summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CREDITS117
-rw-r--r--FS/Changes5
-rw-r--r--FS/FS.pm231
-rw-r--r--FS/FS/CGI.pm350
-rw-r--r--FS/FS/ClientAPI.pm44
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm257
-rw-r--r--FS/FS/ClientAPI/passwd.pm57
-rw-r--r--FS/FS/Conf.pm1059
-rw-r--r--FS/FS/ConfItem.pm63
-rw-r--r--FS/FS/InitHandler.pm91
-rw-r--r--FS/FS/Misc.pm102
-rw-r--r--FS/FS/Msgcat.pm98
-rw-r--r--FS/FS/Record.pm1346
-rw-r--r--FS/FS/SearchCache.pm96
-rw-r--r--FS/FS/UI/Base.pm194
-rw-r--r--FS/FS/UI/CGI.pm239
-rw-r--r--FS/FS/UI/Gtk.pm224
-rw-r--r--FS/FS/UI/agent.pm62
-rw-r--r--FS/FS/UID.pm316
-rwxr-xr-xFS/FS/addr_block.pm330
-rw-r--r--FS/FS/agent.pm160
-rw-r--r--FS/FS/agent_type.pm165
-rw-r--r--FS/FS/cust_bill.pm902
-rw-r--r--FS/FS/cust_bill_event.pm180
-rw-r--r--FS/FS/cust_bill_pay.pm219
-rw-r--r--FS/FS/cust_bill_pkg.pm215
-rw-r--r--FS/FS/cust_bill_pkg_detail.pm123
-rw-r--r--FS/FS/cust_credit.pm260
-rw-r--r--FS/FS/cust_credit_bill.pm162
-rw-r--r--FS/FS/cust_credit_refund.pm205
-rw-r--r--FS/FS/cust_main.pm2559
-rw-r--r--FS/FS/cust_main_county.pm256
-rw-r--r--FS/FS/cust_main_invoice.pm177
-rw-r--r--FS/FS/cust_pay.pm407
-rw-r--r--FS/FS/cust_pay_batch.pm209
-rw-r--r--FS/FS/cust_pkg.pm776
-rw-r--r--FS/FS/cust_refund.pm283
-rw-r--r--FS/FS/cust_svc.pm525
-rw-r--r--FS/FS/cust_tax_exempt.pm131
-rw-r--r--FS/FS/domain_record.pm351
-rw-r--r--FS/FS/export_svc.pm123
-rw-r--r--FS/FS/msgcat.pm132
-rw-r--r--FS/FS/nas.pm152
-rw-r--r--FS/FS/part_bill_event.pm183
-rw-r--r--FS/FS/part_export.pm1045
-rw-r--r--FS/FS/part_export/apache.pm7
-rw-r--r--FS/FS/part_export/bind.pm7
-rw-r--r--FS/FS/part_export/bind_slave.pm7
-rw-r--r--FS/FS/part_export/bsdshell.pm7
-rw-r--r--FS/FS/part_export/cp.pm136
-rw-r--r--FS/FS/part_export/cyrus.pm98
-rw-r--r--FS/FS/part_export/domain_shellcommands.pm109
-rw-r--r--FS/FS/part_export/forward_shellcommands.pm110
-rw-r--r--FS/FS/part_export/http.pm88
-rw-r--r--FS/FS/part_export/infostreet.pm255
-rw-r--r--FS/FS/part_export/ldap.pm253
-rw-r--r--FS/FS/part_export/null.pm13
-rw-r--r--FS/FS/part_export/shellcommands.pm125
-rw-r--r--FS/FS/part_export/shellcommands_withdomain.pm7
-rw-r--r--FS/FS/part_export/sqlmail.pm182
-rw-r--r--FS/FS/part_export/sqlradius.pm282
-rw-r--r--FS/FS/part_export/sqlradius_withdomain.pm12
-rw-r--r--FS/FS/part_export/sysvshell.pm7
-rw-r--r--FS/FS/part_export/textradius.pm166
-rw-r--r--FS/FS/part_export/vpopmail.pm226
-rw-r--r--FS/FS/part_export/www_shellcommands.pm109
-rw-r--r--FS/FS/part_export_option.pm134
-rw-r--r--FS/FS/part_pkg.pm320
-rw-r--r--FS/FS/part_pop_local.pm116
-rw-r--r--FS/FS/part_referral.pm116
-rwxr-xr-xFS/FS/part_router_field.pm134
-rwxr-xr-xFS/FS/part_sb_field.pm267
-rw-r--r--FS/FS/part_svc.pm324
-rw-r--r--FS/FS/part_svc_column.pm118
-rwxr-xr-xFS/FS/part_svc_router.pm32
-rw-r--r--FS/FS/pkg_svc.pm152
-rw-r--r--FS/FS/port.pm160
-rw-r--r--FS/FS/prepay_credit.pm126
-rw-r--r--FS/FS/queue.pm401
-rw-r--r--FS/FS/queue_arg.pm121
-rw-r--r--FS/FS/queue_depend.pm120
-rw-r--r--FS/FS/raddb.pm1106
-rw-r--r--FS/FS/radius_usergroup.pm130
-rwxr-xr-xFS/FS/router.pm156
-rwxr-xr-xFS/FS/router_field.pm146
-rwxr-xr-xFS/FS/sb_field.pm148
-rw-r--r--FS/FS/session.pm269
-rw-r--r--FS/FS/svc_Common.pm381
-rw-r--r--FS/FS/svc_acct.pm1212
-rw-r--r--FS/FS/svc_acct_pop.pm209
-rwxr-xr-xFS/FS/svc_broadband.pm288
-rw-r--r--FS/FS/svc_domain.pm434
-rw-r--r--FS/FS/svc_forward.pm282
-rw-r--r--FS/FS/svc_www.pm276
-rw-r--r--FS/FS/type_pkgs.pm126
-rw-r--r--FS/MANIFEST197
-rw-r--r--FS/MANIFEST.SKIP1
-rw-r--r--FS/Makefile.PL10
-rw-r--r--FS/README6
-rw-r--r--FS/bin/freeside-addoutsource24
-rw-r--r--FS/bin/freeside-addoutsourceuser15
-rw-r--r--FS/bin/freeside-adduser63
-rwxr-xr-xFS/bin/freeside-apply-credits21
-rwxr-xr-xFS/bin/freeside-bill128
-rwxr-xr-xFS/bin/freeside-cc-receipts-report270
-rwxr-xr-xFS/bin/freeside-count-active-customers17
-rwxr-xr-xFS/bin/freeside-credit-report224
-rwxr-xr-xFS/bin/freeside-daily132
-rw-r--r--FS/bin/freeside-deloutsource11
-rw-r--r--FS/bin/freeside-deloutsourceuser6
-rw-r--r--FS/bin/freeside-deluser64
-rwxr-xr-xFS/bin/freeside-email59
-rwxr-xr-xFS/bin/freeside-expiration-alerter226
-rw-r--r--FS/bin/freeside-queued267
-rw-r--r--FS/bin/freeside-radgroup76
-rwxr-xr-xFS/bin/freeside-receivables-report217
-rw-r--r--FS/bin/freeside-reexport62
-rw-r--r--FS/bin/freeside-selfservice-server235
-rw-r--r--FS/bin/freeside-setinvoice42
-rwxr-xr-xFS/bin/freeside-setup1130
-rw-r--r--FS/bin/freeside-sqlradius-radacctd180
-rwxr-xr-xFS/bin/freeside-sqlradius-reset76
-rw-r--r--FS/bin/freeside-sqlradius-seconds58
-rwxr-xr-xFS/bin/freeside-tax-report292
-rw-r--r--FS/t/CGI.t5
-rw-r--r--FS/t/ClientAPI.t5
-rw-r--r--FS/t/Conf.t5
-rw-r--r--FS/t/ConfItem.t5
-rw-r--r--FS/t/InitHandler.t5
-rw-r--r--FS/t/Misc.t5
-rw-r--r--FS/t/Msgcat.t5
-rw-r--r--FS/t/Record.t5
-rw-r--r--FS/t/SearchCache.t5
-rw-r--r--FS/t/UID.t5
-rw-r--r--FS/t/agent.t5
-rw-r--r--FS/t/agent_type.t5
-rw-r--r--FS/t/cust_bill.t5
-rw-r--r--FS/t/cust_bill_event.t5
-rw-r--r--FS/t/cust_bill_pay.t5
-rw-r--r--FS/t/cust_bill_pkg.t5
-rw-r--r--FS/t/cust_bill_pkg_detail.t5
-rw-r--r--FS/t/cust_credit.t5
-rw-r--r--FS/t/cust_credit_bill.t5
-rw-r--r--FS/t/cust_credit_refund.t5
-rw-r--r--FS/t/cust_main.t5
-rw-r--r--FS/t/cust_main_county.t5
-rw-r--r--FS/t/cust_main_invoice.t5
-rw-r--r--FS/t/cust_pay.t5
-rw-r--r--FS/t/cust_pay_batch.t5
-rw-r--r--FS/t/cust_pkg.t5
-rw-r--r--FS/t/cust_refund.t5
-rw-r--r--FS/t/cust_svc.t5
-rw-r--r--FS/t/cust_tax_exempt.pm5
-rw-r--r--FS/t/cust_tax_exempt.t5
-rw-r--r--FS/t/domain_record.t5
-rw-r--r--FS/t/export_svc.t5
-rw-r--r--FS/t/msgcat.t5
-rw-r--r--FS/t/nas.t5
-rw-r--r--FS/t/part_bill_event.t5
-rw-r--r--FS/t/part_export-apache.t5
-rw-r--r--FS/t/part_export-bind.t5
-rw-r--r--FS/t/part_export-bind_slave.t5
-rw-r--r--FS/t/part_export-bsdshell.t5
-rw-r--r--FS/t/part_export-cp.t5
-rw-r--r--FS/t/part_export-cyrus.t5
-rw-r--r--FS/t/part_export-domain_shellcommands.t5
-rw-r--r--FS/t/part_export-forward_shellcommands.t5
-rw-r--r--FS/t/part_export-http.t5
-rw-r--r--FS/t/part_export-infostreet.t5
-rw-r--r--FS/t/part_export-ldap.t5
-rw-r--r--FS/t/part_export-null.t5
-rw-r--r--FS/t/part_export-shellcommands.t5
-rw-r--r--FS/t/part_export-shellcommands_withdomain.t5
-rw-r--r--FS/t/part_export-sqlmail.t5
-rw-r--r--FS/t/part_export-sqlradius.t5
-rw-r--r--FS/t/part_export-sqlradius_withdomain.t5
-rw-r--r--FS/t/part_export-sysvshell.t5
-rw-r--r--FS/t/part_export-textradius.t5
-rw-r--r--FS/t/part_export-vpopmail.t5
-rw-r--r--FS/t/part_export-www_shellcommands.t5
-rw-r--r--FS/t/part_export.t5
-rw-r--r--FS/t/part_export_option.t5
-rw-r--r--FS/t/part_pkg.t5
-rw-r--r--FS/t/part_pop_local.t5
-rw-r--r--FS/t/part_referral.t5
-rw-r--r--FS/t/part_svc.t5
-rw-r--r--FS/t/part_svc_column.t5
-rw-r--r--FS/t/pkg_svc.t5
-rw-r--r--FS/t/port.t5
-rw-r--r--FS/t/prepay_credit.t5
-rw-r--r--FS/t/queue.t5
-rw-r--r--FS/t/queue_arg.t5
-rw-r--r--FS/t/queue_depend.t5
-rw-r--r--FS/t/raddb.t5
-rw-r--r--FS/t/radius_usergroup.t5
-rw-r--r--FS/t/session.t5
-rw-r--r--FS/t/svc_Common.t5
-rw-r--r--FS/t/svc_acct.t5
-rw-r--r--FS/t/svc_acct_pop.t5
-rw-r--r--FS/t/svc_domain.t5
-rw-r--r--FS/t/svc_forward.t5
-rw-r--r--FS/t/svc_www.t5
-rw-r--r--FS/t/type_pkgs.t5
-rw-r--r--GPL339
-rw-r--r--INSTALL1
-rw-r--r--Makefile212
-rw-r--r--README43
-rw-r--r--README.1.5.0pre117
-rw-r--r--TODO9
-rwxr-xr-xbin/apache.export65
-rwxr-xr-xbin/bind.export190
-rwxr-xr-xbin/bind.import192
-rwxr-xr-xbin/bsdshell.export114
-rwxr-xr-xbin/create-history-tables93
-rwxr-xr-xbin/dbdef-create26
-rwxr-xr-xbin/fix-sequences69
-rwxr-xr-xbin/freeside-init60
-rwxr-xr-xbin/freeside-session-kill103
-rwxr-xr-xbin/fs-migrate-part_svc41
-rwxr-xr-xbin/fs-migrate-payref31
-rwxr-xr-xbin/fs-migrate-svc_acct_sm229
-rwxr-xr-xbin/fs-radius-add-check68
-rwxr-xr-xbin/fs-radius-add-reply69
-rwxr-xr-xbin/generate-prepay35
-rwxr-xr-xbin/generate-raddb37
-rwxr-xr-xbin/generate-tests21
-rwxr-xr-xbin/masonize70
-rwxr-xr-xbin/passwd.import120
-rwxr-xr-xbin/pod2x56
-rwxr-xr-xbin/populate-msgcat127
-rwxr-xr-xbin/svc_acct.export641
-rwxr-xr-xbin/svc_acct.import238
-rwxr-xr-xbin/svc_domain.erase17
-rwxr-xr-xbin/sysvshell.export112
-rw-r--r--conf/agent_defaultpkg0
-rw-r--r--conf/alerter_template20
-rw-r--r--conf/declinetemplate10
-rw-r--r--conf/home1
-rw-r--r--conf/invoice_from1
-rw-r--r--conf/invoice_template27
-rw-r--r--conf/locale1
-rw-r--r--conf/lpr1
-rw-r--r--conf/maxsearchrecordsperpage1
-rw-r--r--conf/report_template14
-rw-r--r--conf/shells5
-rw-r--r--conf/show-msgcat-codes0
-rw-r--r--conf/smtpmachine1
-rw-r--r--conf/soadefaultttl1
-rw-r--r--conf/soaexpire1
-rw-r--r--conf/soarefresh1
-rw-r--r--conf/soaretry1
-rw-r--r--debian/README.Debian6
-rw-r--r--debian/changelog9
-rw-r--r--debian/conffiles.ex7
-rw-r--r--debian/control92
-rw-r--r--debian/copyright10
-rw-r--r--debian/cron.d.ex4
-rw-r--r--debian/dirs2
-rw-r--r--debian/docs3
-rw-r--r--debian/ex.doc-base.package22
-rw-r--r--debian/freeside-doc.docs2
-rw-r--r--debian/freeside-doc.files2
-rw-r--r--debian/init.d.ex70
-rw-r--r--debian/manpage.1.ex60
-rw-r--r--debian/manpage.sgml.ex143
-rw-r--r--debian/menu.ex2
-rw-r--r--debian/postinst.ex47
-rw-r--r--debian/postrm.ex36
-rw-r--r--debian/preinst.ex42
-rw-r--r--debian/prerm.ex37
-rwxr-xr-xdebian/rules113
-rw-r--r--debian/watch.ex5
-rwxr-xr-xeg/TEMPLATE_cust_main.import198
-rw-r--r--eg/export_template.pm56
-rw-r--r--eg/table_template-svc.pm161
-rw-r--r--eg/table_template.pm112
-rw-r--r--etc/abbr_state.txt72
-rw-r--r--etc/countries.txt239
-rw-r--r--etc/domain-template.txt231
-rwxr-xr-xetc/megapop.pl116
-rw-r--r--etc/sql-reserved-words.txt103
-rwxr-xr-xfs_passwd/fs_passwd129
-rwxr-xr-xfs_passwd/fs_passwd.cgi57
-rw-r--r--fs_passwd/fs_passwd.html25
-rwxr-xr-xfs_passwd/fs_passwd_server88
-rwxr-xr-xfs_passwd/fs_passwdd62
-rwxr-xr-xfs_radlog/fs_radlogd51
-rwxr-xr-xfs_selfadmin/FS-MailAdminServer/MailAdminClient.pm541
-rwxr-xr-xfs_selfadmin/FS-MailAdminServer/cgi/mailadmin.cgi698
-rwxr-xr-xfs_selfadmin/FS-MailAdminServer/fs_mailadmind366
-rw-r--r--fs_selfadmin/README27
-rwxr-xr-xfs_selfadmin/fs_mailadmin_server642
-rwxr-xr-xfs_selfservice/DEPLOY13
-rw-r--r--fs_selfservice/FS-SelfService/Changes6
-rw-r--r--fs_selfservice/FS-SelfService/MANIFEST6
-rw-r--r--fs_selfservice/FS-SelfService/Makefile.PL15
-rw-r--r--fs_selfservice/FS-SelfService/SelfService.pm115
-rw-r--r--fs_selfservice/FS-SelfService/cgi/login.html32
-rw-r--r--fs_selfservice/FS-SelfService/cgi/make_payment.html120
-rw-r--r--fs_selfservice/FS-SelfService/cgi/myaccount.html47
-rw-r--r--fs_selfservice/FS-SelfService/cgi/passwd.html25
-rw-r--r--fs_selfservice/FS-SelfService/cgi/payment_results.html18
-rw-r--r--fs_selfservice/FS-SelfService/cgi/selfservice.cgi188
-rw-r--r--fs_selfservice/FS-SelfService/cgi/view_invoice.html21
-rw-r--r--fs_selfservice/FS-SelfService/freeside-selfservice-clientd226
-rw-r--r--fs_selfservice/FS-SelfService/test.pl17
-rwxr-xr-xfs_selfservice/fs_passwd_test19
-rw-r--r--fs_sesmon/FS-SessionClient/Changes5
-rw-r--r--fs_sesmon/FS-SessionClient/MANIFEST11
-rw-r--r--fs_sesmon/FS-SessionClient/MANIFEST.SKIP1
-rw-r--r--fs_sesmon/FS-SessionClient/Makefile.PL10
-rw-r--r--fs_sesmon/FS-SessionClient/SessionClient.pm122
-rw-r--r--fs_sesmon/FS-SessionClient/bin/freeside-login36
-rw-r--r--fs_sesmon/FS-SessionClient/bin/freeside-logout36
-rw-r--r--fs_sesmon/FS-SessionClient/cgi/login.cgi108
-rw-r--r--fs_sesmon/FS-SessionClient/cgi/logout.cgi83
-rw-r--r--fs_sesmon/FS-SessionClient/fs_sessiond65
-rw-r--r--fs_sesmon/FS-SessionClient/test.pl21
-rw-r--r--fs_sesmon/fs_session_server140
-rw-r--r--fs_signup/FS-SignupClient/Changes5
-rw-r--r--fs_signup/FS-SignupClient/MANIFEST8
-rw-r--r--fs_signup/FS-SignupClient/MANIFEST.SKIP1
-rw-r--r--fs_signup/FS-SignupClient/Makefile.PL18
-rw-r--r--fs_signup/FS-SignupClient/SignupClient.pm189
-rw-r--r--fs_signup/FS-SignupClient/cgi/decline.html5
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup-alternate.html218
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.cgi664
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.html184
-rw-r--r--fs_signup/FS-SignupClient/cgi/stateselect.html80
-rw-r--r--fs_signup/FS-SignupClient/cgi/success.html11
-rwxr-xr-xfs_signup/FS-SignupClient/fs_signupd86
-rw-r--r--fs_signup/FS-SignupClient/test.pl20
-rw-r--r--fs_signup/cck.template14
-rwxr-xr-xfs_signup/fs_signup_server289
-rwxr-xr-xfs_signup/ieak.template40
-rwxr-xr-xfs_webdemo/register.cgi136
-rw-r--r--fs_webdemo/register.html33
-rwxr-xr-xfs_webdemo/registerd192
-rwxr-xr-xfs_webdemo/registerd.Pg221
-rw-r--r--htetc/global.asa193
-rw-r--r--htetc/handler.pl166
-rw-r--r--htetc/handler.pl-1.0x161
-rwxr-xr-xhttemplate/.htaccess3
-rw-r--r--httemplate/browse/addr_block.cgi76
-rwxr-xr-xhttemplate/browse/agent.cgi63
-rwxr-xr-xhttemplate/browse/agent_type.cgi58
-rwxr-xr-xhttemplate/browse/cust_main_county.cgi136
-rwxr-xr-xhttemplate/browse/cust_pay_batch.cgi52
-rw-r--r--httemplate/browse/generic.cgi46
-rwxr-xr-xhttemplate/browse/msgcat.cgi50
-rwxr-xr-xhttemplate/browse/nas.cgi80
-rwxr-xr-xhttemplate/browse/part_bill_event.cgi71
-rwxr-xr-xhttemplate/browse/part_export.cgi39
-rwxr-xr-xhttemplate/browse/part_pkg.cgi144
-rwxr-xr-xhttemplate/browse/part_referral.cgi38
-rw-r--r--httemplate/browse/part_sb_field.cgi31
-rwxr-xr-xhttemplate/browse/part_svc.cgi109
-rwxr-xr-xhttemplate/browse/queue.cgi7
-rw-r--r--httemplate/browse/router.cgi37
-rwxr-xr-xhttemplate/browse/svc_acct_pop.cgi49
-rw-r--r--httemplate/config/config-process.cgi51
-rw-r--r--httemplate/config/config-view.cgi64
-rw-r--r--httemplate/config/config.cgi176
-rwxr-xr-xhttemplate/docs/admin.html81
-rw-r--r--httemplate/docs/billing.html54
-rw-r--r--httemplate/docs/config.html36
-rwxr-xr-xhttemplate/docs/export.html55
-rw-r--r--httemplate/docs/index.html29
-rw-r--r--httemplate/docs/install.html206
-rwxr-xr-xhttemplate/docs/legacy.html39
-rw-r--r--httemplate/docs/man/FS/part_export/.cvs_is_on_crack0
-rw-r--r--httemplate/docs/overview.diabin0 -> 2800 bytes
-rw-r--r--httemplate/docs/overview.pngbin0 -> 13064 bytes
-rwxr-xr-xhttemplate/docs/passwd.html23
-rw-r--r--httemplate/docs/schema.diabin0 -> 14438 bytes
-rw-r--r--httemplate/docs/schema.html427
-rw-r--r--httemplate/docs/schema.pngbin0 -> 681043 bytes
-rw-r--r--httemplate/docs/session.html59
-rw-r--r--httemplate/docs/signup.html56
-rwxr-xr-xhttemplate/docs/ssh.html16
-rwxr-xr-xhttemplate/docs/trouble.html26
-rw-r--r--httemplate/docs/upgrade10.html120
-rw-r--r--httemplate/docs/upgrade7.html24
-rw-r--r--httemplate/docs/upgrade8.html392
-rw-r--r--httemplate/docs/upgrade9.html26
-rwxr-xr-xhttemplate/edit/REAL_cust_pkg.cgi97
-rwxr-xr-xhttemplate/edit/agent.cgi74
-rwxr-xr-xhttemplate/edit/agent_type.cgi63
-rwxr-xr-xhttemplate/edit/cust_bill_pay.cgi95
-rwxr-xr-xhttemplate/edit/cust_credit.cgi63
-rwxr-xr-xhttemplate/edit/cust_credit_bill.cgi101
-rwxr-xr-xhttemplate/edit/cust_main.cgi523
-rwxr-xr-xhttemplate/edit/cust_main_county-expand.cgi54
-rwxr-xr-xhttemplate/edit/cust_main_county.cgi69
-rwxr-xr-xhttemplate/edit/cust_pay.cgi129
-rwxr-xr-xhttemplate/edit/cust_pkg.cgi117
-rwxr-xr-xhttemplate/edit/msgcat.cgi58
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi222
-rw-r--r--httemplate/edit/part_export.cgi125
-rwxr-xr-xhttemplate/edit/part_pkg.cgi508
-rwxr-xr-xhttemplate/edit/part_referral.cgi48
-rw-r--r--httemplate/edit/part_router_field.cgi71
-rw-r--r--httemplate/edit/part_sb_field.cgi79
-rwxr-xr-xhttemplate/edit/part_svc.cgi249
-rwxr-xr-xhttemplate/edit/process/REAL_cust_pkg.cgi22
-rwxr-xr-xhttemplate/edit/process/addr_block/add.cgi20
-rwxr-xr-xhttemplate/edit/process/addr_block/allocate.cgi25
-rwxr-xr-xhttemplate/edit/process/addr_block/deallocate.cgi24
-rwxr-xr-xhttemplate/edit/process/addr_block/split.cgi19
-rwxr-xr-xhttemplate/edit/process/agent.cgi28
-rwxr-xr-xhttemplate/edit/process/agent_type.cgi55
-rwxr-xr-xhttemplate/edit/process/cust_bill_pay.cgi31
-rwxr-xr-xhttemplate/edit/process/cust_credit.cgi30
-rwxr-xr-xhttemplate/edit/process/cust_credit_bill.cgi43
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi125
-rwxr-xr-xhttemplate/edit/process/cust_main_county-collapse.cgi35
-rwxr-xr-xhttemplate/edit/process/cust_main_county-expand.cgi58
-rwxr-xr-xhttemplate/edit/process/cust_main_county.cgi26
-rwxr-xr-xhttemplate/edit/process/cust_pay.cgi39
-rwxr-xr-xhttemplate/edit/process/cust_pkg.cgi43
-rwxr-xr-xhttemplate/edit/process/domain_record.cgi34
-rw-r--r--httemplate/edit/process/generic.cgi70
-rw-r--r--httemplate/edit/process/msgcat.cgi20
-rwxr-xr-xhttemplate/edit/process/part_bill_event.cgi53
-rw-r--r--httemplate/edit/process/part_export.cgi39
-rwxr-xr-xhttemplate/edit/process/part_pkg.cgi109
-rwxr-xr-xhttemplate/edit/process/part_referral.cgi28
-rwxr-xr-xhttemplate/edit/process/part_svc.cgi62
-rw-r--r--httemplate/edit/process/quick-charge.cgi32
-rw-r--r--httemplate/edit/process/quick-cust_pkg.cgi24
-rw-r--r--httemplate/edit/process/router.cgi101
-rwxr-xr-xhttemplate/edit/process/svc_acct.cgi49
-rwxr-xr-xhttemplate/edit/process/svc_acct_pop.cgi28
-rw-r--r--httemplate/edit/process/svc_broadband.cgi79
-rwxr-xr-xhttemplate/edit/process/svc_domain.cgi31
-rwxr-xr-xhttemplate/edit/process/svc_forward.cgi29
-rw-r--r--httemplate/edit/process/svc_www.cgi36
-rwxr-xr-xhttemplate/edit/router.cgi92
-rwxr-xr-xhttemplate/edit/svc_acct.cgi293
-rwxr-xr-xhttemplate/edit/svc_acct_pop.cgi56
-rw-r--r--httemplate/edit/svc_broadband.cgi192
-rwxr-xr-xhttemplate/edit/svc_domain.cgi98
-rwxr-xr-xhttemplate/edit/svc_forward.cgi175
-rw-r--r--httemplate/edit/svc_www.cgi178
-rwxr-xr-xhttemplate/graph/money_time-graph.cgi108
-rw-r--r--httemplate/graph/money_time.cgi59
-rw-r--r--httemplate/images/mid-logo.pngbin0 -> 9727 bytes
-rw-r--r--httemplate/images/small-logo.pngbin0 -> 4781 bytes
-rw-r--r--httemplate/index.html223
-rwxr-xr-xhttemplate/misc/bill.cgi38
-rwxr-xr-xhttemplate/misc/cancel-unaudited.cgi31
-rwxr-xr-xhttemplate/misc/cancel_pkg.cgi15
-rwxr-xr-xhttemplate/misc/catchall.cgi133
-rwxr-xr-xhttemplate/misc/change_pkg.cgi66
-rwxr-xr-xhttemplate/misc/cust_main-cancel.cgi16
-rw-r--r--httemplate/misc/cust_main-import.cgi51
-rw-r--r--httemplate/misc/cust_main-import_charges.cgi14
-rwxr-xr-xhttemplate/misc/delete-cust_pay.cgi16
-rwxr-xr-xhttemplate/misc/delete-customer.cgi60
-rwxr-xr-xhttemplate/misc/delete-domain_record.cgi15
-rwxr-xr-xhttemplate/misc/delete-part_export.cgi15
-rwxr-xr-xhttemplate/misc/expire_pkg.cgi25
-rwxr-xr-xhttemplate/misc/link.cgi45
-rw-r--r--httemplate/misc/meta-import.cgi64
-rwxr-xr-xhttemplate/misc/print-invoice.cgi23
-rwxr-xr-xhttemplate/misc/process/catchall.cgi33
-rw-r--r--httemplate/misc/process/cust_main-import.cgi30
-rw-r--r--httemplate/misc/process/cust_main-import_charges.cgi26
-rwxr-xr-xhttemplate/misc/process/delete-customer.cgi29
-rwxr-xr-xhttemplate/misc/process/link.cgi43
-rw-r--r--httemplate/misc/process/meta-import.cgi178
-rw-r--r--httemplate/misc/queue.cgi47
-rwxr-xr-xhttemplate/misc/susp_pkg.cgi15
-rwxr-xr-xhttemplate/misc/unapply-cust_pay.cgi18
-rwxr-xr-xhttemplate/misc/unprovision.cgi33
-rwxr-xr-xhttemplate/misc/unsusp_pkg.cgi15
-rwxr-xr-xhttemplate/search/cust_bill.cgi165
-rwxr-xr-xhttemplate/search/cust_bill.html19
-rw-r--r--httemplate/search/cust_bill_event.cgi62
-rwxr-xr-xhttemplate/search/cust_bill_event.html23
-rwxr-xr-xhttemplate/search/cust_main-otaker.cgi29
-rwxr-xr-xhttemplate/search/cust_main-payinfo.html20
-rwxr-xr-xhttemplate/search/cust_main-quickpay.html43
-rwxr-xr-xhttemplate/search/cust_main.cgi668
-rwxr-xr-xhttemplate/search/cust_main.html42
-rwxr-xr-xhttemplate/search/cust_pay.cgi151
-rwxr-xr-xhttemplate/search/cust_pay.html18
-rwxr-xr-xhttemplate/search/cust_pkg.cgi350
-rwxr-xr-xhttemplate/search/cust_pkg.html24
-rwxr-xr-xhttemplate/search/report_cc.cgi25
-rwxr-xr-xhttemplate/search/report_cc.html23
-rwxr-xr-xhttemplate/search/report_credit.cgi25
-rwxr-xr-xhttemplate/search/report_credit.html23
-rw-r--r--httemplate/search/report_cust_pay.html24
-rwxr-xr-xhttemplate/search/report_receivables.cgi19
-rwxr-xr-xhttemplate/search/report_tax.cgi25
-rwxr-xr-xhttemplate/search/report_tax.html23
-rwxr-xr-xhttemplate/search/sql.cgi76
-rwxr-xr-xhttemplate/search/svc_acct.cgi277
-rwxr-xr-xhttemplate/search/svc_acct.html19
-rwxr-xr-xhttemplate/search/svc_domain.cgi154
-rwxr-xr-xhttemplate/search/svc_domain.html19
-rwxr-xr-xhttemplate/view/cust_bill.cgi48
-rwxr-xr-xhttemplate/view/cust_main.cgi923
-rwxr-xr-xhttemplate/view/cust_pkg.cgi164
-rwxr-xr-xhttemplate/view/svc_acct.cgi203
-rw-r--r--httemplate/view/svc_broadband.cgi91
-rwxr-xr-xhttemplate/view/svc_domain.cgi106
-rwxr-xr-xhttemplate/view/svc_forward.cgi69
-rw-r--r--httemplate/view/svc_www.cgi55
-rw-r--r--init.d/freeside-init70
-rwxr-xr-xinstall/freebsd/INSTALL40
-rw-r--r--install/freebsd/ports43
-rw-r--r--install/redhat/7.3/INSTALL14
-rw-r--r--install/redhat/7.3/sources.list2
-rw-r--r--rt/ChangeLog16016
-rw-r--r--rt/Makefile517
-rwxr-xr-xrt/README402
-rwxr-xr-xrt/TODO9
-rw-r--r--rt/bin/initacls.Oracle26
-rwxr-xr-xrt/bin/initacls.Pg28
-rwxr-xr-xrt/bin/initacls.mysql20
-rwxr-xr-xrt/bin/mason_handler.fcgi255
-rwxr-xr-xrt/bin/mason_handler.scgi218
-rwxr-xr-xrt/bin/rt-mailgate842
-rw-r--r--rt/bin/rtadmin1040
-rwxr-xr-xrt/bin/webmux.pl248
-rw-r--r--rt/docs/design_docs/acls228
-rw-r--r--rt/docs/design_docs/basic-definitions.txt54
-rw-r--r--rt/docs/design_docs/cli_spec361
-rw-r--r--rt/docs/design_docs/evil_plans9
-rw-r--r--rt/docs/design_docs/local_hacking32
-rwxr-xr-xrt/docs/rt.gifbin0 -> 8811 bytes
-rw-r--r--rt/etc/acl.Oracle19
-rwxr-xr-xrt/etc/acl.Pg96
-rwxr-xr-xrt/etc/acl.mysql12
-rwxr-xr-xrt/etc/config.pm473
-rwxr-xr-xrt/etc/schema.Pg747
-rwxr-xr-xrt/etc/schema.mysql429
-rw-r--r--rt/etc/schema.pm349
-rw-r--r--rt/lib/MANIFEST57
-rw-r--r--rt/lib/MANIFEST.SKIP1
-rw-r--r--rt/lib/Makefile.PL49
-rw-r--r--rt/lib/RT.pm191
-rwxr-xr-xrt/lib/RT/ACE.pm806
-rwxr-xr-xrt/lib/RT/ACL.pm329
-rwxr-xr-xrt/lib/RT/Action/Autoreply.pm40
-rwxr-xr-xrt/lib/RT/Action/Generic.pm56
-rwxr-xr-xrt/lib/RT/Action/Notify.pm83
-rwxr-xr-xrt/lib/RT/Action/NotifyAsComment.pm34
-rw-r--r--rt/lib/RT/Action/OpenDependent.pm55
-rw-r--r--rt/lib/RT/Action/ResolveMembers.pm35
-rwxr-xr-xrt/lib/RT/Action/SendEmail.pm699
-rwxr-xr-xrt/lib/RT/Action/SendPasswordEmail.pm170
-rw-r--r--rt/lib/RT/Action/StallDependent.pm68
-rwxr-xr-xrt/lib/RT/Attachment.pm601
-rwxr-xr-xrt/lib/RT/Attachments.pm136
-rw-r--r--rt/lib/RT/Condition/AnyTransaction.pm34
-rwxr-xr-xrt/lib/RT/Condition/Generic.pm55
-rw-r--r--rt/lib/RT/Condition/NewDependency.pm0
-rw-r--r--rt/lib/RT/Condition/StatusChange.pm35
-rwxr-xr-xrt/lib/RT/CurrentUser.pm166
-rw-r--r--rt/lib/RT/Date.pm335
-rwxr-xr-xrt/lib/RT/EasySearch.pm115
-rwxr-xr-xrt/lib/RT/Group.pm430
-rwxr-xr-xrt/lib/RT/GroupMember.pm231
-rwxr-xr-xrt/lib/RT/GroupMembers.pm124
-rwxr-xr-xrt/lib/RT/Groups.pm135
-rw-r--r--rt/lib/RT/Handle.pm62
-rw-r--r--rt/lib/RT/Interface/CLI.pm112
-rwxr-xr-xrt/lib/RT/Interface/Email.pm683
-rw-r--r--rt/lib/RT/Interface/Web.pm1124
-rw-r--r--rt/lib/RT/Keyword.pm446
-rw-r--r--rt/lib/RT/KeywordSelect.pm452
-rw-r--r--rt/lib/RT/KeywordSelects.pm143
-rw-r--r--rt/lib/RT/Keywords.pm106
-rw-r--r--rt/lib/RT/Link.pm487
-rw-r--r--rt/lib/RT/Links.pm153
-rw-r--r--rt/lib/RT/ObjectKeyword.pm192
-rw-r--r--rt/lib/RT/ObjectKeywords.pm234
-rwxr-xr-xrt/lib/RT/Queue.pm961
-rwxr-xr-xrt/lib/RT/Queues.pm162
-rwxr-xr-xrt/lib/RT/Record.pm400
-rwxr-xr-xrt/lib/RT/Scrip.pm654
-rwxr-xr-xrt/lib/RT/ScripAction.pm385
-rwxr-xr-xrt/lib/RT/ScripActions.pm137
-rwxr-xr-xrt/lib/RT/ScripCondition.pm366
-rwxr-xr-xrt/lib/RT/ScripConditions.pm142
-rwxr-xr-xrt/lib/RT/Scrips.pm162
-rwxr-xr-xrt/lib/RT/Template.pm512
-rwxr-xr-xrt/lib/RT/Templates.pm143
-rw-r--r--rt/lib/RT/TestHarness.pm14
-rwxr-xr-xrt/lib/RT/Ticket.pm3026
-rwxr-xr-xrt/lib/RT/Tickets.pm1806
-rwxr-xr-xrt/lib/RT/Transaction.pm895
-rwxr-xr-xrt/lib/RT/Transactions.pm129
-rwxr-xr-xrt/lib/RT/User.pm1696
-rwxr-xr-xrt/lib/RT/Users.pm298
-rwxr-xr-xrt/lib/RT/Watcher.pm313
-rwxr-xr-xrt/lib/RT/Watchers.pm226
-rw-r--r--rt/lib/test.pl52
-rw-r--r--rt/tools/cpan2rpm299
-rw-r--r--rt/tools/initdb216
-rwxr-xr-xrt/tools/insertdata618
-rw-r--r--rt/tools/testdeps115
-rwxr-xr-xrt/webrt/Admin/Elements/CreateQueueCalled3
-rwxr-xr-xrt/webrt/Admin/Elements/CreateUserCalled3
-rwxr-xr-xrt/webrt/Admin/Elements/EditUserComments9
-rwxr-xr-xrt/webrt/Admin/Elements/GrantQueueRightsTo30
-rwxr-xr-xrt/webrt/Admin/Elements/GroupTabs18
-rwxr-xr-xrt/webrt/Admin/Elements/Header5
-rw-r--r--rt/webrt/Admin/Elements/ListGlobalKeywordSelects15
-rwxr-xr-xrt/webrt/Admin/Elements/ListGlobalScrips10
-rw-r--r--rt/webrt/Admin/Elements/ModifyKeyword95
-rw-r--r--rt/webrt/Admin/Elements/ModifyKeywordSelect120
-rwxr-xr-xrt/webrt/Admin/Elements/ModifyQueue56
-rwxr-xr-xrt/webrt/Admin/Elements/ModifyTemplate78
-rwxr-xr-xrt/webrt/Admin/Elements/ModifyUser77
-rw-r--r--rt/webrt/Admin/Elements/QueueRightsForUser17
-rwxr-xr-xrt/webrt/Admin/Elements/QueueTabs36
-rw-r--r--rt/webrt/Admin/Elements/SelectKeywordSelect22
-rw-r--r--rt/webrt/Admin/Elements/SelectModifyGroup10
-rw-r--r--rt/webrt/Admin/Elements/SelectModifyKeyword13
-rw-r--r--rt/webrt/Admin/Elements/SelectModifyKeywordSelect13
-rwxr-xr-xrt/webrt/Admin/Elements/SelectModifyQueue10
-rwxr-xr-xrt/webrt/Admin/Elements/SelectModifyUser26
-rwxr-xr-xrt/webrt/Admin/Elements/SelectQueueRights29
-rw-r--r--rt/webrt/Admin/Elements/SelectRights58
-rwxr-xr-xrt/webrt/Admin/Elements/SelectScrip25
-rw-r--r--rt/webrt/Admin/Elements/SelectScripAction25
-rw-r--r--rt/webrt/Admin/Elements/SelectScripCondition25
-rw-r--r--rt/webrt/Admin/Elements/SelectSingleOrMultiple20
-rwxr-xr-xrt/webrt/Admin/Elements/SelectTemplate37
-rw-r--r--rt/webrt/Admin/Elements/SelectUsers17
-rwxr-xr-xrt/webrt/Admin/Elements/SystemTabs31
-rwxr-xr-xrt/webrt/Admin/Elements/Tabs31
-rwxr-xr-xrt/webrt/Admin/Elements/UserTabs21
-rwxr-xr-xrt/webrt/Admin/Global/GroupRights.html78
-rw-r--r--rt/webrt/Admin/Global/Keywords.html97
-rwxr-xr-xrt/webrt/Admin/Global/Scrips.html95
-rwxr-xr-xrt/webrt/Admin/Global/Template.html66
-rwxr-xr-xrt/webrt/Admin/Global/Templates.html24
-rwxr-xr-xrt/webrt/Admin/Global/UserRights.html42
-rwxr-xr-xrt/webrt/Admin/Global/index.html2
-rw-r--r--rt/webrt/Admin/Groups/Members.html76
-rw-r--r--rt/webrt/Admin/Groups/Modify.html83
-rw-r--r--rt/webrt/Admin/Groups/Rights.html1
-rw-r--r--rt/webrt/Admin/Groups/index.html33
-rw-r--r--rt/webrt/Admin/KeywordSelects/Modify.html17
-rw-r--r--rt/webrt/Admin/KeywordSelects/index.html137
-rw-r--r--rt/webrt/Admin/Keywords/Modify.html96
-rw-r--r--rt/webrt/Admin/Keywords/index.html110
-rwxr-xr-xrt/webrt/Admin/Queues/Create.html13
-rwxr-xr-xrt/webrt/Admin/Queues/GroupRights.html103
-rw-r--r--rt/webrt/Admin/Queues/Keywords.html114
-rwxr-xr-xrt/webrt/Admin/Queues/Modify.html137
-rwxr-xr-xrt/webrt/Admin/Queues/People.html161
-rwxr-xr-xrt/webrt/Admin/Queues/Scrips.html111
-rwxr-xr-xrt/webrt/Admin/Queues/Template.html68
-rwxr-xr-xrt/webrt/Admin/Queues/Templates.html24
-rwxr-xr-xrt/webrt/Admin/Queues/UserRights.html72
-rwxr-xr-xrt/webrt/Admin/Queues/index.html52
-rwxr-xr-xrt/webrt/Admin/Users/Modify.html259
-rwxr-xr-xrt/webrt/Admin/Users/Prefs.html97
-rw-r--r--rt/webrt/Admin/Users/Rights.html1
-rwxr-xr-xrt/webrt/Admin/Users/index.html71
-rwxr-xr-xrt/webrt/Admin/index.html4
-rwxr-xr-xrt/webrt/Elements/Checkbox17
-rw-r--r--rt/webrt/Elements/CreateTicket1
-rw-r--r--rt/webrt/Elements/CustomHomepageHeader0
-rwxr-xr-xrt/webrt/Elements/Error23
-rwxr-xr-xrt/webrt/Elements/Footer10
-rw-r--r--rt/webrt/Elements/GotoTicket1
-rwxr-xr-xrt/webrt/Elements/Header61
-rwxr-xr-xrt/webrt/Elements/ListActions14
-rwxr-xr-xrt/webrt/Elements/Login69
-rw-r--r--rt/webrt/Elements/MessageBox30
-rw-r--r--rt/webrt/Elements/MyRequests45
-rw-r--r--rt/webrt/Elements/MyTickets43
-rw-r--r--rt/webrt/Elements/Quicksearch41
-rw-r--r--rt/webrt/Elements/Refresh22
-rwxr-xr-xrt/webrt/Elements/Section11
-rwxr-xr-xrt/webrt/Elements/SelectBoolean24
-rwxr-xr-xrt/webrt/Elements/SelectDate25
-rwxr-xr-xrt/webrt/Elements/SelectDateRelation14
-rwxr-xr-xrt/webrt/Elements/SelectDateType12
-rwxr-xr-xrt/webrt/Elements/SelectEqualityOperator18
-rw-r--r--rt/webrt/Elements/SelectKeyword38
-rw-r--r--rt/webrt/Elements/SelectKeywordOptions18
-rw-r--r--rt/webrt/Elements/SelectLinkType16
-rw-r--r--rt/webrt/Elements/SelectMatch31
-rwxr-xr-xrt/webrt/Elements/SelectNewTicketQueue9
-rwxr-xr-xrt/webrt/Elements/SelectOwner22
-rwxr-xr-xrt/webrt/Elements/SelectQueue38
-rw-r--r--rt/webrt/Elements/SelectResultsPerPage22
-rw-r--r--rt/webrt/Elements/SelectSortOrder18
-rwxr-xr-xrt/webrt/Elements/SelectStatus17
-rw-r--r--rt/webrt/Elements/SelectTicketSortBy15
-rwxr-xr-xrt/webrt/Elements/SelectUsers8
-rw-r--r--rt/webrt/Elements/SelectWatcherType26
-rwxr-xr-xrt/webrt/Elements/ShadedBox5
-rwxr-xr-xrt/webrt/Elements/Submit44
-rwxr-xr-xrt/webrt/Elements/Tabs133
-rwxr-xr-xrt/webrt/Elements/TitleBoxEnd10
-rwxr-xr-xrt/webrt/Elements/TitleBoxStart20
-rw-r--r--rt/webrt/Elements/ViewUser29
-rwxr-xr-xrt/webrt/Elements/dayMenu19
-rwxr-xr-xrt/webrt/Elements/monthMenu37
-rwxr-xr-xrt/webrt/Elements/yearMenu24
-rwxr-xr-xrt/webrt/NoAuth/Logout.html22
-rwxr-xr-xrt/webrt/NoAuth/Reminder.html3
-rw-r--r--rt/webrt/NoAuth/images/rt.jpgbin0 -> 917 bytes
-rw-r--r--rt/webrt/NoAuth/images/spacer.gifbin0 -> 43 bytes
-rwxr-xr-xrt/webrt/NoAuth/webrt.css102
-rwxr-xr-xrt/webrt/Search/Bulk.html186
-rwxr-xr-xrt/webrt/Search/Listing.html134
-rwxr-xr-xrt/webrt/Search/PickRestriction112
-rwxr-xr-xrt/webrt/Search/RestrictSearch.html3
-rw-r--r--rt/webrt/Search/TicketCell28
-rw-r--r--rt/webrt/SelfService/Attachment/dhandler27
-rw-r--r--rt/webrt/SelfService/Closed.html4
-rwxr-xr-xrt/webrt/SelfService/Create.html63
-rwxr-xr-xrt/webrt/SelfService/Display.html190
-rwxr-xr-xrt/webrt/SelfService/Elements/GotoTicket1
-rwxr-xr-xrt/webrt/SelfService/Elements/Header55
-rw-r--r--rt/webrt/SelfService/Elements/MyRequests41
-rw-r--r--rt/webrt/SelfService/Elements/Tabs49
-rwxr-xr-xrt/webrt/SelfService/Error.html22
-rwxr-xr-xrt/webrt/SelfService/Prefs.html51
-rwxr-xr-xrt/webrt/SelfService/Update.html40
-rw-r--r--rt/webrt/SelfService/index.html3
-rw-r--r--rt/webrt/Ticket/Attachment/dhandler27
-rwxr-xr-xrt/webrt/Ticket/Create.html199
-rwxr-xr-xrt/webrt/Ticket/Display.html152
-rwxr-xr-xrt/webrt/Ticket/Elements/AddWatchers54
-rwxr-xr-xrt/webrt/Ticket/Elements/EditBasics62
-rwxr-xr-xrt/webrt/Ticket/Elements/EditDates46
-rw-r--r--rt/webrt/Ticket/Elements/EditKeywordSelects45
-rwxr-xr-xrt/webrt/Ticket/Elements/EditLinks109
-rwxr-xr-xrt/webrt/Ticket/Elements/EditPeople37
-rwxr-xr-xrt/webrt/Ticket/Elements/EditWatchers46
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowBasics29
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowDates54
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowDependencies18
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowHistory43
-rw-r--r--rt/webrt/Ticket/Elements/ShowKeywordSelects26
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowLinks61
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowMemberOf12
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowMembers22
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowPeople12
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowReferences27
-rw-r--r--rt/webrt/Ticket/Elements/ShowRequestor35
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowSummary61
-rwxr-xr-xrt/webrt/Ticket/Elements/ShowTransaction162
-rwxr-xr-xrt/webrt/Ticket/Elements/Tabs126
-rwxr-xr-xrt/webrt/Ticket/Elements/ToolBar3
-rwxr-xr-xrt/webrt/Ticket/History.html30
-rwxr-xr-xrt/webrt/Ticket/Modify.html39
-rwxr-xr-xrt/webrt/Ticket/ModifyAll.html124
-rwxr-xr-xrt/webrt/Ticket/ModifyDates.html26
-rwxr-xr-xrt/webrt/Ticket/ModifyLinks.html31
-rwxr-xr-xrt/webrt/Ticket/ModifyPeople.html38
-rwxr-xr-xrt/webrt/Ticket/Update.html110
-rwxr-xr-xrt/webrt/User/Prefs.html53
-rwxr-xr-xrt/webrt/autohandler73
-rw-r--r--rt/webrt/index.html25
-rw-r--r--sql-ledger/SL/AM.pm694
-rw-r--r--sql-ledger/SL/AP.pm381
-rw-r--r--sql-ledger/SL/AR.pm381
-rw-r--r--sql-ledger/SL/CA.pm262
-rw-r--r--sql-ledger/SL/CP.pm308
-rw-r--r--sql-ledger/SL/CT.pm447
-rw-r--r--sql-ledger/SL/Form.pm1397
-rw-r--r--sql-ledger/SL/GL.pm462
-rw-r--r--sql-ledger/SL/IC.pm936
-rw-r--r--sql-ledger/SL/IR.pm995
-rw-r--r--sql-ledger/SL/IS.pm1231
-rw-r--r--sql-ledger/SL/Inifile.pm87
-rw-r--r--sql-ledger/SL/Mailer.pm147
-rw-r--r--sql-ledger/SL/Menu.pm117
-rw-r--r--sql-ledger/SL/Num2text.pm162
-rw-r--r--sql-ledger/SL/OE.pm674
-rw-r--r--sql-ledger/SL/PE.pm276
-rw-r--r--sql-ledger/SL/RC.pm186
-rw-r--r--sql-ledger/SL/RP.pm1310
-rw-r--r--sql-ledger/SL/User.pm692
-rw-r--r--sql-ledger/VERSION1
-rwxr-xr-xsql-ledger/am.pl126
-rw-r--r--sql-ledger/bin/lynx/menu.pl128
-rw-r--r--sql-ledger/bin/mozilla/admin.pl1504
-rw-r--r--sql-ledger/bin/mozilla/am.pl1051
-rw-r--r--sql-ledger/bin/mozilla/ap.pl1103
-rw-r--r--sql-ledger/bin/mozilla/ar.pl1135
-rw-r--r--sql-ledger/bin/mozilla/arap.pl406
-rw-r--r--sql-ledger/bin/mozilla/ca.pl413
-rw-r--r--sql-ledger/bin/mozilla/cp.pl528
-rw-r--r--sql-ledger/bin/mozilla/ct.pl631
-rw-r--r--sql-ledger/bin/mozilla/gl.pl806
-rw-r--r--sql-ledger/bin/mozilla/ic.pl1638
-rw-r--r--sql-ledger/bin/mozilla/io.pl1149
-rw-r--r--sql-ledger/bin/mozilla/ir.pl653
-rw-r--r--sql-ledger/bin/mozilla/is.pl739
-rw-r--r--sql-ledger/bin/mozilla/login.pl217
-rw-r--r--sql-ledger/bin/mozilla/menu.pl160
-rw-r--r--sql-ledger/bin/mozilla/oe.pl1111
-rw-r--r--sql-ledger/bin/mozilla/pe.pl549
-rw-r--r--sql-ledger/bin/mozilla/rc.pl371
-rw-r--r--sql-ledger/bin/mozilla/rp.pl1730
-rw-r--r--sql-ledger/css/sql-ledger.css113
-rw-r--r--sql-ledger/doc/COPYING355
-rw-r--r--sql-ledger/doc/README287
-rw-r--r--sql-ledger/doc/UPGRADE-1.6-1.861
-rw-r--r--sql-ledger/doc/UPGRADE-1.8-1.8.323
-rw-r--r--sql-ledger/doc/UPGRADE-1.8.3-1.8.410
-rw-r--r--sql-ledger/doc/UPGRADE-1.8.4-1.8.518
-rw-r--r--sql-ledger/doc/UPGRADE-1.8.5-1.8.76
-rw-r--r--sql-ledger/doc/UPGRADE-1.8.7-2.0.020
-rw-r--r--sql-ledger/doc/UPGRADE-2.0-2.0.88
-rw-r--r--sql-ledger/doc/copyright23
-rw-r--r--sql-ledger/doc/faq.html747
-rw-r--r--sql-ledger/favicon.icobin0 -> 3638 bytes
-rw-r--r--sql-ledger/locale/br/COPYING24
-rw-r--r--sql-ledger/locale/br/LANGUAGE1
-rw-r--r--sql-ledger/locale/br/admin122
-rw-r--r--sql-ledger/locale/br/all487
-rw-r--r--sql-ledger/locale/br/am139
-rw-r--r--sql-ledger/locale/br/ap133
-rw-r--r--sql-ledger/locale/br/ar133
-rw-r--r--sql-ledger/locale/br/arap30
-rw-r--r--sql-ledger/locale/br/ca50
-rw-r--r--sql-ledger/locale/br/cp75
-rw-r--r--sql-ledger/locale/br/ct69
-rw-r--r--sql-ledger/locale/br/gl124
-rw-r--r--sql-ledger/locale/br/ic205
-rw-r--r--sql-ledger/locale/br/io106
-rw-r--r--sql-ledger/locale/br/ir178
-rw-r--r--sql-ledger/locale/br/is185
-rw-r--r--sql-ledger/locale/br/login28
-rw-r--r--sql-ledger/locale/br/menu72
-rw-r--r--sql-ledger/locale/br/oe199
-rw-r--r--sql-ledger/locale/br/pe35
-rw-r--r--sql-ledger/locale/br/rc37
-rw-r--r--sql-ledger/locale/br/rp117
-rw-r--r--sql-ledger/locale/cn/COPYING24
-rw-r--r--sql-ledger/locale/cn/LANGUAGE1
-rw-r--r--sql-ledger/locale/cn/admin124
-rw-r--r--sql-ledger/locale/cn/all495
-rw-r--r--sql-ledger/locale/cn/am139
-rw-r--r--sql-ledger/locale/cn/ap133
-rw-r--r--sql-ledger/locale/cn/ar133
-rw-r--r--sql-ledger/locale/cn/arap30
-rw-r--r--sql-ledger/locale/cn/ca50
-rw-r--r--sql-ledger/locale/cn/cp77
-rw-r--r--sql-ledger/locale/cn/ct71
-rw-r--r--sql-ledger/locale/cn/gl124
-rw-r--r--sql-ledger/locale/cn/ic206
-rw-r--r--sql-ledger/locale/cn/io106
-rw-r--r--sql-ledger/locale/cn/ir178
-rw-r--r--sql-ledger/locale/cn/is185
-rw-r--r--sql-ledger/locale/cn/login27
-rw-r--r--sql-ledger/locale/cn/menu71
-rw-r--r--sql-ledger/locale/cn/oe200
-rw-r--r--sql-ledger/locale/cn/pe35
-rw-r--r--sql-ledger/locale/cn/rc37
-rw-r--r--sql-ledger/locale/cn/rp120
-rw-r--r--sql-ledger/locale/ct/COPYING21
-rw-r--r--sql-ledger/locale/ct/LANGUAGE1
-rw-r--r--sql-ledger/locale/ct/admin122
-rw-r--r--sql-ledger/locale/ct/all487
-rw-r--r--sql-ledger/locale/ct/am139
-rw-r--r--sql-ledger/locale/ct/ap133
-rw-r--r--sql-ledger/locale/ct/ar133
-rw-r--r--sql-ledger/locale/ct/arap30
-rw-r--r--sql-ledger/locale/ct/ca50
-rw-r--r--sql-ledger/locale/ct/cp75
-rw-r--r--sql-ledger/locale/ct/ct69
-rw-r--r--sql-ledger/locale/ct/gl124
-rw-r--r--sql-ledger/locale/ct/ic205
-rw-r--r--sql-ledger/locale/ct/io106
-rw-r--r--sql-ledger/locale/ct/ir178
-rw-r--r--sql-ledger/locale/ct/is185
-rw-r--r--sql-ledger/locale/ct/login28
-rw-r--r--sql-ledger/locale/ct/menu72
-rw-r--r--sql-ledger/locale/ct/oe199
-rw-r--r--sql-ledger/locale/ct/pe35
-rw-r--r--sql-ledger/locale/ct/rc37
-rw-r--r--sql-ledger/locale/ct/rp117
-rw-r--r--sql-ledger/locale/cz/COPYING23
-rw-r--r--sql-ledger/locale/cz/LANGUAGE1
-rw-r--r--sql-ledger/locale/cz/admin122
-rw-r--r--sql-ledger/locale/cz/all487
-rw-r--r--sql-ledger/locale/cz/am139
-rw-r--r--sql-ledger/locale/cz/ap133
-rw-r--r--sql-ledger/locale/cz/ar133
-rw-r--r--sql-ledger/locale/cz/arap30
-rw-r--r--sql-ledger/locale/cz/ca50
-rw-r--r--sql-ledger/locale/cz/cp75
-rw-r--r--sql-ledger/locale/cz/ct69
-rw-r--r--sql-ledger/locale/cz/gl124
-rw-r--r--sql-ledger/locale/cz/ic205
-rw-r--r--sql-ledger/locale/cz/io106
-rw-r--r--sql-ledger/locale/cz/ir178
-rw-r--r--sql-ledger/locale/cz/is185
-rw-r--r--sql-ledger/locale/cz/login28
-rw-r--r--sql-ledger/locale/cz/menu72
-rw-r--r--sql-ledger/locale/cz/oe199
-rw-r--r--sql-ledger/locale/cz/pe35
-rw-r--r--sql-ledger/locale/cz/rc37
-rw-r--r--sql-ledger/locale/cz/rp117
-rw-r--r--sql-ledger/locale/de/COPYING22
-rw-r--r--sql-ledger/locale/de/LANGUAGE1
-rw-r--r--sql-ledger/locale/de/Num2text185
-rw-r--r--sql-ledger/locale/de/admin124
-rw-r--r--sql-ledger/locale/de/all499
-rw-r--r--sql-ledger/locale/de/am139
-rw-r--r--sql-ledger/locale/de/ap133
-rw-r--r--sql-ledger/locale/de/ar134
-rw-r--r--sql-ledger/locale/de/arap30
-rw-r--r--sql-ledger/locale/de/ca50
-rw-r--r--sql-ledger/locale/de/cp77
-rw-r--r--sql-ledger/locale/de/ct71
-rw-r--r--sql-ledger/locale/de/gl124
-rw-r--r--sql-ledger/locale/de/ic205
-rw-r--r--sql-ledger/locale/de/io108
-rw-r--r--sql-ledger/locale/de/ir180
-rw-r--r--sql-ledger/locale/de/is187
-rwxr-xr-xsql-ledger/locale/de/locales.pl303
-rw-r--r--sql-ledger/locale/de/login27
-rw-r--r--sql-ledger/locale/de/menu73
-rw-r--r--sql-ledger/locale/de/oe202
-rw-r--r--sql-ledger/locale/de/pe45
-rw-r--r--sql-ledger/locale/de/rc37
-rw-r--r--sql-ledger/locale/de/rp119
-rw-r--r--sql-ledger/locale/dk/COPYING24
-rw-r--r--sql-ledger/locale/dk/LANGUAGE1
-rw-r--r--sql-ledger/locale/dk/admin122
-rw-r--r--sql-ledger/locale/dk/all487
-rw-r--r--sql-ledger/locale/dk/am139
-rw-r--r--sql-ledger/locale/dk/ap133
-rw-r--r--sql-ledger/locale/dk/ar133
-rw-r--r--sql-ledger/locale/dk/arap30
-rw-r--r--sql-ledger/locale/dk/ca50
-rw-r--r--sql-ledger/locale/dk/cp75
-rw-r--r--sql-ledger/locale/dk/ct69
-rw-r--r--sql-ledger/locale/dk/gl124
-rw-r--r--sql-ledger/locale/dk/ic205
-rw-r--r--sql-ledger/locale/dk/io106
-rw-r--r--sql-ledger/locale/dk/ir178
-rw-r--r--sql-ledger/locale/dk/is185
-rw-r--r--sql-ledger/locale/dk/login28
-rw-r--r--sql-ledger/locale/dk/menu72
-rw-r--r--sql-ledger/locale/dk/oe199
-rw-r--r--sql-ledger/locale/dk/pe35
-rw-r--r--sql-ledger/locale/dk/rc37
-rw-r--r--sql-ledger/locale/dk/rp117
-rw-r--r--sql-ledger/locale/ee/COPYING25
-rw-r--r--sql-ledger/locale/ee/LANGUAGE1
-rw-r--r--sql-ledger/locale/ee/admin124
-rw-r--r--sql-ledger/locale/ee/all497
-rw-r--r--sql-ledger/locale/ee/am139
-rw-r--r--sql-ledger/locale/ee/ap133
-rw-r--r--sql-ledger/locale/ee/ar134
-rw-r--r--sql-ledger/locale/ee/arap30
-rw-r--r--sql-ledger/locale/ee/ca50
-rw-r--r--sql-ledger/locale/ee/cp77
-rw-r--r--sql-ledger/locale/ee/ct71
-rw-r--r--sql-ledger/locale/ee/gl124
-rw-r--r--sql-ledger/locale/ee/ic208
-rw-r--r--sql-ledger/locale/ee/io108
-rw-r--r--sql-ledger/locale/ee/ir180
-rw-r--r--sql-ledger/locale/ee/is187
-rw-r--r--sql-ledger/locale/ee/login27
-rw-r--r--sql-ledger/locale/ee/menu71
-rw-r--r--sql-ledger/locale/ee/oe202
-rw-r--r--sql-ledger/locale/ee/pe35
-rw-r--r--sql-ledger/locale/ee/rc37
-rw-r--r--sql-ledger/locale/ee/rp120
-rw-r--r--sql-ledger/locale/en_GB/COPYING23
-rw-r--r--sql-ledger/locale/en_GB/LANGUAGE1
-rw-r--r--sql-ledger/locale/en_GB/admin124
-rw-r--r--sql-ledger/locale/en_GB/all499
-rw-r--r--sql-ledger/locale/en_GB/am139
-rw-r--r--sql-ledger/locale/en_GB/ap133
-rw-r--r--sql-ledger/locale/en_GB/ar134
-rw-r--r--sql-ledger/locale/en_GB/arap30
-rw-r--r--sql-ledger/locale/en_GB/bp54
-rw-r--r--sql-ledger/locale/en_GB/ca50
-rw-r--r--sql-ledger/locale/en_GB/cp77
-rw-r--r--sql-ledger/locale/en_GB/ct71
-rw-r--r--sql-ledger/locale/en_GB/gl124
-rw-r--r--sql-ledger/locale/en_GB/ic205
-rw-r--r--sql-ledger/locale/en_GB/io108
-rw-r--r--sql-ledger/locale/en_GB/ir180
-rw-r--r--sql-ledger/locale/en_GB/is187
-rw-r--r--sql-ledger/locale/en_GB/login27
-rw-r--r--sql-ledger/locale/en_GB/menu73
-rw-r--r--sql-ledger/locale/en_GB/oe202
-rw-r--r--sql-ledger/locale/en_GB/pe45
-rw-r--r--sql-ledger/locale/en_GB/rc37
-rw-r--r--sql-ledger/locale/en_GB/rp119
-rw-r--r--sql-ledger/locale/es/COPYING26
-rw-r--r--sql-ledger/locale/es/LANGUAGE1
-rw-r--r--sql-ledger/locale/es/Num2text195
-rw-r--r--sql-ledger/locale/es/admin124
-rw-r--r--sql-ledger/locale/es/all490
-rw-r--r--sql-ledger/locale/es/am139
-rw-r--r--sql-ledger/locale/es/ap133
-rw-r--r--sql-ledger/locale/es/ar133
-rw-r--r--sql-ledger/locale/es/arap30
-rw-r--r--sql-ledger/locale/es/ca50
-rw-r--r--sql-ledger/locale/es/cp75
-rw-r--r--sql-ledger/locale/es/ct69
-rw-r--r--sql-ledger/locale/es/gl124
-rw-r--r--sql-ledger/locale/es/ic205
-rw-r--r--sql-ledger/locale/es/io106
-rw-r--r--sql-ledger/locale/es/ir178
-rw-r--r--sql-ledger/locale/es/is185
-rw-r--r--sql-ledger/locale/es/login27
-rw-r--r--sql-ledger/locale/es/menu71
-rw-r--r--sql-ledger/locale/es/oe200
-rw-r--r--sql-ledger/locale/es/pe35
-rw-r--r--sql-ledger/locale/es/rc37
-rw-r--r--sql-ledger/locale/es/rp117
-rw-r--r--sql-ledger/locale/fi/COPYING23
-rw-r--r--sql-ledger/locale/fi/LANGUAGE1
-rw-r--r--sql-ledger/locale/fi/admin126
-rw-r--r--sql-ledger/locale/fi/all494
-rw-r--r--sql-ledger/locale/fi/am140
-rw-r--r--sql-ledger/locale/fi/ap133
-rw-r--r--sql-ledger/locale/fi/ar133
-rw-r--r--sql-ledger/locale/fi/arap30
-rw-r--r--sql-ledger/locale/fi/ca50
-rw-r--r--sql-ledger/locale/fi/cp75
-rw-r--r--sql-ledger/locale/fi/ct71
-rw-r--r--sql-ledger/locale/fi/gl124
-rw-r--r--sql-ledger/locale/fi/ic205
-rw-r--r--sql-ledger/locale/fi/io106
-rw-r--r--sql-ledger/locale/fi/ir178
-rw-r--r--sql-ledger/locale/fi/is185
-rw-r--r--sql-ledger/locale/fi/login27
-rw-r--r--sql-ledger/locale/fi/menu71
-rw-r--r--sql-ledger/locale/fi/oe199
-rw-r--r--sql-ledger/locale/fi/pe35
-rw-r--r--sql-ledger/locale/fi/rc37
-rw-r--r--sql-ledger/locale/fi/rp117
-rw-r--r--sql-ledger/locale/fr/COPYING27
-rw-r--r--sql-ledger/locale/fr/LANGUAGE1
-rw-r--r--sql-ledger/locale/fr/admin124
-rw-r--r--sql-ledger/locale/fr/all495
-rw-r--r--sql-ledger/locale/fr/am139
-rw-r--r--sql-ledger/locale/fr/ap133
-rw-r--r--sql-ledger/locale/fr/ar133
-rw-r--r--sql-ledger/locale/fr/arap30
-rw-r--r--sql-ledger/locale/fr/ca50
-rw-r--r--sql-ledger/locale/fr/cp77
-rw-r--r--sql-ledger/locale/fr/ct71
-rw-r--r--sql-ledger/locale/fr/gl124
-rw-r--r--sql-ledger/locale/fr/ic206
-rw-r--r--sql-ledger/locale/fr/io106
-rw-r--r--sql-ledger/locale/fr/ir178
-rw-r--r--sql-ledger/locale/fr/is185
-rw-r--r--sql-ledger/locale/fr/login27
-rw-r--r--sql-ledger/locale/fr/menu71
-rw-r--r--sql-ledger/locale/fr/oe200
-rw-r--r--sql-ledger/locale/fr/pe35
-rw-r--r--sql-ledger/locale/fr/rc37
-rw-r--r--sql-ledger/locale/fr/rp120
-rw-r--r--sql-ledger/locale/hu/COPYING23
-rw-r--r--sql-ledger/locale/hu/LANGUAGE1
-rw-r--r--sql-ledger/locale/hu/admin124
-rw-r--r--sql-ledger/locale/hu/all499
-rw-r--r--sql-ledger/locale/hu/am139
-rw-r--r--sql-ledger/locale/hu/ap133
-rw-r--r--sql-ledger/locale/hu/ar134
-rw-r--r--sql-ledger/locale/hu/arap30
-rw-r--r--sql-ledger/locale/hu/ca50
-rw-r--r--sql-ledger/locale/hu/cp77
-rw-r--r--sql-ledger/locale/hu/ct71
-rw-r--r--sql-ledger/locale/hu/gl124
-rw-r--r--sql-ledger/locale/hu/ic205
-rw-r--r--sql-ledger/locale/hu/io108
-rw-r--r--sql-ledger/locale/hu/ir180
-rw-r--r--sql-ledger/locale/hu/is187
-rw-r--r--sql-ledger/locale/hu/login27
-rw-r--r--sql-ledger/locale/hu/menu73
-rw-r--r--sql-ledger/locale/hu/oe202
-rw-r--r--sql-ledger/locale/hu/pe45
-rw-r--r--sql-ledger/locale/hu/rc37
-rw-r--r--sql-ledger/locale/hu/rp119
-rw-r--r--sql-ledger/locale/is/COPYING23
-rw-r--r--sql-ledger/locale/is/LANGUAGE1
-rw-r--r--sql-ledger/locale/is/admin124
-rw-r--r--sql-ledger/locale/is/all496
-rw-r--r--sql-ledger/locale/is/am139
-rw-r--r--sql-ledger/locale/is/ap133
-rw-r--r--sql-ledger/locale/is/ar134
-rw-r--r--sql-ledger/locale/is/arap30
-rw-r--r--sql-ledger/locale/is/ca50
-rw-r--r--sql-ledger/locale/is/cp77
-rw-r--r--sql-ledger/locale/is/ct71
-rw-r--r--sql-ledger/locale/is/gl124
-rw-r--r--sql-ledger/locale/is/ic206
-rw-r--r--sql-ledger/locale/is/io106
-rw-r--r--sql-ledger/locale/is/ir178
-rw-r--r--sql-ledger/locale/is/is185
-rw-r--r--sql-ledger/locale/is/login27
-rw-r--r--sql-ledger/locale/is/menu71
-rw-r--r--sql-ledger/locale/is/oe200
-rw-r--r--sql-ledger/locale/is/pe35
-rw-r--r--sql-ledger/locale/is/rc37
-rw-r--r--sql-ledger/locale/is/rp120
-rw-r--r--sql-ledger/locale/it/COPYING25
-rw-r--r--sql-ledger/locale/it/LANGUAGE1
-rw-r--r--sql-ledger/locale/it/Num2text163
-rw-r--r--sql-ledger/locale/it/admin124
-rw-r--r--sql-ledger/locale/it/all495
-rw-r--r--sql-ledger/locale/it/am139
-rw-r--r--sql-ledger/locale/it/ap133
-rw-r--r--sql-ledger/locale/it/ar133
-rw-r--r--sql-ledger/locale/it/arap30
-rw-r--r--sql-ledger/locale/it/ca50
-rw-r--r--sql-ledger/locale/it/cp77
-rw-r--r--sql-ledger/locale/it/ct71
-rw-r--r--sql-ledger/locale/it/gl124
-rw-r--r--sql-ledger/locale/it/ic206
-rw-r--r--sql-ledger/locale/it/io106
-rw-r--r--sql-ledger/locale/it/ir178
-rw-r--r--sql-ledger/locale/it/is185
-rw-r--r--sql-ledger/locale/it/login27
-rw-r--r--sql-ledger/locale/it/menu71
-rw-r--r--sql-ledger/locale/it/oe200
-rw-r--r--sql-ledger/locale/it/pe35
-rw-r--r--sql-ledger/locale/it/qe199
-rw-r--r--sql-ledger/locale/it/rc37
-rw-r--r--sql-ledger/locale/it/rp120
-rw-r--r--sql-ledger/locale/lt/COPYING23
-rw-r--r--sql-ledger/locale/lt/LANGUAGE1
-rw-r--r--sql-ledger/locale/lt/admin124
-rw-r--r--sql-ledger/locale/lt/all497
-rw-r--r--sql-ledger/locale/lt/am139
-rw-r--r--sql-ledger/locale/lt/ap133
-rw-r--r--sql-ledger/locale/lt/ar134
-rw-r--r--sql-ledger/locale/lt/arap30
-rw-r--r--sql-ledger/locale/lt/ca50
-rw-r--r--sql-ledger/locale/lt/cp77
-rw-r--r--sql-ledger/locale/lt/ct71
-rw-r--r--sql-ledger/locale/lt/gl124
-rw-r--r--sql-ledger/locale/lt/ic208
-rw-r--r--sql-ledger/locale/lt/io108
-rw-r--r--sql-ledger/locale/lt/ir180
-rw-r--r--sql-ledger/locale/lt/is187
-rw-r--r--sql-ledger/locale/lt/login27
-rw-r--r--sql-ledger/locale/lt/menu71
-rw-r--r--sql-ledger/locale/lt/oe202
-rw-r--r--sql-ledger/locale/lt/pe35
-rw-r--r--sql-ledger/locale/lt/rc37
-rw-r--r--sql-ledger/locale/lt/rp120
-rw-r--r--sql-ledger/locale/mx/COPYING23
-rw-r--r--sql-ledger/locale/mx/LANGUAGE1
-rw-r--r--sql-ledger/locale/mx/admin128
-rw-r--r--sql-ledger/locale/mx/all496
-rw-r--r--sql-ledger/locale/mx/am140
-rw-r--r--sql-ledger/locale/mx/ap133
-rw-r--r--sql-ledger/locale/mx/ar133
-rw-r--r--sql-ledger/locale/mx/arap30
-rw-r--r--sql-ledger/locale/mx/ca50
-rw-r--r--sql-ledger/locale/mx/cp75
-rw-r--r--sql-ledger/locale/mx/ct69
-rw-r--r--sql-ledger/locale/mx/gl124
-rw-r--r--sql-ledger/locale/mx/ic206
-rw-r--r--sql-ledger/locale/mx/io106
-rw-r--r--sql-ledger/locale/mx/ir178
-rw-r--r--sql-ledger/locale/mx/is185
-rw-r--r--sql-ledger/locale/mx/login28
-rw-r--r--sql-ledger/locale/mx/menu72
-rw-r--r--sql-ledger/locale/mx/oe200
-rw-r--r--sql-ledger/locale/mx/pe35
-rw-r--r--sql-ledger/locale/mx/rc37
-rw-r--r--sql-ledger/locale/mx/rp117
-rw-r--r--sql-ledger/locale/nl/COPYING26
-rw-r--r--sql-ledger/locale/nl/LANGUAGE1
-rw-r--r--sql-ledger/locale/nl/Num2text161
-rw-r--r--sql-ledger/locale/nl/admin124
-rw-r--r--sql-ledger/locale/nl/all491
-rw-r--r--sql-ledger/locale/nl/am139
-rw-r--r--sql-ledger/locale/nl/ap133
-rw-r--r--sql-ledger/locale/nl/ar133
-rw-r--r--sql-ledger/locale/nl/arap30
-rw-r--r--sql-ledger/locale/nl/ca50
-rw-r--r--sql-ledger/locale/nl/cp75
-rw-r--r--sql-ledger/locale/nl/ct71
-rw-r--r--sql-ledger/locale/nl/gl124
-rw-r--r--sql-ledger/locale/nl/ic206
-rw-r--r--sql-ledger/locale/nl/io106
-rw-r--r--sql-ledger/locale/nl/ir178
-rw-r--r--sql-ledger/locale/nl/is185
-rw-r--r--sql-ledger/locale/nl/login27
-rw-r--r--sql-ledger/locale/nl/menu71
-rw-r--r--sql-ledger/locale/nl/oe200
-rw-r--r--sql-ledger/locale/nl/pe35
-rw-r--r--sql-ledger/locale/nl/rc37
-rw-r--r--sql-ledger/locale/nl/rp116
-rw-r--r--sql-ledger/locale/no/COPYING24
-rw-r--r--sql-ledger/locale/no/LANGUAGE1
-rw-r--r--sql-ledger/locale/no/admin124
-rw-r--r--sql-ledger/locale/no/all496
-rw-r--r--sql-ledger/locale/no/am139
-rw-r--r--sql-ledger/locale/no/ap133
-rw-r--r--sql-ledger/locale/no/ar134
-rw-r--r--sql-ledger/locale/no/arap30
-rw-r--r--sql-ledger/locale/no/ca50
-rw-r--r--sql-ledger/locale/no/cp77
-rw-r--r--sql-ledger/locale/no/ct71
-rw-r--r--sql-ledger/locale/no/gl124
-rw-r--r--sql-ledger/locale/no/ic206
-rw-r--r--sql-ledger/locale/no/io106
-rw-r--r--sql-ledger/locale/no/ir178
-rw-r--r--sql-ledger/locale/no/is185
-rw-r--r--sql-ledger/locale/no/login27
-rw-r--r--sql-ledger/locale/no/menu71
-rw-r--r--sql-ledger/locale/no/oe200
-rw-r--r--sql-ledger/locale/no/pe35
-rw-r--r--sql-ledger/locale/no/rc37
-rw-r--r--sql-ledger/locale/no/rp120
-rw-r--r--sql-ledger/locale/pa/COPYING23
-rw-r--r--sql-ledger/locale/pa/LANGUAGE1
-rw-r--r--sql-ledger/locale/pa/admin128
-rw-r--r--sql-ledger/locale/pa/all496
-rw-r--r--sql-ledger/locale/pa/am140
-rw-r--r--sql-ledger/locale/pa/ap133
-rw-r--r--sql-ledger/locale/pa/ar133
-rw-r--r--sql-ledger/locale/pa/arap30
-rw-r--r--sql-ledger/locale/pa/ca50
-rw-r--r--sql-ledger/locale/pa/cp75
-rw-r--r--sql-ledger/locale/pa/ct69
-rw-r--r--sql-ledger/locale/pa/gl124
-rw-r--r--sql-ledger/locale/pa/ic206
-rw-r--r--sql-ledger/locale/pa/io106
-rw-r--r--sql-ledger/locale/pa/ir178
-rw-r--r--sql-ledger/locale/pa/is185
-rw-r--r--sql-ledger/locale/pa/login28
-rw-r--r--sql-ledger/locale/pa/menu72
-rw-r--r--sql-ledger/locale/pa/oe200
-rw-r--r--sql-ledger/locale/pa/pe35
-rw-r--r--sql-ledger/locale/pa/rc37
-rw-r--r--sql-ledger/locale/pa/rp117
-rw-r--r--sql-ledger/locale/pl/COPYING23
-rw-r--r--sql-ledger/locale/pl/LANGUAGE1
-rw-r--r--sql-ledger/locale/pl/admin122
-rw-r--r--sql-ledger/locale/pl/all487
-rw-r--r--sql-ledger/locale/pl/am139
-rw-r--r--sql-ledger/locale/pl/ap133
-rw-r--r--sql-ledger/locale/pl/ar133
-rw-r--r--sql-ledger/locale/pl/arap30
-rw-r--r--sql-ledger/locale/pl/ca50
-rw-r--r--sql-ledger/locale/pl/cp75
-rw-r--r--sql-ledger/locale/pl/ct69
-rw-r--r--sql-ledger/locale/pl/gl124
-rw-r--r--sql-ledger/locale/pl/ic205
-rw-r--r--sql-ledger/locale/pl/io106
-rw-r--r--sql-ledger/locale/pl/ir178
-rw-r--r--sql-ledger/locale/pl/is185
-rw-r--r--sql-ledger/locale/pl/login28
-rw-r--r--sql-ledger/locale/pl/menu72
-rw-r--r--sql-ledger/locale/pl/oe199
-rw-r--r--sql-ledger/locale/pl/pe35
-rw-r--r--sql-ledger/locale/pl/rc37
-rw-r--r--sql-ledger/locale/pl/rp117
-rw-r--r--sql-ledger/locale/pt/COPYING23
-rw-r--r--sql-ledger/locale/pt/LANGUAGE1
-rw-r--r--sql-ledger/locale/pt/admin122
-rw-r--r--sql-ledger/locale/pt/all487
-rw-r--r--sql-ledger/locale/pt/am139
-rw-r--r--sql-ledger/locale/pt/ap133
-rw-r--r--sql-ledger/locale/pt/ar133
-rw-r--r--sql-ledger/locale/pt/arap30
-rw-r--r--sql-ledger/locale/pt/ca50
-rw-r--r--sql-ledger/locale/pt/cp75
-rw-r--r--sql-ledger/locale/pt/ct69
-rw-r--r--sql-ledger/locale/pt/gl124
-rw-r--r--sql-ledger/locale/pt/ic205
-rw-r--r--sql-ledger/locale/pt/io106
-rw-r--r--sql-ledger/locale/pt/ir178
-rw-r--r--sql-ledger/locale/pt/is185
-rw-r--r--sql-ledger/locale/pt/login28
-rw-r--r--sql-ledger/locale/pt/menu72
-rw-r--r--sql-ledger/locale/pt/oe199
-rw-r--r--sql-ledger/locale/pt/pe35
-rw-r--r--sql-ledger/locale/pt/rc37
-rw-r--r--sql-ledger/locale/pt/rp117
-rw-r--r--sql-ledger/locale/ru/COPYING23
-rw-r--r--sql-ledger/locale/ru/LANGUAGE1
-rw-r--r--sql-ledger/locale/ru/admin122
-rw-r--r--sql-ledger/locale/ru/all487
-rw-r--r--sql-ledger/locale/ru/am139
-rw-r--r--sql-ledger/locale/ru/ap133
-rw-r--r--sql-ledger/locale/ru/ar133
-rw-r--r--sql-ledger/locale/ru/arap30
-rw-r--r--sql-ledger/locale/ru/ca50
-rw-r--r--sql-ledger/locale/ru/cp75
-rw-r--r--sql-ledger/locale/ru/ct69
-rw-r--r--sql-ledger/locale/ru/gl124
-rw-r--r--sql-ledger/locale/ru/ic205
-rw-r--r--sql-ledger/locale/ru/io106
-rw-r--r--sql-ledger/locale/ru/ir178
-rw-r--r--sql-ledger/locale/ru/is185
-rw-r--r--sql-ledger/locale/ru/login28
-rw-r--r--sql-ledger/locale/ru/menu72
-rw-r--r--sql-ledger/locale/ru/oe199
-rw-r--r--sql-ledger/locale/ru/pe35
-rw-r--r--sql-ledger/locale/ru/rc37
-rw-r--r--sql-ledger/locale/ru/rp117
-rw-r--r--sql-ledger/locale/se/COPYING23
-rw-r--r--sql-ledger/locale/se/LANGUAGE1
-rw-r--r--sql-ledger/locale/se/admin124
-rw-r--r--sql-ledger/locale/se/all491
-rw-r--r--sql-ledger/locale/se/am139
-rw-r--r--sql-ledger/locale/se/ap133
-rw-r--r--sql-ledger/locale/se/ar133
-rw-r--r--sql-ledger/locale/se/arap30
-rw-r--r--sql-ledger/locale/se/ca50
-rw-r--r--sql-ledger/locale/se/cp75
-rw-r--r--sql-ledger/locale/se/ct71
-rw-r--r--sql-ledger/locale/se/gl124
-rw-r--r--sql-ledger/locale/se/ic205
-rw-r--r--sql-ledger/locale/se/io106
-rw-r--r--sql-ledger/locale/se/ir178
-rw-r--r--sql-ledger/locale/se/is185
-rw-r--r--sql-ledger/locale/se/login27
-rw-r--r--sql-ledger/locale/se/menu71
-rw-r--r--sql-ledger/locale/se/oe199
-rw-r--r--sql-ledger/locale/se/pe35
-rw-r--r--sql-ledger/locale/se/rc37
-rw-r--r--sql-ledger/locale/se/rp117
-rw-r--r--sql-ledger/locale/tr/COPYING23
-rw-r--r--sql-ledger/locale/tr/LANGUAGE1
-rw-r--r--sql-ledger/locale/tr/admin122
-rw-r--r--sql-ledger/locale/tr/all487
-rw-r--r--sql-ledger/locale/tr/am139
-rw-r--r--sql-ledger/locale/tr/ap133
-rw-r--r--sql-ledger/locale/tr/ar133
-rw-r--r--sql-ledger/locale/tr/arap30
-rw-r--r--sql-ledger/locale/tr/ca50
-rw-r--r--sql-ledger/locale/tr/cp75
-rw-r--r--sql-ledger/locale/tr/ct69
-rw-r--r--sql-ledger/locale/tr/gl124
-rw-r--r--sql-ledger/locale/tr/ic205
-rw-r--r--sql-ledger/locale/tr/io106
-rw-r--r--sql-ledger/locale/tr/ir178
-rw-r--r--sql-ledger/locale/tr/is185
-rw-r--r--sql-ledger/locale/tr/login28
-rw-r--r--sql-ledger/locale/tr/menu72
-rw-r--r--sql-ledger/locale/tr/oe199
-rw-r--r--sql-ledger/locale/tr/pe35
-rw-r--r--sql-ledger/locale/tr/rc37
-rw-r--r--sql-ledger/locale/tr/rp117
-rw-r--r--sql-ledger/locale/tw/COPYING25
-rw-r--r--sql-ledger/locale/tw/LANGUAGE1
-rw-r--r--sql-ledger/locale/tw/admin122
-rw-r--r--sql-ledger/locale/tw/all487
-rw-r--r--sql-ledger/locale/tw/am139
-rw-r--r--sql-ledger/locale/tw/ap133
-rw-r--r--sql-ledger/locale/tw/ar133
-rw-r--r--sql-ledger/locale/tw/arap30
-rw-r--r--sql-ledger/locale/tw/ca50
-rw-r--r--sql-ledger/locale/tw/cp75
-rw-r--r--sql-ledger/locale/tw/ct69
-rw-r--r--sql-ledger/locale/tw/gl124
-rw-r--r--sql-ledger/locale/tw/ic205
-rw-r--r--sql-ledger/locale/tw/io106
-rw-r--r--sql-ledger/locale/tw/ir178
-rw-r--r--sql-ledger/locale/tw/is185
-rw-r--r--sql-ledger/locale/tw/login28
-rw-r--r--sql-ledger/locale/tw/menu72
-rw-r--r--sql-ledger/locale/tw/oe199
-rw-r--r--sql-ledger/locale/tw/pe35
-rw-r--r--sql-ledger/locale/tw/rc37
-rw-r--r--sql-ledger/locale/tw/rp117
-rw-r--r--sql-ledger/locale/ua/COPYING23
-rw-r--r--sql-ledger/locale/ua/LANGUAGE1
-rw-r--r--sql-ledger/locale/ua/admin124
-rw-r--r--sql-ledger/locale/ua/all495
-rw-r--r--sql-ledger/locale/ua/am139
-rw-r--r--sql-ledger/locale/ua/ap133
-rw-r--r--sql-ledger/locale/ua/ar133
-rw-r--r--sql-ledger/locale/ua/arap30
-rw-r--r--sql-ledger/locale/ua/ca50
-rw-r--r--sql-ledger/locale/ua/cp77
-rw-r--r--sql-ledger/locale/ua/ct71
-rw-r--r--sql-ledger/locale/ua/gl124
-rw-r--r--sql-ledger/locale/ua/ic206
-rw-r--r--sql-ledger/locale/ua/io106
-rw-r--r--sql-ledger/locale/ua/ir178
-rw-r--r--sql-ledger/locale/ua/is185
-rw-r--r--sql-ledger/locale/ua/login27
-rw-r--r--sql-ledger/locale/ua/menu71
-rw-r--r--sql-ledger/locale/ua/oe200
-rw-r--r--sql-ledger/locale/ua/pe35
-rw-r--r--sql-ledger/locale/ua/rc37
-rw-r--r--sql-ledger/locale/ua/rp120
-rw-r--r--sql-ledger/locale/ve/COPYING23
-rw-r--r--sql-ledger/locale/ve/LANGUAGE1
-rw-r--r--sql-ledger/locale/ve/admin124
-rw-r--r--sql-ledger/locale/ve/all491
-rw-r--r--sql-ledger/locale/ve/am139
-rw-r--r--sql-ledger/locale/ve/ap133
-rw-r--r--sql-ledger/locale/ve/ar133
-rw-r--r--sql-ledger/locale/ve/arap30
-rw-r--r--sql-ledger/locale/ve/ca50
-rw-r--r--sql-ledger/locale/ve/cp75
-rw-r--r--sql-ledger/locale/ve/ct71
-rw-r--r--sql-ledger/locale/ve/gl124
-rw-r--r--sql-ledger/locale/ve/ic206
-rw-r--r--sql-ledger/locale/ve/io106
-rw-r--r--sql-ledger/locale/ve/ir178
-rw-r--r--sql-ledger/locale/ve/is185
-rw-r--r--sql-ledger/locale/ve/login27
-rw-r--r--sql-ledger/locale/ve/menu71
-rw-r--r--sql-ledger/locale/ve/oe200
-rw-r--r--sql-ledger/locale/ve/pe35
-rw-r--r--sql-ledger/locale/ve/rc37
-rw-r--r--sql-ledger/locale/ve/rp116
-rwxr-xr-xsql-ledger/login.pl132
-rw-r--r--sql-ledger/menu.ini394
-rwxr-xr-xsql-ledger/setup.pl594
-rw-r--r--sql-ledger/sql-ledger.conf.default33
-rw-r--r--sql-ledger/sql-ledger.pngbin0 -> 6963 bytes
-rw-r--r--sql-ledger/sql/Austria-chart.sql143
-rw-r--r--sql-ledger/sql/Austria-gifi.sql334
-rw-r--r--sql-ledger/sql/Brazil_General-chart.sql70
-rw-r--r--sql-ledger/sql/Canada-gifi.sql754
-rw-r--r--sql-ledger/sql/Canada_General-chart.sql77
-rw-r--r--sql-ledger/sql/Czech_Republic-chart.sql317
-rw-r--r--sql-ledger/sql/Danish_Default-chart.sql75
-rw-r--r--sql-ledger/sql/Default-chart.sql81
-rw-r--r--sql-ledger/sql/Dutch_Default-chart.sql80
-rw-r--r--sql-ledger/sql/Dutch_Standard-chart.sql233
-rw-r--r--sql-ledger/sql/France-chart.sql951
-rw-r--r--sql-ledger/sql/German-Sample-chart.sql216
-rw-r--r--sql-ledger/sql/German-Sample-gifi.sql19
-rw-r--r--sql-ledger/sql/Germany-DATEV-SKR03-chart.sql262
-rw-r--r--sql-ledger/sql/Germany-DATEV-SKR03-gifi.sql550
-rw-r--r--sql-ledger/sql/Germany-SKR03-chart.sql267
-rw-r--r--sql-ledger/sql/Germany-SKR03-gifi.sql1083
-rw-r--r--sql-ledger/sql/Italy-chart.sql179
-rw-r--r--sql-ledger/sql/Oracle-indices.sql57
-rw-r--r--sql-ledger/sql/Oracle-tables.sql388
-rw-r--r--sql-ledger/sql/Oracle-upgrade-1.8.0-1.8.4.sql28
-rw-r--r--sql-ledger/sql/Oracle-upgrade-1.8.4-1.8.5.sql77
-rw-r--r--sql-ledger/sql/Oracle-upgrade-1.8.5-2.0.0.sql100
-rw-r--r--sql-ledger/sql/Oracle-upgrade-2.0.0-2.0.8.sql19
-rw-r--r--sql-ledger/sql/Pg-indices.sql57
-rw-r--r--sql-ledger/sql/Pg-tables.sql289
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.2.6-1.2.7.sql4
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.2.7-1.4.0.sql173
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.4.0-1.6.0.sql126
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.6.0-1.8.0.sql104
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.8.0-1.8.4.sql21
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.8.4-1.8.5.sql63
-rw-r--r--sql-ledger/sql/Pg-upgrade-1.8.5-2.0.0.sql92
-rw-r--r--sql-ledger/sql/Pg-upgrade-2.0.0-2.0.8.sql12
-rw-r--r--sql-ledger/sql/Poland-chart.sql337
-rw-r--r--sql-ledger/sql/Simplified_Chinese_Default-chart.sql78
-rw-r--r--sql-ledger/sql/Spain-chart.sql132
-rw-r--r--sql-ledger/sql/Swiss-German-chart.sql160
-rw-r--r--sql-ledger/sql/Swiss-German-gifi.sql55
-rw-r--r--sql-ledger/sql/Traditional_Chinese_Default-chart.sql78
-rw-r--r--sql-ledger/sql/US_General-chart.sql98
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-balance_sheet.html103
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-check.tex71
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-income_statement.html77
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-invoice.html315
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-invoice.tex223
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-packing_list.html143
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-packing_list.tex116
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-purchase_order.html187
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-purchase_order.tex198
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-receipt.tex71
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-sales_order.html221
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-sales_order.tex137
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-statement.html125
-rw-r--r--sql-ledger/templates/Brazilian_Portuguese-statement.tex137
-rw-r--r--sql-ledger/templates/Danish-balance_sheet.html96
-rw-r--r--sql-ledger/templates/Danish-check.tex71
-rw-r--r--sql-ledger/templates/Danish-income_statement.html73
-rw-r--r--sql-ledger/templates/Danish-invoice.html273
-rw-r--r--sql-ledger/templates/Danish-invoice.tex152
-rw-r--r--sql-ledger/templates/Danish-packing_list.html145
-rw-r--r--sql-ledger/templates/Danish-packing_list.tex123
-rw-r--r--sql-ledger/templates/Danish-purchase_order.html191
-rw-r--r--sql-ledger/templates/Danish-purchase_order.tex143
-rw-r--r--sql-ledger/templates/Danish-receipt.tex71
-rw-r--r--sql-ledger/templates/Danish-sales_order.html210
-rw-r--r--sql-ledger/templates/Danish-sales_order.tex144
-rw-r--r--sql-ledger/templates/Danish-statement.html121
-rw-r--r--sql-ledger/templates/Danish-statement.tex137
-rw-r--r--sql-ledger/templates/Default-balance_sheet.html100
-rw-r--r--sql-ledger/templates/Default-check.tex77
-rw-r--r--sql-ledger/templates/Default-income_statement.html82
-rw-r--r--sql-ledger/templates/Default-invoice.html309
-rw-r--r--sql-ledger/templates/Default-invoice.tex231
-rw-r--r--sql-ledger/templates/Default-packing_list.html148
-rw-r--r--sql-ledger/templates/Default-packing_list.tex122
-rw-r--r--sql-ledger/templates/Default-purchase_order.html224
-rw-r--r--sql-ledger/templates/Default-purchase_order.tex198
-rw-r--r--sql-ledger/templates/Default-receipt.tex74
-rw-r--r--sql-ledger/templates/Default-sales_order.html212
-rw-r--r--sql-ledger/templates/Default-sales_order.tex143
-rw-r--r--sql-ledger/templates/Default-statement.html121
-rw-r--r--sql-ledger/templates/Default-statement.tex137
-rw-r--r--sql-ledger/templates/Dutch-balance_sheet.html104
-rw-r--r--sql-ledger/templates/Dutch-check.tex71
-rw-r--r--sql-ledger/templates/Dutch-income_statement.html83
-rw-r--r--sql-ledger/templates/Dutch-invoice.html239
-rw-r--r--sql-ledger/templates/Dutch-invoice.tex138
-rw-r--r--sql-ledger/templates/Dutch-packing_list.html121
-rw-r--r--sql-ledger/templates/Dutch-packing_list.tex114
-rw-r--r--sql-ledger/templates/Dutch-purchase_order.html186
-rw-r--r--sql-ledger/templates/Dutch-purchase_order.tex137
-rw-r--r--sql-ledger/templates/Dutch-receipt.tex71
-rw-r--r--sql-ledger/templates/Dutch-sales_order.html208
-rw-r--r--sql-ledger/templates/Dutch-sales_order.tex134
-rw-r--r--sql-ledger/templates/Dutch-statement.html121
-rw-r--r--sql-ledger/templates/Dutch-statement.tex137
-rw-r--r--sql-ledger/templates/Estonian-balance_sheet.html103
-rw-r--r--sql-ledger/templates/Estonian-check.tex71
-rw-r--r--sql-ledger/templates/Estonian-income_statement.html84
-rw-r--r--sql-ledger/templates/Estonian-invoice.html215
-rw-r--r--sql-ledger/templates/Estonian-invoice.tex147
-rw-r--r--sql-ledger/templates/Estonian-packing_list.html147
-rw-r--r--sql-ledger/templates/Estonian-packing_list.tex119
-rw-r--r--sql-ledger/templates/Estonian-purchase_order.html195
-rw-r--r--sql-ledger/templates/Estonian-purchase_order.tex143
-rw-r--r--sql-ledger/templates/Estonian-receipt.tex71
-rw-r--r--sql-ledger/templates/Estonian-sales_order.html214
-rw-r--r--sql-ledger/templates/Estonian-sales_order.tex141
-rw-r--r--sql-ledger/templates/Estonian-statement.html121
-rw-r--r--sql-ledger/templates/Estonian-statement.tex137
-rw-r--r--sql-ledger/templates/French-balance_sheet.html109
-rw-r--r--sql-ledger/templates/French-check.tex71
-rw-r--r--sql-ledger/templates/French-income_statement.html86
-rw-r--r--sql-ledger/templates/French-invoice.html309
-rw-r--r--sql-ledger/templates/French-invoice.tex151
-rw-r--r--sql-ledger/templates/French-packing_list.html152
-rw-r--r--sql-ledger/templates/French-packing_list.tex125
-rw-r--r--sql-ledger/templates/French-purchase_order.html207
-rw-r--r--sql-ledger/templates/French-purchase_order.tex143
-rw-r--r--sql-ledger/templates/French-receipt.tex71
-rw-r--r--sql-ledger/templates/French-sales_order.html229
-rw-r--r--sql-ledger/templates/French-sales_order.tex144
-rw-r--r--sql-ledger/templates/French-statement.html133
-rw-r--r--sql-ledger/templates/French-statement.tex137
-rw-r--r--sql-ledger/templates/German-balance_sheet.html100
-rw-r--r--sql-ledger/templates/German-check.tex71
-rw-r--r--sql-ledger/templates/German-income_statement.html78
-rw-r--r--sql-ledger/templates/German-invoice.html265
-rw-r--r--sql-ledger/templates/German-invoice.tex155
-rw-r--r--sql-ledger/templates/German-packing_list.html146
-rw-r--r--sql-ledger/templates/German-packing_list.tex118
-rw-r--r--sql-ledger/templates/German-purchase_order.html188
-rw-r--r--sql-ledger/templates/German-purchase_order.tex143
-rw-r--r--sql-ledger/templates/German-receipt.tex71
-rw-r--r--sql-ledger/templates/German-sales_order.html213
-rw-r--r--sql-ledger/templates/German-sales_order.tex142
-rw-r--r--sql-ledger/templates/German-statement.html121
-rw-r--r--sql-ledger/templates/German-statement.tex137
-rw-r--r--sql-ledger/templates/Service-balance_sheet.html100
-rw-r--r--sql-ledger/templates/Service-check.tex71
-rw-r--r--sql-ledger/templates/Service-income_statement.html82
-rw-r--r--sql-ledger/templates/Service-invoice.html226
-rw-r--r--sql-ledger/templates/Service-invoice.tex151
-rw-r--r--sql-ledger/templates/Service-packing_list.html148
-rw-r--r--sql-ledger/templates/Service-packing_list.tex120
-rw-r--r--sql-ledger/templates/Service-purchase_order.html194
-rw-r--r--sql-ledger/templates/Service-purchase_order.tex143
-rw-r--r--sql-ledger/templates/Service-receipt.tex71
-rw-r--r--sql-ledger/templates/Service-sales_order.html198
-rw-r--r--sql-ledger/templates/Service-sales_order.tex139
-rw-r--r--sql-ledger/templates/Service-statement.html121
-rw-r--r--sql-ledger/templates/Service-statement.tex137
-rw-r--r--sql-ledger/templates/Spanish_A4-balance_sheet.html100
-rw-r--r--sql-ledger/templates/Spanish_A4-check.tex71
-rw-r--r--sql-ledger/templates/Spanish_A4-income_statement.html77
-rw-r--r--sql-ledger/templates/Spanish_A4-invoice.html153
-rw-r--r--sql-ledger/templates/Spanish_A4-invoice.tex108
-rw-r--r--sql-ledger/templates/Spanish_A4-packing_list.html155
-rw-r--r--sql-ledger/templates/Spanish_A4-packing_list.tex108
-rw-r--r--sql-ledger/templates/Spanish_A4-purchase_order.html153
-rw-r--r--sql-ledger/templates/Spanish_A4-purchase_order.tex107
-rw-r--r--sql-ledger/templates/Spanish_A4-receipt.tex71
-rw-r--r--sql-ledger/templates/Spanish_A4-sales_order.html153
-rw-r--r--sql-ledger/templates/Spanish_A4-sales_order.tex107
-rw-r--r--sql-ledger/templates/Spanish_A4-statement.html121
-rw-r--r--sql-ledger/templates/Spanish_A4-statement.tex137
-rw-r--r--sql-ledger/templates/Spanish_Letter-balance_sheet.html100
-rw-r--r--sql-ledger/templates/Spanish_Letter-check.tex71
-rw-r--r--sql-ledger/templates/Spanish_Letter-income_statement.html77
-rw-r--r--sql-ledger/templates/Spanish_Letter-invoice.html153
-rw-r--r--sql-ledger/templates/Spanish_Letter-invoice.tex110
-rw-r--r--sql-ledger/templates/Spanish_Letter-packing_list.html155
-rw-r--r--sql-ledger/templates/Spanish_Letter-packing_list.tex108
-rw-r--r--sql-ledger/templates/Spanish_Letter-purchase_order.html153
-rw-r--r--sql-ledger/templates/Spanish_Letter-purchase_order.tex107
-rw-r--r--sql-ledger/templates/Spanish_Letter-receipt.tex71
-rw-r--r--sql-ledger/templates/Spanish_Letter-sales_order.html153
-rw-r--r--sql-ledger/templates/Spanish_Letter-sales_order.tex107
-rw-r--r--sql-ledger/templates/Spanish_Letter-statement.html121
-rw-r--r--sql-ledger/templates/Spanish_Letter-statement.tex137
-rw-r--r--sql-ledger/users/members.default5
-rwxr-xr-xtest/cgi-test560
1610 files changed, 228450 insertions, 9307 deletions
diff --git a/CREDITS b/CREDITS
new file mode 100644
index 000000000..0b4e2d9c9
--- /dev/null
+++ b/CREDITS
@@ -0,0 +1,117 @@
+Thanks to Matt Simerson <matt@michweb.net> of MichWeb Inc. for documentation
+and pre-release testing. Without his help the documentation in 1.0.0
+release would have consisted of a single screenfull of text.
+(To clear up some misunderstanding, Matt did not write the current
+documentation.)
+
+Steve Cleff <cleff@yahoo.com> did the default background image in 1.0.x and
+is also the creator of Freeside's elusive mascot, Snakeman, who we hope will
+make an appearance in an upcoming version.
+
+Jerry St. Pierre <jstpi@city.timmins.on.ca> did the "SISD" graphic used in
+1.0.x and most of 1.1.x.
+
+Mark Norris of Urban Design, Inc. <http://www.urban.com/> did the red "S"
+logo for later 1.1.x versions and 1.2.x
+
+Brian McCane? <bmccane@maxbaud.net> contributed PostgreSQL support, HTML
+style enhancements and many, many bugfixes.
+
+Cerkit <cerkit@alfheim.net> contributed rsync support and desynced hosts.
+His changes will hopefully be included in an upcoming version.
+
+CompleteHOST, Inc. (http://www.completehost.com) funded the development of the
+following features:
+ - Multiple, separate databases and configurations on one box.
+ - Per-customer pricing (custom packages)
+ - Internationalization wrt addresses (cust_main, cust_main_county)
+Thanks!
+
+Mark Williamson <mark.williamson@ebbs.com.au> and Roger Mangraviti
+<rem@atu.com.au> contributed state/provence listings for Australia.
+
+Peter Wemm <peter@netplex.com.au> sent in a bunch of bugfixes for the 1.2
+release.
+
+Greg Kuhnert <gregk@no1.com.au> sent some documentation updates.
+
+Joel Griffiths <griff@aver-computer.com> contribued many bugfixes as well as
+the print-batch script.
+
+NetLoud <http://www.netloud.com/> funded the development of the following
+features:
+ - IEAK support for the signup server
+ - Pre-payment support
+
+NetAcces.Net (not netaccess.net) funded the development of the following
+features:
+ - DNS tracking and export to BIND configuration files
+ - Web site virtual host tracking and export to Apache configuration files
+
+Kristian Hoffmann <khoff@pc-intouch.com> contributed Netscape CCK
+autoconfiguration support for the signup server, lots of great mailing
+lists posts which I shamelessly made into documentation, fixes to get rid of
+the embarassing and non-database-normal "owed" field, and many other things
+I'm forgetting. Most recently Kristian and Mark (last name?) contributed
+the IP address tracking and svc_broadband in 1.5.
+
+Jeff Finucane <jeff@cmh.net> send in a bunch of bugfixes (for the sendmail
+export, cancel-unaudited.cgi), patches to support billing date modification,
+and probably other things too (sorry if I forgot them). And yet even more
+bug squashing, thanks! *and* he single-handedly implemented all the necessary
+work to get rid of svc_acct_sm and the "default domain" thanks!! and rewrote
+the financials! wow, thanks jeff! and contributed financial reports!
+
+Kenny Elliott <kenny@neoserve.com> contributed ICRADIUS radreply table support,
+allowing attributes with ICRADIUS, helped fix many bugs, and some
+other stuff I can't recall (sorry).
+
+Stephen Amadei <amadei@dandy.net> contribued portability cleanups for the
+low-level DBI stuff.
+
+Jason Spence <thalakan@frys.com> contributed admin.html and other
+documentation, autocapnames javascript, bugfixes & other neat stuff I can't
+remember.
+
+Brad Dameron <bdameron@tscnet.com> contributed code to do configurable state
+and referral defaults.
+
+Surf and Sip, Inc., <http://www.surfandsip.com> sponsored a long-requested
+feature - the session monitor and time-based prepaid cards.
+Matt Peterson <matt@peterson.org> and Mack ? <mackn@mackn.net> tested
+the new features and contributed many bugfixes.
+
+Landel Telecom <http://www.landel.com/> sponsored shipping addresses and
+customer notes, as well as an update of the CP provisioning.
+
+nikotel, Inc. <http://www.nikojet.com> sponsored the inclusion of
+customer-to-customer referrals in the web interface and signup server.
+
+Three Bubba's Innanet <http://www.inna.net> sponsored expedited check entry,
+the "similar names warning" feature, and a number of other enhancements.
+
+Dave Burgess <burgess@neonramp.com> sent in a bunch of fixes and small changes
+and will doubtless send more once he's got his tree under control.
+
+Luke Pfeifer <freeside@globalli.com> contributed the "subscription" price plan.
+
+Noment Networks, LLC <http://www.noment.com/> sponsored ICRADIUS/FreeRADIUS
+groups, message catalogs, and signup server enhancements.
+
+Donald Greer <dgreer@austintx.com> provided the SQL to work around MySQL's lack
+of subqueries, and Dale Hege <fhege@lumenexus.net> provided the patches.
+Thanks!
+
+<baloo@gimpgirl.com> sent in several documentation patches.
+
+"Stephen Bechard" <steve@destek.net> sent in patches for svc_www services and
+other fixes.
+
+Charles A Beasley <cbeasley@noment.net> contributed quota editing for the
+Infostreet export.
+
+Richard Siddall <richard.siddall@elirion.net> sent in Mason fixes and other
+things I'm probably forgetting.
+
+Everything else is my (Ivan Kohler <ivan@420.am>) fault.
+
diff --git a/FS/Changes b/FS/Changes
new file mode 100644
index 000000000..c94ef10f5
--- /dev/null
+++ b/FS/Changes
@@ -0,0 +1,5 @@
+Revision history for Perl extension FS.
+
+0.01 Wed Aug 4 00:13:45 1999
+ - original version; created by h2xs 1.19
+
diff --git a/FS/FS.pm b/FS/FS.pm
new file mode 100644
index 000000000..e4a32082c
--- /dev/null
+++ b/FS/FS.pm
@@ -0,0 +1,231 @@
+package FS;
+
+use strict;
+use vars qw($VERSION);
+
+$VERSION = '0.01';
+
+#find missing entries in this file with:
+# for a in `ls *pm | cut -d. -f1`; do grep 'L<FS::'$a'>' ../FS.pm >/dev/null || echo "missing $a" ; done
+
+1;
+__END__
+
+=head1 NAME
+
+FS - Freeside Perl modules
+
+=head1 SYNOPSIS
+
+Freeside perl modules and CLI utilities.
+
+=head2 Utility classes
+
+L<FS::Conf> - Freeside configuration values
+
+L<FS::ConfItem> - Freeside configuration option meta-data.
+
+L<FS::UID> - User class (not yet OO)
+
+L<FS::CGI> - Non OO-subroutines for the web interface.
+
+L<FS::Msgcat> - Message catalog
+
+L<FS::SearchCache> - Search cache
+
+L<FS::raddb> - RADIUS dictionary
+
+=head2 Database record classes
+
+L<FS::Record> - Database record base class
+
+L<FS::svc_acct_pop> - POP (Point of Presence, not Post
+Office Protocol) class
+
+L<FS::part_pop_local> - Local calling area class
+
+L<FS::part_referral> - Referral class
+
+L<FS::cust_main_county> - Locale (tax rate) class
+
+L<FS::cust_tax_exempt> - Tax exemption record class
+
+L<FS::svc_Common> - Service base class
+
+L<FS::svc_acct> - Account (shell, RADIUS, POP3) class
+
+L<FS::radius_usergroup> - RADIUS groups
+
+L<FS::svc_domain> - Domain class
+
+L<FS::domain_record> - DNS zone entries
+
+L<FS::svc_forward> - Mail forwarding class
+
+L<FS::svc_www> - Web virtual host class.
+
+L<FS::part_svc> - Service definition class
+
+L<FS::part_svc_column> - Column constraint class
+
+L<FS::export_svc> - Class linking service definitions (see L<FS::part_svc>)
+with exports (see L<FS::part_export>)
+
+L<FS::part_export> - External provisioning export class
+
+L<FS::part_export_option> - Export option class
+
+L<FS::part_pkg> - Package (billing item) definition class
+
+L<FS::pkg_svc> - Class linking package (billing item)
+definitions (see L<FS::part_pkg>) with service definitions
+(see L<FS::part_svc>)
+
+L<FS::agent> - Agent (reseller) class
+
+L<FS::agent_type> - Agent type class
+
+L<FS::type_pkgs> - Class linking agent types (see
+L<FS::agent_type>) with package (billing item) definitions
+(see L<FS::part_pkg>)
+
+L<FS::cust_svc> - Service class
+
+L<FS::cust_pkg> - Package (billing item) class
+
+L<FS::cust_main> - Customer class
+
+L<FS::cust_main_invoice> - Invoice destination
+class
+
+L<FS::cust_bill> - Invoice class
+
+L<FS::cust_bill_pkg> - Invoice line item class
+
+L<FS::cust_bill_pkg_detail> - Invoice line item detail class
+
+L<FS::part_bill_event> - Invoice event definition class
+
+L<FS::cust_bill_event> - Completed invoice event class
+
+L<FS::cust_pay> - Payment class
+
+L<FS::cust_bill_pay> - Payment application class
+
+L<FS::cust_credit> - Credit class
+
+L<FS::cust_refund> - Refund class
+
+L<FS::cust_credit_refund> - Refund application class
+
+L<FS::cust_credit_bill> - Credit invoice application class
+
+L<FS::cust_pay_batch> - Credit card transaction queue class
+
+L<FS::prepay_credit> - Prepaid "calling card" credit class.
+
+L<FS::nas> - Network Access Server class
+
+L<FS::port> - NAS port class
+
+L<FS::session> - User login session class
+
+L<FS::queue> - Job queue
+
+L<FS::queue_arg> - Job arguments
+
+L<FS::queue_depend> - Job dependencies
+
+L<FS::msgcat> - Message catalogs
+
+=head1 Remote API modules
+
+L<FS::SignupClient>
+
+L<FS::SessionClient>
+
+L<FS::MailAdminServer>
+
+=head2 Command-line utilities
+
+L<freeside-adduser>
+
+L<freeside-queued>
+
+L<freeside-daily>
+
+L<freeside-expiration-alerter>
+
+L<freeside-email>
+
+L<freeside-cc-receipts-report>
+
+L<freeside-credit-report>
+
+L<freeside-receivables-report>
+
+L<freeside-tax-report>
+
+L<freeside-bill>
+
+L<freeside-overdue>
+
+=head2 User Interface classes (under (stalled) development; not yet usable)
+
+L<FS::UI::Base> - User-interface base class
+
+L<FS::UI::Gtk> - Gtk user-interface class
+
+L<FS::UI::CGI> - CGI (HTML) user-interface class
+
+L<FS::UI::agent> - agent table user-interface class
+
+=head2 Notes
+
+To quote perl(1), "If you're intending to read these straight through for the
+first time, the suggested order will tend to reduce the number of forward
+references."
+
+If you've never used OO modules before,
+http://www.perl.com/doc/FMTEYEWTK/easy_objects.html might help you out.
+
+=head1 DESCRIPTION
+
+Freeside is a billing and administration package for Internet Service
+Providers.
+
+The Freeside home page is at <http://www.sisd.com/freeside>.
+
+The main documentation is in httemplate/docs.
+
+=head1 SUPPORT
+
+A mailing list for users is available. Send a blank message to
+<ivan-freeside-subscribe@sisd.com> to subscribe.
+
+A mailing list for developers is available. It is intended to be lower volume
+and higher SNR than the users list. Send a blank message to
+<ivan-freeside-devel-subscribe@sisd.com> to subscribe.
+
+Commercial support is available; see
+<http://www.sisd.com/freeside/commercial.html>.
+
+=head1 AUTHOR
+
+Primarily Ivan Kohler <ivan@sisd.com>, with help from many kind folks.
+
+See the CREDITS file in the Freeside distribution for a (hopefully) complete
+list and the individal files for details.
+
+=head1 SEE ALSO
+
+perl(1), main Freeside documentation in htdocs/docs/
+
+=head1 BUGS
+
+Those modules which would be useful separately should be pulled out,
+renamed appropriately and uploaded to CPAN. So far: DBIx::DBSchema, Net::SSH
+and Net::SCP...
+
+=cut
+
diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm
new file mode 100644
index 000000000..86d20f6cb
--- /dev/null
+++ b/FS/FS/CGI.pm
@@ -0,0 +1,350 @@
+package FS::CGI;
+
+use strict;
+use vars qw(@EXPORT_OK @ISA);
+use Exporter;
+use CGI;
+use URI::URL;
+#use CGI::Carp qw(fatalsToBrowser);
+use FS::UID;
+
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(header menubar idiot eidiot popurl table itable ntable
+ small_custview myexit http_header);
+
+=head1 NAME
+
+FS::CGI - Subroutines for the web interface
+
+=head1 SYNOPSIS
+
+ use FS::CGI qw(header menubar idiot eidiot popurl);
+
+ print header( 'Title', '' );
+ print header( 'Title', menubar('item', 'URL', ... ) );
+
+ idiot "error message";
+ eidiot "error message";
+
+ $url = popurl; #returns current url
+ $url = popurl(3); #three levels up
+
+=head1 DESCRIPTION
+
+Provides a few common subroutines for the web interface.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item header TITLE, MENUBAR
+
+Returns an HTML header.
+
+=cut
+
+sub header {
+ my($title,$menubar,$etc)=@_; #$etc is for things like onLoad= etc.
+ #use Carp;
+ $etc = '' unless defined $etc;
+
+ my $x = <<END;
+ <HTML>
+ <HEAD>
+ <TITLE>
+ $title
+ </TITLE>
+ <META HTTP-Equiv="Cache-Control" Content="no-cache">
+ <META HTTP-Equiv="Pragma" Content="no-cache">
+ <META HTTP-Equiv="Expires" Content="0">
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8"$etc>
+ <FONT SIZE=7>
+ $title
+ </FONT>
+ <BR><BR>
+END
+ $x .= $menubar. "<BR><BR>" if $menubar;
+ $x;
+}
+
+=item http_header
+
+Sets an http header.
+
+=cut
+
+sub http_header {
+ my ( $header, $value ) = @_;
+ if (exists $ENV{MOD_PERL}) {
+ if ( defined $main::Response
+ && $main::Response->isa('Apache::ASP::Response') ) { #Apache::ASP
+ if ( $header =~ /^Content-Type$/ ) {
+ $main::Response->{ContentType} = $value;
+ } else {
+ $main::Response->AddHeader( $header => $value );
+ }
+ } elsif ( defined $HTML::Mason::Commands::r ) { #Mason
+ ## is this the correct pacakge for $r ??? for 1.0x and 1.1x ?
+ if ( $header =~ /^Content-Type$/ ) {
+ $HTML::Mason::Commands::r->content_type($value);
+ } else {
+ $HTML::Mason::Commands::r->header_out( $header => $value );
+ }
+ } else {
+ die "http_header called in unknown environment";
+ }
+ } else {
+ die "http_header called not running under mod_perl";
+ }
+
+}
+
+=item menubar ITEM, URL, ...
+
+Returns an HTML menubar.
+
+=cut
+
+sub menubar { #$menubar=menubar('Main Menu', '../', 'Item', 'url', ... );
+ my($item,$url,@html);
+ while (@_) {
+ ($item,$url)=splice(@_,0,2);
+ push @html, qq!<A HREF="$url">$item</A>!;
+ }
+ join(' | ',@html);
+}
+
+=item idiot ERROR
+
+This is depriciated. Don't use it.
+
+Sends an HTML error message.
+
+=cut
+
+sub idiot {
+ #warn "idiot depriciated";
+ my($error)=@_;
+# my $cgi = &FS::UID::cgi();
+# if ( $cgi->isa('CGI::Base') ) {
+# no strict 'subs';
+# &CGI::Base::SendHeaders;
+# } else {
+# print $cgi->header( @FS::CGI::header );
+# }
+ print <<END;
+<HTML>
+ <HEAD>
+ <TITLE>Error processing your request</TITLE>
+ <META HTTP-Equiv="Cache-Control" Content="no-cache">
+ <META HTTP-Equiv="Pragma" Content="no-cache">
+ <META HTTP-Equiv="Expires" Content="0">
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H4>Error processing your request</H4>
+ </CENTER>
+ Your request could not be processed because of the following error:
+ <P><B>$error</B>
+ </BODY>
+</HTML>
+END
+
+}
+
+=item eidiot ERROR
+
+This is depriciated. Don't use it.
+
+Sends an HTML error message, then exits.
+
+=cut
+
+sub eidiot {
+ warn "eidiot depriciated";
+ $HTML::Mason::Commands::r->send_http_header
+ if defined $HTML::Mason::Commands::r;
+ idiot(@_);
+ &myexit();
+}
+
+=item myexit
+
+You probably shouldn't use this; but if you must:
+
+If running under mod_perl, calles Apache::exit, otherwise, calls exit.
+
+=cut
+
+sub myexit {
+ if (exists $ENV{MOD_PERL}) {
+
+ if ( defined $main::Response
+ && $main::Response->isa('Apache::ASP::Response') ) { #Apache::ASP
+ $main::Response->End();
+ require Apache;
+ Apache::exit();
+ } elsif ( defined $HTML::Mason::Commands::m ) { #Mason
+ #$HTML::Mason::Commands::m->flush_buffer();
+ $HTML::Mason::Commands::m->abort();
+ die "shouldn't fall through to here (mason \$m->abort didn't)";
+ } else {
+ #??? well, it is $ENV{MOD_PERL}
+ warn "running under unknown mod_perl environment; trying Apache::exit()";
+ require Apache;
+ Apache::exit();
+ }
+ } else {
+ exit;
+ }
+}
+
+=item popurl LEVEL
+
+Returns current URL with LEVEL levels of path removed from the end (default 0).
+
+=cut
+
+sub popurl {
+ my($up)=@_;
+ my $cgi = &FS::UID::cgi;
+ my $url = new URI::URL ( $cgi->isa('Apache') ? $cgi->uri : $cgi->url );
+ my(@path)=$url->path_components;
+ splice @path, 0-$up;
+ $url->path_components(@path);
+ my $x = $url->as_string;
+ $x .= '/' unless $x =~ /\/$/;
+ $x;
+}
+
+=item table
+
+Returns HTML tag for beginning a table.
+
+=cut
+
+sub table {
+ my $col = shift;
+ if ( $col ) {
+ qq!<TABLE BGCOLOR="$col" BORDER=1 WIDTH="100%" CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999">!;
+ } else {
+ '<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999">';
+ }
+}
+
+=item itable
+
+Returns HTML tag for beginning an (invisible) table.
+
+=cut
+
+sub itable {
+ my $col = shift;
+ my $cellspacing = shift || 0;
+ if ( $col ) {
+ qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing WIDTH="100%">!;
+ } else {
+ qq!<TABLE BORDER=0 CELLSPACING=$cellspacing WIDTH="100%">!;
+ }
+}
+
+=item ntable
+
+This is getting silly.
+
+=cut
+
+sub ntable {
+ my $col = shift;
+ my $cellspacing = shift || 0;
+ if ( $col ) {
+ qq!<TABLE BGCOLOR="$col" BORDER=0 CELLSPACING=$cellspacing>!;
+ } else {
+ '<TABLE BORDER CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999">';
+ }
+
+}
+
+=item small_custview CUSTNUM || CUST_MAIN_OBJECT, COUNTRYDEFAULT
+
+Sheesh. I should just switch to Mason.
+
+=cut
+
+sub small_custview {
+ use FS::Record qw(qsearchs);
+ use FS::cust_main;
+
+ my $arg = shift;
+ my $countrydefault = shift || 'US';
+
+ my $cust_main = ref($arg) ? $arg
+ : qsearchs('cust_main', { 'custnum' => $arg } )
+ or die "unknown custnum $arg";
+
+ my $html = 'Customer #<B>'. $cust_main->custnum. '</B>'.
+ ntable('#e8e8e8'). '<TR><TD>'. ntable("#cccccc",2).
+ '<TR><TD ALIGN="right" VALIGN="top">Billing<BR>Address</TD><TD BGCOLOR="#ffffff">'.
+ $cust_main->getfield('last'). ', '. $cust_main->first. '<BR>';
+
+ $html .= $cust_main->company. '<BR>' if $cust_main->company;
+ $html .= $cust_main->address1. '<BR>';
+ $html .= $cust_main->address2. '<BR>' if $cust_main->address2;
+ $html .= $cust_main->city. ', '. $cust_main->state. ' '. $cust_main->zip. '<BR>';
+ $html .= $cust_main->country. '<BR>'
+ if $cust_main->country && $cust_main->country ne $countrydefault;
+
+ $html .= '</TD></TR></TABLE></TD>';
+
+ if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+
+ my $pre = $cust_main->ship_last ? 'ship_' : '';
+
+ $html .= '<TD>'. ntable("#cccccc",2).
+ '<TR><TD ALIGN="right" VALIGN="top">Service<BR>Address</TD><TD BGCOLOR="#ffffff">'.
+ $cust_main->get("${pre}last"). ', '.
+ $cust_main->get("${pre}first"). '<BR>';
+ $html .= $cust_main->get("${pre}company"). '<BR>'
+ if $cust_main->get("${pre}company");
+ $html .= $cust_main->get("${pre}address1"). '<BR>';
+ $html .= $cust_main->get("${pre}address2"). '<BR>'
+ if $cust_main->get("${pre}address2");
+ $html .= $cust_main->get("${pre}city"). ', '.
+ $cust_main->get("${pre}state"). ' '.
+ $cust_main->get("${pre}ship_zip"). '<BR>';
+ $html .= $cust_main->get("${pre}country"). '<BR>'
+ if $cust_main->get("${pre}country")
+ && $cust_main->get("${pre}country") ne $countrydefault;
+
+ $html .= '</TD></TR></TABLE></TD>';
+ }
+
+ $html .= '</TR></TABLE>';
+
+ $html .= '<BR>Balance: <B>$'. $cust_main->balance. '</B><BR>';
+
+ # last payment might be good here too?
+
+ $html;
+}
+
+=back
+
+=head1 BUGS
+
+Not OO.
+
+Not complete.
+
+small_custview sooooo doesn't belong here. i should just switch to Mason.
+
+=head1 SEE ALSO
+
+L<CGI>, L<CGI::Base>
+
+=cut
+
+1;
+
+
diff --git a/FS/FS/ClientAPI.pm b/FS/FS/ClientAPI.pm
new file mode 100644
index 000000000..7cbbdbf67
--- /dev/null
+++ b/FS/FS/ClientAPI.pm
@@ -0,0 +1,44 @@
+package FS::ClientAPI;
+
+use strict;
+use vars qw(%handler $domain);
+
+%handler = ();
+
+#find modules
+foreach my $INC ( @INC ) {
+ foreach my $file ( glob("$INC/FS/ClientAPI/*.pm") ) {
+ $file =~ /\/(\w+)\.pm$/ or do {
+ warn "unrecognized ClientAPI file: $file";
+ next
+ };
+ my $mod = $1;
+ #warn "using FS::ClientAPI::$mod";
+ eval "use FS::ClientAPI::$mod;";
+ die "error using FS::ClientAPI::$mod: $@" if $@;
+ }
+}
+
+#(sub for modules)
+sub register_handlers {
+ my $self = shift;
+ my %new_handlers = @_;
+ foreach my $key ( keys %new_handlers ) {
+ warn "WARNING: redefining sub $key" if exists $handler{$key};
+ #warn "registering $key";
+ $handler{$key} = $new_handlers{$key};
+ }
+}
+
+#---
+
+sub dispatch {
+ my ( $self, $name ) = ( shift, shift );
+ my $sub = $handler{$name}
+ or die "unknown FS::ClientAPI sub $name (known: ". join(" ", keys %handler );
+ #or die "unknown FS::ClientAPI sub $name";
+ &{$sub}(@_);
+}
+
+1;
+
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
new file mode 100644
index 000000000..e12e93b12
--- /dev/null
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -0,0 +1,257 @@
+package FS::ClientAPI::MyAccount;
+
+use strict;
+use vars qw($cache);
+use Digest::MD5 qw(md5_hex);
+use Date::Format;
+use Business::CreditCard;
+use Cache::SharedMemoryCache; #store in db?
+use FS::CGI qw(small_custview); #doh
+use FS::Conf;
+use FS::Record qw(qsearch qsearchs);
+use FS::svc_acct;
+use FS::svc_domain;
+use FS::cust_main;
+use FS::cust_bill;
+use FS::cust_main_county;
+
+use FS::ClientAPI; #hmm
+FS::ClientAPI->register_handlers(
+ 'MyAccount/login' => \&login,
+ 'MyAccount/customer_info' => \&customer_info,
+ 'MyAccount/invoice' => \&invoice,
+ 'MyAccount/cancel' => \&cancel,
+ 'MyAccount/payment_info' => \&payment_info,
+ 'MyAccount/process_payment' => \&process_payment,
+);
+
+#store in db?
+my $cache = new Cache::SharedMemoryCache();
+
+#false laziness w/FS::ClientAPI::passwd::passwd (needs to handle encrypted pw)
+sub login {
+ my $p = shift;
+
+ my $svc_domain = qsearchs('svc_domain', { 'domain' => $p->{'domain'} } )
+ or return { error => "Domain not found" };
+
+ my $svc_acct =
+ ( length($p->{'password'}) < 13
+ && qsearchs( 'svc_acct', { 'username' => $p->{'username'},
+ 'domsvc' => $svc_domain->svcnum,
+ '_password' => $p->{'password'} } )
+ )
+ || qsearchs( 'svc_acct', { 'username' => $p->{'username'},
+ 'domsvc' => $svc_domain->svcnum,
+ '_password' => $p->{'password'} } );
+
+ unless ( $svc_acct ) { return { error => 'Incorrect password.' } }
+
+ my $session = {
+ 'svcnum' => $svc_acct->svcnum,
+ };
+
+ my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
+ if ( $cust_pkg ) {
+ my $cust_main = $cust_pkg->cust_main;
+ $session->{'custnum'} = $cust_main->custnum;
+ }
+
+ my $session_id;
+ do {
+ $session_id = md5_hex(md5_hex(time(). {}. rand(). $$))
+ } until ( ! defined $cache->get($session_id) ); #just in case
+
+ $cache->set( $session_id, $session, '1 hour' );
+
+ return { 'error' => '',
+ 'session_id' => $session_id,
+ };
+}
+
+sub customer_info {
+ my $p = shift;
+ my $session = $cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my %return;
+
+ my $custnum = $session->{'custnum'};
+
+ if ( $custnum ) { #customer record
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or return { 'error' => "unknown custnum $custnum" };
+
+ $return{balance} = $cust_main->balance;
+
+ my @open = map {
+ {
+ invnum => $_->invnum,
+ date => time2str("%b %o, %Y", $_->_date),
+ owed => $_->owed,
+ };
+ } $cust_main->open_cust_bill;
+ $return{open_invoices} = \@open;
+
+ my $conf = new FS::Conf;
+ $return{small_custview} =
+ small_custview( $cust_main, $conf->config('defaultcountry') );
+
+ $return{name} = $cust_main->first. ' '. $cust_main->get('last');
+
+ } else { #no customer record
+
+ my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $session->{'svcnum'} } )
+ or die "unknown svcnum";
+ $return{name} = $svc_acct->email;
+
+ }
+
+ return { 'error' => '',
+ 'custnum' => $custnum,
+ %return,
+ };
+
+}
+
+sub payment_info {
+ my $p = shift;
+ my $session = $cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my %return;
+
+ my $custnum = $session->{'custnum'};
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or return { 'error' => "unknown custnum $custnum" };
+
+ $return{balance} = $cust_main->balance;
+
+ $return{payname} = $cust_main->payname
+ || ( $cust_main->first. ' '. $cust_main->get('last') );
+
+ $return{$_} = $cust_main->get($_) for qw(address1 address2 city state zip);
+
+ $return{payby} = $cust_main->payby;
+
+ if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
+ warn $return{card_type} = cardtype($cust_main->payinfo);
+ $return{payinfo} = $cust_main->payinfo;
+
+ if ( $cust_main->paydate =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #Pg date format
+ @return{'month', 'year'} = ( $2, $1 );
+ } elsif ( $cust_main->paydate =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ @return{'month', 'year'} = ( $1, $3 );
+ }
+
+ }
+
+ #list all counties/states/countries
+ $return{'cust_main_county'} =
+ [ map { $_->hashref } qsearch('cust_main_county', {}) ],
+
+ #shortcut for one-country folks
+ my $conf = new FS::Conf;
+ my %states = map { $_->state => 1 }
+ qsearch('cust_main_county', {
+ 'country' => $conf->config('defaultcountry') || 'US'
+ } );
+ $return{'states'} = [ sort { $a cmp $b } keys %states ];
+
+ $return{card_types} = {
+ 'VISA' => 'VISA card',
+ 'MasterCard' => 'MasterCard',
+ 'Discover' => 'Discover card',
+ 'American Express' => 'American Express card',
+ };
+
+ my $_date = time;
+ $return{paybatch} = "webui-MyAccount-$_date-$$-". rand() * 2**32;
+
+ return { 'error' => '',
+ %return,
+ };
+
+};
+
+sub process_payment {
+ my $p = shift;
+
+ my $session = $cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my %return;
+
+ my $custnum = $session->{'custnum'};
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or return { 'error' => "unknown custnum $custnum" };
+
+ if ( $p->{'save'} ) {
+ my $new = new FS::cust_main { $cust_main->hash };
+ $new->set( $_ => $p->{$_} )
+ foreach qw( payname address1 address2 city state zip payinfo );
+ $new->set( 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01' );
+ $new->set( 'payby' => $p->{'auto'} ? 'CARD' : 'DCRD' );
+ my $error = $new->replace($cust_main);
+ return { 'error' => $error } if $error;
+ $cust_main = $new;
+ }
+
+ my $error = $cust_main->realtime_bop( 'CC', $p->{'amount'}, quiet=>1,
+ 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01',
+ map { $_ => $p->{$_} }
+ qw( payname address1 address2 city state zip payinfo )
+ );
+ return { 'error' => $error } if $error;
+
+ $cust_main->apply_payments;
+
+ return { 'error' => '' };
+
+}
+
+sub invoice {
+ my $p = shift;
+ my $session = $cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my $custnum = $session->{'custnum'};
+
+ my $invnum = $p->{'invnum'};
+
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $invnum,
+ 'custnum' => $custnum } )
+ or return { 'error' => "Can't find invnum" };
+
+ #my %return;
+
+ return { 'error' => '',
+ 'invnum' => $invnum,
+ 'invoice_text' => join('', $cust_bill->print_text ),
+ };
+
+}
+
+sub cancel {
+ my $p = shift;
+ my $session = $cache->get($p->{'session_id'})
+ or return { 'error' => "Can't resume session" }; #better error message
+
+ my $custnum = $session->{'custnum'};
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or return { 'error' => "unknown custnum $custnum" };
+
+ my @errors = $cust_main->cancel;
+
+ my $error = scalar(@errors) ? join(' / ', @errors) : '';
+
+ return { 'error' => $error };
+
+}
+
+1;
+
diff --git a/FS/FS/ClientAPI/passwd.pm b/FS/FS/ClientAPI/passwd.pm
new file mode 100644
index 000000000..016ebff79
--- /dev/null
+++ b/FS/FS/ClientAPI/passwd.pm
@@ -0,0 +1,57 @@
+package FS::ClientAPI::passwd;
+
+use strict;
+use FS::Record qw(qsearchs);
+use FS::svc_acct;
+#use FS::svc_domain;
+
+use FS::ClientAPI; #hmm
+FS::ClientAPI->register_handlers(
+ 'passwd/passwd' => \&passwd,
+ 'passwd/chfn' => \&chfn,
+ 'passwd/chsh' => \&chsh,
+);
+
+sub passwd {
+ my $packet = shift;
+
+ my $domain = $FS::ClientAPI::domain || $packet->{'domain'};
+ my $svc_domain = qsearchs('svc_domain', { 'domain' => $domain } )
+ or return { error => "Domain $domain not found" };
+
+ my $old_password = $packet->{'old_password'};
+ my $new_password = $packet->{'new_password'};
+ my $new_gecos = $packet->{'new_gecos'};
+ my $new_shell = $packet->{'new_shell'};
+
+#false laziness w/FS::ClientAPI::MyAccount::login (needs to handle encrypted pw)
+ my $svc_acct =
+ ( length($old_password) < 13
+ && qsearchs( 'svc_acct', { 'username' => $packet->{'username'},
+ 'domsvc' => $svc_domain->svcnum,
+ '_password' => $old_password } )
+ )
+ || qsearchs( 'svc_acct', { 'username' => $packet->{'username'},
+ 'domsvc' => $svc_domain->svcnum,
+ '_password' => $old_password } );
+
+ unless ( $svc_acct ) { return { error => 'Incorrect password.' } }
+
+ my %hash = $svc_acct->hash;
+ my $new_svc_acct = new FS::svc_acct ( \%hash );
+ $new_svc_acct->setfield('_password', $new_password )
+ if $new_password && $new_password ne $old_password;
+ $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos;
+ $new_svc_acct->setfield('shell',$new_shell) if $new_shell;
+ my $error = $new_svc_acct->replace($svc_acct);
+
+ return { error => $error };
+
+}
+
+sub chfn {}
+
+sub chsh {}
+
+1;
+
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
new file mode 100644
index 000000000..706ebe720
--- /dev/null
+++ b/FS/FS/Conf.pm
@@ -0,0 +1,1059 @@
+package FS::Conf;
+
+use vars qw($default_dir @config_items $DEBUG );
+use IO::File;
+use File::Basename;
+use FS::ConfItem;
+
+$DEBUG = 0;
+
+=head1 NAME
+
+FS::Conf - Freeside configuration values
+
+=head1 SYNOPSIS
+
+ use FS::Conf;
+
+ $conf = new FS::Conf "/config/directory";
+
+ $FS::Conf::default_dir = "/config/directory";
+ $conf = new FS::Conf;
+
+ $dir = $conf->dir;
+
+ $value = $conf->config('key');
+ @list = $conf->config('key');
+ $bool = $conf->exists('key');
+
+ $conf->touch('key');
+ $conf->set('key' => 'value');
+ $conf->delete('key');
+
+ @config_items = $conf->config_items;
+
+=head1 DESCRIPTION
+
+Read and write Freeside configuration values. Keys currently map to filenames,
+but this may change in the future.
+
+=head1 METHODS
+
+=over 4
+
+=item new [ DIRECTORY ]
+
+Create a new configuration object. A directory arguement is required if
+$FS::Conf::default_dir has not been set.
+
+=cut
+
+sub new {
+ my($proto,$dir) = @_;
+ my($class) = ref($proto) || $proto;
+ my($self) = { 'dir' => $dir || $default_dir } ;
+ bless ($self, $class);
+}
+
+=item dir
+
+Returns the directory.
+
+=cut
+
+sub dir {
+ my($self) = @_;
+ my $dir = $self->{dir};
+ -e $dir or die "FATAL: $dir doesn't exist!";
+ -d $dir or die "FATAL: $dir isn't a directory!";
+ -r $dir or die "FATAL: Can't read $dir!";
+ -x $dir or die "FATAL: $dir not searchable (executable)!";
+ $dir =~ /^(.*)$/;
+ $1;
+}
+
+=item config KEY
+
+Returns the configuration value or values (depending on context) for key.
+
+=cut
+
+sub config {
+ my($self,$file)=@_;
+ my($dir)=$self->dir;
+ my $fh = new IO::File "<$dir/$file" or return;
+ if ( wantarray ) {
+ map {
+ /^(.*)$/
+ or die "Illegal line (array context) in $dir/$file:\n$_\n";
+ $1;
+ } <$fh>;
+ } else {
+ <$fh> =~ /^(.*)$/
+ or die "Illegal line (scalar context) in $dir/$file:\n$_\n";
+ $1;
+ }
+}
+
+=item exists KEY
+
+Returns true if the specified key exists, even if the corresponding value
+is undefined.
+
+=cut
+
+sub exists {
+ my($self,$file)=@_;
+ my($dir) = $self->dir;
+ -e "$dir/$file";
+}
+
+=item touch KEY
+
+Creates the specified configuration key if it does not exist.
+
+=cut
+
+sub touch {
+ my($self, $file) = @_;
+ my $dir = $self->dir;
+ unless ( $self->exists($file) ) {
+ warn "[FS::Conf] TOUCH $file\n" if $DEBUG;
+ system('touch', "$dir/$file");
+ }
+}
+
+=item set KEY VALUE
+
+Sets the specified configuration key to the given value.
+
+=cut
+
+sub set {
+ my($self, $file, $value) = @_;
+ my $dir = $self->dir;
+ $value =~ /^(.*)$/s;
+ $value = $1;
+ unless ( join("\n", @{[ $self->config($file) ]}) eq $value ) {
+ warn "[FS::Conf] SET $file\n" if $DEBUG;
+# warn "$dir" if is_tainted($dir);
+# warn "$dir" if is_tainted($file);
+ chmod 0644, "$dir/$file";
+ my $fh = new IO::File ">$dir/$file" or return;
+ chmod 0644, "$dir/$file";
+ print $fh "$value\n";
+ }
+}
+#sub is_tainted {
+# return ! eval { join('',@_), kill 0; 1; };
+# }
+
+=item delete KEY
+
+Deletes the specified configuration key.
+
+=cut
+
+sub delete {
+ my($self, $file) = @_;
+ my $dir = $self->dir;
+ if ( $self->exists($file) ) {
+ warn "[FS::Conf] DELETE $file\n";
+ unlink "$dir/$file";
+ }
+}
+
+=item config_items
+
+Returns all of the possible configuration items as FS::ConfItem objects. See
+L<FS::ConfItem>.
+
+=cut
+
+sub config_items {
+ my $self = shift;
+ #quelle kludge
+ @config_items,
+ map {
+ my $basename = basename($_);
+ $basename =~ /^(.*)$/;
+ $basename = $1;
+ new FS::ConfItem {
+ 'key' => $basename,
+ 'section' => 'billing',
+ 'description' => 'Alternate template file for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
+ 'type' => 'textarea',
+ }
+ } glob($self->dir. '/invoice_template_*')
+ ;
+}
+
+=back
+
+=head1 BUGS
+
+If this was more than just crud that will never be useful outside Freeside I'd
+worry that config_items is freeside-specific and icky.
+
+=head1 SEE ALSO
+
+"Configuration" in the web interface (config/config.cgi).
+
+httemplate/docs/config.html
+
+=cut
+
+@config_items = map { new FS::ConfItem $_ } (
+
+ {
+ 'key' => 'address',
+ 'section' => 'deprecated',
+ 'description' => 'This configuration option is no longer used. See <a href="#invoice_template">invoice_template</a> instead.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'alerter_template',
+ 'section' => 'billing',
+ 'description' => 'Template file for billing method expiration alerts. See the <a href="../docs/billing.html#invoice_template">billing documentation</a> for details.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'apacheroot',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. The directory containing Apache virtual hosts',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'apacheip',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be the current IP address to assign to new virtual hosts',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'apachemachine',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>www_shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. A machine with the apacheroot directory and user home directories. The existance of this file enables setup of virtual host directories, and, in conjunction with the `home\' configuration file, symlinks into user home directories.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'apachemachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>apache</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be Apache machines, one per line. This enables export of `/etc/apache/vhosts.conf\', which can be included in your Apache configuration via the <a href="http://www.apache.org/docs/mod/core.html#include">Include</a> directive.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'bindprimary',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>bind</i> <a href="../browse/part_export.cgi">export</a> instead. Your BIND primary nameserver. This enables export of /var/named/named.conf and zone files into /var/named',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'bindsecondaries',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>bind_slave</i> <a href="../browse/part_export.cgi">export</a> instead. Your BIND secondary nameservers, one per line. This enables export of /var/named/named.conf',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'business-onlinepayment',
+ 'section' => 'billing',
+ 'description' => '<a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support, at least three lines: processor, login, and password. An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\'). Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'business-onlinepayment-ach',
+ 'section' => 'billing',
+ 'description' => 'Alternate <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> support for ACH transactions (defaults to regular <b>business-onlinepayment</b>). At least three lines: processor, login, and password. An optional fourth line specifies the action or actions (multiple actions are separated with `,\': for example: `Authorization Only, Post Authorization\'). Optional additional lines are passed to Business::OnlinePayment as %processor_options.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'business-onlinepayment-description',
+ 'section' => 'billing',
+ 'description' => 'String passed as the description field to <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a>. Evaluated as a double-quoted perl string, with the following variables available: <code>$agent</code> (the agent name), and <code>$pkgs</code> (a comma-separated list of packages to which the invoiced being charged applies)',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'bsdshellmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>bsdshell</i> <a href="../browse/part_export.cgi">export</a> instead. Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd\' and `/etc/master.passwd\'.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'countrydefault',
+ 'section' => 'UI',
+ 'description' => 'Default two-letter country code (if not supplied, the default is `US\')',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'cyrus',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>cyrus</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to integrate with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>, three lines: IMAP server, admin username, and admin password. Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'cp_app',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>cp</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to integrate with <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>, four lines: "host:port", username, password, and workgroup (for new users).',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'deletecustomers',
+ 'section' => 'UI',
+ 'description' => 'Enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers\' packages if they cancel service.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'deletepayments',
+ 'section' => 'UI',
+ 'description' => 'Enable deletion of unclosed payments. Be very careful! Only delete payments that were data-entry errors, not adjustments. Optionally specify one or more comma-separated email addresses to be notified when a payment is deleted.',
+ 'type' => [qw( checkbox text )],
+ },
+
+ {
+ 'key' => 'unapplypayments',
+ 'section' => 'UI',
+ 'description' => 'Enable "unapplication" of unclosed payments.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'dirhash',
+ 'section' => 'shell',
+ 'description' => 'Optional numeric value to control directory hashing. If positive, hashes directories for the specified number of levels from the front of the username. If negative, hashes directories for the specified number of levels from the end of the username. Some examples: <ul><li>1: user -> <a href="#home">/home</a>/u/user<li>2: user -> <a href="#home">/home</a>/u/s/user<li>-1: user -> <a href="#home">/home</a>/r/user<li>-2: user -> <a href="#home">home</a>/r/e/user</ul>',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'disable_customer_referrals',
+ 'section' => 'UI',
+ 'description' => 'Disable new customer-to-customer referrals in the web interface',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'editreferrals',
+ 'section' => 'UI',
+ 'description' => 'Enable advertising source modification for existing customers',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'emailinvoiceonly',
+ 'section' => 'billing',
+ 'description' => 'Disables postal mail invoices',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'disablepostalinvoicedefault',
+ 'section' => 'billing',
+ 'description' => 'Disables postal mail invoices as the default option in the UI. Be careful not to setup customers which are not sent invoices. See <a href ="#emailinvoiceauto">emailinvoiceauto</a>.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'emailinvoiceauto',
+ 'section' => 'billing',
+ 'description' => 'Automatically adds new accounts to the email invoice list',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'exclude_ip_addr',
+ 'section' => '',
+ 'description' => 'Exclude these from the list of available broadband service IP addresses. (One per line)',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'erpcdmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, ERPCD is no longer supported. Used to be ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd\' and `/usr/annex/acp_dialup\'',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'hidecancelledpackages',
+ 'section' => 'UI',
+ 'description' => 'Prevent cancelled packages from showing up in listings (though they will still be in the database)',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'hidecancelledcustomers',
+ 'section' => 'UI',
+ 'description' => 'Prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'home',
+ 'section' => 'required',
+ 'description' => 'For new users, prefixed to username to create a directory name. Should have a leading but not a trailing slash.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'icradiusmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to enable radcheck and radreply table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck and radreply tables needs to be created manually). You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option. <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line. Machines listed in this file will have the radcheck table exported to them. Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password. For example: <CODE>"radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd"</CODE></blockquote>',
+ 'type' => [qw( checkbox textarea )],
+ },
+
+ {
+ 'key' => 'icradius_mysqldest',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be the destination directory for the MySQL databases, on the ICRADIUS/FreeRADIUS machines. Defaults to "/usr/local/var/".',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'icradius_mysqlsource',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be the source directory for for the MySQL radcheck table files, on the Freeside machine. Defaults to "/usr/local/var/freeside".',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'icradius_secrets',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to specify a database for ICRADIUS/FreeRADIUS export. Three lines: DBI data source, username and password.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'invoice_from',
+ 'section' => 'required',
+ 'description' => 'Return address on email invoices',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'invoice_template',
+ 'section' => 'required',
+ 'description' => 'Required template file for invoices. See the <a href="../docs/billing.html">billing documentation</a> for details.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'lpr',
+ 'section' => 'required',
+ 'description' => 'Print command for paper invoices, for example `lpr -h\'',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'maildisablecatchall',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, now the default. Turning this option on used to disable the requirement that each virtual domain have a catch-all mailbox.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'money_char',
+ 'section' => '',
+ 'description' => 'Currency symbol - defaults to `$\'',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'mxmachines',
+ 'section' => 'deprecated',
+ 'description' => 'MX entries for new domains, weight and machine, one per line, with trailing `.\'',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'nsmachines',
+ 'section' => 'deprecated',
+ 'description' => 'NS nameservers for new domains, one per line, with trailing `.\'',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'defaultrecords',
+ 'section' => 'BIND',
+ 'description' => 'DNS entries to add automatically when creating a domain',
+ 'type' => 'editlist',
+ 'editlist_parts' => [ { type=>'text' },
+ { type=>'immutable', value=>'IN' },
+ { type=>'select',
+ select_enum=>{ map { $_=>$_ } qw(A CNAME MX NS)} },
+ { type=> 'text' }, ],
+ },
+
+ {
+ 'key' => 'arecords',
+ 'section' => 'deprecated',
+ 'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'cnamerecords',
+ 'section' => 'deprecated',
+ 'description' => 'A list of tab seperated CNAME records to add automatically when creating a domain',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'nismachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>. Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd\' and `/etc/global/shadow\'.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'passwordmin',
+ 'section' => 'password',
+ 'description' => 'Minimum password length (default 6)',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'passwordmax',
+ 'section' => 'password',
+ 'description' => 'Maximum password length (default 8) (don\'t set this over 12 if you need to import or export crypt() passwords)',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'qmailmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add <i>qmail</i> and <i>shellcommands</i> <a href="../browse/part_export.cgi">exports</a> instead. This option used to export `/var/qmail/control/virtualdomains\', `/var/qmail/control/recipientmap\', and `/var/qmail/control/rcpthosts\'. Setting this option (even if empty) also turns on user `.qmail-extension\' file maintenance in conjunction with the <b>shellmachine</b> option.',
+ 'type' => [qw( checkbox textarea )],
+ },
+
+ {
+ 'key' => 'radiusmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add an <i>sqlradius</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to export to be: your RADIUS authentication machines, one per line. This enables export of `/etc/raddb/users\'.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'referraldefault',
+ 'section' => 'UI',
+ 'description' => 'Default referral, specified by refnum',
+ 'type' => 'text',
+ },
+
+# {
+# 'key' => 'registries',
+# 'section' => 'required',
+# 'description' => 'Directory which contains domain registry information. Each registry is a directory.',
+# },
+
+ {
+ 'key' => 'report_template',
+ 'section' => 'required',
+ 'description' => 'Required template file for reports. See the <a href="../docs/billing.html">billing documentation</a> for details.',
+ 'type' => 'textarea',
+ },
+
+
+ {
+ 'key' => 'maxsearchrecordsperpage',
+ 'section' => 'UI',
+ 'description' => 'If set, number of search records to return per page.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'sendmailconfigpath',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be sendmail configuration file path. Defaults to `/etc\'. Many newer distributions use `/etc/mail\'.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'sendmailmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead. Used to be sendmail machines, one per line. This enables export of `/etc/virtusertable\' and `/etc/sendmail.cw\'.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'sendmailrestart',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>sendmail</i> <a href="../browse/part_export.cgi">export</a> instead. Used to define the command which is run on sendmail machines after files are copied.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'session-start',
+ 'section' => 'session',
+ 'description' => 'If defined, the command which is executed on the Freeside machine when a session begins. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'session-stop',
+ 'section' => 'session',
+ 'description' => 'If defined, the command which is executed on the Freeside machine when a session ends. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'shellmachine',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to contain a single machine with user home directories mounted. This enables home directory creation, renaming and archiving/deletion. In conjunction with `qmailmachines\', it also enables `.qmail-extension\' file maintenance.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'shellmachine-useradd',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to contain command(s) to run on shellmachine when an account is created. If the <b>shellmachine</b> option is set but this option is not, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default. If this option is set but empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead. Otherwise the value is evaluated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.',
+ 'type' => [qw( checkbox text )],
+ },
+
+ {
+ 'key' => 'shellmachine-userdel',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to contain command(s) to run on shellmachine when an account is deleted. If the <b>shellmachine</b> option is set but this option is not, <code>userdel $username</code> is the default. If this option is set but empty, <code>rm -rf $dir</code> is the default instead. Otherwise the value is evaluated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.',
+ 'type' => [qw( checkbox text )],
+ },
+
+ {
+ 'key' => 'shellmachine-usermod',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>shellcommands</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to contain command(s) to run on shellmachine when an account is modified. If the <b>shellmachine</b> option is set but this option is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.',
+ #'type' => [qw( checkbox text )],
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'shellmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>sysvshell</i> <a href="../browse/part_export.cgi">export</a> instead. Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd\' and `/etc/shadow\' files.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'shells',
+ 'section' => 'required',
+ 'description' => 'Legal shells (think /etc/shells). You probably want to `cut -d: -f7 /etc/passwd | sort | uniq\' initially so that importing doesn\'t fail with `Illegal shell\' errors, then remove any special entries afterwords. A blank line specifies that an empty shell is permitted.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'showpasswords',
+ 'section' => 'UI',
+ 'description' => 'Display unencrypted user passwords in the web interface',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'signupurl',
+ 'section' => 'UI',
+ 'description' => 'if you are using customer-to-customer referrals, and you enter the URL of your <a href="../docs/signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'smtpmachine',
+ 'section' => 'required',
+ 'description' => 'SMTP relay for Freeside\'s outgoing mail',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soadefaultttl',
+ 'section' => 'BIND',
+ 'description' => 'SOA default TTL for new domains.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soaemail',
+ 'section' => 'BIND',
+ 'description' => 'SOA email for new domains, in BIND form (`.\' instead of `@\'), with trailing `.\'',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soaexpire',
+ 'section' => 'BIND',
+ 'description' => 'SOA expire for new domains',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soamachine',
+ 'section' => 'BIND',
+ 'description' => 'SOA machine for new domains, with trailing `.\'',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soarefresh',
+ 'section' => 'BIND',
+ 'description' => 'SOA refresh for new domains',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'soaretry',
+ 'section' => 'BIND',
+ 'description' => 'SOA retry for new domains',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'statedefault',
+ 'section' => 'UI',
+ 'description' => 'Default state or province (if not supplied, the default is `CA\')',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'radiusprepend',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, real-time text radius now edits an existing file in place - just (turn off freeside-queued and) edit your RADIUS users file directly. The contents used to be be prepended to the top of the RADIUS users file (text exports only).',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'textradiusprepend',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, use RADIUS check attributes instead. The contents used to be prepended to the first line of a user\'s RADIUS entry in text exports.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'unsuspendauto',
+ 'section' => 'billing',
+ 'description' => 'Enables the automatic unsuspension of suspended packages when a customer\'s balance due changes from positive to zero or negative as the result of a payment or credit',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'usernamemin',
+ 'section' => 'username',
+ 'description' => 'Minimum username length (default 2)',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'usernamemax',
+ 'section' => 'username',
+ 'description' => 'Maximum username length',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'username-ampersand',
+ 'section' => 'username',
+ 'description' => 'Allow the ampersand character (&amp;) in usernames. Be careful when using this option in conjunction with <a href="#shellmachine-useradd">shellmachine-useradd</a> and other configuration options which execute shell commands, as the ampersand will be interpreted by the shell if not quoted.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-letter',
+ 'section' => 'username',
+ 'description' => 'Usernames must contain at least one letter',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-letterfirst',
+ 'section' => 'username',
+ 'description' => 'Usernames must start with a letter',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-noperiod',
+ 'section' => 'username',
+ 'description' => 'Disallow periods in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-nounderscore',
+ 'section' => 'username',
+ 'description' => 'Disallow underscores in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-nodash',
+ 'section' => 'username',
+ 'description' => 'Disallow dashes in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username-uppercase',
+ 'section' => 'username',
+ 'description' => 'Allow uppercase characters in usernames',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'username_policy',
+ 'section' => 'deprecated',
+ 'description' => 'This file controls the mechanism for preventing duplicate usernames in passwd/radius files exported from svc_accts. This should be one of \'prepend domsvc\' \'append domsvc\' \'append domain\' or \'append @domain\'',
+ 'type' => 'select',
+ 'select_enum' => [ 'prepend domsvc', 'append domsvc', 'append domain', 'append @domain' ],
+ #'type' => 'text',
+ },
+
+ {
+ 'key' => 'vpopmailmachines',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to contain your vpopmail pop toasters, one per line. Each line is of the form "machinename vpopdir vpopuid vpopgid". For example: <code>poptoaster.domain.tld /home/vpopmail 508 508</code> Note: vpopuid and vpopgid are values taken from the vpopmail machine\'s /etc/passwd',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'vpopmailrestart',
+ 'section' => 'deprecated',
+ 'description' => '<b>DEPRECATED</b>, add a <i>vpopmail</i> <a href="../browse/part_export.cgi">export</a> instead. This option used to define the shell commands to run on vpopmail machines after files are copied. An example can be found in eg/vpopmailrestart of the source distribution.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'safe-part_pkg',
+ 'section' => 'UI',
+ 'description' => 'Validates package definition setup and recur expressions against a preset list. Useful for webdemos, annoying to powerusers.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'safe-part_bill_event',
+ 'section' => 'UI',
+ 'description' => 'Validates invoice event expressions against a preset list. Useful for webdemos, annoying to powerusers.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'show_ss',
+ 'section' => 'UI',
+ 'description' => 'Turns on display/collection of SS# in the web interface.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'agent_defaultpkg',
+ 'section' => 'UI',
+ 'description' => 'Setting this option will cause new packages to be available to all agent types by default.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'legacy_link',
+ 'section' => 'UI',
+ 'description' => 'Display options in the web interface to link legacy pre-Freeside services.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'queue_dangerous_controls',
+ 'section' => 'UI',
+ 'description' => 'Enable queue modification controls on account pages and for new jobs. Unless you are a developer working on new export code, you should probably leave this off to avoid causing provisioning problems.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'security_phrase',
+ 'section' => 'password',
+ 'description' => 'Enable the tracking of a "security phrase" with each account. Not recommended, as it is vulnerable to social engineering.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'locale',
+ 'section' => 'UI',
+ 'description' => 'Message locale',
+ 'type' => 'select',
+ 'select_enum' => [ qw(en_US) ],
+ },
+
+ {
+ 'key' => 'selfservice_server-quiet',
+ 'section' => '',
+ 'description' => 'Disable decline and cancel emails generated by transactions initiated by the selfservice server. Not recommended, unless the customer will get instant feedback from a customer service UI, and receiving an email would be confusing/overkill.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'signup_server-quiet',
+ 'section' => '',
+ 'description' => 'Disable decline and cancel emails generated by transactions initiated by the signup server. Not recommended, unless the customer will get instant feedback from a customer service UI, and receiving an email would be confusing/overkill. Does not disable welcome emails.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'signup_server-payby',
+ 'section' => '',
+ 'description' => 'Acceptable payment types for the signup server',
+ 'type' => 'selectmultiple',
+ 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
+ },
+
+ {
+ 'key' => 'signup_server-email',
+ 'section' => '',
+ 'description' => 'Comma-separated list of email addresses to receive notification of signups via the signup server.',
+ 'type' => 'text',
+ },
+
+
+ {
+ 'key' => 'show-msgcat-codes',
+ 'section' => 'UI',
+ 'description' => 'Show msgcat codes in error messages. Turn this option on before reporting errors to the mailing list.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'signup_server-realtime',
+ 'section' => '',
+ 'description' => 'Run billing for signup server signups immediately, and suspend accounts which subsequently have a balance.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'declinetemplate',
+ 'section' => 'billing',
+ 'description' => 'Template file for credit card decline emails.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'emaildecline',
+ 'section' => 'billing',
+ 'description' => 'Enable emailing of credit card decline notices.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cancelmessage',
+ 'section' => 'billing',
+ 'description' => 'Template file for cancellation emails.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'cancelsubject',
+ 'section' => 'billing',
+ 'description' => 'Subject line for cancellation emails.',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'emailcancel',
+ 'section' => 'billing',
+ 'description' => 'Enable emailing of cancellation notices.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'require_cardname',
+ 'section' => 'billing',
+ 'description' => 'Require an "Exact name on card" to be entered explicitly; don\'t default to using the first and last name.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'enable_taxclasses',
+ 'section' => 'billing',
+ 'description' => 'Enable per-package tax classes',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'welcome_email',
+ 'section' => '',
+ 'description' => 'Template file for welcome email. Welcome emails are sent to the customer email invoice destination(s) each time a svc_acct record is created. See the <a href="http://search.cpan.org/doc/MJD/Text-Template-1.42/Template.pm">Text::Template</a> documentation for details on the template substitution language. The following variables are available: <code>$username</code>, <code>$password</code>, <code>$first</code>, <code>$last</code> and <code>$pkg</code>.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'welcome_email-from',
+ 'section' => '',
+ 'description' => 'From: address header for welcome email',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'welcome_email-subject',
+ 'section' => '',
+ 'description' => 'Subject: header for welcome email',
+ 'type' => 'text',
+ },
+
+ {
+ 'key' => 'welcome_email-mimetype',
+ 'section' => '',
+ 'description' => 'MIME type for welcome email',
+ 'type' => 'select',
+ 'select_enum' => [ 'text/plain', 'text/html' ],
+ },
+
+ {
+ 'key' => 'payby-default',
+ 'section' => 'UI',
+ 'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
+ 'type' => 'select',
+ 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
+ },
+
+ {
+ 'key' => 'svc_acct-notes',
+ 'section' => 'UI',
+ 'description' => 'Extra HTML to be displayed on the Account View screen.',
+ 'type' => 'textarea',
+ },
+
+ {
+ 'key' => 'radius-password',
+ 'section' => '',
+ 'description' => 'RADIUS attribute for plain-text passwords.',
+ 'type' => 'select',
+ 'select_enum' => [ 'Password', 'User-Password' ],
+ },
+
+ {
+ 'key' => 'radius-ip',
+ 'section' => '',
+ 'description' => 'RADIUS attribute for IP addresses.',
+ 'type' => 'select',
+ 'select_enum' => [ 'Framed-IP-Address', 'Framed-Address' ],
+ },
+
+ {
+ 'key' => 'svc_acct-alldomains',
+ 'section' => '',
+ 'description' => 'Allow accounts to select any domain in the database. Normally accounts can only select from the domain set in the service definition and those purchased by the customer.',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'dump-scpdest',
+ 'section' => '',
+ 'description' => 'destination for scp database dumps: user@host:/path',
+ 'type' => 'text',
+ },
+
+);
+
+1;
+
diff --git a/FS/FS/ConfItem.pm b/FS/FS/ConfItem.pm
new file mode 100644
index 000000000..83295b4fa
--- /dev/null
+++ b/FS/FS/ConfItem.pm
@@ -0,0 +1,63 @@
+package FS::ConfItem;
+
+=head1 NAME
+
+FS::ConfItem - Configutaion option meta-data.
+
+=head1 SYNOPSIS
+
+ use FS::Conf;
+ @config_items = $conf->config_items;
+
+ foreach $item ( @config_items ) {
+ $key = $item->key;
+ $section = $item->section;
+ $description = $item->description;
+ }
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = @_ ? shift : {};
+ bless ($self, $class);
+}
+
+=item key
+
+=item section
+
+=item description
+
+=cut
+
+sub AUTOLOAD {
+ my $self = shift;
+ my $field = $AUTOLOAD;
+ $field =~ s/.*://;
+ $self->{$field};
+}
+
+=back
+
+=head1 BUGS
+
+Terse docs.
+
+=head1 SEE ALSO
+
+L<FS::Conf>
+
+=cut
+
+1;
+
diff --git a/FS/FS/InitHandler.pm b/FS/FS/InitHandler.pm
new file mode 100644
index 000000000..5038cf352
--- /dev/null
+++ b/FS/FS/InitHandler.pm
@@ -0,0 +1,91 @@
+package FS::InitHandler;
+
+# this leaks memory under graceful restarts and i wouldn't use it on any
+# modern server. useful for very slow machines with memory to spare, just
+# always do a full restart
+
+use strict;
+use vars qw($DEBUG);
+use FS::UID qw(adminsuidsetup);
+use FS::Record;
+
+$DEBUG = 1;
+
+sub handler {
+
+ use Date::Format;
+ use Date::Parse;
+ use Tie::IxHash;
+ use HTML::Entities;
+ use IO::Handle;
+ use IO::File;
+ use String::Approx;
+ use HTML::Widgets::SelectLayers 0.02;
+ #use FS::UID;
+ #use FS::Record;
+ use FS::Conf;
+ use FS::CGI;
+ use FS::Msgcat;
+
+ use FS::agent;
+ use FS::agent_type;
+ use FS::domain_record;
+ use FS::cust_bill;
+ use FS::cust_bill_pay;
+ use FS::cust_credit;
+ use FS::cust_credit_bill;
+ use FS::cust_main;
+ use FS::cust_main_county;
+ use FS::cust_pay;
+ use FS::cust_pkg;
+ use FS::cust_refund;
+ use FS::cust_svc;
+ use FS::nas;
+ use FS::part_bill_event;
+ use FS::part_pkg;
+ use FS::part_referral;
+ use FS::part_svc;
+ use FS::pkg_svc;
+ use FS::port;
+ use FS::queue;
+ use FS::raddb;
+ use FS::session;
+ use FS::svc_acct;
+ use FS::svc_acct_pop;
+ use FS::svc_domain;
+ use FS::svc_forward;
+ use FS::svc_www;
+ use FS::type_pkgs;
+ use FS::part_export;
+ use FS::part_export_option;
+ use FS::export_svc;
+ use FS::msgcat;
+
+ warn "[FS::InitHandler] handler called\n" if $DEBUG;
+
+ #this is sure to be broken on freebsd
+ $> = $FS::UID::freeside_uid;
+
+ open(MAPSECRETS,"<$FS::UID::conf_dir/mapsecrets")
+ or die "can't read $FS::UID::conf_dir/mapsecrets: $!";
+
+ my %seen;
+ while (<MAPSECRETS>) {
+ next if /^\s*(#|$)/;
+ /^([\w\-\.]+)\s(.*)$/
+ or do { warn "strange line in mapsecrets: $_"; next; };
+ my($user, $datasrc) = ($1, $2);
+ next if $seen{$datasrc}++;
+ warn "[FS::InitHandler] preloading $datasrc for $user\n" if $DEBUG;
+ adminsuidsetup($user);
+ }
+
+ close MAPSECRETS;
+
+ #lalala probably broken on freebsd
+ ($<, $>) = ($>, $<);
+ $< = 0;
+
+}
+
+1;
diff --git a/FS/FS/Misc.pm b/FS/FS/Misc.pm
new file mode 100644
index 000000000..efad2dfd6
--- /dev/null
+++ b/FS/FS/Misc.pm
@@ -0,0 +1,102 @@
+package FS::Misc;
+
+use strict;
+use vars qw ( @ISA @EXPORT_OK );
+use Exporter;
+
+@ISA = qw( Exporter );
+@EXPORT_OK = qw( send_email );
+
+=head1 NAME
+
+FS::Misc - Miscellaneous subroutines
+
+=head1 SYNOPSIS
+
+ use FS::Misc qw(send_email);
+
+ send_email();
+
+=head1 DESCRIPTION
+
+Miscellaneous subroutines. This module contains miscellaneous subroutines
+called from multiple other modules. These are not OO or necessarily related,
+but are collected here to elimiate code duplication.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item send_email OPTION => VALUE ...
+
+Options:
+
+I<from> - (required)
+
+I<to> - (required) comma-separated scalar or arrayref of recipients
+
+I<subject> - (required)
+
+I<content-type> - (optional) MIME type
+
+I<body> - (required) arrayref of body text lines
+
+=cut
+
+use vars qw( $conf );
+use Date::Format;
+use Mail::Header;
+use Mail::Internet 1.44;
+use FS::UID;
+
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+} );
+
+sub send_email {
+ my(%options) = @_;
+
+ $ENV{MAILADDRESS} = $options{'from'};
+ my $to = ref($options{to}) ? join(', ', @{ $options{to} } ) : $options{to};
+ my @header = (
+ 'From: '. $options{'from'},
+ 'To: '. $to,
+ 'Sender: '. $options{'from'},
+ 'Reply-To: '. $options{'from'},
+ 'Date: '. time2str("%a, %d %b %Y %X %z", time),
+ 'Subject: '. $options{'subject'},
+ );
+ push @header, 'Content-Type: '. $options{'content-type'}
+ if exists($options{'content-type'});
+ my $header = new Mail::Header ( \@header );
+
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => $options{'body'},
+ );
+
+ my $smtpmachine = $conf->config('smtpmachine');
+ $!=0;
+
+ my $rv = $message->smtpsend( 'Host' => $smtpmachine )
+ or $message->smtpsend( Host => $smtpmachine, Debug => 1 );
+
+ if ($rv) { #smtpsend returns a list of addresses, not true/false
+ return '';
+ } else {
+ return "can't send email to $to via server $smtpmachine with SMTP: $!";
+ }
+
+}
+
+=head1 BUGS
+
+This package exists.
+
+=head1 SEE ALSO
+
+L<FS::UID>, L<FS::CGI>, L<FS::Record>, the base documentation.
+
+=cut
+
+1;
diff --git a/FS/FS/Msgcat.pm b/FS/FS/Msgcat.pm
new file mode 100644
index 000000000..625743dc0
--- /dev/null
+++ b/FS/FS/Msgcat.pm
@@ -0,0 +1,98 @@
+package FS::Msgcat;
+
+use strict;
+use vars qw( @ISA @EXPORT_OK $conf $locale $debug );
+use Exporter;
+use FS::UID;
+#use FS::Record qw( qsearchs ); # wtf? won't import...
+use FS::Record;
+use FS::Conf;
+use FS::msgcat;
+
+@ISA = qw(Exporter);
+@EXPORT_OK = qw( gettext geterror );
+
+$FS::UID::callback{'Msgcat'} = sub {
+ $conf = new FS::Conf;
+ $locale = $conf->config('locale') || 'en_US';
+ $debug = $conf->exists('show-msgcat-codes')
+};
+
+=head1 NAME
+
+FS::Msgcat - Message catalog functions
+
+=head1 SYNOPSIS
+
+ use FS::Msgcat qw(gettext geterror);
+
+ #simple interface for retreiving messages...
+ $message = gettext('msgcode');
+ #or errors (includes the error code)
+ $message = geterror('msgcode');
+
+=head1 DESCRIPTION
+
+FS::Msgcat provides functions to use the message catalog. If you want to
+maintain the message catalog database, see L<FS::msgcat> instead.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item gettext MSGCODE
+
+Returns the full message for the supplied message code.
+
+=cut
+
+sub gettext {
+ $debug ? geterror(@_) : _gettext(@_);
+}
+
+sub _gettext {
+ my $msgcode = shift;
+ my $msgcat = FS::Record::qsearchs('msgcat', {
+ 'msgcode' => $msgcode,
+ 'locale' => $locale
+ } );
+ if ( $msgcat ) {
+ $msgcat->msg;
+ } else {
+ warn "WARNING: message for msgcode $msgcode in locale $locale not found";
+ $msgcode;
+ }
+
+}
+
+=item geterror MSGCODE
+
+Returns the full message for the supplied message code, including the message
+code.
+
+=cut
+
+sub geterror {
+ my $msgcode = shift;
+ my $msg = _gettext($msgcode);
+ if ( $msg eq $msgcode ) {
+ "Error code $msgcode (message for locale $locale not found)";
+ } else {
+ "$msg (error code $msgcode)";
+ }
+}
+
+=back
+
+=head1 BUGS
+
+i18n/l10n, eek
+
+=head1 SEE ALSO
+
+L<FS::msgcat>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm
new file mode 100644
index 000000000..02fd4e390
--- /dev/null
+++ b/FS/FS/Record.pm
@@ -0,0 +1,1346 @@
+package FS::Record;
+
+use strict;
+use vars qw( $dbdef_file $dbdef $setup_hack $AUTOLOAD @ISA @EXPORT_OK $DEBUG
+ $me %dbdef_cache );
+use subs qw(reload_dbdef);
+use Exporter;
+use Carp qw(carp cluck croak confess);
+use File::CounterFile;
+use Locale::Country;
+use DBI qw(:sql_types);
+use DBIx::DBSchema 0.21;
+use FS::UID qw(dbh getotaker datasrc driver_name);
+use FS::SearchCache;
+use FS::Msgcat qw(gettext);
+
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(dbh fields hfields qsearch qsearchs dbdef jsearch);
+
+$DEBUG = 0;
+$me = '[FS::Record]';
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::Record'} = sub {
+ $File::CounterFile::DEFAULT_DIR = "/usr/local/etc/freeside/counters.". datasrc;
+ $dbdef_file = "/usr/local/etc/freeside/dbdef.". datasrc;
+ &reload_dbdef unless $setup_hack; #$setup_hack needed now?
+};
+
+=head1 NAME
+
+FS::Record - Database record objects
+
+=head1 SYNOPSIS
+
+ use FS::Record;
+ use FS::Record qw(dbh fields qsearch qsearchs dbdef);
+
+ $record = new FS::Record 'table', \%hash;
+ $record = new FS::Record 'table', { 'column' => 'value', ... };
+
+ $record = qsearchs FS::Record 'table', \%hash;
+ $record = qsearchs FS::Record 'table', { 'column' => 'value', ... };
+ @records = qsearch FS::Record 'table', \%hash;
+ @records = qsearch FS::Record 'table', { 'column' => 'value', ... };
+
+ $table = $record->table;
+ $dbdef_table = $record->dbdef_table;
+
+ $value = $record->get('column');
+ $value = $record->getfield('column');
+ $value = $record->column;
+
+ $record->set( 'column' => 'value' );
+ $record->setfield( 'column' => 'value' );
+ $record->column('value');
+
+ %hash = $record->hash;
+
+ $hashref = $record->hashref;
+
+ $error = $record->insert;
+
+ $error = $record->delete;
+
+ $error = $new_record->replace($old_record);
+
+ # external use deprecated - handled by the database (at least for Pg, mysql)
+ $value = $record->unique('column');
+
+ $error = $record->ut_float('column');
+ $error = $record->ut_number('column');
+ $error = $record->ut_numbern('column');
+ $error = $record->ut_money('column');
+ $error = $record->ut_text('column');
+ $error = $record->ut_textn('column');
+ $error = $record->ut_alpha('column');
+ $error = $record->ut_alphan('column');
+ $error = $record->ut_phonen('column');
+ $error = $record->ut_anything('column');
+ $error = $record->ut_name('column');
+
+ $dbdef = reload_dbdef;
+ $dbdef = reload_dbdef "/non/standard/filename";
+ $dbdef = dbdef;
+
+ $quoted_value = _quote($value,'table','field');
+
+ #deprecated
+ $fields = hfields('table');
+ if ( $fields->{Field} ) { # etc.
+
+ @fields = fields 'table'; #as a subroutine
+ @fields = $record->fields; #as a method call
+
+
+=head1 DESCRIPTION
+
+(Mostly) object-oriented interface to database records. Records are currently
+implemented on top of DBI. FS::Record is intended as a base class for
+table-specific classes to inherit from, i.e. FS::cust_main.
+
+=head1 CONSTRUCTORS
+
+=over 4
+
+=item new [ TABLE, ] HASHREF
+
+Creates a new record. It doesn't store it in the database, though. See
+L<"insert"> for that.
+
+Note that the object stores this hash reference, not a distinct copy of the
+hash it points to. You can ask the object for a copy with the I<hash>
+method.
+
+TABLE can only be omitted when a dervived class overrides the table method.
+
+=cut
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ bless ($self, $class);
+
+ unless ( defined ( $self->table ) ) {
+ $self->{'Table'} = shift;
+ carp "warning: FS::Record::new called with table name ". $self->{'Table'};
+ }
+
+ my $hashref = $self->{'Hash'} = shift;
+
+ foreach my $field ( grep !defined($hashref->{$_}), $self->fields ) {
+ $hashref->{$field}='';
+ }
+
+ $self->_cache($hashref, shift) if $self->can('_cache') && @_;
+
+ $self;
+}
+
+sub new_or_cached {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ bless ($self, $class);
+
+ $self->{'Table'} = shift unless defined ( $self->table );
+
+ my $hashref = $self->{'Hash'} = shift;
+ my $cache = shift;
+ if ( defined( $cache->cache->{$hashref->{$cache->key}} ) ) {
+ my $obj = $cache->cache->{$hashref->{$cache->key}};
+ $obj->_cache($hashref, $cache) if $obj->can('_cache');
+ $obj;
+ } else {
+ $cache->cache->{$hashref->{$cache->key}} = $self->new($hashref, $cache);
+ }
+
+}
+
+sub create {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ bless ($self, $class);
+ if ( defined $self->table ) {
+ cluck "create constructor is deprecated, use new!";
+ $self->new(@_);
+ } else {
+ croak "FS::Record::create called (not from a subclass)!";
+ }
+}
+
+=item qsearch TABLE, HASHREF, SELECT, EXTRA_SQL, CACHE_OBJ
+
+Searches the database for all records matching (at least) the key/value pairs
+in HASHREF. Returns all the records found as `FS::TABLE' objects if that
+module is loaded (i.e. via `use FS::cust_main;'), otherwise returns FS::Record
+objects.
+
+###oops, argh, FS::Record::new only lets us create database fields.
+#Normal behaviour if SELECT is not specified is `*', as in
+#C<SELECT * FROM table WHERE ...>. However, there is an experimental new
+#feature where you can specify SELECT - remember, the objects returned,
+#although blessed into the appropriate `FS::TABLE' package, will only have the
+#fields you specify. This might have unwanted results if you then go calling
+#regular FS::TABLE methods
+#on it.
+
+=cut
+
+sub qsearch {
+ my($stable, $record, $select, $extra_sql, $cache ) = @_;
+ #$stable =~ /^([\w\_]+)$/ or die "Illegal table: $table";
+ #for jsearch
+ $stable =~ /^([\w\s\(\)\.\,\=]+)$/ or die "Illegal table: $stable";
+ $stable = $1;
+ $select ||= '*';
+ my $dbh = dbh;
+
+ my $table = $cache ? $cache->table : $stable;
+
+ my @fields = grep exists($record->{$_}), fields($table);
+
+ my $statement = "SELECT $select FROM $stable";
+ if ( @fields ) {
+ $statement .= ' WHERE '. join(' AND ', map {
+
+ my $op = '=';
+ my $column = $_;
+ if ( ref($record->{$_}) ) {
+ $op = $record->{$_}{'op'} if $record->{$_}{'op'};
+ #$op = 'LIKE' if $op =~ /^ILIKE$/i && driver_name ne 'Pg';
+ if ( uc($op) eq 'ILIKE' ) {
+ $op = 'LIKE';
+ $record->{$_}{'value'} = lc($record->{$_}{'value'});
+ $column = "LOWER($_)";
+ }
+ $record->{$_} = $record->{$_}{'value'}
+ }
+
+ if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) {
+ if ( $op eq '=' ) {
+ if ( driver_name eq 'Pg' ) {
+ if ( $dbdef->table($table)->column($column)->type =~ /(int)/i ) {
+ qq-( $column IS NULL )-;
+ } else {
+ qq-( $column IS NULL OR $column = '' )-;
+ }
+ } else {
+ qq-( $column IS NULL OR $column = "" )-;
+ }
+ } elsif ( $op eq '!=' ) {
+ if ( driver_name eq 'Pg' ) {
+ if ( $dbdef->table($table)->column($column)->type =~ /(int)/i ) {
+ qq-( $column IS NOT NULL )-;
+ } else {
+ qq-( $column IS NOT NULL AND $column != '' )-;
+ }
+ } else {
+ qq-( $column IS NOT NULL AND $column != "" )-;
+ }
+ } else {
+ if ( driver_name eq 'Pg' ) {
+ qq-( $column $op '' )-;
+ } else {
+ qq-( $column $op "" )-;
+ }
+ }
+ } else {
+ "$column $op ?";
+ }
+ } @fields );
+ }
+ $statement .= " $extra_sql" if defined($extra_sql);
+
+ warn "[debug]$me $statement\n" if $DEBUG > 1;
+ my $sth = $dbh->prepare($statement)
+ or croak "$dbh->errstr doing $statement";
+
+ my $bind = 1;
+
+ foreach my $field (
+ grep defined( $record->{$_} ) && $record->{$_} ne '', @fields
+ ) {
+ if ( $record->{$field} =~ /^\d+(\.\d+)?$/
+ && $dbdef->table($table)->column($field)->type =~ /(int)/i
+ ) {
+ $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_INTEGER } );
+ } else {
+ $sth->bind_param($bind++, $record->{$field}, { TYPE => SQL_VARCHAR } );
+ }
+ }
+
+# $sth->execute( map $record->{$_},
+# grep defined( $record->{$_} ) && $record->{$_} ne '', @fields
+# ) or croak "Error executing \"$statement\": ". $sth->errstr;
+
+ $sth->execute or croak "Error executing \"$statement\": ". $sth->errstr;
+
+ $dbh->commit or croak $dbh->errstr if $FS::UID::AutoCommit;
+
+ if ( eval 'scalar(@FS::'. $table. '::ISA);' ) {
+ if ( eval 'FS::'. $table. '->can(\'new\')' eq \&new ) {
+ #derivied class didn't override new method, so this optimization is safe
+ if ( $cache ) {
+ map {
+ new_or_cached( "FS::$table", { %{$_} }, $cache )
+ } @{$sth->fetchall_arrayref( {} )};
+ } else {
+ map {
+ new( "FS::$table", { %{$_} } )
+ } @{$sth->fetchall_arrayref( {} )};
+ }
+ } else {
+ warn "untested code (class FS::$table uses custom new method)";
+ map {
+ eval 'FS::'. $table. '->new( { %{$_} } )';
+ } @{$sth->fetchall_arrayref( {} )};
+ }
+ } else {
+ cluck "warning: FS::$table not loaded; returning FS::Record objects";
+ map {
+ FS::Record->new( $table, { %{$_} } );
+ } @{$sth->fetchall_arrayref( {} )};
+ }
+
+}
+
+=item jsearch TABLE, HASHREF, SELECT, EXTRA_SQL, PRIMARY_TABLE, PRIMARY_KEY
+
+Experimental JOINed search method. Using this method, you can execute a
+single SELECT spanning multiple tables, and cache the results for subsequent
+method calls. Interface will almost definately change in an incompatible
+fashion.
+
+Arguments:
+
+=cut
+
+sub jsearch {
+ my($table, $record, $select, $extra_sql, $ptable, $pkey ) = @_;
+ my $cache = FS::SearchCache->new( $ptable, $pkey );
+ my %saw;
+ ( $cache,
+ grep { !$saw{$_->getfield($pkey)}++ }
+ qsearch($table, $record, $select, $extra_sql, $cache )
+ );
+}
+
+=item qsearchs TABLE, HASHREF
+
+Same as qsearch, except that if more than one record matches, it B<carp>s but
+returns the first. If this happens, you either made a logic error in asking
+for a single item, or your data is corrupted.
+
+=cut
+
+sub qsearchs { # $result_record = &FS::Record:qsearchs('table',\%hash);
+ my $table = $_[0];
+ my(@result) = qsearch(@_);
+ carp "warning: Multiple records in scalar search ($table)"
+ if scalar(@result) > 1;
+ #should warn more vehemently if the search was on a primary key?
+ scalar(@result) ? ($result[0]) : ();
+}
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item table
+
+Returns the table name.
+
+=cut
+
+sub table {
+# cluck "warning: FS::Record::table deprecated; supply one in subclass!";
+ my $self = shift;
+ $self -> {'Table'};
+}
+
+=item dbdef_table
+
+Returns the DBIx::DBSchema::Table object for the table.
+
+=cut
+
+sub dbdef_table {
+ my($self)=@_;
+ my($table)=$self->table;
+ $dbdef->table($table);
+}
+
+=item get, getfield COLUMN
+
+Returns the value of the column/field/key COLUMN.
+
+=cut
+
+sub get {
+ my($self,$field) = @_;
+ # to avoid "Use of unitialized value" errors
+ if ( defined ( $self->{Hash}->{$field} ) ) {
+ $self->{Hash}->{$field};
+ } else {
+ '';
+ }
+}
+sub getfield {
+ my $self = shift;
+ $self->get(@_);
+}
+
+=item set, setfield COLUMN, VALUE
+
+Sets the value of the column/field/key COLUMN to VALUE. Returns VALUE.
+
+=cut
+
+sub set {
+ my($self,$field,$value) = @_;
+ $self->{'Hash'}->{$field} = $value;
+}
+sub setfield {
+ my $self = shift;
+ $self->set(@_);
+}
+
+=item AUTLOADED METHODS
+
+$record->column is a synonym for $record->get('column');
+
+$record->column('value') is a synonym for $record->set('column','value');
+
+=cut
+
+# readable/safe
+sub AUTOLOAD {
+ my($self,$value)=@_;
+ my($field)=$AUTOLOAD;
+ $field =~ s/.*://;
+ if ( defined($value) ) {
+ confess "errant AUTOLOAD $field for $self (arg $value)"
+ unless ref($self) && $self->can('setfield');
+ $self->setfield($field,$value);
+ } else {
+ confess "errant AUTOLOAD $field for $self (no args)"
+ unless ref($self) && $self->can('getfield');
+ $self->getfield($field);
+ }
+}
+
+# efficient
+#sub AUTOLOAD {
+# my $field = $AUTOLOAD;
+# $field =~ s/.*://;
+# if ( defined($_[1]) ) {
+# $_[0]->setfield($field, $_[1]);
+# } else {
+# $_[0]->getfield($field);
+# }
+#}
+
+=item hash
+
+Returns a list of the column/value pairs, usually for assigning to a new hash.
+
+To make a distinct duplicate of an FS::Record object, you can do:
+
+ $new = new FS::Record ( $old->table, { $old->hash } );
+
+=cut
+
+sub hash {
+ my($self) = @_;
+ %{ $self->{'Hash'} };
+}
+
+=item hashref
+
+Returns a reference to the column/value hash.
+
+=cut
+
+sub hashref {
+ my($self) = @_;
+ $self->{'Hash'};
+}
+
+=item insert
+
+Inserts this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ #single-field unique keys are given a value if false
+ #(like MySQL's AUTO_INCREMENT or Pg SERIAL)
+ foreach ( $self->dbdef_table->unique->singles ) {
+ $self->unique($_) unless $self->getfield($_);
+ }
+
+ #and also the primary key, if the database isn't going to
+ my $primary_key = $self->dbdef_table->primary_key;
+ my $db_seq = 0;
+ if ( $primary_key ) {
+ my $col = $self->dbdef_table->column($primary_key);
+
+ $db_seq =
+ uc($col->type) eq 'SERIAL'
+ || ( driver_name eq 'Pg'
+ && defined($col->default)
+ && $col->default =~ /^nextval\(/i
+ )
+ || ( driver_name eq 'mysql'
+ && defined($col->local)
+ && $col->local =~ /AUTO_INCREMENT/i
+ );
+ $self->unique($primary_key) unless $self->getfield($primary_key) || $db_seq;
+ }
+
+ my $table = $self->table;
+ #false laziness w/delete
+ my @fields =
+ grep defined($self->getfield($_)) && $self->getfield($_) ne "",
+ $self->fields
+ ;
+ my @values = map { _quote( $self->getfield($_), $table, $_) } @fields;
+ #eslaf
+
+ my $statement = "INSERT INTO $table ( ".
+ join( ', ', @fields ).
+ ") VALUES (".
+ join( ', ', @values ).
+ ")"
+ ;
+ warn "[debug]$me $statement\n" if $DEBUG > 1;
+ my $sth = dbh->prepare($statement) or return dbh->errstr;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ $sth->execute or return $sth->errstr;
+
+ if ( $db_seq ) { # get inserted id from the database, if applicable
+ warn "[debug]$me retreiving sequence from database\n" if $DEBUG;
+ my $insertid = '';
+ if ( driver_name eq 'Pg' ) {
+
+ my $oid = $sth->{'pg_oid_status'};
+ my $i_sql = "SELECT $primary_key FROM $table WHERE oid = ?";
+ my $i_sth = dbh->prepare($i_sql) or do {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return dbh->errstr;
+ };
+ $i_sth->execute($oid) or do {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return $i_sth->errstr;
+ };
+ $insertid = $i_sth->fetchrow_arrayref->[0];
+
+ } elsif ( driver_name eq 'mysql' ) {
+
+ $insertid = dbh->{'mysql_insertid'};
+ # work around mysql_insertid being null some of the time, ala RT :/
+ unless ( $insertid ) {
+ warn "WARNING: DBD::mysql didn't return mysql_insertid; ".
+ "using SELECT LAST_INSERT_ID();";
+ my $i_sql = "SELECT LAST_INSERT_ID()";
+ my $i_sth = dbh->prepare($i_sql) or do {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return dbh->errstr;
+ };
+ $i_sth->execute or do {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return $i_sth->errstr;
+ };
+ $insertid = $i_sth->fetchrow_arrayref->[0];
+ }
+
+ } else {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return "don't know how to retreive inserted ids from ". driver_name.
+ ", try using counterfiles (maybe run dbdef-create?)";
+ }
+ $self->setfield($primary_key, $insertid);
+ }
+
+ my $h_sth;
+ if ( defined $dbdef->table('h_'. $table) ) {
+ my $h_statement = $self->_h_statement('insert');
+ warn "[debug]$me $h_statement\n" if $DEBUG > 2;
+ $h_sth = dbh->prepare($h_statement) or do {
+ dbh->rollback if $FS::UID::AutoCommit;
+ return dbh->errstr;
+ };
+ } else {
+ $h_sth = '';
+ }
+ $h_sth->execute or return $h_sth->errstr if $h_sth;
+
+ dbh->commit or croak dbh->errstr if $FS::UID::AutoCommit;
+
+ '';
+}
+
+=item add
+
+Depriciated (use insert instead).
+
+=cut
+
+sub add {
+ cluck "warning: FS::Record::add deprecated!";
+ insert @_; #call method in this scope
+}
+
+=item delete
+
+Delete this record from the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ my $statement = "DELETE FROM ". $self->table. " WHERE ". join(' AND ',
+ map {
+ $self->getfield($_) eq ''
+ #? "( $_ IS NULL OR $_ = \"\" )"
+ ? ( driver_name eq 'Pg'
+ ? "$_ IS NULL"
+ : "( $_ IS NULL OR $_ = \"\" )"
+ )
+ : "$_ = ". _quote($self->getfield($_),$self->table,$_)
+ } ( $self->dbdef_table->primary_key )
+ ? ( $self->dbdef_table->primary_key)
+ : $self->fields
+ );
+ warn "[debug]$me $statement\n" if $DEBUG > 1;
+ my $sth = dbh->prepare($statement) or return dbh->errstr;
+
+ my $h_sth;
+ if ( defined $dbdef->table('h_'. $self->table) ) {
+ my $h_statement = $self->_h_statement('delete');
+ warn "[debug]$me $h_statement\n" if $DEBUG > 2;
+ $h_sth = dbh->prepare($h_statement) or return dbh->errstr;
+ } else {
+ $h_sth = '';
+ }
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $rc = $sth->execute or return $sth->errstr;
+ #not portable #return "Record not found, statement:\n$statement" if $rc eq "0E0";
+ $h_sth->execute or return $h_sth->errstr if $h_sth;
+ dbh->commit or croak dbh->errstr if $FS::UID::AutoCommit;
+
+ #no need to needlessly destoy the data either (causes problems actually)
+ #undef $self; #no need to keep object!
+
+ '';
+}
+
+=item del
+
+Depriciated (use delete instead).
+
+=cut
+
+sub del {
+ cluck "warning: FS::Record::del deprecated!";
+ &delete(@_); #call method in this scope
+}
+
+=item replace OLD_RECORD
+
+Replace the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+ warn "[debug]$me $new ->replace $old\n" if $DEBUG;
+
+ return "Records not in same table!" unless $new->table eq $old->table;
+
+ my $primary_key = $old->dbdef_table->primary_key;
+ return "Can't change $primary_key"
+ if $primary_key
+ && ( $old->getfield($primary_key) ne $new->getfield($primary_key) );
+
+ my $error = $new->check;
+ return $error if $error;
+
+ my @diff = grep $new->getfield($_) ne $old->getfield($_), $old->fields;
+ unless ( @diff ) {
+ carp "[warning]$me $new -> replace $old: records identical";
+ return '';
+ }
+
+ my $statement = "UPDATE ". $old->table. " SET ". join(', ',
+ map {
+ "$_ = ". _quote($new->getfield($_),$old->table,$_)
+ } @diff
+ ). ' WHERE '.
+ join(' AND ',
+ map {
+ $old->getfield($_) eq ''
+ #? "( $_ IS NULL OR $_ = \"\" )"
+ ? ( driver_name eq 'Pg'
+ ? "$_ IS NULL"
+ : "( $_ IS NULL OR $_ = \"\" )"
+ )
+ : "$_ = ". _quote($old->getfield($_),$old->table,$_)
+ } ( $primary_key ? ( $primary_key ) : $old->fields )
+ )
+ ;
+ warn "[debug]$me $statement\n" if $DEBUG > 1;
+ my $sth = dbh->prepare($statement) or return dbh->errstr;
+
+ my $h_old_sth;
+ if ( defined $dbdef->table('h_'. $old->table) ) {
+ my $h_old_statement = $old->_h_statement('replace_old');
+ warn "[debug]$me $h_old_statement\n" if $DEBUG > 2;
+ $h_old_sth = dbh->prepare($h_old_statement) or return dbh->errstr;
+ } else {
+ $h_old_sth = '';
+ }
+
+ my $h_new_sth;
+ if ( defined $dbdef->table('h_'. $new->table) ) {
+ my $h_new_statement = $new->_h_statement('replace_new');
+ warn "[debug]$me $h_new_statement\n" if $DEBUG > 2;
+ $h_new_sth = dbh->prepare($h_new_statement) or return dbh->errstr;
+ } else {
+ $h_new_sth = '';
+ }
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $rc = $sth->execute or return $sth->errstr;
+ #not portable #return "Record not found (or records identical)." if $rc eq "0E0";
+ $h_old_sth->execute or return $h_old_sth->errstr if $h_old_sth;
+ $h_new_sth->execute or return $h_new_sth->errstr if $h_new_sth;
+ dbh->commit or croak dbh->errstr if $FS::UID::AutoCommit;
+
+ '';
+
+}
+
+=item rep
+
+Depriciated (use replace instead).
+
+=cut
+
+sub rep {
+ cluck "warning: FS::Record::rep deprecated!";
+ replace @_; #call method in this scope
+}
+
+=item check
+
+Not yet implemented, croaks. Derived classes should provide a check method.
+
+=cut
+
+sub check {
+ confess "FS::Record::check not implemented; supply one in subclass!";
+}
+
+sub _h_statement {
+ my( $self, $action ) = @_;
+
+ my @fields =
+ grep defined($self->getfield($_)) && $self->getfield($_) ne "",
+ $self->fields
+ ;
+ my @values = map { _quote( $self->getfield($_), $self->table, $_) } @fields;
+
+ "INSERT INTO h_". $self->table. " ( ".
+ join(', ', qw(history_date history_user history_action), @fields ).
+ ") VALUES (".
+ join(', ', time, dbh->quote(getotaker()), dbh->quote($action), @values).
+ ")"
+ ;
+}
+
+=item unique COLUMN
+
+B<Warning>: External use is B<deprecated>.
+
+Replaces COLUMN in record with a unique number, using counters in the
+filesystem. Used by the B<insert> method on single-field unique columns
+(see L<DBIx::DBSchema::Table>) and also as a fallback for primary keys
+that aren't SERIAL (Pg) or AUTO_INCREMENT (mysql).
+
+Returns the new value.
+
+=cut
+
+sub unique {
+ my($self,$field) = @_;
+ my($table)=$self->table;
+
+ croak "Unique called on field $field, but it is ",
+ $self->getfield($field),
+ ", not null!"
+ if $self->getfield($field);
+
+ #warn "table $table is tainted" if is_tainted($table);
+ #warn "field $field is tainted" if is_tainted($field);
+
+ my($counter) = new File::CounterFile "$table.$field",0;
+# hack for web demo
+# getotaker() =~ /^([\w\-]{1,16})$/ or die "Illegal CGI REMOTE_USER!";
+# my($user)=$1;
+# my($counter) = new File::CounterFile "$user/$table.$field",0;
+# endhack
+
+ my $index = $counter->inc;
+ $index = $counter->inc while qsearchs($table, { $field=>$index } );
+
+ $index =~ /^(\d*)$/;
+ $index=$1;
+
+ $self->setfield($field,$index);
+
+}
+
+=item ut_float COLUMN
+
+Check/untaint floating point numeric data: 1.1, 1, 1.1e10, 1e10. May not be
+null. If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_float {
+ my($self,$field)=@_ ;
+ ($self->getfield($field) =~ /^(\d+\.\d+)$/ ||
+ $self->getfield($field) =~ /^(\d+)$/ ||
+ $self->getfield($field) =~ /^(\d+\.\d+e\d+)$/ ||
+ $self->getfield($field) =~ /^(\d+e\d+)$/)
+ or return "Illegal or empty (float) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_number COLUMN
+
+Check/untaint simple numeric data (whole numbers). May not be null. If there
+is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_number {
+ my($self,$field)=@_;
+ $self->getfield($field) =~ /^(\d+)$/
+ or return "Illegal or empty (numeric) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_numbern COLUMN
+
+Check/untaint simple numeric data (whole numbers). May be null. If there is
+an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_numbern {
+ my($self,$field)=@_;
+ $self->getfield($field) =~ /^(\d*)$/
+ or return "Illegal (numeric) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_money COLUMN
+
+Check/untaint monetary numbers. May be negative. Set to 0 if null. If there
+is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_money {
+ my($self,$field)=@_;
+ $self->setfield($field, 0) if $self->getfield($field) eq '';
+ $self->getfield($field) =~ /^(\-)? ?(\d*)(\.\d{2})?$/
+ or return "Illegal (money) $field: ". $self->getfield($field);
+ #$self->setfield($field, "$1$2$3" || 0);
+ $self->setfield($field, ( ($1||''). ($2||''). ($3||'') ) || 0);
+ '';
+}
+
+=item ut_text COLUMN
+
+Check/untaint text. Alphanumerics, spaces, and the following punctuation
+symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' " , . ? / =
+May not be null. If there is an error, returns the error, otherwise returns
+false.
+
+=cut
+
+sub ut_text {
+ my($self,$field)=@_;
+ #warn "msgcat ". \&msgcat. "\n";
+ #warn "notexist ". \&notexist. "\n";
+ #warn "AUTOLOAD ". \&AUTOLOAD. "\n";
+ $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]+)$/
+ or return gettext('illegal_or_empty_text'). " $field: ".
+ $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_textn COLUMN
+
+Check/untaint text. Alphanumerics, spaces, and the following punctuation
+symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' " , . ? /
+May be null. If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_textn {
+ my($self,$field)=@_;
+ $self->getfield($field) =~ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/
+ or return gettext('illegal_text'). " $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_alpha COLUMN
+
+Check/untaint alphanumeric strings (no spaces). May not be null. If there is
+an error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_alpha {
+ my($self,$field)=@_;
+ $self->getfield($field) =~ /^(\w+)$/
+ or return "Illegal or empty (alphanumeric) $field: ".
+ $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_alpha COLUMN
+
+Check/untaint alphanumeric strings (no spaces). May be null. If there is an
+error, returns the error, otherwise returns false.
+
+=cut
+
+sub ut_alphan {
+ my($self,$field)=@_;
+ $self->getfield($field) =~ /^(\w*)$/
+ or return "Illegal (alphanumeric) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_phonen COLUMN [ COUNTRY ]
+
+Check/untaint phone numbers. May be null. If there is an error, returns
+the error, otherwise returns false.
+
+Takes an optional two-letter ISO country code; without it or with unsupported
+countries, ut_phonen simply calls ut_alphan.
+
+=cut
+
+sub ut_phonen {
+ my( $self, $field, $country ) = @_;
+ return $self->ut_alphan($field) unless defined $country;
+ my $phonen = $self->getfield($field);
+ if ( $phonen eq '' ) {
+ $self->setfield($field,'');
+ } elsif ( $country eq 'US' || $country eq 'CA' ) {
+ $phonen =~ s/\D//g;
+ $phonen =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/
+ or return gettext('illegal_phone'). " $field: ". $self->getfield($field);
+ $phonen = "$1-$2-$3";
+ $phonen .= " x$4" if $4;
+ $self->setfield($field,$phonen);
+ } else {
+ warn "warning: don't know how to check phone numbers for country $country";
+ return $self->ut_textn($field);
+ }
+ '';
+}
+
+=item ut_ip COLUMN
+
+Check/untaint ip addresses. IPv4 only for now.
+
+=cut
+
+sub ut_ip {
+ my( $self, $field ) = @_;
+ $self->getfield($field) =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/
+ or return "Illegal (IP address) $field: ". $self->getfield($field);
+ for ( $1, $2, $3, $4 ) { return "Illegal (IP address) $field" if $_ > 255; }
+ $self->setfield($field, "$1.$2.$3.$4");
+ '';
+}
+
+=item ut_ipn COLUMN
+
+Check/untaint ip addresses. IPv4 only for now. May be null.
+
+=cut
+
+sub ut_ipn {
+ my( $self, $field ) = @_;
+ if ( $self->getfield($field) =~ /^()$/ ) {
+ $self->setfield($field,'');
+ '';
+ } else {
+ $self->ut_ip($field);
+ }
+}
+
+=item ut_domain COLUMN
+
+Check/untaint host and domain names.
+
+=cut
+
+sub ut_domain {
+ my( $self, $field ) = @_;
+ #$self->getfield($field) =~/^(\w+\.)*\w+$/
+ $self->getfield($field) =~/^(([\w\-]+\.)*\w+)$/
+ or return "Illegal (domain) $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_name COLUMN
+
+Check/untaint proper names; allows alphanumerics, spaces and the following
+punctuation: , . - '
+
+May not be null.
+
+=cut
+
+sub ut_name {
+ my( $self, $field ) = @_;
+ $self->getfield($field) =~ /^([\w \,\.\-\']+)$/
+ or return gettext('illegal_name'). " $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_zip COLUMN
+
+Check/untaint zip codes.
+
+=cut
+
+sub ut_zip {
+ my( $self, $field, $country ) = @_;
+ if ( $country eq 'US' ) {
+ $self->getfield($field) =~ /\s*(\d{5}(\-\d{4})?)\s*$/
+ or return gettext('illegal_zip'). " $field for country $country: ".
+ $self->getfield($field);
+ $self->setfield($field,$1);
+ } else {
+ $self->getfield($field) =~ /^\s*(\w[\w\-\s]{2,8}\w)\s*$/
+ or return gettext('illegal_zip'). " $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ }
+ '';
+}
+
+=item ut_country COLUMN
+
+Check/untaint country codes. Country names are changed to codes, if possible -
+see L<Locale::Country>.
+
+=cut
+
+sub ut_country {
+ my( $self, $field ) = @_;
+ unless ( $self->getfield($field) =~ /^(\w\w)$/ ) {
+ if ( $self->getfield($field) =~ /^([\w \,\.\(\)\']+)$/
+ && country2code($1) ) {
+ $self->setfield($field,uc(country2code($1)));
+ }
+ }
+ $self->getfield($field) =~ /^(\w\w)$/
+ or return "Illegal (country) $field: ". $self->getfield($field);
+ $self->setfield($field,uc($1));
+ '';
+}
+
+=item ut_anything COLUMN
+
+Untaints arbitrary data. Be careful.
+
+=cut
+
+sub ut_anything {
+ my( $self, $field ) = @_;
+ $self->getfield($field) =~ /^(.*)$/s
+ or return "Illegal $field: ". $self->getfield($field);
+ $self->setfield($field,$1);
+ '';
+}
+
+=item ut_enum COLUMN CHOICES_ARRAYREF
+
+Check/untaint a column, supplying all possible choices, like the "enum" type.
+
+=cut
+
+sub ut_enum {
+ my( $self, $field, $choices ) = @_;
+ foreach my $choice ( @$choices ) {
+ if ( $self->getfield($field) eq $choice ) {
+ $self->setfield($choice);
+ return '';
+ }
+ }
+ return "Illegal (enum) field $field: ". $self->getfield($field);
+}
+
+=item ut_foreign_key COLUMN FOREIGN_TABLE FOREIGN_COLUMN
+
+Check/untaint a foreign column key. Call a regular ut_ method (like ut_number)
+on the column first.
+
+=cut
+
+sub ut_foreign_key {
+ my( $self, $field, $table, $foreign ) = @_;
+ qsearchs($table, { $foreign => $self->getfield($field) })
+ or return "Can't find $field ". $self->getfield($field).
+ " in $table.$foreign";
+ '';
+}
+
+=item ut_foreign_keyn COLUMN FOREIGN_TABLE FOREIGN_COLUMN
+
+Like ut_foreign_key, except the null value is also allowed.
+
+=cut
+
+sub ut_foreign_keyn {
+ my( $self, $field, $table, $foreign ) = @_;
+ $self->getfield($field)
+ ? $self->ut_foreign_key($field, $table, $foreign)
+ : '';
+}
+
+=item fields [ TABLE ]
+
+This can be used as both a subroutine and a method call. It returns a list
+of the columns in this record's table, or an explicitly specified table.
+(See L<DBIx::DBSchema::Table>).
+
+=cut
+
+# Usage: @fields = fields($table);
+# @fields = $record->fields;
+sub fields {
+ my $something = shift;
+ my $table;
+ if ( ref($something) ) {
+ $table = $something->table;
+ } else {
+ $table = $something;
+ }
+ #croak "Usage: \@fields = fields(\$table)\n or: \@fields = \$record->fields" unless $table;
+ my($table_obj) = $dbdef->table($table);
+ confess "Unknown table $table" unless $table_obj;
+ $table_obj->columns;
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item reload_dbdef([FILENAME])
+
+Load a database definition (see L<DBIx::DBSchema>), optionally from a
+non-default filename. This command is executed at startup unless
+I<$FS::Record::setup_hack> is true. Returns a DBIx::DBSchema object.
+
+=cut
+
+sub reload_dbdef {
+ my $file = shift || $dbdef_file;
+
+ unless ( exists $dbdef_cache{$file} ) {
+ warn "[debug]$me loading dbdef for $file\n" if $DEBUG;
+ $dbdef_cache{$file} = DBIx::DBSchema->load( $file )
+ or die "can't load database schema from $file";
+ } else {
+ warn "[debug]$me re-using cached dbdef for $file\n" if $DEBUG;
+ }
+ $dbdef = $dbdef_cache{$file};
+}
+
+=item dbdef
+
+Returns the current database definition. See L<DBIx::DBSchema>.
+
+=cut
+
+sub dbdef { $dbdef; }
+
+=item _quote VALUE, TABLE, COLUMN
+
+This is an internal function used to construct SQL statements. It returns
+VALUE DBI-quoted (see L<DBI/"quote">) unless VALUE is a number and the column
+type (see L<DBIx::DBSchema::Column>) does not end in `char' or `binary'.
+
+=cut
+
+sub _quote {
+ my($value, $table, $column) = @_;
+ my $column_obj = $dbdef->table($table)->column($column);
+ my $column_type = $column_obj->type;
+
+ if ( $value eq '' && $column_type =~ /^int/ ) {
+ if ( $column_obj->null ) {
+ 'NULL';
+ } else {
+ cluck "WARNING: Attempting to set non-null integer $table.$column null; ".
+ "using 0 instead";
+ 0;
+ }
+ } elsif ( $value =~ /^\d+(\.\d+)?$/ &&
+ ! $column_type =~ /(char|binary|text)$/i ) {
+ $value;
+ } else {
+ dbh->quote($value);
+ }
+}
+
+=item hfields TABLE
+
+This is deprecated. Don't use it.
+
+It returns a hash-type list with the fields of this record's table set true.
+
+=cut
+
+sub hfields {
+ carp "warning: hfields is deprecated";
+ my($table)=@_;
+ my(%hash);
+ foreach (fields($table)) {
+ $hash{$_}=1;
+ }
+ \%hash;
+}
+
+sub _dump {
+ my($self)=@_;
+ join("\n", map {
+ "$_: ". $self->getfield($_). "|"
+ } (fields($self->table)) );
+}
+
+sub DESTROY { return; }
+
+#sub DESTROY {
+# my $self = shift;
+# #use Carp qw(cluck);
+# #cluck "DESTROYING $self";
+# warn "DESTROYING $self";
+#}
+
+#sub is_tainted {
+# return ! eval { join('',@_), kill 0; 1; };
+# }
+
+=back
+
+=head1 BUGS
+
+This module should probably be renamed, since much of the functionality is
+of general use. It is not completely unlike Adapter::DBI (see below).
+
+Exported qsearch and qsearchs should be deprecated in favor of method calls
+(against an FS::Record object like the old search and searchs that qsearch
+and qsearchs were on top of.)
+
+The whole fields / hfields mess should be removed.
+
+The various WHERE clauses should be subroutined.
+
+table string should be deprecated in favor of DBIx::DBSchema::Table.
+
+No doubt we could benefit from a Tied hash. Documenting how exists / defined
+true maps to the database (and WHERE clauses) would also help.
+
+The ut_ methods should ask the dbdef for a default length.
+
+ut_sqltype (like ut_varchar) should all be defined
+
+A fallback check method should be provided which uses the dbdef.
+
+The ut_money method assumes money has two decimal digits.
+
+The Pg money kludge in the new method only strips `$'.
+
+The ut_phonen method only checks US-style phone numbers.
+
+The _quote function should probably use ut_float instead of a regex.
+
+All the subroutines probably should be methods, here or elsewhere.
+
+Probably should borrow/use some dbdef methods where appropriate (like sub
+fields)
+
+As of 1.14, DBI fetchall_hashref( {} ) doesn't set fetchrow_hashref NAME_lc,
+or allow it to be set. Working around it is ugly any way around - DBI should
+be fixed. (only affects RDBMS which return uppercase column names)
+
+ut_zip should take an optional country like ut_phone.
+
+=head1 SEE ALSO
+
+L<DBIx::DBSchema>, L<FS::UID>, L<DBI>
+
+Adapter::DBI from Ch. 11 of Advanced Perl Programming by Sriram Srinivasan.
+
+=cut
+
+1;
+
diff --git a/FS/FS/SearchCache.pm b/FS/FS/SearchCache.pm
new file mode 100644
index 000000000..4218acfb6
--- /dev/null
+++ b/FS/FS/SearchCache.pm
@@ -0,0 +1,96 @@
+package FS::SearchCache;
+
+use strict;
+use vars qw($DEBUG);
+#use Carp qw(carp cluck croak confess);
+
+$DEBUG = 0;
+
+=head1 NAME
+
+FS::SearchCache - cache
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my( $table, $key ) = @_;
+ warn "table $table\n" if $DEBUG > 1;
+ warn "key $key\n" if $DEBUG > 1;
+ my $self = { 'table' => $table,
+ 'key' => $key,
+ 'cache' => {},
+ 'subcache' => {},
+ };
+ bless ($self, $class);
+
+ $self;
+}
+
+=item table
+
+=cut
+
+sub table { my $self = shift; $self->{table}; }
+
+=item key
+
+=cut
+
+sub key { my $self = shift; $self->{key}; }
+
+=item cache
+
+=cut
+
+sub cache { my $self = shift; $self->{cache}; }
+
+=item subcache
+
+=cut
+
+sub subcache {
+ my $self = shift;
+ my $col = shift;
+ my $table = shift;
+ my $keyval = shift;
+ if ( exists $self->{subcache}->{$col}->{$keyval} ) {
+ warn "returning existing subcache for $keyval ($col)".
+ "$self->{subcache}->{$col}->{$keyval}\n" if $DEBUG;
+ return $self->{subcache}->{$col}->{$keyval};
+ } else {
+ #my $tablekey = @_ ? shift : $col;
+ my $tablekey = $col;
+ my $subcache = ref($self)->new( $table, $tablekey );
+ $self->{subcache}->{$col}->{$keyval} = $subcache;
+ warn "creating new subcache $table $tablekey: $subcache\n" if $DEBUG;
+ $subcache;
+ }
+}
+
+=back
+
+=head1 BUGS
+
+Dismal documentation.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>
+
+=cut
+
+1;
+
+
diff --git a/FS/FS/UI/Base.pm b/FS/FS/UI/Base.pm
new file mode 100644
index 000000000..bbeb9e171
--- /dev/null
+++ b/FS/FS/UI/Base.pm
@@ -0,0 +1,194 @@
+package FS::UI::Base;
+
+use strict;
+use vars qw ( @ISA );
+use FS::Record qw( fields qsearch );
+
+@ISA = ( $FS::UI::Base::_lock );
+
+=head1 NAME
+
+FS::UI::Base - Base class for all user-interface objects
+
+=head1 SYNOPSIS
+
+ use FS::UI::SomeInterface;
+ use FS::UI::some_table;
+
+ $interface = new FS::UI::some_table;
+
+ $error = $interface->browse;
+ $error = $interface->search;
+ $error = $interface->view;
+ $error = $interface->edit;
+ $error = $interface->process;
+
+=head1 DESCRIPTION
+
+An FS::UI::Base object represents a user interface object. FS::UI::Base
+is intended as a base class for table-specfic classes to inherit from, i.e.
+FS::UI::cust_main. The simplest case, which will provide a default UI for your
+new table, is as follows:
+
+ package FS::UI::table_name;
+ use vars qw ( @ISA );
+ use FS::UI::Base;
+ @ISA = qw( FS::UI::Base );
+ sub db_table { 'table_name'; }
+
+Currently available interfaces are:
+ FS::UI::Gtk, an X-Windows UI implemented using the Gtk+ toolkit
+ FS::UI::CGI, a web interface implemented using CGI.pm, etc.
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+=item browse
+
+=cut
+
+sub browse {
+ my $self = shift;
+
+ my @fields = $self->list_fields;
+
+ #begin browse-specific stuff
+
+ $self->title( "Browse ". $self->db_names ) unless $self->title;
+ my @records = qsearch ( $self->db_table, {} );
+
+ #end browse-specific stuff
+
+ $self->addwidget ( new FS::UI::_Text ( $self->db_description ) );
+
+ my @header = $self->list_header;
+ my @headerspan = $self->list_headerspan;
+ my %callback = $self->db_callback;
+
+ my $columns;
+
+ my $table = new FS::UI::_Tableborder (
+ 'rows' => 1 + scalar(@records),
+ 'columns' => $columns || scalar(@fields),
+ );
+
+ my $c = 0;
+ foreach my $header ( @header ) {
+ my $headerspan = shift(@headerspan) || 1;
+ $table->attach(
+ 0, $c, new FS::UI::_Text ( $header ), 1, $headerspan
+ );
+ $c += $headerspan;
+ }
+
+ my $r = 1;
+
+ foreach my $record ( @records ) {
+ $c = 0;
+ foreach my $field ( @fields ) {
+ my $value = $record->getfield($field);
+ my $widget;
+ if ( $callback{$field} ) {
+ $widget = &{ $callback{$field} }( $value, $record );
+ } else {
+ $widget = new FS::UI::_Text ( $value );
+ }
+ $table->attach( $r, $c++, $widget, 1, 1 );
+ }
+ $r++;
+ }
+
+ $self->addwidget( $table );
+
+ $self->activate;
+
+}
+
+=item title
+
+=cut
+
+sub title {
+ my $self = shift;
+ my $value = shift;
+ if ( defined($value) ) {
+ $self->{'title'} = $value;
+ } else {
+ $self->{'title'};
+ }
+}
+
+=item addwidget
+
+=cut
+
+sub addwidget {
+ my $self = shift;
+ my $widget = shift;
+ push @{ $self->{'Widgets'} }, $widget;
+}
+
+#fallback methods
+
+sub db_description {}
+
+sub db_name {}
+
+sub db_names {
+ my $self = shift;
+ $self->db_name. 's';
+}
+
+sub list_fields {
+ my $self = shift;
+ fields( $self->db_table );
+}
+
+sub list_header {
+ my $self = shift;
+ $self->list_fields
+}
+
+sub list_headerspan {
+ my $self = shift;
+ map 1, $self->list_header;
+}
+
+sub db_callback {}
+
+=back
+
+=head1 VERSION
+
+$Id: Base.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+
+=head1 BUGS
+
+This documentation is incomplete.
+
+There should be some sort of per-(freeside)-user preferences and the ability
+for specific FS::UI:: modules to put their own values there as well.
+
+=head1 SEE ALSO
+
+L<FS::UI::Gtk>, L<FS::UI::CGI>
+
+=head1 HISTORY
+
+$Log: Base.pm,v $
+Revision 1.1 1999-08-04 09:03:53 ivan
+initial checkin of module files for proper perl installation
+
+Revision 1.1 1999/01/20 09:30:36 ivan
+skeletal cross-UI UI code.
+
+
+=cut
+
+1;
+
diff --git a/FS/FS/UI/CGI.pm b/FS/FS/UI/CGI.pm
new file mode 100644
index 000000000..ae87d1375
--- /dev/null
+++ b/FS/FS/UI/CGI.pm
@@ -0,0 +1,239 @@
+package FS::UI::CGI;
+
+use strict;
+use CGI;
+#use CGI::Switch; #when FS::UID user and preference callback stuff is fixed
+use CGI::Carp qw(fatalsToBrowser);
+use HTML::Table;
+use FS::UID qw(adminsuidsetup);
+#use FS::Record qw( qsearch fields );
+
+die "Can't initialize CGI interface; $FS::UI::Base::_lock used"
+ if $FS::UI::Base::_lock;
+$FS::UI::Base::_lock = "FS::UI::CGI";
+
+=head1 NAME
+
+FS::UI::CGI - Base class for CGI user-interface objects
+
+=head1 SYNOPSIS
+
+ use FS::UI::CGI;
+ use FS::UI::some_table;
+
+ $interface = new FS::UI::some_table;
+
+ $error = $interface->browse;
+ $error = $interface->search;
+ $error = $interface->view;
+ $error = $interface->edit;
+ $error = $interface->process;
+
+=head1 DESCRIPTION
+
+An FS::UI::CGI object represents a CGI interface object.
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+
+ $self->{'_cgi'} = new CGI;
+ $self->{'_user'} = $self->{'_cgi'}->remote_user;
+ $self->{'_dbh'} = FS::UID::adminsuidsetup $self->{'_user'};
+
+ bless ( $self, $class);
+}
+
+sub activate {
+ my $self = shift;
+ print $self->_header,
+ join ( "<BR>", map $_->sprint, @{ $self->{'Widgets'} } ),
+ $self->_footer,
+ ;
+}
+
+=item _header
+
+=cut
+
+sub _header {
+ my $self = shift;
+ my $cgi = $self->{'_cgi'};
+
+ $cgi->header( '-expires' => 'now' ), '<HTML>',
+ '<HEAD><TITLE>', $self->title, '</TITLE></HEAD>',
+ '<BODY BGCOLOR="#ffffff">',
+ '<FONT COLOR="#ff0000" SIZE=7>', $self->title, '</FONT><BR><BR>',
+ ;
+}
+
+=item _footer
+
+=cut
+
+sub _footer {
+ "</BODY></HTML>";
+}
+
+=item interface
+
+Returns the string `CGI'. Useful for the author of a table-specific UI class
+to conditionally specify certain behaviour.
+
+=cut
+
+sub interface { 'CGI'; }
+
+=back
+
+=cut
+
+package FS::UI::_Widget;
+
+use vars qw( $AUTOLOAD );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+ bless ( $self, $class );
+}
+
+sub AUTOLOAD {
+ my $self = shift;
+ my $value = shift;
+ my($field)=$AUTOLOAD;
+ $field =~ s/.*://;
+ if ( defined($value) ) {
+ $self->{$field} = $value;
+ } else {
+ $self->{$field};
+ }
+}
+
+package FS::UI::_Text;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Widget);
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ $self->{'_text'} = shift;
+ bless ( $self, $class );
+}
+
+sub sprint {
+ my $self = shift;
+ $self->{'_text'};
+}
+
+package FS::UI::_Link;
+
+use vars qw ( @ISA $BASE_URL );
+
+@ISA = qw ( FS::UI::_Widget);
+$BASE_URL = "http://rootwood.sisd.com/freeside";
+
+sub sprint {
+ my $self = shift;
+ my $table = $self->{'table'};
+ my $method = $self->{'method'};
+
+ # i will be cleaned up when we're done moving from the old webinterface!
+ my @arg = @{$self->{'arg'}};
+ my $yuck = join( "&", @arg);
+ qq(<A HREF="$BASE_URL/$method/$table.cgi?$yuck">). $self->{'text'}. "<\A>";
+}
+
+package FS::UI::_Table;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Widget);
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = $class eq $proto ? { @_ } : $proto;
+ bless ( $self, $class );
+ $self->{'_table'} = new HTML::Table ( $self->rows, $self->columns );
+ $self;
+}
+
+sub attach {
+ my $self = shift;
+ my ( $row, $column, $widget, $rowspan, $colspan ) = @_;
+ $self->{"_table"}->setCell( $row+1, $column+1, $widget->sprint );
+ $self->{"_table"}->setCellRowSpan( $row+1, $column+1, $rowspan ) if $rowspan;
+ $self->{"_table"}->setCellColSpan( $row+1, $column+1, $colspan ) if $colspan;
+}
+
+sub sprint {
+ my $self = shift;
+ $self->{'_table'}->getTable;
+}
+
+package FS::UI::_Tableborder;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Table );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = $class eq $proto ? { @_ } : $proto;
+ bless ( $self, $class );
+ $self->SUPER::new(@_);
+ $self->{'_table'}->setBorder;
+ $self;
+}
+
+=head1 VERSION
+
+$Id: CGI.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+
+=head1 BUGS
+
+This documentation is incomplete.
+
+In _Tableborder, headers should be links that sort on their fields.
+
+_Link uses a constant $BASE_URL
+
+_Link passes the arguments as a manually-constructed GET string instead
+of POSTing, for compatability while the web interface is upgraded. Once
+this is done it should pass arguements properly (i.e. as a POST, 8-bit clean)
+
+Still some small bits of widget code same as FS::UI::Gtk.
+
+=head1 SEE ALSO
+
+L<FS::UI::Base>
+
+=head1 HISTORY
+
+$Log: CGI.pm,v $
+Revision 1.1 1999-08-04 09:03:53 ivan
+initial checkin of module files for proper perl installation
+
+Revision 1.1 1999/01/20 09:30:36 ivan
+skeletal cross-UI UI code.
+
+
+=cut
+
+1;
+
diff --git a/FS/FS/UI/Gtk.pm b/FS/FS/UI/Gtk.pm
new file mode 100644
index 000000000..507a29361
--- /dev/null
+++ b/FS/FS/UI/Gtk.pm
@@ -0,0 +1,224 @@
+package FS::UI::Gtk;
+
+use strict;
+use Gtk;
+use FS::UID qw(adminsuidsetup);
+
+die "Can't initialize Gtk interface; $FS::UI::Base::_lock used"
+ if $FS::UI::Base::_lock;
+$FS::UI::Base::_lock = "FS::UI::Gtk";
+
+=head1 NAME
+
+FS::UI::Gtk - Base class for Gtk user-interface objects
+
+=head1 SYNOPSIS
+
+ use FS::UI::Gtk;
+ use FS::UI::some_table;
+
+ $interface = new FS::UI::some_table;
+
+ $error = $interface->browse;
+ $error = $interface->search;
+ $error = $interface->view;
+ $error = $interface->edit;
+ $error = $interface->process;
+
+=head1 DESCRIPTION
+
+An FS::UI::Gtk object represents a Gtk user interface object.
+
+=head1 METHODS
+
+=over 4
+
+=item new
+
+=cut
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+
+ bless ( $self, $class );
+
+ $self->{'_user'} = 'ivan'; #Pop up login window?
+ $self->{'_dbh'} = FS::UID::adminsuidsetup $self->{'_user'};
+
+
+
+ $self;
+}
+
+sub activate {
+ my $self = shift;
+
+ my $vbox = new Gtk::VBox ( 0, 4 );
+
+ foreach my $widget ( @{ $self->{'Widgets'} } ) {
+ $widget->_gtk->show;
+ $vbox->pack_start ( $widget->_gtk, 1, 1, 4 );
+ }
+ $vbox->show;
+
+ my $window = new Gtk::Window "toplevel";
+ $self->{'_gtk'} = $window;
+ $window->set_title( $self->title );
+ $window->add ( $vbox );
+ $window->show;
+ main Gtk;
+}
+
+=item interface
+
+Returns the string `Gtk'. Useful for the author of a table-specific UI class
+to conditionally specify certain behaviour.
+
+=cut
+
+sub interface { 'Gtk'; }
+
+=back
+
+=cut
+
+package FS::UI::_Widget;
+
+use vars qw( $AUTOLOAD );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+ bless ( $self, $class );
+}
+
+sub _gtk {
+ my $self = shift;
+ $self->{'_gtk'};
+}
+
+sub AUTOLOAD {
+ my $self = shift;
+ my $value = shift;
+ my($field)=$AUTOLOAD;
+ $field =~ s/.*://;
+ if ( defined($value) ) {
+ $self->{$field} = $value;
+ } else {
+ $self->{$field};
+ }
+}
+
+package FS::UI::_Text;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Widget );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = {};
+ $self->{'_gtk'} = new Gtk::Label ( shift );
+ bless ( $self, $class );
+}
+
+package FS::UI::_Link;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Widget );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+ $self->{'_gtk'} = new_with_label Gtk::Button ( $self->{'text'} );
+ $self->{'_gtk'}->signal_connect( 'clicked', sub {
+ print "STUB: (Gtk) FS::UI::_Link";
+ }, "hi", "there" );
+ bless ( $self, $class );
+}
+
+
+package FS::UI::_Table;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Widget );
+
+sub new {
+ my $proto = shift;
+ my $class = ref($proto) || $proto;
+ my $self = { @_ };
+ bless ( $self, $class );
+
+ $self->{'_gtk'} = new Gtk::Table (
+ $self->rows,
+ $self->columns,
+ 0, #homogeneous
+ );
+
+ $self;
+}
+
+sub attach {
+ my $self = shift;
+ my ( $row, $column, $widget, $rowspan, $colspan ) = @_;
+ $rowspan ||= 1;
+ $colspan ||= 1;
+ $self->_gtk->attach_defaults(
+ $widget->_gtk,
+ $column,
+ $column + $colspan,
+ $row,
+ $row + $rowspan,
+ );
+ $widget->_gtk->show;
+}
+
+package FS::UI::_Tableborder;
+
+use vars qw ( @ISA );
+
+@ISA = qw ( FS::UI::_Table );
+
+=head1 VERSION
+
+$Id: Gtk.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+
+=head1 BUGS
+
+This documentation is incomplete.
+
+_Tableborder is just a _Table now. _Tableborders should scroll (but not the
+headers) and need and need more decoration. (data in white section ala gtksql
+and sliding field widths) headers should be buttons that callback to sort on
+their fields.
+
+There should be a persistant, per-(freeside)-user store for window positions
+and sizes and sort fields etc (see L<FS::UI::CGI/BUGS>.
+
+Still some small bits of widget code same as FS::UI::CGI.
+
+=head1 SEE ALSO
+
+L<FS::UI::Base>
+
+=head1 HISTORY
+
+$Log: Gtk.pm,v $
+Revision 1.1 1999-08-04 09:03:53 ivan
+initial checkin of module files for proper perl installation
+
+Revision 1.1 1999/01/20 09:30:36 ivan
+skeletal cross-UI UI code.
+
+
+=cut
+
+1;
+
diff --git a/FS/FS/UI/agent.pm b/FS/FS/UI/agent.pm
new file mode 100644
index 000000000..ce9744a55
--- /dev/null
+++ b/FS/FS/UI/agent.pm
@@ -0,0 +1,62 @@
+package FS::UI::agent;
+
+use strict;
+use vars qw ( @ISA );
+use FS::UI::Base;
+use FS::Record qw( qsearchs );
+use FS::agent;
+use FS::agent_type;
+
+@ISA = qw ( FS::UI::Base );
+
+sub db_table { 'agent' };
+
+sub db_name { 'Agent' };
+
+sub db_description { <<END;
+Agents are resellers of your service. Agents may be limited to a subset of your
+full offerings (via their type).
+END
+}
+
+sub list_fields {
+ 'agentnum',
+ 'typenum',
+# 'freq',
+# 'prog',
+; }
+
+sub list_header {
+ 'Agent',
+ 'Type',
+# 'Freq (n/a)',
+# 'Prog (n/a)',
+; }
+
+sub db_callback {
+ 'agentnum' =>
+ sub {
+ my ( $agentnum, $record ) = @_;
+ my $agent = $record->agent;
+ new FS::UI::_Link (
+ 'table' => 'agent',
+ 'method' => 'edit',
+ 'arg' => [ $agentnum ],
+ 'text' => "$agentnum: $agent",
+ );
+ },
+ 'typenum' =>
+ sub {
+ my $typenum = shift;
+ my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
+ my $atype = $agent_type->atype;
+ new FS::UI::_Link (
+ 'table' => 'agent_type',
+ 'method' => 'edit',
+ 'arg' => [ $typenum ],
+ 'text' => "$typenum: $atype"
+ );
+ },
+}
+
+1;
diff --git a/FS/FS/UID.pm b/FS/FS/UID.pm
new file mode 100644
index 000000000..f67005151
--- /dev/null
+++ b/FS/FS/UID.pm
@@ -0,0 +1,316 @@
+package FS::UID;
+
+use strict;
+use vars qw(
+ @ISA @EXPORT_OK $cgi $dbh $freeside_uid $user
+ $conf_dir $secrets $datasrc $db_user $db_pass %callback @callback
+ $driver_name $AutoCommit
+);
+use subs qw(
+ getsecrets cgisetotaker
+);
+use Exporter;
+use Carp qw(carp croak cluck);
+use DBI;
+use FS::Conf;
+
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(checkeuid checkruid cgisuidsetup adminsuidsetup forksuidsetup
+ getotaker dbh datasrc getsecrets driver_name );
+
+$freeside_uid = scalar(getpwnam('freeside'));
+
+$conf_dir = "/usr/local/etc/freeside/";
+
+$AutoCommit = 1; #ours, not DBI
+
+=head1 NAME
+
+FS::UID - Subroutines for database login and assorted other stuff
+
+=head1 SYNOPSIS
+
+ use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
+ checkeuid checkruid);
+
+ adminsuidsetup $user;
+
+ $cgi = new CGI;
+ $dbh = cgisuidsetup($cgi);
+
+ $dbh = dbh;
+
+ $datasrc = datasrc;
+
+ $driver_name = driver_name;
+
+=head1 DESCRIPTION
+
+Provides a hodgepodge of subroutines.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item adminsuidsetup USER
+
+Sets the user to USER (see config.html from the base documentation).
+Cleans the environment.
+Make sure the script is running as freeside, or setuid freeside.
+Opens a connection to the database.
+Swaps real and effective UIDs.
+Runs any defined callbacks (see below).
+Returns the DBI database handle (usually you don't need this).
+
+=cut
+
+sub adminsuidsetup {
+ $dbh->disconnect if $dbh;
+ &forksuidsetup(@_);
+}
+
+sub forksuidsetup {
+ $user = shift;
+ croak "fatal: adminsuidsetup called without arguements" unless $user;
+
+ $user =~ /^([\w\-\.]+)$/ or croak "fatal: illegal user $user";
+ $user = $1;
+
+ $ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+ $ENV{'SHELL'} = '/bin/sh';
+ $ENV{'IFS'} = " \t\n";
+ $ENV{'CDPATH'} = '';
+ $ENV{'ENV'} = '';
+ $ENV{'BASH_ENV'} = '';
+
+ croak "Not running uid freeside!" unless checkeuid();
+ getsecrets;
+ $dbh = DBI->connect($datasrc,$db_user,$db_pass, {
+ 'AutoCommit' => 0,
+ #'ChopBlanks' => 1,
+ } ) or die "DBI->connect error: $DBI::errstr\n";
+
+ foreach ( keys %callback ) {
+ &{$callback{$_}};
+ # breaks multi-database installs # delete $callback{$_}; #run once
+ }
+
+ &{$_} foreach @callback;
+
+ $dbh;
+}
+
+=item install_callback
+
+A package can install a callback to be run in adminsuidsetup by passing
+a coderef to the FS::UID->install_callback class method. If adminsuidsetup has
+run already, the callback will also be run immediately.
+
+ $coderef = sub { warn "Hi, I'm returning your call!" };
+ FS::UID->install_callback($coderef);
+
+ install_callback FS::UID sub {
+ warn "Hi, I'm returning your call!"
+ };
+
+=cut
+
+sub install_callback {
+ my $class = shift;
+ my $callback = shift;
+ push @callback, $callback;
+ &{$callback} if $dbh;
+}
+
+=item cgisuidsetup CGI_object
+
+Takes a single argument, which is a CGI (see L<CGI>) or Apache (see L<Apache>)
+object (CGI::Base is depriciated). Runs cgisetotaker and then adminsuidsetup.
+
+=cut
+
+sub cgisuidsetup {
+ $cgi=shift;
+ if ( $cgi->isa('CGI::Base') ) {
+ carp "Use of CGI::Base is depriciated";
+ } elsif ( $cgi->isa('Apache') ) {
+
+ } elsif ( ! $cgi->isa('CGI') ) {
+ croak "fatal: unrecognized object $cgi";
+ }
+ cgisetotaker;
+ adminsuidsetup($user);
+}
+
+=item cgi
+
+Returns the CGI (see L<CGI>) object.
+
+=cut
+
+sub cgi {
+ carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
+ $cgi;
+}
+
+=item dbh
+
+Returns the DBI database handle.
+
+=cut
+
+sub dbh {
+ $dbh;
+}
+
+=item datasrc
+
+Returns the DBI data source.
+
+=cut
+
+sub datasrc {
+ $datasrc;
+}
+
+=item driver_name
+
+Returns just the driver name portion of the DBI data source.
+
+=cut
+
+sub driver_name {
+ return $driver_name if defined $driver_name;
+ $driver_name = ( split(':', $datasrc) )[1];
+}
+
+sub suidsetup {
+ croak "suidsetup depriciated";
+}
+
+=item getotaker
+
+Returns the current Freeside user.
+
+=cut
+
+sub getotaker {
+ $user;
+}
+
+=item cgisetotaker
+
+Sets and returns the CGI REMOTE_USER. $cgi should be defined as a CGI.pm
+object (see L<CGI>) or an Apache object (see L<Apache>). Support for CGI::Base
+and derived classes is depriciated.
+
+=cut
+
+sub cgisetotaker {
+ if ( $cgi && $cgi->isa('CGI::Base') && defined $cgi->var('REMOTE_USER')) {
+ carp "Use of CGI::Base is depriciated";
+ $user = lc ( $cgi->var('REMOTE_USER') );
+ } elsif ( $cgi && $cgi->isa('CGI') && defined $cgi->remote_user ) {
+ $user = lc ( $cgi->remote_user );
+ } elsif ( $cgi && $cgi->isa('Apache') ) {
+ $user = lc ( $cgi->connection->user );
+ } else {
+ die "fatal: Can't get REMOTE_USER! for cgi $cgi - you need to setup ".
+ "Apache user authentication as documented in httemplate/docs/install.html";
+ }
+ $user;
+}
+
+=item checkeuid
+
+Returns true if effective UID is that of the freeside user.
+
+=cut
+
+sub checkeuid {
+ ( $> == $freeside_uid );
+}
+
+=item checkruid
+
+Returns true if the real UID is that of the freeside user.
+
+=cut
+
+sub checkruid {
+ ( $< == $freeside_uid );
+}
+
+=item getsecrets [ USER ]
+
+Sets the user to USER, if supplied.
+Sets and returns the DBI datasource, username and password for this user from
+the `/usr/local/etc/freeside/mapsecrets' file.
+
+=cut
+
+sub getsecrets {
+ my($setuser) = shift;
+ $user = $setuser if $setuser;
+ die "No user!" unless $user;
+ my($conf) = new FS::Conf $conf_dir;
+ my($line) = grep /^\s*$user\s/, $conf->config('mapsecrets');
+ die "User $user not found in mapsecrets!" unless $line;
+ $line =~ /^\s*$user\s+(.*)$/;
+ $secrets = $1;
+ die "Illegal mapsecrets line for user?!" unless $secrets;
+ ($datasrc, $db_user, $db_pass) = $conf->config($secrets)
+ or die "Can't get secrets: $!";
+ $FS::Conf::default_dir = $conf_dir. "/conf.$datasrc";
+ undef $driver_name;
+ ($datasrc, $db_user, $db_pass);
+}
+
+=back
+
+=head1 CALLBACKS
+
+Warning: this interface is (still) likely to change in future releases.
+
+New (experimental) callback interface:
+
+A package can install a callback to be run in adminsuidsetup by passing
+a coderef to the FS::UID->install_callback class method. If adminsuidsetup has
+run already, the callback will also be run immediately.
+
+ $coderef = sub { warn "Hi, I'm returning your call!" };
+ FS::UID->install_callback($coderef);
+
+ install_callback FS::UID sub {
+ warn "Hi, I'm returning your call!"
+ };
+
+Old (deprecated) callback interface:
+
+A package can install a callback to be run in adminsuidsetup by putting a
+coderef into the hash %FS::UID::callback :
+
+ $coderef = sub { warn "Hi, I'm returning your call!" };
+ $FS::UID::callback{'Package::Name'} = $coderef;
+
+=head1 BUGS
+
+Too many package-global variables.
+
+Not OO.
+
+No capabilities yet. When mod_perl and Authen::DBI are implemented,
+cgisuidsetup will go away as well.
+
+Goes through contortions to support non-OO syntax with multiple datasrc's.
+
+Callbacks are (still) inelegant.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<CGI>, L<DBI>, config.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/addr_block.pm b/FS/FS/addr_block.pm
new file mode 100755
index 000000000..c5ddca7d0
--- /dev/null
+++ b/FS/FS/addr_block.pm
@@ -0,0 +1,330 @@
+package FS::addr_block;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs qsearch dbh );
+use FS::router;
+use FS::svc_broadband;
+use FS::Conf;
+use NetAddr::IP;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::addr_block - Object methods for addr_block records
+
+=head1 SYNOPSIS
+
+ use FS::addr_block;
+
+ $record = new FS::addr_block \%hash;
+ $record = new FS::addr_block { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::addr_block record describes an address block assigned for broadband
+access. FS::addr_block inherits from FS::Record. The following fields are
+currently supported:
+
+=over 4
+
+=item blocknum - primary key, used in FS::svc_broadband to associate
+services to the block.
+
+=item routernum - the router (see FS::router) to which this
+block is assigned.
+
+=item ip_gateway - the gateway address used by customers within this block.
+
+=item ip_netmask - the netmask of the block, expressed as an integer.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see "insert".
+
+=cut
+
+sub table { 'addr_block'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+sub delete {
+ my $self = shift;
+ return 'Block must be deallocated before deletion'
+ if $self->router;
+
+ $self->SUPER::delete;
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_number('routernum')
+ || $self->ut_ip('ip_gateway')
+ || $self->ut_number('ip_netmask')
+ ;
+ return $error if $error;
+
+
+ # A routernum of 0 indicates an unassigned block and is allowed
+ return "Unknown routernum"
+ if ($self->routernum and not $self->router);
+
+ my $self_addr = $self->NetAddr;
+ return "Cannot parse address: ". $self->ip_gateway . '/' . $self->ip_netmask
+ unless $self_addr;
+
+ if (not $self->blocknum) {
+ my @block = grep {
+ my $block_addr = $_->NetAddr;
+ if($block_addr->contains($self_addr)
+ or $self_addr->contains($block_addr)) { $_; };
+ } qsearch( 'addr_block', {});
+ foreach(@block) {
+ return "Block intersects existing block ".$_->ip_gateway."/".$_->ip_netmask;
+ }
+ }
+
+ '';
+}
+
+
+=item router
+
+Returns the FS::router object corresponding to this object. If the
+block is unassigned, returns undef.
+
+=cut
+
+sub router {
+ my $self = shift;
+ return qsearchs('router', { routernum => $self->routernum });
+}
+
+=item svc_broadband
+
+Returns a list of FS::svc_broadband objects associated
+with this object.
+
+=cut
+
+sub svc_broadband {
+ my $self = shift;
+ return qsearch('svc_broadband', { blocknum => $self->blocknum });
+}
+
+=item NetAddr
+
+Returns a NetAddr::IP object for this block's address and netmask.
+
+=cut
+
+sub NetAddr {
+ my $self = shift;
+
+ return new NetAddr::IP ($self->ip_gateway, $self->ip_netmask);
+}
+
+=item next_free_addr
+
+Returns a NetAddr::IP object corresponding to the first unassigned address
+in the block (other than the network, broadcast, or gateway address). If
+there are no free addresses, returns false.
+
+=cut
+
+sub next_free_addr {
+ my $self = shift;
+
+ my $conf = new FS::Conf;
+ my @excludeaddr = $conf->config('exclude_ip_addr');
+
+ my @used = (
+ map { $_->NetAddr->addr }
+ ($self,
+ qsearch('svc_broadband', { blocknum => $self->blocknum }) ),
+ @excludeaddr );
+
+ my @free = $self->NetAddr->hostenum;
+ while (my $ip = shift @free) {
+ if (not grep {$_ eq $ip->addr;} @used) { return $ip; };
+ }
+
+ '';
+
+}
+
+=item allocate
+
+Allocates this address block to a router. Takes an FS::router object
+as an argument.
+
+At present it's not possible to reallocate a block to a different router
+except by deallocating it first, which requires that none of its addresses
+be assigned. This is probably as it should be.
+
+=cut
+
+sub allocate {
+ my ($self, $router) = @_;
+
+ return 'Block is already allocated'
+ if($self->router);
+
+ return 'Block must be allocated to a router'
+ unless(ref $router eq 'FS::router');
+
+ my @svc = $self->svc_broadband;
+ if (@svc) {
+ return 'Block has assigned addresses: '. join ', ', map {$_->ip_addr} @svc;
+ }
+
+ my $new = new FS::addr_block {$self->hash};
+ $new->routernum($router->routernum);
+ return $new->replace($self);
+
+}
+
+=item deallocate
+
+Deallocates the block (i.e. sets the routernum to 0). If any addresses in the
+block are assigned to services, it fails.
+
+=cut
+
+sub deallocate {
+ my $self = shift;
+
+ my @svc = $self->svc_broadband;
+ if (@svc) {
+ return 'Block has assigned addresses: '. join ', ', map {$_->ip_addr} @svc;
+ }
+
+ my $new = new FS::addr_block {$self->hash};
+ $new->routernum(0);
+ return $new->replace($self);
+}
+
+=item split_block
+
+Splits this address block into two equal blocks, occupying the same space as
+the original block. The first of the two will also have the same blocknum.
+The gateway address of each block will be set to the first usable address, i.e.
+(network address)+1. Since this method is designed for use on unallocated
+blocks, this is probably the correct behavior.
+
+(At present, splitting allocated blocks is disallowed. Anyone who wants to
+implement this is reminded that each split costs three addresses, and any
+customers who were using these addresses will have to be moved; depending on
+how full the block was before being split, they might have to be moved to a
+different block. Anyone who I<still> wants to implement it is asked to tie it
+to a configuration switch so that site admins can disallow it.)
+
+=cut
+
+sub split_block {
+
+ # We should consider using Attribute::Handlers/Aspect/Hook::LexWrap/
+ # something to atomicize functions, so that we can say
+ #
+ # sub split_block : atomic {
+ #
+ # instead of repeating all this AutoCommit verbage in every
+ # sub that does more than one database operation.
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $self = shift;
+ my $error;
+
+ if ($self->router) {
+ return 'Block is already allocated';
+ }
+
+ #TODO: Smallest allowed block should be a config option.
+ if ($self->NetAddr->masklen() ge 30) {
+ return 'Cannot split blocks with a mask length >= 30';
+ }
+
+ my (@new, @ip);
+ $ip[0] = $self->NetAddr;
+ @ip = map {$_->first()} $ip[0]->split($self->ip_netmask + 1);
+
+ foreach (0,1) {
+ $new[$_] = new FS::addr_block {$self->hash};
+ $new[$_]->ip_gateway($ip[$_]->addr);
+ $new[$_]->ip_netmask($ip[$_]->masklen);
+ }
+
+ $new[1]->blocknum('');
+
+ $error = $new[0]->replace($self);
+ if ($error) {
+ $dbh->rollback;
+ return $error;
+ }
+
+ $error = $new[1]->insert;
+ if ($error) {
+ $dbh->rollback;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ return '';
+}
+
+=item merge
+
+To be implemented.
+
+=back
+
+=head1 BUGS
+
+Minimum block size should be a config option. It's hardcoded at /30 right
+now because that's the smallest block that makes any sense at all.
+
+=cut
+
+1;
+
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm
new file mode 100644
index 000000000..f11a28db9
--- /dev/null
+++ b/FS/FS/agent.pm
@@ -0,0 +1,160 @@
+package FS::agent;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main;
+use FS::agent_type;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::agent - Object methods for agent records
+
+=head1 SYNOPSIS
+
+ use FS::agent;
+
+ $record = new FS::agent \%hash;
+ $record = new FS::agent { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $agent_type = $record->agent_type;
+
+ $hashref = $record->pkgpart_hashref;
+ #may purchase $pkgpart if $hashref->{$pkgpart};
+
+=head1 DESCRIPTION
+
+An FS::agent object represents an agent. Every customer has an agent. Agents
+can be used to track things like resellers or salespeople. FS::agent inherits
+from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item agentnum - primary key (assigned automatically for new agents)
+
+=item agent - Text name of this agent
+
+=item typenum - Agent type. See L<FS::agent_type>
+
+=item prog - For future use.
+
+=item freq - For future use.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new agent. To add the agent to the database, see L<"insert">.
+
+=cut
+
+sub table { 'agent'; }
+
+=item insert
+
+Adds this agent to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this agent from the database. Only agents with no customers can be
+deleted. If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ return "Can't delete an agent with customers!"
+ if qsearch( 'cust_main', { 'agentnum' => $self->agentnum } );
+
+ $self->SUPER::delete;
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid agent. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('agentnum')
+ || $self->ut_text('agent')
+ || $self->ut_number('typenum')
+ || $self->ut_numbern('freq')
+ || $self->ut_textn('prog')
+ ;
+ return $error if $error;
+
+ return "Unknown typenum!"
+ unless $self->agent_type;
+
+ '';
+
+}
+
+=item agent_type
+
+Returns the FS::agent_type object (see L<FS::agent_type>) for this agent.
+
+=cut
+
+sub agent_type {
+ my $self = shift;
+ qsearchs( 'agent_type', { 'typenum' => $self->typenum } );
+}
+
+=item pkgpart_hashref
+
+Returns a hash reference. The keys of the hash are pkgparts. The value is
+true if this agent may purchase the specified package definition. See
+L<FS::part_pkg>.
+
+=cut
+
+sub pkgpart_hashref {
+ my $self = shift;
+ $self->agent_type->pkgpart_hashref;
+}
+
+=back
+
+=head1 VERSION
+
+$Id: agent.pm,v 1.3 2002-03-24 18:23:47 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::agent_type>, L<FS::cust_main>, L<FS::part_pkg>,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/agent_type.pm b/FS/FS/agent_type.pm
new file mode 100644
index 000000000..988533ae3
--- /dev/null
+++ b/FS/FS/agent_type.pm
@@ -0,0 +1,165 @@
+package FS::agent_type;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch );
+use FS::agent;
+use FS::type_pkgs;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::agent_type - Object methods for agent_type records
+
+=head1 SYNOPSIS
+
+ use FS::agent_type;
+
+ $record = new FS::agent_type \%hash;
+ $record = new FS::agent_type { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $hashref = $record->pkgpart_hashref;
+ #may purchase $pkgpart if $hashref->{$pkgpart};
+
+ @type_pkgs = $record->type_pkgs;
+
+ @pkgparts = $record->pkgpart;
+
+=head1 DESCRIPTION
+
+An FS::agent_type object represents an agent type. Every agent (see
+L<FS::agent>) has an agent type. Agent types define which packages (see
+L<FS::part_pkg>) may be purchased by customers (see L<FS::cust_main>), via
+FS::type_pkgs records (see L<FS::type_pkgs>). FS::agent_type inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item typenum - primary key (assigned automatically for new agent types)
+
+=item atype - Text name of this agent type
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new agent type. To add the agent type to the database, see
+L<"insert">.
+
+=cut
+
+sub table { 'agent_type'; }
+
+=item insert
+
+Adds this agent type to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this agent type from the database. Only agent types with no agents
+can be deleted. If there is an error, returns the error, otherwise returns
+false.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ return "Can't delete an agent_type with agents!"
+ if qsearch( 'agent', { 'typenum' => $self->typenum } );
+
+ $self->SUPER::delete;
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid agent type. If there is an
+error, returns the error, otherwise returns false. Called by the insert and
+replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('typenum')
+ or $self->ut_text('atype');
+
+}
+
+=item pkgpart_hashref
+
+Returns a hash reference. The keys of the hash are pkgparts. The value is
+true iff this agent may purchase the specified package definition. See
+L<FS::part_pkg>.
+
+=cut
+
+sub pkgpart_hashref {
+ my $self = shift;
+ my %pkgpart;
+ #$pkgpart{$_}++ foreach $self->pkgpart;
+ # not compatible w/5.004_04 (fixed in 5.004_05)
+ foreach ( $self->pkgpart ) { $pkgpart{$_}++; }
+ \%pkgpart;
+}
+
+=item type_pkgs
+
+Returns all FS::type_pkgs objects (see L<FS::type_pkgs>) for this agent type.
+
+=cut
+
+sub type_pkgs {
+ my $self = shift;
+ qsearch('type_pkgs', { 'typenum' => $self->typenum } );
+}
+
+=item pkgpart
+
+Returns the pkgpart of all package definitions (see L<FS::part_pkg>) for this
+agent type.
+
+=cut
+
+sub pkgpart {
+ my $self = shift;
+ map $_->pkgpart, $self->type_pkgs;
+}
+
+=back
+
+=head1 VERSION
+
+$Id: agent_type.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::agent>, L<FS::type_pkgs>, L<FS::cust_main>,
+L<FS::part_pkg>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
new file mode 100644
index 000000000..a22f44b24
--- /dev/null
+++ b/FS/FS/cust_bill.pm
@@ -0,0 +1,902 @@
+package FS::cust_bill;
+
+use strict;
+use vars qw( @ISA $conf $money_char );
+use vars qw( $invoice_lines @buf ); #yuck
+use Date::Format;
+use Text::Template;
+use FS::UID qw( datasrc );
+use FS::Record qw( qsearch qsearchs );
+use FS::Misc qw( send_email );
+use FS::cust_main;
+use FS::cust_bill_pkg;
+use FS::cust_credit;
+use FS::cust_pay;
+use FS::cust_pkg;
+use FS::cust_credit_bill;
+use FS::cust_pay_batch;
+use FS::cust_bill_event;
+
+@ISA = qw( FS::Record );
+
+#ask FS::UID to run this stuff for us later
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+ $money_char = $conf->config('money_char') || '$';
+} );
+
+=head1 NAME
+
+FS::cust_bill - Object methods for cust_bill records
+
+=head1 SYNOPSIS
+
+ use FS::cust_bill;
+
+ $record = new FS::cust_bill \%hash;
+ $record = new FS::cust_bill { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ ( $total_previous_balance, @previous_cust_bill ) = $record->previous;
+
+ @cust_bill_pkg_objects = $cust_bill->cust_bill_pkg;
+
+ ( $total_previous_credits, @previous_cust_credit ) = $record->cust_credit;
+
+ @cust_pay_objects = $cust_bill->cust_pay;
+
+ $tax_amount = $record->tax;
+
+ @lines = $cust_bill->print_text;
+ @lines = $cust_bill->print_text $time;
+
+=head1 DESCRIPTION
+
+An FS::cust_bill object represents an invoice; a declaration that a customer
+owes you money. The specific charges are itemized as B<cust_bill_pkg> records
+(see L<FS::cust_bill_pkg>). FS::cust_bill inherits from FS::Record. The
+following fields are currently supported:
+
+=over 4
+
+=item invnum - primary key (assigned automatically for new invoices)
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=item charged - amount of this invoice
+
+=item printed - deprecated
+
+=item closed - books closed flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new invoice. To add the invoice to the database, see L<"insert">.
+Invoices are normally created by calling the bill method of a customer object
+(see L<FS::cust_main>).
+
+=cut
+
+sub table { 'cust_bill'; }
+
+=item insert
+
+Adds this invoice to the database ("Posts" the invoice). If there is an error,
+returns the error, otherwise returns false.
+
+=item delete
+
+Currently unimplemented. I don't remove invoices because there would then be
+no record you ever posted this invoice (which is bad, no?)
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't delete closed invoice" if $self->closed =~ /^Y/i;
+ $self->SUPER::delete(@_);
+}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+Only printed may be changed. printed is normally updated by calling the
+collect method of a customer object (see L<FS::cust_main>).
+
+=cut
+
+sub replace {
+ my( $new, $old ) = ( shift, shift );
+ return "Can't change custnum!" unless $old->custnum == $new->custnum;
+ #return "Can't change _date!" unless $old->_date eq $new->_date;
+ return "Can't change _date!" unless $old->_date == $new->_date;
+ return "Can't change charged!" unless $old->charged == $new->charged;
+
+ $new->SUPER::replace($old);
+}
+
+=item check
+
+Checks all fields to make sure this is a valid invoice. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('invnum')
+ || $self->ut_number('custnum')
+ || $self->ut_numbern('_date')
+ || $self->ut_money('charged')
+ || $self->ut_numbern('printed')
+ || $self->ut_enum('closed', [ '', 'Y' ])
+ ;
+ return $error if $error;
+
+ return "Unknown customer"
+ unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+
+ $self->_date(time) unless $self->_date;
+
+ $self->printed(0) if $self->printed eq '';
+
+ ''; #no error
+}
+
+=item previous
+
+Returns a list consisting of the total previous balance for this customer,
+followed by the previous outstanding invoices (as FS::cust_bill objects also).
+
+=cut
+
+sub previous {
+ my $self = shift;
+ my $total = 0;
+ my @cust_bill = sort { $a->_date <=> $b->_date }
+ grep { $_->owed != 0 && $_->_date < $self->_date }
+ qsearch( 'cust_bill', { 'custnum' => $self->custnum } )
+ ;
+ foreach ( @cust_bill ) { $total += $_->owed; }
+ $total, @cust_bill;
+}
+
+=item cust_bill_pkg
+
+Returns the line items (see L<FS::cust_bill_pkg>) for this invoice.
+
+=cut
+
+sub cust_bill_pkg {
+ my $self = shift;
+ qsearch( 'cust_bill_pkg', { 'invnum' => $self->invnum } );
+}
+
+=item cust_bill_event
+
+Returns the completed invoice events (see L<FS::cust_bill_event>) for this
+invoice.
+
+=cut
+
+sub cust_bill_event {
+ my $self = shift;
+ qsearch( 'cust_bill_event', { 'invnum' => $self->invnum } );
+}
+
+
+=item cust_main
+
+Returns the customer (see L<FS::cust_main>) for this invoice.
+
+=cut
+
+sub cust_main {
+ my $self = shift;
+ qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+}
+
+=item cust_credit
+
+Depreciated. See the cust_credited method.
+
+ #Returns a list consisting of the total previous credited (see
+ #L<FS::cust_credit>) and unapplied for this customer, followed by the previous
+ #outstanding credits (FS::cust_credit objects).
+
+=cut
+
+sub cust_credit {
+ use Carp;
+ croak "FS::cust_bill->cust_credit depreciated; see ".
+ "FS::cust_bill->cust_credit_bill";
+ #my $self = shift;
+ #my $total = 0;
+ #my @cust_credit = sort { $a->_date <=> $b->_date }
+ # grep { $_->credited != 0 && $_->_date < $self->_date }
+ # qsearch('cust_credit', { 'custnum' => $self->custnum } )
+ #;
+ #foreach (@cust_credit) { $total += $_->credited; }
+ #$total, @cust_credit;
+}
+
+=item cust_pay
+
+Depreciated. See the cust_bill_pay method.
+
+#Returns all payments (see L<FS::cust_pay>) for this invoice.
+
+=cut
+
+sub cust_pay {
+ use Carp;
+ croak "FS::cust_bill->cust_pay depreciated; see FS::cust_bill->cust_bill_pay";
+ #my $self = shift;
+ #sort { $a->_date <=> $b->_date }
+ # qsearch( 'cust_pay', { 'invnum' => $self->invnum } )
+ #;
+}
+
+=item cust_bill_pay
+
+Returns all payment applications (see L<FS::cust_bill_pay>) for this invoice.
+
+=cut
+
+sub cust_bill_pay {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch( 'cust_bill_pay', { 'invnum' => $self->invnum } );
+}
+
+=item cust_credited
+
+Returns all applied credits (see L<FS::cust_credit_bill>) for this invoice.
+
+=cut
+
+sub cust_credited {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch( 'cust_credit_bill', { 'invnum' => $self->invnum } )
+ ;
+}
+
+=item tax
+
+Returns the tax amount (see L<FS::cust_bill_pkg>) for this invoice.
+
+=cut
+
+sub tax {
+ my $self = shift;
+ my $total = 0;
+ my @taxlines = qsearch( 'cust_bill_pkg', { 'invnum' => $self->invnum ,
+ 'pkgnum' => 0 } );
+ foreach (@taxlines) { $total += $_->setup; }
+ $total;
+}
+
+=item owed
+
+Returns the amount owed (still outstanding) on this invoice, which is charged
+minus all payment applications (see L<FS::cust_bill_pay>) and credit
+applications (see L<FS::cust_credit_bill>).
+
+=cut
+
+sub owed {
+ my $self = shift;
+ my $balance = $self->charged;
+ $balance -= $_->amount foreach ( $self->cust_bill_pay );
+ $balance -= $_->amount foreach ( $self->cust_credited );
+ $balance = sprintf( "%.2f", $balance);
+ $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp
+ $balance;
+}
+
+=item send
+
+Sends this invoice to the destinations configured for this customer: send
+emails or print. See L<FS::cust_main_invoice>.
+
+=cut
+
+sub send {
+ my($self,$template) = @_;
+ my @print_text = $self->print_text('', $template);
+ my @invoicing_list = $self->cust_main->invoicing_list;
+
+ if ( grep { $_ ne 'POST' } @invoicing_list or !@invoicing_list ) { #email
+
+ #better to notify this person than silence
+ @invoicing_list = ($conf->config('invoice_from')) unless @invoicing_list;
+
+ my $error = send_email(
+ 'from' => $conf->config('invoice_from'),
+ 'to' => [ grep { $_ ne 'POST' } @invoicing_list ],
+ 'subject' => 'Invoice',
+ 'body' => \@print_text,
+ );
+ return "can't send invoice: $error" if $error;
+
+ }
+
+ if ( grep { $_ eq 'POST' } @invoicing_list ) { #postal
+ my $lpr = $conf->config('lpr');
+ open(LPR, "|$lpr")
+ or return "Can't open pipe to $lpr: $!";
+ print LPR @print_text;
+ close LPR
+ or return $! ? "Error closing $lpr: $!"
+ : "Exit status $? from $lpr";
+ }
+
+ '';
+
+}
+
+=item send_csv OPTIONS
+
+Sends invoice as a CSV data-file to a remote host with the specified protocol.
+
+Options are:
+
+protocol - currently only "ftp"
+server
+username
+password
+dir
+
+The file will be named "N-YYYYMMDDHHMMSS.csv" where N is the invoice number
+and YYMMDDHHMMSS is a timestamp.
+
+The fields of the CSV file is as follows:
+
+record_type, invnum, custnum, _date, charged, first, last, company, address1, address2, city, state, zip, country, pkg, setup, recur, sdate, edate
+
+=over 4
+
+=item record type - B<record_type> is either C<cust_bill> or C<cust_bill_pkg>
+
+If B<record_type> is C<cust_bill>, this is a primary invoice record. The
+last five fields (B<pkg> through B<edate>) are irrelevant, and all other
+fields are filled in.
+
+If B<record_type> is C<cust_bill_pkg>, this is a line item record. Only the
+first two fields (B<record_type> and B<invnum>) and the last five fields
+(B<pkg> through B<edate>) are filled in.
+
+=item invnum - invoice number
+
+=item custnum - customer number
+
+=item _date - invoice date
+
+=item charged - total invoice amount
+
+=item first - customer first name
+
+=item last - customer first name
+
+=item company - company name
+
+=item address1 - address line 1
+
+=item address2 - address line 1
+
+=item city
+
+=item state
+
+=item zip
+
+=item country
+
+=item pkg - line item description
+
+=item setup - line item setup fee (one or both of B<setup> and B<recur> will be defined)
+
+=item recur - line item recurring fee (one or both of B<setup> and B<recur> will be defined)
+
+=item sdate - start date for recurring fee
+
+=item edate - end date for recurring fee
+
+=back
+
+=cut
+
+sub send_csv {
+ my($self, %opt) = @_;
+
+ #part one: create file
+
+ my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/cust_bill";
+ mkdir $spooldir, 0700 unless -d $spooldir;
+
+ my $file = $spooldir. '/'. $self->invnum. time2str('-%Y%m%d%H%M%S.csv', time);
+
+ open(CSV, ">$file") or die "can't open $file: $!";
+
+ eval "use Text::CSV_XS";
+ die $@ if $@;
+
+ my $csv = Text::CSV_XS->new({'always_quote'=>1});
+
+ my $cust_main = $self->cust_main;
+
+ $csv->combine(
+ 'cust_bill',
+ $self->invnum,
+ $self->custnum,
+ time2str("%x", $self->_date),
+ sprintf("%.2f", $self->charged),
+ ( map { $cust_main->getfield($_) }
+ qw( first last company address1 address2 city state zip country ) ),
+ map { '' } (1..5),
+ ) or die "can't create csv";
+ print CSV $csv->string. "\n";
+
+ #new charges (false laziness w/print_text)
+ foreach my $cust_bill_pkg ( $self->cust_bill_pkg ) {
+
+ my($pkg, $setup, $recur, $sdate, $edate);
+ if ( $cust_bill_pkg->pkgnum ) {
+
+ ($pkg, $setup, $recur, $sdate, $edate) = (
+ $cust_bill_pkg->cust_pkg->part_pkg->pkg,
+ ( $cust_bill_pkg->setup != 0
+ ? sprintf("%.2f", $cust_bill_pkg->setup )
+ : '' ),
+ ( $cust_bill_pkg->recur != 0
+ ? sprintf("%.2f", $cust_bill_pkg->recur )
+ : '' ),
+ time2str("%x", $cust_bill_pkg->sdate),
+ time2str("%x", $cust_bill_pkg->edate),
+ );
+
+ } else { #pkgnum tax
+ next unless $cust_bill_pkg->setup != 0;
+ my $itemdesc = defined $cust_bill_pkg->dbdef_table->column('itemdesc')
+ ? ( $cust_bill_pkg->itemdesc || 'Tax' )
+ : 'Tax';
+ ($pkg, $setup, $recur, $sdate, $edate) =
+ ( $itemdesc, sprintf("%10.2f",$cust_bill_pkg->setup), '', '', '' );
+ }
+
+ $csv->combine(
+ 'cust_bill_pkg',
+ $self->invnum,
+ ( map { '' } (1..11) ),
+ ($pkg, $setup, $recur, $sdate, $edate)
+ ) or die "can't create csv";
+ print CSV $csv->string. "\n";
+
+ }
+
+ close CSV or die "can't close CSV: $!";
+
+ #part two: upload it
+
+ my $net;
+ if ( $opt{protocol} eq 'ftp' ) {
+ eval "use Net::FTP;";
+ die $@ if $@;
+ $net = Net::FTP->new($opt{server}) or die @$;
+ } else {
+ die "unknown protocol: $opt{protocol}";
+ }
+
+ $net->login( $opt{username}, $opt{password} )
+ or die "can't FTP to $opt{username}\@$opt{server}: login error: $@";
+
+ $net->binary or die "can't set binary mode";
+
+ $net->cwd($opt{dir}) or die "can't cwd to $opt{dir}";
+
+ $net->put($file) or die "can't put $file: $!";
+
+ $net->quit;
+
+ unlink $file;
+
+}
+
+=item comp
+
+Pays this invoice with a compliemntary payment. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub comp {
+ my $self = shift;
+ my $cust_pay = new FS::cust_pay ( {
+ 'invnum' => $self->invnum,
+ 'paid' => $self->owed,
+ '_date' => '',
+ 'payby' => 'COMP',
+ 'payinfo' => $self->cust_main->payinfo,
+ 'paybatch' => '',
+ } );
+ $cust_pay->insert;
+}
+
+=item realtime_card
+
+Attempts to pay this invoice with a credit card payment via a
+Business::OnlinePayment realtime gateway. See
+http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment
+for supported processors.
+
+=cut
+
+sub realtime_card {
+ my $self = shift;
+ $self->realtime_bop( 'CC', @_ );
+}
+
+=item realtime_ach
+
+Attempts to pay this invoice with an electronic check (ACH) payment via a
+Business::OnlinePayment realtime gateway. See
+http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment
+for supported processors.
+
+=cut
+
+sub realtime_ach {
+ my $self = shift;
+ $self->realtime_bop( 'ECHECK', @_ );
+}
+
+=item realtime_lec
+
+Attempts to pay this invoice with phone bill (LEC) payment via a
+Business::OnlinePayment realtime gateway. See
+http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment
+for supported processors.
+
+=cut
+
+sub realtime_lec {
+ my $self = shift;
+ $self->realtime_bop( 'LEC', @_ );
+}
+
+sub realtime_bop {
+ my( $self, $method ) = @_;
+
+ my $cust_main = $self->cust_main;
+ my $amount = $self->owed;
+
+ my $description = 'Internet Services';
+ if ( $conf->exists('business-onlinepayment-description') ) {
+ my $dtempl = $conf->config('business-onlinepayment-description');
+
+ my $agent_obj = $cust_main->agent
+ or die "can't retreive agent for $cust_main (agentnum ".
+ $cust_main->agentnum. ")";
+ my $agent = $agent_obj->agent;
+ my $pkgs = join(', ',
+ map { $_->cust_pkg->part_pkg->pkg }
+ grep { $_->pkgnum } $self->cust_bill_pkg
+ );
+ $description = eval qq("$dtempl");
+ }
+
+ $cust_main->realtime_bop($method, $amount,
+ 'description' => $description,
+ 'invnum' => $self->invnum,
+ );
+
+}
+
+=item batch_card
+
+Adds a payment for this invoice to the pending credit card batch (see
+L<FS::cust_pay_batch>).
+
+=cut
+
+sub batch_card {
+ my $self = shift;
+ my $cust_main = $self->cust_main;
+
+ my $cust_pay_batch = new FS::cust_pay_batch ( {
+ 'invnum' => $self->getfield('invnum'),
+ 'custnum' => $cust_main->getfield('custnum'),
+ 'last' => $cust_main->getfield('last'),
+ 'first' => $cust_main->getfield('first'),
+ 'address1' => $cust_main->getfield('address1'),
+ 'address2' => $cust_main->getfield('address2'),
+ 'city' => $cust_main->getfield('city'),
+ 'state' => $cust_main->getfield('state'),
+ 'zip' => $cust_main->getfield('zip'),
+ 'country' => $cust_main->getfield('country'),
+ 'trancode' => 77,
+ 'cardnum' => $cust_main->getfield('payinfo'),
+ 'exp' => $cust_main->getfield('paydate'),
+ 'payname' => $cust_main->getfield('payname'),
+ 'amount' => $self->owed,
+ } );
+ my $error = $cust_pay_batch->insert;
+ die $error if $error;
+
+ '';
+}
+
+=item print_text [TIME];
+
+Returns an text invoice, as a list of lines.
+
+TIME an optional value used to control the printing of overdue messages. The
+default is now. It isn't the date of the invoice; that's the `_date' field.
+It is specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=cut
+
+sub print_text {
+
+ my( $self, $today, $template ) = @_;
+ $today ||= time;
+# my $invnum = $self->invnum;
+ my $cust_main = qsearchs('cust_main', { 'custnum', $self->custnum } );
+ $cust_main->payname( $cust_main->first. ' '. $cust_main->getfield('last') )
+ unless $cust_main->payname && $cust_main->payby ne 'CHEK';
+
+ my( $pr_total, @pr_cust_bill ) = $self->previous; #previous balance
+# my( $cr_total, @cr_cust_credit ) = $self->cust_credit; #credits
+ #my $balance_due = $self->owed + $pr_total - $cr_total;
+ my $balance_due = $self->owed + $pr_total;
+
+ #my @collect = ();
+ #my($description,$amount);
+ @buf = ();
+
+ #previous balance
+ foreach ( @pr_cust_bill ) {
+ push @buf, [
+ "Previous Balance, Invoice #". $_->invnum.
+ " (". time2str("%x",$_->_date). ")",
+ $money_char. sprintf("%10.2f",$_->owed)
+ ];
+ }
+ if (@pr_cust_bill) {
+ push @buf,['','-----------'];
+ push @buf,[ 'Total Previous Balance',
+ $money_char. sprintf("%10.2f",$pr_total ) ];
+ push @buf,['',''];
+ }
+
+ #new charges
+ foreach my $cust_bill_pkg (
+ ( grep { $_->pkgnum } $self->cust_bill_pkg ), #packages first
+ ( grep { ! $_->pkgnum } $self->cust_bill_pkg ), #then taxes
+ ) {
+
+ if ( $cust_bill_pkg->pkgnum ) {
+
+ my $cust_pkg = qsearchs('cust_pkg', { pkgnum =>$cust_bill_pkg->pkgnum } );
+ my $part_pkg = qsearchs('part_pkg', { pkgpart=>$cust_pkg->pkgpart } );
+ my $pkg = $part_pkg->pkg;
+
+ if ( $cust_bill_pkg->setup != 0 ) {
+ push @buf, [ "$pkg Setup",
+ $money_char. sprintf("%10.2f", $cust_bill_pkg->setup) ];
+ push @buf,
+ map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
+ }
+
+ if ( $cust_bill_pkg->recur != 0 ) {
+ push @buf, [
+ "$pkg (" . time2str("%x", $cust_bill_pkg->sdate) . " - " .
+ time2str("%x", $cust_bill_pkg->edate) . ")",
+ $money_char. sprintf("%10.2f", $cust_bill_pkg->recur)
+ ];
+ push @buf,
+ map { [ " ". $_->[0]. ": ". $_->[1], '' ] } $cust_pkg->labels;
+ }
+
+ push @buf, map { [ " $_", '' ] } $cust_bill_pkg->details;
+
+ } else { #pkgnum tax or one-shot line item
+ my $itemdesc = defined $cust_bill_pkg->dbdef_table->column('itemdesc')
+ ? ( $cust_bill_pkg->itemdesc || 'Tax' )
+ : 'Tax';
+ if ( $cust_bill_pkg->setup != 0 ) {
+ push @buf, [ $itemdesc,
+ $money_char. sprintf("%10.2f", $cust_bill_pkg->setup) ];
+ }
+ if ( $cust_bill_pkg->recur != 0 ) {
+ push @buf, [ "$itemdesc (". time2str("%x", $cust_bill_pkg->sdate). " - "
+ . time2str("%x", $cust_bill_pkg->edate). ")",
+ $money_char. sprintf("%10.2f", $cust_bill_pkg->recur)
+ ];
+ }
+ }
+ }
+
+ push @buf,['','-----------'];
+ push @buf,['Total New Charges',
+ $money_char. sprintf("%10.2f",$self->charged) ];
+ push @buf,['',''];
+
+ push @buf,['','-----------'];
+ push @buf,['Total Charges',
+ $money_char. sprintf("%10.2f",$self->charged + $pr_total) ];
+ push @buf,['',''];
+
+ #credits
+ foreach ( $self->cust_credited ) {
+
+ #something more elaborate if $_->amount ne $_->cust_credit->credited ?
+
+ my $reason = substr($_->cust_credit->reason,0,32);
+ $reason .= '...' if length($reason) < length($_->cust_credit->reason);
+ $reason = " ($reason) " if $reason;
+ push @buf,[
+ "Credit #". $_->crednum. " (". time2str("%x",$_->cust_credit->_date) .")".
+ $reason,
+ $money_char. sprintf("%10.2f",$_->amount)
+ ];
+ }
+ #foreach ( @cr_cust_credit ) {
+ # push @buf,[
+ # "Credit #". $_->crednum. " (" . time2str("%x",$_->_date) .")",
+ # $money_char. sprintf("%10.2f",$_->credited)
+ # ];
+ #}
+
+ #get & print payments
+ foreach ( $self->cust_bill_pay ) {
+
+ #something more elaborate if $_->amount ne ->cust_pay->paid ?
+
+ push @buf,[
+ "Payment received ". time2str("%x",$_->cust_pay->_date ),
+ $money_char. sprintf("%10.2f",$_->amount )
+ ];
+ }
+
+ #balance due
+ push @buf,['','-----------'];
+ push @buf,['Balance Due', $money_char.
+ sprintf("%10.2f", $balance_due ) ];
+
+ #create the template
+ my $templatefile = 'invoice_template';
+ $templatefile .= "_$template" if $template;
+ my @invoice_template = $conf->config($templatefile)
+ or die "cannot load config file $templatefile";
+ $invoice_lines = 0;
+ my $wasfunc = 0;
+ foreach ( grep /invoice_lines\(\d*\)/, @invoice_template ) { #kludgy
+ /invoice_lines\((\d*)\)/;
+ $invoice_lines += $1 || scalar(@buf);
+ $wasfunc=1;
+ }
+ die "no invoice_lines() functions in template?" unless $wasfunc;
+ my $invoice_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @invoice_template ],
+ ) or die "can't create new Text::Template object: $Text::Template::ERROR";
+ $invoice_template->compile()
+ or die "can't compile template: $Text::Template::ERROR";
+
+ #setup template variables
+ package FS::cust_bill::_template; #!
+ use vars qw( $invnum $date $page $total_pages @address $overdue @buf $agent );
+
+ $invnum = $self->invnum;
+ $date = $self->_date;
+ $page = 1;
+ $agent = $self->cust_main->agent->agent;
+
+ if ( $FS::cust_bill::invoice_lines ) {
+ $total_pages =
+ int( scalar(@FS::cust_bill::buf) / $FS::cust_bill::invoice_lines );
+ $total_pages++
+ if scalar(@FS::cust_bill::buf) % $FS::cust_bill::invoice_lines;
+ } else {
+ $total_pages = 1;
+ }
+
+ #format address (variable for the template)
+ my $l = 0;
+ @address = ( '', '', '', '', '', '' );
+ package FS::cust_bill; #!
+ $FS::cust_bill::_template::address[$l++] =
+ $cust_main->payname.
+ ( ( $cust_main->payby eq 'BILL' ) && $cust_main->payinfo
+ ? " (P.O. #". $cust_main->payinfo. ")"
+ : ''
+ )
+ ;
+ $FS::cust_bill::_template::address[$l++] = $cust_main->company
+ if $cust_main->company;
+ $FS::cust_bill::_template::address[$l++] = $cust_main->address1;
+ $FS::cust_bill::_template::address[$l++] = $cust_main->address2
+ if $cust_main->address2;
+ $FS::cust_bill::_template::address[$l++] =
+ $cust_main->city. ", ". $cust_main->state. " ". $cust_main->zip;
+ $FS::cust_bill::_template::address[$l++] = $cust_main->country
+ unless $cust_main->country eq 'US';
+
+ # #overdue? (variable for the template)
+ # $FS::cust_bill::_template::overdue = (
+ # $balance_due > 0
+ # && $today > $self->_date
+ ## && $self->printed > 1
+ # && $self->printed > 0
+ # );
+
+ #and subroutine for the template
+ sub FS::cust_bill::_template::invoice_lines {
+ my $lines = shift || scalar(@buf);
+ map {
+ scalar(@buf) ? shift @buf : [ '', '' ];
+ }
+ ( 1 .. $lines );
+ }
+
+ #and fill it in
+ $FS::cust_bill::_template::page = 1;
+ my $lines;
+ my @collect;
+ while (@buf) {
+ push @collect, split("\n",
+ $invoice_template->fill_in( PACKAGE => 'FS::cust_bill::_template' )
+ );
+ $FS::cust_bill::_template::page++;
+ }
+
+ map "$_\n", @collect;
+
+}
+
+=back
+
+=head1 BUGS
+
+The delete method.
+
+print_text formatting (and some logic :/) is in source, but needs to be
+slurped in from a file. Also number of lines ($=).
+
+missing print_ps for a nice postscript copy (maybe HylaFAX-cover-page-style
+or something similar so the look can be completely customized?)
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill_pay>, L<FS::cust_pay>,
+L<FS::cust_bill_pkg>, L<FS::cust_bill_credit>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_bill_event.pm b/FS/FS/cust_bill_event.pm
new file mode 100644
index 000000000..c97734780
--- /dev/null
+++ b/FS/FS/cust_bill_event.pm
@@ -0,0 +1,180 @@
+package FS::cust_bill_event;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_bill;
+use FS::part_bill_event;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::cust_bill_event - Object methods for cust_bill_event records
+
+=head1 SYNOPSIS
+
+ use FS::cust_bill_event;
+
+ $record = new FS::cust_bill_event \%hash;
+ $record = new FS::cust_bill_event { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_bill_event object represents an complete invoice event.
+FS::cust_bill_event inherits from FS::Record. The following fields are
+currently supported:
+
+=over 4
+
+=item eventnum - primary key
+
+=item invnum - invoice (see L<FS::cust_bill>)
+
+=item eventpart - event definition (see L<FS::part_bill_event>)
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=item status - event status: B<done> or B<failed>
+
+=item statustext - additional status detail (i.e. error message)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new completed invoice event. To add the compelted invoice event to
+the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'cust_bill_event'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid completed invoice event. If
+there is an error, returns the error, otherwise returns false. Called by the
+insert and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error = $self->ut_numbern('eventnum')
+ || $self->ut_number('invnum')
+ || $self->ut_number('eventpart')
+ || $self->ut_number('_date')
+ || $self->ut_enum('status', [qw( done failed )])
+ || $self->ut_textn('statustext')
+ ;
+
+ return "Unknown invnum ". $self->invnum
+ unless qsearchs( 'cust_bill' ,{ 'invnum' => $self->invnum } );
+
+ return "Unknown eventpart ". $self->eventpart
+ unless qsearchs( 'part_bill_event' ,{ 'eventpart' => $self->eventpart } );
+
+ ''; #no error
+}
+
+=item part_bill_event
+
+Returns the invoice event definition (see L<FS::part_bill_event>) for this
+completed invoice event.
+
+=cut
+
+sub part_bill_event {
+ my $self = shift;
+ qsearchs( 'part_bill_event', { 'eventpart' => $self->eventpart } );
+}
+
+=item cust_bill
+
+Returns the invoice (see L<FS::cust_bill>) for this completed invoice event.
+
+=cut
+
+sub cust_bill {
+ my $self = shift;
+ qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
+}
+
+=item retry
+
+Changes the status of this event from B<done> to B<failed>, allowing it to be
+retried.
+
+=cut
+
+sub retry {
+ my $self = shift;
+ return '' unless $self->status eq 'done';
+ my $old = ref($self)->new( { $self->hash } );
+ $self->status('failed');
+ $self->replace($old);
+}
+
+=back
+
+=head1 BUGS
+
+Far too early in the morning.
+
+=head1 SEE ALSO
+
+L<FS::part_bill_event>, L<FS::cust_bill>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_bill_pay.pm b/FS/FS/cust_bill_pay.pm
new file mode 100644
index 000000000..913704bef
--- /dev/null
+++ b/FS/FS/cust_bill_pay.pm
@@ -0,0 +1,219 @@
+package FS::cust_bill_pay;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs dbh );
+use FS::cust_bill;
+use FS::cust_pay;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_bill_pay - Object methods for cust_bill_pay records
+
+=head1 SYNOPSIS
+
+ use FS::cust_bill_pay;
+
+ $record = new FS::cust_bill_pay \%hash;
+ $record = new FS::cust_bill_pay { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_bill_pay object represents the application of a payment to a
+specific invoice. FS::cust_bill_pay inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item billpaynum - primary key (assigned automatically)
+
+=item invnum - Invoice (see L<FS::cust_bill>)
+
+=item paynum - Payment (see L<FS::cust_pay>)
+
+=item amount - Amount of the payment to apply to the specific invoice.
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new record. To add the record to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_bill_pay'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ $error = $self->SUPER::insert;
+
+ my $cust_pay = qsearchs('cust_pay', { 'paynum' => $self->paynum } ) or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "unknown cust_pay.paynum: ". $self->paynum;
+ };
+
+ my $pay_total = 0;
+ $pay_total += $_ foreach map { $_->amount }
+ qsearch('cust_bill_pay', { 'paynum' => $self->paynum } );
+
+ if ( sprintf("%.2f", $pay_total) > sprintf("%.2f", $cust_pay->paid) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "total cust_bill_pay.amount $pay_total for paynum ". $self->paynum.
+ " greater than cust_pay.paid ". $cust_pay->paid;
+ }
+
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $self->invnum } ) or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "unknown cust_bill.invnum: ". $self->invnum;
+ };
+
+ my $bill_total = 0;
+ $bill_total += $_ foreach map { $_->amount }
+ qsearch('cust_bill_pay', { 'invnum' => $self->invnum } );
+ $bill_total += $_ foreach map { $_->amount }
+ qsearch('cust_credit_bill', { 'invnum' => $self->invnum } );
+ if ( sprintf("%.2f", $bill_total) > sprintf("%.2f", $cust_bill->charged) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "total cust_bill_pay.amount and cust_credit_bill.amount $bill_total".
+ " for invnum ". $self->invnum.
+ " greater than cust_bill.charged ". $cust_bill->charged;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item delete
+
+Deletes this payment application, unless the closed flag for the parent payment
+(see L<FS::cust_pay>) is set.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't delete application for closed payment"
+ if $self->cust_pay->closed =~ /^Y/i;
+ $self->SUPER::delete(@_);
+}
+
+=item replace OLD_RECORD
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub replace {
+ return "Can't (yet?) modify cust_bill_pay records!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid payment. If there is an error,
+returns the error, otherwise returns false. Called by the insert method.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('billpaynum')
+ || $self->ut_number('invnum')
+ || $self->ut_number('paynum')
+ || $self->ut_money('amount')
+ || $self->ut_numbern('_date')
+ ;
+ return $error if $error;
+
+ return "amount must be > 0" if $self->amount <= 0;
+
+ $self->_date(time) unless $self->_date;
+
+ ''; #no error
+}
+
+=item cust_pay
+
+Returns the payment (see L<FS::cust_pay>)
+
+=cut
+
+sub cust_pay {
+ my $self = shift;
+ qsearchs( 'cust_pay', { 'paynum' => $self->paynum } );
+}
+
+=item cust_bill
+
+Returns the invoice (see L<FS::cust_bill>)
+
+=cut
+
+sub cust_bill {
+ my $self = shift;
+ qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_bill_pay.pm,v 1.12 2002-02-07 22:29:34 ivan Exp $
+
+=head1 BUGS
+
+Delete and replace methods.
+
+the checks for over-applied payments could be better done like the ones in
+cust_bill_credit
+
+=head1 SEE ALSO
+
+L<FS::cust_pay>, L<FS::cust_bill>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
new file mode 100644
index 000000000..a6615d05d
--- /dev/null
+++ b/FS/FS/cust_bill_pkg.pm
@@ -0,0 +1,215 @@
+package FS::cust_bill_pkg;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs dbdef dbh );
+use FS::cust_pkg;
+use FS::cust_bill;
+use FS::cust_bill_pkg_detail;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_bill_pkg - Object methods for cust_bill_pkg records
+
+=head1 SYNOPSIS
+
+ use FS::cust_bill_pkg;
+
+ $record = new FS::cust_bill_pkg \%hash;
+ $record = new FS::cust_bill_pkg { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_bill_pkg object represents an invoice line item.
+FS::cust_bill_pkg inherits from FS::Record. The following fields are currently
+supported:
+
+=over 4
+
+=item invnum - invoice (see L<FS::cust_bill>)
+
+=item pkgnum - package (see L<FS::cust_pkg>) or 0 for the special virtual sales tax package
+
+=item setup - setup fee
+
+=item recur - recurring fee
+
+=item sdate - starting date of recurring fee
+
+=item edate - ending date of recurring fee
+
+=item itemdesc - Line item description (currentlty used only when pkgnum is 0)
+
+=back
+
+sdate and edate are specified as UNIX timestamps; see L<perlfunc/"time">. Also
+see L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new line item. To add the line item to the database, see
+L<"insert">. Line items are normally created by calling the bill method of a
+customer object (see L<FS::cust_main>).
+
+=cut
+
+sub table { 'cust_bill_pkg'; }
+
+=item insert
+
+Adds this line item to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ unless ( defined dbdef->table('cust_bill_pkg_detail') && $self->get('details') ) {
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ return '';
+ }
+
+ foreach my $detail ( @{$self->get('details')} ) {
+ my $cust_bill_pkg_detail = new FS::cust_bill_pkg_detail {
+ 'pkgnum' => $self->pkgnum,
+ 'invnum' => $self->invnum,
+ 'detail' => $detail,
+ };
+ $error = $cust_bill_pkg_detail->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item delete
+
+Currently unimplemented. I don't remove line items because there would then be
+no record the items ever existed (which is bad, no?)
+
+=cut
+
+sub delete {
+ return "Can't delete cust_bill_pkg records!";
+}
+
+=item replace OLD_RECORD
+
+Currently unimplemented. This would be even more of an accounting nightmare
+than deleteing the items. Just don't do it.
+
+=cut
+
+sub replace {
+ return "Can't modify cust_bill_pkg records!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid line item. If there is an
+error, returns the error, otherwise returns false. Called by the insert
+method.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_number('pkgnum')
+ || $self->ut_number('invnum')
+ || $self->ut_money('setup')
+ || $self->ut_money('recur')
+ || $self->ut_numbern('sdate')
+ || $self->ut_numbern('edate')
+ || $self->ut_textn('itemdesc')
+ ;
+ return $error if $error;
+
+ if ( $self->pkgnum != 0 ) { #allow unchecked pkgnum 0 for tax! (add to part_pkg?)
+ return "Unknown pkgnum ". $self->pkgnum
+ unless qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
+ }
+
+ return "Unknown invnum"
+ unless qsearchs( 'cust_bill' ,{ 'invnum' => $self->invnum } );
+
+ ''; #no error
+}
+
+=item cust_pkg
+
+Returns the package (see L<FS::cust_pkg>) for this invoice line item.
+
+=cut
+
+sub cust_pkg {
+ my $self = shift;
+ qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
+}
+
+=item details
+
+Returns an array of detail information for the invoice line item.
+
+=cut
+
+sub details {
+ my $self = shift;
+ return () unless defined dbdef->table('cust_bill_pkg_detail');
+ map { $_->detail }
+ qsearch ( 'cust_bill_pkg_detail', { 'pkgnum' => $self->pkgnum,
+ 'invnum' => $self->invnum, } );
+ #qsearch ( 'cust_bill_pkg_detail', { 'lineitemnum' => $self->lineitemnum });
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_bill>, L<FS::cust_pkg>, L<FS::cust_main>, schema.html
+from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_bill_pkg_detail.pm b/FS/FS/cust_bill_pkg_detail.pm
new file mode 100644
index 000000000..199de439b
--- /dev/null
+++ b/FS/FS/cust_bill_pkg_detail.pm
@@ -0,0 +1,123 @@
+package FS::cust_bill_pkg_detail;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::cust_bill_pkg_detail - Object methods for cust_bill_pkg_detail records
+
+=head1 SYNOPSIS
+
+ use FS::cust_bill_pkg_detail;
+
+ $record = new FS::cust_bill_pkg_detail \%hash;
+ $record = new FS::cust_bill_pkg_detail { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_bill_pkg_detail object represents additional detail information for
+an invoice line item (see L<FS::cust_bill_pkg>). FS::cust_bill_pkg_detail
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item detailnum - primary key
+
+=item pkgnum -
+
+=item invnum -
+
+=item detail - detail description
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new line item detail. To add the line item detail to the database,
+see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'cust_bill_pkg_detail'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid line item detail. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('detailnum')
+ || $self->ut_foreign_key('pkgnum', 'cust_pkg', 'pkgnum')
+ || $self->ut_foreign_key('invnum', 'cust_pkg', 'invnum')
+ || $self->ut_text('detail')
+ ;
+
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::cust_bill_pkg>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm
new file mode 100644
index 000000000..284d59de2
--- /dev/null
+++ b/FS/FS/cust_credit.pm
@@ -0,0 +1,260 @@
+package FS::cust_credit;
+
+use strict;
+use vars qw( @ISA $conf $unsuspendauto );
+use FS::UID qw( dbh getotaker );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main;
+use FS::cust_refund;
+use FS::cust_credit_bill;
+
+@ISA = qw( FS::Record );
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::cust_credit'} = sub {
+
+ $conf = new FS::Conf;
+ $unsuspendauto = $conf->exists('unsuspendauto');
+
+};
+
+=head1 NAME
+
+FS::cust_credit - Object methods for cust_credit records
+
+=head1 SYNOPSIS
+
+ use FS::cust_credit;
+
+ $record = new FS::cust_credit \%hash;
+ $record = new FS::cust_credit { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_credit object represents a credit; the equivalent of a negative
+B<cust_bill> record (see L<FS::cust_bill>). FS::cust_credit inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item crednum - primary key (assigned automatically for new credits)
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item amount - amount of the credit
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=item otaker - order taker (assigned automatically, see L<FS::UID>)
+
+=item reason - text
+
+=item closed - books closed flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new credit. To add the credit to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_credit'; }
+
+=item insert
+
+Adds this credit to the database ("Posts" the credit). If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $cust_main = qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+ my $old_balance = $cust_main->balance;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error inserting $self: $error";
+ }
+
+ #false laziness w/ cust_credit::insert
+ if ( $unsuspendauto && $old_balance && $cust_main->balance <= 0 ) {
+ my @errors = $cust_main->unsuspend;
+ #return
+ # side-fx with nested transactions? upstack rolls back?
+ warn "WARNING:Errors unsuspending customer ". $cust_main->custnum. ": ".
+ join(' / ', @errors)
+ if @errors;
+ }
+ #eslaf
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item delete
+
+Currently unimplemented.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't delete closed credit" if $self->closed =~ /^Y/i;
+ $self->SUPER::delete(@_);
+}
+
+=item replace OLD_RECORD
+
+Credits may not be modified; there would then be no record the credit was ever
+posted.
+
+=cut
+
+sub replace {
+ return "Can't modify credit!"
+}
+
+=item check
+
+Checks all fields to make sure this is a valid credit. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('crednum')
+ || $self->ut_number('custnum')
+ || $self->ut_numbern('_date')
+ || $self->ut_money('amount')
+ || $self->ut_textn('reason')
+ || $self->ut_enum('closed', [ '', 'Y' ])
+ ;
+ return $error if $error;
+
+ return "amount must be > 0 " if $self->amount <= 0;
+
+ return "Unknown customer"
+ unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+
+ $self->_date(time) unless $self->_date;
+
+ $self->otaker(getotaker);
+
+ ''; #no error
+}
+
+=item cust_refund
+
+Depreciated. See the cust_credit_refund method.
+
+#Returns all refunds (see L<FS::cust_refund>) for this credit.
+
+=cut
+
+sub cust_refund {
+ use Carp;
+ croak "FS::cust_credit->cust_pay depreciated; see ".
+ "FS::cust_credit->cust_credit_refund";
+ #my $self = shift;
+ #sort { $a->_date <=> $b->_date }
+ # qsearch( 'cust_refund', { 'crednum' => $self->crednum } )
+ #;
+}
+
+=item cust_credit_refund
+
+Returns all refund applications (see L<FS::cust_credit_refund>) for this credit.
+
+=cut
+
+sub cust_credit_refund {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch( 'cust_credit_refund', { 'crednum' => $self->crednum } )
+ ;
+}
+
+=item cust_credit_bill
+
+Returns all application to invoices (see L<FS::cust_credit_bill>) for this
+credit.
+
+=cut
+
+sub cust_credit_bill {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch( 'cust_credit_bill', { 'crednum' => $self->crednum } )
+ ;
+}
+
+=item credited
+
+Returns the amount of this credit that is still outstanding; which is
+amount minus all refund applications (see L<FS::cust_credit_refund>) and
+applications to invoices (see L<FS::cust_credit_bill>).
+
+=cut
+
+sub credited {
+ my $self = shift;
+ my $amount = $self->amount;
+ $amount -= $_->amount foreach ( $self->cust_credit_refund );
+ $amount -= $_->amount foreach ( $self->cust_credit_bill );
+ sprintf( "%.2f", $amount );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_credit.pm,v 1.16 2002-06-04 14:35:52 ivan Exp $
+
+=head1 BUGS
+
+The delete method.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_credit_refund>, L<FS::cust_refund>,
+L<FS::cust_credit_bill> L<FS::cust_bill>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_credit_bill.pm b/FS/FS/cust_credit_bill.pm
new file mode 100644
index 000000000..62215419c
--- /dev/null
+++ b/FS/FS/cust_credit_bill.pm
@@ -0,0 +1,162 @@
+package FS::cust_credit_bill;
+
+use strict;
+use vars qw( @ISA );
+use FS::UID qw( getotaker );
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main;
+#use FS::cust_refund;
+use FS::cust_credit;
+use FS::cust_bill;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_credit_bill - Object methods for cust_credit_bill records
+
+=head1 SYNOPSIS
+
+ use FS::cust_credit_bill;
+
+ $record = new FS::cust_credit_bill \%hash;
+ $record = new FS::cust_credit_bill { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_credit_bill object represents application of a credit (see
+L<FS::cust_credit>) to an invoice (see L<FS::cust_bill>). FS::cust_credit
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item creditbillnum - primary key
+
+=item crednum - credit being applied
+
+=item invnum - invoice to which credit is applied (see L<FS::cust_bill>)
+
+=item amount - amount of the credit applied
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new cust_credit_bill. To add the cust_credit_bill to the database,
+see L<"insert">.
+
+=cut
+
+sub table { 'cust_credit_bill'; }
+
+=item insert
+
+Adds this cust_credit_bill to the database ("Posts" all or part of a credit).
+If there is an error, returns the error, otherwise returns false.
+
+=item delete
+
+Currently unimplemented.
+
+=cut
+
+sub delete {
+ return "Can't unapply credit!"
+}
+
+=item replace OLD_RECORD
+
+Application of credits may not be modified.
+
+=cut
+
+sub replace {
+ return "Can't modify application of credit!"
+}
+
+=item check
+
+Checks all fields to make sure this is a valid credit application. If there
+is an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('creditbillnum')
+ || $self->ut_number('crednum')
+ || $self->ut_number('invnum')
+ || $self->ut_numbern('_date')
+ || $self->ut_money('amount')
+ ;
+ return $error if $error;
+
+ return "amount must be > 0" if $self->amount <= 0;
+
+ return "Unknown credit"
+ unless my $cust_credit =
+ qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+
+ return "Unknown invoice"
+ unless my $cust_bill =
+ qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
+
+ $self->_date(time) unless $self->_date;
+
+ return "Cannot apply more than remaining value of credit"
+ unless $self->amount <= $cust_credit->credited;
+
+ return "Cannot apply more than remaining value of invoice"
+ unless $self->amount <= $cust_bill->owed;
+
+ ''; #no error
+}
+
+=item sub cust_credit
+
+Returns the credit (see L<FS::cust_credit>)
+
+=cut
+
+sub cust_credit {
+ my $self = shift;
+ qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_credit_bill.pm,v 1.7 2002-01-24 16:58:47 ivan Exp $
+
+=head1 BUGS
+
+The delete method.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_refund>, L<FS::cust_bill>, L<FS::cust_credit>,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_credit_refund.pm b/FS/FS/cust_credit_refund.pm
new file mode 100644
index 000000000..cc3b32cdb
--- /dev/null
+++ b/FS/FS/cust_credit_refund.pm
@@ -0,0 +1,205 @@
+package FS::cust_credit_refund;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs dbh );
+#use FS::UID qw(getotaker);
+use FS::cust_credit;
+use FS::cust_refund;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_credit_refund - Object methods for cust_bill_pay records
+
+=head1 SYNOPSIS
+
+ use FS::cust_credit_refund;
+
+ $record = new FS::cust_credit_refund \%hash;
+ $record = new FS::cust_credit_refund { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_credit_refund represents the application of a refund to a specific
+credit. FS::cust_credit_refund inherits from FS::Record. The following fields
+are currently supported:
+
+=over 4
+
+=item creditrefundnum - primary key (assigned automatically)
+
+=item crednum - Credit (see L<FS::cust_credit>)
+
+=item refundnum - Refund (see L<FS::cust_refund>)
+
+=item amount - Amount of the refund to apply to the specific credit.
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new record. To add the record to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_credit_refund'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ $error = $self->SUPER::insert;
+
+ my $cust_refund =
+ qsearchs('cust_refund', { 'refundnum' => $self->refundnum } )
+ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "unknown cust_refund.refundnum: ". $self->refundnum
+ };
+
+ my $refund_total = 0;
+ $refund_total += $_ foreach map { $_->amount }
+ qsearch('cust_credit_refund', { 'refundnum' => $self->refundnum } );
+
+ if ( $refund_total > $cust_refund->refund ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "total cust_credit_refund.amount $refund_total for refundnum ".
+ $self->refundnum.
+ " greater than cust_refund.refund ". $cust_refund->refund;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item delete
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub delete {
+ return "Can't (yet?) delete cust_credit_refund records!";
+}
+
+=item replace OLD_RECORD
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub replace {
+ return "Can't (yet?) modify cust_credit_refund records!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid payment. If there is an error,
+returns the error, otherwise returns false. Called by the insert method.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('creditrefundnum')
+ || $self->ut_number('crednum')
+ || $self->ut_number('refundnum')
+ || $self->ut_money('amount')
+ || $self->ut_numbern('_date')
+ ;
+ return $error if $error;
+
+ return "amount must be > 0" if $self->amount <= 0;
+
+ $self->_date(time) unless $self->_date;
+
+ return "unknown cust_credit.crednum: ". $self->crednum
+ unless qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+
+ ''; #no error
+}
+
+=item cust_refund
+
+Returns the refund (see L<FS::cust_refund>)
+
+=cut
+
+sub cust_refund {
+ my $self = shift;
+ qsearchs( 'cust_refund', { 'refundnum' => $self->refundnum } );
+}
+
+=item cust_credit
+
+Returns the credit (see L<FS::cust_credit>)
+
+=cut
+
+sub cust_credit {
+ my $self = shift;
+ qsearchs( 'cust_credit', { 'crednum' => $self->crednum } );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_credit_refund.pm,v 1.9 2002-01-26 01:52:31 ivan Exp $
+
+=head1 BUGS
+
+Delete and replace methods.
+
+the checks for over-applied refunds could be better done like the ones in
+cust_bill_credit
+
+=head1 SEE ALSO
+
+L<FS::cust_credit>, L<FS::cust_refund>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
new file mode 100644
index 000000000..4302c504a
--- /dev/null
+++ b/FS/FS/cust_main.pm
@@ -0,0 +1,2559 @@
+package FS::cust_main;
+
+use strict;
+use vars qw( @ISA $conf $Debug $import );
+use Safe;
+use Carp;
+BEGIN {
+ eval "use Time::Local;";
+ die "Time::Local version 1.05 required with Perl versions before 5.6"
+ if $] < 5.006 && !defined($Time::Local::VERSION);
+ eval "use Time::Local qw(timelocal timelocal_nocheck);";
+}
+use Date::Format;
+#use Date::Manip;
+use Business::CreditCard;
+use FS::UID qw( getotaker dbh );
+use FS::Record qw( qsearchs qsearch dbdef );
+use FS::Misc qw( send_email );
+use FS::cust_pkg;
+use FS::cust_bill;
+use FS::cust_bill_pkg;
+use FS::cust_pay;
+use FS::cust_credit;
+use FS::part_referral;
+use FS::cust_main_county;
+use FS::agent;
+use FS::cust_main_invoice;
+use FS::cust_credit_bill;
+use FS::cust_bill_pay;
+use FS::prepay_credit;
+use FS::queue;
+use FS::part_pkg;
+use FS::part_bill_event;
+use FS::cust_bill_event;
+use FS::cust_tax_exempt;
+use FS::type_pkgs;
+use FS::Msgcat qw(gettext);
+
+@ISA = qw( FS::Record );
+
+$Debug = 1;
+#$Debug = 1;
+
+$import = 0;
+
+#ask FS::UID to run this stuff for us later
+#$FS::UID::callback{'FS::cust_main'} = sub {
+install_callback FS::UID sub {
+ $conf = new FS::Conf;
+ #yes, need it for stuff below (prolly should be cached)
+};
+
+sub _cache {
+ my $self = shift;
+ my ( $hashref, $cache ) = @_;
+ if ( exists $hashref->{'pkgnum'} ) {
+# #@{ $self->{'_pkgnum'} } = ();
+ my $subcache = $cache->subcache( 'pkgnum', 'cust_pkg', $hashref->{custnum});
+ $self->{'_pkgnum'} = $subcache;
+ #push @{ $self->{'_pkgnum'} },
+ FS::cust_pkg->new_or_cached($hashref, $subcache) if $hashref->{pkgnum};
+ }
+}
+
+=head1 NAME
+
+FS::cust_main - Object methods for cust_main records
+
+=head1 SYNOPSIS
+
+ use FS::cust_main;
+
+ $record = new FS::cust_main \%hash;
+ $record = new FS::cust_main { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ @cust_pkg = $record->all_pkgs;
+
+ @cust_pkg = $record->ncancelled_pkgs;
+
+ @cust_pkg = $record->suspended_pkgs;
+
+ $error = $record->bill;
+ $error = $record->bill %options;
+ $error = $record->bill 'time' => $time;
+
+ $error = $record->collect;
+ $error = $record->collect %options;
+ $error = $record->collect 'invoice_time' => $time,
+ 'batch_card' => 'yes',
+ 'report_badcard' => 'yes',
+ ;
+
+=head1 DESCRIPTION
+
+An FS::cust_main object represents a customer. FS::cust_main inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item custnum - primary key (assigned automatically for new customers)
+
+=item agentnum - agent (see L<FS::agent>)
+
+=item refnum - Advertising source (see L<FS::part_referral>)
+
+=item first - name
+
+=item last - name
+
+=item ss - social security number (optional)
+
+=item company - (optional)
+
+=item address1
+
+=item address2 - (optional)
+
+=item city
+
+=item county - (optional, see L<FS::cust_main_county>)
+
+=item state - (see L<FS::cust_main_county>)
+
+=item zip
+
+=item country - (see L<FS::cust_main_county>)
+
+=item daytime - phone (optional)
+
+=item night - phone (optional)
+
+=item fax - phone (optional)
+
+=item ship_first - name
+
+=item ship_last - name
+
+=item ship_company - (optional)
+
+=item ship_address1
+
+=item ship_address2 - (optional)
+
+=item ship_city
+
+=item ship_county - (optional, see L<FS::cust_main_county>)
+
+=item ship_state - (see L<FS::cust_main_county>)
+
+=item ship_zip
+
+=item ship_country - (see L<FS::cust_main_county>)
+
+=item ship_daytime - phone (optional)
+
+=item ship_night - phone (optional)
+
+=item ship_fax - phone (optional)
+
+=item payby - I<CARD> (credit card - automatic), I<DCRD> (credit card - on-demand), I<CHEK> (electronic check - automatic), I<DCHK> (electronic check - on-demand), I<LECB> (Phone bill billing), I<BILL> (billing), I<COMP> (free), or I<PREPAY> (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to I<BILL>)
+
+=item payinfo - card number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) or prepayment identifier (see L<FS::prepay_credit>)
+
+=item paydate - expiration date, mm/yyyy, m/yyyy, mm/yy or m/yy
+
+=item payname - name on card or billing name
+
+=item tax - tax exempt, empty or `Y'
+
+=item otaker - order taker (assigned automatically, see L<FS::UID>)
+
+=item comments - comments (optional)
+
+=item referral_custnum - referring customer number
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new customer. To add the customer to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'cust_main'; }
+
+=item insert [ CUST_PKG_HASHREF [ , INVOICING_LIST_ARYREF ] ]
+
+Adds this customer to the database. If there is an error, returns the error,
+otherwise returns false.
+
+CUST_PKG_HASHREF: If you pass a Tie::RefHash data structure to the insert
+method containing FS::cust_pkg and FS::svc_I<tablename> objects, all records
+are inserted atomicly, or the transaction is rolled back. Passing an empty
+hash reference is equivalent to not supplying this parameter. There should be
+a better explanation of this, but until then, here's an example:
+
+ use Tie::RefHash;
+ tie %hash, 'Tie::RefHash'; #this part is important
+ %hash = (
+ $cust_pkg => [ $svc_acct ],
+ ...
+ );
+ $cust_main->insert( \%hash );
+
+INVOICING_LIST_ARYREF: If you pass an arrarref to the insert method, it will
+be set as the invoicing list (see L<"invoicing_list">). Errors return as
+expected and rollback the entire transaction; it is not necessary to call
+check_invoicing_list first. The invoicing_list is set after the records in the
+CUST_PKG_HASHREF above are inserted, so it is now possible to set an
+invoicing_list destination to the newly-created svc_acct. Here's an example:
+
+ $cust_main->insert( {}, [ $email, 'POST' ] );
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $cust_pkgs = @_ ? shift : {};
+ my $invoicing_list = @_ ? shift : '';
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $amount = 0;
+ my $seconds = 0;
+ if ( $self->payby eq 'PREPAY' ) {
+ $self->payby('BILL');
+ my $prepay_credit = qsearchs(
+ 'prepay_credit',
+ { 'identifier' => $self->payinfo },
+ '',
+ 'FOR UPDATE'
+ );
+ warn "WARNING: can't find pre-found prepay_credit: ". $self->payinfo
+ unless $prepay_credit;
+ $amount = $prepay_credit->amount;
+ $seconds = $prepay_credit->seconds;
+ my $error = $prepay_credit->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "removing prepay_credit (transaction rolled back): $error";
+ }
+ }
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ #return "inserting cust_main record (transaction rolled back): $error";
+ return $error;
+ }
+
+ # invoicing list
+ if ( $invoicing_list ) {
+ $error = $self->check_invoicing_list( $invoicing_list );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "checking invoicing_list (transaction rolled back): $error";
+ }
+ $self->invoicing_list( $invoicing_list );
+ }
+
+ # packages
+ $error = $self->order_pkgs($cust_pkgs, \$seconds);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( $seconds ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "No svc_acct record to apply pre-paid time";
+ }
+
+ if ( $amount ) {
+ my $cust_credit = new FS::cust_credit {
+ 'custnum' => $self->custnum,
+ 'amount' => $amount,
+ };
+ $error = $cust_credit->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "inserting credit (transaction rolled back): $error";
+ }
+ }
+
+ $error = $self->queue_fuzzyfiles_update;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "updating fuzzy search cache: $error";
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item order_pkgs
+
+document me. like ->insert(%cust_pkg) on an existing record
+
+=cut
+
+sub order_pkgs {
+ my $self = shift;
+ my $cust_pkgs = shift;
+ my $seconds = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_pkg ( keys %$cust_pkgs ) {
+ $cust_pkg->custnum( $self->custnum );
+ my $error = $cust_pkg->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "inserting cust_pkg (transaction rolled back): $error";
+ }
+ foreach my $svc_something ( @{$cust_pkgs->{$cust_pkg}} ) {
+ $svc_something->pkgnum( $cust_pkg->pkgnum );
+ if ( $seconds && $$seconds && $svc_something->isa('FS::svc_acct') ) {
+ $svc_something->seconds( $svc_something->seconds + $$seconds );
+ $$seconds = 0;
+ }
+ $error = $svc_something->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ #return "inserting svc_ (transaction rolled back): $error";
+ return $error;
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+}
+
+=item delete NEW_CUSTNUM
+
+This deletes the customer. If there is an error, returns the error, otherwise
+returns false.
+
+This will completely remove all traces of the customer record. This is not
+what you want when a customer cancels service; for that, cancel all of the
+customer's packages (see L<FS::cust_pkg/cancel>).
+
+If the customer has any uncancelled packages, you need to pass a new (valid)
+customer number for those packages to be transferred to. Cancelled packages
+will be deleted. Did I mention that this is NOT what you want when a customer
+cancels service and that you really should be looking see L<FS::cust_pkg/cancel>?
+
+You can't delete a customer with invoices (see L<FS::cust_bill>),
+or credits (see L<FS::cust_credit>), payments (see L<FS::cust_pay>) or
+refunds (see L<FS::cust_refund>).
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ if ( qsearch( 'cust_bill', { 'custnum' => $self->custnum } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Can't delete a customer with invoices";
+ }
+ if ( qsearch( 'cust_credit', { 'custnum' => $self->custnum } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Can't delete a customer with credits";
+ }
+ if ( qsearch( 'cust_pay', { 'custnum' => $self->custnum } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Can't delete a customer with payments";
+ }
+ if ( qsearch( 'cust_refund', { 'custnum' => $self->custnum } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Can't delete a customer with refunds";
+ }
+
+ my @cust_pkg = $self->ncancelled_pkgs;
+ if ( @cust_pkg ) {
+ my $new_custnum = shift;
+ unless ( qsearchs( 'cust_main', { 'custnum' => $new_custnum } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Invalid new customer number: $new_custnum";
+ }
+ foreach my $cust_pkg ( @cust_pkg ) {
+ my %hash = $cust_pkg->hash;
+ $hash{'custnum'} = $new_custnum;
+ my $new_cust_pkg = new FS::cust_pkg ( \%hash );
+ my $error = $new_cust_pkg->replace($cust_pkg);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+ my @cancelled_cust_pkg = $self->all_pkgs;
+ foreach my $cust_pkg ( @cancelled_cust_pkg ) {
+ my $error = $cust_pkg->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ foreach my $cust_main_invoice ( #(email invoice destinations, not invoices)
+ qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } )
+ ) {
+ my $error = $cust_main_invoice->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item replace OLD_RECORD [ INVOICING_LIST_ARYREF ]
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+INVOICING_LIST_ARYREF: If you pass an arrarref to the insert method, it will
+be set as the invoicing list (see L<"invoicing_list">). Errors return as
+expected and rollback the entire transaction; it is not necessary to call
+check_invoicing_list first. Here's an example:
+
+ $new_cust_main->replace( $old_cust_main, [ $email, 'POST' ] );
+
+=cut
+
+sub replace {
+ my $self = shift;
+ my $old = shift;
+ my @param = @_;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::replace($old);
+
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( @param ) { # INVOICING_LIST_ARYREF
+ my $invoicing_list = shift @param;
+ $error = $self->check_invoicing_list( $invoicing_list );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $self->invoicing_list( $invoicing_list );
+ }
+
+ if ( $self->payby =~ /^(CARD|CHEK|LECB)$/ &&
+ grep { $self->get($_) ne $old->get($_) } qw(payinfo paydate payname) ) {
+ # card/check/lec info has changed, want to retry realtime_ invoice events
+ my $error = $self->retry_realtime;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $error = $self->queue_fuzzyfiles_update;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "updating fuzzy search cache: $error";
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item queue_fuzzyfiles_update
+
+Used by insert & replace to update the fuzzy search cache
+
+=cut
+
+sub queue_fuzzyfiles_update {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $queue = new FS::queue { 'job' => 'FS::cust_main::append_fuzzyfiles' };
+ my $error = $queue->insert($self->getfield('last'), $self->company);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "queueing job (transaction rolled back): $error";
+ }
+
+ if ( defined $self->dbdef_table->column('ship_last') && $self->ship_last ) {
+ $queue = new FS::queue { 'job' => 'FS::cust_main::append_fuzzyfiles' };
+ $error = $queue->insert($self->getfield('ship_last'), $self->ship_company);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "queueing job (transaction rolled back): $error";
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item check
+
+Checks all fields to make sure this is a valid customer record. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and repalce methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ #warn "BEFORE: \n". $self->_dump;
+
+ my $error =
+ $self->ut_numbern('custnum')
+ || $self->ut_number('agentnum')
+ || $self->ut_number('refnum')
+ || $self->ut_name('last')
+ || $self->ut_name('first')
+ || $self->ut_textn('company')
+ || $self->ut_text('address1')
+ || $self->ut_textn('address2')
+ || $self->ut_text('city')
+ || $self->ut_textn('county')
+ || $self->ut_textn('state')
+ || $self->ut_country('country')
+ || $self->ut_anything('comments')
+ || $self->ut_numbern('referral_custnum')
+ ;
+ #barf. need message catalogs. i18n. etc.
+ $error .= "Please select a advertising source."
+ if $error =~ /^Illegal or empty \(numeric\) refnum: /;
+ return $error if $error;
+
+ return "Unknown agent"
+ unless qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
+
+ return "Unknown refnum"
+ unless qsearchs( 'part_referral', { 'refnum' => $self->refnum } );
+
+ return "Unknown referring custnum ". $self->referral_custnum
+ unless ! $self->referral_custnum
+ || qsearchs( 'cust_main', { 'custnum' => $self->referral_custnum } );
+
+ if ( $self->ss eq '' ) {
+ $self->ss('');
+ } else {
+ my $ss = $self->ss;
+ $ss =~ s/\D//g;
+ $ss =~ /^(\d{3})(\d{2})(\d{4})$/
+ or return "Illegal social security number: ". $self->ss;
+ $self->ss("$1-$2-$3");
+ }
+
+
+# bad idea to disable, causes billing to fail because of no tax rates later
+# unless ( $import ) {
+ unless ( qsearch('cust_main_county', {
+ 'country' => $self->country,
+ 'state' => '',
+ } ) ) {
+ return "Unknown state/county/country: ".
+ $self->state. "/". $self->county. "/". $self->country
+ unless qsearch('cust_main_county',{
+ 'state' => $self->state,
+ 'county' => $self->county,
+ 'country' => $self->country,
+ } );
+ }
+# }
+
+ $error =
+ $self->ut_phonen('daytime', $self->country)
+ || $self->ut_phonen('night', $self->country)
+ || $self->ut_phonen('fax', $self->country)
+ || $self->ut_zip('zip', $self->country)
+ ;
+ return $error if $error;
+
+ my @addfields = qw(
+ last first company address1 address2 city county state zip
+ country daytime night fax
+ );
+
+ if ( defined $self->dbdef_table->column('ship_last') ) {
+ if ( scalar ( grep { $self->getfield($_) ne $self->getfield("ship_$_") }
+ @addfields )
+ && scalar ( grep { $self->getfield("ship_$_") ne '' } @addfields )
+ )
+ {
+ my $error =
+ $self->ut_name('ship_last')
+ || $self->ut_name('ship_first')
+ || $self->ut_textn('ship_company')
+ || $self->ut_text('ship_address1')
+ || $self->ut_textn('ship_address2')
+ || $self->ut_text('ship_city')
+ || $self->ut_textn('ship_county')
+ || $self->ut_textn('ship_state')
+ || $self->ut_country('ship_country')
+ ;
+ return $error if $error;
+
+ #false laziness with above
+ unless ( qsearchs('cust_main_county', {
+ 'country' => $self->ship_country,
+ 'state' => '',
+ } ) ) {
+ return "Unknown ship_state/ship_county/ship_country: ".
+ $self->ship_state. "/". $self->ship_county. "/". $self->ship_country
+ unless qsearchs('cust_main_county',{
+ 'state' => $self->ship_state,
+ 'county' => $self->ship_county,
+ 'country' => $self->ship_country,
+ } );
+ }
+ #eofalse
+
+ $error =
+ $self->ut_phonen('ship_daytime', $self->ship_country)
+ || $self->ut_phonen('ship_night', $self->ship_country)
+ || $self->ut_phonen('ship_fax', $self->ship_country)
+ || $self->ut_zip('ship_zip', $self->ship_country)
+ ;
+ return $error if $error;
+
+ } else { # ship_ info eq billing info, so don't store dup info in database
+ $self->setfield("ship_$_", '')
+ foreach qw( last first company address1 address2 city county state zip
+ country daytime night fax );
+ }
+ }
+
+ $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY)$/
+ or return "Illegal payby: ". $self->payby;
+ $self->payby($1);
+
+ if ( $self->payby eq 'CARD' || $self->payby eq 'DCRD' ) {
+
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\D//g;
+ $payinfo =~ /^(\d{13,16})$/
+ or return gettext('invalid_card'); # . ": ". $self->payinfo;
+ $payinfo = $1;
+ $self->payinfo($payinfo);
+ validate($payinfo)
+ or return gettext('invalid_card'); # . ": ". $self->payinfo;
+ return gettext('unknown_card_type')
+ if cardtype($self->payinfo) eq "Unknown";
+
+ } elsif ( $self->payby eq 'CHEK' || $self->payby eq 'DCHK' ) {
+
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/[^\d\@]//g;
+ $payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account@aba';
+ $payinfo = "$1\@$2";
+ $self->payinfo($payinfo);
+
+ } elsif ( $self->payby eq 'LECB' ) {
+
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\D//g;
+ $payinfo =~ /^1?(\d{10})$/ or return 'invalid btn billing telephone number';
+ $payinfo = $1;
+ $self->payinfo($payinfo);
+
+ } elsif ( $self->payby eq 'BILL' ) {
+
+ $error = $self->ut_textn('payinfo');
+ return "Illegal P.O. number: ". $self->payinfo if $error;
+
+ } elsif ( $self->payby eq 'COMP' ) {
+
+ $error = $self->ut_textn('payinfo');
+ return "Illegal comp account issuer: ". $self->payinfo if $error;
+
+ } elsif ( $self->payby eq 'PREPAY' ) {
+
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\W//g; #anything else would just confuse things
+ $self->payinfo($payinfo);
+ $error = $self->ut_alpha('payinfo');
+ return "Illegal prepayment identifier: ". $self->payinfo if $error;
+ return "Unknown prepayment identifier"
+ unless qsearchs('prepay_credit', { 'identifier' => $self->payinfo } );
+
+ }
+
+ if ( $self->paydate eq '' || $self->paydate eq '-' ) {
+ return "Expriation date required"
+ unless $self->payby =~ /^(BILL|PREPAY|CHEK|LECB)$/;
+ $self->paydate('');
+ } else {
+ my( $m, $y );
+ if ( $self->paydate =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/ ) {
+ ( $m, $y ) = ( $1, length($2) == 4 ? $2 : "20$2" );
+ } elsif ( $self->paydate =~ /^(20)?(\d{2})[\/\-](\d{2})[\/\-]\d+$/ ) {
+ ( $m, $y ) = ( $3, "20$2" );
+ } else {
+ return "Illegal expiration date: ". $self->paydate;
+ }
+ $self->paydate("$y-$m-01");
+ my($nowm,$nowy)=(localtime(time))[4,5]; $nowm++; $nowy+=1900;
+ return gettext('expired_card')
+ if !$import && ( $y<$nowy || ( $y==$nowy && $1<$nowm ) );
+ }
+
+ if ( $self->payname eq '' && $self->payby ne 'CHEK' &&
+ ( ! $conf->exists('require_cardname')
+ || $self->payby !~ /^(CARD|DCRD)$/ )
+ ) {
+ $self->payname( $self->first. " ". $self->getfield('last') );
+ } else {
+ $self->payname =~ /^([\w \,\.\-\']+)$/
+ or return gettext('illegal_name'). " payname: ". $self->payname;
+ $self->payname($1);
+ }
+
+ $self->tax =~ /^(Y?)$/ or return "Illegal tax: ". $self->tax;
+ $self->tax($1);
+
+ $self->otaker(getotaker);
+
+ #warn "AFTER: \n". $self->_dump;
+
+ ''; #no error
+}
+
+=item all_pkgs
+
+Returns all packages (see L<FS::cust_pkg>) for this customer.
+
+=cut
+
+sub all_pkgs {
+ my $self = shift;
+ if ( $self->{'_pkgnum'} ) {
+ values %{ $self->{'_pkgnum'}->cache };
+ } else {
+ qsearch( 'cust_pkg', { 'custnum' => $self->custnum });
+ }
+}
+
+=item ncancelled_pkgs
+
+Returns all non-cancelled packages (see L<FS::cust_pkg>) for this customer.
+
+=cut
+
+sub ncancelled_pkgs {
+ my $self = shift;
+ if ( $self->{'_pkgnum'} ) {
+ grep { ! $_->getfield('cancel') } values %{ $self->{'_pkgnum'}->cache };
+ } else {
+ @{ [ # force list context
+ qsearch( 'cust_pkg', {
+ 'custnum' => $self->custnum,
+ 'cancel' => '',
+ }),
+ qsearch( 'cust_pkg', {
+ 'custnum' => $self->custnum,
+ 'cancel' => 0,
+ }),
+ ] };
+ }
+}
+
+=item suspended_pkgs
+
+Returns all suspended packages (see L<FS::cust_pkg>) for this customer.
+
+=cut
+
+sub suspended_pkgs {
+ my $self = shift;
+ grep { $_->susp } $self->ncancelled_pkgs;
+}
+
+=item unflagged_suspended_pkgs
+
+Returns all unflagged suspended packages (see L<FS::cust_pkg>) for this
+customer (thouse packages without the `manual_flag' set).
+
+=cut
+
+sub unflagged_suspended_pkgs {
+ my $self = shift;
+ return $self->suspended_pkgs
+ unless dbdef->table('cust_pkg')->column('manual_flag');
+ grep { ! $_->manual_flag } $self->suspended_pkgs;
+}
+
+=item unsuspended_pkgs
+
+Returns all unsuspended (and uncancelled) packages (see L<FS::cust_pkg>) for
+this customer.
+
+=cut
+
+sub unsuspended_pkgs {
+ my $self = shift;
+ grep { ! $_->susp } $self->ncancelled_pkgs;
+}
+
+=item unsuspend
+
+Unsuspends all unflagged suspended packages (see L</unflagged_suspended_pkgs>
+and L<FS::cust_pkg>) for this customer. Always returns a list: an empty list
+on success or a list of errors.
+
+=cut
+
+sub unsuspend {
+ my $self = shift;
+ grep { $_->unsuspend } $self->suspended_pkgs;
+}
+
+=item suspend
+
+Suspends all unsuspended packages (see L<FS::cust_pkg>) for this customer.
+Always returns a list: an empty list on success or a list of errors.
+
+=cut
+
+sub suspend {
+ my $self = shift;
+ grep { $_->suspend } $self->unsuspended_pkgs;
+}
+
+=item cancel
+
+Cancels all uncancelled packages (see L<FS::cust_pkg>) for this customer.
+Always returns a list: an empty list on success or a list of errors.
+
+=cut
+
+sub cancel {
+ my $self = shift;
+ grep { $_->cancel } $self->ncancelled_pkgs;
+}
+
+=item agent
+
+Returns the agent (see L<FS::agent>) for this customer.
+
+=cut
+
+sub agent {
+ my $self = shift;
+ qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
+}
+
+=item bill OPTIONS
+
+Generates invoices (see L<FS::cust_bill>) for this customer. Usually used in
+conjunction with the collect method.
+
+Options are passed as name-value pairs.
+
+The only currently available option is `time', which bills the customer as if
+it were that time. It is specified as a UNIX timestamp; see
+L<perlfunc/"time">). Also see L<Time::Local> and L<Date::Parse> for conversion
+functions. For example:
+
+ use Date::Parse;
+ ...
+ $cust_main->bill( 'time' => str2time('April 20th, 2001') );
+
+If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub bill {
+ my( $self, %options ) = @_;
+ my $time = $options{'time'} || time;
+
+ my $error;
+
+ #put below somehow?
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ # find the packages which are due for billing, find out how much they are
+ # & generate invoice database.
+
+ my( $total_setup, $total_recur ) = ( 0, 0 );
+ #my( $taxable_setup, $taxable_recur ) = ( 0, 0 );
+ my @cust_bill_pkg = ();
+ #my $tax = 0;##
+ #my $taxable_charged = 0;##
+ #my $charged = 0;##
+
+ my %tax;
+
+ foreach my $cust_pkg (
+ qsearch('cust_pkg', { 'custnum' => $self->custnum } )
+ ) {
+
+ #NO!! next if $cust_pkg->cancel;
+ next if $cust_pkg->getfield('cancel');
+
+ #? to avoid use of uninitialized value errors... ?
+ $cust_pkg->setfield('bill', '')
+ unless defined($cust_pkg->bill);
+
+ my $part_pkg = $cust_pkg->part_pkg;
+
+ #so we don't modify cust_pkg record unnecessarily
+ my $cust_pkg_mod_flag = 0;
+ my %hash = $cust_pkg->hash;
+ my $old_cust_pkg = new FS::cust_pkg \%hash;
+
+ my @details = ();
+
+ # bill setup
+ my $setup = 0;
+ unless ( $cust_pkg->setup ) {
+ my $setup_prog = $part_pkg->getfield('setup');
+ $setup_prog =~ /^(.*)$/ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Illegal setup for pkgpart ". $part_pkg->pkgpart.
+ ": $setup_prog";
+ };
+ $setup_prog = $1;
+ $setup_prog = '0' if $setup_prog =~ /^\s*$/;
+
+ #my $cpt = new Safe;
+ ##$cpt->permit(); #what is necessary?
+ #$cpt->share(qw( $cust_pkg )); #can $cpt now use $cust_pkg methods?
+ #$setup = $cpt->reval($setup_prog);
+ $setup = eval $setup_prog;
+ unless ( defined($setup) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error eval-ing part_pkg->setup pkgpart ". $part_pkg->pkgpart.
+ "(expression $setup_prog): $@";
+ }
+ $cust_pkg->setfield('setup',$time);
+ $cust_pkg_mod_flag=1;
+ }
+
+ #bill recurring fee
+ my $recur = 0;
+ my $sdate;
+ if ( $part_pkg->getfield('freq') > 0 &&
+ ! $cust_pkg->getfield('susp') &&
+ ( $cust_pkg->getfield('bill') || 0 ) <= $time
+ ) {
+ my $recur_prog = $part_pkg->getfield('recur');
+ $recur_prog =~ /^(.*)$/ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Illegal recur for pkgpart ". $part_pkg->pkgpart.
+ ": $recur_prog";
+ };
+ $recur_prog = $1;
+ $recur_prog = '0' if $recur_prog =~ /^\s*$/;
+
+ # shared with $recur_prog
+ $sdate = $cust_pkg->bill || $cust_pkg->setup || $time;
+
+ #my $cpt = new Safe;
+ ##$cpt->permit(); #what is necessary?
+ #$cpt->share(qw( $cust_pkg )); #can $cpt now use $cust_pkg methods?
+ #$recur = $cpt->reval($recur_prog);
+ $recur = eval $recur_prog;
+ unless ( defined($recur) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error eval-ing part_pkg->recur pkgpart ". $part_pkg->pkgpart.
+ "(expression $recur_prog): $@";
+ }
+ #change this bit to use Date::Manip? CAREFUL with timezones (see
+ # mailing list archive)
+ my ($sec,$min,$hour,$mday,$mon,$year) =
+ (localtime($sdate) )[0,1,2,3,4,5];
+
+ #pro-rating magic - if $recur_prog fiddles $sdate, want to use that
+ # only for figuring next bill date, nothing else, so, reset $sdate again
+ # here
+ $sdate = $cust_pkg->bill || $cust_pkg->setup || $time;
+ $cust_pkg->last_bill($sdate)
+ if $cust_pkg->dbdef_table->column('last_bill');
+
+ $mon += $part_pkg->freq;
+ until ( $mon < 12 ) { $mon -= 12; $year++; }
+ $cust_pkg->setfield('bill',
+ timelocal_nocheck($sec,$min,$hour,$mday,$mon,$year));
+ $cust_pkg_mod_flag = 1;
+ }
+
+ warn "\$setup is undefined" unless defined($setup);
+ warn "\$recur is undefined" unless defined($recur);
+ warn "\$cust_pkg->bill is undefined" unless defined($cust_pkg->bill);
+
+ my $taxable_charged = 0;
+ if ( $cust_pkg_mod_flag ) {
+ $error=$cust_pkg->replace($old_cust_pkg);
+ if ( $error ) { #just in case
+ $dbh->rollback if $oldAutoCommit;
+ return "Error modifying pkgnum ". $cust_pkg->pkgnum. ": $error";
+ }
+ $setup = sprintf( "%.2f", $setup );
+ $recur = sprintf( "%.2f", $recur );
+ if ( $setup < 0 ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "negative setup $setup for pkgnum ". $cust_pkg->pkgnum;
+ }
+ if ( $recur < 0 ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "negative recur $recur for pkgnum ". $cust_pkg->pkgnum;
+ }
+ if ( $setup > 0 || $recur > 0 ) {
+ my $cust_bill_pkg = new FS::cust_bill_pkg ({
+ 'pkgnum' => $cust_pkg->pkgnum,
+ 'setup' => $setup,
+ 'recur' => $recur,
+ 'sdate' => $sdate,
+ 'edate' => $cust_pkg->bill,
+ 'details' => \@details,
+ });
+ push @cust_bill_pkg, $cust_bill_pkg;
+ $total_setup += $setup;
+ $total_recur += $recur;
+ $taxable_charged += $setup
+ unless $part_pkg->setuptax =~ /^Y$/i;
+ $taxable_charged += $recur
+ unless $part_pkg->recurtax =~ /^Y$/i;
+
+ unless ( $self->tax =~ /Y/i
+ || $self->payby eq 'COMP'
+ || $taxable_charged == 0 ) {
+
+ my $cust_main_county = qsearchs('cust_main_county',{
+ 'state' => $self->state,
+ 'county' => $self->county,
+ 'country' => $self->country,
+ 'taxclass' => $part_pkg->taxclass,
+ } );
+ $cust_main_county ||= qsearchs('cust_main_county',{
+ 'state' => $self->state,
+ 'county' => $self->county,
+ 'country' => $self->country,
+ 'taxclass' => '',
+ } );
+ unless ( $cust_main_county ) {
+ $dbh->rollback if $oldAutoCommit;
+ return
+ "fatal: can't find tax rate for state/county/country/taxclass ".
+ join('/', ( map $self->$_(), qw(state county country) ),
+ $part_pkg->taxclass ). "\n";
+ }
+
+ if ( $cust_main_county->exempt_amount ) {
+ my ($mon,$year) = (localtime($sdate) )[4,5];
+ $mon++;
+ my $freq = $part_pkg->freq || 1;
+ my $taxable_per_month = sprintf("%.2f", $taxable_charged / $freq );
+ foreach my $which_month ( 1 .. $freq ) {
+ my %hash = (
+ 'custnum' => $self->custnum,
+ 'taxnum' => $cust_main_county->taxnum,
+ 'year' => 1900+$year,
+ 'month' => $mon++,
+ );
+ #until ( $mon < 12 ) { $mon -= 12; $year++; }
+ until ( $mon < 13 ) { $mon -= 12; $year++; }
+ my $cust_tax_exempt =
+ qsearchs('cust_tax_exempt', \%hash)
+ || new FS::cust_tax_exempt( { %hash, 'amount' => 0 } );
+ my $remaining_exemption = sprintf("%.2f",
+ $cust_main_county->exempt_amount - $cust_tax_exempt->amount );
+ if ( $remaining_exemption > 0 ) {
+ my $addl = $remaining_exemption > $taxable_per_month
+ ? $taxable_per_month
+ : $remaining_exemption;
+ $taxable_charged -= $addl;
+ my $new_cust_tax_exempt = new FS::cust_tax_exempt ( {
+ $cust_tax_exempt->hash,
+ 'amount' => sprintf("%.2f", $cust_tax_exempt->amount + $addl),
+ } );
+ $error = $new_cust_tax_exempt->exemptnum
+ ? $new_cust_tax_exempt->replace($cust_tax_exempt)
+ : $new_cust_tax_exempt->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "fatal: can't update cust_tax_exempt: $error";
+ }
+
+ } # if $remaining_exemption > 0
+
+ } #foreach $which_month
+
+ } #if $cust_main_county->exempt_amount
+
+ $taxable_charged = sprintf( "%.2f", $taxable_charged);
+
+ #$tax += $taxable_charged * $cust_main_county->tax / 100
+ $tax{ $cust_main_county->taxname || 'Tax' } +=
+ $taxable_charged * $cust_main_county->tax / 100
+
+ } #unless $self->tax =~ /Y/i
+ # || $self->payby eq 'COMP'
+ # || $taxable_charged == 0
+
+ } #if $setup > 0 || $recur > 0
+
+ } #if $cust_pkg_mod_flag
+
+ } #foreach my $cust_pkg
+
+ my $charged = sprintf( "%.2f", $total_setup + $total_recur );
+# my $taxable_charged = sprintf( "%.2f", $taxable_setup + $taxable_recur );
+
+ unless ( @cust_bill_pkg ) { #don't create invoices with no line items
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ return '';
+ }
+
+# unless ( $self->tax =~ /Y/i
+# || $self->payby eq 'COMP'
+# || $taxable_charged == 0 ) {
+# my $cust_main_county = qsearchs('cust_main_county',{
+# 'state' => $self->state,
+# 'county' => $self->county,
+# 'country' => $self->country,
+# } ) or die "fatal: can't find tax rate for state/county/country ".
+# $self->state. "/". $self->county. "/". $self->country. "\n";
+# my $tax = sprintf( "%.2f",
+# $taxable_charged * ( $cust_main_county->getfield('tax') / 100 )
+# );
+
+ foreach my $taxname ( grep { $tax{$_} > 0 } keys %tax ) {
+ my $tax = sprintf("%.2f", $tax{$taxname} );
+ $charged = sprintf( "%.2f", $charged+$tax );
+
+ my $cust_bill_pkg = new FS::cust_bill_pkg ({
+ 'pkgnum' => 0,
+ 'setup' => $tax,
+ 'recur' => 0,
+ 'sdate' => '',
+ 'edate' => '',
+ 'itemdesc' => $taxname,
+ });
+ push @cust_bill_pkg, $cust_bill_pkg;
+ }
+# }
+
+ my $cust_bill = new FS::cust_bill ( {
+ 'custnum' => $self->custnum,
+ '_date' => $time,
+ 'charged' => $charged,
+ } );
+ $error = $cust_bill->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't create invoice for customer #". $self->custnum. ": $error";
+ }
+
+ my $invnum = $cust_bill->invnum;
+ my $cust_bill_pkg;
+ foreach $cust_bill_pkg ( @cust_bill_pkg ) {
+ #warn $invnum;
+ $cust_bill_pkg->invnum($invnum);
+ $error = $cust_bill_pkg->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't create invoice line item for customer #". $self->custnum.
+ ": $error";
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+}
+
+=item collect OPTIONS
+
+(Attempt to) collect money for this customer's outstanding invoices (see
+L<FS::cust_bill>). Usually used after the bill method.
+
+Depending on the value of `payby', this may print or email an invoice (I<BILL>,
+I<DCRD>, or I<DCHK>), charge a credit card (I<CARD>), charge via electronic
+check/ACH (I<CHEK>), or just add any necessary (pseudo-)payment (I<COMP>).
+
+Most actions are now triggered by invoice events; see L<FS::part_bill_event>
+and the invoice events web interface.
+
+If there is an error, returns the error, otherwise returns false.
+
+Options are passed as name-value pairs.
+
+Currently available options are:
+
+invoice_time - Use this time when deciding when to print invoices and
+late notices on those invoices. The default is now. It is specified as a UNIX timestamp; see L<perlfunc/"time">). Also see L<Time::Local> and L<Date::Parse>
+for conversion functions.
+
+retry - Retry card/echeck/LEC transactions even when not scheduled by invoice
+events.
+
+retry_card - Deprecated alias for 'retry'
+
+batch_card - This option is deprecated. See the invoice events web interface
+to control whether cards are batched or run against a realtime gateway.
+
+report_badcard - This option is deprecated.
+
+force_print - This option is deprecated; see the invoice events web interface.
+
+=cut
+
+sub collect {
+ my( $self, %options ) = @_;
+ my $invoice_time = $options{'invoice_time'} || time;
+
+ #put below somehow?
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $balance = $self->balance;
+ warn "collect customer". $self->custnum. ": balance $balance" if $Debug;
+ unless ( $balance > 0 ) { #redundant?????
+ $dbh->rollback if $oldAutoCommit; #hmm
+ return '';
+ }
+
+ if ( exists($options{'retry_card'}) ) {
+ carp 'retry_card option passed to collect is deprecated; use retry';
+ $options{'retry'} ||= $options{'retry_card'};
+ }
+ if ( exists($options{'retry'}) && $options{'retry'} ) {
+ my $error = $self->retry_realtime;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ foreach my $cust_bill ( $self->cust_bill ) {
+
+ #this has to be before next's
+ my $amount = sprintf( "%.2f", $balance < $cust_bill->owed
+ ? $balance
+ : $cust_bill->owed
+ );
+ $balance = sprintf( "%.2f", $balance - $amount );
+
+ next unless $cust_bill->owed > 0;
+
+ # don't try to charge for the same invoice if it's already in a batch
+ #next if qsearchs( 'cust_pay_batch', { 'invnum' => $cust_bill->invnum } );
+
+ warn "invnum ". $cust_bill->invnum. " (owed ". $cust_bill->owed. ", amount $amount, balance $balance)" if $Debug;
+
+ next unless $amount > 0;
+
+
+ foreach my $part_bill_event (
+ sort { $a->seconds <=> $b->seconds
+ || $a->weight <=> $b->weight
+ || $a->eventpart <=> $b->eventpart }
+ grep { $_->seconds <= ( $invoice_time - $cust_bill->_date )
+ && ! qsearchs( 'cust_bill_event', {
+ 'invnum' => $cust_bill->invnum,
+ 'eventpart' => $_->eventpart,
+ 'status' => 'done',
+ } )
+ }
+ qsearch('part_bill_event', { 'payby' => $self->payby,
+ 'disabled' => '', } )
+ ) {
+
+ last unless $cust_bill->owed > 0; #don't run subsequent events if owed=0
+
+ warn "calling invoice event (". $part_bill_event->eventcode. ")\n"
+ if $Debug;
+ my $cust_main = $self; #for callback
+ my $error = eval $part_bill_event->eventcode;
+
+ my $status = '';
+ my $statustext = '';
+ if ( $@ ) {
+ $status = 'failed';
+ $statustext = $@;
+ } elsif ( $error ) {
+ $status = 'done';
+ $statustext = $error;
+ } else {
+ $status = 'done'
+ }
+
+ #add cust_bill_event
+ my $cust_bill_event = new FS::cust_bill_event {
+ 'invnum' => $cust_bill->invnum,
+ 'eventpart' => $part_bill_event->eventpart,
+ #'_date' => $invoice_time,
+ '_date' => time,
+ 'status' => $status,
+ 'statustext' => $statustext,
+ };
+ $error = $cust_bill_event->insert;
+ if ( $error ) {
+ #$dbh->rollback if $oldAutoCommit;
+ #return "error: $error";
+
+ # gah, even with transactions.
+ $dbh->commit if $oldAutoCommit; #well.
+ my $e = 'WARNING: Event run but database not updated - '.
+ 'error inserting cust_bill_event, invnum #'. $cust_bill->invnum.
+ ', eventpart '. $part_bill_event->eventpart.
+ ": $error";
+ warn $e;
+ return $e;
+ }
+
+
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item retry_realtime
+
+Schedules realtime credit card / electronic check / LEC billing events for
+for retry. Useful if card information has changed or manual retry is desired.
+The 'collect' method must be called to actually retry the transaction.
+
+Implementation details: For each of this customer's open invoices, changes
+the status of the first "done" (with statustext error) realtime processing
+event to "failed".
+
+=cut
+
+sub retry_realtime {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_bill (
+ grep { $_->cust_bill_event }
+ $self->open_cust_bill
+ ) {
+ my @cust_bill_event =
+ sort { $a->part_bill_event->seconds <=> $b->part_bill_event->seconds }
+ grep {
+ #$_->part_bill_event->plan eq 'realtime-card'
+ $_->part_bill_event->eventcode =~
+ /\$cust_bill\->realtime_(card|ach|lec)$/
+ && $_->status eq 'done'
+ && $_->statustext
+ }
+ $cust_bill->cust_bill_event;
+ next unless @cust_bill_event;
+ my $error = $cust_bill_event[0]->retry;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error scheduling invoice event for retry: $error";
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item realtime_bop METHOD AMOUNT [ OPTION => VALUE ... ]
+
+Runs a realtime credit card, ACH (electronic check) or phone bill transaction
+via a Business::OnlinePayment realtime gateway. See
+L<http://420.am/business-onlinepayment> for supported gateways.
+
+Available methods are: I<CC>, I<ECHECK> and I<LEC>
+
+Available options are: I<description>, I<invnum>, I<quiet>
+
+The additional options I<payname>, I<address1>, I<address2>, I<city>, I<state>,
+I<zip>, I<payinfo> and I<paydate> are also available. Any of these options,
+if set, will override the value from the customer record.
+
+I<description> is a free-text field passed to the gateway. It defaults to
+"Internet services".
+
+If an I<invnum> is specified, this payment (if sucessful) is applied to the
+specified invoice. If you don't specify an I<invnum> you might want to
+call the B<apply_payments> method.
+
+I<quiet> can be set true to surpress email decline notices.
+
+(moved from cust_bill) (probably should get realtime_{card,ach,lec} here too)
+
+=cut
+
+sub realtime_bop {
+ my( $self, $method, $amount, %options ) = @_;
+ if ( $Debug ) {
+ warn "$self $method $amount\n";
+ warn " $_ => $options{$_}\n" foreach keys %options;
+ }
+
+ $options{'description'} ||= 'Internet services';
+
+ #pre-requisites
+ die "Real-time processing not enabled\n"
+ unless $conf->exists('business-onlinepayment');
+ eval "use Business::OnlinePayment";
+ die $@ if $@;
+
+ #overrides
+ $self->set( $_ => $options{$_} )
+ foreach grep { exists($options{$_}) }
+ qw( payname address1 address2 city state zip payinfo paydate );
+
+ #load up config
+ my $bop_config = 'business-onlinepayment';
+ $bop_config .= '-ach'
+ if $method eq 'ECHECK' && $conf->exists($bop_config. '-ach');
+ my ( $processor, $login, $password, $action, @bop_options ) =
+ $conf->config($bop_config);
+ $action ||= 'normal authorization';
+ pop @bop_options if scalar(@bop_options) % 2 && $bop_options[-1] =~ /^\s*$/;
+
+ #massage data
+
+ my $address = $self->address1;
+ $address .= ", ". $self->address2 if $self->address2;
+
+ my($payname, $payfirst, $paylast);
+ if ( $self->payname && $method ne 'ECHECK' ) {
+ $payname = $self->payname;
+ $payname =~ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)\s*$/
+ or return "Illegal payname $payname";
+ ($payfirst, $paylast) = ($1, $2);
+ } else {
+ $payfirst = $self->getfield('first');
+ $paylast = $self->getfield('last');
+ $payname = "$payfirst $paylast";
+ }
+
+ my @invoicing_list = grep { $_ ne 'POST' } $self->invoicing_list;
+ if ( $conf->exists('emailinvoiceauto')
+ || ( $conf->exists('emailinvoiceonly') && ! @invoicing_list ) ) {
+ push @invoicing_list, $self->all_emails;
+ }
+ my $email = $invoicing_list[0];
+
+ my %content;
+ if ( $method eq 'CC' ) {
+ $content{card_number} = $self->payinfo;
+ $self->paydate =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
+ $content{expiration} = "$2/$1";
+ } elsif ( $method eq 'ECHECK' ) {
+ my($account_number,$routing_code) = $self->payinfo;
+ ( $content{account_number}, $content{routing_code} ) =
+ split('@', $self->payinfo);
+ $content{bank_name} = $self->payname;
+ $content{account_type} = 'CHECKING';
+ $content{account_name} = $payname;
+ $content{customer_org} = $self->company ? 'B' : 'I';
+ $content{customer_ssn} = $self->ss;
+ } elsif ( $method eq 'LEC' ) {
+ $content{phone} = $self->payinfo;
+ }
+
+ #transaction(s)
+
+ my( $action1, $action2 ) = split(/\s*\,\s*/, $action );
+
+ my $transaction =
+ new Business::OnlinePayment( $processor, @bop_options );
+ $transaction->content(
+ 'type' => $method,
+ 'login' => $login,
+ 'password' => $password,
+ 'action' => $action1,
+ 'description' => $options{'description'},
+ 'amount' => $amount,
+ 'invoice_number' => $options{'invnum'},
+ 'customer_id' => $self->custnum,
+ 'last_name' => $paylast,
+ 'first_name' => $payfirst,
+ 'name' => $payname,
+ 'address' => $address,
+ 'city' => $self->city,
+ 'state' => $self->state,
+ 'zip' => $self->zip,
+ 'country' => $self->country,
+ 'referer' => 'http://cleanwhisker.420.am/',
+ 'email' => $email,
+ 'phone' => $self->daytime || $self->night,
+ %content, #after
+ );
+ $transaction->submit();
+
+ if ( $transaction->is_success() && $action2 ) {
+ my $auth = $transaction->authorization;
+ my $ordernum = $transaction->can('order_number')
+ ? $transaction->order_number
+ : '';
+
+ my $capture =
+ new Business::OnlinePayment( $processor, @bop_options );
+
+ my %capture = (
+ %content,
+ type => $method,
+ action => $action2,
+ login => $login,
+ password => $password,
+ order_number => $ordernum,
+ amount => $amount,
+ authorization => $auth,
+ description => $options{'description'},
+ );
+
+ foreach my $field (qw( authorization_source_code returned_ACI transaction_identifier validation_code
+ transaction_sequence_num local_transaction_date
+ local_transaction_time AVS_result_code )) {
+ $capture{$field} = $transaction->$field() if $transaction->can($field);
+ }
+
+ $capture->content( %capture );
+
+ $capture->submit();
+
+ unless ( $capture->is_success ) {
+ my $e = "Authorization sucessful but capture failed, custnum #".
+ $self->custnum. ': '. $capture->result_code.
+ ": ". $capture->error_message;
+ warn $e;
+ return $e;
+ }
+
+ }
+
+ #result handling
+ if ( $transaction->is_success() ) {
+
+ my %method2payby = (
+ 'CC' => 'CARD',
+ 'ECHECK' => 'CHEK',
+ 'LEC' => 'LECB',
+ );
+
+ my $cust_pay = new FS::cust_pay ( {
+ 'custnum' => $self->custnum,
+ 'invnum' => $options{'invnum'},
+ 'paid' => $amount,
+ '_date' => '',
+ 'payby' => $method2payby{$method},
+ 'payinfo' => $self->payinfo,
+ 'paybatch' => "$processor:". $transaction->authorization,
+ } );
+ my $error = $cust_pay->insert;
+ if ( $error ) {
+ # gah, even with transactions.
+ my $e = 'WARNING: Card/ACH debited but database not updated - '.
+ 'error applying payment, invnum #' . $self->invnum.
+ " ($processor): $error";
+ warn $e;
+ return $e;
+ } else {
+ return '';
+ }
+
+ } else {
+
+ my $perror = "$processor error: ". $transaction->error_message;
+
+ if ( !$options{'quiet'} && $conf->exists('emaildecline')
+ && grep { $_ ne 'POST' } $self->invoicing_list
+ ) {
+ my @templ = $conf->config('declinetemplate');
+ my $template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @templ ],
+ ) or return "($perror) can't create template: $Text::Template::ERROR";
+ $template->compile()
+ or return "($perror) can't compile template: $Text::Template::ERROR";
+
+ my $templ_hash = { error => $transaction->error_message };
+
+ my $error = send_email(
+ 'from' => $conf->config('invoice_from'),
+ 'to' => [ grep { $_ ne 'POST' } $self->invoicing_list ],
+ 'subject' => 'Your payment could not be processed',
+ 'body' => [ $template->fill_in(HASH => $templ_hash) ],
+ );
+
+ $perror .= " (also received error sending decline notification: $error)"
+ if $error;
+
+ }
+
+ return $perror;
+ }
+
+}
+
+=item total_owed
+
+Returns the total owed for this customer on all invoices
+(see L<FS::cust_bill/owed>).
+
+=cut
+
+sub total_owed {
+ my $self = shift;
+ $self->total_owed_date(2145859200); #12/31/2037
+}
+
+=item total_owed_date TIME
+
+Returns the total owed for this customer on all invoices with date earlier than
+TIME. TIME is specified as a UNIX timestamp; see L<perlfunc/"time">). Also
+see L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=cut
+
+sub total_owed_date {
+ my $self = shift;
+ my $time = shift;
+ my $total_bill = 0;
+ foreach my $cust_bill (
+ grep { $_->_date <= $time }
+ qsearch('cust_bill', { 'custnum' => $self->custnum, } )
+ ) {
+ $total_bill += $cust_bill->owed;
+ }
+ sprintf( "%.2f", $total_bill );
+}
+
+=item apply_credits
+
+Applies (see L<FS::cust_credit_bill>) unapplied credits (see L<FS::cust_credit>)
+to outstanding invoice balances in chronological order and returns the value
+of any remaining unapplied credits available for refund
+(see L<FS::cust_refund>).
+
+=cut
+
+sub apply_credits {
+ my $self = shift;
+
+ return 0 unless $self->total_credited;
+
+ my @credits = sort { $b->_date <=> $a->_date} (grep { $_->credited > 0 }
+ qsearch('cust_credit', { 'custnum' => $self->custnum } ) );
+
+ my @invoices = sort { $a->_date <=> $b->_date} (grep { $_->owed > 0 }
+ qsearch('cust_bill', { 'custnum' => $self->custnum } ) );
+
+ my $credit;
+
+ foreach my $cust_bill ( @invoices ) {
+ my $amount;
+
+ if ( !defined($credit) || $credit->credited == 0) {
+ $credit = pop @credits or last;
+ }
+
+ if ($cust_bill->owed >= $credit->credited) {
+ $amount=$credit->credited;
+ }else{
+ $amount=$cust_bill->owed;
+ }
+
+ my $cust_credit_bill = new FS::cust_credit_bill ( {
+ 'crednum' => $credit->crednum,
+ 'invnum' => $cust_bill->invnum,
+ 'amount' => $amount,
+ } );
+ my $error = $cust_credit_bill->insert;
+ die $error if $error;
+
+ redo if ($cust_bill->owed > 0);
+
+ }
+
+ return $self->total_credited;
+}
+
+=item apply_payments
+
+Applies (see L<FS::cust_bill_pay>) unapplied payments (see L<FS::cust_pay>)
+to outstanding invoice balances in chronological order.
+
+ #and returns the value of any remaining unapplied payments.
+
+=cut
+
+sub apply_payments {
+ my $self = shift;
+
+ #return 0 unless
+
+ my @payments = sort { $b->_date <=> $a->_date } ( grep { $_->unapplied > 0 }
+ qsearch('cust_pay', { 'custnum' => $self->custnum } ) );
+
+ my @invoices = sort { $a->_date <=> $b->_date} (grep { $_->owed > 0 }
+ qsearch('cust_bill', { 'custnum' => $self->custnum } ) );
+
+ my $payment;
+
+ foreach my $cust_bill ( @invoices ) {
+ my $amount;
+
+ if ( !defined($payment) || $payment->unapplied == 0 ) {
+ $payment = pop @payments or last;
+ }
+
+ if ( $cust_bill->owed >= $payment->unapplied ) {
+ $amount = $payment->unapplied;
+ } else {
+ $amount = $cust_bill->owed;
+ }
+
+ my $cust_bill_pay = new FS::cust_bill_pay ( {
+ 'paynum' => $payment->paynum,
+ 'invnum' => $cust_bill->invnum,
+ 'amount' => $amount,
+ } );
+ my $error = $cust_bill_pay->insert;
+ die $error if $error;
+
+ redo if ( $cust_bill->owed > 0);
+
+ }
+
+ return $self->total_unapplied_payments;
+}
+
+=item total_credited
+
+Returns the total outstanding credit (see L<FS::cust_credit>) for this
+customer. See L<FS::cust_credit/credited>.
+
+=cut
+
+sub total_credited {
+ my $self = shift;
+ my $total_credit = 0;
+ foreach my $cust_credit ( qsearch('cust_credit', {
+ 'custnum' => $self->custnum,
+ } ) ) {
+ $total_credit += $cust_credit->credited;
+ }
+ sprintf( "%.2f", $total_credit );
+}
+
+=item total_unapplied_payments
+
+Returns the total unapplied payments (see L<FS::cust_pay>) for this customer.
+See L<FS::cust_pay/unapplied>.
+
+=cut
+
+sub total_unapplied_payments {
+ my $self = shift;
+ my $total_unapplied = 0;
+ foreach my $cust_pay ( qsearch('cust_pay', {
+ 'custnum' => $self->custnum,
+ } ) ) {
+ $total_unapplied += $cust_pay->unapplied;
+ }
+ sprintf( "%.2f", $total_unapplied );
+}
+
+=item balance
+
+Returns the balance for this customer (total_owed minus total_credited
+minus total_unapplied_payments).
+
+=cut
+
+sub balance {
+ my $self = shift;
+ sprintf( "%.2f",
+ $self->total_owed - $self->total_credited - $self->total_unapplied_payments
+ );
+}
+
+=item balance_date TIME
+
+Returns the balance for this customer, only considering invoices with date
+earlier than TIME (total_owed_date minus total_credited minus
+total_unapplied_payments). TIME is specified as a UNIX timestamp; see
+L<perlfunc/"time">). Also see L<Time::Local> and L<Date::Parse> for conversion
+functions.
+
+=cut
+
+sub balance_date {
+ my $self = shift;
+ my $time = shift;
+ sprintf( "%.2f",
+ $self->total_owed_date($time)
+ - $self->total_credited
+ - $self->total_unapplied_payments
+ );
+}
+
+=item invoicing_list [ ARRAYREF ]
+
+If an arguement is given, sets these email addresses as invoice recipients
+(see L<FS::cust_main_invoice>). Errors are not fatal and are not reported
+(except as warnings), so use check_invoicing_list first.
+
+Returns a list of email addresses (with svcnum entries expanded).
+
+Note: You can clear the invoicing list by passing an empty ARRAYREF. You can
+check it without disturbing anything by passing nothing.
+
+This interface may change in the future.
+
+=cut
+
+sub invoicing_list {
+ my( $self, $arrayref ) = @_;
+ if ( $arrayref ) {
+ my @cust_main_invoice;
+ if ( $self->custnum ) {
+ @cust_main_invoice =
+ qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } );
+ } else {
+ @cust_main_invoice = ();
+ }
+ foreach my $cust_main_invoice ( @cust_main_invoice ) {
+ #warn $cust_main_invoice->destnum;
+ unless ( grep { $cust_main_invoice->address eq $_ } @{$arrayref} ) {
+ #warn $cust_main_invoice->destnum;
+ my $error = $cust_main_invoice->delete;
+ warn $error if $error;
+ }
+ }
+ if ( $self->custnum ) {
+ @cust_main_invoice =
+ qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } );
+ } else {
+ @cust_main_invoice = ();
+ }
+ my %seen = map { $_->address => 1 } @cust_main_invoice;
+ foreach my $address ( @{$arrayref} ) {
+ next if exists $seen{$address} && $seen{$address};
+ $seen{$address} = 1;
+ my $cust_main_invoice = new FS::cust_main_invoice ( {
+ 'custnum' => $self->custnum,
+ 'dest' => $address,
+ } );
+ my $error = $cust_main_invoice->insert;
+ warn $error if $error;
+ }
+ }
+ if ( $self->custnum ) {
+ map { $_->address }
+ qsearch( 'cust_main_invoice', { 'custnum' => $self->custnum } );
+ } else {
+ ();
+ }
+}
+
+=item check_invoicing_list ARRAYREF
+
+Checks these arguements as valid input for the invoicing_list method. If there
+is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub check_invoicing_list {
+ my( $self, $arrayref ) = @_;
+ foreach my $address ( @{$arrayref} ) {
+ my $cust_main_invoice = new FS::cust_main_invoice ( {
+ 'custnum' => $self->custnum,
+ 'dest' => $address,
+ } );
+ my $error = $self->custnum
+ ? $cust_main_invoice->check
+ : $cust_main_invoice->checkdest
+ ;
+ return $error if $error;
+ }
+ '';
+}
+
+=item set_default_invoicing_list
+
+Sets the invoicing list to all accounts associated with this customer,
+overwriting any previous invoicing list.
+
+=cut
+
+sub set_default_invoicing_list {
+ my $self = shift;
+ $self->invoicing_list($self->all_emails);
+}
+
+=item all_emails
+
+Returns the email addresses of all accounts provisioned for this customer.
+
+=cut
+
+sub all_emails {
+ my $self = shift;
+ my %list;
+ foreach my $cust_pkg ( $self->all_pkgs ) {
+ my @cust_svc = qsearch('cust_svc', { 'pkgnum' => $cust_pkg->pkgnum } );
+ my @svc_acct =
+ map { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) }
+ grep { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) }
+ @cust_svc;
+ $list{$_}=1 foreach map { $_->email } @svc_acct;
+ }
+ keys %list;
+}
+
+=item invoicing_list_addpost
+
+Adds postal invoicing to this customer. If this customer is already configured
+to receive postal invoices, does nothing.
+
+=cut
+
+sub invoicing_list_addpost {
+ my $self = shift;
+ return if grep { $_ eq 'POST' } $self->invoicing_list;
+ my @invoicing_list = $self->invoicing_list;
+ push @invoicing_list, 'POST';
+ $self->invoicing_list(\@invoicing_list);
+}
+
+=item referral_cust_main [ DEPTH [ EXCLUDE_HASHREF ] ]
+
+Returns an array of customers referred by this customer (referral_custnum set
+to this custnum). If DEPTH is given, recurses up to the given depth, returning
+customers referred by customers referred by this customer and so on, inclusive.
+The default behavior is DEPTH 1 (no recursion).
+
+=cut
+
+sub referral_cust_main {
+ my $self = shift;
+ my $depth = @_ ? shift : 1;
+ my $exclude = @_ ? shift : {};
+
+ my @cust_main =
+ map { $exclude->{$_->custnum}++; $_; }
+ grep { ! $exclude->{ $_->custnum } }
+ qsearch( 'cust_main', { 'referral_custnum' => $self->custnum } );
+
+ if ( $depth > 1 ) {
+ push @cust_main,
+ map { $_->referral_cust_main($depth-1, $exclude) }
+ @cust_main;
+ }
+
+ @cust_main;
+}
+
+=item referral_cust_main_ncancelled
+
+Same as referral_cust_main, except only returns customers with uncancelled
+packages.
+
+=cut
+
+sub referral_cust_main_ncancelled {
+ my $self = shift;
+ grep { scalar($_->ncancelled_pkgs) } $self->referral_cust_main;
+}
+
+=item referral_cust_pkg [ DEPTH ]
+
+Like referral_cust_main, except returns a flat list of all unsuspended (and
+uncancelled) packages for each customer. The number of items in this list may
+be useful for comission calculations (perhaps after a C<grep { my $pkgpart = $_->pkgpart; grep { $_ == $pkgpart } @commission_worthy_pkgparts> } $cust_main-> ).
+
+=cut
+
+sub referral_cust_pkg {
+ my $self = shift;
+ my $depth = @_ ? shift : 1;
+
+ map { $_->unsuspended_pkgs }
+ grep { $_->unsuspended_pkgs }
+ $self->referral_cust_main($depth);
+}
+
+=item credit AMOUNT, REASON
+
+Applies a credit to this customer. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub credit {
+ my( $self, $amount, $reason ) = @_;
+ my $cust_credit = new FS::cust_credit {
+ 'custnum' => $self->custnum,
+ 'amount' => $amount,
+ 'reason' => $reason,
+ };
+ $cust_credit->insert;
+}
+
+=item charge AMOUNT [ PKG [ COMMENT [ TAXCLASS ] ] ]
+
+Creates a one-time charge for this customer. If there is an error, returns
+the error, otherwise returns false.
+
+=cut
+
+sub charge {
+ my ( $self, $amount ) = ( shift, shift );
+ my $pkg = @_ ? shift : 'One-time charge';
+ my $comment = @_ ? shift : '$'. sprintf("%.2f",$amount);
+ my $taxclass = @_ ? shift : '';
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $part_pkg = new FS::part_pkg ( {
+ 'pkg' => $pkg,
+ 'comment' => $comment,
+ 'setup' => $amount,
+ 'freq' => 0,
+ 'recur' => '0',
+ 'disabled' => 'Y',
+ 'taxclass' => $taxclass,
+ } );
+
+ my $error = $part_pkg->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ my $pkgpart = $part_pkg->pkgpart;
+ my %type_pkgs = ( 'typenum' => $self->agent->typenum, 'pkgpart' => $pkgpart );
+ unless ( qsearchs('type_pkgs', \%type_pkgs ) ) {
+ my $type_pkgs = new FS::type_pkgs \%type_pkgs;
+ $error = $type_pkgs->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ my $cust_pkg = new FS::cust_pkg ( {
+ 'custnum' => $self->custnum,
+ 'pkgpart' => $pkgpart,
+ } );
+
+ $error = $cust_pkg->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item cust_bill
+
+Returns all the invoices (see L<FS::cust_bill>) for this customer.
+
+=cut
+
+sub cust_bill {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch('cust_bill', { 'custnum' => $self->custnum, } )
+}
+
+=item open_cust_bill
+
+Returns all the open (owed > 0) invoices (see L<FS::cust_bill>) for this
+customer.
+
+=cut
+
+sub open_cust_bill {
+ my $self = shift;
+ grep { $_->owed > 0 } $self->cust_bill;
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item check_and_rebuild_fuzzyfiles
+
+=cut
+
+sub check_and_rebuild_fuzzyfiles {
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+ -e "$dir/cust_main.last" && -e "$dir/cust_main.company"
+ or &rebuild_fuzzyfiles;
+}
+
+=item rebuild_fuzzyfiles
+
+=cut
+
+sub rebuild_fuzzyfiles {
+
+ use Fcntl qw(:flock);
+
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+
+ #last
+
+ open(LASTLOCK,">>$dir/cust_main.last")
+ or die "can't open $dir/cust_main.last: $!";
+ flock(LASTLOCK,LOCK_EX)
+ or die "can't lock $dir/cust_main.last: $!";
+
+ my @all_last = map $_->getfield('last'), qsearch('cust_main', {});
+ push @all_last,
+ grep $_, map $_->getfield('ship_last'), qsearch('cust_main',{})
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ open (LASTCACHE,">$dir/cust_main.last.tmp")
+ or die "can't open $dir/cust_main.last.tmp: $!";
+ print LASTCACHE join("\n", @all_last), "\n";
+ close LASTCACHE or die "can't close $dir/cust_main.last.tmp: $!";
+
+ rename "$dir/cust_main.last.tmp", "$dir/cust_main.last";
+ close LASTLOCK;
+
+ #company
+
+ open(COMPANYLOCK,">>$dir/cust_main.company")
+ or die "can't open $dir/cust_main.company: $!";
+ flock(COMPANYLOCK,LOCK_EX)
+ or die "can't lock $dir/cust_main.company: $!";
+
+ my @all_company = grep $_ ne '', map $_->company, qsearch('cust_main',{});
+ push @all_company,
+ grep $_ ne '', map $_->ship_company, qsearch('cust_main', {})
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ open (COMPANYCACHE,">$dir/cust_main.company.tmp")
+ or die "can't open $dir/cust_main.company.tmp: $!";
+ print COMPANYCACHE join("\n", @all_company), "\n";
+ close COMPANYCACHE or die "can't close $dir/cust_main.company.tmp: $!";
+
+ rename "$dir/cust_main.company.tmp", "$dir/cust_main.company";
+ close COMPANYLOCK;
+
+}
+
+=item all_last
+
+=cut
+
+sub all_last {
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+ open(LASTCACHE,"<$dir/cust_main.last")
+ or die "can't open $dir/cust_main.last: $!";
+ my @array = map { chomp; $_; } <LASTCACHE>;
+ close LASTCACHE;
+ \@array;
+}
+
+=item all_company
+
+=cut
+
+sub all_company {
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+ open(COMPANYCACHE,"<$dir/cust_main.company")
+ or die "can't open $dir/cust_main.last: $!";
+ my @array = map { chomp; $_; } <COMPANYCACHE>;
+ close COMPANYCACHE;
+ \@array;
+}
+
+=item append_fuzzyfiles LASTNAME COMPANY
+
+=cut
+
+sub append_fuzzyfiles {
+ my( $last, $company ) = @_;
+
+ &check_and_rebuild_fuzzyfiles;
+
+ use Fcntl qw(:flock);
+
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+
+ if ( $last ) {
+
+ open(LAST,">>$dir/cust_main.last")
+ or die "can't open $dir/cust_main.last: $!";
+ flock(LAST,LOCK_EX)
+ or die "can't lock $dir/cust_main.last: $!";
+
+ print LAST "$last\n";
+
+ flock(LAST,LOCK_UN)
+ or die "can't unlock $dir/cust_main.last: $!";
+ close LAST;
+ }
+
+ if ( $company ) {
+
+ open(COMPANY,">>$dir/cust_main.company")
+ or die "can't open $dir/cust_main.company: $!";
+ flock(COMPANY,LOCK_EX)
+ or die "can't lock $dir/cust_main.company: $!";
+
+ print COMPANY "$company\n";
+
+ flock(COMPANY,LOCK_UN)
+ or die "can't unlock $dir/cust_main.company: $!";
+
+ close COMPANY;
+ }
+
+ 1;
+}
+
+=item batch_import
+
+=cut
+
+sub batch_import {
+ my $param = shift;
+ #warn join('-',keys %$param);
+ my $fh = $param->{filehandle};
+ my $agentnum = $param->{agentnum};
+ my $refnum = $param->{refnum};
+ my $pkgpart = $param->{pkgpart};
+ my @fields = @{$param->{fields}};
+
+ eval "use Date::Parse;";
+ die $@ if $@;
+ eval "use Text::CSV_XS;";
+ die $@ if $@;
+
+ my $csv = new Text::CSV_XS;
+ #warn $csv;
+ #warn $fh;
+
+ my $imported = 0;
+ #my $columns;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ #while ( $columns = $csv->getline($fh) ) {
+ my $line;
+ while ( defined($line=<$fh>) ) {
+
+ $csv->parse($line) or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't parse: ". $csv->error_input();
+ };
+
+ my @columns = $csv->fields();
+ #warn join('-',@columns);
+
+ my %cust_main = (
+ agentnum => $agentnum,
+ refnum => $refnum,
+ country => 'US', #default
+ payby => 'BILL', #default
+ paydate => '12/2037', #default
+ );
+ my $billtime = time;
+ my %cust_pkg = ( pkgpart => $pkgpart );
+ foreach my $field ( @fields ) {
+ if ( $field =~ /^cust_pkg\.(setup|bill|susp|expire|cancel)$/ ) {
+ #$cust_pkg{$1} = str2time( shift @$columns );
+ if ( $1 eq 'setup' ) {
+ $billtime = str2time(shift @columns);
+ } else {
+ $cust_pkg{$1} = str2time( shift @columns );
+ }
+ } else {
+ #$cust_main{$field} = shift @$columns;
+ $cust_main{$field} = shift @columns;
+ }
+ }
+
+ my $cust_pkg = new FS::cust_pkg ( \%cust_pkg ) if $pkgpart;
+ my $cust_main = new FS::cust_main ( \%cust_main );
+ use Tie::RefHash;
+ tie my %hash, 'Tie::RefHash'; #this part is important
+ $hash{$cust_pkg} = [] if $pkgpart;
+ my $error = $cust_main->insert( \%hash );
+
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't insert customer for $line: $error";
+ }
+
+ #false laziness w/bill.cgi
+ $error = $cust_main->bill( 'time' => $billtime );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't bill customer for $line: $error";
+ }
+
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+
+ $error = $cust_main->collect();
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't collect customer for $line: $error";
+ }
+
+ $imported++;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ return "Empty file!" unless $imported;
+
+ ''; #no error
+
+}
+
+=item batch_charge
+
+=cut
+
+sub batch_charge {
+ my $param = shift;
+ #warn join('-',keys %$param);
+ my $fh = $param->{filehandle};
+ my @fields = @{$param->{fields}};
+
+ eval "use Date::Parse;";
+ die $@ if $@;
+ eval "use Text::CSV_XS;";
+ die $@ if $@;
+
+ my $csv = new Text::CSV_XS;
+ #warn $csv;
+ #warn $fh;
+
+ my $imported = 0;
+ #my $columns;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ #while ( $columns = $csv->getline($fh) ) {
+ my $line;
+ while ( defined($line=<$fh>) ) {
+
+ $csv->parse($line) or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't parse: ". $csv->error_input();
+ };
+
+ my @columns = $csv->fields();
+ #warn join('-',@columns);
+
+ my %row = ();
+ foreach my $field ( @fields ) {
+ $row{$field} = shift @columns;
+ }
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $row{'custnum'} } );
+ unless ( $cust_main ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "unknown custnum $row{'custnum'}";
+ }
+
+ if ( $row{'amount'} > 0 ) {
+ my $error = $cust_main->charge($row{'amount'}, $row{'pkg'});
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $imported++;
+ } elsif ( $row{'amount'} < 0 ) {
+ my $error = $cust_main->credit( sprintf( "%.2f", 0-$row{'amount'} ),
+ $row{'pkg'} );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $imported++;
+ } else {
+ #hmm?
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ return "Empty file!" unless $imported;
+
+ ''; #no error
+
+}
+
+=back
+
+=head1 BUGS
+
+The delete method.
+
+The delete method should possibly take an FS::cust_main object reference
+instead of a scalar customer number.
+
+Bill and collect options should probably be passed as references instead of a
+list.
+
+There should probably be a configuration file with a list of allowed credit
+card types.
+
+No multiple currency support (probably a larger project than just this module).
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_pkg>, L<FS::cust_bill>, L<FS::cust_credit>
+L<FS::agent>, L<FS::part_referral>, L<FS::cust_main_county>,
+L<FS::cust_main_invoice>, L<FS::UID>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_main_county.pm b/FS/FS/cust_main_county.pm
new file mode 100644
index 000000000..d8796e451
--- /dev/null
+++ b/FS/FS/cust_main_county.pm
@@ -0,0 +1,256 @@
+package FS::cust_main_county;
+
+use strict;
+use vars qw( @ISA @EXPORT_OK $conf
+ @cust_main_county %cust_main_county $countyflag );
+use Exporter;
+use FS::Record qw( qsearch );
+
+@ISA = qw( FS::Record );
+@EXPORT_OK = qw( regionselector );
+
+@cust_main_county = ();
+$countyflag = '';
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::cust_main_county'} = sub {
+ $conf = new FS::Conf;
+};
+
+=head1 NAME
+
+FS::cust_main_county - Object methods for cust_main_county objects
+
+=head1 SYNOPSIS
+
+ use FS::cust_main_county;
+
+ $record = new FS::cust_main_county \%hash;
+ $record = new FS::cust_main_county { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ ($county_html, $state_html, $country_html) =
+ FS::cust_main_county::regionselector( $county, $state, $country );
+
+=head1 DESCRIPTION
+
+An FS::cust_main_county object represents a tax rate, defined by locale.
+FS::cust_main_county inherits from FS::Record. The following fields are
+currently supported:
+
+=over 4
+
+=item taxnum - primary key (assigned automatically for new tax rates)
+
+=item state
+
+=item county
+
+=item country
+
+=item tax - percentage
+
+=item taxclass
+
+=item exempt_amount
+
+=item taxname - if defined, printed on invoices instead of "Tax"
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new tax rate. To add the tax rate to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_main_county'; }
+
+=item insert
+
+Adds this tax rate to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this tax rate from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid tax rate. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->exempt_amount(0) unless $self->exempt_amount;
+
+ $self->ut_numbern('taxnum')
+ || $self->ut_textn('state')
+ || $self->ut_textn('county')
+ || $self->ut_text('country')
+ || $self->ut_float('tax')
+ || $self->ut_textn('taxclass') # ...
+ || $self->ut_money('exempt_amount')
+ || $self->ut_textn('taxname')
+ ;
+
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item regionselector [ COUNTY STATE COUNTRY [ PREFIX [ ONCHANGE ] ] ]
+
+=cut
+
+sub regionselector {
+ my ( $selected_county, $selected_state, $selected_country,
+ $prefix, $onchange ) = @_;
+
+ $prefix = '' unless defined $prefix;
+
+ $countyflag = 0;
+
+# unless ( @cust_main_county ) { #cache
+ @cust_main_county = qsearch('cust_main_county', {} );
+ foreach my $c ( @cust_main_county ) {
+ $countyflag=1 if $c->county;
+ #push @{$cust_main_county{$c->country}{$c->state}}, $c->county;
+ $cust_main_county{$c->country}{$c->state}{$c->county} = 1;
+ }
+# }
+ $countyflag=1 if $selected_county;
+
+ my $script_html = <<END;
+ <SCRIPT>
+ function opt(what,value,text) {
+ var optionName = new Option(text, value, false, false);
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+ function ${prefix}country_changed(what) {
+ country = what.options[what.selectedIndex].text;
+ for ( var i = what.form.${prefix}state.length; i >= 0; i-- )
+ what.form.${prefix}state.options[i] = null;
+END
+ #what.form.${prefix}state.options[0] = new Option('', '', false, true);
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ my $text = $state || '(n/a)';
+ $script_html .= qq!opt(what.form.${prefix}state, "$state", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+
+ $script_html .= <<END;
+ }
+ function ${prefix}state_changed(what) {
+END
+
+ if ( $countyflag ) {
+ $script_html .= <<END;
+ state = what.options[what.selectedIndex].text;
+ country = what.form.${prefix}country.options[what.form.${prefix}country.selectedIndex].text;
+ for ( var i = what.form.${prefix}county.length; i >= 0; i-- )
+ what.form.${prefix}county.options[i] = null;
+END
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ $script_html .= "\nif ( state == \"$state\" ) {\n";
+ #foreach my $county ( sort @{$cust_main_county{$country}{$state}} ) {
+ foreach my $county ( sort keys %{$cust_main_county{$country}{$state}} ) {
+ my $text = $county || '(n/a)';
+ $script_html .=
+ qq!opt(what.form.${prefix}county, "$county", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+ $script_html .= "}\n";
+ }
+ }
+
+ $script_html .= <<END;
+ }
+ </SCRIPT>
+END
+
+ my $county_html = $script_html;
+ if ( $countyflag ) {
+ $county_html .= qq!<SELECT NAME="${prefix}county" onChange="$onchange">!;
+ $county_html .= '</SELECT>';
+ } else {
+ $county_html .=
+ qq!<INPUT TYPE="hidden" NAME="${prefix}county" VALUE="$selected_county">!;
+ }
+
+ my $state_html = qq!<SELECT NAME="${prefix}state" !.
+ qq!onChange="${prefix}state_changed(this); $onchange">!;
+ foreach my $state ( sort keys %{ $cust_main_county{$selected_country} } ) {
+ my $text = $state || '(n/a)';
+ my $selected = $state eq $selected_state ? 'SELECTED' : '';
+ $state_html .= "\n<OPTION $selected VALUE=$state>$text</OPTION>"
+ }
+ $state_html .= '</SELECT>';
+
+ $state_html .= '</SELECT>';
+
+ my $country_html = qq!<SELECT NAME="${prefix}country" !.
+ qq!onChange="${prefix}country_changed(this); $onchange">!;
+ my $countrydefault = $conf->config('countrydefault') || 'US';
+ foreach my $country (
+ sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) or $a cmp $b }
+ keys %cust_main_county
+ ) {
+ my $selected = $country eq $selected_country ? ' SELECTED' : '';
+ $country_html .= "\n<OPTION$selected>$country</OPTION>"
+ }
+ $country_html .= '</SELECT>';
+
+ ($county_html, $state_html, $country_html);
+
+}
+
+=back
+
+=head1 BUGS
+
+regionselector? putting web ui components in here? they should probably live
+somewhere else...
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>, L<FS::cust_bill>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_main_invoice.pm b/FS/FS/cust_main_invoice.pm
new file mode 100644
index 000000000..bcb1437af
--- /dev/null
+++ b/FS/FS/cust_main_invoice.pm
@@ -0,0 +1,177 @@
+package FS::cust_main_invoice;
+
+use strict;
+use vars qw(@ISA $conf);
+use Exporter;
+use FS::Record qw( qsearchs );
+use FS::Conf;
+use FS::cust_main;
+use FS::svc_acct;
+use FS::Msgcat qw(gettext);
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_main_invoice - Object methods for cust_main_invoice records
+
+=head1 SYNOPSIS
+
+ use FS::cust_main_invoice;
+
+ $record = new FS::cust_main_invoice \%hash;
+ $record = new FS::cust_main_invoice { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $email_address = $record->address;
+
+=head1 DESCRIPTION
+
+An FS::cust_main_invoice object represents an invoice destination. FS::cust_main_invoice inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item destnum - primary key
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item dest - Invoice destination: If numeric, a svcnum (see L<FS::svc_acct>), if string, a literal email address, or `POST' to enable mailing (the default if no cust_main_invoice records exist)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new invoice destination. To add the invoice destination to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'cust_main_invoice'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Delete this record from the database.
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ return "Can't change custnum!" unless $old->custnum == $new->custnum;
+
+ $new->SUPER::replace($old);
+}
+
+
+=item check
+
+Checks all fields to make sure this is a valid invoice destination. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and repalce methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error = $self->ut_numbern('destnum')
+ || $self->ut_number('custnum')
+ || $self->checkdest;
+ ;
+ return $error if $error;
+
+ return "Unknown customer"
+ unless qsearchs('cust_main',{ 'custnum' => $self->custnum });
+
+ ''; #noerror
+}
+
+=item checkdest
+
+Checks the dest field only.
+
+#If it finds that the account ends in the
+#same domain configured as the B<domain> configuration file, it will change the
+#invoice destination from an email address to a service number (see
+#L<FS::svc_acct>).
+
+=cut
+
+sub checkdest {
+ my $self = shift;
+
+ my $error = $self->ut_text('dest');
+ return $error if $error;
+
+ if ( $self->dest eq 'POST' ) {
+ #contemplate our navel
+ } elsif ( $self->dest =~ /^(\d+)$/ ) {
+ return "Unknown local account (specified by svcnum: ". $self->dest. ")"
+ unless qsearchs( 'svc_acct', { 'svcnum' => $self->dest } );
+ } elsif ( $self->dest =~ /^([\w\.\-\&\+]+)\@(([\w\.\-]+\.)+\w+)$/ ) {
+ my($user, $domain) = ($1, $2);
+ $self->dest("$1\@$2");
+ } else {
+ return gettext("illegal_email_invoice_address");
+ }
+
+ ''; #no error
+}
+
+=item address
+
+Returns the literal email address for this record (or `POST').
+
+=cut
+
+sub address {
+ my $self = shift;
+ if ( $self->dest =~ /^(\d+)$/ ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $1 } )
+ or return undef;
+ $svc_acct->email;
+ } else {
+ $self->dest;
+ }
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_main_invoice.pm,v 1.13 2002-09-18 22:50:44 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
new file mode 100644
index 000000000..55f2fc4a3
--- /dev/null
+++ b/FS/FS/cust_pay.pm
@@ -0,0 +1,407 @@
+package FS::cust_pay;
+
+use strict;
+use vars qw( @ISA $conf $unsuspendauto );
+use Date::Format;
+use Business::CreditCard;
+use FS::UID qw( dbh );
+use FS::Record qw( dbh qsearch qsearchs dbh );
+use FS::Misc qw(send_email);
+use FS::cust_bill;
+use FS::cust_bill_pay;
+use FS::cust_main;
+
+@ISA = qw( FS::Record );
+
+#ask FS::UID to run this stuff for us later
+FS::UID->install_callback( sub {
+ $conf = new FS::Conf;
+ $unsuspendauto = $conf->exists('unsuspendauto');
+} );
+
+=head1 NAME
+
+FS::cust_pay - Object methods for cust_pay objects
+
+=head1 SYNOPSIS
+
+ use FS::cust_pay;
+
+ $record = new FS::cust_pay \%hash;
+ $record = new FS::cust_pay { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_pay object represents a payment; the transfer of money from a
+customer. FS::cust_pay inherits from FS::Record. The following fields are
+currently supported:
+
+=over 4
+
+=item paynum - primary key (assigned automatically for new payments)
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item paid - Amount of this payment
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH),
+`LECB' (phone bill billing), `BILL' (billing), or `COMP' (free)
+
+=item payinfo - card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively
+
+=item paybatch - text field for tracking card processing
+
+=item closed - books closed flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new payment. To add the payment to the databse, see L<"insert">.
+
+=cut
+
+sub table { 'cust_pay'; }
+
+=item insert
+
+Adds this payment to the database.
+
+For backwards-compatibility and convenience, if the additional field invnum
+is defined, an FS::cust_bill_pay record for the full amount of the payment
+will be created. In this case, custnum is optional.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ if ( $self->invnum ) {
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $self->invnum } )
+ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Unknown cust_bill.invnum: ". $self->invnum;
+ };
+ $self->custnum($cust_bill->custnum );
+ }
+
+ my $cust_main = qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+ my $old_balance = $cust_main->balance;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error inserting $self: $error";
+ }
+
+ if ( $self->invnum ) {
+ my $cust_bill_pay = new FS::cust_bill_pay {
+ 'invnum' => $self->invnum,
+ 'paynum' => $self->paynum,
+ 'amount' => $self->paid,
+ '_date' => $self->_date,
+ };
+ $error = $cust_bill_pay->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error inserting $cust_bill_pay: $error";
+ }
+ }
+
+ if ( $self->paybatch =~ /^webui-/ ) {
+ my @cust_pay = qsearch('cust_pay', {
+ 'custnum' => $self->custnum,
+ 'paybatch' => $self->paybatch,
+ } );
+ if ( scalar(@cust_pay) > 1 ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "a payment with webui token ". $self->paybatch. " already exists";
+ }
+ }
+
+ #false laziness w/ cust_credit::insert
+ if ( $unsuspendauto && $old_balance && $cust_main->balance <= 0 ) {
+ my @errors = $cust_main->unsuspend;
+ #return
+ # side-fx with nested transactions? upstack rolls back?
+ warn "WARNING:Errors unsuspending customer ". $cust_main->custnum. ": ".
+ join(' / ', @errors)
+ if @errors;
+ }
+ #eslaf
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+sub upgrade_replace { #1.3.x->1.4.x
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ my %new = $self->hash;
+ my $new = FS::cust_pay->new(\%new);
+
+ if ( $self->invnum ) {
+ my $cust_bill_pay = new FS::cust_bill_pay {
+ 'invnum' => $self->invnum,
+ 'paynum' => $self->paynum,
+ 'amount' => $self->paid,
+ '_date' => $self->_date,
+ };
+ $error = $cust_bill_pay->insert;
+ if ( $error =~
+ /total cust_bill_pay.amount and cust_credit_bill.amount .* for invnum .* greater than cust_bill.charged/ ) {
+ #warn $error;
+ my $cust_bill = qsearchs( 'cust_bill', { 'invnum' => $self->invnum } );
+ $new->custnum($cust_bill->custnum);
+ } elsif ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ } else {
+ $new->custnum($cust_bill_pay->cust_bill->custnum);
+ }
+ } else {
+ die;
+ }
+
+ $error = $new->SUPER::replace($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+
+}
+
+=item delete
+
+Deletes this payment and all associated applications (see L<FS::cust_bill_pay>),
+unless the closed flag is set.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't delete closed payment" if $self->closed =~ /^Y/i;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_bill_pay ( $self->cust_bill_pay ) {
+ my $error = $cust_bill_pay->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ my $error = $self->SUPER::delete(@_);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( $conf->config('deletepayments') ne '' ) {
+
+ my $cust_main = qsearchs('cust_main',{ 'custnum' => $self->custnum });
+
+ my $error = send_email(
+ 'from' => $conf->config('invoice_from'), #??? well as good as any
+ 'to' => $conf->config('deletepayments'),
+ 'subject' => 'FREESIDE NOTIFICATION: Payment deleted',
+ 'body' => [
+ "This is an automatic message from your Freeside installation\n",
+ "informing you that the following payment has been deleted:\n",
+ "\n",
+ 'paynum: '. $self->paynum. "\n",
+ 'custnum: '. $self->custnum.
+ " (". $cust_main->last. ", ". $cust_main->first. ")\n",
+ 'paid: $'. sprintf("%.2f", $self->paid). "\n",
+ 'date: '. time2str("%a %b %e %T %Y", $self->_date). "\n",
+ 'payby: '. $self->payby. "\n",
+ 'payinfo: '. $self->payinfo. "\n",
+ 'paybatch: '. $self->paybatch. "\n",
+ ],
+ );
+
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "can't send payment deletion notification: $error";
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item replace OLD_RECORD
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub replace {
+ return "Can't (yet?) modify cust_pay records!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid payment. If there is an error,
+returns the error, otherwise returns false. Called by the insert method.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('paynum')
+ || $self->ut_numbern('custnum')
+ || $self->ut_money('paid')
+ || $self->ut_numbern('_date')
+ || $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
+ ;
+ return $error if $error;
+
+ return "paid must be > 0 " if $self->paid <= 0;
+
+ return "unknown cust_main.custnum: ". $self->custnum
+ unless $self->invnum
+ || qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+
+ $self->_date(time) unless $self->_date;
+
+ $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP)$/ or return "Illegal payby";
+ $self->payby($1);
+
+ #false laziness with cust_refund::check
+ if ( $self->payby eq 'CARD' ) {
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\D//g;
+ $self->payinfo($payinfo);
+ if ( $self->payinfo ) {
+ $self->payinfo =~ /^(\d{13,16})$/
+ or return "Illegal (mistyped?) credit card number (payinfo)";
+ $self->payinfo($1);
+ validate($self->payinfo) or return "Illegal credit card number";
+ return "Unknown card type" if cardtype($self->payinfo) eq "Unknown";
+ } else {
+ $self->payinfo('N/A');
+ }
+
+ } else {
+ $error = $self->ut_textn('payinfo');
+ return $error if $error;
+ }
+
+ ''; #no error
+
+}
+
+=item cust_bill_pay
+
+Returns all applications to invoices (see L<FS::cust_bill_pay>) for this
+payment.
+
+=cut
+
+sub cust_bill_pay {
+ my $self = shift;
+ sort { $a->_date <=> $b->_date }
+ qsearch( 'cust_bill_pay', { 'paynum' => $self->paynum } )
+ ;
+}
+
+=item unapplied
+
+Returns the amount of this payment that is still unapplied; which is
+paid minus all payment applications (see L<FS::cust_bill_pay>).
+
+=cut
+
+sub unapplied {
+ my $self = shift;
+ my $amount = $self->paid;
+ $amount -= $_->amount foreach ( $self->cust_bill_pay );
+ sprintf("%.2f", $amount );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_pay.pm,v 1.24 2003-05-19 12:00:44 ivan Exp $
+
+=head1 BUGS
+
+Delete and replace methods.
+
+=head1 SEE ALSO
+
+L<FS::cust_bill_pay>, L<FS::cust_bill>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_pay_batch.pm b/FS/FS/cust_pay_batch.pm
new file mode 100644
index 000000000..c4427c387
--- /dev/null
+++ b/FS/FS/cust_pay_batch.pm
@@ -0,0 +1,209 @@
+package FS::cust_pay_batch;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record;
+use Business::CreditCard;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_pay_batch - Object methods for batch cards
+
+=head1 SYNOPSIS
+
+ use FS::cust_pay_batch;
+
+ $record = new FS::cust_pay_batch \%hash;
+ $record = new FS::cust_pay_batch { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_pay_batch object represents a credit card transaction ready to be
+batched (sent to a processor). FS::cust_pay_batch inherits from FS::Record.
+Typically called by the collect method of an FS::cust_main object. The
+following fields are currently supported:
+
+=over 4
+
+=item paybatchnum - primary key (automatically assigned)
+
+=item cardnum
+
+=item exp - card expiration
+
+=item amount
+
+=item invnum - invoice
+
+=item custnum - customer
+
+=item payname - name on card
+
+=item first - name
+
+=item last - name
+
+=item address1
+
+=item address2
+
+=item city
+
+=item state
+
+=item zip
+
+=item country
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new record. To add the record to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'cust_pay_batch'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Delete this record from the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item replace OLD_RECORD
+
+#inactive
+#
+#Replaces the OLD_RECORD with this one in the database. If there is an error,
+#returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ return "Can't (yet?) replace batched transactions!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid transaction. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and repalce methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('paybatchnum')
+ || $self->ut_numbern('trancode') #depriciated
+ || $self->ut_number('cardnum')
+ || $self->ut_money('amount')
+ || $self->ut_number('invnum')
+ || $self->ut_number('custnum')
+ || $self->ut_text('address1')
+ || $self->ut_textn('address2')
+ || $self->ut_text('city')
+ || $self->ut_textn('state')
+ ;
+
+ return $error if $error;
+
+ $self->getfield('last') =~ /^([\w \,\.\-\']+)$/ or return "Illegal last name";
+ $self->setfield('last',$1);
+
+ $self->first =~ /^([\w \,\.\-\']+)$/ or return "Illegal first name";
+ $self->first($1);
+
+ my $cardnum = $self->cardnum;
+ $cardnum =~ s/\D//g;
+ $cardnum =~ /^(\d{13,16})$/
+ or return "Illegal credit card number";
+ $cardnum = $1;
+ $self->cardnum($cardnum);
+ validate($cardnum) or return "Illegal credit card number";
+ return "Unknown card type" if cardtype($cardnum) eq "Unknown";
+
+ if ( $self->exp eq '' ) {
+ return "Expriation date required"; #unless
+ $self->exp('');
+ } else {
+ if ( $self->exp =~ /^(\d{4})[\/\-](\d{1,2})[\/\-](\d{1,2})$/ ) {
+ $self->exp("$1-$2-$3");
+ } elsif ( $self->exp =~ /^(\d{1,2})[\/\-](\d{2}(\d{2})?)$/ ) {
+ if ( length($2) == 4 ) {
+ $self->exp("$2-$1-01");
+ } elsif ( $2 > 98 ) { #should pry change to check for "this year"
+ $self->exp("19$2-$1-01");
+ } else {
+ $self->exp("20$2-$1-01");
+ }
+ } else {
+ return "Illegal expiration date";
+ }
+ }
+
+ if ( $self->payname eq '' ) {
+ $self->payname( $self->first. " ". $self->getfield('last') );
+ } else {
+ $self->payname =~ /^([\w \,\.\-\']+)$/
+ or return "Illegal billing name";
+ $self->payname($1);
+ }
+
+ #$self->zip =~ /^\s*(\w[\w\-\s]{3,8}\w)\s*$/
+ # or return "Illegal zip: ". $self->zip;
+ #$self->zip($1);
+
+ $self->country =~ /^(\w\w)$/ or return "Illegal country: ". $self->country;
+ $self->country($1);
+
+ $error = $self->ut_zip('zip', $self->country);
+ return $error if $error;
+
+ #check invnum, custnum, ?
+
+ ''; #no error
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_pay_batch.pm,v 1.6 2002-02-22 23:08:11 ivan Exp $
+
+=head1 BUGS
+
+There should probably be a configuration file with a list of allowed credit
+card types.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, L<FS::Record>
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
new file mode 100644
index 000000000..a423c5518
--- /dev/null
+++ b/FS/FS/cust_pkg.pm
@@ -0,0 +1,776 @@
+package FS::cust_pkg;
+
+use strict;
+use vars qw(@ISA $disable_agentcheck);
+use vars qw( $quiet );
+use FS::UID qw( getotaker dbh );
+use FS::Record qw( qsearch qsearchs );
+use FS::Misc qw( send_email );
+use FS::cust_svc;
+use FS::part_pkg;
+use FS::cust_main;
+use FS::type_pkgs;
+use FS::pkg_svc;
+use FS::cust_bill_pkg;
+
+# need to 'use' these instead of 'require' in sub { cancel, suspend, unsuspend,
+# setup }
+# because they load configuraion by setting FS::UID::callback (see TODO)
+use FS::svc_acct;
+use FS::svc_domain;
+use FS::svc_www;
+use FS::svc_forward;
+
+# for sending cancel emails in sub cancel
+use FS::Conf;
+
+@ISA = qw( FS::Record );
+
+$disable_agentcheck = 0;
+
+sub _cache {
+ my $self = shift;
+ my ( $hashref, $cache ) = @_;
+ #if ( $hashref->{'pkgpart'} ) {
+ if ( $hashref->{'pkg'} ) {
+ # #@{ $self->{'_pkgnum'} } = ();
+ # my $subcache = $cache->subcache('pkgpart', 'part_pkg');
+ # $self->{'_pkgpart'} = $subcache;
+ # #push @{ $self->{'_pkgnum'} },
+ # FS::part_pkg->new_or_cached($hashref, $subcache);
+ $self->{'_pkgpart'} = FS::part_pkg->new($hashref);
+ }
+ if ( exists $hashref->{'svcnum'} ) {
+ #@{ $self->{'_pkgnum'} } = ();
+ my $subcache = $cache->subcache('svcnum', 'cust_svc', $hashref->{pkgnum});
+ $self->{'_svcnum'} = $subcache;
+ #push @{ $self->{'_pkgnum'} },
+ FS::cust_svc->new_or_cached($hashref, $subcache) if $hashref->{svcnum};
+ }
+}
+
+=head1 NAME
+
+FS::cust_pkg - Object methods for cust_pkg objects
+
+=head1 SYNOPSIS
+
+ use FS::cust_pkg;
+
+ $record = new FS::cust_pkg \%hash;
+ $record = new FS::cust_pkg { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->cancel;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $part_pkg = $record->part_pkg;
+
+ @labels = $record->labels;
+
+ $seconds = $record->seconds_since($timestamp);
+
+ $error = FS::cust_pkg::order( $custnum, \@pkgparts );
+ $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] );
+
+=head1 DESCRIPTION
+
+An FS::cust_pkg object represents a customer billing item. FS::cust_pkg
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item pkgnum - primary key (assigned automatically for new billing items)
+
+=item custnum - Customer (see L<FS::cust_main>)
+
+=item pkgpart - Billing item definition (see L<FS::part_pkg>)
+
+=item setup - date
+
+=item bill - date (next bill date)
+
+=item last_bill - last bill date
+
+=item susp - date
+
+=item expire - date
+
+=item cancel - date
+
+=item otaker - order taker (assigned automatically if null, see L<FS::UID>)
+
+=item manual_flag - If this field is set to 1, disables the automatic
+unsuspension of this package when using the B<unsuspendauto> config file.
+
+=back
+
+Note: setup, bill, susp, expire and cancel are specified as UNIX timestamps;
+see L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for
+conversion functions.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new billing item. To add the item to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_pkg'; }
+
+=item insert
+
+Adds this billing item to the database ("Orders" the item). If there is an
+error, returns the error, otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ # custnum might not have have been defined in sub check (for one-shot new
+ # customers), so check it here instead
+ # (is this still necessary with transactions?)
+
+ my $error = $self->ut_number('custnum');
+ return $error if $error;
+
+ my $cust_main = $self->cust_main;
+ return "Unknown customer ". $self->custnum unless $cust_main;
+
+ unless ( $disable_agentcheck ) {
+ my $agent = qsearchs( 'agent', { 'agentnum' => $cust_main->agentnum } );
+ my $pkgpart_href = $agent->pkgpart_hashref;
+ return "agent ". $agent->agentnum.
+ " can't purchase pkgpart ". $self->pkgpart
+ unless $pkgpart_href->{ $self->pkgpart };
+ }
+
+ $self->SUPER::insert;
+
+}
+
+=item delete
+
+This method now works but you probably shouldn't use it.
+
+You don't want to delete billing items, because there would then be no record
+the customer ever purchased the item. Instead, see the cancel method.
+
+=cut
+
+#sub delete {
+# return "Can't delete cust_pkg records!";
+#}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+Currently, custnum, setup, bill, susp, expire, and cancel may be changed.
+
+Changing pkgpart may have disasterous effects. See the order subroutine.
+
+setup and bill are normally updated by calling the bill method of a customer
+object (see L<FS::cust_main>).
+
+suspend is normally updated by the suspend and unsuspend methods.
+
+cancel is normally updated by the cancel method (and also the order subroutine
+in some cases).
+
+=cut
+
+sub replace {
+ my( $new, $old ) = ( shift, shift );
+
+ #return "Can't (yet?) change pkgpart!" if $old->pkgpart != $new->pkgpart;
+ return "Can't change otaker!" if $old->otaker ne $new->otaker;
+
+ #allow this *sigh*
+ #return "Can't change setup once it exists!"
+ # if $old->getfield('setup') &&
+ # $old->getfield('setup') != $new->getfield('setup');
+
+ #some logic for bill, susp, cancel?
+
+ $new->SUPER::replace($old);
+}
+
+=item check
+
+Checks all fields to make sure this is a valid billing item. If there is an
+error, returns the error, otherwise returns false. Called by the insert and
+replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('pkgnum')
+ || $self->ut_numbern('custnum')
+ || $self->ut_number('pkgpart')
+ || $self->ut_numbern('setup')
+ || $self->ut_numbern('bill')
+ || $self->ut_numbern('susp')
+ || $self->ut_numbern('cancel')
+ ;
+ return $error if $error;
+
+ if ( $self->custnum ) {
+ return "Unknown customer ". $self->custnum unless $self->cust_main;
+ }
+
+ return "Unknown pkgpart: ". $self->pkgpart
+ unless qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
+
+ $self->otaker(getotaker) unless $self->otaker;
+ $self->otaker =~ /^([\w\.\-]{0,16})$/ or return "Illegal otaker";
+ $self->otaker($1);
+
+ if ( $self->dbdef_table->column('manual_flag') ) {
+ $self->manual_flag =~ /^([01]?)$/ or return "Illegal manual_flag";
+ $self->manual_flag($1);
+ }
+
+ ''; #no error
+}
+
+=item cancel
+
+Cancels and removes all services (see L<FS::cust_svc> and L<FS::part_svc>)
+in this package, then cancels the package itself (sets the cancel field to
+now).
+
+If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub cancel {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
+ ) {
+ my $error = $cust_svc->cancel;
+
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error cancelling cust_svc: $error";
+ }
+
+ }
+
+ unless ( $self->getfield('cancel') ) {
+ my %hash = $self->hash;
+ $hash{'cancel'} = time;
+ my $new = new FS::cust_pkg ( \%hash );
+ $error = $new->replace($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ my $conf = new FS::Conf;
+ my @invoicing_list = grep { $_ ne 'POST' } $self->cust_main->invoicing_list;
+ if ( !$quiet && $conf->exists('emailcancel') && @invoicing_list ) {
+ my $conf = new FS::Conf;
+ my $error = send_email(
+ 'from' => $conf->config('invoice_from'),
+ 'to' => \@invoicing_list,
+ 'subject' => $conf->config('cancelsubject'),
+ 'body' => [ map "$_\n", $conf->config('cancelmessage') ],
+ );
+ #should this do something on errors?
+ }
+
+ ''; #no errors
+
+}
+
+=item suspend
+
+Suspends all services (see L<FS::cust_svc> and L<FS::part_svc>) in this
+package, then suspends the package itself (sets the susp field to now).
+
+If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub suspend {
+ my $self = shift;
+ my $error ;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } )
+ ) {
+ my $part_svc = qsearchs( 'part_svc', { 'svcpart' => $cust_svc->svcpart } );
+
+ $part_svc->svcdb =~ /^([\w\-]+)$/ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Illegal svcdb value in part_svc!";
+ };
+ my $svcdb = $1;
+ require "FS/$svcdb.pm";
+
+ my $svc = qsearchs( $svcdb, { 'svcnum' => $cust_svc->svcnum } );
+ if ($svc) {
+ $error = $svc->suspend;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ }
+
+ unless ( $self->getfield('susp') ) {
+ my %hash = $self->hash;
+ $hash{'susp'} = time;
+ my $new = new FS::cust_pkg ( \%hash );
+ $error = $new->replace($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ ''; #no errors
+}
+
+=item unsuspend
+
+Unsuspends all services (see L<FS::cust_svc> and L<FS::part_svc>) in this
+package, then unsuspends the package itself (clears the susp field).
+
+If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub unsuspend {
+ my $self = shift;
+ my($error);
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_svc (
+ qsearch('cust_svc',{'pkgnum'=> $self->pkgnum } )
+ ) {
+ my $part_svc = qsearchs( 'part_svc', { 'svcpart' => $cust_svc->svcpart } );
+
+ $part_svc->svcdb =~ /^([\w\-]+)$/ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Illegal svcdb value in part_svc!";
+ };
+ my $svcdb = $1;
+ require "FS/$svcdb.pm";
+
+ my $svc = qsearchs( $svcdb, { 'svcnum' => $cust_svc->svcnum } );
+ if ($svc) {
+ $error = $svc->unsuspend;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ }
+
+ unless ( ! $self->getfield('susp') ) {
+ my %hash = $self->hash;
+ $hash{'susp'} = '';
+ my $new = new FS::cust_pkg ( \%hash );
+ $error = $new->replace($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ ''; #no errors
+}
+
+=item last_bill
+
+Returns the last bill date, or if there is no last bill date, the setup date.
+Useful for billing metered services.
+
+=cut
+
+sub last_bill {
+ my $self = shift;
+ if ( $self->dbdef_table->column('last_bill') ) {
+ return $self->setfield('last_bill', $_[0]) if @_;
+ return $self->getfield('last_bill') if $self->getfield('last_bill');
+ }
+ my $cust_bill_pkg = qsearchs('cust_bill_pkg', { 'pkgnum' => $self->pkgnum,
+ 'edate' => $self->bill, } );
+ $cust_bill_pkg ? $cust_bill_pkg->sdate : $self->setup || 0;
+}
+
+=item part_pkg
+
+Returns the definition for this billing item, as an FS::part_pkg object (see
+L<FS::part_pkg>).
+
+=cut
+
+sub part_pkg {
+ my $self = shift;
+ #exists( $self->{'_pkgpart'} )
+ $self->{'_pkgpart'}
+ ? $self->{'_pkgpart'}
+ : qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
+}
+
+=item cust_svc
+
+Returns the services for this package, as FS::cust_svc objects (see
+L<FS::cust_svc>)
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ if ( $self->{'_svcnum'} ) {
+ values %{ $self->{'_svcnum'}->cache };
+ } else {
+ qsearch ( 'cust_svc', { 'pkgnum' => $self->pkgnum } );
+ }
+}
+
+=item labels
+
+Returns a list of lists, calling the label method for all services
+(see L<FS::cust_svc>) of this billing item.
+
+=cut
+
+sub labels {
+ my $self = shift;
+ map { [ $_->label ] } $self->cust_svc;
+}
+
+=item cust_main
+
+Returns the parent customer object (see L<FS::cust_main>).
+
+=cut
+
+sub cust_main {
+ my $self = shift;
+ qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+}
+
+=item seconds_since TIMESTAMP
+
+Returns the number of seconds all accounts (see L<FS::svc_acct>) in this
+package have been online since TIMESTAMP, according to the session monitor.
+
+TIMESTAMP is specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=cut
+
+sub seconds_since {
+ my($self, $since) = @_;
+ my $seconds = 0;
+
+ foreach my $cust_svc (
+ grep { $_->part_svc->svcdb eq 'svc_acct' } $self->cust_svc
+ ) {
+ $seconds += $cust_svc->seconds_since($since);
+ }
+
+ $seconds;
+
+}
+
+=item seconds_since_sqlradacct TIMESTAMP_START TIMESTAMP_END
+
+Returns the numbers of seconds all accounts (see L<FS::svc_acct>) in this
+package have been online between TIMESTAMP_START (inclusive) and TIMESTAMP_END
+(exclusive).
+
+TIMESTAMP_START and TIMESTAMP_END are specified as UNIX timestamps; see
+L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for conversion
+functions.
+
+
+=cut
+
+sub seconds_since_sqlradacct {
+ my($self, $start, $end) = @_;
+
+ my $seconds = 0;
+
+ foreach my $cust_svc (
+ grep {
+ my $part_svc = $_->part_svc;
+ $part_svc->svcdb eq 'svc_acct'
+ && scalar($part_svc->part_export('sqlradius'));
+ } $self->cust_svc
+ ) {
+ $seconds += $cust_svc->seconds_since_sqlradacct($start, $end);
+ }
+
+ $seconds;
+
+}
+
+=item attribute_since_sqlradacct TIMESTAMP_START TIMESTAMP_END ATTRIBUTE
+
+Returns the sum of the given attribute for all accounts (see L<FS::svc_acct>)
+in this package for sessions ending between TIMESTAMP_START (inclusive) and
+TIMESTAMP_END
+(exclusive).
+
+TIMESTAMP_START and TIMESTAMP_END are specified as UNIX timestamps; see
+L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for conversion
+functions.
+
+=cut
+
+sub attribute_since_sqlradacct {
+ my($self, $start, $end, $attrib) = @_;
+
+ my $sum = 0;
+
+ foreach my $cust_svc (
+ grep {
+ my $part_svc = $_->part_svc;
+ $part_svc->svcdb eq 'svc_acct'
+ && scalar($part_svc->part_export('sqlradius'));
+ } $self->cust_svc
+ ) {
+ $sum += $cust_svc->attribute_since_sqlradacct($start, $end, $attrib);
+ }
+
+ $sum;
+
+}
+
+=item transfer DEST_PKGNUM
+
+Transfers as many services as possible from this package to another package.
+The destination package must already exist. Services are moved only if
+the destination allows services with the correct I<svcnum> (not svcdb).
+Any services that can't be moved remain in the original package.
+
+Returns an error, if there is one; otherwise, returns the number of services
+that couldn't be moved.
+
+=cut
+
+sub transfer {
+ my ($self, $dest_pkgnum) = @_;
+
+ my $remaining = 0;
+ my $dest;
+ my %target;
+ my $pkg_svc;
+
+ if (ref ($dest_pkgnum) eq 'FS::cust_pkg') {
+ $dest = $dest_pkgnum;
+ $dest_pkgnum = $dest->pkgnum;
+ } else {
+ $dest = qsearchs('cust_pkg', { pkgnum => $dest_pkgnum });
+ }
+
+ return ('Package does not exist: '.$dest_pkgnum) unless $dest;
+
+ foreach $pkg_svc (qsearch('pkg_svc', { pkgpart => $dest->pkgpart })) {
+ $target{$pkg_svc->svcpart} = $pkg_svc->quantity;
+ }
+
+ my $cust_svc;
+
+ foreach $cust_svc ($dest->cust_svc) {
+ $target{$cust_svc->svcpart}--;
+ }
+
+ foreach $cust_svc ($self->cust_svc) {
+ if($target{$cust_svc->svcpart} > 0) {
+ $target{$cust_svc->svcpart}--;
+ my $new = new FS::cust_svc {
+ svcnum => $cust_svc->svcnum,
+ svcpart => $cust_svc->svcpart,
+ pkgnum => $dest_pkgnum };
+ my $error = $new->replace($cust_svc);
+ return $error if $error;
+ } else {
+ $remaining++
+ }
+ }
+ return $remaining;
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF [ RETURN_CUST_PKG_ARRAYREF ] ]
+
+CUSTNUM is a customer (see L<FS::cust_main>)
+
+PKGPARTS is a list of pkgparts specifying the the billing item definitions (see
+L<FS::part_pkg>) to order for this customer. Duplicates are of course
+permitted.
+
+REMOVE_PKGNUMS is an optional list of pkgnums specifying the billing items to
+remove for this customer. The services (see L<FS::cust_svc>) are moved to the
+new billing items. An error is returned if this is not possible (see
+L<FS::pkg_svc>). An empty arrayref is equivalent to not specifying this
+parameter.
+
+RETURN_CUST_PKG_ARRAYREF, if specified, will be filled in with the
+newly-created cust_pkg objects.
+
+=cut
+
+sub order {
+
+ # Rewritten to make use of the transfer() method, and in general
+ # to not suck so badly.
+
+ my ($custnum, $pkgparts, $remove_pkgnum, $return_cust_pkg) = @_;
+
+ # Transactionize this whole mess
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error;
+ my $cust_main = qsearchs('cust_main', { custnum => $custnum });
+ return "Customer not found: $custnum" unless $cust_main;
+
+ # Create the new packages.
+ my $cust_pkg;
+ foreach (@$pkgparts) {
+ $cust_pkg = new FS::cust_pkg { custnum => $custnum,
+ pkgpart => $_ };
+ $error = $cust_pkg->insert;
+ if ($error) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ push @$return_cust_pkg, $cust_pkg;
+ }
+ # $return_cust_pkg now contains refs to all of the newly
+ # created packages.
+
+ # Transfer services and cancel old packages.
+ foreach my $old_pkgnum (@$remove_pkgnum) {
+ my $old_pkg = qsearchs ('cust_pkg', { pkgnum => $old_pkgnum });
+ foreach my $new_pkg (@$return_cust_pkg) {
+ $error = $old_pkg->transfer($new_pkg);
+ if ($error and $error == 0) {
+ # $old_pkg->transfer failed.
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ if ($error > 0) {
+ # Transfers were successful, but we went through all of the
+ # new packages and still had services left on the old package.
+ # We can't cancel the package under the circumstances, so abort.
+ $dbh->rollback if $oldAutoCommit;
+ return "Unable to transfer all services from package ".$old_pkg->pkgnum;
+ }
+ $error = $old_pkg->cancel;
+ if ($error) {
+ $dbh->rollback;
+ return $error;
+ }
+ }
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+=back
+
+=head1 BUGS
+
+sub order is not OO. Perhaps it should be moved to FS::cust_main and made so?
+
+In sub order, the @pkgparts array (passed by reference) is clobbered.
+
+Also in sub order, no money is adjusted. Once FS::part_pkg defines a standard
+method to pass dates to the recur_prog expression, it should do so.
+
+FS::svc_acct, FS::svc_domain, FS::svc_www, FS::svc_ip and FS::svc_forward are
+loaded via 'use' at compile time, rather than via 'require' in sub { setup,
+suspend, unsuspend, cancel } because they use %FS::UID::callback to load
+configuration values. Probably need a subroutine which decides what to do
+based on whether or not we've fetched the user yet, rather than a hash. See
+FS::UID and the TODO.
+
+Now that things are transactional should the check in the insert method be
+moved to check ?
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>, L<FS::part_pkg>, L<FS::cust_svc>,
+L<FS::pkg_svc>, schema.html from the base documentation
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm
new file mode 100644
index 000000000..763671736
--- /dev/null
+++ b/FS/FS/cust_refund.pm
@@ -0,0 +1,283 @@
+package FS::cust_refund;
+
+use strict;
+use vars qw( @ISA );
+use Business::CreditCard;
+use FS::Record qw( qsearchs dbh );
+use FS::UID qw(getotaker);
+use FS::cust_credit;
+use FS::cust_credit_refund;
+use FS::cust_main;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::cust_refund - Object method for cust_refund objects
+
+=head1 SYNOPSIS
+
+ use FS::cust_refund;
+
+ $record = new FS::cust_refund \%hash;
+ $record = new FS::cust_refund { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_refund represents a refund: the transfer of money to a customer;
+equivalent to a negative payment (see L<FS::cust_pay>). FS::cust_refund
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item refundnum - primary key (assigned automatically for new refunds)
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item refund - Amount of the refund
+
+=item _date - specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH),
+`LECB' (Phone bill billing), `BILL' (billing), or `COMP' (free)
+
+=item payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username)
+
+=item paybatch - text field for tracking card processing
+
+=item otaker - order taker (assigned automatically, see L<FS::UID>)
+
+=item closed - books closed flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new refund. To add the refund to the database, see L<"insert">.
+
+=cut
+
+sub table { 'cust_refund'; }
+
+=item insert
+
+Adds this refund to the database.
+
+For backwards-compatibility and convenience, if the additional field crednum is
+defined, an FS::cust_credit_refund record for the full amount of the refund
+will be created. In this case, custnum is optional.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ if ( $self->crednum ) {
+ my $cust_credit = qsearchs('cust_credit', { 'crednum' => $self->crednum } )
+ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Unknown cust_credit.crednum: ". $self->crednum;
+ };
+ $self->custnum($cust_credit->custnum);
+ }
+
+ my $error = $self->check;
+ return $error if $error;
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( $self->crednum ) {
+ my $cust_credit_refund = new FS::cust_credit_refund {
+ 'crednum' => $self->crednum,
+ 'refundnum' => $self->refundnum,
+ 'amount' => $self->refund,
+ '_date' => $self->_date,
+ };
+ $error = $cust_credit_refund->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ #$self->custnum($cust_credit_refund->cust_credit->custnum);
+ }
+
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+sub upgrade_replace { #1.3.x->1.4.x
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ my %new = $self->hash;
+ my $new = FS::cust_refund->new(\%new);
+
+ if ( $self->crednum ) {
+ my $cust_credit_refund = new FS::cust_credit_refund {
+ 'crednum' => $self->crednum,
+ 'refundnum' => $self->refundnum,
+ 'amount' => $self->refund,
+ '_date' => $self->_date,
+ };
+ $error = $cust_credit_refund->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $new->custnum($cust_credit_refund->cust_credit->custnum);
+ } else {
+ die;
+ }
+
+ $error = $new->SUPER::replace($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item delete
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't delete closed refund" if $self->closed =~ /^Y/i;
+ $self->SUPER::delete(@_);
+}
+
+=item replace OLD_RECORD
+
+Currently unimplemented (accounting reasons).
+
+=cut
+
+sub replace {
+ return "Can't (yet?) modify cust_refund records!";
+}
+
+=item check
+
+Checks all fields to make sure this is a valid refund. If there is an error,
+returns the error, otherwise returns false. Called by the insert method.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('refundnum')
+ || $self->ut_numbern('custnum')
+ || $self->ut_money('refund')
+ || $self->ut_numbern('_date')
+ || $self->ut_textn('paybatch')
+ || $self->ut_enum('closed', [ '', 'Y' ])
+ ;
+ return $error if $error;
+
+ return "refund must be > 0 " if $self->refund <= 0;
+
+ $self->_date(time) unless $self->_date;
+
+ return "unknown cust_main.custnum: ". $self->custnum
+ unless $self->crednum
+ || qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+
+ $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP)$/ or return "Illegal payby";
+ $self->payby($1);
+
+ #false laziness with cust_pay::check
+ if ( $self->payby eq 'CARD' ) {
+ my $payinfo = $self->payinfo;
+ $payinfo =~ s/\D//g;
+ $self->payinfo($payinfo);
+ if ( $self->payinfo ) {
+ $self->payinfo =~ /^(\d{13,16})$/
+ or return "Illegal (mistyped?) credit card number (payinfo)";
+ $self->payinfo($1);
+ validate($self->payinfo) or return "Illegal credit card number";
+ return "Unknown card type" if cardtype($self->payinfo) eq "Unknown";
+ } else {
+ $self->payinfo('N/A');
+ }
+
+ } else {
+ $error = $self->ut_textn('payinfo');
+ return $error if $error;
+ }
+
+ $self->otaker(getotaker);
+
+ ''; #no error
+}
+
+=back
+
+=head1 VERSION
+
+$Id: cust_refund.pm,v 1.20 2002-11-19 09:51:58 ivan Exp $
+
+=head1 BUGS
+
+Delete and replace methods.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_credit>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
new file mode 100644
index 000000000..c0cb6f4e9
--- /dev/null
+++ b/FS/FS/cust_svc.pm
@@ -0,0 +1,525 @@
+package FS::cust_svc;
+
+use strict;
+use vars qw( @ISA $ignore_quantity );
+use Carp qw( cluck );
+use FS::Record qw( qsearch qsearchs dbh );
+use FS::cust_pkg;
+use FS::part_pkg;
+use FS::part_svc;
+use FS::pkg_svc;
+use FS::svc_acct;
+use FS::svc_domain;
+use FS::svc_forward;
+use FS::svc_broadband;
+use FS::domain_record;
+use FS::part_export;
+
+@ISA = qw( FS::Record );
+
+$ignore_quantity = 0;
+
+sub _cache {
+ my $self = shift;
+ my ( $hashref, $cache ) = @_;
+ if ( $hashref->{'username'} ) {
+ $self->{'_svc_acct'} = FS::svc_acct->new($hashref, '');
+ }
+ if ( $hashref->{'svc'} ) {
+ $self->{'_svcpart'} = FS::part_svc->new($hashref);
+ }
+}
+
+=head1 NAME
+
+FS::cust_svc - Object method for cust_svc objects
+
+=head1 SYNOPSIS
+
+ use FS::cust_svc;
+
+ $record = new FS::cust_svc \%hash
+ $record = new FS::cust_svc { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ ($label, $value) = $record->label;
+
+=head1 DESCRIPTION
+
+An FS::cust_svc represents a service. FS::cust_svc inherits from FS::Record.
+The following fields are currently supported:
+
+=over 4
+
+=item svcnum - primary key (assigned automatically for new services)
+
+=item pkgnum - Package (see L<FS::cust_pkg>)
+
+=item svcpart - Service definition (see L<FS::part_svc>)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new service. To add the refund to the database, see L<"insert">.
+Services are normally created by creating FS::svc_ objects (see
+L<FS::svc_acct>, L<FS::svc_domain>, and L<FS::svc_forward>, among others).
+
+=cut
+
+sub table { 'cust_svc'; }
+
+=item insert
+
+Adds this service to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this service from the database. If there is an error, returns the
+error, otherwise returns false. Note that this only removes the cust_svc
+record - you should probably use the B<cancel> method instead.
+
+=item cancel
+
+Cancels the relevant service by calling the B<cancel> method of the associated
+FS::svc_XXX object (i.e. an FS::svc_acct object or FS::svc_domain object),
+deleting the FS::svc_XXX record and then deleting this record.
+
+If there is an error, returns the error, otherwise returns false.
+
+=cut
+
+sub cancel {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $part_svc = $self->part_svc;
+
+ $part_svc->svcdb =~ /^([\w\-]+)$/ or do {
+ $dbh->rollback if $oldAutoCommit;
+ return "Illegal svcdb value in part_svc!";
+ };
+ my $svcdb = $1;
+ require "FS/$svcdb.pm";
+
+ my $svc = $self->svc_x;
+ if ($svc) {
+ my $error = $svc->cancel;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error canceling service: $error";
+ }
+ $error = $svc->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error deleting service: $error";
+ }
+ }
+
+ my $error = $self->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Error deleting cust_svc: $error";
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ ''; #no errors
+
+}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $new->SUPER::replace($old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error if $error;
+ }
+
+ if ( $new->svcpart != $old->svcpart ) {
+ my $svc_x = $new->svc_x;
+ my $new_svc_x = ref($svc_x)->new({$svc_x->hash});
+ my $error = $new_svc_x->replace($svc_x);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error if $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+
+}
+
+=item check
+
+Checks all fields to make sure this is a valid service. If there is an error,
+returns the error, otehrwise returns false. Called by the insert and
+replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('svcnum')
+ || $self->ut_numbern('pkgnum')
+ || $self->ut_number('svcpart')
+ ;
+ return $error if $error;
+
+ my $part_svc = qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
+ return "Unknown svcpart" unless $part_svc;
+
+ if ( $self->pkgnum ) {
+ my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
+ return "Unknown pkgnum" unless $cust_pkg;
+ my $pkg_svc = qsearchs( 'pkg_svc', {
+ 'pkgpart' => $cust_pkg->pkgpart,
+ 'svcpart' => $self->svcpart,
+ });
+ # or new FS::pkg_svc ( { 'pkgpart' => $cust_pkg->pkgpart,
+ # 'svcpart' => $self->svcpart,
+ # 'quantity' => 0 } );
+ my $quantity = $pkg_svc ? $pkg_svc->quantity : 0;
+
+ my @cust_svc = qsearch('cust_svc', {
+ 'pkgnum' => $self->pkgnum,
+ 'svcpart' => $self->svcpart,
+ });
+ return "Already ". scalar(@cust_svc). " ". $part_svc->svc.
+ " services for pkgnum ". $self->pkgnum
+ if scalar(@cust_svc) >= $quantity && (!$ignore_quantity || !$quantity);
+ }
+
+ ''; #no error
+}
+
+=item part_svc
+
+Returns the definition for this service, as a FS::part_svc object (see
+L<FS::part_svc>).
+
+=cut
+
+sub part_svc {
+ my $self = shift;
+ $self->{'_svcpart'}
+ ? $self->{'_svcpart'}
+ : qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
+}
+
+=item cust_pkg
+
+Returns the definition for this service, as a FS::part_svc object (see
+L<FS::part_svc>).
+
+=cut
+
+sub cust_pkg {
+ my $self = shift;
+ qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
+}
+
+=item label
+
+Returns a list consisting of:
+- The name of this service (from part_svc)
+- A meaningful identifier (username, domain, or mail alias)
+- The table name (i.e. svc_domain) for this service
+
+=cut
+
+sub label {
+ my $self = shift;
+ my $svcdb = $self->part_svc->svcdb;
+ my $svc_x = $self->svc_x
+ or die "can't find $svcdb.svcnum ". $self->svcnum;
+ my $tag;
+ if ( $svcdb eq 'svc_acct' ) {
+ $tag = $svc_x->email;
+ } elsif ( $svcdb eq 'svc_forward' ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_x->srcsvc } );
+ $tag = $svc_acct->email. '->';
+ if ( $svc_x->dstsvc ) {
+ $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_x->dstsvc } );
+ $tag .= $svc_acct->email;
+ } else {
+ $tag .= $svc_x->dst;
+ }
+ } elsif ( $svcdb eq 'svc_domain' ) {
+ $tag = $svc_x->getfield('domain');
+ } elsif ( $svcdb eq 'svc_www' ) {
+ my $domain = qsearchs( 'domain_record', { 'recnum' => $svc_x->recnum } );
+ $tag = $domain->zone;
+ } elsif ( $svcdb eq 'svc_broadband' ) {
+ $tag = $svc_x->ip_addr;
+ } else {
+ cluck "warning: asked for label of unsupported svcdb; using svcnum";
+ $tag = $svc_x->getfield('svcnum');
+ }
+ $self->part_svc->svc, $tag, $svcdb;
+}
+
+=item svc_x
+
+Returns the FS::svc_XXX object for this service (i.e. an FS::svc_acct object or
+FS::svc_domain object, etc.)
+
+=cut
+
+sub svc_x {
+ my $self = shift;
+ my $svcdb = $self->part_svc->svcdb;
+ if ( $svcdb eq 'svc_acct' && $self->{'_svc_acct'} ) {
+ $self->{'_svc_acct'};
+ } else {
+ qsearchs( $svcdb, { 'svcnum' => $self->svcnum } );
+ }
+}
+
+=item seconds_since TIMESTAMP
+
+See L<FS::svc_acct/seconds_since>. Equivalent to
+$cust_svc->svc_x->seconds_since, but more efficient. Meaningless for records
+where B<svcdb> is not "svc_acct".
+
+=cut
+
+#note: implementation here, POD in FS::svc_acct
+sub seconds_since {
+ my($self, $since) = @_;
+ my $dbh = dbh;
+ my $sth = $dbh->prepare(' SELECT SUM(logout-login) FROM session
+ WHERE svcnum = ?
+ AND login >= ?
+ AND logout IS NOT NULL'
+ ) or die $dbh->errstr;
+ $sth->execute($self->svcnum, $since) or die $sth->errstr;
+ $sth->fetchrow_arrayref->[0];
+}
+
+=item seconds_since_sqlradacct TIMESTAMP_START TIMESTAMP_END
+
+See L<FS::svc_acct/seconds_since_sqlradacct>. Equivalent to
+$cust_svc->svc_x->seconds_since_sqlradacct, but more efficient. Meaningless
+for records where B<svcdb> is not "svc_acct".
+
+=cut
+
+#note: implementation here, POD in FS::svc_acct
+sub seconds_since_sqlradacct {
+ my($self, $start, $end) = @_;
+
+ my $username = $self->svc_x->username;
+
+ my @part_export = $self->part_svc->part_export('sqlradius')
+ or die "no sqlradius export configured for this service type";
+ #or return undef;
+
+ my $seconds = 0;
+ foreach my $part_export ( @part_export ) {
+
+ my $dbh = DBI->connect( map { $part_export->option($_) }
+ qw(datasrc username password) )
+ or die "can't connect to sqlradius database: ". $DBI::errstr;
+
+ #select a unix time conversion function based on database type
+ my $str2time;
+ if ( $dbh->{Driver}->{Name} eq 'mysql' ) {
+ $str2time = 'UNIX_TIMESTAMP(';
+ } elsif ( $dbh->{Driver}->{Name} eq 'Pg' ) {
+ $str2time = 'EXTRACT( EPOCH FROM ';
+ } else {
+ warn "warning: unknown database type ". $dbh->{Driver}->{Name}.
+ "; guessing how to convert to UNIX timestamps";
+ $str2time = 'extract(epoch from ';
+ }
+
+ my $query;
+
+ #find closed sessions completely within the given range
+ my $sth = $dbh->prepare("SELECT SUM(acctsessiontime)
+ FROM radacct
+ WHERE UserName = ?
+ AND $str2time AcctStartTime) >= ?
+ AND $str2time AcctStopTime ) < ?
+ AND $str2time AcctStopTime ) > 0
+ AND AcctStopTime IS NOT NULL"
+ ) or die $dbh->errstr;
+ $sth->execute($username, $start, $end) or die $sth->errstr;
+ my $regular = $sth->fetchrow_arrayref->[0];
+
+ #find open sessions which start in the range, count session start->range end
+ $query = "SELECT SUM( ? - $str2time AcctStartTime ) )
+ FROM radacct
+ WHERE UserName = ?
+ AND $str2time AcctStartTime ) >= ?
+ AND $str2time AcctStartTime ) < ?
+ AND ( ? - $str2time AcctStartTime ) ) < 86400
+ AND ( $str2time AcctStopTime ) = 0
+ OR AcctStopTime IS NULL )";
+ $sth = $dbh->prepare($query) or die $dbh->errstr;
+ $sth->execute($end, $username, $start, $end, $end)
+ or die $sth->errstr. " executing query $query";
+ my $start_during = $sth->fetchrow_arrayref->[0];
+
+ #find closed sessions which start before the range but stop during,
+ #count range start->session end
+ $sth = $dbh->prepare("SELECT SUM( $str2time AcctStopTime ) - ? )
+ FROM radacct
+ WHERE UserName = ?
+ AND $str2time AcctStartTime ) < ?
+ AND $str2time AcctStopTime ) >= ?
+ AND $str2time AcctStopTime ) < ?
+ AND $str2time AcctStopTime ) > 0
+ AND AcctStopTime IS NOT NULL"
+ ) or die $dbh->errstr;
+ $sth->execute($start, $username, $start, $start, $end ) or die $sth->errstr;
+ my $end_during = $sth->fetchrow_arrayref->[0];
+
+ #find closed (not anymore - or open) sessions which start before the range
+ # but stop after, or are still open, count range start->range end
+ # don't count open sessions (probably missing stop record)
+ $sth = $dbh->prepare("SELECT COUNT(*)
+ FROM radacct
+ WHERE UserName = ?
+ AND $str2time AcctStartTime ) < ?
+ AND ( $str2time AcctStopTime ) >= ?
+ )"
+ # OR AcctStopTime = 0
+ # OR AcctStopTime IS NULL )"
+ ) or die $dbh->errstr;
+ $sth->execute($username, $start, $end ) or die $sth->errstr;
+ my $entire_range = ($end-$start) * $sth->fetchrow_arrayref->[0];
+
+ $seconds += $regular + $end_during + $start_during + $entire_range;
+
+ }
+
+ $seconds;
+
+}
+
+=item attribute_since_sqlradacct TIMESTAMP_START TIMESTAMP_END ATTRIBUTE
+
+See L<FS::svc_acct/attribute_since_sqlradacct>. Equivalent to
+$cust_svc->svc_x->attribute_since_sqlradacct, but more efficient. Meaningless
+for records where B<svcdb> is not "svc_acct".
+
+=cut
+
+#note: implementation here, POD in FS::svc_acct
+#(false laziness w/seconds_since_sqlradacct above)
+sub attribute_since_sqlradacct {
+ my($self, $start, $end, $attrib) = @_;
+
+ my $username = $self->svc_x->username;
+
+ my @part_export = $self->part_svc->part_export('sqlradius')
+ or die "no sqlradius export configured for this service type";
+ #or return undef;
+
+ my $sum = 0;
+
+ foreach my $part_export ( @part_export ) {
+
+ my $dbh = DBI->connect( map { $part_export->option($_) }
+ qw(datasrc username password) )
+ or die "can't connect to sqlradius database: ". $DBI::errstr;
+
+ #select a unix time conversion function based on database type
+ my $str2time;
+ if ( $dbh->{Driver}->{Name} eq 'mysql' ) {
+ $str2time = 'UNIX_TIMESTAMP(';
+ } elsif ( $dbh->{Driver}->{Name} eq 'Pg' ) {
+ $str2time = 'EXTRACT( EPOCH FROM ';
+ } else {
+ warn "warning: unknown database type ". $dbh->{Driver}->{Name}.
+ "; guessing how to convert to UNIX timestamps";
+ $str2time = 'extract(epoch from ';
+ }
+
+ my $sth = $dbh->prepare("SELECT SUM($attrib)
+ FROM radacct
+ WHERE UserName = ?
+ AND $str2time AcctStopTime ) >= ?
+ AND $str2time AcctStopTime ) < ?
+ AND AcctStopTime IS NOT NULL"
+ ) or die $dbh->errstr;
+ $sth->execute($username, $start, $end) or die $sth->errstr;
+
+ $sum += $sth->fetchrow_arrayref->[0];
+
+ }
+
+ $sum;
+
+}
+
+=back
+
+=head1 BUGS
+
+Behaviour of changing the svcpart of cust_svc records is undefined and should
+possibly be prohibited, and pkg_svc records are not checked.
+
+pkg_svc records are not checked in general (here).
+
+Deleting this record doesn't check or delete the svc_* record associated
+with this record.
+
+In seconds_since_sqlradacct, specifying a DATASRC/USERNAME/PASSWORD instead of
+a DBI database handle is not yet implemented.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_pkg>, L<FS::part_svc>, L<FS::pkg_svc>,
+schema.html from the base documentation
+
+=cut
+
+1;
+
diff --git a/FS/FS/cust_tax_exempt.pm b/FS/FS/cust_tax_exempt.pm
new file mode 100644
index 000000000..ab873c0a7
--- /dev/null
+++ b/FS/FS/cust_tax_exempt.pm
@@ -0,0 +1,131 @@
+package FS::cust_tax_exempt;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::cust_tax_exempt - Object methods for cust_tax_exempt records
+
+=head1 SYNOPSIS
+
+ use FS::cust_tax_exempt;
+
+ $record = new FS::cust_tax_exempt \%hash;
+ $record = new FS::cust_tax_exempt { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::cust_tax_exempt object represents a historical record of a customer tax
+exemption. Currently this is only used for "texas tax". FS::cust_tax_exempt
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item exemptnum - primary key
+
+=item custnum - customer (see L<FS::cust_main>)
+
+=item taxnum - tax rate (see L<FS::cust_main_county>)
+
+=item year
+
+=item month
+
+=item amount
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new exemption record. To add the example to the database, see
+L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'cust_tax_exempt'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('exemptnum')
+ || $self->ut_foreign_key('custnum', 'cust_main', 'custnum')
+ || $self->ut_foreign_key('taxnum', 'cust_main_county', 'taxnum')
+ || $self->ut_number('year') #check better
+ || $self->ut_number('month') #check better
+ || $self->ut_money('amount')
+ ;
+}
+
+=back
+
+=head1 BUGS
+
+Texas tax is a royal pain in the ass.
+
+=head1 SEE ALSO
+
+L<FS::cust_main_county>, L<FS::cust_main>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm
new file mode 100644
index 000000000..77b955088
--- /dev/null
+++ b/FS/FS/domain_record.pm
@@ -0,0 +1,351 @@
+package FS::domain_record;
+
+use strict;
+use vars qw( @ISA $noserial_hack );
+#use FS::Record qw( qsearch qsearchs );
+use FS::Record qw( qsearchs dbh );
+use FS::svc_domain;
+use FS::svc_www;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::domain_record - Object methods for domain_record records
+
+=head1 SYNOPSIS
+
+ use FS::domain_record;
+
+ $record = new FS::domain_record \%hash;
+ $record = new FS::domain_record { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::domain_record object represents an entry in a DNS zone.
+FS::domain_record inherits from FS::Record. The following fields are currently
+supported:
+
+=over 4
+
+=item recnum - primary key
+
+=item svcnum - Domain (see L<FS::svc_domain>) of this entry
+
+=item reczone - partial (or full) zone for this entry
+
+=item recaf - address family for this entry, currently only `IN' is recognized.
+
+=item rectype - record type for this entry (A, MX, etc.)
+
+=item recdata - data for this entry
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new entry. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'domain_record'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ if ( $self->rectype eq '_mstr' ) { #delete all other records
+ foreach my $domain_record ( reverse $self->svc_domain->domain_record ) {
+ my $error = $domain_record->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ unless ( $self->rectype =~ /^(SOA|_mstr)$/ ) {
+ my $error = $self->increment_serial;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ return "Can't delete a domain record which has a website!"
+ if qsearchs( 'svc_www', { 'recnum' => $self->recnum } );
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ unless ( $self->rectype =~ /^(SOA|_mstr)$/ ) {
+ my $error = $self->increment_serial;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::replace(@_);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ unless ( $self->rectype eq 'SOA' ) {
+ my $error = $self->increment_serial;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('recnum')
+ || $self->ut_number('svcnum')
+ ;
+ return $error if $error;
+
+ return "Unknown svcnum (in svc_domain)"
+ unless qsearchs('svc_domain', { 'svcnum' => $self->svcnum } );
+
+ $self->reczone =~ /^(@|[a-z0-9\.\-\*]+)$/i
+ or return "Illegal reczone: ". $self->reczone;
+ $self->reczone($1);
+
+ $self->recaf =~ /^(IN)$/ or return "Illegal recaf: ". $self->recaf;
+ $self->recaf($1);
+
+ $self->rectype =~ /^(SOA|NS|MX|A|PTR|CNAME|_mstr)$/
+ or return "Illegal rectype (only SOA NS MX A PTR CNAME recognized): ".
+ $self->rectype;
+ $self->rectype($1);
+
+ return "Illegal reczone for ". $self->rectype. ": ". $self->reczone
+ if $self->rectype !~ /^MX$/i && $self->reczone =~ /\*/;
+
+ if ( $self->rectype eq 'SOA' ) {
+ my $recdata = $self->recdata;
+ $recdata =~ s/\s+/ /g;
+ $recdata =~ /^([a-z0-9\.\-]+ [\w\-\+]+\.[a-z0-9\.\-]+ \( ((\d+|((\d+[WDHMS])+)) ){5}\))$/i
+ or return "Illegal data for SOA record: $recdata";
+ $self->recdata($1);
+ } elsif ( $self->rectype eq 'NS' ) {
+ $self->recdata =~ /^([a-z0-9\.\-]+)$/i
+ or return "Illegal data for NS record: ". $self->recdata;
+ $self->recdata($1);
+ } elsif ( $self->rectype eq 'MX' ) {
+ $self->recdata =~ /^(\d+)\s+([a-z0-9\.\-]+)$/i
+ or return "Illegal data for MX record: ". $self->recdata;
+ $self->recdata("$1 $2");
+ } elsif ( $self->rectype eq 'A' ) {
+ $self->recdata =~ /^((\d{1,3}\.){3}\d{1,3})$/
+ or return "Illegal data for A record: ". $self->recdata;
+ $self->recdata($1);
+ } elsif ( $self->rectype eq 'PTR' ) {
+ $self->recdata =~ /^([a-z0-9\.\-]+)$/i
+ or return "Illegal data for PTR record: ". $self->recdata;
+ $self->recdata($1);
+ } elsif ( $self->rectype eq 'CNAME' ) {
+ $self->recdata =~ /^([a-z0-9\.\-]+|\@)$/i
+ or return "Illegal data for CNAME record: ". $self->recdata;
+ $self->recdata($1);
+ } elsif ( $self->rectype eq '_mstr' ) {
+ $self->recdata =~ /^((\d{1,3}\.){3}\d{1,3})$/
+ or return "Illegal data for _master pseudo-record: ". $self->recdata;
+ } else {
+ die "ack!";
+ }
+
+ ''; #no error
+}
+
+=item increment_serial
+
+=cut
+
+sub increment_serial {
+ return '' if $noserial_hack;
+ my $self = shift;
+
+ my $soa = qsearchs('domain_record', {
+ svcnum => $self->svcnum,
+ reczone => '@', #or full domain ?
+ recaf => 'IN',
+ rectype => 'SOA',
+ } ) or return "soa record not found; can't increment serial";
+
+ my $data = $soa->recdata;
+ $data =~ s/(\(\D*)(\d+)/$1.($2+1)/e; #well, it works.
+
+ my %hash = $soa->hash;
+ $hash{recdata} = $data;
+ my $new = new FS::domain_record \%hash;
+ $new->replace($soa);
+}
+
+=item svc_domain
+
+Returns the domain (see L<FS::svc_domain>) for this record.
+
+=cut
+
+sub svc_domain {
+ my $self = shift;
+ qsearchs('svc_domain', { svcnum => $self->svcnum } );
+}
+
+=item zone
+
+Returns the canonical zone name.
+
+=cut
+
+sub zone {
+ my $self = shift;
+ my $zone = $self->reczone; # or die ?
+ if ( $zone =~ /\.$/ ) {
+ $zone =~ s/\.$//;
+ } else {
+ my $svc_domain = $self->svc_domain; # or die ?
+ $zone .= '.'. $svc_domain->domain;
+ $zone =~ s/^\@\.//;
+ }
+ $zone;
+}
+
+=back
+
+=head1 VERSION
+
+$Id: domain_record.pm,v 1.15 2003-04-29 18:28:50 khoff Exp $
+
+=head1 BUGS
+
+The data validation doesn't check everything it could. In particular,
+there is no protection against bad data that passes the regex, duplicate
+SOA records, forgetting the trailing `.', impossible IP addersses, etc. Of
+course, it's still better than editing the zone files directly. :)
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/export_svc.pm b/FS/FS/export_svc.pm
new file mode 100644
index 000000000..da9ac698a
--- /dev/null
+++ b/FS/FS/export_svc.pm
@@ -0,0 +1,123 @@
+package FS::export_svc;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::part_export;
+use FS::part_svc;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::export_svc - Object methods for export_svc records
+
+=head1 SYNOPSIS
+
+ use FS::export_svc;
+
+ $record = new FS::export_svc \%hash;
+ $record = new FS::export_svc { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::export_svc object links a service definition (see L<FS::part_svc>) to
+an export (see L<FS::part_export>). FS::export_svc inherits from FS::Record.
+The following fields are currently supported:
+
+=over 4
+
+=item exportsvcnum - primary key
+
+=item exportnum - export (see L<FS::part_export>)
+
+=item svcpart - service definition (see L<FS::part_svc>)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new record. To add the record to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'export_svc'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('exportsvcnum')
+ || $self->ut_number('exportnum')
+ || $self->ut_foreign_key('exportnum', 'part_export', 'exportnum')
+ || $self->ut_number('svcpart')
+ || $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
+ ;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::part_export>, L<FS::part_svc>, L<FS::Record>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/msgcat.pm b/FS/FS/msgcat.pm
new file mode 100644
index 000000000..fa10d34fa
--- /dev/null
+++ b/FS/FS/msgcat.pm
@@ -0,0 +1,132 @@
+package FS::msgcat;
+
+use strict;
+use vars qw( @ISA );
+use Exporter;
+use FS::UID;
+use FS::Record qw( qsearchs );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::msgcat - Object methods for message catalog entries
+
+=head1 SYNOPSIS
+
+ use FS::msgcat;
+
+ $record = new FS::msgcat \%hash;
+ $record = new FS::msgcat { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::msgcat object represents an message catalog entry. FS::msgcat inherits
+from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item msgnum - primary key
+
+=item msgcode - Error code
+
+=item locale - Locale
+
+=item msg - Message
+
+=back
+
+If you just want to B<use> message catalogs, see L<FS::Msgcat>.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new example. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'msgcat'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('msgnum')
+ || $self->ut_text('msgcode')
+ || $self->ut_text('msg')
+ ;
+ return $error if $error;
+
+ $self->locale =~ /^([\w\@]+)$/ or return "illegal locale: ". $self->locale;
+ $self->locale($1);
+
+ ''; #no error
+}
+
+=back
+
+=head1 BUGS
+
+i18n/l10n, eek
+
+=head1 SEE ALSO
+
+L<FS::Msgcat>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/nas.pm b/FS/FS/nas.pm
new file mode 100644
index 000000000..58c6827ea
--- /dev/null
+++ b/FS/FS/nas.pm
@@ -0,0 +1,152 @@
+package FS::nas;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw(qsearchs); #qsearch);
+use FS::UID qw( dbh );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::nas - Object methods for nas records
+
+=head1 SYNOPSIS
+
+ use FS::nas;
+
+ $record = new FS::nas \%hash;
+ $record = new FS::nas {
+ 'nasnum' => 1,
+ 'nasip' => '10.4.20.23',
+ 'nasfqdn' => 'box1.brc.nv.us.example.net',
+ };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->heartbeat($timestamp);
+
+=head1 DESCRIPTION
+
+An FS::nas object represents an Network Access Server on your network, such as
+a terminal server or equivalent. FS::nas inherits from FS::Record. The
+following fields are currently supported:
+
+=over 4
+
+=item nasnum - primary key
+
+=item nas - NAS name
+
+=item nasip - NAS ip address
+
+=item nasfqdn - NAS fully-qualified domain name
+
+=item last - timestamp indicating the last instant the NAS was in a known
+ state (used by the session monitoring).
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new NAS. To add the NAS to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'nas'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('nasnum')
+ || $self->ut_text('nas')
+ || $self->ut_ip('nasip')
+ || $self->ut_domain('nasfqdn')
+ || $self->ut_numbern('last');
+}
+
+=item heartbeat TIMESTAMP
+
+Updates the timestamp for this nas
+
+=cut
+
+sub heartbeat {
+ my($self, $timestamp) = @_;
+ my $dbh = dbh;
+ my $sth =
+ $dbh->prepare("UPDATE nas SET last = ? WHERE nasnum = ? AND last < ?");
+ $sth->execute($timestamp, $self->nasnum, $timestamp) or die $sth->errstr;
+ $self->last($timestamp);
+}
+
+=back
+
+=head1 VERSION
+
+$Id: nas.pm,v 1.6 2002-03-04 12:48:49 ivan Exp $
+
+=head1 BUGS
+
+heartbeat method uses SQL directly and doesn't update history tables.
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm
new file mode 100644
index 000000000..e0e4f3f19
--- /dev/null
+++ b/FS/FS/part_bill_event.pm
@@ -0,0 +1,183 @@
+package FS::part_bill_event;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::Conf;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::part_bill_event - Object methods for part_bill_event records
+
+=head1 SYNOPSIS
+
+ use FS::part_bill_event;
+
+ $record = new FS::part_bill_event \%hash;
+ $record = new FS::part_bill_event { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_bill_event object represents an invoice event definition -
+a callback which is triggered when an invoice is a certain amount of time
+overdue. FS::part_bill_event inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item eventpart - primary key
+
+=item payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
+
+=item event - event name
+
+=item eventcode - event action
+
+=item seconds - how long after the invoice date events of this type are triggered
+
+=item weight - ordering for events with identical seconds
+
+=item plan - eventcode plan
+
+=item plandata - additional plan data
+
+=item disabled - Disabled flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new invoice event definition. To add the example to the database,
+see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'part_bill_event'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid invoice event definition. If
+there is an error, returns the error, otherwise returns false. Called by the
+insert and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ $self->weight(0) unless $self->weight;
+
+ my $conf = new FS::Conf;
+ if ( $conf->exists('safe-part_bill_event') ) {
+ my $error = $self->ut_anything('eventcode');
+ return $error if $error;
+
+ my $c = $self->eventcode;
+
+ $c =~ /^\s*\$cust_main\->(suspend|cancel|invoicing_list_addpost|bill|collect)\(\);\s*("";)?\s*$/
+
+ or $c =~ /^\s*\$cust_bill\->(comp|realtime_(card|ach|lec)|realtime_card_cybercash|batch_card|send)\(\);\s*$/
+
+ or $c =~ /^\s*\$cust_bill\->send\(\'\w+\'\);\s*$/
+
+ or $c =~ /^\s*\$cust_main\->apply_payments; \$cust_main->apply_credits; "";\s*$/
+
+ or $c =~ /^\s*\$cust_main\->charge\( \s*\d*\.?\d*\s*,\s*\'[\w \!\@\#\$\%\&\(\)\-\+\;\:\"\,\.\?\/]*\'\s*\);\s*$/
+
+ or do {
+ #log
+ return "illegal eventcode: $c";
+ };
+
+ }
+
+ my $error = $self->ut_numbern('eventpart')
+ || $self->ut_enum('payby', [qw( CARD DCRD CHEK DCHK LECB BILL COMP )] )
+ || $self->ut_text('event')
+ || $self->ut_anything('eventcode')
+ || $self->ut_number('seconds')
+ || $self->ut_enum('disabled', [ '', 'Y' ] )
+ || $self->ut_number('weight')
+ || $self->ut_textn('plan')
+ || $self->ut_anything('plandata')
+ ;
+ return $error if $error;
+
+ #quelle kludge
+ if ( $self->plandata =~ /^templatename\s+(.*)$/ ) {
+ my $name= $1;
+ unless ( $conf->exists("invoice_template_$name") ) {
+ $conf->set(
+ "invoice_template_$name" =>
+ join("\n", $conf->config('invoice_template') )
+ );
+ }
+ }
+
+ '';
+
+}
+
+=back
+
+=head1 BUGS
+
+Alas.
+
+=head1 SEE ALSO
+
+L<FS::cust_bill>, L<FS::cust_bill_event>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm
new file mode 100644
index 000000000..ff519969d
--- /dev/null
+++ b/FS/FS/part_export.pm
@@ -0,0 +1,1045 @@
+package FS::part_export;
+
+use strict;
+use vars qw( @ISA @EXPORT_OK %exports );
+use Exporter;
+use Tie::IxHash;
+use FS::Record qw( qsearch qsearchs dbh );
+use FS::part_svc;
+use FS::part_export_option;
+use FS::export_svc;
+
+@ISA = qw(FS::Record);
+@EXPORT_OK = qw(export_info);
+
+=head1 NAME
+
+FS::part_export - Object methods for part_export records
+
+=head1 SYNOPSIS
+
+ use FS::part_export;
+
+ $record = new FS::part_export \%hash;
+ $record = new FS::part_export { 'column' => 'value' };
+
+ #($new_record, $options) = $template_recored->clone( $svcpart );
+
+ $error = $record->insert( { 'option' => 'value' } );
+ $error = $record->insert( \%options );
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_export object represents an export of Freeside data to an external
+provisioning system. FS::part_export inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item exportnum - primary key
+
+=item machine - Machine name
+
+=item exporttype - Export type
+
+=item nodomain - blank or "Y" : usernames are exported to this service with no domain
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new export. To add the export to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'part_export'; }
+
+=cut
+
+#=item clone SVCPART
+#
+#An alternate constructor. Creates a new export by duplicating an existing
+#export. The given svcpart is assigned to the new export.
+#
+#Returns a list consisting of the new export object and a hashref of options.
+#
+#=cut
+#
+#sub clone {
+# my $self = shift;
+# my $class = ref($self);
+# my %hash = $self->hash;
+# $hash{'exportnum'} = '';
+# $hash{'svcpart'} = shift;
+# ( $class->new( \%hash ),
+# { map { $_->optionname => $_->optionvalue }
+# qsearch('part_export_option', { 'exportnum' => $self->exportnum } )
+# }
+# );
+#}
+
+=item insert HASHREF
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+If a hash reference of options is supplied, part_export_option records are
+created (see L<FS::part_export_option>).
+
+=cut
+
+#false laziness w/queue.pm
+sub insert {
+ my $self = shift;
+ my $options = shift;
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ foreach my $optionname ( keys %{$options} ) {
+ my $part_export_option = new FS::part_export_option ( {
+ 'exportnum' => $self->exportnum,
+ 'optionname' => $optionname,
+ 'optionvalue' => $options->{$optionname},
+ } );
+ $error = $part_export_option->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+#foreign keys would make this much less tedious... grr dumb mysql
+sub delete {
+ my $self = shift;
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ foreach my $part_export_option ( $self->part_export_option ) {
+ my $error = $part_export_option->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ foreach my $export_svc ( $self->export_svc ) {
+ my $error = $export_svc->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item replace OLD_RECORD HASHREF
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+If a hash reference of options is supplied, part_export_option records are
+created or modified (see L<FS::part_export_option>).
+
+=cut
+
+sub replace {
+ my $self = shift;
+ my $old = shift;
+ my $options = shift;
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::replace($old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ foreach my $optionname ( keys %{$options} ) {
+ my $old = qsearchs( 'part_export_option', {
+ 'exportnum' => $self->exportnum,
+ 'optionname' => $optionname,
+ } );
+ my $new = new FS::part_export_option ( {
+ 'exportnum' => $self->exportnum,
+ 'optionname' => $optionname,
+ 'optionvalue' => $options->{$optionname},
+ } );
+ $new->optionnum($old->optionnum) if $old;
+ my $error = $old ? $new->replace($old) : $new->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ #remove extraneous old options
+ foreach my $opt (
+ grep { !exists $options->{$_->optionname} } $old->part_export_option
+ ) {
+ my $error = $opt->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+};
+
+=item check
+
+Checks all fields to make sure this is a valid export. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_numbern('exportnum')
+ || $self->ut_domain('machine')
+ || $self->ut_alpha('exporttype')
+ ;
+ return $error if $error;
+
+ $self->machine =~ /^([\w\-\.]*)$/
+ or return "Illegal machine: ". $self->machine;
+ $self->machine($1);
+
+ $self->nodomain =~ /^(Y?)$/ or return "Illegal nodomain: ". $self->nodomain;
+ $self->nodomain($1);
+
+ $self->deprecated(1); #BLAH
+
+ #check exporttype?
+
+ ''; #no error
+}
+
+#=item part_svc
+#
+#Returns the service definition (see L<FS::part_svc>) for this export.
+#
+#=cut
+#
+#sub part_svc {
+# my $self = shift;
+# qsearchs('part_svc', { svcpart => $self->svcpart } );
+#}
+
+sub part_svc {
+ use Carp;
+ croak "FS::part_export::part_svc deprecated";
+ #confess "FS::part_export::part_svc deprecated";
+}
+
+=item svc_x
+
+Returns a list of associated FS::svc_* records.
+
+=cut
+
+sub svc_x {
+ my $self = shift;
+ map { $_->svc_x } $self->cust_svc;
+}
+
+=item cust_svc
+
+Returns a list of associated FS::cust_svc records.
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ $self->export_svc;
+}
+
+=item export_svc
+
+Returns a list of associated FS::export_svc records.
+
+=cut
+
+sub export_svc {
+ my $self = shift;
+ qsearch('export_svc', { 'exportnum' => $self->exportnum } );
+}
+
+=item part_export_option
+
+Returns all options as FS::part_export_option objects (see
+L<FS::part_export_option>).
+
+=cut
+
+sub part_export_option {
+ my $self = shift;
+ qsearch('part_export_option', { 'exportnum' => $self->exportnum } );
+}
+
+=item options
+
+Returns a list of option names and values suitable for assigning to a hash.
+
+=cut
+
+sub options {
+ my $self = shift;
+ map { $_->optionname => $_->optionvalue } $self->part_export_option;
+}
+
+=item option OPTIONNAME
+
+Returns the option value for the given name, or the empty string.
+
+=cut
+
+sub option {
+ my $self = shift;
+ my $part_export_option =
+ qsearchs('part_export_option', {
+ exportnum => $self->exportnum,
+ optionname => shift,
+ } );
+ $part_export_option ? $part_export_option->optionvalue : '';
+}
+
+=item rebless
+
+Reblesses the object into the FS::part_export::EXPORTTYPE class, where
+EXPORTTYPE is the object's I<exporttype> field. There should be better docs
+on how to create new exports (and they should live in their own files and be
+autoloaded-on-demand), but until then, see L</NEW EXPORT CLASSES>.
+
+=cut
+
+sub rebless {
+ my $self = shift;
+ my $exporttype = $self->exporttype;
+ my $class = ref($self). "::$exporttype";
+ eval "use $class;";
+ die $@ if $@;
+ bless($self, $class);
+}
+
+=item export_insert SVC_OBJECT
+
+=cut
+
+sub export_insert {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_insert(@_);
+}
+
+#sub AUTOLOAD {
+# my $self = shift;
+# $self->rebless;
+# my $method = $AUTOLOAD;
+# #$method =~ s/::(\w+)$/::_$1/; #infinite loop prevention
+# $method =~ s/::(\w+)$/_$1/; #infinite loop prevention
+# $self->$method(@_);
+#}
+
+=item export_replace NEW OLD
+
+=cut
+
+sub export_replace {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_replace(@_);
+}
+
+=item export_delete
+
+=cut
+
+sub export_delete {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_delete(@_);
+}
+
+=item export_suspend
+
+=cut
+
+sub export_suspend {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_suspend(@_);
+}
+
+=item export_unsuspend
+
+=cut
+
+sub export_unsuspend {
+ my $self = shift;
+ $self->rebless;
+ $self->_export_unsuspend(@_);
+}
+
+#fallbacks providing useful error messages intead of infinite loops
+sub _export_insert {
+ my $self = shift;
+ return "_export_insert: unknown export type ". $self->exporttype;
+}
+
+sub _export_replace {
+ my $self = shift;
+ return "_export_replace: unknown export type ". $self->exporttype;
+}
+
+sub _export_delete {
+ my $self = shift;
+ return "_export_delete: unknown export type ". $self->exporttype;
+}
+
+#fallbacks providing null operations
+
+sub _export_suspend {
+ my $self = shift;
+ #warn "warning: _export_suspened unimplemented for". ref($self);
+ '';
+}
+
+sub _export_unsuspend {
+ my $self = shift;
+ #warn "warning: _export_unsuspend unimplemented for ". ref($self);
+ '';
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item export_info [ SVCDB ]
+
+Returns a hash reference of the exports for the given I<svcdb>, or if no
+I<svcdb> is specified, for all exports. The keys of the hash are
+I<exporttype>s and the values are again hash references containing information
+on the export:
+
+ 'desc' => 'Description',
+ 'options' => {
+ 'option' => { label=>'Option Label' },
+ 'option2' => { label=>'Another label' },
+ },
+ 'nodomain' => 'Y', #or ''
+ 'notes' => 'Additional notes',
+
+=cut
+
+sub export_info {
+ #warn $_[0];
+ return $exports{$_[0]} if @_;
+ #{ map { %{$exports{$_}} } keys %exports };
+ my $r = { map { %{$exports{$_}} } keys %exports };
+}
+
+#=item exporttype2svcdb EXPORTTYPE
+#
+#Returns the applicable I<svcdb> for an I<exporttype>.
+#
+#=cut
+#
+#sub exporttype2svcdb {
+# my $exporttype = $_[0];
+# foreach my $svcdb ( keys %exports ) {
+# return $svcdb if grep { $exporttype eq $_ } keys %{$exports{$svcdb}};
+# }
+# '';
+#}
+
+tie my %sysvshell_options, 'Tie::IxHash',
+ 'crypt' => { label=>'Password encryption',
+ type=>'select', options=>[qw(crypt md5)],
+ default=>'crypt',
+ },
+;
+
+tie my %bsdshell_options, 'Tie::IxHash',
+ 'crypt' => { label=>'Password encryption',
+ type=>'select', options=>[qw(crypt md5)],
+ default=>'crypt',
+ },
+;
+
+tie my %shellcommands_options, 'Tie::IxHash',
+ #'machine' => { label=>'Remote machine' },
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ default=>'useradd -c $finger -d $dir -m -s $shell -u $uid -p $crypt_password $username'
+ #default=>'cp -pr /etc/skel $dir; chown -R $uid.$gid $dir'
+ },
+ 'useradd_stdin' => { label=>'Insert command STDIN',
+ type =>'textarea',
+ default=>'',
+ },
+ 'userdel' => { label=>'Delete command',
+ default=>'userdel -r $username',
+ #default=>'rm -rf $dir',
+ },
+ 'userdel_stdin' => { label=>'Delete command STDIN',
+ type =>'textarea',
+ default=>'',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -p $new_crypt_password $old_username',
+ #default=>'[ -d $old_dir ] && mv $old_dir $new_dir || ( '.
+ # 'chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; '.
+ # 'find . -depth -print | cpio -pdm $new_dir; '.
+ # 'chmod u-t $new_dir; chown -R $uid.$gid $new_dir; '.
+ # 'rm -rf $old_dir'.
+ #')'
+ },
+ 'usermod_stdin' => { label=>'Modify command STDIN',
+ type =>'textarea',
+ default=>'',
+ },
+ 'usermod_pwonly' => { label=>'Disallow username changes',
+ type =>'checkbox',
+ },
+ 'suspend' => { label=>'Suspension command',
+ default=>'',
+ },
+ 'suspend_stdin' => { label=>'Suspension command STDIN',
+ default=>'',
+ },
+ 'unsuspend' => { label=>'Unsuspension command',
+ default=>'',
+ },
+ 'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
+ default=>'',
+ },
+;
+
+tie my %shellcommands_withdomain_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ #default=>''
+ },
+ 'useradd_stdin' => { label=>'Insert command STDIN',
+ type =>'textarea',
+ #default=>"$_password\n$_password\n",
+ },
+ 'userdel' => { label=>'Delete command',
+ #default=>'',
+ },
+ 'userdel_stdin' => { label=>'Delete command STDIN',
+ type =>'textarea',
+ #default=>'',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'',
+ },
+ 'usermod_stdin' => { label=>'Modify command STDIN',
+ type =>'textarea',
+ #default=>"$_password\n$_password\n",
+ },
+ 'usermod_pwonly' => { label=>'Disallow username changes',
+ type =>'checkbox',
+ },
+ 'suspend' => { label=>'Suspension command',
+ default=>'',
+ },
+ 'suspend_stdin' => { label=>'Suspension command STDIN',
+ default=>'',
+ },
+ 'unsuspend' => { label=>'Unsuspension command',
+ default=>'',
+ },
+ 'unsuspend_stdin' => { label=>'Unsuspension command STDIN',
+ default=>'',
+ },
+;
+
+tie my %www_shellcommands_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ default=>'mkdir /var/www/$zone; chown $username /var/www/$zone; ln -s /var/www/$zone $homedir/$zone',
+ },
+ 'userdel' => { label=>'Delete command',
+ default=>'[ -n &quot;$zone&quot; ] && rm -rf /var/www/$zone; rm $homedir/$zone',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'[ -n &quot;$old_zone&quot; ] && rm $old_homedir/$old_zone; [ &quot;$old_zone&quot; != &quot;$new_zone&quot; -a -n &quot;$new_zone&quot; ] && mv /var/www/$old_zone /var/www/$new_zone; [ &quot;$old_username&quot; != &quot;$new_username&quot; ] && chown -R $new_username /var/www/$new_zone; ln -s /var/www/$new_zone $new_homedir/$new_zone',
+ },
+;
+
+tie my %apache_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'httpd_conf' => { label=>'httpd.conf snippet location',
+ default=>'/etc/apache/httpd-freeside.conf', },
+ 'template' => {
+ label => 'Template',
+ type => 'textarea',
+ default => <<'END',
+<VirtualHost $domain> #generic
+#<VirtualHost ip.addr> #preferred, http://httpd.apache.org/docs/dns-caveats.html
+DocumentRoot /var/www/$zone
+ServerName $zone
+ServerAlias *.$zone
+#BandWidthModule On
+#LargeFileLimit 4096 12288
+</VirtualHost>
+
+END
+ },
+;
+
+tie my %domain_shellcommands_options, 'Tie::IxHash',
+ 'user' => { lable=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ default=>'',
+ },
+ 'userdel' => { label=>'Delete command',
+ default=>'',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'',
+ },
+;
+
+tie my %textradius_options, 'Tie::IxHash',
+ 'user' => { label=>'Remote username', default=>'root' },
+ 'users' => { label=>'users file location', default=>'/etc/raddb/users' },
+;
+
+tie my %sqlradius_options, 'Tie::IxHash',
+ 'datasrc' => { label=>'DBI data source ' },
+ 'username' => { label=>'Database username' },
+ 'password' => { label=>'Database password' },
+;
+
+tie my %sqlradius_withdomain_options, 'Tie::IxHash',
+ 'datasrc' => { label=>'DBI data source ' },
+ 'username' => { label=>'Database username' },
+ 'password' => { label=>'Database password' },
+;
+
+tie my %cyrus_options, 'Tie::IxHash',
+ 'server' => { label=>'IMAP server' },
+ 'username' => { label=>'Admin username' },
+ 'password' => { label=>'Admin password' },
+;
+
+tie my %cp_options, 'Tie::IxHash',
+ 'port' => { label=>'Port number' },
+ 'username' => { label=>'Username' },
+ 'password' => { label=>'Password' },
+ 'domain' => { label=>'Domain' },
+ 'workgroup' => { label=>'Default Workgroup' },
+;
+
+tie my %infostreet_options, 'Tie::IxHash',
+ 'url' => { label=>'XML-RPC Access URL', },
+ 'login' => { label=>'InfoStreet login', },
+ 'password' => { label=>'InfoStreet password', },
+ 'groupID' => { label=>'InfoStreet groupID', },
+;
+
+tie my %vpopmail_options, 'Tie::IxHash',
+ #'machine' => { label=>'vpopmail machine', },
+ 'dir' => { label=>'directory', }, # ?more info? default?
+ 'uid' => { label=>'vpopmail uid' },
+ 'gid' => { label=>'vpopmail gid' },
+ 'restart' => { label=> 'vpopmail restart command',
+ default=> 'cd /home/vpopmail/domains; for domain in *; do /home/vpopmail/bin/vmkpasswd $domain; done; /var/qmail/bin/qmail-newu; killall -HUP qmail-send',
+ },
+;
+
+tie my %bind_options, 'Tie::IxHash',
+ #'machine' => { label=>'named machine' },
+ 'named_conf' => { label => 'named.conf location',
+ default=> '/etc/bind/named.conf' },
+ 'zonepath' => { label => 'path to zone files',
+ default=> '/etc/bind/', },
+ 'bind_release' => { label => 'ISC BIND Release',
+ type => 'select',
+ options => [qw(BIND8 BIND9)],
+ default => 'BIND8' },
+ 'bind9_minttl' => { label => 'The minttl required by bind9 and RFC1035.',
+ default => '1D' },
+;
+
+tie my %bind_slave_options, 'Tie::IxHash',
+ #'machine' => { label=> 'Slave machine' },
+ 'master' => { label=> 'Master IP address(s) (semicolon-separated)' },
+ 'named_conf' => { label => 'named.conf location',
+ default => '/etc/bind/named.conf' },
+ 'bind_release' => { label => 'ISC BIND Release',
+ type => 'select',
+ options => [qw(BIND8 BIND9)],
+ default => 'BIND8' },
+ 'bind9_minttl' => { label => 'The minttl required by bind9 and RFC1035.',
+ default => '1D' },
+;
+
+tie my %http_options, 'Tie::IxHash',
+ 'method' => { label =>'Method',
+ type =>'select',
+ #options =>[qw(POST GET)],
+ options =>[qw(POST)],
+ default =>'POST' },
+ 'url' => { label => 'URL', default => 'http://', },
+ 'insert_data' => {
+ label => 'Insert data',
+ type => 'textarea',
+ default => join("\n",
+ 'DomainName $svc_x->domain',
+ 'Email ( grep { $_ ne "POST" } $svc_x->cust_svc->cust_pkg->cust_main->invoicing_list)[0]',
+ 'test 1',
+ 'reseller $svc_x->cust_svc->cust_pkg->part_pkg->pkg =~ /reseller/i',
+ ),
+ },
+ 'delete_data' => {
+ label => 'Delete data',
+ type => 'textarea',
+ default => join("\n",
+ ),
+ },
+ 'replace_data' => {
+ label => 'Replace data',
+ type => 'textarea',
+ default => join("\n",
+ ),
+ },
+;
+
+tie my %sqlmail_options, 'Tie::IxHash',
+ 'datasrc' => { label => 'DBI data source' },
+ 'username' => { label => 'Database username' },
+ 'password' => { label => 'Database password' },
+ 'server_type' => {
+ label => 'Server type',
+ type => 'select',
+ options => [qw(dovecot_plain dovecot_crypt dovecot_digest_md5 courier_plain
+ courier_crypt)],
+ default => ['dovecot_plain'], },
+ 'svc_acct_table' => { label => 'User Table', default => 'user_acct' },
+ 'svc_forward_table' => { label => 'Forward Table', default => 'forward' },
+ 'svc_domain_table' => { label => 'Domain Table', default => 'domain' },
+ 'svc_acct_fields' => { label => 'svc_acct Export Fields',
+ default => 'username _password domsvc svcnum' },
+ 'svc_forward_fields' => { label => 'svc_forward Export Fields',
+ default => 'domain svcnum catchall' },
+ 'svc_domain_fields' => { label => 'svc_domain Export Fields',
+ default => 'srcsvc dstsvc dst' },
+ 'resolve_dstsvc' => { label => q{Resolve svc_forward.dstsvc to an email address and store it in dst. (Doesn't require that you also export dstsvc.)},
+ type => 'checkbox' },
+
+;
+
+tie my %ldap_options, 'Tie::IxHash',
+ 'dn' => { label=>'Root DN' },
+ 'password' => { label=>'Root DN password' },
+ 'userdn' => { label=>'User DN' },
+ 'attributes' => { label=>'Attributes',
+ type=>'textarea',
+ default=>join("\n",
+ 'uid $username',
+ 'mail $username\@$domain',
+ 'uidno $uid',
+ 'gidno $gid',
+ 'cn $first',
+ 'sn $last',
+ 'mailquota $quota',
+ 'vmail',
+ 'location',
+ 'mailtag',
+ 'mailhost',
+ 'mailmessagestore $dir',
+ 'userpassword $crypt_password',
+ 'hint',
+ 'answer $sec_phrase',
+ 'objectclass top,person,inetOrgPerson',
+ ),
+ },
+ 'radius' => { label=>'Export RADIUS attributes', type=>'checkbox', },
+;
+
+tie my %forward_shellcommands_options, 'Tie::IxHash',
+ 'user' => { lable=>'Remote username', default=>'root' },
+ 'useradd' => { label=>'Insert command',
+ default=>'',
+ },
+ 'userdel' => { label=>'Delete command',
+ default=>'',
+ },
+ 'usermod' => { label=>'Modify command',
+ default=>'',
+ },
+;
+
+#export names cannot have dashes...
+%exports = (
+ 'svc_acct' => {
+ 'sysvshell' => {
+ 'desc' =>
+ 'Batch export of /etc/passwd and /etc/shadow files (Linux/SysV).',
+ 'options' => \%sysvshell_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'MD5 crypt requires installation of <a href="http://search.cpan.org/search?dist=Crypt-PasswdMD5">Crypt::PasswdMD5</a> from CPAN. Run bin/sysvshell.export to export the files.',
+ },
+ 'bsdshell' => {
+ 'desc' =>
+ 'Batch export of /etc/passwd and /etc/master.passwd files (BSD).',
+ 'options' => \%bsdshell_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'MD5 crypt requires installation of <a href="http://search.cpan.org/search?dist=Crypt-PasswdMD5">Crypt::PasswdMD5</a> from CPAN. Run bin/bsdshell.export to export the files.',
+ },
+# 'nis' => {
+# 'desc' =>
+# 'Batch export of /etc/global/passwd and /etc/global/shadow for NIS ',
+# 'options' => {},
+# },
+ 'textradius' => {
+ 'desc' => 'Real-time export to a text /etc/raddb/users file (Livingston, Cistron)',
+ 'options' => \%textradius_options,
+ 'notes' => 'This will edit a text RADIUS users file in place on a remote server. Requires installation of <a href="http://search.cpan.org/search?dist=RADIUS-UserFile">RADIUS::UserFile</a> from CPAN. If using RADIUS::UserFile 1.01, make sure to apply <a href="http://rt.cpan.org/NoAuth/Bug.html?id=1210">this patch</a>. Also make sure <a href="http://rsync.samba.org/">rsync</a> is installed on the remote machine, and <a href="../docs/ssh.html">SSH is setup for unattended operation</a>.',
+ },
+
+ 'shellcommands' => {
+ 'desc' => 'Real-time export via remote SSH (i.e. useradd, userdel, etc.)',
+ 'options' => \%shellcommands_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Run remote commands via SSH. Usernames are considered unique (also see shellcommands_withdomain). You probably want this if the commands you are running will not accept a domain as a parameter. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.<BR><BR>Use these buttons for some useful presets:<UL><LI><INPUT TYPE="button" VALUE="Linux/NetBSD" onClick=\'this.form.useradd.value = "useradd -c $finger -d $dir -m -s $shell -u $uid -p $crypt_password $username"; this.form.useradd_stdin.value = ""; this.form.userdel.value = "userdel -r $username"; this.form.userdel_stdin.value=""; this.form.usermod.value = "usermod -c $new_finger -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -p $new_crypt_password $old_username"; this.form.usermod_stdin.value = "";\'><LI><INPUT TYPE="button" VALUE="FreeBSD" onClick=\'this.form.useradd.value = "pw useradd $username -d $dir -m -s $shell -u $uid -g $gid -c $finger -h 0"; this.form.useradd_stdin.value = "$_password\n"; this.form.userdel.value = "pw userdel $username -r"; this.form.userdel_stdin.value=""; this.form.usermod.value = "pw usermod $old_username -d $new_dir -m -l $new_username -s $new_shell -u $new_uid -c $new_finger -h 0"; this.form.usermod_stdin.value = "$new__password\n";\'><LI><INPUT TYPE="button" VALUE="Just maintain directories (use with sysvshell or bsdshell)" onClick=\'this.form.useradd.value = "cp -pr /etc/skel $dir; chown -R $uid.$gid $dir"; this.form.useradd_stdin.value = ""; this.form.usermod.value = "[ -d $old_dir ] && mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $new_uid.$new_gid $new_dir; rm -rf $old_dir )"; this.form.usermod_stdin.value = ""; this.form.userdel.value = "rm -rf $dir"; this.form.userdel_stdin.value="";\'></UL>The following variables are available for interpolation (prefixed with new_ or old_ for replace operations): <UL><LI><code>$username</code><LI><code>$_password</code><LI><code>$quoted_password</code> - unencrypted password quoted for the shell<LI><code>$crypt_password</code> - encrypted password<LI><code>$uid</code><LI><code>$gid</code><LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)<LI><code>$dir</code> - home directory<LI><code>$shell</code><LI><code>$quota</code><LI>All other fields in <a href="../docs/schema.html#svc_acct">svc_acct</a> are also available.</UL>',
+ },
+
+ 'shellcommands_withdomain' => {
+ 'desc' => 'Real-time export via remote SSH (vpopmail, etc.).',
+ 'options' => \%shellcommands_withdomain_options,
+ 'notes' => 'Run remote commands via SSH. username@domain (rather than just usernames) are considered unique (also see shellcommands). You probably want this if the commands you are running will accept a domain as a parameter, and will allow the same username with different domains. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.<BR><BR>Use these buttons for some useful presets:<UL><LI><INPUT TYPE="button" VALUE="vpopmail" onClick=\'this.form.useradd.value = "/home/vpopmail/bin/vadduser $username\\\@$domain $quoted_password"; this.form.useradd_stdin.value = ""; this.form.userdel.value = "/home/vpopmail/bin/vdeluser $username\\\@$domain"; this.form.userdel_stdin.value=""; this.form.usermod.value = "/home/vpopmail/bin/vpasswd $new_username\\\@$new_domain $new_quoted_password"; this.form.usermod_stdin.value = ""; this.form.usermod_pwonly.checked = true;\'></UL>The following variables are available for interpolation (prefixed with <code>new_</code> or <code>old_</code> for replace operations): <UL><LI><code>$username</code><LI><code>$domain</code><LI><code>$_password</code><LI><code>$quoted_password</code> - unencrypted password quoted for the shell<LI><code>$crypt_password</code> - encrypted password<LI><code>$uid</code><LI><code>$gid</code><LI><code>$finger</code> - GECOS, already quoted for the shell (do not add additional quotes)<LI><code>$dir</code> - home directory<LI><code>$shell</code><LI><code>$quota</code><LI>All other fields in <a href="../docs/schema.html#svc_acct">svc_acct</a> are also available.</UL>',
+ },
+
+ 'ldap' => {
+ 'desc' => 'Real-time export to LDAP',
+ 'options' => \%ldap_options,
+ 'notes' => 'Real-time export to arbitrary LDAP attributes. Requires installation of <a href="http://search.cpan.org/search?dist=Net-LDAP">Net::LDAP</a> from CPAN.',
+ },
+
+ 'sqlradius' => {
+ 'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS)',
+ 'options' => \%sqlradius_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for <a href="http://www.freeradius.org/">FreeRADIUS</a> or <a href="http://radius.innercite.com/">ICRADIUS</a>. This export does not export RADIUS realms (see also sqlradius_withdomain). An existing RADIUS database will be updated in realtime, but you can use <a href="../docs/man/bin/freeside-sqlradius-reset">freeside-sqlradius-reset</a> to delete the entire RADIUS database and repopulate the tables from the Freeside database. See the <a href="http://search.cpan.org/doc/TIMB/DBI/DBI.pm">DBI documentation</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">documentation for your DBD</a> for the exact syntax of a DBI data source.',
+ },
+
+ 'sqlradius_withdomain' => {
+ 'desc' => 'Real-time export to SQL-backed RADIUS (ICRADIUS, FreeRADIUS) with realms',
+ 'options' => \%sqlradius_withdomain_options,
+ 'nodomain' => '',
+ 'notes' => 'Real-time export of radcheck, radreply and usergroup tables to any SQL database for <a href="http://www.freeradius.org/">FreeRADIUS</a> or <a href="http://radius.innercite.com/">ICRADIUS</a>. This export exports domains to RADIUS realms (see also sqlradius). An existing RADIUS database will be updated in realtime, but you can use <a href="../docs/man/bin/freeside-sqlradius-reset">freeside-sqlradius-reset</a> to delete the entire RADIUS database and repopulate the tables from the Freeside database. See the <a href="http://search.cpan.org/doc/TIMB/DBI/DBI.pm">DBI documentation</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">documentation for your DBD</a> for the exact syntax of a DBI data source.',
+ },
+
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ 'nodomain' => '',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested. (...extended description from pc-intouch?...)',
+ },
+
+ 'cyrus' => {
+ 'desc' => 'Real-time export to Cyrus IMAP server',
+ 'options' => \%cyrus_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Integration with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>. Cyrus::IMAP::Admin should be installed locally and the connection to the server secured. <B>svc_acct.quota</B>, if available, is used to set the Cyrus quota. '
+ },
+
+ 'cp' => {
+ 'desc' => 'Real-time export to Critical Path Account Provisioning Protocol',
+ 'options' => \%cp_options,
+ 'notes' => 'Real-time export to <a href="http://www.cp.net/">Critial Path Account Provisioning Protocol</a>. Requires installation of <a href="http://search.cpan.org/search?dist=Net-APP">Net::APP</a> from CPAN.',
+ },
+
+ 'infostreet' => {
+ 'desc' => 'Real-time export to InfoStreet streetSmartAPI',
+ 'options' => \%infostreet_options,
+ 'nodomain' => 'Y',
+ 'notes' => 'Real-time export to <a href="http://www.infostreet.com/">InfoStreet</a> streetSmartAPI. Requires installation of <a href="http://search.cpan.org/search?dist=Frontier-Client">Frontier::Client</a> from CPAN.',
+ },
+
+ 'vpopmail' => {
+ 'desc' => 'Real-time export to vpopmail text files',
+ 'options' => \%vpopmail_options,
+ 'notes' => 'Real time export to <a href="http://inter7.com/vpopmail/">vpopmail</a> text files. <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed, and you will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a> to <b>vpopmail</b>@<i>export.host</i>.',
+ },
+
+ },
+
+ 'svc_domain' => {
+
+ 'bind' => {
+ 'desc' =>'Batch export to BIND named',
+ 'options' => \%bind_options,
+ 'notes' => 'Batch export of BIND zone and configuration files to primary nameserver. <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed. Run bin/bind.export to export the files.',
+ },
+
+ 'bind_slave' => {
+ 'desc' =>'Batch export to slave BIND named',
+ 'options' => \%bind_slave_options,
+ 'notes' => 'Batch export of BIND configuration file to a secondary nameserver. Zones are slaved from the listed masters. <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed. Run bin/bind.export to export the files.',
+ },
+
+ 'http' => {
+ 'desc' => 'Send an HTTP or HTTPS GET or POST request',
+ 'options' => \%http_options,
+ 'notes' => 'Send an HTTP or HTTPS GET or POST to the specified URL. <a href="http://search.cpan.org/search?dist=libwww-perl">libwww-perl</a> must be installed. For HTTPS support, <a href="http://search.cpan.org/search?dist=Crypt-SSLeay">Crypt::SSLeay</a> or <a href="http://search.cpan.org/search?dist=IO-Socket-SSL">IO::Socket::SSL</a> is required.',
+ },
+
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ #'nodomain' => 'Y',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested. (...extended description from pc-intouch?...)',
+ },
+
+ 'domain_shellcommands' => {
+ 'desc' => 'Run remote commands via SSH, for domains.',
+ 'options' => \%domain_shellcommands_options,
+ 'notes' => 'Run remote commands via SSH, for domains. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.<BR><BR>Use these buttons for some useful presets:<UL><LI><INPUT TYPE="button" VALUE="qmail catchall .qmail-domain-default maintenance" onClick=\'this.form.useradd.value = "[ \"$uid\" -a \"$gid\" -a \"$dir\" -a \"$qdomain\" ] && [ -e $dir/.qmail-$qdomain-default ] || { touch $dir/.qmail-$qdomain-default; chown $uid:$gid $dir/.qmail-$qdomain-default; }"; this.form.userdel.value = ""; this.form.usermod.value = "";\'></UL>The following variables are available for interpolation (prefixed with <code>new_</code> or <code>old_</code> for replace operations): <UL><LI><code>$domain</code><LI><code>$qdomain</code> - domain with periods replaced by colons<LI><code>$uid</code> - of catchall account<LI><code>$gid</code> - of catchall account<LI><code>$dir</code> - home directory of catchall account<LI>All other fields in <a href="../docs/schema.html#svc_domain">svc_domain</a> are also available.</UL>',
+ },
+
+
+ },
+
+ 'svc_forward' => {
+ 'sqlmail' => {
+ 'desc' => 'Real-time export to SQL-backed mail server',
+ 'options' => \%sqlmail_options,
+ #'nodomain' => 'Y',
+ 'notes' => 'Database schema can be made to work with Courier IMAP and Exim. Others could work but are untested. (...extended description from pc-intouch?...)',
+ },
+
+ 'forward_shellcommands' => {
+ 'desc' => 'Run remote commands via SSH, for forwards',
+ 'options' => \%forward_shellcommands_options,
+ 'notes' => 'Run remote commands via SSH, for forwards. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.<BR><BR>Use these buttons for some useful presets:<UL><LI><INPUT TYPE="button" VALUE="text vpopmail maintenance" onClick=\'this.form.useradd.value = "[ -d /home/vpopmail/domains/$domain/$username ] && { echo \"$destination\" > /home/vpopmail/domains/$domain/$username/.qmail; chown vpopmail:vchkpw /home/vpopmail/domains/$domain/$username/.qmail; }"; this.form.userdel.value = "rm /home/vpopmail/domains/$domain/$username/.qmail"; this.form.usermod.value = "mv /home/vpopmail/domains/$old_domain/$old_username/.qmail /home/vpopmail/domains/$new_domain/$new_username; [ \"$old_destination\" != \"$new_destination\" ] && { echo \"$new_destination\" > /home/vpopmail/domains/$new_domain/$new_username/.qmail; chown vpopmail:vchkpw /home/vpopmail/domains/$new_domain/$new_username/.qmail; }";\'></UL>The following variables are available for interpolation (prefixed with <code>new_</code> or <code>old_</code> for replace operations): <UL><LI><code>$username</code><LI><code>$domain</code><LI><code>$destination</code> - forward destination<LI>All other fields in <a href="../docs/schema.html#svc_forward">svc_forward</a> are also available.</UL>',
+ },
+ },
+
+ 'svc_www' => {
+ 'www_shellcommands' => {
+ 'desc' => 'Run remote commands via SSH, for virtual web sites.',
+ 'options' => \%www_shellcommands_options,
+ 'notes' => 'Run remote commands via SSH, for virtual web sites. You will need to <a href="../docs/ssh.html">setup SSH for unattended operation</a>.<BR><BR>The following variables are available for interpolation (prefixed with <code>new_</code> or <code>old_</code> for replace operations): <UL><LI><code>$zone</code><LI><code>$username</code><LI><code>$homedir</code><LI>All other fields in <a href="../docs/schema.html#svc_www">svc_www</a> are also available.</UL>',
+ },
+
+ 'apache' => {
+ 'desc' => 'Export an Apache httpd.conf file snippet.',
+ 'options' => \%apache_options,
+ 'notes' => 'Batch export of an httpd.conf snippet from a template. Typically used with something like <code>Include /etc/apache/httpd-freeside.conf</code> in httpd.conf. <a href="http://search.cpan.org/search?dist=File-Rsync">File::Rsync</a> must be installed. Run bin/apache.export to export the files.',
+ },
+ },
+
+ 'svc_broadband' => {
+ },
+
+);
+
+=back
+
+=head1 NEW EXPORT CLASSES
+
+Should be added to the %export hash here, and a module should be added in
+FS/FS/part_export/ (an example may be found in eg/export_template.pm)
+
+=head1 BUGS
+
+All the stuff in the %exports hash should be generated from the specific
+export modules.
+
+Hmm... cust_export class (not necessarily a database table...) ... ?
+
+deprecated column...
+
+=head1 SEE ALSO
+
+L<FS::part_export_option>, L<FS::export_svc>, L<FS::svc_acct>,
+L<FS::svc_domain>,
+L<FS::svc_forward>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_export/apache.pm b/FS/FS/part_export/apache.pm
new file mode 100644
index 000000000..9161d72b3
--- /dev/null
+++ b/FS/FS/part_export/apache.pm
@@ -0,0 +1,7 @@
+package FS::part_export::apache;
+
+use vars qw(@ISA);
+use FS::part_export::null;
+
+@ISA = qw(FS::part_export::null);
+
diff --git a/FS/FS/part_export/bind.pm b/FS/FS/part_export/bind.pm
new file mode 100644
index 000000000..b72c9bdb0
--- /dev/null
+++ b/FS/FS/part_export/bind.pm
@@ -0,0 +1,7 @@
+package FS::part_export::bind;
+
+use vars qw(@ISA);
+use FS::part_export::null;
+
+@ISA = qw(FS::part_export::null);
+
diff --git a/FS/FS/part_export/bind_slave.pm b/FS/FS/part_export/bind_slave.pm
new file mode 100644
index 000000000..ebb29c1d7
--- /dev/null
+++ b/FS/FS/part_export/bind_slave.pm
@@ -0,0 +1,7 @@
+package FS::part_export::bind_slave;
+
+use vars qw(@ISA);
+use FS::part_export::null;
+
+@ISA = qw(FS::part_export::null);
+
diff --git a/FS/FS/part_export/bsdshell.pm b/FS/FS/part_export/bsdshell.pm
new file mode 100644
index 000000000..06642097f
--- /dev/null
+++ b/FS/FS/part_export/bsdshell.pm
@@ -0,0 +1,7 @@
+package FS::part_export::bsdshell;
+
+use vars qw(@ISA);
+use FS::part_export::null;
+
+@ISA = qw(FS::part_export::null);
+
diff --git a/FS/FS/part_export/cp.pm b/FS/FS/part_export/cp.pm
new file mode 100644
index 000000000..c4750dd5d
--- /dev/null
+++ b/FS/FS/part_export/cp.pm
@@ -0,0 +1,136 @@
+package FS::part_export::cp;
+
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'create_mailbox',
+ 'Mailbox' => $svc_acct->username,
+ 'Password' => $svc_acct->_password,
+ 'Workgroup' => $self->option('workgroup'),
+ 'Domain' => $svc_acct->domain,
+ );
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ return "can't change domain with Critical Path"
+ if $old->domain ne $new->domain;
+ return '' unless $old->username ne $new->username
+ || $old->_password ne $new->_password;
+ $self->cp_queue( $new->svcnum, 'replace', $new->domain,
+ $old->username, $new->username, $old->_password, $new->_password );
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'delete_mailbox',
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ );
+}
+
+sub _export_suspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'set_mailbox_status',
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ 'OTHER' => 'T',
+ 'OTHER_SUSPEND' => 'T',
+ );
+}
+
+sub _export_unsuspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cp_queue( $svc_acct->svcnum, 'set_mailbox_status',
+ 'Mailbox' => $svc_acct->username,
+ 'Domain' => $svc_acct->domain,
+ 'PAYMENT' => 'F',
+ 'OTHER' => 'F',
+ 'OTHER_SUSPEND' => 'F',
+ 'OTHER_BOUNCE' => 'F',
+ );
+}
+
+sub cp_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => 'FS::part_export::cp::cp_command',
+ };
+ $queue->insert(
+ $self->machine,
+ $self->option('port'),
+ $self->option('username'),
+ $self->option('password'),
+ $self->option('domain'),
+ $method,
+ @_,
+ );
+}
+
+sub cp_command { #subroutine, not method
+ my($host, $port, $username, $password, $login_domain, $method, @args) = @_;
+
+ #quelle hack
+ if ( $method eq 'replace' ) {
+
+ my( $domain, $old_username, $new_username, $old_password, $new_password)
+ = @args;
+
+ if ( $old_username ne $new_username ) {
+ cp_command($host, $port, $username, $password, 'rename_mailbox',
+ Domain => $domain,
+ Old_Mailbox => $old_username,
+ New_Mailbox => $new_username,
+ );
+ }
+
+ #my $other = 'F';
+ if ( $new_password =~ /^\*SUSPENDED\* (.*)$/ ) {
+ $new_password = $1;
+ # $other = 'T';
+ }
+ #cp_command($host, $port, $username, $password, $login_domain,
+ # 'set_mailbox_status',
+ # Domain => $domain,
+ # Mailbox => $new_username,
+ # Other => $other,
+ # Other_Bounce => $other,
+ #);
+
+ if ( $old_password ne $new_password ) {
+ cp_command($host, $port, $username, $password, $login_domain,
+ 'change_mailbox',
+ Domain => $domain,
+ Mailbox => $new_username,
+ Password => $new_password,
+ );
+ }
+
+ return;
+ }
+ #eof quelle hack
+
+ eval "use Net::APP;";
+
+ my $app = new Net::APP (
+ "$host:$port",
+ User => $username,
+ Password => $password,
+ Domain => $login_domain,
+ Timeout => 60,
+ #Debug => 1,
+ ) or die "$@\n";
+
+ $app->$method( @args );
+
+ die $app->message."\n" unless $app->ok;
+
+}
+
diff --git a/FS/FS/part_export/cyrus.pm b/FS/FS/part_export/cyrus.pm
new file mode 100644
index 000000000..110ff198f
--- /dev/null
+++ b/FS/FS/part_export/cyrus.pm
@@ -0,0 +1,98 @@
+package FS::part_export::cyrus;
+
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+ $self->cyrus_queue( $svc_acct->svcnum, 'insert',
+ $svc_acct->username, $svc_acct->quota );
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ return "can't change username using Cyrus"
+ if $old->username ne $new->username;
+ return '';
+# #return '' unless $old->_password ne $new->_password;
+# $self->cyrus_queue( $new->svcnum,
+# 'replace', $new->username, $new->_password );
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->cyrus_queue( $svc_acct->svcnum, 'delete',
+ $svc_acct->username );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub cyrus_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::cyrus::cyrus_$method",
+ };
+ $queue->insert(
+ $self->option('server'),
+ $self->option('username'),
+ $self->option('password'),
+ @_
+ );
+}
+
+sub cyrus_insert { #subroutine, not method
+ my $client = cyrus_connect(shift, shift, shift);
+ my( $username, $quota ) = @_;
+ my $rc = $client->create("user.$username");
+ my $error = $client->error;
+ die "creating user.$username: $error" if $error;
+
+ $rc = $client->setacl("user.$username", $username => 'all' );
+ $error = $client->error;
+ die "setacl user.$username: $error" if $error;
+
+ if ( $quota ) {
+ $rc = $client->setquota("user.$username", 'STORAGE' => $quota );
+ $error = $client->error;
+ die "setquota user.$username: $error" if $error;
+ }
+
+}
+
+sub cyrus_delete { #subroutine, not method
+ my ( $server, $admin_username, $password_username, $username ) = @_;
+ my $client = cyrus_connect($server, $admin_username, $password_username);
+
+ my $rc = $client->setacl("user.$username", $admin_username => 'all' );
+ my $error = $client->error;
+ die $error if $error;
+
+ $rc = $client->delete("user.$username");
+ $error = $client->error;
+ die $error if $error;
+}
+
+sub cyrus_connect {
+
+ my( $server, $admin_username, $admin_password ) = @_;
+
+ eval "use Cyrus::IMAP::Admin;";
+
+ my $client = Cyrus::IMAP::Admin->new($server);
+ $client->authenticate(
+ -user => $admin_username,
+ -mechanism => "login",
+ -password => $admin_password,
+ );
+ $client;
+
+}
+
+#sub cyrus_replace { #subroutine, not method
+#}
+
+
diff --git a/FS/FS/part_export/domain_shellcommands.pm b/FS/FS/part_export/domain_shellcommands.pm
new file mode 100644
index 000000000..0edbab0dd
--- /dev/null
+++ b/FS/FS/part_export/domain_shellcommands.pm
@@ -0,0 +1,109 @@
+package FS::part_export::domain_shellcommands;
+
+use strict;
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self) = shift;
+ $self->_export_command('useradd', @_);
+}
+
+sub _export_delete {
+ my($self) = shift;
+ $self->_export_command('userdel', @_);
+}
+
+sub _export_command {
+ my ( $self, $action, $svc_domain) = (shift, shift, shift);
+ my $command = $self->option($action);
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${$_} = $svc_domain->getfield($_) foreach $svc_domain->fields;
+ }
+ ( $qdomain = $domain ) =~ s/\./:/g; #see dot-qmail(5): EXTENSION ADDRESSES
+
+ if ( $svc_domain->catchall ) {
+ no strict 'refs';
+ my $svc_acct = $svc_domain->catchall_svc_acct;
+ ${$_} = $svc_acct->getfield($_) foreach qw(uid gid dir);
+ } else {
+ ${$_} = '' foreach qw(uid gid dir);
+ }
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $svc_domain->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+sub _export_replace {
+ my($self, $new, $old ) = (shift, shift, shift);
+ my $command = $self->option('usermod');
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${"old_$_"} = $old->getfield($_) foreach $old->fields;
+ ${"new_$_"} = $new->getfield($_) foreach $new->fields;
+ }
+ ( $old_qdomain = $old_domain ) =~ s/\./:/g; #see dot-qmail(5): EXTENSION ADDRESSES
+ ( $new_qdomain = $new_domain ) =~ s/\./:/g; #see dot-qmail(5): EXTENSION ADDRESSES
+
+ if ( $old->catchall ) {
+ no strict 'refs';
+ my $svc_acct = $old->catchall_svc_acct;
+ ${"old_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
+ } else {
+ ${"old_$_"} = '' foreach qw(uid gid dir);
+ }
+ if ( $new->catchall ) {
+ no strict 'refs';
+ my $svc_acct = $new->catchall_svc_acct;
+ ${"new_$_"} = $svc_acct->getfield($_) foreach qw(uid gid dir);
+ } else {
+ ${"new_$_"} = '' foreach qw(uid gid dir);
+ }
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $new->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub shellcommands_queue {
+ my( $self, $svcnum ) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::domain_shellcommands::ssh_cmd",
+ };
+ $queue->insert( @_ );
+}
+
+sub ssh_cmd { #subroutine, not method
+ use Net::SSH '0.07';
+ &Net::SSH::ssh_cmd( { @_ } );
+}
+
+#sub shellcommands_insert { #subroutine, not method
+#}
+#sub shellcommands_replace { #subroutine, not method
+#}
+#sub shellcommands_delete { #subroutine, not method
+#}
+
diff --git a/FS/FS/part_export/forward_shellcommands.pm b/FS/FS/part_export/forward_shellcommands.pm
new file mode 100644
index 000000000..f6fcb6062
--- /dev/null
+++ b/FS/FS/part_export/forward_shellcommands.pm
@@ -0,0 +1,110 @@
+package FS::part_export::forward_shellcommands;
+
+use strict;
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self) = shift;
+ $self->_export_command('useradd', @_);
+}
+
+sub _export_delete {
+ my($self) = shift;
+ $self->_export_command('userdel', @_);
+}
+
+sub _export_command {
+ my ( $self, $action, $svc_forward ) = (shift, shift, shift);
+ my $command = $self->option($action);
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${$_} = $svc_forward->getfield($_) foreach $svc_forward->fields;
+ }
+
+ my $svc_acct = $svc_forward->srcsvc_acct;
+ $username = $svc_acct->username;
+ $domain = $svc_acct->domain;
+ if ($svc_forward->dstsvc_acct) {
+ $destination = $svc_forward->dstsvc_acct->email;
+ } else {
+ $destination = $svc_forward->dst;
+ }
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $svc_forward->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ my $command = $self->option('usermod');
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${"old_$_"} = $old->getfield($_) foreach $old->fields;
+ ${"new_$_"} = $new->getfield($_) foreach $new->fields;
+ }
+
+ my $old_svc_acct = $old->srcsvc_acct;
+ $old_username = $old_svc_acct->username;
+ $old_domain = $old_svc_acct->domain;
+ if ($old->dstsvc_acct) {
+ $old_destination = $old->dstsvc_acct->email;
+ } else {
+ $old_destination = $old->dst;
+ }
+
+ my $new_svc_acct = $new->srcsvc_acct;
+ $new_username = $new_svc_acct->username;
+ $new_domain = $new_svc_acct->domain;
+ if ($new->dstsvc) {
+ $new_destination = $new->dstsvc_acct->email;
+ } else {
+ $new_destination = $new->dst;
+ }
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $new->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub shellcommands_queue {
+ my( $self, $svcnum ) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::forward_shellcommands::ssh_cmd",
+ };
+ $queue->insert( @_ );
+}
+
+sub ssh_cmd { #subroutine, not method
+ use Net::SSH '0.07';
+ &Net::SSH::ssh_cmd( { @_ } );
+}
+
+#sub shellcommands_insert { #subroutine, not method
+#}
+#sub shellcommands_replace { #subroutine, not method
+#}
+#sub shellcommands_delete { #subroutine, not method
+#}
+
diff --git a/FS/FS/part_export/http.pm b/FS/FS/part_export/http.pm
new file mode 100644
index 000000000..0e02f0f8e
--- /dev/null
+++ b/FS/FS/part_export/http.pm
@@ -0,0 +1,88 @@
+package FS::part_export::http;
+
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my $self = shift;
+ $self->_export_command('insert', @_);
+}
+
+sub _export_delete {
+ my $self = shift;
+ $self->_export_command('delete', @_);
+}
+
+sub _export_command {
+ my( $self, $action, $svc_x ) = ( shift, shift, shift );
+
+ return unless $self->option("${action}_data");
+
+ $self->http_queue( $svc_x->svcnum,
+ $self->option('method'),
+ $self->option('url'),
+ map {
+ /^\s*(\S+)\s+(.*)$/ or /()()/;
+ my( $field, $value_expression ) = ( $1, $2 );
+ my $value = eval $value_expression;
+ die $@ if $@;
+ ( $field, $value );
+ } split(/\n/, $self->option("${action}_data") )
+ );
+
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = ( shift, shift, shift );
+
+ return unless $self->option('replace_data');
+
+ $self->http_queue( $svc_x->svcnum,
+ $self->option('method'),
+ $self->option('url'),
+ map {
+ /^\s*(\S+)\s+(.*)$/ or /()()/;
+ my( $field, $value_expression ) = ( $1, $2 );
+ die $@ if $@;
+ ( $field, $value );
+ } split(/\n/, $self->option('replace_data') )
+ );
+
+}
+
+sub http_queue {
+ my($self, $svcnum) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::http::http",
+ };
+ $queue->insert( @_ );
+}
+
+sub http {
+ my($method, $url, @data) = @_;
+
+ $method = lc($method);
+
+ eval "use LWP::UserAgent;";
+ die "using LWP::UserAgent: $@" if $@;
+ eval "use HTTP::Request::Common;";
+ die "using HTTP::Request::Common: $@" if $@;
+
+ my $ua = LWP::UserAgent->new;
+
+ #my $response = $ua->$method(
+ # $url, \%data,
+ # 'Content-Type'=>'application/x-www-form-urlencoded'
+ #);
+ my $req = HTTP::Request::Common::POST( $url, \@data );
+ my $response = $ua->request($req);
+
+ die $response->error_as_HTML if $response->is_error;
+
+}
+
diff --git a/FS/FS/part_export/infostreet.pm b/FS/FS/part_export/infostreet.pm
new file mode 100644
index 000000000..caca7c5e1
--- /dev/null
+++ b/FS/FS/part_export/infostreet.pm
@@ -0,0 +1,255 @@
+package FS::part_export::infostreet;
+
+use vars qw(@ISA %infostreet2cust_main $DEBUG);
+use FS::UID qw(dbh);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+$DEBUG = 0;
+
+%infostreet2cust_main = (
+ 'firstName' => 'first',
+ 'lastName' => 'last',
+ 'address1' => 'address1',
+ 'address2' => 'address2',
+ 'city' => 'city',
+ 'state' => 'state',
+ 'zipCode' => 'zip',
+ 'country' => 'country',
+ 'phoneNumber' => 'daytime',
+ 'faxNumber' => 'night', #noment-request...
+);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my( $self, $svc_acct ) = (shift, shift);
+ my $cust_main = $svc_acct->cust_svc->cust_pkg->cust_main;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $err_or_queue = $self->infostreet_err_or_queue( $svc_acct->svcnum,
+ 'createUser', $svc_acct->username, $svc_acct->_password );
+ return $err_or_queue unless ref($err_or_queue);
+ my $jobnum = $err_or_queue->jobnum;
+
+ my %contact_info = ( map {
+ $_ => $cust_main->getfield( $infostreet2cust_main{$_} );
+ } keys %infostreet2cust_main );
+
+ my @emails = grep { $_ ne 'POST' } $cust_main->invoicing_list;
+ $contact_info{'email'} = $emails[0] if @emails;
+
+ #this one is kinda noment-specific
+ $contact_info{'organization'} = $cust_main->agent->agent;
+
+ $err_or_queue = $self->infostreet_queueContact( $svc_acct->svcnum,
+ $svc_acct->username, %contact_info );
+ return $err_or_queue unless ref($err_or_queue);
+
+ # If a quota has been specified set the quota because it is not the default
+ $err_or_queue = $self->infostreet_queueSetQuota( $svc_acct->svcnum,
+ $svc_acct->username, $svc_acct->quota ) if $svc_acct->quota;
+ return $err_or_queue unless ref($err_or_queue);
+
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ return $error if $error;
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ return "can't change username with InfoStreet"
+ if $old->username ne $new->username;
+
+ # If the quota has changed then do the export to setQuota
+ my $err_or_queue = $self->infostreet_queueSetQuota( $new->svcnum, $new->username, $new->quota )
+ if ( $old->quota != $new->quota );
+ return $err_or_queue unless ref($err_or_queue);
+
+
+ return '' unless $old->_password ne $new->_password;
+ $self->infostreet_queue( $new->svcnum,
+ 'passwd', $new->username, $new->_password );
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->infostreet_queue( $svc_acct->svcnum,
+ 'purgeAccount,releaseUsername', $svc_acct->username );
+}
+
+sub _export_suspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->infostreet_queue( $svc_acct->svcnum,
+ 'setStatus', $svc_acct->username, 'DISABLED' );
+}
+
+sub _export_unsuspend {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->infostreet_queue( $svc_acct->svcnum,
+ 'setStatus', $svc_acct->username, 'ACTIVE' );
+}
+
+sub infostreet_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => 'FS::part_export::infostreet::infostreet_command',
+ };
+ $queue->insert(
+ $self->option('url'),
+ $self->option('login'),
+ $self->option('password'),
+ $self->option('groupID'),
+ $method,
+ @_,
+ );
+}
+
+#ick false laziness
+sub infostreet_err_or_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => 'FS::part_export::infostreet::infostreet_command',
+ };
+ $queue->insert(
+ $self->option('url'),
+ $self->option('login'),
+ $self->option('password'),
+ $self->option('groupID'),
+ $method,
+ @_,
+ ) or $queue;
+}
+
+sub infostreet_queueContact {
+ my( $self, $svcnum ) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => 'FS::part_export::infostreet::infostreet_setContact',
+ };
+ $queue->insert(
+ $self->option('url'),
+ $self->option('login'),
+ $self->option('password'),
+ $self->option('groupID'),
+ @_,
+ ) or $queue;
+}
+
+sub infostreet_setContact {
+ my($url, $is_username, $is_password, $groupID, $username, %contact_info) = @_;
+ my $accountID = infostreet_command($url, $is_username, $is_password, $groupID,
+ 'getAccountID', $username);
+ foreach my $field ( keys %contact_info ) {
+ infostreet_command($url, $is_username, $is_password, $groupID,
+ 'setContactField', [ 'int'=>$accountID ], $field, $contact_info{$field} );
+ }
+
+}
+
+sub infostreet_queueSetQuota {
+
+ my( $self, $svcnum) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => 'FS::part_export::infostreet::infostreet_setQuota',
+ };
+
+ $queue->insert(
+ $self->option('url'),
+ $self->option('login'),
+ $self->option('password'),
+ $self->option('groupID'),
+ @_,
+ ) or $queue;
+
+}
+
+sub infostreet_setQuota {
+ my($url, $is_username, $is_password, $groupID, $username, $quota) = @_;
+ infostreet_command($url, $is_username, $is_password, $groupID, 'setQuota', $username, [ 'int'=> $quota ] );
+}
+
+
+sub infostreet_command { #subroutine, not method
+ my($url, $username, $password, $groupID, $method, @args) = @_;
+
+ warn "[FS::part_export::infostreet] $method ".join(' ', @args)."\n" if $DEBUG;
+
+ #quelle hack
+ if ( $method =~ /,/ ) {
+ foreach my $part ( split(/,\s*/, $method) ) {
+ infostreet_command($url, $username, $password, $groupID, $part, @args);
+ }
+ return;
+ }
+
+ eval "use Frontier::Client;";
+ die $@ if $@;
+
+ eval 'sub Frontier::RPC2::String::repr {
+ my $self = shift;
+ my $value = $$self;
+ $value =~ s/([&<>\"])/$Frontier::RPC2::char_entities{$1}/ge;
+ $value;
+ }';
+ die $@ if $@;
+
+ my $conn = Frontier::Client->new( url => $url );
+ my $key_result = $conn->call( 'authenticate', $username, $password, $groupID);
+ my %key_result = _infostreet_parse($key_result);
+ die $key_result{error} unless $key_result{success};
+ my $key = $key_result{data};
+
+ #my $result = $conn->call($method, $key, @args);
+ my $result = $conn->call( $method, $key,
+ map {
+ if ( ref($_) ) {
+ my( $type, $value) = @{$_};
+ $conn->$type($value);
+ } else {
+ $conn->string($_);
+ }
+ } @args );
+ my %result = _infostreet_parse($result);
+ die $result{error} unless $result{success};
+
+ $result->{data};
+
+}
+
+#sub infostreet_command_byid { #subroutine, not method;
+# my($url, $username, $password, $groupID, $method, @args ) = @_;
+#
+# infostreet_command
+#
+#}
+
+sub _infostreet_parse { #subroutine, not method
+ my $arg = shift;
+ map {
+ my $value = $arg->{$_};
+ #warn ref($value);
+ $value = $value->value()
+ if ref($value) && $value->isa('Frontier::RPC2::DataType');
+ $_=>$value;
+ } keys %$arg;
+}
+
+
diff --git a/FS/FS/part_export/ldap.pm b/FS/FS/part_export/ldap.pm
new file mode 100644
index 000000000..57fd1f3f4
--- /dev/null
+++ b/FS/FS/part_export/ldap.pm
@@ -0,0 +1,253 @@
+package FS::part_export::ldap;
+
+use vars qw(@ISA @saltset);
+use FS::Record qw( dbh );
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+
+ #false laziness w/shellcommands.pm
+ {
+ no strict 'refs';
+ ${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields;
+ ${$_} = $svc_acct->$_() foreach qw( domain );
+ my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
+ if ( $cust_pkg ) {
+ my $cust_main = $cust_pkg->cust_main;
+ ${$_} = $cust_main->getfield($_) foreach qw(first last);
+ }
+ }
+ $crypt_password = ''; #surpress "used only once" warnings
+ $crypt_password = '{crypt}'. crypt( $svc_acct->_password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))] );
+
+ my $username_attrib;
+ my %attrib = map { /^\s*(\w+)\s+(.*\S)\s*$/;
+ $username_attrib = $1 if $2 eq '$username';
+ ( $1 => eval(qq("$2")) ); }
+ grep { /^\s*(\w+)\s+(.*\S)\s*$/ }
+ split("\n", $self->option('attributes'));
+
+ if ( $self->option('radius') ) {
+ foreach my $table (qw(reply check)) {
+ my $method = "radius_$table";
+ my %radius = $svc_acct->$method();
+ foreach my $radius ( keys %radius ) {
+ ( my $ldap = $radius ) =~ s/\-//g;
+ $attrib{$ldap} = $radius{$radius};
+ }
+ }
+ }
+
+ my $err_or_queue = $self->ldap_queue( $svc_acct->svcnum, 'insert',
+ #$svc_acct->username,
+ $username_attrib,
+ %attrib );
+ return $err_or_queue unless ref($err_or_queue);
+
+ #groups with LDAP?
+ #my @groups = $svc_acct->radius_groups;
+ #if ( @groups ) {
+ # my $err_or_queue = $self->ldap_queue(
+ # $svc_acct->svcnum, 'usergroup_insert',
+ # $svc_acct->username, @groups );
+ # return $err_or_queue unless ref($err_or_queue);
+ #}
+
+ '';
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ return "can't (yet?) change username with ldap"
+ if $old->username ne $new->username;
+
+ return "ldap replace unimplemented";
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $jobnum = '';
+ #if ( $old->username ne $new->username ) {
+ # my $err_or_queue = $self->ldap_queue( $new->svcnum, 'rename',
+ # $new->username, $old->username );
+ # unless ( ref($err_or_queue) ) {
+ # $dbh->rollback if $oldAutoCommit;
+ # return $err_or_queue;
+ # }
+ # $jobnum = $err_or_queue->jobnum;
+ #}
+
+ foreach my $table (qw(reply check)) {
+ my $method = "radius_$table";
+ my %new = $new->$method();
+ my %old = $old->$method();
+ if ( grep { !exists $old{$_} #new attributes
+ || $new{$_} ne $old{$_} #changed
+ } keys %new
+ ) {
+ my $err_or_queue = $self->ldap_queue( $new->svcnum, 'insert',
+ $table, $new->username, %new );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ my @del = grep { !exists $new{$_} } keys %old;
+ if ( @del ) {
+ my $err_or_queue = $self->ldap_queue( $new->svcnum, 'attrib_delete',
+ $table, $new->username, @del );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+ }
+
+ # (sorta) false laziness with FS::svc_acct::replace
+ my @oldgroups = @{$old->usergroup}; #uuuh
+ my @newgroups = $new->radius_groups;
+ my @delgroups = ();
+ foreach my $oldgroup ( @oldgroups ) {
+ if ( grep { $oldgroup eq $_ } @newgroups ) {
+ @newgroups = grep { $oldgroup ne $_ } @newgroups;
+ next;
+ }
+ push @delgroups, $oldgroup;
+ }
+
+ if ( @delgroups ) {
+ my $err_or_queue = $self->ldap_queue( $new->svcnum, 'usergroup_delete',
+ $new->username, @delgroups );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ if ( @newgroups ) {
+ my $err_or_queue = $self->ldap_queue( $new->svcnum, 'usergroup_insert',
+ $new->username, @newgroups );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ return "ldap delete unimplemented";
+ my $err_or_queue = $self->ldap_queue( $svc_acct->svcnum, 'delete',
+ $svc_acct->username );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub ldap_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::ldap::ldap_$method",
+ };
+ $queue->insert(
+ $self->machine,
+ $self->option('dn'),
+ $self->option('password'),
+ $self->option('userdn'),
+ @_,
+ ) or $queue;
+}
+
+sub ldap_insert { #subroutine, not method
+ my $ldap = ldap_connect(shift, shift, shift);
+ my( $userdn, $username_attrib, %attrib ) = @_;
+
+ $userdn = "$username_attrib=$attrib{$username_attrib}, $userdn"
+ if $username_attrib;
+ #icky hack, but should be unsurprising to the LDAPers
+ foreach my $key ( grep { $attrib{$_} =~ /,/ } keys %attrib ) {
+ $attrib{$key} = [ split(/,/, $attrib{$key}) ];
+ }
+
+ my $status = $ldap->add( $userdn, attrs => [ %attrib ] );
+ die 'LDAP error: '. $status->error. "\n" if $status->is_error;
+
+ $ldap->unbind;
+}
+
+#sub ldap_delete { #subroutine, not method
+# my $dbh = ldap_connect(shift, shift, shift);
+# my $username = shift;
+#
+# foreach my $table (qw( radcheck radreply usergroup )) {
+# my $sth = $dbh->prepare( "DELETE FROM $table WHERE UserName = ?" );
+# $sth->execute($username)
+# or die "can't delete from $table table: ". $sth->errstr;
+# }
+# $dbh->disconnect;
+#}
+
+sub ldap_connect {
+ my( $machine, $dn, $password ) = @_;
+ my %bind_options;
+ $bind_options{password} = $password if length($password);
+
+ eval "use Net::LDAP";
+ die $@ if $@;
+
+ my $ldap = Net::LDAP->new($machine) or die $@;
+ my $status = $ldap->bind( $dn, %bind_options );
+ die 'LDAP error: '. $status->error. "\n" if $status->is_error;
+
+ $ldap;
+}
+
diff --git a/FS/FS/part_export/null.pm b/FS/FS/part_export/null.pm
new file mode 100644
index 000000000..0145af3a4
--- /dev/null
+++ b/FS/FS/part_export/null.pm
@@ -0,0 +1,13 @@
+package FS::part_export::null;
+
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {}
+sub _export_replace {}
+sub _export_delete {}
+
diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm
new file mode 100644
index 000000000..edc944009
--- /dev/null
+++ b/FS/FS/part_export/shellcommands.pm
@@ -0,0 +1,125 @@
+package FS::part_export::shellcommands;
+
+use vars qw(@ISA @saltset);
+use String::ShellQuote;
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self) = shift;
+ $self->_export_command('useradd', @_);
+}
+
+sub _export_delete {
+ my($self) = shift;
+ $self->_export_command('userdel', @_);
+}
+
+sub _export_suspend {
+ my($self) = shift;
+ $self->_export_command('suspend', @_);
+}
+
+sub _export_unsuspend {
+ my($self) = shift;
+ $self->_export_command('unsuspend', @_);
+}
+
+sub _export_command {
+ my ( $self, $action, $svc_acct) = (shift, shift, shift);
+ my $command = $self->option($action);
+ return '' if $command =~ /^\s*$/;
+ my $stdin = $self->option($action."_stdin");
+
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${$_} = $svc_acct->getfield($_) foreach $svc_acct->fields;
+ }
+
+ my $cust_pkg = $svc_acct->cust_svc->cust_pkg;
+ if ( $cust_pkg ) {
+ $email = ( grep { $_ ne 'POST' } $cust_pkg->cust_main->invoicing_list )[0];
+ } else {
+ $email = '';
+ }
+
+ $finger = shell_quote $finger;
+ $quoted_password = shell_quote $_password;
+ $domain = $svc_acct->domain;
+ $crypt_password = ''; #surpress "used only once" warnings
+ $crypt_password = crypt( $svc_acct->_password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))] );
+
+ $self->shellcommands_queue( $svc_acct->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ stdin_string => eval(qq("$stdin")),
+ );
+}
+
+sub _export_replace {
+ my($self, $new, $old ) = (shift, shift, shift);
+ my $command = $self->option('usermod');
+ my $stdin = $self->option('usermod_stdin');
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${"old_$_"} = $old->getfield($_) foreach $old->fields;
+ ${"new_$_"} = $new->getfield($_) foreach $new->fields;
+ }
+ $new_finger = shell_quote $new_finger;
+ $quoted_new__password = shell_quote $new__password; #old, wrong?
+ $new_quoted_password = shell_quote $new__password; #new, better?
+ $old_domain = $old->domain;
+ $new_domain = $new->domain;
+ $new_crypt_password = ''; #surpress "used only once" warnings
+ $new_crypt_password = crypt( $new->_password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))]);
+ if ( $self->option('usermod_pwonly') ) {
+ my $error = '';
+ if ( $old_username ne $new_username ) {
+ $error ||= "can't change username";
+ }
+ if ( $old_domain ne $new_domain ) {
+ $error ||= "can't change domain";
+ }
+ return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
+ if $error;
+ }
+ $self->shellcommands_queue( $new->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ stdin_string => eval(qq("$stdin")),
+ );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub shellcommands_queue {
+ my( $self, $svcnum ) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::shellcommands::ssh_cmd",
+ };
+ $queue->insert( @_ );
+}
+
+sub ssh_cmd { #subroutine, not method
+ use Net::SSH '0.07';
+ &Net::SSH::ssh_cmd( { @_ } );
+}
+
+#sub shellcommands_insert { #subroutine, not method
+#}
+#sub shellcommands_replace { #subroutine, not method
+#}
+#sub shellcommands_delete { #subroutine, not method
+#}
+
diff --git a/FS/FS/part_export/shellcommands_withdomain.pm b/FS/FS/part_export/shellcommands_withdomain.pm
new file mode 100644
index 000000000..a15c24d88
--- /dev/null
+++ b/FS/FS/part_export/shellcommands_withdomain.pm
@@ -0,0 +1,7 @@
+package FS::part_export::shellcommands_withdomain;
+
+use vars qw(@ISA);
+use FS::part_export::shellcommands;
+
+@ISA = qw(FS::part_export::shellcommands);
+
diff --git a/FS/FS/part_export/sqlmail.pm b/FS/FS/part_export/sqlmail.pm
new file mode 100644
index 000000000..8ccad3c7e
--- /dev/null
+++ b/FS/FS/part_export/sqlmail.pm
@@ -0,0 +1,182 @@
+package FS::part_export::sqlmail;
+
+use vars qw(@ISA);
+use Digest::MD5 qw(md5_hex);
+use FS::Record qw(qsearchs);
+use FS::part_export;
+use FS::svc_domain;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc) = (shift, shift);
+ # this is a svc_something.
+
+ my $svcdb = $svc->cust_svc->part_svc->svcdb;
+ my $export_table = $self->option($svcdb . '_table')
+ or die('Export table not defined for svcdb: ' . $svcdb);
+ my @export_fields = split(/\s+/, $self->option($svcdb . '_fields'));
+ my $svchash = update_values($self, $svc, $svcdb);
+
+ foreach my $key (keys(%$svchash)) {
+ unless (grep { $key eq $_ } @export_fields) {
+ delete $svchash->{$key};
+ }
+ }
+
+ my $error = $self->sqlmail_queue( $svc->svcnum, 'insert',
+ $self->option('server_type'), $export_table,
+ (map { ($_, $svchash->{$_}); } keys(%$svchash)));
+ return $error if $error;
+ '';
+
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+
+ my $svcdb = $new->cust_svc->part_svc->svcdb;
+ my $export_table = $self->option($svcdb . '_table')
+ or die('Export table not defined for svcdb: ' . $svcdb);
+ my @export_fields = split(/\s+/, $self->option($svcdb . '_fields'));
+ my $svchash = update_values($self, $new, $svcdb);
+
+ foreach my $key (keys(%$svchash)) {
+ unless (grep { $key eq $_ } @export_fields) {
+ delete $svchash->{$key};
+ }
+ }
+
+ my $error = $self->sqlmail_queue( $new->svcnum, 'replace',
+ $old->svcnum, $self->option('server_type'), $export_table,
+ (map { ($_, $svchash->{$_}); } keys(%$svchash)));
+ return $error if $error;
+ '';
+
+}
+
+sub _export_delete {
+ my( $self, $svc ) = (shift, shift);
+
+ my $svcdb = $svc->cust_svc->part_svc->svcdb;
+ my $table = $self->option($svcdb . '_table')
+ or die('Export table not defined for svcdb: ' . $svcdb);
+
+ $self->sqlmail_queue( $svc->svcnum, 'delete', $table,
+ $svc->svcnum );
+}
+
+sub sqlmail_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::sqlmail::sqlmail_$method",
+ };
+ $queue->insert(
+ $self->option('datasrc'),
+ $self->option('username'),
+ $self->option('password'),
+ @_,
+ );
+}
+
+sub sqlmail_insert { #subroutine, not method
+ my $dbh = sqlmail_connect(shift, shift, shift);
+ my( $server_type, $table ) = (shift, shift);
+
+ my %attrs = @_;
+
+ map { $attrs{$_} = $attrs{$_} ? qq!'$attrs{$_}'! : 'NULL'; } keys(%attrs);
+ my $query = sprintf("INSERT INTO %s (%s) values (%s)",
+ $table, join(",", keys(%attrs)),
+ join(',', values(%attrs)));
+
+ $dbh->do($query) or die $dbh->errstr;
+ $dbh->disconnect;
+
+ '';
+}
+
+sub sqlmail_delete { #subroutine, not method
+ my $dbh = sqlmail_connect(shift, shift, shift);
+ my( $table, $svcnum ) = @_;
+
+ $dbh->do("DELETE FROM $table WHERE svcnum = $svcnum") or die $dbh->errstr;
+ $dbh->disconnect;
+
+ '';
+}
+
+sub sqlmail_replace {
+ my $dbh = sqlmail_connect(shift, shift, shift);
+ my($oldsvcnum, $server_type, $table) = (shift, shift, shift);
+
+ my %attrs = @_;
+ map { $attrs{$_} = $attrs{$_} ? qq!'$attrs{$_}'! : 'NULL'; } keys(%attrs);
+
+ my $query = "SELECT COUNT(*) FROM $table WHERE svcnum = $oldsvcnum";
+ my $result = $dbh->selectrow_arrayref($query) or die $dbh->errstr;
+
+ if (@$result[0] == 0) {
+ $query = sprintf("INSERT INTO %s (%s) values (%s)",
+ $table, join(",", keys(%attrs)),
+ join(',', values(%attrs)));
+ $dbh->do($query) or die $dbh->errstr;
+ } else {
+ $query = sprintf('UPDATE %s SET %s WHERE svcnum = %s',
+ $table, join(', ', map {"$_ = $attrs{$_}"} keys(%attrs)),
+ $oldsvcnum);
+ $dbh->do($query) or die $dbh->errstr;
+ }
+
+ $dbh->disconnect;
+
+ '';
+}
+
+sub sqlmail_connect {
+ DBI->connect(@_) or die $DBI::errstr;
+}
+
+sub update_values {
+
+ # Update records to conform to a particular server_type.
+
+ my ($self, $svc, $svcdb) = (shift,shift,shift);
+ my $svchash = { %{$svc->hashref} } or return ''; # We need a copy.
+
+ if ($svcdb eq 'svc_acct') {
+ if ($self->option('server_type') eq 'courier_crypt') {
+ my $salt = join '', ('.', '/', 0..9,'A'..'Z', 'a'..'z')[rand 64, rand 64];
+ $svchash->{_password} = crypt($svchash->{_password}, $salt);
+
+ } elsif ($self->option('server_type') eq 'dovecot_plain') {
+ $svchash->{_password} = '{PLAIN}' . $svchash->{_password};
+
+ } elsif ($self->option('server_type') eq 'dovecot_crypt') {
+ my $salt = join '', ('.', '/', 0..9,'A'..'Z', 'a'..'z')[rand 64, rand 64];
+ $svchash->{_password} = '{CRYPT}' . crypt($svchash->{_password}, $salt);
+
+ } elsif ($self->option('server_type') eq 'dovecot_digest_md5') {
+ my $svc_domain = qsearchs('svc_domain', { svcnum => $svc->domsvc });
+ die('Unable to lookup svc_domain with domsvc: ' . $svc->domsvc)
+ unless ($svc_domain);
+
+ my $domain = $svc_domain->domain;
+ my $md5hash = '{DIGEST-MD5}' . md5_hex(join(':', $svchash->{username},
+ $domain, $svchash->{_password}));
+ $svchash->{_password} = $md5hash;
+ }
+ } elsif ($svcdb eq 'svc_forward') {
+ if ($self->option('resolve_dstsvc') && $svc->dstsvc_acct) {
+ $svchash->{dst} = $svc->dstsvc_acct->username . '@' .
+ $svc->dstsvc_acct->svc_domain->domain;
+ }
+ }
+
+ return($svchash);
+
+}
+
diff --git a/FS/FS/part_export/sqlradius.pm b/FS/FS/part_export/sqlradius.pm
new file mode 100644
index 000000000..8a8f9beba
--- /dev/null
+++ b/FS/FS/part_export/sqlradius.pm
@@ -0,0 +1,282 @@
+package FS::part_export::sqlradius;
+
+use vars qw(@ISA);
+use FS::Record qw( dbh );
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub export_username {
+ my($self, $svc_acct) = (shift, shift);
+ $svc_acct->username;
+}
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+
+ foreach my $table (qw(reply check)) {
+ my $method = "radius_$table";
+ my %attrib = $svc_acct->$method();
+ next unless keys %attrib;
+ my $err_or_queue = $self->sqlradius_queue( $svc_acct->svcnum, 'insert',
+ $table, $self->export_username($svc_acct), %attrib );
+ return $err_or_queue unless ref($err_or_queue);
+ }
+ my @groups = $svc_acct->radius_groups;
+ if ( @groups ) {
+ my $err_or_queue = $self->sqlradius_queue(
+ $svc_acct->svcnum, 'usergroup_insert',
+ $self->export_username($svc_acct), @groups );
+ return $err_or_queue unless ref($err_or_queue);
+ }
+ '';
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $jobnum = '';
+ if ( $self->export_username($old) ne $self->export_username($new) ) {
+ my $err_or_queue = $self->sqlradius_queue( $new->svcnum, 'rename',
+ $self->export_username($new), $self->export_username($old) );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ $jobnum = $err_or_queue->jobnum;
+ }
+
+ foreach my $table (qw(reply check)) {
+ my $method = "radius_$table";
+ my %new = $new->$method();
+ my %old = $old->$method();
+ if ( grep { !exists $old{$_} #new attributes
+ || $new{$_} ne $old{$_} #changed
+ } keys %new
+ ) {
+ my $err_or_queue = $self->sqlradius_queue( $new->svcnum, 'insert',
+ $table, $self->export_username($new), %new );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ my @del = grep { !exists $new{$_} } keys %old;
+ if ( @del ) {
+ my $err_or_queue = $self->sqlradius_queue( $new->svcnum, 'attrib_delete',
+ $table, $self->export_username($new), @del );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+ }
+
+ # (sorta) false laziness with FS::svc_acct::replace
+ my @oldgroups = @{$old->usergroup}; #uuuh
+ my @newgroups = $new->radius_groups;
+ my @delgroups = ();
+ foreach my $oldgroup ( @oldgroups ) {
+ if ( grep { $oldgroup eq $_ } @newgroups ) {
+ @newgroups = grep { $oldgroup ne $_ } @newgroups;
+ next;
+ }
+ push @delgroups, $oldgroup;
+ }
+
+ if ( @delgroups ) {
+ my $err_or_queue = $self->sqlradius_queue( $new->svcnum, 'usergroup_delete',
+ $self->export_username($new), @delgroups );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ if ( @newgroups ) {
+ my $err_or_queue = $self->sqlradius_queue( $new->svcnum, 'usergroup_insert',
+ $self->export_username($new), @newgroups );
+ unless ( ref($err_or_queue) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $err_or_queue;
+ }
+ if ( $jobnum ) {
+ my $error = $err_or_queue->depend_insert( $jobnum );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ my $err_or_queue = $self->sqlradius_queue( $svc_acct->svcnum, 'delete',
+ $self->export_username($svc_acct) );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub sqlradius_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::sqlradius::sqlradius_$method",
+ };
+ $queue->insert(
+ $self->option('datasrc'),
+ $self->option('username'),
+ $self->option('password'),
+ @_,
+ ) or $queue;
+}
+
+sub sqlradius_insert { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my( $table, $username, %attributes ) = @_;
+
+ foreach my $attribute ( keys %attributes ) {
+
+ my $s_sth = $dbh->prepare(
+ "SELECT COUNT(*) FROM rad$table WHERE UserName = ? AND Attribute = ?"
+ ) or die $dbh->errstr;
+ $s_sth->execute( $username, $attribute ) or die $s_sth->errstr;
+
+ if ( $s_sth->fetchrow_arrayref->[0] ) {
+
+ my $u_sth = $dbh->prepare(
+ "UPDATE rad$table SET Value = ? WHERE UserName = ? AND Attribute = ?"
+ ) or die $dbh->errstr;
+ $u_sth->execute($attributes{$attribute}, $username, $attribute)
+ or die $u_sth->errstr;
+
+ } else {
+
+ my $i_sth = $dbh->prepare(
+ "INSERT INTO rad$table ( UserName, Attribute, op, Value ) ".
+ "VALUES ( ?, ?, ?, ? )"
+ ) or die $dbh->errstr;
+ $i_sth->execute(
+ $username,
+ $attribute,
+ ( $attribute =~ /Password/i ? '==' : ':=' ),
+ $attributes{$attribute},
+ ) or die $i_sth->errstr;
+
+ }
+
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_usergroup_insert { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my( $username, @groups ) = @_;
+
+ my $sth = $dbh->prepare(
+ "INSERT INTO usergroup ( UserName, GroupName ) VALUES ( ?, ? )"
+ ) or die $dbh->errstr;
+ foreach my $group ( @groups ) {
+ $sth->execute( $username, $group )
+ or die "can't insert into groupname table: ". $sth->errstr;
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_usergroup_delete { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my( $username, @groups ) = @_;
+
+ my $sth = $dbh->prepare(
+ "DELETE FROM usergroup WHERE UserName = ? AND GroupName = ?"
+ ) or die $dbh->errstr;
+ foreach my $group ( @groups ) {
+ $sth->execute( $username, $group )
+ or die "can't delete from groupname table: ". $sth->errstr;
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_rename { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my($new_username, $old_username) = @_;
+ foreach my $table (qw(radreply radcheck usergroup )) {
+ my $sth = $dbh->prepare("UPDATE $table SET Username = ? WHERE UserName = ?")
+ or die $dbh->errstr;
+ $sth->execute($new_username, $old_username)
+ or die "can't update $table: ". $sth->errstr;
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_attrib_delete { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my( $table, $username, @attrib ) = @_;
+
+ foreach my $attribute ( @attrib ) {
+ my $sth = $dbh->prepare(
+ "DELETE FROM rad$table WHERE UserName = ? AND Attribute = ?" )
+ or die $dbh->errstr;
+ $sth->execute($username,$attribute)
+ or die "can't delete from rad$table table: ". $sth->errstr;
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_delete { #subroutine, not method
+ my $dbh = sqlradius_connect(shift, shift, shift);
+ my $username = shift;
+
+ foreach my $table (qw( radcheck radreply usergroup )) {
+ my $sth = $dbh->prepare( "DELETE FROM $table WHERE UserName = ?" );
+ $sth->execute($username)
+ or die "can't delete from $table table: ". $sth->errstr;
+ }
+ $dbh->disconnect;
+}
+
+sub sqlradius_connect {
+ #my($datasrc, $username, $password) = @_;
+ #DBI->connect($datasrc, $username, $password) or die $DBI::errstr;
+ DBI->connect(@_) or die $DBI::errstr;
+}
+
diff --git a/FS/FS/part_export/sqlradius_withdomain.pm b/FS/FS/part_export/sqlradius_withdomain.pm
new file mode 100644
index 000000000..1c8f38c9d
--- /dev/null
+++ b/FS/FS/part_export/sqlradius_withdomain.pm
@@ -0,0 +1,12 @@
+package FS::part_export::sqlradius_withdomain;
+
+use vars qw(@ISA);
+use FS::part_export::sqlradius;
+
+@ISA = qw(FS::part_export::sqlradius);
+
+sub export_username {
+ my($self, $svc_acct) = (shift, shift);
+ $svc_acct->email;
+}
+
diff --git a/FS/FS/part_export/sysvshell.pm b/FS/FS/part_export/sysvshell.pm
new file mode 100644
index 000000000..f3f6b34b6
--- /dev/null
+++ b/FS/FS/part_export/sysvshell.pm
@@ -0,0 +1,7 @@
+package FS::part_export::sysvshell;
+
+use vars qw(@ISA);
+use FS::part_export::null;
+
+@ISA = qw(FS::part_export::null);
+
diff --git a/FS/FS/part_export/textradius.pm b/FS/FS/part_export/textradius.pm
new file mode 100644
index 000000000..1492f2672
--- /dev/null
+++ b/FS/FS/part_export/textradius.pm
@@ -0,0 +1,166 @@
+package FS::part_export::textradius;
+
+use vars qw(@ISA $prefix);
+use Fcntl qw(:flock);
+use FS::UID qw(datasrc);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+$prefix = "/usr/local/etc/freeside/export.";
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+ $err_or_queue = $self->textradius_queue( $svc_acct->svcnum, 'insert',
+ $svc_acct->username, $svc_acct->radius_check, '-', $svc_acct->radius_reply);
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ return "can't (yet?) change username with textradius"
+ if $old->username ne $new->username;
+ #return '' unless $old->_password ne $new->_password;
+ $err_or_queue = $self->textradius_queue( $new->svcnum, 'insert',
+ $new->username, $new->radius_check, '-', $new->radius_reply);
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ $err_or_queue = $self->textradius_queue( $svc_acct->svcnum, 'delete',
+ $svc_acct->username );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+#a good idea to queue anything that could fail or take any time
+sub textradius_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::textradius::textradius_$method",
+ };
+ $queue->insert(
+ $self->option('user')||'root',
+ $self->machine,
+ $self->option('users'),
+ @_,
+ ) or $queue;
+}
+
+sub textradius_insert { #subroutine, not method
+ my( $user, $host, $users, $username, @attributes ) = @_;
+
+ #silly arg processing
+ my($att, @check);
+ push @check, $att while @attributes && ($att=shift @attributes) ne '-';
+ my %check = @check;
+ my %reply = @attributes;
+
+ my $file = textradius_download($user, $host, $users);
+
+ eval "use RADIUS::UserFile;";
+ die $@ if $@;
+
+ my $userfile = new RADIUS::UserFile(
+ File => $file,
+ Who => [ $username ],
+ Check_Items => [ keys %check ],
+ ) or die "error parsing $file";
+
+ $userfile->remove($username);
+ $userfile->add(
+ Who => $username,
+ Attributes => { %check, %reply },
+ Comment => 'user added by Freeside',
+ ) or die "error adding to $file";
+
+ $userfile->update( Who => [ $username ] )
+ or die "error updating $file";
+
+ textradius_upload($user, $host, $users);
+
+}
+
+sub textradius_delete { #subroutine, not method
+ my( $user, $host, $users, $username ) = @_;
+
+ my $file = textradius_download($user, $host, $users);
+
+ eval "use RADIUS::UserFile;";
+ die $@ if $@;
+
+ my $userfile = new RADIUS::UserFile(
+ File => $file,
+ Who => [ $username ],
+ ) or die "error parsing $file";
+
+ $userfile->remove($username);
+
+ $userfile->update( Who => [ $username ] )
+ or die "error updating $file";
+
+ textradius_upload($user, $host, $users);
+}
+
+sub textradius_download {
+ my( $user, $host, $users ) = @_;
+
+ my $dir = $prefix. datasrc;
+ mkdir $dir, 0700 or die $! unless -d $dir;
+ $dir .= "/$host";
+ mkdir $dir, 0700 or die $! unless -d $dir;
+
+ my $dest = "$dir/users";
+
+ eval "use File::Rsync;";
+ die $@ if $@;
+ my $rsync = File::Rsync->new({ rsh => 'ssh' });
+
+ open(LOCK, "+>>$dest.lock")
+ and flock(LOCK,LOCK_EX)
+ or die "can't open $dest.lock: $!";
+
+ $rsync->exec( {
+ src => "$user\@$host:$users",
+ dest => $dest,
+ } ); # true/false return value from exec is not working, alas
+ if ( $rsync->err ) {
+ die "error downloading $user\@$host:$users : ".
+ 'exit status: '. $rsync->status. ', '.
+ 'STDERR: '. join(" / ", $rsync->err). ', '.
+ 'STDOUT: '. join(" / ", $rsync->out);
+ }
+
+ $dest;
+}
+
+sub textradius_upload {
+ my( $user, $host, $users ) = @_;
+
+ my $dir = $prefix. datasrc. "/$host";
+
+ eval "use File::Rsync;";
+ die $@ if $@;
+ my $rsync = File::Rsync->new({
+ rsh => 'ssh',
+ #dry_run => 1,
+ });
+ $rsync->exec( {
+ src => "$dir/users",
+ dest => "$user\@$host:$users",
+ } ); # true/false return value from exec is not working, alas
+ if ( $rsync->err ) {
+ die "error uploading to $user\@$host:$users : ".
+ 'exit status: '. $rsync->status. ', '.
+ 'STDERR: '. join(" / ", $rsync->err). ', '.
+ 'STDOUT: '. join(" / ", $rsync->out);
+ }
+
+ flock(LOCK,LOCK_UN);
+ close LOCK;
+
+}
+
diff --git a/FS/FS/part_export/vpopmail.pm b/FS/FS/part_export/vpopmail.pm
new file mode 100644
index 000000000..a505a0f47
--- /dev/null
+++ b/FS/FS/part_export/vpopmail.pm
@@ -0,0 +1,226 @@
+package FS::part_export::vpopmail;
+
+use vars qw(@ISA @saltset $exportdir);
+use Fcntl qw(:flock);
+use File::Path;
+use FS::UID qw( datasrc );
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_acct) = (shift, shift);
+ $self->vpopmail_queue( $svc_acct->svcnum, 'insert',
+ $svc_acct->username,
+ crypt($svc_acct->_password,$saltset[int(rand(64))].$saltset[int(rand(64))]),
+ $svc_acct->domain,
+ $svc_acct->quota,
+ $svc_acct->finger,
+ );
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+
+ my $cpassword = crypt(
+ $new->_password, $saltset[int(rand(64))].$saltset[int(rand(64))]
+ );
+
+ return "can't change username with vpopmail"
+ if $old->username ne $new->username;
+
+ #no.... if mail can't be preserved, better to disallow username changes
+ #if ($old->username ne $new->username || $old->domain ne $new->domain ) {
+ # vpopmail_queue( $svc_acct->svcnum, 'delete',
+ # $old->username, $old->domain
+ # );
+ # vpopmail_queue( $svc_acct->svcnum, 'insert',
+ # $new->username,
+ # $cpassword,
+ # $new->domain,
+ # );
+
+ return '' unless $old->_password ne $new->_password;
+
+ $self->vpopmail_queue( $new->svcnum, 'replace',
+ $new->username, $cpassword, $new->domain, $new->quota, $new->finger );
+}
+
+sub _export_delete {
+ my( $self, $svc_acct ) = (shift, shift);
+ $self->vpopmail_queue( $svc_acct->svcnum, 'delete',
+ $svc_acct->username, $svc_acct->domain );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub vpopmail_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+
+ my $exportdir = "/usr/local/etc/freeside/export." . datasrc;
+ mkdir $exportdir, 0700 or die $! unless -d $exportdir;
+ $exportdir .= "/vpopmail";
+ mkdir $exportdir, 0700 or die $! unless -d $exportdir;
+ $exportdir .= '/'. $self->machine;
+ mkdir $exportdir, 0700 or die $! unless -d $exportdir;
+ mkdir "$exportdir/domains", 0700 or die $! unless -d "$exportdir/domains";
+
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::vpopmail::vpopmail_$method",
+ };
+ $queue->insert(
+ $exportdir,
+ $self->machine,
+ $self->option('dir'),
+ $self->option('uid'),
+ $self->option('gid'),
+ $self->option('restart'),
+ @_
+ );
+}
+
+sub vpopmail_insert { #subroutine, not method
+ my( $exportdir, $machine, $dir, $uid, $gid, $restart ) = splice @_,0,6;
+ my( $username, $password, $domain, $quota, $finger ) = @_;
+
+ mkdir "$exportdir/domains/$domain", 0700 or die $!
+ unless -d "$exportdir/domains/$domain";
+
+ (open(VPASSWD, ">>$exportdir/domains/$domain/vpasswd")
+ and flock(VPASSWD,LOCK_EX)
+ ) or die "can't open vpasswd file for $username\@$domain: ".
+ "$exportdir/domains/$domain/vpasswd: $!";
+ print VPASSWD join(":",
+ $username,
+ $password,
+ '1',
+ '0',
+ $finger,
+ "$dir/domains/$domain/$username",
+ $quota ? $quota.'S' : 'NOQUOTA',
+ ), "\n";
+
+ flock(VPASSWD,LOCK_UN);
+ close(VPASSWD);
+
+ for my $mkdir (
+ grep { ! -d $_ } map { "$exportdir/domains/$domain/$username$_" }
+ ( '', qw( /Maildir /Maildir/cur /Maildir/new /Maildir/tmp ) )
+ ) {
+ mkdir $mkdir, 0700 or die "can't mkdir $mkdir: $!";
+ }
+
+ vpopmail_sync( $exportdir, $machine, $dir, $uid, $gid, $restart );
+
+}
+
+sub vpopmail_replace { #subroutine, not method
+ my( $exportdir, $machine, $dir, $uid, $gid, $restart ) = splice @_,0,6;
+ my( $username, $password, $domain, $quota, $finger ) = @_;
+
+ (open(VPASSWD, "$exportdir/domains/$domain/vpasswd")
+ and flock(VPASSWD,LOCK_EX)
+ ) or die "can't open $exportdir/domains/$domain/vpasswd: $!";
+
+ open(VPASSWDTMP, ">$exportdir/domains/$domain/vpasswd.tmp")
+ or die "Can't open $exportdir/domains/$domain/vpasswd.tmp: $!";
+
+ while (<VPASSWD>) {
+ my ($mailbox, $pw, $vuid, $vgid, $vfinger, $vdir, $vquota, @rest) =
+ split(':', $_);
+ if ( $username ne $mailbox ) {
+ print VPASSWDTMP $_;
+ next
+ }
+ print VPASSWDTMP join (':',
+ $mailbox,
+ $password,
+ '1',
+ '0',
+ $finger,
+ "$dir/domains/$domain/$username", #$vdir
+ $quota ? $quota.'S' : 'NOQUOTA',
+ ), "\n";
+ }
+
+ close(VPASSWDTMP);
+
+ rename "$exportdir/domains/$domain/vpasswd.tmp", "$exportdir/domains/$domain/vpasswd"
+ or die "Can't rename $exportdir/domains/$domain/vpasswd.tmp: $!";
+
+ flock(VPASSWD,LOCK_UN);
+ close(VPASSWD);
+
+ vpopmail_sync( $exportdir, $machine, $dir, $uid, $gid, $restart );
+
+}
+
+sub vpopmail_delete { #subroutine, not method
+ my( $exportdir, $machine, $dir, $uid, $gid, $restart ) = splice @_,0,6;
+ my( $username, $domain ) = @_;
+
+ (open(VPASSWD, "$exportdir/domains/$domain/vpasswd")
+ and flock(VPASSWD,LOCK_EX)
+ ) or die "can't open $exportdir/domains/$domain/vpasswd: $!";
+
+ open(VPASSWDTMP, ">$exportdir/domains/$domain/vpasswd.tmp")
+ or die "Can't open $exportdir/domains/$domain/vpasswd.tmp: $!";
+
+ while (<VPASSWD>) {
+ my ($mailbox, $rest) = split(':', $_);
+ print VPASSWDTMP $_ unless $username eq $mailbox;
+ }
+
+ close(VPASSWDTMP);
+
+ rename "$exportdir/domains/$domain/vpasswd.tmp",
+ "$exportdir/domains/$domain/vpasswd"
+ or die "Can't rename $exportdir/domains/$domain/vpasswd.tmp: $!";
+
+ flock(VPASSWD,LOCK_UN);
+ close(VPASSWD);
+
+ rmtree "$exportdir/domains/$domain/$username"
+ or die "can't rmtree $exportdir/domains/$domain/$username: $!";
+
+ vpopmail_sync( $exportdir, $machine, $dir, $uid, $gid, $restart );
+}
+
+sub vpopmail_sync {
+ my( $exportdir, $machine, $dir, $uid, $gid, $restart ) = splice @_,0,6;
+
+ chdir $exportdir;
+# my @args = ( $rsync, "-rlpt", "-e", $ssh, "domains/",
+# "vpopmail\@$machine:$dir/domains/" );
+# system {$args[0]} @args;
+
+ eval "use File::Rsync;";
+ die $@ if $@;
+
+ my $rsync = File::Rsync->new({ rsh => 'ssh' });
+
+ $rsync->exec( {
+ recursive => 1,
+ perms => 1,
+ times => 1,
+ src => "$exportdir/domains/",
+ dest => "vpopmail\@$machine:$dir/domains/",
+ } ); # true/false return value from exec is not working, alas
+ if ( $rsync->err ) {
+ die "error uploading to vpopmail\@$machine:$dir/domains/ : ".
+ 'exit status: '. $rsync->status. ', '.
+ 'STDERR: '. join(" / ", $rsync->err). ', '.
+ 'STDOUT: '. join(" / ", $rsync->out);
+ }
+
+ eval "use Net::SSH qw(ssh);";
+ die $@ if $@;
+
+ ssh("vpopmail\@$machine", $restart) if $restart;
+}
+
+
diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm
new file mode 100644
index 000000000..20658c7a2
--- /dev/null
+++ b/FS/FS/part_export/www_shellcommands.pm
@@ -0,0 +1,109 @@
+package FS::part_export::www_shellcommands;
+
+use strict;
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self) = shift;
+ $self->_export_command('useradd', @_);
+}
+
+sub _export_delete {
+ my($self) = shift;
+ $self->_export_command('userdel', @_);
+}
+
+sub _export_command {
+ my ( $self, $action, $svc_www) = (shift, shift, shift);
+ my $command = $self->option($action);
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${$_} = $svc_www->getfield($_) foreach $svc_www->fields;
+ }
+ my $domain_record = $svc_www->domain_record; # or die ?
+ my $zone = $domain_record->zone; # or die ?
+ my $svc_acct = $svc_www->svc_acct; # or die ?
+ my $username = $svc_acct->username;
+ my $homedir = $svc_acct->dir; # or die ?
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $svc_www->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+sub _export_replace {
+ my($self, $new, $old ) = (shift, shift, shift);
+ my $command = $self->option('usermod');
+
+ #set variable for the command
+ no strict 'vars';
+ {
+ no strict 'refs';
+ ${"old_$_"} = $old->getfield($_) foreach $old->fields;
+ ${"new_$_"} = $new->getfield($_) foreach $new->fields;
+ }
+ my $old_domain_record = $old->domain_record; # or die ?
+ my $old_zone = $old_domain_record->reczone; # or die ?
+ unless ( $old_zone =~ /\.$/ ) {
+ my $old_svc_domain = $old_domain_record->svc_domain; # or die ?
+ $old_zone .= '.'. $old_svc_domain->domain;
+ }
+
+ my $old_svc_acct = $old->svc_acct; # or die ?
+ my $old_username = $old_svc_acct->username;
+ my $old_homedir = $old_svc_acct->dir; # or die ?
+
+ my $new_domain_record = $new->domain_record; # or die ?
+ my $new_zone = $new_domain_record->reczone; # or die ?
+ unless ( $new_zone =~ /\.$/ ) {
+ my $new_svc_domain = $new_domain_record->svc_domain; # or die ?
+ $new_zone .= '.'. $new_svc_domain->domain;
+ }
+
+ my $new_svc_acct = $new->svc_acct; # or die ?
+ my $new_username = $new_svc_acct->username;
+ my $new_homedir = $new_svc_acct->dir; # or die ?
+
+ #done setting variables for the command
+
+ $self->shellcommands_queue( $new->svcnum,
+ user => $self->option('user')||'root',
+ host => $self->machine,
+ command => eval(qq("$command")),
+ );
+}
+
+#a good idea to queue anything that could fail or take any time
+sub shellcommands_queue {
+ my( $self, $svcnum ) = (shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::www_shellcommands::ssh_cmd",
+ };
+ $queue->insert( @_ );
+}
+
+sub ssh_cmd { #subroutine, not method
+ use Net::SSH '0.07';
+ &Net::SSH::ssh_cmd( { @_ } );
+}
+
+#sub shellcommands_insert { #subroutine, not method
+#}
+#sub shellcommands_replace { #subroutine, not method
+#}
+#sub shellcommands_delete { #subroutine, not method
+#}
+
diff --git a/FS/FS/part_export_option.pm b/FS/FS/part_export_option.pm
new file mode 100644
index 000000000..a0b19fde1
--- /dev/null
+++ b/FS/FS/part_export_option.pm
@@ -0,0 +1,134 @@
+package FS::part_export_option;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::part_export;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::part_export_option - Object methods for part_export_option records
+
+=head1 SYNOPSIS
+
+ use FS::part_export_option;
+
+ $record = new FS::part_export_option \%hash;
+ $record = new FS::part_export_option { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_export_option object represents an export option.
+FS::part_export_option inherits from FS::Record. The following fields are
+currently supported:
+
+=over 4
+
+=item optionnum - primary key
+
+=item exportnum - export (see L<FS::part_export>)
+
+=item optionname - option name
+
+=item optionvalue - option value
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new export option. To add the export option to the database, see
+L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'part_export_option'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid export option. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('optionnum')
+ || $self->ut_number('exportnum')
+ || $self->ut_alpha('optionname')
+ || $self->ut_anything('optionvalue')
+ ;
+ return $error if $error;
+
+ return "Unknown exportnum: ". $self->exportnum
+ unless qsearchs('part_export', { 'exportnum' => $self->exportnum } );
+
+ #check options & values?
+
+ ''; #no error
+}
+
+=back
+
+=head1 BUGS
+
+Possibly.
+
+=head1 SEE ALSO
+
+L<FS::part_export>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm
new file mode 100644
index 000000000..6525864c4
--- /dev/null
+++ b/FS/FS/part_pkg.pm
@@ -0,0 +1,320 @@
+package FS::part_pkg;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch dbh );
+use FS::pkg_svc;
+use FS::agent_type;
+use FS::type_pkgs;
+use FS::Conf;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::part_pkg - Object methods for part_pkg objects
+
+=head1 SYNOPSIS
+
+ use FS::part_pkg;
+
+ $record = new FS::part_pkg \%hash
+ $record = new FS::part_pkg { 'column' => 'value' };
+
+ $custom_record = $template_record->clone;
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ @pkg_svc = $record->pkg_svc;
+
+ $svcnum = $record->svcpart;
+ $svcnum = $record->svcpart( 'svc_acct' );
+
+=head1 DESCRIPTION
+
+An FS::part_pkg object represents a billing item definition. FS::part_pkg
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item pkgpart - primary key (assigned automatically for new billing item definitions)
+
+=item pkg - Text name of this billing item definition (customer-viewable)
+
+=item comment - Text name of this billing item definition (non-customer-viewable)
+
+=item setup - Setup fee expression
+
+=item freq - Frequency of recurring fee
+
+=item recur - Recurring fee expression
+
+=item setuptax - Setup fee tax exempt flag, empty or `Y'
+
+=item recurtax - Recurring fee tax exempt flag, empty or `Y'
+
+=item taxclass - Tax class flag
+
+=item plan - Price plan
+
+=item plandata - Price plan data
+
+=item disabled - Disabled flag, empty or `Y'
+
+=back
+
+setup and recur are evaluated as Safe perl expressions. You can use numbers
+just as you would normally. More advanced semantics are not yet defined.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new billing item definition. To add the billing item definition to
+the database, see L<"insert">.
+
+=cut
+
+sub table { 'part_pkg'; }
+
+=item clone
+
+An alternate constructor. Creates a new billing item definition by duplicating
+an existing definition. A new pkgpart is assigned and `(CUSTOM) ' is prepended
+to the comment field. To add the billing item definition to the database, see
+L<"insert">.
+
+=cut
+
+sub clone {
+ my $self = shift;
+ my $class = ref($self);
+ my %hash = $self->hash;
+ $hash{'pkgpart'} = '';
+ $hash{'comment'} = "(CUSTOM) ". $hash{'comment'}
+ unless $hash{'comment'} =~ /^\(CUSTOM\) /;
+ #new FS::part_pkg ( \%hash ); # ?
+ new $class ( \%hash ); # ?
+}
+
+=item insert
+
+Adds this billing item definition to the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ my $conf = new FS::Conf;
+
+ if ( $conf->exists('agent_defaultpkg') ) {
+ foreach my $agent_type ( qsearch('agent_type', {} ) ) {
+ my $type_pkgs = new FS::type_pkgs({
+ 'typenum' => $agent_type->typenum,
+ 'pkgpart' => $self->pkgpart,
+ });
+ my $error = $type_pkgs->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item delete
+
+Currently unimplemented.
+
+=cut
+
+sub delete {
+ return "Can't (yet?) delete package definitions.";
+# check & make sure the pkgpart isn't in cust_pkg or type_pkgs?
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid billing item definition. If
+there is an error, returns the error, otherwise returns false. Called by the
+insert and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ for (qw(setup recur)) { $self->set($_=>0) if $self->get($_) =~ /^\s*$/; }
+
+ my $conf = new FS::Conf;
+ if ( $conf->exists('safe-part_pkg') ) {
+
+ my $error = $self->ut_anything('setup')
+ || $self->ut_anything('recur');
+ return $error if $error;
+
+ my $s = $self->setup;
+
+ $s =~ /^\s*\d*\.?\d*\s*$/
+
+ or $s =~ /^my \$d = \$cust_pkg->bill || \$time; \$d += 86400 \* \s*\d+\s*; \$cust_pkg->bill\(\$d\); \$cust_pkg_mod_flag=1; \s*\d*\.?\d*\s*$/
+
+ or do {
+ #log!
+ return "illegal setup: $s";
+ };
+
+ my $r = $self->recur;
+
+ $r =~ /^\s*\d*\.?\d*\s*$/
+
+ #or $r =~ /^\$sdate += 86400 \* \s*\d+\s*; \s*\d*\.?\d*\s*$/
+
+ or $r =~ /^my \$mnow = \$sdate; my \(\$sec,\$min,\$hour,\$mday,\$mon,\$year\) = \(localtime\(\$sdate\) \)\[0,1,2,3,4,5\]; my \$mstart = timelocal\(0,0,0,1,\$mon,\$year\); my \$mend = timelocal\(0,0,0,1, \$mon == 11 \? 0 : \$mon\+1, \$year\+\(\$mon==11\)\); \$sdate = \$mstart; \( \$part_pkg->freq \- 1 \) \* \d*\.?\d* \/ \$part_pkg\-\>freq \+ \d*\.?\d* \/ \$part_pkg\-\>freq \* \(\$mend\-\$mnow\) \/ \(\$mend\-\$mstart\) ;\s*$/
+
+ or $r =~ /^my \$mnow = \$sdate; my \(\$sec,\$min,\$hour,\$mday,\$mon,\$year\) = \(localtime\(\$sdate\) \)\[0,1,2,3,4,5\]; \$sdate = timelocal\(0,0,0,1,\$mon,\$year\); \s*\d*\.?\d*\s*;\s*$/
+
+ or $r =~ /^my \$error = \$cust_pkg\->cust_main\->credit\( \s*\d*\.?\d*\s* \* scalar\(\$cust_pkg\->cust_main\->referral_cust_main_ncancelled\(\s*\d+\s*\)\), "commission" \); die \$error if \$error; \s*\d*\.?\d*\s*;\s*$/
+
+ or $r =~ /^my \$error = \$cust_pkg\->cust_main\->credit\( \s*\d*\.?\d*\s* \* scalar\(\$cust_pkg\->cust_main->referral_cust_pkg\(\s*\d+\s*\)\), "commission" \); die \$error if \$error; \s*\d*\.?\d*\s*;\s*$/
+
+ or $r =~ /^my \$error = \$cust_pkg\->cust_main\->credit\( \s*\d*\.?\d*\s* \* scalar\( grep \{ my \$pkgpart = \$_\->pkgpart; grep \{ \$_ == \$pkgpart \} \(\s*(\s*\d+,\s*)*\s*\) \} \$cust_pkg\->cust_main->referral_cust_pkg\(\s*\d+\s*\)\), "commission" \); die \$error if \$error; \s*\d*\.?\d*\s*;\s*$/
+
+ or $r =~ /^my \$hours = \$cust_pkg\->seconds_since\(\$cust_pkg\->bill \|\| 0\) \/ 3600 \- \s*\d*\.?\d*\s*; \$hours = 0 if \$hours < 0; \s*\d*\.?\d*\s* \+ \s*\d*\.?\d*\s* \* \$hours;\s*$/
+
+ or $r =~ /^my \$min = \$cust_pkg\->seconds_since\(\$cust_pkg\->bill \|\| 0\) \/ 60 \- \s*\d*\.?\d*\s*; \$min = 0 if \$min < 0; \s*\d*\.?\d*\s* \+ \s*\d*\.?\d*\s* \* \$min;\s*$/
+
+ or $r =~ /^my \$last_bill = \$cust_pkg\->last_bill; my \$hours = \$cust_pkg\->seconds_since_sqlradacct\(\$last_bill, \$sdate \) \/ 3600 - \s*\d\.?\d*\s*; \$hours = 0 if \$hours < 0; my \$input = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctInputOctets" \) \/ 1048576; my \$output = \$cust_pkg\->attribute_since_sqlradacct\(\$last_bill, \$sdate, "AcctOutputOctets" \) \/ 1048576; my \$total = \$input \+ \$output \- \s*\d\.?\d*\s*; \$total = 0 if \$total < 0; my \$input = \$input - \s*\d\.?\d*\s*; \$input = 0 if \$input < 0; my \$output = \$output - \s*\d\.?\d*\s*; \$output = 0 if \$output < 0; \s*\d\.?\d*\s* \+ \s*\d\.?\d*\s* \* \$hours \+ \s*\d\.?\d*\s* \* \$input \+ \s*\d\.?\d*\s* \* \$output \+ \s*\d\.?\d*\s* \* \$total *;\s*$/
+
+ or do {
+ #log!
+ return "illegal recur: $r";
+ };
+
+ }
+
+ $self->ut_numbern('pkgpart')
+ || $self->ut_text('pkg')
+ || $self->ut_text('comment')
+ || $self->ut_anything('setup')
+ || $self->ut_number('freq')
+ || $self->ut_anything('recur')
+ || $self->ut_alphan('plan')
+ || $self->ut_anything('plandata')
+ || $self->ut_enum('setuptax', [ '', 'Y' ] )
+ || $self->ut_enum('recurtax', [ '', 'Y' ] )
+ || $self->ut_textn('taxclass')
+ || $self->ut_enum('disabled', [ '', 'Y' ] )
+ ;
+}
+
+=item pkg_svc
+
+Returns all FS::pkg_svc objects (see L<FS::pkg_svc>) for this package
+definition (with non-zero quantity).
+
+=cut
+
+sub pkg_svc {
+ my $self = shift;
+ grep { $_->quantity } qsearch( 'pkg_svc', { 'pkgpart' => $self->pkgpart } );
+}
+
+=item svcpart [ SVCDB ]
+
+Returns the svcpart of a single service definition (see L<FS::part_svc>)
+associated with this billing item definition (see L<FS::pkg_svc>). Returns
+false if there not exactly one service definition with quantity 1, or if
+SVCDB is specified and does not match the svcdb of the service definition,
+
+=cut
+
+sub svcpart {
+ my $self = shift;
+ my $svcdb = scalar(@_) ? shift : '';
+ my @pkg_svc = grep {
+ $_->quantity == 1
+ && ( $svcdb eq $_->part_svc->svcdb || !$svcdb )
+ } $self->pkg_svc;
+ return '' if scalar(@pkg_svc) != 1;
+ $pkg_svc[0]->svcpart;
+}
+
+=item payby
+
+Returns a list of the acceptable payment types for this package. Eventually
+this should come out of a database table and be editable, but currently has the
+following logic instead;
+
+If the package has B<0> setup and B<0> recur, the single item B<BILL> is
+returned, otherwise, the single item B<CARD> is returned.
+
+(CHEK? LEC? Probably shouldn't accept those by default, prone to abuse)
+
+=cut
+
+sub payby {
+ my $self = shift;
+ #if ( $self->setup == 0 && $self->recur == 0 ) {
+ if ( $self->setup =~ /^\s*0+(\.0*)?\s*$/
+ && $self->recur =~ /^\s*0+(\.0*)?\s*$/ ) {
+ ( 'BILL' );
+ } else {
+ ( 'CARD' );
+ }
+}
+
+=back
+
+=head1 BUGS
+
+The delete method is unimplemented.
+
+setup and recur semantics are not yet defined (and are implemented in
+FS::cust_bill. hmm.).
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_pkg>, L<FS::type_pkgs>, L<FS::pkg_svc>, L<Safe>.
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_pop_local.pm b/FS/FS/part_pop_local.pm
new file mode 100644
index 000000000..0b7cdf6c9
--- /dev/null
+++ b/FS/FS/part_pop_local.pm
@@ -0,0 +1,116 @@
+package FS::part_pop_local;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record; # qw( qsearchs );
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::part_pop_local - Object methods for part_pop_local records
+
+=head1 SYNOPSIS
+
+ use FS::part_pop_local;
+
+ $record = new FS::part_pop_local \%hash;
+ $record = new FS::part_pop_local { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_pop_local object represents a local call area. Each
+FS::part_pop_local record maps a NPA/NXX (area code and exchange) to the POP
+(see L<FS::svc_acct_pop>) which is a local call. FS::part_pop_local inherits
+from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item localnum - primary key (assigned automatically for new accounts)
+
+=item popnum - see L<FS::svc_acct_pop>
+
+=item city
+
+=item state
+
+=item npa - area code
+
+=item nxx - exchange
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new point of presence (if only it were that easy!). To add the
+point of presence to the database, see L<"insert">.
+
+=cut
+
+sub table { 'part_pop_local'; }
+
+=item insert
+
+Adds this point of presence to the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item delete
+
+Removes this point of presence from the database.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid point of presence. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('localnum')
+ or $self->ut_numbern('popnum')
+ or $self->ut_text('city')
+ or $self->ut_text('state')
+ or $self->ut_number('npa')
+ or $self->ut_number('nxx')
+ ;
+
+}
+
+=back
+
+=head1 VERSION
+
+$Id: part_pop_local.pm,v 1.1 2001-09-26 09:17:06 ivan Exp $
+
+=head1 BUGS
+
+US/CA-centric.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::svc_acct_pop>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_referral.pm b/FS/FS/part_referral.pm
new file mode 100644
index 000000000..23885dffd
--- /dev/null
+++ b/FS/FS/part_referral.pm
@@ -0,0 +1,116 @@
+package FS::part_referral;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::part_referral - Object methods for part_referral objects
+
+=head1 SYNOPSIS
+
+ use FS::part_referral;
+
+ $record = new FS::part_referral \%hash
+ $record = new FS::part_referral { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_referral represents a advertising source - where a customer heard
+of your services. This can be used to track the effectiveness of a particular
+piece of advertising, for example. FS::part_referral inherits from FS::Record.
+The following fields are currently supported:
+
+=over 4
+
+=item refnum - primary key (assigned automatically for new referrals)
+
+=item referral - Text name of this advertising source
+
+=back
+
+=head1 NOTE
+
+These were called B<referrals> before version 1.4.0 - the name was changed
+so as not to be confused with the new customer-to-customer referrals.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new advertising source. To add the referral to the database, see
+L<"insert">.
+
+=cut
+
+sub table { 'part_referral'; }
+
+=item insert
+
+Adds this advertising source to the database. If there is an error, returns
+the error, otherwise returns false.
+
+=item delete
+
+Currently unimplemented.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ return "Can't (yet?) delete part_referral records";
+ #need to make sure no customers have this referral!
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid advertising source. If there is
+an error, returns the error, otherwise returns false. Called by the insert and
+replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('refnum')
+ || $self->ut_text('referral')
+ ;
+}
+
+=back
+
+=head1 BUGS
+
+The delete method is unimplemented.
+
+`Advertising source'. Yes, it's a sucky name. The only other ones I could
+come up with were "Marketing channel" and "Heard Abouts" and those are
+definately both worse.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_main>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_router_field.pm b/FS/FS/part_router_field.pm
new file mode 100755
index 000000000..73ca50fb6
--- /dev/null
+++ b/FS/FS/part_router_field.pm
@@ -0,0 +1,134 @@
+package FS::part_router_field;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::router_field;
+use FS::router;
+
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::part_router_field - Object methods for part_router_field records
+
+=head1 SYNOPSIS
+
+ use FS::part_router_field;
+
+ $record = new FS::part_router_field \%hash;
+ $record = new FS::part_router_field { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+A part_router_field represents an xfield definition for routers. For more
+information on xfields, see L<FS::part_sb_field>.
+
+The following fields are supported:
+
+=over 4
+
+=item routerfieldpart - primary key (assigned automatically)
+
+=item name - name of field
+
+=item length
+
+=item check_block
+
+=item list_source
+
+(See L<FS::part_sb_field> for details on these fields.)
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see "insert".
+
+=cut
+
+sub table { 'part_router_field'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $error = '';
+
+ $self->name =~ /^([a-z0-9_\-\.]{1,15})$/i
+ or return "Invalid field name for part_router_field";
+
+ ''; #no error
+}
+
+=item list_values
+
+Equivalent to "eval($part_router_field->list_source)".
+
+=cut
+
+sub list_values {
+ my $self = shift;
+ return () unless $self->list_source;
+ my @opts = eval($self->list_source);
+ if($@) {
+ warn $@;
+ return ();
+ } else {
+ return @opts;
+ }
+}
+
+=back
+
+=head1 VERSION
+
+$Id:
+
+=head1 BUGS
+
+Needless duplication of much of FS::part_sb_field, with the result that most of
+the warnings about it apply here also.
+
+=head1 SEE ALSO
+
+FS::svc_broadband, FS::router, FS::router_field, schema.html
+from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_sb_field.pm b/FS/FS/part_sb_field.pm
new file mode 100755
index 000000000..8dca946b5
--- /dev/null
+++ b/FS/FS/part_sb_field.pm
@@ -0,0 +1,267 @@
+package FS::part_sb_field;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::part_sb_field - Object methods for part_sb_field records
+
+=head1 SYNOPSIS
+
+ use FS::part_sb_field;
+
+ $record = new FS::part_sb_field \%hash;
+ $record = new FS::part_sb_field { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_sb_field object represents an extended field (xfield) definition
+for svc_broadband's sb_field mechanism (see L<FS::svc_broadband>).
+FS::part_sb_field inherits from FS::Record. The following fields are
+currently supported:
+
+=over 2
+
+=item sbfieldpart - primary key (assigned automatically)
+
+=item name - name of the field
+
+=item svcpart - service type for which this field is available (see L<FS::part_svc>)
+
+=item length - length of the contents of the field (see note #1)
+
+=item check_block - validation routine (see note #2)
+
+=item list_source - enumeration routine (see note #3)
+
+=back
+
+=head1 BACKGROUND
+
+Broadband services, unlike dialup services, are provided over a wide
+variety of physical media (DSL, wireless, cable modems, digital circuits)
+and network architectures (Ethernet, PPP, ATM). For many of these access
+mechanisms, adding a new customer requires knowledge of some properties
+of the physical connection (circuit number, the type of CPE in use, etc.).
+It is unreasonable to expect ISPs to alter Freeside's schema (and the
+associated library and UI code) to make each of these parameters a field in
+svc_broadband.
+
+Hence sb_field and part_sb_field. They allow the Freeside administrator to
+define 'extended fields' ('xfields') associated with svc_broadband records.
+These are I<not> processed in any way by Freeside itself; they exist solely for
+use by exports (see L<FS::part_export>) and technical support staff.
+
+For a parallel mechanism (at the per-router level rather than per-service),
+see L<FS::part_router_field>.
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see "insert".
+
+=cut
+
+sub table { 'part_sb_field'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $error = '';
+
+ $error = $self->ut_numbern('svcpart');
+ return $error if $error;
+
+ unless (qsearchs('part_svc', { svcpart => $self->svcpart }))
+ { return "Unknown svcpart: " . $self->svcpart;}
+
+ $self->name =~ /^([a-z0-9_\-\.]{1,15})$/i
+ or return "Invalid field name for part_sb_field";
+
+ #How to check input_block, display_block, and check_block?
+
+ ''; #no error
+}
+
+=item list_values
+
+If the I<list_source> field is set, this method eval()s it and
+returns its output. If the field is empty, list_values returns
+an empty list.
+
+Any arguments passed to this method will be received by the list_source
+code, but this behavior is a fortuitous accident and may be removed in
+the future.
+
+=cut
+
+sub list_values {
+ my $self = shift;
+ return () unless $self->list_source;
+
+ my @opts = eval($self->list_source);
+ if($@) {
+ warn $@;
+ return ();
+ } else {
+ return @opts;
+ }
+}
+
+=item part_svc
+
+Returns the FS::part_svc object associated with this field definition.
+
+=cut
+
+sub part_svc {
+ my $self = shift;
+ return qsearchs('part_svc', { svcpart => $self->svcpart });
+}
+
+=back
+
+=head1 VERSION
+
+$Id:
+
+=head1 NOTES
+
+=over
+
+=item 1.
+
+The I<length> field is not enforced. It provides a hint to UI
+code about how to display the field on a form. If you want to enforce a
+minimum or maximum length for a field, use a I<check_block>.
+
+=item 2.
+
+The check_block mechanism used here as well as in
+FS::part_router_field allows the user to define validation rules.
+
+When FS::sb_field::check is called, the proposed value of the xfield is
+assigned to $_. The check_block is then eval()'d and its return value
+captured. If the return value is false (empty/zero/undef), $_ is then assigned
+back into the field and stored in the database.
+
+Therefore a check_block can do three different things with the value: allow
+it, allow it with a modification, or reject it. This is very flexible, but
+somewhat dangerous. Some warnings:
+
+=over 2
+
+=item *
+
+Assume that $_ has had I<no> error checking prior to the
+check_block. That's what the check_block is for, after all. It could
+contain I<anything>: evil shell commands in backquotes, 100kb JPEG images,
+the Klez virus, whatever.
+
+=item *
+
+If your check_block modifies the input value, it should probably
+produce a value that wouldn't be modified by going through the same
+check_block again. (That is, it should map input values into its own
+eigenspace.) The reason is that if someone calls $new->replace($old),
+where $new and $old contain the same value for the field, they probably
+want the field to keep its old value, not to get transformed by the
+check_block again. So don't do silly things like '$_++' or
+'tr/A-Za-z/a-zA-Z/'.
+
+=item *
+
+Don't alter the contents of the database. I<Reading> the database
+is perfectly reasonable, but writing to it is a bad idea. Remember that
+check() might get called more than once, as described above.
+
+=item *
+
+The check_block probably won't even get called if the user submits
+an I<empty> sb_field. So at present, you can't set up a default value with
+something like 's/^$/foo/'. Conversely, don't replace the submitted value
+with an empty string. It probably will get stored, but might be deleted at
+any time.
+
+=back
+
+=item 3.
+
+The list_source mechanism is a UI hint (like length) to generate
+drop-down or list boxes. If list_source contains a value, the UI code can
+eval() it and use the results as the options on the list.
+
+Note 'can'. This is not a substitute for check_block. The HTML interface
+currently requires that the user pick one of the options on the list
+because that's the way HTML drop-down boxes work, but in the future the UI
+code might add an 'Other (please specify)' option and a text box so that
+the user can enter something else. Or it might ignore list_source and just
+generate a text box. Or the interface might be rewritten in MS Access,
+where drop-down boxes have text boxes built in. Data validation is the job
+of check(), not the front end.
+
+Note also that a list of literals evaluates to itself, so a list_source
+like
+
+C<('Windows', 'MacOS', 'Linux')>
+
+or
+
+C<qw(Windows MacOS Linux)>
+
+means exactly what you'd think.
+
+=head1 BUGS
+
+The lack of any way to do default values. We might add this as another UI
+hint (since, for the most part, it's the UI's job to figure out which fields
+have had values entered into them). In fact, there are lots of things we
+should add as UI hints.
+
+Oh, and the documentation is probably full of lies.
+
+=head1 SEE ALSO
+
+FS::svc_broadband, FS::sb_field, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm
new file mode 100644
index 000000000..63bc2ad1c
--- /dev/null
+++ b/FS/FS/part_svc.pm
@@ -0,0 +1,324 @@
+package FS::part_svc;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs fields dbh );
+use FS::part_svc_column;
+use FS::part_export;
+use FS::export_svc;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::part_svc - Object methods for part_svc objects
+
+=head1 SYNOPSIS
+
+ use FS::part_svc;
+
+ $record = new FS::part_svc \%hash
+ $record = new FS::part_svc { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_svc represents a service definition. FS::part_svc inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item svcpart - primary key (assigned automatically for new service definitions)
+
+=item svc - text name of this service definition
+
+=item svcdb - table used for this service. See L<FS::svc_acct>,
+L<FS::svc_domain>, and L<FS::svc_forward>, among others.
+
+=item disabled - Disabled flag, empty or `Y'
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new service definition. To add the service definition to the
+database, see L<"insert">.
+
+=cut
+
+sub table { 'part_svc'; }
+
+=item insert EXTRA_FIELDS_ARRAYREF
+
+Adds this service definition to the database. If there is an error, returns
+the error, otherwise returns false.
+
+TODOC:
+
+=item I<svcdb>__I<field> - Default or fixed value for I<field> in I<svcdb>.
+
+=item I<svcdb>__I<field>_flag - defines I<svcdb>__I<field> action: null, `D' for default, or `F' for fixed
+
+TODOC: EXTRA_FIELDS_ARRAYREF
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my @fields = ();
+ @fields = @{shift(@_)} if @_;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ my $svcdb = $self->svcdb;
+# my @rows = map { /^${svcdb}__(.*)$/; $1 }
+# grep ! /_flag$/,
+# grep /^${svcdb}__/,
+# fields('part_svc');
+ foreach my $field (
+ grep { $_ ne 'svcnum'
+ && defined( $self->getfield($svcdb.'__'.$_.'_flag') )
+ } (fields($svcdb), @fields)
+ ) {
+ my $part_svc_column = $self->part_svc_column($field);
+ my $previous = qsearchs('part_svc_column', {
+ 'svcpart' => $self->svcpart,
+ 'columnname' => $field,
+ } );
+
+ my $flag = $self->getfield($svcdb.'__'.$field.'_flag');
+ if ( uc($flag) =~ /^([DF])$/ ) {
+ $part_svc_column->setfield('columnflag', $1);
+ $part_svc_column->setfield('columnvalue',
+ $self->getfield($svcdb.'__'.$field)
+ );
+ if ( $previous ) {
+ $error = $part_svc_column->replace($previous);
+ } else {
+ $error = $part_svc_column->insert;
+ }
+ } else {
+ $error = $previous ? $previous->delete : '';
+ }
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item delete
+
+Currently unimplemented.
+
+=cut
+
+sub delete {
+ return "Can't (yet?) delete service definitions.";
+# check & make sure the svcpart isn't in cust_svc or pkg_svc (in any packages)?
+}
+
+=item replace OLD_RECORD [ '1.3-COMPAT' [ , EXTRA_FIELDS_ARRAYREF ] ]
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+TODOC: 1.3-COMPAT
+
+TODOC: EXTRA_FIELDS_ARRAYREF
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ return "Can't change svcdb for an existing service definition!"
+ unless $old->svcdb eq $new->svcdb;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $new->SUPER::replace( $old );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( @_ && $_[0] eq '1.3-COMPAT' ) {
+ shift;
+ my @fields = ();
+ @fields = @{shift(@_)} if @_;
+
+ my $svcdb = $new->svcdb;
+ foreach my $field (
+ grep { $_ ne 'svcnum'
+ && defined( $new->getfield($svcdb.'__'.$_.'_flag') )
+ } (fields($svcdb),@fields)
+ ) {
+ my $part_svc_column = $new->part_svc_column($field);
+ my $previous = qsearchs('part_svc_column', {
+ 'svcpart' => $new->svcpart,
+ 'columnname' => $field,
+ } );
+
+ my $flag = $new->getfield($svcdb.'__'.$field.'_flag');
+ if ( uc($flag) =~ /^([DF])$/ ) {
+ $part_svc_column->setfield('columnflag', $1);
+ $part_svc_column->setfield('columnvalue',
+ $new->getfield($svcdb.'__'.$field)
+ );
+ if ( $previous ) {
+ $error = $part_svc_column->replace($previous);
+ } else {
+ $error = $part_svc_column->insert;
+ }
+ } else {
+ $error = $previous ? $previous->delete : '';
+ }
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ } else {
+ $dbh->rollback if $oldAutoCommit;
+ return 'non-1.3-COMPAT interface not yet written';
+ #not yet implemented
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item check
+
+Checks all fields to make sure this is a valid service definition. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $recref = $self->hashref;
+
+ my $error;
+ $error=
+ $self->ut_numbern('svcpart')
+ || $self->ut_text('svc')
+ || $self->ut_alpha('svcdb')
+ || $self->ut_enum('disabled', [ '', 'Y' ] )
+ ;
+ return $error if $error;
+
+ my @fields = eval { fields( $recref->{svcdb} ) }; #might die
+ return "Unknown svcdb!" unless @fields;
+
+ ''; #no error
+}
+
+=item part_svc_column COLUMNNAME
+
+Returns the part_svc_column object (see L<FS::part_svc_column>) for the given
+COLUMNNAME, or a new part_svc_column object if none exists.
+
+=cut
+
+sub part_svc_column {
+ my( $self, $columnname) = @_;
+ $self->svcpart &&
+ qsearchs('part_svc_column', {
+ 'svcpart' => $self->svcpart,
+ 'columnname' => $columnname,
+ }
+ ) or new FS::part_svc_column {
+ 'svcpart' => $self->svcpart,
+ 'columnname' => $columnname,
+ };
+}
+
+=item all_part_svc_column
+
+=cut
+
+sub all_part_svc_column {
+ my $self = shift;
+ qsearch('part_svc_column', { 'svcpart' => $self->svcpart } );
+}
+
+=item part_export [ EXPORTTYPE ]
+
+Returns all exports (see L<FS::part_export>) for this service, or, if an
+export type is specified, only returns exports of the given type.
+
+=cut
+
+sub part_export {
+ my $self = shift;
+ my %search;
+ $search{'exporttype'} = shift if @_;
+ map { qsearchs('part_export', { 'exportnum' => $_->exportnum, %search } ) }
+ qsearch('export_svc', { 'svcpart' => $self->svcpart } );
+}
+
+=back
+
+=head1 BUGS
+
+Delete is unimplemented.
+
+The list of svc_* tables is hardcoded. When svc_acct_pop is renamed, this
+should be fixed.
+
+all_part_svc_column method should be documented
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::part_svc_column>, L<FS::part_pkg>, L<FS::pkg_svc>,
+L<FS::cust_svc>, L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_svc_column.pm b/FS/FS/part_svc_column.pm
new file mode 100644
index 000000000..37e841e87
--- /dev/null
+++ b/FS/FS/part_svc_column.pm
@@ -0,0 +1,118 @@
+package FS::part_svc_column;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( fields );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::part_svc_column - Object methods for part_svc_column objects
+
+=head1 SYNOPSIS
+
+ use FS::part_svc_column;
+
+ $record = new FS::part_svc_column \%hash
+ $record = new FS::part_svc_column { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::part_svc_column record represents a service definition column
+constraint. FS::part_svc_column inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item columnnum - primary key (assigned automatcially for new records)
+
+=item svcpart - service definition (see L<FS::part_svc>)
+
+=item columnname - column name in part_svc.svcdb table
+
+=item columnvalue - default or fixed value for the column
+
+=item columnflag - null, D or F
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new column constraint. To add the column constraint to the database, see L<"insert">.
+
+=cut
+
+sub table { 'part_svc_column'; }
+
+=item insert
+
+Adds this service definition to the database. If there is an error, returns
+the error, otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('columnnum')
+ || $self->ut_number('svcpart')
+ || $self->ut_alpha('columnname')
+ || $self->ut_anything('columnvalue')
+ ;
+ return $error if $error;
+
+ $self->columnflag =~ /^([DF])$/
+ or return "illegal columnflag ". $self->columnflag;
+ $self->columnflag(uc($1));
+
+ ''; #no error
+}
+
+=back
+
+=head1 VERSION
+
+$Id: part_svc_column.pm,v 1.1 2001-09-07 20:49:15 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::part_svc>, L<FS::part_pkg>, L<FS::pkg_svc>,
+L<FS::cust_svc>, L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/part_svc_router.pm b/FS/FS/part_svc_router.pm
new file mode 100755
index 000000000..0b23ab580
--- /dev/null
+++ b/FS/FS/part_svc_router.pm
@@ -0,0 +1,32 @@
+package FS::part_svc_router;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw(qsearchs);
+use FS::router;
+use FS::part_svc;
+
+@ISA = qw(FS::Record);
+
+sub table { 'part_svc_router'; }
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
+ || $self->ut_foreign_key('routernum', 'router', 'routernum');
+ return $error if $error;
+ ''; #no error
+}
+
+sub router {
+ my $self = shift;
+ return qsearchs('router', { routernum => $self->routernum });
+}
+
+sub part_svc {
+ my $self = shift;
+ return qsearchs('part_svc', { svcpart => $self->svcpart });
+}
+
+1;
diff --git a/FS/FS/pkg_svc.pm b/FS/FS/pkg_svc.pm
new file mode 100644
index 000000000..3c544ffd8
--- /dev/null
+++ b/FS/FS/pkg_svc.pm
@@ -0,0 +1,152 @@
+package FS::pkg_svc;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::part_pkg;
+use FS::part_svc;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::pkg_svc - Object methods for pkg_svc records
+
+=head1 SYNOPSIS
+
+ use FS::pkg_svc;
+
+ $record = new FS::pkg_svc \%hash;
+ $record = new FS::pkg_svc { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $part_pkg = $record->part_pkg;
+
+ $part_svc = $record->part_svc;
+
+=head1 DESCRIPTION
+
+An FS::pkg_svc record links a billing item definition (see L<FS::part_pkg>) to
+a service definition (see L<FS::part_svc>). FS::pkg_svc inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item pkgpart - Billing item definition (see L<FS::part_pkg>)
+
+=item svcpart - Service definition (see L<FS::part_svc>)
+
+=item quantity - Quantity of this service definition that this billing item
+definition includes
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see L<"insert">.
+
+=cut
+
+sub table { 'pkg_svc'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ return "Can't change pkgpart!" if $old->pkgpart != $new->pkgpart;
+ return "Can't change svcpart!" if $old->svcpart != $new->svcpart;
+
+ $new->SUPER::replace($old);
+}
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error;
+ $error =
+ $self->ut_number('pkgpart')
+ || $self->ut_number('svcpart')
+ || $self->ut_number('quantity')
+ ;
+ return $error if $error;
+
+ return "Unknown pkgpart!" unless $self->part_pkg;
+ return "Unknown svcpart!" unless $self->part_svc;
+
+ ''; #no error
+}
+
+=item part_pkg
+
+Returns the FS::part_pkg object (see L<FS::part_pkg>).
+
+=cut
+
+sub part_pkg {
+ my $self = shift;
+ qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
+}
+
+=item part_svc
+
+Returns the FS::part_svc object (see L<FS::part_svc>).
+
+=cut
+
+sub part_svc {
+ my $self = shift;
+ qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: pkg_svc.pm,v 1.3 2002-06-10 01:39:50 khoff Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::part_pkg>, L<FS::part_svc>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/port.pm b/FS/FS/port.pm
new file mode 100644
index 000000000..13455ca89
--- /dev/null
+++ b/FS/FS/port.pm
@@ -0,0 +1,160 @@
+package FS::port;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::nas;
+use FS::session;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::port - Object methods for port records
+
+=head1 SYNOPSIS
+
+ use FS::port;
+
+ $record = new FS::port \%hash;
+ $record = new FS::port { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $session = $port->session;
+
+=head1 DESCRIPTION
+
+An FS::port object represents an individual port on a NAS. FS::port inherits
+from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item portnum - primary key
+
+=item ip - IP address of this port
+
+=item nasport - port number on the NAS
+
+=item nasnum - NAS this port is on - see L<FS::nas>
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new port. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'port'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_numbern('portnum')
+ || $self->ut_ipn('ip')
+ || $self->ut_numbern('nasport')
+ || $self->ut_number('nasnum');
+ ;
+ return $error if $error;
+ return "Either ip or nasport must be specified"
+ unless $self->ip || $self->nasport;
+ return "Unknown nasnum"
+ unless qsearchs('nas', { 'nasnum' => $self->nasnum } );
+ ''; #no error
+}
+
+=item session
+
+Returns the currently open session on this port, or if no session is currently
+open, the most recent session. See L<FS::session>.
+
+=cut
+
+sub session {
+ my $self = shift;
+ qsearchs('session', { 'portnum' => $self->portnum }, '*',
+ 'ORDER BY login DESC LIMIT 1' );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: port.pm,v 1.5 2001-02-14 04:33:06 ivan Exp $
+
+=head1 BUGS
+
+The author forgot to customize this manpage.
+
+The session method won't deal well if you have multiple open sessions on a
+port, for example if your RADIUS server drops B<stop> records. Suggestions for
+how to deal with this sort of lossage welcome; should we close the session
+when we get a new session on that port? Tag it as invalid somehow? Close it
+one second after it was opened? *sigh* Maybe FS::session shouldn't let you
+create overlapping sessions, at least folks will find out their logging is
+dropping records.
+
+If you think the above refers multiple user logins you need to read the
+manpages again.
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/prepay_credit.pm b/FS/FS/prepay_credit.pm
new file mode 100644
index 000000000..7ed9b8344
--- /dev/null
+++ b/FS/FS/prepay_credit.pm
@@ -0,0 +1,126 @@
+package FS::prepay_credit;
+
+use strict;
+use vars qw( @ISA );
+#use FS::Record qw( qsearch qsearchs );
+use FS::Record qw();
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::prepay_credit - Object methods for prepay_credit records
+
+=head1 SYNOPSIS
+
+ use FS::prepay_credit;
+
+ $record = new FS::prepay_credit \%hash;
+ $record = new FS::prepay_credit {
+ 'identifier' => '4198123455512121'
+ 'amount' => '19.95',
+ };
+
+ $record = new FS::prepay_credit {
+ 'identifier' => '4198123455512121'
+ 'seconds' => '7200',
+ };
+
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::table_name object represents an pre--paid credit, such as a pre-paid
+"calling card". FS::prepay_credit inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item field - description
+
+=item identifier - identifier entered by the user to receive the credit
+
+=item amount - amount of the credit
+
+=item seconds - time amount of credit (see L<FS::svc_acct/seconds>)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new pre-paid credit. To add the example to the database, see
+L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'prepay_credit'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+=item check
+
+Checks all fields to make sure this is a valid pre-paid credit. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $identifier = $self->identifier;
+ $identifier =~ s/\W//g; #anything else would just confuse things
+ $self->identifier($identifier);
+
+ $self->ut_numbern('prepaynum')
+ || $self->ut_alpha('identifier')
+ || $self->ut_money('amount')
+ || $self->utnumbern('seconds')
+ ;
+
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::svc_acct>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/queue.pm b/FS/FS/queue.pm
new file mode 100644
index 000000000..d35dc883f
--- /dev/null
+++ b/FS/FS/queue.pm
@@ -0,0 +1,401 @@
+package FS::queue;
+
+use strict;
+use vars qw( @ISA @EXPORT_OK $conf $jobnums);
+use Exporter;
+use FS::UID;
+use FS::Conf;
+use FS::Record qw( qsearch qsearchs dbh );
+#use FS::queue;
+use FS::queue_arg;
+use FS::queue_depend;
+use FS::cust_svc;
+
+@ISA = qw(FS::Record);
+@EXPORT_OK = qw( joblisting );
+
+$FS::UID::callback{'FS::queue'} = sub {
+ $conf = new FS::Conf;
+};
+
+$jobnums = '';
+
+=head1 NAME
+
+FS::queue - Object methods for queue records
+
+=head1 SYNOPSIS
+
+ use FS::queue;
+
+ $record = new FS::queue \%hash;
+ $record = new FS::queue { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::queue object represents an queued job. FS::queue inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item jobnum - primary key
+
+=item job - fully-qualified subroutine name
+
+=item status - job status
+
+=item statustext - freeform text status message
+
+=item _date - UNIX timestamp
+
+=item svcnum - optional link to service (see L<FS::cust_svc>)
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new job. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'queue'; }
+
+=item insert [ ARGUMENT, ARGUMENT... ]
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+If any arguments are supplied, a queue_arg record for each argument is also
+created (see L<FS::queue_arg>).
+
+=cut
+
+#false laziness w/part_export.pm
+sub insert {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ foreach my $arg ( @_ ) {
+ my $queue_arg = new FS::queue_arg ( {
+ 'jobnum' => $self->jobnum,
+ 'arg' => $arg,
+ } );
+ $error = $queue_arg->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ push @$jobnums, $self->jobnum if $jobnums;
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item delete
+
+Delete this record from the database. Any corresponding queue_arg records are
+deleted as well
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my @del = qsearch( 'queue_arg', { 'jobnum' => $self->jobnum } );
+ push @del, qsearch( 'queue_depend', { 'depend_jobnum' => $self->jobnum } );
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ foreach my $del ( @del ) {
+ $error = $del->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+
+}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid job. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_numbern('jobnum')
+ || $self->ut_anything('job')
+ || $self->ut_numbern('_date')
+ || $self->ut_enum('status',['', qw( new locked failed )])
+ || $self->ut_anything('statustext')
+ || $self->ut_numbern('svcnum')
+ ;
+ return $error if $error;
+
+ $error = $self->ut_foreign_keyn('svcnum', 'cust_svc', 'svcnum');
+ $self->svcnum('') if $error;
+
+ $self->status('new') unless $self->status;
+ $self->_date(time) unless $self->_date;
+
+ ''; #no error
+}
+
+=item args
+
+Returns a list of the arguments associated with this job.
+
+=cut
+
+sub args {
+ my $self = shift;
+ map $_->arg, qsearch( 'queue_arg',
+ { 'jobnum' => $self->jobnum },
+ '',
+ 'ORDER BY argnum'
+ );
+}
+
+=item cust_svc
+
+Returns the FS::cust_svc object associated with this job, if any.
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ qsearchs('cust_svc', { 'svcnum' => $self->svcnum } );
+}
+
+=item queue_depend
+
+Returns the FS::queue_depend objects associated with this job, if any.
+
+=cut
+
+sub queue_depend {
+ my $self = shift;
+ qsearch('queue_depend', { 'jobnum' => $self->jobnum } );
+}
+
+
+=item depend_insert OTHER_JOBNUM
+
+Inserts a dependancy for this job - it will not be run until the other job
+specified completes. If there is an error, returns the error, otherwise
+returns false.
+
+When using job dependancies, you should wrap the insertion of all relevant jobs
+in a database transaction.
+
+=cut
+
+sub depend_insert {
+ my($self, $other_jobnum) = @_;
+ my $queue_depend = new FS::queue_depend ( {
+ 'jobnum' => $self->jobnum,
+ 'depend_jobnum' => $other_jobnum,
+ } );
+ $queue_depend->insert;
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item joblisting HASHREF NOACTIONS
+
+=cut
+
+sub joblisting {
+ my($hashref, $noactions) = @_;
+
+ use Date::Format;
+ use HTML::Entities;
+ use FS::CGI;
+
+ my @queue = qsearch( 'queue', $hashref );
+ return '' unless scalar(@queue);
+
+ my $p = FS::CGI::popurl(2);
+
+ my $html = qq!<FORM ACTION="$p/misc/queue.cgi" METHOD="POST">!.
+ FS::CGI::table(). <<END;
+ <TR>
+ <TH COLSPAN=2>Job</TH>
+ <TH>Args</TH>
+ <TH>Date</TH>
+ <TH>Status</TH>
+END
+ $html .= '<TH>Account</TH>' unless $hashref->{svcnum};
+ $html .= '</TR>';
+
+ my $dangerous = $conf->exists('queue_dangerous_controls');
+
+ my $areboxes = 0;
+
+ foreach my $queue ( sort {
+ $a->getfield('jobnum') <=> $b->getfield('jobnum')
+ } @queue ) {
+ my $queue_hashref = $queue->hashref;
+ my $jobnum = $queue->jobnum;
+
+ my $args;
+ if ( $dangerous || $queue->job !~ /^FS::part_export::/ || !$noactions ) {
+ $args = encode_entities( join(' ',
+ map { length($_)<54 ? $_ : substr($_,0,32)."..." } $queue->args #1&g
+ ) );
+ } else {
+ $args = '';
+ }
+
+ my $date = time2str( "%a %b %e %T %Y", $queue->_date );
+ my $status = $queue->status;
+ $status .= ': '. $queue->statustext if $queue->statustext;
+ my @queue_depend = $queue->queue_depend;
+ $status .= ' (waiting for '.
+ join(', ', map { $_->depend_jobnum } @queue_depend ).
+ ')'
+ if @queue_depend;
+ my $changable = $dangerous
+ || ( ! $noactions && $status =~ /^failed/ || $status =~ /^locked/ );
+ if ( $changable ) {
+ $status .=
+ qq! (&nbsp;<A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=new">retry</A>&nbsp;|!.
+ qq!&nbsp;<A HREF="$p/misc/queue.cgi?jobnum=$jobnum&action=del">remove</A>&nbsp;)!;
+ }
+ my $cust_svc = $queue->cust_svc;
+
+ $html .= <<END;
+ <TR>
+ <TD>$jobnum</TD>
+ <TD>$queue_hashref->{job}</TD>
+ <TD>$args</TD>
+ <TD>$date</TD>
+ <TD>$status</TD>
+END
+
+ unless ( $hashref->{svcnum} ) {
+ my $account;
+ if ( $cust_svc ) {
+ my $table = $cust_svc->part_svc->svcdb;
+ my $label = ( $cust_svc->label )[1];
+ $account = qq!<A HREF="../view/$table.cgi?!. $queue->svcnum.
+ qq!">$label</A>!;
+ } else {
+ $account = '';
+ }
+ $html .= "<TD>$account</TD>";
+ }
+
+ if ( $changable ) {
+ $areboxes=1;
+ $html .=
+ qq!<TD><INPUT NAME="jobnum$jobnum" TYPE="checkbox" VALUE="1"></TD>!;
+
+ }
+
+ $html .= '</TR>';
+
+}
+
+ $html .= '</TABLE>';
+
+ if ( $areboxes ) {
+ $html .= '<BR><INPUT TYPE="submit" NAME="action" VALUE="retry selected">'.
+ '<INPUT TYPE="submit" NAME="action" VALUE="remove selected"><BR>';
+ }
+
+ $html;
+
+}
+
+=back
+
+=head1 VERSION
+
+$Id: queue.pm,v 1.15 2002-07-02 06:48:59 ivan Exp $
+
+=head1 BUGS
+
+$jobnums global
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/queue_arg.pm b/FS/FS/queue_arg.pm
new file mode 100644
index 000000000..08fe47341
--- /dev/null
+++ b/FS/FS/queue_arg.pm
@@ -0,0 +1,121 @@
+package FS::queue_arg;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::queue_arg - Object methods for queue_arg records
+
+=head1 SYNOPSIS
+
+ use FS::queue_arg;
+
+ $record = new FS::queue_arg \%hash;
+ $record = new FS::queue_arg { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::queue_arg object represents job argument. FS::queue_arg inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item argnum - primary key
+
+=item jobnum - see L<FS::queue>
+
+=item arg - argument
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new argument. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'queue_arg'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid argument. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_numbern('argnum')
+ || $self->ut_numbern('jobnum')
+ || $self->ut_anything('arg')
+ ;
+ return $error if $error;
+
+ ''; #no error
+}
+
+=back
+
+=head1 VERSION
+
+$Id: queue_arg.pm,v 1.1 2001-09-11 00:08:18 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::queue>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/queue_depend.pm b/FS/FS/queue_depend.pm
new file mode 100644
index 000000000..4a4e3c55c
--- /dev/null
+++ b/FS/FS/queue_depend.pm
@@ -0,0 +1,120 @@
+package FS::queue_depend;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::queue;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::queue_depend - Object methods for queue_depend records
+
+=head1 SYNOPSIS
+
+ use FS::queue_depend;
+
+ $record = new FS::queue_depend \%hash;
+ $record = new FS::queue_depend { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::queue_depend object represents an job dependancy. FS::queue_depend
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item dependnum - primary key
+
+=item jobnum - source jobnum (see L<FS::queue>).
+
+=item depend_jobnum - dependancy jobnum (see L<FS::queue>)
+
+=back
+
+The job specified by B<jobnum> depends on the job specified B<depend_jobnum> -
+the B<jobnum> job will not be run until the B<depend_jobnum> job has completed
+sucessfully (or manually removed).
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new dependancy. To add the dependancy to the database, see
+L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'queue_depend'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid dependancy. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('dependnum')
+ || $self->ut_foreign_key('jobnum', 'queue', 'jobnum')
+ || $self->ut_foreign_key('depend_jobnum', 'queue', 'jobnum')
+ ;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::queue>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/raddb.pm b/FS/FS/raddb.pm
new file mode 100644
index 000000000..a35a757f5
--- /dev/null
+++ b/FS/FS/raddb.pm
@@ -0,0 +1,1106 @@
+package FS::raddb;
+use vars qw(%attrib);
+
+%attrib = (
+ 'usr_at_zip_output_filter' => 'USR-AT-Zip-Output-Filter',
+ 'ms_filter' => 'MS-Filter',
+ 'usr_blocks_received' => 'USR-Blocks-Received',
+ 'shiva_called_number' => 'Shiva-Called-Number',
+ 'annex_filter' => 'Annex-Filter',
+ 'usr_channel_expansion' => 'USR-Channel-Expansion',
+ 'session_timeout' => 'Session-Timeout',
+ 'usr_simplified_mnp_level' => 'USR-Simplified-MNP-Levels',
+ 'ascend_route_ipx' => 'Ascend-Route-IPX',
+ 'annex_user_server_locati' => 'Annex-User-Server-Location',
+ 'acc_callback_mode' => 'Acc-Callback-Mode',
+ 'usr_filter_zones' => 'USR-Filter-Zones',
+ 'ascend_session_svr_key' => 'Ascend-Session-Svr-Key',
+ 'le_nat_tcp_session_timeo' => 'LE-NAT-TCP-Session-Timeout',
+ 'ascend_ts_idle_limit' => 'Ascend-TS-Idle-Limit',
+ 'usr_port_tap_priority' => 'USR-Port-Tap-Priority',
+ 'ascend_private_route' => 'Ascend-Private-Route',
+ 'prompt' => 'Prompt',
+ 'acct_link_count' => 'Acct-Link-Count',
+ 'login_lat_node' => 'Login-LAT-Node',
+ 'usr_mbi_ct_pri_card_slot' => 'USR-Mbi_Ct_PRI_Card_Slot',
+ 'erx_ingress_statistics' => 'ERX-Ingress-Statistics',
+ 'annex_system_disc_reason' => 'Annex-System-Disc-Reason',
+ 'usr_call_arrival_time' => 'USR-Call-Arrival-Time',
+ 'ascend_disconnect_cause' => 'Ascend-Disconnect-Cause',
+ 'ascend_user_acct_time' => 'Ascend-User-Acct-Time',
+ 'ascend_appletalk_peer_mo' => 'Ascend-Appletalk-Peer-Mode',
+ 'chap_challenge' => 'CHAP-Challenge',
+ 'ascend_mpp_idle_percent' => 'Ascend-MPP-Idle-Percent',
+ 'ascend_user_acct_port' => 'Ascend-User-Acct-Port',
+ 'ascend_numbering_plan_id' => 'Ascend-Numbering-Plan-ID',
+ 'ascend_access_intercept_' => 'Ascend-Access-Intercept-LEA',
+ 'pvc_encapsulation_type' => 'PVC_Encapsulation_Type',
+ 'ascend_bir_bridge_group' => 'Ascend-BIR-Bridge-Group',
+ 'ascend_atm_group' => 'Ascend-ATM-Group',
+ 'ascend_fr_svc_addr' => 'Ascend-FR-SVC-Addr',
+ 'x_ascend_send_auth' => 'X-Ascend-Send-Auth',
+ 'le_ip_pool' => 'LE-IP-Pool',
+ 'annex_addr_resolution_se' => 'Annex-Addr-Resolution-Servers',
+ 'usr_last_callers_number_' => 'USR-Last-Callers-Number-ANI',
+ 'login_port' => 'Login-Port',
+ 'ms_chap2_response' => 'MS-CHAP2-Response',
+ 'annex_secondary_dns_serv' => 'Annex-Secondary-DNS-Server',
+ 'ascend_ipsec_profile' => 'Ascend-IPSEC-Profile',
+ 'usr_accm_type' => 'USR-ACCM-Type',
+ 'simultaneous_use' => 'Simultaneous-Use',
+ 'framed_protocol' => 'Framed-Protocol',
+ 'ascend_recv_name' => 'Ascend-Recv-Name',
+ 'usr_call_connecting_time' => 'USR-Call-Connecting-Time',
+ 'tunnel_remote_name' => 'Tunnel_Remote_Name',
+ 'usr_vts_session_key' => 'USR-VTS-Session-Key',
+ 'ascend_fr_dce_n393' => 'Ascend-FR-DCE-N393',
+ 'login_host' => 'Login-Host',
+ 'usr_reply_script3' => 'USR-Reply-Script3',
+ 'ascend_pppoe_enable' => 'Ascend-PPPoE-Enable',
+ 'annex_primary_dns_server' => 'Annex-Primary-DNS-Server',
+ 'x_ascend_bridge_address' => 'X-Ascend-Bridge-Address',
+ 'usr_number_of_link_naks' => 'USR-Number-of-Link-NAKs',
+ 'annex_cli_command' => 'Annex-CLI-Command',
+ 'usr_pw_framed_routing_v2' => 'USR-PW_Framed_Routing_V2',
+ 'usr_tunnel_switch_endpoi' => 'USR-Tunnel-Switch-Endpoint',
+ 'ascend_call_by_call' => 'Ascend-Call-By-Call',
+ 'ascend_first_dest' => 'Ascend-First-Dest',
+ 'usr_appletalk_network_ra' => 'USR-Appletalk-Network-Range',
+ 'annex_tunnel_authen_type' => 'Annex-Tunnel-Authen-Type',
+ 'sql_user_name' => 'SQL-User-Name',
+ 'erx_secondary_dns' => 'ERX-Secondary-Dns',
+ 'h323_return_code' => 'h323-return-code',
+ 'annex_host_allow' => 'Annex-Host-Allow',
+ 'x_ascend_require_auth' => 'X-Ascend-Require-Auth',
+ 'le_ipsec_deny_action' => 'LE-IPSec-Deny-Action',
+ 'annex_edo' => 'Annex-EDO',
+ 'acct_delay_time' => 'Acct-Delay-Time',
+ 'ascend_call_block_durati' => 'Ascend-Call-Block-Duration',
+ 'login_tcp_port' => 'Login-TCP-Port',
+ 'ascend_temporary_rtes' => 'Ascend-Temporary-Rtes',
+ 'ascend_dialed_number' => 'Ascend-Dialed-Number',
+ 'x_ascend_dec_channel_cou' => 'X-Ascend-Dec-Channel-Count',
+ 'ascend_fr_dlci' => 'Ascend-FR-DLCI',
+ 'annex_modem_disc_reason' => 'Annex-Modem-Disc-Reason',
+ 'x_ascend_receive_secret' => 'X-Ascend-Receive-Secret',
+ 'char_noecho' => 'Char-Noecho',
+ 'ascend_pri_number_type' => 'Ascend-PRI-Number-Type',
+ 'ascend_dsl_upstream_limi' => 'Ascend-Dsl-Upstream-Limit',
+ 'x_ascend_modem_shelfno' => 'X-Ascend-Modem-ShelfNo',
+ 'prefix' => 'Prefix',
+ 'usr_rad_dvmrp_metric' => 'USR-Rad-Dvmrp-Metric',
+ 'usr_ip_saa_filter' => 'USR-IP-SAA-Filter',
+ 'ms_link_utilization_thre' => 'MS-Link-Utilization-Threshold',
+ 'ascend_home_network_name' => 'Ascend-Home-Network-Name',
+ 'acc_customer_id' => 'Acc-Customer-Id',
+ 'message_authenticator' => 'Message-Authenticator',
+ 'ascend_secondary_home_ag' => 'Ascend-Secondary-Home-Agent',
+ 'x_ascend_pre_output_octe' => 'X-Ascend-Pre-Output-Octets',
+ 'usr_multicast_forwarding' => 'USR-Multicast-Forwarding',
+ 'ascend_call_direction' => 'Ascend-Call-Direction',
+ 'acc_connect_rx_speed' => 'Acc-Connect-Rx-Speed',
+ 'ascend_force_56' => 'Ascend-Force-56',
+ 'usr_harc_disconnect_code' => 'USR-HARC-Disconnect-Code',
+ 'shasta_service_profile' => 'Shasta-Service-Profile',
+ 'cisco_maximum_time' => 'Cisco-Maximum-Time',
+ 'usr_tunnel_auth_hostname' => 'USR-Tunnel-Auth-Hostname',
+ 'ascend_client_assign_win' => 'Ascend-Client-Assign-WINS',
+ 'acc_modem_modulation_typ' => 'Acc-Modem-Modulation-Type',
+ 'acc_ip_gateway_pri' => 'Acc-Ip-Gateway-Pri',
+ 'ascend_bridge_address' => 'Ascend-Bridge-Address',
+ 'x_ascend_fr_link_mgt' => 'X-Ascend-FR-Link-Mgt',
+ 'ascend_handle_ipx' => 'Ascend-Handle-IPX',
+ 'ascend_x25_pad_alias_2' => 'Ascend-X25-Pad-Alias-2',
+ 'ascend_group' => 'Ascend-Group',
+ 'ascend_dsl_rate_type' => 'Ascend-Dsl-Rate-Type',
+ 'ascend_require_auth' => 'Ascend-Require-Auth',
+ 'x_ascend_billing_number' => 'X-Ascend-Billing-Number',
+ 'usr_orig_nas_type' => 'USR-Orig-NAS-Type',
+ 'ascend_remote_fw' => 'Ascend-Remote-FW',
+ 'acct_output_packets' => 'Acct-Output-Packets',
+ 'lm_password' => 'LM-Password',
+ 'tunnel_window' => 'Tunnel_Window',
+ 'x_ascend_link_compressio' => 'X-Ascend-Link-Compression',
+ 'x_ascend_base_channel_co' => 'X-Ascend-Base-Channel-Count',
+ 'cisco_avpair' => 'Cisco-AVPair',
+ 'shiva_event_flags' => 'Shiva-Event-Flags',
+ 'usr_number_of_rings_limi' => 'USR-Number-of-Rings-Limit',
+ 'ascend_ts_idle_mode' => 'Ascend-TS-Idle-Mode',
+ 'ascend_bi_directional_au' => 'Ascend-Bi-Directional-Auth',
+ 'state' => 'State',
+ 'usr_keypress_timeout' => 'USR-Keypress-Timeout',
+ 'usr_pw_vpn_neighbor' => 'USR-PW_VPN_Neighbor',
+ 'ldap_userdn' => 'Ldap-UserDn',
+ 'x_ascend_fr_n391' => 'X-Ascend-FR-N391',
+ 'ascend_tunneling_protoco' => 'Ascend-Tunneling-Protocol',
+ 'x_ascend_fr_direct' => 'X-Ascend-FR-Direct',
+ 'nas_ip_address' => 'NAS-IP-Address',
+ 'usr_call_end_time' => 'USR-Call-End-Time',
+ 'tunnel_algorithm' => 'Tunnel_Algorithm',
+ 'usr_vpn_encrypter' => 'USR-VPN-Encrypter',
+ 'ascend_atm_connect_group' => 'Ascend-ATM-Connect-Group',
+ 'x_ascend_ft1_caller' => 'X-Ascend-FT1-Caller',
+ 'login_callback_number' => 'Login-Callback-Number',
+ 'usr_ip_rip_input_filter' => 'USR-IP-RIP-Input-Filter',
+ 'usr_rmmie_last_update_ev' => 'USR-RMMIE-Last-Update-Event',
+ 'h323_disconnect_cause' => 'h323-disconnect-cause',
+ 'x_ascend_handle_ipx' => 'X-Ascend-Handle-IPX',
+ 'usr_igmp_version' => 'USR-IGMP-Version',
+ 'usr_imsi' => 'USR-IMSI',
+ 'group_name' => 'Group-Name',
+ 'usr_nas_type' => 'USR-NAS-Type',
+ 'ascend_ip_tos' => 'Ascend-IP-TOS',
+ 'x_ascend_token_immediate' => 'X-Ascend-Token-Immediate',
+ 'ascend_private_route_tab' => 'Ascend-Private-Route-Table-ID',
+ 'ms_chap2_cpw' => 'MS-CHAP2-CPW',
+ 'tunnel_session_auth_ctx' => 'Tunnel_Session_Auth_Ctx',
+ 'usr_mobile_numbytes_rxed' => 'USR-Mobile-NumBytes-Rxed',
+ 'usr_mbi_ct_tdm_time_slot' => 'USR-Mbi_Ct_TDM_Time_Slot',
+ 'ascend_x25_nui' => 'Ascend-X25-Nui',
+ 'x_ascend_first_dest' => 'X-Ascend-First-Dest',
+ 'x_ascend_num_in_multilin' => 'X-Ascend-Num-In-Multilink',
+ 'usr_send_password' => 'USR-Send-Password',
+ 'x_ascend_fr_t391' => 'X-Ascend-FR-T391',
+ 'acct_input_octets' => 'Acct-Input-Octets',
+ 'bridge_group' => 'Bridge_Group',
+ 'annex_sec_profile_index' => 'Annex-Sec-Profile-Index',
+ 'acc_dns_server_pri' => 'Acc-Dns-Server-Pri',
+ 'ms_acct_auth_type' => 'MS-Acct-Auth-Type',
+ 'tunnel_password' => 'Tunnel-Password',
+ 'usr_reply_script5' => 'USR-Reply-Script5',
+ 'shiva_links_in_bundle' => 'Shiva-Links-In-Bundle',
+ 'ascend_fr_profile_name' => 'Ascend-FR-Profile-Name',
+ 'ascend_mtu' => 'Ascend-MTU',
+ 'cisco_ppp_async_map' => 'Cisco-PPP-Async-Map',
+ 'cisco_num_in_multilink' => 'Cisco-Num-In-Multilink',
+ 'usr_mobile_ip_address' => 'USR-Mobile-IP-Address',
+ 'ascend_bridge' => 'Ascend-Bridge',
+ 'x_ascend_presession_time' => 'X-Ascend-PreSession-Time',
+ 'tunnel_cmd_timeout' => 'Tunnel_Cmd_Timeout',
+ 'ascend_multicast_client' => 'Ascend-Multicast-Client',
+ 'tunnel_private_group_id' => 'Tunnel-Private-Group-Id',
+ 'usr_rmmie_rcv_tot_pwrlvl' => 'USR-RMMIE-Rcv-Tot-PwrLvl',
+ 'calling_station_id' => 'Calling-Station-Id',
+ 'tunnel_rate_limit_burst' => 'Tunnel_Rate_Limit_Burst',
+ 'usr_device_connected_to' => 'USR-Device-Connected-To',
+ 'login_lat_service' => 'Login-LAT-Service',
+ 'x_ascend_home_network_na' => 'X-Ascend-Home-Network-Name',
+ 'ascend_h323_fegw_address' => 'Ascend-H323-Fegw-Address',
+ 'usr_called_party_number' => 'USR-Called-Party-Number',
+ 'ascend_remove_seconds' => 'Ascend-Remove-Seconds',
+ 'shiva_user_attributes' => 'Shiva-User-Attributes',
+ 'x_ascend_route_ipx' => 'X-Ascend-Route-IPX',
+ 'acc_route_policy' => 'Acc-Route-Policy',
+ 'x_ascend_client_gateway' => 'X-Ascend-Client-Gateway',
+ 'ms_mppe_encryption_polic' => 'MS-MPPE-Encryption-Policy',
+ 'x_ascend_data_filter' => 'X-Ascend-Data-Filter',
+ 'ascend_atm_direct' => 'Ascend-ATM-Direct',
+ 'ascend_session_type' => 'Ascend-Session-Type',
+ 'x_ascend_fr_linkup' => 'X-Ascend-FR-LinkUp',
+ 'ascend_metric' => 'Ascend-Metric',
+ 'usr_speed_of_connection' => 'USR-Speed-Of-Connection',
+ 'le_nat_outsource_outmap' => 'LE-NAT-Outsource-Outmap',
+ 'pppoe_url' => 'PPPOE_URL',
+ 'acct_mcast_out_octets' => 'Acct_Mcast_Out_Octets',
+ 'ascend_callback' => 'Ascend-Callback',
+ 'tunnel_client_auth_id' => 'Tunnel-Client-Auth-Id',
+ 'acct_unique_session_id' => 'Acct-Unique-Session-Id',
+ 'usr_port_tap_format' => 'USR-Port-Tap-Format',
+ 'ascend_ckt_type' => 'Ascend-Ckt-Type',
+ 'ascend_ppp_async_map' => 'Ascend-PPP-Async-Map',
+ 'usr_acct_reason_code' => 'USR-Acct-Reason-Code',
+ 'ascend_filter' => 'Ascend-Filter',
+ 'h323_redirect_number' => 'h323-redirect-number',
+ 'port_limit' => 'Port-Limit',
+ 'x_ascend_shared_profile_' => 'X-Ascend-Shared-Profile-Enable',
+ 'tunnel_police_rate' => 'Tunnel_Police_Rate',
+ 'ascend_calling_id_screen' => 'Ascend-Calling-Id-Screening',
+ 'usr_multicast_proxy' => 'USR-Multicast-Proxy',
+ 'usr_bridging' => 'USR-Bridging',
+ 'usr_originate_answer_mod' => 'USR-Originate-Answer-Mode',
+ 'x_ascend_fr_dlci' => 'X-Ascend-FR-DLCI',
+ 'usr_request_type' => 'USR-Request-Type',
+ 'acc_dialout_auth_usernam' => 'Acc-Dialout-Auth-Username',
+ 'ascend_host_info' => 'Ascend-Host-Info',
+ 'usr_rmmie_num_of_updates' => 'USR-RMMIE-Num-Of-Updates',
+ 'x_ascend_fr_profile_name' => 'X-Ascend-FR-Profile-Name',
+ 'ascend_fr_direct_profile' => 'Ascend-FR-Direct-Profile',
+ 'x_ascend_bridge' => 'X-Ascend-Bridge',
+ 'tunnel_deadtime' => 'Tunnel_Deadtime',
+ 'ms_chap_error' => 'MS-CHAP-Error',
+ 'framed_route' => 'Framed-Route',
+ 'expiration' => 'Expiration',
+ 'ascend_backup' => 'Ascend-Backup',
+ 'ascend_pre_output_octets' => 'Ascend-Pre-Output-Octets',
+ 'framed_appletalk_zone' => 'Framed-AppleTalk-Zone',
+ 'annex_audit_level' => 'Annex-Audit-Level',
+ 'bind_auth_context' => 'Bind_Auth_Context',
+ 'cisco_asing_ip_pool' => 'Cisco-Asing-IP-Pool',
+ 'ascend_user_acct_base' => 'Ascend-User-Acct-Base',
+ 'mcast_receive' => 'Mcast_Receive',
+ 'usr_ds0' => 'USR-DS0',
+ 'ms_ras_vendor' => 'MS-RAS-Vendor',
+ 'tunnel_domain' => 'Tunnel_Domain',
+ 'usr_secondary_nbns_serve' => 'USR-Secondary_NBNS_Server',
+ 'tunnel_max_sessions' => 'Tunnel_Max_Sessions',
+ 'ascend_ip_direct' => 'Ascend-IP-Direct',
+ 'idle_timeout' => 'Idle-Timeout',
+ 'tunnel_server_auth_id' => 'Tunnel-Server-Auth-Id',
+ 'usr_start_time' => 'USR-Start-Time',
+ 'usr_ip' => 'USR-IP',
+ 'usr_gateway_ip_address' => 'USR-Gateway-IP-Address',
+ 'usr_number_of_characters' => 'USR-Number-Of-Characters-Lost',
+ 'ascend_dba_monitor' => 'Ascend-DBA-Monitor',
+ 'ms_chap_domain' => 'MS-CHAP-Domain',
+ 'cisco_pre_input_octets' => 'Cisco-Pre-Input-Octets',
+ 'acct_session_time' => 'Acct-Session-Time',
+ 'framed_ip_address' => 'Framed-IP-Address',
+ 'x_ascend_ip_pool_definit' => 'X-Ascend-IP-Pool-Definition',
+ 'erx_alternate_cli_access' => 'ERX-Alternate-Cli-Access-Level',
+ 'medium_type' => 'Medium_Type',
+ 'acct_output_octets_64' => 'Acct_Output_Octets_64',
+ 'ascend_cir_timer' => 'Ascend-CIR-Timer',
+ 'police_rate' => 'Police_Rate',
+ 'ms_mppe_send_key' => 'MS-MPPE-Send-Key',
+ 'ascend_multicast_gleave_' => 'Ascend-Multicast-GLeave-Delay',
+ 'x_ascend_host_info' => 'X-Ascend-Host-Info',
+ 'erx_egress_policy_name' => 'ERX-Egress-Policy-Name',
+ 'user_name' => 'User-Name',
+ 'bind_bypass_bypass' => 'Bind_Bypass_Bypass',
+ 'annex_acct_servers' => 'Annex-Acct-Servers',
+ 'usr_chassis_call_channel' => 'USR-Chassis-Call-Channel',
+ 'annex_input_filter' => 'Annex-Input-Filter',
+ 'ascend_home_agent_passwo' => 'Ascend-Home-Agent-Password',
+ 'nas_port_type' => 'NAS-Port-Type',
+ 'ascend_endpoint_disc' => 'Ascend-Endpoint-Disc',
+ 'tunnel_police_burst' => 'Tunnel_Police_Burst',
+ 'bind_auth_max_sessions' => 'Bind_Auth_Max_Sessions',
+ 'x_ascend_fr_dce_n392' => 'X-Ascend-FR-DCE-N392',
+ 'usr_connect_term_reason' => 'USR-Connect-Term-Reason',
+ 'usr_mbi_ct_pri_card_span' => 'USR-Mbi_Ct_PRI_Card_Span_Line',
+ 'erx_egress_statistics' => 'ERX-Egress-Statistics',
+ 'ascend_fr_dte_n392' => 'Ascend-FR-DTE-N392',
+ 'usr_esn' => 'USR-ESN',
+ 'x_ascend_fr_dte_n392' => 'X-Ascend-FR-DTE-N392',
+ 'x_ascend_fr_nailed_grp' => 'X-Ascend-FR-Nailed-Grp',
+ 'ascend_bridge_non_pppoe' => 'Ascend-Bridge-Non-PPPoE',
+ 'ascend_ipx_alias' => 'Ascend-IPX-Alias',
+ 'acc_tunnel_port' => 'Acc-Tunnel-Port',
+ 'acct_input_gigawords' => 'Acct-Input-Gigawords',
+ 'ascend_maximum_channels' => 'Ascend-Maximum-Channels',
+ 'x_ascend_ppp_async_map' => 'X-Ascend-PPP-Async-Map',
+ 'usr_retrains_requested' => 'USR-Retrains-Requested',
+ 'x_ascend_metric' => 'X-Ascend-Metric',
+ 'acc_apsm_oversubscribed' => 'Acc-Apsm-Oversubscribed',
+ 'erx_atm_pcr' => 'ERX-Atm-PCR',
+ 'usr_ipx_routing' => 'USR-IPX-Routing',
+ 'usr_tunneled_mlpp' => 'USR-Tunneled-MLPP',
+ 'usr_send_script5' => 'USR-Send-Script5',
+ 'ascend_traffic_shaper' => 'Ascend-Traffic-Shaper',
+ 'ascend_bacp_enable' => 'Ascend-BACP-Enable',
+ 'login_time' => 'Login-Time',
+ 'ascend_call_type' => 'Ascend-Call-Type',
+ 'erx_address_pool_name' => 'ERX-Address-Pool-Name',
+ 'h323_incoming_conf_id' => 'h323-incoming-conf-id',
+ 'packet_type' => 'Packet-Type',
+ 'usr_security_resp_limit' => 'USR-Security-Resp-Limit',
+ 'ip_address_pool_name' => 'Ip_Address_Pool_Name',
+ 'ascend_cbcp_trunk_group' => 'Ascend-CBCP-Trunk-Group',
+ 'ascend_ipx_node_addr' => 'Ascend-IPX-Node-Addr',
+ 'ascend_menu_selector' => 'Ascend-Menu-Selector',
+ 'usr_ds0s' => 'USR-DS0s',
+ 'usr_actual_voltage' => 'USR-Actual-Voltage',
+ 'annex_sw_version' => 'Annex-SW-Version',
+ 'ascend_history_weigh_typ' => 'Ascend-History-Weigh-Type',
+ 'ascend_receive_secret' => 'Ascend-Receive-Secret',
+ 'usr_ip_rip_policies' => 'USR-IP-RIP-Policies',
+ 'ascend_pw_warntime' => 'Ascend-PW-Warntime',
+ 'x_ascend_assign_ip_serve' => 'X-Ascend-Assign-IP-Server',
+ 'tunnel_session_auth_serv' => 'Tunnel_Session_Auth_Service_Grp',
+ 'usr_blocks_resent' => 'USR-Blocks-Resent',
+ 'usr_fallback_enabled' => 'USR-Fallback-Enabled',
+ 'arap_challenge_response' => 'ARAP-Challenge-Response',
+ 'tunnel_session_auth' => 'Tunnel_Session_Auth',
+ 'usr_sync_async_mode' => 'USR-Sync-Async-Mode',
+ 'client_port_dnis' => 'Client-Port-DNIS',
+ 'ascend_ppp_vj_1172' => 'Ascend-PPP-VJ-1172',
+ 'ascend_remote_addr' => 'Ascend-Remote-Addr',
+ 'ascend_fr_n391' => 'Ascend-FR-N391',
+ 'client_port_id' => 'Client-Port-Id',
+ 'usr_num_fax_pages_proces' => 'USR-Num-Fax-Pages-Processed',
+ 'le_ipsec_active_profile' => 'LE-IPSec-Active-Profile',
+ 'usr_port_tap_facility' => 'USR-Port-Tap-Facility',
+ 'usr_callback_type' => 'USR-Callback-Type',
+ 'login_lat_group' => 'Login-LAT-Group',
+ 'x_ascend_call_type' => 'X-Ascend-Call-Type',
+ 'ascend_route_ip' => 'Ascend-Route-IP',
+ 'usr_pw_vpn_id' => 'USR-PW_VPN_ID',
+ 'le_nat_sess_dir_fail_act' => 'LE-NAT-Sess-Dir-Fail-Action',
+ 'cisco_pre_output_octets' => 'Cisco-Pre-Output-Octets',
+ 'h323_billing_model' => 'h323-billing-model',
+ 'usr_equalization_type' => 'USR-Equalization-Type',
+ 'acc_clearing_cause' => 'Acc-Clearing-Cause',
+ 'x_ascend_menu_selector' => 'X-Ascend-Menu-Selector',
+ 'x_ascend_netware_timeout' => 'X-Ascend-Netware-timeout',
+ 'ascend_fr_linkup' => 'Ascend-FR-LinkUp',
+ 'police_burst' => 'Police_Burst',
+ 'ascend_filter_required' => 'Ascend-Filter-Required',
+ 'usr_compression_algorith' => 'USR-Compression-Algorithm',
+ 'le_ipsec_outsource_profi' => 'LE-IPSec-Outsource-Profile',
+ 'x_ascend_idle_limit' => 'X-Ascend-Idle-Limit',
+ 'usr_call_terminate_in_gm' => 'USR-Call-Terminate-in-GMT',
+ 'usr_ipx_call_output_filt' => 'USR-IPX-Call-Output-Filter',
+ 'ip_tos_field' => 'IP_TOS_Field',
+ 'ascend_ip_tos_apply_to' => 'Ascend-IP-TOS-Apply-To',
+ 'tunnel_l2f_second_passwo' => 'Tunnel_L2F_Second_Password',
+ 'usr_call_event_code' => 'USR-Call-Event-Code',
+ 'usr_rmmie_product_code' => 'USR-RMMIE-Product-Code',
+ 'usr_host_type' => 'USR-Host-Type',
+ 'ascend_send_auth' => 'Ascend-Send-Auth',
+ 'shiva_compression_type' => 'Shiva-Compression-Type',
+ 'filter_id' => 'Filter-Id',
+ 'ascend_ft1_caller' => 'Ascend-FT1-Caller',
+ 'erx_cli_initial_access_l' => 'ERX-Cli-Initial-Access-Level',
+ 'usr_log_filter_packets' => 'USR-Log-Filter-Packets',
+ 'ascend_fr_nailed_grp' => 'Ascend-FR-Nailed-Grp',
+ 'usr_initial_tx_link_data' => 'USR-Initial-Tx-Link-Data-Rate',
+ 'acc_input_errors' => 'Acc-Input-Errors',
+ 'x_ascend_user_acct_port' => 'X-Ascend-User-Acct-Port',
+ 'erx_secondary_wins' => 'ERX-Secondary-Wins',
+ 'usr_rmmie_serial_number' => 'USR-RMMIE-Serial-Number',
+ 'ascend_client_primary_dn' => 'Ascend-Client-Primary-DNS',
+ 'usr_slot_connected_to' => 'USR-Slot-Connected-To',
+ 'shiva_disconnect_reason' => 'Shiva-Disconnect-Reason',
+ 'usr_receive_acc_map' => 'USR-Receive-Acc-Map',
+ 'usr_compression_reset_mo' => 'USR-Compression-Reset-Mode',
+ 'usr_rmmie_planned_discon' => 'USR-RMMIE-Planned-Disconnect',
+ 'ascend_client_assign_dns' => 'Ascend-Client-Assign-DNS',
+ 'ascend_fr_type' => 'Ascend-FR-Type',
+ 'tunnel_client_endpoint' => 'Tunnel-Client-Endpoint',
+ 'x_ascend_send_secret' => 'X-Ascend-Send-Secret',
+ 'x_ascend_call_filter' => 'X-Ascend-Call-Filter',
+ 'usr_ipx_rip_input_filter' => 'USR-IPX-RIP-Input-Filter',
+ 'x_ascend_maximum_time' => 'X-Ascend-Maximum-Time',
+ 'ascend_x25_pad_x3_profil' => 'Ascend-X25-Pad-X3-Profile',
+ 'pvc_profile_name' => 'PVC_Profile_Name',
+ 'ascend_global_call_id' => 'Ascend-Global-Call-Id',
+ 'tunnel_local_name' => 'Tunnel_Local_Name',
+ 'ascend_fr_t392' => 'Ascend-FR-T392',
+ 'usr_dnis_reauthenticatio' => 'USR-DNIS-ReAuthentication',
+ 'ascend_pre_output_packet' => 'Ascend-Pre-Output-Packets',
+ 'ascend_token_immediate' => 'Ascend-Token-Immediate',
+ 'usr_chassis_call_slot' => 'USR-Chassis-Call-Slot',
+ 'rate_limit_burst' => 'Rate_Limit_Burst',
+ 'cisco_route_ip' => 'Cisco-Route-IP',
+ 'dhcp_max_leases' => 'DHCP_Max_Leases',
+ 'user_category' => 'User-Category',
+ 'x_ascend_maximum_call_du' => 'X-Ascend-Maximum-Call-Duration',
+ 'bind_type' => 'Bind_Type',
+ 'usr_framed_ipx_route' => 'USR-Framed-IPX-Route',
+ 'rate_limit_rate' => 'Rate_Limit_Rate',
+ 'ascend_atm_connect_vpi' => 'Ascend-ATM-Connect-Vpi',
+ 'x_ascend_inc_channel_cou' => 'X-Ascend-Inc-Channel-Count',
+ 'connect_info' => 'Connect-Info',
+ 'x_ascend_pre_input_packe' => 'X-Ascend-Pre-Input-Packets',
+ 'usr_port_tap_address' => 'USR-Port-Tap-Address',
+ 'ascend_home_agent_udp_po' => 'Ascend-Home-Agent-UDP-Port',
+ 'usr_final_rx_link_data_r' => 'USR-Final-Rx-Link-Data-Rate',
+ 'usr_pw_usr_ifilter_ip' => 'USR-PW_USR_IFilter_IP',
+ 'ascend_route_appletalk' => 'Ascend-Route-Appletalk',
+ 'ms_chap_lm_enc_pw' => 'MS-CHAP-LM-Enc-PW',
+ 'ascend_callback_delay' => 'Ascend-Callback-Delay',
+ 'x_ascend_bacp_enable' => 'X-Ascend-BACP-Enable',
+ 'bg_trans_bpdu' => 'BG_Trans_BPDU',
+ 'huntgroup_name' => 'Huntgroup-Name',
+ 'x_ascend_ipx_alias' => 'X-Ascend-IPX-Alias',
+ 'x_ascend_secondary_home_' => 'X-Ascend-Secondary-Home-Agent',
+ 'usr_ipx_wan' => 'USR-IPX-WAN',
+ 'menu' => 'Menu',
+ 'x_ascend_fr_direct_dlci' => 'X-Ascend-FR-Direct-DLCI',
+ 'acct_status_type' => 'Acct-Status-Type',
+ 'ascend_port_redir_server' => 'Ascend-Port-Redir-Server',
+ 'acc_dns_server_sec' => 'Acc-Dns-Server-Sec',
+ 'ascend_minimum_channels' => 'Ascend-Minimum-Channels',
+ 'ascend_telnet_profile' => 'Ascend-Telnet-Profile',
+ 'ascend_ipx_route' => 'Ascend-IPX-Route',
+ 'usr_call_connect_in_gmt' => 'USR-Call-Connect-in-GMT',
+ 'x_ascend_dba_monitor' => 'X-Ascend-DBA-Monitor',
+ 'usr_event_id' => 'USR-Event-Id',
+ 'ascend_inc_channel_count' => 'Ascend-Inc-Channel-Count',
+ 'usr_send_script3' => 'USR-Send-Script3',
+ 'framed_callback_id' => 'Framed-Callback-Id',
+ 'arap_zone_access' => 'ARAP-Zone-Access',
+ 'service_type' => 'Service-Type',
+ 'usr_nfas_id' => 'USR-NFAS-ID',
+ 'shiva_calling_number' => 'Shiva-Calling-Number',
+ 'ascend_user_acct_host' => 'Ascend-User-Acct-Host',
+ 'ascend_fr_link_mgt' => 'Ascend-FR-Link-Mgt',
+ 'ms_primary_nbns_server' => 'MS-Primary-NBNS-Server',
+ 'quintum_avpair' => 'Quintum-AVPair',
+ 'x_ascend_home_agent_pass' => 'X-Ascend-Home-Agent-Password',
+ 'ascend_transit_number' => 'Ascend-Transit-Number',
+ 'ascend_cache_refresh' => 'Ascend-Cache-Refresh',
+ 'versanet_termination_cau' => 'Versanet-Termination-Cause',
+ 'ascend_user_acct_type' => 'Ascend-User-Acct-Type',
+ 'usr_mic' => 'USR-MIC',
+ 'ascend_base_channel_coun' => 'Ascend-Base-Channel-Count',
+ 'x_ascend_dhcp_pool_numbe' => 'X-Ascend-DHCP-Pool-Number',
+ 'ms_chap2_success' => 'MS-CHAP2-Success',
+ 'cisco_idle_limit' => 'Cisco-Idle-Limit',
+ 'ascend_pw_lifetime' => 'Ascend-PW-Lifetime',
+ 'usr_packet_bus_session' => 'USR-Packet-Bus-Session',
+ 'ascend_atm_loopback_cell' => 'Ascend-ATM-Loopback-Cell-Loss',
+ 'acct_input_packets_64' => 'Acct_Input_Packets_64',
+ 'ascend_modem_slotno' => 'Ascend-Modem-SlotNo',
+ 'usr_characters_received' => 'USR-Characters-Received',
+ 'ms_bap_usage' => 'MS-BAP-Usage',
+ 'cisco_data_filter' => 'Cisco-Data-Filter',
+ 'ascend_seconds_of_histor' => 'Ascend-Seconds-Of-History',
+ 'h323_setup_time' => 'h323-setup-time',
+ 'acc_dialout_auth_passwor' => 'Acc-Dialout-Auth-Password',
+ 'le_nat_outsource_inmap' => 'LE-NAT-Outsource-Inmap',
+ 'usr_sap_filter_in' => 'USR-SAP-Filter-In',
+ 'framed_appletalk_link' => 'Framed-AppleTalk-Link',
+ 'usr_initial_rx_link_data' => 'USR-Initial-Rx-Link-Data-Rate',
+ 'usr_ospf_addressless_ind' => 'USR-OSPF-Addressless-Index',
+ 'usr_ipx' => 'USR-IPX',
+ 'shiva_connect_reason' => 'Shiva-Connect-Reason',
+ 'cisco_ppp_vj_slot_comp' => 'Cisco-PPP-VJ-Slot-Comp',
+ 'ascend_atm_vpi' => 'Ascend-ATM-Vpi',
+ 'acc_ml_mlx_admin_state' => 'Acc-ML-MLX-Admin-State',
+ 'usr_igmp_robustness' => 'USR-IGMP-Robustness',
+ 'add_prefix' => 'Add-Prefix',
+ 'x_ascend_call_by_call' => 'X-Ascend-Call-By-Call',
+ 'x_ascend_connect_progres' => 'X-Ascend-Connect-Progress',
+ 'usr_at_rtmp_input_filter' => 'USR-AT-RTMP-Input-Filter',
+ 'erx_igmp_enable' => 'ERX-Igmp-Enable',
+ 'usr_rmmie_rcv_pwrlvl_375' => 'USR-RMMIE-Rcv-PwrLvl-3750Hz',
+ 'usr_pw_packet' => 'USR-PW_Packet',
+ 'dialback_no' => 'Dialback-No',
+ 'ascend_ip_tos_precedence' => 'Ascend-IP-TOS-Precedence',
+ 'annex_cli_filter' => 'Annex-CLI-Filter',
+ 'x_ascend_dial_number' => 'X-Ascend-Dial-Number',
+ 'usr_iwf_call_identifier' => 'USR-IWF-Call-Identifier',
+ 'ms_secondary_dns_server' => 'MS-Secondary-DNS-Server',
+ 'ascend_client_secondary_' => 'Ascend-Client-Secondary-WINS',
+ 'shiva_type_of_service' => 'Shiva-Type-Of-Service',
+ 'usr_framed_ip_address_po' => 'USR-Framed_IP_Address_Pool_Name',
+ 'bind_ses_context' => 'Bind_Ses_Context',
+ 'acc_reason_code' => 'Acc-Reason-Code',
+ 'ms_chap_cpw_1' => 'MS-CHAP-CPW-1',
+ 'h323_call_type' => 'h323-call-type',
+ 'ascend_fr_08_mode' => 'Ascend-FR-08-Mode',
+ 'usr_calling_party_number' => 'USR-Calling-Party-Number',
+ 'usr_rad_multicast_routin' => 'USR-Rad-Multicast-Routing-RtLim',
+ 'usr_reply_script2' => 'USR-Reply-Script2',
+ 'usr_security_login_limit' => 'USR-Security-Login-Limit',
+ 'cisco_link_compression' => 'Cisco-Link-Compression',
+ 'usr_et_bridge_output_fil' => 'USR-ET-Bridge-Output-Filter',
+ 'ascend_vrouter_name' => 'Ascend-VRouter-Name',
+ 'usr_modem_setup_time' => 'USR-Modem-Setup-Time',
+ 'cisco_ip_direct' => 'Cisco-IP-Direct',
+ 'x_ascend_temporary_rtes' => 'X-Ascend-Temporary-Rtes',
+ 'ascend_x25_pad_alias_3' => 'Ascend-X25-Pad-Alias-3',
+ 'usr_rmmie_pwrlvl_xmit_lv' => 'USR-RMMIE-PwrLvl-Xmit-Lvl',
+ 'configuration_token' => 'Configuration-Token',
+ 'usr_at_rtmp_output_filte' => 'USR-AT-RTMP-Output-Filter',
+ 'usr_ip_default_route_opt' => 'USR-IP-Default-Route-Option',
+ 'ascend_calling_subaddres' => 'Ascend-Calling-Subaddress',
+ 'stripped_user_name' => 'Stripped-User-Name',
+ 'cisco_call_filter' => 'Cisco-Call-Filter',
+ 'termination_menu' => 'Termination-Menu',
+ 'port_message' => 'Port-Message',
+ 'usr_igmp_maximum_respons' => 'USR-IGMP-Maximum-Response-Time',
+ 'erx_ingress_policy_name' => 'ERX-Ingress-Policy-Name',
+ 'ascend_call_attempt_limi' => 'Ascend-Call-Attempt-Limit',
+ 'acc_service_profile' => 'Acc-Service-Profile',
+ 'ascend_bir_proxy' => 'Ascend-BIR-Proxy',
+ 'ascend_x25_nui_prompt' => 'Ascend-X25-Nui-Prompt',
+ 'usr_rmmie_pwrlvl_noise_l' => 'USR-RMMIE-PwrLvl-Noise-Lvl',
+ 'usr_rmmie_pwrlvl_nearech' => 'USR-RMMIE-PwrLvl-NearEcho-Canc',
+ 'x_ascend_multicast_clien' => 'X-Ascend-Multicast-Client',
+ 'usr_unauthenticated_time' => 'USR-Unauthenticated-Time',
+ 'acc_callback_cbcp_type' => 'Acc-Callback-CBCP-Type',
+ 'login_service' => 'Login-Service',
+ 'usr_rad_multicast_routin' => 'USR-Rad-Multicast-Routing-Bound',
+ 'ascend_dial_number' => 'Ascend-Dial-Number',
+ 'x_ascend_remote_addr' => 'X-Ascend-Remote-Addr',
+ 'usr_rmmie_rcv_pwrlvl_330' => 'USR-RMMIE-Rcv-PwrLvl-3300Hz',
+ 'usr_call_end_date_time' => 'USR-Call-End-Date-Time',
+ 'bind_dot1q_slot' => 'Bind_Dot1q_Slot',
+ 'le_connect_detail' => 'LE-Connect-Detail',
+ 'annex_user_level' => 'Annex-User-Level',
+ 'tunnel_dnis' => 'Tunnel_DNIS',
+ 'assigned_ip_address' => 'Assigned_IP_Address',
+ 'acc_bridging_support' => 'Acc-Bridging-Support',
+ 'usr_channel' => 'USR-Channel',
+ 'arap_security_data' => 'ARAP-Security-Data',
+ 'bind_auth_service_grp' => 'Bind_Auth_Service_Grp',
+ 'x_ascend_pre_output_pack' => 'X-Ascend-Pre-Output-Packets',
+ 'x_ascend_seconds_of_hist' => 'X-Ascend-Seconds-Of-History',
+ 'h323_voice_quality' => 'h323-voice-quality',
+ 'usr_rmmie_last_update_ti' => 'USR-RMMIE-Last-Update-Time',
+ 'usr_disconnect_cause_ind' => 'USR-Disconnect-Cause-Indicator',
+ 'usr_channel_connected_to' => 'USR-Channel-Connected-To',
+ 'ascend_calling_id_number' => 'Ascend-Calling-Id-Number-Plan',
+ 'usr_number_of_fallbacks' => 'USR-Number-of-Fallbacks',
+ 'usr_ip_call_output_filte' => 'USR-IP-Call-Output-Filter',
+ 'ascend_bir_enable' => 'Ascend-BIR-Enable',
+ 'usr_connect_time_limit' => 'USR-Connect-Time-Limit',
+ 'ascend_presession_time' => 'Ascend-PreSession-Time',
+ 'ascend_private_route_req' => 'Ascend-Private-Route-Required',
+ 'ascend_dsl_cir_xmit_limi' => 'Ascend-Dsl-CIR-Xmit-Limit',
+ 'framed_compression' => 'Framed-Compression',
+ 'ascend_svc_enabled' => 'Ascend-SVC-Enabled',
+ 'proxy_state' => 'Proxy-State',
+ 'ascend_tunnel_vrouter_na' => 'Ascend-Tunnel-VRouter-Name',
+ 'usr_ipx_call_input_filte' => 'USR-IPX-Call-Input-Filter',
+ 'x_ascend_assign_ip_globa' => 'X-Ascend-Assign-IP-Global-Pool',
+ 'erx_alternate_cli_vroute' => 'ERX-Alternate-Cli-Vrouter-Name',
+ 'ascend_dhcp_maximum_leas' => 'Ascend-DHCP-Maximum-Leases',
+ 'ascend_modem_shelfno' => 'Ascend-Modem-ShelfNo',
+ 'bind_auth_protocol' => 'Bind_Auth_Protocol',
+ 'shasta_user_privilege' => 'Shasta-User-Privilege',
+ 'acct_interim_interval' => 'Acct-Interim-Interval',
+ 'hint' => 'Hint',
+ 'x_ascend_target_util' => 'X-Ascend-Target-Util',
+ 'ms_link_drop_time_limit' => 'MS-Link-Drop-Time-Limit',
+ 'acc_access_partition' => 'Acc-Access-Partition',
+ 'x_ascend_multilink_id' => 'X-Ascend-Multilink-ID',
+ 'usr_power_supply_number' => 'USR-Power-Supply-Number',
+ 'acc_ipx_compression' => 'Acc-Ipx-Compression',
+ 'nomadix_bw_down' => 'Nomadix-Bw-Down',
+ 'usr_call_reference_numbe' => 'USR-Call-Reference-Number',
+ 'cisco_target_util' => 'Cisco-Target-Util',
+ 'usr_back_channel_data_ra' => 'USR-Back-Channel-Data-Rate',
+ 'acc_ip_gateway_sec' => 'Acc-Ip-Gateway-Sec',
+ 'usr_dte_ring_no_answer_l' => 'USR-DTE-Ring-No-Answer-Limit',
+ 'usr_connect_time' => 'USR-Connect-Time',
+ 'ascend_ip_pool_definitio' => 'Ascend-IP-Pool-Definition',
+ 'usr_call_start_date_time' => 'USR-Call-Start-Date-Time',
+ 'dialback_name' => 'Dialback-Name',
+ 'bind_tun_context' => 'Bind_Tun_Context',
+ 'h323_redirect_ip_address' => 'h323-redirect-ip-address',
+ 'annex_keypress_timeout' => 'Annex-Keypress-Timeout',
+ 'ascend_x25_pad_alias_1' => 'Ascend-X25-Pad-Alias-1',
+ 'ms_chap_response' => 'MS-CHAP-Response',
+ 'usr_max_channels' => 'USR-Max-Channels',
+ 'ascend_fr_dte_n393' => 'Ascend-FR-DTE-N393',
+ 'ascend_pre_input_octets' => 'Ascend-Pre-Input-Octets',
+ 'erx_atm_mbs' => 'ERX-Atm-MBS',
+ 'usr_line_reversals' => 'USR-Line-Reversals',
+ 'x_ascend_third_prompt' => 'X-Ascend-Third-Prompt',
+ 'x_ascend_pw_warntime' => 'X-Ascend-PW-Warntime',
+ 'ascend_data_filter' => 'Ascend-Data-Filter',
+ 'framed_address' => 'Framed-Address',
+ 'context_name' => 'Context-Name',
+ 'usr_send_script2' => 'USR-Send-Script2',
+ 'ms_arap_pw_change_reason' => 'MS-ARAP-PW-Change-Reason',
+ 'acct_session_id' => 'Acct-Session-Id',
+ 'initial_modulation_type' => 'Initial-Modulation-Type',
+ 'ascend_h323_gatekeeper' => 'Ascend-H323-Gatekeeper',
+ 'x_ascend_fcp_parameter' => 'X-Ascend-FCP-Parameter',
+ 'tunnel_type' => 'Tunnel-Type',
+ 'multi_link_flag' => 'Multi-Link-Flag',
+ 'ascend_idle_limit' => 'Ascend-Idle-Limit',
+ 'password_retry' => 'Password-Retry',
+ 'h323_remote_address' => 'h323-remote-address',
+ 'erx_atm_service_category' => 'ERX-Atm-Service-Category',
+ 'acct_input_packets' => 'Acct-Input-Packets',
+ 'h323_disconnect_time' => 'h323-disconnect-time',
+ 'ascend_billing_number' => 'Ascend-Billing-Number',
+ 'usr_syslog_tap' => 'USR-Syslog-Tap',
+ 'ms_mppe_encryption_type' => 'MS-MPPE-Encryption-Type',
+ 'ascend_assign_ip_pool' => 'Ascend-Assign-IP-Pool',
+ 'usr_routing_protocol' => 'USR-Routing-Protocol',
+ 'usr_rad_location_type' => 'USR-Rad-Location-Type',
+ 'usr_characters_sent' => 'USR-Characters-Sent',
+ 'usr_mp_edo_hiper' => 'USR-MP-EDO-HIPER',
+ 'annex_host_restrict' => 'Annex-Host-Restrict',
+ 'user_service_type' => 'User-Service-Type',
+ 'acct_multi_session_id' => 'Acct-Multi-Session-Id',
+ 'ms_chap_cpw_2' => 'MS-CHAP-CPW-2',
+ 'x_ascend_primary_home_ag' => 'X-Ascend-Primary-Home-Agent',
+ 'x_ascend_dialout_allowed' => 'X-Ascend-Dialout-Allowed',
+ 'ascend_connect_progress' => 'Ascend-Connect-Progress',
+ 'x_ascend_ara_pw' => 'X-Ascend-Ara-PW',
+ 'ns_mta_md5_password' => 'NS-MTA-MD5-Password',
+ 'callback_number' => 'Callback-Number',
+ 'acct_output_packets_64' => 'Acct_Output_Packets_64',
+ 'x_ascend_user_acct_key' => 'X-Ascend-User-Acct-Key',
+ 'ascend_modem_portno' => 'Ascend-Modem-PortNo',
+ 'ascend_assign_ip_server' => 'Ascend-Assign-IP-Server',
+ 'ascend_fcp_parameter' => 'Ascend-FCP-Parameter',
+ 'ascend_inter_arrival_jit' => 'Ascend-Inter-Arrival-Jitter',
+ 'client_ip_address' => 'Client-IP-Address',
+ 'usr_number_of_link_timeo' => 'USR-Number-of-Link-Timeouts',
+ 'ascend_dsl_cir_recv_limi' => 'Ascend-Dsl-CIR-Recv-Limit',
+ 'ms_acct_eap_type' => 'MS-Acct-EAP-Type',
+ 'x_ascend_user_acct_type' => 'X-Ascend-User-Acct-Type',
+ 'usr_rmmie_x2_status' => 'USR-RMMIE-x2-Status',
+ 'ascend_dsl_downstream_li' => 'Ascend-Dsl-Downstream-Limit',
+ 'shiva_customer_id' => 'Shiva-Customer-Id',
+ 'lac_real_port' => 'LAC_Real_Port',
+ 'h323_connect_time' => 'h323-connect-time',
+ 'old_password' => 'Old-Password',
+ 'usr_vpn_gw_location_id' => 'USR-VPN-GW-Location-Id',
+ 'x_ascend_if_netmask' => 'X-Ascend-IF-Netmask',
+ 'add_suffix' => 'Add-Suffix',
+ 'x_ascend_client_assign_d' => 'X-Ascend-Client-Assign-DNS',
+ 'usr_q931_call_reference_' => 'USR-Q931-Call-Reference-Value',
+ 'usr_terminal_type' => 'USR-Terminal-Type',
+ 'usr_spoofing' => 'USR-Spoofing',
+ 'erx_tunnel_password' => 'ERX-Tunnel-Password',
+ 'ascend_assign_ip_client' => 'Ascend-Assign-IP-Client',
+ 'usr_server_time' => 'USR-Server-Time',
+ 'ascend_data_svc' => 'Ascend-Data-Svc',
+ 'annex_authen_servers' => 'Annex-Authen-Servers',
+ 'nomadix_bw_up' => 'Nomadix-Bw-Up',
+ 'shiva_link_speed' => 'Shiva-Link-Speed',
+ 'usr_reply_script6' => 'USR-Reply-Script6',
+ 'usr_expansion_algorithm' => 'USR-Expansion-Algorithm',
+ 'x_ascend_mpp_idle_percen' => 'X-Ascend-MPP-Idle-Percent',
+ 'cisco_data_rate' => 'Cisco-Data-Rate',
+ 'usr_primary_dns_server' => 'USR-Primary_DNS_Server',
+ 'erx_local_loopback_inter' => 'ERX-Local-Loopback-Interface',
+ 'ascend_target_util' => 'Ascend-Target-Util',
+ 'usr_default_dte_data_rat' => 'USR-Default-DTE-Data-Rate',
+ 'x_ascend_event_type' => 'X-Ascend-Event-Type',
+ 'usr_mp_mrru' => 'USR-MP-MRRU',
+ 'bind_bypass_context' => 'Bind_Bypass_Context',
+ 'no_such_attribute' => 'No-Such-Attribute',
+ 'acct_mcast_out_packets' => 'Acct_Mcast_Out_Packets',
+ 'tunnel_medium_type' => 'Tunnel-Medium-Type',
+ 'acc_callback_delay' => 'Acc-Callback-Delay',
+ 'x_ascend_home_agent_udp_' => 'X-Ascend-Home-Agent-UDP-Port',
+ 'acct_input_octets_64' => 'Acct_Input_Octets_64',
+ 'ascend_atm_connect_vci' => 'Ascend-ATM-Connect-Vci',
+ 'erx_primary_dns' => 'ERX-Primary-Dns',
+ 'ascend_xmit_rate' => 'Ascend-Xmit-Rate',
+ 'ms_new_arap_password' => 'MS-New-ARAP-Password',
+ 'usr_call_error_code' => 'USR-Call-Error-Code',
+ 'acct_output_octets' => 'Acct-Output-Octets',
+ 'usr_failure_to_connect_r' => 'USR-Failure-to-Connect-Reason',
+ 'ascend_num_in_multilink' => 'Ascend-Num-In-Multilink',
+ 'x_ascend_number_sessions' => 'X-Ascend-Number-Sessions',
+ 'usr_ip_rip_output_filter' => 'USR-IP-RIP-Output-Filter',
+ 'usr_chassis_temp_thresho' => 'USR-Chassis-Temp-Threshold',
+ 'usr_blocks_sent' => 'USR-Blocks-Sent',
+ 'usr_ids0_call_type' => 'USR-IDS0-Call-Type',
+ 'acc_ccp_option' => 'Acc-Ccp-Option',
+ 'ascend_client_gateway' => 'Ascend-Client-Gateway',
+ 'x_ascend_multicast_rate_' => 'X-Ascend-Multicast-Rate-Limit',
+ 'le_ipsec_passive_profile' => 'LE-IPSec-Passive-Profile',
+ 'usr_chassis_call_span' => 'USR-Chassis-Call-Span',
+ 'usr_mobileip_home_agent_' => 'USR-MobileIP-Home-Agent-Address',
+ 'password' => 'Password',
+ 'le_nat_log_options' => 'LE-NAT-Log-Options',
+ 'x_ascend_ppp_address' => 'X-Ascend-PPP-Address',
+ 'usr_fallback_limit' => 'USR-Fallback-Limit',
+ 'suffix' => 'Suffix',
+ 'usr_multicast_receive' => 'USR-Multicast-Receive',
+ 'client_dns_sec' => 'Client_DNS_Sec',
+ 'annex_product_name' => 'Annex-Product-Name',
+ 'cisco_pw_lifetime' => 'Cisco-PW-Lifetime',
+ 'x_ascend_fr_dce_n393' => 'X-Ascend-FR-DCE-N393',
+ 'x_ascend_ts_idle_limit' => 'X-Ascend-TS-Idle-Limit',
+ 'usr_last_number_dialed_o' => 'USR-Last-Number-Dialed-Out',
+ 'mcast_send' => 'Mcast_Send',
+ 'pppoe_motm' => 'PPPOE_MOTM',
+ 'usr_pw_usr_ifilter_ipx' => 'USR-PW_USR_IFilter_IPX',
+ 'usr_pw_tunnel_authentica' => 'USR-PW_Tunnel_Authentication',
+ 'ascend_source_ip_check' => 'Ascend-Source-IP-Check',
+ 'ascend_assign_ip_global_' => 'Ascend-Assign-IP-Global-Pool',
+ 'ms_ras_version' => 'MS-RAS-Version',
+ 'usr_rad_multicast_routin' => 'USR-Rad-Multicast-Routing-Ttl',
+ 'x_ascend_modem_slotno' => 'X-Ascend-Modem-SlotNo',
+ 'acc_ml_call_threshold' => 'Acc-ML-Call-Threshold',
+ 'ascend_menu_item' => 'Ascend-Menu-Item',
+ 'usr_cdma_call_reference_' => 'USR-CDMA-Call-Reference-Number',
+ 'callback_id' => 'Callback-Id',
+ 'framed_ipx_network' => 'Framed-IPX-Network',
+ 'x_ascend_disconnect_caus' => 'X-Ascend-Disconnect-Cause',
+ 'ascend_user_acct_key' => 'Ascend-User-Acct-Key',
+ 'x_ascend_pw_lifetime' => 'X-Ascend-PW-Lifetime',
+ 'user_name_is_star' => 'User-Name-Is-Star',
+ 'x_ascend_authen_alias' => 'X-Ascend-Authen-Alias',
+ 'framed_pool' => 'Framed-Pool',
+ 'ms_primary_dns_server' => 'MS-Primary-DNS-Server',
+ 'realm' => 'Realm',
+ 'arap_features' => 'ARAP-Features',
+ 'acc_connect_tx_speed' => 'Acc-Connect-Tx-Speed',
+ 'usr_last_number_dialed_i' => 'USR-Last-Number-Dialed-In-DNIS',
+ 'usr_chassis_temperature' => 'USR-Chassis-Temperature',
+ 'x_ascend_xmit_rate' => 'X-Ascend-Xmit-Rate',
+ 'x_ascend_send_passwd' => 'X-Ascend-Send-Passwd',
+ 'le_modem_info' => 'LE-Modem-Info',
+ 'ascend_ipx_peer_mode' => 'Ascend-IPX-Peer-Mode',
+ 'le_nat_other_session_tim' => 'LE-NAT-Other-Session-Timeout',
+ 'tunnel_rate_limit_rate' => 'Tunnel_Rate_Limit_Rate',
+ 'ascend_maximum_call_dura' => 'Ascend-Maximum-Call-Duration',
+ 'ascend_dhcp_pool_number' => 'Ascend-DHCP-Pool-Number',
+ 'x_ascend_callback' => 'X-Ascend-Callback',
+ 'ascend_access_intercept_' => 'Ascend-Access-Intercept-Log',
+ 'usr_iwf_ip_address' => 'USR-IWF-IP-Address',
+ 'nas_port_id' => 'NAS-Port-Id',
+ 'le_advice_of_charge' => 'LE-Advice-of-Charge',
+ 'ascend_add_seconds' => 'Ascend-Add-Seconds',
+ 'annex_transmit_speed' => 'Annex-Transmit-Speed',
+ 'usr_port_tap' => 'USR-Port-Tap',
+ 'usr_at_call_input_filter' => 'USR-AT-Call-Input-Filter',
+ 'ascend_qos_downstream' => 'Ascend-QOS-Downstream',
+ 'ascend_x25_reverse_charg' => 'Ascend-X25-Reverse-Charging',
+ 'lac_port' => 'LAC_Port',
+ 'tunnel_assignment_id' => 'Tunnel-Assignment-Id',
+ 'fall_through' => 'Fall-Through',
+ 'cisco_disconnect_cause' => 'Cisco-Disconnect-Cause',
+ 'module_message' => 'Module-Message',
+ 'framed_ip_netmask' => 'Framed-IP-Netmask',
+ 'ascend_egress_enabled' => 'Ascend-Egress-Enabled',
+ 'ascend_dsl_rate_mode' => 'Ascend-Dsl-Rate-Mode',
+ 'x_ascend_client_primary_' => 'X-Ascend-Client-Primary-DNS',
+ 'usr_pw_usr_ofilter_sap' => 'USR-PW_USR_OFilter_SAP',
+ 'acct_terminate_cause' => 'Acct-Terminate-Cause',
+ 'x_ascend_fr_dte_n393' => 'X-Ascend-FR-DTE-N393',
+ 'x_ascend_call_block_dura' => 'X-Ascend-Call-Block-Duration',
+ 'ascend_ppp_address' => 'Ascend-PPP-Address',
+ 'caller_id' => 'Caller-ID',
+ 'bind_int_interface_name' => 'Bind_Int_Interface_Name',
+ 'x_ascend_ppp_vj_slot_com' => 'X-Ascend-PPP-VJ-Slot-Comp',
+ 'usr_modem_group' => 'USR-Modem-Group',
+ 'cisco_maximum_channels' => 'Cisco-Maximum-Channels',
+ 'ascend_link_compression' => 'Ascend-Link-Compression',
+ 'usr_retrains_granted' => 'USR-Retrains-Granted',
+ 'ascend_dropped_packets' => 'Ascend-Dropped-Packets',
+ 'usr_pw_usr_ofilter_ip' => 'USR-PW_USR_OFilter_IP',
+ 'quintum_nas_port' => 'Quintum-NAS-Port',
+ 'annex_tunnel_authen_mode' => 'Annex-Tunnel-Authen-Mode',
+ 'tunnel_function' => 'Tunnel_Function',
+ 'usr_mp_edo' => 'USR-MP-EDO',
+ 'le_nat_outmap' => 'LE-NAT-Outmap',
+ 'usr_modulation_type' => 'USR-Modulation-Type',
+ 'ascend_maximum_time' => 'Ascend-Maximum-Time',
+ 'annex_callback_portlist' => 'Annex-Callback-Portlist',
+ 'x_ascend_remove_seconds' => 'X-Ascend-Remove-Seconds',
+ 'tunnel_server_endpoint' => 'Tunnel-Server-Endpoint',
+ 'arap_password' => 'ARAP-Password',
+ 'ms_chap_mppe_keys' => 'MS-CHAP-MPPE-Keys',
+ 'ascend_source_auth' => 'Ascend-Source-Auth',
+ 'group' => 'Group',
+ 'usr_send_script6' => 'USR-Send-Script6',
+ 'le_nat_inmap' => 'LE-NAT-Inmap',
+ 'chap_password' => 'CHAP-Password',
+ 'annex_primary_nbns_serve' => 'Annex-Primary-NBNS-Server',
+ 'annex_receive_speed' => 'Annex-Receive-Speed',
+ 'usr_rmmie_manufacturer_i' => 'USR-RMMIE-Manufacturer-ID',
+ 'bind_l2tp_flow_control' => 'Bind_L2TP_Flow_Control',
+ 'smb_account_ctrl' => 'SMB-Account-CTRL',
+ 'ascend_calling_id_presen' => 'Ascend-Calling-Id-Presentatn',
+ 'ascend_ip_pool_chaining' => 'Ascend-IP-Pool-Chaining',
+ 'le_admin_group' => 'LE-Admin-Group',
+ 'nas_identifier' => 'NAS-Identifier',
+ 'x_ascend_history_weigh_t' => 'X-Ascend-History-Weigh-Type',
+ 'tunnel_connection_id' => 'Tunnel-Connection-Id',
+ 'nas_real_port' => 'NAS_Real_Port',
+ 'ms_old_arap_password' => 'MS-Old-ARAP-Password',
+ 'usr_ip_rip_simple_auth_p' => 'USR-IP-RIP-Simple-Auth-Password',
+ 'erx_primary_wins' => 'ERX-Primary-Wins',
+ 'usr_pw_index' => 'USR-PW_Index',
+ 'erx_cli_allow_all_vr_acc' => 'ERX-Cli-Allow-All-VR-Access',
+ 'le_ipsec_log_options' => 'LE-IPSec-Log-Options',
+ 'ascend_home_agent_ip_add' => 'Ascend-Home-Agent-IP-Addr',
+ 'annex_re_chap_timeout' => 'Annex-Re-CHAP-Timeout',
+ 'usr_final_tx_link_data_r' => 'USR-Final-Tx-Link-Data-Rate',
+ 'client_dns_pri' => 'Client_DNS_Pri',
+ 'usr_primary_nbns_server' => 'USR-Primary_NBNS_Server',
+ 'usr_cusr_hat_script_rule' => 'USR-CUSR-hat-Script-Rules',
+ 'ascend_multicast_rate_li' => 'Ascend-Multicast-Rate-Limit',
+ 'usr_rmmie_pwrlvl_farecho' => 'USR-RMMIE-PwrLvl-FarEcho-Canc',
+ 'acc_acct_on_off_reason' => 'Acc-Acct-On-Off-Reason',
+ 'le_multicast_client' => 'LE-Multicast-Client',
+ 'ascend_send_passwd' => 'Ascend-Send-Passwd',
+ 'annex_unauthenticated_ti' => 'Annex-Unauthenticated-Time',
+ 'tunnel_context' => 'Tunnel_Context',
+ 'acc_nbns_server_sec' => 'Acc-Nbns-Server-Sec',
+ 'usr_channel_decrement' => 'USR-Channel-Decrement',
+ 'usr_rmmie_firmware_versi' => 'USR-RMMIE-Firmware-Version',
+ 'ms_chap_challenge' => 'MS-CHAP-Challenge',
+ 'x_ascend_client_secondar' => 'X-Ascend-Client-Secondary-DNS',
+ 'ascend_cbcp_mode' => 'Ascend-CBCP-Mode',
+ 'ascend_x25_rpoa' => 'Ascend-X25-Rpoa',
+ 'usr_dtr_false_timeout' => 'USR-DTR-False-Timeout',
+ 'usr_rad_multicast_routin' => 'USR-Rad-Multicast-Routing-Proto',
+ 'ascend_x25_pad_x3_parame' => 'Ascend-X25-Pad-X3-Parameters',
+ 'usr_physical_state' => 'USR-Physical-State',
+ 'ascend_fr_t391' => 'Ascend-FR-T391',
+ 'bind_dot1q_port' => 'Bind_Dot1q_Port',
+ 'lac_port_type' => 'LAC_Port_Type',
+ 'bg_aging_time' => 'BG_Aging_Time',
+ 'erx_atm_scr' => 'ERX-Atm-SCR',
+ 'x_ascend_menu_item' => 'X-Ascend-Menu-Item',
+ 'ascend_x25_pad_banner' => 'Ascend-X25-Pad-Banner',
+ 'h323_gw_id' => 'h323-gw-id',
+ 'h323_preferred_lang' => 'h323-preferred-lang',
+ 'usr_min_compression_size' => 'USR-Min-Compression-Size',
+ 'usr_compression_type' => 'USR-Compression-Type',
+ 'x_ascend_call_attempt_li' => 'X-Ascend-Call-Attempt-Limit',
+ 'ascend_dialout_allowed' => 'Ascend-Dialout-Allowed',
+ 'annex_local_username' => 'Annex-Local-Username',
+ 'cisco_pre_input_packets' => 'Cisco-Pre-Input-Packets',
+ 'ascend_send_secret' => 'Ascend-Send-Secret',
+ 'shiva_function' => 'Shiva-Function',
+ 'usr_dte_data_idle_timout' => 'USR-DTE-Data-Idle-Timout',
+ 'usr_number_of_blers' => 'USR-Number-of-Blers',
+ 'usr_card_type' => 'USR-Card-Type',
+ 'ascend_token_idle' => 'Ascend-Token-Idle',
+ 'x_ascend_group' => 'X-Ascend-Group',
+ 'nt_password' => 'NT-Password',
+ 'acct_mcast_in_packets' => 'Acct_Mcast_In_Packets',
+ 'usr_supports_tags' => 'USR-Supports-Tags',
+ 'ascend_number_sessions' => 'Ascend-Number-Sessions',
+ 'x_ascend_add_seconds' => 'X-Ascend-Add-Seconds',
+ 'usr_number_of_upshifts' => 'USR-Number-of-Upshifts',
+ 'proxy_to_realm' => 'Proxy-To-Realm',
+ 'acc_callback_num_valid' => 'Acc-Callback-Num-Valid',
+ 'x_ascend_maximum_channel' => 'X-Ascend-Maximum-Channels',
+ 'acc_access_community' => 'Acc-Access-Community',
+ 'x_ascend_fr_direct_profi' => 'X-Ascend-FR-Direct-Profile',
+ 'usr_send_name' => 'USR-Send-Name',
+ 'usr_chassis_slot' => 'USR-Chassis-Slot',
+ 'login_ip_host' => 'Login-IP-Host',
+ 'ascend_netware_timeout' => 'Ascend-Netware-timeout',
+ 'vendor_specific' => 'Vendor-Specific',
+ 'bind_sub_user_at_context' => 'Bind_Sub_User_At_Context',
+ 'ascend_fr_direct_dlci' => 'Ascend-FR-Direct-DLCI',
+ 'ascend_atm_fault_managem' => 'Ascend-ATM-Fault-Management',
+ 'ascend_qos_upstream' => 'Ascend-QOS-Upstream',
+ 'source_validation' => 'Source_Validation',
+ 'x_ascend_token_expiry' => 'X-Ascend-Token-Expiry',
+ 'ascend_dec_channel_count' => 'Ascend-Dec-Channel-Count',
+ 'usr_local_framed_ip_addr' => 'USR-Local-Framed-IP-Addr',
+ 'usr_service_option' => 'USR-Service-Option',
+ 'usr_transmit_acc_map' => 'USR-Transmit-Acc-Map',
+ 'ascend_fr_direct' => 'Ascend-FR-Direct',
+ 'x_ascend_expect_callback' => 'X-Ascend-Expect-Callback',
+ 'acc_ml_damping_factor' => 'Acc-ML-Damping-Factor',
+ 'framed_netmask' => 'Framed-Netmask',
+ 'usr_connect_speed' => 'USR-Connect-Speed',
+ 'ascend_client_primary_wi' => 'Ascend-Client-Primary-WINS',
+ 'cisco_multilink_id' => 'Cisco-Multilink-ID',
+ 'bg_span_dis' => 'BG_Span_Dis',
+ 'ascend_multilink_id' => 'Ascend-Multilink-ID',
+ 'tunnel_max_tunnels' => 'Tunnel_Max_Tunnels',
+ 'ascend_dhcp_reply' => 'Ascend-DHCP-Reply',
+ 'ascend_x25_cug' => 'Ascend-X25-Cug',
+ 'shiva_network_protocols' => 'Shiva-Network-Protocols',
+ 'ascend_ara_pw' => 'Ascend-Ara-PW',
+ 'ip_host_addr' => 'Ip_Host_Addr',
+ 'le_ip_gateway' => 'LE-IP-Gateway',
+ 'usr_mobile_numbytes_txed' => 'USR-Mobile-NumBytes-Txed',
+ 'x_ascend_fr_t392' => 'X-Ascend-FR-T392',
+ 'cisco_pre_output_packets' => 'Cisco-Pre-Output-Packets',
+ 'tunnel_group' => 'Tunnel_Group',
+ 'bind_sub_password' => 'Bind_Sub_Password',
+ 'eap_message' => 'EAP-Message',
+ 'exec_program' => 'Exec-Program',
+ 'bg_path_cost' => 'BG_Path_Cost',
+ 'auth_type' => 'Auth-Type',
+ 'usr_modem_training_time' => 'USR-Modem-Training-Time',
+ 'ascend_cbcp_enable' => 'Ascend-CBCP-Enable',
+ 'x_ascend_ipx_route' => 'X-Ascend-IPX-Route',
+ 'ascend_redirect_number' => 'Ascend-Redirect-Number',
+ 'h323_credit_time' => 'h323-credit-time',
+ 'ascend_appletalk_route' => 'Ascend-Appletalk-Route',
+ 'shiva_link_protocol' => 'Shiva-Link-Protocol',
+ 'x_ascend_fr_circuit_name' => 'X-Ascend-FR-Circuit-Name',
+ 'client_id' => 'Client-Id',
+ 'usr_appletalk' => 'USR-Appletalk',
+ 'usr_mpip_tunnel_originat' => 'USR-MPIP-Tunnel-Originator',
+ 'annex_output_filter' => 'Annex-Output-Filter',
+ 'pvc_circuit_padding' => 'PVC_Circuit_Padding',
+ 'x_ascend_minimum_channel' => 'X-Ascend-Minimum-Channels',
+ 'h323_time_and_day' => 'h323-time-and-day',
+ 'ascend_ipx_header_compre' => 'Ascend-IPX-Header-Compression',
+ 'termination_action' => 'Termination-Action',
+ 'x_ascend_modem_portno' => 'X-Ascend-Modem-PortNo',
+ 'acct_tunnel_packets_lost' => 'Acct-Tunnel-Packets-Lost',
+ 'framed_filter_id' => 'Framed-Filter-Id',
+ 'usr_ccp_algorithm' => 'USR-CCP-Algorithm',
+ 'ascend_token_expiry' => 'Ascend-Token-Expiry',
+ 'annex_secondary_nbns_ser' => 'Annex-Secondary-NBNS-Server',
+ 'usr_et_bridge_call_outpu' => 'USR-ET-Bridge-Call-Output-Filte',
+ 'acc_modem_error_protocol' => 'Acc-Modem-Error-Protocol',
+ 'acc_request_type' => 'Acc-Request-Type',
+ 'x_ascend_ipx_peer_mode' => 'X-Ascend-IPX-Peer-Mode',
+ 'ascend_ppp_vj_slot_comp' => 'Ascend-PPP-VJ-Slot-Comp',
+ 'cisco_presession_time' => 'Cisco-PreSession-Time',
+ 'usr_chat_script_name' => 'USR-Chat-Script-Name',
+ 'ascend_fr_circuit_name' => 'Ascend-FR-Circuit-Name',
+ 'ascend_expect_callback' => 'Ascend-Expect-Callback',
+ 'framed_mtu' => 'Framed-MTU',
+ 'ascend_port_redir_protoc' => 'Ascend-Port-Redir-Protocol',
+ 'usr_pw_vpn_name' => 'USR-PW_VPN_Name',
+ 'ascend_nas_port_format' => 'Ascend-NAS-Port-Format',
+ 'shasta_vpn_name' => 'Shasta-VPN-Name',
+ 'usr_dtr_true_timeout' => 'USR-DTR-True-Timeout',
+ 'ascend_third_prompt' => 'Ascend-Third-Prompt',
+ 'connect_rate' => 'Connect-Rate',
+ 'usr_block_error_count_li' => 'USR-Block-Error-Count-Limit',
+ 'called_station_id' => 'Called-Station-Id',
+ 'usr_pw_cutoff' => 'USR-PW_Cutoff',
+ 'ascend_data_rate' => 'Ascend-Data-Rate',
+ 'x_ascend_ts_idle_mode' => 'X-Ascend-TS-Idle-Mode',
+ 'ascend_x25_pad_prompt' => 'Ascend-X25-Pad-Prompt',
+ 'x_ascend_dhcp_reply' => 'X-Ascend-DHCP-Reply',
+ 'acc_nbns_server_pri' => 'Acc-Nbns-Server-Pri',
+ 'ascend_call_filter' => 'Ascend-Call-Filter',
+ 'acc_tunnel_secret' => 'Acc-Tunnel-Secret',
+ 'usr_simplified_v42bis_us' => 'USR-Simplified-V42bis-Usage',
+ 'bind_int_context' => 'Bind_Int_Context',
+ 'erx_virtual_router_name' => 'ERX-Virtual-Router-Name',
+ 'crypt_password' => 'Crypt-Password',
+ 'challenge_state' => 'Challenge-State',
+ 'ascend_client_secondary_' => 'Ascend-Client-Secondary-DNS',
+ 'strip_user_name' => 'Strip-User-Name',
+ 'x_ascend_user_acct_host' => 'X-Ascend-User-Acct-Host',
+ 'x_ascend_route_ip' => 'X-Ascend-Route-IP',
+ 'x_ascend_assign_ip_clien' => 'X-Ascend-Assign-IP-Client',
+ 'usr_mbi_ct_bchannel_used' => 'USR-Mbi_Ct_BChannel_Used',
+ 'ascend_x25_profile_name' => 'Ascend-X25-Profile-Name',
+ 'usr_call_type' => 'USR-Call-Type',
+ 'x_ascend_user_acct_base' => 'X-Ascend-User-Acct-Base',
+ 'acct_output_gigawords' => 'Acct-Output-Gigawords',
+ 'usr_rmmie_firmware_build' => 'USR-RMMIE-Firmware-Build-Date',
+ 'ascend_fr_link_status_dl' => 'Ascend-FR-Link-Status-DLCI',
+ 'login_lat_port' => 'Login-LAT-Port',
+ 'usr_call_arrival_in_gmt' => 'USR-Call-Arrival-in-GMT',
+ 'acct_mcast_in_octets' => 'Acct_Mcast_In_Octets',
+ 'erx_sa_validate' => 'ERX-Sa-Validate',
+ 'ascend_service_type' => 'Ascend-Service-Type',
+ 'ascend_x25_nui_password_' => 'Ascend-X25-Nui-Password-Prompt',
+ 'usr_pw_vpn_gateway' => 'USR-PW_VPN_Gateway',
+ 'ascend_fr_dce_n392' => 'Ascend-FR-DCE-N392',
+ 'acc_ip_compression' => 'Acc-Ip-Compression',
+ 'lac_real_port_type' => 'LAC_Real_Port_Type',
+ 'ascend_if_netmask' => 'Ascend-IF-Netmask',
+ 'acct_session_start_time' => 'Acct-Session-Start-Time',
+ 'ms_chap_nt_enc_pw' => 'MS-CHAP-NT-Enc-PW',
+ 'ascend_port_redir_portnu' => 'Ascend-Port-Redir-Portnum',
+ 'mcast_maxgroups' => 'Mcast_MaxGroups',
+ 'x_ascend_home_agent_ip_a' => 'X-Ascend-Home-Agent-IP-Addr',
+ 'ascend_cache_time' => 'Ascend-Cache-Time',
+ 'x_ascend_data_svc' => 'X-Ascend-Data-Svc',
+ 'erx_tunnel_virtual_route' => 'ERX-Tunnel-Virtual-Router',
+ 'usr_re_chap_timeout' => 'USR-Re-Chap-Timeout',
+ 'x_ascend_ppp_vj_1172' => 'X-Ascend-PPP-VJ-1172',
+ 'usr_igmp_routing' => 'USR-IGMP-Routing',
+ 'h323_prompt_id' => 'h323-prompt-id',
+ 'le_terminate_detail' => 'LE-Terminate-Detail',
+ 'acc_ml_clear_threshold' => 'Acc-ML-Clear-Threshold',
+ 'x_ascend_ip_direct' => 'X-Ascend-IP-Direct',
+ 'nas_port' => 'NAS-Port',
+ 'x_ascend_data_rate' => 'X-Ascend-Data-Rate',
+ 'usr_ip_call_input_filter' => 'USR-IP-Call-Input-Filter',
+ 'ascend_auth_type' => 'Ascend-Auth-Type',
+ 'x_ascend_preempt_limit' => 'X-Ascend-Preempt-Limit',
+ 'h323_credit_amount' => 'h323-credit-amount',
+ 'usr_reply_script1' => 'USR-Reply-Script1',
+ 'usr_et_bridge_input_filt' => 'USR-ET-Bridge-Input-Filter',
+ 'current_time' => 'Current-Time',
+ 'cisco_xmit_rate' => 'Cisco-Xmit-Rate',
+ 'ascend_authen_alias' => 'Ascend-Authen-Alias',
+ 'x_ascend_session_svr_key' => 'X-Ascend-Session-Svr-Key',
+ 'acc_dialout_auth_mode' => 'Acc-Dialout-Auth-Mode',
+ 'usr_event_date_time' => 'USR-Event-Date-Time',
+ 'x_ascend_ipx_node_addr' => 'X-Ascend-IPX-Node-Addr',
+ 'ascend_primary_home_agen' => 'Ascend-Primary-Home-Agent',
+ 'x_ascend_user_acct_time' => 'X-Ascend-User-Acct-Time',
+ 'usr_at_call_output_filte' => 'USR-AT-Call-Output-Filter',
+ 'acc_output_errors' => 'Acc-Output-Errors',
+ 'usr_ipx_rip_output_filte' => 'USR-IPX-RIP-Output-Filter',
+ 'x_ascend_pri_number_type' => 'X-Ascend-PRI-Number-Type',
+ 'bind_l2tp_tunnel_name' => 'Bind_L2TP_Tunnel_Name',
+ 'replicate_to_realm' => 'Replicate-To-Realm',
+ 'usr_at_zip_input_filter' => 'USR-AT-Zip-Input-Filter',
+ 'annex_mrru' => 'Annex-MRRU',
+ 'event_timestamp' => 'Event-Timestamp',
+ 'ascend_pre_input_packets' => 'Ascend-Pre-Input-Packets',
+ 'h323_call_origin' => 'h323-call-origin',
+ 'x_ascend_fr_type' => 'X-Ascend-FR-Type',
+ 'x_ascend_token_idle' => 'X-Ascend-Token-Idle',
+ 'usr_igmp_query_interval' => 'USR-IGMP-Query-Interval',
+ 'ascend_atm_vci' => 'Ascend-ATM-Vci',
+ 'usr_port_tap_output' => 'USR-Port-Tap-Output',
+ 'session' => 'Session',
+ 'ascend_uu_info' => 'Ascend-UU-Info',
+ 'ms_mppe_recv_key' => 'MS-MPPE-Recv-Key',
+ 'usr_secondary_dns_server' => 'USR-Secondary_DNS_Server',
+ 'x_ascend_tunneling_proto' => 'X-Ascend-Tunneling-Protocol',
+ 'acc_dial_port_index' => 'Acc-Dial-Port-Index',
+ 'cisco_nas_port' => 'Cisco-NAS-Port',
+ 'usr_send_script1' => 'USR-Send-Script1',
+ 'usr_tunnel_security' => 'USR-Tunnel-Security',
+ 'arap_security' => 'ARAP-Security',
+ 'tunnel_preference' => 'Tunnel-Preference',
+ 'usr_reply_script4' => 'USR-Reply-Script4',
+ 'h323_currency_type' => 'h323-currency-type',
+ 'usr_rmmie_status' => 'USR-RMMIE-Status',
+ 'ascend_shared_profile_en' => 'Ascend-Shared-Profile-Enable',
+ 'annex_syslog_tap' => 'Annex-Syslog-Tap',
+ 'usr_send_script4' => 'USR-Send-Script4',
+ 'acc_clearing_location' => 'Acc-Clearing-Location',
+ 'annex_disconnect_reason' => 'Annex-Disconnect-Reason',
+ 'x_ascend_dhcp_maximum_le' => 'X-Ascend-DHCP-Maximum-Leases',
+ 'usr_at_input_filter' => 'USR-AT-Input-Filter',
+ 'usr_auth_mode' => 'USR-Auth-Mode',
+ 'shiva_session_id' => 'Shiva-Session-Id',
+ 'usr_expected_voltage' => 'USR-Expected-Voltage',
+ 'ascend_owner_ip_addr' => 'Ascend-Owner-IP-Addr',
+ 'ascend_atm_direct_profil' => 'Ascend-ATM-Direct-Profile',
+ 'usr_pw_usr_ofilter_ipx' => 'USR-PW_USR_OFilter_IPX',
+ 'framed_routing' => 'Framed-Routing',
+ 'pam_auth' => 'Pam-Auth',
+ 'usr_interface_index' => 'USR-Interface-Index',
+ 'x_ascend_transit_number' => 'X-Ascend-Transit-Number',
+ 'usr_end_time' => 'USR-End-Time',
+ 'x_ascend_assign_ip_pool' => 'X-Ascend-Assign-IP-Pool',
+ 'ms_secondary_nbns_server' => 'MS-Secondary-NBNS-Server',
+ 'bind_dot1q_vlan_tag_id' => 'Bind_Dot1q_Vlan_Tag_Id',
+ 'acct_tunnel_connection' => 'Acct-Tunnel-Connection',
+ 'tunnel_retransmit' => 'Tunnel_Retransmit',
+ 'x_ascend_backup' => 'X-Ascend-Backup',
+ 'usr_bearer_capabilities' => 'USR-Bearer-Capabilities',
+ 'ascend_calling_id_type_o' => 'Ascend-Calling-Id-Type-Of-Num',
+ 'shiva_acct_serv_switch' => 'Shiva-Acct-Serv-Switch',
+ 'ascend_h323_conference_i' => 'Ascend-H323-Conference-Id',
+ 'acct_authentic' => 'Acct-Authentic',
+ 'x_ascend_force_56' => 'X-Ascend-Force-56',
+ 'framed_appletalk_network' => 'Framed-AppleTalk-Network',
+ 'reply_message' => 'Reply-Message',
+ 'annex_addr_resolution_pr' => 'Annex-Addr-Resolution-Protocol',
+ 'class' => 'Class',
+ 'h323_conf_id' => 'h323-conf-id',
+ 'ascend_cbcp_delay' => 'Ascend-CBCP-Delay',
+ 'ascend_dropped_octets' => 'Ascend-Dropped-Octets',
+ 'ascend_h323_dialed_time' => 'Ascend-H323-Dialed-Time',
+ 'usr_local_ip_address' => 'USR-Local-IP-Address',
+ 'ascend_x25_x121_address' => 'Ascend-X25-X121-Address',
+ 'ascend_destination_nas_p' => 'Ascend-Destination-Nas-Port',
+ 'annex_local_ip_address' => 'Annex-Local-IP-Address',
+ 'usr_at_output_filter' => 'USR-AT-Output-Filter',
+ 'cisco_ip_pool_definition' => 'Cisco-IP-Pool-Definition',
+ 'annex_domain_name' => 'Annex-Domain-Name',
+ 'ascend_preempt_limit' => 'Ascend-Preempt-Limit',
+ 'ascend_event_type' => 'Ascend-Event-Type',
+ 'x_ascend_pre_input_octet' => 'X-Ascend-Pre-Input-Octets',
+ 'exec_program_wait' => 'Exec-Program-Wait',
+
+ #NOMENT
+ 'nomadix_ip_upsell' => 'Nomadix-IP-Upsell',
+
+ #NETC.NET.AU (RADIATOR?)
+ 'authentication_type' => 'Authentication-Type',
+
+);
+
+1;
diff --git a/FS/FS/radius_usergroup.pm b/FS/FS/radius_usergroup.pm
new file mode 100644
index 000000000..647621d28
--- /dev/null
+++ b/FS/FS/radius_usergroup.pm
@@ -0,0 +1,130 @@
+package FS::radius_usergroup;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+use FS::svc_acct;
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::radius_usergroup - Object methods for radius_usergroup records
+
+=head1 SYNOPSIS
+
+ use FS::radius_usergroup;
+
+ $record = new FS::radius_usergroup \%hash;
+ $record = new FS::radius_usergroup { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::radius_usergroup object links an account (see L<FS::svc_acct>) with a
+RADIUS group. FS::radius_usergroup inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item usergroupnum - primary key
+
+=item svcnum - Account (see L<FS::svc_acct>).
+
+=item groupname - group name
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new record. To add the record to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'radius_usergroup'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+#inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+#inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+#inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('usergroupnum')
+ || $self->ut_number('svcnum')
+ || $self->ut_foreign_key('svcnum','svc_acct','svcnum')
+ || $self->ut_text('groupname')
+ ;
+}
+
+=item svc_acct
+
+Returns the account associated with this record (see L<FS::svc_acct>).
+
+=cut
+
+sub svc_acct {
+ my $self = shift;
+ qsearchs('svc_acct', { svcnum => $self->svcnum } );
+}
+
+=back
+
+=head1 BUGS
+
+Don't let 'em get you down.
+
+=head1 SEE ALSO
+
+L<svc_acct>, L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/router.pm b/FS/FS/router.pm
new file mode 100755
index 000000000..3f9459a01
--- /dev/null
+++ b/FS/FS/router.pm
@@ -0,0 +1,156 @@
+package FS::router;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs qsearch );
+use FS::addr_block;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::router - Object methods for router records
+
+=head1 SYNOPSIS
+
+ use FS::router;
+
+ $record = new FS::router \%hash;
+ $record = new FS::router { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::router record describes a broadband router, such as a DSLAM or a wireless
+ access point. FS::router inherits from FS::Record. The following
+fields are currently supported:
+
+=over 4
+
+=item routernum - primary key
+
+=item routername - descriptive name for the router
+
+=item svcnum - svcnum of the owning FS::svc_broadband, if appropriate
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see "insert".
+
+=cut
+
+sub table { 'router'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_numbern('routernum')
+ || $self->ut_text('routername');
+ return $error if $error;
+
+ '';
+}
+
+=item addr_block
+
+Returns a list of FS::addr_block objects (address blocks) associated
+with this object.
+
+=cut
+
+sub addr_block {
+ my $self = shift;
+ return qsearch('addr_block', { routernum => $self->routernum });
+}
+
+=item router_field
+
+Returns a list of FS::router_field objects assigned to this object.
+
+=cut
+
+sub router_field {
+ my $self = shift;
+
+ return qsearch('router_field', { routernum => $self->routernum });
+}
+
+=item part_svc_router
+
+Returns a list of FS::part_svc_router objects associated with this
+object. This is unlikely to be useful for any purpose other than retrieving
+the associated FS::part_svc objects. See below.
+
+=cut
+
+sub part_svc_router {
+ my $self = shift;
+ return qsearch('part_svc_router', { routernum => $self->routernum });
+}
+
+=item part_svc
+
+Returns a list of FS::part_svc objects associated with this object.
+
+=cut
+
+sub part_svc {
+ my $self = shift;
+ return map { qsearchs('part_svc', { svcpart => $_->svcpart }) }
+ $self->part_svc_router;
+}
+
+=back
+
+=head1 VERSION
+
+$Id:
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+FS::svc_broadband, FS::router, FS::addr_block, FS::router_field, FS::part_svc,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/router_field.pm b/FS/FS/router_field.pm
new file mode 100755
index 000000000..eee21ab89
--- /dev/null
+++ b/FS/FS/router_field.pm
@@ -0,0 +1,146 @@
+package FS::router_field;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::part_router_field;
+use FS::router;
+
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::router_field - Object methods for router_field records
+
+=head1 SYNOPSIS
+
+ use FS::router_field;
+
+ $record = new FS::router_field \%hash;
+ $record = new FS::router_field { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+FS::router_field contains values of router xfields. See FS::part_sb_field
+for details on the xfield mechanism.
+
+=over 4
+
+=item routerfieldpart - Type of router_field as defined by
+FS::part_router_field
+
+=item routernum - The FS::router to which this value belongs.
+
+=item value - The contents of the field.
+
+=back
+
+=head1 METHODS
+
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see "insert".
+
+=cut
+
+sub table { 'router_field'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ return "routernum must be defined" unless $self->routernum;
+ return "routerfieldpart must be defined" unless $self->routerfieldpart;
+
+ my $part_router_field = $self->part_router_field;
+ $_ = $self->value;
+
+ my $check_block = $part_router_field->check_block;
+ if ($check_block) {
+ $@ = '';
+ my $error = (eval($check_block) or $@);
+ return $error if $error;
+ $self->setfield('value' => $_);
+ }
+
+ ''; #no error
+}
+
+=item part_router_field
+
+Returns a reference to the FS:part_router_field that defines this
+FS::router_field
+
+=cut
+
+sub part_router_field {
+ my $self = shift;
+
+ return qsearchs('part_router_field',
+ { routerfieldpart => $self->routerfieldpart });
+}
+
+=item router
+
+Returns a reference to the FS::router to which this FS::router_field
+belongs.
+
+=cut
+
+sub router {
+ my $self = shift;
+
+ return qsearchs('router', { routernum => $self->routernum });
+}
+
+=back
+
+=head1 VERSION
+
+$Id:
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+FS::svc_broadband, FS::router, FS::router_block, FS::router_field,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/sb_field.pm b/FS/FS/sb_field.pm
new file mode 100755
index 000000000..d4eb37844
--- /dev/null
+++ b/FS/FS/sb_field.pm
@@ -0,0 +1,148 @@
+package FS::sb_field;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::part_sb_field;
+
+use UNIVERSAL qw( can );
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::sb_field - Object methods for sb_field records
+
+=head1 SYNOPSIS
+
+ use FS::sb_field;
+
+ $record = new FS::sb_field \%hash;
+ $record = new FS::sb_field { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+See L<FS::part_sb_field> for details on this table's mission in life.
+FS::sb_field contains the actual values of the xfields defined in
+part_sb_field.
+
+The following fields are supported:
+
+=over 4
+
+=item sbfieldpart - Type of sb_field as defined by FS::part_sb_field
+
+=item svcnum - The svc_broadband to which this value belongs.
+
+=item value - The contents of the field.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see L<"insert">.
+
+=cut
+
+sub table { 'sb_field'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks the value against the check_block of the corresponding part_sb_field.
+Returns whatever the check_block returned (unless the check_block dies, in
+which case check returns the die message). Therefore, if the check_block
+wants to allow the value to be stored, it must return false. See
+L<FS::part_sb_field> for details.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ return "svcnum must be defined" unless $self->svcnum;
+ return "sbfieldpart must be defined" unless $self->sbfieldpart;
+
+ my $part_sb_field = $self->part_sb_field;
+
+ $_ = $self->value;
+
+ my $check_block = $self->part_sb_field->check_block;
+ if ($check_block) {
+ $@ = '';
+ my $error = (eval($check_block) or $@); # treat fatal errors as errors
+ return $error if $error;
+ $self->setfield('value' => $_);
+ }
+
+ ''; #no error
+}
+
+=item part_sb_field
+
+Returns a reference to the FS::part_sb_field that defines this FS::sb_field.
+
+=cut
+
+sub part_sb_field {
+ my $self = shift;
+
+ return qsearchs('part_sb_field', { sbfieldpart => $self->sbfieldpart });
+}
+
+=back
+
+=item svc_broadband
+
+Returns a reference to the FS::svc_broadband to which this value is attached.
+Nobody's ever going to use this function, but here it is anyway.
+
+=cut
+
+sub svc_broadband {
+ my $self = shift;
+
+ return qsearchs('svc_broadband', { svcnum => $self->svcnum });
+}
+
+=head1 VERSION
+
+$Id:
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::svc_broadband>, schema.html
+from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/session.pm b/FS/FS/session.pm
new file mode 100644
index 000000000..de0f2a76a
--- /dev/null
+++ b/FS/FS/session.pm
@@ -0,0 +1,269 @@
+package FS::session;
+
+use strict;
+use vars qw( @ISA $conf $start $stop );
+use FS::UID qw( dbh );
+use FS::Record qw( qsearchs );
+use FS::svc_acct;
+use FS::port;
+use FS::nas;
+
+@ISA = qw(FS::Record);
+
+$FS::UID::callback{'FS::session'} = sub {
+ $conf = new FS::Conf;
+ $start = $conf->exists('session-start') ? $conf->config('session-start') : '';
+ $stop = $conf->exists('session-stop') ? $conf->config('session-stop') : '';
+};
+
+=head1 NAME
+
+FS::session - Object methods for session records
+
+=head1 SYNOPSIS
+
+ use FS::session;
+
+ $record = new FS::session \%hash;
+ $record = new FS::session {
+ 'portnum' => 1,
+ 'svcnum' => 2,
+ 'login' => $timestamp,
+ 'logout' => $timestamp,
+ };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->nas_heartbeat($timestamp);
+
+=head1 DESCRIPTION
+
+An FS::session object represents an user login session. FS::session inherits
+from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item sessionnum - primary key
+
+=item portnum - NAS port for this session - see L<FS::port>
+
+=item svcnum - User for this session - see L<FS::svc_acct>
+
+=item login - timestamp indicating the beginning of this user session.
+
+=item logout - timestamp indicating the end of this user session. May be null,
+ which indicates a currently open session.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new session. To add the session to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'session'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false. If the `login' field is empty, it is replaced with
+the current time.
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ $error = $self->check;
+ return $error if $error;
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ if ( qsearchs('session', { 'portnum' => $self->portnum, 'logout' => '' } ) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "a session on that port is already open!";
+ }
+
+ $self->setfield('login', time()) unless $self->getfield('login');
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $self->nas_heartbeat($self->getfield('login'));
+
+ #session-starting callback
+ #redundant with heartbeat, yuck
+ my $port = qsearchs('port',{'portnum'=>$self->portnum});
+ my $nas = qsearchs('nas',{'nasnum'=>$port->nasnum});
+ #kcuy
+ my( $ip, $nasip, $nasfqdn ) = ( $port->ip, $nas->nasip, $nas->nasfqdn );
+ system( eval qq("$start") ) if $start;
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false. If the `logout' field is empty,
+it is replaced with the current time.
+
+=cut
+
+sub replace {
+ my($self, $old) = @_;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->check;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $self->setfield('logout', time()) unless $self->getfield('logout');
+
+ $error = $self->SUPER::replace($old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $self->nas_heartbeat($self->getfield('logout'));
+
+ #session-ending callback
+ #redundant with heartbeat, yuck
+ my $port = qsearchs('port',{'portnum'=>$self->portnum});
+ my $nas = qsearchs('nas',{'nasnum'=>$port->nasnum});
+ #kcuy
+ my( $ip, $nasip, $nasfqdn ) = ( $port->ip, $nas->nasip, $nas->nasfqdn );
+ system( eval qq("$stop") ) if $stop;
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item check
+
+Checks all fields to make sure this is a valid session. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+ my $error =
+ $self->ut_numbern('sessionnum')
+ || $self->ut_number('portnum')
+ || $self->ut_number('svcnum')
+ || $self->ut_numbern('login')
+ || $self->ut_numbern('logout')
+ ;
+ return $error if $error;
+ return "Unknown svcnum"
+ unless qsearchs('svc_acct', { 'svcnum' => $self->svcnum } );
+ '';
+}
+
+=item nas_heartbeat
+
+Heartbeats the nas associated with this session (see L<FS::nas>).
+
+=cut
+
+sub nas_heartbeat {
+ my $self = shift;
+ my $port = qsearchs('port',{'portnum'=>$self->portnum});
+ my $nas = qsearchs('nas',{'nasnum'=>$port->nasnum});
+ $nas->heartbeat(shift);
+}
+
+=item svc_acct
+
+Returns the svc_acct record associated with this session (see L<FS::svc_acct>).
+
+=cut
+
+sub svc_acct {
+ my $self = shift;
+ qsearchs('svc_acct', { 'svcnum' => $self->svcnum } );
+}
+
+=back
+
+=head1 VERSION
+
+$Id: session.pm,v 1.7 2001-04-15 13:35:12 ivan Exp $
+
+=head1 BUGS
+
+Maybe you shouldn't be able to insert a session if there's currently an open
+session on that port. Or maybe the open session on that port should be flagged
+as problematic? autoclosed? *sigh*
+
+Hmm, sessions refer to current svc_acct records... probably need to constrain
+deletions to svc_acct records such that no svc_acct records are deleted which
+have a session (even if long-closed).
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_Common.pm b/FS/FS/svc_Common.pm
new file mode 100644
index 000000000..87b6097aa
--- /dev/null
+++ b/FS/FS/svc_Common.pm
@@ -0,0 +1,381 @@
+package FS::svc_Common;
+
+use strict;
+use vars qw( @ISA $noexport_hack );
+use FS::Record qw( qsearchs fields dbh );
+use FS::cust_svc;
+use FS::part_svc;
+use FS::queue;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::svc_Common - Object method for all svc_ records
+
+=head1 SYNOPSIS
+
+use FS::svc_Common;
+
+@ISA = qw( FS::svc_Common );
+
+=head1 DESCRIPTION
+
+FS::svc_Common is intended as a base class for table-specific classes to
+inherit from, i.e. FS::svc_acct. FS::svc_Common inherits from FS::Record.
+
+=head1 METHODS
+
+=over 4
+
+=item insert [ JOBNUM_ARRAYREF ]
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+If an arrayref is passed as parameter, the B<jobnum>s of any export jobs will
+be added to the array.
+
+=cut
+
+sub insert {
+ my $self = shift;
+ local $FS::queue::jobnums = shift if @_;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->check;
+ return $error if $error;
+
+ my $svcnum = $self->svcnum;
+ my $cust_svc;
+ unless ( $svcnum ) {
+ $cust_svc = new FS::cust_svc ( {
+ #hua?# 'svcnum' => $svcnum,
+ 'pkgnum' => $self->pkgnum,
+ 'svcpart' => $self->svcpart,
+ } );
+ $error = $cust_svc->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $svcnum = $self->svcnum($cust_svc->svcnum);
+ } else {
+ $cust_svc = qsearchs('cust_svc',{'svcnum'=>$self->svcnum});
+ unless ( $cust_svc ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "no cust_svc record found for svcnum ". $self->svcnum;
+ }
+ $self->pkgnum($cust_svc->pkgnum);
+ $self->svcpart($cust_svc->svcpart);
+ }
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ #new-style exports!
+ unless ( $noexport_hack ) {
+ foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
+ my $error = $part_export->export_insert($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "exporting to ". $part_export->exporttype.
+ " (transaction rolled back): $error";
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item delete
+
+Deletes this account from the database. If there is an error, returns the
+error, otherwise returns false.
+
+The corresponding FS::cust_svc record will be deleted as well.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $svcnum = $self->svcnum;
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->SUPER::delete;
+ return $error if $error;
+
+ #new-style exports!
+ unless ( $noexport_hack ) {
+ foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
+ my $error = $part_export->export_delete($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "exporting to ". $part_export->exporttype.
+ " (transaction rolled back): $error";
+ }
+ }
+ }
+
+ return $error if $error;
+
+ my $cust_svc = $self->cust_svc;
+ $error = $cust_svc->delete;
+ return $error if $error;
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ '';
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+sub replace {
+ my ($new, $old) = (shift, shift);
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $new->SUPER::replace($old);
+ if ($error) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ #new-style exports!
+ unless ( $noexport_hack ) {
+ foreach my $part_export ( $new->cust_svc->part_svc->part_export ) {
+ my $error = $part_export->export_replace($new,$old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error exporting to ". $part_export->exporttype.
+ " (transaction rolled back): $error";
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+
+=item setfixed
+
+Sets any fixed fields for this service (see L<FS::part_svc>). If there is an
+error, returns the error, otherwise returns the FS::part_svc object (use ref()
+to test the return). Usually called by the check method.
+
+=cut
+
+sub setfixed {
+ my $self = shift;
+ $self->setx('F');
+}
+
+=item setdefault
+
+Sets all fields to their defaults (see L<FS::part_svc>), overriding their
+current values. If there is an error, returns the error, otherwise returns
+the FS::part_svc object (use ref() to test the return).
+
+=cut
+
+sub setdefault {
+ my $self = shift;
+ $self->setx('D');
+}
+
+sub setx {
+ my $self = shift;
+ my $x = shift;
+
+ my $error;
+
+ $error =
+ $self->ut_numbern('svcnum')
+ ;
+ return $error if $error;
+
+ #get part_svc
+ my $svcpart;
+ if ( $self->svcnum ) {
+ my $cust_svc = $self->cust_svc;
+ return "Unknown svcnum" unless $cust_svc;
+ $svcpart = $cust_svc->svcpart;
+ } else {
+ $svcpart = $self->getfield('svcpart');
+ }
+ my $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ return "Unkonwn svcpart" unless $part_svc;
+
+ #set default/fixed/whatever fields from part_svc
+ my $table = $self->table;
+ foreach my $field ( grep { $_ ne 'svcnum' } fields($table) ) {
+ my $part_svc_column = $part_svc->part_svc_column($field);
+ if ( $part_svc_column->columnflag eq $x ) {
+ $self->setfield( $field, $part_svc_column->columnvalue );
+ }
+ }
+
+ $part_svc;
+
+}
+
+=item cust_svc
+
+Returns the cust_svc record associated with this svc_ record, as a FS::cust_svc
+object (see L<FS::cust_svc>).
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ qsearchs('cust_svc', { 'svcnum' => $self->svcnum } );
+}
+
+=item suspend
+
+Runs export_suspend callbacks.
+
+=cut
+
+sub suspend {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ #new-style exports!
+ unless ( $noexport_hack ) {
+ foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
+ my $error = $part_export->export_suspend($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error exporting to ". $part_export->exporttype.
+ " (transaction rolled back): $error";
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item unsuspend
+
+Runs export_unsuspend callbacks.
+
+=cut
+
+sub unsuspend {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ #new-style exports!
+ unless ( $noexport_hack ) {
+ foreach my $part_export ( $self->cust_svc->part_svc->part_export ) {
+ my $error = $part_export->export_unsuspend($self);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error exporting to ". $part_export->exporttype.
+ " (transaction rolled back): $error";
+ }
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+
+}
+
+=item cancel
+
+Stub - returns false (no error) so derived classes don't need to define these
+methods. Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=cut
+
+sub cancel { ''; }
+
+=back
+
+=head1 VERSION
+
+$Id: svc_Common.pm,v 1.12 2002-06-14 11:22:53 ivan Exp $
+
+=head1 BUGS
+
+The setfixed method return value.
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, schema.html
+from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
new file mode 100644
index 000000000..5b8107fc8
--- /dev/null
+++ b/FS/FS/svc_acct.pm
@@ -0,0 +1,1212 @@
+package FS::svc_acct;
+
+use strict;
+use vars qw( @ISA $DEBUG $me $conf
+ $dir_prefix @shells $usernamemin
+ $usernamemax $passwordmin $passwordmax
+ $username_ampersand $username_letter $username_letterfirst
+ $username_noperiod $username_nounderscore $username_nodash
+ $username_uppercase
+ $welcome_template $welcome_from $welcome_subject $welcome_mimetype
+ $smtpmachine
+ $radius_password $radius_ip
+ $dirhash
+ @saltset @pw_set );
+use Carp;
+use Fcntl qw(:flock);
+use FS::UID qw( datasrc );
+use FS::Conf;
+use FS::Record qw( qsearch qsearchs fields dbh );
+use FS::svc_Common;
+use FS::cust_svc;
+use FS::part_svc;
+use FS::svc_acct_pop;
+use FS::cust_main_invoice;
+use FS::svc_domain;
+use FS::raddb;
+use FS::queue;
+use FS::radius_usergroup;
+use FS::export_svc;
+use FS::part_export;
+use FS::Msgcat qw(gettext);
+
+@ISA = qw( FS::svc_Common );
+
+$DEBUG = 0;
+$me = '[FS::svc_acct]';
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::svc_acct'} = sub {
+ $conf = new FS::Conf;
+ $dir_prefix = $conf->config('home');
+ @shells = $conf->config('shells');
+ $usernamemin = $conf->config('usernamemin') || 2;
+ $usernamemax = $conf->config('usernamemax');
+ $passwordmin = $conf->config('passwordmin') || 6;
+ $passwordmax = $conf->config('passwordmax') || 8;
+ $username_letter = $conf->exists('username-letter');
+ $username_letterfirst = $conf->exists('username-letterfirst');
+ $username_noperiod = $conf->exists('username-noperiod');
+ $username_nounderscore = $conf->exists('username-nounderscore');
+ $username_nodash = $conf->exists('username-nodash');
+ $username_uppercase = $conf->exists('username-uppercase');
+ $username_ampersand = $conf->exists('username-ampersand');
+ $dirhash = $conf->config('dirhash') || 0;
+ if ( $conf->exists('welcome_email') ) {
+ $welcome_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", $conf->config('welcome_email') ]
+ ) or warn "can't create welcome email template: $Text::Template::ERROR";
+ $welcome_from = $conf->config('welcome_email-from'); # || 'your-isp-is-dum'
+ $welcome_subject = $conf->config('welcome_email-subject') || 'Welcome';
+ $welcome_mimetype = $conf->config('welcome_email-mimetype') || 'text/plain';
+ } else {
+ $welcome_template = '';
+ $welcome_from = '';
+ $welcome_subject = '';
+ $welcome_mimetype = '';
+ }
+ $smtpmachine = $conf->config('smtpmachine');
+ $radius_password = $conf->config('radius-password') || 'Password';
+ $radius_ip = $conf->config('radius-ip') || 'Framed-IP-Address';
+};
+
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+@pw_set = ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '!', '.', ',' );
+
+sub _cache {
+ my $self = shift;
+ my ( $hashref, $cache ) = @_;
+ if ( $hashref->{'svc_acct_svcnum'} ) {
+ $self->{'_domsvc'} = FS::svc_domain->new( {
+ 'svcnum' => $hashref->{'domsvc'},
+ 'domain' => $hashref->{'svc_acct_domain'},
+ 'catchall' => $hashref->{'svc_acct_catchall'},
+ } );
+ }
+}
+
+=head1 NAME
+
+FS::svc_acct - Object methods for svc_acct records
+
+=head1 SYNOPSIS
+
+ use FS::svc_acct;
+
+ $record = new FS::svc_acct \%hash;
+ $record = new FS::svc_acct { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+ %hash = $record->radius;
+
+ %hash = $record->radius_reply;
+
+ %hash = $record->radius_check;
+
+ $domain = $record->domain;
+
+ $svc_domain = $record->svc_domain;
+
+ $email = $record->email;
+
+ $seconds_since = $record->seconds_since($timestamp);
+
+=head1 DESCRIPTION
+
+An FS::svc_acct object represents an account. FS::svc_acct inherits from
+FS::svc_Common. The following fields are currently supported:
+
+=over 4
+
+=item svcnum - primary key (assigned automatcially for new accounts)
+
+=item username
+
+=item _password - generated if blank
+
+=item sec_phrase - security phrase
+
+=item popnum - Point of presence (see L<FS::svc_acct_pop>)
+
+=item uid
+
+=item gid
+
+=item finger - GECOS
+
+=item dir - set automatically if blank (and uid is not)
+
+=item shell
+
+=item quota - (unimplementd)
+
+=item slipip - IP address
+
+=item seconds -
+
+=item domsvc - svcnum from svc_domain
+
+=item radius_I<Radius_Attribute> - I<Radius-Attribute>
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new account. To add the account to the database, see L<"insert">.
+
+=cut
+
+sub table { 'svc_acct'; }
+
+=item insert
+
+Adds this account to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+The additional field I<usergroup> can optionally be defined; if so it should
+contain an arrayref of group names. See L<FS::radius_usergroup>. (used in
+sqlradius export only)
+
+(TODOC: L<FS::queue> and L<freeside-queued>)
+
+(TODOC: new exports!)
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->check;
+ return $error if $error;
+
+ #no, duplicate checking just got a whole lot more complicated
+ #(perhaps keep this check with a config option to turn on?)
+
+ #return gettext('username_in_use'). ": ". $self->username
+ # if qsearchs( 'svc_acct', { 'username' => $self->username,
+ # 'domsvc' => $self->domsvc,
+ # } );
+
+ if ( $self->svcnum ) {
+ my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$self->svcnum});
+ unless ( $cust_svc ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "no cust_svc record found for svcnum ". $self->svcnum;
+ }
+ $self->pkgnum($cust_svc->pkgnum);
+ $self->svcpart($cust_svc->svcpart);
+ }
+
+ #new duplicate username checking
+
+ my $part_svc = qsearchs('part_svc', { 'svcpart' => $self->svcpart } );
+ unless ( $part_svc ) {
+ $dbh->rollback if $oldAutoCommit;
+ return 'unknown svcpart '. $self->svcpart;
+ }
+
+ my @dup_user = qsearch( 'svc_acct', { 'username' => $self->username } );
+ my @dup_userdomain = qsearch( 'svc_acct', { 'username' => $self->username,
+ 'domsvc' => $self->domsvc } );
+ my @dup_uid;
+ if ( $part_svc->part_svc_column('uid')->columnflag ne 'F'
+ && $self->username !~ /^(toor|(hyla)?fax)$/ ) {
+ @dup_uid = qsearch( 'svc_acct', { 'uid' => $self->uid } );
+ } else {
+ @dup_uid = ();
+ }
+
+ if ( @dup_user || @dup_userdomain || @dup_uid ) {
+ my $exports = FS::part_export::export_info('svc_acct');
+ my %conflict_user_svcpart;
+ my %conflict_userdomain_svcpart = ( $self->svcpart => 'SELF', );
+
+ foreach my $part_export ( $part_svc->part_export ) {
+
+ #this will catch to the same exact export
+ my @svcparts = map { $_->svcpart }
+ qsearch('export_svc', { 'exportnum' => $part_export->exportnum });
+
+ #this will catch to exports w/same exporthost+type ???
+ #my @other_part_export = qsearch('part_export', {
+ # 'machine' => $part_export->machine,
+ # 'exporttype' => $part_export->exporttype,
+ #} );
+ #foreach my $other_part_export ( @other_part_export ) {
+ # push @svcparts, map { $_->svcpart }
+ # qsearch('export_svc', { 'exportnum' => $part_export->exportnum });
+ #}
+
+ #my $nodomain = $exports->{$part_export->exporttype}{'nodomain'};
+ #silly kludge to avoid uninitialized value errors
+ my $nodomain = exists( $exports->{$part_export->exporttype}{'nodomain'} )
+ ? $exports->{$part_export->exporttype}{'nodomain'}
+ : '';
+ if ( $nodomain =~ /^Y/i ) {
+ $conflict_user_svcpart{$_} = $part_export->exportnum
+ foreach @svcparts;
+ } else {
+ $conflict_userdomain_svcpart{$_} = $part_export->exportnum
+ foreach @svcparts;
+ }
+ }
+
+ foreach my $dup_user ( @dup_user ) {
+ my $dup_svcpart = $dup_user->cust_svc->svcpart;
+ if ( exists($conflict_user_svcpart{$dup_svcpart}) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "duplicate username: conflicts with svcnum ". $dup_user->svcnum.
+ " via exportnum ". $conflict_user_svcpart{$dup_svcpart};
+ }
+ }
+
+ foreach my $dup_userdomain ( @dup_userdomain ) {
+ my $dup_svcpart = $dup_userdomain->cust_svc->svcpart;
+ if ( exists($conflict_userdomain_svcpart{$dup_svcpart}) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "duplicate username\@domain: conflicts with svcnum ".
+ $dup_userdomain->svcnum. " via exportnum ".
+ $conflict_userdomain_svcpart{$dup_svcpart};
+ }
+ }
+
+ foreach my $dup_uid ( @dup_uid ) {
+ my $dup_svcpart = $dup_uid->cust_svc->svcpart;
+ if ( exists($conflict_user_svcpart{$dup_svcpart})
+ || exists($conflict_userdomain_svcpart{$dup_svcpart}) ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "duplicate uid: conflicts with svcnum". $dup_uid->svcnum.
+ "via exportnum ". $conflict_user_svcpart{$dup_svcpart}
+ || $conflict_userdomain_svcpart{$dup_svcpart};
+ }
+ }
+
+ }
+
+ #see? i told you it was more complicated
+
+ my @jobnums;
+ $error = $self->SUPER::insert(\@jobnums);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ if ( $self->usergroup ) {
+ foreach my $groupname ( @{$self->usergroup} ) {
+ my $radius_usergroup = new FS::radius_usergroup ( {
+ svcnum => $self->svcnum,
+ groupname => $groupname,
+ } );
+ my $error = $radius_usergroup->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+ }
+
+ #false laziness with sub replace (and cust_main)
+ my $queue = new FS::queue {
+ 'svcnum' => $self->svcnum,
+ 'job' => 'FS::svc_acct::append_fuzzyfiles'
+ };
+ $error = $queue->insert($self->username);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "queueing job (transaction rolled back): $error";
+ }
+
+ my $cust_pkg = $self->cust_svc->cust_pkg;
+
+ if ( $cust_pkg ) {
+ my $cust_main = $cust_pkg->cust_main;
+
+ if ( $conf->exists('emailinvoiceauto') ) {
+ my @invoicing_list = $cust_main->invoicing_list;
+ push @invoicing_list, $self->email;
+ $cust_main->invoicing_list(\@invoicing_list);
+ }
+
+ #welcome email
+ my $to = '';
+ if ( $welcome_template && $cust_pkg ) {
+ my $to = join(', ', grep { $_ ne 'POST' } $cust_main->invoicing_list );
+ if ( $to ) {
+ my $wqueue = new FS::queue {
+ 'svcnum' => $self->svcnum,
+ 'job' => 'FS::svc_acct::send_email'
+ };
+ my $error = $wqueue->insert(
+ 'to' => $to,
+ 'from' => $welcome_from,
+ 'subject' => $welcome_subject,
+ 'mimetype' => $welcome_mimetype,
+ 'body' => $welcome_template->fill_in( HASH => {
+ 'custnum' => $self->custnum,
+ 'username' => $self->username,
+ 'password' => $self->_password,
+ 'first' => $cust_main->first,
+ 'last' => $cust_main->getfield('last'),
+ 'pkg' => $cust_pkg->part_pkg->pkg,
+ } ),
+ );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error queuing welcome email: $error";
+ }
+
+ foreach my $jobnum ( @jobnums ) {
+ my $error = $wqueue->depend_insert($jobnum);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error queuing welcome email job dependancy: $error";
+ }
+ }
+
+ }
+
+ }
+
+ } # if ( $cust_pkg )
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+}
+
+=item delete
+
+Deletes this account from the database. If there is an error, returns the
+error, otherwise returns false.
+
+The corresponding FS::cust_svc record will be deleted as well.
+
+(TODOC: new exports!)
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ return "Can't delete an account which is a (svc_forward) source!"
+ if qsearch( 'svc_forward', { 'srcsvc' => $self->svcnum } );
+
+ return "Can't delete an account which is a (svc_forward) destination!"
+ if qsearch( 'svc_forward', { 'dstsvc' => $self->svcnum } );
+
+ return "Can't delete an account with (svc_www) web service!"
+ if qsearch( 'svc_www', { 'usersvc' => $self->usersvc } );
+
+ # what about records in session ? (they should refer to history table)
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $cust_main_invoice (
+ qsearch( 'cust_main_invoice', { 'dest' => $self->svcnum } )
+ ) {
+ unless ( defined($cust_main_invoice) ) {
+ warn "WARNING: something's wrong with qsearch";
+ next;
+ }
+ my %hash = $cust_main_invoice->hash;
+ $hash{'dest'} = $self->email;
+ my $new = new FS::cust_main_invoice \%hash;
+ my $error = $new->replace($cust_main_invoice);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ foreach my $svc_domain (
+ qsearch( 'svc_domain', { 'catchall' => $self->svcnum } )
+ ) {
+ my %hash = new FS::svc_domain->hash;
+ $hash{'catchall'} = '';
+ my $new = new FS::svc_domain \%hash;
+ my $error = $new->replace($svc_domain);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ foreach my $radius_usergroup (
+ qsearch('radius_usergroup', { 'svcnum' => $self->svcnum } )
+ ) {
+ my $error = $radius_usergroup->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+The additional field I<usergroup> can optionally be defined; if so it should
+contain an arrayref of group names. See L<FS::radius_usergroup>. (used in
+sqlradius export only)
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+ my $error;
+ warn "$me replacing $old with $new\n" if $DEBUG;
+
+ return "Username in use"
+ if $old->username ne $new->username &&
+ qsearchs( 'svc_acct', { 'username' => $new->username,
+ 'domsvc' => $new->domsvc,
+ } );
+ {
+ #no warnings 'numeric'; #alas, a 5.006-ism
+ local($^W) = 0;
+ return "Can't change uid!" if $old->uid != $new->uid;
+ }
+
+ #change homdir when we change username
+ $new->setfield('dir', '') if $old->username ne $new->username;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ # redundant, but so $new->usergroup gets set
+ $error = $new->check;
+ return $error if $error;
+
+ $old->usergroup( [ $old->radius_groups ] );
+ warn "old groups: ". join(' ',@{$old->usergroup}). "\n" if $DEBUG;
+ warn "new groups: ". join(' ',@{$new->usergroup}). "\n" if $DEBUG;
+ if ( $new->usergroup ) {
+ #(sorta) false laziness with FS::part_export::sqlradius::_export_replace
+ my @newgroups = @{$new->usergroup};
+ foreach my $oldgroup ( @{$old->usergroup} ) {
+ if ( grep { $oldgroup eq $_ } @newgroups ) {
+ @newgroups = grep { $oldgroup ne $_ } @newgroups;
+ next;
+ }
+ my $radius_usergroup = qsearchs('radius_usergroup', {
+ svcnum => $old->svcnum,
+ groupname => $oldgroup,
+ } );
+ my $error = $radius_usergroup->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error deleting radius_usergroup $oldgroup: $error";
+ }
+ }
+
+ foreach my $newgroup ( @newgroups ) {
+ my $radius_usergroup = new FS::radius_usergroup ( {
+ svcnum => $new->svcnum,
+ groupname => $newgroup,
+ } );
+ my $error = $radius_usergroup->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error adding radius_usergroup $newgroup: $error";
+ }
+ }
+
+ }
+
+ $error = $new->SUPER::replace($old);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error if $error;
+ }
+
+ if ( $new->username ne $old->username ) {
+ #false laziness with sub insert (and cust_main)
+ my $queue = new FS::queue {
+ 'svcnum' => $new->svcnum,
+ 'job' => 'FS::svc_acct::append_fuzzyfiles'
+ };
+ $error = $queue->insert($new->username);
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "queueing job (transaction rolled back): $error";
+ }
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+}
+
+=item suspend
+
+Suspends this account by prefixing *SUSPENDED* to the password. If there is an
+error, returns the error, otherwise returns false.
+
+Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+Calls any export-specific suspend hooks.
+
+=cut
+
+sub suspend {
+ my $self = shift;
+ my %hash = $self->hash;
+ unless ( $hash{_password} =~ /^\*SUSPENDED\* /
+ || $hash{_password} eq '*'
+ ) {
+ $hash{_password} = '*SUSPENDED* '.$hash{_password};
+ my $new = new FS::svc_acct ( \%hash );
+ my $error = $new->replace($self);
+ return $error if $error;
+ }
+
+ $self->SUPER::suspend;
+}
+
+=item unsuspend
+
+Unsuspends this account by removing *SUSPENDED* from the password. If there is
+an error, returns the error, otherwise returns false.
+
+Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+Calls any export-specific unsuspend hooks.
+
+=cut
+
+sub unsuspend {
+ my $self = shift;
+ my %hash = $self->hash;
+ if ( $hash{_password} =~ /^\*SUSPENDED\* (.*)$/ ) {
+ $hash{_password} = $1;
+ my $new = new FS::svc_acct ( \%hash );
+ my $error = $new->replace($self);
+ return $error if $error;
+ }
+
+ $self->SUPER::unsuspend;
+}
+
+=item cancel
+
+Just returns false (no error) for now.
+
+Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item check
+
+Checks all fields to make sure this is a valid service. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+Sets any fixed values; see L<FS::part_svc>.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my($recref) = $self->hashref;
+
+ my $x = $self->setfixed;
+ return $x unless ref($x);
+ my $part_svc = $x;
+
+ if ( $part_svc->part_svc_column('usergroup')->columnflag eq "F" ) {
+ $self->usergroup(
+ [ split(',', $part_svc->part_svc_column('usergroup')->columnvalue) ] );
+ }
+
+ my $error = $self->ut_numbern('svcnum')
+ #|| $self->ut_number('domsvc')
+ || $self->ut_foreign_key('domsvc', 'svc_domain', 'svcnum' )
+ || $self->ut_textn('sec_phrase')
+ ;
+ return $error if $error;
+
+ my $ulen = $usernamemax || $self->dbdef_table->column('username')->length;
+ if ( $username_uppercase ) {
+ $recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/i
+ or return gettext('illegal_username'). " ($usernamemin-$ulen): ". $recref->{username};
+ $recref->{username} = $1;
+ } else {
+ $recref->{username} =~ /^([a-z0-9_\-\.\&]{$usernamemin,$ulen})$/
+ or return gettext('illegal_username'). " ($usernamemin-$ulen): ". $recref->{username};
+ $recref->{username} = $1;
+ }
+
+ if ( $username_letterfirst ) {
+ $recref->{username} =~ /^[a-z]/ or return gettext('illegal_username');
+ } elsif ( $username_letter ) {
+ $recref->{username} =~ /[a-z]/ or return gettext('illegal_username');
+ }
+ if ( $username_noperiod ) {
+ $recref->{username} =~ /\./ and return gettext('illegal_username');
+ }
+ if ( $username_nounderscore ) {
+ $recref->{username} =~ /_/ and return gettext('illegal_username');
+ }
+ if ( $username_nodash ) {
+ $recref->{username} =~ /\-/ and return gettext('illegal_username');
+ }
+ unless ( $username_ampersand ) {
+ $recref->{username} =~ /\&/ and return gettext('illegal_username');
+ }
+
+ $recref->{popnum} =~ /^(\d*)$/ or return "Illegal popnum: ".$recref->{popnum};
+ $recref->{popnum} = $1;
+ return "Unknown popnum" unless
+ ! $recref->{popnum} ||
+ qsearchs('svc_acct_pop',{'popnum'=> $recref->{popnum} } );
+
+ unless ( $part_svc->part_svc_column('uid')->columnflag eq 'F' ) {
+
+ $recref->{uid} =~ /^(\d*)$/ or return "Illegal uid";
+ $recref->{uid} = $1 eq '' ? $self->unique('uid') : $1;
+
+ $recref->{gid} =~ /^(\d*)$/ or return "Illegal gid";
+ $recref->{gid} = $1 eq '' ? $recref->{uid} : $1;
+ #not all systems use gid=uid
+ #you can set a fixed gid in part_svc
+
+ return "Only root can have uid 0"
+ if $recref->{uid} == 0
+ && $recref->{username} ne 'root'
+ && $recref->{username} ne 'toor';
+
+
+ $recref->{dir} =~ /^([\/\w\-\.\&]*)$/
+ or return "Illegal directory: ". $recref->{dir};
+ $recref->{dir} = $1;
+ return "Illegal directory"
+ if $recref->{dir} =~ /(^|\/)\.+(\/|$)/; #no .. component
+ return "Illegal directory"
+ if $recref->{dir} =~ /\&/ && ! $username_ampersand;
+ unless ( $recref->{dir} ) {
+ $recref->{dir} = $dir_prefix . '/';
+ if ( $dirhash > 0 ) {
+ for my $h ( 1 .. $dirhash ) {
+ $recref->{dir} .= substr($recref->{username}, $h-1, 1). '/';
+ }
+ } elsif ( $dirhash < 0 ) {
+ for my $h ( reverse $dirhash .. -1 ) {
+ $recref->{dir} .= substr($recref->{username}, $h, 1). '/';
+ }
+ }
+ $recref->{dir} .= $recref->{username};
+ ;
+ }
+
+ unless ( $recref->{username} eq 'sync' ) {
+ if ( grep $_ eq $recref->{shell}, @shells ) {
+ $recref->{shell} = (grep $_ eq $recref->{shell}, @shells)[0];
+ } else {
+ return "Illegal shell \`". $self->shell. "\'; ".
+ $conf->dir. "/shells contains: @shells";
+ }
+ } else {
+ $recref->{shell} = '/bin/sync';
+ }
+
+ } else {
+ $recref->{gid} ne '' ?
+ return "Can't have gid without uid" : ( $recref->{gid}='' );
+ $recref->{dir} ne '' ?
+ return "Can't have directory without uid" : ( $recref->{dir}='' );
+ $recref->{shell} ne '' ?
+ return "Can't have shell without uid" : ( $recref->{shell}='' );
+ }
+
+ # $error = $self->ut_textn('finger');
+ # return $error if $error;
+ $self->getfield('finger') =~
+ /^([\w \t\!\@\#\$\%\&\(\)\-\+\;\'\"\,\.\?\/\*\<\>]*)$/
+ or return "Illegal finger: ". $self->getfield('finger');
+ $self->setfield('finger', $1);
+
+ $recref->{quota} =~ /^(\d*)$/ or return "Illegal quota";
+ $recref->{quota} = $1;
+
+ unless ( $part_svc->part_svc_column('slipip')->columnflag eq 'F' ) {
+ if ( $recref->{slipip} eq '' ) {
+ $recref->{slipip} = '';
+ } elsif ( $recref->{slipip} eq '0e0' ) {
+ $recref->{slipip} = '0e0';
+ } else {
+ $recref->{slipip} =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/
+ or return "Illegal slipip: ". $self->slipip;
+ $recref->{slipip} = $1;
+ }
+
+ }
+
+ #arbitrary RADIUS stuff; allow ut_textn for now
+ foreach ( grep /^radius_/, fields('svc_acct') ) {
+ $self->ut_textn($_);
+ }
+
+ #generate a password if it is blank
+ $recref->{_password} = join('',map($pw_set[ int(rand $#pw_set) ], (0..7) ) )
+ unless ( $recref->{_password} );
+
+ #if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{4,16})$/ ) {
+ if ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([^\t\n]{$passwordmin,$passwordmax})$/ ) {
+ $recref->{_password} = $1.$3;
+ #uncomment this to encrypt password immediately upon entry, or run
+ #bin/crypt_pw in cron to give new users a window during which their
+ #password is available to techs, for faxing, etc. (also be aware of
+ #radius issues!)
+ #$recref->{password} = $1.
+ # crypt($3,$saltset[int(rand(64))].$saltset[int(rand(64))]
+ #;
+ } elsif ( $recref->{_password} =~ /^((\*SUSPENDED\* )?)([\w\.\/\$\;\+]{13,34})$/ ) {
+ $recref->{_password} = $1.$3;
+ } elsif ( $recref->{_password} eq '*' ) {
+ $recref->{_password} = '*';
+ } elsif ( $recref->{_password} eq '!!' ) {
+ $recref->{_password} = '!!';
+ } else {
+ #return "Illegal password";
+ return gettext('illegal_password'). " $passwordmin-$passwordmax ".
+ FS::Msgcat::_gettext('illegal_password_characters').
+ ": ". $recref->{_password};
+ }
+
+ ''; #no error
+}
+
+=item radius
+
+Depriciated, use radius_reply instead.
+
+=cut
+
+sub radius {
+ carp "FS::svc_acct::radius depriciated, use radius_reply";
+ $_[0]->radius_reply;
+}
+
+=item radius_reply
+
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS
+reply attributes of this record.
+
+Note that this is now the preferred method for reading RADIUS attributes -
+accessing the columns directly is discouraged, as the column names are
+expected to change in the future.
+
+=cut
+
+sub radius_reply {
+ my $self = shift;
+ my %reply =
+ map {
+ /^(radius_(.*))$/;
+ my($column, $attrib) = ($1, $2);
+ #$attrib =~ s/_/\-/g;
+ ( $FS::raddb::attrib{lc($attrib)}, $self->getfield($column) );
+ } grep { /^radius_/ && $self->getfield($_) } fields( $self->table );
+ if ( $self->slipip && $self->slipip ne '0e0' ) {
+ $reply{$radius_ip} = $self->slipip;
+ }
+ %reply;
+}
+
+=item radius_check
+
+Returns key/value pairs, suitable for assigning to a hash, for any RADIUS
+check attributes of this record.
+
+Note that this is now the preferred method for reading RADIUS attributes -
+accessing the columns directly is discouraged, as the column names are
+expected to change in the future.
+
+=cut
+
+sub radius_check {
+ my $self = shift;
+ my $password = $self->_password;
+ my $pw_attrib = length($password) <= 12 ? $radius_password : 'Crypt-Password';
+ ( $pw_attrib => $password,
+ map {
+ /^(rc_(.*))$/;
+ my($column, $attrib) = ($1, $2);
+ #$attrib =~ s/_/\-/g;
+ ( $FS::raddb::attrib{lc($attrib)}, $self->getfield($column) );
+ } grep { /^rc_/ && $self->getfield($_) } fields( $self->table )
+ );
+}
+
+=item domain
+
+Returns the domain associated with this account.
+
+=cut
+
+sub domain {
+ my $self = shift;
+ die "svc_acct.domsvc is null for svcnum ". $self->svcnum unless $self->domsvc;
+ my $svc_domain = $self->svc_domain
+ or die "no svc_domain.svcnum for svc_acct.domsvc ". $self->domsvc;
+ $svc_domain->domain;
+}
+
+=item svc_domain
+
+Returns the FS::svc_domain record for this account's domain (see
+L<FS::svc_domain>).
+
+=cut
+
+sub svc_domain {
+ my $self = shift;
+ $self->{'_domsvc'}
+ ? $self->{'_domsvc'}
+ : qsearchs( 'svc_domain', { 'svcnum' => $self->domsvc } );
+}
+
+=item cust_svc
+
+Returns the FS::cust_svc record for this account (see L<FS::cust_svc>).
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
+}
+
+=item email
+
+Returns an email address associated with the account.
+
+=cut
+
+sub email {
+ my $self = shift;
+ $self->username. '@'. $self->domain;
+}
+
+=item seconds_since TIMESTAMP
+
+Returns the number of seconds this account has been online since TIMESTAMP,
+according to the session monitor (see L<FS::Session>).
+
+TIMESTAMP is specified as a UNIX timestamp; see L<perlfunc/"time">. Also see
+L<Time::Local> and L<Date::Parse> for conversion functions.
+
+=cut
+
+#note: POD here, implementation in FS::cust_svc
+sub seconds_since {
+ my $self = shift;
+ $self->cust_svc->seconds_since(@_);
+}
+
+=item seconds_since_sqlradacct TIMESTAMP_START TIMESTAMP_END
+
+Returns the numbers of seconds this account has been online between
+TIMESTAMP_START (inclusive) and TIMESTAMP_END (exclusive), according to an
+external SQL radacct table, specified via sqlradius export. Sessions which
+started in the specified range but are still open are counted from session
+start to the end of the range (unless they are over 1 day old, in which case
+they are presumed missing their stop record and not counted). Also, sessions
+which end in therange but started earlier are counted from the start of the
+range to session end. Finally, sessions which start before the range but end
+after are counted for the entire range.
+
+TIMESTAMP_START and TIMESTAMP_END are specified as UNIX timestamps; see
+L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for conversion
+functions.
+
+=cut
+
+#note: POD here, implementation in FS::cust_svc
+sub seconds_since_sqlradacct {
+ my $self = shift;
+ $self->cust_svc->seconds_since_sqlradacct(@_);
+}
+
+=item attribute_since_sqlradacct TIMESTAMP_START TIMESTAMP_END ATTRIBUTE
+
+Returns the sum of the given attribute for all accounts (see L<FS::svc_acct>)
+in this package for sessions ending between TIMESTAMP_START (inclusive) and
+TIMESTAMP_END (exclusive).
+
+TIMESTAMP_START and TIMESTAMP_END are specified as UNIX timestamps; see
+L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for conversion
+functions.
+
+=cut
+
+#note: POD here, implementation in FS::cust_svc
+sub attribute_since_sqlradacct {
+ my $self = shift;
+ $self->cust_svc->attribute_since_sqlradacct(@_);
+}
+
+=item radius_groups
+
+Returns all RADIUS groups for this account (see L<FS::radius_usergroup>).
+
+=cut
+
+sub radius_groups {
+ my $self = shift;
+ if ( $self->usergroup ) {
+ #when provisioning records, export callback runs in svc_Common.pm before
+ #radius_usergroup records can be inserted...
+ @{$self->usergroup};
+ } else {
+ map { $_->groupname }
+ qsearch('radius_usergroup', { 'svcnum' => $self->svcnum } );
+ }
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item send_email
+
+This is the FS::svc_acct job-queue-able version. It still uses
+FS::Misc::send_email under-the-hood.
+
+=cut
+
+sub send_email {
+ my %opt = @_;
+
+ eval "use FS::Misc qw(send_email)";
+ die $@ if $@;
+
+ $opt{mimetype} ||= 'text/plain';
+ $opt{mimetype} .= '; charset="iso-8859-1"' unless $opt{mimetype} =~ /charset/;
+
+ my $error = send_email(
+ 'from' => $opt{from},
+ 'to' => $opt{to},
+ 'subject' => $opt{subject},
+ 'content-type' => $opt{mimetype},
+ 'body' => [ map "$_\n", split("\n", $opt{body}) ],
+ );
+ die $error if $error;
+}
+
+=item check_and_rebuild_fuzzyfiles
+
+=cut
+
+sub check_and_rebuild_fuzzyfiles {
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+ -e "$dir/svc_acct.username"
+ or &rebuild_fuzzyfiles;
+}
+
+=item rebuild_fuzzyfiles
+
+=cut
+
+sub rebuild_fuzzyfiles {
+
+ use Fcntl qw(:flock);
+
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+
+ #username
+
+ open(USERNAMELOCK,">>$dir/svc_acct.username")
+ or die "can't open $dir/svc_acct.username: $!";
+ flock(USERNAMELOCK,LOCK_EX)
+ or die "can't lock $dir/svc_acct.username: $!";
+
+ my @all_username = map $_->getfield('username'), qsearch('svc_acct', {});
+
+ open (USERNAMECACHE,">$dir/svc_acct.username.tmp")
+ or die "can't open $dir/svc_acct.username.tmp: $!";
+ print USERNAMECACHE join("\n", @all_username), "\n";
+ close USERNAMECACHE or die "can't close $dir/svc_acct.username.tmp: $!";
+
+ rename "$dir/svc_acct.username.tmp", "$dir/svc_acct.username";
+ close USERNAMELOCK;
+
+}
+
+=item all_username
+
+=cut
+
+sub all_username {
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+ open(USERNAMECACHE,"<$dir/svc_acct.username")
+ or die "can't open $dir/svc_acct.username: $!";
+ my @array = map { chomp; $_; } <USERNAMECACHE>;
+ close USERNAMECACHE;
+ \@array;
+}
+
+=item append_fuzzyfiles USERNAME
+
+=cut
+
+sub append_fuzzyfiles {
+ my $username = shift;
+
+ &check_and_rebuild_fuzzyfiles;
+
+ use Fcntl qw(:flock);
+
+ my $dir = $FS::UID::conf_dir. "cache.". $FS::UID::datasrc;
+
+ open(USERNAME,">>$dir/svc_acct.username")
+ or die "can't open $dir/svc_acct.username: $!";
+ flock(USERNAME,LOCK_EX)
+ or die "can't lock $dir/svc_acct.username: $!";
+
+ print USERNAME "$username\n";
+
+ flock(USERNAME,LOCK_UN)
+ or die "can't unlock $dir/svc_acct.username: $!";
+ close USERNAME;
+
+ 1;
+}
+
+
+
+=item radius_usergroup_selector GROUPS_ARRAYREF [ SELECTNAME ]
+
+=cut
+
+sub radius_usergroup_selector {
+ my $sel_groups = shift;
+ my %sel_groups = map { $_=>1 } @$sel_groups;
+
+ my $selectname = shift || 'radius_usergroup';
+
+ my $dbh = dbh;
+ my $sth = $dbh->prepare(
+ 'SELECT DISTINCT(groupname) FROM radius_usergroup ORDER BY groupname'
+ ) or die $dbh->errstr;
+ $sth->execute() or die $sth->errstr;
+ my @all_groups = map { $_->[0] } @{$sth->fetchall_arrayref};
+
+ my $html = <<END;
+ <SCRIPT>
+ function ${selectname}_doadd(object) {
+ var myvalue = object.${selectname}_add.value;
+ var optionName = new Option(myvalue,myvalue,false,true);
+ var length = object.$selectname.length;
+ object.$selectname.options[length] = optionName;
+ object.${selectname}_add.value = "";
+ }
+ </SCRIPT>
+ <SELECT MULTIPLE NAME="$selectname">
+END
+
+ foreach my $group ( @all_groups ) {
+ $html .= '<OPTION';
+ if ( $sel_groups{$group} ) {
+ $html .= ' SELECTED';
+ $sel_groups{$group} = 0;
+ }
+ $html .= ">$group</OPTION>\n";
+ }
+ foreach my $group ( grep { $sel_groups{$_} } keys %sel_groups ) {
+ $html .= "<OPTION SELECTED>$group</OPTION>\n";
+ };
+ $html .= '</SELECT>';
+
+ $html .= qq!<BR><INPUT TYPE="text" NAME="${selectname}_add">!.
+ qq!<INPUT TYPE="button" VALUE="Add new group" onClick="${selectname}_doadd(this.form)">!;
+
+ $html;
+}
+
+=back
+
+=head1 BUGS
+
+The $recref stuff in sub check should be cleaned up.
+
+The suspend, unsuspend and cancel methods update the database, but not the
+current object. This is probably a bug as it's unexpected and
+counterintuitive.
+
+radius_usergroup_selector? putting web ui components in here? they should
+probably live somewhere else...
+
+=head1 SEE ALSO
+
+L<FS::svc_Common>, edit/part_svc.cgi from an installed web interface,
+export.html from the base documentation, L<FS::Record>, L<FS::Conf>,
+L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, L<FS::queue>,
+L<freeside-queued>), L<FS::svc_acct_pop>,
+schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_acct_pop.pm b/FS/FS/svc_acct_pop.pm
new file mode 100644
index 000000000..196ab7ebb
--- /dev/null
+++ b/FS/FS/svc_acct_pop.pm
@@ -0,0 +1,209 @@
+package FS::svc_acct_pop;
+
+use strict;
+use vars qw( @ISA @EXPORT_OK @svc_acct_pop %svc_acct_pop );
+use FS::Record qw( qsearch qsearchs );
+
+@ISA = qw( FS::Record Exporter );
+@EXPORT_OK = qw( popselector );
+
+=head1 NAME
+
+FS::svc_acct_pop - Object methods for svc_acct_pop records
+
+=head1 SYNOPSIS
+
+ use FS::svc_acct_pop;
+
+ $record = new FS::svc_acct_pop \%hash;
+ $record = new FS::svc_acct_pop { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $html = FS::svc_acct_pop::popselector( $popnum, $state );
+
+=head1 DESCRIPTION
+
+An FS::svc_acct object represents an point of presence. FS::svc_acct_pop
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item popnum - primary key (assigned automatically for new accounts)
+
+=item city
+
+=item state
+
+=item ac - area code
+
+=item exch - exchange
+
+=item loc - rest of number
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new point of presence (if only it were that easy!). To add the
+point of presence to the database, see L<"insert">.
+
+=cut
+
+sub table { 'svc_acct_pop'; }
+
+=item insert
+
+Adds this point of presence to the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item delete
+
+Removes this point of presence from the database.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid point of presence. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ $self->ut_numbern('popnum')
+ or $self->ut_text('city')
+ or $self->ut_text('state')
+ or $self->ut_number('ac')
+ or $self->ut_number('exch')
+ or $self->ut_numbern('loc')
+ ;
+
+}
+
+=item text
+
+Returns:
+
+"$city, $state ($ac)/$exch"
+
+=cut
+
+sub text {
+ my $self = shift;
+ $self->city. ', '. $self->state.
+ ' ('. $self->ac. ')/'. $self->exch. '-'. $self->loc;
+}
+
+=back
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item popselector [ POPNUM [ STATE ] ]
+
+=cut
+
+#horrible false laziness with signup.cgi (pull special-case for 0 & 1
+# pop code out from signup.cgi??)
+sub popselector {
+ my( $popnum, $state ) = @_;
+
+ unless ( @svc_acct_pop ) { #cache pop list
+ @svc_acct_pop = qsearch('svc_acct_pop', {} );
+ %svc_acct_pop = ();
+ push @{$svc_acct_pop{$_->state}}, $_ foreach @svc_acct_pop;
+ }
+
+ my $text = <<END;
+ <SCRIPT>
+ function opt(what,href,text) {
+ var optionName = new Option(text, href, false, false)
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+
+ function popstate_changed(what) {
+ state = what.options[what.selectedIndex].text;
+ what.form.popnum.options.length = 0
+ what.form.popnum.options[0] = new Option("", "", false, true);
+END
+
+ foreach my $popstate ( sort { $a cmp $b } keys %svc_acct_pop ) {
+ $text .= "\nif ( state == \"$popstate\" ) {\n";
+
+ foreach my $pop ( @{$svc_acct_pop{$popstate}}) {
+ my $o_popnum = $pop->popnum;
+ my $poptext = $pop->text;
+ $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n"
+ }
+ $text .= "}\n";
+ }
+
+ $text .= "}\n</SCRIPT>\n";
+
+ $text .=
+ qq!<SELECT NAME="popstate" SIZE=1 onChange="popstate_changed(this)">!.
+ qq!<OPTION> !;
+ $text .= "<OPTION>$_" foreach sort { $a cmp $b } keys %svc_acct_pop;
+ $text .= '</SELECT>'; #callback? return 3 html pieces? #'</TD><TD>';
+
+ $text .= qq!<SELECT NAME="popnum" SIZE=1><OPTION> !;
+ my @initial_select;
+ if ( scalar(@svc_acct_pop) > 100 ) {
+ @initial_select = qsearchs( 'svc_acct_pop', { 'popnum' => $popnum } );
+ } else {
+ @initial_select = @svc_acct_pop;
+ }
+ foreach my $pop ( @initial_select ) {
+ $text .= qq!<OPTION VALUE="!. $pop->popnum. '"'.
+ ( ( $popnum && $pop->popnum == $popnum ) ? ' SELECTED' : '' ). ">".
+ $pop->text;
+ }
+ $text .= '</SELECT>';
+
+ $text;
+
+}
+
+=back
+
+=head1 VERSION
+
+$Id: svc_acct_pop.pm,v 1.9 2003-07-04 01:37:46 ivan Exp $
+
+=head1 BUGS
+
+It should be renamed to part_pop.
+
+popselector? putting web ui components in here? they should probably live
+somewhere else...
+
+popselector: pull special-case for 0 & 1 pop code out from signup.cgi
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::svc_acct>, L<FS::part_pop_local>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
new file mode 100755
index 000000000..45f6c3601
--- /dev/null
+++ b/FS/FS/svc_broadband.pm
@@ -0,0 +1,288 @@
+package FS::svc_broadband;
+
+use strict;
+use vars qw(@ISA $conf);
+use FS::Record qw( qsearchs qsearch dbh );
+use FS::svc_Common;
+use FS::cust_svc;
+use FS::addr_block;
+use NetAddr::IP;
+
+@ISA = qw( FS::svc_Common );
+
+$FS::UID::callback{'FS::svc_broadband'} = sub {
+ $conf = new FS::Conf;
+};
+
+=head1 NAME
+
+FS::svc_broadband - Object methods for svc_broadband records
+
+=head1 SYNOPSIS
+
+ use FS::svc_broadband;
+
+ $record = new FS::svc_broadband \%hash;
+ $record = new FS::svc_broadband { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::svc_broadband object represents a 'broadband' Internet connection, such
+as a DSL, cable modem, or fixed wireless link. These services are assumed to
+have the following properties:
+
+FS::svc_broadband inherits from FS::svc_Common. The following fields are
+currently supported:
+
+=over 4
+
+=item svcnum - primary key
+
+=item blocknum - see FS::addr_block
+
+=item
+speed_up - maximum upload speed, in bits per second. If set to zero, upload
+speed will be unlimited. Exports that do traffic shaping should handle this
+correctly, and not blindly set the upload speed to zero and kill the customer's
+connection.
+
+=item
+speed_down - maximum download speed, as above
+
+=item ip_addr - the customer's IP address. If the customer needs more than one
+IP address, set this to the address of the customer's router. As a result, the
+customer's router will have the same address for both its internal and external
+interfaces thus saving address space. This has been found to work on most NAT
+routers available.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new svc_broadband. To add the record to the database, see
+"insert".
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'svc_broadband'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields pkgnum and svcpart (see FS::cust_svc) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+=cut
+
+# Standard FS::svc_Common::insert
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# Standard FS::svc_Common::delete
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# Standard FS::svc_Common::replace
+
+=item sb_field
+
+Returns a list of FS::sb_field objects assigned to this object.
+
+=cut
+
+sub sb_field {
+ my $self = shift;
+
+ return qsearch( 'sb_field', { svcnum => $self->svcnum } );
+}
+
+=item sb_field_hashref
+
+Returns a hashref of the FS::sb_field key/value pairs for this object.
+
+Deprecated. Please don't use it.
+
+=cut
+
+# Kristian wrote this, but don't hold it against him. He was under a powerful
+# distracting influence whom he evidently found much more interesting than
+# svc_broadband.pm. I can't say I blame him.
+
+sub sb_field_hashref {
+ my $self = shift;
+ my $svcpart = shift;
+
+ if ((not $svcpart) && ($self->cust_svc)) {
+ $svcpart = $self->cust_svc->svcpart;
+ }
+
+ my $hashref = {};
+
+ map {
+ my $sb_field = qsearchs('sb_field', { sbfieldpart => $_->sbfieldpart,
+ svcnum => $self->svcnum });
+ $hashref->{$_->getfield('name')} = $sb_field ? $sb_field->getfield('value') : '';
+ } qsearch('part_sb_field', { svcpart => $svcpart });
+
+ return $hashref;
+
+}
+
+=item suspend
+
+Called by the suspend method of FS::cust_pkg (see FS::cust_pkg).
+
+=item unsuspend
+
+Called by the unsuspend method of FS::cust_pkg (see FS::cust_pkg).
+
+=item cancel
+
+Called by the cancel method of FS::cust_pkg (see FS::cust_pkg).
+
+=item check
+
+Checks all fields to make sure this is a valid broadband service. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+ my $x = $self->setfixed;
+
+ return $x unless ref($x);
+
+ my $error =
+ $self->ut_numbern('svcnum')
+ || $self->ut_foreign_key('blocknum', 'addr_block', 'blocknum')
+ || $self->ut_number('speed_up')
+ || $self->ut_number('speed_down')
+ || $self->ut_ipn('ip_addr')
+ ;
+ return $error if $error;
+
+ if($self->speed_up < 0) { return 'speed_up must be positive'; }
+ if($self->speed_down < 0) { return 'speed_down must be positive'; }
+
+ if (not($self->ip_addr) or $self->ip_addr eq '0.0.0.0') {
+ $self->ip_addr($self->addr_block->next_free_addr->addr);
+ if (not $self->ip_addr) {
+ return "No free addresses in addr_block (blocknum: ".$self->blocknum.")";
+ }
+ }
+
+ # This should catch errors in the ip_addr. If it doesn't,
+ # they'll almost certainly not map into the block anyway.
+ my $self_addr = $self->NetAddr; #netmask is /32
+ return ('Cannot parse address: ' . $self->ip_addr) unless $self_addr;
+
+ my $block_addr = $self->addr_block->NetAddr;
+ unless ($block_addr->contains($self_addr)) {
+ return 'blocknum '.$self->blocknum.' does not contain address '.$self->ip_addr;
+ }
+
+ my $router = $self->addr_block->router
+ or return 'Cannot assign address from unallocated block:'.$self->addr_block->blocknum;
+ if(grep { $_->routernum == $router->routernum} $self->allowed_routers) {
+ } # do nothing
+ else {
+ return 'Router '.$router->routernum.' cannot provide svcpart '.$self->svcpart;
+ }
+
+
+ ''; #no error
+}
+
+=item NetAddr
+
+Returns a NetAddr::IP object containing the IP address of this service. The netmask
+is /32.
+
+=cut
+
+sub NetAddr {
+ my $self = shift;
+ return new NetAddr::IP ($self->ip_addr);
+}
+
+=item addr_block
+
+Returns the FS::addr_block record (i.e. the address block) for this broadband service.
+
+=cut
+
+sub addr_block {
+ my $self = shift;
+
+ return qsearchs('addr_block', { blocknum => $self->blocknum });
+}
+
+=back
+
+=item allowed_routers
+
+Returns a list of allowed FS::router objects.
+
+=cut
+
+sub allowed_routers {
+ my $self = shift;
+
+ return map { $_->router } qsearch('part_svc_router', { svcpart => $self->svcpart });
+}
+
+=head1 BUGS
+
+I think there's one place in the code where we actually use sb_field_hashref.
+That's a bug in itself.
+
+The real problem with it is that we're still grappling with the question of how
+tightly xfields should be integrated with real fields. There are a few
+different directions we could go with it--we I<could> override several
+functions in Record so that xfields behave almost exactly like real fields (can
+be set with setfield(), appear in fields() and hash(), used as criteria in
+qsearch(), etc.).
+
+=head1 SEE ALSO
+
+FS::svc_Common, FS::Record, FS::addr_block, FS::sb_field,
+FS::part_svc, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm
new file mode 100644
index 000000000..32b94563d
--- /dev/null
+++ b/FS/FS/svc_domain.pm
@@ -0,0 +1,434 @@
+package FS::svc_domain;
+
+use strict;
+use vars qw( @ISA $whois_hack $conf
+ @defaultrecords $soadefaultttl $soaemail $soaexpire $soamachine
+ $soarefresh $soaretry
+);
+use Carp;
+use Date::Format;
+use Net::Whois 1.0;
+use FS::Record qw(fields qsearch qsearchs dbh);
+use FS::Conf;
+use FS::svc_Common;
+use FS::cust_svc;
+use FS::svc_acct;
+use FS::cust_pkg;
+use FS::cust_main;
+use FS::domain_record;
+use FS::queue;
+
+@ISA = qw( FS::svc_Common );
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::domain'} = sub {
+ $conf = new FS::Conf;
+
+ @defaultrecords = $conf->config('defaultrecords');
+ $soadefaultttl = $conf->config('soadefaultttl');
+ $soaemail = $conf->config('soaemail');
+ $soaexpire = $conf->config('soaexpire');
+ $soamachine = $conf->config('soamachine');
+ $soarefresh = $conf->config('soarefresh');
+ $soaretry = $conf->config('soaretry');
+
+};
+
+=head1 NAME
+
+FS::svc_domain - Object methods for svc_domain records
+
+=head1 SYNOPSIS
+
+ use FS::svc_domain;
+
+ $record = new FS::svc_domain \%hash;
+ $record = new FS::svc_domain { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::svc_domain object represents a domain. FS::svc_domain inherits from
+FS::svc_Common. The following fields are currently supported:
+
+=over 4
+
+=item svcnum - primary key (assigned automatically for new accounts)
+
+=item domain
+
+=item catchall - optional svcnum of an svc_acct record, designating an email catchall account.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new domain. To add the domain to the database, see L<"insert">.
+
+=cut
+
+sub table { 'svc_domain'; }
+
+=item insert
+
+Adds this domain to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields I<pkgnum> and I<svcpart> (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+The additional field I<action> should be set to I<N> for new domains or I<M>
+for transfers.
+
+A registration or transfer email will be submitted unless
+$FS::svc_domain::whois_hack is true.
+
+The additional field I<email> can be used to manually set the admin contact
+email address on this email. Otherwise, the svc_acct records for this package
+(see L<FS::cust_pkg>) are searched. If there is exactly one svc_acct record
+in the same package, it is automatically used. Otherwise an error is returned.
+
+If any I<soamachine> configuration file exists, an SOA record is added to
+the domain_record table (see <FS::domain_record>).
+
+If any records are defined in the I<defaultrecords> configuration file,
+appropriate records are added to the domain_record table (see
+L<FS::domain_record>).
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->check;
+ return $error if $error;
+
+ return "Domain in use (here)"
+ if qsearchs( 'svc_domain', { 'domain' => $self->domain } );
+
+ my $whois = $self->whois;
+ if ( $self->action eq "N" && ! $whois_hack && $whois ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Domain in use (see whois)";
+ }
+ if ( $self->action eq "M" && ! $whois ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Domain not found (see whois)";
+ }
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $self->submit_internic unless $whois_hack;
+
+ if ( $soamachine ) {
+ my $soa = new FS::domain_record {
+ 'svcnum' => $self->svcnum,
+ 'reczone' => '@',
+ 'recaf' => 'IN',
+ 'rectype' => 'SOA',
+ 'recdata' => "$soamachine $soaemail ( ". time2str("%Y%m%d", time). "00 ".
+ "$soarefresh $soaretry $soaexpire $soadefaultttl )"
+ };
+ $error = $soa->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "couldn't insert SOA record for new domain: $error";
+ }
+
+ foreach my $record ( @defaultrecords ) {
+ my($zone,$af,$type,$data) = split(/\s+/,$record,4);
+ my $domain_record = new FS::domain_record {
+ 'svcnum' => $self->svcnum,
+ 'reczone' => $zone,
+ 'recaf' => $af,
+ 'rectype' => $type,
+ 'recdata' => $data,
+ };
+ my $error = $domain_record->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "couldn't insert record for new domain: $error";
+ }
+ }
+
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
+ ''; #no error
+}
+
+=item delete
+
+Deletes this domain from the database. If there is an error, returns the
+error, otherwise returns false.
+
+The corresponding FS::cust_svc record will be deleted as well.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ return "Can't delete a domain which has accounts!"
+ if qsearch( 'svc_acct', { 'domsvc' => $self->svcnum } );
+
+ #return "Can't delete a domain with (domain_record) zone entries!"
+ # if qsearch('domain_record', { 'svcnum' => $self->svcnum } );
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ foreach my $domain_record ( reverse $self->domain_record ) {
+ my $error = $domain_record->delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ }
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+}
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ return "Can't change domain - reorder."
+ if $old->getfield('domain') ne $new->getfield('domain');
+
+ my $error = $new->SUPER::replace($old);
+ return $error if $error;
+}
+
+=item suspend
+
+Just returns false (no error) for now.
+
+Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item unsuspend
+
+Just returns false (no error) for now.
+
+Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item cancel
+
+Just returns false (no error) for now.
+
+Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item check
+
+Checks all fields to make sure this is a valid domain. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+Sets any fixed values; see L<FS::part_svc>.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $x = $self->setfixed;
+ return $x unless ref($x);
+ #my $part_svc = $x;
+
+ my $error = $self->ut_numbern('svcnum')
+ || $self->ut_numbern('catchall')
+ ;
+ return $error if $error;
+
+ #hmm
+ my $pkgnum;
+ if ( $self->svcnum ) {
+ my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
+ $pkgnum = $cust_svc->pkgnum;
+ } else {
+ $pkgnum = $self->pkgnum;
+ }
+
+ my($recref) = $self->hashref;
+
+ unless ( $whois_hack ) {
+ unless ( $self->email ) { #find out an email address
+ my @svc_acct;
+ foreach ( qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } ) ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $_->svcnum } );
+ push @svc_acct, $svc_acct if $svc_acct;
+ }
+
+ if ( scalar(@svc_acct) == 0 ) {
+ return "Must order an account in package ". $pkgnum. " first";
+ } elsif ( scalar(@svc_acct) > 1 ) {
+ return "More than one account in package ". $pkgnum. ": specify admin contact email";
+ } else {
+ $self->email($svc_acct[0]->email );
+ }
+ }
+ }
+
+ #if ( $recref->{domain} =~ /^([\w\-\.]{1,22})\.(com|net|org|edu)$/ ) {
+ if ( $recref->{domain} =~ /^([\w\-]{1,63})\.(com|net|org|edu)$/ ) {
+ $recref->{domain} = "$1.$2";
+ # hmmmmmmmm.
+ } elsif ( $whois_hack && $recref->{domain} =~ /^([\w\-\.]+)$/ ) {
+ $recref->{domain} = $1;
+ } else {
+ return "Illegal domain ". $recref->{domain}.
+ " (or unknown registry - try \$whois_hack)";
+ }
+
+ $recref->{action} =~ /^(M|N)$/ or return "Illegal action";
+ $recref->{action} = $1;
+
+ if ( $recref->{catchall} ne '' ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $recref->{catchall} } );
+ return "Unknown catchall" unless $svc_acct;
+ }
+
+ $self->ut_textn('purpose');
+
+}
+
+=item domain_record
+
+=cut
+
+sub domain_record {
+ my $self = shift;
+
+ my %order = (
+ SOA => 1,
+ NS => 2,
+ MX => 3,
+ CNAME => 4,
+ A => 5,
+ );
+
+ sort { $order{$a->rectype} <=> $order{$b->rectype} }
+ qsearch('domain_record', { svcnum => $self->svcnum } );
+
+}
+
+sub catchall_svc_acct {
+ my $self = shift;
+ if ( $self->catchall ) {
+ qsearchs( 'svc_acct', { 'svcnum' => $self->catchall } );
+ } else {
+ '';
+ }
+}
+
+=item whois
+
+Returns the Net::Whois::Domain object (see L<Net::Whois>) for this domain, or
+undef if the domain is not found in whois.
+
+(If $FS::svc_domain::whois_hack is true, returns that in all cases instead.)
+
+=cut
+
+sub whois {
+ $whois_hack or new Net::Whois::Domain $_[0]->domain;
+}
+
+=item _whois
+
+Depriciated.
+
+=cut
+
+sub _whois {
+ die "_whois depriciated";
+}
+
+=item submit_internic
+
+Submits a registration email for this domain.
+
+=cut
+
+sub submit_internic {
+ #my $self = shift;
+ carp "submit_internic depreciated";
+}
+
+=back
+
+=head1 BUGS
+
+Delete doesn't send a registration template.
+
+All registries should be supported.
+
+Should change action to a real field.
+
+The $recref stuff in sub check should be cleaned up.
+
+=head1 SEE ALSO
+
+L<FS::svc_Common>, L<FS::Record>, L<FS::Conf>, L<FS::cust_svc>,
+L<FS::part_svc>, L<FS::cust_pkg>, L<Net::Whois>, schema.html from the base
+documentation, config.html from the base documentation.
+
+=cut
+
+1;
+
+
diff --git a/FS/FS/svc_forward.pm b/FS/FS/svc_forward.pm
new file mode 100644
index 000000000..2b1fb9225
--- /dev/null
+++ b/FS/FS/svc_forward.pm
@@ -0,0 +1,282 @@
+package FS::svc_forward;
+
+use strict;
+use vars qw( @ISA );
+use FS::Conf;
+use FS::Record qw( fields qsearch qsearchs dbh );
+use FS::svc_Common;
+use FS::cust_svc;
+use FS::svc_acct;
+use FS::svc_domain;
+
+@ISA = qw( FS::svc_Common );
+
+=head1 NAME
+
+FS::svc_forward - Object methods for svc_forward records
+
+=head1 SYNOPSIS
+
+ use FS::svc_forward;
+
+ $record = new FS::svc_forward \%hash;
+ $record = new FS::svc_forward { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::svc_forward object represents a mail forwarding alias. FS::svc_forward
+inherits from FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item svcnum - primary key (assigned automatcially for new accounts)
+
+=item srcsvc - svcnum of the source of the forward (see L<FS::svc_acct>)
+
+=item dstsvc - svcnum of the destination of the forward (see L<FS::svc_acct>)
+
+=item dst - foreign destination (email address) - forward not local to freeside
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new mail forwarding alias. To add the mail forwarding alias to the
+database, see L<"insert">.
+
+=cut
+
+sub table { 'svc_forward'; }
+
+=item insert
+
+Adds this mail forwarding alias to the database. If there is an error, returns
+the error, otherwise returns false.
+
+The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ $error = $self->check;
+ return $error if $error;
+
+ $error = $self->SUPER::insert;
+ if ($error) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ ''; #no error
+
+}
+
+=item delete
+
+Deletes this mail forwarding alias from the database. If there is an error,
+returns the error, otherwise returns false.
+
+The corresponding FS::cust_svc record will be deleted as well.
+
+=cut
+
+sub delete {
+ my $self = shift;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::Autocommit = 0;
+ my $dbh = dbh;
+
+ my $error = $self->SUPER::delete;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+
+ if ( $new->srcsvc != $old->srcsvc
+ && ( $new->dstsvc != $old->dstsvc
+ || ! $new->dstsvc && $new->dst ne $old->dst
+ )
+ ) {
+ return "Can't change both source and destination of a mail forward!"
+ }
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $error = $new->SUPER::replace($old);
+ if ($error) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+=item suspend
+
+Just returns false (no error) for now.
+
+Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item unsuspend
+
+Just returns false (no error) for now.
+
+Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item cancel
+
+Just returns false (no error) for now.
+
+Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item check
+
+Checks all fields to make sure this is a valid mail forwarding alias. If there
+is an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+Sets any fixed values; see L<FS::part_svc>.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $x = $self->setfixed;
+ return $x unless ref($x);
+ #my $part_svc = $x;
+
+ my $error = $self->ut_numbern('svcnum')
+ || $self->ut_number('srcsvc')
+ || $self->ut_numbern('dstsvc')
+ ;
+ return $error if $error;
+
+ return "Unknown srcsvc" unless $self->srcsvc_acct;
+
+ return "Both dstsvc and dst were defined; only one can be specified"
+ if $self->dstsvc && $self->dst;
+
+ return "one of dstsvc or dst is required"
+ unless $self->dstsvc || $self->dst;
+
+ #return "Unknown dstsvc: $dstsvc" unless $self->dstsvc_acct || ! $self->dstsvc;
+ return "Unknown dstsvc"
+ unless qsearchs('svc_acct', { 'svcnum' => $self->dstsvc } )
+ || ! $self->dstsvc;
+
+
+ if ( $self->dst ) {
+ $self->dst =~ /^([\w\.\-]+)\@(([\w\-]+\.)+\w+)$/
+ or return "Illegal dst: ". $self->dst;
+ $self->dst("$1\@$2");
+ } else {
+ $self->dst('');
+ }
+
+ ''; #no error
+}
+
+=item srcsvc_acct
+
+Returns the FS::svc_acct object referenced by the srcsvc column.
+
+=cut
+
+sub srcsvc_acct {
+ my $self = shift;
+ qsearchs('svc_acct', { 'svcnum' => $self->srcsvc } );
+}
+
+=item dstsvc_acct
+
+Returns the FS::svc_acct object referenced by the srcsvc column, or false for
+forwards not local to freeside.
+
+=cut
+
+sub dstsvc_acct {
+ my $self = shift;
+ qsearchs('svc_acct', { 'svcnum' => $self->dstsvc } );
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::Conf>, L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>,
+L<FS::svc_acct>, L<FS::svc_domain>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/svc_www.pm b/FS/FS/svc_www.pm
new file mode 100644
index 000000000..d7a42c8ae
--- /dev/null
+++ b/FS/FS/svc_www.pm
@@ -0,0 +1,276 @@
+package FS::svc_www;
+
+use strict;
+use vars qw(@ISA $conf $apacheip);
+#use FS::Record qw( qsearch qsearchs );
+use FS::Record qw( qsearchs dbh );
+use FS::svc_Common;
+use FS::cust_svc;
+use FS::domain_record;
+use FS::svc_acct;
+use FS::svc_domain;
+
+@ISA = qw( FS::svc_Common );
+
+#ask FS::UID to run this stuff for us later
+$FS::UID::callback{'FS::svc_www'} = sub {
+ $conf = new FS::Conf;
+ $apacheip = $conf->config('apacheip');
+};
+
+=head1 NAME
+
+FS::svc_www - Object methods for svc_www records
+
+=head1 SYNOPSIS
+
+ use FS::svc_www;
+
+ $record = new FS::svc_www \%hash;
+ $record = new FS::svc_www { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::svc_www object represents an web virtual host. FS::svc_www inherits
+from FS::svc_Common. The following fields are currently supported:
+
+=over 4
+
+=item svcnum - primary key
+
+=item recnum - DNS `A' record corresponding to this web virtual host. (see L<FS::domain_record>)
+
+=item usersvc - account (see L<FS::svc_acct>) corresponding to this web virtual host.
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new web virtual host. To add the record to the database, see
+L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'svc_www'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+=cut
+
+sub insert {
+ my $self = shift;
+
+ my $error = $self->check;
+ return $error if $error;
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+ my $oldAutoCommit = $FS::UID::AutoCommit;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ #if ( $self->recnum =~ /^([\w\-]+|\@)\.(([\w\.\-]+\.)+\w+)$/ ) {
+ if ( $self->recnum =~ /^([\w\-]+|\@)\.(\d+)$/ ) {
+ my( $reczone, $domain_svcnum ) = ( $1, $2 );
+ unless ( $apacheip ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "Configuration option apacheip not set; can't autocreate A record";
+ #"for $reczone". $svc_domain->domain;
+ }
+ my $domain_record = new FS::domain_record {
+ 'svcnum' => $domain_svcnum,
+ 'reczone' => $reczone,
+ 'recaf' => 'IN',
+ 'rectype' => 'A',
+ 'recdata' => $apacheip,
+ };
+ $error = $domain_record->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+ $self->recnum($domain_record->recnum);
+ }
+
+ $error = $self->SUPER::insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return $error;
+ }
+
+ $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+ '';
+}
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ my $error;
+
+ $error = $self->SUPER::delete;
+ return $error if $error;
+
+ '';
+}
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+ my $error;
+
+ $error = $new->SUPER::replace($old);
+ return $error if $error;
+
+ '';
+}
+
+=item suspend
+
+Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item unsuspend
+
+Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item cancel
+
+Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item check
+
+Checks all fields to make sure this is a valid web virtual host. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and repalce methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $x = $self->setfixed;
+ return $x unless ref($x);
+ #my $part_svc = $x;
+
+ my $error =
+ $self->ut_numbern('svcnum')
+# || $self->ut_number('recnum')
+ || $self->ut_number('usersvc')
+ ;
+ return $error if $error;
+
+ if ( $self->recnum =~ /^(\d+)$/ ) {
+
+ $self->recnum($1);
+ return "Unknown recnum: ". $self->recnum
+ unless qsearchs('domain_record', { 'recnum' => $self->recnum } );
+
+ } elsif ( $self->recnum =~ /^([\w\-]+|\@)\.(([\w\.\-]+\.)+\w+)$/ ) {
+
+ my( $reczone, $domain ) = ( $1, $2 );
+
+ my $svc_domain = qsearchs( 'svc_domain', { 'domain' => $domain } )
+ or return "unknown domain $domain (recnum $1.$2)";
+
+ my $domain_record = qsearchs( 'domain_record', {
+ 'reczone' => $reczone,
+ 'svcnum' => $svc_domain->svcnum,
+ });
+
+ if ( $domain_record ) {
+ $self->recnum($domain_record->recnum);
+ } else {
+ #insert will create it
+ #$self->recnum("$reczone.$domain");
+ $self->recnum("$reczone.". $svc_domain->svcnum);
+ }
+
+ } else {
+ return "Illegal recnum: ". $self->recnum;
+ }
+
+ return "Unknown usersvc (svc_acct.svcnum): ". $self->usersvc
+ unless qsearchs('svc_acct', { 'svcnum' => $self->usersvc } );
+
+ ''; #no error
+}
+
+=item domain_record
+
+Returns the FS::domain_record record for this web virtual host's zone (see
+L<FS::domain_record>).
+
+=cut
+
+sub domain_record {
+ my $self = shift;
+ qsearchs('domain_record', { 'recnum' => $self->recnum } );
+}
+
+=item svc_acct
+
+Returns the FS::svc_acct record for this web virtual host's owner (see
+L<FS::svc_acct>).
+
+=cut
+
+sub svc_acct {
+ my $self = shift;
+ qsearchs('svc_acct', { 'svcnum' => $self->usersvc } );
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::svc_Common>, L<FS::Record>, L<FS::domain_record>, L<FS::cust_svc>,
+L<FS::part_svc>, L<FS::cust_pkg>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/FS/FS/type_pkgs.pm b/FS/FS/type_pkgs.pm
new file mode 100644
index 000000000..efba60dbd
--- /dev/null
+++ b/FS/FS/type_pkgs.pm
@@ -0,0 +1,126 @@
+package FS::type_pkgs;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearchs );
+use FS::agent_type;
+use FS::part_pkg;
+
+@ISA = qw( FS::Record );
+
+=head1 NAME
+
+FS::type_pkgs - Object methods for type_pkgs records
+
+=head1 SYNOPSIS
+
+ use FS::type_pkgs;
+
+ $record = new FS::type_pkgs \%hash;
+ $record = new FS::type_pkgs { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::type_pkgs record links an agent type (see L<FS::agent_type>) to a
+billing item definition (see L<FS::part_pkg>). FS::type_pkgs inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item typenum - Agent type, see L<FS::agent_type>
+
+=item pkgpart - Billing item definition, see L<FS::part_pkg>
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Create a new record. To add the record to the database, see L<"insert">.
+
+=cut
+
+sub table { 'type_pkgs'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=item delete
+
+Deletes this record from the database. If there is an error, returns the
+error, otherwise returns false.
+
+=item replace OLD_RECORD
+
+Replaces OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=item check
+
+Checks all fields to make sure this is a valid record. If there is an error,
+returns the error, otherwise returns false. Called by the insert and replace
+methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $error =
+ $self->ut_number('typenum')
+ || $self->ut_number('pkgpart')
+ ;
+ return $error if $error;
+
+ return "Unknown typenum"
+ unless qsearchs( 'agent_type', { 'typenum' => $self->typenum } );
+
+ return "Unknown pkgpart"
+ unless qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
+
+ ''; #no error
+}
+
+=item part_pkg
+
+Returns the FS::part_pkg object associated with this record.
+
+=cut
+
+sub part_pkg {
+ my $self = shift;
+ qsearchs( 'part_pkg', { 'pkgpart' => $self->pkgpart } );
+}
+
+=cut
+
+=back
+
+=head1 VERSION
+
+$Id: type_pkgs.pm,v 1.2 2002-10-04 12:57:06 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::Record>, L<FS::agent_type>, L<FS::part_pkgs>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
diff --git a/FS/MANIFEST b/FS/MANIFEST
new file mode 100644
index 000000000..846f37310
--- /dev/null
+++ b/FS/MANIFEST
@@ -0,0 +1,197 @@
+Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+README
+bin/freeside-addoutsource
+bin/freeside-addoutsourceuser
+bin/freeside-adduser
+bin/freeside-apply-credits
+bin/freeside-bill
+bin/freeside-cc-receipts-report
+bin/freeside-count-active-customers
+bin/freeside-credit-report
+bin/freeside-daily
+bin/freeside-deloutsource
+bin/freeside-deloutsourceuser
+bin/freeside-deluser
+bin/freeside-email
+bin/freeside-expiration-alerter
+bin/freeside-queued
+bin/freeside-radgroup
+bin/freeside-receivables-report
+bin/freeside-reexport
+bin/freeside-selfservice-server
+bin/freeside-setinvoice
+bin/freeside-setup
+bin/freeside-sqlradius-radacctd
+bin/freeside-sqlradius-reset
+bin/freeside-sqlradius-seconds
+bin/freeside-tax-report
+FS.pm
+FS/CGI.pm
+FS/InitHandler.pm
+FS/ClientAPI.pm
+FS/ClientAPI/passwd.pm
+FS/ClientAPI/MyAccount.pm
+FS/Conf.pm
+FS/ConfItem.pm
+FS/Misc.pm
+FS/Record.pm
+FS/SearchCache.pm
+FS/UI/Base.pm
+FS/UI/CGI.pm
+FS/UI/Gtk.pm
+FS/UI/agent.pm
+FS/UID.pm
+FS/Msgcat.pm
+FS/agent.pm
+FS/agent_type.pm
+FS/cust_bill.pm
+FS/cust_bill_pkg.pm
+FS/cust_bill_pkg_detail.pm
+FS/cust_credit.pm
+FS/cust_credit_bill.pm
+FS/cust_main.pm
+FS/cust_main_county.pm
+FS/cust_main_invoice.pm
+FS/cust_pay.pm
+FS/cust_bill_event.pm
+FS/cust_bill_pay.pm
+FS/cust_pay_batch.pm
+FS/cust_pkg.pm
+FS/cust_refund.pm
+FS/cust_credit_refund.pm
+FS/cust_svc.pm
+FS/part_bill_event.pm
+FS/export_svc.pm
+FS/part_export.pm
+FS/part_export_option.pm
+FS/part_export/apache.pm
+FS/part_export/bind.pm
+FS/part_export/bind_slave.pm
+FS/part_export/bsdshell.pm
+FS/part_export/cp.pm
+FS/part_export/cyrus.pm
+FS/part_export/domain_shellcommands.pm
+FS/part_export/forward_shellcommands.pm
+FS/part_export/http.pm
+FS/part_export/infostreet.pm
+FS/part_export/ldap.pm
+FS/part_export/null.pm
+FS/part_export/shellcommands.pm
+FS/part_export/shellcommands_withdomain.pm
+FS/part_export/sqlmail.pm
+FS/part_export/sqlradius.pm
+FS/part_export/sysvshell.pm
+FS/part_export/textradius.pm
+FS/part_export/vpopmail.pm
+FS/part_export/www_shellcommands.pm
+FS/part_pkg.pm
+FS/part_pop_local.pm
+FS/part_referral.pm
+FS/part_svc.pm
+FS/part_svc_column.pm
+FS/part_router_field.pm
+FS/part_sb_field.pm
+FS/part_svc_router.pm
+FS/pkg_svc.pm
+FS/svc_Common.pm
+FS/svc_acct.pm
+FS/svc_acct_pop.pm
+FS/svc_broadband.pm
+FS/svc_domain.pm
+FS/router.pm
+FS/router_field.pm
+FS/type_pkgs.pm
+FS/nas.pm
+FS/port.pm
+FS/session.pm
+FS/domain_record.pm
+FS/prepay_credit.pm
+FS/svc_www.pm
+FS/svc_forward.pm
+FS/sb_field.pm
+FS/raddb.pm
+FS/radius_usergroup.pm
+FS/queue.pm
+FS/queue_arg.pm
+FS/queue_depend.pm
+FS/msgcat.pm
+FS/cust_tax_exempt.pm
+t/agent.t
+t/agent_type.t
+t/CGI.t
+t/InitHandler.t
+t/ClientAPI.t
+t/Conf.t
+t/ConfItem.t
+t/Misc.t
+t/Record.t
+t/UID.t
+t/Msgcat.t
+t/SearchCache.t
+t/cust_bill.t
+t/cust_bill_event.t
+t/cust_bill_pay.t
+t/cust_bill_pkg.t
+t/cust_bill_pkg_detail.t
+t/cust_credit.t
+t/cust_credit_bill.t
+t/cust_credit_refund.t
+t/cust_main.t
+t/cust_main_county.t
+t/cust_main_invoice.t
+t/cust_pay.t
+t/cust_pay_batch.t
+t/cust_pkg.t
+t/cust_refund.t
+t/cust_svc.t
+t/cust_tax_exempt.t
+t/domain_record.t
+t/nas.t
+t/part_bill_event.t
+t/export_svc.t
+t/part_export.t
+t/part_export_option.t
+t/part_export-bind.t
+t/part_export-bind_slave.t
+t/part_export-bsdshell.t
+t/part_export-cp.t
+t/part_export-cyrus.t
+t/part_export-domain_shellcommands.t
+t/part_export-forward_shellcommands.t
+t/part_export-http.t
+t/part_export-infostreet.t
+t/part_export-ldap.t
+t/part_export-null.t
+t/part_export-shellcommands.t
+t/part_export-shellcommands_withdomain.t
+t/part_export-sqlmail.t
+t/part_export-sqlradius.t
+t/part_export-sysvshell.t
+t/part_export-textradius.t
+t/part_export-vpopmail.t
+t/part_export-www_shellcommands.t
+t/part_pkg.t
+t/part_pop_local.t
+t/part_referral.t
+t/part_svc.t
+t/part_svc_column.t
+t/pkg_svc.t
+t/port.t
+t/prepay_credit.t
+t/radius_usergroup.t
+t/session.t
+t/svc_acct.t
+t/svc_acct_pop.t
+t/svc_Common.t
+t/svc_domain.t
+t/svc_forward.t
+t/svc_www.t
+t/type_pkgs.t
+t/queue.t
+t/queue_arg.t
+t/queue_depend.t
+t/msgcat.t
+t/raddb.t
diff --git a/FS/MANIFEST.SKIP b/FS/MANIFEST.SKIP
new file mode 100644
index 000000000..ae335e78a
--- /dev/null
+++ b/FS/MANIFEST.SKIP
@@ -0,0 +1 @@
+CVS/
diff --git a/FS/Makefile.PL b/FS/Makefile.PL
new file mode 100644
index 000000000..1647f8eef
--- /dev/null
+++ b/FS/Makefile.PL
@@ -0,0 +1,10 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'FS',
+ 'VERSION_FROM' => 'FS.pm', # finds $VERSION
+ 'EXE_FILES' => [ glob 'bin/*' ],
+ 'INSTALLSCRIPT' => '/usr/local/bin',
+ 'INSTALLSITEBIN' => '/usr/local/bin',
+);
diff --git a/FS/README b/FS/README
new file mode 100644
index 000000000..d4c35acb4
--- /dev/null
+++ b/FS/README
@@ -0,0 +1,6 @@
+This is the Perl module section of Freeside.
+
+perl Makefile.PL
+make
+make test
+make install
diff --git a/FS/bin/freeside-addoutsource b/FS/bin/freeside-addoutsource
new file mode 100644
index 000000000..5cec17f46
--- /dev/null
+++ b/FS/bin/freeside-addoutsource
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+domain=$1
+
+createdb $domain && \
+\
+mkdir /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain && \
+\
+chown freeside /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain && \
+\
+cp /home/ivan/freeside/conf/[a-z]* /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain && \
+\
+touch /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain/secrets && \
+\
+chown freeside /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain/secrets && \
+\
+chmod 600 /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain/secrets && \
+\
+echo -e "DBI:Pg:host=localhost;dbname=$domain\nfreeside\n" >/usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain/secrets && \
+\
+mkdir /usr/local/etc/freeside/counters.DBI:Pg:host=localhost\;dbname=$domain && \
+mkdir /usr/local/etc/freeside/cache.DBI:Pg:host=localhost\;dbname=$domain && \
+mkdir /usr/local/etc/freeside/export.DBI:Pg:host=localhost\;dbname=$domain
+
diff --git a/FS/bin/freeside-addoutsourceuser b/FS/bin/freeside-addoutsourceuser
new file mode 100644
index 000000000..180cd9399
--- /dev/null
+++ b/FS/bin/freeside-addoutsourceuser
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+username=$1
+domain=$2
+password=$3
+
+freeside-adduser -h /usr/local/etc/freeside/htpasswd \
+ -s conf.DBI:Pg:host=localhost\;dbname=$domain/secrets \
+ -b \
+ $username $password 2>/dev/null
+
+[ -e /usr/local/etc/freeside/dbdef.DBI:Pg:host=localhost\;dbname=$domain ] \
+ || ( freeside-setup $username 2>/dev/null; \
+ /home/ivan/freeside/bin/populate-msgcat $username )
+
diff --git a/FS/bin/freeside-adduser b/FS/bin/freeside-adduser
new file mode 100644
index 000000000..c3ee05b9b
--- /dev/null
+++ b/FS/bin/freeside-adduser
@@ -0,0 +1,63 @@
+#!/usr/bin/perl -w
+#
+# $Id: freeside-adduser,v 1.8 2002-09-27 05:36:29 ivan Exp $
+
+use strict;
+use vars qw($opt_h $opt_b $opt_c $opt_s);
+use Fcntl qw(:flock);
+use Getopt::Std;
+
+my $FREESIDE_CONF = "/usr/local/etc/freeside";
+
+getopts("bch:s:");
+die &usage if $opt_c && ! $opt_h;
+my $user = shift or die &usage;
+
+if ( $opt_h ) {
+ my @args = ( 'htpasswd' );
+ push @args, '-b' if $opt_b;
+ push @args, '-c' if $opt_c;
+ push @args, $opt_h, $user;
+ push @args, shift if $opt_b;
+ system(@args) == 0 or die "htpasswd failed: $?";
+}
+
+my $secretfile = $opt_s || 'secrets';
+
+open(MAPSECRETS,">>$FREESIDE_CONF/mapsecrets")
+ and flock(MAPSECRETS,LOCK_EX)
+ or die "can't open $FREESIDE_CONF/mapsecrets: $!";
+print MAPSECRETS "$user $secretfile\n";
+close MAPSECRETS or die "can't close $FREESIDE_CONF/mapsecrets: $!";
+
+sub usage {
+ die "Usage:\n\n freeside-adduser [ -h htpasswd_file [ -c ] [ -b ] ] [ -s secretfile ] username"
+}
+
+=head1 NAME
+
+freeside-adduser - Command line interface to add (freeside) users.
+
+=head1 SYNOPSIS
+
+ freeside-adduser [ -h htpasswd_file [ -c ] ] [ -s secretfile ] username
+
+=head1 DESCRIPTION
+
+Adds a user to the Freeside billing system. This is for adding users (internal
+sales/tech folks) to the web interface, not for adding customer accounts.
+
+ -h: Also call htpasswd for this user with the given filename
+
+ -c: Passed to htpasswd(1)
+
+ -s: Specify an alternate secret file
+
+ -b: same as htpasswd(1), probably insecure, not recommended
+
+=head1 SEE ALSO
+
+L<htpasswd>(1), base Freeside documentation
+
+=cut
+
diff --git a/FS/bin/freeside-apply-credits b/FS/bin/freeside-apply-credits
new file mode 100755
index 000000000..ea6a7bdd0
--- /dev/null
+++ b/FS/bin/freeside-apply-credits
@@ -0,0 +1,21 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use vars qw( $user $cust_main @customers );
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_main;
+
+$user = shift or die &usage;
+&adminsuidsetup( $user );
+
+my @customers = qsearch('cust_main', {} );
+die "No customers" unless (scalar(@customers) > 0);
+
+foreach $cust_main (@customers) {
+ print "Applying credits for customer #". $cust_main->custnum;
+ $cust_main->apply_credits;
+}
+
+
+
diff --git a/FS/bin/freeside-bill b/FS/bin/freeside-bill
new file mode 100755
index 000000000..49ad4a768
--- /dev/null
+++ b/FS/bin/freeside-bill
@@ -0,0 +1,128 @@
+#!/usr/bin/perl -w
+# don't take any world-facing input
+#!/usr/bin/perl -Tw
+
+use strict;
+use Fcntl qw(:flock);
+use Date::Parse;
+use Getopt::Std;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch qsearchs);
+use FS::cust_main;
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_a $opt_c $opt_d $opt_p);
+getopts("acd:p");
+my $user = shift or die &usage;
+
+adminsuidsetup $user;
+
+my %bill_only = map { $_ => 1 } (
+ @ARGV ? @ARGV : ( map $_->custnum, qsearch('cust_main', {} ) )
+);
+
+#we're at now now (and later).
+my($time)= $opt_d ? str2time($opt_d) : $^T;
+
+# find packages w/ bill < time && cancel != '', and create corresponding
+# customer objects
+
+my($cust_main,%saw);
+foreach $cust_main (
+ map {
+ unless ( exists $saw{ $_->custnum } && defined $saw{ $_->custnum} ) {
+ $saw{ $_->custnum } = 0; # to avoid 'use of uninitialized value' errors
+ }
+ if (
+ ( $opt_a || ( ( $_->getfield('bill') || 0 ) <= $time ) )
+ && $bill_only{ $_->custnum }
+ && !$saw{ $_->custnum }++
+ ) {
+ qsearchs('cust_main',{'custnum'=> $_->custnum } );
+ } else {
+ ();
+ }
+ } ( qsearch('cust_pkg', { 'cancel' => '' }),
+ qsearch('cust_pkg', { 'cancel' => 0 }),
+ )
+) {
+
+ # and bill them
+
+ print "Billing customer #" . $cust_main->getfield('custnum') . "\n";
+
+ my($error);
+
+ $error=$cust_main->bill('time'=>$time);
+ warn "Error billing, customer #" . $cust_main->getfield('custnum') .
+ ":" . $error if $error;
+
+ if ($opt_p) {
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+ }
+
+ if ($opt_c) {
+ $error=$cust_main->collect( 'invoice_time' => $time);
+ warn "Error collecting from customer #" . $cust_main->custnum. ":$error"
+ if $error;
+
+ #sleep 1;
+ }
+
+}
+
+# subroutines
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ #$ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ # Date::Parse
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-bill [ -c [ -p ] ] [ -d 'date' ] user [ custnum custnum ... ]\n";
+}
+
+=head1 NAME
+
+freeside-bill - Command line (crontab, script) interface to customer billing.
+
+=head1 SYNOPSIS
+
+ freeside-bill [ -c [ -p ] [ -a ] ] [ -d 'date' ] user [ custnum custnum ... ]
+
+=head1 DESCRIPTION
+
+This script is deprecated in 1.4.0. You should use freeside-daily instead.
+
+Bills customers. Searches for customers who are due for billing and calls
+the bill and collect methods of a cust_main object. See L<FS::cust_main>.
+
+ -c: Turn on collecting (you probably want this).
+
+ -p: Apply unapplied payments and credits before collecting (you probably want
+ this too)
+
+ -a: Call collect even if there isn't a new invoice (probably a bad idea for
+ daily use)
+
+ -d: Pretend it's 'date'. Date is in any format Date::Parse is happy with,
+ but be careful.
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+custnum: if one or more customer numbers are specified, only bills those
+customers. Otherwise, bills all customers.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<freeside-daily>, L<FS::cust_main>, config.html from the base documentation
+
+=cut
+
diff --git a/FS/bin/freeside-cc-receipts-report b/FS/bin/freeside-cc-receipts-report
new file mode 100755
index 000000000..136851aec
--- /dev/null
+++ b/FS/bin/freeside-cc-receipts-report
@@ -0,0 +1,270 @@
+#!/usr/bin/perl -Tw
+
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch qsearchs);
+use FS::cust_pay;
+use FS::cust_pay_batch;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $opt_s $opt_f $report_lines $report_template @buf $header);
+getopts("vpmef:s:"); #switches
+
+#we're at now now (and later).
+my($_finishdate)= $opt_f ? str2time($main::opt_f) : $^T;
+my($_startdate)= $opt_s ? str2time($main::opt_s) : $^T;
+
+# Get the current month
+my ($ssec,$smin,$shour,$smday,$smon,$syear) =
+ (localtime($_startdate) )[0,1,2,3,4,5];
+$smon++;
+$syear += 1900;
+
+# Get the current month
+my ($fsec,$fmin,$fhour,$fmday,$fmon,$fyear) =
+ (localtime($_finishdate) )[0,1,2,3,4,5];
+$fmon++;
+$fyear += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@cust_pays)=qsearch('cust_pay',{});
+if (scalar(@cust_pays) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $main::opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $main::opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: Credit Card Receipts",
+ ] );
+}
+
+my $uninvoiced = 0;
+my $total = 0;
+my $taxed = 0;
+my $untaxed = 0;
+my $total_tax = 0;
+
+# Now I can start looping
+foreach my $cust_pay (@cust_pays)
+{
+ my $_date = $cust_pay->getfield('_date');
+ my $invnum = $cust_pay->getfield('invnum');
+ my $paid = $cust_pay->getfield('paid');
+ my $payby = $cust_pay->getfield('payby');
+
+
+ if ($_date >= $_startdate && $_date <= $_finishdate && $payby =~ 'CARD') {
+ $total += $paid;
+
+ $uninvoiced += $cust_pay->unapplied;
+ my @cust_bill_pays = $cust_pay->cust_bill_pay;
+ foreach my $cust_bill_pay (@cust_bill_pays) {
+ my $invoice_amt =0;
+ my $invoice_tax =0;
+ my(@cust_bill_pkgs)= $cust_bill_pay->cust_bill->cust_bill_pkg;
+ foreach my $cust_bill_pkg (@cust_bill_pkgs) {
+
+ my $recur = $cust_bill_pkg->getfield('recur');
+ my $setup = $cust_bill_pkg->getfield('setup');
+ my $pkgnum = $cust_bill_pkg->getfield('pkgnum');
+
+ if ($pkgnum == 0) {
+ $invoice_tax += $recur;
+ $invoice_tax += $setup;
+ } else {
+ $invoice_amt += $recur;
+ $invoice_amt += $setup;
+ }
+
+ }
+
+ if ($invoice_tax > 0) {
+ if ($invoice_amt != $paid) {
+ # attempt to prorate partially paid invoices
+ $total_tax += $paid / ($invoice_amt + $invoice_tax) * $invoice_tax;
+ $taxed += $paid / ($invoice_amt + $invoice_tax) * $invoice_amt;
+ } else {
+ $total_tax += $invoice_tax;
+ $taxed += $invoice_amt;
+ }
+ } else {
+ $untaxed += $paid;
+ }
+
+ }
+
+ }
+
+}
+
+push @buf, sprintf(qq{\n%25s%14.2f\n}, "Uninvoiced", $uninvoiced);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Untaxed", $untaxed);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Taxed", $taxed);
+push @buf, sprintf(qq{%25s%14.2f\n}, "Tax", $total_tax);
+push @buf, sprintf(qq{\n%39s\n%39.2f\n}, "=========", $total);
+
+sub FS::cc_receipts_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::cc_receipts_report::_template::title = qq~CREDIT CARD RECEIPTS for period $smon/$smday/$syear through $fmon/$fmday/$fyear~;
+$FS::cc_receipts_report::_template::title = $opt_t if $opt_t;
+$FS::cc_receipts_report::_template::page = 1;
+$FS::cc_receipts_report::_template::date = $^T;
+$FS::cc_receipts_report::_template::date = $^T;
+$FS::cc_receipts_report::_template::fdate = $_finishdate;
+$FS::cc_receipts_report::_template::fdate = $_finishdate;
+$FS::cc_receipts_report::_template::sdate = $_startdate;
+$FS::cc_receipts_report::_template::sdate = $_startdate;
+$FS::cc_receipts_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::cc_receipts_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::cc_receipts_report::_template' )
+ );
+ $FS::cc_receipts_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ :\.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-cc-receipts-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-cc-receipts-report - Prints or emails total credit card receipts in a given period.
+
+=head1 SYNOPSIS
+
+ freeside-cc-receipts-report [-v] [-p] [-m] [-e] [-t "title"] [-s date] [-f date] user
+
+=head1 DESCRIPTION
+
+Prints or emails sales taxes invoiced in a given period.
+
+-v: Verbose - Prints records to STDOUT.
+
+-p: Print to printer lpr as found in the conf directory.
+
+-m: Email output to user found in the Conf email file.
+
+-e: Print a final form feed to the printer.
+
+-t: supply a title for the top of each page.
+
+-s: starting date for inclusion
+
+-f: final date for inclusion
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-cc-receipts-report,v 1.5 2002-09-09 22:57:34 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/bin/freeside-count-active-customers b/FS/bin/freeside-count-active-customers
new file mode 100755
index 000000000..759085a73
--- /dev/null
+++ b/FS/bin/freeside-count-active-customers
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+domain=$1
+
+echo "\t
+select count(*) from cust_main where
+ 0 < ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL
+ OR cust_pkg.cancel = 0
+ )
+ )
+ OR 0 = ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ );
+" | psql -U freeside -q $domain | head -1
+
diff --git a/FS/bin/freeside-credit-report b/FS/bin/freeside-credit-report
new file mode 100755
index 000000000..410dabe8f
--- /dev/null
+++ b/FS/bin/freeside-credit-report
@@ -0,0 +1,224 @@
+#!/usr/bin/perl -Tw
+
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_credit;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $opt_s $opt_f $report_lines $report_template @buf $header);
+getopts("vpmef:s:"); #switches
+
+#we're at now now (and later).
+my($_finishdate)= $opt_f ? str2time($main::opt_f) : $^T;
+my($_startdate)= $opt_s ? str2time($main::opt_s) : $^T;
+
+# Get the current month
+my ($ssec,$smin,$shour,$smday,$smon,$syear) =
+ (localtime($_startdate) )[0,1,2,3,4,5];
+$smon++;
+$syear += 1900;
+
+# Get the current month
+my ($fsec,$fmin,$fhour,$fmday,$fmon,$fyear) =
+ (localtime($_finishdate) )[0,1,2,3,4,5];
+$fmon++;
+$fyear += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@cust_credits)=qsearch('cust_credit',{});
+if (scalar(@cust_credits) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $main::opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $main::opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: In House Credits",
+ ] );
+}
+
+my $uninvoiced = 0;
+my $total = 0;
+my $taxed = 0;
+my $untaxed = 0;
+my $total_tax = 0;
+
+# Now I can start looping
+foreach my $cust_credit (@cust_credits)
+{
+ my $_date = $cust_credit->getfield('_date');
+ my $amount = $cust_credit->getfield('amount');
+
+ if ($_date >= $_startdate && $_date <= $_finishdate) {
+ $total += $amount;
+ }
+}
+
+push @buf, sprintf(qq{\n%25s%14.2f\n}, "Credits Offered", $total);
+push @buf, sprintf(qq{\n%39s\n%39.2f\n}, "=========", $total);
+
+sub FS::credit_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::credit_report::_template::title = qq~IN HOUSE CREDITS for $smon/$smday/$syear through $fmon/$fmday/$fyear~;
+$FS::credit_report::_template::title = $opt_t if $opt_t;
+$FS::credit_report::_template::page = 1;
+$FS::credit_report::_template::date = $^T;
+$FS::credit_report::_template::date = $^T;
+$FS::credit_report::_template::fdate = $_finishdate;
+$FS::credit_report::_template::fdate = $_finishdate;
+$FS::credit_report::_template::sdate = $_startdate;
+$FS::credit_report::_template::sdate = $_startdate;
+$FS::credit_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::credit_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::credit_report::_template' )
+ );
+ $FS::credit_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ :\.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-credit-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-credit-report - Prints or emails total credit memos in a given period.
+
+=head1 SYNOPSIS
+
+ freeside-credit-report [-v] [-p] [-m] [-e] [-t "title"] [-s date] [-f date] user
+
+=head1 DESCRIPTION
+
+Prints or emails total credit memos in a given period.
+
+-v: Verbose - Prints records to STDOUT.
+
+-p: Print to printer lpr as found in the conf directory.
+
+-m: Email output to user found in the Conf email file.
+
+-e: Print a final form feed to the printer.
+
+-t: supply a title for the top of each page.
+
+-s: starting date for inclusion
+
+-f: final date for inclusion
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-credit-report,v 1.5 2002-09-09 22:57:34 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily
new file mode 100755
index 000000000..63e621b57
--- /dev/null
+++ b/FS/bin/freeside-daily
@@ -0,0 +1,132 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Fcntl qw(:flock);
+use Date::Parse;
+use Getopt::Std;
+use FS::UID qw(adminsuidsetup driver_name dbh datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::Conf;
+use FS::cust_main;
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_d $opt_v $opt_p);
+getopts("p:d:v");
+my $user = shift or die &usage;
+
+adminsuidsetup $user;
+
+$FS::cust_main::Debug = 1 if $opt_v;
+
+my %search;
+$search{'payby'} = $opt_p if $opt_p;
+
+my @cust_main = @ARGV
+ ? map { qsearchs('cust_main', { custnum => $_, %search } ) } @ARGV
+ : qsearch('cust_main', \%search )
+;
+
+#we're at now now (and later).
+my($time)= $opt_d ? str2time($opt_d) : $^T;
+
+my($cust_main,%saw);
+foreach $cust_main ( @cust_main ) {
+
+ # $^T not $time because -d is for pre-printing invoices
+ foreach my $cust_pkg (
+ grep { $_->expire && $_->expire <= $^T } $cust_main->ncancelled_pkgs
+ ) {
+ my $error = $cust_pkg->cancel;
+ warn "Error cancelling expired pkg ". $cust_pkg->pkgnum. " for custnum ".
+ $cust_main->custnum. ": $error"
+ if $error;
+ }
+
+ my $error = $cust_main->bill( 'time' => $time );
+ warn "Error billing, custnum ". $cust_main->custnum. ": $error" if $error;
+
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+
+ $error = $cust_main->collect( 'invoice_time' => $time );
+ warn "Error collecting, custnum". $cust_main->custnum. ": $error" if $error;
+
+}
+
+if ( driver_name eq 'Pg' ) {
+ dbh->{AutoCommit} = 1; #so we can vacuum
+ foreach my $statement ( 'vacuum', 'vacuum analyze' ) {
+ my $sth = dbh->prepare($statement) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ }
+}
+
+#local hack
+my $conf = new FS::Conf;
+my $dest = $conf->config('dump-scpdest');
+if ( $dest ) {
+ datasrc =~ /dbname=([\w\.]+)$/ or die "unparsable datasrc ". datasrc;
+ my $database = $1;
+ eval "use Net::SCP qw(scp);";
+ if ( driver_name eq 'Pg' ) {
+ system("pg_dump $database >/var/tmp/$database.sql")
+ } else {
+ die "database dumps not yet supported for ". driver_name;
+ }
+ scp("/var/tmp/$database.sql", $dest);
+ unlink "/var/tmp/$database.sql" or die $!;
+}
+
+# subroutines
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ #$ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ # Date::Parse
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-daily [ -d 'date' ] user [ custnum custnum ... ]\n";
+}
+
+=head1 NAME
+
+freeside-daily - Run daily billing and invoice collection events.
+
+=head1 SYNOPSIS
+
+ freeside-daily [ -d 'date' ] [ -p 'payby' ] [ -v ] user [ custnum custnum ... ]
+
+=head1 DESCRIPTION
+
+Bills customers and runs invoice collection events. Should be run from
+crontab daily.
+
+This script replaces freeside-bill from 1.3.1.
+
+Bills customers. Searches for customers who are due for billing and calls
+the bill and collect methods of a cust_main object. See L<FS::cust_main>.
+
+ -d: Pretend it's 'date'. Date is in any format Date::Parse is happy with,
+ but be careful.
+
+ -p: Only process customers with the specified payby (I<CARD>, I<DCRD>, I<CHEK>, I<DCHK>, I<BILL>, I<COMP>, I<LECB>)
+
+ -v: enable debugging
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+custnum: if one or more customer numbers are specified, only bills those
+customers. Otherwise, bills all customers.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=cut
+
diff --git a/FS/bin/freeside-deloutsource b/FS/bin/freeside-deloutsource
new file mode 100644
index 000000000..561853539
--- /dev/null
+++ b/FS/bin/freeside-deloutsource
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+domain=$1
+
+dropdb $domain && \
+rm -rf /usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=$domain && \
+rm -rf /usr/local/etc/freeside/counters.DBI:Pg:host=localhost\;dbname=$domain && \
+rm -rf /usr/local/etc/freeside/cache.DBI:Pg:host=localhost\;dbname=$domain && \
+rm -rf /usr/local/etc/freeside/export.DBI:Pg:host=localhost\;dbname=$domain && \
+rm /usr/local/etc/freeside/dbdef.DBI:Pg:host=localhost\;dbname=$domain
+
diff --git a/FS/bin/freeside-deloutsourceuser b/FS/bin/freeside-deloutsourceuser
new file mode 100644
index 000000000..96871e50c
--- /dev/null
+++ b/FS/bin/freeside-deloutsourceuser
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+username=$1
+
+freeside-deluser -h /usr/local/etc/freeside/htpasswd $username 2>/dev/null
+
diff --git a/FS/bin/freeside-deluser b/FS/bin/freeside-deluser
new file mode 100644
index 000000000..57d6ce165
--- /dev/null
+++ b/FS/bin/freeside-deluser
@@ -0,0 +1,64 @@
+#!/usr/bin/perl -w
+
+use strict;
+use vars qw($opt_h);
+use Fcntl qw(:flock);
+use Getopt::Std;
+
+my $FREESIDE_CONF = "/usr/local/etc/freeside";
+
+getopts("h:");
+my $user = shift or die &usage;
+
+if ( $opt_h ) {
+ open(HTPASSWD,"<$opt_h")
+ and flock(HTPASSWD,LOCK_EX)
+ or die "can't open $opt_h: $!";
+ open(HTPASSWD_TMP,">$opt_h.tmp") or die "can't open $opt_h.tmp: $!";
+ while (<HTPASSWD>) {
+ print HTPASSWD_TMP $_ unless /^$user:/;
+ }
+ close HTPASSWD_TMP;
+ rename "$opt_h.tmp", "$opt_h" or die $!;
+ flock(HTPASSWD,LOCK_UN);
+ close HTPASSWD;
+}
+
+open(MAPSECRETS,"<$FREESIDE_CONF/mapsecrets")
+ and flock(MAPSECRETS,LOCK_EX)
+ or die "can't open $FREESIDE_CONF/mapsecrets: $!";
+open(MAPSECRETS_TMP,">>$FREESIDE_CONF/mapsecrets.tmp")
+ or die "can't open $FREESIDE_CONF/mapsecrets.tmp: $!";
+while (<MAPSECRETS>) {
+ print MAPSECRETS_TMP $_ unless /^$user\s/;
+}
+close MAPSECRETS_TMP;
+rename "$FREESIDE_CONF/mapsecrets.tmp", "$FREESIDE_CONF/mapsecrets" or die $!;
+flock(MAPSECRETS,LOCK_UN);
+close MAPSECRETS;
+
+sub usage {
+ die "Usage:\n\n freeside-deluser [ -h htpasswd_file ] username"
+}
+
+=head1 NAME
+
+freeside-deluser - Command line interface to add (freeside) users.
+
+=head1 SYNOPSIS
+
+ freeside-deluser [ -h htpasswd_file ] username
+
+=head1 DESCRIPTION
+
+Adds a user to the Freeside billing system. This is for adding users (internal
+sales/tech folks) to the web interface, not for adding customer accounts.
+
+ -h: Also delete from the given htpasswd filename
+
+=head1 SEE ALSO
+
+L<freeside-adduser>, L<htpasswd>(1), base Freeside documentation
+
+=cut
+
diff --git a/FS/bin/freeside-email b/FS/bin/freeside-email
new file mode 100755
index 000000000..400dc2ac7
--- /dev/null
+++ b/FS/bin/freeside-email
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+use FS::Record qw(qsearch);
+use FS::svc_acct;
+
+&untaint_argv; #what it sounds like (eww)
+my $user = shift or die &usage;
+
+adminsuidsetup $user;
+
+my $conf = new FS::Conf;
+
+my @svc_acct = qsearch('svc_acct', {});
+my @emails = map $_->email, @svc_acct;
+
+print join("\n", @emails), "\n";
+
+# subroutines
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ #$ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ # Date::Parse
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-email user\n";
+}
+
+=head1 NAME
+
+freeside-email - Prints email addresses of all users on STDOUT
+
+=head1 SYNOPSIS
+
+ freeside-email user
+
+=head1 DESCRIPTION
+
+Prints the email addresses of all customers on STDOUT, separated by newlines.
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-email,v 1.2 2002-09-18 22:50:44 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+=cut
+
diff --git a/FS/bin/freeside-expiration-alerter b/FS/bin/freeside-expiration-alerter
new file mode 100755
index 000000000..691fd3aa5
--- /dev/null
+++ b/FS/bin/freeside-expiration-alerter
@@ -0,0 +1,226 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use Date::Format;
+use Time::Local;
+use Text::Template;
+use Getopt::Std;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_main;
+
+use vars qw($smtpmachine @body);
+
+#hush, perl!
+$FS::alerter::_template::first = "";
+$FS::alerter::_template::last = "";
+$FS::alerter::_template::company = "";
+$FS::alerter::_template::payby = "";
+$FS::alerter::_template::expdate = "";
+
+# Set the mail program and other variables
+my $mail_sender = "billing\@mydomain.tld"; # or invoice_from if available
+my $failure_recipient = "postmaster"; # or invoice_from if available
+my $warning_time = 30 * 24 * 60 * 60;
+my $urgent_time = 15 * 24 * 60 * 60;
+my $panic_time = 5 * 24 * 60 * 60;
+my $window_time = 24 * 60 * 60;
+
+&untaint_argv; #what it sounds like (eww)
+
+#we're at now now (and later).
+my($_date)= $^T;
+
+# Get the current month
+my ($sec,$min,$hour,$mday,$mon,$year) =
+ (localtime($_date) )[0,1,2,3,4,5];
+$mon++;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+$smtpmachine = $conf->config('smtpmachine');
+$mail_sender = $conf->config('invoice_from')
+ if $conf->exists('invoice_from');
+$failure_recipient = $conf->config('invoice_from')
+ if $conf->exists('invoice_from');
+
+
+my(@customers)=qsearch('cust_main',{});
+if (scalar(@customers) == 0)
+{
+ exit 1;
+}
+
+# Prepare for sending email
+
+$ENV{MAILADDRESS} = $mail_sender;
+my $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $failure_recipient",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: Unnotified Billing Arrangement Expirations",
+] );
+
+my @alerter_template = $conf->config('alerter_template')
+ or die "cannot load config file alerter_template";
+
+my $alerter = new Text::Template (TYPE => 'ARRAY', SOURCE => [ map "$_\n", @alerter_template ])
+ or die "can't create new Text::Template object: Text::Template::ERROR";
+$alerter->compile() or die "can't compile template: Text::Template::ERROR";
+
+# Now I can start looping
+foreach my $customer (@customers)
+{
+ my $paydate = $customer->getfield('paydate');
+ next if $paydate =~ /^\s*$/; #skip empty expiration dates
+
+ my $custnum = $customer->getfield('custnum');
+ my $first = $customer->getfield('first');
+ my $last = $customer->getfield('last');
+ my $company = $customer->getfield('company');
+ my $payby = $customer->getfield('payby');
+ my $payinfo = $customer->getfield('payinfo');
+ my $daytime = $customer->getfield('daytime');
+ my $night = $customer->getfield('night');
+
+ my ($payyear,$paymonth,$payday) = split (/-/,$paydate);
+
+ my $expire_time = timelocal(0,0,0,$payday,--$paymonth,$payyear);
+
+ #credit cards expire at the end of the month/year of their exp date
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
+ ($paymonth < 11) ? $paymonth++ : ($paymonth=0, $payyear++);
+ $expire_time = timelocal(0,0,0,$payday,$paymonth,$payyear);
+ $expire_time--;
+ }
+
+ if (($expire_time < $_date + $warning_time &&
+ $expire_time > $_date + $warning_time - $window_time) ||
+ ($expire_time < $_date + $urgent_time &&
+ $expire_time > $_date + $urgent_time - $window_time) ||
+ ($expire_time < $_date + $panic_time &&
+ $expire_time > $_date + $panic_time - $window_time)) {
+
+
+
+ my @packages = $customer->ncancelled_pkgs;
+ if (scalar(@packages) != 0) {
+ my @invoicing_list = $customer->invoicing_list;
+ if ( grep { $_ ne 'POST' } @invoicing_list ) {
+ my $header = new Mail::Header ( [
+ "From: $mail_sender",
+ "To: ". join(', ', grep { $_ ne 'POST' } @invoicing_list ),
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Date: ". time2str("%a, %d %b %Y %X %z", time),
+ "Subject: Billing Arrangement Expiration",
+ ] );
+ $FS::alerter::_template::first = $first;
+ $FS::alerter::_template::last = $last;
+ $FS::alerter::_template::company = $company;
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
+ $FS::alerter::_template::payby = "credit card (" .
+ substr($payinfo, 0, 2) . "xxxxxxxxxx" .
+ substr($payinfo, -4) . ")";
+ }elsif ($payby eq 'COMP') {
+ $FS::alerter::_template::payby = "complimentary account";
+ }else{
+ $FS::alerter::_template::payby = "current method";
+ }
+ $FS::alerter::_template::expdate = $expire_time;
+
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ $alerter->fill_in( PACKAGE => 'FS::alerter::_template' ) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => $smtpmachine )
+ or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
+ or die "Can't send expiration email: $!";
+
+ } elsif ( ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list ) {
+ push @body, sprintf(qq{%5d %-32.32s %4s %10s %12s %12s},
+ $custnum,
+ $first . " " . $last . " " . $company,
+ $payby,
+ $paydate,
+ $daytime,
+ $night);
+ }
+ }
+ }
+}
+
+# Now I need to send EMAIL
+if (scalar(@body)) {
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@body) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => $smtpmachine )
+ or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
+ or die "can't send alerter failure email to $failure_recipient".
+ " via server $smtpmachine with SMTP: $!";
+}
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-expiration-alerter user\n";
+}
+
+=head1 NAME
+
+freeside-expiration-alerter - Emails notifications of credit card expirations.
+
+=head1 SYNOPSIS
+
+ freeside-expiration-alerter user
+
+=head1 DESCRIPTION
+
+Emails customers notice that their credit card or other billing arrangement
+is about to expire. Usually run as a cron job.
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-expiration-alerter,v 1.5 2003-04-21 20:53:57 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+=cut
+
+
diff --git a/FS/bin/freeside-queued b/FS/bin/freeside-queued
new file mode 100644
index 000000000..6ea27c05f
--- /dev/null
+++ b/FS/bin/freeside-queued
@@ -0,0 +1,267 @@
+#!/usr/bin/perl -w
+
+use strict;
+use vars qw( $log_file $sigterm $sigint $kids $max_kids %kids );
+use subs qw( _die _logmsg );
+use Fcntl qw(:flock);
+use POSIX qw(:sys_wait_h setsid);
+use Date::Format;
+use IO::File;
+use FS::UID qw(adminsuidsetup forksuidsetup driver_name dbh);
+use FS::Record qw(qsearch qsearchs);
+use FS::queue;
+use FS::queue_depend;
+
+# no autoloading just yet
+use FS::cust_main;
+use FS::svc_acct;
+use Net::SSH 0.07;
+use FS::part_export;
+
+$max_kids = '10'; #guess it should be a config file...
+$kids = 0;
+
+my $user = shift or die &usage;
+
+#my $pid_file = "/var/run/freeside-queued.$user.pid";
+my $pid_file = "/var/run/freeside-queued.pid";
+
+&daemonize1;
+
+#sub REAPER { my $pid = wait; $SIG{CHLD} = \&REAPER; $kids--; }
+#$SIG{CHLD} = \&REAPER;
+
+$sigterm = 0;
+$sigint = 0;
+$SIG{INT} = sub { warn "SIGINT received; shutting down\n"; $sigint++; };
+$SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
+
+my $freeside_gid = scalar(getgrnam('freeside'))
+ or die "can't setgid to freeside group\n";
+$) = $freeside_gid;
+$( = $freeside_gid;
+#if freebsd can't setuid(), presumably it can't setgid() either. grr fleabsd
+($(,$)) = ($),$();
+$) = $freeside_gid;
+
+$> = $FS::UID::freeside_uid;
+$< = $FS::UID::freeside_uid;
+#freebsd is sofa king broken, won't setuid()
+($<,$>) = ($>,$<);
+$> = $FS::UID::freeside_uid;
+
+$ENV{HOME} = (getpwuid($>))[7]; #for ssh
+adminsuidsetup $user;
+
+$log_file = "/usr/local/etc/freeside/queuelog.". $FS::UID::datasrc;
+
+&daemonize2;
+
+$SIG{__DIE__} = \&_die;
+$SIG{__WARN__} = \&_logmsg;
+
+warn "freeside-queued starting\n";
+
+my $warnkids=0;
+while (1) {
+
+ &reap_kids;
+ #prevent runaway forking
+ if ( $kids >= $max_kids ) {
+ warn "WARNING: maximum $kids children reached\n" unless $warnkids++;
+ &reap_kids;
+ sleep 1; #waiting for signals is cheap
+ next;
+ }
+ $warnkids=0;
+
+ my $nodepend = driver_name eq 'mysql'
+ ? ''
+ : 'AND 0 = ( SELECT COUNT(*) FROM queue_depend'.
+ ' WHERE queue_depend.jobnum = queue.jobnum ) ';
+
+ #my($job, $ljob);
+ #{
+ # my $oldAutoCommit = $FS::UID::AutoCommit;
+ # local $FS::UID::AutoCommit = 0;
+ $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+
+ my $job = qsearchs(
+ 'queue',
+ { 'status' => 'new' },
+ '',
+ driver_name eq 'mysql'
+ ? "$nodepend ORDER BY jobnum LIMIT 1 FOR UPDATE"
+ : "$nodepend ORDER BY jobnum FOR UPDATE LIMIT 1"
+ ) or do {
+ $dbh->commit or die $dbh->errstr; #if $oldAutoCommit;
+ sleep 5; #connecting to db is expensive
+ next;
+ };
+
+ if ( driver_name eq 'mysql'
+ && qsearch('queue_depend', { 'jobnum' => $job->jobnum } ) ) {
+ $dbh->commit or die $dbh->errstr; #if $oldAutoCommit;
+ sleep 5; #would be better if mysql could do everything in query above
+ next;
+ }
+
+ my %hash = $job->hash;
+ $hash{'status'} = 'locked';
+ my $ljob = new FS::queue ( \%hash );
+ my $error = $ljob->replace($job);
+ die $error if $error;
+
+ $dbh->commit or die $dbh->errstr; #if $oldAutoCommit;
+
+ $FS::UID::AutoCommit = 1;
+ #}
+
+ my @args = $ljob->args;
+
+ defined( my $pid = fork ) or do {
+ warn "WARNING: can't fork: $!\n";
+ my %hash = $job->hash;
+ $hash{'status'} = 'failed';
+ $hash{'statustext'} = "[freeside-queued] can't fork: $!";
+ my $ljob = new FS::queue ( \%hash );
+ my $error = $ljob->replace($job);
+ die $error if $error;
+ next; #don't increment the kid counter
+ };
+
+ if ( $pid ) {
+ $kids++;
+ $kids{$pid} = 1;
+ } else { #kid time
+
+ #get new db handle
+ $FS::UID::dbh->{InactiveDestroy} = 1;
+
+ forksuidsetup($user);
+
+ #auto-use export classes...
+ if ( $ljob->job =~ /(FS::part_export::\w+)::/ ) {
+ my $class = $1;
+ eval "use $class;";
+ if ( $@ ) {
+ warn "job use $class failed";
+ my %hash = $ljob->hash;
+ $hash{'status'} = 'failed';
+ $hash{'statustext'} = $@;
+ my $fjob = new FS::queue( \%hash );
+ my $error = $fjob->replace($ljob);
+ die $error if $error;
+ exit; #end-of-kid
+ };
+ }
+
+ my $eval = "&". $ljob->job. '(@args);';
+ warn "running $eval";
+ eval $eval; #throw away return value? suppose so
+ if ( $@ ) {
+ warn "job $eval failed";
+ my %hash = $ljob->hash;
+ $hash{'status'} = 'failed';
+ $hash{'statustext'} = $@;
+ my $fjob = new FS::queue( \%hash );
+ my $error = $fjob->replace($ljob);
+ die $error if $error;
+ } else {
+ $ljob->delete;
+ }
+
+ exit;
+ #end-of-kid
+ }
+
+} continue {
+ if ( $sigterm ) {
+ warn "received TERM signal; exiting\n";
+ exit;
+ }
+ if ( $sigint ) {
+ warn "received INT signal; exiting\n";
+ exit;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-queued user\n";
+}
+
+sub _die {
+ my $msg = shift;
+ unlink $pid_file if -e $pid_file;
+ _logmsg($msg);
+}
+
+sub _logmsg {
+ chomp( my $msg = shift );
+ my $log = new IO::File ">>$log_file";
+ flock($log, LOCK_EX);
+ seek($log, 0, 2);
+ print $log "[". time2str("%a %b %e %T %Y",time). "] [$$] $msg\n";
+ flock($log, LOCK_UN);
+ close $log;
+}
+
+sub daemonize1 {
+
+ chdir "/" or die "Can't chdir to /: $!";
+ open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
+ defined(my $pid = fork) or die "Can't fork: $!";
+ if ( $pid ) {
+ print "freeside-queued started with pid $pid\n"; #logging to $log_file\n";
+ exit unless $pid_file;
+ my $pidfh = new IO::File ">$pid_file" or exit;
+ print $pidfh "$pid\n";
+ exit;
+ }
+ #open STDOUT, '>/dev/null'
+ # or die "Can't write to /dev/null: $!";
+ #setsid or die "Can't start a new session: $!";
+ #open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+
+}
+
+sub daemonize2 {
+ open STDOUT, '>/dev/null'
+ or die "Can't write to /dev/null: $!";
+ setsid or die "Can't start a new session: $!";
+ open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+}
+
+sub reap_kids {
+ foreach my $pid ( keys %kids ) {
+ my $kid = waitpid($pid, WNOHANG);
+ if ( $kid > 0 ) {
+ $kids--;
+ delete $kids{$kid};
+ }
+ }
+}
+
+=head1 NAME
+
+freeside-queued - Job queue daemon
+
+=head1 SYNOPSIS
+
+ freeside-queued user
+
+=head1 DESCRIPTION
+
+Job queue daemon. Should be running at all times.
+
+user: from the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+=cut
+
diff --git a/FS/bin/freeside-radgroup b/FS/bin/freeside-radgroup
new file mode 100644
index 000000000..ed85626d2
--- /dev/null
+++ b/FS/bin/freeside-radgroup
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_svc;
+use FS::svc_acct;
+
+&untaint_argv; #what it sounds like (eww)
+
+my($user, $action, $groupname, $svcpart) = @ARGV;
+
+adminsuidsetup $user;
+
+my @svc_acct = map { $_->svc_x } qsearch('cust_svc', { svcpart => $svcpart } );
+
+if ( lc($action) eq 'add' ) {
+ foreach my $svc_acct ( @svc_acct ) {
+ my @groups = $svc_acct->radius_groups;
+ next if grep { $_ eq $groupname } @groups;
+ push @groups, $groupname;
+ my %hash = $svc_acct->hash;
+ $hash{usergroup} = \@groups;
+ my $new = new FS::svc_acct \%hash;
+ my $error = $new->replace($svc_acct);
+ die $error if $error;
+ }
+} else {
+ die &usage;
+}
+
+# subroutines
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-radgroup user action groupname svcpart\n";
+}
+
+=head1 NAME
+
+freeside-radgroup - Command line utility to manipulate radius groups
+
+=head1 SYNOPSIS
+
+ freeside-addgroup user action groupname svcpart
+
+=head1 DESCRIPTION
+
+ B<user> is a freeside user as added with freeside-adduser.
+
+ B<command> is the action to take. Available actions are: I<add>
+
+ B<groupname> is the group to add (or remove, etc.)
+
+ B<svcpart> specifies which accounts will be updated.
+
+=head1 EXAMPLES
+
+freeside-radgroup freesideuser add groupname 3
+
+Adds I<groupname> to all accounts with service definition 3.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<freeside-adduser>, L<FS::svc_acct>, L<FS::part_svc>
+
+=cut
+
diff --git a/FS/bin/freeside-receivables-report b/FS/bin/freeside-receivables-report
new file mode 100755
index 000000000..f3ad2a1a6
--- /dev/null
+++ b/FS/bin/freeside-receivables-report
@@ -0,0 +1,217 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_main;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $report_lines $report_template @buf $header);
+getopts("vpmet:"); #switches
+
+#we're at now now (and later).
+my($_date)= $^T;
+
+# Get the current month
+my ($sec,$min,$hour,$mday,$mon,$year) =
+ (localtime($_date) )[0,1,2,3,4,5];
+$mon++;
+$year += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+ foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@customers)=qsearch('cust_main',{});
+if (scalar(@customers) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: Receivables",
+ ] );
+}
+
+my $total = 0;
+
+
+# Now I can start looping
+foreach my $customer (@customers)
+{
+ my $custnum = $customer->getfield('custnum');
+ my $first = $customer->getfield('first');
+ my $last = $customer->getfield('last');
+ my $company = $customer->getfield('company');
+ my $daytime = $customer->getfield('daytime');
+ my $balance = $customer->balance;
+
+
+ if ($balance != 0) {
+ $total += $balance;
+ push @buf, sprintf(qq{%8d %-32.32s %12s %9.2f},
+ $custnum,
+ $first . " " . $last . " " . $company,
+ $daytime,
+ $balance);
+
+ }
+
+}
+
+push @buf, ('', sprintf(qq{%61s}, "========="), sprintf(qq{%61.2f}, $total));
+
+sub FS::receivables_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::receivables_report::_template::title = " R E C E I V A B L E S ";
+$FS::receivables_report::_template::title = $opt_t if $opt_t;
+$FS::receivables_report::_template::page = 1;
+$FS::receivables_report::_template::date = $_date;
+$FS::receivables_report::_template::date = $_date;
+$FS::receivables_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::receivables_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::receivables_report::_template' )
+ );
+ $FS::receivables_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ \.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-receivables-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-receivables-report - Prints or emails outstanding receivables.
+
+=head1 SYNOPSIS
+
+ freeside-receivables-report [-v] [-p] [-m] [-e] [-t "title"] user
+
+=head1 DESCRIPTION
+
+Prints or emails outstanding receivables
+
+B<-v>: Verbose - Prints records to STDOUT.
+
+B<-p>: Print to printer lpr as found in the conf directory.
+
+B<-m>: Mail output to user found in the Conf email file.
+
+B<-e>: Print a final form feed to the printer.
+
+B<-t>: supply a title for the top of each page.
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-receivables-report,v 1.6 2002-09-09 22:57:34 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/bin/freeside-reexport b/FS/bin/freeside-reexport
new file mode 100644
index 000000000..b5c50a422
--- /dev/null
+++ b/FS/bin/freeside-reexport
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::svc_acct;
+use FS::cust_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my $export_x = shift or die &usage;
+my @part_export;
+if ( $export_x =~ /^(\d+)$/ ) {
+ @part_export = qsearchs('part_export', { exportnum=>$1 } )
+ or die "exportnum $export_x not found\n";
+} else {
+ @part_export = qsearch('part_export', { exporttype=>$export_x } )
+ or die "no exports of type $export_x found\n";
+}
+
+my $svc_something = shift or die &usage;
+my $svc_x;
+if ( $svc_something =~ /^(\d+)$/ ) {
+ my $cust_svc = qsearchs('cust_svc', { svcnum=>$1 } )
+ or die "svcnum $svc_something not found\n";
+ $svc_x = $cust_svc->svc_x;
+} else {
+ $svc_x = qsearchs('svc_acct', { username=>$svc_something } )
+ or die "username $svc_something not found\n";
+}
+
+foreach my $part_export ( @part_export ) {
+ my $error = $part_export->export_insert($svc_x);
+ die $error if $error;
+}
+
+
+sub usage {
+ die "Usage:\n\n freeside-reexport user exportnum|exporttype svcnum|username\n";
+}
+
+=head1 NAME
+
+freeside-reexport - Command line tool to re-trigger export jobs for existing services
+
+=head1 SYNOPSIS
+
+ freeside-reexport user exportnum|exporttype svcnum|username
+
+=head1 DESCRIPTION
+
+ Re-queues the export job for the specified exportnum or exporttype(s) and
+ specified service (selected by svcnum or username).
+
+=head1 SEE ALSO
+
+L<freeside-sqlradius-reset>, L<FS::part_export>
+
+=cut
+
diff --git a/FS/bin/freeside-selfservice-server b/FS/bin/freeside-selfservice-server
new file mode 100644
index 000000000..264cbc56d
--- /dev/null
+++ b/FS/bin/freeside-selfservice-server
@@ -0,0 +1,235 @@
+#!/usr/bin/perl -w
+#
+# freeside-selfservice-server
+
+# alas, much false laziness with freeside-queued and fs_signup_server. at
+# least it is slated to replace fs_{signup,passwd,mailadmin}_server
+# should probably generalize the version in here, or better yet use
+# Proc::Daemon or somesuch
+
+use strict;
+use vars qw( $Debug %kids $kids $max_kids $shutdown $log_file $ssh_pid );
+use Fcntl qw(:flock);
+use POSIX qw(:sys_wait_h setsid);
+use IO::Handle;
+use IO::Select;
+use IO::File;
+use Storable qw(nstore_fd fd_retrieve);
+use Net::SSH qw(sshopen2);
+use FS::UID qw(adminsuidsetup forksuidsetup);
+use FS::ClientAPI;
+
+use FS::Conf;
+use FS::cust_bill;
+use FS::cust_pkg;
+
+$Debug = 2; # >= 2 will log packet contents, including potentially compromising
+ # information
+
+$shutdown = 0;
+$max_kids = '10'; #?
+$kids = 0;
+
+my $user = shift or die &usage;
+my $machine = shift or die &usage;
+my $pid_file = "/var/run/freeside-selfservice-server.$user.pid";
+#my $pid_file = "/var/run/freeside-selfservice-server.$user.pid"; $FS::UID::datasrc not posible, but should include machine name at least, hmm
+
+&init($user);
+
+my $conf = new FS::Conf;
+
+if ($conf->exists('selfservice_server-quiet')) {
+ $FS::cust_bill::quiet = 1;
+ $FS::cust_pkg::quiet = 1;
+}
+
+my $clientd = "/usr/local/sbin/freeside-selfservice-clientd"; #better name?
+
+my $warnkids=0;
+while (1) {
+ my($writer,$reader,$error) = (new IO::Handle, new IO::Handle, new IO::Handle);
+ warn "connecting to $machine\n" if $Debug;
+
+ $ssh_pid = sshopen2($machine,$reader,$writer,$clientd);
+
+# nstore_fd(\*writer, {'hi'=>'there'});
+
+ warn "entering main loop\n" if $Debug;
+ my $undisp = 0;
+ my $s = IO::Select->new( $reader );
+ while (1) {
+
+ &reap_kids;
+
+ warn "waiting for packet from client\n" if $Debug && !$undisp;
+ $undisp = 1;
+ my @handles = $s->can_read(5);
+ unless ( @handles ) {
+ &shutdown if $shutdown;
+ next;
+ }
+
+ $undisp = 0;
+
+ warn "receiving packet from client\n" if $Debug;
+
+ my $packet = fd_retrieve($reader);
+ warn "packet received\n".
+ join('', map { " $_=>$packet->{$_}\n" } keys %$packet )
+ if $Debug > 1;
+
+ #prevent runaway forking
+ my $warnkids = 0;
+ while ( $kids >= $max_kids ) {
+ warn "WARNING: maximum $kids children reached\n" unless $warnkids++;
+ &reap_kids;
+ sleep 1;
+ }
+
+ warn "forking child\n" if $Debug;
+ defined( my $pid = fork ) or die "can't fork: $!";
+ if ( $pid ) {
+ $kids++;
+ $kids{$pid} = 1;
+ warn "child $pid spawned\n" if $Debug;
+ } else { #kid time
+
+ #get new db handle
+ $FS::UID::dbh->{InactiveDestroy} = 1;
+ forksuidsetup($user);
+
+ my $type = $packet->{_packet};
+ warn "calling $type handler\n" if $Debug;
+ my $rv = eval { FS::ClientAPI->dispatch($type, $packet); };
+ if ( $@ ) {
+ warn my $error = "WARNING: error dispatching $type: $@";
+ $rv = { _error => $error };
+ }
+ $rv->{_token} = $packet->{_token}; #identifier
+
+ warn "sending response\n" if $Debug;
+ flock($writer, LOCK_EX) or die "FATAL: can't lock write stream: $!";
+ nstore_fd($rv, $writer) or die "FATAL: can't send response: $!";
+ $writer->flush or die "FATAL: can't flush: $!";
+ flock($writer, LOCK_UN) or die "WARNING: can't release write lock: $!";
+
+ warn "child exiting\n" if $Debug;
+ exit; #end-of-kid
+ }
+
+ }
+
+}
+
+###
+# utility subroutines
+###
+
+sub reap_kids {
+ #warn "reaping kids\n";
+ foreach my $pid ( keys %kids ) {
+ my $kid = waitpid($pid, WNOHANG);
+ if ( $kid > 0 ) {
+ $kids--;
+ delete $kids{$kid};
+ }
+ }
+ #warn "done reaping\n";
+}
+
+sub init {
+ my $user = shift;
+
+ chdir "/" or die "Can't chdir to /: $!";
+ open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
+ defined(my $pid = fork) or die "Can't fork: $!";
+ if ( $pid ) {
+ print "freeside-selfservice-server to $machine started with pid $pid\n"; #logging to $log_file
+ exit unless $pid_file;
+ my $pidfh = new IO::File ">$pid_file" or exit;
+ print $pidfh "$pid\n";
+ exit;
+ }
+
+# sub REAPER { my $pid = wait; $SIG{CHLD} = \&REAPER; $kids--; }
+# #sub REAPER { my $pid = wait; $kids--; $SIG{CHLD} = \&REAPER; }
+# $SIG{CHLD} = \&REAPER;
+
+ $shutdown = 0;
+ $SIG{HUP} = sub { warn "SIGHUP received; shutting down\n"; $shutdown++; };
+ $SIG{INT} = sub { warn "SIGINT received; shutting down\n"; $shutdown++; };
+ $SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $shutdown++; };
+ $SIG{QUIT} = sub { warn "SIGQUIT received; shutting down\n"; $shutdown++; };
+ $SIG{PIPE} = sub { warn "SIGPIPE received; shutting down\n"; $shutdown++; };
+
+ #false laziness w/freeside-queued
+ my $freeside_gid = scalar(getgrnam('freeside'))
+ or die "can't setgid to freeside group\n";
+ $) = $freeside_gid;
+ $( = $freeside_gid;
+ #if freebsd can't setuid(), presumably it can't setgid() either. grr fleabsd
+ ($(,$)) = ($),$();
+ $) = $freeside_gid;
+
+ $> = $FS::UID::freeside_uid;
+ $< = $FS::UID::freeside_uid;
+ #freebsd is sofa king broken, won't setuid()
+ ($<,$>) = ($>,$<);
+ $> = $FS::UID::freeside_uid;
+ #eslaf
+
+ $ENV{HOME} = (getpwuid($>))[7]; #for ssh
+ adminsuidsetup $user;
+
+ #$log_file = "/usr/local/etc/freeside/selfservice.". $FS::UID::datasrc; #MACHINE NAME
+ $log_file = "/usr/local/etc/freeside/selfservice.$machine.log";
+
+ open STDOUT, '>/dev/null'
+ or die "Can't write to /dev/null: $!";
+ setsid or die "Can't start a new session: $!";
+ open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+
+ $SIG{__DIE__} = \&_die;
+ $SIG{__WARN__} = \&_logmsg;
+
+ warn "freeside-selfservice-server starting\n";
+
+}
+
+sub shutdown {
+ my $wait = 12; #wait up to 1 minute
+ while ( $kids > 0 && $wait-- ) {
+ warn "waiting for $kids children to terminate";
+ sleep 5;
+ }
+ warn "abandoning $kids children" if $kids;
+ kill 'TERM', $ssh_pid if $ssh_pid;
+ die "exiting";
+}
+
+sub _die {
+ my $msg = shift;
+ unlink $pid_file if -e $pid_file;
+ _logmsg($msg);
+}
+
+sub _logmsg {
+ chomp( my $msg = shift );
+ _do_logmsg( "[server] [". scalar(localtime). "] [$$] $msg\n" );
+}
+
+sub _do_logmsg {
+ chomp( my $msg = shift );
+ my $log = new IO::File ">>$log_file";
+ flock($log, LOCK_EX);
+ seek($log, 0, 2);
+ print $log "$msg\n";
+ flock($log, LOCK_UN);
+ close $log;
+}
+
+sub usage {
+ die "Usage:\n\n fs_signup_server user machine\n";
+}
+
diff --git a/FS/bin/freeside-setinvoice b/FS/bin/freeside-setinvoice
new file mode 100644
index 000000000..708e2fa30
--- /dev/null
+++ b/FS/bin/freeside-setinvoice
@@ -0,0 +1,42 @@
+#!/usr/bin/perl
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+use FS::Record qw(qsearch qsearchs);
+use FS::cust_main;
+use FS::svc_acct;
+
+&untaint_argv; #what it sounds like (eww)
+my $user = shift or die &usage;
+
+adminsuidsetup $user;
+
+foreach my $cust_main (
+ grep { ! scalar($_->invoicing_list) }
+ qsearch( 'cust_main', {} )
+) {
+ my @dest;
+ my @cust_pkg = $cust_main->ncancelled_pkgs;
+ foreach my $cust_pkg ( @cust_pkg ) {
+ foreach my $cust_svc ( $cust_pkg->cust_svc ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $cust_svc->svcnum } );
+ push @dest, $svc_acct->svcnum if $svc_acct;
+ }
+ }
+ push @dest, 'POST' unless @dest;
+ $cust_main->invoicing_list(\@dest);
+}
+
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^(.*)$/ || die "Illegal arguement \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-setinvoice user\n";
+}
+
+
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
new file mode 100755
index 000000000..734744efe
--- /dev/null
+++ b/FS/bin/freeside-setup
@@ -0,0 +1,1130 @@
+#!/usr/bin/perl -Tw
+
+#to delay loading dbdef until we're ready
+BEGIN { $FS::Record::setup_hack = 1; }
+
+use strict;
+use vars qw($opt_s);
+use Getopt::Std;
+use DBI;
+use DBIx::DBSchema 0.21;
+use DBIx::DBSchema::Table;
+use DBIx::DBSchema::Column;
+use DBIx::DBSchema::ColGroup::Unique;
+use DBIx::DBSchema::ColGroup::Index;
+use FS::UID qw(adminsuidsetup datasrc checkeuid getsecrets);
+use FS::Record;
+use FS::cust_main_county;
+use FS::raddb;
+use FS::part_bill_event;
+
+die "Not running uid freeside!" unless checkeuid();
+
+my %attrib2db =
+ map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
+
+getopts("s");
+my $user = shift or die &usage;
+getsecrets($user);
+
+#needs to match FS::Record
+my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc;
+
+###
+
+#print "\nEnter the maximum username length: ";
+#my($username_len)=&getvalue;
+my $username_len = 32; #usernamemax config file
+
+#print "\n\n", <<END, ":";
+#Freeside tracks the RADIUS User-Name, check attribute Password and
+#reply attribute Framed-IP-Address for each user. You can specify additional
+#check and reply attributes (or you can add them later with the
+#fs-radius-add-check and fs-radius-add-reply programs).
+#
+#First enter any additional RADIUS check attributes you need to track for each
+#user, separated by whitespace.
+#END
+#my @check_attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
+# split(" ",&getvalue);
+#
+#print "\n\n", <<END, ":";
+#Now enter any additional reply attributes you need to track for each user,
+#separated by whitespace.
+#END
+#my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
+# split(" ",&getvalue);
+#
+#print "\n\n", <<END, ":";
+#Do you wish to enable the tracking of a second, separate shipping/service
+#address?
+#END
+#my $ship = &_yesno;
+#
+#sub getvalue {
+# my($x)=scalar(<STDIN>);
+# chop $x;
+# $x;
+#}
+#
+#sub _yesno {
+# print " [y/N]:";
+# my $x = scalar(<STDIN>);
+# $x =~ /^y/i;
+#}
+
+my @check_attributes = (); #add later
+my @attributes = (); #add later
+my $ship = $opt_s;
+
+###
+
+my($char_d) = 80; #default maxlength for text fields
+
+#my(@date_type) = ( 'timestamp', '', '' );
+my(@date_type) = ( 'int', 'NULL', '' );
+my(@perl_type) = ( 'text', 'NULL', '' );
+my @money_type = ( 'decimal', '', '10,2' );
+
+###
+# create a dbdef object from the old data structure
+###
+
+my(%tables)=&tables_hash_hack;
+
+#turn it into objects
+my($dbdef) = new DBIx::DBSchema ( map {
+ my(@columns);
+ while (@{$tables{$_}{'columns'}}) {
+ my($name,$type,$null,$length)=splice @{$tables{$_}{'columns'}}, 0, 4;
+ push @columns, new DBIx::DBSchema::Column ( $name,$type,$null,$length );
+ }
+ DBIx::DBSchema::Table->new(
+ $_,
+ $tables{$_}{'primary_key'},
+ DBIx::DBSchema::ColGroup::Unique->new($tables{$_}{'unique'}),
+ DBIx::DBSchema::ColGroup::Index->new($tables{$_}{'index'}),
+ @columns,
+ );
+} (keys %tables) );
+
+my $cust_main = $dbdef->table('cust_main');
+unless ($ship) { #remove ship_ from cust_main
+ $cust_main->delcolumn($_) foreach ( grep /^ship_/, $cust_main->columns );
+} else { #add indices
+ push @{$cust_main->index->lol_ref},
+ map { [ "ship_$_" ] } qw( last company daytime night fax );
+}
+
+#add radius attributes to svc_acct
+
+my($svc_acct)=$dbdef->table('svc_acct');
+
+my($attribute);
+foreach $attribute (@attributes) {
+ $svc_acct->addcolumn ( new DBIx::DBSchema::Column (
+ 'radius_'. $attribute,
+ 'varchar',
+ 'NULL',
+ $char_d,
+ ));
+}
+
+foreach $attribute (@check_attributes) {
+ $svc_acct->addcolumn( new DBIx::DBSchema::Column (
+ 'rc_'. $attribute,
+ 'varchar',
+ 'NULL',
+ $char_d,
+ ));
+}
+
+#create history tables (false laziness w/create-history-tables)
+foreach my $table ( grep { ! /^h_/ } $dbdef->tables ) {
+ my $tableobj = $dbdef->table($table)
+ or die "unknown table $table";
+
+ die "unique->lol_ref undefined for $table"
+ unless defined $tableobj->unique->lol_ref;
+ die "index->lol_ref undefined for $table"
+ unless defined $tableobj->index->lol_ref;
+
+ my $h_tableobj = DBIx::DBSchema::Table->new( {
+ name => "h_$table",
+ primary_key => 'historynum',
+ unique => DBIx::DBSchema::ColGroup::Unique->new( [] ),
+ 'index' => DBIx::DBSchema::ColGroup::Index->new( [
+ @{$tableobj->unique->lol_ref},
+ @{$tableobj->index->lol_ref}
+ ] ),
+ columns => [
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'historynum',
+ 'type' => 'serial',
+ 'null' => 'NOT NULL',
+ 'length' => '',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_date',
+ 'type' => 'int',
+ 'null' => 'NULL',
+ 'length' => '',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_user',
+ 'type' => 'varchar',
+ 'null' => 'NOT NULL',
+ 'length' => '80',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_action',
+ 'type' => 'varchar',
+ 'null' => 'NOT NULL',
+ 'length' => '80',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ map {
+ my $column = $tableobj->column($_);
+
+ #clone so as to not disturb the original
+ $column = DBIx::DBSchema::Column->new( {
+ map { $_ => $column->$_() }
+ qw( name type null length default local )
+ } );
+
+ $column->type('int')
+ if $column->type eq 'serial';
+ #$column->default('')
+ # if $column->default =~ /^nextval\(/i;
+ #( my $local = $column->local ) =~ s/AUTO_INCREMENT//i;
+ #$column->local($local);
+ $column;
+ } $tableobj->columns
+ ],
+ } );
+ $dbdef->addtable($h_tableobj);
+}
+
+#important
+$dbdef->save($dbdef_file);
+&FS::Record::reload_dbdef($dbdef_file);
+
+###
+# create 'em
+###
+
+my($dbh)=adminsuidsetup $user;
+
+#create tables
+$|=1;
+
+foreach my $statement ( $dbdef->sql($dbh) ) {
+ $dbh->do( $statement )
+ or die "CREATE error: ". $dbh->errstr. "\ndoing statement: $statement";
+}
+
+#not really sample data (and shouldn't default to US)
+
+#cust_main_county
+
+#USPS state codes
+foreach ( qw(
+AL AK AS AZ AR CA CO CT DC DE FM FL GA GU HI ID IL IN IA KS KY LA
+ME MH MD MA MI MN MS MO MT NC ND NE NH NJ NM NV NY MP OH OK OR PA PW PR RI
+SC SD TN TX UT VT VI VA WA WV WI WY AE AA AP
+) ) {
+ my($cust_main_county)=new FS::cust_main_county({
+ 'state' => $_,
+ 'tax' => 0,
+ 'country' => 'US',
+ });
+ my($error);
+ $error=$cust_main_county->insert;
+ die $error if $error;
+}
+
+#AU "offical" state codes ala mark.williamson@ebbs.com.au (Mark Williamson)
+foreach ( qw(
+VIC NSW NT QLD TAS ACT WA SA
+) ) {
+ my($cust_main_county)=new FS::cust_main_county({
+ 'state' => $_,
+ 'tax' => 0,
+ 'country' => 'AU',
+ });
+ my($error);
+ $error=$cust_main_county->insert;
+ die $error if $error;
+}
+
+#ISO 2-letter country codes (same as country TLDs) except US and AU
+foreach ( qw(
+AF AL DZ AS AD AO AI AQ AG AR AM AW AT AZ BS BH BD BB BY BE BZ BJ BM BT BO
+BA BW BV BR IO BN BG BF BI KH CM CA CV KY CF TD CL CN CX CC CO KM CG CK CR CI
+HR CU CY CZ DK DJ DM DO TP EC EG SV GQ ER EE ET FK FO FJ FI FR FX GF PF TF GA
+GM GE DE GH GI GR GL GD GP GU GT GN GW GY HT HM HN HK HU IS IN ID IR IQ IE IL
+IT JM JP JO KZ KE KI KP KR KW KG LA LV LB LS LR LY LI LT LU MO MK MG MW MY MV
+ML MT MH MQ MR MU YT MX FM MD MC MN MS MA MZ MM NA NR NP NL AN NC NZ NI NE NG
+NU NF MP NO OM PK PW PA PG PY PE PH PN PL PT PR QA RE RO RU RW KN LC VC WS SM
+ST SA SN SC SL SG SK SI SB SO ZA GS ES LK SH PM SD SR SJ SZ SE CH SY TW TJ TZ
+TH TG TK TO TT TN TR TM TC TV UG UA AE GB UM UY UZ VU VA VE VN VG VI WF EH
+YE YU ZR ZM ZW
+) ) {
+ my($cust_main_county)=new FS::cust_main_county({
+ 'tax' => 0,
+ 'country' => $_,
+ });
+ my($error);
+ $error=$cust_main_county->insert;
+ die $error if $error;
+}
+
+#billing events
+foreach my $aref (
+ [ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
+ [ 'CARD', 'Batch card', '$cust_bill->batch_card();', 40, 'batch-card' ],
+ [ 'BILL', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCRD', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCHK', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+) {
+
+ my $part_bill_event = new FS::part_bill_event({
+ 'payby' => $aref->[0],
+ 'event' => $aref->[1],
+ 'eventcode' => $aref->[2],
+ 'seconds' => 0,
+ 'weight' => $aref->[3],
+ 'plan' => $aref->[4],
+ });
+ my($error);
+ $error=$part_bill_event->insert;
+ die $error if $error;
+
+}
+
+$dbh->commit or die $dbh->errstr;
+$dbh->disconnect or die $dbh->errstr;
+
+#print "Freeside database initialized sucessfully\n";
+
+sub usage {
+ die "Usage:\n freeside-setup [ -s ] user\n";
+}
+
+###
+# Now it becomes an object. much better.
+###
+sub tables_hash_hack {
+
+ #note that s/(date|change)/_$1/; to avoid keyword conflict.
+ #put a kludge in FS::Record to catch this or? (pry need some date-handling
+ #stuff anyway also)
+
+ my(%tables)=( #yech.}
+
+ 'agent' => {
+ 'columns' => [
+ 'agentnum', 'serial', '', '',
+ 'agent', 'varchar', '', $char_d,
+ 'typenum', 'int', '', '',
+ 'freq', 'int', 'NULL', '',
+ 'prog', @perl_type,
+ ],
+ 'primary_key' => 'agentnum',
+ 'unique' => [],
+ 'index' => [ ['typenum'] ],
+ },
+
+ 'agent_type' => {
+ 'columns' => [
+ 'typenum', 'serial', '', '',
+ 'atype', 'varchar', '', $char_d,
+ ],
+ 'primary_key' => 'typenum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'type_pkgs' => {
+ 'columns' => [
+ 'typenum', 'int', '', '',
+ 'pkgpart', 'int', '', '',
+ ],
+ 'primary_key' => '',
+ 'unique' => [ ['typenum', 'pkgpart'] ],
+ 'index' => [ ['typenum'] ],
+ },
+
+ 'cust_bill' => {
+ 'columns' => [
+ 'invnum', 'serial', '', '',
+ 'custnum', 'int', '', '',
+ '_date', @date_type,
+ 'charged', @money_type,
+ 'printed', 'int', '', '',
+ 'closed', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'invnum',
+ 'unique' => [],
+ 'index' => [ ['custnum'], ['_date'] ],
+ },
+
+ 'cust_bill_event' => {
+ 'columns' => [
+ 'eventnum', 'serial', '', '',
+ 'invnum', 'int', '', '',
+ 'eventpart', 'int', '', '',
+ '_date', @date_type,
+ 'status', 'varchar', '', $char_d,
+ 'statustext', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'eventnum',
+ #no... there are retries now #'unique' => [ [ 'eventpart', 'invnum' ] ],
+ 'unique' => [],
+ 'index' => [ ['invnum'], ['status'] ],
+ },
+
+ 'part_bill_event' => {
+ 'columns' => [
+ 'eventpart', 'serial', '', '',
+ 'payby', 'char', '', 4,
+ 'event', 'varchar', '', $char_d,
+ 'eventcode', @perl_type,
+ 'seconds', 'int', 'NULL', '',
+ 'weight', 'int', '', '',
+ 'plan', 'varchar', 'NULL', $char_d,
+ 'plandata', 'text', 'NULL', '',
+ 'disabled', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'eventpart',
+ 'unique' => [],
+ 'index' => [ ['payby'] ],
+ },
+
+ 'cust_bill_pkg' => {
+ 'columns' => [
+ 'pkgnum', 'int', '', '',
+ 'invnum', 'int', '', '',
+ 'setup', @money_type,
+ 'recur', @money_type,
+ 'sdate', @date_type,
+ 'edate', @date_type,
+ 'itemdesc', 'varchar', 'NULL', $char_d,
+ ],
+ 'primary_key' => '',
+ 'unique' => [],
+ 'index' => [ ['invnum'] ],
+ },
+
+ 'cust_bill_pkg_detail' => {
+ 'columns' => [
+ 'detailnum', 'serial', '', '',
+ 'pkgnum', 'int', '', '',
+ 'invnum', 'int', '', '',
+ 'detail', 'varchar', '', $char_d,
+ ],
+ 'primary_key' => 'detailnum',
+ 'unique' => [],
+ 'index' => [ [ 'pkgnum', 'invnum' ] ],
+ },
+
+ 'cust_credit' => {
+ 'columns' => [
+ 'crednum', 'serial', '', '',
+ 'custnum', 'int', '', '',
+ '_date', @date_type,
+ 'amount', @money_type,
+ 'otaker', 'varchar', '', 32,
+ 'reason', 'text', 'NULL', '',
+ 'closed', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'crednum',
+ 'unique' => [],
+ 'index' => [ ['custnum'] ],
+ },
+
+ 'cust_credit_bill' => {
+ 'columns' => [
+ 'creditbillnum', 'serial', '', '',
+ 'crednum', 'int', '', '',
+ 'invnum', 'int', '', '',
+ '_date', @date_type,
+ 'amount', @money_type,
+ ],
+ 'primary_key' => 'creditbillnum',
+ 'unique' => [],
+ 'index' => [ ['crednum'], ['invnum'] ],
+ },
+
+ 'cust_main' => {
+ 'columns' => [
+ 'custnum', 'serial', '', '',
+ 'agentnum', 'int', '', '',
+# 'titlenum', 'int', 'NULL', '',
+ 'last', 'varchar', '', $char_d,
+# 'middle', 'varchar', 'NULL', $char_d,
+ 'first', 'varchar', '', $char_d,
+ 'ss', 'varchar', 'NULL', 11,
+ 'company', 'varchar', 'NULL', $char_d,
+ 'address1', 'varchar', '', $char_d,
+ 'address2', 'varchar', 'NULL', $char_d,
+ 'city', 'varchar', '', $char_d,
+ 'county', 'varchar', 'NULL', $char_d,
+ 'state', 'varchar', 'NULL', $char_d,
+ 'zip', 'varchar', '', 10,
+ 'country', 'char', '', 2,
+ 'daytime', 'varchar', 'NULL', 20,
+ 'night', 'varchar', 'NULL', 20,
+ 'fax', 'varchar', 'NULL', 12,
+ 'ship_last', 'varchar', 'NULL', $char_d,
+# 'ship_middle', 'varchar', 'NULL', $char_d,
+ 'ship_first', 'varchar', 'NULL', $char_d,
+ 'ship_company', 'varchar', 'NULL', $char_d,
+ 'ship_address1', 'varchar', 'NULL', $char_d,
+ 'ship_address2', 'varchar', 'NULL', $char_d,
+ 'ship_city', 'varchar', 'NULL', $char_d,
+ 'ship_county', 'varchar', 'NULL', $char_d,
+ 'ship_state', 'varchar', 'NULL', $char_d,
+ 'ship_zip', 'varchar', 'NULL', 10,
+ 'ship_country', 'char', 'NULL', 2,
+ 'ship_daytime', 'varchar', 'NULL', 20,
+ 'ship_night', 'varchar', 'NULL', 20,
+ 'ship_fax', 'varchar', 'NULL', 12,
+ 'payby', 'char', '', 4,
+ 'payinfo', 'varchar', 'NULL', $char_d,
+ #'paydate', @date_type,
+ 'paydate', 'varchar', 'NULL', 10,
+ 'payname', 'varchar', 'NULL', $char_d,
+ 'tax', 'char', 'NULL', 1,
+ 'otaker', 'varchar', '', 32,
+ 'refnum', 'int', '', '',
+ 'referral_custnum', 'int', 'NULL', '',
+ 'comments', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'custnum',
+ 'unique' => [],
+ #'index' => [ ['last'], ['company'] ],
+ 'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ],
+ [ 'daytime' ], [ 'night' ], [ 'fax' ],
+ ],
+ },
+
+ 'cust_main_invoice' => {
+ 'columns' => [
+ 'destnum', 'serial', '', '',
+ 'custnum', 'int', '', '',
+ 'dest', 'varchar', '', $char_d,
+ ],
+ 'primary_key' => 'destnum',
+ 'unique' => [],
+ 'index' => [ ['custnum'], ],
+ },
+
+ 'cust_main_county' => { #county+state+country are checked off the
+ #cust_main_county for validation and to provide
+ # a tax rate.
+ 'columns' => [
+ 'taxnum', 'serial', '', '',
+ 'state', 'varchar', 'NULL', $char_d,
+ 'county', 'varchar', 'NULL', $char_d,
+ 'country', 'char', '', 2,
+ 'taxclass', 'varchar', 'NULL', $char_d,
+ 'exempt_amount', @money_type,
+ 'tax', 'real', '', '', #tax %
+ 'taxname', 'varchar', 'NULL', $char_d,
+ ],
+ 'primary_key' => 'taxnum',
+ 'unique' => [],
+ # 'unique' => [ ['taxnum'], ['state', 'county'] ],
+ 'index' => [],
+ },
+
+ 'cust_pay' => {
+ 'columns' => [
+ 'paynum', 'serial', '', '',
+ #now cust_bill_pay #'invnum', 'int', '', '',
+ 'custnum', 'int', '', '',
+ 'paid', @money_type,
+ '_date', @date_type,
+ 'payby', 'char', '', 4, # CARD/BILL/COMP, should be index into
+ # payment type table.
+ 'payinfo', 'varchar', 'NULL', $char_d, #see cust_main above
+ 'paybatch', 'varchar', 'NULL', $char_d, #for auditing purposes.
+ 'closed', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'paynum',
+ 'unique' => [],
+ 'index' => [ [ 'custnum' ], [ 'paybatch' ] ],
+ },
+
+ 'cust_bill_pay' => {
+ 'columns' => [
+ 'billpaynum', 'serial', '', '',
+ 'invnum', 'int', '', '',
+ 'paynum', 'int', '', '',
+ 'amount', @money_type,
+ '_date', @date_type
+ ],
+ 'primary_key' => 'billpaynum',
+ 'unique' => [],
+ 'index' => [ [ 'paynum' ], [ 'invnum' ] ],
+ },
+
+ 'cust_pay_batch' => { #what's this used for again? list of customers
+ #in current CARD batch? (necessarily CARD?)
+ 'columns' => [
+ 'paybatchnum', 'serial', '', '',
+ 'invnum', 'int', '', '',
+ 'custnum', 'int', '', '',
+ 'last', 'varchar', '', $char_d,
+ 'first', 'varchar', '', $char_d,
+ 'address1', 'varchar', '', $char_d,
+ 'address2', 'varchar', 'NULL', $char_d,
+ 'city', 'varchar', '', $char_d,
+ 'state', 'varchar', 'NULL', $char_d,
+ 'zip', 'varchar', '', 10,
+ 'country', 'char', '', 2,
+# 'trancode', 'int', '', '',
+ 'cardnum', 'varchar', '', 16,
+ #'exp', @date_type,
+ 'exp', 'varchar', '', 11,
+ 'payname', 'varchar', 'NULL', $char_d,
+ 'amount', @money_type,
+ ],
+ 'primary_key' => 'paybatchnum',
+ 'unique' => [],
+ 'index' => [ ['invnum'], ['custnum'] ],
+ },
+
+ 'cust_pkg' => {
+ 'columns' => [
+ 'pkgnum', 'serial', '', '',
+ 'custnum', 'int', '', '',
+ 'pkgpart', 'int', '', '',
+ 'otaker', 'varchar', '', 32,
+ 'setup', @date_type,
+ 'bill', @date_type,
+ 'last_bill', @date_type,
+ 'susp', @date_type,
+ 'cancel', @date_type,
+ 'expire', @date_type,
+ 'manual_flag', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'pkgnum',
+ 'unique' => [],
+ 'index' => [ ['custnum'] ],
+ },
+
+ 'cust_refund' => {
+ 'columns' => [
+ 'refundnum', 'serial', '', '',
+ #now cust_credit_refund #'crednum', 'int', '', '',
+ 'custnum', 'int', '', '',
+ '_date', @date_type,
+ 'refund', @money_type,
+ 'otaker', 'varchar', '', 32,
+ 'reason', 'varchar', '', $char_d,
+ 'payby', 'char', '', 4, # CARD/BILL/COMP, should be index
+ # into payment type table.
+ 'payinfo', 'varchar', 'NULL', $char_d, #see cust_main above
+ 'paybatch', 'varchar', 'NULL', $char_d,
+ 'closed', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'refundnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'cust_credit_refund' => {
+ 'columns' => [
+ 'creditrefundnum', 'serial', '', '',
+ 'crednum', 'int', '', '',
+ 'refundnum', 'int', '', '',
+ 'amount', @money_type,
+ '_date', @date_type
+ ],
+ 'primary_key' => 'creditrefundnum',
+ 'unique' => [],
+ 'index' => [ [ 'crednum', 'refundnum' ] ],
+ },
+
+
+ 'cust_svc' => {
+ 'columns' => [
+ 'svcnum', 'serial', '', '',
+ 'pkgnum', 'int', 'NULL', '',
+ 'svcpart', 'int', '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [],
+ 'index' => [ ['svcnum'], ['pkgnum'], ['svcpart'] ],
+ },
+
+ 'part_pkg' => {
+ 'columns' => [
+ 'pkgpart', 'serial', '', '',
+ 'pkg', 'varchar', '', $char_d,
+ 'comment', 'varchar', '', $char_d,
+ 'setup', @perl_type,
+ 'freq', 'int', '', '', #billing frequency (months)
+ 'recur', @perl_type,
+ 'setuptax', 'char', 'NULL', 1,
+ 'recurtax', 'char', 'NULL', 1,
+ 'plan', 'varchar', 'NULL', $char_d,
+ 'plandata', 'text', 'NULL', '',
+ 'disabled', 'char', 'NULL', 1,
+ 'taxclass', 'varchar', 'NULL', $char_d,
+ ],
+ 'primary_key' => 'pkgpart',
+ 'unique' => [],
+ 'index' => [ [ 'disabled' ], ],
+ },
+
+# 'part_title' => {
+# 'columns' => [
+# 'titlenum', 'int', '', '',
+# 'title', 'varchar', '', $char_d,
+# ],
+# 'primary_key' => 'titlenum',
+# 'unique' => [ [] ],
+# 'index' => [ [] ],
+# },
+
+ 'pkg_svc' => {
+ 'columns' => [
+ 'pkgpart', 'int', '', '',
+ 'svcpart', 'int', '', '',
+ 'quantity', 'int', '', '',
+ ],
+ 'primary_key' => '',
+ 'unique' => [ ['pkgpart', 'svcpart'] ],
+ 'index' => [ ['pkgpart'] ],
+ },
+
+ 'part_referral' => {
+ 'columns' => [
+ 'refnum', 'serial', '', '',
+ 'referral', 'varchar', '', $char_d,
+ ],
+ 'primary_key' => 'refnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'part_svc' => {
+ 'columns' => [
+ 'svcpart', 'serial', '', '',
+ 'svc', 'varchar', '', $char_d,
+ 'svcdb', 'varchar', '', $char_d,
+ 'disabled', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'svcpart',
+ 'unique' => [],
+ 'index' => [ [ 'disabled' ] ],
+ },
+
+ 'part_svc_column' => {
+ 'columns' => [
+ 'columnnum', 'serial', '', '',
+ 'svcpart', 'int', '', '',
+ 'columnname', 'varchar', '', 64,
+ 'columnvalue', 'varchar', 'NULL', $char_d,
+ 'columnflag', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'columnnum',
+ 'unique' => [ [ 'svcpart', 'columnname' ] ],
+ 'index' => [ [ 'svcpart' ] ],
+ },
+
+ #(this should be renamed to part_pop)
+ 'svc_acct_pop' => {
+ 'columns' => [
+ 'popnum', 'serial', '', '',
+ 'city', 'varchar', '', $char_d,
+ 'state', 'varchar', '', $char_d,
+ 'ac', 'char', '', 3,
+ 'exch', 'char', '', 3,
+ 'loc', 'char', 'NULL', 4, #NULL for legacy purposes
+ ],
+ 'primary_key' => 'popnum',
+ 'unique' => [],
+ 'index' => [ [ 'state' ] ],
+ },
+
+ 'part_pop_local' => {
+ 'columns' => [
+ 'localnum', 'serial', '', '',
+ 'popnum', 'int', '', '',
+ 'city', 'varchar', 'NULL', $char_d,
+ 'state', 'char', 'NULL', 2,
+ 'npa', 'char', '', 3,
+ 'nxx', 'char', '', 3,
+ ],
+ 'primary_key' => 'localnum',
+ 'unique' => [],
+ 'index' => [ [ 'npa', 'nxx' ], [ 'popnum' ] ],
+ },
+
+ 'svc_acct' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '',
+ 'username', 'varchar', '', $username_len, #unique (& remove dup code)
+ '_password', 'varchar', '', 50, #13 for encryped pw's plus ' *SUSPENDED* (mp5 passwords can be 34)
+ 'sec_phrase', 'varchar', 'NULL', $char_d,
+ 'popnum', 'int', 'NULL', '',
+ 'uid', 'int', 'NULL', '',
+ 'gid', 'int', 'NULL', '',
+ 'finger', 'varchar', 'NULL', $char_d,
+ 'dir', 'varchar', 'NULL', $char_d,
+ 'shell', 'varchar', 'NULL', $char_d,
+ 'quota', 'varchar', 'NULL', $char_d,
+ 'slipip', 'varchar', 'NULL', 15, #four TINYINTs, bah.
+ 'seconds', 'int', 'NULL', '', #uhhhh
+ 'domsvc', 'int', '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ #'unique' => [ [ 'username', 'domsvc' ] ],
+ 'unique' => [],
+ 'index' => [ ['username'], ['domsvc'] ],
+ },
+
+ #'svc_charge' => {
+ # 'columns' => [
+ # 'svcnum', 'int', '', '',
+ # 'amount', @money_type,
+ # ],
+ # 'primary_key' => 'svcnum',
+ # 'unique' => [ [] ],
+ # 'index' => [ [] ],
+ #},
+
+ 'svc_domain' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '',
+ 'domain', 'varchar', '', $char_d,
+ 'catchall', 'int', 'NULL', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [ ['domain'] ],
+ 'index' => [],
+ },
+
+ 'domain_record' => {
+ 'columns' => [
+ 'recnum', 'serial', '', '',
+ 'svcnum', 'int', '', '',
+ #'reczone', 'varchar', '', $char_d,
+ 'reczone', 'varchar', '', 255,
+ 'recaf', 'char', '', 2,
+ 'rectype', 'varchar', '', 5,
+ #'recdata', 'varchar', '', $char_d,
+ 'recdata', 'varchar', '', 255,
+ ],
+ 'primary_key' => 'recnum',
+ 'unique' => [],
+ 'index' => [ ['svcnum'] ],
+ },
+
+ 'svc_forward' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '',
+ 'srcsvc', 'int', '', '',
+ 'dstsvc', 'int', '', '',
+ 'dst', 'varchar', 'NULL', $char_d,
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [],
+ 'index' => [ ['srcsvc'], ['dstsvc'] ],
+ },
+
+ 'svc_www' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '',
+ 'recnum', 'int', '', '',
+ 'usersvc', 'int', '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ #'svc_wo' => {
+ # 'columns' => [
+ # 'svcnum', 'int', '', '',
+ # 'svcnum', 'int', '', '',
+ # 'svcnum', 'int', '', '',
+ # 'worker', 'varchar', '', $char_d,
+ # '_date', @date_type,
+ # ],
+ # 'primary_key' => 'svcnum',
+ # 'unique' => [ [] ],
+ # 'index' => [ [] ],
+ #},
+
+ 'prepay_credit' => {
+ 'columns' => [
+ 'prepaynum', 'serial', '', '',
+ 'identifier', 'varchar', '', $char_d,
+ 'amount', @money_type,
+ 'seconds', 'int', 'NULL', '',
+ ],
+ 'primary_key' => 'prepaynum',
+ 'unique' => [ ['identifier'] ],
+ 'index' => [],
+ },
+
+ 'port' => {
+ 'columns' => [
+ 'portnum', 'serial', '', '',
+ 'ip', 'varchar', 'NULL', 15,
+ 'nasport', 'int', 'NULL', '',
+ 'nasnum', 'int', '', '',
+ ],
+ 'primary_key' => 'portnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'nas' => {
+ 'columns' => [
+ 'nasnum', 'serial', '', '',
+ 'nas', 'varchar', '', $char_d,
+ 'nasip', 'varchar', '', 15,
+ 'nasfqdn', 'varchar', '', $char_d,
+ 'last', 'int', '', '',
+ ],
+ 'primary_key' => 'nasnum',
+ 'unique' => [ [ 'nas' ], [ 'nasip' ] ],
+ 'index' => [ [ 'last' ] ],
+ },
+
+ 'session' => {
+ 'columns' => [
+ 'sessionnum', 'serial', '', '',
+ 'portnum', 'int', '', '',
+ 'svcnum', 'int', '', '',
+ 'login', @date_type,
+ 'logout', @date_type,
+ ],
+ 'primary_key' => 'sessionnum',
+ 'unique' => [],
+ 'index' => [ [ 'portnum' ] ],
+ },
+
+ 'queue' => {
+ 'columns' => [
+ 'jobnum', 'serial', '', '',
+ 'job', 'text', '', '',
+ '_date', 'int', '', '',
+ 'status', 'varchar', '', $char_d,
+ 'statustext', 'text', 'NULL', '',
+ 'svcnum', 'int', 'NULL', '',
+ ],
+ 'primary_key' => 'jobnum',
+ 'unique' => [],
+ 'index' => [ [ 'svcnum' ], [ 'status' ] ],
+ },
+
+ 'queue_arg' => {
+ 'columns' => [
+ 'argnum', 'serial', '', '',
+ 'jobnum', 'int', '', '',
+ 'arg', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'argnum',
+ 'unique' => [],
+ 'index' => [ [ 'jobnum' ] ],
+ },
+
+ 'queue_depend' => {
+ 'columns' => [
+ 'dependnum', 'serial', '', '',
+ 'jobnum', 'int', '', '',
+ 'depend_jobnum', 'int', '', '',
+ ],
+ 'primary_key' => 'dependnum',
+ 'unique' => [],
+ 'index' => [ [ 'jobnum' ], [ 'depend_jobnum' ] ],
+ },
+
+ 'export_svc' => {
+ 'columns' => [
+ 'exportsvcnum' => 'serial', '', '',
+ 'exportnum' => 'int', '', '',
+ 'svcpart' => 'int', '', '',
+ ],
+ 'primary_key' => 'exportsvcnum',
+ 'unique' => [ [ 'exportnum', 'svcpart' ] ],
+ 'index' => [ [ 'exportnum' ], [ 'svcpart' ] ],
+ },
+
+ 'part_export' => {
+ 'columns' => [
+ 'exportnum', 'serial', '', '',
+ #'svcpart', 'int', '', '',
+ 'machine', 'varchar', '', $char_d,
+ 'exporttype', 'varchar', '', $char_d,
+ 'nodomain', 'char', 'NULL', 1,
+ ],
+ 'primary_key' => 'exportnum',
+ 'unique' => [],
+ 'index' => [ [ 'machine' ], [ 'exporttype' ] ],
+ },
+
+ 'part_export_option' => {
+ 'columns' => [
+ 'optionnum', 'serial', '', '',
+ 'exportnum', 'int', '', '',
+ 'optionname', 'varchar', '', $char_d,
+ 'optionvalue', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'optionnum',
+ 'unique' => [],
+ 'index' => [ [ 'exportnum' ], [ 'optionname' ] ],
+ },
+
+ 'radius_usergroup' => {
+ 'columns' => [
+ 'usergroupnum', 'serial', '', '',
+ 'svcnum', 'int', '', '',
+ 'groupname', 'varchar', '', $char_d,
+ ],
+ 'primary_key' => 'usergroupnum',
+ 'unique' => [],
+ 'index' => [ [ 'svcnum' ], [ 'groupname' ] ],
+ },
+
+ 'msgcat' => {
+ 'columns' => [
+ 'msgnum', 'serial', '', '',
+ 'msgcode', 'varchar', '', $char_d,
+ 'locale', 'varchar', '', 16,
+ 'msg', 'text', '', '',
+ ],
+ 'primary_key' => 'msgnum',
+ 'unique' => [ [ 'msgcode', 'locale' ] ],
+ 'index' => [],
+ },
+
+ 'cust_tax_exempt' => {
+ 'columns' => [
+ 'exemptnum', 'serial', '', '',
+ 'custnum', 'int', '', '',
+ 'taxnum', 'int', '', '',
+ 'year', 'int', '', '',
+ 'month', 'int', '', '',
+ 'amount', @money_type,
+ ],
+ 'primary_key' => 'exemptnum',
+ 'unique' => [ [ 'custnum', 'taxnum', 'year', 'month' ] ],
+ 'index' => [],
+ },
+
+ 'router' => {
+ 'columns' => [
+ 'routernum', 'serial', '', '',
+ 'routername', 'varchar', '', $char_d,
+ 'svcnum', 'int', '0', '',
+ ],
+ 'primary_key' => 'routernum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'part_svc_router' => {
+ 'columns' => [
+ 'svcpart', 'int', '', '',
+ 'routernum', 'int', '', '',
+ ],
+ 'primary_key' => '',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'part_router_field' => {
+ 'columns' => [
+ 'routerfieldpart', 'serial', '', '',
+ 'name', 'varchar', '', $char_d,
+ 'length', 'int', '', '',
+ 'check_block', 'text', 'NULL', '',
+ 'list_source', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'routerfieldpart',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'router_field' => {
+ 'columns' => [
+ 'routerfieldpart', 'int', '', '',
+ 'routernum', 'int', '', '',
+ 'value', 'varchar', '', 128,
+ ],
+ 'primary_key' => '',
+ 'unique' => [ [ 'routerfieldpart', 'routernum' ] ],
+ 'index' => [],
+ },
+
+ 'addr_block' => {
+ 'columns' => [
+ 'blocknum', 'serial', '', '',
+ 'routernum', 'int', '', '',
+ 'ip_gateway', 'varchar', '', 15,
+ 'ip_netmask', 'int', '', '',
+ ],
+ 'primary_key' => 'blocknum',
+ 'unique' => [ [ 'blocknum', 'routernum' ] ],
+ 'index' => [],
+ },
+
+ 'part_sb_field' => {
+ 'columns' => [
+ 'sbfieldpart', 'serial', '', '',
+ 'svcpart', 'int', '', '',
+ 'name', 'varchar', '', $char_d,
+ 'length', 'int', '', '',
+ 'check_block', 'text', 'NULL', '',
+ 'list_source', 'text', 'NULL', '',
+ ],
+ 'primary_key' => 'sbfieldpart',
+ 'unique' => [ [ 'sbfieldpart', 'svcpart' ] ],
+ 'index' => [],
+ },
+
+ 'sb_field' => {
+ 'columns' => [
+ 'sbfieldpart', 'int', '', '',
+ 'svcnum', 'int', '', '',
+ 'value', 'varchar', '', 128,
+ ],
+ 'primary_key' => '',
+ 'unique' => [ [ 'sbfieldpart', 'svcnum' ] ],
+ 'index' => [],
+ },
+
+ 'svc_broadband' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '',
+ 'blocknum', 'int', '', '',
+ 'speed_up', 'int', '', '',
+ 'speed_down', 'int', '', '',
+ 'ip_addr', 'varchar', '', 15,
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ );
+
+ %tables;
+
+}
+
diff --git a/FS/bin/freeside-sqlradius-radacctd b/FS/bin/freeside-sqlradius-radacctd
new file mode 100644
index 000000000..4e8d57c51
--- /dev/null
+++ b/FS/bin/freeside-sqlradius-radacctd
@@ -0,0 +1,180 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use vars qw( $log_file $sigterm $sigint );
+use subs qw( _die _logmsg );
+use Fcntl qw(:flock);
+use POSIX qw(setsid);
+use Date::Format;
+use IO::File;
+use FS::UID qw(adminsuidsetup);
+#use FS::Record qw(qsearch qsearchs);
+#use FS::part_export;
+#use FS::svc_acct;
+#use FS::cust_svc;
+
+#lots of false laziness w/freeside-queued
+
+my $user = shift or die &usage;
+
+#my $pid_file = "/var/run/freeside-sqlradius-radacctd.$user.pid";
+my $pid_file = "/var/run/freeside-sqlradius-radacctd.pid";
+
+&daemonize1;
+
+#sub REAPER { my $pid = wait; $SIG{CHLD} = \&REAPER; $kids--; }
+#$SIG{CHLD} = \&REAPER;
+
+$sigterm = 0;
+$sigint = 0;
+$SIG{INT} = sub { warn "SIGINT received; shutting down\n"; $sigint++; };
+$SIG{TERM} = sub { warn "SIGTERM received; shutting down\n"; $sigterm++; };
+
+my $freeside_gid = scalar(getgrnam('freeside'))
+ or die "can't setgid to freeside group\n";
+$) = $freeside_gid;
+$( = $freeside_gid;
+#if freebsd can't setuid(), presumably it can't setgid() either. grr fleabsd
+($(,$)) = ($),$();
+$) = $freeside_gid;
+
+$> = $FS::UID::freeside_uid;
+$< = $FS::UID::freeside_uid;
+#freebsd is sofa king broken, won't setuid()
+($<,$>) = ($>,$<);
+$> = $FS::UID::freeside_uid;
+
+#$ENV{HOME} = (getpwuid($>))[7]; #for ssh
+adminsuidsetup $user;
+
+$log_file= "/usr/local/etc/freeside/sqlradius-radacctd-log.". $FS::UID::datasrc;
+
+&daemonize2;
+
+$SIG{__DIE__} = \&_die;
+$SIG{__WARN__} = \&_logmsg;
+
+warn "freeside-sqlradius-radacctd starting\n";
+
+#eslaf
+
+#my $machine = shift or die &usage; #would need to be up higher for real
+my @exports = qsearch('part_export', { 'exporttype' => 'sqlradius' } );
+
+while (1) {
+
+ my %seen = ();
+ foreach my $export ( @exports ) {
+ next if $seen{$export->option('datasrc')}++;
+ my $dbh = DBI->connect(
+ map { $export->option($_) } qw( datasrc username password )
+ ) or do {
+ warn "can't connect to ". $export->option('datasrc'). ": ". $DBI::errstr;
+ next;
+ }
+
+ # find old radacct position
+ #$lastid = 0;
+
+ # get new radacct records
+ my $sth = $dbh->prepare('SELECT * FROM radacct WHERE radacctid > ?') or do {
+ warn "can't select in radacct table from ". $export->option('datasrc').
+ ": ". $dbh->errstr;
+ next;
+ };
+
+ while ( my $radacct = $sth->fetchrow_arrayref({}) ) {
+
+ my $session = new FS::session {
+ portnum =>
+ svcnum =>
+ login =>
+ #logout =>
+ };
+
+ }
+
+ # look for updated radacct records & replace them
+
+ }
+
+ sleep 5;
+
+}
+
+#more false laziness w/freeside-queued
+
+sub usage {
+ die "Usage:\n\n freeside-sqlradius-radacctd user\n";
+}
+
+sub _die {
+ my $msg = shift;
+ unlink $pid_file if -e $pid_file;
+ _logmsg($msg);
+}
+
+sub _logmsg {
+ chomp( my $msg = shift );
+ my $log = new IO::File ">>$log_file";
+ flock($log, LOCK_EX);
+ seek($log, 0, 2);
+ print $log "[". time2str("%a %b %e %T %Y",time). "] [$$] $msg\n";
+ flock($log, LOCK_UN);
+ close $log;
+}
+
+sub daemonize1 {
+
+ chdir "/" or die "Can't chdir to /: $!";
+ open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
+ defined(my $pid = fork) or die "Can't fork: $!";
+ if ( $pid ) {
+ print "freeside-sqlradius-radacctd started with pid $pid\n";
+ #logging to $log_file\n";
+ exit unless $pid_file;
+ my $pidfh = new IO::File ">$pid_file" or exit;
+ print $pidfh "$pid\n";
+ exit;
+ }
+ #open STDOUT, '>/dev/null'
+ # or die "Can't write to /dev/null: $!";
+ #setsid or die "Can't start a new session: $!";
+ #open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+
+}
+
+sub daemonize2 {
+ open STDOUT, '>/dev/null'
+ or die "Can't write to /dev/null: $!";
+ setsid or die "Can't start a new session: $!";
+ open STDERR, '>&STDOUT' or die "Can't dup stdout: $!";
+}
+
+
+#eslaf
+
+=head1 NAME
+
+freeside-sqlradius-radacctd - Real-time radacct import daemon
+
+=head1 SYNOPSIS
+
+ freeside-sqlradius-radacctd username
+
+=head1 DESCRIPTION
+
+Imports records from an SQL radacct table in real-time into the session
+monitor.
+
+This enables per-minute or per-hour charges as well as the
+"View active NAS ports" function.
+
+B<username> is a username added by freeside-adduser.
+
+=head1 SEE ALSO
+
+session.html from the base documentation.
+
+=cut
+
diff --git a/FS/bin/freeside-sqlradius-reset b/FS/bin/freeside-sqlradius-reset
new file mode 100755
index 000000000..74f90a582
--- /dev/null
+++ b/FS/bin/freeside-sqlradius-reset
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::svc_acct;
+use FS::cust_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+#my $machine = shift or die &usage;
+
+my @exports = qsearch('part_export', { exporttype=>'sqlradius' } );
+push @exports, qsearch('part_export', { exporttype=>'sqlradius_withdomain' } );
+
+
+foreach my $export ( @exports ) {
+ my $icradius_dbh = DBI->connect(
+ map { $export->option($_) } qw( datasrc username password )
+ ) or die $DBI::errstr;
+ for my $table (qw( radcheck radreply usergroup )) {
+ my $sth = $icradius_dbh->prepare("DELETE FROM $table");
+ $sth->execute or die "Can't reset $table table: ". $sth->errstr;
+ }
+ $icradius_dbh->disconnect;
+}
+
+foreach my $export ( @exports ) {
+
+ #my @svcparts = map { $_->svcpart } $export->export_svc;
+
+ my @svc_acct =
+ map { qsearchs('svc_acct', { 'svcnum' => $_->svcnum } ) }
+ map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ $export->export_svc;
+
+ foreach my $svc_acct ( @svc_acct ) {
+
+ #false laziness with FS::svc_acct::insert (like it matters)
+ my $error = $export->export_insert($svc_acct);
+ die $error if $error;
+
+ }
+}
+
+sub usage {
+ #die "Usage:\n\n sqlradius_reset user machine\n";
+ die "Usage:\n\n freeside-sqlradius-reset user\n";
+}
+
+=head1 NAME
+
+freeside-sqlradius-reset - Command line interface to reset and recreate RADIUS SQL tables
+
+=head1 SYNOPSIS
+
+ freeside-sqlradius-reset username
+
+=head1 DESCRIPTION
+
+Deletes the radcheck, radreply and usergroup tables and repopulates them from
+the Freeside database, for all sqlradius exports.
+
+B<username> is a username added by freeside-adduser.
+
+=head1 SEE ALSO
+
+L<freeside-reexport>, L<FS::part_export>, L<FS::part_export::sqlradius>
+
+=cut
+
+
+
diff --git a/FS/bin/freeside-sqlradius-seconds b/FS/bin/freeside-sqlradius-seconds
new file mode 100644
index 000000000..1c978fa8a
--- /dev/null
+++ b/FS/bin/freeside-sqlradius-seconds
@@ -0,0 +1,58 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use Date::Parse;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearchs);
+use FS::svc_acct;
+
+my $fs_user = shift or die &usage;
+adminsuidsetup( $fs_user );
+
+my $target_user = shift or die &usage;
+my $start = shift or die &usage;
+$start = str2time($start);
+my $stop = scalar(@ARGV) ? str2time(shift) : time;
+
+my $svc_acct = qsearchs( 'svc_acct', { 'username' => $target_user } );
+die "username $target_user not found\n" unless $svc_acct;
+
+print $svc_acct->seconds_since_sqlradacct( $start, $stop ). "\n";
+
+sub usage {
+ die "Usage:\n\n freeside-sqlradius-seconds freeside_username target_username start_date stop_date\n";
+}
+
+
+=head1 NAME
+
+freeside-sqlradius-seconds - Real-time radacct import daemon
+
+=head1 SYNOPSIS
+
+ freeside-sqlradius-seconds freeside_username target_username start_date [ stop_date ]
+
+=head1 DESCRIPTION
+
+Returns the number of seconds the specified username has been online between
+start_date (inclusive) and stop_date (exclusive).
+See L<FS::svc_acct/seconds_since_sqlradacct>
+
+B<freeside_username> is a username added by freeside-adduser.
+B<target_username> is the username of the user account to query.
+B<start_date> and B<stop_date> are in any format Date::Parse is happy with.
+B<stop_date> defaults to now if not specified.
+
+=head1 BUGS
+
+Selection of the account in question is rather simplistic in that
+B<target_username> doesn't necessarily identify a unique account (and wouldn't
+even if a domain was specified), and no sqlradius export is checked for.
+
+=head1 SEE ALSO
+
+L<FS::svc_acct/seconds_since_sqlradacct>
+
+=cut
+
+1;
diff --git a/FS/bin/freeside-tax-report b/FS/bin/freeside-tax-report
new file mode 100755
index 000000000..240f3ad37
--- /dev/null
+++ b/FS/bin/freeside-tax-report
@@ -0,0 +1,292 @@
+#!/usr/bin/perl -Tw
+
+
+use strict;
+use Date::Parse;
+use Time::Local;
+use Getopt::Std;
+use Text::Template;
+use Net::SMTP;
+use Mail::Header;
+use Mail::Internet;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_bill;
+use FS::cust_bill_pay;
+use FS::cust_pay;
+
+
+&untaint_argv; #what it sounds like (eww)
+use vars qw($opt_v $opt_p $opt_m $opt_e $opt_t $opt_s $opt_f $report_lines $report_template @buf $header);
+getopts("vpmef:s:"); #switches
+
+#we're at now now (and later).
+my($_finishdate)= $opt_f ? str2time($main::opt_f) : $^T;
+my($_startdate)= $opt_s ? str2time($main::opt_s) : $^T;
+
+# Get the current month
+my ($ssec,$smin,$shour,$smday,$smon,$syear) =
+ (localtime($_startdate) )[0,1,2,3,4,5];
+$smon++;
+$syear += 1900;
+
+# Get the current month
+my ($fsec,$fmin,$fhour,$fmday,$fmon,$fyear) =
+ (localtime($_finishdate) )[0,1,2,3,4,5];
+$fmon++;
+$fyear += 1900;
+
+# Login to the database
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# Get the needed configuration files
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+my $email = $conf->config('email');
+my $smtpmachine = $conf->config('smtpmachine');
+my $mail_sender = $conf->exists('invoice_from') ? $conf->config('invoice_from') :
+ 'postmaster';
+my @report_template = $conf->config('report_template')
+ or die "cannot load config file report_template";
+$report_lines = 0;
+foreach ( grep /report_lines\(\d+\)/, @report_template ) { #kludgy :/
+ /report_lines\((\d+)\)/;
+ $report_lines += $1;
+}
+die "no report_lines() functions in template?" unless $report_lines;
+$report_template = new Text::Template (
+ TYPE => 'ARRAY',
+ SOURCE => [ map "$_\n", @report_template ],
+) or die "can't create new Text::Template object: $Text::Template::ERROR";
+
+
+my(@cust_bills)=qsearch('cust_bill',{});
+if (scalar(@cust_bills) == 0)
+{
+ exit 1;
+}
+
+# Open print and email pipes
+# $lpr and opt_p for printing
+# $email and opt_m for email
+
+if ($lpr && $main::opt_p)
+{
+ open(LPR, "|$lpr");
+}
+
+if ($email && $main::opt_m)
+{
+ $ENV{MAILADDRESS} = $mail_sender;
+ $header = new Mail::Header ( [
+ "From: Account Processor",
+ "To: $email",
+ "Sender: $mail_sender",
+ "Reply-To: $mail_sender",
+ "Subject: Sales Taxes Invoiced",
+ ] );
+}
+
+my $comped = 0;
+my $comped_tax = 0;
+my $other = 0;
+my $other_tax = 0;
+my $total = 0;
+my $taxed = 0;
+my $untaxed = 0;
+my $total_tax = 0;
+
+# Now I can start looping
+foreach my $cust_bill (@cust_bills)
+{
+ my $_date = $cust_bill->getfield('_date');
+ my $invnum = $cust_bill->getfield('invnum');
+ my $charged = $cust_bill->getfield('charged');
+
+ if ($_date >= $_startdate && $_date <= $_finishdate) {
+ $total += $charged;
+
+ # The following lines were used to produce rather verbose reports
+ #my ($sec,$min,$hour,$mday,$mon,$year) =
+ # (localtime($_date) )[0,1,2,3,4,5];
+ #$mon++;
+ #$year -= 100 if $year >= 100;
+ #$year = "0" . $year if $year < 10;
+
+ my $invoice_amt =0;
+ my $invoice_tax =0;
+ my $invoice_comped =0;
+ my(@cust_bill_pkgs)= $cust_bill->cust_bill_pkg;
+ foreach my $cust_bill_pkg (@cust_bill_pkgs) {
+
+ my $recur = $cust_bill_pkg->getfield('recur');
+ my $setup = $cust_bill_pkg->getfield('setup');
+ my $pkgnum = $cust_bill_pkg->getfield('pkgnum');
+
+ if ($pkgnum == 0) {
+ # The following line was used to produce rather verbose reports
+ # push @buf, ('', sprintf(qq{%10s%15s%14.2f}, "$mon/$mday/$year", "Tax $invnum", $recur+$setup));
+ $invoice_tax += $recur;
+ $invoice_tax += $setup;
+ } else {
+ # The following line was used to produce rather verbose reports
+ # push @buf, ('', sprintf(qq{%10s%15s%14.2f}, "$mon/$mday/$year", "Inv $invnum", $recur+$setup));
+ $invoice_amt += $recur;
+ $invoice_amt += $setup;
+ }
+
+ }
+
+ my(@cust_bill_pays)= $cust_bill->cust_bill_pay;
+ foreach my $cust_bill_pay (@cust_bill_pays) {
+ my $payby = $cust_bill_pay->cust_pay->payby;
+ my $paid = $cust_bill_pay->getfield('amount');
+ if ($payby =~ 'COMP') {
+ $invoice_comped += $paid;
+ }
+ }
+
+ if (abs($invoice_comped - ($invoice_amt + $invoice_tax)) < 0.0001){
+ $comped += $invoice_amt;
+ $comped_tax += $invoice_tax;
+ } elsif ($invoice_comped > 0) {
+ push @buf, sprintf(qq{\nInvoice %10d has inexpliciable complimentary payments of %14.9f\n}, $invnum, $invoice_comped);
+ $other += $invoice_amt;
+ $other_tax += $invoice_tax;
+ } elsif ($invoice_tax > 0) {
+ $total_tax += $invoice_tax;
+ $taxed += $invoice_amt;
+ } else {
+ $untaxed += $invoice_amt;
+ }
+
+ }
+
+}
+
+push @buf, ('', sprintf(qq{%25s%14.2f}, "Complimentary", $comped));
+push @buf, sprintf(qq{%25s%14.2f}, "Complimentary Tax", $comped_tax);
+push @buf, sprintf(qq{%25s%14.2f}, "Other", $other);
+push @buf, sprintf(qq{%25s%14.2f}, "Other Tax", $other_tax);
+push @buf, sprintf(qq{%25s%14.2f}, "Untaxed", $untaxed);
+push @buf, sprintf(qq{%25s%14.2f}, "Taxed", $taxed);
+push @buf, sprintf(qq{%25s%14.2f}, "Tax", $total_tax);
+push @buf, ('', sprintf(qq{%39s}, "========="), sprintf(qq{%39.2f}, $total));
+
+sub FS::tax_report::_template::report_lines {
+ my $lines = shift;
+ map {
+ scalar(@buf) ? shift @buf : '' ;
+ }
+ ( 1 .. $lines );
+}
+
+$FS::tax_report::_template::title = qq~SALES TAXES INVOICED for $smon/$smday/$syear through $fmon/$fmday/$fyear~;
+$FS::tax_report::_template::title = $opt_t if $opt_t;
+$FS::tax_report::_template::page = 1;
+$FS::tax_report::_template::date = $^T;
+$FS::tax_report::_template::date = $^T;
+$FS::tax_report::_template::fdate = $_finishdate;
+$FS::tax_report::_template::fdate = $_finishdate;
+$FS::tax_report::_template::sdate = $_startdate;
+$FS::tax_report::_template::sdate = $_startdate;
+$FS::tax_report::_template::total_pages =
+ int( scalar(@buf) / $report_lines);
+$FS::tax_report::_template::total_pages++ if scalar(@buf) % $report_lines;
+
+my @report;
+while (@buf) {
+ push @report, split("\n",
+ $report_template->fill_in( PACKAGE => 'FS::tax_report::_template' )
+ );
+ $FS::tax_report::_template::page++;
+}
+
+if ($opt_v) {
+ print map "$_\n", @report;
+}
+if($lpr && $opt_p)
+{
+ print LPR map "$_\n", @report;
+ print LPR "\f" if $opt_e;
+ close LPR || die "Could not close printer: $lpr\n";
+}
+if($email && $opt_m)
+{
+ my $message = new Mail::Internet (
+ 'Header' => $header,
+ 'Body' => [ (@report) ],
+ );
+ $!=0;
+ $message->smtpsend( Host => "$smtpmachine" )
+ or die "can't send report to $email via $smtpmachine: $!";
+}
+
+
+# subroutines
+sub untaint_argv {
+ foreach $_ ( $[ .. $#ARGV ) { #untaint @ARGV
+ $ARGV[$_] =~ /^([\w\-\/ :\.]*)$/ || die "Illegal argument \"$ARGV[$_]\"";
+ $ARGV[$_]=$1;
+ }
+}
+
+sub usage {
+ die "Usage:\n\n freeside-tax-report [-v] [-p] [-e] user\n";
+}
+
+=head1 NAME
+
+freeside-tax-report - Prints or emails sales taxes invoiced in a given period.
+
+=head1 SYNOPSIS
+
+ freeside-tax-report [-v] [-p] [-m] [-e] [-t "title"] [-s date] [-f date] user
+
+=head1 DESCRIPTION
+
+Prints or emails sales taxes invoiced in a given period.
+
+-v: Verbose - Prints records to STDOUT.
+
+-p: Print to printer lpr as found in the conf directory.
+
+-m: Email output to user found in the Conf email file.
+
+-e: Print a final form feed to the printer.
+
+-t: supply a title for the top of each page.
+
+-s: starting date for inclusion
+
+-f: final date for inclusion
+
+user: From the mapsecrets file - see config.html from the base documentation
+
+=head1 VERSION
+
+$Id: freeside-tax-report,v 1.5 2002-09-09 22:57:34 ivan Exp $
+
+=head1 BUGS
+
+Yes..... Use at your own risk. No guarantees or warrantees of any
+kind apply to this program. Parts of this program are hacked from
+other GNU licensed software created mainly by Ivan Kohler.
+
+This is released under the GNU Public License. See www.gnu.org
+for more information regarding this license.
+
+=head1 SEE ALSO
+
+L<FS::cust_main>, config.html from the base documentation
+
+=head1 AUTHOR
+
+Jeff Finucane <jeff@cmh.net>
+
+based on print-batch by Joel Griffiths <griff@aver-computer.com>
+
+=cut
+
diff --git a/FS/t/CGI.t b/FS/t/CGI.t
new file mode 100644
index 000000000..1b4e238b6
--- /dev/null
+++ b/FS/t/CGI.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::CGI;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/ClientAPI.t b/FS/t/ClientAPI.t
new file mode 100644
index 000000000..973d8dada
--- /dev/null
+++ b/FS/t/ClientAPI.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::ClientAPI;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Conf.t b/FS/t/Conf.t
new file mode 100644
index 000000000..a9f7653b3
--- /dev/null
+++ b/FS/t/Conf.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Conf;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/ConfItem.t b/FS/t/ConfItem.t
new file mode 100644
index 000000000..c7932d7e3
--- /dev/null
+++ b/FS/t/ConfItem.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::ConfItem;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/InitHandler.t b/FS/t/InitHandler.t
new file mode 100644
index 000000000..0ce60c833
--- /dev/null
+++ b/FS/t/InitHandler.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::InitHandler;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Misc.t b/FS/t/Misc.t
new file mode 100644
index 000000000..cc7751ab6
--- /dev/null
+++ b/FS/t/Misc.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Misc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Msgcat.t b/FS/t/Msgcat.t
new file mode 100644
index 000000000..29e71b33c
--- /dev/null
+++ b/FS/t/Msgcat.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Msgcat;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/Record.t b/FS/t/Record.t
new file mode 100644
index 000000000..00de1eda3
--- /dev/null
+++ b/FS/t/Record.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::Record;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/SearchCache.t b/FS/t/SearchCache.t
new file mode 100644
index 000000000..3c26f3528
--- /dev/null
+++ b/FS/t/SearchCache.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::SearchCache;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/UID.t b/FS/t/UID.t
new file mode 100644
index 000000000..9f7da4e89
--- /dev/null
+++ b/FS/t/UID.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::UID;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/agent.t b/FS/t/agent.t
new file mode 100644
index 000000000..769cce254
--- /dev/null
+++ b/FS/t/agent.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::agent;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/agent_type.t b/FS/t/agent_type.t
new file mode 100644
index 000000000..99c66a151
--- /dev/null
+++ b/FS/t/agent_type.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::agent_type;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill.t b/FS/t/cust_bill.t
new file mode 100644
index 000000000..b43f08ee2
--- /dev/null
+++ b/FS/t/cust_bill.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_event.t b/FS/t/cust_bill_event.t
new file mode 100644
index 000000000..0e2ca3e24
--- /dev/null
+++ b/FS/t/cust_bill_event.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_event;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_pay.t b/FS/t/cust_bill_pay.t
new file mode 100644
index 000000000..001eed01e
--- /dev/null
+++ b/FS/t/cust_bill_pay.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_pay;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_pkg.t b/FS/t/cust_bill_pkg.t
new file mode 100644
index 000000000..0e45bdb0c
--- /dev/null
+++ b/FS/t/cust_bill_pkg.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_bill_pkg_detail.t b/FS/t/cust_bill_pkg_detail.t
new file mode 100644
index 000000000..ea6e3d125
--- /dev/null
+++ b/FS/t/cust_bill_pkg_detail.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_bill_pkg_detail;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit.t b/FS/t/cust_credit.t
new file mode 100644
index 000000000..cddf75cff
--- /dev/null
+++ b/FS/t/cust_credit.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit_bill.t b/FS/t/cust_credit_bill.t
new file mode 100644
index 000000000..0ef54c3f1
--- /dev/null
+++ b/FS/t/cust_credit_bill.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit_bill;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_credit_refund.t b/FS/t/cust_credit_refund.t
new file mode 100644
index 000000000..6b2b599f3
--- /dev/null
+++ b/FS/t/cust_credit_refund.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_credit_refund;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main.t b/FS/t/cust_main.t
new file mode 100644
index 000000000..b0ffbdb32
--- /dev/null
+++ b/FS/t/cust_main.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main_county.t b/FS/t/cust_main_county.t
new file mode 100644
index 000000000..dd6119911
--- /dev/null
+++ b/FS/t/cust_main_county.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main_county;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_main_invoice.t b/FS/t/cust_main_invoice.t
new file mode 100644
index 000000000..9661620e0
--- /dev/null
+++ b/FS/t/cust_main_invoice.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_main_invoice;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pay.t b/FS/t/cust_pay.t
new file mode 100644
index 000000000..f6d0b7571
--- /dev/null
+++ b/FS/t/cust_pay.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pay;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pay_batch.t b/FS/t/cust_pay_batch.t
new file mode 100644
index 000000000..02b572c15
--- /dev/null
+++ b/FS/t/cust_pay_batch.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pay_batch;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_pkg.t b/FS/t/cust_pkg.t
new file mode 100644
index 000000000..c6a686061
--- /dev/null
+++ b/FS/t/cust_pkg.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_refund.t b/FS/t/cust_refund.t
new file mode 100644
index 000000000..91583da28
--- /dev/null
+++ b/FS/t/cust_refund.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_refund;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_svc.t b/FS/t/cust_svc.t
new file mode 100644
index 000000000..267d731db
--- /dev/null
+++ b/FS/t/cust_svc.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_tax_exempt.pm b/FS/t/cust_tax_exempt.pm
new file mode 100644
index 000000000..8af13e3aa
--- /dev/null
+++ b/FS/t/cust_tax_exempt.pm
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_tax_exempt;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/cust_tax_exempt.t b/FS/t/cust_tax_exempt.t
new file mode 100644
index 000000000..8af13e3aa
--- /dev/null
+++ b/FS/t/cust_tax_exempt.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::cust_tax_exempt;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/domain_record.t b/FS/t/domain_record.t
new file mode 100644
index 000000000..794518ccf
--- /dev/null
+++ b/FS/t/domain_record.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::domain_record;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/export_svc.t b/FS/t/export_svc.t
new file mode 100644
index 000000000..773c5dea7
--- /dev/null
+++ b/FS/t/export_svc.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::export_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/msgcat.t b/FS/t/msgcat.t
new file mode 100644
index 000000000..c38c63935
--- /dev/null
+++ b/FS/t/msgcat.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::msgcat;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/nas.t b/FS/t/nas.t
new file mode 100644
index 000000000..6f8ae36d2
--- /dev/null
+++ b/FS/t/nas.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::nas;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_bill_event.t b/FS/t/part_bill_event.t
new file mode 100644
index 000000000..5626a9f97
--- /dev/null
+++ b/FS/t/part_bill_event.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_bill_event;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-apache.t b/FS/t/part_export-apache.t
new file mode 100644
index 000000000..b9995080f
--- /dev/null
+++ b/FS/t/part_export-apache.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::apache;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-bind.t b/FS/t/part_export-bind.t
new file mode 100644
index 000000000..d0c96be40
--- /dev/null
+++ b/FS/t/part_export-bind.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::bind;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-bind_slave.t b/FS/t/part_export-bind_slave.t
new file mode 100644
index 000000000..c6a038610
--- /dev/null
+++ b/FS/t/part_export-bind_slave.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::bind_slave;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-bsdshell.t b/FS/t/part_export-bsdshell.t
new file mode 100644
index 000000000..eaf417a70
--- /dev/null
+++ b/FS/t/part_export-bsdshell.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::bsdshell;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-cp.t b/FS/t/part_export-cp.t
new file mode 100644
index 000000000..bbefa6c1b
--- /dev/null
+++ b/FS/t/part_export-cp.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::cp;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-cyrus.t b/FS/t/part_export-cyrus.t
new file mode 100644
index 000000000..e0b3f350e
--- /dev/null
+++ b/FS/t/part_export-cyrus.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::cyrus;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-domain_shellcommands.t b/FS/t/part_export-domain_shellcommands.t
new file mode 100644
index 000000000..a2a44fbfb
--- /dev/null
+++ b/FS/t/part_export-domain_shellcommands.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::domain_shellcommands;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-forward_shellcommands.t b/FS/t/part_export-forward_shellcommands.t
new file mode 100644
index 000000000..78ca68d10
--- /dev/null
+++ b/FS/t/part_export-forward_shellcommands.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::forward_shellcommands;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-http.t b/FS/t/part_export-http.t
new file mode 100644
index 000000000..ea41b939f
--- /dev/null
+++ b/FS/t/part_export-http.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::http;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-infostreet.t b/FS/t/part_export-infostreet.t
new file mode 100644
index 000000000..1b3341825
--- /dev/null
+++ b/FS/t/part_export-infostreet.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::infostreet;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-ldap.t b/FS/t/part_export-ldap.t
new file mode 100644
index 000000000..826c3418d
--- /dev/null
+++ b/FS/t/part_export-ldap.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::ldap;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-null.t b/FS/t/part_export-null.t
new file mode 100644
index 000000000..055cdcee6
--- /dev/null
+++ b/FS/t/part_export-null.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::null;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-shellcommands.t b/FS/t/part_export-shellcommands.t
new file mode 100644
index 000000000..7bb47d3f8
--- /dev/null
+++ b/FS/t/part_export-shellcommands.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::shellcommands;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-shellcommands_withdomain.t b/FS/t/part_export-shellcommands_withdomain.t
new file mode 100644
index 000000000..c0bd1bbb0
--- /dev/null
+++ b/FS/t/part_export-shellcommands_withdomain.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::shellcommands_withdomain;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-sqlmail.t b/FS/t/part_export-sqlmail.t
new file mode 100644
index 000000000..b048a75a5
--- /dev/null
+++ b/FS/t/part_export-sqlmail.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::sqlmail;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-sqlradius.t b/FS/t/part_export-sqlradius.t
new file mode 100644
index 000000000..5fb23a5a6
--- /dev/null
+++ b/FS/t/part_export-sqlradius.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::sqlradius;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-sqlradius_withdomain.t b/FS/t/part_export-sqlradius_withdomain.t
new file mode 100644
index 000000000..504bf679f
--- /dev/null
+++ b/FS/t/part_export-sqlradius_withdomain.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::sqlradius_withdomain;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-sysvshell.t b/FS/t/part_export-sysvshell.t
new file mode 100644
index 000000000..7fc24acb1
--- /dev/null
+++ b/FS/t/part_export-sysvshell.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::sysvshell;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-textradius.t b/FS/t/part_export-textradius.t
new file mode 100644
index 000000000..d8a48a0c8
--- /dev/null
+++ b/FS/t/part_export-textradius.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::textradius;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-vpopmail.t b/FS/t/part_export-vpopmail.t
new file mode 100644
index 000000000..2e37114a2
--- /dev/null
+++ b/FS/t/part_export-vpopmail.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::vpopmail;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export-www_shellcommands.t b/FS/t/part_export-www_shellcommands.t
new file mode 100644
index 000000000..2ea79cf97
--- /dev/null
+++ b/FS/t/part_export-www_shellcommands.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export::www_shellcommands;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export.t b/FS/t/part_export.t
new file mode 100644
index 000000000..26b398791
--- /dev/null
+++ b/FS/t/part_export.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_export_option.t b/FS/t/part_export_option.t
new file mode 100644
index 000000000..13200c213
--- /dev/null
+++ b/FS/t/part_export_option.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_export_option;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_pkg.t b/FS/t/part_pkg.t
new file mode 100644
index 000000000..fd96073f9
--- /dev/null
+++ b/FS/t/part_pkg.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_pkg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_pop_local.t b/FS/t/part_pop_local.t
new file mode 100644
index 000000000..4e4ad17f5
--- /dev/null
+++ b/FS/t/part_pop_local.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_pop_local;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_referral.t b/FS/t/part_referral.t
new file mode 100644
index 000000000..d20b97930
--- /dev/null
+++ b/FS/t/part_referral.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_referral;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_svc.t b/FS/t/part_svc.t
new file mode 100644
index 000000000..bdb2a7aca
--- /dev/null
+++ b/FS/t/part_svc.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/part_svc_column.t b/FS/t/part_svc_column.t
new file mode 100644
index 000000000..467025c1e
--- /dev/null
+++ b/FS/t/part_svc_column.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::part_svc_column;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/pkg_svc.t b/FS/t/pkg_svc.t
new file mode 100644
index 000000000..77d34295a
--- /dev/null
+++ b/FS/t/pkg_svc.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::pkg_svc;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/port.t b/FS/t/port.t
new file mode 100644
index 000000000..46377aaf9
--- /dev/null
+++ b/FS/t/port.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::port;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/prepay_credit.t b/FS/t/prepay_credit.t
new file mode 100644
index 000000000..e7626bdf1
--- /dev/null
+++ b/FS/t/prepay_credit.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::prepay_credit;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/queue.t b/FS/t/queue.t
new file mode 100644
index 000000000..43e33730e
--- /dev/null
+++ b/FS/t/queue.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::queue;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/queue_arg.t b/FS/t/queue_arg.t
new file mode 100644
index 000000000..cf3f91dfe
--- /dev/null
+++ b/FS/t/queue_arg.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::queue_arg;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/queue_depend.t b/FS/t/queue_depend.t
new file mode 100644
index 000000000..8eaa2cdb3
--- /dev/null
+++ b/FS/t/queue_depend.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::queue_depend;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/raddb.t b/FS/t/raddb.t
new file mode 100644
index 000000000..ac28d0798
--- /dev/null
+++ b/FS/t/raddb.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::raddb;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/radius_usergroup.t b/FS/t/radius_usergroup.t
new file mode 100644
index 000000000..325742cf5
--- /dev/null
+++ b/FS/t/radius_usergroup.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::radius_usergroup;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/session.t b/FS/t/session.t
new file mode 100644
index 000000000..c4b714ea4
--- /dev/null
+++ b/FS/t/session.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::session;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_Common.t b/FS/t/svc_Common.t
new file mode 100644
index 000000000..ed49e1e49
--- /dev/null
+++ b/FS/t/svc_Common.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_Common;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_acct.t b/FS/t/svc_acct.t
new file mode 100644
index 000000000..9ca78c9d1
--- /dev/null
+++ b/FS/t/svc_acct.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_acct;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_acct_pop.t b/FS/t/svc_acct_pop.t
new file mode 100644
index 000000000..e612c40af
--- /dev/null
+++ b/FS/t/svc_acct_pop.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_acct_pop;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_domain.t b/FS/t/svc_domain.t
new file mode 100644
index 000000000..4d91898ac
--- /dev/null
+++ b/FS/t/svc_domain.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_domain;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_forward.t b/FS/t/svc_forward.t
new file mode 100644
index 000000000..d653d34ef
--- /dev/null
+++ b/FS/t/svc_forward.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_forward;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/svc_www.t b/FS/t/svc_www.t
new file mode 100644
index 000000000..eb4e83fbc
--- /dev/null
+++ b/FS/t/svc_www.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::svc_www;
+$loaded=1;
+print "ok 1\n";
diff --git a/FS/t/type_pkgs.t b/FS/t/type_pkgs.t
new file mode 100644
index 000000000..98401805c
--- /dev/null
+++ b/FS/t/type_pkgs.t
@@ -0,0 +1,5 @@
+BEGIN { $| = 1; print "1..1\n" }
+END {print "not ok 1\n" unless $loaded;}
+use FS::type_pkgs;
+$loaded=1;
+print "ok 1\n";
diff --git a/GPL b/GPL
new file mode 100644
index 000000000..e77696ae8
--- /dev/null
+++ b/GPL
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 000000000..4b9b0853c
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1 @@
+See httemplate/docs/index.html
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..6256ccc3e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,212 @@
+#!/usr/bin/make
+
+DATASOURCE = DBI:Pg:dbname=freeside
+#DATASOURCE=DBI:mysql:freeside
+
+DB_USER = freeside
+DB_PASSWORD=
+
+TEMPLATE = asp
+#TEMPLATE = mason
+
+ASP_GLOBAL = /usr/local/etc/freeside/asp-global
+MASON_HANDLER = /usr/local/etc/freeside/handler.pl
+MASONDATA = /usr/local/etc/freeside/masondata
+
+#deb, others?
+FREESIDE_DOCUMENT_ROOT = /var/www/freeside
+#freebsd
+#FREESIDE_DOCUMENT_ROOT = /usr/local/www/data/freeside
+
+#deb, others?
+INIT_FILE = /etc/init.d/freeside
+#freebsd
+#INIT_FILE = /usr/local/etc/rc.d/011.freeside.sh
+
+#deb, others?
+HTTPD_RESTART = /etc/init.d/apache restart
+#freebsd
+#HTTPD_RESTART = /usr/local/etc/rc.d/apache.sh stop; sleep 1; /usr/local/etc/rc.d/apache.sh start
+
+FREESIDE_RESTART = ${INIT_FILE} restart
+
+#deb, others?
+INSTALLGROUP = root
+#freebsd
+#INSTALLGROUP = wheel
+
+#edit the stuff below to have the daemons start
+
+QUEUED_USER=fs_queue
+
+#eventually this shouldn't be needed
+FREESIDE_PATH = `pwd`
+
+PASSWD_USER = nostart
+PASSWD_MACHINE = localhost
+
+SIGNUP_USER = nostart
+SIGNUP_MACHINE = localhost
+SIGNUP_AGENTNUM = 2
+SIGNUP_REFNUM = 2
+
+SELFSERVICE_USER = fs_selfservice
+SELFSERVICE_MACHINE = localhost
+
+#---
+
+#not changable yet
+FREESIDE_CONF = /usr/local/etc/freeside
+
+VERSION=1.5.0pre3
+TAG=freeside_1_5_0pre3
+
+help:
+ @echo "supported targets: aspdocs masondocs alldocs docs install-docs"
+ @echo " htmlman"
+ @echo " perl-modules install-perl-modules"
+ @echo " install deploy"
+ @echo " create-database"
+ @echo " clean"
+
+aspdocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
+ rm -rf aspdocs
+ cp -pr httemplate aspdocs
+ perl -p -i -e "\
+ s/%%%VERSION%%%/${VERSION}/g;\
+ " aspdocs/index.html
+ touch aspdocs
+
+
+masondocs: htmlman httemplate/* httemplate/*/* httemplate/*/*/* httemplate/*/*/*/* httemplate/*/*/*/*/*
+ rm -rf masondocs
+ cp -pr httemplate masondocs
+ ( cd masondocs; \
+ ../bin/masonize; \
+ )
+ perl -p -i -e "\
+ s/%%%VERSION%%%/${VERSION}/g;\
+ " masondocs/index.html
+ touch masondocs
+
+alldocs: aspdocs masondocs
+
+docs:
+ make ${TEMPLATE}docs
+
+htmlman:
+ [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
+ [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
+ [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
+ [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
+ [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
+ chmod a+rx bin/pod2x
+ [ -e DONT_REBUILD_DOCS ] || bin/pod2x
+
+forcehtmlman:
+ [ -e ./httemplate/docs/man ] || mkdir httemplate/docs/man
+ [ -e ./httemplate/docs/man/bin ] || mkdir httemplate/docs/man/bin
+ [ -e ./httemplate/docs/man/FS ] || mkdir httemplate/docs/man/FS
+ [ -e ./httemplate/docs/man/FS/UI ] || mkdir httemplate/docs/man/FS/UI
+ [ -e ./httemplate/docs/man/FS/part_export ] || mkdir httemplate/docs/man/FS/part_export
+ bin/pod2x
+
+install-docs: docs
+ [ -e ${FREESIDE_DOCUMENT_ROOT} ] && mv ${FREESIDE_DOCUMENT_ROOT} ${FREESIDE_DOCUMENT_ROOT}.`date +%Y%m%d%H%M%S` || true
+ cp -r ${TEMPLATE}docs ${FREESIDE_DOCUMENT_ROOT}
+ [ "${TEMPLATE}" = "asp" -a ! -e ${ASP_GLOBAL} ] && mkdir ${ASP_GLOBAL} || true
+ [ "${TEMPLATE}" = "asp" ] && chown -R freeside ${ASP_GLOBAL} || true
+ [ "${TEMPLATE}" = "asp" ] && cp htetc/global.asa ${ASP_GLOBAL} || true
+ [ "${TEMPLATE}" = "mason" ] && cp htetc/handler.pl ${MASON_HANDLER} || true
+ [ "${TEMPLATE}" = "mason" -a ! -e ${MASONDATA} ] && mkdir ${MASONDATA} || true
+ [ "${TEMPLATE}" = "mason" ] && chown -R freeside ${MASONDATA} || true
+
+perl-modules:
+ cd FS; \
+ [ -e Makefile ] || perl Makefile.PL; \
+ make
+
+install-perl-modules: perl-modules
+ cd FS; \
+ make install UNINST=1
+
+install-init:
+ #[ -e ${INIT_FILE} ] || install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
+ install -o root -g ${INSTALLGROUP} -m 711 init.d/freeside-init ${INIT_FILE}
+ perl -p -i -e "\
+ s/%%%QUEUED_USER%%%/${QUEUED_USER}/g;\
+ s'%%%FREESIDE_PATH%%%'${FREESIDE_PATH}'g;\
+ s/%%%PASSWD_USER%%%/${PASSWD_USER}/g;\
+ s/%%%PASSWD_MACHINE%%%/${PASSWD_MACHINE}/g;\
+ s/%%%SIGNUP_USER%%%/${SIGNUP_USER}/g;\
+ s/%%%SIGNUP_MACHINE%%%/${SIGNUP_MACHINE}/g;\
+ s/%%%SIGNUP_AGENTNUM%%%/${SIGNUP_AGENTNUM}/g;\
+ s/%%%SIGNUP_REFNUM%%%/${SIGNUP_REFNUM}/g;\
+ s/%%%SELFSERVICE_USER%%%/${SELFSERVICE_USER}/g;\
+ s/%%%SELFSERVICE_MACHINE%%%/${SELFSERVICE_MACHINE}/g;\
+ " ${INIT_FILE}
+
+install: install-perl-modules install-docs install-init
+
+deploy: install
+ ${HTTPD_RESTART}
+ ${FREESIDE_RESTART}
+
+create-database:
+ perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
+
+create-config: install-perl-modules
+ [ -e ${FREESIDE_CONF} ] && mv ${FREESIDE_CONF} ${FREESIDE_CONF}.`date +%Y%m%d%H%M%S` || true
+ mkdir ${FREESIDE_CONF}
+ chown freeside ${FREESIDE_CONF}
+
+ touch ${FREESIDE_CONF}/secrets
+ chown freeside ${FREESIDE_CONF}/secrets
+ chmod 600 ${FREESIDE_CONF}/secrets
+
+ echo -e "${DATASOURCE}\n${DB_USER}\n${DB_PASSWORD}" >${FREESIDE_CONF}/secrets
+ chmod 600 ${FREESIDE_CONF}/secrets
+ chown freeside ${FREESIDE_CONF}/secrets
+
+ mkdir "${FREESIDE_CONF}/conf.${DATASOURCE}"
+ rm -rf conf/registries #old dirs just won't go away
+ cp conf/[a-z]* "${FREESIDE_CONF}/conf.${DATASOURCE}"
+ chown -R freeside "${FREESIDE_CONF}/conf.${DATASOURCE}"
+
+ mkdir "${FREESIDE_CONF}/counters.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF}/counters.${DATASOURCE}"
+
+ mkdir "${FREESIDE_CONF}/cache.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF}/cache.${DATASOURCE}"
+
+ mkdir "${FREESIDE_CONF}/export.${DATASOURCE}"
+ chown freeside "${FREESIDE_CONF}/export.${DATASOURCE}"
+
+clean:
+ rm -rf aspdocs masondocs
+ cd FS; \
+ make clean
+
+#these are probably only useful if you're me...
+
+upload-docs: forcehtmlman
+ ssh cleanwhisker.420.am rm -rf /var/www/www.sisd.com/freeside/devdocs
+ scp -pr httemplate/docs cleanwhisker.420.am:/var/www/www.sisd.com/freeside/devdocs
+
+release: upload-docs
+ cd /home/ivan/freeside
+ #cvs tag ${TAG}
+ cvs tag -F ${TAG}
+
+ #cd /home/ivan
+ cvs export -r ${TAG} -d freeside-${VERSION} freeside
+ tar czvf freeside-${VERSION}.tar.gz freeside-${VERSION}
+
+ scp freeside-${VERSION}.tar.gz ivan@cleanwhisker.420.am:/var/www/sisd.420.am/freeside/
+ mv freeside-${VERSION} freeside-${VERSION}.tar.gz ..
+
+update-webdemo:
+ ssh ivan@pouncequick.420.am '( cd freeside; cvs update -d -P )'
+ #ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make clean; make deploy )'
+ ssh root@pouncequick.420.am '( cd /home/ivan/freeside; make deploy )'
+
diff --git a/README b/README
new file mode 100644
index 000000000..1030b3857
--- /dev/null
+++ b/README
@@ -0,0 +1,43 @@
+Freeside
+
+Copyright (C) 2000,2001,2002,2003 Ivan Kohler
+Copyright (C) 1999 Silicon Interactive Software Design
+All rights reserved
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of:
+
+ a) the GNU General Public License as published by the Free
+ Software Foundation; either version 2, or (at your option) any
+ later version
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program, in the file `GPL'; if not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite
+ 330, Boston, MA 02111-1307, USA.
+
+Freeside is a billing and administration package for Internet Service
+Providers.
+
+The Freeside home page is at `http://www.sisd.com/freeside'.
+
+The documentation is in `httemplate/docs'.
+
+A mailing list for users is available. Send a blank message to
+<ivan-freeside-subscribe@sisd.com> to subscribe.
+
+A mailing list for developers is available. It is intended to be lower volume
+and higher SNR than the users list. Send a blank message to
+<ivan-freeside-devel-subscribe@sisd.com> to subscribe.
+
+Commercial support is available from Ivan Kohler <ivan@sisd.com>. Requests for
+free support sent to me directly will be ignored. Please subscribe to the the
+user mailing list to request free support!
+
+Ivan Kohler <ivan-freeside_readme@420.am>
+
diff --git a/README.1.5.0pre1 b/README.1.5.0pre1
new file mode 100644
index 000000000..0de86bce0
--- /dev/null
+++ b/README.1.5.0pre1
@@ -0,0 +1,17 @@
+preliminary upgrade instructions
+
+schema changes:
+ *** get svc_broadband changes from pc-intouch
+ *** otaker changes s/8/32 all otkaer fields
+ *** optional: sequence changes
+ *** add column cust_main_county.taxname
+ *** add column cust_bill_pkg.itemdesc
+ *** drop index cust_bill_pkg1
+ *** add index part_pkg1 and part_svc1
+
+install DBIx::DBSchema 0.21
+install NetAddr::IP
+
+Run dbdef-create
+something about history tables
+Restart apache and freeside-queued
diff --git a/TODO b/TODO
new file mode 100644
index 000000000..4c582c9d7
--- /dev/null
+++ b/TODO
@@ -0,0 +1,9 @@
+$Id: TODO,v 1.68 2002-02-16 18:14:23 ivan Exp $
+
+The TODO list / bug-tracking is now kept in a database. See
+http://pouncequick.420.am/rt/
+
+If you are interested in helping with any of these, please join the
+*development* mailing list (send a blank message to
+ivan-freeside-devel-subscribe@sisd.com) to avoid duplication of effort.
+
diff --git a/bin/apache.export b/bin/apache.export
new file mode 100755
index 000000000..f0a6beefc
--- /dev/null
+++ b/bin/apache.export
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -w
+
+use strict;
+#use File::Path;
+use File::Rsync;
+use Net::SSH qw(ssh);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::cust_svc;
+use FS::svc_www;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+#needs the export number in there somewhere too...?
+my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/apache";
+mkdir $spooldir, 0700 unless -d $spooldir;
+
+my @exports = qsearch('part_export', { 'exporttype' => 'apache' } );
+
+my $rsync = File::Rsync->new({
+ rsh => 'ssh',
+# dry_run => 1,
+});
+
+foreach my $export ( @exports ) {
+
+ my $machine = $export->machine;
+ my $file = "$spooldir/$machine.conf";
+
+ open(HTTPD_CONF,">$file") or die "can't open $file: $!";
+
+ my $template = $export->option('template');
+
+ my @svc_www = $export->svc_x;
+
+ foreach my $svc_www ( @svc_www ) {
+ use vars qw($zone $username);
+ $zone = $svc_www->domain_record->zone;
+ $username = $svc_www->svc_acct->username;
+ print HTTPD_CONF eval(qq("$template")). "\n\n";
+ }
+
+ my $user = $export->option('user');
+ my $httpd_conf = $export->option('httpd_conf');
+
+ $rsync->exec( {
+ src => $file,
+ dest => "$user\@$machine:$httpd_conf",
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+ # warn $rsync->out;
+
+ ssh("root\@$machine", 'apachectl graceful');
+
+}
+
+close HTTPD_CONF;
+
+# -----
+
+sub usage {
+ die "Usage:\n apache.export user\n";
+}
+
diff --git a/bin/bind.export b/bin/bind.export
new file mode 100755
index 000000000..64d44065d
--- /dev/null
+++ b/bin/bind.export
@@ -0,0 +1,190 @@
+#!/usr/bin/perl -w
+
+use strict;
+use File::Path;
+use File::Rsync;
+use Net::SSH qw(ssh);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::cust_pkg;
+use FS::cust_svc;
+use FS::svc_domain;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/bind";
+mkdir $spooldir, 0700 unless -d $spooldir;
+
+my @exports = qsearch('part_export', { 'exporttype' => 'bind' } );
+my @sexports = qsearch('part_export', { 'exporttype' => 'bind_slave' } );
+
+my $rsync = File::Rsync->new({
+ rsh => 'ssh',
+# dry_run => 1,
+});
+
+foreach my $export ( @exports ) {
+
+ my $machine = $export->machine;
+ my $prefix = "$spooldir/$machine";
+
+ my $bind_rel = $export->option('bind_release');
+ my $ndc_cmd = ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc';
+ my $minttl = $export->option('bind9_minttl');
+
+ #prevent old domain files from piling up
+ #rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
+
+ mkdir $prefix, 0700 unless -d $prefix;
+
+ open(NAMED_CONF,">$prefix/named.conf")
+ or die "can't open $prefix/named.conf: $!";
+
+ open(CONF_HEADER,"<$prefix/named.conf.HEADER")
+ or die "can't open $prefix/named.conf.HEADER: $!";
+ while (<CONF_HEADER>) { print NAMED_CONF $_; }
+ close CONF_HEADER;
+
+ my $zonepath = $export->option('zonepath');
+ $zonepath =~ s/\/$//;
+
+ my @svc_domain = $export->svc_x;
+
+ foreach my $svc_domain ( @svc_domain ) {
+ my $domain = $svc_domain->domain;
+ my @masters = qsearch('domain_record', {
+ 'svcnum' => $svc_domain->svcnum,
+ 'rectype' => '_mstr',
+ } );
+ if ( @masters ) {
+ my $masters = join('; ', map { $_->recdata } @masters );
+
+ print NAMED_CONF <<END;
+zone "$domain" {
+ type slave;
+ file "db.$domain";
+ masters { $masters; };
+};
+
+END
+
+ } else {
+
+ print NAMED_CONF <<END;
+zone "$domain" {
+ type master;
+ file "$zonepath/db.$domain";
+};
+
+END
+
+ open (DB_MASTER,">$prefix/db.$domain")
+ or die "can't open $prefix/db.$domain: $!";
+
+ if ($bind_rel eq 'BIND9') {
+ print DB_MASTER "\$TTL $minttl\n\$ORIGIN $domain.\n";
+ }
+
+ my @domain_records =
+ qsearch('domain_record', { 'svcnum' => $svc_domain->svcnum } );
+ foreach my $domain_record (
+ sort { $b->rectype cmp $a->rectype } @domain_records
+ ) {
+ #if ( $domain_record->rectype eq 'SOA' ) {
+ # print DB_MASTER join("\t", $domain_record-> reczone
+ #} else {
+ print DB_MASTER join("\t",
+ map { $domain_record->getfield($_) }
+ qw( reczone recaf rectype recdata )
+ ), "\n";
+ #}
+ }
+
+ close DB_MASTER;
+
+ }
+
+ }
+
+ $rsync->exec( {
+ src => "$prefix/",
+ recursive => 1,
+ dest => "root\@$machine:$zonepath/",
+ exclude => [qw( *.import named.conf.HEADER named.conf )],
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+ # warn $rsync->out;
+
+ $rsync->exec( {
+ src => "$prefix/named.conf",
+ dest => "root\@$machine:". $export->option('named_conf'),
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+# warn $rsync->out;
+
+ ssh("root\@$machine", "$ndc_cmd reload");
+
+}
+
+close NAMED_CONF;
+
+foreach my $sexport ( @sexports ) { #false laziness with above
+
+ my $machine = $sexport->machine;
+ my $prefix = "$spooldir/$machine";
+
+ my $bind_rel = $sexport->option('bind_release');
+ my $ndc_cmd = ($bind_rel eq 'BIND9') ? 'rndc' : 'ndc';
+
+ #prevent old domain files from piling up
+ #rmtree "$prefix" or die "can't rmtree $prefix.db: $!";
+
+ mkdir $prefix, 0700 unless -d $prefix;
+
+ open(NAMED_CONF,">$prefix/named.conf")
+ or die "can't open $prefix/named.conf: $!";
+
+ open(CONF_HEADER,"<$prefix/named.conf.HEADER")
+ or die "can't open $prefix/named.conf.HEADER: $!";
+ while (<CONF_HEADER>) { print NAMED_CONF $_; }
+ close CONF_HEADER;
+
+ my $masters = $sexport->option('master');
+
+ #false laziness with freeside-sqlradius-reset
+ my @svc_domain =
+ map { qsearchs('svc_domain', { 'svcnum' => $_->svcnum } ) }
+ map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) }
+ $sexport->export_svc;
+
+ foreach my $svc_domain ( @svc_domain ) {
+ my $domain = $svc_domain->domain;
+ print NAMED_CONF <<END;
+zone "$domain" {
+ type slave;
+ file "db.$domain";
+ masters { $masters; };
+};
+
+END
+
+ }
+
+ $rsync->exec( {
+ src => "$prefix/named.conf",
+ dest => "root\@$machine:". $sexport->option('named_conf'),
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+# warn $rsync->out;
+
+ ssh("root\@$machine", "$ndc_cmd reload");
+
+}
+close NAMED_CONF;
+
+# -----
+
+sub usage {
+ die "Usage:\n bind.export user\n";
+}
+
diff --git a/bin/bind.import b/bin/bind.import
new file mode 100755
index 000000000..57eca2b63
--- /dev/null
+++ b/bin/bind.import
@@ -0,0 +1,192 @@
+#!/usr/bin/perl -w
+#
+# $Id: bind.import,v 1.3 2002-07-15 01:44:23 ivan Exp $
+
+#need to manually put header in /usr/local/etc/freeside/export.<datasrc./bind/<machine>/named.conf.HEADER
+
+use strict;
+use vars qw( %d_part_svc );
+use Term::Query qw(query);
+#use BIND::Conf_Parser;
+#use DNS::ZoneParse 0.81;
+
+#use Net::SCP qw(iscp);
+use Net::SCP qw(scp);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch); #qsearchs);
+#use FS::svc_acct_sm;
+use FS::svc_domain;
+use FS::domain_record;
+#use FS::svc_acct;
+#use FS::part_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+$FS::svc_Common::noexport_hack = 1;
+$FS::domain_record::noserial_hack = 1;
+
+use vars qw($spooldir);
+$spooldir = "/usr/local/etc/freeside/export.". datasrc. "/bind";
+mkdir $spooldir unless -d $spooldir;
+
+%d_part_svc =
+ map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_domain'});
+
+print "\n\n",
+ ( join "\n", map "$_: ".$d_part_svc{$_}->svc, sort keys %d_part_svc ),
+ "\n\n";
+use vars qw($domain_svcpart);
+$^W=0; #Term::Query isn't -w-safe
+$domain_svcpart =
+ query "Enter part number for domains: ", 'irk', [ keys %d_part_svc ];
+$^W=1;
+
+print "\n\n", <<END;
+Enter the location and name of your primary named.conf file, for example
+"ns.isp.com:/var/named/named.conf"
+END
+my($named_conf)=&getvalue(":");
+
+use vars qw($named_machine $prefix);
+$named_machine = (split(/:/, $named_conf))[0];
+$prefix = "$spooldir/$named_machine";
+mkdir $prefix unless -d $prefix;
+
+#iscp("root\@$named_conf","$prefix/named.conf.import");
+scp("root\@$named_conf","$prefix/named.conf.import");
+
+
+sub getvalue {
+ my $prompt = shift;
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query $prompt, '';
+ $^W=1;
+ $return;
+}
+
+print "\n\n";
+
+##
+
+$FS::svc_domain::whois_hack=1;
+
+my $p = Parser->new;
+$p->parse_file("$prefix/named.conf.import");
+
+print "\nBIND import completed.\n";
+
+##
+
+sub usage {
+ die "Usage:\n\n svc_domain.import user\n";
+}
+
+########
+BEGIN {
+
+ package Parser;
+ use BIND::Conf_Parser;
+ use vars qw(@ISA $named_dir);
+ @ISA = qw(BIND::Conf_Parser);
+
+ sub handle_option {
+ my($self, $option, $argument) = @_;
+ return unless $option eq "directory";
+ $named_dir = $argument;
+ }
+
+ sub handle_zone {
+ my($self, $name, $class, $type, $options) = @_;
+ return unless $class eq 'in';
+ return if grep { $name eq $_ }
+ ( qw( . localhost 127.in-addr.arpa 0.in-addr.arpa 255.in-addr.arpa ) );
+
+ my $domain = new FS::svc_domain( {
+ svcpart => $main::domain_svcpart,
+ domain => $name,
+ action => 'N',
+ } );
+ my $error = $domain->insert;
+ die $error if $error;
+
+ if ( $type eq 'slave' ) {
+
+ #use Data::Dumper;
+ #print Dumper($options);
+ #exit;
+
+ foreach my $master ( @{ $options->{masters} } ) {
+ my $domain_record = new FS::domain_record( {
+ 'svcnum' => $domain->svcnum,
+ 'reczone' => '@',
+ 'recaf' => 'IN',
+ 'rectype' => '_mstr',
+ 'recdata' => $master,
+ } );
+ my $error = $domain_record->insert;
+ die $error if $error;
+ }
+
+ } elsif ( $type eq 'master' ) {
+
+ my $file = $options->{file};
+
+ use File::Basename;
+ my $basefile = basename($file);
+ my $sourcefile = $file;
+ $sourcefile = "$named_dir/$sourcefile" unless $file =~ /^\//;
+ use Net::SCP qw(iscp scp);
+ scp("root\@$main::named_machine:$sourcefile",
+ "$main::prefix/$basefile.import");
+
+ use DNS::ZoneParse 0.81;
+ my $zone = DNS::ZoneParse->new("$main::prefix/$basefile.import");
+
+ my $dump = $zone->Dump;
+
+ #use Data::Dumper;
+ #print "$name: ". Dumper($dump);
+ #exit;
+
+ foreach my $rectype ( keys %$dump ) {
+ if ( $rectype =~ /^SOA$/i ) {
+ my $rec = $dump->{$rectype};
+ my $domain_record = new FS::domain_record( {
+ 'svcnum' => $domain->svcnum,
+ 'reczone' => $rec->{origin},
+ 'recaf' => 'IN',
+ 'rectype' => $rectype,
+ 'recdata' =>
+ $rec->{primary}. ' '. $rec->{email}. ' ( '.
+ join(' ', map $rec->{$_},
+ qw( serial refresh retry expire minimumTTL ) ).
+ ' )',
+ } );
+ my $error = $domain_record->insert;
+ die $error if $error;
+ } else {
+ #die $dump->{$rectype};
+ foreach my $rec ( @{ $dump->{$rectype} } ) {
+ my $domain_record = new FS::domain_record( {
+ 'svcnum' => $domain->svcnum,
+ 'reczone' => $rec->{name},
+ 'recaf' => $rec->{class},
+ 'rectype' => $rectype,
+ 'recdata' => ( $rectype =~ /^MX$/i
+ ? $rec->{priority}. ' '. $rec->{host}
+ : $rec->{host} ),
+ } );
+ my $error = $domain_record->insert;
+ die $error if $error;
+ }
+ }
+ }
+
+ }
+
+ }
+
+}
+#########
+
diff --git a/bin/bsdshell.export b/bin/bsdshell.export
new file mode 100755
index 000000000..6e0d1037e
--- /dev/null
+++ b/bin/bsdshell.export
@@ -0,0 +1,114 @@
+#!/usr/bin/perl -w
+
+# bsdshell export
+
+use strict;
+use File::Rsync;
+use Net::SSH qw(ssh);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::cust_svc;
+use FS::svc_acct;
+
+my @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my $spooldir = "/usr/local/etc/freeside/export.". datasrc;
+#my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/shell";
+
+my @bsd_exports = qsearch('part_export', { 'exporttype' => 'bsdshell' } );
+
+my $rsync = File::Rsync->new({
+ rsh => 'ssh',
+# dry_run => 1,
+});
+
+foreach my $export ( @bsd_exports ) {
+ my $machine = $export->machine;
+ my $prefix = "$spooldir/$machine";
+ mkdir $prefix, 0700 unless -d $prefix;
+
+ #LOCKING!!!
+
+ ( open(MASTER,">$prefix/master.passwd")
+ #!!! and flock(MASTER,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $prefix/master.passwd: $!";
+ ( open(PASSWD,">$prefix/passwd")
+ #!!! and flock(PASSWD,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $prefix/passwd: $!";
+
+ chmod 0644, "$prefix/passwd";
+ chmod 0600, "$prefix/master.passwd";
+
+ my @svc_acct = $export->svc_x;
+
+ next unless @svc_acct;
+
+ foreach my $svc_acct ( sort { $a->uid <=> $b->uid } @svc_acct ) {
+
+ my $password = $svc_acct->_password;
+ my $cpassword;
+ #if ( ( length($password) <= 8 )
+ if ( ( length($password) <= 12 )
+ && ( $password ne '*' )
+ && ( $password ne '!!' )
+ && ( $password ne '' )
+ ) {
+ $cpassword=crypt($password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))]
+ );
+ # MD5 !!!!
+ } else {
+ $cpassword=$password;
+ }
+
+ ###
+ # FORMAT OF THE PASSWD FILE HERE
+ print PASSWD join(":",
+ $svc_acct->username,
+ 'x', # "##". $username,
+ $svc_acct->uid,
+ $svc_acct->gid,
+ $svc_acct->finger,
+ $svc_acct->dir,
+ $svc_acct->shell,
+ ), "\n";
+
+ ###
+ # FORMAT OF FreeBSD MASTER PASSWD FILE HERE
+ print MASTER join(":",
+ $svc_acct->username, # User name
+ $cpassword, # Encrypted password
+ $svc_acct->uid, # User ID
+ $svc_acct->gid, # Group ID
+ "", # Login Class
+ "0", # Password Change Time
+ "0", # Password Expiration Time
+ $svc_acct->finger, # Users name
+ $svc_acct->dir, # Users home directory
+ $svc_acct->shell, # shell
+ ), "\n" ;
+
+ }
+
+ #!!! flock(MASTER,LOCK_UN);
+ #!!! flock(PASSWD,LOCK_UN);
+ close MASTER;
+ close PASSWD;
+
+ $rsync->exec( {
+ src => "$prefix/passwd",
+ dest => "root\@$machine:/etc/passwd"
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+
+ $rsync->exec( {
+ src => "$prefix/master.passwd",
+ dest => "root\@$machine:/etc/master.passwd.new"
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+ ssh("root\@$machine", "pwd_mkdb /etc/master.passwd.new");
+
+ # UNLOCK!!
+}
diff --git a/bin/create-history-tables b/bin/create-history-tables
new file mode 100755
index 000000000..39248bf3f
--- /dev/null
+++ b/bin/create-history-tables
@@ -0,0 +1,93 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use DBI;
+use DBIx::DBSchema 0.21;
+use DBIx::DBSchema::Table;
+use DBIx::DBSchema::Column;
+use DBIx::DBSchema::ColGroup::Unique;
+use DBIx::DBSchema::ColGroup::Index;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(dbdef);
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup $user;
+
+my $schema = dbdef();
+
+#false laziness w/fs-setup
+my @tables = scalar(@ARGV)
+ ? @ARGV
+ : grep { ! /^(h|pg)_/ } $schema->tables;
+foreach my $table ( @tables ) {
+ next if grep { /^h_$table/ } $schema->tables;
+ warn "creating history table for $table\n";
+ my $tableobj = $schema->table($table)
+ or die "unknown table $table (did you run dbdef-create?)\n";
+ my $h_tableobj = DBIx::DBSchema::Table->new( {
+ name => "h_$table",
+ primary_key => 'historynum',
+ unique => DBIx::DBSchema::ColGroup::Unique->new( [] ),
+ 'index' => DBIx::DBSchema::ColGroup::Index->new( [
+ @{$tableobj->unique->lol_ref},
+ @{$tableobj->index->lol_ref}
+ ] ),
+ columns => [
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'historynum',
+ 'type' => 'serial',
+ 'null' => 'NOT NULL',
+ 'length' => '',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_date',
+ 'type' => 'int',
+ 'null' => 'NULL',
+ 'length' => '',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_user',
+ 'type' => 'varchar',
+ 'null' => 'NOT NULL',
+ 'length' => '80',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ DBIx::DBSchema::Column->new( {
+ 'name' => 'history_action',
+ 'type' => 'varchar',
+ 'null' => 'NOT NULL',
+ 'length' => '80',
+ 'default' => '',
+ 'local' => '',
+ } ),
+ map {
+ my $column = $tableobj->column($_);
+ $column->type('int')
+ if $column->type eq 'serial';
+ $column->default('')
+ if $column->default =~ /^nextval\(/i;
+ ( my $local = $column->local ) =~ s/AUTO_INCREMENT//i;
+ $column->local($local);
+ $column;
+ } $tableobj->columns
+ ],
+ } );
+ foreach my $statement ( $h_tableobj->sql_create_table($dbh) ) {
+ $dbh->do( $statement )
+ or die "CREATE error: ". $dbh->errstr. "\ndoing statement: $statement";
+ }
+
+}
+
+$dbh->commit or die $dbh->errstr;
+$dbh->disconnect or die $dbh->errstr;
+
+sub usage {
+ die "Usage:\n create-history-tables user [ table table ... ] \n";
+}
+
diff --git a/bin/dbdef-create b/bin/dbdef-create
new file mode 100755
index 000000000..c977f876e
--- /dev/null
+++ b/bin/dbdef-create
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: dbdef-create,v 1.6 2002-09-19 13:34:52 ivan Exp $
+
+use strict;
+use DBI;
+use DBIx::DBSchema 0.21;
+use FS::UID qw(adminsuidsetup datasrc driver_name);
+
+my $user = shift or die &usage;
+
+my($dbh)=adminsuidsetup $user;
+
+#needs to match FS::Record
+my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc;
+
+my $dbdef = new_native DBIx::DBSchema $dbh;
+
+#print $dbdef->pretty_print;
+
+#important
+$dbdef->save($dbdef_file);
+
+sub usage {
+ die "Usage:\n dbdef-create user\n";
+}
diff --git a/bin/fix-sequences b/bin/fix-sequences
new file mode 100755
index 000000000..2ff89d3e5
--- /dev/null
+++ b/bin/fix-sequences
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -Tw
+
+# run dbdef-create first!
+
+use strict;
+use DBI;
+use DBIx::DBSchema 0.21;
+use DBIx::DBSchema::Table;
+use DBIx::DBSchema::Column;
+use DBIx::DBSchema::ColGroup::Unique;
+use DBIx::DBSchema::ColGroup::Index;
+use FS::UID qw(adminsuidsetup driver_name);
+use FS::Record qw(dbdef);
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup $user;
+
+my $schema = dbdef();
+
+#false laziness w/fs-setup
+my @tables = scalar(@ARGV)
+ ? @ARGV
+ : grep { ! /^h_/ } $schema->tables;
+foreach my $table ( @tables ) {
+ my $tableobj = $schema->table($table)
+ or die "unknown table $table (did you run dbdef-create?)\n";
+
+ my $primary_key = $tableobj->primary_key;
+ next unless $primary_key;
+
+ my $col = $tableobj->column($primary_key);
+
+
+ next unless uc($col->type) eq 'SERIAL'
+ || ( driver_name eq 'Pg'
+ && defined($col->default)
+ && $col->default =~ /^nextval\(/i
+ )
+ || ( driver_name eq 'mysql'
+ && defined($col->local)
+ && $col->local =~ /AUTO_INCREMENT/i
+ );
+
+ my $seq = "${table}_${primary_key}_seq";
+ if ( driver_name eq 'Pg'
+ && defined($col->default)
+ && $col->default =~ /^nextval\('"(public\.)?(\w+_seq)"'::text\)$/
+ ) {
+ $seq = $2;
+ }
+
+ warn "fixing sequence for $table\n";
+
+
+ my $sql = "SELECT setval( '$seq',
+ ( SELECT max($primary_key) FROM $table ) );";
+
+ #warn $col->default. " $seq\n$sql\n";
+ $dbh->do( $sql ) or die $dbh->errstr;
+
+}
+
+$dbh->commit or die $dbh->errstr;
+$dbh->disconnect or die $dbh->errstr;
+
+sub usage {
+ die "Usage:\n fix-sequences user [ table table ... ] \n";
+}
+
diff --git a/bin/freeside-init b/bin/freeside-init
new file mode 100755
index 000000000..fe12931fc
--- /dev/null
+++ b/bin/freeside-init
@@ -0,0 +1,60 @@
+#! /bin/sh
+#
+# start the freeside job queue daemon
+
+#PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/local/bin/freeside-queued
+NAME=freeside-queued
+DESC="freeside job queue daemon"
+USER="ivan"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+# start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid -b -m\
+# --exec $DAEMON
+ $DAEMON $USER &
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON
+ echo "$NAME."
+ rm /var/run/$NAME.pid
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its config files on the fly
+ # for example by sending it SIGHUP, do it here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this a do-nothing entry.
+ #
+ # echo "Reloading $DESC configuration files."
+ # start-stop-daemon --stop --signal 1 --quiet --pidfile \
+ # /var/run/$NAME.pid --exec $DAEMON
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/bin/freeside-session-kill b/bin/freeside-session-kill
new file mode 100755
index 000000000..d5fd703f6
--- /dev/null
+++ b/bin/freeside-session-kill
@@ -0,0 +1,103 @@
+#!/usr/bin/perl -w
+
+use strict;
+use vars qw($conf);
+use Fcntl qw(:flock);
+use FS::UID qw(adminsuidsetup datasrc dbh);
+use FS::Record qw(dbdef qsearch fields);
+use FS::session;
+use FS::svc_acct;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my $sessionlock = "/usr/local/etc/freeside/session-kill.lock.". datasrc;
+
+open(LOCK,"+>>$sessionlock") or die "Can't open $sessionlock: $!";
+select(LOCK); $|=1; select(STDOUT);
+unless ( flock(LOCK,LOCK_EX|LOCK_NB) ) {
+ seek(LOCK,0,0);
+ my($pid)=<LOCK>;
+ chop($pid);
+ #no reason to start loct of blocking processes
+ die "Is another session kill process running under pid $pid?\n";
+}
+seek(LOCK,0,0);
+print LOCK $$,"\n";
+
+$FS::UID::AutoCommit = 0;
+
+my $now = time;
+
+#uhhhhh
+
+use DBIx::DBSchema;
+use DBIx::DBSchema::Table; #down this path lies madness
+use DBIx::DBSchema::Column;
+
+my $dbdef = dbdef or die;
+#warn $dbdef;
+#warn $dbdef->{'tables'};
+#warn keys %{$dbdef->{'tables'}};
+my $session_table = $dbdef->table('session') or die;
+my $svc_acct_table = $dbdef->table('svc_acct') or die;
+
+my $session_svc_acct = new DBIx::DBSchema::Table ( 'session,svc_acct', '', '', '',
+ map( DBIx::DBSchema::Column->new( "session.$_",
+ $session_table->column($_)->type,
+ $session_table->column($_)->null,
+ $session_table->column($_)->length,
+ ), $session_table->columns() ),
+ map( DBIx::DBSchema::Column->new( "svc_acct.$_",
+ $svc_acct_table->column($_)->type,
+ $svc_acct_table->column($_)->null,
+ $svc_acct_table->column($_)->length,
+ ), $svc_acct_table->columns ),
+# map("svc_acct.$_", $svc_acct_table->columns),
+);
+
+$dbdef->addtable($session_svc_acct); #madness, i tell you
+
+$FS::Record::DEBUG = 1;
+my @session = qsearch('session,svc_acct', {}, '', ' WHERE '. join(' AND ',
+ 'svc_acct.svcnum = session.svcnum',
+ '( session.logout IS NULL OR session.logout = 0 )',
+ "( $now - session.login ) >= svc_acct.seconds"
+). " FOR UPDATE" );
+
+my $dbh = dbh;
+
+foreach my $join ( @session ) {
+
+ my $session = new FS::session ( {
+ map { $_ => $join->{'Hash'}{"session.$_"} } fields('session')
+ } ); #see no evil
+
+ my $svc_acct = new FS::svc_acct ( {
+ map { $_ => $join->{'Hash'}{"svc_acct.$_"} } fields('svc_acct')
+ } );
+
+ #false laziness w/ fs_session_server
+ my $nsession = new FS::session ( { $session->hash } );
+ my $error = $nsession->replace($session);
+ if ( $error ) {
+ $dbh->rollback;
+ die $error;
+ }
+ my $time = $nsession->logout - $nsession->login;
+ my $new_svc_acct = new FS::svc_acct ( { $svc_acct->hash } );
+ my $seconds = $new_svc_acct->seconds;
+ $seconds -= $time;
+ $seconds = 0 if $seconds < 0;
+ $new_svc_acct->seconds( $seconds );
+ $error = $new_svc_acct->replace( $svc_acct );
+ warn "can't debit time from ". $svc_acct->username. ": $error\n"; #don't want to rollback, though
+ #ssenizal eslaf
+
+}
+
+$dbh->commit or die $dbh->errstr;
+
+sub usage {
+ die "Usage:\n\n freeside-session-kill user\n";
+}
diff --git a/bin/fs-migrate-part_svc b/bin/fs-migrate-part_svc
new file mode 100755
index 000000000..b0f3ac57e
--- /dev/null
+++ b/bin/fs-migrate-part_svc
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch fields);
+use FS::part_svc;
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup $user;
+
+my $oldAutoCommit = $FS::UID::AutoCommit;
+local $FS::UID::AutoCommit = 0;
+
+foreach my $part_svc ( qsearch('part_svc', {} ) ) {
+ foreach my $field (
+ grep { defined($part_svc->getfield($part_svc->svcdb.'__'.$_.'_flag') ) }
+ fields($part_svc->svcdb)
+ ) {
+ my $flag = $part_svc->getfield($part_svc->svcdb.'__'.$field.'_flag');
+ if ( uc($flag) =~ /^([DF])$/ ) {
+ my $part_svc_column = new FS::part_svc_column {
+ 'svcpart' => $part_svc->svcpart,
+ 'columnname' => $field,
+ 'columnflag' => $1,
+ 'columnvalue' => $part_svc->getfield($part_svc->svcdb.'__'.$field),
+ };
+ my $error = $part_svc_column->insert;
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ die $error;
+ }
+ }
+ }
+}
+
+$dbh->commit or die $dbh->errstr;
+
+sub usage {
+ die "Usage:\n fs-migrate-part_svc user\n";
+}
+
diff --git a/bin/fs-migrate-payref b/bin/fs-migrate-payref
new file mode 100755
index 000000000..158419706
--- /dev/null
+++ b/bin/fs-migrate-payref
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::cust_pay;
+use FS::cust_refund;
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup $user;
+
+# apply payments to invoices
+
+foreach my $cust_pay ( qsearch('cust_pay', {} ) ) {
+ my $error = $cust_pay->upgrade_replace;
+ warn $error if $error;
+}
+
+# apply refunds to credits
+
+foreach my $cust_refund ( qsearch('cust_refund') ) {
+ my $error = $cust_refund->upgrade_replace;
+ warn $error if $error;
+}
+
+# ? apply credits to invoices
+
+sub usage {
+ die "Usage:\n fs-migrate-payref user\n";
+}
+
diff --git a/bin/fs-migrate-svc_acct_sm b/bin/fs-migrate-svc_acct_sm
new file mode 100755
index 000000000..e34b23596
--- /dev/null
+++ b/bin/fs-migrate-svc_acct_sm
@@ -0,0 +1,229 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: fs-migrate-svc_acct_sm,v 1.4 2002-06-21 09:13:16 ivan Exp $
+#
+# jeff@cmh.net 01-Jul-20
+
+#to delay loading dbdef until we're ready
+#BEGIN { $FS::Record::setup_hack = 1; }
+
+use strict;
+use Term::Query qw(query);
+#use DBI;
+#use DBIx::DBSchema;
+#use DBIx::DBSchema::Table;
+#use DBIx::DBSchema::Column;
+#use DBIx::DBSchema::ColGroup::Unique;
+#use DBIx::DBSchema::ColGroup::Index;
+use FS::Conf;
+use FS::UID qw(adminsuidsetup datasrc checkeuid getsecrets);
+use FS::Record qw(qsearch qsearchs);
+use FS::svc_domain;
+use FS::svc_forward;
+use vars qw( $conf $old_default_domain %part_domain_svc %part_acct_svc %part_forward_svc $svc_acct $svc_acct_sm $error);
+
+die "Not running uid freeside!" unless checkeuid();
+
+my $user = shift or die &usage;
+getsecrets($user);
+
+$conf = new FS::Conf;
+$old_default_domain = $conf->config('domain');
+
+#needs to match FS::Record
+#my($dbdef_file) = "/usr/local/etc/freeside/dbdef.". datasrc;
+
+###
+# This section would be the appropriate place to manipulate
+# the schema & tables.
+###
+
+## we need to add the domsvc to svc_acct
+## we must add a svc_forward record....
+## I am thinking that the fields svcnum (int), destsvc (int), and
+## dest (varchar (80)) are appropriate, with destsvc/dest an either/or
+## much in the spirit of cust_main_invoice
+
+###
+# massage the data
+###
+
+my($dbh)=adminsuidsetup $user;
+
+$|=1;
+
+$FS::svc_Common::noexport_hack = 1;
+$FS::svc_domain::whois_hack = 1;
+
+%part_domain_svc=map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_domain'});
+%part_acct_svc=map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_acct'});
+%part_forward_svc=map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_forward'});
+
+die "No services with svcdb svc_domain!\n" unless %part_domain_svc;
+die "No services with svcdb svc_acct!\n" unless %part_acct_svc;
+die "No services with svcdb svc_forward!\n" unless %part_forward_svc;
+
+my($svc_domain) = qsearchs('svc_domain', { 'domain' => $old_default_domain });
+if (! $svc_domain || $svc_domain->domain != $old_default_domain) {
+ print <<EOF;
+
+Your database currently does not contain a svc_domain record for the
+domain $old_default_domain. Would you like me to add one for you?
+EOF
+
+ my($response)=scalar(<STDIN>);
+ chop $response;
+ if ($response =~ /^[yY]/) {
+ print "\n\n", &menu_domain_svc, "\n", <<END;
+I need to create new domain accounts. Which service shall I use for that?
+END
+ my($domain_svcpart)=&getdomainpart;
+
+ $svc_domain = new FS::svc_domain {
+ 'domain' => $old_default_domain,
+ 'svcpart' => $domain_svcpart,
+ 'action' => 'M',
+ };
+# $error=$svc_domain->insert && die "Error adding domain $old_default_domain: $error";
+ $error=$svc_domain->insert;
+ die "Error adding domain $old_default_domain: $error" if $error;
+ }else{
+ print <<EOF;
+
+ This program cannot function properly until a svc_domain record matching
+your conf_dir/domain file exists.
+EOF
+
+ exit 1;
+ }
+}
+
+print "\n\n", &menu_acct_svc, "\n", <<END;
+I may need to create some new pop accounts and set up forwarding to them
+for some users. Which service shall I use for that?
+END
+my($pop_svcpart)=&getacctpart;
+
+print "\n\n", &menu_forward_svc, "\n", <<END;
+I may need to create some new forwarding for some users. Which service
+shall I use for that?
+END
+my($forward_svcpart)=&getforwardpart;
+
+sub menu_domain_svc {
+ ( join "\n", map "$_: ".$part_domain_svc{$_}->svc, sort keys %part_domain_svc ). "\n";
+}
+sub menu_acct_svc {
+ ( join "\n", map "$_: ".$part_acct_svc{$_}->svc, sort keys %part_acct_svc ). "\n";
+}
+sub menu_forward_svc {
+ ( join "\n", map "$_: ".$part_forward_svc{$_}->svc, sort keys %part_forward_svc ). "\n";
+}
+sub getdomainpart {
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query "Enter part number:", 'irk', [ keys %part_domain_svc ];
+ $^W=1;
+ $return;
+}
+sub getacctpart {
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query "Enter part number:", 'irk', [ keys %part_acct_svc ];
+ $^W=1;
+ $return;
+}
+sub getforwardpart {
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query "Enter part number:", 'irk', [ keys %part_forward_svc ];
+ $^W=1;
+ $return;
+}
+
+
+#migrate data
+
+my(@svc_accts) = qsearch('svc_acct', {});
+foreach $svc_acct (@svc_accts) {
+ my(@svc_acct_sms) = qsearch('svc_acct_sm', {
+ domuid => $svc_acct->getfield('uid'),
+ }
+ );
+
+ # Ok.. we've got the svc_acct record, and an array of svc_acct_sm's
+ # What do we do from here?
+
+ # The intuitive:
+ # plop the svc_acct into the 'default domain'
+ # and then represent the svc_acct_sm's with svc_forwards
+ # they can be gussied up manually, later
+ #
+ # Perhaps better:
+ # when no svc_acct_sm exists, place svc_acct in 'default domain'
+ # when one svc_acct_sm exists, place svc_acct in corresponding
+ # domain & possibly create a svc_forward in 'default domain'
+ # when multiple svc_acct_sm's exists (in different domains) we'd
+ # better use the 'intuitive' approach.
+ #
+ # Specific way:
+ # as 'perhaps better,' but we may be able to guess which domain
+ # is correct by comparing the svcnum of domains to the username
+ # of the svc_acct
+ #
+
+ # The intuitive way:
+
+ my $def_acct = new FS::svc_acct ( { $svc_acct->hash } );
+ $def_acct->setfield('domsvc' => $svc_domain->getfield('svcnum'));
+ $error = $def_acct->replace($svc_acct);
+ die "Error replacing svc_acct for " . $def_acct->username . " : $error" if $error;
+
+ foreach $svc_acct_sm (@svc_acct_sms) {
+
+ my($domrec)=qsearchs('svc_domain', {
+ svcnum => $svc_acct_sm->getfield('domsvc'),
+ }) || die "svc_acct_sm references invalid domsvc $svc_acct_sm->getfield('domsvc')\n";
+
+ if ($svc_acct_sm->getfield('domuser') =~ /^\*$/) {
+
+ my($newdom) = new FS::svc_domain ( { $domrec->hash } );
+ $newdom->setfield('catchall', $svc_acct->svcnum);
+ $newdom->setfield('action', "M");
+ $error = $newdom->replace($domrec);
+ die "Error replacing svc_domain for (anything)@" . $domrec->domain . " : $error" if $error;
+
+ } else {
+
+ my($newacct) = new FS::svc_acct {
+ 'svcpart' => $pop_svcpart,
+ 'username' => $svc_acct_sm->getfield('domuser'),
+ 'domsvc' => $svc_acct_sm->getfield('domsvc'),
+ 'dir' => '/dev/null',
+ };
+ $error = $newacct->insert;
+ die "Error adding svc_acct for " . $newacct->username . " : $error" if $error;
+
+ my($newforward) = new FS::svc_forward {
+ 'svcpart' => $forward_svcpart,
+ 'srcsvc' => $newacct->getfield('svcnum'),
+ 'dstsvc' => $def_acct->getfield('svcnum'),
+ };
+ $error = $newforward->insert;
+ die "Error adding svc_forward for " . $newacct->username ." : $error" if $error;
+ }
+
+ $error = $svc_acct_sm->delete;
+ die "Error deleting svc_acct_sm for " . $svc_acct_sm->domuser ." : $error" if $error;
+
+ };
+
+};
+
+
+$dbh->commit or die $dbh->errstr;
+$dbh->disconnect or die $dbh->errstr;
+
+print "svc_acct_sm records sucessfully migrated\n";
+
+sub usage {
+ die "Usage:\n fs-migrate-svc_acct_sm user\n";
+}
+
diff --git a/bin/fs-radius-add-check b/bin/fs-radius-add-check
new file mode 100755
index 000000000..4e4769e58
--- /dev/null
+++ b/bin/fs-radius-add-check
@@ -0,0 +1,68 @@
+#!/usr/bin/perl -Tw
+
+# quick'n'dirty hack of fs-setup to add radius attributes
+
+use strict;
+use DBI;
+use FS::UID qw(adminsuidsetup checkeuid getsecrets);
+use FS::raddb;
+
+die "Not running uid freeside!" unless checkeuid();
+
+my %attrib2db =
+ map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
+
+my $user = shift or die &usage;
+getsecrets($user);
+
+my $dbh = adminsuidsetup $user;
+
+###
+
+print "\n\n", <<END, ":";
+Enter the additional RADIUS check attributes you need to track for
+each user, separated by whitespace.
+END
+my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
+ split(" ",&getvalue);
+
+sub getvalue {
+ my($x)=scalar(<STDIN>);
+ chop $x;
+ $x;
+}
+
+###
+
+my($char_d) = 80; #default maxlength for text fields
+
+###
+
+foreach my $attribute ( @attributes ) {
+
+ my $statement =
+ "ALTER TABLE svc_acct ADD COLUMN rc_$attribute varchar($char_d) NULL";
+ my $sth = $dbh->prepare( $statement )
+ or warn "Error preparing $statement: ". $dbh->errstr;
+ my $rc = $sth->execute
+ or warn "Error executing $statement: ". $sth->errstr;
+
+ $statement =
+ "ALTER TABLE h_svc_acct ADD COLUMN rc_$attribute varchar($char_d) NULL";
+ $sth = $dbh->prepare( $statement )
+ or warn "Error preparing $statement: ". $dbh->errstr;
+ $rc = $sth->execute
+ or warn "Error executing $statement: ". $sth->errstr;
+
+}
+
+$dbh->commit or die $dbh->errstr;
+
+$dbh->disconnect or die $dbh->errstr;
+
+print "\n\n", "Now you must run dbdef-create.\n\n";
+
+sub usage {
+ die "Usage:\n fs-radius-add-check user\n";
+}
+
diff --git a/bin/fs-radius-add-reply b/bin/fs-radius-add-reply
new file mode 100755
index 000000000..3de01374f
--- /dev/null
+++ b/bin/fs-radius-add-reply
@@ -0,0 +1,69 @@
+#!/usr/bin/perl -Tw
+
+# quick'n'dirty hack of fs-setup to add radius attributes
+
+use strict;
+use DBI;
+use FS::UID qw(adminsuidsetup checkeuid getsecrets);
+use FS::raddb;
+
+die "Not running uid freeside!" unless checkeuid();
+
+my %attrib2db =
+ map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
+
+my $user = shift or die &usage;
+getsecrets($user);
+
+my $dbh = adminsuidsetup $user;
+
+###
+
+print "\n\n", <<END, ":";
+Enter the additional RADIUS reply attributes you need to track for
+each user, separated by whitespace.
+END
+my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
+ split(" ",&getvalue);
+
+sub getvalue {
+ my($x)=scalar(<STDIN>);
+ chop $x;
+ $x;
+}
+
+###
+
+my($char_d) = 80; #default maxlength for text fields
+
+###
+
+foreach my $attribute ( @attributes ) {
+
+ my $statement =
+ "ALTER TABLE svc_acct ADD COLUMN radius_$attribute varchar($char_d) NULL";
+ my $sth = $dbh->prepare( $statement )
+ or warn "Error preparing $statement: ". $dbh->errstr;
+ my $rc = $sth->execute
+ or warn "Error executing $statement: ". $sth->errstr;
+
+ $statement =
+ "ALTER TABLE h_svc_acct ADD COLUMN radius_$attribute varchar($char_d) NULL";
+ $sth = $dbh->prepare( $statement )
+ or warn "Error preparing $statement: ". $dbh->errstr;
+ $rc = $sth->execute
+ or warn "Error executing $statement: ". $sth->errstr;
+
+}
+
+$dbh->commit or die $dbh->errstr;
+
+$dbh->disconnect or die $dbh->errstr;
+
+print "\n\n", "Now you must run dbdef-create.\n\n";
+
+sub usage {
+ die "Usage:\n fs-radius-add-reply user\n";
+}
+
+
diff --git a/bin/generate-prepay b/bin/generate-prepay
new file mode 100755
index 000000000..cb4ba7fc6
--- /dev/null
+++ b/bin/generate-prepay
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::prepay_credit;
+
+require 5.004; #srand(time|$$);
+
+my $user = shift or die &usage;
+&adminsuidsetup( $user );
+
+my $amount = shift or die &usage;
+
+my $seconds = shift or die &usage;
+
+my $num_digits = shift or die &usage;
+
+my $num_entries = shift or die &usage;
+
+for ( 1 .. $num_entries ) {
+ my $identifier = join( '', map int(rand(10)), ( 1 .. $num_digits ) );
+ my $prepay_credit = new FS::prepay_credit {
+ 'identifier' => $identifier,
+ 'amount' => $amount,
+ 'seconds' => $seconds,
+ };
+ my $error = $prepay_credit->insert;
+ die $error if $error;
+ print "$identifier\n";
+}
+
+sub usage {
+ die "Usage:\n\n generate-prepay user amount seconds num_digits num_entries";
+}
+
diff --git a/bin/generate-raddb b/bin/generate-raddb
new file mode 100755
index 000000000..1d0053a2b
--- /dev/null
+++ b/bin/generate-raddb
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+
+# usage: generate-raddb radius-server/raddb/dictionary* >raddb.pm
+# i.e.: generate-raddb ~/src/freeradius-0.2/raddb/dictionary* >FS/raddb.pm
+
+print <<END;
+package FS::raddb;
+use vars qw(%attrib);
+
+%attrib = (
+END
+
+while (<>) {
+ next if /^(#|\s*$|\$INCLUDE\s+)/;
+ next if /^(VALUE|VENDOR|BEGIN\-VENDOR|END\-VENDOR)\s+/;
+ /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-]+)\s+/ or die $_;
+ $attrib = $2;
+ $dbname = lc($2);
+ $dbname =~ s/\-/_/g;
+ $hash{$dbname} = $attrib;
+ #print "$2\n";
+}
+
+foreach ( keys %hash ) {
+# print "$_\n" if length($_)>24;
+# print substr($_,0,24),"\n" if length($_)>24;
+# $max = length($_) if length($_)>$max;
+#everything >24 is still unique, at least with freeradius comprehensive dataset
+ print " '". substr($_,0,24). "' => '$hash{$_}',\n";
+}
+
+print <<END;
+);
+
+1;
+END
+
diff --git a/bin/generate-tests b/bin/generate-tests
new file mode 100755
index 000000000..73fd29ecb
--- /dev/null
+++ b/bin/generate-tests
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+@files = glob('FS/*.pm');
+foreach (@files) {
+# warn $_;
+ chomp;
+ s/^FS\///;
+ $f=$_;
+ $f=~s/pm$/t/;
+ $m=$_;
+ $m=~s/\.pm$//;
+ open(TEST,">t/$f");
+ print "t/$f\n";
+ print TEST
+ 'BEGIN { $| = 1; print "1..1\n" }'. "\n".
+ 'END {print "not ok 1\n" unless $loaded;}'. "\n".
+ "use FS::$m;\n".
+ '$loaded=1;'. "\n".
+ 'print "ok 1\n";'. "\n"
+ ;
+ close TEST;
+}
diff --git a/bin/masonize b/bin/masonize
new file mode 100755
index 000000000..475c9a6bf
--- /dev/null
+++ b/bin/masonize
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+foreach $file ( split(/\n/, `find . -depth -print | grep cgi\$`) ) {
+ open(F,$file) or die "can't open $file for reading: $!";
+ @file = <F>;
+ #print "$file ". scalar(@file). "\n";
+ close $file;
+ system("chmod u+w $file");
+ open(W,">$file") or die "can't open $file for writing: $!";
+ select W; $| = 1; select STDOUT;
+ $all = join('',@file);
+
+ $mode = 'html';
+ while ( length($all) ) {
+
+ if ( $mode eq 'html' ) {
+
+ if ( $all =~ /^(.+?)(<%=?.*)$/s && $1 !~ /<%/s ) {
+ print W $1;
+ $all = $2;
+ next;
+ } elsif ( $all =~ /^<%=(.*)$/s ) {
+ print W '<%';
+ $all = $1;
+ $mode = 'perlv';
+ #die;
+ next;
+ } elsif ( $all =~ /^<%(.*)$/s ) {
+ print W "\n";
+ $all = $1;
+ $mode = 'perlc';
+ next;
+ } elsif ( $all !~ /<%/s ) {
+ print W $all;
+ last;
+ } else {
+ warn length($all); die;
+ }
+ die;
+
+ } elsif ( $mode eq 'perlv' ) {
+
+ if ( $all =~ /^(.*?%>)(.*)$/s ) {
+ print W $1;
+ $all=$2;
+ $mode = 'html';
+ next;
+ }
+ die 'unterminated <%= ???';
+
+ } elsif ( $mode eq 'perlc' ) {
+
+ if ( $all =~ /^([^\n]*?)%>(.*)$/s ) {
+ print W "%$1\n";
+ $all=$2;
+ $mode='html';
+ next;
+ }
+ if ( $all =~ /^([^\n]*)\n(.*)$/s ) {
+ print W "%$1\n";
+ $all=$2;
+ next;
+ }
+
+ } else { die };
+
+ }
+
+ close W;
+}
diff --git a/bin/passwd.import b/bin/passwd.import
new file mode 100755
index 000000000..093f8bafd
--- /dev/null
+++ b/bin/passwd.import
@@ -0,0 +1,120 @@
+#!/usr/bin/perl -Tw
+# $Id: passwd.import,v 1.8 2003-06-12 14:08:00 ivan Exp $
+
+use strict;
+use vars qw(%part_svc);
+use Date::Parse;
+use Term::Query qw(query);
+use Net::SCP qw(iscp);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::svc_acct;
+use FS::part_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+push @FS::svc_acct::shells, qw(/bin/sync /sbin/shutdown /bin/halt /sbin/halt); #others?
+
+my($spooldir)="/usr/local/etc/freeside/export.". datasrc;
+
+#$FS::svc_acct::nossh_hack = 1;
+$FS::svc_Common::noexport_hack = 1;
+
+###
+
+%part_svc=map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_acct'});
+
+die "No services with svcdb svc_acct!\n" unless %part_svc;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Enter part number to import.
+END
+my($shell_svcpart)=&getpart;
+
+print "\n\n", <<END;
+Enter the location and name of your _user_ passwd file, for example
+"mail.isp.com:/etc/passwd" or "nis.isp.com:/etc/global/passwd"
+END
+my($loc_passwd)=&getvalue(":");
+iscp("root\@$loc_passwd", "$spooldir/passwd.import");
+
+print "\n\n", <<END;
+Enter the location and name of your _user_ shadow file, for example
+"mail.isp.com:/etc/shadow" or "bsd.isp.com:/etc/master.passwd"
+END
+my($loc_shadow)=&getvalue(":");
+iscp("root\@$loc_shadow", "$spooldir/shadow.import");
+
+sub menu_svc {
+ ( join "\n", map "$_: ".$part_svc{$_}->svc, sort keys %part_svc ). "\n";
+}
+sub getpart {
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query "Enter part number:", 'irk', [ keys %part_svc ];
+ $^W=1;
+ $return;
+}
+sub getvalue {
+ my $prompt = shift;
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query $prompt, '';
+ $^W=1;
+ $return;
+}
+
+print "\n\n";
+
+###
+
+open(PASSWD,"<$spooldir/passwd.import");
+open(SHADOW,"<$spooldir/shadow.import");
+
+my(%password);
+while (<SHADOW>) {
+ chop;
+ my($username,$password)=split(/:/);
+ #$password =~ s/^\!$/\*/;
+ #$password =~ s/\!+/\*SUSPENDED\* /;
+ $password{$username}=$password;
+}
+
+while (<PASSWD>) {
+ chop;
+ my($username,$x,$uid,$gid,$finger,$dir,$shell) = split(/:/);
+ my $password = $password{$username};
+
+ my $svcpart = $shell_svcpart;
+
+ #if ( qsearchs('svc_acct', { 'username' => $username } ) ) {
+ # warn "warning: $username already exists; skipping\n";
+ # next;
+ #}
+
+ my($svc_acct) = new FS::svc_acct ({
+ 'svcpart' => $svcpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'uid' => $uid,
+ 'gid' => $gid,
+ 'finger' => $finger,
+ 'dir' => $dir,
+ 'shell' => $shell,
+ #%{$allparam{$username}},
+ });
+ my($error);
+ $error=$svc_acct->insert;
+ if ( $error ) {
+ if ( $error =~ /duplicate/i ) {
+ warn "$username: $error";
+ } else {
+ die "$username: $error";
+ }
+ }
+
+}
+
+sub usage {
+ die "Usage:\n\n passwd.import user\n";
+}
+
diff --git a/bin/pod2x b/bin/pod2x
new file mode 100755
index 000000000..46ccc7743
--- /dev/null
+++ b/bin/pod2x
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+
+#use Pod::Text;
+#$Pod::Text::termcap=1;
+
+my $site_perl = "./FS";
+#my $catman = "./catman";
+#my $catman = "./htdocs/docs/man";
+#my $html = "./htdocs/docs/man";
+my $html = "./httemplate/docs/man";
+
+$|=1;
+
+die "Can't find $site_perl" unless -d $site_perl;
+#die "Can't find $catman" unless -d $catman;
+die "Can't find $html" unless -d $html;
+
+#make some useless links
+foreach my $file (
+ glob("$site_perl/bin/freeside-*"),
+) {
+ next if $file =~ /\.pod$/;
+ #symlink $file, "$file.pod"; # or die "link $file to $file.pod: $!";
+ system("cp $file $file.pod");
+}
+
+foreach my $file (
+ glob("$site_perl/*.pm"),
+ glob("$site_perl/*/*.pm"),
+ glob("$site_perl/*/*/*.pm"),
+ glob("$site_perl/bin/*.pod"),
+ glob("./fs_sesmon/FS-SessionClient/*.pm"),
+ glob("./fs_signup/FS-SignupClient/*.pm"),
+ glob("./fs_selfadmin/FS-MailAdminServer/*.pm"),
+) {
+ next if $file =~ /(^|\/)blib\//;
+ #$file =~ /\/([\w\-]+)\.pm$/ or die "oops file $file";
+ my $name;
+ if ( $file =~ /fs_\w+\/FS\-\w+\/(.*)\.pm$/ ) {
+ $name = "FS/$1";
+ } elsif ( $file =~ /$site_perl\/(.*)\.(pm|pod)$/ ) {
+ $name = $1;
+ } else {
+ die "oops file $file";
+ }
+ print "$name\n";
+ my $htmlroot = join('/', map '..',1..(scalar($file =~ tr/\///)-2)) || '.';
+# system "pod2text $file >$catman/$name.txt";
+ system "pod2html --podroot=$site_perl --podpath=./FS:./FS/UI:.:./bin --norecurse --htmlroot=$htmlroot $file >$html/$name.html";
+ #system "pod2html --podroot=$site_perl --htmlroot=$htmlroot $file >$html/$name.html";
+# system "pod2html $file >$html/$name.html";
+}
+
+#remove the useless links
+unlink glob("$site_perl/bin/*.pod");
+
diff --git a/bin/populate-msgcat b/bin/populate-msgcat
new file mode 100755
index 000000000..719d33046
--- /dev/null
+++ b/bin/populate-msgcat
@@ -0,0 +1,127 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+use FS::msgcat;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+foreach my $del_msgcat ( qsearch('msgcat', {}) ) {
+ my $error = $del_msgcat->delete;
+ die $error if $error;
+}
+
+my %messages = messages();
+
+foreach my $msgcode ( keys %messages ) {
+ foreach my $locale ( keys %{$messages{$msgcode}} ) {
+ my $msgcat = new FS::msgcat( {
+ 'msgcode' => $msgcode,
+ 'locale' => $locale,
+ 'msg' => $messages{$msgcode}{$locale},
+ });
+ my $error = $msgcat->insert;
+ die $error if $error;
+ }
+}
+
+#print "Message catalog initialized sucessfully\n";
+
+sub messages {
+
+ # 'msgcode' => {
+ # 'en_US' => 'Message',
+ # },
+
+ (
+
+ 'passwords_dont_match' => {
+ 'en_US' => "Passwords don't match",
+ },
+
+ 'invalid_card' => {
+ 'en_US' => 'Invalid credit card number',
+ },
+
+ 'unknown_card_type' => {
+ 'en_US' => 'Unknown card type',
+ },
+
+ 'not_a' => {
+ 'en_US' => 'Not a ',
+ },
+
+ 'empty_password' => {
+ 'en_US' => 'Empty password',
+ },
+
+ 'no_access_number_selected' => {
+ 'en_US' => 'No access number selected',
+ },
+
+ 'illegal_text' => {
+ 'en_US' => 'Illegal (text)',
+ #'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in field',
+ },
+
+ 'illegal_or_empty_text' => {
+ 'en_US' => 'Illegal or empty (text)',
+ #'en_US' => 'Only letters, numbers, spaces, and the following punctuation symbols are permitted: ! @ # $ % & ( ) - + ; : \' " , . ? / in required field',
+ },
+
+ 'illegal_username' => {
+ 'en_US' => 'Illegal username',
+ },
+
+ 'illegal_password' => {
+ 'en_US' => 'Illegal password (',
+ },
+
+ 'illegal_password_characters' => {
+ 'en_US' => ' characters)',
+ },
+
+ 'username_in_use' => {
+ 'en_US' => 'Username in use',
+ },
+
+ 'illegal_email_invoice_address' => {
+ 'en_US' => 'Illegal email invoice address',
+ },
+
+ 'illegal_name' => {
+ 'en_US' => 'Illegal (name)',
+ #'en_US' => 'Only letters, numbers, spaces and the following punctuation symbols are permitted: , . - \' in field',
+ },
+
+ 'illegal_phone' => {
+ 'en_US' => 'Illegal (phone)',
+ #'en_US' => '',
+ },
+
+ 'illegal_zip' => {
+ 'en_US' => 'Illegal (zip)',
+ #'en_US' => '',
+ },
+
+ 'expired_card' => {
+ 'en_US' => 'Expired card',
+ },
+
+ 'daytime' => {
+ 'en_US' => 'Day Phone',
+ },
+
+ 'night' => {
+ 'en_US' => 'Night Phone',
+ },
+
+ );
+}
+
+sub usage {
+ die "Usage:\n\n populate-msgcat user\n";
+}
+
diff --git a/bin/svc_acct.export b/bin/svc_acct.export
new file mode 100755
index 000000000..0bc370fc0
--- /dev/null
+++ b/bin/svc_acct.export
@@ -0,0 +1,641 @@
+#!/usr/bin/perl -w
+#
+# $Id: svc_acct.export,v 1.36 2002-05-16 14:28:35 ivan Exp $
+#
+# Create and export password, radius and vpopmail password files:
+# passwd, passwd.adjunct, shadow, acp_passwd, acp_userinfo, acp_dialup
+# users/assign, domains/vdomain/vpasswd
+# Also export sendmail and qmail config files.
+
+use strict;
+use vars qw($conf);
+use Fcntl qw(:flock);
+use File::Path;
+use IO::Handle;
+use FS::Conf;
+use Net::SSH qw(ssh);
+use Net::SCP qw(scp);
+use FS::UID qw(adminsuidsetup datasrc dbh);
+use FS::Record qw(qsearch qsearchs fields);
+use FS::svc_acct;
+use FS::svc_domain;
+use FS::svc_forward;
+
+my $ssh='ssh';
+my $rsync='rsync';
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+$conf = new FS::Conf;
+
+my $userpolicy = $conf->config('username_policy')
+ if $conf->exists('username_policy');
+
+my @shellmachines = $conf->config('shellmachines')
+ if $conf->exists('shellmachines');
+
+my @bsdshellmachines = $conf->config('bsdshellmachines')
+ if $conf->exists('bsdshellmachines');
+
+my @nismachines = $conf->config('nismachines')
+ if $conf->exists('nismachines');
+
+my @erpcdmachines = $conf->config('erpcdmachines')
+ if $conf->exists('erpcdmachines');
+
+my @radiusmachines = $conf->config('radiusmachines')
+ if $conf->exists('radiusmachines');
+
+my $textradiusprepend =
+ $conf->exists('textradiusprepend')
+ ? $conf->config('textradiusprepend')
+ : '';
+
+warn "using depriciated textradiusprepend file" if $textradiusprepend;
+
+
+my $radiusprepend =
+ $conf->exists('radiusprepend')
+ ? join("\n", $conf->config('radiusprepend'))
+ : '';
+
+my @vpopmailmachines = $conf->config('vpopmailmachines')
+ if $conf->exists('vpopmailmachines');
+my $vpopmailrestart = '';
+$vpopmailrestart = $conf->config('vpopmailrestart')
+ if $conf->exists('vpopmailrestart');
+
+my ($machine, $vpopdir, $vpopuid, $vpopgid) = split (/\s+/, $vpopmailmachines[0]) if $vpopmailmachines[0];
+
+my($shellmachine, @qmailmachines);
+if ( $conf->exists('qmailmachines') ) {
+ $shellmachine = $conf->config('shellmachine');
+ @qmailmachines = $conf->config('qmailmachines');
+}
+
+my(@sendmailmachines, $sendmailconfigpath, $sendmailrestart);
+if ( $conf->exists('sendmailmachines') ) {
+ @sendmailmachines = $conf->config('sendmailmachines');
+ $sendmailconfigpath = $conf->config('sendmailconfigpath') || '/etc';
+ $sendmailrestart = $conf->config('sendmailrestart');
+}
+
+my $mydomain = $conf->config('domain') if $conf->exists('domain');
+
+
+
+
+my(@saltset)= ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+require 5.004; #srand(time|$$);
+
+my $spooldir = "/usr/local/etc/freeside/export.". datasrc;
+my $spoollock = "/usr/local/etc/freeside/svc_acct.export.lock.". datasrc;
+
+open(EXPORT,"+>>$spoollock") or die "Can't open $spoollock: $!";
+select(EXPORT); $|=1; select(STDOUT);
+unless ( flock(EXPORT,LOCK_EX|LOCK_NB) ) {
+ seek(EXPORT,0,0);
+ my($pid)=<EXPORT>;
+ chop($pid);
+ #no reason to start lots of blocking processes
+ die "Is another export process running under pid $pid?\n";
+}
+seek(EXPORT,0,0);
+print EXPORT $$,"\n";
+
+my(@svc_domain)=qsearch('svc_domain',{});
+
+( open(MASTER,">$spooldir/master.passwd")
+ and flock(MASTER,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/.master.passwd: $!";
+( open(PASSWD,">$spooldir/passwd")
+ and flock(PASSWD,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/passwd: $!";
+( open(SHADOW,">$spooldir/shadow")
+ and flock(SHADOW,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/shadow: $!";
+( open(ACP_PASSWD,">$spooldir/acp_passwd")
+ and flock(ACP_PASSWD,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/acp_passwd: $!";
+( open(ACP_DIALUP,">$spooldir/acp_dialup")
+ and flock(ACP_DIALUP,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/acp_dialup: $!";
+( open(USERS,">$spooldir/users")
+ and flock(USERS,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/users: $!";
+
+( open(ASSIGN,">$spooldir/assign")
+ and flock(ASSIGN,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/assign: $!";
+( open(RCPTHOSTS,">$spooldir/rcpthosts")
+ and flock(RCPTHOSTS,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/rcpthosts: $!";
+( open(VPOPRCPTHOSTS,">$spooldir/vpoprcpthosts")
+ and flock(VPOPRCPTHOSTS,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/rcpthosts: $!";
+( open(RECIPIENTMAP,">$spooldir/recipientmap")
+ and flock(RECIPIENTMAP,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/recipientmap: $!";
+( open(VIRTUALDOMAINS,">$spooldir/virtualdomains")
+ and flock(VIRTUALDOMAINS,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/virtualdomains: $!";
+( open(VPOPVIRTUALDOMAINS,">$spooldir/vpopvirtualdomains")
+ and flock(VPOPVIRTUALDOMAINS,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/virtualdomains: $!";
+( open(VIRTUSERTABLE,">$spooldir/virtusertable")
+ and flock(VIRTUSERTABLE,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/virtusertable: $!";
+( open(SENDMAIL_CW,">$spooldir/sendmail.cw")
+ and flock(SENDMAIL_CW,LOCK_EX|LOCK_NB)
+) or die "Can't open $spooldir/sendmail.cw: $!";
+
+
+
+chmod 0644, "$spooldir/passwd",
+ "$spooldir/acp_dialup",
+ "$spooldir/assign",
+ "$spooldir/sendmail.cw",
+ "$spooldir/virtusertable",
+ "$spooldir/rcpthosts",
+ "$spooldir/vpoprcpthosts",
+ "$spooldir/recipientmap",
+ "$spooldir/virtualdomains",
+ "$spooldir/vpopvirtualdomains",
+
+;
+chmod 0600, "$spooldir/master.passwd",
+ "$spooldir/acp_passwd",
+ "$spooldir/shadow",
+ "$spooldir/users",
+;
+
+rmtree"$spooldir/domains", 0, 1;
+mkdir "$spooldir/domains", 0700;
+
+setpriority(0,0,10);
+
+print USERS "$radiusprepend\n";
+
+my %usernames; ## this hack helps keep the passwd files sane
+my @sendmail;
+
+my $svc_domain;
+foreach $svc_domain (sort {$a->domain cmp $b->domain} @svc_domain) {
+
+ my($domain)=$svc_domain->domain;
+ print RCPTHOSTS "$domain\n.$domain\n";
+ print VPOPRCPTHOSTS "$domain\n";
+ print SENDMAIL_CW "$domain\n";
+
+ ###
+ # FORMAT OF THE ASSIGN/USERS FILE HERE
+ print ASSIGN join(":",
+ "+" . $domain . "-",
+ $domain,
+ $vpopuid,
+ $vpopgid,
+ $vpopdir . "/domains/" . $domain,
+ "-",
+ "",
+ "",
+ ), "\n" if $vpopmailmachines[0];
+
+ (mkdir "$spooldir/domains/" . $domain, 0700)
+ or die "Can't create $spooldir/domains/" . $domain .": $!";
+
+ ( open(QMAILDEFAULT,">$spooldir/domains/" . $domain . "/.qmail-default")
+ and flock(QMAILDEFAULT,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $spooldir/domains/" . $domain . "/.qmail-default: $!";
+
+ ( open(VPASSWD,">$spooldir/domains/" . $domain . "/vpasswd")
+ and flock(VPASSWD,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $spooldir/domains/" . $domain . "/vpasswd: $!";
+
+ my ($svc_acct);
+
+ if ($svc_domain->getfield('catchall')) {
+ $svc_acct = qsearchs('svc_acct', {'svcnum' => $svc_domain->catchall});
+ die "Cannot find catchall account for domain $domain\n" unless $svc_acct;
+
+ my $username = $svc_acct->username;
+ push @sendmail, "\@$domain\t$username\n";
+ print VIRTUALDOMAINS "$domain:$username-$domain\n",
+ ".$domain:$username-$domain\n",
+ ;
+
+ ###
+ # FORMAT OF THE .QMAIL-DEFAULT FILE HERE
+ print QMAILDEFAULT "| $vpopdir/bin/vdelivermail \"\" " . $svc_acct->email . "\n"
+ if $vpopmailmachines[0];
+
+ }else{
+ ###
+ # FORMAT OF THE .QMAIL-DEFAULT FILE HERE
+ print QMAILDEFAULT "| $vpopdir/bin/vdelivermail \"\" bounce-no-mailbox\n"
+ if $vpopmailmachines[0];
+ }
+
+ print VPOPVIRTUALDOMAINS "$domain:$domain\n";
+
+ foreach $svc_acct (qsearch('svc_acct', {'domsvc' => $svc_domain->svcnum})) {
+ my($password)=$svc_acct->getfield('_password');
+ my($cpassword,$rpassword);
+ #if ( ( length($password) <= 8 )
+ if ( ( length($password) <= 12 )
+ && ( $password ne '*' )
+ && ( $password ne '!!' )
+ && ( $password ne '' )
+ ) {
+ $cpassword=crypt($password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))]
+ );
+ $rpassword=$password;
+ } else {
+ $cpassword=$password;
+ $rpassword='UNIX';
+ }
+
+ my $username;
+
+ if ($mydomain && ($mydomain eq $svc_domain->domain)) {
+ $username=$svc_acct->username;
+ } elsif ($userpolicy =~ /^prepend domsvc$/) {
+ $username=$svc_acct->domsvc . $svc_acct->username;
+ } elsif ($userpolicy =~ /^append domsvc$/) {
+ $username=$svc_acct->username . $svc_acct->domsvc;
+ } elsif ($userpolicy =~ /^append domain$/) {
+ $username=$svc_acct->username . $svc_domain->domain;
+ } elsif ($userpolicy =~ /^append domain$/) {
+ $username=$svc_acct->username . $svc_domain->domain;
+ } elsif ($userpolicy =~ /^append \@domain$/) {
+ $username=$svc_acct->username . '@'. $svc_domain->domain;
+ } else {
+ die "Unknown policy in username_policy\n";
+ }
+
+ if ($svc_acct->dir ne '/dev/null' || $svc_acct->slipip ne '') {
+ if ($usernames{$username}++) {
+ die "Duplicate username detected: $username\n";
+ }
+ }
+
+ if ( $svc_acct->uid =~ /^(\d+)$/ ) {
+
+ die "Non-root user ". $svc_acct->username. " has 0 UID!"
+ if $svc_acct->uid == 0 && $svc_acct->username ne 'root';
+
+ if ( $svc_acct->dir ne "/dev/null") {
+
+ ###
+ # FORMAT OF FreeBSD MASTER PASSWD FILE HERE
+ print MASTER join(":",
+ $username, # User name
+ $cpassword, # Encrypted password
+ $svc_acct->uid, # User ID
+ $svc_acct->gid, # Group ID
+ "", # Login Class
+ "0", # Password Change Time
+ "0", # Password Expiration Time
+ $svc_acct->finger, # Users name
+ $svc_acct->dir, # Users home directory
+ $svc_acct->shell, # shell
+ ), "\n" ;
+
+
+ ###
+ # FORMAT OF THE PASSWD FILE HERE
+ print PASSWD join(":",
+ $username,
+ 'x', # "##". $username,
+ $svc_acct->uid,
+ $svc_acct->gid,
+ $svc_acct->finger,
+ $svc_acct->dir,
+ $svc_acct->shell,
+ ), "\n";
+
+ ###
+ # FORMAT OF THE SHADOW FILE HERE
+ print SHADOW join(":",
+ $username,
+ $cpassword,
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ ), "\n";
+ }
+ }
+
+ ###
+ # FORMAT OF THE VPASSWD FILE HERE
+ print VPASSWD join(":",
+ $svc_acct->username,
+ $cpassword,
+ '1',
+ '0',
+ $svc_acct->username,
+ "$vpopdir/domains/" . $svc_domain->domain ."/" . $svc_acct->username,
+ 'NOQUOTA',
+ ), "\n";
+
+
+ if ( $svc_acct->slipip ne '' ) {
+
+ ###
+ # FORMAT OF THE ACP_* FILES HERE
+ print ACP_PASSWD join(":",
+ $username,
+ $cpassword,
+ "0",
+ "0",
+ "",
+ "",
+ "",
+ ), "\n";
+
+ my($ip)=$svc_acct->slipip;
+
+ unless ( $ip eq '0.0.0.0' || $svc_acct->slipip eq '0e0' ) {
+ print ACP_DIALUP $username, "\t*\t", $svc_acct->slipip, "\n";
+ }
+
+ my %radreply = $svc_acct->radius_reply;
+ my %radcheck = $svc_acct->radius_check;
+
+ my $radcheck = join ", ", map { qq($_ = "$radcheck{$_}") } keys %radcheck;
+ $radcheck .= ", " if $radcheck;
+
+ ###
+ # FORMAT OF THE USERS FILE HERE
+ print USERS
+ $username,
+ qq(\t${textradiusprepend}),
+ $radcheck,
+# qq(Password = "$rpassword"\n\t),
+ join ",\n\t", map { qq($_ = "$radreply{$_}") } keys %radreply;
+
+ #if ( $ip && $ip ne '0e0' ) {
+ # #print USERS qq(,\n\tFramed-Address = "$ip"\n\n);
+ # print USERS qq(,\n\tFramed-IP-Address = "$ip"\n\n);
+ #} else {
+ print USERS qq(\n\n);
+ #}
+
+ }
+
+ ###
+ # vpopmail directory structure creation
+
+ (mkdir "$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username, 0700)
+ or die "Can't create $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . ": $!";
+ (mkdir "$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/Maildir", 0700)
+ or die "Can't create $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . " /Maildir: $!";
+ (mkdir "$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/Maildir/cur", 0700)
+ or die "Can't create $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . " /Maildir/cur: $!";
+ (mkdir "$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/Maildir/new", 0700)
+ or die "Can't create $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . " /Maildir/new: $!";
+ (mkdir "$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/Maildir/tmp", 0700)
+ or die "Can't create $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . " /Maildir/tmp: $!";
+
+ ( open(DOTQMAIL,">$spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/.qmail")
+ and flock(DOTQMAIL,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $spooldir/domains/" . $svc_domain->domain . "/" . $svc_acct->username . "/.qmail: $!";
+
+ my($svc_forward);
+ foreach $svc_forward (qsearch('svc_forward', {'srcsvc' => $svc_acct->svcnum})) {
+ my($destination);
+ if ($svc_forward->dstsvc) {
+ my $dst_acct = qsearchs('svc_acct', {'svcnum' => $svc_forward->dstsvc});
+ my $dst_domain = qsearchs('svc_domain', {'svcnum' => $dst_acct->domsvc});
+ $destination = $dst_acct->username . '@' . $dst_domain->domain;
+
+ if ($dst_domain->domain eq $mydomain) {
+ print VIRTUSERTABLE $svc_acct->username . "@" . $svc_domain->domain .
+ "\t" . $dst_acct->username . "\n";
+ print RECIPIENTMAP $svc_acct->username . "@" . $svc_domain->domain .
+ ":$destination\n";
+ }
+ } else {
+ $destination = $svc_forward->dst;
+ }
+
+ ###
+ # FORMAT OF .QMAIL FILES HERE
+ print DOTQMAIL "$destination\n";
+ }
+
+ flock(DOTQMAIL,LOCK_UN);
+ close DOTQMAIL;
+
+ }
+
+ flock(VPASSWD,LOCK_UN);
+ flock(QMAILDEFAULT,LOCK_UN);
+ close VPASSWD;
+ close QMAILDEFAULT;
+
+}
+
+###
+# FORMAT OF THE ASSIGN/USERS FILE FINAL LINE HERE
+print ASSIGN ".\n";
+
+print VIRTUSERTABLE @sendmail;
+
+flock(MASTER,LOCK_UN);
+flock(PASSWD,LOCK_UN);
+flock(SHADOW,LOCK_UN);
+flock(ACP_DIALUP,LOCK_UN);
+flock(ACP_PASSWD,LOCK_UN);
+flock(USERS,LOCK_UN);
+flock(ASSIGN,LOCK_UN);
+flock(SENDMAIL_CW,LOCK_UN);
+flock(VIRTUSERTABLE,LOCK_UN);
+flock(RCPTHOSTS,LOCK_UN);
+flock(VPOPRCPTHOSTS,LOCK_UN);
+flock(RECIPIENTMAP,LOCK_UN);
+flock(VPOPVIRTUALDOMAINS,LOCK_UN);
+
+close MASTER;
+close PASSWD;
+close SHADOW;
+close ACP_DIALUP;
+close ACP_PASSWD;
+close USERS;
+close ASSIGN;
+close SENDMAIL_CW;
+close VIRTUSERTABLE;
+close RCPTHOSTS;
+close VPOPRCPTHOSTS;
+close RECIPIENTMAP;
+close VPOPVIRTUALDOMAINS;
+
+###
+# export stuff
+#
+
+my($ashellmachine);
+foreach $ashellmachine (@shellmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/passwd","root\@$ashellmachine:/etc/passwd.new")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/shadow","root\@$ashellmachine:/etc/shadow.new")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$ashellmachine",
+ "( ".
+ "mv /etc/passwd.new /etc/passwd; ".
+ "mv /etc/shadow.new /etc/shadow; ".
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+my($bsdshellmachine);
+foreach $bsdshellmachine (@bsdshellmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/passwd","root\@$bsdshellmachine:/etc/passwd.new")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/master.passwd","root\@$bsdshellmachine:/etc/master.passwd.new")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$bsdshellmachine",
+ "( ".
+ "mv /etc/passwd.new /etc/passwd; ".
+ #"mv /etc/master.passwd.new /etc/master.passwd; ".
+ "pwd_mkdb /etc/master.passwd.new; ".
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+my($nismachine);
+foreach $nismachine (@nismachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/passwd","root\@$nismachine:/etc/global/passwd")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/shadow","root\@$nismachine:/etc/global/shadow")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$nismachine",
+ "( ".
+ "cd /var/yp; make; ".
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+my($erpcdmachine);
+foreach $erpcdmachine (@erpcdmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/acp_passwd","root\@$erpcdmachine:/usr/annex/acp_passwd")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/acp_dialup","root\@$erpcdmachine:/usr/annex/acp_dialup")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$erpcdmachine",
+ "( ".
+ "kill -USR1 \`cat /usr/annex/erpcd.pid\'".
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+my($radiusmachine);
+foreach $radiusmachine (@radiusmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/users","root\@$radiusmachine:/etc/raddb/users")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$radiusmachine",
+ "( ".
+ "builddbm".
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+#my @args = ("/bin/tar", "c", "--force-local", "-C", "$spooldir", "-f", "$spooldir/vpoptarball", "domains");
+
+#system {$args[0]} @args;
+
+my($vpopmailmachine);
+foreach $vpopmailmachine (@vpopmailmachines) {
+ my ($machine, $vpopdir, $vpopuid, $vpopgid) = split (/\s+/, $vpopmailmachine);
+ my $scp = new Net::SCP;
+# $scp->scp("$spooldir/vpoptarball","root\@$machine:vpoptarball")
+# or die "scp error: ". $scp->{errstr};
+# ssh("root\@$machine",
+# "( ".
+# "rm -rf domains; ".
+# "tar xf vpoptarball; ".
+# "chown -R $vpopuid:$vpopgid domains; ".
+# "tar cf vpoptarball domains; ".
+# "cd $vpopdir; ".
+# "tar xf ~/vpoptarball; ".
+# " )"
+# )
+# == 0 or die "ssh error: $!";
+
+ chdir $spooldir;
+ my @args = ("$rsync", "-rlpt", "-e", "$ssh", "domains/", "vpopmail\@$machine:$vpopdir/domains/");
+
+ system {$args[0]} @args;
+
+ $scp->scp("$spooldir/assign","root\@$machine:/var/qmail/users/assign")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/vpopvirtualdomains","root\@$machine:/var/qmail/control/virtualdomains")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/vpoprcpthosts","root\@$machine:/var/qmail/control/rcpthosts")
+ or die "scp error: ". $scp->{errstr};
+
+ ssh("root\@$machine",
+ "( ".
+ $vpopmailrestart .
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+
+
+}
+
+my($sendmailmachine);
+foreach $sendmailmachine (@sendmailmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/sendmail.cw","root\@$sendmailmachine:$sendmailconfigpath/sendmail.cw.new")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/virtusertable","root\@$sendmailmachine:$sendmailconfigpath/virtusertable.new")
+ or die "scp error: ". $scp->{errstr};
+ ssh("root\@$sendmailmachine",
+ "( ".
+ "mv $sendmailconfigpath/sendmail.cw.new $sendmailconfigpath/sendmail.cw; ".
+ "mv $sendmailconfigpath/virtusertable.new $sendmailconfigpath/virtusertable; ".
+ $sendmailrestart.
+ " )"
+ )
+ == 0 or die "ssh error: $!";
+}
+
+my($qmailmachine);
+foreach $qmailmachine (@qmailmachines) {
+ my $scp = new Net::SCP;
+ $scp->scp("$spooldir/recipientmap","root\@$qmailmachine:/var/qmail/control/recipientmap")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/virtualdomains","root\@$qmailmachine:/var/qmail/control/virtualdomains")
+ or die "scp error: ". $scp->{errstr};
+ $scp->scp("$spooldir/rcpthosts","root\@$qmailmachine:/var/qmail/control/rcpthosts")
+ or die "scp error: ". $scp->{errstr};
+ #ssh("root\@$qmailmachine","/etc/init.d/qmail restart")
+ # == 0 or die "ssh error: $!";
+}
+
+unlink $spoollock;
+flock(EXPORT,LOCK_UN);
+close EXPORT;
+
+#
+
+sub usage {
+ die "Usage:\n\n svc_acct.export user\n";
+}
+
diff --git a/bin/svc_acct.import b/bin/svc_acct.import
new file mode 100755
index 000000000..eb94e1c37
--- /dev/null
+++ b/bin/svc_acct.import
@@ -0,0 +1,238 @@
+#!/usr/bin/perl -Tw
+# $Id: svc_acct.import,v 1.17 2001-08-19 10:25:44 ivan Exp $
+
+use strict;
+use vars qw(%part_svc);
+use Date::Parse;
+use Term::Query qw(query);
+use Net::SCP qw(iscp);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch);
+use FS::svc_acct;
+use FS::part_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+push @FS::svc_acct::shells, qw(/bin/sync /sbin/shuddown /bin/halt); #others?
+
+my($spooldir)="/usr/local/etc/freeside/export.". datasrc;
+
+$FS::svc_acct::nossh_hack = 1;
+
+###
+
+%part_svc=map { $_->svcpart, $_ } qsearch('part_svc',{'svcdb'=>'svc_acct'});
+
+die "No services with svcdb svc_acct!\n" unless %part_svc;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Most accounts probably have entries in passwd and users (with Port-Limit
+nonexistant or 1).
+END
+my($ppp_svcpart)=&getpart;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Some accounts have entries in passwd and users, but with Port-Limit 2 (or
+more).
+END
+my($isdn_svcpart)=&getpart;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Some accounts might have entries in users only (Port-Limit 1)
+END
+my($oppp_svcpart)=&getpart;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Some accounts might have entries in users only (Port-Limit >= 2)
+END
+my($oisdn_svcpart)=&getpart;
+
+print "\n\n", &menu_svc, "\n", <<END;
+POP mail accounts have entries in passwd only, and have a particular shell.
+END
+my($pop_shell)=&getvalue("Enter that shell:");
+my($popmail_svcpart)=&getpart;
+
+print "\n\n", &menu_svc, "\n", <<END;
+Everything else in passwd is a shell account.
+END
+my($shell_svcpart)=&getpart;
+
+print "\n\n", <<END;
+Enter the location and name of your _user_ passwd file, for example
+"mail.isp.com:/etc/passwd" or "nis.isp.com:/etc/global/passwd"
+END
+my($loc_passwd)=&getvalue(":");
+iscp("root\@$loc_passwd", "$spooldir/passwd.import");
+
+print "\n\n", <<END;
+Enter the location and name of your _user_ shadow file, for example
+"mail.isp.com:/etc/shadow" or "bsd.isp.com:/etc/master.passwd"
+END
+my($loc_shadow)=&getvalue(":");
+iscp("root\@$loc_shadow", "$spooldir/shadow.import");
+
+print "\n\n", <<END;
+Enter the location and name of your radius "users" file, for example
+"radius.isp.com:/etc/raddb/users"
+END
+my($loc_users)=&getvalue(":");
+iscp("root\@$loc_users", "$spooldir/users.import");
+
+sub menu_svc {
+ ( join "\n", map "$_: ".$part_svc{$_}->svc, sort keys %part_svc ). "\n";
+}
+sub getpart {
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query "Enter part number:", 'irk', [ keys %part_svc ];
+ $^W=1;
+ $return;
+}
+sub getvalue {
+ my $prompt = shift;
+ $^W=0; # Term::Query isn't -w-safe
+ my $return = query $prompt, '';
+ $^W=1;
+ $return;
+}
+
+print "\n\n";
+
+###
+
+open(PASSWD,"<$spooldir/passwd.import");
+open(SHADOW,"<$spooldir/shadow.import");
+open(USERS,"<$spooldir/users.import");
+
+my(%upassword,%ip,%allparam);
+my(%param,$username);
+while (<USERS>) {
+ chop;
+ next if /^\s*$/;
+ next if /^\s*#/;
+ if ( /^\S/ ) {
+ /^(\w+)\s+(Auth-Type\s+=\s+Local,\s+)?Password\s+=\s+"([^"]+)"(,\s+Expiration\s+=\s+"([^"]*")\s*)?$/
+ or die "1Unexpected line in users.import: $_";
+ my($password,$expiration);
+ ($username,$password,$expiration)=(lc($1),$3,$5);
+ $password = '' if $password eq 'UNIX';
+ $upassword{$username}=$password;
+ undef %param;
+ } else {
+ die "2Unexpected line in users.import: $_";
+ }
+ while (<USERS>) {
+ chop;
+ if ( /^\s*$/ ) {
+ if ( defined $param{'radius_Framed_IP_Address'} ) {
+ $ip{$username} = $param{'radius_Framed_IP_Address'};
+ delete $param{'radius_Framed_IP_Address'};
+ } else {
+ $ip{$username} = '0e0';
+ }
+ $allparam{$username}={ %param };
+ last;
+ } elsif ( /^\s+([\w\-]+)\s=\s"?([\w\.\-\s]+)"?,?\s*$/ ) {
+ my($attribute,$value)=($1,$2);
+ $attribute =~ s/\-/_/g;
+ $param{'radius_'.$attribute}=$value;
+ } else {
+ die "3Unexpected line in users.import: $_";
+ }
+ }
+}
+#? incase there isn't a terminating blank line ?
+if ( defined $param{'radius_Framed_IP_Address'} ) {
+ $ip{$username} = $param{'radius_Framed_IP_Address'};
+ delete $param{'radius_Framed_IP_Address'};
+} else {
+ $ip{$username} = '0e0';
+}
+$allparam{$username}={ %param };
+
+my(%password);
+while (<SHADOW>) {
+ chop;
+ my($username,$password)=split(/:/);
+ #$password =~ s/^\!$/\*/;
+ #$password =~ s/\!+/\*SUSPENDED\* /;
+ $password{$username}=$password;
+}
+
+while (<PASSWD>) {
+ chop;
+ my($username,$x,$uid,$gid,$finger,$dir,$shell)=split(/:/);
+ my($password)=$upassword{$username} || $password{$username};
+
+ my($maxb)=${$allparam{$username}}{'radius_Port_Limit'};
+ my($svcpart);
+ if ( exists $upassword{$username} ) {
+ if ( $maxb >= 2 ) {
+ $svcpart = $isdn_svcpart
+ } elsif ( ! $maxb || $maxb == 1 ) {
+ $svcpart = $ppp_svcpart
+ } else {
+ die "Illegal Port-Limit in users ($username)!\n";
+ }
+ } elsif ( $shell eq $pop_shell ) {
+ $svcpart = $popmail_svcpart;
+ } else {
+ $svcpart = $shell_svcpart;
+ }
+
+ my($svc_acct) = new FS::svc_acct ({
+ 'svcpart' => $svcpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'uid' => $uid,
+ 'gid' => $gid,
+ 'finger' => $finger,
+ 'dir' => $dir,
+ 'shell' => $shell,
+ 'slipip' => $ip{$username},
+ %{$allparam{$username}},
+ });
+ my($error);
+ $error=$svc_acct->insert;
+ die $error if $error;
+
+ delete $allparam{$username};
+ delete $upassword{$username};
+}
+
+#my($username);
+foreach $username ( keys %upassword ) {
+ my($password)=$upassword{$username};
+
+ my($maxb)=${$allparam{$username}}{'radius_Port_Limit'} || 0;
+ my($svcpart);
+ if ( $maxb == 2 ) {
+ $svcpart = $oisdn_svcpart
+ } elsif ( ! $maxb || $maxb == 1 ) {
+ $svcpart = $oppp_svcpart
+ } else {
+ die "Illegal Port-Limit in users!\n";
+ }
+
+ my($svc_acct) = new FS::svc_acct ({
+ 'svcpart' => $svcpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'slipip' => $ip{$username},
+ %{$allparam{$username}},
+ });
+ my($error);
+ $error=$svc_acct->insert;
+ die $error, if $error;
+
+ delete $allparam{$username};
+ delete $upassword{$username};
+}
+
+#
+
+sub usage {
+ die "Usage:\n\n svc_acct.import user\n";
+}
+
diff --git a/bin/svc_domain.erase b/bin/svc_domain.erase
new file mode 100755
index 000000000..c0236614b
--- /dev/null
+++ b/bin/svc_domain.erase
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+#
+# $Id: svc_domain.erase,v 1.1 2002-04-20 11:57:35 ivan Exp $
+
+use strict;
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearch);
+
+use FS::domain_record;
+use FS::svc_domain;
+
+adminsuidsetup(shift @ARGV) or die "Usage: svc_domain.erase user\n";
+
+foreach my $record ( qsearch('domain_record',{}), qsearch('svc_domain', {} ) ) {
+ my $error = $record->delete;
+ die $error if $error;
+}
diff --git a/bin/sysvshell.export b/bin/sysvshell.export
new file mode 100755
index 000000000..c13912c3f
--- /dev/null
+++ b/bin/sysvshell.export
@@ -0,0 +1,112 @@
+#!/usr/bin/perl -w
+
+# sysvshell export
+
+use strict;
+use File::Rsync;
+use Net::SSH qw(ssh);
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(qsearch qsearchs);
+use FS::part_export;
+use FS::cust_svc;
+use FS::svc_acct;
+
+my @saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my $spooldir = "/usr/local/etc/freeside/export.". datasrc;
+#my $spooldir = "/usr/local/etc/freeside/export.". datasrc. "/shell";
+
+my @sysv_exports = qsearch('part_export', { 'exporttype' => 'sysvshell' } );
+
+my $rsync = File::Rsync->new({
+ rsh => 'ssh',
+# dry_run => 1,
+});
+
+foreach my $export ( @sysv_exports ) {
+ my $machine = $export->machine;
+ my $prefix = "$spooldir/$machine";
+ mkdir $prefix, 0700 unless -d $prefix;
+
+ #LOCKING!!!
+
+ ( open(SHADOW,">$prefix/shadow")
+ #!!! and flock(SHADOW,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $prefix/shadow: $!";
+ ( open(PASSWD,">$prefix/passwd")
+ #!!! and flock(PASSWD,LOCK_EX|LOCK_NB)
+ ) or die "Can't open $prefix/passwd: $!";
+
+ chmod 0644, "$prefix/passwd";
+ chmod 0600, "$prefix/shadow";
+
+ my @svc_acct = $export->svc_x;
+
+ next unless @svc_acct;
+
+ foreach my $svc_acct ( sort { $a->uid <=> $b->uid } @svc_acct ) {
+
+ my $password = $svc_acct->_password;
+ my $cpassword;
+ #if ( ( length($password) <= 8 )
+ if ( ( length($password) <= 12 )
+ && ( $password ne '*' )
+ && ( $password ne '!!' )
+ && ( $password ne '' )
+ ) {
+ $cpassword=crypt($password,
+ $saltset[int(rand(64))].$saltset[int(rand(64))]
+ );
+ # MD5 !!!!
+ } else {
+ $cpassword=$password;
+ }
+
+ ###
+ # FORMAT OF THE PASSWD FILE HERE
+ print PASSWD join(":",
+ $svc_acct->username,
+ 'x', # "##". $username,
+ $svc_acct->uid,
+ $svc_acct->gid,
+ $svc_acct->finger,
+ $svc_acct->dir,
+ $svc_acct->shell,
+ ), "\n";
+
+ ###
+ # FORMAT OF THE SHADOW FILE HERE
+ print SHADOW join(":",
+ $svc_acct->username,
+ $cpassword,
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ ), "\n";
+
+ }
+
+ #!!! flock(SHADOW,LOCK_UN);
+ #!!! flock(PASSWD,LOCK_UN);
+ close SHADOW;
+ close PASSWD;
+
+ $rsync->exec( {
+ src => "$prefix/shadow",
+ dest => "root\@$machine:/etc/shadow"
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+
+ $rsync->exec( {
+ src => "$prefix/passwd",
+ dest => "root\@$machine:/etc/passwd"
+ } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err);
+
+ # UNLOCK!!
+}
diff --git a/conf/agent_defaultpkg b/conf/agent_defaultpkg
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/conf/agent_defaultpkg
diff --git a/conf/alerter_template b/conf/alerter_template
new file mode 100644
index 000000000..4d8a012ef
--- /dev/null
+++ b/conf/alerter_template
@@ -0,0 +1,20 @@
+
+
+Ivan Kohler
+1339 Hayes St.
+San Francisco, CA 94117
+
+
+{ $first; } { $last; }:
+
+ We thank you for your continuing patronage. This notice is to remind you
+that your { $payby } used to pay SISD.COM for Internet
+service will expire on { use Date::Format; time2str("%x", $expdate); }. Please provide us with new billing
+information so that we may continue your service uninterrupted.
+
+Very Truly Yours,
+
+ SISD Service Team
+
+
+
diff --git a/conf/declinetemplate b/conf/declinetemplate
new file mode 100644
index 000000000..14b8c60ec
--- /dev/null
+++ b/conf/declinetemplate
@@ -0,0 +1,10 @@
+Hi,
+
+Your credit card could not be processed for the following reason:
+ { $error }
+
+Please provide us with new billing information so that we may continue your
+service uninterrupted.
+
+Thanks.
+
diff --git a/conf/home b/conf/home
new file mode 100644
index 000000000..05280cb02
--- /dev/null
+++ b/conf/home
@@ -0,0 +1 @@
+/home
diff --git a/conf/invoice_from b/conf/invoice_from
new file mode 100644
index 000000000..110ec8f41
--- /dev/null
+++ b/conf/invoice_from
@@ -0,0 +1 @@
+ivan-unconfigured-freeside-installation@420.am
diff --git a/conf/invoice_template b/conf/invoice_template
new file mode 100644
index 000000000..e226d636f
--- /dev/null
+++ b/conf/invoice_template
@@ -0,0 +1,27 @@
+
+ Invoice
+ { substr("Page $page of $total_pages ", 0, 19); } { use Date::Format; time2str("%x", $date); } FS-{ $invnum; }
+
+
+Ivan Kohler
+1339 Hayes St.
+San Francisco, CA 94117
+
+
+{ $address[0]; }
+{ $address[1]; }
+{ $address[2]; }
+{ $address[3]; }
+{ $address[4]; }
+{ $address[5]; }
+
+{
+ join("\n",
+ map {
+ my ( $desc, $price ) = @{$_};
+ " ". substr( $desc. " "x65, 0, 65). " ". substr( $price. " "x11, 0, 11);
+ } invoice_lines(31)
+ );
+}
+
+ -=> Freeside - open-source billing for ISPs - http://www.sisd.com/freeside <=-
diff --git a/conf/locale b/conf/locale
new file mode 100644
index 000000000..7741b83a3
--- /dev/null
+++ b/conf/locale
@@ -0,0 +1 @@
+en_US
diff --git a/conf/lpr b/conf/lpr
new file mode 100644
index 000000000..fa1c31315
--- /dev/null
+++ b/conf/lpr
@@ -0,0 +1 @@
+lpr -h
diff --git a/conf/maxsearchrecordsperpage b/conf/maxsearchrecordsperpage
new file mode 100644
index 000000000..29d6383b5
--- /dev/null
+++ b/conf/maxsearchrecordsperpage
@@ -0,0 +1 @@
+100
diff --git a/conf/report_template b/conf/report_template
new file mode 100644
index 000000000..9c6bb2b4a
--- /dev/null
+++ b/conf/report_template
@@ -0,0 +1,14 @@
+{ sprintf("%-19s", "Page $page of $total_pages"); } {
+ my $spacer = (40 - length($title) > 0) ? 40 - length($title) : 0;
+ $spacer = int($spacer / 2);
+ my $titlelen = 40 - $spacer;
+ sprintf("%*s%-*s", $spacer, " ", $titlelen, $title);
+ } { use Date::Format; time2str("%x %X", $date); }
+
+
+{
+ join("\n", map { $_ } report_lines(57));
+}
+
+
+
diff --git a/conf/shells b/conf/shells
new file mode 100644
index 000000000..a41fc6209
--- /dev/null
+++ b/conf/shells
@@ -0,0 +1,5 @@
+
+/bin/sh
+/bin/csh
+/bin/bash
+/bin/false
diff --git a/conf/show-msgcat-codes b/conf/show-msgcat-codes
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/conf/show-msgcat-codes
diff --git a/conf/smtpmachine b/conf/smtpmachine
new file mode 100644
index 000000000..2fbb50c4a
--- /dev/null
+++ b/conf/smtpmachine
@@ -0,0 +1 @@
+localhost
diff --git a/conf/soadefaultttl b/conf/soadefaultttl
new file mode 100644
index 000000000..92f616fb8
--- /dev/null
+++ b/conf/soadefaultttl
@@ -0,0 +1 @@
+259200
diff --git a/conf/soaexpire b/conf/soaexpire
new file mode 100644
index 000000000..d235b91b6
--- /dev/null
+++ b/conf/soaexpire
@@ -0,0 +1 @@
+3600000
diff --git a/conf/soarefresh b/conf/soarefresh
new file mode 100644
index 000000000..9f35f8e81
--- /dev/null
+++ b/conf/soarefresh
@@ -0,0 +1 @@
+10800
diff --git a/conf/soaretry b/conf/soaretry
new file mode 100644
index 000000000..bb08106db
--- /dev/null
+++ b/conf/soaretry
@@ -0,0 +1 @@
+1800
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 000000000..b51eee8d5
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,6 @@
+freeside for Debian
+-------------------
+
+<possible notes regarding this package - if none, delete this file>
+
+ -- Ivan Kohler <ivan-debian@420.am>, Thu, 12 Apr 2001 15:49:17 -0700
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 000000000..d8283b5d9
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,9 @@
+freeside (1.4.1-1) unstable; urgency=low
+
+ * Initial Release.
+
+ -- Ivan Kohler <ivan-debian@420.am> Thu, 12 Apr 2001 15:49:17 -0700
+
+Local variables:
+mode: debian-changelog
+End:
diff --git a/debian/conffiles.ex b/debian/conffiles.ex
new file mode 100644
index 000000000..8686d2af8
--- /dev/null
+++ b/debian/conffiles.ex
@@ -0,0 +1,7 @@
+#
+# If you want to use this conffile, remove all comments and put files that
+# you want dpkg to process here using their absolute pathnames.
+# See section 9.1 of the packaging manual.
+#
+# for example:
+# /etc/freeside/freeside.conf
diff --git a/debian/control b/debian/control
new file mode 100644
index 000000000..de2820d83
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,92 @@
+Source: freeside
+Section: admin
+Priority: optional
+Maintainer: Ivan Kohler <ivan-debian@420.am>
+Build-Depends: debhelper (>> 3.0.0)
+Standards-Version: 3.5.2
+
+Package: freeside
+Architecture: any
+Depends: freeside-lib
+Recommends: freeside-doc, freeside-ui-web, libterm-query-perl
+Suggests: freeside-passwd-server, freeside-signup-server, freeside-session-server, freeside-selfservice-server
+Description: Billing and administration package for ISPs.
+ Freeside is a billing and account administration package for ISPs. It stores
+ customer information in an SQL database, and will update UNIX passwd and
+ shadow files, RADIUS users file and SQL databases, and configuration for
+ sendmail, qmail, BIND and/or Apache. It is also useful as a central database
+ of accounts/domains/web-space for a large number of machines.
+
+Package: freeside-doc
+Architecture: all
+Description: Documentation for freeside
+ This package provides the HTML documentation for Freeside, a billing and
+ account administration package for ISPs.
+
+Package: freeside-lib
+Architecture: all
+Depends: libmime-base64-perl, libdigest-md5-perl, liburi-perl, libhtml-tagset-perl, libhtml-parser-perl, libnet-perl, liblocale-codes-perl, libnet-whois-perl, libwww-perl, libbusiness-creditcard-perl, libmailtools-perl, libtimedate-perl, libdate-manip-perl, libfile-counterfile-perl, libfreezethaw-perl, libtext-template-perl, libdbd-pg-perl, libdbix-datasource-perl, libdbix-dbschema-perl, libnet-ssh-perl, libnet-scp-perl, libapache-asp-perl, libtie-ixhash-perl, libtime-duration-perl, libhtml-widgets-selectlayers-perl, libstorable-perl, libapache-dbi-perl
+Description: Freeside libraries and extension API
+ This package contains the libraries which implement the business logic and
+ backend functions of Freeside, a billing and account administration package
+ for ISPs. This package also contains the manual pages for the library API.
+
+Package: freeside-ui-web
+Architecture: all
+Depends: libstring-approx-perl, freeside-lib, libapache-mod-perl|apache-perl
+Suggests: libapache-mod-ssl|apache-ssl
+Description: Easy-to-use web interface for Freeside
+ This package contains the web interface for Freeside, a billing and account
+ administration package for ISPs. This is what sales or support folks will
+ typically use to add new accounts, edit exiting accounts and so on.
+
+Package: freeside-passwd-server
+Architecture: all
+Depends: freeside-lib
+Description: Freeside password server
+ This component of Freeside, a billing and account administration package for
+ ISPs,
+
+Package: freeside-passwd-client
+Architecture: all
+Depends:
+Description:
+ <rar>
+
+Package: freeside-signup-server
+Architecture: all
+Depends: freeside-lib
+Description:
+ <rar>
+
+Package: freeside-signup-client
+Architecture: all
+Depends:
+Description:
+ <rar>
+
+Package: freeside-signup-client-webui
+Architecture: all
+Depends: freeside-signup-client-lib, httpd
+Description:
+ <rar>
+
+Package: freeside-session-server
+Architecture: all
+Depends: freeside-lib
+Description:
+ <rar>
+
+Package: freeside-session-client
+Architecture: all
+Depends: ssh
+Description:
+ <rar>
+
+Package: freeside-selfservice-server
+Architecture: all
+Depends:
+Description:
+ <rar>
+
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 000000000..e148fcec5
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,10 @@
+This package was debianized by Ivan Kohler <ivan-debian@420.am> on
+Thu, 12 Apr 2001 15:49:17 -0700.
+
+It was downloaded from <fill in ftp site>
+
+Upstream Author(s): <put author(s) name and email here>
+
+Copyright:
+
+<Must follow here>
diff --git a/debian/cron.d.ex b/debian/cron.d.ex
new file mode 100644
index 000000000..61c074da3
--- /dev/null
+++ b/debian/cron.d.ex
@@ -0,0 +1,4 @@
+#
+# Regular cron jobs for the freeside package
+#
+0 4 * * * root freeside_maintenance
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 000000000..ca882bbb7
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1,2 @@
+usr/bin
+usr/sbin
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 000000000..16636bd92
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+INSTALL
+README
+TODO
diff --git a/debian/ex.doc-base.package b/debian/ex.doc-base.package
new file mode 100644
index 000000000..2a055d199
--- /dev/null
+++ b/debian/ex.doc-base.package
@@ -0,0 +1,22 @@
+Document: freeside
+Title: Debian freeside Manual
+Author: <insert document author here>
+Abstract: This manual describes what freeside is
+ and how it can be used to
+ manage online manuals on Debian systems.
+Section: unknown
+
+Format: debiandoc-sgml
+Files: /usr/share/doc/freeside/freeside.sgml.gz
+
+Format: postscript
+Files: /usr/share/doc/freeside/freeside.ps.gz
+
+Format: text
+Files: /usr/share/doc/freeside/freeside.text.gz
+
+Format: HTML
+Index: /usr/share/doc/freeside/html/index.html
+Files: /usr/share/doc/freeside/html/*.html
+
+
diff --git a/debian/freeside-doc.docs b/debian/freeside-doc.docs
new file mode 100644
index 000000000..299950c58
--- /dev/null
+++ b/debian/freeside-doc.docs
@@ -0,0 +1,2 @@
+#DOCS#
+
diff --git a/debian/freeside-doc.files b/debian/freeside-doc.files
new file mode 100644
index 000000000..299950c58
--- /dev/null
+++ b/debian/freeside-doc.files
@@ -0,0 +1,2 @@
+#DOCS#
+
diff --git a/debian/init.d.ex b/debian/init.d.ex
new file mode 100644
index 000000000..57910493a
--- /dev/null
+++ b/debian/init.d.ex
@@ -0,0 +1,70 @@
+#! /bin/sh
+#
+# skeleton example file to build /etc/init.d/ scripts.
+# This file should be used to construct scripts for /etc/init.d.
+#
+# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+# Modified for Debian GNU/Linux
+# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
+#
+# This file was automatically customized by dh-make on Thu, 12 Apr 2001 15:49:17 -0700
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/freeside
+NAME=freeside
+DESC=freeside
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+ start)
+ echo -n "Starting $DESC: "
+ start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON
+ echo "$NAME."
+ ;;
+ stop)
+ echo -n "Stopping $DESC: "
+ start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+ --exec $DAEMON
+ echo "$NAME."
+ ;;
+ #reload)
+ #
+ # If the daemon can reload its config files on the fly
+ # for example by sending it SIGHUP, do it here.
+ #
+ # If the daemon responds to changes in its config file
+ # directly anyway, make this a do-nothing entry.
+ #
+ # echo "Reloading $DESC configuration files."
+ # start-stop-daemon --stop --signal 1 --quiet --pidfile \
+ # /var/run/$NAME.pid --exec $DAEMON
+ #;;
+ restart|force-reload)
+ #
+ # If the "reload" option is implemented, move the "force-reload"
+ # option to the "reload" entry above. If not, "force-reload" is
+ # just the same as "restart".
+ #
+ echo -n "Restarting $DESC: "
+ start-stop-daemon --stop --quiet --pidfile \
+ /var/run/$NAME.pid --exec $DAEMON
+ sleep 1
+ start-stop-daemon --start --quiet --pidfile \
+ /var/run/$NAME.pid --exec $DAEMON
+ echo "$NAME."
+ ;;
+ *)
+ N=/etc/init.d/$NAME
+ # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/debian/manpage.1.ex b/debian/manpage.1.ex
new file mode 100644
index 000000000..ec542bb05
--- /dev/null
+++ b/debian/manpage.1.ex
@@ -0,0 +1,60 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH FREESIDE SECTION "April 12, 2001"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+freeside \- program to do something
+.SH SYNOPSIS
+.B freeside
+.RI [ options ] " files" ...
+.br
+.B bar
+.RI [ options ] " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B freeside
+and
+.B bar
+commands.
+This manual page was written for the Debian GNU/Linux distribution
+because the original program does not have a manual page.
+Instead, it has documentation in the GNU Info format; see below.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
+.\" respectively.
+\fBfreeside\fP is a program that...
+.SH OPTIONS
+These programs follow the usual GNU command line syntax, with long
+options starting with two dashes (`-').
+A summary of options is included below.
+For a complete description, see the Info files.
+.TP
+.B \-h, \-\-help
+Show summary of options.
+.TP
+.B \-v, \-\-version
+Show version of program.
+.SH SEE ALSO
+.BR bar (1),
+.BR baz (1).
+.br
+The programs are documented fully by
+.IR "The Rise and Fall of a Fooish Bar" ,
+available via the Info system.
+.SH AUTHOR
+This manual page was written by Ivan Kohler <ivan-debian@420.am>,
+for the Debian GNU/Linux system (but may be used by others).
diff --git a/debian/manpage.sgml.ex b/debian/manpage.sgml.ex
new file mode 100644
index 000000000..9bc3a8663
--- /dev/null
+++ b/debian/manpage.sgml.ex
@@ -0,0 +1,143 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
+
+<!-- Process this file with docbook-to-man to generate an nroff manual
+ page: `docbook-to-man manpage.sgml > manpage.1'. You may view
+ the manual page with: `docbook-to-man manpage.sgml | nroff -man |
+ less'. A typical entry in a Makefile or Makefile.am is:
+
+manpage.1: manpage.sgml
+ docbook-to-man $< > $@
+ -->
+
+ <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+ <!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
+ <!ENTITY dhsurname "<surname>SURNAME</surname>">
+ <!-- Please adjust the date whenever revising the manpage. -->
+ <!ENTITY dhdate "<date>April 12, 2001</date>">
+ <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+ allowed: see man(7), man(1). -->
+ <!ENTITY dhsection "<manvolnum>SECTION</manvolnum>">
+ <!ENTITY dhemail "<email>ivan-debian@420.am</email>">
+ <!ENTITY dhusername "Ivan Kohler">
+ <!ENTITY dhucpackage "<refentrytitle>FREESIDE</refentrytitle>">
+ <!ENTITY dhpackage "freeside">
+
+ <!ENTITY debian "<productname>Debian GNU/Linux</productname>">
+ <!ENTITY gnu "<acronym>GNU</acronym>">
+]>
+
+<refentry>
+ <refentryinfo>
+ <address>
+ &dhemail;
+ </address>
+ <author>
+ &dhfirstname;
+ &dhsurname;
+ </author>
+ <copyright>
+ <year>2001</year>
+ <holder>&dhusername;</holder>
+ </copyright>
+ &dhdate;
+ </refentryinfo>
+ <refmeta>
+ &dhucpackage;
+
+ &dhsection;
+ </refmeta>
+ <refnamediv>
+ <refname>&dhpackage;</refname>
+
+ <refpurpose>program to do something</refpurpose>
+ </refnamediv>
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>&dhpackage;</command>
+
+ <arg><option>-e <replaceable>this</replaceable></option></arg>
+
+ <arg><option>--example <replaceable>that</replaceable></option></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+ <refsect1>
+ <title>DESCRIPTION</title>
+
+ <para>This manual page documents briefly the
+ <command>&dhpackage;</command> and <command>bar</command>
+ commands.</para>
+
+ <para>This manual page was written for the &debian; distribution
+ because the original program does not have a manual page.
+ Instead, it has documentation in the &gnu;
+ <application>Info</application> format; see below.</para>
+
+ <para><command>&dhpackage;</command> is a program that...</para>
+
+ </refsect1>
+ <refsect1>
+ <title>OPTIONS</title>
+
+ <para>These programs follow the usual GNU command line syntax,
+ with long options starting with two dashes (`-'). A summary of
+ options is included below. For a complete description, see the
+ <application>Info</application> files.</para>
+
+ <variablelist>
+ <varlistentry>
+ <term><option>-h</option>
+ <option>--help</option>
+ </term>
+ <listitem>
+ <para>Show summary of options.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>-v</option>
+ <option>--version</option>
+ </term>
+ <listitem>
+ <para>Show version of program.</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refsect1>
+ <refsect1>
+ <title>SEE ALSO</title>
+
+ <para>bar (1), baz (1).</para>
+
+ <para>The programs are documented fully by <citetitle>The Rise and
+ Fall of a Fooish Bar</citetitle> available via the
+ <application>Info</application> system.</para>
+ </refsect1>
+ <refsect1>
+ <title>AUTHOR</title>
+
+ <para>This manual page was written by &dhusername; &dhemail; for
+ the &debian; system (but may be used by others). Permission is
+ granted to copy, distribute and/or modify this document under
+ the terms of the <acronym>GNU</acronym> Free Documentation
+ License, Version 1.1 or any later version published by the Free
+ Software Foundation; with no Invariant Sections, no Front-Cover
+ Texts and no Back-Cover Texts.</para>
+
+ </refsect1>
+</refentry>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:t
+sgml-parent-document:nil
+sgml-default-dtd-file:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
diff --git a/debian/menu.ex b/debian/menu.ex
new file mode 100644
index 000000000..ddc947e9c
--- /dev/null
+++ b/debian/menu.ex
@@ -0,0 +1,2 @@
+?package(freeside):needs=X11|text|vc|wm section=Apps/see-menu-manual\
+ title="freeside" command="/usr/bin/freeside"
diff --git a/debian/postinst.ex b/debian/postinst.ex
new file mode 100644
index 000000000..c4d4bfba8
--- /dev/null
+++ b/debian/postinst.ex
@@ -0,0 +1,47 @@
+#! /bin/sh
+# postinst script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+#
+# quoting from the policy:
+# Any necessary prompting should almost always be confined to the
+# post-installation script, and should be protected with a conditional
+# so that unnecessary prompting doesn't happen if a package's
+# installation fails and the `postinst' is called with `abort-upgrade',
+# `abort-remove' or `abort-deconfigure'.
+
+case "$1" in
+ configure)
+
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/postrm.ex b/debian/postrm.ex
new file mode 100644
index 000000000..bed8abd3d
--- /dev/null
+++ b/debian/postrm.ex
@@ -0,0 +1,36 @@
+#! /bin/sh
+# postrm script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
+# for details, see /usr/share/doc/packaging-manual/
+
+case "$1" in
+ purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+
+
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 0
+
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+
diff --git a/debian/preinst.ex b/debian/preinst.ex
new file mode 100644
index 000000000..0b42bb28f
--- /dev/null
+++ b/debian/preinst.ex
@@ -0,0 +1,42 @@
+#! /bin/sh
+# preinst script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <new-preinst> `install'
+# * <new-preinst> `install' <old-version>
+# * <new-preinst> `upgrade' <old-version>
+# * <old-preinst> `abort-upgrade' <new-version>
+#
+# For details see /usr/share/doc/packaging-manual/
+
+case "$1" in
+ install|upgrade)
+# if [ "$1" = "upgrade" ]
+# then
+# start-stop-daemon --stop --quiet --oknodo \
+# --pidfile /var/run/freeside.pid \
+# --exec /usr/sbin/freeside 2>/dev/null || true
+# fi
+ ;;
+
+ abort-upgrade)
+ ;;
+
+ *)
+ echo "preinst called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/prerm.ex b/debian/prerm.ex
new file mode 100644
index 000000000..ebb87c540
--- /dev/null
+++ b/debian/prerm.ex
@@ -0,0 +1,37 @@
+#! /bin/sh
+# prerm script for freeside
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see /usr/share/doc/packaging-manual/
+
+case "$1" in
+ remove|upgrade|deconfigure)
+# install-info --quiet --remove /usr/info/freeside.info.gz
+ ;;
+ failed-upgrade)
+ ;;
+ *)
+ echo "prerm called with unknown argument \`$1'" >&2
+ exit 0
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 000000000..71016c406
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,113 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 by Joey Hess.
+#
+# This version is for a hypothetical package that builds an
+# architecture-dependant package, as well as an architecture-independent
+# package.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ # Add here commands to configure the package.
+
+
+ touch configure-stamp
+
+build: configure-stamp build-stamp
+build-stamp:
+ dh_testdir
+
+ # Add here commands to compile the package.
+ $(MAKE)
+
+ touch build-stamp
+
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+
+ # Add here commands to clean up after the build process.
+ -$(MAKE) clean
+
+ dh_clean
+
+install: DH_OPTIONS=
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ # Add here commands to install the package into debian/freeside.
+ $(MAKE) install DESTDIR=$(CURDIR)/debian/freeside
+
+ dh_movefiles
+
+# Build architecture-independent files here.
+# Pass -i to all debhelper commands in this target to reduce clutter.
+binary-indep: build install
+ dh_testdir -i
+ dh_testroot -i
+# dh_installdebconf -i
+ dh_installdocs -i
+ dh_installexamples -i
+ dh_installmenu -i
+# dh_installlogrotate -i
+# dh_installemacsen -i
+# dh_installpam -i
+# dh_installmime -i
+# dh_installinit -i
+ dh_installcron -i
+# dh_installman -i
+ dh_installinfo -i
+# dh_undocumented -i
+ dh_installchangelogs -i
+ dh_link -i
+ dh_compress -i
+ dh_fixperms -i
+ dh_installdeb -i
+# dh_perl -i
+ dh_gencontrol -i
+ dh_md5sums -i
+ dh_builddeb -i
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir -a
+ dh_testroot -a
+# dh_installdebconf -a
+ dh_installdocs -a
+ dh_installexamples -a
+ dh_installmenu -a
+# dh_installlogrotate -a
+# dh_installemacsen -a
+# dh_installpam -a
+# dh_installmime -a
+# dh_installinit -a
+ dh_installcron -a
+# dh_installman -a
+ dh_installinfo -a
+# dh_undocumented -a
+ dh_installchangelogs -a
+ dh_strip -a
+ dh_link -a
+ dh_compress -a
+ dh_fixperms -a
+# dh_makeshlibs -a
+ dh_installdeb -a
+# dh_perl -a
+ dh_shlibdeps -a
+ dh_gencontrol -a
+ dh_md5sums -a
+ dh_builddeb -a
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/debian/watch.ex b/debian/watch.ex
new file mode 100644
index 000000000..3f57ae020
--- /dev/null
+++ b/debian/watch.ex
@@ -0,0 +1,5 @@
+# Example watch control file for uscan
+# Rename this file to "watch" and then you can run the "uscan" command
+# to check for upstream updates and more.
+# Site Directory Pattern Version Script
+sunsite.unc.edu /pub/Linux/Incoming freeside-(.*)\.tar\.gz debian uupdate
diff --git a/eg/TEMPLATE_cust_main.import b/eg/TEMPLATE_cust_main.import
new file mode 100755
index 000000000..e91a2f1d2
--- /dev/null
+++ b/eg/TEMPLATE_cust_main.import
@@ -0,0 +1,198 @@
+#!/usr/bin/perl -w
+#
+# Template for importing legacy customer data
+#
+# $Id: TEMPLATE_cust_main.import,v 1.4 2001-08-21 02:44:47 ivan Exp $
+
+use strict;
+use Date::Parse;
+use FS::UID qw(adminsuidsetup datasrc);
+use FS::Record qw(fields qsearch qsearchs);
+use FS::cust_main;
+use FS::cust_pkg;
+use FS::cust_svc;
+use FS::svc_acct;
+use FS::pkg_svc;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+# use these for the imported cust_main records (unless you have these in legacy
+# data)
+my($agentnum)=4;
+my($refnum)=5;
+
+# map from legacy billing data to pkgpart, maps imported field
+# LegacyBillingData to pkgpart. your names and pkgparts will be different
+my(%pkgpart)=(
+ 'Employee' => 10,
+ 'Business' => 11,
+ 'Individual' => 12,
+ 'Basic PPP' => 13,
+ 'Slave' => 14,
+ 'Co-Located Server' => 15,
+ 'Virtual Web' => 16,
+ 'Perk Mail' => 17,
+ 'Credit Hold' => 18,
+);
+
+my($file)="legacy_file";
+
+open(CLIENT,$file)
+ or die "Can't open $file: $!";
+
+# put a tab-separated header atop the file, or define @fields
+# (use these names or change them below)
+#
+# for cust_main
+# custnum - unique
+# last - (name)
+# first - (name)
+# company
+# address1
+# address2
+# city
+# state
+# zip
+# country
+# daytime - (phone)
+# night - (phone)
+# fax
+# payby - CARD, BILL or COMP
+# payinfo - Credit card #, P.O. # or COMP authorization
+# paydate - Expiration
+# tax - 'Y' for tax exempt
+# for cust_pkg
+# LegacyBillingData - maps via %pkgpart above to a pkgpart
+# for svc_acct
+# username
+
+my($header);
+$header=<CLIENT>;
+chop $header;
+my(@fields)=map { /^\s*(.*[^\s]+)\s*$/; $1 } split(/\t/,$header);
+#print join("\n",@fields);
+
+my($error);
+my($link,$line)=(0,0);
+while (<CLIENT>) {
+ chop;
+ next if /^[\s\t]*$/; #skip any blank lines
+
+ #define %svc hash for this record
+ my(@record)=split(/\t/);
+ my(%svc);
+ foreach (@fields) {
+ $svc{$_}=shift @record;
+ }
+
+ # might need to massage some data like this
+ $svc{'payby'} =~ s/^Credit Card$/CARD/io;
+ $svc{'payby'} =~ s/^Check$/BILL/io;
+ $svc{'payby'} =~ s/^Cash$/BILL/io;
+ $svc{'payby'} =~ s/^$/BILL/o;
+ $svc{'First'} =~ s/&/and/go;
+ $svc{'Zip'} =~ s/\s+$//go;
+
+ my($cust_main) = new FS::cust_main ( {
+ 'custnum' => $svc{'custnum'},
+ 'agentnum' => $agentnum,
+ 'last' => $svc{'last'},
+ 'first' => $svc{'first'},
+ 'company' => $svc{'company'},
+ 'address1' => $svc{'address1'},
+ 'address2' => $svc{'address2'},
+ 'city' => $svc{'city'},
+ 'state' => $svc{'state'},
+ 'zip' => $svc{'zip'},
+ 'country' => $svc{'country'},
+ 'daytime' => $svc{'daytime'},
+ 'night' => $svc{'night'},
+ 'fax' => $svc{'fax'},
+ 'payby' => $svc{'payby'},
+ 'payinfo' => $svc{'payinfo'},
+ 'paydate' => $svc{'paydate'},
+ 'payname' => $svc{'payname'},
+ 'tax' => $svc{'tax'},
+ 'refnum' => $refnum,
+ } );
+
+ $error=$cust_main->insert;
+
+ if ( $error ) {
+ warn $cust_main->_dump;
+ warn map "$_: ". $svc{$_}. "|\n", keys %svc;
+ die $error;
+ }
+
+ my($cust_pkg)=new FS::cust_pkg ( {
+ 'custnum' => $svc{'custnum'},
+ 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}},
+ 'setup' => '',
+ 'bill' => '',
+ 'susp' => '',
+ 'expire' => '',
+ 'cancel' => '',
+ } );
+
+ $error=$cust_pkg->insert;
+ if ( $error ) {
+ warn $svc{'LegacyBillingData'};
+ die $error;
+ }
+
+ unless ( $svc{'username'} ) {
+ warn "Empty login";
+ } else {
+ #find svc_acct record (imported with bin/svc_acct.import) for this username
+ my($svc_acct)=qsearchs('svc_acct',{'username'=>$svc{'username'}});
+ unless ( $svc_acct ) {
+ warn "username ", $svc{'username'}, " not found\n";
+ } else {
+ #link to the cust_pkg record we created above
+
+ #find cust_svc record for this svc_acct record
+ my($o_cust_svc)=qsearchs('cust_svc',{
+ 'svcnum' => $svc_acct->svcnum,
+ 'pkgnum' => '',
+ } );
+ unless ( $o_cust_svc ) {
+ warn "No unlinked cust_svc for svcnum ", $svc_acct->svcnum;
+ } else {
+
+ #make sure this svcpart is in pkgpart
+ my($pkg_svc)=qsearchs('pkg_svc',{
+ 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}},
+ 'svcpart' => $o_cust_svc->svcpart,
+ 'quantity' => 1,
+ });
+ unless ( $pkg_svc ) {
+ warn "login ", $svc{'username'}, ": No svcpart ", $o_cust_svc->svcpart,
+ " for pkgpart ", $pkgpart{$svc{'Acct. Type'}}, "\n" ;
+ } else {
+
+ #create new cust_svc record linked to cust_pkg record
+ my($n_cust_svc) = new FS::cust_svc ({
+ 'svcnum' => $o_cust_svc->svcnum,
+ 'pkgnum' => $cust_pkg->pkgnum,
+ 'svcpart' => $pkg_svc->svcpart,
+ });
+ my($error) = $n_cust_svc->replace($o_cust_svc);
+ die $error if $error;
+ $link++;
+ }
+ }
+ }
+ }
+
+ $line++;
+
+}
+
+warn "\n$link of $line lines linked\n";
+
+# ---
+
+sub usage {
+ die "Usage:\n\n cust_main.import user\n";
+}
diff --git a/eg/export_template.pm b/eg/export_template.pm
new file mode 100644
index 000000000..ca58d4bed
--- /dev/null
+++ b/eg/export_template.pm
@@ -0,0 +1,56 @@
+package FS::part_export::myexport;
+
+use vars qw(@ISA);
+use FS::part_export;
+
+@ISA = qw(FS::part_export);
+
+sub rebless { shift; }
+
+sub _export_insert {
+ my($self, $svc_something) = (shift, shift);
+ $err_or_queue = $self->myexport_queue( $svc_something->svcnum, 'insert',
+ $svc_something->username, $svc_something->_password );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub _export_replace {
+ my( $self, $new, $old ) = (shift, shift, shift);
+ #return "can't change username with myexport"
+ # if $old->username ne $new->username;
+ #return '' unless $old->_password ne $new->_password;
+ $err_or_queue = $self->myexport_queue( $new->svcnum,
+ 'replace', $new->username, $new->_password );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+sub _export_delete {
+ my( $self, $svc_something ) = (shift, shift);
+ $err_or_queue = $self->myexport_queue( $svc_something->svcnum,
+ 'delete', $svc_something->username );
+ ref($err_or_queue) ? '' : $err_or_queue;
+}
+
+#a good idea to queue anything that could fail or take any time
+sub myexport_queue {
+ my( $self, $svcnum, $method ) = (shift, shift, shift);
+ my $queue = new FS::queue {
+ 'svcnum' => $svcnum,
+ 'job' => "FS::part_export::myexport::myexport_$method",
+ };
+ $queue->insert( @_ ) or $queue;
+}
+
+sub myexport_insert { #subroutine, not method
+ my( $username, $password ) = @_;
+ #do things with $username and $password
+}
+
+sub myexport_replace { #subroutine, not method
+}
+
+sub myexport_delete { #subroutine, not method
+ my( $username ) = @_;
+ #do things with $username
+}
+
diff --git a/eg/table_template-svc.pm b/eg/table_template-svc.pm
new file mode 100644
index 000000000..ebf7299d2
--- /dev/null
+++ b/eg/table_template-svc.pm
@@ -0,0 +1,161 @@
+package FS::svc_table;
+
+use strict;
+use vars qw(@ISA);
+#use FS::Record qw( qsearch qsearchs );
+use FS::svc_Common;
+use FS::cust_svc;
+
+@ISA = qw(svc_Common);
+
+=head1 NAME
+
+FS::table_name - Object methods for table_name records
+
+=head1 SYNOPSIS
+
+ use FS::table_name;
+
+ $record = new FS::table_name \%hash;
+ $record = new FS::table_name { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+ $error = $record->suspend;
+
+ $error = $record->unsuspend;
+
+ $error = $record->cancel;
+
+=head1 DESCRIPTION
+
+An FS::table_name object represents an example. FS::table_name inherits from
+FS::svc_Common. The following fields are currently supported:
+
+=over 4
+
+=item field - description
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new example. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+sub table { 'table_name'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
+defined. An FS::cust_svc record will be created and inserted.
+
+=cut
+
+sub insert {
+ my $self = shift;
+ my $error;
+
+ $error = $self->SUPER::insert;
+ return $error if $error;
+
+ '';
+}
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+sub delete {
+ my $self = shift;
+ my $error;
+
+ $error = $self->SUPER::delete;
+ return $error if $error;
+
+ '';
+}
+
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub replace {
+ my ( $new, $old ) = ( shift, shift );
+ my $error;
+
+ $error = $new->SUPER::replace($old);
+ return $error if $error;
+
+ '';
+}
+
+=item suspend
+
+Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item unsuspend
+
+Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item cancel
+
+Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and repalce methods.
+
+=cut
+
+sub check {
+ my $self = shift;
+
+ my $x = $self->setfixed;
+ return $x unless ref($x);
+ my $part_svc = $x;
+
+
+ ''; #no error
+}
+
+=back
+
+=head1 BUGS
+
+The author forgot to customize this manpage.
+
+=head1 SEE ALSO
+
+L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
+L<FS::cust_pkg>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/eg/table_template.pm b/eg/table_template.pm
new file mode 100644
index 000000000..d609bd544
--- /dev/null
+++ b/eg/table_template.pm
@@ -0,0 +1,112 @@
+package FS::table_name;
+
+use strict;
+use vars qw( @ISA );
+use FS::Record qw( qsearch qsearchs );
+
+@ISA = qw(FS::Record);
+
+=head1 NAME
+
+FS::table_name - Object methods for table_name records
+
+=head1 SYNOPSIS
+
+ use FS::table_name;
+
+ $record = new FS::table_name \%hash;
+ $record = new FS::table_name { 'column' => 'value' };
+
+ $error = $record->insert;
+
+ $error = $new_record->replace($old_record);
+
+ $error = $record->delete;
+
+ $error = $record->check;
+
+=head1 DESCRIPTION
+
+An FS::table_name object represents an example. FS::table_name inherits from
+FS::Record. The following fields are currently supported:
+
+=over 4
+
+=item field - description
+
+=back
+
+=head1 METHODS
+
+=over 4
+
+=item new HASHREF
+
+Creates a new example. To add the example to the database, see L<"insert">.
+
+Note that this stores the hash reference, not a distinct copy of the hash it
+points to. You can ask the object for a copy with the I<hash> method.
+
+=cut
+
+# the new method can be inherited from FS::Record, if a table method is defined
+
+sub table { 'table_name'; }
+
+=item insert
+
+Adds this record to the database. If there is an error, returns the error,
+otherwise returns false.
+
+=cut
+
+# the insert method can be inherited from FS::Record
+
+=item delete
+
+Delete this record from the database.
+
+=cut
+
+# the delete method can be inherited from FS::Record
+
+=item replace OLD_RECORD
+
+Replaces the OLD_RECORD with this one in the database. If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+# the replace method can be inherited from FS::Record
+
+=item check
+
+Checks all fields to make sure this is a valid example. If there is
+an error, returns the error, otherwise returns false. Called by the insert
+and replace methods.
+
+=cut
+
+# the check method should currently be supplied - FS::Record contains some
+# data checking routines
+
+sub check {
+ my $self = shift;
+
+ ''; #no error
+}
+
+=back
+
+=head1 BUGS
+
+The author forgot to customize this manpage.
+
+=head1 SEE ALSO
+
+L<FS::Record>, schema.html from the base documentation.
+
+=cut
+
+1;
+
diff --git a/etc/abbr_state.txt b/etc/abbr_state.txt
new file mode 100644
index 000000000..7e4f57f78
--- /dev/null
+++ b/etc/abbr_state.txt
@@ -0,0 +1,72 @@
+State/Possession Abbreviation
+
+ALABAMA AL
+ALASKA AK
+AMERICAN SAMOA AS
+ARIZONA AZ
+ARKANSAS AR
+CALIFORNIA CA
+COLORADO CO
+CONNECTICUT CT
+DELAWARE DE
+DISTRICT OF COLUMBIA DC
+FEDERATED STATES OF MICRONESIA FM
+FLORIDA FL
+GEORGIA GA
+GUAM GU
+HAWAII HI
+IDAHO ID
+ILLINOIS IL
+INDIANA IN
+IOWA IA
+KANSAS KS
+KENTUCKY KY
+LOUISIANA LA
+MAINE ME
+MARSHALL ISLANDS MH
+MARYLAND MD
+MASSACHUSETTS MA
+MICHIGAN MI
+MINNESOTA MN
+MISSISSIPPI MS
+MISSOURI MO
+MONTANA MT
+NEBRASKA NE
+NEVADA NV
+NEW HAMPSHIRE NH
+NEW JERSEY NJ
+NEW MEXICO NM
+NEW YORK NY
+NORTH CAROLINA NC
+NORTH DAKOTA ND
+NORTHERN MARIANA ISLANDS MP
+OHIO OH
+OKLAHOMA OK
+OREGON OR
+PALAU PW
+PENNSYLVANIA PA
+PUERTO RICO PR
+RHODE ISLAND RI
+SOUTH CAROLINA SC
+SOUTH DAKOTA SD
+TENNESSEE TN
+TEXAS TX
+UTAH UT
+VERMONT VT
+VIRGIN ISLANDS VI
+VIRGINIA VA
+WASHINGTON WA
+WEST VIRGINIA WV
+WISCONSIN WI
+WYOMING WY
+
+
+Military "State" Abbreviation
+
+Armed Forces Africa AE
+Armed Forces Americas AA
+(except Canada)
+Armed Forces Canada AE
+Armed Forces Europe AE
+Armed Forces Middle East AE
+Armed Forces Pacific AP
diff --git a/etc/countries.txt b/etc/countries.txt
new file mode 100644
index 000000000..73c3975ed
--- /dev/null
+++ b/etc/countries.txt
@@ -0,0 +1,239 @@
+AFGHANISTAN AF AFG 004
+ALBANIA AL ALB 008
+ALGERIA DZ DZA 012
+AMERICAN SAMOA AS ASM 016
+ANDORRA AD AND 020
+ANGOLA AO AGO 024
+ANGUILLA AI AIA 660
+ANTARCTICA AQ ATA 010
+ANTIGUA AND BARBUDA AG ATG 028
+ARGENTINA AR ARG 032
+ARMENIA AM ARM 051
+ARUBA AW ABW 533
+AUSTRALIA AU AUS 036
+AUSTRIA AT AUT 040
+AZERBAIJAN AZ AZE 031
+BAHAMAS BS BHS 044
+BAHRAIN BH BHR 048
+BANGLADESH BD BGD 050
+BARBADOS BB BRB 052
+BELARUS BY BLR 112
+BELGIUM BE BEL 056
+BELIZE BZ BLZ 084
+BENIN BJ BEN 204
+BERMUDA BM BMU 060
+BHUTAN BT BTN 064
+BOLIVIA BO BOL 068
+BOSNIA AND HERZEGOWINA BA BIH 070
+BOTSWANA BW BWA 072
+BOUVET ISLAND BV BVT 074
+BRAZIL BR BRA 076
+BRITISH INDIAN OCEAN TERRITORY IO IOT 086
+BRUNEI DARUSSALAM BN BRN 096
+BULGARIA BG BGR 100
+BURKINA FASO BF BFA 854
+BURUNDI BI BDI 108
+CAMBODIA KH KHM 116
+CAMEROON CM CMR 120
+CANADA CA CAN 124
+CAPE VERDE CV CPV 132
+CAYMAN ISLANDS KY CYM 136
+CENTRAL AFRICAN REPUBLIC CF CAF 140
+CHAD TD TCD 148
+CHILE CL CHL 152
+CHINA CN CHN 156
+CHRISTMAS ISLAND CX CXR 162
+COCOS (KEELING) ISLANDS CC CCK 166
+COLOMBIA CO COL 170
+COMOROS KM COM 174
+CONGO CG COG 178
+COOK ISLANDS CK COK 184
+COSTA RICA CR CRI 188
+COTE D'IVOIRE CI CIV 384
+CROATIA (local name: Hrvatska) HR HRV 191
+CUBA CU CUB 192
+CYPRUS CY CYP 196
+CZECH REPUBLIC CZ CZE 203
+DENMARK DK DNK 208
+DJIBOUTI DJ DJI 262
+DOMINICA DM DMA 212
+DOMINICAN REPUBLIC DO DOM 214
+EAST TIMOR TP TMP 626
+ECUADOR EC ECU 218
+EGYPT EG EGY 818
+EL SALVADOR SV SLV 222
+EQUATORIAL GUINEA GQ GNQ 226
+ERITREA ER ERI 232
+ESTONIA EE EST 233
+ETHIOPIA ET ETH 231
+FALKLAND ISLANDS (MALVINAS) FK FLK 238
+FAROE ISLANDS FO FRO 234
+FIJI FJ FJI 242
+FINLAND FI FIN 246
+FRANCE FR FRA 250
+FRANCE, METROPOLITAN FX FXX 249
+FRENCH GUIANA GF GUF 254
+FRENCH POLYNESIA PF PYF 258
+FRENCH SOUTHERN TERRITORIES TF ATF 260
+GABON GA GAB 266
+GAMBIA GM GMB 270
+GEORGIA GE GEO 268
+GERMANY DE DEU 276
+GHANA GH GHA 288
+GIBRALTAR GI GIB 292
+GREECE GR GRC 300
+GREENLAND GL GRL 304
+GRENADA GD GRD 308
+GUADELOUPE GP GLP 312
+GUAM GU GUM 316
+GUATEMALA GT GTM 320
+GUINEA GN GIN 324
+GUINEA-BISSAU GW GNB 624
+GUYANA GY GUY 328
+HAITI HT HTI 332
+HEARD AND MC DONALD ISLANDS HM HMD 334
+HONDURAS HN HND 340
+HONG KONG HK HKG 344
+HUNGARY HU HUN 348
+ICELAND IS ISL 352
+INDIA IN IND 356
+INDONESIA ID IDN 360
+IRAN (ISLAMIC REPUBLIC OF) IR IRN 364
+IRAQ IQ IRQ 368
+IRELAND IE IRL 372
+ISRAEL IL ISR 376
+ITALY IT ITA 380
+JAMAICA JM JAM 388
+JAPAN JP JPN 392
+JORDAN JO JOR 400
+KAZAKHSTAN KZ KAZ 398
+KENYA KE KEN 404
+KIRIBATI KI KIR 296
+KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP PRK 408
+KOREA, REPUBLIC OF KR KOR 410
+KUWAIT KW KWT 414
+KYRGYZSTAN KG KGZ 417
+LAO PEOPLE'S DEMOCRATIC REPUBLIC LA LAO 418
+LATVIA LV LVA 428
+LEBANON LB LBN 422
+LESOTHO LS LSO 426
+LIBERIA LR LBR 430
+LIBYAN ARAB JAMAHIRIYA LY LBY 434
+LIECHTENSTEIN LI LIE 438
+LITHUANIA LT LTU 440
+LUXEMBOURG LU LUX 442
+MACAU MO MAC 446
+MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK MKD 807
+MADAGASCAR MG MDG 450
+MALAWI MW MWI 454
+MALAYSIA MY MYS 458
+MALDIVES MV MDV 462
+MALI ML MLI 466
+MALTA MT MLT 470
+MARSHALL ISLANDS MH MHL 584
+MARTINIQUE MQ MTQ 474
+MAURITANIA MR MRT 478
+MAURITIUS MU MUS 480
+MAYOTTE YT MYT 175
+MEXICO MX MEX 484
+MICRONESIA, FEDERATED STATES OF FM FSM 583
+MOLDOVA, REPUBLIC OF MD MDA 498
+MONACO MC MCO 492
+MONGOLIA MN MNG 496
+MONTSERRAT MS MSR 500
+MOROCCO MA MAR 504
+MOZAMBIQUE MZ MOZ 508
+MYANMAR MM MMR 104
+NAMIBIA NA NAM 516
+NAURU NR NRU 520
+NEPAL NP NPL 524
+NETHERLANDS NL NLD 528
+NETHERLANDS ANTILLES AN ANT 530
+NEW CALEDONIA NC NCL 540
+NEW ZEALAND NZ NZL 554
+NICARAGUA NI NIC 558
+NIGER NE NER 562
+NIGERIA NG NGA 566
+NIUE NU NIU 570
+NORFOLK ISLAND NF NFK 574
+NORTHERN MARIANA ISLANDS MP MNP 580
+NORWAY NO NOR 578
+OMAN OM OMN 512
+PAKISTAN PK PAK 586
+PALAU PW PLW 585
+PANAMA PA PAN 591
+PAPUA NEW GUINEA PG PNG 598
+PARAGUAY PY PRY 600
+PERU PE PER 604
+PHILIPPINES PH PHL 608
+PITCAIRN PN PCN 612
+POLAND PL POL 616
+PORTUGAL PT PRT 620
+PUERTO RICO PR PRI 630
+QATAR QA QAT 634
+REUNION RE REU 638
+ROMANIA RO ROM 642
+RUSSIAN FEDERATION RU RUS 643
+RWANDA RW RWA 646
+SAINT KITTS AND NEVIS KN KNA 659
+SAINT LUCIA LC LCA 662
+SAINT VINCENT AND THE GRENADINES VC VCT 670
+SAMOA WS WSM 882
+SAN MARINO SM SMR 674
+SAO TOME AND PRINCIPE ST STP 678
+SAUDI ARABIA SA SAU 682
+SENEGAL SN SEN 686
+SEYCHELLES SC SYC 690
+SIERRA LEONE SL SLE 694
+SINGAPORE SG SGP 702
+SLOVAKIA (Slovak Republic) SK SVK 703
+SLOVENIA SI SVN 705
+SOLOMON ISLANDS SB SLB 090
+SOMALIA SO SOM 706
+SOUTH AFRICA ZA ZAF 710
+SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS SGS 239
+SPAIN ES ESP 724
+SRI LANKA LK LKA 144
+ST. HELENA SH SHN 654
+ST. PIERRE AND MIQUELON PM SPM 666
+SUDAN SD SDN 736
+SURINAME SR SUR 740
+SVALBARD AND JAN MAYEN ISLANDS SJ SJM 744
+SWAZILAND SZ SWZ 748
+SWEDEN SE SWE 752
+SWITZERLAND CH CHE 756
+SYRIAN ARAB REPUBLIC SY SYR 760
+TAIWAN, PROVINCE OF CHINA TW TWN 158
+TAJIKISTAN TJ TJK 762
+TANZANIA, UNITED REPUBLIC OF TZ TZA 834
+THAILAND TH THA 764
+TOGO TG TGO 768
+TOKELAU TK TKL 772
+TONGA TO TON 776
+TRINIDAD AND TOBAGO TT TTO 780
+TUNISIA TN TUN 788
+TURKEY TR TUR 792
+TURKMENISTAN TM TKM 795
+TURKS AND CAICOS ISLANDS TC TCA 796
+TUVALU TV TUV 798
+UGANDA UG UGA 800
+UKRAINE UA UKR 804
+UNITED ARAB EMIRATES AE ARE 784
+UNITED KINGDOM GB GBR 826
+UNITED STATES US USA 840
+UNITED STATES MINOR OUTLYING ISLANDS UM UMI 581
+URUGUAY UY URY 858
+UZBEKISTAN UZ UZB 860
+VANUATU VU VUT 548
+VATICAN CITY STATE (HOLY SEE) VA VAT 336
+VENEZUELA VE VEN 862
+VIET NAM VN VNM 704
+VIRGIN ISLANDS (BRITISH) VG VGB 092
+VIRGIN ISLANDS (U.S.) VI VIR 850
+WALLIS AND FUTUNA ISLANDS WF WLF 876
+WESTERN SAHARA EH ESH 732
+YEMEN YE YEM 887
+YUGOSLAVIA YU YUG 891
+ZAIRE ZR ZAR 180
+ZAMBIA ZM ZMB 894
+ZIMBABWE ZW ZWE 716
diff --git a/etc/domain-template.txt b/etc/domain-template.txt
new file mode 100644
index 000000000..8e4983ce2
--- /dev/null
+++ b/etc/domain-template.txt
@@ -0,0 +1,231 @@
+[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ]
+
+******* Please DO NOT REMOVE Version Number or Sections A-Q ********
+
+Domain Version Number: 4.0
+
+******* Email completed agreement to hostmaster@internic.net *******
+
+ NETWORK SOLUTIONS, INC.
+
+ DOMAIN NAME REGISTRATION AGREEMENT
+
+
+A. Introduction. This domain name registration agreement
+("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC.
+("NSI") for the purpose of applying for and registering a domain name
+on the Internet. If this Registration Agreement is accepted by NSI,
+and a domain name is registered in NSI's domain name database and
+assigned to the Registrant, Registrant ("Registrant") agrees to be
+bound by the terms of this Registration Agreement and the terms of
+NSI's Domain Name Dispute Policy ("Dispute Policy") which is
+incorporated herein by reference and made a part of this Registration
+Agreement. This Registration Agreement shall be accepted at the
+offices of NSI.
+
+B. Fees and Payments.
+
+1) Registration or renewal (re-registration) date through March 31, 1998:
+Registrant agrees to pay a registration fee of One Hundred United States
+Dollars (US$100) as consideration for the registration of each new domain
+name or Fifty United States Dollars (US$50) to renew (re-register) an
+existing registration.
+2) Registration or renewal date on and after April 1, 1998: Registrant
+agrees to pay a registration fee of Seventy United States Dollars (US$70)
+as consideration for the registration of each new domain name or the
+applicable renewal (re-registration) fee (currently Thirty-Five United
+States Dollars (US$35)) at the time of renewal (re-registration).
+3) Period of Service: The non-refundable fee covers a period of two (2)
+years for each new registration, and one (1) year for each renewal,
+and includes any permitted modification(s) to the domain name record
+during the covered period.
+4) Payment: Payment is due to Network Solutions within thirty (30)
+days from the date of the invoice.
+
+C. Dispute Policy. Registrant agrees, as a condition to
+submitting this Registration Agreement, and if the Registration
+Agreement is accepted by NSI, that the Registrant shall be bound by
+NSI's current Dispute Policy. The current version of the Dispute
+Policy may be found at the InterNIC Registration Services web site:
+"http://www.netsol.com/rs/dispute-policy.html".
+
+D. Dispute Policy Changes or Modifications. Registrant agrees
+that NSI, in its sole discretion, may change or modify the Dispute
+Policy, incorporated by reference herein, at any time. Registrant
+agrees that Registrant's maintaining the registration of a domain name
+after changes or modifications to the Dispute Policy become effective
+constitutes Registrant's continued acceptance of these changes or
+modifications. Registrant agrees that if Registrant considers any such
+changes or modifications to be unacceptable, Registrant may request
+that the domain name be deleted from the domain name database.
+
+E. Disputes. Registrant agrees that, if the registration of its
+domain name is challenged by any third party, the Registrant will be
+subject to the provisions specified in the Dispute Policy.
+
+F. Agents. Registrant agrees that if this Registration Agreement
+is completed by an agent for the Registrant, such as an ISP or
+Administrative Contact/Agent, the Registrant is nonetheless bound as a
+principal by all terms and conditions herein, including the Dispute
+Policy.
+
+G. Limitation of Liability. Registrant agrees that NSI shall have
+no liability to the Registrant for any loss Registrant may incur in
+connection with NSI's processing of this Registration Agreement, in
+connection with NSI's processing of any authorized modification to the
+domain name's record during the covered period, as a result of the
+Registrant's ISP's failure to pay either the initial registration fee
+or renewal fee, or as a result of the application of the provisions of
+the Dispute Policy. Registrant agrees that in no event shall the
+maximum liability of NSI under this Agreement for any matter exceed
+Five Hundred United States Dollars (US$500).
+
+H. Indemnity. Registrant agrees, in the event the Registration
+Agreement is accepted by NSI and a subsequent dispute arises with any
+third party, to indemnify and hold NSI harmless pursuant to the terms
+and conditions contained in the Dispute Policy.
+
+I. Breach. Registrant agrees that failure to abide by any
+provision of this Registration Agreement or the Dispute Policy may be
+considered by NSI to be a material breach and that NSI may provide a
+written notice, describing the breach, to the Registrant. If, within
+thirty (30) days of the date of mailing such notice, the Registrant
+fails to provide evidence, which is reasonably satisfactory to NSI,
+that it has not breached its obligations, then NSI may delete
+Registrant's registration of the domain name. Any such breach by a
+Registrant shall not be deemed to be excused simply because NSI did
+not act earlier in response to that, or any other, breach by the
+Registrant.
+
+J. No Guaranty. Registrant agrees that, by registration of a
+domain name, such registration does not confer immunity from objection
+to either the registration or use of the domain name.
+
+K. Warranty. Registrant warrants by submitting this Registration
+Agreement that, to the best of Registrant's knowledge and belief, the
+information submitted herein is true and correct, and that any future
+changes to this information will be provided to NSI in a timely manner
+according to the domain name modification procedures in place at that
+time. Breach of this warranty will constitute a material breach.
+
+L. Revocation. Registrant agrees that NSI may delete a
+Registrant's domain name if this Registration Agreement, or subsequent
+modification(s) thereto, contains false or misleading information, or
+conceals or omits any information NSI would likely consider material
+to its decision to approve this Registration Agreement.
+
+M. Right of Refusal. NSI, in its sole discretion, reserves the
+right to refuse to approve the Registration Agreement for any
+Registrant. Registrant agrees that the submission of this Registration
+Agreement does not obligate NSI to accept this Registration Agreement.
+Registrant agrees that NSI shall not be liable for loss or damages
+that may result from NSI's refusal to accept this Registration
+Agreement.
+
+N. Severability. Registrant agrees that the terms of this
+Registration Agreement are severable. If any term or provision is
+declared invalid, it shall not affect the remaining terms or
+provisions which shall continue to be binding.
+
+O. Entirety. Registrant agrees that this Registration Agreement
+and the Dispute Policy is the complete and exclusive agreement between
+Registrant and NSI regarding the registration of Registrant's domain
+name. This Registration Agreement and the Dispute Policy supersede all
+prior agreements and understandings, whether established by custom,
+practice, policy, or precedent.
+
+P. Governing Law. Registrant agrees that this Registration
+Agreement shall be governed in all respects by and construed in
+accordance with the laws of the Commonwealth of Virginia, United
+States of America. By submitting this Registration Agreement,
+Registrant consents to the exclusive jurisdiction and venue of the
+United States District Court for the Eastern District of Virginia,
+Alexandria Division. If there is no jurisdiction in the United States
+District Court for the Eastern District of Virginia, Alexandria
+Division, then jurisdiction shall be in the Circuit Court of Fairfax
+County, Fairfax, Virginia.
+
+Q. This is Domain Name Registration Agreement Version
+Number 4.0. This Registration Agreement is only for registrations
+under top-level domains: COM, ORG, NET, and EDU. By completing
+and submitting this Registration Agreement for consideration and
+acceptance by NSI, the Registrant agrees that he/she has read and
+agrees to be bound by A through P above.
+
+
+Authorization
+0a. (N)ew (M)odify (D)elete....:###action###
+0b. Auth Scheme................:
+0c. Auth Info..................:
+
+1. Comments...................:###purpose###
+
+2. Complete Domain Name.......:###domain###
+
+Organization Using Domain Name
+
+3a. Organization Name..........:###company###
+###LOOP###
+3b. Street Address.............:###address###
+###ENDLOOP###
+3c. City.......................:###city###
+3d. State......................:###state###
+3e. Postal Code................:###zip###
+3f. Country....................:###country###
+
+Administrative Contact
+4a. NIC Handle (if known)......:
+4b. (I)ndividual (R)ole........:I
+4c. Name (Last, First).........:###last###, ###first###
+4d. Organization Name..........:###company###
+###LOOP###
+4e. Street Address.............:###address###
+###ENDLOOP###
+4f. City.......................:###city###
+4g. State......................:###state###
+4h. Postal Code................:###zip###
+4i. Country....................:###country###
+4j. Phone Number...............:###daytime###
+4k. Fax Number.................:###fax###
+4l. E-Mailbox..................:###email###
+
+Technical Contact
+5a. NIC Handle (if known)......:###tech_contact###
+5b. (I)ndividual (R)ole........:
+5c. Name (Last, First).........:
+5d. Organization Name..........:
+5e. Street Address.............:
+5f. City.......................:
+5g. State......................:
+5h. Postal Code................:
+5i. Country....................:
+5j. Phone Number...............:
+5k. Fax Number.................:
+5l. E-Mailbox..................:
+
+Billing Contact
+6a. NIC Handle (if known)......:
+6b. (I)ndividual (R)ole........:
+6c. Name (Last, First).........:
+6d. Organization Name..........:
+6e. Street Address.............:
+6f. City.......................:
+6g. State......................:
+6h. Postal Code................:
+6i. Country....................:
+6j. Phone Number...............:
+6k. Fax Number.................:
+6l. E-Mailbox..................:
+
+Prime Name Server
+7a. Primary Server Hostname....:###primary###
+7b. Primary Server Netaddress..:###primary_ip###
+
+Secondary Name Server(s)
+###LOOP###
+8a. Secondary Server Hostname..:###secondary###
+8b. Secondary Server Netaddress:###secondary_ip###
+###ENDLOOP###
+
+END OF AGREEMENT
+
diff --git a/etc/megapop.pl b/etc/megapop.pl
new file mode 100755
index 000000000..b250bcdde
--- /dev/null
+++ b/etc/megapop.pl
@@ -0,0 +1,116 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: megapop.pl,v 1.1 1999-04-19 10:32:44 ivan Exp $
+#
+# this will break when megapop changes the URL or format of their listing page.
+# that's stupid. perhaps they can provide a machine-readable listing?
+
+use strict;
+use LWP::UserAgent;
+use FS::UID qw(adminsuidsetup);
+use FS::svc_acct_pop;
+
+my $url = "http://www.megapop.com/location.htm";
+
+my $user = shift or die &usage;
+adminsuidsetup($user);
+
+my %state2usps = &state2usps;
+$state2usps{'WASHINGTON STATE'} = 'WA'; #megapop's on crack
+$state2usps{'CANADA'} = 'CANADA'; #freeside's on crack
+
+my $ua = new LWP::UserAgent;
+my $request = new HTTP::Request('GET', $url);
+my $response = $ua->request($request);
+die $response->error_as_HTML unless $response->is_success;
+my $line;
+my $usps = '';
+foreach $line ( split("\n", $response->content) ) {
+ if ( $line =~ /\W(\w[\w\s]*\w)\s+LOCATIONS/i ) {
+ $usps = $state2usps{uc($1)}
+ or warn "warning: unknown state $1\n";
+ } elsif ( $line =~ /(\d{3})\-(\d{3})\-(\d{4})\s+(\w[\w\s]*\w)/ ) {
+ print "$1 $2 $3 $4 $usps\n";
+ my $svc_acct_pop = new FS::svc_acct_pop ( {
+ 'city' => $4,
+ 'state' => $usps,
+ 'ac' => $1,
+ 'exch' => $2,
+ } );
+ my $error = $svc_acct_pop->insert;
+ die $error if $error;
+ }
+}
+
+sub usage {
+ die "Usage:\n $0 user\n";
+}
+
+sub state2usps{ (
+ 'ALABAMA' => 'AL',
+ 'ALASKA' => 'AK',
+ 'AMERICAN SAMOA' => 'AS',
+ 'ARIZONA' => 'AZ',
+ 'ARKANSAS' => 'AR',
+ 'CALIFORNIA' => 'CA',
+ 'COLORADO' => 'CO',
+ 'CONNECTICUT' => 'CT',
+ 'DELAWARE' => 'DE',
+ 'DISTRICT OF COLUMBIA' => 'DC',
+ 'FEDERATED STATES OF MICRONESIA' => 'FM',
+ 'FLORIDA' => 'FL',
+ 'GEORGIA' => 'GA',
+ 'GUAM' => 'GU',
+ 'HAWAII' => 'HI',
+ 'IDAHO' => 'ID',
+ 'ILLINOIS' => 'IL',
+ 'INDIANA' => 'IN',
+ 'IOWA' => 'IA',
+ 'KANSAS' => 'KS',
+ 'KENTUCKY' => 'KY',
+ 'LOUISIANA' => 'LA',
+ 'MAINE' => 'ME',
+ 'MARSHALL ISLANDS' => 'MH',
+ 'MARYLAND' => 'MD',
+ 'MASSACHUSETTS' => 'MA',
+ 'MICHIGAN' => 'MI',
+ 'MINNESOTA' => 'MN',
+ 'MISSISSIPPI' => 'MS',
+ 'MISSOURI' => 'MO',
+ 'MONTANA' => 'MT',
+ 'NEBRASKA' => 'NE',
+ 'NEVADA' => 'NV',
+ 'NEW HAMPSHIRE' => 'NH',
+ 'NEW JERSEY' => 'NJ',
+ 'NEW MEXICO' => 'NM',
+ 'NEW YORK' => 'NY',
+ 'NORTH CAROLINA' => 'NC',
+ 'NORTH DAKOTA' => 'ND',
+ 'NORTHERN MARIANA ISLANDS' => 'MP',
+ 'OHIO' => 'OH',
+ 'OKLAHOMA' => 'OK',
+ 'OREGON' => 'OR',
+ 'PALAU' => 'PW',
+ 'PENNSYLVANIA' => 'PA',
+ 'PUERTO RICO' => 'PR',
+ 'RHODE ISLAND' => 'RI',
+ 'SOUTH CAROLINA' => 'SC',
+ 'SOUTH DAKOTA' => 'SD',
+ 'TENNESSEE' => 'TN',
+ 'TEXAS' => 'TX',
+ 'UTAH' => 'UT',
+ 'VERMONT' => 'VT',
+ 'VIRGIN ISLANDS' => 'VI',
+ 'VIRGINIA' => 'VA',
+ 'WASHINGTON' => 'WA',
+ 'WEST VIRGINIA' => 'WV',
+ 'WISCONSIN' => 'WI',
+ 'WYOMING' => 'WY',
+ 'ARMED FORCES AFRICA' => 'AE',
+ 'ARMED FORCES AMERICAS' => 'AA',
+ 'ARMED FORCES CANADA' => 'AE',
+ 'ARMED FORCES EUROPE' => 'AE',
+ 'ARMED FORCES MIDDLE EAST' => 'AE',
+ 'ARMED FORCES PACIFIC' => 'AP',
+) }
+
diff --git a/etc/sql-reserved-words.txt b/etc/sql-reserved-words.txt
new file mode 100644
index 000000000..dc507cef5
--- /dev/null
+++ b/etc/sql-reserved-words.txt
@@ -0,0 +1,103 @@
+From http://epoch.cs.berkeley.edu:8000/sequoia/dba/montage/FAQ/SQL.html
+ by Jean Anderson (jta@postgres.berkeley.edu)
+
+What are the SQL reserved words?
+
+I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
+SQL3 words are not set in stone, but you'd do well to avoid them.
+
+ From sql1992.txt:
+
+ AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
+ COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
+ EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
+ NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
+ PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
+ REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
+ ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
+ SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
+ UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
+
+ From sql1992.txt (Annex E):
+
+ ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
+ BIT, BIT
+
+What are the SQL reserved words?
+
+I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
+SQL3 words are not set in stone, but you'd do well to avoid them.
+
+ From sql1992.txt:
+
+ AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
+ COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
+ EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
+ NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
+ PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
+ REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
+ ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
+ SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
+ UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
+
+ From sql1992.txt (Annex E):
+
+ ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
+ BIT, BIT
+
+What are the SQL reserved words?
+
+I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
+SQL3 words are not set in stone, but you'd do well to avoid them.
+
+ From sql1992.txt:
+
+ AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
+ COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
+ EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
+ NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
+ PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
+ REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
+ ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
+ SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
+ UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
+
+ From sql1992.txt (Annex E):
+
+ ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
+ BIT, BIT_LENGTH, BOTH, CASCADE, CASCADED, CASE, CAST, CATALOG,
+ CHAR_LENGTH, CHARACTER_LENGTH, COALESCE, COLLATE, COLLATION, COLUMN,
+ CONNECT, CONNECTION, CONSTRAINT, CONSTRAINTS, CONVERT, CORRESPONDING,
+ CROSS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER,
+ DATE, DAY, DEALLOCATE, DEFERRABLE, DEFERRED, DESCRIBE, DESCRIPTOR,
+ DIAGNOSTICS, DISCONNECT, DOMAIN, DROP, ELSE, END-EXEC, EXCEPT,
+ EXCEPTION, EXECUTE, EXTERNAL, EXTRACT, FALSE, FIRST, FULL, GET,
+ GLOBAL, HOUR, IDENTITY, IMMEDIATE, INITIALLY, INNER, INPUT,
+ INSENSITIVE, INTERSECT, INTERVAL, ISOLATION, JOIN, LAST, LEADING,
+ LEFT, LEVEL, LOCAL, LOWER, MATCH, MINUTE, MONTH, NAMES, NATIONAL,
+ NATURAL, NCHAR, NEXT, NO, NULLIF, OCTET_LENGTH, ONLY, OUTER, OUTPUT,
+ OVERLAPS, PAD, PARTIAL, POSITION, PREPARE, PRESERVE, PRIOR, READ,
+ RELATIVE, RESTRICT, REVOKE, RIGHT, ROWS, SCROLL, SECOND, SESSION,
+ SESSION_USER, SIZE, SPACE, SQLSTATE, SUBSTRING, SYSTEM_USER,
+ TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE,
+ TRAILING, TRANSACTION, TRANSLATE, TRANSLATION, TRIM, TRUE, UNKNOWN,
+ UPPER, USAGE, USING, VALUE, VARCHAR, VARYING, WHEN, WRITE, YEAR, ZONE
+
+ From sql3part2.txt (Annex E)
+
+ ACTION, ACTOR, AFTER, ALIAS, ASYNC, ATTRIBUTES, BEFORE, BOOLEAN,
+ BREADTH, COMPLETION, CURRENT_PATH, CYCLE, DATA, DEPTH, DESTROY,
+ DICTIONARY, EACH, ELEMENT, ELSEIF, EQUALS, FACTOR, GENERAL, HOLD,
+ IGNORE, INSTEAD, LESS, LIMIT, LIST, MODIFY, NEW, NEW_TABLE, NO,
+ NONE, OFF, OID, OLD, OLD_TABLE, OPERATION, OPERATOR, OPERATORS,
+ PARAMETERS, PATH, PENDANT, POSTFIX, PREFIX, PREORDER, PRIVATE,
+ PROTECTED, RECURSIVE, REFERENCING, REPLACE, ROLE, ROUTINE, ROW,
+ SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SESSION, SIMILAR, SPACE,
+ SQLEXCEPTION, SQLWARNING, START, STATE, STRUCTURE, SYMBOL, TERM,
+ TEST, THERE, TRIGGER, TYPE, UNDER, VARIABLE, VIRTUAL, VISIBLE,
+ WAIT, WITHOUT
+
+ sql3part4.txt (ANNEX E):
+
+ CALL, DO, ELSEIF, EXCEPTION, IF, LEAVE, LOOP, OTHERS, RESIGNAL,
+ RETURN, RETURNS, SIGNAL, TUPLE, WHILE
diff --git a/fs_passwd/fs_passwd b/fs_passwd/fs_passwd
new file mode 100755
index 000000000..0b467aefc
--- /dev/null
+++ b/fs_passwd/fs_passwd
@@ -0,0 +1,129 @@
+#!/usr/bin/perl -Tw
+#
+# fs_passwd
+#
+# portions of this script are copied from the `passwd' script in the original
+# (perl 4) camel book, now archived at
+# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd
+#
+# ivan@sisd.com 98-mar-8
+#
+# password lengths 0,255 instead of 6,8 - we'll let the server process
+# check the data ivan@sisd.com 98-jul-17
+
+use strict;
+use Getopt::Std;
+use Socket;
+use IO::Handle;
+use vars qw($opt_f $opt_s);
+
+my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket";
+my($freeside_uid)=scalar(getpwnam('freeside'));
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+$SIG{__DIE__}= sub { system '/bin/stty', 'echo'; };
+
+die "passwd program isn't running setuid to freeside\n" if $> != $freeside_uid;
+
+unshift @ARGV, "-f" if $0 =~ /chfn$/;
+unshift @ARGV, "-s" if $0 =~ /chsh$/;
+
+getopts('fs');
+
+my($me)='';
+if ( $_ = shift(@ARGV) ) {
+ /^(\w{2,8})$/;
+ $me = $1;
+}
+die "You can't change the password for $me." if $me && $<;
+$me = (getpwuid($<))[0] unless $me;
+
+my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)=
+ getpwnam $me;
+
+my($old_password,$new_password,$new_gecos,$new_shell);
+
+if ( $opt_f || $opt_s ) {
+ system '/bin/stty', '-echo';
+ print "Password:";
+ $old_password=<STDIN>;
+ system '/bin/stty', 'echo';
+ chop($old_password);
+ #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
+ $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
+ $old_password = $1;
+
+ $new_password = '';
+
+ if ( $opt_f ) {
+ print "\nChanging gecos for $me.\n";
+ print "Gecos [", $gcos, "]: ";
+ $new_gecos=<STDIN>;
+ chop($new_gecos);
+ $new_gecos ||= $gcos;
+ $new_gecos =~ /^(.{0,255})$/ or die "\nIllegal gecos.\n";
+ } else {
+ $new_gecos = '';
+ }
+
+ if ( $opt_s ) {
+ print "\nChanging shell for $me.\n";
+ print "Shell [", $shell, "]: ";
+ $new_shell=<STDIN>;
+ chop($new_shell);
+ $new_shell ||= $shell;
+ $new_shell =~ /^(.{0,255})$/ or die "\nIllegal shell.\n";
+ } else {
+ $new_shell = '';
+ }
+
+} else {
+
+ print "Changing password for $me.\n";
+ print "Old password:";
+ system '/bin/stty', '-echo';
+ $old_password=<STDIN>;
+ chop $old_password;
+ #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
+ $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
+ $old_password = $1;
+ print "\nEnter the new password (minimum of 6, maximum of 8 characters)\n";
+ print "Please use a combination of upper and lowercase letters and numbers.\n";
+ print "New password:";
+ $new_password=<STDIN>;
+ chop($new_password);
+ #$new_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
+ $new_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
+ $new_password = $1;
+ print "\nRe-enter new password:";
+ my($check_new_password);
+ $check_new_password=<STDIN>;
+ chop($check_new_password);
+ die "\nThey don't match; try again.\n" unless $check_new_password eq $new_password;
+
+ $new_gecos='';
+ $new_shell='';
+}
+print "\n";
+
+system '/bin/stty', 'echo';
+
+socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+connect(SOCK, sockaddr_un($fs_passwdd_socket)) or die "connect: $!";
+print SOCK join("\n",$me,$old_password,$new_password,$new_gecos,$new_shell),"\n";
+SOCK->flush;
+my($error);
+$error = <SOCK>;
+chop $error;
+
+if ($error) {
+ print "\nUpdate error: $error\n";
+} else {
+ print "\nUpdate sucessful.\n";
+}
diff --git a/fs_passwd/fs_passwd.cgi b/fs_passwd/fs_passwd.cgi
new file mode 100755
index 000000000..3f676fff3
--- /dev/null
+++ b/fs_passwd/fs_passwd.cgi
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use Getopt::Std;
+use Socket;
+use IO::Handle;
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+
+my $fs_passwdd_socket = "/usr/local/freeside/fs_passwdd_socket";
+my $freeside_uid = scalar(getpwnam('freeside'));
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+die "fs_passwd.cgi isn't running as freeside user\n" if $> != $freeside_uid;
+
+my $cgi = new CGI;
+
+$cgi->param('username') =~ /^([^\n]{0,255}$)/ or die "Illegal username";
+my $me = $1;
+
+$cgi->param('old_password') =~ /^([^\n]{0,255}$)/ or die "Illegal old_password";
+my $old_password = $1;
+
+$cgi->param('new_password') =~ /^([^\n]{0,255}$)/ or die "Illegal new_password";
+my $new_password = $1;
+
+die "New passwords don't match"
+ unless $new_password eq $cgi->param('new_password2');
+
+socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+connect(SOCK, sockaddr_un($fs_passwdd_socket)) or die "connect: $!";
+print SOCK join("\n", $me, $old_password, $new_password, '', ''), "\n";
+SOCK->flush;
+my $error = <SOCK>;
+chomp $error;
+
+if ($error) {
+ die $error;
+} else {
+ print $cgi->header(), <<END;
+<html>
+ <head>
+ <title>Password changed</title>
+ </head>
+ <body bgcolor="#e8e8e8">
+ <h3>Password changed</h3>
+<br>Your password has been changed.
+ </body>
+</html>
+END
+}
diff --git a/fs_passwd/fs_passwd.html b/fs_passwd/fs_passwd.html
new file mode 100644
index 000000000..fadc4df8b
--- /dev/null
+++ b/fs_passwd/fs_passwd.html
@@ -0,0 +1,25 @@
+<html>
+ <head>
+ <title>Change password</title>
+ </head>
+ <body bgcolor="#e8e8e8">
+ <h3>Change password</h3>
+ <form action="/cgi-bin/fs_passwd.cgi" method="post">
+ <table bgcolor="#cccccc" border=0 cellspacing=2>
+ <tr><th align="right">Username</th>
+ <td><input type="text" name="username" size="18"></td>
+ </tr>
+ <tr><th align="right">Current password</th>
+ <td><input type="password" name="old_password" size="18"></td>
+ </tr>
+ <tr><th align="right">New password</th>
+ <td><input type="password" name="new_password" size="18"></td>
+ </tr>
+ <tr><th align="right">Re-enter new password</th>
+ <td><input type="password" name="new_password2" size="18"></td>
+ </tr>
+ </table>
+ <br><input type="submit" value="Change password">
+ </body>
+</html>
+
diff --git a/fs_passwd/fs_passwd_server b/fs_passwd/fs_passwd_server
new file mode 100755
index 000000000..a29b2c738
--- /dev/null
+++ b/fs_passwd/fs_passwd_server
@@ -0,0 +1,88 @@
+#!/usr/bin/perl -Tw
+#
+# fs_passwd_server
+#
+# portions of this script are copied from the `passwd' script in the original
+# (perl 4) camel book, now archived at
+# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd
+#
+# ivan@sisd.com 98-mar-9
+#
+# crypt-aware, s/password/_password/; ivan@sisd.com 98-aug-23
+
+use strict;
+use vars qw($pid);
+use subs qw(killssh);
+use IO::Handle;
+use Net::SSH qw(sshopen2);
+use FS::UID qw(adminsuidsetup);
+use FS::Record qw(qsearchs);
+use FS::svc_acct;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+my($shellmachine)=shift or die &usage;
+
+#causing trouble for some folks
+#$SIG{CHLD} = sub { wait() };
+
+$SIG{HUP} = \&killssh;
+$SIG{INT} = \&killssh;
+$SIG{QUIT} = \&killssh;
+$SIG{TERM} = \&killssh;
+$SIG{PIPE} = \&killssh;
+
+sub killssh { kill 'TERM', $pid if $pid; exit; };
+
+my($fs_passwdd)="/usr/local/sbin/fs_passwdd";
+
+while (1) {
+ my($reader,$writer)=(new IO::Handle, new IO::Handle);
+ $writer->autoflush(1);
+ $pid = sshopen2($shellmachine,$reader,$writer,$fs_passwdd);
+ while (1) {
+ my($username,$old_password,$new_password,$new_gecos,$new_shell);
+ defined($username=<$reader>) or last;
+ defined($old_password=<$reader>) or last;
+ defined($new_password=<$reader>) or last;
+ defined($new_gecos=<$reader>) or last;
+ defined($new_shell=<$reader>) or last;
+ chop($username);
+ chop($old_password);
+ chop($new_password);
+ chop($new_gecos);
+ chop($new_shell);
+ my($svc_acct);
+
+ #need to try both $old_password and encrypted $old_password
+ #maybe the crypt function in svc_acct.export needs to be a library?
+ my $salt = substr($old_password,0,2);
+ my $cold_password = crypt($old_password,$salt);
+ $svc_acct=qsearchs('svc_acct',{'username'=>$username,
+ '_password'=>$old_password,
+ } )
+ || qsearchs('svc_acct',{'username'=>$username,
+ '_password'=>$cold_password,
+ } );
+ unless ( $svc_acct ) { print $writer "Incorrect password.\n"; next; }
+
+ my(%hash)=$svc_acct->hash;
+ my($new_svc_acct) = new FS::svc_acct ( \%hash );
+ $new_svc_acct->setfield('_password',$new_password)
+ if $new_password && $new_password ne $old_password;
+ $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos;
+ $new_svc_acct->setfield('shell',$new_shell) if $new_shell;
+ my($error)=$new_svc_acct->replace($svc_acct);
+ print $writer $error,"\n";
+ }
+ close $writer;
+ close $reader;
+ sleep 60;
+ warn "Connection to $shellmachine lost! Reconnecting...\n";
+}
+
+sub usage {
+ die "Usage:\n\n fs_passwd_server user shellmachine\n";
+}
+
diff --git a/fs_passwd/fs_passwdd b/fs_passwd/fs_passwdd
new file mode 100755
index 000000000..cce98e787
--- /dev/null
+++ b/fs_passwd/fs_passwdd
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -Tw
+#
+# fs_passwdd
+#
+# This is run REMOTELY over ssh by fs_passwd_server.
+#
+# ivan@sisd.com 98-mar-9
+
+use strict;
+use Socket;
+
+my $fs_passwdd_socket = "/usr/local/freeside/fs_passwdd_socket";
+my $pid_file = "$fs_passwdd_socket.pid";
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+$|=1;
+
+my $uaddr = sockaddr_un($fs_passwdd_socket);
+my $proto = getprotobyname('tcp');
+
+socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
+unlink($fs_passwdd_socket);
+bind(Server, $uaddr) or die "bind: $!";
+listen(Server,SOMAXCONN) or die "listen: $!";
+
+if ( -e $pid_file ) {
+ open(PIDFILE,"<$pid_file");
+ #chomp( my $old_pid = <PIDFILE> );
+ my $old_pid = <PIDFILE>;
+ close PIDFILE;
+ $old_pid =~ /^(\d+)$/;
+ kill 'TERM', $1;
+}
+open(PIDFILE,">$pid_file");
+print PIDFILE "$$\n";
+close PIDFILE;
+
+my($paddr);
+for ( ; $paddr = accept(Client,Server); close Client) {
+ my($me,$old_password,$new_password,$new_gecos,$new_shell);
+
+ $me=<Client>;
+ $old_password=<Client>;
+ $new_password=<Client>;
+ $new_gecos=<Client>;
+ $new_shell=<Client>;
+
+ print $me,$old_password,$new_password,$new_gecos,$new_shell;
+ my($error);
+
+ $error=<STDIN>;
+
+ print Client $error;
+ close Client;
+}
+
diff --git a/fs_radlog/fs_radlogd b/fs_radlog/fs_radlogd
new file mode 100755
index 000000000..74c2af361
--- /dev/null
+++ b/fs_radlog/fs_radlogd
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -Tw
+#
+# ivan@sisd.com 98-mar-23
+
+use strict;
+use Date::Parse; #but hopefully not
+
+$|=1;
+
+my($file,$pos)=@_;
+open(FILE,"<$file") or die "Can't open $file: $!";
+seek(FILE,$pos,0) or die "Can't seek: $!";
+
+my($datestr);
+my(%param);
+
+$SIG{'HUP'} = sub { print "EOF\n"; exit; };
+
+while (1) {
+
+ while (<FILE>) {
+ next if /^$/;
+ if ( /^\S/ ) {
+ chop($datestr=$_);
+ undef %param;
+ } else {
+ warn "Unexpected line: $_";
+ }
+ while (<FILE>) {
+ if ( /^$/ ) {
+ #if ( $param{'Acct-Status-Type'} eq 'Stop' ) {
+ print join("\t",
+ tell FILE,
+ %param,
+ ),"\n";
+ #}
+ last;
+ } elsif ( /^\s+([\w\-]+)\s\=\s\"?([\w\.\-]+)\"?\s*$/ ) {
+ $param{$1}=$2;
+ } else {
+ warn "Unexpected line: $_";
+ }
+
+ }
+
+ }
+ sleep 1;
+ seek(FILE,0,1);
+}
+
+
diff --git a/fs_selfadmin/FS-MailAdminServer/MailAdminClient.pm b/fs_selfadmin/FS-MailAdminServer/MailAdminClient.pm
new file mode 100755
index 000000000..46cde4c0d
--- /dev/null
+++ b/fs_selfadmin/FS-MailAdminServer/MailAdminClient.pm
@@ -0,0 +1,541 @@
+package FS::MailAdminClient;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT_OK $fs_mailadmind_socket);
+use Exporter;
+use Socket;
+use FileHandle;
+use IO::Handle;
+
+$VERSION = '0.01';
+
+@ISA = qw( Exporter );
+@EXPORT_OK = qw( signup_info authenticate list_packages list_mailboxes delete_mailbox password_mailbox add_mailbox list_forwards list_pkg_forwards delete_forward add_forward new_customer );
+
+$fs_mailadmind_socket = "/usr/local/freeside/fs_mailadmind_socket";
+
+$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+my $freeside_uid = scalar(getpwnam('freeside'));
+die "not running as the freeside user\n" if $> != $freeside_uid;
+
+=head1 NAME
+
+FS::MailAdminClient - Freeside mail administration client API
+
+=head1 SYNOPSIS
+
+ use FS::MailAdminClient qw( signup_info list_mailboxes new_customer );
+
+ ( $locales, $packages, $pops ) = signup_info;
+
+ ( $accounts ) = list_mailboxes;
+
+ $error = new_customer ( {
+ 'first' => $first,
+ 'last' => $last,
+ 'ss' => $ss,
+ 'comapny' => $company,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'country' => $country,
+ 'daytime' => $daytime,
+ 'night' => $night,
+ 'fax' => $fax,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'invoicing_list' => $invoicing_list,
+ 'pkgpart' => $pkgpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'popnum' => $popnum,
+ } );
+
+=head1 DESCRIPTION
+
+This module provides an API for a remote mail administration server.
+
+It needs to be run as the freeside user. Because of this, the program which
+calls these subroutines should be written very carefully.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item signup_info
+
+Returns three array references of hash references.
+
+The first set of hash references is of allowable locales. Each hash reference
+has the following keys:
+ taxnum
+ state
+ county
+ country
+
+The second set of hash references is of allowable packages. Each hash
+reference has the following keys:
+ pkgpart
+ pkg
+
+The third set of hash references is of allowable POPs (Points Of Presence).
+Each hash reference has the following keys:
+ popnum
+ city
+ state
+ ac
+ exch
+
+=cut
+
+sub signup_info {
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "signup_info\n";
+ SOCK->flush;
+
+ chop ( my $n_cust_main_county = <SOCK> );
+ my @cust_main_county = map {
+ chop ( my $taxnum = <SOCK> );
+ chop ( my $state = <SOCK> );
+ chop ( my $county = <SOCK> );
+ chop ( my $country = <SOCK> );
+ {
+ 'taxnum' => $taxnum,
+ 'state' => $state,
+ 'county' => $county,
+ 'country' => $country,
+ };
+ } 1 .. $n_cust_main_county;
+
+ chop ( my $n_part_pkg = <SOCK> );
+ my @part_pkg = map {
+ chop ( my $pkgpart = <SOCK> );
+ chop ( my $pkg = <SOCK> );
+ {
+ 'pkgpart' => $pkgpart,
+ 'pkg' => $pkg,
+ };
+ } 1 .. $n_part_pkg;
+
+ chop ( my $n_svc_acct_pop = <SOCK> );
+ my @svc_acct_pop = map {
+ chop ( my $popnum = <SOCK> );
+ chop ( my $city = <SOCK> );
+ chop ( my $state = <SOCK> );
+ chop ( my $ac = <SOCK> );
+ chop ( my $exch = <SOCK> );
+ chop ( my $loc = <SOCK> );
+ {
+ 'popnum' => $popnum,
+ 'city' => $city,
+ 'state' => $state,
+ 'ac' => $ac,
+ 'exch' => $exch,
+ 'loc' => $loc,
+ };
+ } 1 .. $n_svc_acct_pop;
+
+ close SOCK;
+
+ \@cust_main_county, \@part_pkg, \@svc_acct_pop;
+}
+
+=item authenticate
+
+Authentictes against a service on the remote Freeside system. Requires a hash
+reference as a parameter with the following keys:
+ authuser
+ _password
+
+Returns a scalar error message of the form "authuser OK|FAILED" or an error
+message.
+
+=cut
+
+sub authenticate {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "authenticate", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser _password
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item list_packages
+
+Returns one array reference of hash references.
+
+The set of hash references is of existing packages. Each hash reference
+has the following keys:
+ pkgnum
+ domain
+ account
+
+=cut
+
+sub list_packages {
+ my $user = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "list_packages\n", $user, "\n";
+ SOCK->flush;
+
+ chop ( my $n_packages = <SOCK> );
+ my @packages = map {
+ chop ( my $pkgnum = <SOCK> );
+ chop ( my $domain = <SOCK> );
+ chop ( my $account = <SOCK> );
+ {
+ 'pkgnum' => $pkgnum,
+ 'domain' => $domain,
+ 'account' => $account,
+ };
+ } 1 .. $n_packages;
+
+ close SOCK;
+
+ \@packages;
+}
+
+=item list_mailboxes
+
+Returns one array references of hash references.
+
+The set of hash references is of existing accounts. Each hash reference
+has the following keys:
+ svcnum
+ username
+ _password
+
+=cut
+
+sub list_mailboxes {
+ my ($user, $package) = @_;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "list_mailboxes\n", $user, "\n", $package, "\n";
+ SOCK->flush;
+
+ chop ( my $n_svc_acct = <SOCK> );
+ my @svc_acct = map {
+ chop ( my $svcnum = <SOCK> );
+ chop ( my $username = <SOCK> );
+ chop ( my $_password = <SOCK> );
+ {
+ 'svcnum' => $svcnum,
+ 'username' => $username,
+ '_password' => $_password,
+ };
+ } 1 .. $n_svc_acct;
+
+ close SOCK;
+
+ \@svc_acct;
+}
+
+=item delete_mailbox
+
+Deletes a mailbox service from the remote Freeside system. Requires a hash
+reference as a paramater with the following keys:
+ authuser
+ account
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub delete_mailbox {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "delete_mailbox", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser account
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item password_mailbox
+
+Changes the password for a mailbox service on the remote Freeside system.
+ Requires a hash reference as a paramater with the following keys:
+ authuser
+ account
+ _password
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub password_mailbox {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "password_mailbox", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser account _password
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item add_mailbox
+
+Creates a mailbox service on the remote Freeside system. Requires a hash
+reference as a parameter with the following keys:
+ authuser
+ package
+ account
+ _password
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub add_mailbox {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "add_mailbox", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser package account _password
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item list_forwards
+
+Returns one array references of hash references.
+
+The set of hash references is of existing forwards. Each hash reference
+has the following keys:
+ svcnum
+ dest
+
+=cut
+
+sub list_forwards {
+ my ($user, $service) = @_;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "list_forwards\n", $user, "\n", $service, "\n";
+ SOCK->flush;
+
+ chop ( my $n_svc_forward = <SOCK> );
+ my @svc_forward = map {
+ chop ( my $svcnum = <SOCK> );
+ chop ( my $dest = <SOCK> );
+ {
+ 'svcnum' => $svcnum,
+ 'dest' => $dest,
+ };
+ } 1 .. $n_svc_forward;
+
+ close SOCK;
+
+ \@svc_forward;
+}
+
+=item list_pkg_forwards
+
+Returns one array references of hash references.
+
+The set of hash references is of existing forwards. Each hash reference
+has the following keys:
+ svcnum
+ srcsvc
+ dest
+
+=cut
+
+sub list_pkg_forwards {
+ my ($user, $package) = @_;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "list_pkg_forwards\n", $user, "\n", $package, "\n";
+ SOCK->flush;
+
+ chop ( my $n_svc_forward = <SOCK> );
+ my @svc_forward = map {
+ chop ( my $svcnum = <SOCK> );
+ chop ( my $srcsvc = <SOCK> );
+ chop ( my $dest = <SOCK> );
+ {
+ 'svcnum' => $svcnum,
+ 'srcsvc' => $srcsvc,
+ 'dest' => $dest,
+ };
+ } 1 .. $n_svc_forward;
+
+ close SOCK;
+
+ \@svc_forward;
+}
+
+=item delete_forward
+
+Deletes a forward service from the remote Freeside system. Requires a hash
+reference as a paramater with the following keys:
+ authuser
+ svcnum
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub delete_forward {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "delete_forward", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser svcnum
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item add_forward
+
+Creates a forward service on the remote Freeside system. Requires a hash
+reference as a parameter with the following keys:
+ authuser
+ package
+ source
+ dest
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub add_forward {
+ my $hashref = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "add_forward", "\n";
+ SOCK->flush;
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ authuser package source dest
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ close SOCK;
+
+ $error;
+}
+
+=item new_customer HASHREF
+
+Adds a customer to the remote Freeside system. Requires a hash reference as
+a paramater with the following keys:
+ first
+ last
+ ss
+ comapny
+ address1
+ address2
+ city
+ county
+ state
+ zip
+ country
+ daytime
+ night
+ fax
+ payby
+ payinfo
+ paydate
+ payname
+ invoicing_list
+ pkgpart
+ username
+ _password
+ popnum
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub new_customer {
+ my $hashref = shift;
+
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_mailadmind_socket)) or die "connect: $!";
+ print SOCK "new_customer\n";
+
+ print SOCK join("\n", map { $hashref->{$_} } qw(
+ first last ss company address1 address2 city county state zip country
+ daytime night fax payby payinfo paydate payname invoicing_list
+ pkgpart username _password popnum
+ ) ), "\n";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ $error;
+}
+
+=back
+
+=head1 VERSION
+
+$Id: MailAdminClient.pm,v 1.1 2001-10-18 15:04:54 jeff Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<fs_signupd>, L<FS::SignupServer>, L<FS::cust_main>
+
+=cut
+
+1;
+
diff --git a/fs_selfadmin/FS-MailAdminServer/cgi/mailadmin.cgi b/fs_selfadmin/FS-MailAdminServer/cgi/mailadmin.cgi
new file mode 100755
index 000000000..c26c3dc42
--- /dev/null
+++ b/fs_selfadmin/FS-MailAdminServer/cgi/mailadmin.cgi
@@ -0,0 +1,698 @@
+#!/usr/bin/perl
+########################################################################
+# #
+# mailadmin.cgi NCI2000 #
+# Jeff Finucane <jeff@nci2000.net> #
+# 26 April 2001 #
+# #
+########################################################################
+
+use DBI;
+use strict;
+use CGI;
+use FS::MailAdminClient qw(authenticate list_packages list_mailboxes delete_mailbox password_mailbox add_mailbox list_forwards list_pkg_forwards delete_forward add_forward);
+
+my $sessionfile = '/usr/local/apache/htdocs/mailadmin/adminsess'; # session file
+my $tmpdir = '/usr/local/apache/htdocs/mailadmin/tmp'; # Location to store temp files
+my $cookiedomain = ".your.dom"; # domain if THIS server, should prepend with a '.'
+my $cookieexpire = '+12h'; # expire the cookie session after this much idle time
+my $sessexpire = 43200; # expire session after this long of no use (in seconds)
+
+my $body = "<body bgcolor=dddddd>";
+
+#### Should not have to change anything under this line ####
+my $printmainpage = 1;
+my $i = 0;
+my $printheader = 1;
+my $query = new CGI;
+my $cgi = $query->url();
+my $now = getdatetime();
+my $current_package = 0;
+my $current_account = 0;
+my $current_domname = "";
+
+# if they are trying to login we wont check the session yet
+if ($query->param('login') eq '' && $query->param('action') ne 'login') {
+ checksession();
+ printheader();
+}
+
+if ($query->param('login') ne '') {
+
+ my $username = $query->param('username');
+ my $password = $query->param('password');
+
+ if (!checkuserpass($username, $password)) {
+ printheader();
+ error('not_admin');
+ }
+
+ my @alpha = ('A'..'Z', 'a'..'z', 0..9);
+ my $sessid = '';
+ for (my $i = 0; $i < 10; $i++) {
+ $sessid .= @alpha[rand(@alpha)];
+ }
+
+ my $cookie1 = $query->cookie(-name=>'username',
+ -value=>$username,
+ -expires=>$cookieexpire,
+ -domain=>$cookiedomain);
+
+ my $cookie2 = $query->cookie(-name=>'ma_sessionid',
+ -value=>$sessid,
+ -expires=>$cookieexpire,
+ -domain=>$cookiedomain);
+
+ my $now = time();
+ open(NEWSESS, ">>$sessionfile") || error('open');
+ print NEWSESS "$username $sessid $now 0 0\n";
+ close(NEWSESS);
+
+ print $query->header(-COOKIE=>[$cookie1, $cookie2]);
+
+ $printmainpage = 1;
+
+} elsif ($query->param('action') eq 'blankframe') {
+
+ print "<html>$body</body></html>\n";
+ $printmainpage = 0;
+
+} elsif ($query->param('action') eq 'list_packages') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ my $list = list_packages($username);
+ print "<html>$body\n";
+ print "<center><table border=0>\n";
+ print "<tr><td></td><td><p>Package Number</td><td><p>Description</td></tr>\n";
+ foreach my $package ( @{$list} ) {
+ print "<tr>";
+ print "<td></td><td><p>$package->{'pkgnum'}</td><td><p>$package->{'domain'}</td>\n";
+ print "<td></td><td><a href=\"$cgi\?action=select&package=$package->{'pkgnum'}&account=$package->{'account'}&domname=$package->{'domain'}\" target=\"rightmainframe\">select</td>\n";
+ print "</tr>";
+ }
+ print "</table>\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'list_mailboxes') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $list = list_mailboxes($username, $current_package);
+ my $forwardlist = list_pkg_forwards($username, $current_package);
+ print "<html>$body\n";
+ print "<center><table border=0>\n";
+ print "<tr><td></td><td><p>Username</td><td><p>Password</td></tr>\n";
+ foreach my $account ( @{$list} ) {
+ print "<tr>";
+ print "<td></td><td><p>$account->{'username'}</td><td><p>$account->{'_password'}</td>\n";
+ print "<td></td><td><a href=\"$cgi\?action=change&account=$account->{'svcnum'}&mailbox=$account->{'username'}\" target=\"rightmainframe\">change</td>\n";
+ print "</tr>";
+
+# my $forwardlist = list_forwards($username, $account->{'svcnum'});
+# foreach my $forward ( @{$forwardlist} ) {
+# my $label = qq!=> ! . $forward->{'dest'};
+# print "<tr><td></td><td></td><td><p>$label</td></tr>\n";
+# }
+ foreach my $forward ( @{$forwardlist} ) {
+ if ($forward->{'srcsvc'} == $account->{'svcnum'}) {
+ my $label = qq!=> ! . $forward->{'dest'};
+ print "<tr><td></td><td></td><td><p>$label</td></tr>\n";
+ }
+ }
+
+ }
+ print "</table>\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'select') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ $current_package = $query->param('package');
+ $current_account = $query->param('account');
+ $current_domname = $query->param('domname');
+ set_package();
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<center>\n";
+ print "<p>Selected package $current_package\n";
+ print "</center>\n";
+ print "</form>\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'change') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $mailbox = $query->param('mailbox');
+ my $list = list_forwards($username, $account);
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<center><table border=0>\n";
+ print "<tr><td></td><td><p>Username</td><td><p>$mailbox</td></tr>\n";
+ print "<input type=hidden name=\"account\" value=\"$account\">\n";
+ print "<input type=hidden name=\"mailbox\" value=\"$mailbox\">\n";
+ foreach my $forward ( @{$list} ) {
+ my $label = qq!=> ! . $forward->{'dest'};
+# print "<tr><td></td><td></td><td><p>$label</td></tr>\n";
+ print "<tr><td></td><td></td><td><p>$label</td><td><a href=\"$cgi\?action=deleteforward&service=$forward->{'svcnum'}&mailbox=$mailbox&dest=$forward->{'dest'}\" target=\"rightmainframe\">remove</td></tr>\n";
+ }
+ print "<tr><td></td><td><p>Password</td><td><input type=text name=\"_password\" value=\"\"></td></tr>\n";
+ print "</table>\n";
+ print "<input type=submit name=\"deleteaccount\" value=\"Delete This User\">\n";
+ print "<input type=submit name=\"changepassword\" value=\"Change The Password\">\n";
+ print "<input type=submit name=\"addforward\" value=\"Add Forwarding\">\n";
+ print "</center>\n";
+ print "</form>\n";
+ print "<br>\n";
+ print "<p> You may delete this user and all mailforwarding by pressing <B>Delete This User</B>.\n";
+ print "<p> To set or change the password for this user, type the new password in the box next to <B>Password</B> and press <B>Change The Password</B>.\n";
+ print "<p> If you would like to have mail destined for this user forwarded to another email address then press the <B>Add Forwarding</B> button.\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('deleteaccount') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $mailbox = $query->param('mailbox');
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<p>Are you certain you want to delete user $mailbox?\n";
+ print "<p><input type=hidden name=\"account\" value=\"$account\">\n";
+ print "<input type=submit name=\"deleteaccounty\" value=\"Confirm\">\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('deleteaccounty') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+
+ if ( my $error = delete_mailbox ( {
+ 'authuser' => $username,
+ 'account' => $account,
+ } ) ) {
+ print "<html>$body\n";
+ print "<p>$error\n";
+ print "</body></html>\n";
+
+ } else {
+ print "<html>$body\n";
+ print "<p>Deleted\n";
+ print "</body></html>\n";
+ }
+
+ $printmainpage=0;
+
+} elsif ($query->param('changepassword') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $_password = $query->param('_password');
+
+ if ( my $error = password_mailbox ( {
+ 'authuser' => $username,
+ 'account' => $account,
+ '_password' => $_password,
+ } ) ) {
+ print "<html>$body\n";
+ print "<p>$error\n";
+ print "</body></html>\n";
+
+ } else {
+ print "<html>$body\n";
+ print "<p>Changed\n";
+ print "</body></html>\n";
+ }
+
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'newmailbox') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<center><table border=0>\n";
+ print "<tr><td></td><td><p>Username </td><td><input type=text name=\"account\" value=\"\"></td><td>@ " . $current_domname . "</td></tr>\n";
+ print "<tr><td></td><td><p>Password</td><td><input type=text name=\"_password\" value=\"\"></td></tr>\n";
+ print "</table>\n";
+ print "<input type=submit name=\"addmailbox\" value=\"Add This User\">\n";
+ print "</center>\n";
+ print "</form>\n";
+ print "<br>\n";
+ print "<p>Use this screen to add a new mailbox user. If the domain name of the email address (the part after the <B>@</B> sign) is not what you expect then you may need to use <B>List Packages</B> to select the package with the correct domain.\n";
+ print "<p>Enter the first portion of the email address in the box adjacent to <B>Username</B> and enter the password for that user in the space next to <B>Password</B>. Then press the button labeled <B>Add The User</B>.\n";
+ print "<p>If you do not want to add a new user at this time then select a choice from the menu at the left, such as <B>List Mailboxes</B>.\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('addmailbox') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $_password = $query->param('_password');
+
+ if ( my $error = add_mailbox ( {
+ 'authuser' => $username,
+ 'package' => $current_package,
+ 'account' => $account,
+ '_password' => $_password,
+ } ) ) {
+ print "<html>$body\n";
+ print "<p>$error\n";
+ print "</body></html>\n";
+
+ } else {
+ print "<html>$body\n";
+ print "<p>Created\n";
+ print "</body></html>\n";
+ }
+
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'deleteforward') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $svcnum = $query->param('service');
+ my $mailbox = $query->param('mailbox');
+ my $dest = $query->param('dest');
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<p>Are you certain you want to remove the forwarding from $mailbox to $dest?\n";
+ print "<p><input type=hidden name=\"service\" value=\"$svcnum\">\n";
+ print "<input type=submit name=\"deleteforwardy\" value=\"Confirm\">\n";
+ print "</body></html>\n";
+ $printmainpage=0;
+
+} elsif ($query->param('deleteforwardy') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $service = $query->param('service');
+
+ if ( my $error = delete_forward ( {
+ 'authuser' => $username,
+ 'svcnum' => $service,
+ } ) ) {
+ print "<html>$body\n";
+ print "<p>$error\n";
+ print "</body></html>\n";
+
+ } else {
+ print "<html>$body\n";
+ print "<p>Forwarding Removed\n";
+ print "</body></html>\n";
+ }
+
+ $printmainpage=0;
+
+} elsif ($query->param('addforward') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $mailbox = $query->param('mailbox');
+
+ print "<html>$body\n";
+ print "<form name=form1 action=\"$cgi\" method=post target=\"rightmainframe\">\n";
+ print "<center><table border=0>\n";
+ print "<input type=hidden name=\"account\" value=\"$account\">\n";
+ print "<input type=hidden name=\"mailbox\" value=\"$mailbox\">\n";
+ print "<tr><td>Forward mail from </td><td><p>$mailbox:</td><td> to </td></tr>\n";
+ print "<tr><td></td><td><p>Destination:</td><td><input type=text name=\"dest\" value=\"\"></td></tr>\n";
+ print "</table>\n";
+ print "<input type=submit name=\"addforwarddst\" value=\"Add the Forwarding\">\n";
+ print "</center>\n";
+ print "</form>\n";
+ print "<br>\n";
+ print "<p> If you would like mail originally destined for the above address to be forwarded to a different email address then type that email address in the box next to <B>Destination:</B> and press the <B>Add the Forwarding</B> button.\n";
+ print "<p> If you do not want to add mail forwarding then select a choice from the menu at the left, such as <B>List Accounts</B>.\n";
+
+ $printmainpage=0;
+
+} elsif ($query->param('addforwarddst') ne '') {
+
+ my $username = $query->cookie(-name=>'username'); # session checked
+ select_package($username) unless $current_package;
+ my $account = $query->param('account');
+ my $dest = $query->param('dest');
+
+ if ( my $error = add_forward ( {
+ 'authuser' => $username,
+ 'package' => $current_package,
+ 'source' => $account,
+ 'dest' => $dest,
+ } ) ) {
+ print "<html>$body\n";
+ print "<p>$error\n";
+ print "</body></html>\n";
+
+ } else {
+ print "<html>$body\n";
+ print "<p>Forwarding Created\n";
+ print "</body></html>\n";
+ }
+
+ $printmainpage=0;
+
+} elsif ($query->param('action') eq 'navframe') {
+
+ print "<html><body bgcolor=bbbbbb>\n";
+ print "<center><h2>NCI2000 MAIL ADMIN Web Interface</h2></center>\n";
+
+ print "<br><center>Choose Action:</center><br>\n";
+ print "<center><table border=0>\n";
+ print "<ul>\n";
+ print "<tr><td><li><a href=\"$cgi\?action=logout\" target=\"_top\">Log Off</a></td><tr>\n";
+ print "<tr><td><li><a href=\"$cgi\?action=list_packages\" target=\"rightmainframe\">List Packages</a></td><tr>\n";
+ print "<tr><td><li><a href=\"$cgi\?action=list_mailboxes\" target=\"rightmainframe\">List Accounts</a></td><tr>\n";
+ print "<tr><td><li><a href=\"$cgi\?action=newmailbox\" target=\"rightmainframe\">Add Account</a></td><tr>\n";
+ print "</ul>\n";
+ print "</table></center>\n";
+
+ print "<br><br><br>\n";
+ print "</body></html>\n";
+
+ $printmainpage = 0;
+
+} elsif ($query->param('action') eq 'rightmainframe') {
+
+ print "<html>$body\n";
+ print "<br><br><br>\n";
+ print "<font size=4><----- Please choose function on the left menu</font>\n";
+ print "<br><br>\n";
+ print "<p> Choose <B>Log Off</B> when you are finished. This helps prevent unauthorized access to your accounts.\n";
+ print "<p> Use <B>List Packages</B> when you administer multiple packages. When you have multiple domains at NCI2000 you are likely to have multiple packages. Use of <B>List Packages</B> is not necessary if administer only one package.\n";
+ print "<p> Use <B>List Accounts</B> to view your current arrangement of mailboxes. From this list you my choose to make changes to existing mailboxes or delete mailboxes. If you would like to modify the forwarding associated with a mailbox then choose it from this list.\n";
+ print "<p> Use <B>Add Account</B> when you would like an additional mailbox. After you have added the mailbox you may choose to make additional changes from the list provided by <B>List Accounts<B>.\n";
+ print "</body></html>\n";
+
+ $printmainpage = 0;
+
+}
+
+
+if ($query->param('action') eq 'login') {
+
+ printheader();
+ printlogin();
+
+} elsif ($query->param('action') eq 'logout') {
+
+ destroysession();
+ printheader();
+ printlogin();
+
+} elsif ($printmainpage) {
+
+
+ print "<html><head><title>NCI2000 MAIL ADMIN Web Interface</title></head>\n";
+ print "<FRAMESET cols=\"160,*\" BORDER=\"3\">\n";
+ print "<FRAME NAME=\"navframe\" src=\"$cgi?action=navframe\">\n";
+ print "<FRAME NAME=\"rightmainframe\" src=\"$cgi?action=rightmainframe\">\n";
+ print "</FRAMESET>\n";
+ print "</html>\n";
+
+
+}
+
+sub getdatetime {
+ my $today = localtime(time());
+ my ($day,$mon,$dayofmon,$time,$year) = split(/\s+/,$today);
+ my @datemonths = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
+
+ my $numidx = "01";
+ my ($nummon);
+ foreach my $mons (@datemonths) {
+ if ($mon eq $mons) {
+ $nummon = $numidx;
+ }
+ $numidx++;
+ }
+
+ return "$year-$nummon-$dayofmon $time";
+
+}
+
+sub error {
+
+ my $error = shift;
+ my $arg1 = shift;
+
+ printheader();
+
+ if ($error eq 'not_admin') {
+ print "<html><head><title>Error!</title></head>\n";
+ print "$body\n";
+ print "<center><h1><font face=arial>Error!</font></h1></center>\n";
+ print "<font face=arial>Unauthorized attempt to access mail administration.</font>\n";
+ print "<br><font face=arial>Please login again if you think this is an error.</font>\n";
+ print "<form><input type=button value=\"<<Back\" OnClick=\"history.back()\"></form>\n";
+ print "</body></html>\n";
+ } elsif ($error eq 'exists') {
+ print "<html><head><title>Error!</title></head>\n";
+ print "$body\n";
+ print "<center><h1><font face=arial>Error!</font></h1></center>\n";
+ print "<font face=arial>The user you are trying to enter already exists. Please go back and enter a different username</font>\n";
+ print "</font></body></html>\n";
+ } elsif ($error eq 'ingroup') {
+ print "<html><head><title>Error!</title></head>\n";
+ print "$body\n";
+ print "<center><h1><font face=arial>Error!</font></h1></center>\n";
+ print "<font face=arial>This user is already in the group <i>$arg1</i>. Please go back and deselect group <i>$arg1</i> from the list.</font>\n";
+ print "<form><input type=button value=\"<<Back\" OnClick=\"history.back()\"></form>\n";
+ print "</font></body></html>\n";
+ } elsif ($error eq 'sess_expired') {
+ print "<html>$body\n";
+ print "<center><font size=4>Your session has expired.</font></center>\n";
+ print "<br><br><center>Please login again <a href=\"$cgi\?action=login\" target=\"_top\"> HERE</a></center>\n";
+ print "</body></html>\n";
+ } elsif ($error eq 'open') {
+ print "<html>$body\n";
+ print "<center><font size=4>Unable to open or rename file.</font></center>\n";
+ print "<br><br><center>If this continues, please contact your administrator</center>\n";
+ print "</body></html>\n";
+ }
+
+
+ exit;
+
+}
+
+
+#print a html header if not printed yet
+sub printheader {
+
+ if ($printheader) {
+ print "Content-Type: text/html\n\n";
+ $printheader = 0;
+ }
+
+}
+
+
+#verify user can access administration
+sub checksession {
+
+ my $username = $query->cookie(-name=>'username');
+ my $sessionid = $query->cookie(-name=>'ma_sessionid');
+
+ if ($sessionid eq '') {
+ printheader();
+ if ($query->param()) {
+ error('sess_expired');
+ } else {
+ printlogin();
+ exit;
+ }
+ }
+
+ my $now = time();
+ my $founduser = 0;
+ open(SESSFILE, "$sessionfile") || error('open');
+ error('open') if -l "$tmpdir/adminsess.$$";
+ open(NEWSESS, ">$tmpdir/adminsess.$$") || error('open');
+ while (<SESSFILE>) {
+ chomp();
+ my ($user, $sess, $time, $pkgnum, $svcdomain, $domname) = split(/\s+/);
+ next if $now - $sessexpire > $time;
+ if ($username eq $user && !$founduser) {
+ if ($sess eq $sessionid) {
+ $founduser = 1;
+ print NEWSESS "$user $sess $now $pkgnum $svcdomain $domname\n";
+ $current_package=$pkgnum;
+ $current_account=$svcdomain;
+ $current_domname=$domname;
+ next;
+ }
+ }
+ print NEWSESS "$user $sess $time $pkgnum $svcdomain $domname\n";
+ }
+ close(SESSFILE);
+ close(NEWSESS);
+ system("mv $tmpdir/adminsess.$$ $sessionfile");
+ error('sess_expired') unless $founduser;
+
+ my $cookie1 = $query->cookie(-name=>'username',
+ -value=>$username,
+ -expires=>$cookieexpire,
+ -domain=>$cookiedomain);
+
+ my $cookie2 = $query->cookie(-name=>'ma_sessionid',
+ -value=>$sessionid,
+ -expires=>$cookieexpire,
+ -domain=>$cookiedomain);
+
+ print $query->header(-COOKIE=>[$cookie1, $cookie2]);
+
+ $printheader = 0;
+
+ return 0;
+
+}
+
+sub destroysession {
+
+ my $username = $query->cookie(-name=>'username');
+ my $sessionid = $query->cookie(-name=>'ma_sessionid');
+
+ if ($sessionid eq '') {
+ printheader();
+ if ($query->param()) {
+ error('sess_expired');
+ } else {
+ printlogin();
+ exit;
+ }
+ }
+
+ my $now = time();
+ my $founduser = 0;
+ open(SESSFILE, "$sessionfile") || error('open');
+ error('open') if -l "$tmpdir/adminsess.$$";
+ open(NEWSESS, ">$tmpdir/adminsess.$$") || error('open');
+ while (<SESSFILE>) {
+ chomp();
+ my ($user, $sess, $time, $pkgnum, $svcdomain, $domname) = split(/\s+/);
+ next if $now - $sessexpire > $time;
+ if ($username eq $user && !$founduser) {
+ if ($sess eq $sessionid) {
+ $founduser = 1;
+ next;
+ }
+ }
+ print NEWSESS "$user $sess $time $pkgnum $svcdomain $domname\n";
+ }
+ close(SESSFILE);
+ close(NEWSESS);
+ system("mv $tmpdir/adminsess.$$ $sessionfile");
+ error('sess_expired') unless $founduser;
+
+ $printheader = 0;
+
+ return 0;
+
+}
+
+# checks the username and pass against the database
+sub checkuserpass {
+
+ my $username = shift;
+ my $password = shift;
+
+ my $error = authenticate ( {
+ 'authuser' => $username,
+ '_password' => $password,
+ } );
+
+ if ($error eq "$username OK") {
+ return 1;
+ }else{
+ return 0;
+ }
+
+}
+
+#printlogin prints a login page
+sub printlogin {
+
+ print "<html>$body\n";
+ print "<center><font size=4>Please login to access MAIL ADMIN</font></center>\n";
+ print "<form action=\"$cgi\" method=post>\n";
+ print "<center>Email Address: &nbsp; <input type=text name=\"username\">\n";
+ print "<br>Email Password: <input type=password name=\"password\">\n";
+ print "<br><input type=submit name=\"login\" value=\"Login\">\n";
+ print "</form></center>\n";
+ print "</body></html>\n";
+}
+
+
+#select_package chooses a administrable package if more than one exists
+sub select_package {
+ my $user = shift;
+ my $packages = list_packages($user);
+ if (scalar(@{$packages}) eq 1) {
+ $current_package = @{$packages}[0]->{'pkgnum'};
+ set_package();
+ }
+ if (scalar(@{$packages}) > 1) {
+# print $query->redirect("$cgi\?action=list_packages");
+ print "<p>No package selected. You must first <a href=\"$cgi\?action=list_packages\" target=\"rightmainframe\">select a package</a>.\n";
+ exit;
+ }
+}
+
+sub set_package {
+
+ my $username = $query->cookie(-name=>'username');
+ my $sessionid = $query->cookie(-name=>'ma_sessionid');
+
+ if ($sessionid eq '') {
+ printheader();
+ if ($query->param()) {
+ error('sess_expired');
+ } else {
+ printlogin();
+ exit;
+ }
+ }
+
+ my $now = time();
+ my $founduser = 0;
+ open(SESSFILE, "$sessionfile") || error('open');
+ error('open') if -l "$tmpdir/adminsess.$$";
+ open(NEWSESS, ">$tmpdir/adminsess.$$") || error('open');
+ while (<SESSFILE>) {
+ chomp();
+ my ($user, $sess, $time, $pkgnum, $svcdomain, $domname) = split(/\s+/);
+ next if $now - $sessexpire > $time;
+ if ($username eq $user && !$founduser) {
+ if ($sess eq $sessionid) {
+ $founduser = 1;
+ print NEWSESS "$user $sess $time $current_package $current_account $current_domname\n";
+ next;
+ }
+ }
+ print NEWSESS "$user $sess $time $pkgnum $svcdomain $domname\n";
+ }
+ close(SESSFILE);
+ close(NEWSESS);
+ system("mv $tmpdir/adminsess.$$ $sessionfile");
+ error('sess_expired') unless $founduser;
+
+ $printheader = 0;
+
+ return 0;
+
+}
+
diff --git a/fs_selfadmin/FS-MailAdminServer/fs_mailadmind b/fs_selfadmin/FS-MailAdminServer/fs_mailadmind
new file mode 100755
index 000000000..746d7822e
--- /dev/null
+++ b/fs_selfadmin/FS-MailAdminServer/fs_mailadmind
@@ -0,0 +1,366 @@
+#!/usr/bin/perl -Tw
+
+eval 'exec /usr/bin/perl -Tw -S $0 ${1+"$@"}'
+ if 0; # not running under some shell
+#
+# fs_mailadmind
+#
+# This is run REMOTELY over ssh by fs_mailadmin_server.
+#
+
+use strict;
+use Socket;
+
+use vars qw( $Debug );
+
+$Debug = 0;
+
+my($fs_mailadmind_socket)="/usr/local/freeside/fs_mailadmind_socket";
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+$|=1;
+
+warn "[fs_mailadmind] Reading locales...\n" if $Debug;
+chomp( my $n_cust_main_county = <STDIN> );
+my @cust_main_county = map {
+ chomp( my $taxnum = <STDIN> );
+ chomp( my $state = <STDIN> );
+ chomp( my $county = <STDIN> );
+ chomp( my $country = <STDIN> );
+ {
+ 'taxnum' => $taxnum,
+ 'state' => $state,
+ 'county' => $county,
+ 'country' => $country,
+ };
+} ( 1 .. $n_cust_main_county );
+
+warn "[fs_mailadmind] Reading package definitions...\n" if $Debug;
+chomp( my $n_part_pkg = <STDIN> );
+my @part_pkg = map {
+ chomp( my $pkgpart = <STDIN> );
+ chomp( my $pkg = <STDIN> );
+ {
+ 'pkgpart' => $pkgpart,
+ 'pkg' => $pkg,
+ };
+} ( 1 .. $n_part_pkg );
+
+warn "[fs_mailadmind] Reading POPs...\n" if $Debug;
+chomp( my $n_svc_acct_pop = <STDIN> );
+my @svc_acct_pop = map {
+ chomp( my $popnum = <STDIN> );
+ chomp( my $city = <STDIN> );
+ chomp( my $state = <STDIN> );
+ chomp( my $ac = <STDIN> );
+ chomp( my $exch = <STDIN> );
+ chomp( my $loc = <STDIN> );
+ {
+ 'popnum' => $popnum,
+ 'city' => $city,
+ 'state' => $state,
+ 'ac' => $ac,
+ 'exch' => $exch,
+ 'loc' => $loc,
+ };
+} ( 1 .. $n_svc_acct_pop );
+
+warn "[fs_mailadmind] Creating $fs_mailadmind_socket\n" if $Debug;
+my $uaddr = sockaddr_un($fs_mailadmind_socket);
+my $proto = getprotobyname('tcp');
+socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
+unlink($fs_mailadmind_socket);
+bind(Server, $uaddr) or die "bind: $!";
+listen(Server,SOMAXCONN) or die "listen: $!";
+
+warn "[fs_mailadmind] Entering main loop...\n" if $Debug;
+my $paddr;
+for ( ; $paddr = accept(Client,Server); close Client) {
+
+ chop( my $command = <Client> );
+
+ if ( $command eq "signup_info" ) {
+ warn "[fs_mailadmind] sending signup info...\n" if $Debug;
+ print Client join("\n", $n_cust_main_county,
+ map {
+ $_->{taxnum},
+ $_->{state},
+ $_->{county},
+ $_->{country},
+ } @cust_main_county
+ ), "\n";
+
+ print Client join("\n", $n_part_pkg,
+ map {
+ $_->{pkgpart},
+ $_->{pkg},
+ } @part_pkg
+ ), "\n";
+
+ print Client join("\n", $n_svc_acct_pop,
+ map {
+ $_->{popnum},
+ $_->{city},
+ $_->{state},
+ $_->{ac},
+ $_->{exch},
+ $_->{loc},
+ } @svc_acct_pop
+ ), "\n";
+
+ } elsif ( $command eq "new_customer" ) {
+ warn "[fs_mailadmind] reading customer signup...\n" if $Debug;
+ my(
+ $first, $last, $ss, $company, $address1, $address2, $city, $county,
+ $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
+ $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
+ $popnum,
+ ) = map { scalar(<Client>) } ( 1 .. 23 );
+
+ warn "[fs_mailadmind] sending customer data to remote server...\n" if $Debug;
+ print
+ $first, $last, $ss, $company, $address1, $address2, $city, $county,
+ $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
+ $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
+ $popnum,
+ ;
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "authenticate" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading authentication material...\n" if $Debug;
+ chop( my $password = <Client> );
+ warn "[fs_mailadmind] sending information to remote server...\n" if $Debug;
+ print "authenticate\n", $user, "\n", $password, "\n";
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "list_packages" ) {
+ warn "[fs_mailadmind] reading user information to list_packages...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] sending user information to remote server...\n" if $Debug;
+ print "list_packages\n", $user, "\n";
+
+ warn "[fs_mailadmind] reading data from remote server...\n" if $Debug;
+ chomp( my $n_packages = <STDIN> );
+ my @packages = map {
+ chomp( my $pkgnum = <STDIN> );
+ chomp( my $domain = <STDIN> );
+ chomp( my $account = <STDIN> );
+ {
+ 'pkgnum' => $pkgnum,
+ 'domain' => $domain,
+ 'account' => $account,
+ };
+ } ( 1 .. $n_packages );
+
+ warn "[fs_mailadmind] sending data to local client...\n" if $Debug;
+
+ print Client join("\n", $n_packages,
+ map {
+ $_->{pkgnum},
+ $_->{domain},
+ $_->{account},
+ } @packages
+ ), "\n";
+
+ } elsif ( $command eq "list_mailboxes" ) {
+ warn "[fs_mailadmind] reading user information to list_mailboxes...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading package number to list_mailboxes...\n" if $Debug;
+ chop( my $package = <Client> );
+ warn "[fs_mailadmind] sending user information to remote server...\n" if $Debug;
+ print "list_mailboxes\n", $user, "\n", $package, "\n";
+
+ warn "[fs_mailadmind] reading data from remote server...\n" if $Debug;
+ chomp( my $n_svc_acct = <STDIN> );
+ my @svc_acct = map {
+ chomp( my $svcnum = <STDIN> );
+ chomp( my $username = <STDIN> );
+ chomp( my $_password = <STDIN> );
+ {
+ 'svcnum' => $svcnum,
+ 'username' => $username,
+ '_password' => $_password,
+ };
+ } ( 1 .. $n_svc_acct );
+
+ warn "[fs_mailadmind] sending data to local client...\n" if $Debug;
+
+ print Client join("\n", $n_svc_acct,
+ map {
+ $_->{svcnum},
+ $_->{username},
+ $_->{_password},
+ } @svc_acct
+ ), "\n";
+
+ } elsif ( $command eq "delete_mailbox" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading account information to delete...\n" if $Debug;
+ chop( my $account = <Client> );
+ warn "[fs_mailadmind] sending information to remote server...\n" if $Debug;
+ print "delete_mailbox\n", $user, "\n", $account, "\n";
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "password_mailbox" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading account information to password...\n" if $Debug;
+ my(
+ $account, $_password,
+ ) = map { scalar(<Client>) } ( 1 .. 2 );
+
+ warn "[fs_mailadmind] sending password data to remote server...\n" if $Debug;
+ print "password_mailbox", "\n";
+ print
+ $user, "\n", $account, $_password,
+ ;
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "add_mailbox" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading account information to create...\n" if $Debug;
+ my(
+ $package, $account, $_password,
+ ) = map { scalar(<Client>) } ( 1 .. 3 );
+
+ warn "[fs_mailadmind] sending service data to remote server...\n" if $Debug;
+ print "add_mailbox", "\n";
+ print
+ $user, "\n", $package, $account, $_password,
+ ;
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "add_forward" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading forward information to create...\n" if $Debug;
+ my(
+ $package, $source, $dest,
+ ) = map { scalar(<Client>) } ( 1 .. 3 );
+
+ warn "[fs_mailadmind] sending service data to remote server...\n" if $Debug;
+ print "add_forward", "\n";
+ print
+ $user, "\n", $package, $source, $dest,
+ ;
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "delete_forward" ) {
+ warn "[fs_mailadmind] reading user information to auth...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading forward information to delete...\n" if $Debug;
+ chop( my $service = <Client> );
+ warn "[fs_mailadmind] sending information to remote server...\n" if $Debug;
+ print "delete_forward\n", $user, "\n", $service, "\n";
+
+ warn "[fs_mailadmind] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_mailadmind] sending error to local client...\n" if $Debug;
+ print Client $error;
+
+ } elsif ( $command eq "list_forwards" ) {
+ warn "[fs_mailadmind] reading user information to list_forwards...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading service number to list_forwards...\n" if $Debug;
+ chop( my $service = <Client> );
+ warn "[fs_mailadmind] sending user information to remote server...\n" if $Debug;
+ print "list_forwards\n", $user, "\n", $service, "\n";
+
+ warn "[fs_mailadmind] reading data from remote server...\n" if $Debug;
+ chomp( my $n_svc_forward = <STDIN> );
+ my @svc_forward = map {
+ chomp( my $svcnum = <STDIN> );
+ chomp( my $dest = <STDIN> );
+ {
+ 'svcnum' => $svcnum,
+ 'dest' => $dest,
+ };
+ } ( 1 .. $n_svc_forward );
+
+ warn "[fs_mailadmind] sending data to local client...\n" if $Debug;
+
+ print Client join("\n", $n_svc_forward,
+ map {
+ $_->{svcnum},
+ $_->{dest},
+ } @svc_forward
+ ), "\n";
+
+ } elsif ( $command eq "list_pkg_forwards" ) {
+ warn "[fs_mailadmind] reading user information to list_pkg_forwards...\n" if $Debug;
+ chop( my $user = <Client> );
+ warn "[fs_mailadmind] reading service number to list_forwards...\n" if $Debug;
+ chop( my $package = <Client> );
+ warn "[fs_mailadmind] sending user information to remote server...\n" if $Debug;
+ print "list_pkg_forwards\n", $user, "\n", $package, "\n";
+
+ warn "[fs_mailadmind] reading data from remote server...\n" if $Debug;
+ chomp( my $n_svc_forward = <STDIN> );
+ my @svc_forward = map {
+ chomp( my $svcnum = <STDIN> );
+ chomp( my $srcsvc = <STDIN> );
+ chomp( my $dest = <STDIN> );
+ {
+ 'svcnum' => $svcnum,
+ 'srcsvc' => $srcsvc,
+ 'dest' => $dest,
+ };
+ } ( 1 .. $n_svc_forward );
+
+ warn "[fs_mailadmind] sending data to local client...\n" if $Debug;
+
+ print Client join("\n", $n_svc_forward,
+ map {
+ $_->{svcnum},
+ $_->{srcsvc},
+ $_->{dest},
+ } @svc_forward
+ ), "\n";
+
+ } else {
+ die "unexpected command from client: $command";
+ }
+
+}
+
diff --git a/fs_selfadmin/README b/fs_selfadmin/README
new file mode 100644
index 000000000..d9857f054
--- /dev/null
+++ b/fs_selfadmin/README
@@ -0,0 +1,27 @@
+
+This collection of files implements a 'self-administered mail service.'
+Configuration is similar to fs_signupd
+
+Additionally you will need to modify the database:
+
+CREATE TABLE svc_acct_admin (
+ svcnum int primary key,
+ adminsvc int not null
+);
+
+creating both as keys might be good
+
+(and perform the dbdef-create)
+
+
+As it exists now, a package containing one svc_domain, at least one
+svc_acct_admin, and other services can have its svc_acct's and svc_forward's
+manipulated by the svc_acct referenced by a svc_acct_admin in the package.
+
+One svc_acct may be referenced as svc_acct_admin for multiple packages.
+
+fs_mailadmin_server contains hard coded references to service numbers which
+will require editing for your system.
+
+It's not a lot, but it might provide inspiration.
+
diff --git a/fs_selfadmin/fs_mailadmin_server b/fs_selfadmin/fs_mailadmin_server
new file mode 100755
index 000000000..ef4788543
--- /dev/null
+++ b/fs_selfadmin/fs_mailadmin_server
@@ -0,0 +1,642 @@
+#!/usr/bin/perl -Tw
+#
+# fs_mailadmin_server
+#
+
+use strict;
+use IO::Handle;
+use FS::SSH qw(sshopen2);
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main_county;
+use FS::cust_main;
+use FS::svc_acct_admin;
+
+use vars qw( $opt $Debug $conf $default_domain );
+
+$Debug = 1;
+
+#my @payby = qw(CARD PREPAY);
+
+my $user = shift or die &usage;
+&adminsuidsetup( $user );
+
+$conf = new FS::Conf;
+$default_domain = $conf->config('domain');
+
+my $machine = shift or die &usage;
+
+my $agentnum = shift or die &usage;
+my $agent = qsearchs( 'agent', { 'agentnum' => $agentnum } ) or die &usage;
+my $pkgpart = $agent->pkgpart_hashref;
+
+my $refnum = shift or die &usage;
+
+#causing trouble for some folks
+#$SIG{CHLD} = sub { wait() };
+
+my($fs_mailadmind)=$conf->config('fs_mailadmind');
+
+while (1) {
+ my($reader,$writer)=(new IO::Handle, new IO::Handle);
+ $writer->autoflush(1);
+ warn "[fs_mailadmin_server] Connecting to $machine...\n" if $Debug;
+ sshopen2($machine,$reader,$writer,$fs_mailadmind);
+
+ my $data;
+
+ warn "[fs_mailadmin_server] Sending locales...\n" if $Debug;
+ my @cust_main_county = qsearch('cust_main_county', {} );
+ print $writer $data = join("\n",
+ ( scalar(@cust_main_county) || die "no tax rates (cust_main_county records)" ),
+ map {
+ $_->taxnum,
+ $_->state,
+ $_->county,
+ $_->country,
+ } @cust_main_county
+ ),"\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+ warn "[fs_mailadmin_server] Sending package definitions...\n" if $Debug;
+ my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } }
+ qsearch( 'part_pkg', {} );
+ print $writer $data = join("\n",
+ ( scalar(@part_pkg) || die "no usable package definitions, agent $agentnum" ),
+ map {
+ $_->pkgpart,
+ $_->pkg,
+ } @part_pkg
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+ warn "[fs_mailadmin_server] Sending POPs...\n" if $Debug;
+ my @svc_acct_pop = qsearch ('svc_acct_pop',{} );
+ print $writer $data = join("\n",
+ ( scalar(@svc_acct_pop) || die "No points of presence (svc_acct_pop records)" ),
+ map {
+ $_->popnum,
+ $_->city,
+ $_->state,
+ $_->ac,
+ $_->exch,
+ $_->loc,
+ } @svc_acct_pop
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+ warn "[fs_mailadmin_server] Entering main loop...\n" if $Debug;
+COMMAND: while (1) {
+ warn "[fs_mailadmin_server] Reading (waiting for) command...\n" if $Debug;
+ chop( my($command, $user) = map { scalar(<$reader>) } ( 1 .. 2 ) );
+ my $domain = $default_domain;
+ $user =~ /^([\w\.\-]+)\@(([\w\-]+\.)+\w+)$/;
+ ($user, $domain) = ($1, $2);
+
+ if ($command eq 'authenticate'){
+ warn "[fs_mailadmin_server] Processing authenticate command for $user \n" if $Debug;
+ chop( my($password) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+
+ my $error = '';
+
+ my @svc_domain = qsearchs('svc_domain', { 'domain' => $domain });
+
+ if (scalar(@svc_domain) != 1) {
+ warn "Nonexistant or duplicate service account for \"$domain\"";
+ next COMMAND;
+ }
+
+ my @svc_acct = qsearchs('svc_acct', { 'username' => $user,
+ 'domsvc' => $svc_domain[0]->svcnum });
+ if (scalar(@svc_acct) != 1) {
+ die "Nonexistant or duplicate service account for \"$user\"";
+ next COMMAND;
+ }
+
+ if ($svc_acct[0]->_password eq $password) {
+ $error = "$user\@$domain OK";
+ }else{
+ $error = "$user\@$domain FAILED";
+ }
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+ }
+ elsif ($command eq 'list_packages'){
+ warn "[fs_mailadmin_server] Processing list_packages command for $user \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval {find_administrable_packages( $user, $domain )};
+ warn "$@" if $@;
+
+ my %packages;
+ my %accounts;
+
+ foreach my $package (@packages) {
+ $packages{my $pkgnum = $package->getfield('pkgnum')} = $default_domain;
+ $accounts{$pkgnum} = 0;
+ my @services = qsearch('cust_svc', { 'pkgnum' => $pkgnum });
+ foreach my $service (@services) {
+ if ($service->getfield('svcpart') eq '4'){
+ my $account=qsearchs('svc_domain', { 'svcnum' => $service->getfield('svcnum') });
+ $packages{$pkgnum}=$account->getfield('domain');
+ $accounts{$pkgnum}=$account->getfield('svcnum');
+ }
+ }
+ }
+
+ print $writer $data = join("\n",
+ ( scalar(keys(%packages)) ),
+ map {
+ $_,
+ $packages{$_},
+ $accounts{$_},
+ } keys(%packages)
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+ }elsif ($command eq 'list_mailboxes'){
+
+ warn "[fs_mailadmin_server] Processing list_mailboxes command for $user" if $Debug;
+ chop( my($pkgnum) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+ warn "package $pkgnum \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval {find_administrable_packages( $user, $domain )};
+ warn "$@" if $@;
+
+ my @accounts;
+
+ foreach my $package (@packages) {
+ next unless ($pkgnum eq $package->getfield('pkgnum'));
+ my @services = qsearch('cust_svc', { 'pkgnum' => $package->getfield('pkgnum') });
+ foreach my $service (@services) {
+ if ($service->getfield('svcpart') eq '2'){
+ my $account=qsearchs('svc_acct', { 'svcnum' => $service->getfield('svcnum') });
+# $accounts[$#accounts+1]=$account->getfield('username');
+ $accounts[$#accounts+1]=$account;
+ }
+ }
+ }
+
+ print $writer $data = join("\n",
+# ( scalar(@accounts) || die "No accounts (svc_acct records)" ),
+ ( scalar(@accounts) ),
+ map {
+ $_->svcnum,
+# $_->username,
+ $_->email,
+# $_->_password,
+ '*****',
+ } @accounts
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+
+ } elsif ($command eq 'delete_mailbox'){
+ warn "[fs_mailadmin_server] Processing delete_mailbox command for $user " if $Debug;
+ chop( my($account) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+ warn "account $account \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval { find_administrable_packages($user, $domain) };
+ warn "$@" if $@;
+ $error ||= "$@" if $@;
+
+ my @svc_acct = qsearchs('svc_acct', { 'svcnum' => $account }) unless $error;
+ if (scalar(@svc_acct) != 1) { $error ||= 'Nonexistant or duplicate service account for user.' };
+ if (! $error && check_administrator(\@packages, $svc_acct[0])){
+# not sure about the next three lines... do we delete? or return error
+ foreach my $svc_forward (qsearch('svc_forward', { 'dstsvc' => $svc_acct[0]->getfield('svcnum') })) {
+ $error ||= $svc_forward->delete;
+ }
+ foreach my $svc_forward (qsearch('svc_forward', { 'srcsvc' => $svc_acct[0]->getfield('svcnum') })) {
+ $error ||= $svc_forward->delete;
+ }
+ $error ||= $svc_acct[0]->delete;
+ } else {
+ $error ||= "Illegal attempt to remove service";
+ }
+
+
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ } elsif ($command eq 'password_mailbox'){
+ warn "[fs_mailadmin_server] Processing password_mailbox command for $user " if $Debug;
+ chop( my($account, $_password) = map { scalar(<$reader>) } ( 1 .. 2 ) );
+ warn "account $account with password $_password \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval { find_administrable_packages($user, $domain) };
+ warn "$@" if $@;
+ $error ||= "$@" if $@;
+
+ my @svc_acct = qsearchs('svc_acct', { 'svcnum' => $account }) unless $error;
+ if (scalar(@svc_acct) != 1) { $error ||= 'Nonexistant or duplicate service account.' };
+
+ if (! $error && check_administrator(\@packages, $svc_acct[0])){
+ my $new = new FS::svc_acct ({$svc_acct[0]->hash});
+ $new->setfield('_password' => $_password);
+ $error ||= $new->replace($svc_acct[0]);
+ } else {
+ $error ||= "Illegal attempt to change password";
+ }
+
+
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ } elsif ($command eq 'add_mailbox'){
+ warn "[fs_mailadmin_server] Processing add_mailbox command for $user " if $Debug;
+ chop( my($target_package, $account, $_password) = map { scalar(<$reader>) } ( 1 .. 3 ) );
+ warn "in package $target_package account $account with password $_password \n" if $Debug;
+
+ my $found_package;
+ my $domainsvc=0;
+ my $svcpart=2; # this is 'email box'
+ my $svcpartsm=3; # this is 'domain alias'
+ my $error = '';
+ my $found = 0;
+
+ my @packages = eval { find_administrable_packages($user, $domain) };
+ warn "$@" if $@;
+ $error ||= "$@" if $@;
+
+ foreach my $package (@packages) {
+ if ($package->getfield('pkgnum') eq $target_package) {
+ $found = 1;
+ $found_package=$package;
+ my @services = qsearch('cust_svc', { 'pkgnum' => $target_package });
+ foreach my $service (@services) {
+ if ($service->getfield('svcpart') eq '4'){
+ my @svc_domain=qsearchs('svc_domain', { 'svcnum' => $service->getfield('svcnum') });
+ if (scalar(@svc_domain) eq 1) {
+ $domainsvc=$svc_domain[0]->getfield('svcnum');
+ }
+ }
+ }
+ last;
+ }
+ }
+ warn "User $user does not have administration rights to package $target_package\n" unless $found;
+ $error ||= "User $user does not have administration rights to package $target_package\n" unless $found;
+
+ my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$found_package->getfield('pkgpart')});
+
+ #list of services this pkgpart includes (although at the moment we only care
+ # about $svcpart
+ my $pkg_svc;
+ my %pkg_svc = ();
+ foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $found_package->pkgpart }) ) {
+ $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
+ }
+
+ my @services = qsearch('cust_svc', {'pkgnum' => $found_package->getfield('pkgnum'),
+ 'svcpart' => $svcpart,
+ });
+
+ if (scalar(@services) >= $pkg_svc{$svcpart}) {
+ $error="Maximum allowed already reached.";
+ }
+
+ my $svc_acct = new FS::svc_acct ( {
+ 'pkgnum' => $found_package->pkgnum,
+ 'svcpart' => $svcpart,
+ 'username' => $account,
+ 'domsvc' => $domainsvc,
+ '_password' => $_password,
+ } );
+
+ my $y = $svc_acct->setdefault; # arguably should be in new method
+ $error ||= $y unless ref($y);
+ #and just in case you were silly
+ $svc_acct->pkgnum($found_package->pkgnum);
+ $svc_acct->svcpart($svcpart);
+ $svc_acct->username($account);
+ $svc_acct->domsvc($domainsvc);
+ $svc_acct->_password($_password);
+
+ $error ||= $svc_acct->check;
+
+ if ( ! $error ) { #in this case, $cust_pkg should always
+ #be definied, but....
+ $error ||= $svc_acct->insert;
+ warn "WARNING: $error on pre-checked svc_acct record!" if $error;
+ }
+
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ }elsif ($command eq 'list_forwards'){
+
+ warn "[fs_mailadmin_server] Processing list_forwards command for $user" if $Debug;
+ chop( my($svcnum) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+ warn "service $svcnum \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval {find_administrable_packages( $user, $domain )};
+ warn "$@" if $@;
+
+ my @forwards;
+
+ foreach my $package (@packages) {
+# next unless ($pkgnum eq $package->getfield('pkgnum'));
+ my @services = qsearch('cust_svc', { 'pkgnum' => $package->getfield('pkgnum') });
+ foreach my $service (@services) {
+ if ($service->getfield('svcpart') eq '10'){
+ my $forward=qsearchs('svc_forward', { 'svcnum' => $service->getfield('svcnum') });
+ $forwards[$#forwards+1]=$forward if ($forward->getfield('srcsvc') == $svcnum);
+ }
+ }
+ }
+
+ print $writer $data = join("\n",
+ ( scalar(@forwards) ),
+ map {
+ $_->svcnum,
+ ($_->dstsvc ? qsearchs('svc_acct', {'svcnum' => $_->dstsvc})->email : $_->dst),
+ } @forwards
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+
+ }elsif ($command eq 'list_pkg_forwards'){
+
+ warn "[fs_mailadmin_server] Processing list_pkg_forwards command for $user" if $Debug;
+ chop( my($pkgnum) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+ warn "package $pkgnum \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval {find_administrable_packages( $user, $domain )};
+ warn "$@" if $@;
+
+ my @forwards;
+
+ foreach my $package (@packages) {
+ next unless ($pkgnum eq $package->getfield('pkgnum'));
+ my @services = qsearch('cust_svc', { 'pkgnum' => $package->getfield('pkgnum') });
+ foreach my $service (@services) {
+ if ($service->getfield('svcpart') eq '10'){
+ my $forward=qsearchs('svc_forward', { 'svcnum' => $service->getfield('svcnum') });
+ $forwards[$#forwards+1]=$forward;
+ }
+ }
+ }
+
+ print $writer $data = join("\n",
+ ( scalar(@forwards) ),
+ map {
+ $_->svcnum,
+ $_->srcsvc,
+ ($_->dstsvc ? qsearchs('svc_acct', {'svcnum' => $_->dstsvc})->email : $_->dst),
+ } @forwards
+ ), "\n";
+ warn "[fs_mailadmin_server] $data\n" if $Debug > 2;
+
+
+ } elsif ($command eq 'delete_forward'){
+ warn "[fs_mailadmin_server] Processing delete_forward command for $user " if $Debug;
+ chop( my($forward) = map { scalar(<$reader>) } ( 1 .. 1 ) );
+ warn "forward $forward \n" if $Debug;
+
+ my $error = '';
+
+ my @packages = eval { find_administrable_packages($user, $domain) };
+ warn "$@" if $@;
+ $error ||= "$@" if $@;
+
+ my @svc_forward = qsearchs('svc_forward', { 'svcnum' => $forward }) unless $error;
+ if (scalar(@svc_forward) != 1) { $error ||= 'Nonexistant or duplicate service account for user.' };
+ if (! $error && check_administrator(\@packages, $svc_forward[0])){
+# not sure about the next three lines... do we delete? or return error
+ $error ||= $svc_forward[0]->delete;
+ } else {
+ $error ||= "Illegal attempt to remove service";
+ }
+
+
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ } elsif ($command eq 'add_forward'){
+ warn "[fs_mailadmin_server] Processing add_forward command for $user " if $Debug;
+ chop( my($target_package, $source, $dest) = map { scalar(<$reader>) } ( 1 .. 3 ) );
+ warn "in package $target_package source $source with destination $dest \n" if $Debug;
+
+ my $found_package;
+ my $domainsvc=0;
+ my $svcpart=10; # this is 'forward service'
+ my $error = '';
+ my $found = 0;
+
+ my @packages = eval { find_administrable_packages($user, $domain) };
+ warn "$@" if $@;
+ $error ||= "$@" if $@;
+
+ foreach my $package (@packages) {
+ if ($package->getfield('pkgnum') eq $target_package) {
+ $found = 1;
+ $found_package=$package;
+ last;
+ }
+ }
+ warn "User $user does not have administration rights to package $target_package\n" unless $found;
+ $error ||= "User $user does not have administration rights to package $target_package\n" unless $found;
+
+ my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $source });
+ warn "Forwarding source $source does not exist.\n" unless $svc_acct;
+ $error ||= "Forwarding source $source does not exist.\n" unless $svc_acct;
+
+ my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $source });
+ warn "Forwarding source $source not attached to any account.\n" unless $cust_svc;
+ $error ||= "Forwarding source $source not attached to any account.\n" unless $cust_svc;
+
+ if ( ! $error ) {
+ warn "Forwarding source $source is not in package $target_package\n"
+ unless ($cust_svc->getfield('pkgnum') == $target_package);
+ $error ||= "Forwarding source $source is not in package $target_package\n"
+ unless ($cust_svc->getfield('pkgnum') == $target_package);
+ }
+
+ my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$found_package->getfield('pkgpart')});
+
+ #list of services this pkgpart includes (although at the moment we only care
+ # about $svcpart
+ my $pkg_svc;
+ my %pkg_svc = ();
+ foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $found_package->pkgpart }) ) {
+ $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
+ }
+
+ my @services = qsearch('cust_svc', {'pkgnum' => $found_package->getfield('pkgnum'),
+ 'svcpart' => $svcpart,
+ });
+
+ if (scalar(@services) >= $pkg_svc{$svcpart}) {
+ $error="Maximum allowed already reached.";
+ }
+
+ my $svc_forward = new FS::svc_forward ( {
+ 'pkgnum' => $found_package->pkgnum,
+ 'svcpart' => $svcpart,
+ 'srcsvc' => $source,
+ 'dstsvc' => 0,
+ 'dst' => $dest,
+ } );
+
+ my $y = $svc_forward->setdefault; # arguably should be in new method
+ $error ||= $y unless ref($y);
+ #and just in case you were silly
+ $svc_forward->pkgnum($found_package->pkgnum);
+ $svc_forward->svcpart($svcpart);
+ $svc_forward->srcsvc($source);
+ $svc_forward->dstsvc(0);
+ $svc_forward->dst($dest);
+
+ $error ||= $svc_forward->check;
+
+ if ( ! $error ) { #in this case, $cust_pkg should always
+ #be definied, but....
+ $error ||= $svc_forward->insert;
+ warn "WARNING: $error on pre-checked svc_forward record!" if $error;
+ }
+
+ warn "[fs_mailadmin_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ } else {
+ warn "[fs_mailadmin_server] Bad command: $command \n" if $Debug;
+ print $writer "Bad command \n";
+ }
+ }
+ close $writer;
+ close $reader;
+ warn "connection to $machine lost! waiting 60 seconds...\n";
+ sleep 60;
+ warn "reconnecting...\n";
+}
+
+sub usage {
+ die "Usage:\n\n fs_mailadmin_server user machine agentnum refnum\n";
+}
+
+#sub find_administrable_packages {
+# my $user = shift;
+#
+# my $error = '';
+#
+# my @svc_acct = qsearchs('svc_acct', { 'username' => $user });
+# if (scalar(@svc_acct) != 1) {
+# die "Nonexistant or duplicate service account for \"$user\"";
+# }
+#
+# my @cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct[0]->getfield('svcnum') });
+# if (scalar(@cust_svc) != 1 ) {
+# die "Nonexistant or duplicate customer service for \"$user\"";
+# }
+#
+# my @cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc[0]->getfield('pkgnum') });
+# if (scalar(@cust_pkg) != 1) {
+# die "Nonexistant or duplicate customer package for \"$user\"";
+# }
+#
+# my @cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg[0]->getfield('custnum') });
+# if (scalar(@cust_main) != 1 ) {
+# die "Nonexistant or duplicate customer for \"$user\"";
+# }
+#
+# my @packages = $cust_main[0]->ncancelled_pkgs;
+#}
+
+sub find_administrable_packages {
+ my $user = shift;
+ my $domain = shift;
+
+ my @packages;
+ my $error = '';
+
+ my @svc_domain = qsearchs('svc_domain', { 'domain' => $domain });
+
+ if (scalar(@svc_domain) != 1) {
+ die "Nonexistant or duplicate service account for \"$domain\"";
+ }
+
+ my @svc_acct = qsearchs('svc_acct', { 'username' => $user,
+ 'domsvc' => $svc_domain[0]->svcnum });
+ if (scalar(@svc_acct) != 1) {
+ die "Nonexistant or duplicate service account for \"$user\"";
+ }
+
+ my @svc_acct_admin = qsearch('svc_acct_admin', {'adminsvc' => $svc_acct[0]->getfield('svcnum') });
+ die "Nonexistant or duplicate customer service for \"$user\"" unless scalar(@svc_acct_admin);
+
+ foreach my $svc_acct_admin (@svc_acct_admin) {
+ my @cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct_admin->getfield('svcnum') });
+ if (scalar(@cust_svc) != 1 ) {
+ die "Nonexistant or duplicate customer service for admin \"$svc_acct_admin->getfield('svcnum')\"";
+ }
+
+ my @cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc[0]->getfield('pkgnum') });
+ if (scalar(@cust_pkg) != 1) {
+ die "Nonexistant or duplicate customer package for admin \"$user\"";
+ }
+
+ push @packages, $cust_pkg[0] unless $cust_pkg[0]->getfield('cancel');
+
+ }
+ (@packages);
+}
+
+sub check_administrator {
+ my ($allowed_packages_aref, $svc_acct_ref) = @_;
+
+ my $error = '';
+ my $found = 0;
+
+ {
+ my @cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct_ref->getfield('svcnum') });
+ if (scalar(@cust_svc) != 1 ) {
+ warn "Nonexistant or duplicate customer service for \"$svc_acct_ref->getfield('username')\"";
+ last;
+ }
+
+ my @cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc[0]->getfield('pkgnum') });
+ if (scalar(@cust_pkg) != 1) {
+ warn "Nonexistant or duplicate customer package for \"$svc_acct_ref->getfield('username')\"";
+ last;
+ }
+
+ foreach my $package (@$allowed_packages_aref) {
+ if ($package->getfield('pkgnum') eq $cust_pkg[0]->getfield('pkgnum')) {
+ $found = 1;
+ last;
+ }
+ }
+ }
+
+ $found;
+}
+
+sub check_add {
+ my ($allowed_packages_aref, $target_package) = @_;
+
+ my $error = '';
+ my $found = 0;
+
+ foreach my $package (@$allowed_packages_aref) {
+ if ($package->getfield('pkgnum') eq $target_package) {
+ $found = 1;
+ last;
+ }
+ }
+
+ $found;
+}
+
diff --git a/fs_selfservice/DEPLOY b/fs_selfservice/DEPLOY
new file mode 100755
index 000000000..4aef4cfa4
--- /dev/null
+++ b/fs_selfservice/DEPLOY
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+kill `cat /var/run/freeside-selfservice-server.fs_selfservice.pid`
+
+( cd ..; make deploy; cd fs_selfservice )
+
+cd FS-SelfService
+perl Makefile.PL && make && make install
+
+cp /home/ivan/freeside/fs_selfservice/FS-SelfService/cgi/* /var/www/MyAccount
+chown freeside /var/www/MyAccount/selfservice.cgi
+chmod 755 /var/www/MyAccount/selfservice.cgi
+ln -s /var/www/MyAccount/selfservice.cgi /var/www/MyAccount/index.cgi || true
diff --git a/fs_selfservice/FS-SelfService/Changes b/fs_selfservice/FS-SelfService/Changes
new file mode 100644
index 000000000..b9e26b7dc
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/Changes
@@ -0,0 +1,6 @@
+Revision history for Perl extension FS::SelfService.
+
+0.01 Tue May 28 16:49:41 2002
+ - original version; created by h2xs 1.21 with options
+ -A -X -n FS::SelfService
+
diff --git a/fs_selfservice/FS-SelfService/MANIFEST b/fs_selfservice/FS-SelfService/MANIFEST
new file mode 100644
index 000000000..ebd0d3b1a
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/MANIFEST
@@ -0,0 +1,6 @@
+Changes
+Makefile.PL
+MANIFEST
+SelfService.pm
+test.pl
+freeside-selfservice-clientd
diff --git a/fs_selfservice/FS-SelfService/Makefile.PL b/fs_selfservice/FS-SelfService/Makefile.PL
new file mode 100644
index 000000000..da0a0aa24
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/Makefile.PL
@@ -0,0 +1,15 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'FS::SelfService',
+ 'VERSION_FROM' => 'SelfService.pm', # finds $VERSION
+ 'EXE_FILES' => [ 'freeside-selfservice-clientd' ],
+ 'INSTALLSCRIPT' => '/usr/local/sbin',
+ 'INSTALLSITEBIN' => '/usr/local/sbin',
+ 'PERM_RWX' => '750',
+ 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'SelfService.pm', # retrieve abstract from module
+ AUTHOR => 'Ivan Kohler <ivan-freeside-selfservice@420.am>') : ()),
+);
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
new file mode 100644
index 000000000..5849b28d1
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -0,0 +1,115 @@
+package FS::SelfService;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT_OK $socket %autoload );
+use Exporter;
+use Socket;
+use FileHandle;
+#use IO::Handle;
+use IO::Select;
+use Storable qw(nstore_fd fd_retrieve);
+
+$VERSION = '0.03';
+
+@ISA = qw( Exporter );
+
+$socket = "/usr/local/freeside/selfservice_socket";
+
+%autoload = (
+ 'passwd' => 'passwd/passwd',
+ 'chfn' => 'passwd/passwd',
+ 'chsh' => 'passwd/passwd',
+ 'login' => 'MyAccount/login',
+ 'customer_info' => 'MyAccount/customer_info',
+ 'invoice' => 'MyAccount/invoice',
+ 'cancel' => 'MyAccount/cancel',
+ 'payment_info' => 'MyAccount/payment_info',
+ 'process_payment' => 'MyAccount/process_payment',
+);
+@EXPORT_OK = keys %autoload;
+
+$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+my $freeside_uid = scalar(getpwnam('freeside'));
+die "not running as the freeside user\n" if $> != $freeside_uid;
+
+=head1 NAME
+
+FS::SelfService - Freeside self-service API
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+Use this API to implement your own client "self-service" module.
+
+If you just want to customize the look of the existing "self-service" module,
+see XXXX instead.
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item passwd
+
+Returns the empty value on success, or an error message on errors.
+
+=cut
+
+foreach my $autoload ( keys %autoload ) {
+
+ my $eval =
+ "sub $autoload { ". '
+ my $param;
+ if ( ref($_[0]) ) {
+ $param = shift;
+ } else {
+ $param = { @_ };
+ }
+
+ $param->{_packet} = \''. $autoload{$autoload}. '\';
+
+ simple_packet($param);
+ }';
+
+ eval $eval;
+ die $@ if $@;
+
+}
+
+sub simple_packet {
+ my $packet = shift;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($socket)) or die "connect: $!";
+ nstore_fd($packet, \*SOCK) or die "can't send packet: $!";
+ SOCK->flush;
+
+ #shoudl trap: Magic number checking on storable file failed at blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/fd_retrieve.al) line 337, at /usr/local/share/perl/5.6.1/FS/SelfService.pm line 71
+
+ #block until there is a message on socket
+# my $w = new IO::Select;
+# $w->add(\*SOCK);
+# my @wait = $w->can_read;
+ my $return = fd_retrieve(\*SOCK) or die "error reading result: $!";
+ die $return->{'_error'} if defined $return->{_error} && $return->{_error};
+
+ $return;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<freeside-selfservice-clientd>, L<freeside-selfservice-server>
+
+=cut
+
+1;
+
diff --git a/fs_selfservice/FS-SelfService/cgi/login.html b/fs_selfservice/FS-SelfService/cgi/login.html
new file mode 100644
index 000000000..ca6251eb1
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/login.html
@@ -0,0 +1,32 @@
+<HTML><HEAD><TITLE>Login</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=5>Login</FONT><BR><BR>
+<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
+<FORM ACTION="<%= $self_url %>" METHOD=POST>
+<INPUT TYPE="hidden" NAME="session" VALUE="login">
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=2 CELLPADDING=0>
+<TR>
+ <TH ALIGN="right">Username </TH>
+ <TD>
+ <!-- <INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"> -->
+ <INPUT TYPE="text" NAME="username" VALUE="hslink">
+ </TD>
+</TR>
+<TR>
+ <TH ALIGN="right">Domain </TH>
+ <TD>
+ <!-- <INPUT TYPE="text" NAME="domain" VALUE="<%= $domain %>"> -->
+ <INPUT TYPE="text" NAME="domain" VALUE="pobox.com">
+ </TD>
+</TR>
+<!--<INPUT TYPE="hidden" NAME="domain" VALUE="myisp.com">-->
+<TR>
+ <TH ALIGN="right">Password </TH>
+ <TD>
+ <!-- <INPUT TYPE="password" NAME="password"> -->
+ <INPUT TYPE="password" NAME="password" VALUE="UwjM5zdb">
+ </TD>
+</TR>
+</TABLE>
+<BR><BR><INPUT TYPE="submit" VALUE="Login">
+</FORM></BODY></HTML>
+
diff --git a/fs_selfservice/FS-SelfService/cgi/make_payment.html b/fs_selfservice/FS-SelfService/cgi/make_payment.html
new file mode 100644
index 000000000..a1cda6d49
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/make_payment.html
@@ -0,0 +1,120 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd">
+<A HREF="<%= $url %>myaccount">MyAccount</A><BR>
+<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->
+</TD><TD VALIGN="top">
+<FONT SIZE=4>Make a payment</FONT><BR><BR>
+<FORM NAME="OneTrueForm" METHOD="POST" ACTION="<%=$selfurl%>" onSubmit="document.OneTrueForm.process.disabled=true">
+<INPUT TYPE="hidden" NAME="session" VALUE="<%=$session_id%>">
+<INPUT TYPE="hidden" NAME="action" VALUE="payment_results">
+<TABLE BGCOLOR="#cccccc">
+<TR>
+ <TD ALIGN="right">Amount&nbsp;Due</TD>
+ <TD>
+ <TABLE><TR><TD BGCOLOR="#ffffff">
+ $<%=sprintf("%.2f",$balance)%>
+ </TD></TR></TABLE>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Payment&nbsp;amount</TD>
+ <TD>
+ <TABLE><TR><TD BGCOLOR="#ffffff">
+ $<INPUT TYPE="text" NAME="amount" SIZE=8 VALUE="<%=sprintf("%.2f",$balance)%>">
+ </TD></TR></TABLE>
+ </TD>
+</TR><TR>
+ <TD ALIGN="right">Card&nbsp;type</TD>
+ <TD>
+ <SELECT NAME="card_type"><OPTION></OPTION>
+ <%= foreach ( keys %card_types ) {
+ $selected = $card_type eq $card_types{$_} ? ' SELECTED' : '';
+ $OUT .= qq(<OPTION$selected VALUE="). $card_types{$_}. qq(">$_\n);
+ } %>
+ </SELECT>
+ </TD>
+</TD><TR>
+ <TD ALIGN="right">Card&nbsp;number</TD>
+ <TD>
+ <TABLE>
+ <TR>
+ <TD>
+ <INPUT TYPE="text" NAME="payinfo" SIZE=20 MAXLENGTH=19 VALUE="<%=$payinfo%>"> </TD>
+ <TD>Exp.</TD>
+ <TD>
+ <SELECT NAME="month">
+ <%= for ( ( map "0$_", 1 .. 9 ), 11, 12 ) {
+ $OUT .= '<OPTION'. ($_ eq $month ? ' SELECTED' : ''). ">$_\n";
+ } %>
+ </SELECT>
+ </TD>
+ <TD> / </TD>
+ <TD>
+ <SELECT NAME="year">
+ <%= for ( 2003 .. 2012 ) {
+ $OUT .= '<OPTION'. ($_ eq $year ? ' SELECTED' : ''). ">$_\n";
+ } %>
+ </SELECT>
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+</TR><TR>
+ <TD ALIGN="right">Exact&nbsp;name&nbsp;on&nbsp;card</TD>
+ <TD><INPUT TYPE="text" SIZE=32 MAXLENGTH=80 NAME="payname" VALUE="<%=$payname%>"></TD>
+</TR><TR>
+ <TD ALIGN="right">Card&nbsp;billing&nbsp;address</TD>
+ <TD>
+ <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address1" VALUE="<%=$address1%>">
+ </TD>
+</TR><TR>
+ <TD ALIGN="right">Address&nbsp;line&nbsp;2</TD>
+ <TD>
+ <INPUT TYPE="text" SIZE=40 MAXLENGTH=80 NAME="address2" VALUE="<%=$address2%>">
+ </TD>
+</TR><TR>
+ <TD ALIGN="right">City</TD>
+ <TD>
+ <TABLE>
+ <TR>
+ <TD>
+ <INPUT TYPE="text" NAME="city" SIZE="12" MAXLENGTH=80 VALUE="<%=$city%>">
+ </TD>
+ <TD>State</TD>
+ <TD>
+ <SELECT NAME="state">
+ <%= for ( @states ) {
+ $OUT .= '<OPTION'. ($_ eq $state ? ' SELECTED' : '' ). ">$_\n";
+ } %>
+ </SELECT>
+ </TD>
+ <TD>Zip</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="zip" SIZE=11 MAXLENGTH=10 VALUE="<%=$zip%>">
+ </TD>
+ </TR>
+ </TABLE>
+ </TD>
+</TR><TR>
+ <TD COLSPAN=2>
+ <INPUT TYPE="checkbox" CHECKED NAME="save" VALUE="1">
+ Remember this information
+ </TD>
+</TR><TR>
+ <TD COLSPAN=2>
+ <INPUT TYPE="checkbox"<%= $payby eq 'CARD' ? ' CHECKED' : '' %> NAME="auto" VALUE="1" onClick="if (this.checked) { document.OneTrueForm.save.checked=true; }">
+ Charge future payments to this card automatically
+ </TD>
+</TR>
+</TABLE>
+<BR>
+<INPUT TYPE="hidden" NAME="paybatch" VALUE="<%=$paybatch%>">
+<INPUT TYPE="submit" NAME="process" VALUE="Process payment"> <!-- onClick="this.disabled=true"> -->
+</FORM>
+</TD></TR></TABLE>
+<HR>
+<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
+</BODY></HTML>
+
diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html
new file mode 100644
index 000000000..f48fdedea
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@ -0,0 +1,47 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd">
+<A HREF="<%= $url %>myaccount">MyAccount</A><BR>
+<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->
+</TD><TD VALIGN="top">
+
+Hello <%= $name %>!<BR><BR>
+<%= $small_custview %>
+<BR>
+<%= if ( $balance > 0 ) {
+ $OUT .= qq! <B><A HREF="${url}make_payment">Make a payment</A></B><BR><BR>!;
+} %>
+<%=
+ if ( @open_invoices ) {
+ $OUT .= '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=2 BGCOLOR="#eeeeee">'.
+ '<TR><TH BGCOLOR="#ff3333" COLSPAN=5>Open Invoices</TH><TD>';
+ my $link = qq!<A HREF="<%= $url %>myaccount!;
+ my $col1 = "ffffff";
+ my $col2 = "dddddd";
+ my $col = $col1;
+
+ foreach my $invoice ( @open_invoices ) {
+ my $td = qq!<TD BGCOLOR="#$col">!;
+ my $a=qq!<A HREF="${url}view_invoice;invnum=!. $invoice->{'invnum'}. '">';
+ $OUT .=
+ "<TR>$td${a}Invoice #". $invoice->{'invnum'}. "</A></TD>$td</TD>".
+ "$td$a". $invoice->{'date'}. "</A></TD>$td</TD>".
+ qq!<TD BGCOLOR="#$col" ALIGN="right">$a\$!. $invoice->{'owed'}.
+ '</A></TD>'.
+ '</TR>';
+ $col = $col eq $col1 ? $col2 : $col1;
+ }
+ $OUT .= '</TABLE>';
+ } else {
+ $OUT .= 'You have no outstanding invoices.<BR><BR>';
+ }
+%>
+
+</TD></TR></TABLE>
+<HR>
+<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
+</BODY></HTML>
+
+
+
diff --git a/fs_selfservice/FS-SelfService/cgi/passwd.html b/fs_selfservice/FS-SelfService/cgi/passwd.html
new file mode 100644
index 000000000..fadc4df8b
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/passwd.html
@@ -0,0 +1,25 @@
+<html>
+ <head>
+ <title>Change password</title>
+ </head>
+ <body bgcolor="#e8e8e8">
+ <h3>Change password</h3>
+ <form action="/cgi-bin/fs_passwd.cgi" method="post">
+ <table bgcolor="#cccccc" border=0 cellspacing=2>
+ <tr><th align="right">Username</th>
+ <td><input type="text" name="username" size="18"></td>
+ </tr>
+ <tr><th align="right">Current password</th>
+ <td><input type="password" name="old_password" size="18"></td>
+ </tr>
+ <tr><th align="right">New password</th>
+ <td><input type="password" name="new_password" size="18"></td>
+ </tr>
+ <tr><th align="right">Re-enter new password</th>
+ <td><input type="password" name="new_password2" size="18"></td>
+ </tr>
+ </table>
+ <br><input type="submit" value="Change password">
+ </body>
+</html>
+
diff --git a/fs_selfservice/FS-SelfService/cgi/payment_results.html b/fs_selfservice/FS-SelfService/cgi/payment_results.html
new file mode 100644
index 000000000..92c8cf51b
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/payment_results.html
@@ -0,0 +1,18 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd">
+<A HREF="<%= $url %>myaccount">MyAccount</A><BR>
+<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->
+</TD><TD VALIGN="top">
+<FONT SIZE=4>Payment results</FONT><BR><BR>
+<%= if ( $error ) {
+ $OUT .= qq!<FONT SIZE="+1" COLOR="#ff0000">Error processing your payment: $error</FONT>!;
+} else {
+ $OUT .= 'Your payment was processed sucessfully. Thank you.';
+} %>
+</TD></TR></TABLE>
+<HR>
+<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
+</BODY></HTML>
+
diff --git a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
new file mode 100644
index 000000000..6d6716ddc
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@ -0,0 +1,188 @@
+#!/usr/bin/perl -Tw
+
+use strict;
+use vars qw($cgi $session_id $form_max $template_dir);
+use subs qw(do_template);
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use Text::Template;
+use FS::SelfService qw( login customer_info invoice payment_info
+ process_payment );
+
+$template_dir = '.';
+
+$form_max = 255;
+
+$cgi = new CGI;
+
+unless ( defined $cgi->param('session') ) {
+ do_template('login',{});
+ exit;
+}
+
+if ( $cgi->param('session') eq 'login' ) {
+
+ $cgi->param('username') =~ /^\s*([a-z0-9_\-\.\&]{0,$form_max})\s*$/i
+ or die "illegal username";
+ my $username = $1;
+
+ $cgi->param('domain') =~ /^\s*([\w\-\.]{0,$form_max})\s*$/
+ or die "illegal domain";
+ my $domain = $1;
+
+ $cgi->param('password') =~ /^(.{0,$form_max})$/
+ or die "illegal password";
+ my $password = $1;
+
+ my $rv = login(
+ 'username' => $username,
+ 'domain' => $domain,
+ 'password' => $password,
+ );
+ if ( $rv->{error} ) {
+ do_template('login', {
+ 'error' => $rv->{error},
+ 'username' => $username,
+ 'domain' => $domain,
+ } );
+ exit;
+ } else {
+ $cgi->param('session' => $rv->{session_id} );
+ $cgi->param('action' => 'myaccount' );
+ }
+}
+
+$session_id = $cgi->param('session');
+
+$cgi->param('action') =~
+ /^(myaccount|view_invoice|make_payment|payment_results)$/
+ or die "unknown action ". $cgi->param('action');
+my $action = $1;
+
+my $result = eval "&$action();";
+die $@ if $@;
+
+if ( $result->{error} eq "Can't resume session" ) { #ick
+ do_template('login',{});
+ exit;
+}
+
+#warn $result->{'open_invoices'};
+#warn scalar(@{$result->{'open_invoices'}});
+
+warn "processing template $action\n";
+do_template($action, {
+ 'session_id' => $session_id,
+ %{$result}
+});
+
+#--
+
+sub myaccount { customer_info( 'session_id' => $session_id ); }
+
+sub view_invoice {
+
+ $cgi->param('invnum') =~ /^(\d+)$/ or die "illegal invnum";
+ my $invnum = $1;
+
+ invoice( 'session_id' => $session_id,
+ 'invnum' => $invnum,
+ );
+
+}
+
+sub make_payment {
+ payment_info( 'session_id' => $session_id );
+}
+
+sub payment_results {
+
+ use Business::CreditCard;
+
+ $cgi->param('amount') =~ /^\s*(\d+(\.\d{2})?)\s*$/
+ or die "illegal amount"; #!!!
+ my $amount = $1;
+
+ my $payinfo = $cgi->param('payinfo');
+ $payinfo =~ s/\D//g;
+ $payinfo =~ /^(\d{13,16})$/
+ #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
+ or die "illegal card"; #!!!
+ $payinfo = $1;
+ validate($payinfo)
+ #or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
+ or die "invalid card"; #!!!
+ cardtype($payinfo) eq $cgi->param('card_type')
+ #or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
+ or die "not a ". $cgi->param('card_type');
+
+ $cgi->param('month') =~ /^(\d{2})$/ or die "illegal month";
+ my $month = $1;
+ $cgi->param('year') =~ /^(\d{4})$/ or die "illegal year";
+ my $year = $1;
+
+ $cgi->param('payname') =~ /^(.{0,80})$/ or die "illegal payname";
+ my $payname = $1;
+
+ $cgi->param('address1') =~ /^(.{0,80})$/ or die "illegal address1";
+ my $address1 = $1;
+
+ $cgi->param('address2') =~ /^(.{0,80})$/ or die "illegal address2";
+ my $address2 = $1;
+
+ $cgi->param('city') =~ /^(.{0,80})$/ or die "illegal city";
+ my $city = $1;
+
+ $cgi->param('state') =~ /^(.{2})$/ or die "illegal state";
+ my $state = $1;
+
+ $cgi->param('zip') =~ /^(.{0,10})$/ or die "illegal zip";
+ my $zip = $1;
+
+ my $save = 0;
+ $save = 1 if $cgi->param('save');
+
+ my $auto = 0;
+ $auto = 1 if $cgi->param('auto');
+
+ $cgi->param('paybatch') =~ /^([\w\-\.]+)$/ or die "illegal paybatch";
+ my $paybatch = $1;
+
+ process_payment(
+ 'session_id' => $session_id,
+ 'amount' => $amount,
+ 'payinfo' => $payinfo,
+ 'month' => $month,
+ 'year' => $year,
+ 'payname' => $payname,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'save' => $save,
+ 'auto' => $auto,
+ 'paybatch' => $paybatch,
+ );
+
+}
+
+#--
+
+sub do_template {
+ my $name = shift;
+ my $fill_in = shift;
+
+ $cgi->delete_all();
+ $fill_in->{'selfurl'} = $cgi->self_url;
+
+ my $template = new Text::Template( TYPE => 'FILE',
+ SOURCE => "$template_dir/$name.html",
+ DELIMITERS => [ '<%=', '%>' ],
+ UNTAINT => 1, )
+ or die $Text::Template::ERROR;
+
+ print $cgi->header( '-expires' => 'now' ),
+ $template->fill_in( HASH => $fill_in );
+}
+
diff --git a/fs_selfservice/FS-SelfService/cgi/view_invoice.html b/fs_selfservice/FS-SelfService/cgi/view_invoice.html
new file mode 100644
index 000000000..d2b012b5d
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/cgi/view_invoice.html
@@ -0,0 +1,21 @@
+<HTML><HEAD><TITLE>MyAccount</TITLE></HEAD>
+<BODY BGCOLOR="#eeeeee"><FONT SIZE=5>MyAccount</FONT><BR><BR>
+<%= $url = "$selfurl?session=$session_id;action="; ''; %>
+<TABLE BORDER=0 CELLPADDING=4><TR><TD VALIGN="top" HEIGHT=384 BGCOLOR="#dddddd">
+<A HREF="<%= $url %>myaccount">MyAccount</A><BR>
+<!-- <A HREF="<%= $url %>other">SomethingElse</A><BR> -->
+</TD><TD VALIGN="top">
+
+<A HREF="<%= $url %>myaccount"><-- back to MyAccount</A><BR><BR>
+
+<FONT SIZE="-1"><PRE>
+<%= $invoice_text %>
+</FONT></PRE>
+
+</TD></TR></TABLE>
+<HR>
+<FONT SIZE="-2">powered by <a href="http://www.sisd.com/freeside">freeside</a></FONT>
+</BODY></HTML>
+
+
+
diff --git a/fs_selfservice/FS-SelfService/freeside-selfservice-clientd b/fs_selfservice/FS-SelfService/freeside-selfservice-clientd
new file mode 100644
index 000000000..f13dd42d7
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/freeside-selfservice-clientd
@@ -0,0 +1,226 @@
+#!/usr/bin/perl -w
+#
+# freeside-selfservice-clientd
+#
+# This is run REMOTELY over ssh by freeside-selfservice-server
+
+use strict;
+use subs qw(spawn logmsg);
+use Fcntl qw(:flock);
+use POSIX qw(:sys_wait_h);
+use Socket;
+use Storable qw(nstore_fd fd_retrieve);
+use IO::Handle qw(_IONBF);
+use IO::Select;
+use IO::File;
+
+#STDOUT->setbuf('');
+
+use vars qw( $Debug );
+$Debug = 3; #2 will turn on child logging, 3 will log packet contents,
+ #including potentially compromising information
+
+my $socket = "/usr/local/freeside/selfservice_socket";
+my $pid_file = "$socket.pid";
+
+my $log_file = "/usr/local/freeside/selfservice.log";
+
+#my $me = '[client]';
+
+$|=1;
+
+$SIG{__WARN__} = \&_logmsg;
+
+#read data to be cached or something
+#warn "$me Reading init data\n" if $Debug;
+#my $signup_init =
+
+warn "Creating $socket\n" if $Debug;
+my $uaddr = sockaddr_un($socket);
+my $proto = getprotobyname('tcp');
+socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
+unlink($socket);
+bind(Server, $uaddr) or die "bind: $!";
+listen(Server,SOMAXCONN) or die "listen: $!";
+
+if ( -e $pid_file ) {
+ open(PIDFILE,"<$pid_file");
+ my $old_pid = <PIDFILE>;
+ close PIDFILE;
+ $old_pid =~ /^(\d+)$/;
+ kill 'TERM', $1;
+}
+open(PIDFILE,">$pid_file");
+print PIDFILE "$$\n";
+close PIDFILE;
+
+#my $waitedpid;
+#sub REAPER { $waitedpid = wait; $SIG{CHLD} = \&REAPER; }
+#$SIG{CHLD} = \&REAPER;
+
+warn "entering main loop\n" if $Debug;
+
+my %kids;
+
+my $s = new IO::Select;
+$s->add(\*STDIN);
+$s->add(\*Server);
+
+#for ( $waitedpid = 0;
+# accept(Client,Server) || $waitedpid;
+# $waitedpid = 0, close Client)
+#{
+# next if $waitedpid;
+
+#$SIG{PIPE} = sub { warn "SIGPIPE received" };
+#$SIG{CHLD} = sub { warn "SIGCHLD received" };
+
+#sub REAPER { warn "SIGCHLD received"; my $pid = wait; $SIG{CHLD} = \&REAPER; }
+#sub REAPER { my $pid = wait; $SIG{CHLD} = \&REAPER; }
+#sub REAPER { my $pid = wait; delete $kids{$pid}; $SIG{CHLD} = \&REAPER; }
+#$SIG{CHLD} = \&REAPER;
+
+my $undisp = 0;
+while (1) {
+
+ &reap_kids;
+
+ warn "waiting for connection\n" if $Debug && !$undisp;
+
+ #my @handles = $s->can_read();
+ my @handles = $s->can_read(5);
+ $undisp = !scalar(@handles);
+ foreach my $handle ( @handles ) {
+
+ if ( $handle == \*STDIN ) {
+
+ warn "receiving packet from server\n" if $Debug;
+
+ my $packet = fd_retrieve(\*STDIN);
+ my $token = $packet->{'_token'};
+ warn "received packet from server with token $token\n".
+ ( $Debug > 2
+ ? join('', map { " $_=>$packet->{$_}\n" } keys %$packet )
+ : '' )
+ if $Debug;
+
+ if ( exists($kids{$token}) ) {
+ warn "sending return packet to $token via $kids{$token}\n"
+ if $Debug;
+ nstore_fd($packet, $kids{$token});
+ warn "flushing to $token\n" if $Debug;
+ until ( $kids{$token}->flush ) {
+ warn "WARNING: error flushing: $!";
+ sleep 1;
+ }
+ #no close or delete here - will block waiting for child
+ warn "done with $token\n" if $Debug;
+ } else {
+ warn "WARNING: unknown token $token, discarding message";
+ }
+
+ } elsif ( $handle == \*Server ) {
+
+ until ( accept(Client, Server) ) {
+ warn "WARNING: accept failed: $!";
+ next;
+ }
+
+ warn "received local connection; forking\n" if $Debug;
+
+ spawn sub { #child
+ warn "[child-$$] reading packet from local client" if $Debug > 1;
+ my $packet = fd_retrieve(\*Client);
+ warn "[child-$$] packet received:\n".
+ join('', map { " $_=>$packet->{$_}\n" } keys %$packet )
+ if $Debug > 2;
+ my $command = $packet->{'command'};
+ #handle some commands weirdly?
+ $packet->{_token}=$$;
+
+ warn "[child-$$] sending packet to remote server" if $Debug > 1;
+ flock(STDOUT, LOCK_EX) or die "FATAL: can't lock write stream: $!";
+ nstore_fd($packet, \*STDOUT) or die "FATAL: can't send response: $!";
+ STDOUT->flush or die "FATAL: can't flush: $!";
+ flock(STDOUT, LOCK_UN) or die "FATAL: can't release write lock: $!";
+ close STDOUT or die "FATAL: can't close write stream: $!"; #??!
+
+ warn "[child-$$] waiting for response from parent" if $Debug > 1;
+ my $w = new IO::Select;
+ $w->add(\*STDIN);
+ until ( $w->can_read ) {
+ warn "[child-$$] WARNING: interrupted select: $!\n";
+ }
+ my $rv = fd_retrieve(\*STDIN);
+
+ #close STDIN;
+
+ warn "[child-$$] sending response to local client" if $Debug > 1;
+ nstore_fd($rv, \*Client);
+ Client->flush or die "FATAL: can't flush to local client: $!";
+ close Client or die "FATAL: can't close connection to local client: $!";
+
+ warn "[child-$$] child exiting" if $Debug > 1;
+ exit;
+
+ }; #eo child
+
+ #close Client;
+
+ } else {
+ die "wtf? $handle";
+ }
+
+ }
+
+}
+
+sub reap_kids {
+ #warn "reaping kids\n";
+ foreach my $pid ( keys %kids ) {
+ my $kid = waitpid($pid, WNOHANG);
+ if ( $kid > 0 ) {
+ close $kids{$kid};
+ delete $kids{$kid};
+ }
+ }
+ #warn "done reaping\n";
+}
+
+sub spawn {
+ my $coderef = shift;
+
+ unless (@_ == 0 && $coderef && ref($coderef) eq 'CODE') {
+ use Carp;
+ confess "usage: spawn CODEREF";
+ }
+
+ my $pid;
+ #if (!defined($pid = fork)) {
+ my $kid = new IO::Handle;
+ if (!defined($pid = open($kid, '|-'))) {
+ warn "WARNING: cannot fork: $!";
+ return;
+ } elsif ($pid) {
+ warn "begat $pid" if $Debug;
+ $kids{$pid} = $kid;
+ #$kids{$pid}->autoflush;
+ return; # I'm the parent
+ }
+ # else I'm the child -- go spawn
+
+# open(STDIN, "<&Client") || die "can't dup client to stdin";
+# open(STDOUT, ">&Client") || die "can't dup client to stdout";
+# open(STDERR, ">&STDOUT") || die "can't dup stdout to stderr";
+ exit &$coderef();
+}
+
+sub _logmsg {
+ chomp( my $msg = shift );
+ my $log = new IO::File ">>$log_file";
+ flock($log, LOCK_EX);
+ seek($log, 0, 2);
+ print $log "[client] [". scalar(localtime). "] [$$] $msg\n";
+ flock($log, LOCK_UN);
+ close $log;
+}
diff --git a/fs_selfservice/FS-SelfService/test.pl b/fs_selfservice/FS-SelfService/test.pl
new file mode 100644
index 000000000..7468ea471
--- /dev/null
+++ b/fs_selfservice/FS-SelfService/test.pl
@@ -0,0 +1,17 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use Test;
+BEGIN { plan tests => 1 };
+use FS::SelfService;
+ok(1); # If we made it this far, we're ok.
+
+#########################
+
+# Insert your test code below, the Test module is use()ed here so read
+# its man page ( perldoc Test ) for help writing this test script.
+
diff --git a/fs_selfservice/fs_passwd_test b/fs_selfservice/fs_passwd_test
new file mode 100755
index 000000000..4f8b8a888
--- /dev/null
+++ b/fs_selfservice/fs_passwd_test
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FS::SelfService qw(passwd);
+
+my $rv = passwd(
+ 'username' => 'ivan',
+ 'old_password' => 'heyhoo',
+ 'new_password' => 'haloo',
+);
+my $error = $rv->{error};
+
+if ( $error eq 'Incorrect password.' ) {
+ exit;
+} else {
+ die $error if $error;
+ die "no error";
+}
+
diff --git a/fs_sesmon/FS-SessionClient/Changes b/fs_sesmon/FS-SessionClient/Changes
new file mode 100644
index 000000000..390a7b946
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/Changes
@@ -0,0 +1,5 @@
+Revision history for Perl extension FS::SessionClient
+
+0.01 Wed Oct 18 16:34:36 1999
+ - original version; created by ivan 1.0
+
diff --git a/fs_sesmon/FS-SessionClient/MANIFEST b/fs_sesmon/FS-SessionClient/MANIFEST
new file mode 100644
index 000000000..162d4e453
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/MANIFEST
@@ -0,0 +1,11 @@
+Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+SessionClient.pm
+test.pl
+fs_sessiond
+cgi/login.cgi
+cgi/logout.cgi
+bin/freeside-login
+bin/freeside-logout
diff --git a/fs_sesmon/FS-SessionClient/MANIFEST.SKIP b/fs_sesmon/FS-SessionClient/MANIFEST.SKIP
new file mode 100644
index 000000000..ae335e78a
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/MANIFEST.SKIP
@@ -0,0 +1 @@
+CVS/
diff --git a/fs_sesmon/FS-SessionClient/Makefile.PL b/fs_sesmon/FS-SessionClient/Makefile.PL
new file mode 100644
index 000000000..137b6b8bd
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/Makefile.PL
@@ -0,0 +1,10 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'FS::SessionClient',
+ 'VERSION_FROM' => 'SessionClient.pm', # finds $VERSION
+ 'EXE_FILES' => [ qw(fs_sessiond bin/freeside-login bin/freeside-logout) ],
+ 'INSTALLSCRIPT' => '/usr/local/sbin',
+ 'PERM_RWX' => '750',
+);
diff --git a/fs_sesmon/FS-SessionClient/SessionClient.pm b/fs_sesmon/FS-SessionClient/SessionClient.pm
new file mode 100644
index 000000000..8a0ff705f
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/SessionClient.pm
@@ -0,0 +1,122 @@
+package FS::SessionClient;
+
+use strict;
+use vars qw($AUTOLOAD $VERSION @ISA @EXPORT_OK $fs_sessiond_socket);
+use Exporter;
+use Socket;
+use FileHandle;
+use IO::Handle;
+
+$VERSION = '0.01';
+
+@ISA = qw( Exporter );
+@EXPORT_OK = qw( login logout portnum );
+
+$fs_sessiond_socket = "/usr/local/freeside/fs_sessiond_socket";
+
+$ENV{'PATH'} ='/usr/bin:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+my $freeside_uid = scalar(getpwnam('freeside'));
+die "not running as the freeside user\n" if $> != $freeside_uid;
+
+=head1 NAME
+
+FS::SessionClient - Freeside session client API
+
+=head1 SYNOPSIS
+
+ use FS::SessionClient qw( login portnum logout );
+
+ $error = login ( {
+ 'username' => $username,
+ 'password' => $password,
+ 'login' => $timestamp,
+ 'portnum' => $portnum,
+ } );
+
+ $portnum = portnum( { 'ip' => $ip } ) or die "unknown ip!"
+ $portnum = portnum( { 'nasnum' => $nasnum, 'nasport' => $nasport } )
+ or die "unknown nasnum/nasport";
+
+ $error = logout ( {
+ 'username' => $username,
+ 'password' => $password,
+ 'logout' => $timestamp,
+ 'portnum' => $portnum,
+ } );
+
+=head1 DESCRIPTION
+
+This modules provides an API for a remote session application.
+
+It needs to be run as the freeside user. Because of this, the program which
+calls these subroutines should be written very carefully.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item login HASHREF
+
+HASHREF should have the following keys: username, password, login and portnum.
+login is a UNIX timestamp; if not specified, will default to the current time.
+Starts a new session for the specified user and portnum. The password is
+optional, but must be correct if specified.
+
+Returns a scalar error message, or the empty string for success.
+
+=item portnum
+
+HASHREF should contain a single key: ip, or the two keys: nasnum and nasport.
+Returns a portnum suitable for the login and logout subroutines, or false
+on error.
+
+=item logout HASHREF
+
+HASHREF should have the following keys: usrename, password, logout and portnum.
+logout is a UNIX timestamp; if not specified, will default to the current time.
+Starts a new session for the specified user and portnum. The password is
+optional, but must be correct if specified.
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub AUTOLOAD {
+ my $hashref = shift;
+ my $method = $AUTOLOAD;
+ $method =~ s/^.*:://;
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_sessiond_socket)) or die "connect: $!";
+ print SOCK "$method\n";
+
+ print SOCK join("\n", %{$hashref}, 'END' ), "\n";
+ SOCK->flush;
+
+ chomp( my $r = <SOCK> );
+ $r;
+}
+
+=back
+
+=head1 VERSION
+
+$Id: SessionClient.pm,v 1.3 2000-12-03 20:25:20 ivan Exp $
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<fs_sessiond>
+
+=cut
+
+1;
+
+
+
diff --git a/fs_sesmon/FS-SessionClient/bin/freeside-login b/fs_sesmon/FS-SessionClient/bin/freeside-login
new file mode 100644
index 000000000..a6d475169
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/bin/freeside-login
@@ -0,0 +1,36 @@
+#!/usr/bin/perl -Tw
+
+#false-laziness hack w freeside-logout
+
+use strict;
+use FS::SessionClient qw( login portnum );
+
+my $username = shift;
+
+my $portnum;
+if ( scalar(@ARGV) == 1 ) {
+ my $arg = shift;
+ if ( $arg =~ /^(\d+)$/ ) {
+ $portnum = $1;
+ } elsif ( $arg =~ /^([\d\.]+)$/ ) {
+ $portnum = portnum( { 'ip' => $1 } ) or die "unknown ip!"
+ } else {
+ &usage;
+ }
+} elsif ( scalar(@ARGV) == 2 ) {
+ $portnum = portnum( { 'nasnum' => shift, 'nasport' => shift } )
+ or die "unknown nasnum/nasport";
+} else {
+ &usage;
+}
+
+my $error = login ( {
+ 'username' => $username,
+ 'portnum' => $portnum,
+} );
+
+warn $error if $error;
+
+sub usage {
+ die "Usage:\n\n freeside-login username ( portnum | ip | nasnum nasport )";
+}
diff --git a/fs_sesmon/FS-SessionClient/bin/freeside-logout b/fs_sesmon/FS-SessionClient/bin/freeside-logout
new file mode 100644
index 000000000..9b4ecfe23
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/bin/freeside-logout
@@ -0,0 +1,36 @@
+#!/usr/bin/perl -Tw
+
+#false-laziness hack w freeside-login
+
+use strict;
+use FS::SessionClient qw( logout portnum );
+
+my $username = shift;
+
+my $portnum;
+if ( scalar(@ARGV) == 1 ) {
+ my $arg = shift;
+ if ( $arg =~ /^(\d+)$/ ) {
+ $portnum = $1;
+ } elsif ( $arg =~ /^([\d\.]+)$/ ) {
+ $portnum = portnum( { 'ip' => $1 } ) or die "unknown ip!"
+ } else {
+ &usage;
+ }
+} elsif ( scalar(@ARGV) == 2 ) {
+ $portnum = portnum( { 'nasnum' => shift, 'nasport' => shift } )
+ or die "unknown nasnum/nasport";
+} else {
+ &usage;
+}
+
+my $error = logout ( {
+ 'username' => $username,
+ 'portnum' => $portnum,
+} );
+
+warn $error if $error;
+
+sub usage {
+ die "Usage:\n\n freeside-logout username ( portnum | ip | nasnum nasport )";
+}
diff --git a/fs_sesmon/FS-SessionClient/cgi/login.cgi b/fs_sesmon/FS-SessionClient/cgi/login.cgi
new file mode 100644
index 000000000..0307c5a3d
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/cgi/login.cgi
@@ -0,0 +1,108 @@
+#!/usr/bin/perl -Tw
+
+#false-laziness hack w logout.cgi
+
+use strict;
+use vars qw( $cgi $username $password $error $ip $portnum );
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use FS::SessionClient qw( login portnum );
+
+$cgi = new CGI;
+
+if ( defined $cgi->param('magic') ) {
+ $cgi->param('username') =~ /^\s*(\w{1,255})\s*$/ or do {
+ $error = "Illegal username";
+ &print_form;
+ exit;
+ };
+ $username = $1;
+ $cgi->param('password') =~ /^([^\n]{0,255})$/ or die "guru meditation #420";
+ $password = $1;
+ #$ip = $cgi->remote_host;
+ $ip = $ENV{REMOTE_ADDR};
+ $ip =~ /^([\d\.]+)$/ or die "illegal ip: $ip";
+ $ip = $1;
+ $portnum = portnum( { 'ip' => $1 } ) or do {
+ $error = "You appear to be coming from an unknown IP address. Verify ".
+ "that your computer is set to obtain an IP address automatically ".
+ "via DHCP.";
+ &print_form;
+ exit;
+ };
+
+ ( $error = login ( {
+ 'username' => $username,
+ 'portnum' => $portnum,
+ 'password' => $password,
+ } ) )
+ ? &print_form()
+ : &print_okay();
+
+} else {
+ $username = '';
+ $password = '';
+ $error = '';
+ &print_form;
+}
+
+sub print_form {
+ my $self_url = $cgi->self_url;
+
+ print $cgi->header( '-expires' => 'now' ), <<END;
+<HTML><HEAD><TITLE>login</TITLE></HEAD>
+<BODY BGCOLOR="#FFFFFF">
+END
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>! if $error;
+
+print <<END;
+<FORM ACTION="$self_url" METHOD="POST">
+<INPUT TYPE="hidden" NAME="magic" VALUE="process">
+<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="4" ALIGN="center">
+<TR>
+ <TD ALIGN="center" COLSPAN="2">
+ <STRONG>Welcome</STRONG>
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">
+ Username
+ </TD>
+ <TD ALIGN="left">
+ <INPUT TYPE="text" NAME="username" VALUE="$username">
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">
+ Password
+ </TD>
+ <TD ALIGN="left">
+ <INPUT TYPE="password" NAME="password">
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="center" COLSPAN="2">
+ <INPUT TYPE="submit" VALUE=" Login ">
+ </TD>
+</TR>
+</TABLE>
+</FORM>
+</BODY>
+</HTML>
+END
+
+}
+
+sub print_okay {
+ print $cgi->header( '-expires' => 'now' ), <<END;
+<HTML><HEAD><TITLE>login sucessful</TITLE></HEAD>
+<BODY>login successful, etc.
+</BODY>
+</HTML>
+END
+}
+
+sub usage {
+ die "Usage:\n\n freeside-login username ( portnum | ip | nasnum nasport )";
+}
diff --git a/fs_sesmon/FS-SessionClient/cgi/logout.cgi b/fs_sesmon/FS-SessionClient/cgi/logout.cgi
new file mode 100644
index 000000000..95cef98d1
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/cgi/logout.cgi
@@ -0,0 +1,83 @@
+#!/usr/bin/perl -Tw
+
+#false-laziness hack w login.cgi
+
+use strict;
+use vars qw( $cgi $username $password $error $ip $portnum );
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use FS::SessionClient qw( logout portnum );
+
+$cgi = new CGI;
+
+if ( defined $cgi->param('magic') ) {
+ $cgi->param('username') =~ /^\s*(\w{1,255})\s*$/ or do {
+ $error = "Illegal username";
+ &print_form;
+ exit;
+ };
+ $username = $1;
+ $cgi->param('password') =~ /^([^\n]{0,255})$/ or die "guru meditation #420";
+ $password = $1;
+ #$ip = $cgi->remote_host;
+ $ip = $ENV{REMOTE_ADDR};
+ $ip =~ /^([\d\.]+)$/ or die "illegal ip: $ip";
+ $ip = $1;
+ $portnum = portnum( { 'ip' => $1 } ) or do {
+ $error = "You appear to be coming from an unknown IP address. Verify ".
+ "that your computer is set to obtain an IP address automatically ".
+ "via DHCP.";
+ &print_form;
+ exit;
+ };
+
+ ( $error = logout ( {
+ 'username' => $username,
+ 'portnum' => $portnum,
+ 'password' => $password,
+ } ) )
+ ? &print_form()
+ : &print_okay();
+
+} else {
+ $username = '';
+ $password = '';
+ $error = '';
+ &print_form;
+}
+
+sub print_form {
+ my $self_url = $cgi->self_url;
+
+ print $cgi->header( '-expires' => 'now' ), <<END;
+<HTML><HEAD><TITLE>logout</TITLE></HEAD>
+<BODY>
+END
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>! if $error;
+
+print <<END;
+<FORM ACTION="$self_url" METHOD=POST>
+<INPUT TYPE="hidden" NAME="magic" VALUE="process">
+Username <INPUT TYPE="text" NAME="username" VALUE="$username"><BR>
+Password <INPUT TYPE="password" NAME="password"><BR>
+<INPUT TYPE="submit">
+</FORM>
+</BODY>
+</HTML>
+END
+
+}
+
+sub print_okay {
+ print $cgi->header( '-expires' => 'now' ), <<END;
+<HTML><HEAD><TITLE>logout sucessful</TITLE></HEAD>
+<BODY>logout successful, etc.
+</BODY>
+</HTML>
+END
+}
+
+sub usage {
+ die "Usage:\n\n freeside-logout username ( portnum | ip | nasnum nasport )";
+}
diff --git a/fs_sesmon/FS-SessionClient/fs_sessiond b/fs_sesmon/FS-SessionClient/fs_sessiond
new file mode 100644
index 000000000..bfdb20a1d
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/fs_sessiond
@@ -0,0 +1,65 @@
+#!/usr/bin/perl -Tw
+#
+# fs_sessiond
+#
+# This is run REMOTELY over ssh by fs_session_server
+#
+
+use strict;
+use Socket;
+
+use vars qw( $Debug );
+
+$Debug = 1;
+
+my $fs_sessiond_socket = "/usr/local/freeside/fs_sessiond_socket";
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+$|=1;
+
+my $me = "[fs_sessiond]";
+
+warn "$me starting\n" if $Debug;
+#nothing to read from server
+
+warn "$me creating $fs_sessiond_socket\n" if $Debug;
+my $uaddr = sockaddr_un($fs_sessiond_socket);
+my $proto = getprotobyname('tcp');
+socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
+unlink($fs_sessiond_socket);
+bind(Server, $uaddr) or die "bind: $!";
+listen(Server,SOMAXCONN) or die "listen: $!";
+
+warn "$me entering main loop\n" if $Debug;
+my $paddr;
+for ( ; $paddr = accept(Client,Server); close Client) {
+
+ chomp( my $command = <Client> );
+
+ if ( $command eq 'login' || $command eq 'logout' || $command eq 'portnum' ) {
+ warn "$me reading data from local client\n" if $Debug;
+ my @data;
+ my $dos = 0;
+ push @data, scalar(<Client>) until $dos++ == 99 || $data[$#data] eq "END\n";
+ if ( $dos == 99 ) {
+ warn "$me WARNING: DoS attempt!"
+ } else {
+ warn "$me sending data to remote server\n" if $Debug;
+ print "$command\n", @data;
+ warn "$me reading result from remote server\n" if $Debug;
+ my $error = <STDIN>;
+ warn "$me sending error to local client\n" if $Debug;
+ print Client $error;
+ }
+ } else {
+ warn "$me WARNING: unexpected command from client: $command";
+ }
+
+}
+
diff --git a/fs_sesmon/FS-SessionClient/test.pl b/fs_sesmon/FS-SessionClient/test.pl
new file mode 100644
index 000000000..4b9ae17e0
--- /dev/null
+++ b/fs_sesmon/FS-SessionClient/test.pl
@@ -0,0 +1,21 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+#use FS::SessionClient;
+#sigh, "not running as the freeside user"
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
diff --git a/fs_sesmon/fs_session_server b/fs_sesmon/fs_session_server
new file mode 100644
index 000000000..00229f8dc
--- /dev/null
+++ b/fs_sesmon/fs_session_server
@@ -0,0 +1,140 @@
+#!/usr/bin/perl -Tw
+#
+# fs_session_server
+#
+
+use strict;
+use vars qw( $opt $Debug );
+use IO::Handle;
+use Net::SSH qw(sshopen2);
+use FS::UID qw(adminsuidsetup dbh);
+use FS::Record qw( qsearchs ); #qsearch );
+#use FS::cust_main_county;
+#use FS::cust_main;
+use FS::session;
+use FS::port;
+use FS::svc_acct;
+
+#require "configfile";
+$Debug = 1;
+
+my $user = shift or die &usage;
+&adminsuidsetup( $user );
+
+my $machine = shift or die &usage;
+
+my $fs_sessiond = "/usr/local/sbin/fs_sessiond";
+
+my $me = "[fs_session_server]";
+
+while (1) {
+ my($reader, $writer) = (new IO::Handle, new IO::Handle);
+ $writer->autoflush(1);
+ warn "$me Connecting to $machine\n" if $Debug;
+ sshopen2($machine,$reader,$writer,$fs_sessiond);
+
+ warn "$me Entering main loop\n" if $Debug;
+ while (1) {
+ warn "$me Reading (waiting for) data\n" if $Debug;
+ my $command = scalar(<$reader>);
+ chomp $command;
+ #DoS protection here too, to protect against a compromised client? *sigh*
+ my %hash;
+ while ( ( my $key = scalar(<$reader>) ) ne "END\n" ) {
+ chomp $key;
+ chomp( $hash{$key} = scalar(<$reader>) );
+ }
+
+ if ( $command eq 'login' ) {
+ my $error = &login(\%hash);
+ print $writer "$error\n";
+ } elsif ( $command eq 'logout' ) {
+ my $error = &logout(\%hash);
+ print $writer "$error\n";
+ } elsif ( $command eq 'portnum' ) {
+ my $port;
+ if ( exists $hash{'ip'} ) {
+ $hash{'ip'} =~ /^([\d\.]+)$/ or $1='nomatch';
+ $port = qsearchs('port', { 'ip' => $1 } );
+ } else {
+ $hash{'nasnum'} =~ /^(\d+)$/ and my $nasnum = $1;
+ $hash{'nasport'} =~ /^(\d+)$/ and my $nasport = $1;
+ $port = qsearchs('port', { 'nasnum'=>$nasnum, 'nasport'=>$nasport } );
+ }
+ print $writer ( $port ? $port->portnum : '' ), "\n";
+ } else {
+ warn "$me WARNING: unrecognized command: $command";
+ }
+ }
+ #won't ever reach without code above to throw out of loop, but...
+ close $writer;
+ close $reader;
+ warn "connection to $machine lost!\n";
+ sleep 5;
+ warn "reconnecting...\n";
+}
+
+sub login {
+ my $href = shift;
+ $href->{'username'} =~ /^([a-z0-9_\-\.]+)$/ or return "Illegal username";
+ my $username = $1;
+ my $svc_acct = qsearchs('svc_acct', { 'username' => $username } )
+ or return "Unknown user";
+ return "Incorrect password"
+ if exists($href->{'password'})
+ && $href->{'password'} ne $svc_acct->_password;
+ return "Time limit exceeded" unless $svc_acct->seconds;
+ my $session = new FS::session {
+ 'portnum' => $href->{'portnum'},
+ 'svcnum' => $svc_acct->svcnum,
+ 'login' => $href->{'login'},
+ };
+ $session->insert;
+}
+
+sub logout {
+ my $href = shift;
+ $href->{'username'} =~ /^([a-z0-9_\-\.]+)$/ or return "Illegal username";
+ my $username = $1;
+ local $FS::UID::AutoCommit = 0;
+ my $dbh = dbh;
+ my $svc_acct =
+ qsearchs('svc_acct', { 'username' => $username }, '', 'FOR UPDATE' )
+ or return "Unknown user";
+ return "Incorrect password"
+ if exists($href->{'password'})
+ && $href->{'password'} ne $svc_acct->_password;
+ my $session = qsearchs( 'session', {
+ 'portnum' => $href->{'portnum'},
+ 'svcnum' => $svc_acct->svcnum,
+ 'logout' => '',
+ },
+ '', 'FOR UPDATE'
+ );
+ unless ( $session ) {
+ $dbh->rollback;
+ return "No currently open sessions found for that user/port!";
+ }
+ my $nsession = new FS::session ( { $session->hash } );
+ warn "$nsession replacing $session";
+ my $error = $nsession->replace($session);
+ if ( $error ) {
+ $dbh->rollback;
+ return "can't logout: $error";
+ }
+ my $time = $nsession->logout - $nsession->login;
+ my $new_svc_acct = new FS::svc_acct ( { $svc_acct->hash } );
+ my $seconds = $new_svc_acct->seconds;
+ $seconds -= $time;
+ $seconds = 0 if $seconds < 0;
+ $new_svc_acct->seconds( $seconds );
+ $error = $new_svc_acct->replace( $svc_acct );
+ warn "can't debit time: $error\n"; #don't want to rollback, though
+ $dbh->commit or die $dbh->errstr;
+ ''
+}
+
+sub usage {
+ die "Usage:\n\n fs_session_server user machine\n";
+}
+
diff --git a/fs_signup/FS-SignupClient/Changes b/fs_signup/FS-SignupClient/Changes
new file mode 100644
index 000000000..e750a82bc
--- /dev/null
+++ b/fs_signup/FS-SignupClient/Changes
@@ -0,0 +1,5 @@
+Revision history for Perl extension FS::SignupClient.
+
+0.01 Mon Aug 23 01:12:46 1999
+ - original version; created by h2xs 1.19
+
diff --git a/fs_signup/FS-SignupClient/MANIFEST b/fs_signup/FS-SignupClient/MANIFEST
new file mode 100644
index 000000000..b4a9900c8
--- /dev/null
+++ b/fs_signup/FS-SignupClient/MANIFEST
@@ -0,0 +1,8 @@
+Changes
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+SignupClient.pm
+test.pl
+fs_signupd
+cgi/signup.cgi
diff --git a/fs_signup/FS-SignupClient/MANIFEST.SKIP b/fs_signup/FS-SignupClient/MANIFEST.SKIP
new file mode 100644
index 000000000..ae335e78a
--- /dev/null
+++ b/fs_signup/FS-SignupClient/MANIFEST.SKIP
@@ -0,0 +1 @@
+CVS/
diff --git a/fs_signup/FS-SignupClient/Makefile.PL b/fs_signup/FS-SignupClient/Makefile.PL
new file mode 100644
index 000000000..e74051947
--- /dev/null
+++ b/fs_signup/FS-SignupClient/Makefile.PL
@@ -0,0 +1,18 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'FS::SignupClient',
+ 'VERSION_FROM' => 'SignupClient.pm', # finds $VERSION
+ 'EXE_FILES' => [ 'fs_signupd' ],
+ 'INSTALLSCRIPT' => '/usr/local/sbin',
+ 'INSTALLSITEBIN' => '/usr/local/sbin',
+ 'PERM_RWX' => '750',
+ 'PREREQ_PM' => {
+ 'Business::CreditCard' => 0,
+ 'HTTP::BrowserDetect' => 0,
+ 'HTTP::Headers::UserAgent' => 3,
+ 'Storable' => 0,
+ 'Text::Template' => 0,
+ },
+);
diff --git a/fs_signup/FS-SignupClient/SignupClient.pm b/fs_signup/FS-SignupClient/SignupClient.pm
new file mode 100644
index 000000000..842064de6
--- /dev/null
+++ b/fs_signup/FS-SignupClient/SignupClient.pm
@@ -0,0 +1,189 @@
+package FS::SignupClient;
+
+use strict;
+use vars qw($VERSION @ISA @EXPORT_OK $fs_signupd_socket);
+use Exporter;
+use Socket;
+use FileHandle;
+use IO::Handle;
+use Storable qw(nstore_fd fd_retrieve);
+
+$VERSION = '0.03';
+
+@ISA = qw( Exporter );
+@EXPORT_OK = qw( signup_info new_customer );
+
+$fs_signupd_socket = "/usr/local/freeside/fs_signupd_socket";
+
+$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+my $freeside_uid = scalar(getpwnam('freeside'));
+die "not running as the freeside user\n" if $> != $freeside_uid;
+
+=head1 NAME
+
+FS::SignupClient - Freeside signup client API
+
+=head1 SYNOPSIS
+
+ use FS::SignupClient qw( signup_info new_customer );
+
+ ( $locales, $packages, $pops ) = signup_info;
+
+ $error = new_customer ( {
+ 'first' => $first,
+ 'last' => $last,
+ 'ss' => $ss,
+ 'comapny' => $company,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'country' => $country,
+ 'daytime' => $daytime,
+ 'night' => $night,
+ 'fax' => $fax,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'invoicing_list' => $invoicing_list,
+ 'referral_custnum' => $referral_custnum,
+ 'comments' => $comments,
+ 'pkgpart' => $pkgpart,
+ 'username' => $username,
+ '_password' => $password,
+ 'sec_phrase' => $sec_phrase,
+ 'popnum' => $popnum,
+ 'agentnum' => $agentnum, #optional
+ } );
+
+=head1 DESCRIPTION
+
+This module provides an API for a remote signup server.
+
+It needs to be run as the freeside user. Because of this, the program which
+calls these subroutines should be written very carefully.
+
+=head1 SUBROUTINES
+
+=over 4
+
+=item signup_info
+
+Returns three array references of hash references.
+
+The first set of hash references is of allowable locales. Each hash reference
+has the following keys:
+ taxnum
+ state
+ county
+ country
+
+The second set of hash references is of allowable packages. Each hash
+reference has the following keys:
+ pkgpart
+ pkg
+
+The third set of hash references is of allowable POPs (Points Of Presence).
+Each hash reference has the following keys:
+ popnum
+ city
+ state
+ ac
+ exch
+
+(Future expansion: fourth argument is the $init_data hash reference)
+
+=cut
+
+sub signup_info {
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!";
+ print SOCK "signup_info\n";
+ SOCK->flush;
+
+ my $init_data = fd_retrieve(\*SOCK);
+ close SOCK;
+
+ (map { $init_data->{$_} } qw( cust_main_county part_pkg svc_acct_pop ) ),
+ $init_data;
+
+}
+
+=item new_customer HASHREF
+
+Adds a customer to the remote Freeside system. Requires a hash reference as
+a paramater with the following keys:
+ first
+ last
+ ss
+ comapny
+ address1
+ address2
+ city
+ county
+ state
+ zip
+ country
+ daytime
+ night
+ fax
+ payby
+ payinfo
+ paydate
+ payname
+ invoicing_list
+ referral_custnum
+ comments
+ pkgpart
+ username
+ _password
+ sec_phrase
+ popnum
+
+Returns a scalar error message, or the empty string for success.
+
+=cut
+
+sub new_customer {
+ my $hashref = shift;
+
+ socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
+ connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!";
+ print SOCK "new_customer\n";
+
+ my $signup_data = { map { $_ => $hashref->{$_} } qw(
+ first last ss company address1 address2 city county state zip country
+ daytime night fax payby payinfo paydate payname invoicing_list
+ referral_custnum comments pkgpart username _password sec_phrase popnum
+ ) };
+
+ $signup_data->{agentnum} = $hashref->{agentnum} if $hashref->{agentnum};
+
+ nstore_fd($signup_data, \*SOCK) or die "can't send customer signup: $!";
+ SOCK->flush;
+
+ chop( my $error = <SOCK> );
+ $error;
+}
+
+=back
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<fs_signupd>, L<FS::cust_main>
+
+=cut
+
+1;
+
diff --git a/fs_signup/FS-SignupClient/cgi/decline.html b/fs_signup/FS-SignupClient/cgi/decline.html
new file mode 100644
index 000000000..a37ba3ab6
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/decline.html
@@ -0,0 +1,5 @@
+<HTML><HEAD><TITLE>Processing error</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Processing error</FONT><BR><BR>
+There has been an error processing your account. Please contact customer
+support.
+</BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/signup-alternate.html b/fs_signup/FS-SignupClient/cgi/signup-alternate.html
new file mode 100755
index 000000000..490cefa5e
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/signup-alternate.html
@@ -0,0 +1,218 @@
+<HTML><HEAD><TITLE>ISP Signup form</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup form</FONT><BR><BR>
+<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
+<FORM NAME="dummy">
+<INPUT TYPE="hidden" NAME="magic" VALUE="process">
+<INPUT TYPE="hidden" NAME="ref" VALUE="<%= $referral_custnum %>">
+<INPUT TYPE="hidden" NAME="ss" VALUE="">
+<INPUT TYPE="hidden" NAME="agentnum" VALUE="3">
+Contact Information
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Contact name<BR>(last, first)</TH>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="<%= $last %>">,
+ <INPUT TYPE="text" NAME="first" VALUE="<%= $first %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Company</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="<%= $company %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Address</TH>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="<%= $address1 %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">&nbsp;</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="<%= $address2 %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
+ <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
+ <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
+ <TD><SELECT NAME="state" SIZE="1">
+
+ <%=
+ foreach ( @{$locales} ) {
+ my $value = $_->{'state'};
+ $value .= ' ('. $_->{'county'}. ')' if $_->{'county'};
+ $value .= ' / '. $_->{'country'};
+
+ $OUT .= qq(<OPTION VALUE="$value");
+ $OUT .= ' SELECTED' if ( $state eq $_->{'state'}
+ && $county eq $_->{'county'}
+ && $country eq $_->{'country'}
+ );
+ $OUT .= ">$value</OPTION>";
+ }
+ %>
+
+ </SELECT></TD>
+ <TH><font color="#ff0000">*</font>Zip</TH>
+ <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Day Phone</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="<%= $daytime %>" SIZE=18></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Night Phone</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="<%= $night %>" SIZE=18></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Fax</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="<%= $fax %>" SIZE=12></TD>
+</TR>
+</TABLE><font color="#ff0000">*</font> required fields<BR>
+
+<BR><BR>
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Username</TH>
+ <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Password</TH>
+ <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Re-enter Password</TH>
+ <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>"></TD>
+</TR>
+
+<%= if ( $init_data->{'security_phrase'} ) {
+ <<ENDOUT;
+<TR>
+ <TD ALIGN="right">Security Phrase</TD>
+ <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase">
+ </TD>
+</TR>
+ENDOUT
+ } else {
+ '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
+ }
+%>
+
+<%= if ( scalar(@$pops) ) {
+ '<TR><TD ALIGN="right">Access number</TD><TD>'.
+ popselector($popnum). '</TD></TR>';
+ } else {
+ popselector($popnum);
+ }
+%>
+
+</TABLE><font color="#ff0000">*</font> required fields
+
+<BR><BR>First package
+
+ <%= use Tie::IxHash;
+ my %pkgpart2payby = map { $_->{pkgpart} => $_->{payby}[0] } @{$packages};
+ tie my %options, 'Tie::IxHash',
+ '' => '(none)',
+ map { $_->{pkgpart} => $_->{pkg} }
+ sort { $a->{recur} <=> $b->{recur} }
+ @{$packages}
+ ;
+
+ use HTML::Widgets::SelectLayers 0.02;
+ my @form_text = qw( magic ref ss agentnum
+ last first company address1 address2
+ city zip daytime night fax
+ username _password _password2 sec_phrase );
+ my @form_select = qw( state ); #county country
+ if ( scalar(@$pops) == 0 or scalar(@$pops) == 1 ) {
+ push @form_text, 'popnum',
+ } else {
+ push @form_select, 'popnum',
+ }
+ my $widget = new HTML::Widgets::SelectLayers(
+ options => \%options,
+ selected_layer => $pkgpart,
+ form_name => 'dummy',
+ form_action => $self_url,
+ form_text => \@form_text,
+ form_select => \@form_select,
+ layer_callback => sub {
+ my $layer = shift;
+ my $html = qq( <INPUT TYPE="hidden" NAME="pkgpart" VALUE="$layer">);
+
+ if ( $pkgpart2payby{$layer} eq 'BILL' ) {
+ $html .= <<ENDOUT;
+<INPUT TYPE="hidden" NAME="payby" VALUE="BILL">
+<INPUT TYPE="hidden" NAME="invoicing_list_POST" VALUE="">
+<INPUT TYPE="hidden" NAME="BILL_payinfo" VALUE="">
+<INPUT TYPE="hidden" NAME="BILL_month" VALUE="12">
+<INPUT TYPE="hidden" NAME="BILL_year" VALUE="2037">
+<INPUT TYPE="hidden" NAME="BILL_payname" VALUE="">
+<BR><BR><INPUT TYPE="submit" VALUE="Signup">
+ENDOUT
+ } elsif ( $pkgpart2payby{$layer} eq 'CARD' ) {
+ my $postal_checked = '';
+ my @invoicing_list = split(', ', $invoicing_list );
+ $postal_checked = 'CHECKED'
+ if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
+
+ $invoicing_list= join(', ', grep { $_ ne 'POST' } @invoicing_list );
+
+ my $expselect = expselect("CARD", $paydate);
+
+ my $cardselect = '<SELECT NAME="CARD_type"><OPTION></OPTION>';
+ my %types = (
+ 'VISA' => 'VISA card',
+ 'MasterCard' => 'MasterCard',
+ 'Discover' => 'Discover card',
+ 'American Express' => 'American Express card',
+ );
+ foreach ( keys %types ) {
+ $selected =
+ $cgi->param('CARD_type') eq $types{$_} ? 'SELECTED' : '';
+ $cardselect .=
+ qq!<OPTION $selected VALUE="$types{$_}">$_</OPTION>!;
+ }
+ $cardselect .= '</SELECT>';
+
+ $html .= <<ENDOUT;
+<INPUT TYPE="hidden" NAME="payby" VALUE="CARD">
+<BR><BR>Billing information
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0>
+<INPUT TYPE="hidden" NAME="invoicing_list_POST" VALUE="">
+<TR>
+ <TD ALIGN="right">Email statement to </TD>
+ <TD><INPUT TYPE="text" NAME="invoicing_list" VALUE="$invoicing_list"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Credit card type</TH>
+ <TD>$cardselect</TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Card number</TH>
+ <TD><INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>*</font>Exp</TH>
+ <TD>$expselect</TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Name on card</TH>
+ <TD><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname"></TD>
+</TR>
+</TABLE>
+<font color="#ff0000">*</font> required fields
+<BR><BR><INPUT TYPE="submit" VALUE="Signup">
+ENDOUT
+ } else {
+ $html = <<ENDOUT;
+<BR>Please select a package.<BR>
+ENDOUT
+
+ }
+
+ $html;
+
+ },
+ );
+
+ $widget->html;
+
+
+ %>
+</BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi
new file mode 100755
index 000000000..57b93d4f0
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/signup.cgi
@@ -0,0 +1,664 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: signup.cgi,v 1.43 2003-07-04 03:21:42 ivan Exp $
+
+use strict;
+use vars qw( @payby $cgi $locales $packages
+ $pops %pop %popnum2pop
+ $init_data $error
+ $last $first $ss $company $address1 $address2 $city $state $county
+ $country $zip $daytime $night $fax $invoicing_list $payby $payinfo
+ $paydate $payname $referral_custnum $init_popstate
+ $pkgpart $username $password $password2 $sec_phrase $popnum
+ $agentnum
+ $ieak_file $ieak_template $cck_file $cck_template
+ $signup_html $signup_template
+ $success_html $success_template
+ $decline_html $decline_template
+ $ac $exch $loc
+ $email_name $pkg
+ $self_url
+ );
+use subs qw( print_form print_okay print_decline
+ success_default decline_default
+ expselect );
+use CGI;
+#use CGI::Carp qw(fatalsToBrowser);
+use Text::Template;
+use Business::CreditCard;
+use HTTP::Headers::UserAgent 2.00;
+use FS::SignupClient 0.03 qw( signup_info new_customer );
+
+#acceptable payment methods
+#
+#@payby = qw( CARD BILL COMP );
+#@payby = qw( CARD BILL );
+#@payby = qw( CARD );
+@payby = qw( CARD PREPAY );
+
+$ieak_file = '/usr/local/freeside/ieak.template';
+$cck_file = '/usr/local/freeside/cck.template';
+$signup_html = -e 'signup.html'
+ ? 'signup.html'
+ : '/usr/local/freeside/signup.html';
+$success_html = -e 'success.html'
+ ? 'success.html'
+ : '/usr/local/freeside/success.html';
+$decline_html = -e 'decline.html'
+ ? 'decline.html'
+ : '/usr/local/freeside/decline.html';
+
+
+if ( -e $ieak_file ) {
+ my $ieak_txt = Text::Template::_load_text($ieak_file)
+ or die $Text::Template::ERROR;
+ $ieak_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
+ $ieak_txt = $1;
+ $ieak_txt =~ s/\r//g; # don't double \r on old templates
+ $ieak_txt =~ s/\n/\r\n/g;
+ $ieak_template = new Text::Template ( TYPE => 'STRING', SOURCE => $ieak_txt )
+ or die $Text::Template::ERROR;
+} else {
+ $ieak_template = '';
+}
+
+if ( -e $cck_file ) {
+ my $cck_txt = Text::Template::_load_text($cck_file)
+ or die $Text::Template::ERROR;
+ $cck_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
+ $cck_txt = $1;
+ $cck_template = new Text::Template ( TYPE => 'STRING', SOURCE => $cck_txt )
+ or die $Text::Template::ERROR;
+} else {
+ $cck_template = '';
+}
+
+$agentnum = '';
+if ( -e $signup_html ) {
+ my $signup_txt = Text::Template::_load_text($signup_html)
+ or die $Text::Template::ERROR;
+ $signup_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
+ $signup_txt = $1;
+ $signup_template = new Text::Template ( TYPE => 'STRING',
+ SOURCE => $signup_txt,
+ DELIMITERS => [ '<%=', '%>' ]
+ )
+ or die $Text::Template::ERROR;
+ if ( $signup_txt =~
+ /<\s*INPUT TYPE="?hidden"?\s+NAME="?agentnum"?\s+VALUE="?(\d+)"?\s*>/si
+ ) {
+ $agentnum = $1;
+ }
+} else {
+ #too much maintenance hassle to keep in this file
+ die "can't find ./signup.html or /usr/local/freeside/signup.html";
+ #$signup_template = new Text::Template ( TYPE => 'STRING',
+ # SOURCE => &signup_default,
+ # DELIMITERS => [ '<%=', '%>' ]
+ # )
+ # or die $Text::Template::ERROR;
+}
+
+if ( -e $success_html ) {
+ my $success_txt = Text::Template::_load_text($success_html)
+ or die $Text::Template::ERROR;
+ $success_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
+ $success_txt = $1;
+ $success_template = new Text::Template ( TYPE => 'STRING',
+ SOURCE => $success_txt,
+ DELIMITERS => [ '<%=', '%>' ],
+ )
+ or die $Text::Template::ERROR;
+} else {
+ $success_template = new Text::Template ( TYPE => 'STRING',
+ SOURCE => &success_default,
+ DELIMITERS => [ '<%=', '%>' ],
+ )
+ or die $Text::Template::ERROR;
+}
+
+if ( -e $decline_html ) {
+ my $decline_txt = Text::Template::_load_text($decline_html)
+ or die $Text::Template::ERROR;
+ $decline_txt =~ /^(.*)$/s; #untaint the template source - it's trusted
+ $decline_txt = $1;
+ $decline_template = new Text::Template ( TYPE => 'STRING',
+ SOURCE => $decline_txt,
+ DELIMITERS => [ '<%=', '%>' ],
+ )
+ or die $Text::Template::ERROR;
+} else {
+ $decline_template = new Text::Template ( TYPE => 'STRING',
+ SOURCE => &decline_default,
+ DELIMITERS => [ '<%=', '%>' ],
+ )
+ or die $Text::Template::ERROR;
+}
+
+
+( $locales, $packages, $pops, $init_data ) = signup_info();
+@payby = @{$init_data->{'payby'}} if @{$init_data->{'payby'}};
+$packages = $init_data->{agentnum2part_pkg}{$agentnum} if $agentnum;
+%pop = ();
+%popnum2pop = ();
+foreach (@$pops) {
+ push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_;
+ $popnum2pop{$_->{popnum}} = $_;
+}
+
+$cgi = new CGI;
+
+if ( defined $cgi->param('magic') ) {
+ if ( $cgi->param('magic') eq 'process' ) {
+
+ if ( $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/ ) {
+ $state = $1;
+ $county = $3 || '';
+ $country = $4;
+ } elsif ( $cgi->param('state') =~ /^(\w*)$/ ) {
+ $state = $1;
+ $cgi->param('county') =~ /^([\w ]*)$/
+ or die "illegal county: ". $cgi->param('county');
+ $county = $1;
+ $cgi->param('country') =~ /^(\w+)$/
+ or die "illegal country: ". $cgi->param('country');
+ $country = $1;
+ } else {
+ die "illegal state: ". $cgi->param('state');
+ }
+
+ $payby = $cgi->param('payby');
+ if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
+ #$payinfo = join('@', map { $cgi->param( $payby. "_payinfo$_" ) } (1,2) );
+ $payinfo = $cgi->param($payby. '_payinfo1'). '@'.
+ $cgi->param($payby. '_payinfo2');
+ } else {
+ $payinfo = $cgi->param( $payby. '_payinfo' );
+ }
+ $paydate =
+ $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' );
+ $payname = $cgi->param( $payby. '_payname' );
+
+ if ( $invoicing_list = $cgi->param('invoicing_list') ) {
+ $invoicing_list .= ', POST' if $cgi->param('invoicing_list_POST');
+ } else {
+ $invoicing_list = 'POST';
+ }
+
+ $error = '';
+
+ $last = $cgi->param('last');
+ $first = $cgi->param('first');
+ $ss = $cgi->param('ss');
+ $company = $cgi->param('company');
+ $address1 = $cgi->param('address1');
+ $address2 = $cgi->param('address2');
+ $city = $cgi->param('city');
+ #$county,
+ #$state,
+ $zip = $cgi->param('zip');
+ #$country,
+ $daytime = $cgi->param('daytime');
+ $night = $cgi->param('night');
+ $fax = $cgi->param('fax');
+ #$payby,
+ #$payinfo,
+ #$paydate,
+ #$payname,
+ #$invoicing_list,
+ $referral_custnum = $cgi->param('ref');
+ $pkgpart = $cgi->param('pkgpart');
+ $username = $cgi->param('username');
+ $sec_phrase = $cgi->param('sec_phrase');
+ $password = $cgi->param('_password');
+ $popnum = $cgi->param('popnum');
+ #$agentnum, # = $cgi->param('agentnum'),
+ $init_popstate = $cgi->param('init_popstate');
+
+ if ( $cgi->param('_password') ne $cgi->param('_password2') ) {
+ $error = $init_data->{msgcat}{passwords_dont_match}; #msgcat
+ $password = '';
+ $password2 = '';
+ } else {
+ $password2 = $cgi->param('_password2');
+
+ if ( $payby =~ /^(CARD|DCRD)$/ && $cgi->param('CARD_type') ) {
+ $payinfo =~ s/\D//g;
+
+ $payinfo =~ /^(\d{13,16})$/
+ or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
+ $payinfo = $1;
+ validate($payinfo)
+ or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
+ cardtype($payinfo) eq $cgi->param('CARD_type')
+ or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
+ }
+
+ $error ||= new_customer ( {
+ 'last' => $last,
+ 'first' => $first,
+ 'ss' => $ss,
+ 'company' => $company,
+ 'address1' => $address1,
+ 'address2' => $address2,
+ 'city' => $city,
+ 'county' => $county,
+ 'state' => $state,
+ 'zip' => $zip,
+ 'country' => $country,
+ 'daytime' => $daytime,
+ 'night' => $night,
+ 'fax' => $fax,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paydate' => $paydate,
+ 'payname' => $payname,
+ 'invoicing_list' => $invoicing_list,
+ 'referral_custnum' => $referral_custnum,
+ 'pkgpart' => $pkgpart,
+ 'username' => $username,
+ 'sec_phrase' => $sec_phrase,
+ '_password' => $password,
+ 'popnum' => $popnum,
+ 'agentnum' => $agentnum,
+ } );
+
+ }
+
+ if ( $error eq '_decline' ) {
+ print_decline();
+ } elsif ( $error ) {
+ print_form();
+ } else {
+ print_okay();
+ }
+
+ } else {
+ die "unrecognized magic: ". $cgi->param('magic');
+ }
+} else {
+ $error = '';
+ $last = '';
+ $first = '';
+ $ss = '';
+ $company = '';
+ $address1 = '';
+ $address2 = '';
+ $city = '';
+ $state = $init_data->{statedefault};
+ $county = '';
+ $country = $init_data->{countrydefault};
+ $zip = '';
+ $daytime = '';
+ $night = '';
+ $fax = '';
+ $invoicing_list = '';
+ $payby = '';
+ $payinfo = '';
+ $paydate = '';
+ $payname = '';
+ $pkgpart = '';
+ $username = '';
+ $password = '';
+ $password2 = '';
+ $sec_phrase = '';
+ $popnum = '';
+ $referral_custnum = $cgi->param('ref') || '';
+ $init_popstate = $cgi->param('init_popstate') || '';
+ print_form;
+}
+
+sub print_form {
+
+ $cgi->delete('ref');
+ $cgi->delete('init_popstate');
+ $self_url = $cgi->self_url;
+
+ $error = "Error: $error" if $error;
+
+ print $cgi->header( '-expires' => 'now' ),
+ $signup_template->fill_in();
+
+}
+
+sub print_decline {
+ print $cgi->header( '-expires' => 'now' ),
+ $decline_template->fill_in();
+}
+
+sub print_okay {
+ my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT};
+
+ $cgi->param('username') =~ /^(.+)$/
+ or die "fatal: invalid username got past FS::SignupClient::new_customer";
+ my $username = $1;
+ $cgi->param('_password') =~ /^(.+)$/
+ or die "fatal: invalid password got past FS::SignupClient::new_customer";
+ my $password = $1;
+ ( $cgi->param('first'). ' '. $cgi->param('last') ) =~ /^(.*)$/
+ or die "fatal: invalid email_name got past FS::SignupClient::new_customer";
+ $email_name = $1; #global for template
+
+ my $pop = $popnum2pop{$cgi->param('popnum')};
+ #or die "fatal: invalid popnum got past FS::SignupClient::new_customer";
+ if ( $pop ) {
+ ( $ac, $exch, $loc ) = ( $pop->{'ac'}, $pop->{'exch'}, $pop->{'loc'} );
+ } else {
+ ( $ac, $exch, $loc ) = ( '', '', ''); #presumably you're not using them.
+ }
+
+ #global for template
+ $pkg = ( grep { $_->{'pkgpart'} eq $pkgpart } @$packages )[0]->{'pkg'};
+
+ if ( $ieak_template
+ && $user_agent->platform eq 'ia32'
+ && $user_agent->os =~ /^win/
+ && ($user_agent->browser)[0] eq 'IE'
+ )
+ { #send an IEAK config
+ print $cgi->header('application/x-Internet-signup'),
+ $ieak_template->fill_in();
+ } elsif ( $cck_template
+ && $user_agent->platform eq 'ia32'
+ && $user_agent->os =~ /^win/
+ && ($user_agent->browser)[0] eq 'Netscape'
+ )
+ { #send a Netscape config
+ my $cck_data = $cck_template->fill_in();
+ print $cgi->header('application/x-netscape-autoconfigure-dialer-v2'),
+ map {
+ m/(.*)\s+(.*)$/;
+ pack("N", length($1)). $1. pack("N", length($2)). $2;
+ } split(/\n/, $cck_data);
+
+ } else { #send a simple confirmation
+ print $cgi->header( '-expires' => 'now' ),
+ $success_template->fill_in();
+ }
+}
+
+#horrible false laziness with FS/FS/svc_acct_pop.pm::popselector
+sub popselector {
+
+ my( $popnum ) = @_;
+
+ return '<INPUT TYPE="hidden" NAME="popnum" VALUE="">' unless @$pops;
+ return $pops->[0]{city}. ', '. $pops->[0]{state}.
+ ' ('. $pops->[0]{ac}. ')/'. $pops->[0]{exch}. '-'. $pops->[0]{loc}.
+ '<INPUT TYPE="hidden" NAME="popnum" VALUE="'. $pops->[0]{popnum}. '">'
+ if scalar(@$pops) == 1;
+
+ #my %pop = ();
+ #my %popnum2pop = ();
+ #foreach (@$pops) {
+ # push @{ $pop{ $_->{state} }->{ $_->{ac} } }, $_;
+ # $popnum2pop{$_->{popnum}} = $_;
+ #}
+
+ my $text = <<END;
+ <SCRIPT>
+ function opt(what,href,text) {
+ var optionName = new Option(text, href, false, false)
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+END
+
+ if ( $init_popstate ) {
+ $text .= '<INPUT TYPE="hidden" NAME="init_popstate" VALUE="'.
+ $init_popstate. '">';
+ } else {
+ $text .= <<END;
+ function acstate_changed(what) {
+ state = what.options[what.selectedIndex].text;
+ what.form.popac.options.length = 0
+ what.form.popac.options[0] = new Option("Area code", "-1", false, true);
+END
+ }
+
+ my @states = $init_popstate ? ( $init_popstate ) : keys %pop;
+ foreach my $state ( sort { $a cmp $b } @states ) {
+ $text .= "\nif ( state == \"$state\" ) {\n" unless $init_popstate;
+
+ foreach my $ac ( sort { $a cmp $b } keys %{ $pop{$state} }) {
+ $text .= "opt(what.form.popac, \"$ac\", \"$ac\");\n";
+ if ($ac eq $cgi->param('popac')) {
+ $text .= "what.form.popac.options[what.form.popac.length-1].selected = true;\n";
+ }
+ }
+ $text .= "}\n" unless $init_popstate;
+ }
+ $text .= "popac_changed(what.form.popac)}\n";
+
+ $text .= <<END;
+ function popac_changed(what) {
+ ac = what.options[what.selectedIndex].text;
+ what.form.popnum.options.length = 0;
+ what.form.popnum.options[0] = new Option("City", "-1", false, true);
+
+END
+
+ foreach my $state ( @states ) {
+ foreach my $popac ( keys %{ $pop{$state} } ) {
+ $text .= "\nif ( ac == \"$popac\" ) {\n";
+
+ foreach my $pop ( @{$pop{$state}->{$popac}}) {
+ my $o_popnum = $pop->{popnum};
+ my $poptext = $pop->{city}. ', '. $pop->{state}.
+ ' ('. $pop->{ac}. ')/'. $pop->{exch}. '-'. $pop->{loc};
+
+ $text .= "opt(what.form.popnum, \"$o_popnum\", \"$poptext\");\n";
+ if ($popnum == $o_popnum) {
+ $text .= "what.form.popnum.options[what.form.popnum.length-1].selected = true;\n";
+ }
+ }
+ $text .= "}\n";
+ }
+ }
+
+
+ $text .= "}\n</SCRIPT>\n";
+
+ $text .=
+ qq!<TABLE CELLPADDING="0"><TR><TD><SELECT NAME="acstate"! .
+ qq!SIZE=1 onChange="acstate_changed(this)"><OPTION VALUE=-1>State!;
+ $text .= "<OPTION" . ($_ eq $cgi->param('acstate') ? " SELECTED" : "") .
+ ">$_" foreach sort { $a cmp $b } @states;
+ $text .= '</SELECT>'; #callback? return 3 html pieces? #'</TD>';
+
+ $text .=
+ qq!<SELECT NAME="popac" SIZE=1 onChange="popac_changed(this)">!.
+ qq!<OPTION>Area code</SELECT></TR><TR VALIGN="top">!;
+
+ $text .= qq!<TR><TD><SELECT NAME="popnum" SIZE=1 STYLE="width: 20em"><OPTION>City!;
+
+
+ #comment this block to disable initial list polulation
+ my @initial_select = ();
+ if ( scalar( @$pops ) > 100 ) {
+ push @initial_select, $popnum2pop{$popnum} if $popnum2pop{$popnum};
+ } else {
+ @initial_select = @$pops;
+ }
+ foreach my $pop ( sort { $a->{state} cmp $b->{state} } @initial_select ) {
+ $text .= qq!<OPTION VALUE="!. $pop->{popnum}. '"'.
+ ( ( $popnum && $pop->{popnum} == $popnum ) ? ' SELECTED' : '' ). ">".
+ $pop->{city}. ', '. $pop->{state}.
+ ' ('. $pop->{ac}. ')/'. $pop->{exch}. '-'. $pop->{loc};
+ }
+
+ $text .= qq!</SELECT></TD></TR></TABLE>!;
+
+ $text;
+
+}
+
+sub expselect {
+ my $prefix = shift;
+ my $date = shift || '';
+ my( $m, $y ) = ( 0, 0 );
+ if ( $date =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ }
+ my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
+ for ( 1 .. 12 ) {
+ $return .= "<OPTION";
+ $return .= " SELECTED" if $_ == $m;
+ $return .= ">$_";
+ }
+ $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
+ for ( 2001 .. 2037 ) {
+ $return .= "<OPTION";
+ $return .= " SELECTED" if $_ == $y;
+ $return .= ">$_";
+ }
+ $return .= "</SELECT>";
+
+ $return;
+}
+
+#false laziness w/FS::cust_main_county
+sub regionselector {
+ my ( $selected_county, $selected_state, $selected_country,
+ $prefix, $onchange ) = @_;
+
+ my $prefix = '' unless defined $prefix;
+
+ my $countyflag = 0;
+
+ my %cust_main_county;
+
+# unless ( @cust_main_county ) { #cache
+ #@cust_main_county = qsearch('cust_main_county', {} );
+ #foreach my $c ( @cust_main_county ) {
+ foreach my $c ( @$locales ) {
+ #$countyflag=1 if $c->county;
+ $countyflag=1 if $c->{county};
+ #push @{$cust_main_county{$c->country}{$c->state}}, $c->county;
+ #$cust_main_county{$c->country}{$c->state}{$c->county} = 1;
+ $cust_main_county{$c->{country}}{$c->{state}}{$c->{county}} = 1;
+ }
+# }
+ $countyflag=1 if $selected_county;
+
+ my $script_html = <<END;
+ <SCRIPT>
+ function opt(what,value,text) {
+ var optionName = new Option(text, value, false, false);
+ var length = what.length;
+ what.options[length] = optionName;
+ }
+ function ${prefix}country_changed(what) {
+ country = what.options[what.selectedIndex].text;
+ for ( var i = what.form.${prefix}state.length; i >= 0; i-- )
+ what.form.${prefix}state.options[i] = null;
+END
+ #what.form.${prefix}state.options[0] = new Option('', '', false, true);
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ my $text = $state || '(n/a)';
+ $script_html .= qq!opt(what.form.${prefix}state, "$state", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+
+ $script_html .= <<END;
+ }
+ function ${prefix}state_changed(what) {
+END
+
+ if ( $countyflag ) {
+ $script_html .= <<END;
+ state = what.options[what.selectedIndex].text;
+ country = what.form.${prefix}country.options[what.form.${prefix}country.selectedIndex].text;
+ for ( var i = what.form.${prefix}county.length; i >= 0; i-- )
+ what.form.${prefix}county.options[i] = null;
+END
+
+ foreach my $country ( sort keys %cust_main_county ) {
+ $script_html .= "\nif ( country == \"$country\" ) {\n";
+ foreach my $state ( sort keys %{$cust_main_county{$country}} ) {
+ $script_html .= "\nif ( state == \"$state\" ) {\n";
+ #foreach my $county ( sort @{$cust_main_county{$country}{$state}} ) {
+ foreach my $county ( sort keys %{$cust_main_county{$country}{$state}} ) {
+ my $text = $county || '(n/a)';
+ $script_html .=
+ qq!opt(what.form.${prefix}county, "$county", "$text");\n!;
+ }
+ $script_html .= "}\n";
+ }
+ $script_html .= "}\n";
+ }
+ }
+
+ $script_html .= <<END;
+ }
+ </SCRIPT>
+END
+
+ my $county_html = $script_html;
+ if ( $countyflag ) {
+ $county_html .= qq!<SELECT NAME="${prefix}county" onChange="$onchange">!;
+ $county_html .= '</SELECT>';
+ } else {
+ $county_html .=
+ qq!<INPUT TYPE="hidden" NAME="${prefix}county" VALUE="$selected_county">!;
+ }
+
+ my $state_html = qq!<SELECT NAME="${prefix}state" !.
+ qq!onChange="${prefix}state_changed(this); $onchange">!;
+ foreach my $state ( sort keys %{ $cust_main_county{$selected_country} } ) {
+ my $text = $state || '(n/a)';
+ my $selected = $state eq $selected_state ? 'SELECTED' : '';
+ $state_html .= "\n<OPTION $selected VALUE=$state>$text</OPTION>"
+ }
+ $state_html .= '</SELECT>';
+
+ $state_html .= '</SELECT>';
+
+ my $country_html = qq!<SELECT NAME="${prefix}country" !.
+ qq!onChange="${prefix}country_changed(this); $onchange">!;
+ my $countrydefault = $init_data->{countrydefault} || 'US';
+ foreach my $country (
+ sort { ($b eq $countrydefault) <=> ($a eq $countrydefault) or $a cmp $b }
+ keys %cust_main_county
+ ) {
+ my $selected = $country eq $selected_country ? ' SELECTED' : '';
+ $country_html .= "\n<OPTION$selected>$country</OPTION>"
+ }
+ $country_html .= '</SELECT>';
+
+ ($county_html, $state_html, $country_html);
+
+}
+
+sub success_default { #html to use if you don't specify a success file
+ <<'END';
+<HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
+Thanks for signing up!
+<BR><BR>
+Signup information for <%= $email_name %>:
+<BR><BR>
+Username: <%= $username %><BR>
+Password: <%= $password %><BR>
+Access number: (<%= $ac %>) / $exch - $local<BR>
+Package: <%= $pkg %><BR>
+</BODY></HTML>
+END
+}
+
+sub decline_default { #html to use if there is a decline
+ <<'END';
+<HTML><HEAD><TITLE>Processing error</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Processing error</FONT><BR><BR>
+There has been an error processing your account. Please contact customer
+support.
+</BODY></HTML>
+END
+}
+
diff --git a/fs_signup/FS-SignupClient/cgi/signup.html b/fs_signup/FS-SignupClient/cgi/signup.html
new file mode 100755
index 000000000..80774099c
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/signup.html
@@ -0,0 +1,184 @@
+<HTML><HEAD><TITLE>ISP Signup form</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup form</FONT><BR><BR>
+<FONT SIZE="+1" COLOR="#ff0000"><%= $error %></FONT>
+<FORM ACTION="<%= $self_url %>" METHOD=POST>
+<INPUT TYPE="hidden" NAME="magic" VALUE="process">
+<INPUT TYPE="hidden" NAME="ref" VALUE="<%= $referral_custnum %>">
+<INPUT TYPE="hidden" NAME="ss" VALUE="">
+Contact Information
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Contact name<BR>(last, first)</TH>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="last" VALUE="<%= $last %>">,
+ <INPUT TYPE="text" NAME="first" VALUE="<%= $first %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Company</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="<%= $company %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Address</TH>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="<%= $address1 %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">&nbsp;</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="<%= $address2 %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>City</TH>
+ <TD><INPUT TYPE="text" NAME="city" VALUE="<%= $city %>"></TD>
+ <TH ALIGN="right"><font color="#ff0000">*</font>State/Country</TH>
+ <TD>
+ <%=
+ ($county_html, $state_html, $country_html) =
+ regionselector( $county, $state, $country );
+
+ "$county_html $state_html";
+ %>
+ </TD>
+ <TH><font color="#ff0000">*</font>Zip</TH>
+ <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="<%= $zip %>"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right"><font color="#ff0000">*</font>Country</TH>
+ <TD><%= $country_html %></TD>
+<TR>
+ <TD ALIGN="right">Day Phone</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="<%= $daytime %>" SIZE=18></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Night Phone</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="<%= $night %>" SIZE=18></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Fax</TD>
+ <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="<%= $fax %>" SIZE=12></TD>
+</TR>
+</TABLE><font color="#ff0000">*</font> required fields<BR>
+<BR>Billing information<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
+<TR><TD>
+
+ <%=
+ $OUT .= '<INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"';
+ my @invoicing_list = split(', ', $invoicing_list );
+ $OUT .= ' CHECKED'
+ if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
+ $OUT .= '>';
+ %>
+
+ Postal mail invoice
+</TD></TR>
+<TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="<%= join(', ', grep { $_ ne 'POST' } split(', ', $invoicing_list ) ) %>">
+</TD></TR>
+<%= scalar(@payby) > 1 ? '<TR><TD>Billing type</TD></TR>' : '' %>
+</TABLE>
+<TABLE BGCOLOR="#c0c0c0" BORDER=1 WIDTH="100%">
+<TR>
+
+ <%=
+
+ my $cardselect = '<SELECT NAME="CARD_type"><OPTION></OPTION>';
+ my %types = (
+ 'VISA' => 'VISA card',
+ 'MasterCard' => 'MasterCard',
+ 'Discover' => 'Discover card',
+ 'American Express' => 'American Express card',
+ );
+ foreach ( keys %types ) {
+ $selected = $cgi->param('CARD_type') eq $types{$_} ? 'SELECTED' : '';
+ $cardselect .= qq!<OPTION $selected VALUE="$types{$_}">$_</OPTION>!;
+ }
+ $cardselect .= '</SELECT>';
+
+ my %payby = (
+ 'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
+ 'DCRD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("DCRD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="">!,
+ 'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="">!,
+ 'DCHK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="">!,
+ 'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
+ 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", "12-2037"). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
+ 'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("COMP"),
+ 'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="" MAXLENGTH=80>!,
+ );
+
+ my( $account, $aba ) = split('@', $payinfo);
+ my %paybychecked = (
+ 'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
+ 'DCRD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("DCRD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="$payname">!,
+ 'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="$account" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="$payname">!,
+ 'DCHK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="$account" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="$payname">!,
+ 'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="$payinfo" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
+ 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", $paydate). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
+ 'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("COMP", $paydate),
+ 'PREPAY' => qq!Prepaid card<BR><font color="#ff0000">*</font><INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="$payinfo" MAXLENGTH=80>!,
+ );
+
+ for (@payby) {
+ if ( scalar(@payby) == 1) {
+ $OUT .= '<TD VALIGN=TOP>'.
+ qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$_">!.
+ "$paybychecked{$_}</TD>";
+ } else {
+ $OUT .= qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
+ if ($payby eq $_) {
+ $OUT .= qq! CHECKED> $paybychecked{$_}</TD>!;
+ } else {
+ $OUT .= qq!> $payby{$_}</TD>!;
+ }
+
+ }
+ }
+ %>
+
+</TR></TABLE><font color="#ff0000">*</font> required fields for each billing type
+<BR><BR>First package
+<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
+<TR>
+ <TD COLSPAN=2><SELECT NAME="pkgpart"><OPTION VALUE="">(none)
+
+ <%=
+ foreach my $package ( @{$packages} ) {
+ $OUT .= '<OPTION VALUE="'. $package->{'pkgpart'}. '"';
+ $OUT .= ' SELECTED' if $pkgpart && $package->{'pkgpart'} == $pkgpart;
+ $OUT .= '>'. $package->{'pkg'};
+ }
+ %>
+
+ </SELECT></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Username</TD>
+ <TD><INPUT TYPE="text" NAME="username" VALUE="<%= $username %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Password</TD>
+ <TD><INPUT TYPE="password" NAME="_password" VALUE="<%= $password %>"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Re-enter Password</TD>
+ <TD><INPUT TYPE="password" NAME="_password2" VALUE="<%= $password2 %>"></TD>
+</TR>
+<%=
+ if ( $init_data->{'security_phrase'} ) {
+ $OUT .= <<ENDOUT;
+<TR>
+ <TD ALIGN="right">Security Phrase</TD>
+ <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase">
+ </TD>
+</TR>
+ENDOUT
+ } else {
+ $OUT .= '<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="">';
+ }
+%>
+<%=
+ if ( scalar(@$pops) ) {
+ $OUT .= '<TR><TD ALIGN="right">Access number</TD><TD>'.
+ popselector($popnum). '</TD></TR>';
+ } else {
+ $OUT .= popselector($popnum);
+ }
+%>
+</TABLE>
+<BR><BR><INPUT TYPE="submit" VALUE="Signup">
+</FORM></BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/stateselect.html b/fs_signup/FS-SignupClient/cgi/stateselect.html
new file mode 100644
index 000000000..39823be83
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/stateselect.html
@@ -0,0 +1,80 @@
+<HTML><HEAD><TITLE>ISP Signup</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup - state selection</FONT><BR><BR>
+<SCRIPT>
+function gotoURL(object) {
+ window.location.href = object.options[object.selectedIndex].value;
+}
+</SCRIPT>
+<FORM>
+Select your state:
+<SELECT NAME="init_popstate" onChange="gotoURL(this.form.init_popstate)">
+<OPTION VALUE="stateselect.html"></OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AL">ALABAMA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AK">ALASKA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AS">AMERICAN SAMOA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AZ">ARIZONA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AR">ARKANSAS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=CA">CALIFORNIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=CO">COLORADO</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=CT">CONNECTICUT</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=DE">DELAWARE</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=DC">DISTRICT OF COLUMBIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=FM">FEDERATED STATES OF MICRONESIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=FL">FLORIDA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=GA">GEORGIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=GU">GUAM</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=HI">HAWAII</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=ID">IDAHO</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=IL">ILLINOIS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=IN">INDIANA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=IA">IOWA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=KS">KANSAS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=KY">KENTUCKY</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=LA">LOUISIANA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=ME">MAINE</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MH">MARSHALL ISLANDS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MD">MARYLAND</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MA">MASSACHUSETTS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MI">MICHIGAN</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MN">MINNESOTA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MS">MISSISSIPPI</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MO">MISSOURI</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MT">MONTANA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NE">NEBRASKA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NV">NEVADA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NH">NEW HAMPSHIRE</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NJ">NEW JERSEY</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NM">NEW MEXICO</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NY">NEW YORK</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=NC">NORTH CAROLINA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=ND">NORTH DAKOTA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=MP">NORTHERN MARIANA ISLANDS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=OH">OHIO</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=OK">OKLAHOMA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=OR">OREGON</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=PW">PALAU</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=PA">PENNSYLVANIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=PR">PUERTO RICO</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=RI">RHODE ISLAND</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=SC">SOUTH CAROLINA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=SD">SOUTH DAKOTA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=TN">TENNESSEE</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=TX">TEXAS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=UT">UTAH</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=VT">VERMONT</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=VI">VIRGIN ISLANDS</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=VA">VIRGINIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=WA">WASHINGTON</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=WV">WEST VIRGINIA</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=WI">WISCONSIN</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=WY">WYOMING</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AE">Armed Forces Africa</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AA">Armed Forces Americas</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AE">Armed Forces Canada</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AE">Armed Forces Europe</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AE">Armed Forces Middle East</OPTION>
+<OPTION VALUE="signup.cgi?init_popstate=AP">Armed Forces Pacific</OPTION>
+</SELECT>
+</FORM>
+</BODY>
+</HTML>
diff --git a/fs_signup/FS-SignupClient/cgi/success.html b/fs_signup/FS-SignupClient/cgi/success.html
new file mode 100644
index 000000000..397cc6c30
--- /dev/null
+++ b/fs_signup/FS-SignupClient/cgi/success.html
@@ -0,0 +1,11 @@
+<HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
+<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
+Thanks for signing up!
+<BR><BR>
+Signup information for <%= $email_name %>:
+<BR><BR>
+Username: <%= $username %><BR>
+Password: <%= $password %><BR>
+Access number: (<%= $ac %>) / <%= $exch %> - <%= $local %><BR>
+Package: <%= $pkg %><BR>
+</BODY></HTML>
diff --git a/fs_signup/FS-SignupClient/fs_signupd b/fs_signup/FS-SignupClient/fs_signupd
new file mode 100755
index 000000000..85bd68a2f
--- /dev/null
+++ b/fs_signup/FS-SignupClient/fs_signupd
@@ -0,0 +1,86 @@
+#!/usr/bin/perl -Tw
+#
+# fs_signupd
+#
+# This is run REMOTELY over ssh by fs_signup_server.
+
+use strict;
+use Socket;
+use Storable qw(nstore_fd fd_retrieve);
+use IO::Handle;
+
+use vars qw( $Debug );
+
+$Debug = 1;
+
+my $fs_signupd_socket = "/usr/local/freeside/fs_signupd_socket";
+my $pid_file = "$fs_signupd_socket.pid";
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+$|=1;
+
+warn "[fs_signupd] Reading init data...\n" if $Debug;
+my $init_data = fd_retrieve(\*STDIN);
+
+warn "[fs_signupd] Creating $fs_signupd_socket\n" if $Debug;
+my $uaddr = sockaddr_un($fs_signupd_socket);
+my $proto = getprotobyname('tcp');
+socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
+unlink($fs_signupd_socket);
+bind(Server, $uaddr) or die "bind: $!";
+listen(Server,SOMAXCONN) or die "listen: $!";
+
+if ( -e $pid_file ) {
+ open(PIDFILE,"<$pid_file");
+ #chomp( my $old_pid = <PIDFILE> );
+ my $old_pid = <PIDFILE>;
+ close PIDFILE;
+ $old_pid =~ /^(\d+)$/;
+ kill 'TERM', $1;
+}
+open(PIDFILE,">$pid_file");
+print PIDFILE "$$\n";
+close PIDFILE;
+
+warn "[fs_signupd] Entering main loop...\n" if $Debug;
+my $paddr;
+for ( ; $paddr = accept(Client,Server); close Client) {
+
+ chop( my $command = <Client> );
+
+ if ( $command eq "signup_info" ) {
+
+ warn "[fs_signupd] sending signup info...\n" if $Debug;
+ nstore_fd($init_data, \*Client) or die "can't send init data: $!";
+ Client->flush;
+
+ } elsif ( $command eq "new_customer" ) {
+
+ #inefficient...
+
+ warn "[fs_signupd] reading customer signup...\n" if $Debug;
+ my $signup_data = fd_retrieve(\*Client);
+
+ warn "[fs_signupd] sending customer data to remote server...\n" if $Debug;
+ nstore_fd($signup_data, \*STDOUT) or die "can't send signup data: $!";
+ STDOUT->flush;
+
+ warn "[fs_signupd] reading error from remote server...\n" if $Debug;
+ my $error = <STDIN>;
+
+ warn "[fs_signupd] sending error to local client...\n" if $Debug;
+ print Client $error;
+ Client->flush;
+
+ } else {
+ die "unexpected command from client: $command";
+ }
+
+}
+
diff --git a/fs_signup/FS-SignupClient/test.pl b/fs_signup/FS-SignupClient/test.pl
new file mode 100644
index 000000000..b6136954d
--- /dev/null
+++ b/fs_signup/FS-SignupClient/test.pl
@@ -0,0 +1,20 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+#blah#use FS::SignupClient;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
diff --git a/fs_signup/cck.template b/fs_signup/cck.template
new file mode 100644
index 000000000..f1db554b1
--- /dev/null
+++ b/fs_signup/cck.template
@@ -0,0 +1,14 @@
+SITE_FILE 8chrfile
+SITE_NAME YourISP
+LOGIN { $username }
+PASSWORD { $password }
+PHONE_NUM +1({ $ac }){ $exch }-{ $loc }
+DNS_ADDR 10.0.0.1
+DNS_ADDR2 10.0.0.2
+NNTP_HOST news.yourisp.com
+SMTP_HOST mail.yourisp.com
+DOMAIN_NAME yourisp.com
+POP_SERVER { $username }@mail.yourisp.com
+POP_PASSWORD { $password }
+HOME_URL http://www.yourisp.com
+EMAIL_ADDR { $username }@yourisp.com
diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server
new file mode 100755
index 000000000..d6eb4a8d5
--- /dev/null
+++ b/fs_signup/fs_signup_server
@@ -0,0 +1,289 @@
+#!/usr/bin/perl -Tw
+#
+# fs_signup_server
+#
+
+use strict;
+use vars qw($pid);
+use IO::Handle;
+use Storable qw(nstore_fd fd_retrieve);
+use Tie::RefHash;
+use Net::SSH qw(sshopen2);
+use FS::UID qw(adminsuidsetup);
+use FS::Conf;
+use FS::Record qw( qsearch qsearchs );
+use FS::cust_main_county;
+use FS::cust_main;
+use FS::cust_bill;
+use FS::cust_pkg;
+use FS::Msgcat qw(gettext);
+
+use vars qw( $opt $Debug );
+
+$Debug = 2;
+
+my $user = shift or die &usage;
+&adminsuidsetup( $user );
+
+my $conf = new FS::Conf;
+
+if ($conf->exists('signup_server-quiet')) {
+ $FS::cust_bill::quiet = 1;
+ $FS::cust_pkg::quiet = 1;
+}
+
+#my @payby = qw(CARD PREPAY);
+my @payby = $conf->config('signup_server-payby');
+my $smtpmachine = $conf->config('smtpmachine');
+
+my $machine = shift or die &usage;
+
+my $agentnum = shift or die &usage;
+my $agent = qsearchs( 'agent', { 'agentnum' => $agentnum } ) or die &usage;
+my $pkgpart_href = $agent->pkgpart_hashref;
+
+my $refnum = shift or die &usage;
+
+#causing trouble for some folks
+#$SIG{CHLD} = sub { wait() };
+
+$SIG{HUP} = \&killssh;
+$SIG{INT} = \&killssh;
+$SIG{QUIT} = \&killssh;
+$SIG{TERM} = \&killssh;
+$SIG{PIPE} = \&killssh;
+sub killssh { kill 'TERM', $pid if $pid; exit; };
+
+my($fs_signupd)="/usr/local/sbin/fs_signupd";
+
+while (1) {
+ my($reader,$writer)=(new IO::Handle, new IO::Handle);
+ #seems to be broken - calling ->flush explicitly# $writer->autoflush(1);
+ warn "[fs_signup_server] Connecting to $machine...\n" if $Debug;
+ $pid = sshopen2($machine,$reader,$writer,$fs_signupd);
+
+ my @pops = qsearch('svc_acct_pop',{} );
+ my $init_data = {
+
+ #'_protocol' => 'signup',
+ #'_version' => '0.1',
+ #'_packet' => 'init'
+
+ 'cust_main_county' =>
+ [ map { $_->hashref } qsearch('cust_main_county', {}) ],
+
+ 'part_pkg' =>
+ [
+ #map { $_->hashref }
+ map { { 'payby' => [ $_->payby ], %{$_->hashref} } }
+ grep { $_->svcpart('svc_acct') && $pkgpart_href->{ $_->pkgpart } }
+ qsearch( 'part_pkg', { 'disabled' => '' } )
+ ],
+
+ 'agentnum2part_pkg' =>
+ {
+ map {
+ my $href = $_->pkgpart_hashref;
+ $_->agentnum =>
+ [
+ map { { 'payby' => [ $_->payby ], %{$_->hashref} } }
+ grep { $_->svcpart('svc_acct') && $href->{ $_->pkgpart } }
+ qsearch( 'part_pkg', { 'disabled' => '' } )
+ ];
+ } qsearch('agent', {} )
+ },
+
+ 'svc_acct_pop' => [ map { $_->hashref } @pops ],
+
+ 'security_phrase' => $conf->exists('security_phrase'),
+
+ 'payby' => [ $conf->config('signup_server-payby') ],
+
+ 'msgcat' => { map { $_=>gettext($_) } qw(
+ passwords_dont_match invalid_card unknown_card_type not_a
+ ) },
+
+ 'statedefault' => $conf->config('statedefault') || 'CA',
+
+ 'countrydefault' => $conf->config('countrydefault') || 'US',
+
+ };
+
+ warn "[fs_signup_server] Sending init data...\n" if $Debug;
+ nstore_fd($init_data, $writer) or die "can't send init data: $!";
+ $writer->flush;
+
+ warn "[fs_signup_server] Entering main loop...\n" if $Debug;
+ while (1) {
+ warn "[fs_signup_server] Reading (waiting for) signup data...\n" if $Debug;
+ my $signup_data = fd_retrieve($reader);
+
+ if ( $Debug > 1 ) {
+ warn join('',
+ map { " $_ => ". $signup_data->{$_}. "\n" } keys %$signup_data );
+ }
+
+ warn "[fs_signup_server] Processing signup...\n" if $Debug;
+
+ my $error = '';
+
+ #things that aren't necessary in base class, but are for signup server
+ #return "Passwords don't match"
+ # if $hashref->{'_password'} ne $hashref->{'_password2'}
+ $error ||= gettext('empty_password') unless $signup_data->{'_password'};
+ $error ||= gettext('no_access_number_selected')
+ unless $signup_data->{'popnum'} || !scalar(@pops);
+
+ #shares some stuff with htdocs/edit/process/cust_main.cgi... take any
+ # common that are still here and library them.
+ my $cust_main = new FS::cust_main ( {
+ #'custnum' => '',
+ 'agentnum' => $signup_data->{agentnum} || $agentnum,
+ 'refnum' => $refnum,
+
+ map { $_ => $signup_data->{$_} } qw(
+ last first ss company address1 address2 city county state zip country
+ daytime night fax payby payinfo paydate payname referral_custnum comments
+ ),
+
+ } );
+
+ $error ||= "Illegal payment type"
+ unless grep { $_ eq $signup_data->{'payby'} } @payby;
+
+ $cust_main->payinfo($cust_main->daytime)
+ if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo;
+
+ my @invoicing_list = split( /\s*\,\s*/, $signup_data->{'invoicing_list'} );
+
+ $signup_data->{'pkgpart'} =~ /^(\d+)$/ or '' =~ /^()$/;
+ my $pkgpart = $1;
+
+ my $part_pkg =
+ qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
+ or $error ||= "WARNING: unknown pkgpart: $pkgpart";
+ my $svcpart = $part_pkg->svcpart('svc_acct') unless $error;
+
+ my $cust_pkg = new FS::cust_pkg ( {
+ #later#'custnum' => $custnum,
+ 'pkgpart' => $signup_data->{'pkgpart'},
+ } );
+ $error ||= $cust_pkg->check;
+
+ my $svc_acct = new FS::svc_acct ( {
+ 'svcpart' => $svcpart,
+ map { $_ => $signup_data->{$_} }
+ qw( username _password sec_phrase popnum ),
+ } );
+
+ my $y = $svc_acct->setdefault; # arguably should be in new method
+ $error ||= $y unless ref($y);
+
+ $error ||= $svc_acct->check;
+
+ use Tie::RefHash;
+ tie my %hash, 'Tie::RefHash';
+ %hash = ( $cust_pkg => [ $svc_acct ] );
+ $error ||= $cust_main->insert( \%hash, \@invoicing_list ); #msgcat
+
+ if ( ! $error && $conf->exists('signup_server-realtime') ) {
+
+ warn "[fs_signup_server] Billing customer...\n" if $Debug;
+
+ my $bill_error = $cust_main->bill;
+ warn "[fs_signup_server] error billing new customer: $bill_error"
+ if $bill_error;
+
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+
+ $bill_error = $cust_main->collect;
+ warn "[fs_signup_server] error collecting from new customer: $bill_error"
+ if $bill_error;
+
+ if ( $cust_main->balance > 0 ) {
+
+ #this makes sense. credit is "un-doing" the invoice
+ $cust_main->credit( $cust_main->balance, 'signup server decline' );
+ $cust_main->apply_credits;
+
+ #should check list for errors...
+ #$cust_main->suspend;
+ $cust_main->cancel;
+
+ $error = '_decline';
+ }
+ }
+
+ warn "[fs_signup_server] Sending results...\n" if $Debug;
+ print $writer $error, "\n";
+
+ next if $error;
+
+ if ( $conf->config('signup_server-email') ) {
+ warn "[fs_signup_server] Sending email...\n" if $Debug;
+
+ #false laziness w/FS::cust_bill::send & FS::cust_pay::delete
+ use Mail::Header;
+ use Mail::Internet 1.44;
+ use Date::Format;
+ my $from = $conf->config('invoice_from'); #??? as good as any
+ $ENV{MAILADDRESS} = $from;
+ my $header = new Mail::Header ( [
+ "From: $from",
+ "To: ". $conf->config('signup_server-email'),
+ "Sender: $from",
+ "Reply-To: $from",
+ "Date: ". time2str("%a, %d %b %Y %X %z", time),
+ "Subject: FREESIDE NOTIFICATION: Signup Server",
+ ] );
+ my $body = [
+ "This is an automatic message from your Freeside installation\n",
+ "informing you a customer has signed up via the signup server:\n",
+ "\n",
+ 'custnum : '. $cust_main->custnum. "\n",
+ 'Name : '. $cust_main->last. ", ". $cust_main->first. "\n",
+ 'Agent : '. $cust_main->agent->agent. "\n",
+ 'Package : '. $part_pkg->pkg. ' - '. $part_pkg->comment. "\n",
+ 'Signup Date : '. time2str('%C', time). "\n",
+ 'Username : '. $svc_acct->username. "\n",
+ #'Password : '. # config file to turn this on if noment insists
+ 'Day phone : '. $cust_main->daytime. "\n",
+ 'Night phone : '. $cust_main->night. "\n",
+ 'Address : '. $cust_main->address1. "\n",
+ ( $cust_main->address2
+ ? ' '. $cust_main->address2. "\n"
+ : '' ),
+ ' '. $cust_main->city. ', '. $cust_main->state. ' '.
+ $cust_main->zip. "\n",
+ ( $cust_main->country eq 'US'
+ ? ''
+ : ' '. $cust_main->country. "\n" ),
+ "\n",
+ ];
+ #if ( $cust_main->balance > 0 ) {
+ # push @$body,
+ # "This customer has an outstanding balance and has been suspended.\n";
+ #}
+ my $message = new Mail::Internet ( 'Header' => $header, 'Body' => $body );
+ $!=0;
+ $message->smtpsend( Host => $smtpmachine )
+ or $message->smtpsend( Host => $smtpmachine, Debug => 1 )
+ or warn "[fs_signup_server] can't send email to ".
+ $conf->config('signup_server-email').
+ " via server $smtpmachine with SMTP: $!";
+ #end-of-send mail
+ }
+
+ }
+ close $writer;
+ close $reader;
+ warn "connection to $machine lost! waiting 60 seconds...\n";
+ sleep 60;
+ warn "reconnecting...\n";
+}
+
+sub usage {
+ die "Usage:\n\n fs_signup_server user machine agentnum refnum\n";
+}
+
diff --git a/fs_signup/ieak.template b/fs_signup/ieak.template
new file mode 100755
index 000000000..52edaa951
--- /dev/null
+++ b/fs_signup/ieak.template
@@ -0,0 +1,40 @@
+[Entry]
+Entry_Name = The Internet
+[Phone]
+Dial_As_Is=no
+Phone_Number = { $exch. $loc }
+Area_Code = { $ac }
+Country_Code = 1
+Country_Id = 1
+[Server]
+Type = PPP
+SW_Compress = Yes
+PW_Encrypt = Yes
+Negotiate_TCP/IP = Yes
+Disable_LCP = No
+[TCP/IP]
+Specify_IP_Address = No
+Specity_Server_Address = No
+IP_Header_Compress = Yes
+Gateway_On_Remote = Yes
+[User]
+Name = { $username }
+Password = { $password }
+Display_Password = Yes
+[Internet_Mail]
+Email_Name = { $email_name }
+Email_Address = { $username }\@domain.tld
+POP_Server = mail.domain.tld
+POP_Server_Port_Number = 110
+POP_Login_Name = { $username }
+POP_Login_Password = { $password }
+SMTP_Server = mail.domain.tld
+SMTP_Server_Port_Number = 25
+Install_Mail = 1
+[Internet_News]
+NNTP_Server = news.domain.tld
+NNTP_Server_Port_Number = 119
+Logon_Required = No
+Install_News = 1
+[Branding]
+Window_Title = The Internet
diff --git a/fs_webdemo/register.cgi b/fs_webdemo/register.cgi
new file mode 100755
index 000000000..825582262
--- /dev/null
+++ b/fs_webdemo/register.cgi
@@ -0,0 +1,136 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: register.cgi,v 1.5 2000-03-03 18:22:42 ivan Exp $
+
+use strict;
+use vars qw(
+ $datasrc $user $pass $x
+ $cgi $username $email
+ $dbh $sth
+ );
+ #$freeside_bin $freeside_test $freeside_conf
+ #@pw_set @saltset
+ #$user_pw $crypt_pw
+ #$header $msg
+use CGI;
+use CGI::Carp qw(fatalsToBrowser);
+use DBI;
+#use Mail::Internet;
+#use Mail::Header;
+#use Date::Format;
+
+$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+$ENV{'SHELL'} = '/bin/sh';
+$ENV{'IFS'} = " \t\n";
+$ENV{'CDPATH'} = '';
+$ENV{'ENV'} = '';
+$ENV{'BASH_ENV'} = '';
+
+#$freeside_bin = '/home/freeside/bin/';
+#$freeside_test = '/home/freeside/test/';
+#$freeside_conf = '/usr/local/etc/freeside/';
+
+$datasrc = 'DBI:mysql:http_auth';
+$user = "freeside";
+$pass = "maelcolm";
+
+##my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '!', '.', ',' );
+##my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9' );
+#@pw_set = ( 'a'..'z', '0'..'9' );
+#@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+###
+
+$cgi = new CGI;
+
+$username = $cgi->param('username');
+$username =~ /^\s*([a-z][\w]{0,15})\s*$/i
+ or &idiot("Illegal username. Please use 1-16 alphanumeric characters, and start your username with a letter.");
+$username = lc($1);
+
+$email = $cgi->param('email');
+$email =~ /^([\w\-\.\+]+\@[\w\-\.]+)$/
+ or &idiot("Illegal email address.");
+$email = $1;
+
+###
+
+#$user_pw = join('',map($pw_set[ int(rand $#pw_set) ], (0..7) ) );
+#$crypt_pw = crypt($user_pw,$saltset[int(rand(64))].$saltset[int(rand(64))]);
+
+###
+
+ local $SIG{HUP} = 'IGNORE';
+ local $SIG{INT} = 'IGNORE';
+ local $SIG{QUIT} = 'IGNORE';
+ local $SIG{TERM} = 'IGNORE';
+ local $SIG{TSTP} = 'IGNORE';
+ local $SIG{PIPE} = 'IGNORE';
+
+###
+
+$dbh = DBI->connect( $datasrc, $user, $pass, {
+ 'AutoCommit' => 'true',
+} ) or die "DBI->connect error: $DBI::errstr\n";
+$x = $DBI::errstr; #silly; to avoid "used only once" warning
+
+$sth = $dbh->prepare("INSERT INTO mysql_auth VALUES (". join(", ",
+ $dbh->quote($username),
+# $dbh->quote("X"),
+# $dbh->quote($crypt_pw),
+ $dbh->quote($email),
+ $dbh->quote('freeside'),
+ $dbh->quote('unconfigured'),
+). ")" );
+
+$sth->execute or &idiot("Username in use: ". $sth->errstr);
+
+$dbh->disconnect or die $dbh->errstr;
+
+###
+
+$|=1;
+print $cgi->header;
+print <<END;
+<HTML>
+ <HEAD>
+ <TITLE>Freeside demo registration successful</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#FFFFFF">
+ <table>
+ <tr><td>
+ <p align=center>
+ <img border=0 alt="Silicon Interactive Software Design" src="http://www.sisd.com/freeside/small-logo.gif">
+ </td><td>
+ <center><font color="#ff0000" size=7>freeside demo registration successful</font></center>
+ </td></tr>
+ </table>
+ <P>Your sample database has been setup. Your password and the URL for the
+ Freeside demo have been emailed to you.
+ </BODY>
+</HTML>
+END
+
+###
+
+sub idiot {
+ my($error)=@_;
+ print $cgi->header, <<END;
+<HTML>
+ <HEAD>
+ <TITLE>Registration error</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#FFFFFF">
+ <CENTER>
+ <H4>Registration error</H4>
+ </CENTER>
+ <P><B>$error</B>
+ <P>Hit the <I>Back</I> button in your web browser, correct this mistake,
+ and submit the form again.
+ </BODY>
+</HTML>
+END
+
+ exit;
+
+}
diff --git a/fs_webdemo/register.html b/fs_webdemo/register.html
new file mode 100644
index 000000000..acf9cff7f
--- /dev/null
+++ b/fs_webdemo/register.html
@@ -0,0 +1,33 @@
+<HTML>
+ <HEAD>
+ <TITLE>
+ Freeside - Billing and account administration software for ISPs
+ </TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#ffffff">
+ <table>
+ <tr><td>
+ <A HREF="http://www.sisd.com/">
+ <IMG BORDER=0 SRC="small-logo.gif" ALIGN=LEFT>
+ </A>
+ </td><td>
+ <center><font color="#ff0000" size=7 size=+4>freeside demo registration</font></center>
+ </td></tr>
+ </table>
+<P>You will need to choose a username for access to the Freeside web demo.
+
+<P><FONT SIZE=+1 COLOR="#ff0000">A password
+ and the URL for your demo will be emailed to you, so don't waste your
+ time with non-deliverable addresses.</FONT>
+We will <B>not</B> give your email address to any third party,
+ nor will we send you any unsolicited email (or in fact any email after the automatic registration).
+ <FORM ACTION="register.cgi" METHOD="POST">
+ <PRE>
+Freeside username: <INPUT TYPE="text" NAME="username" MAXLENGTH=16>
+
+Email address: <INPUT TYPE="text" NAME="email">
+</PRE>
+<BR><INPUT TYPE="Submit" VALUE="Register">
+ </FORM>
+ </BODY>
+</HTML>
diff --git a/fs_webdemo/registerd b/fs_webdemo/registerd
new file mode 100755
index 000000000..6314d0af2
--- /dev/null
+++ b/fs_webdemo/registerd
@@ -0,0 +1,192 @@
+#!/usr/bin/perl -w
+#
+# $Id: registerd,v 1.8 2000-03-03 12:27:54 ivan Exp $
+
+use strict;
+use vars qw(
+ $freeside_conf
+ $mysql_data
+ $datasrc $user $pass $x
+ $dbh $sth
+ @pw_set @saltset
+ $header $msg
+ );
+ # $freeside_bin $freeside_test
+ # $cgi $username $name $email $user_pw $crypt_pw
+#use CGI;
+#use CGI::Carp qw(fatalsToBrowser);
+use DBI;
+use Mail::Internet;
+use Mail::Header;
+use Date::Format;
+
+#$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+#$ENV{'SHELL'} = '/bin/sh';
+#$ENV{'IFS'} = " \t\n";
+#$ENV{'CDPATH'} = '';
+#$ENV{'ENV'} = '';
+#$ENV{'BASH_ENV'} = '';
+
+#$freeside_bin = '/home/freeside/bin/';
+#$freeside_test = '/home/freeside/test/';
+$freeside_conf = '/usr/local/etc/freeside/';
+
+$mysql_data = "/var/lib/mysql";
+
+$datasrc = 'DBI:mysql:http_auth';
+$user = "freeside";
+$pass = "maelcolm";
+
+#my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '!', '.', ',' );
+#my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9' );
+@pw_set = ( 'a'..'z', '0'..'9' );
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+#die "not running as system user freeside"
+# unless $> == scalar(getpwnam('freeside'));
+die "not running as root user"
+ unless $> == 0;
+
+$dbh = DBI->connect( $datasrc, $user, $pass, {
+ 'AutoCommit' => 'true',
+} ) or die "DBI->connect error: $DBI::errstr\n";
+$x = $DBI::errstr; #silly; to avoid "used only once" warning
+
+while ( 1 ) {
+
+ $SIG{HUP} = 'IGNORE';
+ $SIG{INT} = 'IGNORE';
+ $SIG{QUIT} = 'IGNORE';
+ $SIG{TERM} = 'IGNORE';
+ $SIG{TSTP} = 'IGNORE';
+ $SIG{PIPE} = 'IGNORE';
+
+ $sth = $dbh->prepare("LOCK TABLES mysql_auth WRITE");
+ $sth->execute or die $sth->errstr;
+
+ $sth = $dbh->prepare(
+ 'SELECT * FROM mysql_auth WHERE status = "unconfigured"'
+ );
+ $sth->execute or die $sth->errstr;
+ my $pending = $sth->fetchall_arrayref( {} );
+
+ $sth = $dbh->prepare(
+ 'UPDATE mysql_auth SET status = "locked" WHERE status = "unconfigured"'
+ );
+ $sth->execute or die $sth->errstr;
+
+ $sth = $dbh->prepare("UNLOCK TABLES");
+ $sth->execute or die $sth->errstr;
+
+ #
+
+ foreach my $row ( @{$pending} ) {
+
+ my $username = $row->{'username'};
+ my $email = $row->{'passwd'};
+
+ system("/usr/bin/mysqladmin --user=$user --password=$pass ".
+ "create demo_$username >/dev/null");
+
+ system "cp -p $mysql_data/demo_template/* $mysql_data/demo_$username";
+
+ mkdir "${freeside_conf}conf.DBI:mysql:demo_$username", 0755;
+ system "cp -pr ${freeside_conf}conf.DBI:mysql:demo_template/* ".
+ "${freeside_conf}conf.DBI:mysql:demo_$username";
+
+ mkdir "${freeside_conf}counters.DBI:mysql:demo_$username", 0755;
+ system "cp -p ${freeside_conf}counters.DBI:mysql:demo_template/* ".
+ "${freeside_conf}counters.DBI:mysql:demo_$username";
+ chown scalar(getpwnam('freeside')), scalar(getgrnam('freeside')),
+ "${freeside_conf}counters.DBI:mysql:demo_$username";
+
+ system "cp -p ${freeside_conf}dbdef.DBI:mysql:demo_template ".
+ "${freeside_conf}dbdef.DBI:mysql:demo_$username";
+
+ open(INVOICE_FROM, ">${freeside_conf}conf.DBI:mysql:demo_$username/invoice_from")
+ or die "Can\'t open ${freeside_conf}conf.DBI:mysql:demo_$username/invoice_from: $!";
+ print INVOICE_FROM "$email\n";
+ close INVOICE_FROM;
+
+ open(LPR, ">${freeside_conf}conf.DBI:mysql:demo_$username/lpr")
+ or die "Can\'t open ${freeside_conf}conf.DBI:mysql:demo_$username/lpr: $!";
+ print LPR "mail $email";
+ close LPR;
+
+ open(FROM, ">${freeside_conf}conf.DBI:mysql:demo_$username/registries/internic/from")
+ or die "Can\'t open ${freeside_conf}conf.DBI:mysql:demo_$username/registries/internic/from: $!";
+ print FROM "$email\n";
+ close FROM;
+
+ open(TO, ">${freeside_conf}conf.DBI:mysql:demo_$username/registries/internic/to")
+ or die "Can\'t open ${freeside_conf}conf.DBI:mysql:demo_$username/registries/internic/to: $!";
+ print TO "$email\n";
+ close TO;
+
+ open(SECRETS, ">${freeside_conf}secrets.demo_$username")
+ or die "Can\'t open ${freeside_conf}secrets.demo_$username: $!";
+ chown scalar(getpwnam('freeside')), scalar(getgrnam('freeside')),
+ "${freeside_conf}secrets.demo_$username";
+ chmod 0600, "${freeside_conf}secrets.demo_$username";
+ print SECRETS "DBI:mysql:demo_$username\nfreeside\nmaelcolm\n";
+ close SECRETS;
+
+ open(MAPSECRETS, ">>${freeside_conf}mapsecrets")
+ or die "Can\'t open ${freeside_conf}mapsecrets: $!";
+ print MAPSECRETS "$username secrets.demo_$username\n";
+ close MAPSECRETS;
+
+ my $user_pw = join('',map($pw_set[ int(rand $#pw_set) ], (0..7) ) );
+ my $crypt_pw =
+ crypt($user_pw,$saltset[int(rand(64))].$saltset[int(rand(64))]);
+
+ $sth = $dbh->prepare(
+ qq(UPDATE mysql_auth SET passwd = "$crypt_pw", status = "done" WHERE username = "$username")
+ );
+ $sth->execute or die $sth->errstr;
+
+ $ENV{SMTPHOSTS} = "localhost";
+ $ENV{MAILADDRESS} = 'ivan-fsreg@sisd.com';
+ $ENV{TZ} = "PST8PDT";
+ $header = Mail::Header->new( [
+ 'From: ivan-fsreg@sisd.com',
+ "To: $email",
+ 'Bcc: ivan-fsreg_bcc@sisd.com',
+ 'Sender: ivan-fsreg@sisd.com',
+ 'Reply-To: ivan-fsreg@sisd.com',
+ #'Date: '. time2str("%a, %d %b %Y %X %z", time ),
+ 'Date: '. time2str("%a, %d %b %Y %X ", time ). "-0800",
+ 'Subject: Freeside demo information',
+ ] );
+ $msg = Mail::Internet->new(
+ 'Header' => $header,
+ 'Body' => [
+ "Hello,\n",
+ "\n",
+ "Your sample Freeside database has been setup.\n",
+ "\n",
+ "Point your web browswer at http://freeside.sisd.com/ and use the following\n",
+ "authentication information:\n",
+ "\n",
+ "Username: $username\n",
+ "Password: $user_pw\n",
+ "\n",
+ "-- \n",
+ "ivan\n",
+ ]
+ );
+ $msg->smtpsend or die "Can\'t send registration email!";
+
+ }
+
+ $SIG{HUP} = 'DEFAULT';
+ $SIG{INT} = 'DEFAULT';
+ $SIG{QUIT} = 'DEFAULT';
+ $SIG{TERM} = 'DEFAULT';
+ $SIG{TSTP} = 'DEFAULT';
+ $SIG{PIPE} = 'DEFAULT';
+
+ sleep 5;
+
+}
+
diff --git a/fs_webdemo/registerd.Pg b/fs_webdemo/registerd.Pg
new file mode 100755
index 000000000..f166846b7
--- /dev/null
+++ b/fs_webdemo/registerd.Pg
@@ -0,0 +1,221 @@
+#!/usr/bin/perl -w
+#
+# $Id: registerd.Pg,v 1.11 2001-10-24 15:29:30 ivan Exp $
+
+use strict;
+use vars qw(
+ $freeside_conf
+ $mysql_data
+ $datasrc $user $pass $x
+ $dbh $sth
+ @pw_set @saltset
+ $header $msg
+ );
+ # $freeside_bin $freeside_test
+ # $cgi $username $name $email $user_pw $crypt_pw
+#use CGI;
+#use CGI::Carp qw(fatalsToBrowser);
+use DBI;
+use Mail::Internet;
+use Mail::Header;
+use Date::Format;
+
+#$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
+#$ENV{'SHELL'} = '/bin/sh';
+#$ENV{'IFS'} = " \t\n";
+#$ENV{'CDPATH'} = '';
+#$ENV{'ENV'} = '';
+#$ENV{'BASH_ENV'} = '';
+
+#$freeside_bin = '/home/freeside/bin/';
+#$freeside_test = '/home/freeside/test/';
+$freeside_conf = '/usr/local/etc/freeside/';
+
+#$mysql_data = "/var/lib/mysql";
+
+$datasrc = 'DBI:mysql:http_auth';
+$user = "freeside";
+$pass = "maelcolm";
+
+#my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '!', '.', ',' );
+#my(@pw_set)= ( 'a'..'z', 'A'..'Z', '0'..'9' );
+@pw_set = ( 'a'..'z', '0'..'9' );
+@saltset = ( 'a'..'z' , 'A'..'Z' , '0'..'9' , '.' , '/' );
+
+#die "not running as system user freeside"
+# unless $> == scalar(getpwnam('freeside'));
+die "not running as root user"
+ unless $> == 0;
+
+$dbh = DBI->connect( $datasrc, $user, $pass, {
+ 'AutoCommit' => 'true',
+} ) or die "DBI->connect error: $DBI::errstr\n";
+#$x = $DBI::errstr; #silly; to avoid "used only once" warning
+
+while ( 1 ) {
+
+ $SIG{HUP} = 'IGNORE';
+ $SIG{INT} = 'IGNORE';
+ $SIG{QUIT} = 'IGNORE';
+ $SIG{TERM} = 'IGNORE';
+ $SIG{TSTP} = 'IGNORE';
+ $SIG{PIPE} = 'IGNORE';
+
+ $sth = $dbh->prepare("LOCK TABLES mysql_auth WRITE");
+ $sth->execute or die $sth->errstr;
+
+ $sth = $dbh->prepare(
+ 'SELECT * FROM mysql_auth WHERE status = "unconfigured"'
+ );
+ $sth->execute or die $sth->errstr;
+ my $pending = $sth->fetchall_arrayref( {} );
+
+ $sth = $dbh->prepare(
+ 'UPDATE mysql_auth SET status = "locked" WHERE status = "unconfigured"'
+ );
+ $sth->execute or die $sth->errstr;
+
+ $sth = $dbh->prepare("UNLOCK TABLES");
+ $sth->execute or die $sth->errstr;
+
+ #
+
+ foreach my $row ( @{$pending} ) {
+
+ my $username = $row->{'username'};
+ my $email = $row->{'passwd'};
+
+ my $pdbh = DBI->connect( 'DBI:Pg:host=localhost;dbname=demo_template', 'freeside', 'maelcolm' )
+ or do { &myerr("$username: ". $DBI::errstr); next; };
+
+ my $psth = $pdbh->prepare("CREATE DATABASE demo_$username")
+ or do { &myerr("$username: ". $pdbh->errstr); next; };
+ $psth->execute()
+ or do { &myerr("$username: ". $psth->errstr); next; };
+
+ $pdbh->disconnect
+ or do { &myerr("fatal: $DBI::errstr"); die; };
+
+ open(PSQL,"|psql -U freeside demo_$username")
+ or do { &myerr("|psql -U freeside demo_$username: $!"); next; };
+ open(PSQLDATA, "</usr/local/etc/freeside/demo_template.Pg")
+ or do { &myerr("/usr/local/etc/freeside/demo_template.Pg: $!"); next; };
+ while(<PSQLDATA>) {
+ print PSQL $_;
+ }
+ close PSQLDATA
+ or do { &myerr("/usr/local/etc/freeside/demo_template.Pg: $!"); next; };
+ close PSQL
+ or do { &myerr("|psql -U freeside demo_$username: $!"); next; };
+
+ mkdir "${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username", 0755;
+ system "cp -pr ${freeside_conf}conf.DBI:Pg:host=localhost\\;dbname=demo_template/* ".
+ "${freeside_conf}conf.DBI:Pg:host=localhost\\;dbname=demo_$username";
+
+ mkdir "${freeside_conf}counters.DBI:Pg:host=localhost;dbname=demo_$username", 0755;
+ system "cp -p ${freeside_conf}counters.DBI:Pg:host=localhost\\;dbname=demo_template/* ".
+ "${freeside_conf}counters.DBI:Pg:host=localhost\\;dbname=demo_$username";
+ chown scalar(getpwnam('freeside')), scalar(getgrnam('freeside')),
+ "${freeside_conf}counters.DBI:Pg:host=localhost;dbname=demo_$username";
+
+ system "cp -p ${freeside_conf}dbdef.DBI:Pg:host=localhost\\;dbname=demo_template ".
+ "${freeside_conf}dbdef.DBI:Pg:host=localhost\\;dbname=demo_$username";
+
+ open(INVOICE_FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/invoice_from")
+ or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/invoice_from: $!";
+ print INVOICE_FROM "$email\n";
+ close INVOICE_FROM;
+
+ open(LPR, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/lpr")
+ or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/lpr: $!";
+ print LPR "mail $email";
+ close LPR;
+
+# open(FROM, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from")
+# or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/from: $!";
+# print FROM "$email\n";
+# close FROM;
+#
+# open(TO, ">${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to")
+# or die "Can\'t open ${freeside_conf}conf.DBI:Pg:host=localhost;dbname=demo_$username/registries/internic/to: $!";
+# print TO "$email\n";
+# close TO;
+
+ open(SECRETS, ">${freeside_conf}secrets.demo_$username")
+ or die "Can\'t open ${freeside_conf}secrets.demo_$username: $!";
+ chown scalar(getpwnam('freeside')), scalar(getgrnam('freeside')),
+ "${freeside_conf}secrets.demo_$username";
+ chmod 0600, "${freeside_conf}secrets.demo_$username";
+ print SECRETS "DBI:Pg:host=localhost;dbname=demo_$username\nfreeside\nmaelcolm\n";
+ close SECRETS;
+
+ open(MAPSECRETS, ">>${freeside_conf}mapsecrets")
+ or die "Can\'t open ${freeside_conf}mapsecrets: $!";
+ print MAPSECRETS "$username secrets.demo_$username\n";
+ close MAPSECRETS;
+
+ my $user_pw = join('',map($pw_set[ int(rand $#pw_set) ], (0..7) ) );
+ my $crypt_pw =
+ crypt($user_pw,$saltset[int(rand(64))].$saltset[int(rand(64))]);
+
+ $sth = $dbh->prepare(
+ qq(UPDATE mysql_auth SET passwd = "$crypt_pw", status = "done" WHERE username = "$username")
+ );
+ $sth->execute or die $sth->errstr;
+
+ #$ENV{SMTPHOSTS} = "localhost";
+ $ENV{SMTPHOSTS} = "192.168.1.1";
+ $ENV{MAILADDRESS} = 'ivan-fsreg@sisd.com';
+ $ENV{TZ} = "PST8PDT";
+ $header = Mail::Header->new( [
+ 'From: ivan-fsreg@sisd.com',
+ "To: $email",
+ 'Bcc: ivan-fsreg_bcc@sisd.com',
+ 'Sender: ivan-fsreg@sisd.com',
+ 'Reply-To: ivan-fsreg@sisd.com',
+ #'Date: '. time2str("%a, %d %b %Y %X %z", time ),
+ 'Date: '. time2str("%a, %d %b %Y %X ", time ). "-0800",
+ 'Subject: Freeside demo information',
+ ] );
+ $msg = Mail::Internet->new(
+ 'Header' => $header,
+ 'Body' => [
+ "Hello,\n",
+ "\n",
+ "Your sample Freeside database has been setup.\n",
+ "\n",
+ "Your login and database will be automatically deleted in 1-2 months.\n",
+ "\n",
+ "Point your web browswer at http://freeside.sisd.com/ and use the following\n",
+ "authentication information:\n",
+ "\n",
+ "Username: $username\n",
+ "Password: $user_pw\n",
+ "\n",
+ "-- \n",
+ "ivan\n",
+ ]
+ );
+ $msg->smtpsend or die "Can\'t send registration email!";
+
+ }
+
+ $SIG{HUP} = 'DEFAULT';
+ $SIG{INT} = 'DEFAULT';
+ $SIG{QUIT} = 'DEFAULT';
+ $SIG{TERM} = 'DEFAULT';
+ $SIG{TSTP} = 'DEFAULT';
+ $SIG{PIPE} = 'DEFAULT';
+
+ sleep 5;
+
+}
+
+sub myerr {
+ my $msg = shift;
+ open(MAIL,"|mail ivan-fsdemoerr\@420.am");
+ print MAIL $msg, "\n\n";
+ print MAIL $msg, "\n\n";
+ close MAIL;
+};
+
diff --git a/htetc/global.asa b/htetc/global.asa
new file mode 100644
index 000000000..d87f1eac6
--- /dev/null
+++ b/htetc/global.asa
@@ -0,0 +1,193 @@
+BEGIN { eval "use Devel::AutoProfiler;"; } #only if installed...
+#BEGIN { package Devel::AutoProfiler; use vars qw(%caller_info); }
+#use Devel::AutoProfiler;
+
+use strict;
+use vars qw( $cgi $p );
+use CGI;
+#use CGI::Carp qw(fatalsToBrowser);
+use Date::Format;
+use Date::Parse;
+use Time::Local;
+use Tie::IxHash;
+use HTML::Entities;
+use IO::Handle;
+use IO::File;
+use String::Approx qw(amatch);
+use Chart::LinesPoints;
+use HTML::Widgets::SelectLayers 0.02;
+use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
+use FS::Record qw(qsearch qsearchs fields dbdef);
+use FS::Conf;
+use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot
+ small_custview myexit http_header);
+use FS::Msgcat qw(gettext geterror);
+
+use FS::agent;
+use FS::agent_type;
+use FS::domain_record;
+use FS::cust_bill;
+use FS::cust_bill_pay;
+use FS::cust_credit;
+use FS::cust_credit_bill;
+use FS::cust_main;
+use FS::cust_main_county;
+use FS::cust_pay;
+use FS::cust_pkg;
+use FS::cust_refund;
+use FS::cust_svc;
+use FS::nas;
+use FS::part_bill_event;
+use FS::part_pkg;
+use FS::part_referral;
+use FS::part_svc;
+use FS::part_svc_router;
+use FS::pkg_svc;
+use FS::port;
+use FS::queue qw(joblisting);
+use FS::raddb;
+use FS::session;
+use FS::svc_acct;
+use FS::svc_acct_pop qw(popselector);
+use FS::svc_domain;
+use FS::svc_forward;
+use FS::svc_www;
+use FS::router;
+use FS::part_router_field;
+use FS::router_field;
+use FS::addr_block;
+use FS::part_sb_field;
+use FS::sb_field;
+use FS::svc_broadband;
+use FS::type_pkgs;
+use FS::part_export;
+use FS::part_export_option;
+use FS::export_svc;
+use FS::msgcat;
+
+sub Script_OnStart {
+ $Response->AddHeader('Pragma' => 'no-cache');
+ $Response->AddHeader('Cache-control' => 'no-cache');
+# $Response->AddHeader('Expires' => 0);
+ $Response->{Expires} = -36288000;
+
+ $cgi = new CGI;
+ &cgisuidsetup($cgi);
+ $p = popurl(2);
+ #print $cgi->header( '-expires' => 'now' );
+ dbh->{'private_profile'} = {} if dbh->can('sprintProfile');
+
+ #really should check for FS::Profiler or something
+ # Devel::AutoProfiler _our_ VERSION? thanks a fucking lot
+ if ( Devel::AutoProfiler->can('__recursively_fetch_subs_in_package') ) {
+ #should check to see it's my special version. well, switch to FS::Profiler
+
+ #nicked from Devel::AutoProfiler::INIT
+ my %subs = Devel::AutoProfiler::__recursively_fetch_subs_in_package('main');
+
+
+ SUB : while( my ($name, $ref) = each(%subs) )
+ {
+ #next if $name =~ /^(main::)?Apache::/;
+ next unless $name =~ /FS/;
+ foreach my $sub (@Devel::AutoProfiler::do_not_instrument_this_sub)
+ {
+ if ($name =~ /$sub/)
+ {
+ next SUB;
+ }
+ }
+ next if ($Devel::AutoProfiler::do_not_instrument_this_sub{$name});
+ #warn "INIT name is $name \n";
+ Devel::AutoProfiler::__instrument_sub($name, $ref);
+ }
+
+ }
+
+}
+
+sub Script_OnFlush {
+ my $ref = $Response->{BinaryRef};
+ #$$ref = $cgi->header( @FS::CGI::header ) . $$ref;
+ #$$ref = $cgi->header() . $$ref;
+ #warn "Script_OnFlush called with dbh ". dbh. "\n";
+ #if ( dbh->can('sprintProfile') ) {
+ if ( UNIVERSAL::can(dbh,'sprintProfile') ) {
+ #warn "dbh can sprintProfile\n";
+ if ( lc($Response->{ContentType}) eq 'text/html' ) { #con
+ #warn "contenttype is sprintProfile\n";
+ $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i
+ or warn "can't remove";
+
+ #$$ref .= '<PRE>'. ("\n"x96). encode_entities(dbh->sprintProfile()). '</PRE>';
+ # wtf? konqueror...
+ $$ref .= '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
+ "\n\n". &sprintAutoProfile(). '</PRE>';
+
+ $$ref .= '</BODY></HTML>';
+ }
+ dbh->{'private_profile'} = {};
+ }
+}
+
+#if ( defined(@DBIx::Profile::ISA) && DBIx::Profile::db->can('sprintProfile') ) {
+#if ( defined(@DBIx::Profile::ISA) && UNIVERSAL::can('DBIx::Profile::db', 'sprintProfile') ) {
+if ( defined(@DBIx::Profile::ISA) ) {
+
+ #warn "enabling profiling redirects";
+ *CGI::redirect = sub {
+ my( $self, $location) = @_;
+ my $page =
+ $cgi->header.
+ qq!<HTML><BODY>Redirect to <A HREF="$location">$location</A><BR><BR>!.
+ '<PRE>'. encode_entities(dbh->sprintProfile()).
+ "\n\n". &sprintAutoProfile(). '</PRE>'.
+ '</BODY></HTML>';
+ dbh->{'private_profile'} = {};
+ return $page;
+ };
+
+}
+
+sub by_total_time
+{
+ return $a->{total_time_in_sub} <=> $b->{total_time_in_sub};
+}
+
+sub sprintAutoProfile {
+ my %caller_info = %Devel::AutoProfiler::caller_info;
+ return unless keys %caller_info;
+
+ %Devel::AutoProfiler::caller_info = ();
+
+ my @keys = keys(%caller_info);
+
+ foreach my $key (@keys)
+ {
+ my $href = $caller_info{$key};
+
+ $href->{who_am_i} = $key;
+ }
+
+ my @subs = values(%caller_info);
+
+ #my @sorted = sort by_total_time ( @subs );
+ my @sorted = reverse sort by_total_time ( @subs );
+
+ # print Dumper \@sorted;
+
+ my @readable_info;
+
+ foreach my $sort (@sorted)
+ {
+ push(@readable_info, delete($sort->{who_am_i}));
+ push(@readable_info, $sort);
+ }
+
+ use Data::Dumper;
+ return encode_entities(Dumper(\@readable_info));
+
+}
+
+1;
+
diff --git a/htetc/handler.pl b/htetc/handler.pl
new file mode 100644
index 000000000..481d5a2d9
--- /dev/null
+++ b/htetc/handler.pl
@@ -0,0 +1,166 @@
+#!/usr/bin/perl
+#
+# This is a basic, fairly fuctional Mason handler.pl.
+#
+# For something a little more involved, check out session_handler.pl
+
+package HTML::Mason;
+
+# Bring in main Mason package.
+use HTML::Mason;
+
+# Bring in ApacheHandler, necessary for mod_perl integration.
+# Uncomment the second line (and comment the first) to use
+# Apache::Request instead of CGI.pm to parse arguments.
+use HTML::Mason::ApacheHandler;
+# use HTML::Mason::ApacheHandler (args_method=>'mod_perl');
+
+# Uncomment the next line if you plan to use the Mason previewer.
+#use HTML::Mason::Preview;
+
+use strict;
+
+# List of modules that you want to use from components (see Admin
+# manual for details)
+#{ package HTML::Mason::Commands;
+# use CGI;
+#}
+
+# Create Mason objects
+#
+
+#my $parser = new HTML::Mason::Parser;
+#my $interp = new HTML::Mason::Interp (parser=>$parser,
+# comp_root=>'/var/www/masondocs',
+# data_dir=>'/usr/local/etc/freeside/masondata',
+# out_mode=>'stream',
+# );
+my $ah = new HTML::Mason::ApacheHandler (
+ #interp => $interp,
+ #auto_send_headers => 0,
+ comp_root=>'/var/www/freeside',
+ data_dir=>'/usr/local/etc/freeside/masondata',
+ #out_mode=>'stream',
+);
+
+# Activate the following if running httpd as root (the normal case).
+# Resets ownership of all files created by Mason at startup.
+#
+#chown (Apache->server->uid, Apache->server->gid, $interp->files_written);
+
+sub handler
+{
+ my ($r) = @_;
+
+ # If you plan to intermix images in the same directory as
+ # components, activate the following to prevent Mason from
+ # evaluating image files as components.
+ #
+ #return -1 if $r->content_type && $r->content_type !~ m|^text/|i;
+
+ #rar
+ { package HTML::Mason::Commands;
+ use strict;
+ use vars qw( $cgi $p );
+ use CGI;
+ #use CGI::Carp qw(fatalsToBrowser);
+ use Date::Format;
+ use Date::Parse;
+ use Time::Local;
+ use Tie::IxHash;
+ use HTML::Entities;
+ use IO::Handle;
+ use IO::File;
+ use String::Approx qw(amatch);
+ use Chart::LinesPoints;
+ use HTML::Widgets::SelectLayers 0.02;
+ use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
+ use FS::Record qw(qsearch qsearchs fields dbdef);
+ use FS::Conf;
+ use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot
+ small_custview myexit http_header);
+ use FS::Msgcat qw(gettext geterror);
+
+ use FS::agent;
+ use FS::agent_type;
+ use FS::domain_record;
+ use FS::cust_bill;
+ use FS::cust_bill_pay;
+ use FS::cust_credit;
+ use FS::cust_credit_bill;
+ use FS::cust_main;
+ use FS::cust_main_county;
+ use FS::cust_pay;
+ use FS::cust_pkg;
+ use FS::cust_refund;
+ use FS::cust_svc;
+ use FS::nas;
+ use FS::part_bill_event;
+ use FS::part_pkg;
+ use FS::part_referral;
+ use FS::part_svc;
+ use FS::part_svc_router;
+ use FS::pkg_svc;
+ use FS::port;
+ use FS::queue qw(joblisting);
+ use FS::raddb;
+ use FS::session;
+ use FS::svc_acct;
+ use FS::svc_acct_pop qw(popselector);
+ use FS::svc_acct_sm;
+ use FS::svc_domain;
+ use FS::svc_forward;
+ use FS::svc_www;
+ use FS::router;
+ use FS::part_router_field;
+ use FS::router_field;
+ use FS::addr_block;
+ use FS::part_sb_field;
+ use FS::sb_field;
+ use FS::svc_broadband;
+ use FS::type_pkgs;
+ use FS::part_export;
+ use FS::part_export_option;
+ use FS::export_svc;
+ use FS::msgcat;
+
+ *CGI::redirect = sub {
+ my( $self, $location ) = @_;
+ use vars qw($m);
+ #http://www.masonhq.com/docs/faq/#how_do_i_do_an_external_redirect
+ $m->clear_buffer;
+ # The next two lines are necessary to stop Apache from re-reading
+ # POSTed data.
+ $r->method('GET');
+ $r->headers_in->unset('Content-length');
+ $r->content_type('text/html');
+ #$r->err_header_out('Location' => $location);
+ $r->header_out('Location' => $location);
+ $r->header_out('Content-Type' => 'text/html');
+ $m->abort(302);
+
+ '';
+ };
+
+ $cgi = new CGI;
+ &cgisuidsetup($cgi);
+ #&cgisuidsetup($r);
+ $p = popurl(2);
+ }
+
+ $r->content_type('text/html');
+ #eorar
+
+ my $headers = $r->headers_out;
+ $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
+ #$r->no_cache(1);
+ $headers->{'Expires'} = '0';
+
+# $r->send_http_header;
+
+ my $status = $ah->handle_request($r);
+
+ $status;
+}
+
+1;
diff --git a/htetc/handler.pl-1.0x b/htetc/handler.pl-1.0x
new file mode 100644
index 000000000..8840b0816
--- /dev/null
+++ b/htetc/handler.pl-1.0x
@@ -0,0 +1,161 @@
+#!/usr/bin/perl
+#
+# This is a basic, fairly fuctional Mason handler.pl.
+#
+# For something a little more involved, check out session_handler.pl
+
+package HTML::Mason;
+
+# Bring in main Mason package.
+use HTML::Mason;
+
+# Bring in ApacheHandler, necessary for mod_perl integration.
+# Uncomment the second line (and comment the first) to use
+# Apache::Request instead of CGI.pm to parse arguments.
+use HTML::Mason::ApacheHandler;
+# use HTML::Mason::ApacheHandler (args_method=>'mod_perl');
+
+# Uncomment the next line if you plan to use the Mason previewer.
+#use HTML::Mason::Preview;
+
+use strict;
+
+# List of modules that you want to use from components (see Admin
+# manual for details)
+#{ package HTML::Mason::Commands;
+# use CGI;
+#}
+
+# Create Mason objects
+#
+my $parser = new HTML::Mason::Parser;
+my $interp = new HTML::Mason::Interp (parser=>$parser,
+ comp_root=>'/var/www/freeside',
+ data_dir=>'/usr/local/etc/freeside/masondata',
+ out_mode=>'stream',
+ );
+my $ah = new HTML::Mason::ApacheHandler ( interp => $interp,
+ #auto_send_headers => 0,
+ );
+
+# Activate the following if running httpd as root (the normal case).
+# Resets ownership of all files created by Mason at startup.
+#
+chown (Apache->server->uid, Apache->server->gid, $interp->files_written);
+
+sub handler
+{
+ my ($r) = @_;
+
+ # If you plan to intermix images in the same directory as
+ # components, activate the following to prevent Mason from
+ # evaluating image files as components.
+ #
+ #return -1 if $r->content_type && $r->content_type !~ m|^text/|i;
+
+ #rar
+ { package HTML::Mason::Commands;
+ use strict;
+ use vars qw( $cgi $p );
+ use CGI;
+ #use CGI::Carp qw(fatalsToBrowser);
+ use Date::Format;
+ use Date::Parse;
+ use Time::Local;
+ use Tie::IxHash;
+ use HTML::Entities;
+ use IO::Handle;
+ use IO::File;
+ use String::Approx qw(amatch);
+ use Chart::LinesPoints;
+ use HTML::Widgets::SelectLayers 0.02;
+ use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name);
+ use FS::Record qw(qsearch qsearchs fields dbdef);
+ use FS::Conf;
+ use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot
+ small_custview myexit http_header);
+ use FS::Msgcat qw(gettext geterror);
+
+ use FS::agent;
+ use FS::agent_type;
+ use FS::domain_record;
+ use FS::cust_bill;
+ use FS::cust_bill_pay;
+ use FS::cust_credit;
+ use FS::cust_credit_bill;
+ use FS::cust_main;
+ use FS::cust_main_county;
+ use FS::cust_pay;
+ use FS::cust_pkg;
+ use FS::cust_refund;
+ use FS::cust_svc;
+ use FS::nas;
+ use FS::part_bill_event;
+ use FS::part_pkg;
+ use FS::part_referral;
+ use FS::part_svc;
+ use FS::part_svc_router;
+ use FS::pkg_svc;
+ use FS::port;
+ use FS::queue qw(joblisting);
+ use FS::raddb;
+ use FS::session;
+ use FS::svc_acct;
+ use FS::svc_acct_pop qw(popselector);
+ use FS::svc_acct_sm;
+ use FS::svc_domain;
+ use FS::svc_forward;
+ use FS::svc_www;
+ use FS::router;
+ use FS::part_router_field;
+ use FS::router_field;
+ use FS::addr_block;
+ use FS::part_sb_field;
+ use FS::sb_field;
+ use FS::svc_broadband;
+ use FS::type_pkgs;
+ use FS::part_export;
+ use FS::part_export_option;
+ use FS::export_svc;
+ use FS::msgcat;
+
+ *CGI::redirect = sub {
+ my( $self, $location ) = @_;
+
+ #http://www.masonhq.com/docs/faq/#how_do_i_do_an_external_redirect
+ $m->clear_buffer;
+ # The next two lines are necessary to stop Apache from re-reading
+ # POSTed data.
+ $r->method('GET');
+ $r->headers_in->unset('Content-length');
+ $r->content_type('text/html');
+ #$r->err_header_out('Location' => $location);
+ $r->header_out('Location' => $location);
+ $r->header_out('Content-Type' => 'text/html');
+ $m->abort(302);
+
+ '';
+ };
+
+ $cgi = new CGI;
+ &cgisuidsetup($cgi);
+ #&cgisuidsetup($r);
+ $p = popurl(2);
+ }
+
+ $r->content_type('text/html');
+ #eorar
+
+ my $headers = $r->headers_out;
+ $headers->{'Pragma'} = $headers->{'Cache-control'} = 'no-cache';
+ #$r->no_cache(1);
+ $headers->{'Expires'} = '0';
+
+# $r->send_http_header;
+
+ my $status = $ah->handle_request($r);
+
+ $status;
+}
+
+1;
diff --git a/httemplate/.htaccess b/httemplate/.htaccess
new file mode 100755
index 000000000..f8c6b9c0c
--- /dev/null
+++ b/httemplate/.htaccess
@@ -0,0 +1,3 @@
+AuthName Freeside
+AuthType Basic
+require valid-user
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi
new file mode 100644
index 000000000..06ac556cf
--- /dev/null
+++ b/httemplate/browse/addr_block.cgi
@@ -0,0 +1,76 @@
+<%= header('Address Blocks', menubar('Main Menu' => $p)) %>
+<%
+
+use NetAddr::IP;
+
+my @addr_block = qsearch('addr_block', {});
+my @router = qsearch('router', {});
+my $block;
+my $p2 = popurl(2);
+my $path = $p2 . "edit/process/addr_block";
+
+%>
+
+<% if ($cgi->param('error')) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
+ <BR><BR>
+<% } %>
+
+<%=table()%>
+
+<% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) { %>
+ <TR>
+ <TD><%=$block->NetAddr%></TD>
+ <% if (my $router = $block->router) { %>
+ <% if (scalar($block->svc_broadband) == 0) { %>
+ <TD>
+ <%=$router->routername%>
+ </TD>
+ <TD>
+ <FORM ACTION="<%=$path%>/deallocate.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
+ <INPUT TYPE="submit" NAME="submit" VALUE="Deallocate">
+ </FORM>
+ </TD>
+ <% } else { %>
+ <TD COLSPAN="2">
+ <%=$router->routername%>
+ </TD>
+ <% } %>
+ <% } else { %>
+ <TD>
+ <FORM ACTION="<%=$path%>/allocate.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
+ <SELECT NAME="routernum" SIZE="1">
+ <% foreach (@router) { %>
+ <OPTION VALUE="<%=$_->routernum %>"><%=$_->routername%></OPTION>
+ <% } %>
+ </SELECT>
+ <INPUT TYPE="submit" NAME="submit" VALUE="Allocate">
+ </FORM>
+ </TD>
+ <TD>
+ <FORM ACTION="<%=$path%>/split.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
+ <INPUT TYPE="submit" NAME="submit" VALUE="Split">
+ </FORM>
+ </TD>
+ </TR>
+<% }
+ } %>
+ <TR><TD COLSPAN="3"><BR></TD></TR>
+ <TR>
+ <FORM ACTION="<%=$path%>/add.cgi" METHOD="POST">
+ <TD>Gateway/Netmask</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
+ </TD>
+ <TD>
+ <INPUT TYPE="submit" NAME="submit" VALUE="Add">
+ </TD>
+ </FORM>
+ </TR>
+</TABLE>
+</BODY>
+</HTML>
+
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
new file mode 100755
index 000000000..cff111ca4
--- /dev/null
+++ b/httemplate/browse/agent.cgi
@@ -0,0 +1,63 @@
+<!-- mason kludge -->
+<%
+#Begin silliness
+#
+#use FS::UI::CGI;
+#use FS::UI::agent;
+#
+#$ui = new FS::UI::agent;
+#$ui->browse;
+#exit;
+#__END__
+#End silliness
+%>
+
+<%= header('Agent Listing', menubar(
+ 'Main Menu' => $p,
+ 'Agent Types' => $p. 'browse/agent_type.cgi',
+# 'Add new agent' => '../edit/agent.cgi'
+)) %>
+Agents are resellers of your service. Agents may be limited to a subset of your
+full offerings (via their type).<BR><BR>
+<A HREF="<%= $p %>edit/agent.cgi"><I>Add a new agent</I></A><BR><BR>
+
+<%= table() %>
+<TR>
+ <TH COLSPAN=2>Agent</TH>
+ <TH>Type</TH>
+ <TH><FONT SIZE=-1>Freq.</FONT></TH>
+ <TH><FONT SIZE=-1>Prog.</FONT></TH>
+</TR>
+<%
+# <TH><FONT SIZE=-1>Agent #</FONT></TH>
+# <TH>Agent</TH>
+
+foreach my $agent ( sort {
+ #$a->getfield('agentnum') <=> $b->getfield('agentnum')
+ $a->getfield('agent') cmp $b->getfield('agent')
+} qsearch('agent',{}) ) {
+ my($hashref)=$agent->hashref;
+ my($typenum)=$hashref->{typenum};
+ my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum});
+ my($atype)=$agent_type->getfield('atype');
+ print <<END;
+ <TR>
+ <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
+ $hashref->{agentnum}</A></TD>
+ <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
+ $hashref->{agent}</A></TD>
+ <TD><A HREF="${p}edit/agent_type.cgi?$typenum">$atype</A></TD>
+ <TD>$hashref->{freq}</TD>
+ <TD>$hashref->{prog}</TD>
+ </TR>
+END
+
+}
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/agent_type.cgi b/httemplate/browse/agent_type.cgi
new file mode 100755
index 000000000..5a8438589
--- /dev/null
+++ b/httemplate/browse/agent_type.cgi
@@ -0,0 +1,58 @@
+<!-- mason kludge -->
+<%= header("Agent Type Listing", menubar(
+ 'Main Menu' => $p,
+ 'Agents' => $p. 'browse/agent.cgi',
+)) %>
+Agent types define groups of packages that you can then assign to particular
+agents.<BR><BR>
+<A HREF="<%= $p %>edit/agent_type.cgi"><I>Add a new agent type</I></A><BR><BR>
+
+<%= table() %>
+<TR>
+ <TH COLSPAN=2>Agent Type</TH>
+ <TH COLSPAN=2>Packages</TH>
+</TR>
+
+<%
+foreach my $agent_type ( sort {
+ $a->getfield('typenum') <=> $b->getfield('typenum')
+} qsearch('agent_type',{}) ) {
+ my($hashref)=$agent_type->hashref;
+ my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
+ my($rowspan)=scalar(@type_pkgs);
+ $rowspan = int($rowspan/2+0.5) ;
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">
+ $hashref->{typenum}
+ </A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD>
+END
+
+ my($type_pkgs);
+ my($tdcount) = -1 ;
+ foreach $type_pkgs ( @type_pkgs ) {
+ my($pkgpart)=$type_pkgs->getfield('pkgpart');
+ my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart });
+ print qq!<TR>! if ($tdcount == 0) ;
+ $tdcount = 0 if ($tdcount == -1) ;
+ print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!,
+ $part_pkg->getfield('pkg'),"</A></TD>";
+ $tdcount ++ ;
+ if ($tdcount == 2)
+ {
+ print qq!</TR>\n! ;
+ $tdcount = 0 ;
+ }
+ }
+
+ print "</TR>";
+}
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
new file mode 100755
index 000000000..c2473c4c8
--- /dev/null
+++ b/httemplate/browse/cust_main_county.cgi
@@ -0,0 +1,136 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+my $enable_taxclasses = $conf->exists('enable_taxclasses');
+
+print header("Tax Rate Listing", menubar(
+ 'Main Menu' => $p,
+ 'Edit tax rates' => $p. "edit/cust_main_county.cgi",
+)),<<END;
+ Click on <u>expand country</u> to specify a country's tax rates by state.
+ <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
+END
+
+if ( $enable_taxclasses ) {
+ print '<BR>Click on <u>expand taxclasses</u> to specify tax classes';
+}
+
+print '<BR><BR>'. &table(). <<END;
+ <TR>
+ <TH><FONT SIZE=-1>Country</FONT></TH>
+ <TH><FONT SIZE=-1>State</FONT></TH>
+ <TH>County</TH>
+ <TH>Taxclass<BR><FONT SIZE=-1>(per-package classification)</FONT></TH>
+ <TH>Tax name<BR><FONT SIZE=-1>(printed on invoices)</FONT></TH>
+ <TH><FONT SIZE=-1>Tax</FONT></TH>
+ <TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
+ </TR>
+END
+
+my @regions = sort { $a->country cmp $b->country
+ or $a->state cmp $b->state
+ or $a->county cmp $b->county
+ or $a->taxclass cmp $b->taxclass
+ } qsearch('cust_main_county',{});
+
+my $sup=0;
+#foreach $cust_main_county ( @regions ) {
+for ( my $i=0; $i<@regions; $i++ ) {
+ my $cust_main_county = $regions[$i];
+ my $hashref = $cust_main_county->hashref;
+ print <<END;
+ <TR>
+ <TD BGCOLOR="#ffffff">$hashref->{country}</TD>
+END
+
+ my $j;
+ if ( $sup ) {
+ $sup--;
+ } else {
+
+ #lookahead
+ for ( $j=1; $i+$j<@regions; $j++ ) {
+ last if $hashref->{country} ne $regions[$i+$j]->country
+ || $hashref->{state} ne $regions[$i+$j]->state
+ || $hashref->{tax} != $regions[$i+$j]->tax
+ || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount;
+ }
+
+ my $newsup=0;
+ if ( $j>1 && $i+$j+1 < @regions
+ && ( $hashref->{state} ne $regions[$i+$j+1]->state
+ || $hashref->{country} ne $regions[$i+$j+1]->country
+ )
+ && ( ! $i
+ || $hashref->{state} ne $regions[$i-1]->state
+ || $hashref->{country} ne $regions[$i-1]->country
+ )
+ ) {
+ $sup = $j-1;
+ } else {
+ $j = 1;
+ }
+
+ print "<TD ROWSPAN=$j", $hashref->{state}
+ ? ' BGCOLOR="#ffffff">'. $hashref->{state}
+ : qq! BGCOLOR="#cccccc">(ALL) <FONT SIZE=-1>!.
+ qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
+ qq!">expand country</A></FONT>!;
+
+ print qq! <FONT SIZE=-1><A HREF="${p}edit/process/cust_main_county-collapse.cgi?!. $hashref->{taxnum}. qq!">collapse state</A></FONT>! if $j>1;
+
+ print "</TD>";
+ }
+
+# $sup=$newsup;
+
+ print "<TD";
+ if ( $hashref->{county} ) {
+ print ' BGCOLOR="#ffffff">'. $hashref->{county};
+ } else {
+ print ' BGCOLOR="#cccccc">(ALL)';
+ if ( $hashref->{state} ) {
+ print qq!<FONT SIZE=-1>!.
+ qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
+ qq!">expand state</A></FONT>!;
+ }
+ }
+ print "</TD>";
+
+ print "<TD";
+ if ( $hashref->{taxclass} ) {
+ print ' BGCOLOR="#ffffff">'. $hashref->{taxclass};
+ } else {
+ print ' BGCOLOR="#cccccc">(ALL)';
+ if ( $enable_taxclasses ) {
+ print qq!<FONT SIZE=-1>!.
+ qq!<A HREF="${p}edit/cust_main_county-expand.cgi?taxclass!.
+ $hashref->{taxnum}. qq!">expand taxclasses</A></FONT>!;
+ }
+
+ }
+ print "</TD>";
+
+ print "<TD";
+ if ( $hashref->{taxname} ) {
+ print ' BGCOLOR="#ffffff">'. $hashref->{taxname};
+ } else {
+ print ' BGCOLOR="#cccccc">Tax';
+ }
+ print "</TD>";
+
+ print "<TD BGCOLOR=\"#ffffff\">$hashref->{tax}%</TD>".
+ '<TD BGCOLOR="#ffffff">$'.
+ sprintf("%.2f", $hashref->{exempt_amount} || 0). '</TD>'.
+ '</TR>';
+
+}
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/cust_pay_batch.cgi b/httemplate/browse/cust_pay_batch.cgi
new file mode 100755
index 000000000..608a58d0d
--- /dev/null
+++ b/httemplate/browse/cust_pay_batch.cgi
@@ -0,0 +1,52 @@
+<!-- mason kludge -->
+<%
+
+print header("Pending credit card batch", menubar(
+ 'Main Menu' => $p,
+# 'Add new referral' => "../edit/part_referral.cgi",
+)), &table(), <<END;
+ <TR>
+ <TH>#</TH>
+ <TH><font size=-1>inv#</font></TH>
+ <TH COLSPAN=2>Customer</TH>
+ <TH>Card name</TH>
+ <TH>Card</TH>
+ <TH>Exp</TH>
+ <TH>Amount</TH>
+ </TR>
+END
+
+foreach my $cust_pay_batch ( sort {
+ $a->getfield('paybatchnum') <=> $b->getfield('paybatchnum')
+} qsearch('cust_pay_batch',{}) ) {
+# my $date = time2str( "%a %b %e %T %Y", $queue->_date );
+# my $status = $hashref->{status};
+# if ( $status eq 'failed' || $status eq 'locked' ) {
+# $status .=
+# qq! ( <A HREF="$p/edit/cust_pay_batch.cgi?jobnum=$jobnum&action=new">retry</A> |!.
+# qq! <A HREF="$p/edit/cust_pay_batch.cgi?jobnum$jobnum&action=del">remove </A> )!;
+# }
+ my $cardnum = $cust_pay_batch->{cardnum};
+ $cardnum =~ s/.{4}$/xxxx/;
+ print <<END;
+ <TR>
+ <TD>$cust_pay_batch->{paybatchnum}</TD>
+ <TD><A HREF="../view/cust_bill.cgi?$cust_pay_batch->{invnum}">$cust_pay_batch->{invnum}</TD>
+ <TD><A HREF="../view/cust_main.cgi?$cust_pay_batch->{custnum}">$cust_pay_batch->{custnum}</TD>
+ <TD>$cust_pay_batch->{last}, $cust_pay_batch->{last}</TD>
+ <TD>$cust_pay_batch->{payname}</TD>
+ <TD>$cardnum</TD>
+ <TD>$cust_pay_batch->{exp}</TD>
+ <TD align="right">\$$cust_pay_batch->{amount}</TD>
+ </TR>
+END
+
+}
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/generic.cgi b/httemplate/browse/generic.cgi
new file mode 100644
index 000000000..9ac0f2391
--- /dev/null
+++ b/httemplate/browse/generic.cgi
@@ -0,0 +1,46 @@
+<%
+
+use FS::Record qw(qsearch dbdef);
+use DBIx::DBSchema;
+use DBIx::DBSchema::Table;
+
+my $error;
+my $p2 = popurl(2);
+my ($table) = $cgi->keywords;
+my $dbdef = dbdef or die "Cannot fetch dbdef!";
+my $dbdef_table = $dbdef->table($table) or die "Cannot fetch schema for $table";
+
+my $pkey = $dbdef_table->primary_key or die "Cannot fetch pkey for $table";
+print header("Browse $table", menubar('Main Menu' => $p));
+
+my @rec = qsearch($table, {});
+my @col = $dbdef_table->columns;
+
+if ($cgi->param('error')) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
+ <BR><BR>
+<% }
+%>
+<A HREF="<%=$p2%>edit/<%=$table%>.cgi"><I>Add a new <%=$table%></I></A><BR><BR>
+
+<%=table()%>
+<TH>
+<% foreach (grep { $_ ne $pkey } @col) {
+ %><TD><%=$_%></TD>
+ <% } %>
+</TH>
+<% foreach $rec (sort {$a->getfield($pkey) cmp $b->getfield($pkey) } @rec) {
+ %>
+ <TR>
+ <TD>
+ <A HREF="<%=$p2%>edit/<%=$table%>.cgi?<%=$rec->getfield($pkey)%>">
+ <%=$rec->getfield($pkey)%></A> </TD> <%
+ foreach $col (grep { $_ ne $pkey } @col) { %>
+ <TD><%=$rec->getfield($col)%></TD> <% } %>
+ </A>
+ </TR>
+<% } %>
+</TABLE>
+</BODY>
+</HTML>
+
diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi
new file mode 100755
index 000000000..d4adf9f1a
--- /dev/null
+++ b/httemplate/browse/msgcat.cgi
@@ -0,0 +1,50 @@
+<!-- mason kludge -->
+<%
+
+print header("View Message catalog", menubar(
+ 'Main Menu' => $p,
+ 'Edit message catalog' => $p. "edit/msgcat.cgi",
+)), '<BR>';
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => 'en_US',
+ 'options' => { 'en_US'=>'en_US' },
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = "<BR>Messages for locale $layer<BR>". table().
+ "<TR><TH COLSPAN=2>Code</TH>".
+ "<TH>Message</TH>";
+ $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
+ $html .= '</TR>';
+
+ #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
+ # qsearch('msgcat', { 'locale' => $layer } ) ) {
+ foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
+ $html .= '<TR><TD>'. $msgcat->msgnum. '</TD>'.
+ '<TD>'. $msgcat->msgcode. '</TD>'.
+ '<TD>'. $msgcat->msg. '</TD>';
+ unless ( $layer eq 'en_US' ) {
+ my $en_msgcat = qsearchs('msgcat', {
+ 'locale' => 'en_US',
+ 'msgcode' => $msgcat->msgcode,
+ } );
+ $html .= '<TD>'. $en_msgcat->msg. '</TD>';
+ }
+ $html .= '</TR>';
+ }
+
+ $html .= '</TABLE>';
+ $html;
+ },
+
+);
+
+print $widget->html;
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/nas.cgi b/httemplate/browse/nas.cgi
new file mode 100755
index 000000000..9ccbfe632
--- /dev/null
+++ b/httemplate/browse/nas.cgi
@@ -0,0 +1,80 @@
+<!-- mason kludge -->
+<%
+
+print header('NAS ports', menubar(
+ 'Main Menu' => $p,
+));
+
+my $now = time;
+
+foreach my $nas ( sort { $a->nasnum <=> $b->nasnum } qsearch( 'nas', {} ) ) {
+ print $nas->nasnum. ": ". $nas->nas. " ".
+ $nas->nasfqdn. " (". $nas->nasip. ") ".
+ "as of ". time2str("%c",$nas->last).
+ " (". &pretty_interval($now - $nas->last). " ago)<br>".
+ &table(). "<TR><TH>Nas<BR>Port #</TH><TH>Global<BR>Port #</BR></TH>".
+ "<TH>IP address</TH><TH>User</TH><TH>Since</TH><TH>Duration</TH><TR>",
+ ;
+ foreach my $port ( sort {
+ $a->nasport <=> $b->nasport || $a->portnum <=> $b->portnum
+ } qsearch( 'port', { 'nasnum' => $nas->nasnum } ) ) {
+ my $session = $port->session;
+ my($user, $since, $pretty_since, $duration);
+ if ( ! $session ) {
+ $user = "(empty)";
+ $since = 0;
+ $pretty_since = "(never)";
+ $duration = '';
+ } elsif ( $session->logout ) {
+ $user = "(empty)";
+ $since = $session->logout;
+ } else {
+ my $svc_acct = $session->svc_acct;
+ $user = "<A HREF=\"$p/view/svc_acct.cgi?". $svc_acct->svcnum. "\">".
+ $svc_acct->username. "</A>";
+ $since = $session->login;
+ }
+ $pretty_since = time2str("%c", $since) if $since;
+ $duration = pretty_interval( $now - $since ). " ago"
+ unless defined($duration);
+ print "<TR><TD>". $port->nasport. "</TD><TD>". $port->portnum. "</TD><TD>".
+ $port->ip. "</TD><TD>$user</TD><TD>$pretty_since".
+ "</TD><TD>$duration</TD></TR>"
+ ;
+ }
+ print "</TABLE><BR>";
+}
+
+#Time::Duration??
+sub pretty_interval {
+ my $interval = shift;
+ my %howlong = (
+ '604800' => 'week',
+ '86400' => 'day',
+ '3600' => 'hour',
+ '60' => 'minute',
+ '1' => 'second',
+ );
+
+ my $pretty = "";
+ foreach my $key ( sort { $b <=> $a } keys %howlong ) {
+ my $value = int( $interval / $key );
+ if ( $value ) {
+ if ( $value == 1 ) {
+ $pretty .=
+ ( $howlong{$key} eq 'hour' ? 'an ' : 'a ' ). $howlong{$key}. " "
+ } else {
+ $pretty .= $value. ' '. $howlong{$key}. 's ';
+ }
+ }
+ $interval -= $value * $key;
+ }
+ $pretty =~ /^\s*(\S.*\S)\s*$/;
+ $1;
+}
+
+#print &table(), <<END;
+#<TR>
+# <TH>#</TH>
+# <TH>NAS</
+%>
diff --git a/httemplate/browse/part_bill_event.cgi b/httemplate/browse/part_bill_event.cgi
new file mode 100755
index 000000000..670474d48
--- /dev/null
+++ b/httemplate/browse/part_bill_event.cgi
@@ -0,0 +1,71 @@
+<!-- mason kludge -->
+<%
+
+my %search;
+if ( $cgi->param('showdisabled') ) {
+ %search = ();
+} else {
+ %search = ( 'disabled' => '' );
+}
+
+my @part_bill_event = qsearch('part_bill_event', \%search );
+my $total = scalar(@part_bill_event);
+
+%>
+<%= header('Invoice Event Listing', menubar( 'Main Menu' => $p) ) %>
+
+ Invoice events are actions taken on overdue invoices.<BR><BR>
+<A HREF="<%= $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A>
+<BR><BR>
+<%= $total %> events
+<%= $cgi->param('showdisabled')
+ ? do { $cgi->param('showdisabled', 0);
+ '( <a href="'. $cgi->self_url. '">hide disabled events</a> )'; }
+ : do { $cgi->param('showdisabled', 1);
+ '( <a href="'. $cgi->self_url. '">show disabled events</a> )'; }
+%>
+<%= table() %>
+ <TR>
+ <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
+ <TH>Payby</TH>
+ <TH>After</TH>
+ <TH>Action</TH>
+ <TH>Options</TH>
+ <TH>Code</TH>
+ </TR>
+
+<% foreach my $part_bill_event ( sort { $a->payby cmp $b->payby
+ || $a->seconds <=> $b->seconds
+ || $a->weight <=> $b->weight
+ || $a->eventpart <=> $b->eventpart
+ } @part_bill_event ) {
+ my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart;
+ use Time::Duration;
+ my $delay = duration_exact($part_bill_event->seconds);
+ my $plandata = $part_bill_event->plandata;
+ $plandata =~ s/\n/<BR>/go;
+%>
+ <TR>
+ <TD><A HREF="<%= $url %>">
+ <%= $part_bill_event->eventpart %></A></TD>
+<% unless ( $cgi->param('showdisabled') ) { %>
+ <TD>
+ <%= $part_bill_event->disabled ? 'DISABLED' : '' %></TD>
+<% } %>
+ <TD><A HREF="<%= $url %>">
+ <%= $part_bill_event->event %></A></TD>
+ <TD>
+ <%= $part_bill_event->payby %></TD>
+ <TD>
+ <%= $delay %></TD>
+ <TD>
+ <%= $part_bill_event->plan %></TD>
+ <TD>
+ <%= $plandata %></TD>
+ <TD><FONT SIZE="-1">
+ <%= $part_bill_event->eventcode %></FONT></TD>
+ </TR>
+<% } %>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/httemplate/browse/part_export.cgi b/httemplate/browse/part_export.cgi
new file mode 100755
index 000000000..76662e0c9
--- /dev/null
+++ b/httemplate/browse/part_export.cgi
@@ -0,0 +1,39 @@
+<!-- mason kludge -->
+<%= header("Export Listing", menubar( 'Main Menu' => "$p#sysadmin" )) %>
+Provisioning services to external machines, databases and APIs.<BR><BR>
+<A HREF="<%= $p %>edit/part_export.cgi"><I>Add a new export</I></A><BR><BR>
+<SCRIPT>
+function part_export_areyousure(href) {
+ if (confirm("Are you sure you want to delete this export?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+
+<%= table() %>
+ <TR>
+ <TH COLSPAN=2>Export</TH>
+ <TH>Options</TH>
+ </TR>
+
+<% foreach my $part_export ( sort {
+ $a->getfield('exportnum') <=> $b->getfield('exportnum')
+ } qsearch('part_export',{}) ) {
+%>
+ <TR>
+ <TD><A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>"><%= $part_export->exportnum %></A></TD>
+ <TD><%= $part_export->exporttype %> to <%= $part_export->machine %> (<A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>">edit</A>&nbsp;|&nbsp;<A HREF="javascript:part_export_areyousure('<%= $p %>misc/delete-part_export.cgi?<%= $part_export->exportnum %>')">delete</A>)</TD>
+ <TD>
+ <%= itable() %>
+ <% my %opt = $part_export->options;
+ foreach my $opt ( keys %opt ) { %>
+ <TR><TD><%= $opt %></TD><TD><%= $opt{$opt} %></TD></TR>
+ <% } %>
+ </TABLE>
+ </TD>
+ </TR>
+
+<% } %>
+
+</TABLE>
+</BODY>
+</HTML>
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
new file mode 100755
index 000000000..7b9436cee
--- /dev/null
+++ b/httemplate/browse/part_pkg.cgi
@@ -0,0 +1,144 @@
+<!-- mason kludge -->
+<%
+
+my %search;
+if ( $cgi->param('showdisabled') ) {
+ %search = ();
+} else {
+ %search = ( 'disabled' => '' );
+}
+
+my @part_pkg = qsearch('part_pkg', \%search );
+my $total = scalar(@part_pkg);
+
+my $sortby;
+my %num_active_cust_pkg;
+if ( $cgi->param('active') ) {
+ my $active_sth = dbh->prepare(
+ 'SELECT COUNT(*) FROM cust_pkg WHERE pkgpart = ?'.
+ ' AND ( cancel IS NULL OR cancel = 0 )'.
+ ' AND ( susp IS NULL OR susp = 0 )'
+ ) or die dbh->errstr;
+ foreach my $part_pkg ( @part_pkg ) {
+ $active_sth->execute($part_pkg->pkgpart) or die $active_sth->errstr;
+ $num_active_cust_pkg{$part_pkg->pkgpart} =
+ $active_sth->fetchrow_arrayref->[0];
+ }
+ $sortby = \*active_cust_pkg_sort;
+} else {
+ $sortby = \*pkgpart_sort;
+}
+
+%>
+<%= header("Package Definition Listing",menubar( 'Main Menu' => $p )) %>
+<% unless ( $cgi->param('active') ) { %>
+ One or more service definitions are grouped together into a package
+ definition and given pricing information. Customers purchase packages
+ rather than purchase services directly.<BR><BR>
+ <A HREF="<%= $p %>edit/part_pkg.cgi"><I>Add a new package definition</I></A>
+ <BR><BR>
+<% } %>
+
+<%= $total %> package definitions
+<%
+if ( $cgi->param('showdisabled') ) {
+ $cgi->param('showdisabled', 0);
+ print qq!( <a href="!. $cgi->self_url. qq!">hide disabled packages</a> )!;
+} else {
+ $cgi->param('showdisabled', 1);
+ print qq!( <a href="!. $cgi->self_url. qq!">show disabled packages</a> )!;
+}
+
+my $colspan = $cgi->param('showdisabled') ? 2 : 3;
+print &table(), <<END;
+ <TR>
+ <TH COLSPAN=$colspan>Package</TH>
+ <TH>Comment</TH>
+END
+print ' <TH><FONT SIZE=-1>Customer<BR>packages</FONT></TH>'
+ if $cgi->param('active');
+print <<END;
+ <TH><FONT SIZE=-1>Freq.</FONT></TH>
+ <TH><FONT SIZE=-1>Plan</FONT></TH>
+ <TH><FONT SIZE=-1>Data</FONT></TH>
+ <TH>Service</TH>
+ <TH><FONT SIZE=-1>Quan.</FONT></TH>
+ </TR>
+END
+
+foreach my $part_pkg ( sort $sortby @part_pkg ) {
+ my($hashref)=$part_pkg->hashref;
+ my(@pkg_svc)=grep $_->getfield('quantity'),
+ qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} });
+ my($rowspan)=scalar(@pkg_svc);
+ my $plandata;
+ if ( $hashref->{plan} ) {
+ $plandata = $hashref->{plandata};
+ $plandata =~ s/^(\w+)=/$1&nbsp;/mg;
+ $plandata =~ s/\n/<BR>/g;
+ } else {
+ $hashref->{plan} = "(legacy)";
+ $plandata = "Setup&nbsp;". $hashref->{setup}.
+ "<BR>Recur&nbsp;". $hashref->{recur};
+ }
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkgpart}</A></TD>
+END
+
+ unless ( $cgi->param('showdisabled') ) {
+ print "<TD ROWSPAN=$rowspan>";
+ print "DISABLED" if $hashref->{disabled};
+ print '</TD>';
+ }
+
+ print <<END;
+ <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkg}</A></TD>
+ <TD ROWSPAN=$rowspan>$hashref->{comment}</TD>
+END
+ if ( $cgi->param('active') ) {
+ print " <TD ROWSPAN=$rowspan>";
+ print '<FONT COLOR="#00CC00"><B>'.
+ $num_active_cust_pkg{$hashref->{'pkgpart'}}.
+ qq!</B></FONT>&nbsp;<A HREF="${p}search/cust_pkg.cgi?magic=active;pkgpart=$hashref->{pkgpart}">active</A>!;
+ # suspended/cancelled
+ print '</TD>';
+ }
+ print <<END;
+ <TD ROWSPAN=$rowspan>$hashref->{freq}</TD>
+ <TD ROWSPAN=$rowspan>$hashref->{plan}</TD>
+ <TD ROWSPAN=$rowspan>$plandata</TD>
+END
+
+ my($pkg_svc);
+ my($n)="";
+ foreach $pkg_svc ( @pkg_svc ) {
+ my($svcpart)=$pkg_svc->getfield('svcpart');
+ my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart });
+ print $n,qq!<TD><A HREF="${p}edit/part_svc.cgi?$svcpart">!,
+ $part_svc->getfield('svc'),"</A></TD><TD>",
+ $pkg_svc->getfield('quantity'),"</TD></TR>\n";
+ $n="<TR>";
+ }
+
+ print "</TR>";
+}
+
+$colspan = $cgi->param('showdisabled') ? 8 : 9;
+print <<END;
+
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+
+sub pkgpart_sort {
+ $a->pkgpart <=> $b->pkgpart;
+}
+
+sub active_cust_pkg_sort {
+ $num_active_cust_pkg{$b->pkgpart} <=> $num_active_cust_pkg{$a->pkgpart};
+}
+
+%>
diff --git a/httemplate/browse/part_referral.cgi b/httemplate/browse/part_referral.cgi
new file mode 100755
index 000000000..084c21bd0
--- /dev/null
+++ b/httemplate/browse/part_referral.cgi
@@ -0,0 +1,38 @@
+<!-- mason kludge -->
+<%= header("Advertising source Listing", menubar(
+ 'Main Menu' => $p,
+# 'Add new referral' => "../edit/part_referral.cgi",
+)) %>
+Where a customer heard about your service. Tracked for informational purposes.
+<BR><BR>
+<A HREF="<%= $p %>edit/part_referral.cgi"><I>Add a new advertising source</I></A>
+<BR><BR>
+
+<%= table() %>
+<TR>
+ <TH COLSPAN=2>Advertising source</TH>
+</TR>
+
+<%
+foreach my $part_referral ( sort {
+ $a->getfield('refnum') <=> $b->getfield('refnum')
+} qsearch('part_referral',{}) ) {
+ my($hashref)=$part_referral->hashref;
+ print <<END;
+ <TR>
+ <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}">
+ $hashref->{refnum}</A></TD>
+ <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}">
+ $hashref->{referral}</A></TD>
+ </TR>
+END
+
+}
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/browse/part_sb_field.cgi b/httemplate/browse/part_sb_field.cgi
new file mode 100644
index 000000000..4c9641e86
--- /dev/null
+++ b/httemplate/browse/part_sb_field.cgi
@@ -0,0 +1,31 @@
+<%= header('svc_broadband extended fields', menubar('Main Menu' => $p)) %>
+<%
+
+my @psf = qsearch('part_sb_field', {});
+my $block;
+my $p2 = popurl(2);
+
+%>
+
+<% if ($cgi->param('error')) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
+ <BR><BR>
+<% } %>
+
+<A HREF="<%=$p2%>edit/part_sb_field.cgi"><I>Add a new field</I></A><BR><BR>
+
+<%=table()%>
+<TH><TD>Field name</TD><TD>Service type</TD></TH>
+<% foreach $psf (sort {$a->name cmp $b->name} @psf) { %>
+ <TR>
+ <TD></TD>
+ <TD>
+ <A HREF="<%=$p2%>edit/part_sb_field.cgi?<%=$psf->sbfieldpart%>">
+ <%=$psf->name%></A></TD>
+ <TD><%=$psf->part_svc->svc%></TD>
+ </TR>
+<% } %>
+</TABLE>
+</BODY>
+</HTML>
+
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
new file mode 100755
index 000000000..7c83924a2
--- /dev/null
+++ b/httemplate/browse/part_svc.cgi
@@ -0,0 +1,109 @@
+<!-- mason kludge -->
+<%
+
+my %search;
+if ( $cgi->param('showdisabled') ) {
+ %search = ();
+} else {
+ %search = ( 'disabled' => '' );
+}
+
+my @part_svc =
+ sort { $a->getfield('svcpart') <=> $b->getfield('svcpart') }
+ qsearch('part_svc', \%search );
+my $total = scalar(@part_svc);
+
+%>
+<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
+
+<SCRIPT>
+function part_export_areyousure(href) {
+ if (confirm("Are you sure you want to delete this export?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+
+ Service definitions are the templates for items you offer to your customers.<BR><BR>
+
+<FORM METHOD="POST" ACTION="<%= $p %>edit/part_svc.cgi">
+<A HREF="<%= $p %>edit/part_svc.cgi"><I>Add a new service definition</I></A><% if ( @part_svc ) { %>&nbsp;or&nbsp;<SELECT NAME="clone"><OPTION></OPTION>
+<% foreach my $part_svc ( @part_svc ) { %>
+ <OPTION VALUE="<%= $part_svc->svcpart %>"><%= $part_svc->svc %></OPTION>
+<% } %>
+</SELECT><INPUT TYPE="submit" VALUE="Clone existing service">
+<% } %>
+</FORM><BR>
+
+<%= $total %> service definitions
+<%= $cgi->param('showdisabled')
+ ? do { $cgi->param('showdisabled', 0);
+ '( <a href="'. $cgi->self_url. '">hide disabled services</a> )'; }
+ : do { $cgi->param('showdisabled', 1);
+ '( <a href="'. $cgi->self_url. '">show disabled services</a> )'; }
+%>
+<%= table() %>
+ <TR>
+ <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Service</TH>
+ <TH>Table</TH>
+ <TH>Export</TH>
+ <TH>Field</TH>
+ <TH COLSPAN=2>Modifier</TH>
+ </TR>
+
+<% foreach my $part_svc ( @part_svc ) {
+ my $hashref = $part_svc->hashref;
+ my $svcdb = $hashref->{svcdb};
+ my @dfields = fields($svcdb);
+ push @dfields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
+ my @fields =
+ grep { $_ ne 'svcnum' && $part_svc->part_svc_column($_)->columnflag }
+ @dfields;
+
+ my $rowspan = scalar(@fields) || 1;
+ my $url = "${p}edit/part_svc.cgi?$hashref->{svcpart}";
+%>
+
+ <TR>
+ <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>">
+ <%= $hashref->{svcpart} %></A></TD>
+<% unless ( $cgi->param('showdisabled') ) { %>
+ <TD ROWSPAN=<%= $rowspan %>>
+ <%= $hashref->{disabled} ? 'DISABLED' : '' %></TD>
+<% } %>
+ <TD ROWSPAN=<%= $rowspan %>><A HREF="<%= $url %>">
+ <%= $hashref->{svc} %></A></TD>
+ <TD ROWSPAN=<%= $rowspan %>>
+ <%= $hashref->{svcdb} %></TD>
+ <TD ROWSPAN=<%= $rowspan %>><%= itable() %>
+<%
+# my @part_export =
+map { qsearchs('part_export', { exportnum => $_->exportnum } ) } qsearch('export_svc', { svcpart => $part_svc->svcpart } ) ;
+ foreach my $part_export (
+ map { qsearchs('part_export', { exportnum => $_->exportnum } ) }
+ qsearch('export_svc', { svcpart => $part_svc->svcpart } )
+ ) {
+%>
+ <TR>
+ <TD><A HREF="<%= $p %>edit/part_export.cgi?<%= $part_export->exportnum %>"><%= $part_export->exportnum %>:&nbsp;<%= $part_export->exporttype %>&nbsp;to&nbsp;<%= $part_export->machine %></A></TD></TR>
+<% } %>
+ </TABLE></TD>
+
+<% my($n1)='';
+ foreach my $field ( @fields ) {
+ my $flag = $part_svc->part_svc_column($field)->columnflag;
+%>
+ <%= $n1 %><TD><%= $field %></TD><TD>
+
+<% if ( $flag eq "D" ) { print "Default"; }
+ elsif ( $flag eq "F" ) { print "Fixed"; }
+ else { print "(Unknown!)"; }
+%>
+ </TD><TD><%= $part_svc->part_svc_column($field)->columnvalue%></TD>
+<% $n1="</TR><TR>";
+ }
+%>
+ </TR>
+<% } %>
+</TABLE>
+</BODY>
+</HTML>
diff --git a/httemplate/browse/queue.cgi b/httemplate/browse/queue.cgi
new file mode 100755
index 000000000..b53c1402d
--- /dev/null
+++ b/httemplate/browse/queue.cgi
@@ -0,0 +1,7 @@
+<!-- mason kludge -->
+<%
+
+print header("Job Queue", menubar( 'Main Menu' => $p, )).
+ joblisting({}). '</BODY></HTML>';
+
+%>
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
new file mode 100644
index 000000000..8864936d9
--- /dev/null
+++ b/httemplate/browse/router.cgi
@@ -0,0 +1,37 @@
+<%= header('Routers', menubar('Main Menu' => $p)) %>
+<%
+
+my @router = qsearch('router', {});
+my $p2 = popurl(2);
+
+%>
+
+<% if ($cgi->param('error')) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
+ <BR><BR>
+<% } %>
+
+<A HREF="<%=$p2%>edit/router.cgi"><I>Add a new router</I></A><BR><BR>
+
+<%=table()%>
+<!-- <TH><TD>Field name</TD><TD>Field value</TD></TH> -->
+<% foreach $router (sort {$a->routernum <=> $b->routernum} @router) { %>
+ <TR>
+<!-- <TD ROWSPAN="<%=scalar($router->router_field) + 2%>"> -->
+ <TD>
+ <A HREF="<%=$p2%>edit/router.cgi?<%=$router->routernum%>"><%=$router->routername%></A>
+ </TD>
+ <!--
+ <% foreach (sort { $a->part_router_field->name cmp $b->part_router_field->name } $router->router_field ) { %>
+ <TR>
+ <TD BGCOLOR="#cccccc" ALIGN="right"><%=$_->part_router_field->name%></TD>
+ <TD BGCOLOR="#ffffff"><%=$_->value%></TD>
+ </TR>
+ <% } %>
+ -->
+ </TR>
+<% } %>
+</TABLE>
+</BODY>
+</HTML>
+
diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi
new file mode 100755
index 000000000..8d35cb56a
--- /dev/null
+++ b/httemplate/browse/svc_acct_pop.cgi
@@ -0,0 +1,49 @@
+<!-- mason kludge -->
+<%= header('Access Number Listing', menubar( 'Main Menu' => $p )) %>
+Points of Presence<BR><BR>
+<A HREF="<%= $p %>edit/svc_acct_pop.cgi"><I>Add new Access Number</I></A><BR><BR>
+<%= table() %>
+ <TR>
+ <TH></TH>
+ <TH>City</TH>
+ <TH>State</TH>
+ <TH>Area code</TH>
+ <TH>Exchange</TH>
+ <TH>Local</TH>
+ </TR>
+
+<%
+foreach my $svc_acct_pop ( sort {
+ #$a->getfield('popnum') <=> $b->getfield('popnum')
+ $a->state cmp $b->state || $a->city cmp $b->city
+ || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc
+} qsearch('svc_acct_pop',{}) ) {
+ my($hashref)=$svc_acct_pop->hashref;
+ print <<END;
+ <TR>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{popnum}</A></TD>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{city}</A></TD>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{state}</A></TD>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{ac}</A></TD>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{exch}</A></TD>
+ <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
+ $hashref->{loc}</A></TD>
+ </TR>
+END
+
+}
+
+print <<END;
+ <TR>
+ </TR>
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi
new file mode 100644
index 000000000..259713260
--- /dev/null
+++ b/httemplate/config/config-process.cgi
@@ -0,0 +1,51 @@
+<%
+ my $conf = new FS::Conf;
+ $FS::Conf::DEBUG = 1;
+ my @config_items = $conf->config_items;
+
+ foreach my $i ( @config_items ) {
+ my @touch = ();
+ my @delete = ();
+ my $n = 0;
+ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
+ if ( $type eq '' ) {
+ } elsif ( $type eq 'textarea' ) {
+ if ( $cgi->param($i->key. $n) ne '' ) {
+ my $value = $cgi->param($i->key. $n);
+ $value =~ s/\r\n/\n/g; #browsers?
+ $conf->set($i->key, $value);
+ } else {
+ $conf->delete($i->key);
+ }
+ } elsif ( $type eq 'checkbox' ) {
+# if ( defined($cgi->param($i->key. $n)) && $cgi->param($i->key. $n) ) {
+ if ( defined $cgi->param($i->key. $n) ) {
+ #$conf->touch($i->key);
+ push @touch, $i->key;
+ } else {
+ #$conf->delete($i->key);
+ push @delete, $i->key;
+ }
+ } elsif ( $type eq 'text' || $type eq 'select' ) {
+ if ( $cgi->param($i->key. $n) ne '' ) {
+ $conf->set($i->key, $cgi->param($i->key. $n));
+ } else {
+ $conf->delete($i->key);
+ }
+ } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) {
+ if ( scalar(@{[ $cgi->param($i->key. $n) ]}) ) {
+ $conf->set($i->key, join("\n", @{[ $cgi->param($i->key. $n) ]} ));
+ } else {
+ $conf->delete($i->key);
+ }
+ } else {
+ }
+ $n++;
+ }
+ # warn @touch;
+ $conf->touch($_) foreach @touch;
+ $conf->delete($_) foreach @delete;
+ }
+
+%>
+<%= $cgi->redirect("config-view.cgi") %>
diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi
new file mode 100644
index 000000000..9a0006792
--- /dev/null
+++ b/httemplate/config/config-view.cgi
@@ -0,0 +1,64 @@
+<!-- mason kludge -->
+<%= header('View Configuration', menubar( 'Main Menu' => $p,
+ 'Edit Configuration' => 'config.cgi' ) ) %>
+
+<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
+
+<% foreach my $section ( qw(required billing username password UI session
+ shell BIND
+ ),
+ '', 'deprecated') { %>
+ <A NAME="<%= $section || 'unclassified' %>"></A>
+ <FONT SIZE="-2">
+ <% foreach my $nav_section ( qw(required billing username password UI session
+ shell BIND
+ ),
+ '', 'deprecated') { %>
+ <% if ( $section eq $nav_section ) { %>
+ [<A NAME="not<%= $nav_section || 'unclassified' %>" style="background-color: #cccccc"><%= ucfirst($nav_section || 'unclassified') %></A>]
+ <% } else { %>
+ [<A HREF="#<%= $nav_section || 'unclassified' %>"><%= ucfirst($nav_section || 'unclassified') %></A>]
+ <% } %>
+ <% } %>
+ </FONT><BR>
+ <%= table("#cccccc", 2) %>
+ <tr>
+ <th colspan="2" bgcolor="#dcdcdc">
+ <%= ucfirst($section || 'unclassified') %> configuration options
+ </th>
+ </tr>
+ <% foreach my $i (grep $_->section eq $section, @config_items) { %>
+ <tr>
+ <td><a name="<%= $i->key %>">
+ <b><%= $i->key %></b>&nbsp;-&nbsp;<%= $i->description %>
+ </a></td>
+ <td><table border=0>
+ <% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
+ my $n = 0; %>
+ <% if ( $type eq '' ) { %>
+ <tr><td><font color="#ff0000">no type</font></td></tr>
+ <% } elsif ( $type eq 'textarea'
+ || $type eq 'editlist'
+ || $type eq 'selectmultiple' ) { %>
+ <tr><td bgcolor="#ffffff">
+<pre>
+<%= encode_entities(join("\n", $conf->config($i->key) ) ) %>
+</pre>
+ </td></tr>
+ <% } elsif ( $type eq 'checkbox' ) { %>
+ <tr><td bgcolor="#<%= $conf->exists($i->key) ? '00ff00">YES' : 'ff0000">NO' %></td></tr>
+ <% } elsif ( $type eq 'text' || $type eq 'select' ) { %>
+ <tr><td bgcolor="#ffffff"><%= $conf->exists($i->key) ? $conf->config($i->key) : '' %></td></tr>
+ <% } else { %>
+ <tr><td>
+ <font color="#ff0000">unknown type <%= $type %></font>
+ </td></tr>
+ <% } %>
+ <% $n++; } %>
+ </table></td>
+ </tr>
+ <% } %>
+ </table><br><br>
+<% } %>
+
+</body></html>
diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi
new file mode 100644
index 000000000..409869e11
--- /dev/null
+++ b/httemplate/config/config.cgi
@@ -0,0 +1,176 @@
+<!-- mason kludge -->
+<%= header('Edit Configuration', menubar( 'Main Menu' => $p ) ) %>
+<SCRIPT>
+var gSafeOnload = new Array();
+var gSafeOnsubmit = new Array();
+window.onload = SafeOnload;
+function SafeAddOnLoad(f) {
+ gSafeOnload[gSafeOnload.length] = f;
+}
+function SafeOnload() {
+ for (var i=0;i<gSafeOnload.length;i++)
+ gSafeOnload[i]();
+}
+function SafeAddOnSubmit(f) {
+ gSafeOnsubmit[gSafeOnsubmit.length] = f;
+}
+function SafeOnsubmit() {
+ for (var i=0;i<gSafeOnsubmit.length;i++)
+ gSafeOnsubmit[i]();
+}
+</SCRIPT>
+
+<% my $conf = new FS::Conf; my @config_items = $conf->config_items; %>
+
+<form name="OneTrueForm" action="config-process.cgi" METHOD="POST" onSubmit="SafeOnsubmit()">
+
+<% foreach my $section ( qw(required billing username password UI session
+ shell BIND
+ ),
+ '', 'deprecated') { %>
+ <A NAME="<%= $section || 'unclassified' %>"></A>
+ <FONT SIZE="-2">
+ <% foreach my $nav_section ( qw(required billing username password UI session
+ shell BIND
+ ),
+ '', 'deprecated') { %>
+ <% if ( $section eq $nav_section ) { %>
+ [<A NAME="not<%= $nav_section || 'unclassified' %>" style="background-color: #cccccc"><%= ucfirst($nav_section || 'unclassified') %></A>]
+ <% } else { %>
+ [<A HREF="#<%= $nav_section || 'unclassified' %>"><%= ucfirst($nav_section || 'unclassified') %></A>]
+ <% } %>
+ <% } %>
+ </FONT><BR>
+ <%= table("#cccccc", 2) %>
+ <tr>
+ <th colspan="2" bgcolor="#dcdcdc">
+ <%= ucfirst($section || 'unclassified') %> configuration options
+ </th>
+ </tr>
+ <% foreach my $i (grep $_->section eq $section, @config_items) { %>
+ <tr>
+ <td>
+ <% my $n = 0;
+ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
+ #warn $i->key unless defined($type);
+ %>
+ <% if ( $type eq '' ) { %>
+ <font color="#ff0000">no type</font>
+ <% } elsif ( $type eq 'textarea' ) { %>
+ <textarea name="<%= $i->key. $n %>" rows=5><%= "\n". join("\n", $conf->config($i->key) ) %></textarea>
+ <% } elsif ( $type eq 'checkbox' ) { %>
+ <input name="<%= $i->key. $n %>" type="checkbox" value="1"<%= $conf->exists($i->key) ? ' CHECKED' : '' %>>
+ <% } elsif ( $type eq 'text' ) { %>
+ <input name="<%= $i->key. $n %>" type="<%= $type %>" value="<%= $conf->exists($i->key) ? $conf->config($i->key) : '' %>">
+ <% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { %>
+ <select name="<%= $i->key. $n %>" <%= $type eq 'selectmultiple' ? 'MULTIPLE' : '' %>>
+ <% my %saw;
+ foreach my $value ( "", @{$i->select_enum} ) {
+ local($^W)=0; next if $saw{$value}++; %>
+ <option value="<%= $value %>"<%= $value eq $conf->config($i->key) || ( $type eq 'selectmultiple' && grep { $_ eq $value } $conf->config($i->key) ) ? ' SELECTED' : '' %>><%= $value %>
+ <% } %>
+ <% if ( $conf->exists($i->key) && $conf->config($i->key) && ! grep { $conf->config($i->key) eq $_ } @{$i->select_enum}) { %>
+ <option value=<%= $conf->config($i->key) %> SELECTED><%= $conf->config($i->key) %>
+ <% } %>
+ </select>
+ <% } elsif ( $type eq 'editlist' ) { %>
+ <script>
+ function doremove<%= $i->key. $n %>() {
+ fromObject = document.OneTrueForm.<%= $i->key. $n %>;
+ for (var i=fromObject.options.length-1;i>-1;i--) {
+ if (fromObject.options[i].selected)
+ deleteOption<%= $i->key. $n %>(fromObject,i);
+ }
+ }
+ function deleteOption<%= $i->key. $n %>(object,index) {
+ object.options[index] = null;
+ }
+ function selectall<%= $i->key. $n %>() {
+ fromObject = document.OneTrueForm.<%= $i->key. $n %>;
+ for (var i=fromObject.options.length-1;i>-1;i--) {
+ fromObject.options[i].selected = true;
+ }
+ }
+ function doadd<%= $i->key. $n %>(object) {
+ var myvalue = "";
+ <% if ( defined($i->editlist_parts) ) { %>
+
+ <% foreach my $pnum ( 0 .. scalar(@{$i->editlist_parts})-1 ) { %>
+
+ if ( myvalue != "" ) { myvalue = myvalue + " "; }
+ <% if ( $i->editlist_parts->[$pnum]{type} eq 'select' ) { %>
+ myvalue = myvalue + object.add<%= $i->key. $n . "_$pnum" %>.options[object.add<%= $i->key. $n . "_$pnum" %>.selectedIndex].value;
+ <!-- #RESET SELECT?? maybe not... -->
+ <% } elsif ( $i->editlist_parts->[$pnum]{type} eq 'immutable' ) { %>
+ myvalue = myvalue + object.add<%= $i->key. $n . "_$pnum" %>.value;
+ <% } else { %>
+ myvalue = myvalue + object.add<%= $i->key. $n . "_$pnum" %>.value;
+ object.add<%= $i->key. $n. "_$pnum" %>.value = "";
+ <% } %>
+
+
+ <% } %>
+ <% } else { %>
+ myvalue = object.add<%= $i->key. $n. "_1" %>.value;
+ <% } %>
+ var optionName = new Option(myvalue, myvalue);
+ var length = object.<%= $i->key. $n %>.length;
+ object.<%= $i->key. $n %>.options[length] = optionName;
+ }
+ </script>
+ <select multiple size=5 name="<%= $i->key. $n %>">
+ <option selected>----------------------------------------------------------------</option>
+ <% foreach my $line ( $conf->config($i->key) ) { %>
+ <option value="<%= $line %>"><%= $line %></option>
+ <% } %>
+ </select><br>
+ <input type="button" value="remove selected" onClick="doremove<%= $i->key. $n %>()">
+ <script>SafeAddOnLoad(doremove<%= $i->key. $n %>);
+ SafeAddOnSubmit(selectall<%= $i->key. $n %>);</script>
+ <br>
+ <%= itable() %><tr>
+ <% if ( defined $i->editlist_parts ) { %>
+ <% my $pnum=0; foreach my $part ( @{$i->editlist_parts} ) { %>
+ <td>
+ <% if ( $part->{type} eq 'text' ) { %>
+ <input type="text" name="add<%= $i->key. $n."_$pnum" %>">
+ <% } elsif ( $part->{type} eq 'immutable' ) { %>
+ <%= $part->{value} %><input type="hidden" name="add<%= $i->key. $n. "_$pnum" %>" value="<%= $part->{value} %>">
+ <% } elsif ( $part->{type} eq 'select' ) { %>
+ <select name="add<%= $i->key. $n. "_$pnum" %>">
+ <% foreach my $key ( keys %{$part->{select_enum}} ) { %>
+ <option value="<%= $key %>"><%= $part->{select_enum}{$key} %></option>
+ <% } %>
+ </select>
+ <% } else { %>
+ <font color="#ff0000">unknown type <%= $part->type %></font>
+ <% } %>
+ </td>
+ <% $pnum++; } %>
+ <% } else { %>
+ <td><input type="text" name="add<%= $i->key. $n %>_0"></td>
+ <% } %>
+ <td><input type="button" value="add" onClick="doadd<%= $i->key. $n %>(this.form)"></td>
+ </tr></table>
+ <% } else { %>
+ <font color="#ff0000">unknown type <%= $type %></font>
+ <% } %>
+ <% $n++; } %>
+ </td>
+ <td><a name="<%= $i->key %>">
+ <b><%= $i->key %></b> - <%= $i->description %>
+ </a></td>
+ </tr>
+ <% } %>
+ </table><br>
+
+ You may need to restart Apache and/or freeside-queued for configuration
+ changes to take effect.<br>
+
+ <input type="submit" value="Apply changes"><br><br>
+
+<% } %>
+
+</form>
+
+</body></html>
diff --git a/httemplate/docs/admin.html b/httemplate/docs/admin.html
new file mode 100755
index 000000000..50beafe78
--- /dev/null
+++ b/httemplate/docs/admin.html
@@ -0,0 +1,81 @@
+<head>
+ <title>Administration</title>
+</head>
+<body>
+ <h1>Administration</h1>
+</body>
+<ul>
+ <li>Open up the root of the Freeside document tree in your web
+ browser. For example, if you created the Freeside document tree in
+ /home/httpd/html/freeside, and your web browser's DocumentRoot is
+ /home/httpd/html, open https://your_host/freeside/. Replace
+ "your_host" with the name or network address of your web server.
+ <li>Select <u>Configuration</u> from the main menu and update your configuration values.
+ <li>Next you must create a service definition. An example of a service
+ definition would be a dial-up account or a domain. First, it is
+ necessary to create a domain definition. Click on <u>View/Edit service
+ definitions</u> and <u>Add a new service definition</u> with <i>Table</i>
+ <b>svc_domain</b> (and no modifiers).
+
+ <li>Now that you have created your first service, you must create a package
+ including this service which you can sell to customers. Zero, one, or many
+ services are bundled into a package. Click on <u>View/Edit package
+ definitions</u> and <u>Add a new package definition</u> which includes
+ quantity <b>1</b> of the svc_domain service you created above.
+
+ <li>After you create your first package, then you must define who is
+ able to sell that package by creating an agent type. An example of
+ an agent type would be an internal sales representitive which sells
+ regular and promotional packages, as opposed to an external sales
+ representitive which would only sell regular packages of services. Click on
+ <u>View/Edit agent types</u> and <u>Add a new agent type</u>. Allow this
+ agent type to sell the package you created above.
+
+ <li>After creating a new agent type, you must create an agent. Click on
+ <u>View/Edit agents</u> and <u>Add a new agent</u>.
+
+ <li>Set up at least one Advertising source. Advertising sources will help
+ you keep track of how effective your advertising is, tracking where customers
+ heard of your service offerings. You must create at least one advertising
+ source. If you do not wish to use the referral functionality, simply create
+ a single advertising source only. Click on <u>View/Edit advertising
+ sources</u> and <u>Add a new advertising source</u>.
+
+ <li>Click on <u>New Customer</u> and create a new customer for your system
+ accounts with billing type <b>Complimentary</b>.
+
+ <li>From the Customer View screen of the newly created customer, order the
+ package you defined above.
+
+ <li>From the Package View screen of the newly created package, choose
+ <u>(Provision)</u> to add the customer's service for this new package.
+
+ <li>Add your own domain.
+
+ <li>Go back to <u>View/Edit service definitions</u> on the main menu, and
+ <u>Add a new service definition</u> with <i>Table</i> <b>svc_acct</b>.
+ Select your domain in the <b>domsvc</b> Modifier. Set <b>Fixed</b> to define
+ a service locked-in to this domain, or <b>Default</b> to define a service
+ which may select from among this domain and the customer's domains.
+
+ <li><table><tr>
+ <td> Create at least POP (Point of Presence) by selecting
+ <u>View/Edit POPs</u> from the main menu.</td>
+ <th align="left"> OR </th>
+ <td>If you are not doing dialup, set slipip to fixed and blank for all your
+ Service Definitions which have Table <b>svc_acct</b>.</td>
+ </tr></table>
+
+ <li>If you are using Freeside to keep track of sales taxes, define tax
+ information for your locales by clicking on the <u>View/Edit locales and tax
+ rates</b> on the main menu.
+
+ <li>If you would like Freeside to notify your customers when their credit
+ cards and other billing arrangements are about to expire, arrange for
+ <b>freeside-expiration-alerter</b> to be run daily by cron or similar
+ facility. The message it sends can be configured from the
+ <u>Configuration</u> choice of the main menu as <u>alerter_template</u>.
+
+</ul>
+</body>
+</html>
diff --git a/httemplate/docs/billing.html b/httemplate/docs/billing.html
new file mode 100644
index 000000000..c78a87f04
--- /dev/null
+++ b/httemplate/docs/billing.html
@@ -0,0 +1,54 @@
+<head>
+ <title>Billing</title>
+</head>
+<body>
+ <h1>Billing</h1>
+ <ul>
+ <li>You can bill individual customers by clicking on the <i>Bill now</i> link on the main customer view.
+ <li>The <a href="man/bin/freeside-daily.html"><b>freeside-daily</b></a> script should be run daily to bill customers and run invoice collection events.
+ <li>Real-time credit card processing: Install the <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> module for your processor. Configure the <a href="../config/config-view.cgi#business-onlinepayment">business-onlinepayment</a> configuration option. Disable the default <b>Batch card</b> <a href="../browse/part_bill_event.cgi">invoice event</a> and add one for Business::OnlinePayment.
+ <li>Optional: Credit card expiration alerts: Customize <a href="../config/config.cgi#alerter_template">alerter_template</a> configuration option and run <a href="man/bin/freeside-expiration-alerter.html">freeside-expiration-alerter</a> daily.
+ <li>Credit card decline alerts: Customize the <a href="../config/config.cgi#declinetemplate">declinetemplate</a> configuration option and set the <a href="../config/config.cgi#emaildecline">emaildecline</a> configuration option.
+ <li>Optional: Invoice template customization
+ <ul>
+ <li>See the <a href="http://search.cpan.org/doc/MJD/Text-Template-1.42/Template.pm">Text::Template</a> documentation for details on the substitution language.
+ <li>You <b>must</b> call the invoice_lines() function at least once - pass it a number of lines, and it returns a list of array references, each of two elements: a service description column, and a price column. Alternatively, call invoice_lines() with no arguments, and pagination will be disabled - all invoice line items will print on one page, with no padding (recommended for email invoices).
+ <li>In addition, the following variables are available:
+ <ul>
+ <li>$invnum - invoice number
+ <li>$date - as a UNIX timestamp (see <a href="http://search.cpan.org/doc/GBARR/TimeDate-1.09/lib/Date/Format.pm">Date::Format</a> for conversion functions).
+ <li>$page - current page
+ <li>$total_pages - total pages
+ <li>@address - A six-element array containing the customer name, company, and address.
+<!-- <li>$overdue - true if this invoice is overdue -->
+ </ul>
+ </ul>
+ <li>Batch credit card processing
+ <ul>
+ <li>After <a href="man/bin/freeside-daily.html"><b>freeside-daily</b></a> is run, a credit card batch will be in the <a href="schema.html#cust_pay_batch">cust_pay_batch</a> table. Export this table to your credit card batching.
+ <li>When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the <a href="schema.html#cust_pay">cust_pay</a> table. Example code to add payments is:
+ <pre>use FS::cust_pay;
+
+# loop over all records in batch
+
+my $payment=create FS::cust_pay (
+ 'invnum' => $invnum,
+ 'paid' => $paid,
+ '_date' => $_date,
+ 'payby' => $payby,
+ 'payinfo' => $payinfo,
+ 'paybatch' => $paybatch,
+);
+
+my $error=$payment->insert;
+if ( $error ) {
+ #process error
+}
+
+# end loop
+</pre>
+All fields except paybatch are contained in the cust_pay_batch table. You can use paybatch field to track particular batches and/or particular transactions within a batch.
+ </ul>
+<!-- <li>The <a href="man/bin/freeside-print-batch.html"><b>freeside-print-batch</b></a> script can print or email pending credit card batches for manual entry. -->
+ </ul>
+</body>
diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html
new file mode 100644
index 000000000..9caf3bb3a
--- /dev/null
+++ b/httemplate/docs/config.html
@@ -0,0 +1,36 @@
+<head>
+ <title>Configuration files</title>
+</head>
+<body>
+ <h1>Configuration files</h1>
+<font size="+1" color="#ff0000">Configuration is now done by the top-level Makefile and web interface. The instructions below are no longer necessary.</font>
+<ul>
+ <li>Create the <b>/usr/local/etc/freeside</b> directory to hold your configuration.
+ <li>Setting up <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache user authetication</a> is mandatory.
+ <li>Create the <b>/usr/local/etc/freeside/mapsecrets</b> file, which maps Apache users to a secrets file which contains a DBI data source, username and password. Every
+line in <b>/usr/local/etc/freeside/mapsecrets</b> should contain a username and
+filename, separated by whitespace. Note that these are not local usernames -
+they are passed from Apache. <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">
+Apache user authetication</a> is mandatory. For example, if you had the Apache users admin,
+john, and sam,
+you mapsecrets file might look like:
+<pre>
+admin secretfile
+john secretfile
+sam secretfile
+</pre>
+ <li>Next, the filename(s) referenced in <b>/usr/local/etc/freeside/mapsecrets</b> file should be created in the <b>/usr/local/etc/freeside/</b> directory. Each file contains three lines: <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI data source</a> (for example,
+ <tt>DBI:mysql:freeside</tt> or <tt>DBI:Pg:host=localhost;dbname=freeside</tt>), database username, and database password.
+ These files should not be world readable. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.20/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD">manpage for your DBD</a> for the exact syntax of a DBI data source. In a normal installation such as the example above, a single file <b>/usr/local/etc/freeside/secretfile</b> would be created - for example:
+<pre>
+DBI:Pg:host=localhost;dbname=freeside
+dbusername
+dbpassword
+</pre>
+<li>Create the <b>/usr/local/etc/freeside/conf.<i>datasource</i></b> directory, for example, <b>/usr/local/etc/freeside/conf.DBI:Pg:host=localhost;dbname=freeside</b> (remember to backslash-escape the ; character when creating directories in the shell:
+<pre>mkdir&nbsp;/usr/local/etc/freeside/conf.DBI:Pg:host=localhost\;dbname=freeside
+</pre>
+<li>The rest of the configuration can be done with the web interface. Select <u>Configuration</u> from the main menu and update your configuration values.
+</ul>
+</body>
+</html>
diff --git a/httemplate/docs/export.html b/httemplate/docs/export.html
new file mode 100755
index 000000000..71e3acf1f
--- /dev/null
+++ b/httemplate/docs/export.html
@@ -0,0 +1,55 @@
+<head>
+ <title>File exporting</title>
+</head>
+<body>
+ <h1>File exporting</h1>
+ <font size="+2">NOTE: This file is OUT OF DATE with the landing of the new export code and is only here for reference. DO NOT follow these instructions. Instead use the new exports in the web interface.</font>
+ <ul>
+ <li>bin/svc_acct.export will create UNIX <b>passwd</b>, <b>shadow</b> and <b>master.passwd</b> files, ERPCD <b>acp_passwd</b> and <b>acp_dialup</b> files and a RADIUS <b>users</b> file in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Some RADIUS servers (such as <a href="http://www.open.com.au/radiator/">Radiator</a>, <a href="ftp://ftp.cheapnet.net/pub/icradius/">ICRADIUS</a> and <a href="http://www.freeradius.org/">FreeRADIUS</a>) will authenticate directly out of an SQL database. In these cases,
+it is reccommended that you replicate (<a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">Replication in MySQL</a>) the data to an external RADIUS machine or point icradius_secrets to the external machine rather than running the RADIUS server on your Freeside machine. Using the appropriate <a href="../config/config-view.cgi">configuration settings</a>, you can export these files to your remote machines unattended:
+ <ul>
+ <li>shellmachines - <b>passwd</b> and <b>shadow</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/shadow.new</b> and then moved to <b>/etc/passwd</b> and <b>/etc/shadow</b> if no errors occur.
+ <li>bsdshellmachines - <b>passwd</b> and <b>master.passwd</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/master.passwd.new</b> and moved to <b>/etc/passwd</b> and <b>/etc/master.passwd</b> if no errors occur.
+ <li>nismachines - <b>passwd</b> and <b>shadow</b> are copied to the <b>/etc/global</b> directory on the remote machine. If no errors occur, the command <b>( cd /var/yp; make; )</b> is executed on the remote machine.
+ <li>erpcdmachines - <b>acp_passwd</b> and <b>acp_dialup</b> are copied to the <b>/usr/annex</b> directory on the remote machine. If no errors occur, the command <b>( kill -USR1 `cat /usr/annex/erpcd.pid` )</b> is executed on the remote machine.
+ <li>radiusmachines - <b>users</b> is copied to the <b>/etc/raddb</b> directory on the remote machine. If no errors occur, the command <b>( builddbm )</b> is executed on the remote machine.
+ <li>icradiusmachines - Turn this option on to enable radcheck table population - by default in the Freeside database, or in the database specified by the <a href="http://rootwood.haze.st/aspside/config/config-view.cgi#icradius_secrets">icradius_secrets</a> config option (the radcheck table needs to be created manually). You do not need to use MySQL for your Freeside database to export to an ICRADIUS/FreeRADIUS MySQL database with this option. <blockquote><b>ADDITIONAL DEPRECATED FUNCTIONALITY</b> (instead use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or point icradius_secrets to the external database) - your <a href="ftp://ftp.cheapnet.net/pub/icradius">ICRADIUS</a> machines or <a href="http://www.freeradius.org/">FreeRADIUS</a> (with MySQL authentication) machines, one per line. Machines listed in this file will have the radcheck table exported to them. Each line should contain four items, separted by whitespace: machine name, MySQL database name, MySQL username, and MySQL password. For example: <CODE>"radius.isp.tld&nbsp;radius_db&nbsp;radius_user&nbsp;passw0rd"</CODE></blockquote>
+ </ul>
+ <li>svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below.
+ <ul>
+ <li>Account creation - If the <b>username</b>, <b>uid</b> and <b>dir</b> fields are defined for a new user, the command(s) specified in the <a href="../config/config-view.cgi#shellmachine-useradd">shellmachine-useradd</a> configuration file are executed on shellmachine via ssh. If this file does not exist, <code>useradd -d $dir -m -s $shell -u $uid $username</code> is the default. If the file exists but is empty, <code>cp -pr /etc/skel $dir; chown -R $uid.$gid $dir</code> is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code>, <code>$uid</code>, <code>$gid</code>, <code>$dir</code>, and <code>$shell</code>.
+ <li>Account deletion - The command(s) specified in the <a href="../config/config-view.cgi#shellmachine-userdel">shellmachine-userdel</a> configuration file are executed on shellmachine via ssh. If this file does not exist, <code>userdel $username</code> is the default. If the file exists but is empty, <code>rm -rf $dir</code> is the default instead. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$username</code> and <code>$dir</code>.
+ <li>Account modification - If a user's home directory changes, the command(s) specified in the <a href="../config/config-view.cgi#shellmachine-usermod">shellmachine-usermod</a> configuration file are execute on shellmachine via ssh. If this file does not exist or is empty, <code>[ -d $old_dir ] &amp;&amp; mv $old_dir $new_dir || ( chmod u+t $old_dir; mkdir $new_dir; cd $old_dir; find . -depth -print | cpio -pdm $new_dir; chmod u-t $new_dir; chown -R $uid.$gid $new_dir; rm -rf $old_dir )</code> is the default. Otherwise the contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$old_dir</code>, <code>$new_dir</code>, <code>$uid</code> and <code>$gid</code>.
+ </ul>
+ <li>svc_acct.pm - <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a> integration, enabled by the <a href="../config/config-view.cgi#cyrus">cyrus configuration file</a>
+ <ul>
+ <li>Account creation - (Cyrus::IMAP::Admin should be installed locally)
+ <li>Account deletion - (Cyrus::IMAP::Admin should be installed locally)
+ <li>Account modification - (not yet implemented)
+ </ul>
+ <li>bin/svc_acct_sm.export will create <a href="http://www.qmail.org">Qmail</a> <b>rcpthosts</b>, <b>recipientmap</b> and <b>virtualdomains</b> files and <a href="http://www.sendmail.org">Sendmail</a> <b>virtusertable</b> and <b>sendmail.cw</b> files in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Using the appropriate <a href="../config/config-view.cgi">configuration files</a>, you can export these files to your remote machines unattemded:
+ <ul>
+ <li>qmailmachines - <b>recipientmap</b>, <b>virtualdomains</b> and <b>rcpthosts</b> are copied to the <b>/var/qmail/control</b> directory on the remote machine. Note: If you <a href="legacy.html#svc_acct_sm">imported</a> qmail configuration files, run the generated <b>/usr/local/etc/freeside/export.<i>datasrc</i>/virtualdomains.FIX</b> on a machine with your user home directories before exporting qmail configuration files.
+ <li>shellmachine - The command <b>[ -e <i>homedir</i>/.qmail-default ] || { touch <i>homedir</i>/.qmail-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-default; }</b> will be run on this machine for users in the virtualdomains file.
+ <li>sendmailmachines - <b>sendmail.cw</b> and <b>virtusertable</b> are copied to the remote machine as <b>/etc/sendmail.cw.new</b> and <b>/etc/virtusertable.new</b>. If no errors occur, they are moved to <b>/etc/sendmail.cw</b> and <b>/etc/virtusertable</b> and the command specified in the <a href="../config/config-view.cgi#sendmailrestart">sendmailrestart</a> configuration file is executed. (The path can be changed from the default <b>/etc</b> with the <a href="../config/config-view.cgi#sendmailconfigpath">sendmailconfigpath</a> configuration file.)
+ </ul>
+ <li>svc_domain.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user <b>.qmail-</b> files can be updated for catchall mailboxes.
+ <ul>
+ <li>The command <pre>[ -e <i>homedir</i>/.qmail-<i>domain</i>-default ] || {
+ touch <i>homedir</i>/.qmail-<i>domain</i>-default;
+ chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-<i>domain</i>-default;
+}</pre> is run.
+ </ul>
+ <li>svc_forward.pm - Not yet documented; see manpage.
+ <li>svc_www.pm - Not yet documented; see manpage.
+ </ul>
+ <br><a name=ssh>Unattended remote login</a> - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. <b>Do not use this feature unless you understand what you are doing!</b>
+ <ul>
+ <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, use a blank passphrase.
+ <li>Append the newly-created <code>identity.pub</code> file to <code>~root/.ssh/authorized_keys</code> on the remote machine(s).
+ <li>Some new SSH v2 implementation accept v2 style keys only. Use the <code>-t</code> option to <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>, and append the created <code>id_dsa.pub</code> or <code>id_rsa.pub</code> to <code>~root/.ssh/authorized_keys2</code> on the remote machine(s).
+ <li>You may need to set <code>PermitRootLogin without-password</code> (meaning with keys only) in your <code>sshd_config</code> file on the remote machine(s).
+ </ul>
+
+</body>
+
diff --git a/httemplate/docs/index.html b/httemplate/docs/index.html
new file mode 100644
index 000000000..b57b06feb
--- /dev/null
+++ b/httemplate/docs/index.html
@@ -0,0 +1,29 @@
+<head>
+ <title>Documentation</title>
+</head>
+<body bgcolor="#ffffff">
+ <h1>Documentation</h1>
+<img src="overview.png">
+<ul>
+ <li><a href="install.html">New Installation</a>
+ <li><a href="upgrade7.html">Upgrading from 1.3.0 to 1.3.1</a>
+ <li><a href="upgrade8.html">Upgrading from 1.3.1 to 1.4.0</a>
+ <li><a href="upgrade9.html">Upgrading from 1.4.0 to 1.4.1</a>
+ <li><a href="upgrade10.html">Upgrading from 1.4.1 (or 1.4.2?) to 1.5.0</a>
+<!--
+ <li><a href="config.html">Configuration files</a>
+!-->
+ <li><a href="admin.html">Administration</a>
+<!--
+ <li><a href="../index.html#admin">Administration</a>
+!-->
+ <li><a href="legacy.html">Importing legacy data</a>
+ <li><a href="export.html">File exporting and remote setup</a>
+ <li><a href="passwd.html">fs_passwd</a>
+ <li><a href="signup.html">Signup server</a>
+ <li><a href="session.html">Session monitor</a>
+ <li><a href="billing.html">Billing</a>
+ <li><a href="schema.html">Schema reference</a>
+ <li><a href="man/FS.html">Perl API</a>
+</ul>
+</body>
diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html
new file mode 100644
index 000000000..54614ccb3
--- /dev/null
+++ b/httemplate/docs/install.html
@@ -0,0 +1,206 @@
+<head>
+ <title>Installation</title>
+</head>
+<body>
+<h1>Installation</h1>
+Before installing, you need:
+<ul>
+ <li><a href="http://www.perl.com/">Perl</a> Don't enable experimental features like threads or the PerlIO abstraction layer.
+ <li><a href="http://www.apache.org">Apache</a> (<a href="http://www.modssl.org/">mod_ssl</a> or <a href="http://www.apache-ssl.org">Apache-SSL</a> highly recommended)
+ <li><a href="http://perl.apache.org/">mod_perl</a> (if compiling your own mod_perl, make sure you set the <a href="http://perl.apache.org/guide/install.html#EVERYTHING">EVERYTHING</a>=1 compile-time option)
+ <li><a href="http://www.openssh.com/">SSH</a> (<a href="http://www.openssh.com//">OpenSSH</a> is recommended. SSH Communications Security <a href="http://www.ssh.com/products/ssh/download.cfm">commercial SSH version 3</a> has been reported incompatible with Freeside.)
+ <li><a href="http://rsync.samba.org/">rsync</a>
+ <li>A <b>transactional</b> database engine <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">supported</a> by Perl's <a href="http://dbi.perl.org">DBI</a>.
+ <ul>
+ <li><a href="http://www.postgresql.org/">PostgreSQL</a> is recommended (v7or later).
+ <li><a href="http://www.mysql.com/">MySQL</a> <b>MINIMUM VERSION 4.1</b> is untested but may work. Versions before 4.1 do not support standard SQL subqueries and are <b>NOT SUPPORTED</b>. If you are a developer who wishes to contribute MySQL 3.x/4.0 support, see <a href="http://pouncequick.420.am/rt/Ticket/Display.html?id=438">ticket #438</a> in the bug-tracking system and ask on the -devel mailing list.
+<!-- <li>MySQL has been reported to work. -->
+ <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are not supported</b>. If you want to use MySQL, you <b>must</b> use one of the new <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a> or <a href="http://www.mysql.com/doc/I/n/InnoDB.html">InnoDB</a>, and set it as the default table type using the <code>--default-table-type=BDB</code> or <code>--default-table-type=InnoDB</code> <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Command-line_options">mysqld command-line option</a> or by setting <code>default-table-type=BDB</code> or <code>default-table-type=InnoDB</code> in the <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Option_files">my.cnf option file</a>.
+ </ul>
+ <li>Perl modules (<a href="http://theoryx5.uwinnipeg.ca/CPAN/perl/CPAN.html">CPAN</a> will query, download and build perl modules automatically)
+ <ul>
+<!-- <li><a href="http://search.cpan.org/search?dist=Array-PrintCols">Array-PrintCols</a>
+ <li><a href="http://search.cpan.org/search?dist=Term-Query">Term-Query</a> (make test broken; install manually) -->
+ <li><a href="http://search.cpan.org/search?dist=MIME-Base64">MIME-Base64</a>
+ <li><a href="http://search.cpan.org/search?dist=Digest-MD5">Digest-MD5</a>
+<!-- <li><a href="http://search.cpan.org/search?dist=MD5">MD5</a> -->
+ <li><a href="http://search.cpan.org/search?dist=URI">URI</a>
+ <li><a href="http://search.cpan.org/search?dist=HTML-Tagset">HTML-Tagset</a>
+ <li><a href="http://search.cpan.org/search?dist=HTML-Parser">HTML-Parser</a>
+ <li><a href="http://search.cpan.org/search?dist=libnet">libnet</a>
+ <li><a href="http://search.cpan.org/search?dist=Locale-Codes">Locale-Codes</a>
+ <li><a href="http://search.cpan.org/search?dist=Net-Whois">Net-Whois</a>
+ <li><a href="http://search.cpan.org/search?dist=libwww-perl">libwww-perl</a>
+ <li><a href="http://search.cpan.org/search?dist=Business-CreditCard">Business-CreditCard</a>
+<!-- <li><a href="http://search.cpan.org/search?dist=Data-ShowTable">Data-ShowTable</a> -->
+ <li><a href="http://search.cpan.org/search?dist=MailTools">MailTools</a>
+ <li><a href="http://search.cpan.org/search?dist=TimeDate">TimeDate</a>
+ <li><a href="http://search.cpan.org/search?dist=DateManip">DateManip</a>
+ <li><a href="http://search.cpan.org/search?dist=File-CounterFile">File-CounterFile</a>
+ <li><a href="http://search.cpan.org/search?dist=FreezeThaw">FreezeThaw</a>
+ <li><a href="http://search.cpan.org/search?dist=String-Approx">String-Approx</a>
+ <li><a href="http://search.cpan.org/search?dist=Text-Template">Text-Template</a>
+ <li><a href="http://search.cpan.org/search?dist=DBI">DBI</a>
+ <li><a href="http://search.cpan.org/search?mode=module&query=DBD">DBD for your database engine</a> (<a href="http://search.cpan.org/search?dist=DBD-Pg">DBD::Pg</a> for PostgreSQL, <a href="http://search.cpan.org/search?dist=DBD-mysql">DBD::mysql</a> for MySQL)
+ <li><a href="http://search.cpan.org/search?dist=DBIx-DataSource">DBIx-DataSource</a>
+ <li><a href="http://search.cpan.org/search?dist=DBIx-DBSchema">DBIx-DBSchema</a>
+ <li><a href="http://search.cpan.org/search?dist=Net-SSH">Net-SSH</a>
+ <li><a href="http://search.cpan.org/search?dist=String-ShellQuote">String-ShellQuote</a>
+ <li><a href="http://search.cpan.org/search?dist=Net-SCP">Net-SCP</a>
+ <li><a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a>
+ <li><a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a>
+ <li><a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a>
+ <li><a href="http://search.cpan.org/search?dist=HTML-Widgets-SelectLayers">HTML-Widgets-SelectLayers</a>
+ <li><a href="http://search.cpan.org/search?dist=Storable">Storable</a>
+<!-- MyAccounts, maybe only for dev <li><a href="http://search.cpan.org/search?dist=Cache-Cache">Cache::Cache</a> -->
+ <li><a href="http://search.cpan.org/search?dist=NetAddr-IP">NetAddr-IP</a>
+ <li><a href="http://search.cpan.org/search?dist=Chart">Chart</a>
+ <li><a href="http://search.cpan.org/search?dist=ApacheDBI">Apache::DBI</a> <i>(optional but recommended for better webinterface performance)</i>
+ </ul>
+</ul>
+Install the Freeside distribution:
+<ul>
+ <li>Add the user and group `freeside' to your system.
+ <li>Allow the freeside user full access to the freeside database.
+ <ul>
+ <li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>:
+ <pre>
+$ su postgres (pgsql on some distributions)
+$ createuser -P freeside
+Enter password for user "freeside":
+Enter it again:
+Shall the new user be allowed to create databases? (y/n) y
+Shall the new user be allowed to create more new users? (y/n) n
+CREATE USER</pre>
+ <li> with <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#User_Account_Management">MySQL</a>:
+ <pre>
+$ mysqladmin -u root password '<i>set_a_root_database_password</i>'
+$ mysql -u root -p
+mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* TO freeside@localhost IDENTIFIED BY '<i>set_a_freeside_database_password</i>';</pre>
+ </ul>
+<!-- <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre>-->
+ <li>Edit the top-level Makefile:
+ <ul>
+ <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:dbname=freeside</tt> for PostgresSQL or <tt>DBI:mysql:freeside</tt> for MySQL. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">manpage for your DBD</a> for the exact syntax of your DBI data source.
+ <li>Set <tt>DB_PASSWORD</tt> to the freeside database user's password.
+ </ul>
+ <li>Add the freeside database to your database engine:
+ <pre>
+$ su
+# make create-database</pre>
+ (or manually, with Postgres:)
+ <pre>
+$ su freeside
+$ createdb freeside</pre>
+ (with MySQL:)
+ <pre>
+$ mysqladmin -u freeside -p create freeside </pre>
+ <li>Build and install the Perl modules:
+ <pre>
+$ make perl-modules
+$ su
+# make install-perl-modules</pre>
+ <li>Create the necessary configuration files:<pre>
+$ su
+# make create-config
+</pre>
+ <li>Run a <b>separate</b> iteration of Apache[-SSL] with mod_perl enabled <b>as the freeside user</b>.
+</ul>
+<table>
+ <tr>
+ <th>Apache::ASP</th><th>Mason</th>
+ </tr>
+ <tr>
+ <td><ul>
+ <li>Run <tt>make aspdocs</tt>
+ <li>Copy <tt>aspdocs/</tt> to your web server's document space:
+<font size="-1"><pre>
+cp&nbsp;aspdocs&nbsp;/usr/local/apache/htdocs/freeside-asp
+</pre></font>
+ <li>Create a <a href="http://www.apache-asp.org/config.html#Global">Global</a> directory, such as <tt>/usr/local/etc/freeside/asp-global/</tt>:
+<font size="-1"><pre>
+mkdir&nbsp;/usr/local/etc/freeside/asp-global/
+chown&nbsp;freeside&nbsp;/usr/local/etc/freeside/asp-global/
+</pre></font>
+ <li>Copy <tt>htetc/global.asa</tt> to the Global directory:
+<font size="-1"><pre>
+cp&nbsp;htetc/global.asa&nbsp;/usr/local/etc/freeside/asp-global/global.asa
+</pre></font>
+ <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example:
+<font size="-1"><pre>
+PerlModule Apache::ASP
+&lt;Directory&nbsp;/usr/local/apache/htdocs/freeside-asp&gt;
+&lt;Files ~ (\.cgi)&gt;
+AddHandler perl-script .cgi
+PerlHandler Apache::ASP
+&lt;/Files&gt;
+&lt;Perl&gt;
+$MLDBM::RemoveTaint = 1;
+&lt;/Perl&gt;
+PerlSetVar&nbsp;Global&nbsp;/usr/local/etc/freeside/asp-global/
+PerlSetVar Debug 2
+&lt;/Directory&gt;
+</pre></font>
+ </ul></td>
+ <td><ul>
+ <li>Run <tt>make masondocs</tt>
+ <li>Copy <tt>masondocs/</tt> to your web server's document space. (For example: <tt>/usr/local/apache/htdocs/freeside-mason</tt>)
+ <li>Copy <tt>htetc/handler.pl</tt> to <tt>/usr/local/etc/freeside</tt> (use htetc/handler.pl-1.0x for Mason versions before 1.10).
+ <li>Edit <tt>handler.pl</tt> and:
+ <ul>
+ <li> set an appropriate <tt>comp_root</tt>, such as <tt>/usr/local/apache/htdocs/freeside-mason</tt>
+ <li> set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/masondata</tt>
+ </ul>
+
+ <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example:
+<font size="-1"><pre>
+PerlModule HTML::Mason
+&lt;Directory&nbsp;/usr/local/apache/htdocs/freeside-mason&gt;
+&lt;Files ~ (\.cgi)&gt;
+AddHandler perl-script .cgi
+PerlHandler HTML::Mason
+&lt;/Files&gt;
+&lt;Perl&gt;
+require&nbsp;"/usr/local/etc/freeside/handler.pl";
+&lt;/Perl&gt;
+&lt;/Directory&gt;
+</pre></font>
+ </ul></td>
+ </tr>
+</table>
+<ul>
+<li>Restrict access to this web interface - see the <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache documentation on user authentication</a>. For example, to configure user authentication with <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files):
+<pre>
+&lt;Directory /usr/local/apache/htdocs/freeside-asp&gt;
+AuthName Freeside
+AuthType Basic
+AuthUserFile /usr/local/etc/freeside/htpasswd
+require valid-user
+&lt;/Directory&gt;
+</pre>
+ <li>Create one or more Freeside users (your internal sales/tech folks, not customer accounts). These users are setup using using Apache authentication, not UNIX user accounts. For example, using <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files):
+ <ul>
+ <li>First user:<font size="-1">
+<pre>$ su
+$ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -c -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font>
+ <li>Additional users:<font size="-1">
+<pre>$ su
+$ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font>
+ </ul>
+ <i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> and then run: <tt>freeside-adduser <b>username</b></tt></i>
+ <li>As the freeside UNIX user, run <tt>freeside-setup <b>username</b></tt> to create the database tables, passing the username of a Freeside user you created above:
+<pre>
+$ su freeside
+$ freeside-setup <b>username</b>
+</pre>
+ Alternately, use the -s option to enable shipping addresses: <tt>freeside-setup -s <b>username</b></tt>
+ <li>As the freeside UNIX user, run <tt>bin/populate-msgcat <b>username</b></tt> (in the untar'ed freeside directory) to populate the message catalog, passing the username of a Freeside user you created above:
+<pre>
+$ su freeside
+$ cd <b>/path/to/freeside/</b>
+$ bin/populate-msgcat <b>username</b>
+</pre>
+ <li><tt>freeside-queued</tt> was installed with the Perl modules. Start it now and ensure that is run upon system startup (Do this manually, or edit the top-level Makefile, replacing INIT_FILE with the appropriate location on your systemand QUEUED_USER with the username of a Freeside user you created above, and run <tt>make install-init</tt>)
+ <li>Now proceed to the initial <a href="admin.html">administration</a> of your installation.
+</ul>
+</body>
diff --git a/httemplate/docs/legacy.html b/httemplate/docs/legacy.html
new file mode 100755
index 000000000..678780962
--- /dev/null
+++ b/httemplate/docs/legacy.html
@@ -0,0 +1,39 @@
+<head>
+ <title>Importing legacy data</title>
+</head>
+<body>
+ <h1>Importing legacy data</h1>
+<font size="+2">In most cases, legacy data import all cases will require writing custom code to deal with your particular legacy data. The example scripts here will not work "out-of-the-box". Importing your legacy data will most probably involve some hacking on the example scripts noted below. Contributions to the import process are welcome.</font>
+<br><br><i>Some import scripts may require installation of the <a href="http://search.cpan.org/search?dist=Array-PrintCols">Array-PrintCols</a> and <a href="http://search.cpan.org/search?dist=Term-Query">Term-Query</a> (make test broken; install manually) modules.</i><br>
+<ul>
+ <li><a name="bind">bin/bind.import</a> - Import domain information from BIND named
+ <li><a name="passwd">bin/passwd.import</a> - Just import `passwd' and `shadow' or `master.passwd', no RADIUS import.
+ <li><a name="svc_acct">bin/svc_acct.import</a> - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need <a href="../browse/part_svc.cgi">services</a> (with table svc_acct) as follows:
+ <ul>
+ <li>Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1)
+ <li>Some accounts have entries in passwd and users, but with Port-Limit 2 (or more)
+ <li>Some accounts might have entries in users only (Port-Limit 1)
+ <li>Some accounts might have entries in users only (Port-Limit >= 2)
+ <li>POP mail accounts have entries in passwd only, and have a particular shell.
+ <li>Everything else in passwd is a shell account.
+ </ul>
+<!-- <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="../browse/part_svc.cgi">services</a> as follows:
+ <ul>
+ <li>Domain (table svc_acct)
+ <li>Mail alias (table svc_acct_sm)
+ </ul>
+-->
+ <li><a name="cust_main">Importing customer data</a>
+ <ul>
+ <li>Manually
+ <ul>
+ <li>Add a <a href="../edit/cust_main.cgi">new customer</a>
+ <li>Add one or more packages for this customer
+ <li>Enter a package by clicking on the package number
+ <li>Pick the `Link to existing' option
+ </ul>
+ <li>Batch - You will need to write a script to import your particular legacy data. You can use eg/TEMPLATE_cust_main.import as a starting point.
+ </ul>
+</ul>
+</body>
+
diff --git a/httemplate/docs/man/FS/part_export/.cvs_is_on_crack b/httemplate/docs/man/FS/part_export/.cvs_is_on_crack
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/httemplate/docs/man/FS/part_export/.cvs_is_on_crack
diff --git a/httemplate/docs/overview.dia b/httemplate/docs/overview.dia
new file mode 100644
index 000000000..a0e34c30e
--- /dev/null
+++ b/httemplate/docs/overview.dia
Binary files differ
diff --git a/httemplate/docs/overview.png b/httemplate/docs/overview.png
new file mode 100644
index 000000000..bf2dbc26c
--- /dev/null
+++ b/httemplate/docs/overview.png
Binary files differ
diff --git a/httemplate/docs/passwd.html b/httemplate/docs/passwd.html
new file mode 100755
index 000000000..fc1dde956
--- /dev/null
+++ b/httemplate/docs/passwd.html
@@ -0,0 +1,23 @@
+<head>
+ <title>fs_passwd</title>
+</head>
+<body>
+ <h1>fs_passwd</h1>
+You may use fs_passwd/fs_passwd as a "passwd", "chfn" and "chsh" replacement on your shell machine(s) to cause password, gecos and shell changes to update your freeside machine. You can also use the fs_passwd/fs_passwd.html and fs_passwd/fs_passwd.cgi to run a public password change CGI on a public web server. This can pose a security risk if not configured correctly. <b>Do not use this feature unless you understand what you are doing!</b>
+<br><br>Currently it is assumed that the the crypt(3) function in the C library is the same on the Freeside machine as on the target machine.
+<ul>
+ <li>Create a freeside account on the shell or web machine(s).
+ <li>Setup SSH keys:
+ <ul>
+ <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, use a blank passphrase.
+ <li>Append the newly-created <code>identity.pub</code> file to <code>~freeside
+/.ssh/authorized_keys</code> on the shell or web machine(s).
+ <li>Some new SSH v2 implementation accept v2 style keys only. Use the <code>-t</code> option to <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>, and append the created <code>id_dsa.pub</code> or <code>id_rsa.pub</code> to <code>~freeside/.ssh/authorized_keys2</code> on the remote machine(s).
+ </ul>
+ <li>Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell or web machine(s). (chown freeside, chmod 500)
+ <li>Create /usr/local/freeside on the shell or web machine(s). (chown freeside, chmod 700)
+ <li>Run an iteration of "fs_passwd/fs_passwd_server <i>user</i> shell.machine" as the freeside user for each shell or web machine (this is a daemon process). <i>user</i> refers to a freeside user added by <a href="man/bin/freeside-adduser.html">freeside-adduser</a>.
+ <li>Copy fs_passwd/fs_passwd to /usr/local/bin on the shell machine(s). (chown freeside, chmod 4755). You may link it to passwd, chfn and chsh as well.
+ <li>Copy fs_passwd/fs_passwd.cgi to the cgi-bin directory on your web machine(s). Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perldoc.com/perl5.6.1/pod/perlsec.html">suidperl</a> to run fs_passwd.cgi as the freeside user.
+</ul>
+</body>
diff --git a/httemplate/docs/schema.dia b/httemplate/docs/schema.dia
new file mode 100644
index 000000000..746561550
--- /dev/null
+++ b/httemplate/docs/schema.dia
Binary files differ
diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html
new file mode 100644
index 000000000..a59755e76
--- /dev/null
+++ b/httemplate/docs/schema.html
@@ -0,0 +1,427 @@
+<head>
+ <title>Schema reference</title>
+</head>
+<body>
+ <h1>Schema reference</h1>
+ Schema diagram: <a href="schema.png">as a giant .png</a> or <a href="schema.dia">dia source</a> (<a href="http://www.lysator.liu.se/~alla/dia/">dia homepage</a>).
+ <ul>
+ <li><a name="agent" href="man/FS/agent.html">agent</a> - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type).
+ <ul>
+ <li>agentnum - primary key
+ <li>agent - name of this agent
+ <li>typenum - <a href="#agent_type">agent type</a>
+ <li>prog - (unimplemented)
+ <li>freq - (unimplemented)
+ </ul>
+ <li><a name="agent_type" href="man/FS/agent_type.html">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents.
+ <ul>
+ <li>typenum - primary key
+ <li>atype - name of this agent type
+ </ul>
+ <li><a name="cust_bill" href="man/FS/cust_bill.html">cust_bill</a> - Invoices. Declarations that a customer owes you money. The specific charges are itemized in <a href="#cust_bill_pkg">cust_bill_pkg</a>.
+ <ul>
+ <li>invnum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>_date
+ <li>charged - amount of this invoice
+ <li>printed - how many times this invoice has been printed automatically
+ <li>closed - books closed flag, empty or `Y'
+ </ul>
+ <li><a name="cust_bill_event" href="man/FS/cust_bill_event.html">cust_bill_event</a> - Invoice event history
+ <ul>
+ <li>eventnum - primary key
+ <li>invnum - <a href="#cust_bill">invoice</a>
+ <li>eventpart - <a href="#part_bill_event">event definition</a>
+ <li>_date
+ <li>status
+ <li>statustext
+ </ul>
+ <li><a name="part_bill_event" href="man/FS/part_bill_event.html">part_bill_event</a> - Invoice event definitions
+ <ul>
+ <li>eventpart - primary key
+ <li>payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
+ <li>event - event name
+ <li>eventcode - event action
+ <li>seconds - how long after the invoice date (<a href="#cust_bill">cust_bill</a>._date) events of this type are triggered
+ <li>weight - ordering for events with identical seconds
+ <li>plan - eventcode plan
+ <li>plandata - additional plan data
+ <li>disabled - Disabled flag, empty or `Y'
+ <li>taxclass - Texas tax class flag, empty or "none", "access", or "hosting"
+ </ul>
+ <li><a name="cust_bill_pkg" href="man/FS/cust_bill_pkg.html">cust_bill_pkg</a> - Invoice line items
+ <ul>
+ <li>invnum - (multiple) key
+ <li>pkgnum - <a href="#cust_pkg">package</a> or 0 for the special virtual sales tax package
+ <li>setup - setup fee
+ <li>recur - recurring fee
+ <li>sdate - starting date
+ <li>edate - ending date
+ <li>itemdesc - Line item description (currently used only when pkgnum is 0)
+ </ul>
+ <li><a name="cust_bill_pkg_detail" href="man/FS/cust_bill_pkg_detail.html">cust_bill_pkg_detail</a> - Invoice line items detail
+ <ul>
+ <li>detailnum - primary key
+ <li>pkgnum -
+ <li>invnum -
+ <li>detail - Detail description
+ </ul>
+ <li><a name="cust_credit" href="man/FS/cust_credit.html">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record.
+ <ul>
+ <li>crednum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>amount - amount credited
+ <li>_date
+ <li>otaker - order taker
+ <li>reason
+ <li>closed - books closed flag, empty or `Y'
+ </ul>
+ <li><a name="cust_credit_bill" href="man/FS/cust_credit_bill.html">cust_credit_bill</a> - Credit invoice application. Links a credit to an invoice.
+ <ul>
+ <li>creditbillnum - primary key
+ <li>crednum - <a href="#cust_credit">credit</a> being applied
+ <li>invnum - <a href="#cust_bill">invoice</a> to which credit is applied
+ <li>amount - amount applied
+ <li>_date
+ </ul>
+ <li><a name="cust_main" href="man/FS/cust_main.html">cust_main</a> - Customers
+ <ul>
+ <li>custnum - primary key
+ <li>agentnum - <a href="#agent">agent</a>
+ <li>refnum - <a href="#part_referral">referral</a>
+ <li>first - name
+ <li>last - name
+ <li>ss - social security number
+ <li>company
+ <li>address1
+ <li>address2
+ <li>city
+ <li>county
+ <li>state
+ <li>zip
+ <li>country
+ <li>daytime - phone
+ <li>night - phone
+ <li>fax - phone
+ <li><i>ship_first</i>
+ <li><i>ship_last</i>
+ <li><i>ship_company</i>
+ <li><i>ship_address1</i>
+ <li><i>ship_address2</i>
+ <li><i>ship_city</i>
+ <li><i>ship_county</i>
+ <li><i>ship_state</i>
+ <li><i>ship_zip</i>
+ <li><i>ship_country</i>
+ <li><i>ship_daytime</i>
+ <li><i>ship_night</i>
+ <li><i>ship_fax</i>
+ <li>payby - CARD, DCHK, CHEK, DCHK, LECB, BILL, or COMP
+ <li>payinfo - card number, P.O.#, or comp issuer
+ <li>paydate - expiration date
+ <li>payname - billing name (name on card)
+ <li>tax - tax exempt, Y or null
+ <li>otaker - order taker
+ <li>referral_custnum
+ <li>comments
+ </ul>
+ (columns in <i>italics</i> are optional)
+ <li><a name="cust_main_invoice" href="man/FS/cust_main_invoice.html">cust_main_invoice</a> - Invoice destinations for email invoices. Note that a customer can have many email destinations for their invoice (either literal or via svcnum), but only one postal destination.
+ <ul>
+ <li>destnum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>dest - Invoice destination. Freeside supports three types of invoice delivery: send directly to a service defined in Freeside, send to an arbitrary email address, or print the invoice to a printer and have someone send it out via snail mail. Freeside determines which method to use based on the contents of the dest field. If the contents are numeric, a <a href="#svc_acct">svcnum</a> pointing to a valid service is expected in the field. If the contents are a string, a literal email address is expected to be in the field. If the special keyword `POST' is present, the snail mail method is used (which is the default if no cust_main_invoice records exist). Snail mail invoices get their address information from <A name="#cust_main">cust_main</A> and are printed with the printer defined in the configuration files.
+ </ul>
+ <li><a name="cust_main_county" href="man/FS/cust_main_county.html">cust_main_county</a> - Tax rates
+ <ul>
+ <li>taxnum - primary key
+ <li>state
+ <li>county
+ <li>country
+ <li>tax - % rate
+ <li>taxclass
+ <li>exempt_amount
+ <li>taxname - if defined, printed on invoices instead of "Tax"
+ </ul>
+ <li><a name="cust_tax_exempt" href="man/FS/cust_tax_exempt.html">cust_tax_exempt</a> - Tax exemption record
+ <ul>
+ <li>exemptnum - primary key
+ <li>taxnum - <a href="#cust_main_county">tax rate</a>
+ <li>year
+ <li>month
+ <li>amount
+ </ul>
+ <li><a name="cust_pay" href="man/FS/cust_pay.html">cust_pay</a> - Payments. Money being transferred from a customer.
+ <ul>
+ <li>paynum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>paid - amount
+ <li>_date
+ <li>payby - CARD, CHEK, LECB, BILL, or COMP
+ <li>payinfo - card number, P.O.#, or comp issuer
+ <li>paybatch - text field for tracking card processor batches
+ <li>closed - books closed flag, empty or `Y'
+ </ul>
+ <li><a name="cust_bill_pay" href="man/FS/cust_bill_pay.html">cust_bill_pay</a> - Applicaton of a payment to a specific invoice.
+ <ul>
+ <li>billpaynum
+ <li>invnum - <a href="#cust_bill">invoice</a>
+ <li>paynum - <a href="#cust_pay">payment</a>
+ <li>amount
+ <li>_date
+ </ul>
+ <li><a name="cust_pay_batch" href="man/FS/cust_pay_batch.html">cust_pay_batch</a> - Pending batch
+ <ul>
+ <li>paybatchnum
+ <li>cardnum
+ <li>exp - card expiration
+ <li>amount
+ <li>invnum - <a href="#cust_bill">invoice</a>
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>payname - name on card
+ <li>first - name
+ <li>last - name
+ <li>address1
+ <li>address2
+ <li>city
+ <li>state
+ <li>zip
+ <li>country
+ </ul>
+ <li><a name="cust_pkg" href="man/FS/cust_pkg.html">cust_pkg</a> - Customer billing items
+ <ul>
+ <li>pkgnum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>pkgpart - <a href="#part_pkg">Package definition</a>
+ <li>setup - date
+ <li>bill - next bill date
+ <li>last_bill - last bill date
+ <li>susp - (past) suspension date
+ <li>expire - (future) cancellation date
+ <li>cancel - (past) cancellation date
+ <li>otaker - order taker
+ <li>manual_flag - If this field is set to 1, disables the automatic unsuspensiond of this package when using the <a href="config.html#unsuspendauto">unsuspendauto</a> config file.
+ </ul>
+ <li><a name="cust_refund" href="man/FS/cust_refund.html">cust_refund</a> - Refunds. The transfer of money to a customer; equivalent to a negative <a href="#cust_pay">cust_pay</a> record.
+ <ul>
+ <li>refundnum - primary key
+ <li>custnum - <a href="#cust_main">customer</a>
+ <li>refund - amount
+ <li>_date
+ <li>payby - CARD, CHEK, LECB, BILL or COMP
+ <li>payinfo - card number, P.O.#, or comp issuer
+ <li>otaker - order taker
+ <li>closed - books closed flag, empty or `Y'
+ </ul>
+ <li><a name="cust_credit_refund" href="man/FS/cust_credit_refund.html">cust_credit_refund</a> - Applicaton of a refund to a specific credit.
+ <ul>
+ <li>creditrefundnum - primary key
+ <li>crednum - <a href="#cust_credit">credit</a>
+ <li>refundnum - <a href="#cust_refund">refund</a>
+ <li>amount
+ <li>_date
+ </ul>
+ <li><a name="cust_svc" href="man/FS/cust_svc.html">cust_svc</a> - Customer services
+ <ul>
+ <li>svcnum - primary key
+ <li>pkgnum - <a href="#cust_pkg">package</a>
+ <li>svcpart - <a href="#part_svc">Service definition</a>
+ </ul>
+ <li><a name="nas" href="man/FS/nas.html">nas</a> - Network Access Server (terminal server)
+ <ul>
+ <li>nasnum - primary key
+ <li>nas - NAS name
+ <li>nasip - NAS ip address
+ <li>nasfqdn - NAS fully-qualified domain name
+ <li>last - timestamp indicating the last instant the NAS was in a known state (used by the session monitoring).
+ </ul>
+ <li><a name="part_pkg" href="man/FS/part_pkg.html">part_pkg</a> - Package definitions
+ <ul>
+ <li>pkgpart - primary key
+ <li>pkg - package name
+ <li>comment - non-customer visable package comment
+ <li>setup - setup fee expression
+ <li>freq - recurring frequency (months)
+ <li>recur - recurring fee expression
+ <li>setuptax - Setup fee tax exempt flag, empty or `Y'
+ <li>recurtax - Recurring fee tax exempt flag, empty or `Y'
+ <li>plan - price plan
+ <li>plandata - additional price plan data
+ <li>disabled - Disabled flag, empty or `Y'
+ </ul>
+ <li><a name="part_referral" href="man/FS/part_referral.html">part_referral</a> - Referral listing
+ <ul>
+ <li>refnum - primary key
+ <li>referral - referral
+ </ul>
+ <li><a name="part_svc" href="man/FS/part_svc.html">part_svc</a> - Service definitions
+ <ul>
+ <li>svcpart - primary key
+ <li>svc - name of this service
+ <li>svcdb - table used for this service: svc_acct, svc_forward, svc_domain, svc_charge or svc_wo
+ <li>disabled - Disabled flag, empty or `Y'
+<!-- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
+ <li><i>table</i>__<i>field</i>_flag - null, D or F
+-->
+ </ul>
+ <li><a name="part_svc_column" href="man/FS/part_svc_column.html">part_svc_column</a>
+ <ul>
+ <li>columnnum - primary key
+ <li>svcpart - <a href="#part_svc">Service definition</a>
+ <li>columnname - column name in part_svc.svcdb table
+ <li>columnvalue - default or fixed value for the column
+ <li>columnflag - null, D or F
+ </ul>
+ <li><a name="pkg_svc" href="man/FS/pkg_svc.html">pkg_svc</a>
+ <ul>
+ <li>pkgpart - <a href="#part_pkg">Package definition</a>
+ <li>svcpart - <a href="#part_svc">Service definition</a>
+ <li>quantity - quantity of this service that this package includes
+ </ul>
+ <li><a name="export_svc" href="man/FS/export_svc.html">export_svc</a>
+ <ul>
+ <li>exportsvcnum - primary key
+ <li>svcpart - <a href="#part_svc">Service definition</a>
+ <li>exportnum - <a href="#exportnum">Export</a>
+ </ul>
+ <li><a name="part_export" href="man/FS/part_export.html">part_export</a> - Export to external provisioning
+ <ul>
+ <li>exportnum - primary key
+ <li>machine - Machine name
+ <li>exporttype - Export type
+ <li>nodomain - blank or Y: usernames are exported to this service with no domain
+ </ul>
+ <li><a name="part_export_option" href="man/FS/part_export_option.html">part_export_option</a> - provisioning options
+ <ul>
+ <li>optionnum - primary key
+ <li>exportnum - <a href="#part_export">Export</a>
+ <li>optionname - option name
+ <li>optionvalue - option value
+ </ul>
+ <li><a name="port" href="man/FS/port.html">port</a> - individual port on a <a href="#nas">nas</a>
+ <ul>
+ <li>portnum - primary key
+ <li>ip - IP address of this port
+ <li>nasport - port number on the NAS
+ <li>nasnum - <a href="#nas">NAS</a>
+ </ul>
+ <li><a name="prepay_credit" href="man/FS/prepay_credit.html">prepay_credit</a>
+ <ul>
+ <li>prepaynum - primary key
+ <li>identifier - text or numeric string used to receive this credit
+ <li>amount - amount of credit
+ </ul>
+ <li><a name="session" href="man/FS/session.html">session</a>
+ <ul>
+ <li>sessionnum - primary key
+ <li>portnum - <a href="#port">Port</a>
+ <li>svcnum - <a href="#svc_acct">Account</a>
+ <li>login - timestamp indicating the beginning of this user session.
+ <li>logout - timestamp indicating the end of this user session. May be null, which indicates a currently open session.
+ </ul>
+
+ <li><a name="svc_acct" href="man/FS/svc_acct.html">svc_acct</a> - Accounts
+ <ul>
+ <li>svcnum - <a href="#cust_svc">primary key</a>
+ <li>username
+ <li>_password
+ <li>sec_phrase - security phrase
+ <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
+ <li>uid
+ <li>gid
+ <li>finger - GECOS
+ <li>dir
+ <li>shell
+ <li>quota - (unimplementd)
+ <li>slipip - IP address
+ <li>seconds
+ <li>domsvc
+ <li>radius_<i>Radius_Reply_Attribute</i> - Radius-Reply-Attribute
+ <li>rc_<i>Radius_Check_Attribute</i> - Radius-Check-Attribute
+ </ul>
+ <li><a name="svc_acct_pop" href="man/FS/svc_acct_pop.html">svc_acct_pop</a> - Points of Presence
+ <ul>
+ <li>popnum - primary key
+ <li>city
+ <li>state
+ <li>ac - area code
+ <li>exch - exchange
+ <li>loc - rest of number
+ </ul>
+ <li><a name="part_pop_local" href="man/FS/part_pop_local.html">part_pop_local</a> - Local calling areas
+ <ul>
+ <li>localnum - primary key
+ <li>popnum - primary key
+ <li>city
+ <li>state
+ <li>npa - area code
+ <li>nxx - exchange
+ </ul>
+ <li><a name="svc_domain" href="man/FS/svc_domain.html">svc_domain</a> - Domains
+ <ul>
+ <li>svcnum - <a href="#cust_svc">primary key</a>
+ <li>domain
+ </ul>
+ <li><a name="svc_forward" href="man/FS/svc_forward.html">svc_forward</a> - Mail forwarding aliases
+ <ul>
+ <li>svcnum - <a href="#cust_svc">primary key</a>
+ <li>srcsvc - <a href="#svc_acct">svcnum of the source of this forward</a>
+ <li>dstsvc - <a href="#svc_acct">svcnum of the destination of this forward</a>
+ <li>dst - foreign destination (email address) - forward not local to freeside
+ </ul>
+ <li><a name="domain_record" href="man/FS/domain_record.html">domain_record</a> - Domain zone detail
+ <ul>
+ <li>recnum - primary key
+ <li>svcnum - <a href="#svc_domain">Domain</a> (by svcnum)
+ <li>reczone - zone for this line
+ <li>recaf - address family, usually <b>IN</b>
+ <li>rectype - type for this record (<b>A</b>, <b>MX</b>, etc.)
+ <li>recdata - data for this record
+ </ul>
+ <li><a name="svc_www" href="man/FS/svc_www.html">svc_www</a>
+ <ul>
+ <li>svcnum - <a href="#cust-svc">primary key</a>
+ <li>recnum - <a href="#domain_record">host</a>
+ <li>usersvc - <a href="#svc_acct">account</a>
+ </ul>
+ <li><a name="type_pkgs" href="man/FS/type_pkgs.html">type_pkgs</a>
+ <ul>
+ <li>typenum - <a href="#agent_type">agent type</a>
+ <li>pkgpart - <a href="#part_pkg">Package definition</a>
+ </ul>
+ <li><a name="queue" href="man/FS/queue.html">queue</a> - job queue
+ <ul>
+ <li>jobnum - primary key
+ <li>job
+ <li>_date
+ <li>status
+ <li>statustext
+ <li>svcnum
+ </ul>
+ <li><a name="queue_arg" href="man/FS/queue_arg.html">queue_arg</a> - job arguments
+ <ul>
+ <li>argnum - primary key
+ <li>jobnum - <a href="#queue">job</a>
+ <li>arg - argument
+ </ul>
+ <li><a name="queue_depend" href="man/FS/queue_depend.html">queue_depend</a> - job dependancies
+ <ul>
+ <li>dependnum - primary key
+ <li>jobnum - source jobnum
+ <li>depend_jobnum - dependancy jobnum
+ </ul>
+ <li><a name="radius_usergroup" href="man/FS/radius_usergroup.html">radius_usergroup</a> - Link users to RADIUS groups.
+ <ul>
+ <li>usergroupnum - primary key
+ <li>svcnum - <a href="#svc_acct">account</a>
+ <li>groupname
+ </ul>
+ <li><a name="msgcat" href="man/FS/msgcat.html">msgcat</a> - i18n message catalog
+ <ul>
+ <li>msgnum - primary key
+ <li>msgcode - message code
+ <li>locale - locale
+ <li>msg - Message text
+ </ul>
+ </ul>
+</body>
diff --git a/httemplate/docs/schema.png b/httemplate/docs/schema.png
new file mode 100644
index 000000000..d0392e76f
--- /dev/null
+++ b/httemplate/docs/schema.png
Binary files differ
diff --git a/httemplate/docs/session.html b/httemplate/docs/session.html
new file mode 100644
index 000000000..72e16424e
--- /dev/null
+++ b/httemplate/docs/session.html
@@ -0,0 +1,59 @@
+<head>
+ <title>Session monitor</title>
+</head>
+<body>
+<h1>Session monitor</h1>
+<h2>Installation</h2>
+For security reasons, the client portion of the session montior may run on one
+or more external public machine(s). On these machines, install:
+<ul>
+ <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at l
+east 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.)
+ <li><a href="man/FS/SessionClient.html">FS::SessionClient</a> (copy the fs_session/FS-SessionClient directory to the external machine, then: perl Makefile.PL; make; make install)
+</ul>
+Then:
+<ul>
+ <li>Add the user `freeside' to the the external machine.
+ <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user).
+ <li>touch /usr/local/freeside/fs_sessiond_socket; chown freeside /usr/local/freeside/fs_sessiond_socket; chmod 600 /usr/local/freeside/fs_sessiond_socket
+ <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s).
+ <li>Run <pre>fs_session_server <i>user</i> <i>machine</i></pre> on the Freeside machine.
+ <ul>
+ <li><i>user</i> is a user from the mapsecrets file.
+ <li><i>machine</i> is the name of the external machine.
+ </ul>
+</ul>
+<h2>Usage</h2>
+<ul>
+ <li>Web
+ <ul>
+ <li>Copy FS-SessionClient/cgi/login.cgi and logout.cgi to your web
+ server's document space.
+ <li>Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">setuid</a> (see <a href="install.html">install.html</a> for details) to run login.cgi and logout.cgi as the freeside user.
+ </ul>
+ <li>Command-line
+ <br><pre>freeside-login username ( portnum | ip | nasnum nasport )
+freeside-logout username ( portnum | ip | nasnum nasport )</pre>
+ <ul>
+ <li><i>username</i> is a customer username from the svc_acct table
+ <li><i>portnum</i>, <i>ip</i> or <i>nasport</i> and <i>nasnum</i> uniquely identify a port in the <a href="schema.html#port">port</a> database table.
+ </ul>
+ <li>RADIUS - One of:
+ <ul>
+ <li>Run the <b>freeside-sqlradius-radacctd</b> daemon to import radacct
+ records from all configured sqlradius exports:
+ <tt>freeside-sqlradius-radacctd username</tt>
+ <li>Configure your RADIUS server's login and logout callbacks to use the command-line <tt>freeside-login</tt> and <tt>freeside-logout</tt> utilites.
+ <li> <i>(incomplete)</i>Use the <b>fs_radlog/fs_radlogd</b> tool to
+ import records from a text radacct file.
+ </ul>
+</ul>
+<h2>Callbacks</h2>
+<ul>
+ <li>Sesstion start - The command(s) specified in the <a href="config.html#session-start">session-start</a> configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
+ <li>Session end - The command(s) specified in the <a href="config.html#session-stop">session-stop</a> configuration file are executed on the Freeside machine. The contents of the file are treated as a double-quoted perl string, with the following variables available: <code>$ip</code>, <code>$nasip</code> and <code>$nasfqdn</code>, which are the IP address of the starting session, and the IP address and fully-qualified domain name of the NAS this session is on.
+</ul>
+<h2>Dropping expired users</h2>
+Run <pre>bin/freeside-session-kill username</pre> periodically from cron.
+</body>
+</html>
diff --git a/httemplate/docs/signup.html b/httemplate/docs/signup.html
new file mode 100644
index 000000000..5168f47d6
--- /dev/null
+++ b/httemplate/docs/signup.html
@@ -0,0 +1,56 @@
+<head>
+ <title>Signup server</title>
+</head>
+<body>
+ <h1>Signup server</h1>
+For security reasons, the signup server should run on an external public
+webserver. On this machine, install:
+<ul>
+ <li>A web server, such as <a href="http://www.apache-ssl.org">Apache-SSL</a> or <a href="http://www.apache.org">Apache</a>
+ <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a>
+ <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at least 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.)
+ <li><a href="http://search.cpan.org/search?dist=Text-Template">Text::Template</a>
+ <li><a href="http://search.cpan.org/search?dist=Storable">Storable</a>
+ <li><a href="http://search.cpan.org/search?dist=Business-CreditCard">Business-CreditCard</a>
+ <li><a href="http://www.sisd.com/useragent">HTTP::Headers::UserAgent</a> (version 2.0 or higher; not yet indexed correctly on CPAN)
+
+ <li><a href="man/FS/SignupClient.html">FS::SignupClient</a> (copy the fs_signup/FS-SignupClient directory to the external machine, then: perl Makefile.PL; make; make install)
+</ul>
+Then:
+<ul>
+ <li>Add the user `freeside' to the the external machine.
+ <li>Copy or symlink fs_signup/FS-SignupClient/cgi/signup.cgi into the web server's document space.
+ <li>When linking to signup.cgi, you can include a referring custnum in the URL as follows: <code>http://public.web.server/path/signup.cgi?ref=1542</code>
+ <li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>)
+ <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user).
+ <li>touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket
+ <li>Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">setuid</a> (see <a href="install.html">install.html</a> for details) to run signup.cgi as the freeside user.
+ <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s).
+ <li>Run <pre>fs_signup_server <i>user</i> <i>machine</i> <i>agentnum</i> <i>refnum</i></pre> on the Freeside machine.
+ <ul>
+ <li><i>user</i> is a user from the mapsecrets file.
+ <li><i>machine</i> is the name of the external machine.
+ <li><i>agentnum</i> and <i>refnum</i> are the <a href="schema.html#agent">agent</a> and <a href="schema.html#part_referral">referral</a>, respectively, to use for customers who sign up via this signup server.
+ </ul>
+</ul>
+Optional:
+<ul>
+ <li>If you create a <b>/usr/local/freeside/ieak.template</b> file on the external machine, it will be sent to IE users with MIME type <i>application/x-Internet-signup</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the variables listed below available.
+ (an example file is included as <b>fs_signup/ieak.template</b>) See the <a href="http://www.microsoft.com/windows/ieak/techinfo/deploy/60/en/toc.asp">IEAK documentation</a> for more information.
+ <li>If you create a <b>/usr/local/freeside/cck.template</b> file on the external machine, the variables defined will be sent to Netscape users with MIME type <i>application/x-netscape-autoconfigure-dialer-v2</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the variables listed below available.
+ (an example file is included as <b>fs_signup/cck.template</b>). See the <a href="http://help.netscape.com/products/client/mc/acctproc4.html">Netscape documentation</a> for more information.
+ <li>If you create a <b>/usr/local/freeside/success.html</b> file on the external machine, it will be used as the success HTML page. Although template substiutions are available, a regular HTML file will work fine here, unlike signup.html. An example file is included as <b>fs_signup/FS-SignupClient/cgi/success.html</b>
+ <li>Variable substitutions available in <b>ieak.template</b>, <b>cck.template</b> and <b>success.html</b>:
+ <ul>
+ <li>$ac - area code of selected POP
+ <li>$exch - exchange of selected POP
+ <li>$loc - local part of selected POP
+ <li>$username
+ <li>$password
+ <li>$email_name - first and last name
+ <li>$pkg - package name
+ </ul>
+ <li>If you create a <b>/usr/local/freeside/signup.html</b> file on the external machine, it will be used as a template for the form HTML. This requires the template to be constructed appropriately; probably best to start with the example file included as <b>fs_signup/FS-SignupClient/cgi/signup.html</b>.
+ <li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, and/or the time specified in the <b>seconds</b> column (for use with the <a href="session.html">session monitor</a>), after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups. The <i>bin/generate-prepay</i> script can be used to populate the <i>prepay_credit</i> table.
+</ul>
+</body>
diff --git a/httemplate/docs/ssh.html b/httemplate/docs/ssh.html
new file mode 100755
index 000000000..d2c501e35
--- /dev/null
+++ b/httemplate/docs/ssh.html
@@ -0,0 +1,16 @@
+<head>
+ <title>Unattended SSH</title>
+</head>
+<body>
+ <h1>Unattended SSH</h1>
+ <br><a name=ssh>Unattended remote login</a> - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. <b>Do not use this feature unless you understand what you are doing!</b>
+ <ul>
+ <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, use a blank passphrase.
+ <li>Append the newly-created <code>identity.pub</code> file to <code>~root/.ssh/authorized_keys</code> (or the appopriate <code>~username/.ssh/authorized_keys</code>) on the remote machine(s).
+ <li>Some new SSH v2 implementation accept v2 style keys only. Use the <code>-t</code> option to <a href="http://www.tac.eu.org/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>, and append the created <code>id_dsa.pub</code> or <code>id_rsa.pub</code> to <code>~root/.ssh/authorized_keys2</code> (or the appopriate <code>~username/.ssh/authorized_keys</code>) on the remote machine(s).
+ <li>You may need to set <code>PermitRootLogin without-password</code> (meaning with keys only) in your <code>sshd_config</code> file on the remote machine(s).
+ <li>You may want to set <code>ForwardX11 = no</code> in <code>~root/.ssh/config</code> to prevent spurious errors if your distribution turns on X11 forwarding by default.
+ </ul>
+
+</body>
+
diff --git a/httemplate/docs/trouble.html b/httemplate/docs/trouble.html
new file mode 100755
index 000000000..fce743928
--- /dev/null
+++ b/httemplate/docs/trouble.html
@@ -0,0 +1,26 @@
+<head>
+ <title>Troubleshooting</title>
+</head>
+<body>
+ <h1>Troubleshooting</h1>
+ <ul>
+ <li>When troubleshooting the web interface, helpful information is often in your web server's error log.
+ <li>If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL.
+ <li>If you get tons of errors in your web server's error log like this:
+<pre>
+Ambiguous use of value => resolved to "value" =>
+at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132.
+</pre>
+ This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile.
+ <li>If you get errors like this:
+<pre>
+UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied
+at <i>/your/path</i>/site_perl/FS/UID.pm line 26.
+BEGIN failed--compilation aborted at
+<i>/your/path</i>/edit/process/part_svc.cgi line 15.
+</pre>
+ Then the scripts are not running as the freeside freeside user. See
+the <a href="install.html">New Installation</a> section of the documentation.
+ <li>If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the <a href="http://www.mysql.com/Manual_chapter/manual_Problems.html#Can_not_connect_to_server">MySQL documentation</a>, DBI manpage and the DBD::mysql manpage for details.
+ </ul>
+</body>
diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html
new file mode 100644
index 000000000..1035510db
--- /dev/null
+++ b/httemplate/docs/upgrade10.html
@@ -0,0 +1,120 @@
+<pre>
+this is incomplete
+
+install DBIx::DBSchema 0.21
+
+install NetAddr::IP and Chart::Base
+
+CREATE TABLE cust_bill_pkg_detail (
+ detailnum serial,
+ pkgnum int NOT NULL,
+ invnum int NOT NULL,
+ detail varchar(80),
+ PRIMARY KEY (detailnum)
+);
+CREATE INDEX cust_bill_pkg_detail1 ON cust_bill_pkg_detail ( pkgnum, invnum );
+
+CREATE TABLE router (
+ routernum serial,
+ routername varchar(80),
+ svcnum int,
+ PRIMARY KEY (routernum)
+);
+
+CREATE TABLE part_svc_router (
+ svcpart int NOT NULL,
+ routernum int NOT NULL
+);
+
+CREATE TABLE part_router_field (
+ routerfieldpart serial,
+ name varchar(80),
+ length int NOT NULL,
+ check_block text,
+ list_source text,
+ PRIMARY KEY (routerfieldpart)
+);
+
+CREATE TABLE router_field (
+ routerfieldpart int NOT NULL,
+ routernum int NOT NULL,
+ value varchar(128)
+);
+CREATE UNIQUE INDEX router_field1 ON router_field ( routerfieldpart, routernum );
+
+CREATE TABLE addr_block (
+ blocknum serial,
+ routernum int NOT NULL,
+ ip_gateway varchar(15) NOT NULL,
+ ip_netmask int NOT NULL,
+ PRIMARY KEY (blocknum)
+);
+CREATE UNIQUE INDEX addr_block1 ON addr_block ( blocknum, routernum );
+
+CREATE TABLE part_sb_field (
+ sbfieldpart serial,
+ svcpart int NOT NULL,
+ name varchar(80) NOT NULL,
+ length int NOT NULL,
+ check_block text NULL,
+ list_source text NULL,
+ PRIMARY key (sbfieldpart)
+);
+CREATE UNIQUE INDEX part_sb_field1 ON part_sb_field ( sbfieldpart, svcpart );
+
+CREATE TABLE sb_field (
+ sbfieldpart int NOT NULL,
+ svcnum int NOT NULL,
+ value varchar(128)
+);
+CREATE UNIQUE INDEX sb_field1 ON sb_field ( sbfieldpart, svcnum );
+
+CREATE TABLE svc_broadband (
+ svcnum int NOT NULL,
+ blocknum int NOT NULL,
+ speed_up int NOT NULL,
+ speed_down int NOT NULL,
+ ip_addr varchar(15),
+ PRIMARY KEY (svcnum)
+);
+
+DELETE INDEX cust_bill_pkg1;
+
+ALTER TABLE cust_bill_pkg ADD itemdesc varchar(80) NULL;
+ALTER TABLE h_cust_bill_pkg ADD itemdesc varchar(80) NULL;
+ALTER TABLE cust_main_county ADD taxname varchar(80) NULL;
+ALTER TABLE h_cust_main_county ADD taxname varchar(80) NULL;
+ALTER TABLE cust_pkg ADD last_bill int NULL;
+ALTER TABLE h_cust_pkg ADD last_bill int NULL;
+
+dump database, edit:
+- cust_main: increase otaker from 8 to 32
+- cust_main: change ss from char(11) to varchar(11)
+- cust_credit: increase otaker from 8 to 32
+- cust_pkg: increase otaker from 8 to 32
+- cust_refund: increase otaker from 8 to 32
+- domain_record: increase reczone from 80 to 255
+- domain_record: change rectype from char to varchar
+- domain_record: increase recdata from 80 to 255
+then reload
+
+optionally:
+
+ CREATE INDEX cust_main6 ON cust_main ( daytime );
+ CREATE INDEX cust_main7 ON cust_main ( night );
+ CREATE INDEX cust_main8 ON cust_main ( fax );
+ CREATE INDEX cust_main9 ON cust_main ( ship_daytime );
+ CREATE INDEX cust_main10 ON cust_main ( ship_night );
+ CREATE INDEX cust_main11 ON cust_main ( ship_fax );
+
+ serial columns
+
+mandatory again:
+
+dbdef-create username
+create-history-tables username cust_bill_pkg_detail router part_svc_router part_router_field router_field addr_block part_sb_field sb_field svc_broadband
+dbdef-create username
+
+
+
+</pre>
diff --git a/httemplate/docs/upgrade7.html b/httemplate/docs/upgrade7.html
new file mode 100644
index 000000000..d9dcfe2ae
--- /dev/null
+++ b/httemplate/docs/upgrade7.html
@@ -0,0 +1,24 @@
+<head>
+ <title>Upgrading to 1.3.1</title>
+</head>
+<body>
+<h1>Upgrading to 1.3.1 from 1.3.0</h1>
+<ul>
+ <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
+ <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
+ <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
+ <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first.
+ <li>If migrating from less than 1.2.3, see these <a href="upgrade5.html">instructions</a> first.
+ <li>If migrating from less than 1.3.0, see these <a href="upgrade6.html">instructions</a> first.
+ <li>Back up your data and current Freeside installation.
+ <li>Copy or symlink htdocs to the new copy.
+ <li>Change to the FS directory in the new tarball, and build and install the
+ Perl modules:
+ <pre>
+$ cd FS/
+$ perl Makefile.PL
+$ make
+$ su
+# make install UNINST=1</pre>
+ <li>Run bin/dbdef-create.
+</body>
diff --git a/httemplate/docs/upgrade8.html b/httemplate/docs/upgrade8.html
new file mode 100644
index 000000000..cf60a8582
--- /dev/null
+++ b/httemplate/docs/upgrade8.html
@@ -0,0 +1,392 @@
+<head>
+ <title>Upgrading to 1.4.0</title>
+</head>
+<body>
+<h1>Upgrading to 1.4.0 from 1.3.1</h1>
+<ul>
+ <li>If migrating from less than 1.3.1, see these <a href="upgrade7.html">instructions</a> first.
+ <li><font size="+2" color="#ff0000">Backup your database and current Freeside installation.</font> (with&nbsp;<a href="http://www.ca.postgresql.org/devel-corner/docs/postgres/backup.html">PostgreSQL</a>) (with&nbsp;<a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Backup">MySQL</a>)
+ <li><a href="http://perl.apache.org/">mod_perl</a> is now required.
+ <li>Install <a href="http://search.cpan.org/search?dist=Time-Duration">Time-Duration</a>, <a href="http://search.cpan.org/search?dist=Tie-IxHash">Tie-IxHash</a> and <a href="http://search.cpan.org/search?dist=HTML-Widgets-SelectLayers">HTML-Widgets-SelectLayers</a> (minimum version 0.02).
+ <li>Install <a href="http://www.apache-asp.org/">Apache::ASP</a> or <a href="http://www.masonhq.com/">HTML::Mason</a> (use version 1.0x - Freeside is not yet compatible with version 1.1x).
+ <li>Install <a href="http://rsync.samba.org/">rsync</a>
+</ul>
+<table>
+ <tr>
+ <th>Apache::ASP</th><th>Mason</th>
+ </tr>
+ <tr>
+ <td><ul>
+ <li>Run <tt>make aspdocs</tt>
+ <li>Copy <tt>aspdocs/</tt> to your web server's document space.
+ <li>Create a <a href="http://www.apache-asp.org/config.html#Global">Global</a> directory, such as <tt>/usr/local/etc/freeside/asp-global/</tt>
+ <li>Copy <tt>htetc/global.asa</tt> to the Global directory.
+ <li>Configure Apache for the Global directory and to execute .cgi files using Apache::ASP. For example:
+<font size="-1"><pre>
+&lt;Directory /usr/local/apache/htdocs/freeside-asp&gt;
+&lt;Files ~ (\.cgi)&gt;
+AddHandler perl-script .cgi
+PerlHandler Apache::ASP
+&lt;/Files&gt;
+&lt;Perl&gt;
+$MLDBM::RemoveTaint = 1;
+&lt;/Perl&gt;
+PerlSetVar Global /usr/local/etc/freeside/asp-global/
+&lt;/Directory&gt;
+</pre></font>
+ </ul></td>
+ <td><ul>
+ <li>(use version 1.0x - Freeside is not yet compatible with version 1.1x)
+ <li>Run <tt>make masondocs</tt>
+ <li>Copy <tt>masondocs/</tt> to your web server's document space.
+ <li>Copy <tt>htetc/handler.pl</tt> to your web server's configuration directory.
+ <li>Edit <tt>handler.pl</tt> and set an appropriate <tt>data_dir</tt>, such as <tt>/usr/local/etc/freeside/mason-data</tt>
+ <li>Configure Apache to use the <tt>handler.pl</tt> file and to execute .cgi files using HTML::Mason. For example:
+<font size="-1"><pre>
+&lt;Directory /usr/local/apache/htdocs/freeside-mason&gt;
+&lt;Files ~ (\.cgi)&gt;
+AddHandler perl-script .cgi
+PerlHandler HTML::Mason
+&lt;/Files&gt;
+&lt;Perl&gt;
+require "/usr/local/apache/conf/handler.pl";
+&lt;/Perl&gt;
+&lt;/Directory&gt;
+</pre></font>
+ </ul></td>
+ </tr>
+</table>
+<ul>
+ <li>Build and install the Perl modules:
+ <pre>
+$ su
+# make install-perl-modules</pre>
+ <li>Apply the following changes to your database:
+<pre>
+CREATE TABLE svc_forward (
+ svcnum int NOT NULL,
+ srcsvc int NOT NULL,
+ dstsvc int NOT NULL,
+ dst varchar(80),
+ PRIMARY KEY (svcnum)
+);
+ALTER TABLE part_svc ADD svc_forward__srcsvc varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_forward__srcsvc_flag char(1) NULL;
+ALTER TABLE part_svc ADD svc_forward__dstsvc varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_forward__dstsvc_flag char(1) NULL;
+ALTER TABLE part_svc ADD svc_forward__dst varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_forward__dst_flag char(1) NULL;
+
+CREATE TABLE cust_credit_bill (
+ creditbillnum int primary key,
+ crednum int not null,
+ invnum int not null,
+ _date int not null,
+ amount decimal(10,2) not null
+);
+
+CREATE TABLE cust_bill_pay (
+ billpaynum int primary key,
+ invnum int not null,
+ paynum int not null,
+ _date int not null,
+ amount decimal(10,2) not null
+);
+
+CREATE TABLE cust_credit_refund (
+ creditrefundnum int primary key,
+ crednum int not null,
+ refundnum int not null,
+ _date int not null,
+ amount decimal(10,2) not null
+);
+
+CREATE TABLE part_svc_column (
+ columnnum int primary key,
+ svcpart int not null,
+ columnname varchar(64) not null,
+ columnvalue varchar(80) null,
+ columnflag char(1) null
+);
+
+CREATE TABLE queue (
+ jobnum int primary key,
+ job text not null,
+ _date int not null,
+ status varchar(80) not null,
+ statustext text null,
+ svcnum int null
+);
+CREATE INDEX queue1 ON queue ( svcnum );
+CREATE INDEX queue2 ON queue ( status );
+
+CREATE TABLE queue_arg (
+ argnum int primary key,
+ jobnum int not null,
+ arg text null
+);
+CREATE INDEX queue_arg1 ON queue_arg ( jobnum );
+
+CREATE TABLE queue_depend (
+ dependnum int primary key,
+ jobnum int not null,
+ depend_jobnum int not null
+);
+CREATE INDEX queue_depend1 ON queue_depend ( jobnum );
+CREATE INDEX queue_depend2 ON queue_depend ( depend_jobnum );
+
+CREATE TABLE part_pop_local (
+ localnum int primary key,
+ popnum int not null,
+ city varchar(80) null,
+ state char(2) null,
+ npa char(3) not null,
+ nxx char(3) not null
+);
+CREATE UNIQUE INDEX part_pop_local1 ON part_pop_local ( npa, nxx );
+
+CREATE TABLE cust_bill_event (
+ eventnum int primary key,
+ invnum int not null,
+ eventpart int not null,
+ _date int not null
+);
+CREATE UNIQUE INDEX cust_bill_event1 ON cust_bill_event ( eventpart, invnum );
+CREATE INDEX cust_bill_event2 ON cust_bill_event ( invnum );
+
+CREATE TABLE part_bill_event (
+ eventpart int primary key,
+ payby char(4) not null,
+ event varchar(80) not null,
+ eventcode text null,
+ seconds int null,
+ weight int not null,
+ plan varchar(80) null,
+ plandata text null,
+ disabled char(1) null
+);
+CREATE INDEX part_bill_event1 ON part_bill_event ( payby );
+
+CREATE TABLE export_svc (
+ exportsvcnum int primary key,
+ exportnum int not null,
+ svcpart int not null
+);
+CREATE UNIQUE INDEX export_svc1 ON export_svc ( exportnum, svcpart );
+CREATE INDEX export_svc2 ON export_svc ( exportnum );
+CREATE INDEX export_svc3 ON export_svc ( svcpart );
+
+CREATE TABLE part_export (
+ exportnum int primary key,
+ machine varchar(80) not null,
+ exporttype varchar(80) not null,
+ nodomain char(1) NULL
+);
+CREATE INDEX part_export1 ON part_export ( machine );
+CREATE INDEX part_export2 ON part_export ( exporttype );
+
+CREATE TABLE part_export_option (
+ optionnum int primary key,
+ exportnum int not null,
+ optionname varchar(80) not null,
+ optionvalue text NULL
+);
+CREATE INDEX part_export_option1 ON part_export_option ( exportnum );
+CREATE INDEX part_export_option2 ON part_export_option ( optionname );
+
+CREATE TABLE radius_usergroup (
+ usergroupnum int primary key,
+ svcnum int not null,
+ groupname varchar(80) not null
+);
+CREATE INDEX radius_usergroup1 ON radius_usergroup ( svcnum );
+CREATE INDEX radius_usergroup2 ON radius_usergroup ( groupname );
+
+CREATE TABLE msgcat (
+ msgnum int primary key,
+ msgcode varchar(80) not null,
+ locale varchar(16) not null,
+ msg text not null
+);
+CREATE INDEX msgcat1 ON msgcat ( msgcode, locale );
+
+CREATE TABLE cust_tax_exempt (
+ exemptnum int primary key,
+ custnum int not null,
+ taxnum int not null,
+ year int not null,
+ month int not null,
+ amount decimal(10,2)
+);
+CREATE UNIQUE INDEX cust_tax_exempt1 ON cust_tax_exempt ( taxnum, year, month );
+
+ALTER TABLE svc_acct ADD domsvc integer NULL;
+ALTER TABLE part_svc ADD svc_acct__domsvc varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_acct__domsvc_flag char(1) NULL;
+ALTER TABLE svc_domain ADD catchall integer NULL;
+ALTER TABLE cust_main ADD referral_custnum integer NULL;
+ALTER TABLE cust_main ADD comments text NULL;
+ALTER TABLE cust_pay ADD custnum integer;
+ALTER TABLE cust_pay_batch ADD paybatchnum integer;
+ALTER TABLE cust_refund ADD custnum integer;
+ALTER TABLE cust_pkg ADD manual_flag char(1) NULL;
+ALTER TABLE part_pkg ADD plan varchar(80) NULL;
+ALTER TABLE part_pkg ADD plandata text NULL;
+ALTER TABLE part_pkg ADD setuptax char(1) NULL;
+ALTER TABLE part_pkg ADD recurtax char(1) NULL;
+ALTER TABLE part_pkg ADD disabled char(1) NULL;
+ALTER TABLE part_svc ADD disabled char(1) NULL;
+ALTER TABLE cust_bill ADD closed char(1) NULL;
+ALTER TABLE cust_pay ADD closed char(1) NULL;
+ALTER TABLE cust_credit ADD closed char(1) NULL;
+ALTER TABLE cust_refund ADD closed char(1) NULL;
+ALTER TABLE cust_bill_event ADD status varchar(80);
+ALTER TABLE cust_bill_event ADD statustext text NULL;
+ALTER TABLE svc_acct ADD sec_phrase varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_acct__sec_phrase varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_acct__sec_phrase_flag char(1) NULL;
+ALTER TABLE part_pkg ADD taxclass varchar(80) NULL;
+ALTER TABLE cust_main_county ADD taxclass varchar(80) NULL;
+ALTER TABLE cust_main_county ADD exempt_amount decimal(10,2);
+CREATE INDEX cust_main3 ON cust_main ( referral_custnum );
+CREATE INDEX cust_credit_bill1 ON cust_credit_bill ( crednum );
+CREATE INDEX cust_credit_bill2 ON cust_credit_bill ( invnum );
+CREATE INDEX cust_bill_pay1 ON cust_bill_pay ( invnum );
+CREATE INDEX cust_bill_pay2 ON cust_bill_pay ( paynum );
+CREATE INDEX cust_credit_refund1 ON cust_credit_refund ( crednum );
+CREATE INDEX cust_credit_refund2 ON cust_credit_refund ( refundnum );
+CREATE UNIQUE INDEX cust_pay_batch_pkey ON cust_pay_batch ( paybatchnum );
+CREATE UNIQUE INDEX part_svc_column1 ON part_svc_column ( svcpart, columnname );
+CREATE INDEX cust_pay2 ON cust_pay ( paynum );
+CREATE INDEX cust_pay3 ON cust_pay ( custnum );
+CREATE INDEX cust_pay4 ON cust_pay ( paybatch );
+</pre>
+
+ <li>If you are using PostgreSQL, apply the following changes to your database:
+<pre>
+CREATE UNIQUE INDEX agent_pkey ON agent ( agentnum );
+CREATE UNIQUE INDEX agent_type_pkey ON agent_type ( typenum );
+CREATE UNIQUE INDEX cust_bill_pkey ON cust_bill ( invnum );
+CREATE UNIQUE INDEX cust_credit_pkey ON cust_credit ( crednum );
+CREATE UNIQUE INDEX cust_main_pkey ON cust_main ( custnum );
+CREATE UNIQUE INDEX cust_main_county_pkey ON cust_main_county ( taxnum );
+CREATE UNIQUE INDEX cust_main_invoice_pkey ON cust_main_invoice ( destnum );
+CREATE UNIQUE INDEX cust_pay_pkey ON cust_pay ( paynum );
+CREATE UNIQUE INDEX cust_pkg_pkey ON cust_pkg ( pkgnum );
+CREATE UNIQUE INDEX cust_refund_pkey ON cust_refund ( refundnum );
+CREATE UNIQUE INDEX cust_svc_pkey ON cust_svc ( svcnum );
+CREATE UNIQUE INDEX domain_record_pkey ON domain_record ( recnum );
+CREATE UNIQUE INDEX nas_pkey ON nas ( nasnum );
+CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg ( pkgpart );
+CREATE UNIQUE INDEX part_referral_pkey ON part_referral ( refnum );
+CREATE UNIQUE INDEX part_svc_pkey ON part_svc ( svcpart );
+CREATE UNIQUE INDEX port_pkey ON port ( portnum );
+CREATE UNIQUE INDEX prepay_credit_pkey ON prepay_credit ( prepaynum );
+CREATE UNIQUE INDEX session_pkey ON session ( sessionnum );
+CREATE UNIQUE INDEX svc_acct_pkey ON svc_acct ( svcnum );
+CREATE UNIQUE INDEX svc_acct_pop_pkey ON svc_acct_pop ( popnum );
+CREATE UNIQUE INDEX svc_acct_sm_pkey ON svc_acct_sm ( svcnum );
+CREATE UNIQUE INDEX svc_domain_pkey ON svc_domain ( svcnum );
+CREATE UNIQUE INDEX svc_www_pkey ON svc_www ( svcnum );
+</pre>
+ <li>If you wish to enable service/shipping addresses, apply the following
+ changes to your database:
+<pre>
+ALTER TABLE cust_main ADD COLUMN ship_last varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_first varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_company varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_address1 varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_address2 varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_city varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_county varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_state varchar(80) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_zip varchar(10) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_country char(2) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_daytime varchar(20) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_night varchar(20) NULL;
+ALTER TABLE cust_main ADD COLUMN ship_fax varchar(12) NULL;
+CREATE INDEX cust_main4 ON cust_main ( ship_last );
+CREATE INDEX cust_main5 ON cust_main ( ship_company );
+</pre>
+ <li>If you are using the signup server, reinstall it according to the <a href="signup.html">instructions</a>. The 1.3.x signup server is not compatible with 1.4.x.
+ <li>Run <tt>bin/dbdef-create <i>username</i></tt>
+ <li>If you have svc_acct_sm records or service definitions:
+ <ul>
+ <li>Create a service definition with table svc_forward
+ <li>Run <tt>bin/fs-migrate-svc_acct_sm <i>username</i></tt>
+ </ul>
+ <li>Or if you just have svc_acct records:
+ <ul>
+ <li>Order and provision a package for your default domain and note down the <b>Service #</b> or <i>svcnum</i>.
+ <li><tt>UPDATE svc_acct SET domsvc = </tt><i>svcnum</i>
+ <li>Update your service definitions to have default (or fixed) <b>domsvc</b>.
+ </ul>
+ <li>Run <tt>bin/fs-migrate-payref<i>username</i></tt>
+ <li>Run <tt>bin/fs-migrate-part_svc<i>username</i></tt>
+ <li><b>After running bin/fs-migrate-payref</b>, apply the following changes to your database:
+ <table border><tr><th>PostgreSQL</th><th>MySQL, others</th></tr>
+<tr><td>
+<font size=-1><pre>
+CREATE TABLE cust_pay_temp (
+ paynum int primary key,
+ custnum int not null,
+ paid decimal(10,2) not null,
+ _date int null,
+ payby char(4) not null,
+ payinfo varchar(16) null,
+ paybatch varchar(80) null,
+ closed char(1) null
+);
+INSERT INTO cust_pay_temp SELECT paynum, custnum, paid, _date, payby, payinfo, paybatch, closed FROM cust_pay;
+DROP TABLE cust_pay;
+ALTER TABLE cust_pay_temp RENAME TO cust_pay;
+CREATE UNIQUE INDEX cust_pay1 ON cust_pay (paynum);
+CREATE TABLE cust_refund_temp (
+ refundnum int primary key,
+ custnum int not null,
+ _date int null,
+ refund decimal(10,2) not null,
+ otaker varchar(8) not null,
+ reason varchar(80) not null,
+ payby char(4) not null,
+ payinfo varchar(16) null,
+ paybatch varchar(80) null,
+ closed char(1) null
+);
+INSERT INTO cust_refund_temp SELECT refundnum, custnum, _date, refund, otaker, reason, payby, payinfo, '', closed from cust_refund;
+DROP TABLE cust_refund;
+ALTER TABLE cust_refund_temp RENAME TO cust_refund;
+CREATE UNIQUE INDEX cust_refund1 ON cust_refund (refundnum);
+</pre></font>
+</td><td>
+<font size=-1><pre>
+ALTER TABLE cust_pay DROP COLUMN invnum;
+ALTER TABLE cust_refund DROP COLUMN crednum;
+</pre></font>
+</td></tr></table>
+ <li><b>IMPORTANT: After applying the second set of database changes</b>, run <tt>bin/dbdef-create <i>username</i></tt> again.
+ <li><b>IMPORTANT</b>: run <tt>bin/create-history-tables <i>username</i></tt>
+ <li><b>IMPORTANT: After running bin/create-history-tables</b>, run <tt>bin/dbdef-create <i>username</i></tt> again.
+ <li>As the freeside UNIX user, run <tt>bin/populate-msgcat <i>username</i></tt
+> to populate the message catalog
+<!-- <li>set the <a href="../config/config.cgi#username_policy">user_policy configuration value</a> as appropriate for your site. -->
+ <li>set the <a href="../config/config.cgi#locale">locale configuration value</a> to en_US.
+ <li>the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Set the <a href="../config/config.cgi#defaultrecords">defaultrecords configuration value</a> instead.
+ <li>Create the `/usr/local/etc/freeside/cache.<i>datasrc</i>' directory
+ (owned by the freeside user).
+ <li>freeside-queued was installed with the Perl modules. Start it now and ensure that is run upon system startup.
+ <li>Set appropriate <a href="../browse/part_bill_event.cgi">invoice events</a> for your site. At the very least, you'll want to set some invoice events "<i>After 0 days</i>": a <i>BILL</i> invoice event to print invoices, a <i>CARD</i> invoice event to batch or run cards real-time, and a <i>COMP</i> invoice event to "pay" complimentary customers. If you were using the <i>-i</i> option to <a href="man/bin/freeside-bill.html">freeside-bill</a> it should be removed.
+ <li>Use <a href="man/bin/freeside-daily.html">freeside-daily</a> instead of <a href="man/bin/freeside-bill.html">freeside-bill</a>.
+ <li>If you would like Freeside to notify your customers when their credit
+ cards and other billing arrangements are about to expire, arrange for
+ <b>freeside-expiration-alerter</b> to be run daily by cron or similar
+ facility. The message it sends can be configured from the
+ <u>Configuration</u> choice of the main menu as <u>alerter_template</u>.
+ <li>Export has been rewritten. If you were using the icradiusmachines,
+ icradius_mysqldest, icradius_mysqlsource, or icradius_secrets files, add
+ an appropriate "sqlradius" export to all relevant Service Definitions
+ instead. Use <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Replication">MySQL replication</a> or
+ point the "sqlradius" export directly at your external ICRADIUS or FreeRADIUS
+ database (or through an SSL-necrypting proxy...)
+</ul>
+</body>
diff --git a/httemplate/docs/upgrade9.html b/httemplate/docs/upgrade9.html
new file mode 100644
index 000000000..24d1cce42
--- /dev/null
+++ b/httemplate/docs/upgrade9.html
@@ -0,0 +1,26 @@
+<head>
+ <title>Upgrading to 1.4.1</title>
+</head>
+<body>
+<h1>Upgrading to 1.4.1 from 1.4.0</h1>
+<ul>
+ <li>If migrating from less than 1.4.0, see these <a href="upgrade8.html">instructions</a> first.
+ <li>Back up your data and current Freeside installation.
+ <li>Run <code>make aspdocs</code> or <code>make masondocs</code>.
+ <li>Copy <code>aspdocs/</code> or <code>masondocs/</code> to your web server's document space.
+ <li>Run <code>make install-perl-modules</code>.
+ <li>Install <a href="http://search.cpan.org/search?dist=Net-SSH">Net::SSH</a> minimum version 0.07
+ <li>Apply the following changes to your database:
+<pre>
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 18, 'daytime', 'en_US', 'Day Phone' );
+INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 19, 'night', 'en_US', 'Night Phone' );
+</pre>
+ <li>Optionally, apply the following changes to your database (performance improvements):
+<pre>
+CREATE INDEX part_pkg1 ON part_pkg ( disabled );
+CREATE INDEX part_svc1 ON part_svc ( disabled );
+CREATE INDEX cust_bill2 ON cust_bill ( _date );
+</pre>
+ <li>If you want to use ACH (electronic checks), you will need to make changes to your database. The easiest way to make these changes is to dump your database (with pg_dump), change the payinfo field in the cust_pay, cust_refund, h_cust_pay and h_cust_refund tables from varchar(16) to varchar(80), reload the database from the dump, and run dbdef-create
+ <li>Restart Apache and freeside-queued.
+</body>
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi
new file mode 100755
index 000000000..e44acba3c
--- /dev/null
+++ b/httemplate/edit/REAL_cust_pkg.cgi
@@ -0,0 +1,97 @@
+<!-- mason kludge -->
+<%
+# <!-- $Id: REAL_cust_pkg.cgi,v 1.5 2003-04-01 01:22:24 ivan Exp $ -->
+
+my $error ='';
+my $pkgnum = '';
+if ( $cgi->param('error') ) {
+ $error = $cgi->param('error');
+ $pkgnum = $cgi->param('pkgnum');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "no pkgnum";
+ $pkgnum = $1;
+}
+
+#get package record
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+die "No package!" unless $cust_pkg;
+my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
+
+if ( $error ) {
+ #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill);
+ $cust_pkg->setup(str2time($cgi->param('setup')));
+ $cust_pkg->bill(str2time($cgi->param('bill')));
+}
+
+#my $custnum = $cust_pkg->getfield('custnum');
+print header('Package Edit'); #, menubar(
+# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
+# 'Main Menu' => popurl(2)
+#));
+
+#print info
+my($susp,$cancel,$expire)=(
+ $cust_pkg->getfield('susp'),
+ $cust_pkg->getfield('cancel'),
+ $cust_pkg->getfield('expire'),
+);
+my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
+my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
+my $otaker = $cust_pkg->getfield('otaker');
+
+print '<FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">', qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>!
+ if $error;
+
+print ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
+ $pkgnum, '</TD></TR>',
+ '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
+ $pkg, '</TD></TR>',
+ '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
+ $comment, '</TD></TR>',
+ '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
+ $otaker, '</TD></TR>',
+ '<TR><TD ALIGN="right">Setup date</TD><TD>'.
+ '<INPUT TYPE="text" NAME="setup" SIZE=32 VALUE="',
+ ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '"></TD></TR>';
+
+print '<TR><TD ALIGN="right">Last bill date</TD><TD>',
+ '<INPUT TYPE="text" NAME="last_bill" SIZE=32 VALUE="',
+ ( $cust_pkg->last_bill
+ ? time2str("%c %z (%Z)", $cust_pkg->last_bill)
+ : "" ),
+ '"></TD></TR>'
+ if $cust_pkg->dbdef_table->column('last_bill');
+
+print '<TR><TD ALIGN="right">Next bill date</TD><TD>',
+ '<INPUT TYPE="text" NAME="bill" SIZE=32 VALUE="',
+ ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>';
+
+print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
+ time2str("%D",$susp), '</TD></TR>'
+ if $susp;
+
+#print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
+# time2str("%D",$expire), '</TD></TR>'
+# if $expire;
+print '<TR><TD ALIGN="right">Expiration date'.
+ '</TD><TD>',
+ '<INPUT TYPE="text" NAME="expire" SIZE=32 VALUE="',
+ ( $expire ? time2str("%c %z (%Z)",$expire) : "" ), '">'.
+ '<BR><FONT SIZE=-1>(will <b>cancel</b> this package'.
+ ' when the date is reached)</FONT>'.
+ '</TD></TR>';
+
+print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
+ time2str("%D",$cancel), '</TD></TR>'
+ if $cancel;
+
+%>
+</TABLE>
+<BR><INPUT TYPE="submit" VALUE="Apply Changes">
+</FORM>
+</BODY>
+</HTML>
diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi
new file mode 100755
index 000000000..449456cdd
--- /dev/null
+++ b/httemplate/edit/agent.cgi
@@ -0,0 +1,74 @@
+<!-- mason kludge -->
+<%
+
+my $agent;
+if ( $cgi->param('error') ) {
+ $agent = new FS::agent ( {
+ map { $_, scalar($cgi->param($_)) } fields('agent')
+ } );
+} elsif ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $agent = qsearchs( 'agent', { 'agentnum' => $1 } );
+} else { #adding
+ $agent = new FS::agent {};
+}
+my $action = $agent->agentnum ? 'Edit' : 'Add';
+my $hashref = $agent->hashref;
+
+print header("$action Agent", menubar(
+ 'Main Menu' => $p,
+ 'View all agents' => $p. 'browse/agent.cgi',
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print '<FORM ACTION="', popurl(1), 'process/agent.cgi" METHOD=POST>',
+ qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$hashref->{agentnum}">!,
+ "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)";
+
+print &ntable("#cccccc", 2, ''), <<END;
+<TR>
+ <TH ALIGN="right">Agent</TH>
+ <TD><INPUT TYPE="text" NAME="agent" SIZE=32 VALUE="$hashref->{agent}"></TD>
+</TR>
+<TR>
+ <TH ALIGN="right">Agent type</TH>
+ <TD><SELECT NAME="typenum" SIZE=1>
+END
+
+foreach my $agent_type (qsearch('agent_type',{})) {
+ print "<OPTION VALUE=". $agent_type->typenum;
+ print " SELECTED"
+ if $hashref->{typenum} && ( $hashref->{typenum} == $agent_type->typenum );
+ print ">", $agent_type->getfield('typenum'), ": ",
+ $agent_type->getfield('atype'),"\n";
+}
+
+print <<END;
+</SELECT></TD>
+</TR>
+<TR>
+ <TD ALIGN="right"><!--Frequency--></TD>
+ <TD><INPUT TYPE="hidden" NAME="freq" VALUE="$hashref->{freq}"></TD>
+</TR>
+<TR>
+ <TD ALIGN="right"><!--Program--></TD>
+ <TD><INPUT TYPE="hidden" NAME="prog" VALUE="$hashref->{prog}"></TD>
+</TR>
+</TABLE>
+END
+
+print qq!<BR><INPUT TYPE="submit" VALUE="!,
+ $hashref->{agentnum} ? "Apply changes" : "Add agent",
+ qq!">!;
+
+print <<END;
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi
new file mode 100755
index 000000000..637c710ab
--- /dev/null
+++ b/httemplate/edit/agent_type.cgi
@@ -0,0 +1,63 @@
+<!-- mason kludge -->
+<%
+
+my($agent_type);
+if ( $cgi->param('error') ) {
+ $agent_type = new FS::agent_type ( {
+ map { $_, scalar($cgi->param($_)) } fields('agent')
+ } );
+} elsif ( $cgi->keywords ) { #editing
+ my( $query ) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $agent_type=qsearchs('agent_type',{'typenum'=>$1});
+} else { #adding
+ $agent_type = new FS::agent_type {};
+}
+my $action = $agent_type->typenum ? 'Edit' : 'Add';
+my $hashref = $agent_type->hashref;
+
+print header("$action Agent Type", menubar(
+ 'Main Menu' => "$p",
+ 'View all agent types' => "${p}browse/agent_type.cgi",
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print '<FORM ACTION="', popurl(1), 'process/agent_type.cgi" METHOD=POST>',
+ qq!<INPUT TYPE="hidden" NAME="typenum" VALUE="$hashref->{typenum}">!,
+ "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)";
+
+print <<END;
+<BR><BR>Agent Type <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="$hashref->{atype}">
+<BR><BR>Select which packages agents of this type may sell to customers<BR>
+END
+
+foreach my $part_pkg ( qsearch('part_pkg',{ 'disabled' => '' }) ) {
+ print qq!<BR><INPUT TYPE="checkbox" NAME="pkgpart!,
+ $part_pkg->getfield('pkgpart'), qq!" !,
+ # ( 'CHECKED 'x scalar(
+ qsearchs('type_pkgs',{
+ 'typenum' => $agent_type->getfield('typenum'),
+ 'pkgpart' => $part_pkg->getfield('pkgpart'),
+ })
+ ? 'CHECKED '
+ : '',
+ qq!VALUE="ON"> !,
+ qq!<A HREF="${p}edit/part_pkg.cgi?!, $part_pkg->pkgpart,
+ '">', $part_pkg->pkgpart. ": ". $part_pkg->getfield('pkg'), '</A>',
+ ;
+}
+
+print qq!<BR><BR><INPUT TYPE="submit" VALUE="!,
+ $hashref->{typenum} ? "Apply changes" : "Add agent type",
+ qq!">!;
+
+print <<END;
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_bill_pay.cgi b/httemplate/edit/cust_bill_pay.cgi
new file mode 100755
index 000000000..8cdf4509a
--- /dev/null
+++ b/httemplate/edit/cust_bill_pay.cgi
@@ -0,0 +1,95 @@
+<!-- mason kludge -->
+<%
+
+my($paynum, $amount, $invnum);
+if ( $cgi->param('error') ) {
+ $paynum = $cgi->param('paynum');
+ $amount = $cgi->param('amount');
+ $invnum = $cgi->param('invnum');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $paynum = $1;
+ $amount = '';
+ $invnum = '';
+}
+
+my $otaker = getotaker;
+
+my $p1 = popurl(1);
+
+print header("Apply Payment", '');
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT><BR><BR>"
+ if $cgi->param('error');
+print <<END;
+ <FORM ACTION="${p1}process/cust_bill_pay.cgi" METHOD=POST>
+END
+
+my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
+die "payment $paynum not found!" unless $cust_pay;
+
+my $unapplied = $cust_pay->unapplied;
+
+print "Payment # <B>$paynum</B>".
+ qq!<INPUT TYPE="hidden" NAME="paynum" VALUE="$paynum">!.
+ '<BR>Date: <B>'. time2str("%D", $cust_pay->_date). '</B>'.
+ '<BR>Amount: $<B>'. $cust_pay->paid. '</B>'.
+ "<BR>Unapplied amount: \$<B>$unapplied</B>"
+ ;
+
+my @cust_bill = grep $_->owed != 0,
+ qsearch('cust_bill', { 'custnum' => $cust_pay->custnum } );
+
+print <<END;
+<SCRIPT>
+function changed(what) {
+ cust_bill = what.options[what.selectedIndex].value;
+END
+
+foreach my $cust_bill ( @cust_bill ) {
+ my $invnum = $cust_bill->invnum;
+ my $changeto = $cust_bill->owed < $unapplied
+ ? $cust_bill->owed
+ : $unapplied;
+ print <<END;
+ if ( cust_bill == $invnum ) {
+ what.form.amount.value = "$changeto";
+ }
+END
+}
+
+# if ( cust_bill == "Refund" ) {
+# what.form.amount.value = "$credited";
+# }
+print <<END;
+}
+</SCRIPT>
+END
+
+print qq!<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">!,
+ '<OPTION VALUE="">';
+foreach my $cust_bill ( @cust_bill ) {
+ print '<OPTION'. ( $cust_bill->invnum eq $invnum ? ' SELECTED' : '' ).
+ ' VALUE="'. $cust_bill->invnum. '">'. $cust_bill->invnum.
+ ' - '. time2str("%D",$cust_bill->_date).
+ ' - $'. $cust_bill->owed;
+}
+#print qq!<OPTION VALUE="Refund">Refund!;
+print "</SELECT>";
+
+print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
+
+print <<END;
+<BR>
+<INPUT TYPE="submit" VALUE="Apply">
+END
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi
new file mode 100755
index 000000000..aae0df2fc
--- /dev/null
+++ b/httemplate/edit/cust_credit.cgi
@@ -0,0 +1,63 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+my($custnum, $amount, $reason);
+if ( $cgi->param('error') ) {
+ #$cust_credit = new FS::cust_credit ( {
+ # map { $_, scalar($cgi->param($_)) } fields('cust_credit')
+ #} );
+ $custnum = $cgi->param('custnum');
+ $amount = $cgi->param('amount');
+ #$refund = $cgi->param('refund');
+ $reason = $cgi->param('reason');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $custnum = $1;
+ $amount = '';
+ #$refund = 'yes';
+ $reason = '';
+}
+my $_date = time;
+
+my $otaker = getotaker;
+
+my $p1 = popurl(1);
+
+print header("Post Credit", '');
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+print <<END, small_custview($custnum, $conf->config('countrydefault'));
+ <FORM ACTION="${p1}process/cust_credit.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="crednum" VALUE="">
+ <INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">
+ <INPUT TYPE="hidden" NAME="paybatch" VALUE="">
+ <INPUT TYPE="hidden" NAME="_date" VALUE="$_date">
+ <INPUT TYPE="hidden" NAME="credited" VALUE="">
+ <INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">
+END
+
+print '<BR><BR>Credit'. ntable("#cccccc", 2).
+ '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'.
+ time2str("%D",$_date). '</TD></TR>';
+
+print qq!<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">\$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8></TD></TR>!;
+
+#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
+
+print qq!<TR><TD ALIGN="right">Reason</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="reason" VALUE="$reason"></TD></TR>!;
+
+print qq!<TR><TD ALIGN="right">Auto-apply<BR>to invoices</TD><TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>!;
+
+print <<END;
+</TABLE>
+<BR>
+<INPUT TYPE="submit" VALUE="Post credit">
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi
new file mode 100755
index 000000000..1a97e1312
--- /dev/null
+++ b/httemplate/edit/cust_credit_bill.cgi
@@ -0,0 +1,101 @@
+<!-- mason kludge -->
+<%
+
+my($crednum, $amount, $invnum);
+if ( $cgi->param('error') ) {
+ #$cust_credit_bill = new FS::cust_credit_bill ( {
+ # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill')
+ #} );
+ $crednum = $cgi->param('crednum');
+ $amount = $cgi->param('amount');
+ #$refund = $cgi->param('refund');
+ $invnum = $cgi->param('invnum');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $crednum = $1;
+ $amount = '';
+ #$refund = 'yes';
+ $invnum = '';
+}
+
+my $otaker = getotaker;
+
+my $p1 = popurl(1);
+
+print header("Apply Credit", '');
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT><BR><BR>"
+ if $cgi->param('error');
+print <<END;
+ <FORM ACTION="${p1}process/cust_credit_bill.cgi" METHOD=POST>
+END
+
+my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
+die "credit $crednum not found!" unless $cust_credit;
+
+my $credited = $cust_credit->credited;
+
+print "Credit # <B>$crednum</B>".
+ qq!<INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!.
+ '<BR>Date: <B>'. time2str("%D", $cust_credit->_date). '</B>'.
+ '<BR>Amount: $<B>'. $cust_credit->amount. '</B>'.
+ "<BR>Unapplied amount: \$<B>$credited</B>".
+ '<BR>Reason: <B>'. $cust_credit->reason. '</B>'
+ ;
+
+my @cust_bill = grep $_->owed != 0,
+ qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } );
+
+print <<END;
+<SCRIPT>
+function changed(what) {
+ cust_bill = what.options[what.selectedIndex].value;
+END
+
+foreach my $cust_bill ( @cust_bill ) {
+ my $invnum = $cust_bill->invnum;
+ my $changeto = $cust_bill->owed < $cust_credit->credited
+ ? $cust_bill->owed
+ : $cust_credit->credited;
+ print <<END;
+ if ( cust_bill == $invnum ) {
+ what.form.amount.value = "$changeto";
+ }
+END
+}
+
+print <<END;
+ if ( cust_bill == "Refund" ) {
+ what.form.amount.value = "$credited";
+ }
+}
+</SCRIPT>
+END
+
+print qq!<BR>Invoice #<SELECT NAME="invnum" SIZE=1 onChange="changed(this)">!,
+ '<OPTION VALUE="">';
+foreach my $cust_bill ( @cust_bill ) {
+ print '<OPTION'. ( $cust_bill->invnum eq $invnum ? ' SELECTED' : '' ).
+ ' VALUE="'. $cust_bill->invnum. '">'. $cust_bill->invnum.
+ ' - '. time2str("%D",$cust_bill->_date).
+ ' - $'. $cust_bill->owed;
+}
+print qq!<OPTION VALUE="Refund">Refund!;
+print "</SELECT>";
+
+print qq!<BR>Amount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
+
+print <<END;
+<BR>
+<INPUT TYPE="submit" VALUE="Apply">
+END
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
new file mode 100755
index 000000000..2b7d8d0dc
--- /dev/null
+++ b/httemplate/edit/cust_main.cgi
@@ -0,0 +1,523 @@
+<!-- mason kludge -->
+<%
+
+ #for misplaced logic below
+ #use FS::part_pkg;
+
+ #for false laziness below (now more properly lazy)
+ #use FS::svc_acct_pop;
+
+ #for (other) false laziness below
+ #use FS::agent;
+ #use FS::type_pkgs;
+
+my $conf = new FS::Conf;
+
+#get record
+
+my $error = '';
+my($custnum, $username, $password, $popnum, $cust_main, $saved_pkgpart);
+my(@invoicing_list);
+if ( $cgi->param('error') ) {
+ $error = $cgi->param('error');
+ $cust_main = new FS::cust_main ( {
+ map { $_, scalar($cgi->param($_)) } fields('cust_main')
+ } );
+ $custnum = $cust_main->custnum;
+ $saved_pkgpart = $cgi->param('pkgpart_svcpart') || '';
+ if ( $saved_pkgpart =~ /^(\d+)_/ ) {
+ $saved_pkgpart = $1;
+ } else {
+ $saved_pkgpart = '';
+ }
+ $username = $cgi->param('username');
+ $password = $cgi->param('_password');
+ $popnum = $cgi->param('popnum');
+ @invoicing_list = split( /\s*,\s*/, $cgi->param('invoicing_list') );
+} elsif ( $cgi->keywords ) { #editing
+ my( $query ) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $custnum=$1;
+ $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+ $saved_pkgpart = 0;
+ $username = '';
+ $password = '';
+ $popnum = 0;
+ @invoicing_list = $cust_main->invoicing_list;
+} else {
+ $custnum='';
+ $cust_main = new FS::cust_main ( {} );
+ $cust_main->otaker( &getotaker );
+ $cust_main->referral_custnum( $cgi->param('referral_custnum') );
+ $saved_pkgpart = 0;
+ $username = '';
+ $password = '';
+ $popnum = 0;
+ @invoicing_list = ();
+}
+$cgi->delete_all();
+my $action = $custnum ? 'Edit' : 'Add';
+
+# top
+
+my $p1 = popurl(1);
+print header("Customer $action", '');
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $error, "</FONT>"
+ if $error;
+
+print qq!<FORM ACTION="${p1}process/cust_main.cgi" METHOD=POST NAME="form1">!,
+ qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!,
+ qq!Customer # !, ( $custnum ? "<B>$custnum</B>" : " (NEW)" ),
+
+;
+
+# agent
+
+my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
+
+my @agents = qsearch( 'agent', {} );
+#die "No agents created!" unless @agents;
+eidiot "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
+my $agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first
+if ( scalar(@agents) == 1 ) {
+ print qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$agentnum">!;
+} else {
+ print qq!<BR><BR>${r}Agent <SELECT NAME="agentnum" SIZE="1">!;
+ my $agent;
+ foreach $agent (sort {
+ $a->agent cmp $b->agent;
+ } @agents) {
+ print '<OPTION VALUE="', $agent->agentnum, '"',
+ " SELECTED"x($agent->agentnum==$agentnum),
+ ">". $agent->agent;
+ #">", $agent->agentnum,": ", $agent->agent;
+ }
+ print "</SELECT>";
+}
+
+#referral
+
+my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
+if ( $custnum && ! $conf->exists('editreferrals') ) {
+ print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
+} else {
+ my(@referrals) = qsearch('part_referral',{});
+ if ( scalar(@referrals) == 0 ) {
+ eidiot "You have not created any advertising sources. You must create at least one advertising source before adding a customer. Go to ". popurl(2). "browse/part_referral.cgi and create one or more advertising sources.";
+ } elsif ( scalar(@referrals) == 1 ) {
+ $refnum ||= $referrals[0]->refnum;
+ print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
+ } else {
+ print qq!<BR><BR>${r}Advertising source <SELECT NAME="refnum" SIZE="1">!;
+ print "<OPTION> " unless $refnum;
+ my($referral);
+ foreach $referral (sort {
+ $a->refnum <=> $b->refnum;
+ } @referrals) {
+ print "<OPTION" . " SELECTED"x($referral->refnum==$refnum),
+ ">", $referral->refnum, ": ", $referral->referral;
+ }
+ print "</SELECT>";
+ }
+}
+
+#referring customer
+
+#print qq!<BR><BR>Referring Customer: !;
+my $referring_cust_main = '';
+if ( $cust_main->referral_custnum
+ and $referring_cust_main =
+ qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
+) {
+ print '<BR><BR>Referring Customer: <A HREF="'. popurl(1). '/cust_main.cgi?'.
+ $cust_main->referral_custnum. '">'.
+ $cust_main->referral_custnum. ': '.
+ ( $referring_cust_main->company
+ || $referring_cust_main->last. ', '. $referring_cust_main->first ).
+ '</A><INPUT TYPE="hidden" NAME="referral_custnum" VALUE="'.
+ $cust_main->referral_custnum. '">';
+} elsif ( ! $conf->exists('disable_customer_referrals') ) {
+ print '<BR><BR>Referring customer number: <INPUT TYPE="text" NAME="referral_custnum" VALUE="">';
+} else {
+ print '<INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">';
+}
+
+# contact info
+
+my($last,$first,$ss,$company,$address1,$address2,$city,$zip)=(
+ $cust_main->last,
+ $cust_main->first,
+ $cust_main->ss,
+ $cust_main->company,
+ $cust_main->address1,
+ $cust_main->address2,
+ $cust_main->city,
+ $cust_main->zip,
+);
+
+print "<BR><BR>Billing address", &itable("#cccccc"), <<END;
+<TR><TH ALIGN="right">${r}Contact&nbsp;name<BR>(last,&nbsp;first)</TH><TD COLSPAN=3>
+END
+
+print <<END;
+<INPUT TYPE="text" NAME="last" VALUE="$last"> ,
+<INPUT TYPE="text" NAME="first" VALUE="$first">
+</TD>
+END
+
+if ( $conf->exists('show_ss') ) {
+ print qq!<TD ALIGN="right">SS#</TD><TD><INPUT TYPE="text" NAME="ss" VALUE="$ss" SIZE=11></TD>!;
+} else {
+ print qq!<TD><INPUT TYPE="hidden" NAME="ss" VALUE="$ss"></TD>!;
+}
+
+print <<END;
+</TR>
+<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="company" VALUE="$company" SIZE=70></TD></TR>
+<TR><TH ALIGN="right">${r}Address</TH><TD COLSPAN=5><INPUT TYPE="text" NAME="address1" VALUE="$address1" SIZE=70></TD></TR>
+<TR><TD ALIGN="right">&nbsp;</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="address2" VALUE="$address2" SIZE=70></TD></TR>
+<TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD><TH ALIGN="right">${r}State</TH><TD>
+END
+
+#false laziness with ship state
+my $countrydefault = $conf->config('countrydefault') || 'US';
+$cust_main->country( $countrydefault ) unless $cust_main->country;
+
+$cust_main->state( $conf->config('statedefault') || 'CA' )
+ unless $cust_main->state || $cust_main->country ne 'US';
+
+my($county_html, $state_html, $country_html) =
+ FS::cust_main_county::regionselector( $cust_main->county,
+ $cust_main->state,
+ $cust_main->country );
+
+print "$county_html $state_html";
+
+print qq!</TD><TH>${r}Zip</TH><TD><INPUT TYPE="text" NAME="zip" VALUE="$zip" SIZE=10></TD></TR>!;
+
+my($daytime,$night,$fax)=(
+ $cust_main->daytime,
+ $cust_main->night,
+ $cust_main->fax,
+);
+
+my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
+my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone';
+
+print <<END;
+<TR><TH ALIGN="right">${r}Country</TH><TD>$country_html</TD></TR>
+<TR><TD ALIGN="right">$daytime_label</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18></TD></TR>
+<TR><TD ALIGN="right">$night_label</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18></TD></TR>
+<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12></TD></TR>
+END
+
+print "</TABLE>${r}required fields<BR>";
+
+# service address
+
+if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+
+ print "\n", <<END;
+ <SCRIPT>
+ function changed(what) {
+ what.form.same.checked = false;
+ }
+ function samechanged(what) {
+ if ( what.checked ) {
+END
+print " what.form.ship_$_.value = what.form.$_.value;\n"
+ for (qw( last first company address1 address2 city zip daytime night fax ));
+print <<END;
+ what.form.ship_country.selectedIndex = what.form.country.selectedIndex;
+ ship_country_changed(what.form.ship_country);
+ what.form.ship_state.selectedIndex = what.form.state.selectedIndex;
+ ship_state_changed(what.form.ship_state);
+ what.form.ship_county.selectedIndex = what.form.county.selectedIndex;
+ }
+ }
+ </SCRIPT>
+END
+
+ print '<BR>Service address ',
+ '(<INPUT TYPE="checkbox" NAME="same" VALUE="Y" onClick="samechanged(this)"';
+ unless ( $cust_main->ship_last && $cgi->param('same') ne 'Y' ) {
+ print ' CHECKED';
+ foreach (
+ qw( last first company address1 address2 city county state zip country
+ daytime night fax )
+ ) {
+ $cust_main->set("ship_$_", $cust_main->get($_) );
+ }
+ }
+ print '>same as billing address)<BR>';
+
+ my($ship_last,$ship_first,$ship_company,$ship_address1,$ship_address2,$ship_city,$ship_zip)=(
+ $cust_main->ship_last,
+ $cust_main->ship_first,
+ $cust_main->ship_company,
+ $cust_main->ship_address1,
+ $cust_main->ship_address2,
+ $cust_main->ship_city,
+ $cust_main->ship_zip,
+ );
+
+ print &itable("#cccccc"), <<END;
+ <TR><TH ALIGN="right">${r}Contact&nbsp;name<BR>(last,&nbsp;first)</TH><TD COLSPAN=5>
+END
+
+ print <<END;
+ <INPUT TYPE="text" NAME="ship_last" VALUE="$ship_last" onChange="changed(this)"> ,
+ <INPUT TYPE="text" NAME="ship_first" VALUE="$ship_first" onChange="changed(this)">
+END
+
+ print <<END;
+ </TD></TR>
+ <TR><TD ALIGN="right">Company</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_company" VALUE="$ship_company" SIZE=70 onChange="changed(this)"></TD></TR>
+ <TR><TH ALIGN="right">${r}Address</TH><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_address1" VALUE="$ship_address1" SIZE=70 onChange="changed(this)"></TD></TR>
+ <TR><TD ALIGN="right">&nbsp;</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_address2" VALUE="$ship_address2" SIZE=70 onChange="changed(this)"></TD></TR>
+ <TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="ship_city" VALUE="$ship_city" onChange="changed(this)"></TD><TH ALIGN="right">${r}State</TH><TD>
+END
+
+ #false laziness with regular state
+ $cust_main->ship_country( $countrydefault ) unless $cust_main->ship_country;
+
+ $cust_main->ship_state( $conf->config('statedefault') || 'CA' )
+ unless $cust_main->ship_state || $cust_main->ship_country ne 'US';
+
+ my($ship_county_html, $ship_state_html, $ship_country_html) =
+ FS::cust_main_county::regionselector( $cust_main->ship_county,
+ $cust_main->ship_state,
+ $cust_main->ship_country,
+ 'ship_',
+ 'changed(this)', );
+
+ print "$ship_county_html $ship_state_html";
+
+ print qq!</TD><TH>${r}Zip</TH><TD><INPUT TYPE="text" NAME="ship_zip" VALUE="$ship_zip" SIZE=10 onChange="changed(this)"></TD></TR>!;
+
+ my($ship_daytime,$ship_night,$ship_fax)=(
+ $cust_main->ship_daytime,
+ $cust_main->ship_night,
+ $cust_main->ship_fax,
+ );
+
+ print <<END;
+ <TR><TH ALIGN="right">${r}Country</TH><TD>$ship_country_html</TD></TR>
+ <TR><TD ALIGN="right">$daytime_label</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_daytime" VALUE="$ship_daytime" SIZE=18 onChange="changed(this)"></TD></TR>
+ <TR><TD ALIGN="right">$night_label</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_night" VALUE="$ship_night" SIZE=18 onChange="changed(this)"></TD></TR>
+ <TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="ship_fax" VALUE="$ship_fax" SIZE=12 onChange="changed(this)"></TD></TR>
+END
+
+ print "</TABLE>${r}required fields<BR>";
+
+}
+
+# billing info
+
+sub expselect {
+ my $prefix = shift;
+ my( $m, $y ) = (0, 0);
+ if ( scalar(@_) ) {
+ my $date = shift || '01-2000';
+ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ } else {
+ die "unrecognized expiration date format: $date";
+ }
+ }
+
+ my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
+ for ( 1 .. 12 ) {
+ $return .= "<OPTION";
+ $return .= " SELECTED" if $_ == $m;
+ $return .= ">$_";
+ }
+ $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
+ for ( 2001 .. 2037 ) {
+ $return .= "<OPTION";
+ $return .= " SELECTED" if $_ == $y;
+ $return .= ">$_";
+ }
+ $return .= "</SELECT>";
+
+ $return;
+}
+
+my $payby_default = $conf->config('payby-default');
+
+if ( $payby_default eq 'HIDE' ) {
+
+ $cust_main->payby('BILL') unless $cust_main->payby;
+
+ foreach my $field (qw( tax payby )) {
+ print qq!<INPUT TYPE="hidden" NAME="$field" VALUE="!.
+ $cust_main->getfield($field). '">';
+ }
+
+ print qq!<INPUT TYPE="hidden" NAME="invoicing_list" VALUE="!.
+ join(', ', $cust_main->invoicing_list). '">';
+
+ foreach my $payby (qw( CARD DCRD CHEK DCHK LECB BILL COMP )) {
+ foreach my $field (qw( payinfo payname )) {
+ print qq!<INPUT TYPE="hidden" NAME="${payby}_$field" VALUE="!.
+ $cust_main->getfield($field). '">';
+ }
+
+ #false laziness w/expselect
+ my( $m, $y );
+ my $date = $cust_main->paydate || '12-2037';
+ if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
+ ( $m, $y ) = ( $2, $1 );
+ } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
+ ( $m, $y ) = ( $1, $3 );
+ } else {
+ die "unrecognized expiration date format: $date";
+ }
+
+ print qq!<INPUT TYPE="hidden" NAME="${payby}_month" VALUE="$m">!.
+ qq!<INPUT TYPE="hidden" NAME="${payby}_year" VALUE="$y">!;
+
+ }
+
+} else {
+
+ print "<BR>Billing information", &itable("#cccccc"),
+ qq!<TR><TD><INPUT TYPE="checkbox" NAME="tax" VALUE="Y"!;
+ print qq! CHECKED! if $cust_main->tax eq "Y";
+ print qq!>Tax Exempt</TD></TR><TR><TD>!.
+ qq!<INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"!;
+
+ #my @invoicing_list = $cust_main->invoicing_list;
+ print qq! CHECKED!
+ if ( ! @invoicing_list && ! $conf->exists('disablepostalinvoicedefault') )
+ || grep { $_ eq 'POST' } @invoicing_list;
+ print qq!>Postal mail invoice</TD></TR>!;
+ my $invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list );
+ print qq!<TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="$invoicing_list"></TD></TR>!;
+
+ print "<TR><TD>Billing type</TD></TR>",
+ "</TABLE>",
+ &table("#cccccc"), "<TR>";
+
+ my($payinfo, $payname)=(
+ $cust_main->payinfo,
+ $cust_main->payname,
+ );
+
+ my %payby = (
+ 'CARD' => qq!Credit card (automatic)<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
+ 'DCRD' => qq!Credit card (on-demand)<BR>${r}<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("DCRD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="">!,
+ 'CHEK' => qq!Electronic check (automatic)<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE=""><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="">!,
+ 'DCHK' => qq!Electronic check (on-demand)<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE=""><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="">!,
+ 'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
+ 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><INPUT TYPE="hidden" NAME="BILL_month" VALUE="12"><INPUT TYPE="hidden" NAME="BILL_year" VALUE="2037">Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="">!,
+ 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR>${r}Exp !. expselect("COMP"),
+);
+
+ my( $account, $aba ) = split('@', $payinfo);
+
+ my %paybychecked = (
+ 'CARD' => qq!Credit card (automatic)<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
+ 'DCRD' => qq!Credit card (on-demand)<BR>${r}<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("DCRD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="$payname">!,
+ 'CHEK' => qq!Electronic check (automatic)<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="$account"><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="$payname">!,
+ 'DCHK' => qq!Electronic check (on-demand)<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="$account"><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="$payname">!,
+ 'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="$payinfo" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
+ 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><INPUT TYPE="hidden" NAME="BILL_month" VALUE="12"><INPUT TYPE="hidden" NAME="BILL_year" VALUE="2037">Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
+ 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("COMP", $cust_main->paydate),
+);
+
+ $cust_main->payby($payby_default) unless $cust_main->payby;
+ for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) {
+ print qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
+ if ($cust_main->payby eq "$_") {
+ print qq! CHECKED> $paybychecked{$_}</TD>!;
+ } else {
+ print qq!> $payby{$_}</TD>!;
+ }
+ }
+
+ print "</TR></TABLE>$r required fields for each billing type";
+
+}
+
+if ( defined $cust_main->dbdef_table->column('comments') ) {
+ print "<BR><BR>Comments", &itable("#cccccc"),
+ qq!<TR><TD><TEXTAREA COLS=80 ROWS=5 WRAP="HARD" NAME="comments">!,
+ $cust_main->comments, "</TEXTAREA>",
+ "</TD></TR></TABLE>";
+}
+
+unless ( $custnum ) {
+ # pry the wrong place for this logic. also pretty expensive
+ #use FS::part_pkg;
+
+ #false laziness, copied from FS::cust_pkg::order
+ my $pkgpart;
+ if ( scalar(@agents) == 1 ) {
+ # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART
+ my($agent)=qsearchs('agent',{'agentnum'=> $agentnum });
+ $pkgpart = $agent->pkgpart_hashref;
+ } else {
+ #can't know (agent not chosen), so, allow all
+ my %typenum;
+ foreach my $agent ( @agents ) {
+ next if $typenum{$agent->typenum}++;
+ #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref }
+ foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround
+ }
+ }
+ #eslaf
+
+ my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } }
+ qsearch( 'part_pkg', { 'disabled' => '' } );
+
+ if ( @part_pkg ) {
+
+# print "<BR><BR>First package", &itable("#cccccc", "0 ALIGN=LEFT"),
+#apiabuse & undesirable wrapping
+ print "<BR><BR>First package", &itable("#cccccc"),
+ qq!<TR><TD COLSPAN=2><SELECT NAME="pkgpart_svcpart">!;
+
+ print qq!<OPTION VALUE="">(none)!;
+
+ foreach my $part_pkg ( @part_pkg ) {
+ print qq!<OPTION VALUE="!,
+# $part_pkg->pkgpart. "_". $pkgpart{ $part_pkg->pkgpart }, '"';
+ $part_pkg->pkgpart. "_". $part_pkg->svcpart, '"';
+ print " SELECTED" if $saved_pkgpart && ( $part_pkg->pkgpart == $saved_pkgpart );
+ print ">", $part_pkg->pkg, " - ", $part_pkg->comment;
+ }
+ print "</SELECT></TD></TR>";
+
+ #false laziness: (mostly) copied from edit/svc_acct.cgi
+ #$ulen = $svc_acct->dbdef_table->column('username')->length;
+ my $ulen = dbdef->table('svc_acct')->column('username')->length;
+ my $ulen2 = $ulen+2;
+ my $passwordmax = $conf->config('passwordmax') || 8;
+ my $pmax2 = $passwordmax + 2;
+ print <<END;
+<TR><TD ALIGN="right">Username</TD>
+<TD><INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen></TD></TR>
+<TR><TD ALIGN="right">Password</TD>
+<TD><INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=$pmax2 MAXLENGTH=$passwordmax>
+(blank to generate)</TD></TR>
+END
+
+ print '<TR><TD ALIGN="right">Access number</TD><TD WIDTH="100%">'
+ .
+ &FS::svc_acct_pop::popselector($popnum).
+ '</TD></TR></TABLE>'
+ ;
+ }
+}
+
+my $otaker = $cust_main->otaker;
+print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!,
+ qq!<BR><INPUT TYPE="submit" VALUE="!,
+ $custnum ? "Apply Changes" : "Add Customer", qq!">!,
+ "</FORM></BODY></HTML>",
+;
+
+%>
diff --git a/httemplate/edit/cust_main_county-expand.cgi b/httemplate/edit/cust_main_county-expand.cgi
new file mode 100755
index 000000000..9f314a457
--- /dev/null
+++ b/httemplate/edit/cust_main_county-expand.cgi
@@ -0,0 +1,54 @@
+<!-- mason kludge -->
+<%
+
+my($taxnum, $delim, $expansion, $taxclass );
+my($query) = $cgi->keywords;
+if ( $cgi->param('error') ) {
+ $taxnum = $cgi->param('taxnum');
+ $delim = $cgi->param('delim');
+ $expansion = $cgi->param('expansion');
+ $taxclass = $cgi->param('taxclass');
+} else {
+ $query =~ /^(taxclass)?(\d+)$/
+ or die "Illegal taxnum (query $query)";
+ $taxclass = $1 ? 'taxclass' : '';
+ $taxnum = $2;
+ $delim = 'n';
+ $expansion = '';
+}
+
+my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
+ or die "cust_main_county.taxnum $taxnum not found";
+die "Can't expand entry!" if $cust_main_county->getfield('county');
+
+my $p1 = popurl(1);
+print header("Tax Rate (expand)", menubar(
+ 'Main Menu' => popurl(2),
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print <<END;
+ <FORM ACTION="${p1}process/cust_main_county-expand.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="taxnum" VALUE="$taxnum">
+ <INPUT TYPE="hidden" NAME="taxclass" VALUE="$taxclass">
+ Separate by
+END
+print '<INPUT TYPE="radio" NAME="delim" VALUE="n"';
+print ' CHECKED' if $delim eq 'n';
+print '>line (broken on some browsers) or',
+ '<INPUT TYPE="radio" NAME="delim" VALUE="s"';
+print ' CHECKED' if $delim eq 's';
+print '>whitespace.';
+print <<END;
+ <BR><INPUT TYPE="submit" VALUE="Submit">
+ <BR><TEXTAREA NAME="expansion" ROWS=100>$expansion</TEXTAREA>
+ </FORM>
+ </CENTER>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi
new file mode 100755
index 000000000..f3d28825a
--- /dev/null
+++ b/httemplate/edit/cust_main_county.cgi
@@ -0,0 +1,69 @@
+<!-- mason kludge -->
+<%
+
+print header("Edit tax rates", menubar(
+ 'Main Menu' => popurl(2),
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="!, popurl(1),
+ qq!process/cust_main_county.cgi" METHOD=POST>!, &table(), <<END;
+ <TR>
+ <TH><FONT SIZE=-1>Country</FONT></TH>
+ <TH><FONT SIZE=-1>State</FONT></TH>
+ <TH><FONT SIZE=-1>County</FONT></TH>
+ <TH><FONT SIZE=-1>Taxclass</FONT><BR><FONT SIZE=-2>(per-package classification)</FONT></TH>
+ <TH><FONT SIZE=-1>Tax name</FONT><BR><FONT SIZE=-2>(printed on invoices)</FONT></TH>
+ <TH><FONT SIZE=-1>Tax</FONT></TH>
+ <TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
+ </TR>
+END
+
+foreach my $cust_main_county ( sort { $a->country cmp $b->country
+ or $a->state cmp $b->state
+ or $a->county cmp $b->county
+ } qsearch('cust_main_county',{}) ) {
+ my($hashref)=$cust_main_county->hashref;
+ print <<END;
+ <TR>
+ <TD BGCOLOR="#ffffff">$hashref->{country}</TD>
+END
+
+ print "<TD", $hashref->{state}
+ ? ' BGCOLOR="#ffffff">'.$hashref->{state}
+ : ' BGCOLOR="#cccccc">(ALL)'
+ , "</TD>";
+
+ print "<TD", $hashref->{county}
+ ? ' BGCOLOR="#ffffff">'. $hashref->{county}
+ : ' BGCOLOR="#cccccc">(ALL)'
+ , "</TD>";
+
+ print "<TD", $hashref->{taxclass}
+ ? ' BGCOLOR="#ffffff">'. $hashref->{taxclass}
+ : ' BGCOLOR="#cccccc">(ALL)'
+ , "</TD>";
+
+ print qq!<TD><INPUT TYPE="text" NAME="taxname!, $hashref->{taxnum},
+ qq!" VALUE="!, $hashref->{taxname}, qq!"></TD>!;
+ print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum},
+ qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD>!;
+ print qq!<TD>\$<INPUT TYPE="text" NAME="exempt_amount!, $hashref->{taxnum},
+ qq!" VALUE="!, $hashref->{exempt_amount}||0, qq!" SIZE=6></TD>!;
+ print '</TR>';
+
+}
+
+print <<END;
+ </TABLE>
+ <INPUT TYPE="submit" VALUE="Apply changes">
+ </FORM>
+ </CENTER>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi
new file mode 100755
index 000000000..f6ae7b299
--- /dev/null
+++ b/httemplate/edit/cust_pay.cgi
@@ -0,0 +1,129 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my($link, $linknum, $paid, $payby, $payinfo, $quickpay);
+if ( $cgi->param('error') ) {
+ $link = $cgi->param('link');
+ $linknum = $cgi->param('linknum');
+ $paid = $cgi->param('paid');
+ $payby = $cgi->param('payby');
+ $payinfo = $cgi->param('payinfo');
+ $quickpay = $cgi->param('quickpay');
+} elsif ($cgi->keywords) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $link = 'invnum';
+ $linknum = $1;
+ $paid = '';
+ $payby = 'BILL';
+ $payinfo = "";
+ $quickpay = '';
+} elsif ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+ $link = 'custnum';
+ $linknum = $1;
+ $paid = '';
+ $payby = 'BILL';
+ $payinfo = '';
+ $quickpay = $cgi->param('quickpay');
+} else {
+ die "illegal query ". $cgi->keywords;
+}
+my $_date = time;
+
+my $paybatch = "webui-$_date-$$-". rand() * 2**32;
+
+my $p1 = popurl(1);
+print header("Post payment", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT><BR><BR>"
+ if $cgi->param('error');
+
+print <<END, ntable("#cccccc",2);
+ <FORM ACTION="${p1}process/cust_pay.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="link" VALUE="$link">
+ <INPUT TYPE="hidden" NAME="linknum" VALUE="$linknum">
+ <INPUT TYPE="hidden" NAME="quickpay" VALUE="$quickpay">
+END
+
+my $custnum;
+if ( $link eq 'invnum' ) {
+
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $linknum } )
+ or die "unknown invnum $linknum";
+ print "Invoice #<B>$linknum</B>". ntable("#cccccc",2).
+ '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'.
+ time2str("%D", $cust_bill->_date). '</TD></TR>'.
+ '<TR><TD ALIGN="right" VALIGN="top">Items</TD><TD BGCOLOR="#ffffff">';
+ foreach ( $cust_bill->cust_bill_pkg ) { #false laziness with FS::cust_bill
+ if ( $_->pkgnum ) {
+
+ my($cust_pkg)=qsearchs('cust_pkg', { 'pkgnum', $_->pkgnum } );
+ my($part_pkg)=qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->pkgpart});
+ my($pkg)=$part_pkg->pkg;
+
+ if ( $_->setup != 0 ) {
+ print "$pkg Setup<BR>"; # $money_char. sprintf("%10.2f",$_->setup);
+ print join('<BR>',
+ map { " ". $_->[0]. ": ". $_->[1] } $cust_pkg->labels
+ ). '<BR>';
+ }
+
+ if ( $_->recur != 0 ) {
+ print
+ "$pkg (" . time2str("%x",$_->sdate) . " - " .
+ time2str("%x",$_->edate) . ")<BR>";
+ #$money_char. sprintf("%10.2f",$_->recur)
+ print join('<BR>',
+ map { '--->'. $_->[0]. ": ". $_->[1] } $cust_pkg->labels
+ ). '<BR>';
+ }
+
+ } else { #pkgnum Tax
+ print "Tax<BR>" # $money_char. sprintf("%10.2f",$_->setup)
+ if $_->setup != 0;
+ }
+
+ }
+ print '</TD></TR></TABLE><BR><BR>';
+
+ $custnum = $cust_bill->custnum;
+
+} elsif ( $link eq 'custnum' ) {
+ $custnum = $linknum;
+}
+
+print small_custview($custnum, $conf->config('countrydefault'));
+
+print qq!<INPUT TYPE="hidden" NAME="_date" VALUE="$_date">!;
+print qq!<INPUT TYPE="hidden" NAME="payby" VALUE="$payby">!;
+
+print '<BR><BR>Payment'. ntable("#cccccc", 2).
+ '<TR><TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff">'.
+ time2str("%D",$_date). '</TD></TR>';
+
+print qq!<TR><TD ALIGN="right">Amount</TD><TD BGCOLOR="#ffffff">\$<INPUT TYPE="text" NAME="paid" VALUE="$paid" SIZE=8 MAXLENGTH=8></TD></TR>!;
+
+print qq!<TR><TD ALIGN="right">Payby</TD><TD BGCOLOR="#ffffff">$payby</TD></TR>!;
+
+#payinfo (check # now as payby="BILL" hardcoded.. what to do later?)
+print qq!<TR><TD ALIGN="right">Check #</TD><TD BGCOLOR="#ffffff"><INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo"></TD></TR>!;
+
+print qq!<TR><TD ALIGN="right">Auto-apply<BR>to invoices</TD><TD><SELECT NAME="apply"><OPTION VALUE="yes" SELECTED>yes<OPTION>no</SELECT></TD>!;
+
+print "</TABLE>";
+
+#paybatch
+print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="$paybatch">!;
+
+print <<END;
+<BR>
+<INPUT TYPE="submit" VALUE="Post payment">
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/cust_pkg.cgi b/httemplate/edit/cust_pkg.cgi
new file mode 100755
index 000000000..485d601eb
--- /dev/null
+++ b/httemplate/edit/cust_pkg.cgi
@@ -0,0 +1,117 @@
+<!-- mason kludge -->
+<%
+
+my %pkg = ();
+my %comment = ();
+my %all_pkg = ();
+my %all_comment = ();
+#foreach (qsearch('part_pkg', { 'disabled' => '' })) {
+# $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+# $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+#}
+foreach (qsearch('part_pkg', {} )) {
+ $all_pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+ $all_comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+ next if $_->disabled;
+ $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
+ $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
+}
+
+my($custnum, %remove_pkg);
+if ( $cgi->param('error') ) {
+ $custnum = $cgi->param('custnum');
+ %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $custnum = $1;
+ %remove_pkg = ();
+}
+
+my $p1 = popurl(1);
+print header("Add/Edit Packages", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
+
+print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
+
+#current packages
+my @cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
+
+if (@cust_pkg) {
+ print <<END;
+Current packages - select to remove (services are moved to a new package below)
+<BR><BR>
+END
+
+ my $count = 0 ;
+ print qq!<TABLE>! ;
+ foreach (@cust_pkg) {
+ print '<TR>' if $count == 0;
+ my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
+ print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"!;
+ print " CHECKED" if $remove_pkg{$pkgnum};
+ print qq!>$pkgnum: $all_pkg{$pkgpart} - $all_comment{$pkgpart}</TD>\n!;
+ $count ++ ;
+ if ($count == 2)
+ {
+ $count = 0 ;
+ print qq!</TR>\n! ;
+ }
+ }
+ print qq!</TABLE><BR><BR>!;
+}
+
+print <<END;
+Order new packages<BR><BR>
+END
+
+my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
+my $agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
+
+my $count = 0;
+my $pkgparts = 0;
+print qq!<TABLE>!;
+foreach my $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
+ $pkgparts++;
+ my($pkgpart)=$type_pkgs->pkgpart;
+ next unless exists $pkg{$pkgpart}; #skip disabled ones
+ print qq!<TR>! if ( $count == 0 );
+ my $value = $cgi->param("pkg$pkgpart") || 0;
+ print <<END;
+ <TD>
+ <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2">
+ $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n
+END
+ $count ++ ;
+ if ( $count == 2 ) {
+ print qq!</TR>\n! ;
+ $count = 0;
+ }
+}
+print qq!</TABLE>!;
+
+unless ( $pkgparts ) {
+ my $p2 = popurl(2);
+ my $typenum = $agent->typenum;
+ my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
+ my $atype = $agent_type->atype;
+ print <<END;
+(No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
+<a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
+any packages.)
+END
+}
+
+#submit
+print <<END;
+<P><INPUT TYPE="submit" VALUE="Order">
+ </FORM>
+ </BODY>
+</HTML>
+END
+%>
diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi
new file mode 100755
index 000000000..ee9b1c6b3
--- /dev/null
+++ b/httemplate/edit/msgcat.cgi
@@ -0,0 +1,58 @@
+<!-- mason kludge -->
+<%
+
+print header("Edit Message catalog", menubar(
+# 'Main Menu' => $p,
+)), '<BR>';
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error').
+ '</FONT><BR><BR>'
+ if $cgi->param('error');
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => 'en_US',
+ 'options' => { 'en_US'=>'en_US' },
+ 'form_action' => 'process/msgcat.cgi',
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!.
+ "<BR>Messages for locale $layer<BR>". table().
+ "<TR><TH COLSPAN=2>Code</TH>".
+ "<TH>Message</TH>";
+ $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US';
+ $html .= '</TR>';
+
+ #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode }
+ # qsearch('msgcat', { 'locale' => $layer } ) ) {
+ foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) {
+ $html .=
+ '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'.
+ '<TD><INPUT TYPE="text" SIZE=32 '.
+ qq! NAME="!. $msgcat->msgnum. '" '.
+ qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!"></TD>!;
+ unless ( $layer eq 'en_US' ) {
+ my $en_msgcat = qsearchs('msgcat', {
+ 'locale' => 'en_US',
+ 'msgcode' => $msgcat->msgcode,
+ } );
+ $html .= '<TD>'. $en_msgcat->msg. '</TD>';
+ }
+ $html .= '</TR>';
+ }
+
+ $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="Apply changes">';
+
+ $html;
+ },
+
+);
+
+print $widget->html;
+
+print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi
new file mode 100755
index 000000000..6426eed93
--- /dev/null
+++ b/httemplate/edit/part_bill_event.cgi
@@ -0,0 +1,222 @@
+<!-- mason kludge -->
+<%
+
+if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) {
+ $cgi->param('eventpart', $1);
+} else {
+ $cgi->param('eventpart', '');
+}
+
+my ($query) = $cgi->keywords;
+my $action = '';
+my $part_bill_event = '';
+if ( $cgi->param('error') ) {
+ $part_bill_event = new FS::part_bill_event ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_bill_event')
+ } );
+}
+if ( $query && $query =~ /^(\d+)$/ ) {
+ $part_bill_event ||= qsearchs('part_bill_event',{'eventpart'=>$1});
+} else {
+ $part_bill_event ||= new FS::part_bill_event {};
+}
+$action ||= $part_bill_event->pkgpart ? 'Edit' : 'Add';
+my $hashref = $part_bill_event->hashref;
+
+print header("$action Invoice Event Definition", menubar(
+ 'Main Menu' => popurl(2),
+ 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi',
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print '<FORM ACTION="', popurl(1), 'process/part_bill_event.cgi" METHOD=POST>'.
+ '<INPUT TYPE="hidden" NAME="eventpart" VALUE="'.
+ $part_bill_event->eventpart .'">';
+print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)";
+
+print ntable("#cccccc",2), <<END;
+<TR><TD ALIGN="right">Payby</TD><TD><SELECT NAME="payby">
+END
+
+for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) {
+ print qq!<OPTION VALUE="$_"!;
+ if ($part_bill_event->payby eq $_) {
+ print " SELECTED>$_</OPTION>";
+ } else {
+ print ">$_</OPTION>";
+ }
+}
+
+my $days = $hashref->{seconds}/86400;
+
+print <<END;
+</SELECT></TD></TR>
+<TR><TD ALIGN="right">Event</TD><TD><INPUT TYPE="text" NAME="event" VALUE="$hashref->{event}"></TD></TR>
+<TR><TD ALIGN="right">After</TD><TD><INPUT TYPE="text" NAME="days" VALUE="$days"> days</TD></TR>
+END
+
+print '<TR><TD ALIGN="right">Disabled</TD><TD>';
+print '<INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"';
+print ' CHECKED' if $hashref->{disabled} eq "Y";
+print '>';
+print '</TD></TR>';
+
+print '<TR><TD ALIGN="right">Action</TD><TD>';
+
+#print ntable();
+
+#this is pretty kludgy right here.
+tie my %events, 'Tie::IxHash',
+
+ 'fee' => {
+ 'name' => 'Late fee',
+ 'code' => '$cust_main->charge( %%%charge%%%, \'%%%reason%%%\' );',
+ 'html' =>
+ 'Amount <INPUT TYPE="text" SIZE="7" NAME="charge" VALUE="%%%charge%%%">'.
+ '<BR>Reason <INPUT TYPE="text" NAME="reason" VALUE="%%%reason%%%">',
+ 'weight' => 10,
+ },
+ 'suspend' => {
+ 'name' => 'Suspend',
+ 'code' => '$cust_main->suspend();',
+ 'weight' => 10,
+ },
+ 'cancel' => {
+ 'name' => 'Cancel',
+ 'code' => '$cust_main->cancel();',
+ 'weight' => 10,
+ },
+
+ 'addpost' => {
+ 'name' => 'Add postal invoicing',
+ 'code' => '$cust_main->invoicing_list_addpost(); "";',
+ 'weight' => 20,
+ },
+
+ 'comp' => {
+ 'name' => 'Pay invoice with a complimentary "payment"',
+ 'code' => '$cust_bill->comp();',
+ 'weight' => 30,
+ },
+
+ 'realtime-card' => {
+ 'name' => 'Run card with a <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> realtime gateway',
+ 'code' => '$cust_bill->realtime_card();',
+ 'weight' => 30,
+ },
+
+ 'realtime-check' => {
+ 'name' => 'Run check with a <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> realtime gateway',
+ 'code' => '$cust_bill->realtime_ach();',
+ 'weight' => 30,
+ },
+
+ 'realtime-lec' => {
+ 'name' => 'Run phone bill ("LEC") billing with a <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> realtime gateway',
+ 'code' => '$cust_bill->realtime_lec();',
+ 'weight' => 30,
+ },
+
+ 'batch-card' => {
+ 'name' => 'Add card to the pending credit card batch',
+ 'code' => '$cust_bill->batch_card();',
+ 'weight' => 40,
+ },
+
+ 'send' => {
+ 'name' => 'Send invoice (email/print)',
+ 'code' => '$cust_bill->send();',
+ 'weight' => 50,
+ },
+
+ 'send_alternate' => {
+ 'name' => 'Send invoice (email/print) with alternate template',
+ 'code' => '$cust_bill->send(\'%%%templatename%%%\');',
+ 'html' =>
+ '<INPUT TYPE="text" NAME="templatename" VALUE="%%%templatename%%%">',
+ 'weight' => 50,
+ },
+
+ 'send_csv_ftp' => {
+ 'name' => 'Upload CSV invoice data to an FTP server',
+ 'code' => '$cust_bill->send_csv( protocol => \'ftp\',
+ server => \'%%%ftpserver%%%\',
+ username => \'%%%ftpusername%%%\',
+ password => \'%%%ftppassword%%%\',
+ dir => \'%%%ftpdir%%%\' );',
+ 'html' =>
+ '<TABLE BORDER=0><TR><TD ALIGN="right">FTP server: </TD>'.
+ '<TD><INPUT TYPE="text" NAME="ftpserver" VALUE="%%%ftpserver%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP username: </TD><TD>'.
+ '<INPUT TYPE="text" NAME="ftpusername" VALUE="%%%ftpusername%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP password: </TD><TD>'.
+ '<INPUT TYPE="text" NAME="ftppassword" VALUE="%%%ftppassword%%%">'.
+ '</TD></TR>'.
+ '<TR><TD ALIGN="right">FTP directory: </TD>'.
+ '<TD><INPUT TYPE="text" NAME="ftpdir" VALUE="%%%ftpdir%%%">'.
+ '</TD></TR>'.
+ '</TABLE>',
+ 'weight' => 50,
+ },
+
+ 'bill' => {
+ 'name' => 'Generate invoices (normally only used with a <i>Late Fee</i> event)',
+ 'code' => '$cust_main->bill();',
+ 'weight' => 60,
+ },
+
+ 'apply' => {
+ 'name' => 'Apply unapplied payments and credits',
+ 'code' => '$cust_main->apply_payments; $cust_main->apply_credits; "";',
+ 'weight' => 70,
+ },
+
+ 'collect' => {
+ 'name' => 'Collect on invoices (normally only used with a <i>Late Fee</i> and <i>Generate Invoice</i> events)',
+ 'code' => '$cust_main->collect();',
+ 'weight' => 80,
+ },
+
+;
+
+foreach my $event ( keys %events ) {
+ my %plandata = map { /^(\w+) (.*)$/; ($1, $2); }
+ split(/\n/, $part_bill_event->plandata);
+ my $html = $events{$event}{html};
+ while ( $html =~ /%%%(\w+)%%%/ ) {
+ my $field = $1;
+ $html =~ s/%%%$field%%%/$plandata{$field}/;
+ }
+
+ print ntable( "#cccccc", 2).
+ qq!<TR><TD><INPUT TYPE="radio" NAME="plan_weight_eventcode" !;
+ print "CHECKED " if $event eq $part_bill_event->plan;
+ print qq!VALUE="!. $event. ":". $events{$event}{weight}. ":".
+ encode_entities($events{$event}{code}).
+ qq!">$events{$event}{name}</TD>!;
+ print '<TD>'. $html. '</TD>' if $html;
+ print qq!</TR>!;
+ print '</TABLE>';
+}
+
+#print '</TABLE>';
+
+print <<END;
+</TD></TR>
+</TABLE>
+END
+
+print qq!<INPUT TYPE="submit" VALUE="!,
+ $hashref->{eventpart} ? "Apply changes" : "Add invoice event",
+ qq!">!;
+%>
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi
new file mode 100644
index 000000000..cc60f1aeb
--- /dev/null
+++ b/httemplate/edit/part_export.cgi
@@ -0,0 +1,125 @@
+<!-- mason kludge -->
+<%
+
+#if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
+# $cgi->param('clone', $1);
+#} else {
+# $cgi->param('clone', '');
+#}
+
+my($query) = $cgi->keywords;
+my $action = '';
+my $part_export = '';
+if ( $cgi->param('error') ) {
+ $part_export = new FS::part_export ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_export')
+ } );
+} elsif ( $query =~ /^(\d+)$/ ) {
+ $part_export = qsearchs('part_export', { 'exportnum' => $1 } );
+} else {
+ $part_export = new FS::part_export;
+}
+$action ||= $part_export->exportnum ? 'Edit' : 'Add';
+
+#my $exports = FS::part_export::export_info($svcdb);
+my $exports = FS::part_export::export_info();
+
+my %layers = map { $_ => "$_ - ". $exports->{$_}{desc} } keys %$exports;
+$layers{''}='';
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => $part_export->exporttype,
+ 'options' => \%layers,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/part_export.cgi',
+ 'form_text' => [qw( exportnum machine )],
+# 'form_checkbox' => [qw()],
+ 'html_between' => "</TD></TR></TABLE>\n",
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="exporttype" VALUE="$layer">!.
+ ntable("#cccccc",2);
+
+ $html .= '<TR><TD ALIGN="right">Description</TD><TD BGCOLOR=#ffffff>'.
+ $exports->{$layer}{notes}. '</TD></TR>'
+ if $layer;
+
+ foreach my $option ( keys %{$exports->{$layer}{options}} ) {
+ my $optinfo = $exports->{$layer}{options}{$option};
+ my $label = $optinfo->{label};
+ my $type = defined($optinfo->{type}) ? $optinfo->{type} : 'text';
+ my $value = $cgi->param($option)
+ || ( $part_export->exportnum && $part_export->option($option) )
+ || ( (exists $optinfo->{default} && !$part_export->exportnum)
+ ? $optinfo->{default}
+ : ''
+ );
+ $html .= qq!<TR><TD ALIGN="right">$label</TD><TD>!;
+ if ( $type eq 'select' ) {
+ $html .= qq!<SELECT NAME="$option">!;
+ foreach my $select_option ( @{$optinfo->{options}} ) {
+ #if ( ref($select_option) ) {
+ #} else {
+ my $selected = $select_option eq $value ? ' SELECTED' : '';
+ $html .= qq!<OPTION VALUE="$select_option"$selected>!.
+ qq!$select_option</OPTION>!;
+ #}
+ }
+ $html .= '</SELECT>';
+ } elsif ( $type eq 'textarea' ) {
+ $html .= qq!<TEXTAREA NAME="$option" COLS=80 ROWS=8 WRAP="virtual">!.
+ qq!$value</TEXTAREA>!;
+ } elsif ( $type eq 'text' ) {
+ $html .= qq!<INPUT TYPE="text" NAME="$option" VALUE="$value" SIZE=64>!;
+ } elsif ( $type eq 'checkbox' ) {
+ $html .= qq!<INPUT TYPE="checkbox" NAME="$option" VALUE="1"!;
+ $html .= ' CHECKED' if $value;
+ $html .= '>';
+ } else {
+ $html .= "unknown type $type";
+ }
+ $html .= '</TD></TR>';
+ }
+ $html .= '</TABLE>';
+
+ $html .= '<INPUT TYPE="hidden" NAME="options" VALUE="'.
+ join(',', keys %{$exports->{$layer}{options}} ). '">';
+
+ $html .= '<INPUT TYPE="hidden" NAME="nodomain" VALUE="'.
+ $exports->{$layer}{nodomain}. '">';
+
+ $html .= '<INPUT TYPE="submit" VALUE="'.
+ ( $part_export->exportnum ? "Apply changes" : "Add export" ).
+ '">';
+
+ $html;
+ },
+);
+
+%>
+<%= header("$action Export", menubar(
+ 'Main Menu' => popurl(2),
+), ' onLoad="visualize()"')
+%>
+
+<% if ( $cgi->param('error') ) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+ <BR><BR>
+<% } %>
+
+<FORM NAME="dummy">
+<INPUT TYPE="hidden" NAME="exportnum" VALUE="<%= $part_export->exportnum %>">
+
+<%= ntable("#cccccc",2) %>
+<TR>
+ <TD ALIGN="right">Export host</TD>
+ <TD>
+ <INPUT TYPE="text" NAME="machine" VALUE="<%= $part_export->machine %>">
+ </TD>
+</TR>
+<TR>
+ <TD ALIGN="right">Export</TD>
+ <TD><%= $widget->html %>
+</BODY>
+</HTML>
+
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
new file mode 100755
index 000000000..dee356250
--- /dev/null
+++ b/httemplate/edit/part_pkg.cgi
@@ -0,0 +1,508 @@
+<!-- mason kludge -->
+<%
+
+if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
+ $cgi->param('clone', $1);
+} else {
+ $cgi->param('clone', '');
+}
+if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
+ $cgi->param('pkgnum', $1);
+} else {
+ $cgi->param('pkgnum', '');
+}
+
+my ($query) = $cgi->keywords;
+my $action = '';
+my $part_pkg = '';
+if ( $cgi->param('error') ) {
+ $part_pkg = new FS::part_pkg ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_pkg')
+ } );
+}
+if ( $cgi->param('clone') ) {
+ $action='Custom Pricing';
+ my $old_part_pkg =
+ qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } );
+ $part_pkg ||= $old_part_pkg->clone;
+ $part_pkg->disabled('Y');
+} elsif ( $query && $query =~ /^(\d+)$/ ) {
+ $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1});
+} else {
+ unless ( $part_pkg ) {
+ $part_pkg = new FS::part_pkg {};
+ $part_pkg->plan('flat');
+ }
+}
+unless ( $part_pkg->plan ) { #backwards-compat
+ $part_pkg->plan('flat');
+ $part_pkg->plandata("setup_fee=". $part_pkg->setup. "\n".
+ "recur_fee=". $part_pkg->recur. "\n");
+}
+$action ||= $part_pkg->pkgpart ? 'Edit' : 'Add';
+my $hashref = $part_pkg->hashref;
+
+
+print header("$action Package Definition", menubar(
+ 'Main Menu' => popurl(2),
+ 'View all packages' => popurl(2). 'browse/part_pkg.cgi',
+));
+#), ' onLoad="visualize()"');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+#print '<FORM ACTION="', popurl(1), 'process/part_pkg.cgi" METHOD=POST>';
+print '<FORM NAME="dummy">';
+
+#if ( $cgi->param('clone') ) {
+# print qq!<INPUT TYPE="hidden" NAME="clone" VALUE="!, $cgi->param('clone'), qq!">!;
+#}
+#if ( $cgi->param('pkgnum') ) {
+# print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="!, $cgi->param('pkgnum'), qq!">!;
+#}
+#
+#print qq!<INPUT TYPE="hidden" NAME="pkgpart" VALUE="$hashref->{pkgpart}">!,
+print "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)";
+
+print ntable("#cccccc",2), <<END;
+<TR><TD ALIGN="right">Package (customer-visible)</TD><TD><INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}"></TD></TR>
+<TR><TD ALIGN="right">Comment (customer-hidden)</TD><TD><INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="$hashref->{comment}"></TD></TR>
+<TR><TD ALIGN="right">Frequency (months) of recurring fee</TD><TD><INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}" SIZE=3>&nbsp;&nbsp;<I>0=no recurring fee, 1=monthly, 3=quarterly, 12=yearly</TD></TR>
+<TR><TD ALIGN="right">Setup fee tax exempt</TD><TD>
+END
+
+print '<INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y"';
+print ' CHECKED' if $hashref->{setuptax} eq "Y";
+print '>';
+
+print <<END;
+</TD></TR>
+<TR><TD ALIGN="right">Recurring fee tax exempt</TD><TD>
+END
+
+print '<INPUT TYPE="checkbox" NAME="recurtax" VALUE="Y"';
+print ' CHECKED' if $hashref->{recurtax} eq "Y";
+print '>';
+
+print '</TD></TR>';
+
+my $conf = new FS::Conf;
+#false laziness w/ view/cust_main.cgi quick order
+if ( $conf->exists('enable_taxclasses') ) {
+ print '<TR><TD ALIGN="right">Tax class</TD><TD><SELECT NAME="taxclass">';
+ my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
+ or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ foreach my $taxclass ( map $_->[0], @{$sth->fetchall_arrayref} ) {
+ print qq!<OPTION VALUE="$taxclass"!;
+ print ' SELECTED' if $taxclass eq $hashref->{taxclass};
+ print qq!>$taxclass</OPTION>!;
+ }
+ print '</SELECT></TD></TR>';
+} else {
+ print
+ '<INPUT TYPE="hidden" NAME="taxclass" VALUE="'. $hashref->{taxclass}. '">';
+}
+
+print '<TR><TD ALIGN="right">Disable new orders</TD><TD>';
+print '<INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"';
+print ' CHECKED' if $hashref->{disabled} eq "Y";
+print '>';
+print '</TD></TR></TABLE>';
+
+my $thead = "\n\n". ntable('#cccccc', 2). <<END;
+<TR><TH BGCOLOR="#dcdcdc"><FONT SIZE=-1>Quan.</FONT></TH><TH BGCOLOR="#dcdcdc">Service</TH></TR>
+END
+
+#unless ( $cgi->param('clone') ) {
+#dunno why...
+unless ( 0 ) {
+ #print <<END, $thead;
+ print <<END, itable(), '<TR><TD VALIGN="top">', $thead;
+<BR><BR>Enter the quantity of each service this package includes.<BR><BR>
+END
+}
+
+my @fixups = ();
+my $count = 0;
+my $columns = 3;
+my @part_svc = qsearch( 'part_svc', { 'disabled' => '' } );
+foreach my $part_svc ( @part_svc ) {
+ my $svcpart = $part_svc->svcpart;
+ my $pkgpart = $cgi->param('clone') || $part_pkg->pkgpart;
+ my $pkg_svc = $pkgpart && qsearchs( 'pkg_svc', {
+ 'pkgpart' => $pkgpart,
+ 'svcpart' => $svcpart,
+ } ) || new FS::pkg_svc ( {
+ 'pkgpart' => $pkgpart,
+ 'svcpart' => $svcpart,
+ 'quantity' => 0,
+ });
+ #? #next unless $pkg_svc;
+
+ push @fixups, "pkg_svc$svcpart";
+
+ #unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) {
+ #dunno why...
+ unless ( 0 ) {
+ print '<TR>'; # if $count == 0 ;
+ print qq!<TD><INPUT TYPE="text" NAME="pkg_svc$svcpart" SIZE=4 MAXLENGTH=3 VALUE="!,
+ $cgi->param("pkg_svc$svcpart") || $pkg_svc->quantity || 0,
+ qq!"></TD><TD><A HREF="part_svc.cgi?!,$part_svc->svcpart,
+ qq!">!, $part_svc->getfield('svc'), "</A></TD></TR>";
+# print "</TABLE></TD><TD>$thead" if ++$count == int(scalar(@part_svc) / 2);
+ $count+=1;
+ foreach ( 1 .. $columns-1 ) {
+ print "</TABLE></TD><TD VALIGN=\"top\">$thead"
+ if $count == int( $_ * scalar(@part_svc) / $columns );
+ }
+ } else {
+ print qq!<INPUT TYPE="hidden" NAME="pkg_svc$svcpart" VALUE="!,
+ $cgi->param("pkg_svc$svcpart") || $pkg_svc->quantity || 0, qq!">\n!;
+ }
+}
+
+#unless ( $cgi->param('clone') ) {
+#dunno why...
+unless ( 0 ) {
+ print "</TR></TABLE></TD></TR></TABLE>";
+ #print "</TR></TABLE>";
+}
+
+foreach my $f ( qw( clone pkgnum ) ) {
+ print qq!<INPUT TYPE="hidden" NAME="$f" VALUE="!. $cgi->param($f). '">';
+}
+print '<INPUT TYPE="hidden" NAME="pkgpart" VALUE="'. $part_pkg->pkgpart. '">';
+
+# prolly should be in database
+tie my %plans, 'Tie::IxHash',
+ 'flat' => {
+ 'name' => 'Flat rate (anniversary billing)',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => 'what.recur_fee.value',
+ },
+
+ 'flat_delayed' => {
+ 'name' => 'Free for X days, then flat rate (anniversary billing)',
+ 'fields' => {
+ 'free_days' => { 'name' => 'Initial free days',
+ 'default' => 0,
+ },
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'free_days', 'setup_fee', 'recur_fee' ],
+ 'setup' => '\'my $d = $cust_pkg->bill || $time; $d += 86400 * \' + what.free_days.value + \'; $cust_pkg->bill($d); $cust_pkg_mod_flag=1; \' + what.setup_fee.value',
+ 'recur' => 'what.recur_fee.value',
+ },
+
+ 'prorate' => {
+ 'name' => 'First partial month pro-rated, then flat-rate (1st of month billing)',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; my $mstart = timelocal(0,0,0,1,$mon,$year); my $mend = timelocal(0,0,0,1, $mon == 11 ? 0 : $mon+1, $year+($mon==11)); $sdate = $mstart; ( $part_pkg->freq - 1 ) * \' + what.recur_fee.value + \' / $part_pkg->freq + \' + what.recur_fee.value + \' / $part_pkg->freq * ($mend-$mnow) / ($mend-$mstart) ; \'',
+ },
+
+ 'subscription' => {
+ 'name' => 'First partial month full charge, then flat-rate (1st of month billing)',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $mnow = $sdate; my ($sec,$min,$hour,$mday,$mon,$year) = (localtime($sdate) )[0,1,2,3,4,5]; $sdate = timelocal(0,0,0,1,$mon,$year); \' + what.recur_fee.value',
+ },
+
+ 'flat_comission_cust' => {
+ 'name' => 'Flat rate with recurring commission per active customer',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ 'comission_amount' => { 'name' => 'Commission amount per month (per active customer)',
+ 'default' => 0,
+ },
+ 'comission_depth' => { 'name' => 'Number of layers',
+ 'default' => 1,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_main_ncancelled(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
+ },
+
+ 'flat_comission' => {
+ 'name' => 'Flat rate with recurring commission per (any) active package',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ 'comission_amount' => { 'name' => 'Commission amount per month (per active package)',
+ 'default' => 0,
+ },
+ 'comission_depth' => { 'name' => 'Number of layers',
+ 'default' => 1,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar($cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
+ },
+
+ 'flat_comission_pkg' => {
+ 'name' => 'Flat rate with recurring commission per (selected) active package',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_fee' => { 'name' => 'Recurring fee for this package',
+ 'default' => 0,
+ },
+ 'comission_amount' => { 'name' => 'Commission amount per month (per uncancelled package)',
+ 'default' => 0,
+ },
+ 'comission_depth' => { 'name' => 'Number of layers',
+ 'default' => 1,
+ },
+ 'comission_pkgpart' => { 'name' => 'Applicable packages<BR><FONT SIZE="-1">(hold <b>ctrl</b> to select multiple packages)</FONT>',
+ 'type' => 'select_multiple',
+ 'select_table' => 'part_pkg',
+ 'select_hash' => { 'disabled' => '' } ,
+ 'select_key' => 'pkgpart',
+ 'select_label' => 'pkg',
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_fee', 'comission_depth', 'comission_amount', 'comission_pkgpart' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '""; var pkgparts = ""; for ( var c=0; c < document.flat_comission_pkg.comission_pkgpart.options.length; c++ ) { if (document.flat_comission_pkg.comission_pkgpart.options[c].selected) { pkgparts = pkgparts + document.flat_comission_pkg.comission_pkgpart.options[c].value + \', \'; } } what.recur.value = \'my $error = $cust_pkg->cust_main->credit( \' + what.comission_amount.value + \' * scalar( grep { my $pkgpart = $_->pkgpart; grep { $_ == $pkgpart } ( \' + pkgparts + \' ) } $cust_pkg->cust_main->referral_cust_pkg(\' + what.comission_depth.value+ \')), "commission" ); die $error if $error; \' + what.recur_fee.value + \';\'',
+ },
+
+
+
+ 'sesmon_hour' => {
+ 'name' => 'Base charge plus charge per-hour from the session monitor',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_flat' => { 'name' => 'Base monthly charge for this package',
+ 'default' => 0,
+ },
+ 'recur_included_hours' => { 'name' => 'Hours included',
+ 'default' => 0,
+ },
+ 'recur_hourly_charge' => { 'name' => 'Additional charge per hour',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_hours', 'recur_hourly_charge' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $hours = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours;\'',
+ },
+
+ 'sesmon_minute' => {
+ 'name' => 'Base charge plus charge per-minute from the session monitor',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_flat' => { 'name' => 'Base monthly charge for this package',
+ 'default' => 0,
+ },
+ 'recur_included_min' => { 'name' => 'Minutes included',
+ 'default' => 0,
+ },
+ 'recur_minly_charge' => { 'name' => 'Additional charge per minute',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [ 'setup_fee', 'recur_flat', 'recur_included_min', 'recur_minly_charge' ],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $min = $cust_pkg->seconds_since($cust_pkg->bill || 0) / 60 - \' + what.recur_included_min.value + \'; $min = 0 if $min < 0; \' + what.recur_flat.value + \' + \' + what.recur_minly_charge.value + \' * $min;\'',
+
+ },
+
+ 'sqlradacct_hour' => {
+ 'name' => 'Base charge plus charge per-hour (and for data) from an external sqlradius radacct table',
+ 'fields' => {
+ 'setup_fee' => { 'name' => 'Setup fee for this package',
+ 'default' => 0,
+ },
+ 'recur_flat' => { 'name' => 'Base monthly charge for this package',
+ 'default' => 0,
+ },
+ 'recur_included_hours' => { 'name' => 'Hours included',
+ 'default' => 0,
+ },
+ 'recur_hourly_charge' => { 'name' => 'Additional charge per hour',
+ 'default' => 0,
+ },
+ 'recur_included_input' => { 'name' => 'Input megabytes included',
+ 'default' => 0,
+ },
+ 'recur_input_charge' => { 'name' =>
+ 'Additional charge per input megabyte',
+ 'default' => 0,
+ },
+ 'recur_included_output' => { 'name' => 'Output megabytes included',
+ 'default' => 0,
+ },
+ 'recur_output_charge' => { 'name' =>
+ 'Additional charge per output megabyte',
+ 'default' => 0,
+ },
+ 'recur_included_total' => { 'name' =>
+ 'Total input+output megabytes included',
+ 'default' => 0,
+ },
+ 'recur_total_charge' => { 'name' =>
+ 'Additional charge per input+output megabyte',
+ 'default' => 0,
+ },
+ },
+ 'fieldorder' => [qw( setup_fee recur_flat recur_included_hours recur_hourly_charge recur_included_input recur_input_charge recur_included_output recur_output_charge recur_included_total recur_total_charge )],
+ 'setup' => 'what.setup_fee.value',
+ 'recur' => '\'my $last_bill = $cust_pkg->last_bill; my $hours = $cust_pkg->seconds_since_sqlradacct($last_bill, $sdate ) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; my $input = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctInputOctets\" ) / 1048576; my $output = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctOutputOctets\" ) / 1048576; my $total = $input + $output - \' + what.recur_included_total.value + \'; $total = 0 if $total < 0; my $input = $input - \' + what.recur_included_input.value + \'; $input = 0 if $input < 0; my $output = $output - \' + what.recur_included_output.value + \'; $output = 0 if $output < 0; my $totalcharge = sprintf(\"%.2f\", \' + what.recur_total_charge.value + \' * $total); my $hourscharge = sprintf(\"%.2f\", \' + what.recur_hourly_charge.value + \' * $hours); push @details, \"Last month\\\'s excess data \". sprintf(\"%.1f\", $total). \" megs: \\\$$totalcharge\", \"Last month\\\'s excess time \". sprintf(\"%.1f\", $hours). \" hours: \\\$$hourscharge\"; \' + what.recur_flat.value + \' + $hourscharge + \' + what.recur_input_charge.value + \' * $input + \' + what.recur_output_charge.value + \' * $output + $totalcharge ;\'',
+ },
+
+;
+
+my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
+ split("\n", $part_pkg->plandata );
+
+tie my %options, 'Tie::IxHash', map { $_=>$plans{$_}->{'name'} } keys %plans;
+
+my @form_select = ();
+if ( $conf->exists('enable_taxclasses') ) {
+ push @form_select, 'taxclass';
+} else {
+ push @fixups, 'taxclass'; #hidden
+}
+
+
+my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => $part_pkg->plan,
+ 'options' => \%options,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/part_pkg.cgi',
+ 'form_text' => [ qw(pkg comment freq clone pkgnum pkgpart), @fixups ],
+ 'form_checkbox' => [ qw(setuptax recurtax disabled) ],
+ 'form_select' => [ @form_select ],
+ 'fixup_callback' => sub {
+ #my $ = @_;
+ my $html = '';
+ for my $p ( keys %plans ) {
+ $html .= "if ( what.plan.value == \"$p\" ) {
+ what.setup.value = $plans{$p}->{setup} ;
+ what.recur.value = $plans{$p}->{recur} ;
+ }\n";
+ }
+ $html;
+ },
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="plan" VALUE="$layer">!.
+ ntable("#cccccc",2);
+ my $href = $plans{$layer}->{'fields'};
+ foreach my $field ( exists($plans{$layer}->{'fieldorder'})
+ ? @{$plans{$layer}->{'fieldorder'}}
+ : keys %{ $href }
+ ) {
+
+ $html .= '<TR><TD ALIGN="right">'. $href->{$field}{'name'}. '</TD><TD>';
+
+ if ( ! exists($href->{$field}{'type'}) ) {
+ $html .= qq!<INPUT TYPE="text" NAME="$field" VALUE="!.
+ ( exists($plandata{$field})
+ ? $plandata{$field}
+ : $href->{$field}{'default'} ).
+ qq!" onChange="fchanged(this)">!;
+ } elsif ( $href->{$field}{'type'} eq 'select_multiple' ) {
+ $html .= qq!<SELECT MULTIPLE NAME="$field" onChange="fchanged(this)">!;
+ foreach my $record (
+ qsearch( $href->{$field}{'select_table'},
+ $href->{$field}{'select_hash'} )
+ ) {
+ my $value = $record->getfield($href->{$field}{'select_key'});
+ $html .= qq!<OPTION VALUE="$value"!.
+ ( $plandata{$field} =~ /(^|, *)$value *(,|$)/
+ ? ' SELECTED'
+ : '' ).
+ '>'. $record->getfield($href->{$field}{'select_label'})
+ }
+ $html .= '</SELECT>';
+ }
+
+ $html .= '</TD></TR>';
+ }
+ $html .= '</TABLE>';
+
+ $html .= '<INPUT TYPE="hidden" NAME="plandata" VALUE="'.
+ join(',', keys %{ $href } ). '">'.
+ '<BR><BR>';
+
+ $html .= '<INPUT TYPE="submit" VALUE="'.
+ ( $hashref->{pkgpart} ? "Apply changes" : "Add package" ).
+ '" onClick="fchanged(this)">';
+
+ $html .= '<BR><BR>don\'t edit this unless you know what you\'re doing '.
+ '<INPUT TYPE="button" VALUE="refresh expressions" '.
+ 'onClick="fchanged(this)">'.
+ ntable("#cccccc",2).
+ '<TR><TD>'.
+ '<FONT SIZE="1">Setup expression<BR>'.
+ '<INPUT TYPE="text" NAME="setup" SIZE="160" VALUE="'.
+ encode_entities($hashref->{setup}). '" onLoad="fchanged(this)">'.
+ '</FONT><BR>'.
+ '<FONT SIZE="1">Recurring espression<BR>'.
+ '<INPUT TYPE="text" NAME="recur" SIZE="160" VALUE="'.
+ encode_entities($hashref->{recur}). '" onLoad="fchanged(this)">'.
+ '</FONT>'.
+ '</TR></TD>'.
+ '</TABLE>';
+
+ $html;
+
+ },
+);
+
+%>
+
+<BR>
+Price plan <%= $widget->html %>
+ </BODY>
+</HTML>
diff --git a/httemplate/edit/part_referral.cgi b/httemplate/edit/part_referral.cgi
new file mode 100755
index 000000000..f784dfa3e
--- /dev/null
+++ b/httemplate/edit/part_referral.cgi
@@ -0,0 +1,48 @@
+<!-- mason kludge -->
+<%
+
+my $part_referral;
+if ( $cgi->param('error') ) {
+ $part_referral = new FS::part_referral ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_referral')
+ } );
+} elsif ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } );
+} else { #adding
+ $part_referral = new FS::part_referral {};
+}
+my $action = $part_referral->refnum ? 'Edit' : 'Add';
+my $hashref = $part_referral->hashref;
+
+my $p1 = popurl(1);
+print header("$action Advertising source", menubar(
+ 'Main Menu' => popurl(2),
+ 'View all advertising sources' => popurl(2). "browse/part_referral.cgi",
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/part_referral.cgi" METHOD=POST>!;
+
+print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$hashref->{refnum}">!;
+#print "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)";
+
+print <<END;
+Advertising source <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="$hashref->{referral}">
+END
+
+print qq!<BR><INPUT TYPE="submit" VALUE="!,
+ $hashref->{refnum} ? "Apply changes" : "Add advertising source",
+ qq!">!;
+
+print <<END;
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/part_router_field.cgi b/httemplate/edit/part_router_field.cgi
new file mode 100644
index 000000000..02962b1c0
--- /dev/null
+++ b/httemplate/edit/part_router_field.cgi
@@ -0,0 +1,71 @@
+<!-- mason kludge -->
+<%
+my ($routerfieldpart, $part_router_field);
+
+if ( $cgi->param('error') ) {
+ $part_router_field = new FS::part_router_field ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_router_field')});
+ $routerfieldpart = $part_router_field->routerfieldpart;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $routerfieldpart=$1;
+ $part_router_field=qsearchs('part_router_field',
+ {'routerfieldpart' => $routerfieldpart})
+ or die "Unknown routerfieldpart!";
+
+ } else { #adding
+ $part_router_field = new FS::part_router_field({});
+ }
+}
+my $action = $part_router_field->routerfieldpart ? 'Edit' : 'Add';
+
+my $p1 = popurl(1);
+print header("$action Router Extended Field Definition",
+ menubar('Main Menu' => $p,
+ 'View all Extended Fields' => $p. 'browse/generic.cgi?part_router_field')
+ );
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+%>
+<FORM ACTION="<%=$p1%>process/generic.cgi" METHOD=POST>
+
+<INPUT TYPE="hidden" NAME="table" VALUE="part_router_field">
+<INPUT TYPE="hidden" NAME="routerfieldpart" VALUE="<%=
+ $routerfieldpart%>">
+Field #<B><%=$routerfieldpart or "(NEW)"%></B><BR><BR>
+
+<%=ntable("#cccccc",2)%>
+ <TR>
+ <TD ALIGN="right">Name</TD>
+ <TD><INPUT TYPE="text" NAME="name" MAXLENGTH=15 VALUE="<%=
+ $part_router_field->name%>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Length</TD>
+ <TD><INPUT TYPE="text" NAME="length" MAXLENGTH=4 VALUE="<%=
+ $part_router_field->length%>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">check_block</TD>
+ <TD><TEXTAREA COLS="20" ROWS="4" NAME="check_block"><%=
+ $part_router_field->check_block%></TEXTAREA></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">list_source</TD>
+ <TD><TEXTAREA COLS="20" ROWS="4" NAME="list_source"><%=
+ $part_router_field->list_source%></TEXTAREA></TD>
+ </TR>
+</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">
+
+</FORM>
+
+<BR><BR>
+<FONT SIZE=-2>If you don't understand what <I>check_block</I> and
+<I>list_source</I> mean, <B>LEAVE THEM BLANK</B>. We mean it.</FONT>
+
+
+</BODY>
+</HTML>
diff --git a/httemplate/edit/part_sb_field.cgi b/httemplate/edit/part_sb_field.cgi
new file mode 100644
index 000000000..9e0cc9e4f
--- /dev/null
+++ b/httemplate/edit/part_sb_field.cgi
@@ -0,0 +1,79 @@
+<!-- mason kludge -->
+<%
+my ($sbfieldpart, $part_sb_field);
+
+if ( $cgi->param('error') ) {
+ $part_sb_field = new FS::part_sb_field ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_sb_field')});
+ $sbfieldpart = $part_sb_field->sbfieldpart;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $sbfieldpart=$1;
+ $part_sb_field=qsearchs('part_sb_field',
+ {'sbfieldpart' => $sbfieldpart})
+ or die "Unknown sbfieldpart!";
+
+ } else { #adding
+ $part_sb_field = new FS::part_sb_field({});
+ }
+}
+my $action = $part_sb_field->sbfieldpart ? 'Edit' : 'Add';
+
+my $p1 = popurl(1);
+print header("$action svc_broadband Extended Field Definition", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+%>
+<FORM ACTION="<%=$p1%>process/generic.cgi" METHOD="POST">
+
+<INPUT TYPE="hidden" NAME="table" VALUE="part_sb_field">
+<INPUT TYPE="hidden" NAME="redirect_ok"
+ VALUE="<%=popurl(2)%>browse/part_sb_field.cgi">
+<INPUT TYPE="hidden" NAME="sbfieldpart" VALUE="<%=
+ $sbfieldpart%>">
+Field #<B><%=$sbfieldpart or "(NEW)"%></B><BR><BR>
+
+<%=ntable("#cccccc",2)%>
+ <TR>
+ <TD ALIGN="right">Name</TD>
+ <TD><INPUT TYPE="text" NAME="name" MAXLENGTH=15 VALUE="<%=
+ $part_sb_field->name%>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Length</TD>
+ <TD><INPUT TYPE="text" NAME="length" MAXLENGTH=4 VALUE="<%=
+ $part_sb_field->length%>"></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Service</TD>
+ <TD><SELECT SIZE=1 NAME="svcpart"><%
+ foreach my $part_svc (qsearch('part_svc', {svcdb => 'svc_broadband'})) {
+ %><OPTION VALUE="<%=$part_svc->svcpart%>"<%=
+ ($part_svc->svcpart == $part_sb_field->svcpart) ? ' SELECTED' : ''%>">
+ <%=$part_svc->svc%>
+ <% } %>
+ </SELECT></TD>
+ <TR>
+ <TD ALIGN="right">check_block</TD>
+ <TD><TEXTAREA COLS="20" ROWS="4" NAME="check_block"><%=
+ $part_sb_field->check_block%></TEXTAREA></TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">list_source</TD>
+ <TD><TEXTAREA COLS="20" ROWS="4" NAME="list_source"><%=
+ $part_sb_field->list_source%></TEXTAREA></TD>
+ </TR>
+</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">
+
+</FORM>
+
+<BR><BR>
+<FONT SIZE=-2>If you don't understand what <I>check_block</I> and
+<I>list_source</I> mean, <B>LEAVE THEM BLANK</B>. We mean it.</FONT>
+
+
+</BODY>
+</HTML>
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
new file mode 100755
index 000000000..d4bb4704c
--- /dev/null
+++ b/httemplate/edit/part_svc.cgi
@@ -0,0 +1,249 @@
+<!-- mason kludge -->
+<%
+ my $part_svc;
+ my $clone = '';
+ if ( $cgi->param('error') ) { #error
+ $part_svc = new FS::part_svc ( {
+ map { $_, scalar($cgi->param($_)) } fields('part_svc')
+ } );
+ } elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone
+ #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query";
+ $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } )
+ or die "unknown svcpart: $1";
+ $clone = $part_svc->svcpart;
+ $part_svc->svcpart('');
+ } elsif ( $cgi->keywords ) { #edit
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "malformed query: $query";
+ $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } )
+ or die "unknown svcpart: $1";
+ } else { #adding
+ $part_svc = new FS::part_svc {};
+ }
+ my $action = $part_svc->svcpart ? 'Edit' : 'Add';
+ my $hashref = $part_svc->hashref;
+# my $p_svcdb = $part_svc->svcdb || 'svc_acct';
+
+
+ #" onLoad=\"visualize()\""
+%>
+
+<%= header("$action Service Definition",
+ menubar( 'Main Menu' => $p,
+ 'View all service definitions' => "${p}browse/part_svc.cgi"
+ ),
+ )
+%>
+
+<% if ( $cgi->param('error') ) { %>
+<FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+<% } %>
+
+<FORM NAME="dummy">
+
+ Service Part #<%= $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %>
+<BR><BR>
+Service <INPUT TYPE="text" NAME="svc" VALUE="<%= $hashref->{svc} %>"><BR>
+Disable new orders <INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<%= $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>><BR>
+<INPUT TYPE="hidden" NAME="svcpart" VALUE="<%= $hashref->{svcpart} %>">
+<BR>
+Services are items you offer to your customers.
+<UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
+ <LI>svc_domain - Domains
+ <LI>svc_forward - mail forwarding
+ <LI>svc_www - Virtual domain website
+ <LI>svc_broadband - Broadband/High-speed Internet service
+<!-- <LI>svc_charge - One-time charges (Partially unimplemented)
+ <LI>svc_wo - Work orders (Partially unimplemented)
+-->
+</UL>
+For the selected table, you can give fields default or fixed (unchangable)
+values. For example, a SLIP/PPP account may have a default (or perhaps fixed)
+<B>slipip</B> of <B>0.0.0.0</B>, while a POP mailbox will probably have a fixed
+blank <B>slipip</B> as well as a fixed shell something like <B>/bin/true</B> or
+<B>/usr/bin/passwd</B>.
+<BR><BR>
+
+<%
+#these might belong somewhere else for other user interfaces
+#pry need to eventually create stuff that's shared amount UIs
+my %defs = (
+ 'svc_acct' => {
+ 'dir' => 'Home directory',
+ 'uid' => 'UID (set to fixed and blank for dial-only)',
+ 'slipip' => 'IP address (Set to fixed and blank to disable dialin, or, set a value to be exported to RADIUS Framed-IP-Address. Use the special value <code>0e0</code> [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)',
+# 'popnum' => qq!<A HREF="$p/browse/svc_acct_pop.cgi/">POP number</A>!,
+ 'popnum' => {
+ desc => 'Access number',
+ type => 'select',
+ select_table => 'svc_acct_pop',
+ select_key => 'popnum',
+ select_label => 'city',
+ },
+ 'username' => {
+ desc => 'Username',
+ type => 'disabled',
+ },
+ 'quota' => '',
+ '_password' => 'Password',
+ 'gid' => 'GID (when blank, defaults to UID)',
+ 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the <b>shells</b> configuration file)',
+ 'finger' => 'GECOS',
+ 'domsvc' => {
+ desc =>'svcnum from svc_domain',
+ type =>'select',
+ select_table => 'svc_domain',
+ select_key => 'svcnum',
+ select_label => 'domain',
+ },
+ 'usergroup' => {
+ desc =>'ICRADIUS/FreeRADIUS groups',
+ type =>'radius_usergroup_selector',
+ },
+ },
+ 'svc_domain' => {
+ 'domain' => 'Domain',
+ },
+ 'svc_forward' => {
+ 'srcsvc' => 'service from which mail is to be forwarded',
+ 'dstsvc' => 'service to which mail is to be forwarded',
+ 'dst' => 'someone@another.domain.com to use when dstsvc is 0',
+ },
+ 'svc_charge' => {
+ 'amount' => 'amount',
+ },
+ 'svc_wo' => {
+ 'worker' => 'Worker',
+ '_date' => 'Date',
+ },
+ 'svc_www' => {
+ #'recnum' => '',
+ #'usersvc' => '',
+ },
+ 'svc_broadband' => {
+ 'actypenum' => 'This is the actypenum that refers to the type of AC that can be provisioned for this service. This field must be set fixed.',
+ 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.',
+ 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.',
+ 'acnum' => 'acnum of a specific AC that this service is restricted to. Not required',
+ 'ip_addr' => 'IP address. Leave blank for automatic assignment.',
+ 'ip_netmask' => 'Mask length, aka. netmask bits. (Eg. 255.255.255.0 == 24)',
+ 'mac_addr' => 'MAC address which is used by some ACs for access control. Specified by 6 colon seperated hex octets. (Eg. 00:00:0a:bc:1a:2b)',
+ 'location' => 'Defines the physically location at which this service was installed. This is not necessarily the billing address',
+ },
+);
+
+ my @dbs = $hashref->{svcdb}
+ ? ( $hashref->{svcdb} )
+ : qw( svc_acct svc_domain svc_forward svc_www svc_broadband );
+
+ tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs;
+ my $widget = new HTML::Widgets::SelectLayers(
+ #'selected_layer' => $p_svcdb,
+ 'selected_layer' => $hashref->{svcdb} || 'svc_acct',
+ 'options' => \%svcdb,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/part_svc.cgi',
+ 'form_text' => [ qw( svc svcpart ) ],
+ 'form_checkbox' => [ 'disabled' ],
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="svcdb" VALUE="$layer">!;
+
+ my $columns = 3;
+ my $count = 0;
+ my @part_export =
+ map { qsearch( 'part_export', {exporttype => $_ } ) }
+ keys %{FS::part_export::export_info($layer)};
+ $html .= '<BR><BR>'. table().
+ table(). "<TR><TH COLSPAN=$columns>Exports</TH></TR><TR>";
+ foreach my $part_export ( @part_export ) {
+ $html .= '<TD><INPUT TYPE="checkbox"'.
+ ' NAME="exportnum'. $part_export->exportnum. '" VALUE="1" ';
+ $html .= 'CHECKED'
+ if ( $clone || $part_svc->svcpart ) #null svcpart search causing error
+ && qsearchs( 'export_svc', {
+ exportnum => $part_export->exportnum,
+ svcpart => $clone || $part_svc->svcpart });
+ $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype.
+ ' to '. $part_export->machine. '</TD>';
+ $count++;
+ $html .= '</TR><TR>' unless $count % $columns;
+ }
+ $html .= '</TR></TABLE><BR><BR>';
+
+ $html .= table(). "<TH>Field</TH><TH COLSPAN=2>Modifier</TH>";
+ #yucky kludge
+ my @fields = defined( $FS::Record::dbdef->table($layer) )
+ ? grep { $_ ne 'svcnum' } fields($layer)
+ : ();
+ push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge
+ $part_svc->svcpart($clone) if $clone; #haha, undone below
+ foreach my $field (@fields) {
+ my $part_svc_column = $part_svc->part_svc_column($field);
+ my $value = $cgi->param('error')
+ ? $cgi->param("${layer}__${field}")
+ : $part_svc_column->columnvalue;
+ my $flag = $cgi->param('error')
+ ? $cgi->param("${layer}__${field}_flag")
+ : $part_svc_column->columnflag;
+ my $def = $defs{$layer}{$field};
+ my $desc = ref($def) ? $def->{desc} : $def;
+
+ $html .= "<TR><TD>$field";
+ $html .= "- <FONT SIZE=-1>$desc</FONT>" if $desc;
+ $html .= "</TD>";
+ $flag = '' if ref($def) && $def->{type} eq 'disabled';
+ $html .=
+ qq!<TD><INPUT TYPE="radio" NAME="${layer}__${field}_flag" VALUE=""!.
+ ' CHECKED'x($flag eq ''). ">Off</TD>".
+ '<TD>';
+ unless ( ref($def) && $def->{type} eq 'disabled' ) {
+ $html .=
+ qq!<INPUT TYPE="radio" NAME="${layer}__${field}_flag" VALUE="D"!.
+ ' CHECKED'x($flag eq 'D'). ">Default ".
+ qq!<INPUT TYPE="radio" NAME="${layer}__${field}_flag" VALUE="F"!.
+ ' CHECKED'x($flag eq 'F'). ">Fixed ".
+ '<BR>';
+ }
+ if ( ref($def) ) {
+ if ( $def->{type} eq 'select' ) {
+ $html .= qq!<SELECT NAME="${layer}__${field}">!;
+ $html .= '<OPTION> </OPTION>' unless $value;
+ foreach my $record ( qsearch( $def->{select_table}, {} ) ) {
+ my $rvalue = $record->getfield($def->{select_key});
+ $html .= qq!<OPTION VALUE="$rvalue"!.
+ ( $rvalue==$value ? ' SELECTED>' : '>' ).
+ $record->getfield($def->{select_label}). '</OPTION>';
+ }
+ $html .= '</SELECT>';
+ } elsif ( $def->{type} eq 'radius_usergroup_selector' ) {
+ $html .= FS::svc_acct::radius_usergroup_selector(
+ [ split(',', $value) ], "${layer}__${field}" );
+ } elsif ( $def->{type} eq 'disabled' ) {
+ $html .=
+ qq!<INPUT TYPE="hidden" NAME="${layer}__${field}" VALUE="">!;
+ } else {
+ $html .= '<font color="#ff0000">unknown type'. $def->{type};
+ }
+ } else {
+ $html .=
+ qq!<INPUT TYPE="text" NAME="${layer}__${field}" VALUE="$value">!;
+ }
+ $html .= "</TD></TR>\n";
+ }
+ $part_svc->svcpart('') if $clone; #undone
+ $html .= "</TABLE>";
+
+ $html .= '<BR><INPUT TYPE="submit" VALUE="'.
+ ($hashref->{svcpart} ? 'Apply changes' : 'Add service'). '">';
+
+ $html;
+
+ },
+ );
+
+%>
+Table <%= $widget->html %>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi
new file mode 100755
index 000000000..7f5c5e49c
--- /dev/null
+++ b/httemplate/edit/process/REAL_cust_pkg.cgi
@@ -0,0 +1,22 @@
+<%
+
+my $pkgnum = $cgi->param('pkgnum') or die;
+my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my %hash = $old->hash;
+$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : '';
+$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : '';
+$hash{'last_bill'} =
+ $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : '';
+$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
+my $new = new FS::cust_pkg \%hash;
+
+my $error = $new->replace($old);
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $pkgnum);
+}
+
+%>
diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi
new file mode 100755
index 000000000..34d799ccd
--- /dev/null
+++ b/httemplate/edit/process/addr_block/add.cgi
@@ -0,0 +1,20 @@
+<%
+
+my $error = '';
+my $ip_gateway = $cgi->param('ip_gateway');
+my $ip_netmask = $cgi->param('ip_netmask');
+
+my $new = new FS::addr_block {
+ ip_gateway => $ip_gateway,
+ ip_netmask => $ip_netmask,
+ routernum => 0 };
+
+$error = $new->insert;
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
+}
+%>
diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi
new file mode 100755
index 000000000..85b0d7a7a
--- /dev/null
+++ b/httemplate/edit/process/addr_block/allocate.cgi
@@ -0,0 +1,25 @@
+<%
+my $error = '';
+my $blocknum = $cgi->param('blocknum');
+my $routernum = $cgi->param('routernum');
+
+my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
+my $router = qsearchs('router', { routernum => $routernum });
+
+if($addr_block) {
+ if ($router) {
+ $error = $addr_block->allocate($router);
+ } else {
+ $error = "Cannot find router with routernum $routernum";
+ }
+} else {
+ $error = "Cannot find block with blocknum $blocknum";
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string);
+} else {
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
+}
+%>
diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi
new file mode 100755
index 000000000..cfb7ed04d
--- /dev/null
+++ b/httemplate/edit/process/addr_block/deallocate.cgi
@@ -0,0 +1,24 @@
+<%
+my $error = '';
+my $blocknum = $cgi->param('blocknum');
+
+my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
+
+if($addr_block) {
+ my $router = $addr_block->router;
+ if ($router) {
+ $error = $addr_block->deallocate($router);
+ } else {
+ $error = "Block is not allocated to a router";
+ }
+} else {
+ $error = "Cannot find block with blocknum $blocknum";
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string);
+} else {
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
+}
+%>
diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi
new file mode 100755
index 000000000..bb6d4ba3e
--- /dev/null
+++ b/httemplate/edit/process/addr_block/split.cgi
@@ -0,0 +1,19 @@
+<%
+my $error = '';
+my $blocknum = $cgi->param('blocknum');
+my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
+
+if ( $addr_block) {
+ $error = $addr_block->split_block;
+} else {
+ $error = "Unknown blocknum: $blocknum";
+}
+
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
+}
+%>
diff --git a/httemplate/edit/process/agent.cgi b/httemplate/edit/process/agent.cgi
new file mode 100755
index 000000000..182eeab41
--- /dev/null
+++ b/httemplate/edit/process/agent.cgi
@@ -0,0 +1,28 @@
+<%
+
+my $agentnum = $cgi->param('agentnum');
+
+my $old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum;
+
+my $new = new FS::agent ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('agent')
+} );
+
+my $error;
+if ( $agentnum ) {
+ $error=$new->replace($old);
+} else {
+ $error=$new->insert;
+ $agentnum=$new->getfield('agentnum');
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "browse/agent.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi
new file mode 100755
index 000000000..516594573
--- /dev/null
+++ b/httemplate/edit/process/agent_type.cgi
@@ -0,0 +1,55 @@
+<%
+
+my $typenum = $cgi->param('typenum');
+my $old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum;
+
+my $new = new FS::agent_type ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('agent_type')
+} );
+
+my $error;
+if ( $typenum ) {
+ $error=$new->replace($old);
+} else {
+ $error=$new->insert;
+ $typenum=$new->getfield('typenum');
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
+} else {
+
+ #false laziness w/ edit/process/part_svc.cgi
+ foreach my $part_pkg (qsearch('part_pkg',{})) {
+ my($pkgpart)=$part_pkg->getfield('pkgpart');
+
+ my($type_pkgs)=qsearchs('type_pkgs',{
+ 'typenum' => $typenum,
+ 'pkgpart' => $pkgpart,
+ });
+ if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) {
+ my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below.
+ $error=$d_type_pkgs->delete;
+ die $error if $error;
+
+ } elsif ( $cgi->param("pkgpart$pkgpart")
+ && ! $type_pkgs
+ ) {
+ #ok to clobber it now (but bad form nonetheless?)
+ $type_pkgs=new FS::type_pkgs ({
+ 'typenum' => $typenum,
+ 'pkgpart' => $pkgpart,
+ });
+ $error= $type_pkgs->insert;
+ die $error if $error;
+ }
+
+ }
+
+ print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/cust_bill_pay.cgi b/httemplate/edit/process/cust_bill_pay.cgi
new file mode 100755
index 000000000..0c33506a8
--- /dev/null
+++ b/httemplate/edit/process/cust_bill_pay.cgi
@@ -0,0 +1,31 @@
+<%
+
+$cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
+my $paynum = $1;
+
+my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } )
+ or die "No such paynum";
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pay->custnum } )
+ or die "Bogus credit: not attached to customer";
+
+my $custnum = $cust_main->custnum;
+
+my $new = new FS::cust_bill_pay ( {
+ map {
+ $_, scalar($cgi->param($_));
+ #} qw(custnum _date amount invnum)
+ } fields('cust_bill_pay')
+} );
+
+my $error = $new->insert;
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "cust_bill_pay.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+}
+
+
+%>
diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi
new file mode 100755
index 000000000..ac92631f8
--- /dev/null
+++ b/httemplate/edit/process/cust_credit.cgi
@@ -0,0 +1,30 @@
+<%
+
+$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
+my $custnum = $1;
+
+$cgi->param('otaker',getotaker);
+
+my $new = new FS::cust_credit ( {
+ map {
+ $_, scalar($cgi->param($_));
+ #} qw(custnum _date amount otaker reason)
+ } fields('cust_credit')
+} );
+
+my $error = $new->insert;
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string );
+} else {
+ if ( $cgi->param('apply') eq 'yes' ) {
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum })
+ or die "unknown custnum $custnum";
+ $cust_main->apply_credits;
+ }
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+}
+
+
+%>
diff --git a/httemplate/edit/process/cust_credit_bill.cgi b/httemplate/edit/process/cust_credit_bill.cgi
new file mode 100755
index 000000000..23e2e6ce5
--- /dev/null
+++ b/httemplate/edit/process/cust_credit_bill.cgi
@@ -0,0 +1,43 @@
+<%
+
+$cgi->param('crednum') =~ /^(\d*)$/ or die "Illegal crednum!";
+my $crednum = $1;
+
+my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } )
+ or die "No such crednum";
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $cust_credit->custnum } )
+ or die "Bogus credit: not attached to customer";
+
+my $custnum = $cust_main->custnum;
+
+my $new;
+if ($cgi->param('invnum') =~ /^Refund$/) {
+ $new = new FS::cust_refund ( {
+ 'reason' => $cust_credit->reason,
+ 'refund' => $cgi->param('amount'),
+ 'payby' => 'BILL',
+ #'_date' => $cgi->param('_date'),
+ 'payinfo' => 'Cash',
+ 'crednum' => $crednum,
+ } );
+} else {
+ $new = new FS::cust_credit_bill ( {
+ map {
+ $_, scalar($cgi->param($_));
+ #} qw(custnum _date amount invnum)
+ } fields('cust_credit_bill')
+ } );
+}
+
+my $error = $new->insert;
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "cust_credit_bill.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+}
+
+
+%>
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
new file mode 100755
index 000000000..3700d9b96
--- /dev/null
+++ b/httemplate/edit/process/cust_main.cgi
@@ -0,0 +1,125 @@
+<%
+
+my $error = '';
+
+#unmunge stuff
+
+$cgi->param('tax','') unless defined $cgi->param('tax');
+
+$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] );
+
+my $payby = $cgi->param('payby');
+if ( $payby ) {
+ if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
+ $cgi->param('payinfo',
+ $cgi->param($payby. '_payinfo1'). '@'. $cgi->param($payby. '_payinfo2') );
+ } else {
+ $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) );
+ }
+ $cgi->param('paydate',
+ $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) );
+ $cgi->param('payname', $cgi->param( $payby. '_payname' ) );
+}
+
+$cgi->param('otaker', &getotaker );
+
+my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
+push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
+$cgi->param('invoicing_list', join(',', @invoicing_list) );
+
+#create new record object
+
+my $new = new FS::cust_main ( {
+ map {
+ $_, scalar($cgi->param($_))
+# } qw(custnum agentnum last first ss company address1 address2 city county
+# state zip daytime night fax payby payinfo paydate payname tax
+# otaker refnum)
+ } fields('cust_main')
+} );
+
+if ( defined($cgi->param('same')) && $cgi->param('same') eq "Y" ) {
+ $new->setfield("ship_$_", '') foreach qw(
+ last first company address1 address2 city county state zip
+ country daytime night fax
+ );
+}
+
+#perhaps this stuff should go to cust_main.pm
+my $cust_pkg = '';
+my $svc_acct = '';
+if ( $new->custnum eq '' ) {
+
+ if ( $cgi->param('pkgpart_svcpart') ) {
+ my $x = $cgi->param('pkgpart_svcpart');
+ $x =~ /^(\d+)_(\d+)$/;
+ my($pkgpart, $svcpart) = ($1, $2);
+ #false laziness: copied from FS::cust_pkg::order (which should become a
+ #FS::cust_main method)
+ my(%part_pkg);
+ # generate %part_pkg
+ # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart
+ my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum });
+ #my($type_pkgs);
+ #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
+ # my($pkgpart)=$type_pkgs->pkgpart;
+ # $part_pkg{$pkgpart}++;
+ #}
+ # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart
+ my $pkgpart_href = $agent->pkgpart_hashref;
+ #eslaf
+
+ # this should wind up in FS::cust_pkg!
+ $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't".
+ "purchase pkgpart ". $pkgpart
+ #unless $part_pkg{ $pkgpart };
+ unless $pkgpart_href->{ $pkgpart };
+
+ $cust_pkg = new FS::cust_pkg ( {
+ #later 'custnum' => $custnum,
+ 'pkgpart' => $pkgpart,
+ } );
+ $error ||= $cust_pkg->check;
+
+ #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } );
+
+ #$error ||= $cust_svc->check;
+
+ $svc_acct = new FS::svc_acct ( {
+ 'svcpart' => $svcpart,
+ 'username' => $cgi->param('username'),
+ '_password' => $cgi->param('_password'),
+ 'popnum' => $cgi->param('popnum'),
+ } );
+
+ my $y = $svc_acct->setdefault; # arguably should be in new method
+ $error ||= $y unless ref($y);
+ #and just in case you were silly
+ $svc_acct->svcpart($svcpart);
+ $svc_acct->username($cgi->param('username'));
+ $svc_acct->_password($cgi->param('_password'));
+ $svc_acct->popnum($cgi->param('popnum'));
+
+ $error ||= $svc_acct->check;
+
+ } elsif ( $cgi->param('username') ) { #good thing to catch
+ $error = "Can't assign username without a package!";
+ }
+
+ use Tie::RefHash;
+ tie my %hash, 'Tie::RefHash';
+ %hash = ( $cust_pkg => [ $svc_acct ] ) if $cust_pkg;
+ $error ||= $new->insert( \%hash, \@invoicing_list );
+} else { #create old record object
+ my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );
+ $error ||= "Old record not found!" unless $old;
+ $error ||= $new->replace($old, \@invoicing_list);
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new->custnum);
+}
+%>
diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi
new file mode 100755
index 000000000..8e67140a8
--- /dev/null
+++ b/httemplate/edit/process/cust_main_county-collapse.cgi
@@ -0,0 +1,35 @@
+<%
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ or die "Illegal taxnum!";
+my $taxnum = $1;
+my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
+ or die ("Unknown taxnum!");
+
+#really should do this in a .pm & start transaction
+
+foreach my $delete ( qsearch('cust_main_county', {
+ 'country' => $cust_main_county->country,
+ 'state' => $cust_main_county->state
+ } ) ) {
+# unless ( qsearch('cust_main',{
+# 'state' => $cust_main_county->getfield('state'),
+# 'county' => $cust_main_county->getfield('county'),
+# 'country' => $cust_main_county->getfield('country'),
+# } ) ) {
+ my $error = $delete->delete;
+ die $error if $error;
+# } else {
+ #should really fix the $cust_main record
+# }
+
+}
+
+$cust_main_county->taxnum('');
+$cust_main_county->county('');
+my $error = $cust_main_county->insert;
+die $error if $error;
+
+print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
+
+%>
diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi
new file mode 100755
index 000000000..a452711c1
--- /dev/null
+++ b/httemplate/edit/process/cust_main_county-expand.cgi
@@ -0,0 +1,58 @@
+<%
+
+$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
+my $taxnum = $1;
+my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
+ or die ("Unknown taxnum!");
+
+my @expansion;
+if ( $cgi->param('delim') eq 'n' ) {
+ @expansion=split(/\n/,$cgi->param('expansion'));
+} elsif ( $cgi->param('delim') eq 's' ) {
+ @expansion=split(' ',$cgi->param('expansion'));
+} else {
+ die "Illegal delim!";
+}
+
+@expansion=map {
+ unless ( /^\s*([\w\- ]+)\s*$/ ) {
+ $cgi->param('error', "Illegal item in expansion");
+ print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string );
+ myexit();
+ }
+ $1;
+} @expansion;
+
+foreach ( @expansion) {
+ my(%hash)=$cust_main_county->hash;
+ my($new)=new FS::cust_main_county \%hash;
+ $new->setfield('taxnum','');
+ if ( $cgi->param('taxclass') ) {
+ $new->setfield('taxclass', $_);
+ } elsif ( ! $cust_main_county->state ) {
+ $new->setfield('state',$_);
+ } else {
+ $new->setfield('county',$_);
+ }
+ #if (datasrc =~ m/Pg/)
+ #{
+ # $new->setfield('tax',0.0);
+ #}
+ my($error)=$new->insert;
+ die $error if $error;
+}
+
+unless ( qsearch( 'cust_main', {
+ 'state' => $cust_main_county->state,
+ 'county' => $cust_main_county->county,
+ 'country' => $cust_main_county->country,
+ } )
+ || ! @expansion
+) {
+ my($error)=($cust_main_county->delete);
+ die $error if $error;
+}
+
+print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
+
+%>
diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi
new file mode 100755
index 000000000..6d80ad512
--- /dev/null
+++ b/httemplate/edit/process/cust_main_county.cgi
@@ -0,0 +1,26 @@
+<%
+
+foreach ( grep { /^tax\d+$/ } $cgi->param ) {
+ /^tax(\d+)$/ or die "Illegal form $_!";
+ my $taxnum = $1;
+ my $old = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
+ or die "Couldn't find taxnum $taxnum!";
+ next unless $old->tax != $cgi->param("tax$taxnum")
+ || $old->exempt_amount != $cgi->param("exempt_amount$taxnum")
+ || $old->taxname ne $cgi->param("taxname$taxnum");
+ my %hash = $old->hash;
+ $hash{tax} = $cgi->param("tax$taxnum");
+ $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum");
+ $hash{taxname} = $cgi->param("taxname$taxnum");
+ my $new = new FS::cust_main_county \%hash;
+ my $error = $new->replace($old);
+ if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
+ myexit();
+ }
+}
+
+print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
+
+%>
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi
new file mode 100755
index 000000000..82442ae00
--- /dev/null
+++ b/httemplate/edit/process/cust_pay.cgi
@@ -0,0 +1,39 @@
+<%
+
+$cgi->param('linknum') =~ /^(\d+)$/
+ or die "Illegal linknum: ". $cgi->param('linknum');
+my $linknum = $1;
+
+$cgi->param('link') =~ /^(custnum|invnum)$/
+ or die "Illegal link: ". $cgi->param('link');
+my $link = $1;
+
+my $new = new FS::cust_pay ( {
+ $link => $linknum,
+ map {
+ $_, scalar($cgi->param($_));
+ } qw(paid _date payby payinfo paybatch)
+ #} fields('cust_pay')
+} );
+
+my $error = $new->insert;
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string );
+} elsif ( $link eq 'invnum' ) {
+ print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum");
+} elsif ( $link eq 'custnum' ) {
+ if ( $cgi->param('apply') eq 'yes' ) {
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
+ or die "unknown custnum $linknum";
+ $cust_main->apply_payments;
+ }
+ if ( $cgi->param('quickpay') eq 'yes' ) {
+ print $cgi->redirect(popurl(3). "search/cust_main-quickpay.html");
+ } else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$linknum");
+ }
+}
+
+%>
diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi
new file mode 100755
index 000000000..df8471c27
--- /dev/null
+++ b/httemplate/edit/process/cust_pkg.cgi
@@ -0,0 +1,43 @@
+<%
+
+my $error = '';
+
+#untaint custnum
+$cgi->param('custnum') =~ /^(\d+)$/;
+my $custnum = $1;
+
+my @remove_pkgnums = map {
+ /^(\d+)$/ or die "Illegal remove_pkg value!";
+ $1;
+} $cgi->param('remove_pkg');
+
+my $error_redirect;
+my @pkgparts;
+if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi
+ $error_redirect = "misc/change_pkg.cgi";
+ @pkgparts = ($1);
+} else { #came from edit/cust_pkg.cgi
+ $error_redirect = "edit/cust_pkg.cgi";
+ foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) {
+ if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) {
+ my $num_pkgs = $1;
+ while ( $num_pkgs-- ) {
+ push @pkgparts,$pkgpart;
+ }
+ } else {
+ $error = "Illegal quantity";
+ last;
+ }
+ }
+}
+
+$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
+}
+
+%>
diff --git a/httemplate/edit/process/domain_record.cgi b/httemplate/edit/process/domain_record.cgi
new file mode 100755
index 000000000..b8c3f62a1
--- /dev/null
+++ b/httemplate/edit/process/domain_record.cgi
@@ -0,0 +1,34 @@
+<%
+
+my $recnum = $cgi->param('recnum');
+
+my $old = qsearchs('agent',{'recnum'=>$recnum}) if $recnum;
+
+my $new = new FS::domain_record ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('domain_record')
+} );
+
+my $error;
+if ( $recnum ) {
+ $error=$new->replace($old);
+} else {
+ $error=$new->insert;
+ $recnum=$new->getfield('recnum');
+}
+
+if ( $error ) {
+# $cgi->param('error', $error);
+# print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string );
+ #no edit screen to send them back to
+%>
+<!-- mason kludge -->
+<%
+ eidiot($error);
+} else {
+ my $svcnum = $new->svcnum;
+ print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/edit/process/generic.cgi b/httemplate/edit/process/generic.cgi
new file mode 100644
index 000000000..9c54feb1d
--- /dev/null
+++ b/httemplate/edit/process/generic.cgi
@@ -0,0 +1,70 @@
+<%
+
+# Welcome to generic.cgi.
+#
+# This script provides a generic edit/process/ backend for simple table
+# editing. All it knows how to do is take the values entered into
+# the script and insert them into the table specified by $cgi->param('table').
+# If there's an existing record with the same primary key, it will be
+# replaced. (Deletion will be added in the future.)
+#
+# Special cgi params for this script:
+# table: the name of the table to be edited. The script will die horribly
+# if it can't find the table.
+# redirect_ok: URL to be displayed after a successful edit. The value of
+# the record's primary key will be passed as a keyword.
+# Defaults to (freeside root)/view/$table.cgi.
+# redirect_error: URL to be displayed if there's an error. The original
+# query string, plus the error message, will be passed.
+# Defaults to $cgi->referer() (i.e. go back where you
+# came from).
+
+
+use FS::Record qw(qsearchs dbdef);
+use DBIx::DBSchema;
+use DBIx::DBSchema::Table;
+
+
+my $error;
+my $p2 = popurl(2);
+my $p3 = popurl(3);
+my $table = $cgi->param('table');
+my $dbdef = dbdef or die "Cannot fetch dbdef!";
+
+my $dbdef_table = $dbdef->table($table) or die "Cannot fetch schema for $table";
+
+my $pkey = $dbdef_table->primary_key or die "Cannot fetch pkey for $table";
+my $pkey_val = $cgi->param($pkey);
+
+
+#warn "new FS::Record ( $table, (hashref) )";
+my $new = FS::Record::new ( "FS::$table", {
+ map { $_, scalar($cgi->param($_)) } fields($table)
+} );
+
+#warn 'created $new of class '.ref($new);
+
+if($pkey_val and (my $old = qsearchs($table, { $pkey, $pkey_val} ))) {
+ # edit
+ $error = $new->replace($old);
+} else {
+ #add
+ $error = $new->insert;
+ $pkey_val = $new->getfield($pkey);
+ # New records usually don't have their primary keys set until after
+ # they've been checked/inserted, so grab the new $pkey_val so we can
+ # redirect to it.
+}
+
+my $redirect_ok = (($cgi->param('redirect_ok')) ?
+ $cgi->param('redirect_ok') : $p3."browse/generic.cgi?$table");
+my $redirect_error = (($cgi->param('redirect_error')) ?
+ $cgi->param('redirect_error') : $cgi->referer());
+
+if($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect($redirect_error . '?' . $cgi->query_string);
+} else {
+ print $cgi->redirect($redirect_ok);
+}
+%>
diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi
new file mode 100644
index 000000000..1f94f6668
--- /dev/null
+++ b/httemplate/edit/process/msgcat.cgi
@@ -0,0 +1,20 @@
+<%
+
+my $error;
+foreach my $param ( grep { /^\d+$/ } $cgi->param ) {
+ my $old = qsearchs('msgcat', { msgnum=>$param } );
+ next if $old->msg eq $cgi->param($param); #no need to update identical records
+ my $new = new FS::msgcat { $old->hash };
+ $new->msg($cgi->param($param));
+ $error = $new->replace($old);
+ last if $error;
+}
+
+if ( $error ) {
+ $cgi->param('error',$error);
+ print $cgi->redirect($p. "msgcat.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "browse/msgcat.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/part_bill_event.cgi b/httemplate/edit/process/part_bill_event.cgi
new file mode 100755
index 000000000..e224bf634
--- /dev/null
+++ b/httemplate/edit/process/part_bill_event.cgi
@@ -0,0 +1,53 @@
+<%
+
+my $eventpart = $cgi->param('eventpart');
+
+my $old = qsearchs('part_bill_event',{'eventpart'=>$eventpart}) if $eventpart;
+
+#s/days/seconds/
+$cgi->param('seconds', $cgi->param('days') * 86400 );
+
+my $error;
+if ( ! $cgi->param('plan_weight_eventcode') ) {
+ $error = "Must select an action";
+} else {
+
+ $cgi->param('plan_weight_eventcode') =~ /^([\w\-]+):(\d+):(.*)$/s
+ or die "illegal plan_weight_eventcode:".
+ $cgi->param('plan_weight_eventcode');
+ $cgi->param('plan', $1);
+ $cgi->param('weight', $2);
+ my $eventcode = $3;
+ my $plandata = '';
+ while ( $eventcode =~ /%%%(\w+)%%%/ ) {
+ my $field = $1;
+ my $value = $cgi->param($field);
+ $eventcode =~ s/%%%$field%%%/$value/;
+ $plandata .= "$field $value\n";
+ }
+ $cgi->param('eventcode', $eventcode);
+ $cgi->param('plandata', $plandata);
+
+ my $new = new FS::part_bill_event ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('part_bill_event'),
+ } );
+
+ if ( $eventpart ) {
+ $error = $new->replace($old);
+ } else {
+ $error = $new->insert;
+ $eventpart = $new->getfield('eventpart');
+ }
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "part_bill_event.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3)."browse/part_bill_event.cgi");
+}
+
+%>
+
diff --git a/httemplate/edit/process/part_export.cgi b/httemplate/edit/process/part_export.cgi
new file mode 100644
index 000000000..fa009edbb
--- /dev/null
+++ b/httemplate/edit/process/part_export.cgi
@@ -0,0 +1,39 @@
+<%
+
+my $exportnum = $cgi->param('exportnum');
+
+my $old = qsearchs('part_export', { 'exportnum'=>$exportnum } ) if $exportnum;
+
+#fixup options
+#warn join('-', split(',',$cgi->param('options')));
+my %options = map {
+ my $value = $cgi->param($_);
+ $value =~ s/\r\n/\n/g; #browsers? (textarea)
+ $_ => $value;
+} split(',', $cgi->param('options'));
+
+my $new = new FS::part_export ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('part_export')
+} );
+
+my $error;
+if ( $exportnum ) {
+ #warn $old;
+ #warn $exportnum;
+ #warn $new->machine;
+ $error = $new->replace($old,\%options);
+} else {
+ $error = $new->insert(\%options);
+# $exportnum = $new->exportnum;
+}
+
+if ( $error ) {
+ $cgi->param('error', $error );
+ print $cgi->redirect(popurl(2). "part_export.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "browse/part_export.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi
new file mode 100755
index 000000000..d489426f9
--- /dev/null
+++ b/httemplate/edit/process/part_pkg.cgi
@@ -0,0 +1,109 @@
+<%
+
+my $dbh = dbh;
+
+my $pkgpart = $cgi->param('pkgpart');
+
+my $old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart;
+
+#fixup plandata
+my $plandata = $cgi->param('plandata');
+my @plandata = split(',', $plandata);
+$cgi->param('plandata',
+ join('', map { "$_=". join(', ', $cgi->param($_)). "\n" } @plandata )
+);
+
+foreach (qw( setuptax recurtax disabled )) {
+ $cgi->param($_, '') unless defined $cgi->param($_);
+}
+
+my $new = new FS::part_pkg ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('part_pkg')
+} );
+
+#warn "setuptax: ". $new->setuptax;
+#warn "recurtax: ". $new->recurtax;
+
+#most of the stuff below should move to part_pkg.pm
+
+foreach my $part_svc ( qsearch('part_svc', {} ) ) {
+ my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0;
+ unless ( $quantity =~ /^(\d+)$/ ) {
+ $cgi->param('error', "Illegal quantity" );
+ print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
+ myexit();
+ }
+}
+
+local $SIG{HUP} = 'IGNORE';
+local $SIG{INT} = 'IGNORE';
+local $SIG{QUIT} = 'IGNORE';
+local $SIG{TERM} = 'IGNORE';
+local $SIG{TSTP} = 'IGNORE';
+local $SIG{PIPE} = 'IGNORE';
+
+local $FS::UID::AutoCommit = 0;
+
+my $error;
+if ( $pkgpart ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $pkgpart=$new->pkgpart;
+}
+if ( $error ) {
+ $dbh->rollback;
+ $cgi->param('error', $error );
+ print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
+ myexit();
+}
+
+foreach my $part_svc (qsearch('part_svc',{})) {
+ my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0;
+ my $old_pkg_svc = qsearchs('pkg_svc', {
+ 'pkgpart' => $pkgpart,
+ 'svcpart' => $part_svc->svcpart,
+ } );
+ my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0;
+ next unless $old_quantity != $quantity; #!here
+ my $new_pkg_svc = new FS::pkg_svc( {
+ 'pkgpart' => $pkgpart,
+ 'svcpart' => $part_svc->svcpart,
+ 'quantity' => $quantity,
+ } );
+ if ( $old_pkg_svc ) {
+ my $myerror = $new_pkg_svc->replace($old_pkg_svc);
+ if ( $myerror ) {
+ $dbh->rollback;
+ die $myerror;
+ }
+ } else {
+ my $myerror = $new_pkg_svc->insert;
+ if ( $myerror ) {
+ $dbh->rollback;
+ die $myerror;
+ }
+ }
+}
+
+unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
+ $dbh->commit or die $dbh->errstr;
+ print $cgi->redirect(popurl(3). "browse/part_pkg.cgi");
+} else {
+ my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } );
+ my %hash = $old_cust_pkg->hash;
+ $hash{'pkgpart'} = $pkgpart;
+ my($new_cust_pkg) = new FS::cust_pkg \%hash;
+ my $myerror = $new_cust_pkg->replace($old_cust_pkg);
+ if ( $myerror ) {
+ $dbh->rollback;
+ die "Error modifying cust_pkg record: $myerror\n";
+ }
+
+ $dbh->commit or die $dbh->errstr;
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum);
+}
+
+%>
diff --git a/httemplate/edit/process/part_referral.cgi b/httemplate/edit/process/part_referral.cgi
new file mode 100755
index 000000000..fd2c01506
--- /dev/null
+++ b/httemplate/edit/process/part_referral.cgi
@@ -0,0 +1,28 @@
+<%
+
+my $refnum = $cgi->param('refnum');
+
+my $new = new FS::part_referral ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('part_referral')
+} );
+
+my $error;
+if ( $refnum ) {
+ my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } );
+ die "(Old) Record not found!" unless $old;
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+}
+$refnum=$new->refnum;
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "browse/part_referral.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi
new file mode 100755
index 000000000..9633fabdf
--- /dev/null
+++ b/httemplate/edit/process/part_svc.cgi
@@ -0,0 +1,62 @@
+<%
+
+my $svcpart = $cgi->param('svcpart');
+
+my $old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart;
+
+$cgi->param( 'svc_acct__usergroup',
+ join(',', $cgi->param('svc_acct__usergroup') ) );
+
+my $new = new FS::part_svc ( {
+ map {
+ $_, scalar($cgi->param($_));
+# } qw(svcpart svc svcdb)
+ } ( fields('part_svc'),
+ map { my $svcdb = $_;
+ my @fields = fields($svcdb);
+ push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
+ map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields;
+ } grep defined( $FS::Record::dbdef->table($_) ),
+ qw( svc_acct svc_domain svc_forward svc_www svc_broadband )
+ )
+} );
+
+my $error;
+if ( $svcpart ) {
+ $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ] );
+} else {
+ $error = $new->insert( [ 'usergroup' ] );
+ $svcpart=$new->getfield('svcpart');
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string );
+} else {
+
+ #false laziness w/ edit/process/agent_type.cgi
+ foreach my $part_export (qsearch('part_export',{})) {
+ my $exportnum = $part_export->exportnum;
+ my $export_svc = qsearchs('export_svc', {
+ 'exportnum' => $part_export->exportnum,
+ 'svcpart' => $new->svcpart,
+ } );
+ if ( $export_svc && ! $cgi->param("exportnum". $part_export->exportnum) ) {
+ $error = $export_svc->delete;
+ die $error if $error;
+ } elsif ( $cgi->param("exportnum". $part_export->exportnum)
+ && ! $export_svc ) {
+ $export_svc = new FS::export_svc ( {
+ 'exportnum' => $part_export->exportnum,
+ 'svcpart' => $new->svcpart,
+ } );
+ $error = $export_svc->insert;
+ die $error if $error;
+ }
+
+ }
+
+ print $cgi->redirect(popurl(3)."browse/part_svc.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
new file mode 100644
index 000000000..477f58508
--- /dev/null
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -0,0 +1,32 @@
+<%
+
+#untaint custnum
+$cgi->param('custnum') =~ /^(\d+)$/
+ or die 'illegal custnum '. $cgi->param('custnum');
+my $custnum = $1;
+
+$cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/
+ or die 'illegal amount '. $cgi->param('amount');
+my $amount = $1;
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum";
+
+my $error = $cust_main->charge(
+ $amount,
+ $cgi->param('pkg'),
+ '$'. sprintf("%.2f",$amount),
+ $cgi->param('taxclass')
+);
+
+if ($error) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot($error);
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum" );
+}
+
+%>
+
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi
new file mode 100644
index 000000000..a8f5b1453
--- /dev/null
+++ b/httemplate/edit/process/quick-cust_pkg.cgi
@@ -0,0 +1,24 @@
+<%
+
+#untaint custnum
+$cgi->param('custnum') =~ /^(\d+)$/
+ or die 'illegal custnum '. $cgi->param('custnum');
+my $custnum = $1;
+$cgi->param('pkgpart') =~ /^(\d+)$/
+ or die 'illegal pkgpart '. $cgi->param('pkgpart');
+my $pkgpart = $1;
+
+my @cust_pkg = ();
+my $error = FS::cust_pkg::order($custnum, [ $pkgpart ], [], \@cust_pkg, );
+
+if ($error) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot($error);
+} else {
+ print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?". $cust_pkg[0]->pkgnum );
+}
+
+%>
+
diff --git a/httemplate/edit/process/router.cgi b/httemplate/edit/process/router.cgi
new file mode 100644
index 000000000..1b7fc3805
--- /dev/null
+++ b/httemplate/edit/process/router.cgi
@@ -0,0 +1,101 @@
+<%
+
+use FS::UID qw(dbh);
+
+my $dbh = dbh;
+local $FS::UID::AutoCommit=0;
+
+sub check {
+ my $error = shift;
+ if($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(3) . "edit/router.cgi?". $cgi->query_string);
+ $dbh->rollback;
+ exit;
+ }
+}
+
+my $error = '';
+my $routernum = $cgi->param('routernum');
+my $routername = $cgi->param('routername');
+my $old = qsearchs('router', { routernum => $routernum });
+my @old_rf;
+my @old_psr;
+
+my $new = new FS::router {
+ routernum => $routernum,
+ routername => $routername,
+ svcnum => 0
+ };
+
+if($old) {
+ if($old->routername ne $new->routername) {
+ $error = $new->replace($old);
+ } #else do nothing
+} else {
+ $error = $new->insert;
+ $routernum = $new->routernum;
+}
+
+check($error);
+
+if ($old) {
+ @old_psr = $old->part_svc_router;
+ foreach $psr (@old_psr) {
+ if($cgi->param('svcpart_'.$psr->svcpart) eq 'ON') {
+ # do nothing
+ } else {
+ $error = $psr->delete;
+ }
+ }
+ check($error);
+ @old_rf = $old->router_field;
+ foreach $rf (@old_rf) {
+ if(my $new_val = $cgi->param('rf_'.$rf->routerfieldpart)) {
+ if($new_val ne $rf->value) {
+ my $new_rf = new FS::router_field
+ { routernum => $routernum,
+ value => $new_val,
+ routerfieldpart => $rf->routerfieldpart };
+ $error = $new_rf->replace($rf);
+ } #else do nothing
+ } else {
+ $error = $rf->delete;
+ }
+ check($error);
+ }
+}
+
+foreach($cgi->param) {
+ if($cgi->param($_) eq 'ON' and /^svcpart_(\d+)$/) {
+ my $svcpart = $1;
+ if(grep {$_->svcpart == $svcpart} @old_psr) {
+ # do nothing
+ } else {
+ my $new_psr = new FS::part_svc_router { svcpart => $svcpart,
+ routernum => $routernum };
+ $error = $new_psr->insert;
+ }
+ check($error);
+ } elsif($cgi->param($_) ne '' and /^rf_(\d+)$/) {
+ my $part = $1;
+ if(my @x = grep {$_->routerfieldpart == $part} @old_rf) {
+ # already handled all of these
+ } else {
+ my $new_rf = new FS::router_field
+ { routernum => $routernum,
+ value => $cgi->param('rf_'.$part),
+ routerfieldpart => $part };
+ $error = $new_rf->insert;
+ check($error);
+ }
+ }
+}
+
+
+
+# Yay, everything worked!
+$dbh->commit or die $dbh->errstr;
+print $cgi->redirect(popurl(3). "browse/router.cgi");
+
+%>
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi
new file mode 100755
index 000000000..950a8602f
--- /dev/null
+++ b/httemplate/edit/process/svc_acct.cgi
@@ -0,0 +1,49 @@
+<%
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum = $1;
+
+my $old;
+if ( $svcnum ) {
+ $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } )
+ or die "fatal: can't find account (svcnum $svcnum)!";
+} else {
+ $old = '';
+}
+
+#unmunge popnum
+$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] );
+
+#unmunge passwd
+if ( $cgi->param('_password') eq '*HIDDEN*' ) {
+ die "fatal: no previous account to recall hidden password from!" unless $old;
+ $cgi->param('_password',$old->getfield('_password'));
+}
+
+#unmunge usergroup
+$cgi->param('usergroup', [ $cgi->param('radius_usergroup') ] );
+
+my $new = new FS::svc_acct ( {
+ map {
+ $_, scalar($cgi->param($_));
+ #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir
+ # shell quota slipip)
+ } ( fields('svc_acct'), qw( pkgnum svcpart usergroup ) )
+} );
+
+my $error;
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->svcnum;
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum );
+}
+
+%>
diff --git a/httemplate/edit/process/svc_acct_pop.cgi b/httemplate/edit/process/svc_acct_pop.cgi
new file mode 100755
index 000000000..46ad74d62
--- /dev/null
+++ b/httemplate/edit/process/svc_acct_pop.cgi
@@ -0,0 +1,28 @@
+<%
+
+my $popnum = $cgi->param('popnum');
+
+my $old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum;
+
+my $new = new FS::svc_acct_pop ( {
+ map {
+ $_, scalar($cgi->param($_));
+ } fields('svc_acct_pop')
+} );
+
+my $error = '';
+if ( $popnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $popnum=$new->getfield('popnum');
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi");
+}
+
+%>
diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi
new file mode 100644
index 000000000..ab8b9f9d8
--- /dev/null
+++ b/httemplate/edit/process/svc_broadband.cgi
@@ -0,0 +1,79 @@
+<%
+
+# If it's stupid but it works, it's not stupid.
+# -- U.S. Army
+
+local $FS::UID::AutoCommit = 0;
+my $dbh = FS::UID::dbh;
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum = $1;
+
+my $old; my @old_sbf;
+if ( $svcnum ) {
+ $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } )
+ or die "fatal: can't find broadband service (svcnum $svcnum)!";
+ @old_sbf = $old->sb_field;
+} else {
+ $old = '';
+}
+
+my $new = new FS::svc_broadband ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ } ( fields('svc_broadband'), qw( pkgnum svcpart ) )
+} );
+
+my $error;
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->svcnum;
+}
+
+unless ($error) {
+ my $sb_field;
+
+ foreach ($cgi->param) {
+ #warn "\$cgi->param $_: " . $cgi->param($_);
+ if(/^sbf_(\d+)/) {
+ my $part = $1;
+ #warn "\$part $part";
+ $sb_field = new FS::sb_field
+ { svcnum => $svcnum,
+ value => $cgi->param($_),
+ sbfieldpart => $part };
+ if (my @x = grep { $_->sbfieldpart eq $part } @old_sbf) {
+ #if (my $old_sb_field = (grep { $_->sbfieldpart eq $part} @old_Sbf)[0]) {
+ #warn "array: " . scalar(@x);
+ if (length($sb_field->value) && ($sb_field->value ne $x[0]->value)) {
+ #warn "replacing " . $x[0]->value . " with " . $sb_field->value;
+ $error = $sb_field->replace($x[0]);
+ #$error = $sb_field->replace($old_sb_field);
+ } elsif (length($sb_field->value) == 0) {
+ #warn "delete";
+ $error = $x[0]->delete;
+ }
+ } else {
+ if (length($sb_field->value) > 0) {
+ #warn "insert";
+ $error = $sb_field->insert;
+ }
+ # else do nothing
+ }
+ }
+ }
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ $cgi->param('ip_addr', $new->ip_addr);
+ $dbh->rollback;
+ print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string );
+} else {
+ $dbh->commit or die $dbh->errstr;
+ print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum );
+}
+
+%>
diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi
new file mode 100755
index 000000000..19f8eb4f8
--- /dev/null
+++ b/httemplate/edit/process/svc_domain.cgi
@@ -0,0 +1,31 @@
+<%
+
+#remove this to actually test the domains!
+$FS::svc_domain::whois_hack = 1;
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum = $1;
+
+my $new = new FS::svc_domain ( {
+ map {
+ $_, scalar($cgi->param($_));
+ #} qw(svcnum pkgnum svcpart domain action purpose)
+ } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) )
+} );
+
+my $error = '';
+if ($cgi->param('svcnum')) {
+ $error="Can't modify a domain!";
+} else {
+ $error=$new->insert;
+ $svcnum=$new->svcnum;
+}
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/edit/process/svc_forward.cgi b/httemplate/edit/process/svc_forward.cgi
new file mode 100755
index 000000000..bb066d8a6
--- /dev/null
+++ b/httemplate/edit/process/svc_forward.cgi
@@ -0,0 +1,29 @@
+<%
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum =$1;
+
+my $old = qsearchs('svc_forward',{'svcnum'=>$svcnum}) if $svcnum;
+
+my $new = new FS::svc_forward ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ } ( fields('svc_forward'), qw( pkgnum svcpart ) )
+} );
+
+my $error = '';
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->getfield('svcnum');
+}
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_forward.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_forward.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/edit/process/svc_www.cgi b/httemplate/edit/process/svc_www.cgi
new file mode 100644
index 000000000..40913145a
--- /dev/null
+++ b/httemplate/edit/process/svc_www.cgi
@@ -0,0 +1,36 @@
+<%
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum = $1;
+
+my $old;
+if ( $svcnum ) {
+ $old = qsearchs('svc_www', { 'svcnum' => $svcnum } )
+ or die "fatal: can't find website (svcnum $svcnum)!";
+} else {
+ $old = '';
+}
+
+my $new = new FS::svc_www ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ #} qw(svcnum pkgnum svcpart recnum usersvc)
+ } ( fields('svc_www'), qw( pkgnum svcpart ) )
+} );
+
+my $error;
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->svcnum;
+}
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_www.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_www.cgi?" . $svcnum );
+}
+
+%>
diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi
new file mode 100755
index 000000000..b524c6494
--- /dev/null
+++ b/httemplate/edit/router.cgi
@@ -0,0 +1,92 @@
+<HTML><BODY>
+
+<%
+
+my $router;
+if ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $router = qsearchs('router', { routernum => $1 })
+ or print $cgi->redirect(popurl(2)."browse/router.cgi") ;
+} else {
+ $router = new FS::router ( {
+ map { $_, scalar($cgi->param($_)) } fields('router')
+ } );
+}
+
+my $routernum = $router->routernum;
+my $action = $routernum ? 'Edit' : 'Add';
+my $hashref = $router->hashref;
+
+print header("$action Router", menubar(
+ 'Main Menu' => "$p",
+ 'View all routers' => "${p}browse/router.cgi",
+));
+
+if($cgi->param('error')) {
+%> <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
+<% } %>
+
+<FORM ACTION="<%=popurl(1)%>process/router.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="routernum" VALUE="<%=$routernum%>">
+ Router #<%=$routernum or "(NEW)"%>
+
+<BR><BR>Name <INPUT TYPE="text" NAME="routername" SIZE=32 VALUE="<%=$hashref->{routername}%>">
+
+<BR><BR>
+Custom fields:
+<BR>
+<%=table() %>
+
+<%
+# I know, I know. Massive false laziness with edit/svc_broadband.cgi. But
+# Kristian won't let me generalize the custom field mechanism to every table in
+# the database, so this is what we get. <snarl>
+# -- MW
+
+my @part_router_field = qsearch('part_router_field', { });
+my %rf = map { $_->part_router_field->name, $_->value } $router->router_field;
+foreach (sort { $a->name cmp $b->name } @part_router_field) {
+ %>
+ <TR>
+ <TD ALIGN="right"><%=$_->name%></TD>
+ <TD><%
+ if(my @opts = $_->list_values) {
+ %> <SELECT NAME="rf_<%=$_->routerfieldpart%>" SIZE="1">
+ <%
+ foreach $opt (@opts) {
+ %> <OPTION VALUE="<%=$opt%>"<%=($opt eq $rf{$_->name})
+ ? ' SELECTED' : ''%>>
+ <%=$opt%>
+ </OPTION>
+ <% } %>
+ </SELECT>
+ <% } else { %>
+ <INPUT NAME="rf_<%=$_->routerfieldpart%>"
+ VALUE="<%=$rf{$_->name}%>"
+ <%=$_->length ? 'SIZE="'.$_->length.'"' : ''%>>
+ <% } %></TD>
+ </TR>
+<% } %>
+</TABLE>
+
+
+
+<BR><BR>Select the service types available on this router<BR>
+<%
+
+foreach my $part_svc ( qsearch('part_svc', { svcdb => 'svc_broadband',
+ disabled => '' }) ) {
+ %>
+ <BR>
+ <INPUT TYPE="checkbox" NAME="svcpart_<%=$part_svc->svcpart%>"<%=
+ qsearchs('part_svc_router', { svcpart => $part_svc->svcpart,
+ routernum => $routernum } ) ? 'CHECKED' : ''%> VALUE="ON">
+ <A HREF="<%=${p}%>edit/part_svc.cgi?<%=$part_svc->svcpart%>">
+ <%=$part_svc->svcpart%>: <%=$part_svc->svc%></A>
+ <% } %>
+
+ <BR><BR><INPUT TYPE="submit" VALUE="Apply changes">
+ </FORM>
+</BODY></HTML>
+
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
new file mode 100755
index 000000000..4420bb609
--- /dev/null
+++ b/httemplate/edit/svc_acct.cgi
@@ -0,0 +1,293 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+my @shells = $conf->config('shells');
+
+my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct, @groups);
+if ( $cgi->param('error') ) {
+ $svc_acct = new FS::svc_acct ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_acct')
+ } );
+ $svcnum = $svc_acct->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+ @groups = $cgi->param('radius_usergroup');
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_acct) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+
+ @groups = $svc_acct->radius_groups;
+
+ } else { #adding
+
+ $svc_acct = new FS::svc_acct({});
+
+ foreach $_ (split(/-/,$query)) {
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ $part_svc = qsearchs( 'part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry for svcpart $svcpart!" unless $part_svc;
+
+ $svcnum='';
+
+ #set gecos
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ if ($cust_pkg) {
+ my($cust_main)=qsearchs('cust_main',{'custnum'=> $cust_pkg->custnum } );
+ unless ( $part_svc->part_svc_column('uid')->columnflag eq 'F' ) {
+ $svc_acct->setfield('finger',
+ $cust_main->getfield('first') . " " . $cust_main->getfield('last')
+ );
+ }
+ }
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ if ( $part_svc_column->columnname eq 'usergroup' ) {
+ @groups = split(',', $part_svc_column->columnvalue);
+ } else {
+ $svc_acct->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+ }
+
+ }
+}
+
+#fixed radius groups always override & display
+if ( $part_svc->part_svc_column('usergroup')->columnflag eq "F" ) {
+ @groups = split(',', $part_svc->part_svc_column('usergroup')->columnvalue);
+}
+
+my $action = $svcnum ? 'Edit' : 'Add';
+
+my $svc = $part_svc->getfield('svc');
+
+my $otaker = getotaker;
+
+my $username = $svc_acct->username;
+my $password;
+if ( $svc_acct->_password ) {
+ if ( $conf->exists('showpasswords') || ! $svcnum ) {
+ $password = $svc_acct->_password;
+ } else {
+ $password = "*HIDDEN*";
+ }
+} else {
+ $password = '';
+}
+
+my $ulen = $conf->config('usernamemax')
+ || $svc_acct->dbdef_table->column('username')->length;
+my $ulen2 = $ulen+2;
+
+my $pmax = $conf->config('passwordmax') || 8;
+my $pmax2 = $pmax+2;
+
+my $p1 = popurl(1);
+print header("$action $svc account");
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT><BR><BR>"
+ if $cgi->param('error');
+
+print 'Service # '. ( $svcnum ? "<B>$svcnum</B>" : " (NEW)" ). '<BR>'.
+ 'Service: <B>'. $part_svc->svc. '</B><BR><BR>'.
+ <<END;
+ <FORM NAME="OneTrueForm" ACTION="${p1}process/svc_acct.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
+ <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
+END
+
+print &ntable("#cccccc",2), <<END;
+<TR><TD ALIGN="right">Username</TD>
+<TD><INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen></TD></TR>
+<TR><TD ALIGN="right">Password</TD>
+<TD><INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=$pmax2 MAXLENGTH=$pmax>
+(blank to generate)</TD>
+</TR>
+END
+
+my $sec_phrase = $svc_acct->sec_phrase;
+if ( $conf->exists('security_phrase') ) {
+ print <<END;
+ <TR><TD ALIGN="right">Security phrase</TD>
+ <TD><INPUT TYPE="text" NAME="sec_phrase" VALUE="$sec_phrase" SIZE=32>
+ (for forgotten passwords)</TD>
+ </TD>
+END
+} else {
+ print qq!<INPUT TYPE="hidden" NAME="sec_phrase" VALUE="$sec_phrase">!;
+}
+
+#domain
+my $domsvc = $svc_acct->domsvc || 0;
+if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'F' ) {
+ print qq!<INPUT TYPE="hidden" NAME="domsvc" VALUE="$domsvc">!;
+} else {
+ my %svc_domain = ();
+
+ if ( $domsvc ) {
+ my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $domsvc, } );
+ if ( $svc_domain ) {
+ $svc_domain{$svc_domain->svcnum} = $svc_domain;
+ } else {
+ warn "unknown svc_domain.svcnum for svc_acct.domsvc: $domsvc";
+ }
+ }
+
+ if ( $part_svc->part_svc_column('domsvc')->columnflag eq 'D' ) {
+ my $svc_domain = qsearchs('svc_domain', {
+ 'svcnum' => $part_svc->part_svc_column('domsvc')->columnvalue,
+ } );
+ if ( $svc_domain ) {
+ $svc_domain{$svc_domain->svcnum} = $svc_domain;
+ } else {
+ warn "unknown svc_domain.svcnum for part_svc_column domsvc: ".
+ $part_svc->part_svc_column('domsvc')->columnvalue;
+ }
+ }
+
+ my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $pkgnum } );
+ if ($cust_pkg && !$conf->exists('svc_acct-alldomains') ) {
+ my @cust_svc =
+ map { qsearch('cust_svc', { 'pkgnum' => $_->pkgnum } ) }
+ qsearch('cust_pkg', { 'custnum' => $cust_pkg->custnum } );
+ foreach my $cust_svc ( @cust_svc ) {
+ my $svc_domain =
+ qsearchs('svc_domain', { 'svcnum' => $cust_svc->svcnum } );
+ $svc_domain{$svc_domain->svcnum} = $svc_domain if $svc_domain;
+ }
+ } else {
+ %svc_domain = map { $_->svcnum => $_ } qsearch('svc_domain', {} );
+ }
+ print qq!<TR><TD ALIGN="right">Domain</TD>!.
+ qq!<TD><SELECT NAME="domsvc" SIZE=1>\n!;
+ foreach my $svcnum (
+ sort { $svc_domain{$a}->domain cmp $svc_domain{$b}->domain }
+ keys %svc_domain
+ ) {
+ my $svc_domain = $svc_domain{$svcnum};
+ print qq!<OPTION VALUE="!. $svc_domain->svcnum. qq!"!.
+ ( $svc_domain->svcnum == $domsvc ? ' SELECTED' : '' ).
+ '>'. $svc_domain->domain. "\n" ;
+ }
+ print "</SELECT></TD></TR>";
+}
+
+#pop
+my $popnum = $svc_acct->popnum || 0;
+if ( $part_svc->part_svc_column('popnum')->columnflag eq "F" ) {
+ print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$popnum">!;
+} else {
+ print qq!<TR><TD ALIGN="right">Access number</TD>!.
+ qq!<TD>!. FS::svc_acct_pop::popselector($popnum). '</TD></TR>';
+}
+
+my($uid,$gid,$finger,$dir)=(
+ $svc_acct->uid,
+ $svc_acct->gid,
+ $svc_acct->finger,
+ $svc_acct->dir,
+);
+
+print <<END;
+<INPUT TYPE="hidden" NAME="uid" VALUE="$uid">
+<INPUT TYPE="hidden" NAME="gid" VALUE="$gid">
+END
+
+if ( !$finger && $part_svc->part_svc_column('uid')->columnflag eq 'F' ) {
+ print '<INPUT TYPE="hidden" NAME="finger" VALUE="">';
+} else {
+ print '<TR><TD ALIGN="right">GECOS</TD>'.
+ qq!<TD><INPUT TYPE="text" NAME="finger" VALUE="$finger"></TD></TR>!;
+}
+print qq!<INPUT TYPE="hidden" NAME="dir" VALUE="$dir">!;
+
+my $shell = $svc_acct->shell;
+if ( $part_svc->part_svc_column('shell')->columnflag eq "F"
+ || ( !$shell && $part_svc->part_svc_column('uid')->columnflag eq 'F' )
+ ) {
+ print qq!<INPUT TYPE="hidden" NAME="shell" VALUE="$shell">!;
+} else {
+ print qq!<TR><TD ALIGN="right">Shell</TD><TD><SELECT NAME="shell" SIZE=1>!;
+ my($etc_shell);
+ foreach $etc_shell (@shells) {
+ print "<OPTION", $etc_shell eq $shell ? ' SELECTED' : '', ">",
+ $etc_shell, "\n";
+ }
+ print "</SELECT></TD></TR>";
+}
+
+my($quota,$slipip)=(
+ $svc_acct->quota,
+ $svc_acct->slipip,
+);
+
+if ( $part_svc->part_svc_column('quota')->columnflag eq "F" )
+{
+ print qq!<INPUT TYPE="hidden" NAME="quota" VALUE="$quota">!;
+} else {
+ print <<END;
+ <TR><TD ALIGN="right">Quota:</TD>
+ <TD> <INPUT TYPE="text" NAME="quota" VALUE="$quota" ></TD>
+ </TR>
+END
+}
+
+if ( $part_svc->part_svc_column('slipip')->columnflag eq "F" ) {
+ print qq!<INPUT TYPE="hidden" NAME="slipip" VALUE="$slipip">!;
+} else {
+ print qq!<TR><TD ALIGN="right">IP</TD><TD><INPUT TYPE="text" NAME="slipip" VALUE="$slipip"></TD></TR>!;
+}
+
+foreach my $r ( grep { /^r(adius|[cr])_/ } fields('svc_acct') ) {
+ $r =~ /^^r(adius|[cr])_(.+)$/ or next; #?
+ my $a = $2;
+ if ( $part_svc->part_svc_column($r)->columnflag eq 'F' ) {
+ print qq!<INPUT TYPE="hidden" NAME="$r" VALUE="!.
+ $svc_acct->getfield($r). '">';
+ } else {
+ print qq!<TR><TD ALIGN="right">$FS::raddb::attrib{$a}</TD><TD><INPUT TYPE="text" NAME="$r" VALUE="!.
+ $svc_acct->getfield($r). '"></TD></TR>';
+ }
+}
+
+print '<TR><TD ALIGN="right">RADIUS groups</TD>';
+if ( $part_svc->part_svc_column('usergroup')->columnflag eq "F" ) {
+ print '<TD BGCOLOR="#ffffff">'. join('<BR>', @groups);
+} else {
+ print '<TD>'. &FS::svc_acct::radius_usergroup_selector( \@groups );
+}
+print '</TD></TR>';
+
+#submit
+print qq!</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">!;
+
+print <<END;
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/svc_acct_pop.cgi b/httemplate/edit/svc_acct_pop.cgi
new file mode 100755
index 000000000..399502a70
--- /dev/null
+++ b/httemplate/edit/svc_acct_pop.cgi
@@ -0,0 +1,56 @@
+<!-- mason kludge -->
+<%
+
+my $svc_acct_pop;
+if ( $cgi->param('error') ) {
+ $svc_acct_pop = new FS::svc_acct_pop ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
+ } );
+} elsif ( $cgi->keywords ) { #editing
+ my($query)=$cgi->keywords;
+ $query =~ /^(\d+)$/;
+ $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
+} else { #adding
+ $svc_acct_pop = new FS::svc_acct_pop {};
+}
+my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
+my $hashref = $svc_acct_pop->hashref;
+
+my $p1 = popurl(1);
+print header("$action Access Number", menubar(
+ 'Main Menu' => popurl(2),
+ 'View all Access Numbers' => popurl(2). "browse/svc_acct_pop.cgi",
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/svc_acct_pop.cgi" METHOD=POST>!;
+
+#display
+
+print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
+ "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
+
+print <<END;
+<PRE>
+City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
+State <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="$hashref->{state}">
+Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
+Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
+Local <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="$hashref->{loc}">
+</PRE>
+END
+
+print qq!<BR><INPUT TYPE="submit" VALUE="!,
+ $hashref->{popnum} ? "Apply changes" : "Add Access Number",
+ qq!">!;
+
+print <<END;
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi
new file mode 100644
index 000000000..ee7f8becf
--- /dev/null
+++ b/httemplate/edit/svc_broadband.cgi
@@ -0,0 +1,192 @@
+<!-- mason kludge -->
+<%
+
+# If it's stupid but it works, it's still stupid.
+# -Kristian
+
+
+use HTML::Widgets::SelectLayers;
+use Tie::IxHash;
+
+my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_broadband );
+if ( $cgi->param('error') ) {
+ $svc_broadband = new FS::svc_broadband ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_broadband')
+ } );
+ $svcnum = $svc_broadband->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_broadband) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ } else { #adding
+
+ $svc_broadband = new FS::svc_broadband({});
+
+ foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svc_broadband->setfield('svcpart', $svcpart);
+
+ $svcnum='';
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ $svc_broadband->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+
+ }
+}
+my $action = $svc_broadband->svcnum ? 'Edit' : 'Add';
+
+if ($pkgnum) {
+
+ #Nothing?
+
+} elsif ( $action eq 'Edit' ) {
+
+ #Nothing?
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my $p1 = popurl(1);
+
+my ($ip_addr, $speed_up, $speed_down, $blocknum) =
+ ($svc_broadband->ip_addr,
+ $svc_broadband->speed_up,
+ $svc_broadband->speed_down,
+ $svc_broadband->blocknum);
+
+%>
+
+<%=header("Broadband Service $action", '')%>
+
+<% if ($cgi->param('error')) { %>
+<FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT><BR>
+<% } %>
+
+Service #<B><%=$svcnum ? $svcnum : "(NEW)"%></B><BR><BR>
+
+<FORM ACTION="<%=${p1}%>process/svc_broadband.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%=$svcnum%>">
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%=$pkgnum%>">
+ <INPUT TYPE="hidden" NAME="svcpart" VALUE="<%=$svcpart%>">
+
+ <%=&ntable("#cccccc",2)%>
+ <TR>
+ <TD ALIGN="right">IP Address</TD>
+ <TD BGCOLOR="#ffffff">
+<% if ( $part_svc->part_svc_column('ip_addr')->columnflag eq 'F' ) { %>
+ <INPUT TYPE="hidden" NAME="ip_addr" VALUE="<%=$ip_addr%>"><%=$ip_addr%>
+<% } else { %>
+ <INPUT TYPE="text" NAME="ip_addr" VALUE="<%=$ip_addr%>">
+<% } %>
+ </TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Download speed</TD>
+ <TD BGCOLOR="#ffffff">
+<% if ( $part_svc->part_svc_column('speed_down')->columnflag eq 'F' ) { %>
+ <INPUT TYPE="hidden" NAME="speed_down" VALUE="<%=$speed_down%>"><%=$speed_down%>Kbps
+<% } else { %>
+ <INPUT TYPE="text" NAME="speed_down" SIZE=5 VALUE="<%=$speed_down%>">Kbps
+<% } %>
+ </TD>
+ </TR>
+ <TR>
+ <TD ALIGN="right">Upload speed</TD>
+ <TD BGCOLOR="#ffffff">
+<% if ( $part_svc->part_svc_column('speed_up')->columnflag eq 'F' ) { %>
+ <INPUT TYPE="hidden" NAME="speed_up" VALUE="<%=$speed_up%>"><%=$speed_up%>Kbps
+<% } else { %>
+ <INPUT TYPE="text" NAME="speed_up" SIZE=5 VALUE="<%=$speed_up%>">Kbps
+<% } %>
+ </TD>
+ </TR>
+<% if ($action eq 'Add') { %>
+ <TR>
+ <TD ALIGN="right">Router/Block</TD>
+ <TD BGCOLOR="#ffffff">
+ <SELECT NAME="blocknum">
+<%
+ foreach my $router ($svc_broadband->allowed_routers) {
+ foreach my $addr_block ($router->addr_block) {
+%>
+ <OPTION VALUE="<%=$addr_block->blocknum%>"<%=($addr_block->blocknum eq $blocknum) ? ' SELECTED' : ''%>>
+ <%=$router->routername%>:<%=$addr_block->ip_gateway%>/<%=$addr_block->ip_netmask%></OPTION>
+<%
+ }
+ }
+%>
+ </SELECT>
+ </TD>
+ </TR>
+<% } else { %>
+
+ <TR>
+ <TD ALIGN="right">Router/Block</TD>
+ <TD BGCOLOR="#ffffff">
+ <%=$svc_broadband->addr_block->router->routername%>:<%=$svc_broadband->addr_block->NetAddr%>
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$svc_broadband->blocknum%>">
+ </TD>
+ </TR>
+
+<% } %>
+
+<%
+
+ my @part_sb_field = qsearch('part_sb_field', { svcpart => $svcpart });
+ my $sbf_hashref = $svc_broadband->sb_field_hashref($svcpart);
+ foreach (sort { $a->name cmp $b->name } @part_sb_field) {
+ %>
+ <TR>
+ <TD ALIGN="right"><%=$_->name%></TD>
+ <TD><%
+ if(my @opts = $_->list_values) {
+ %>
+ <SELECT NAME="sbf_<%=$_->sbfieldpart%>" SIZE=1> <%
+ foreach $opt (@opts) { %>
+ <OPTION VALUE="<%=$opt%>"<%=
+ ($opt eq $sbf_hashref->{$_->name}) ? ' SELECTED' : ''%>>
+ <%=$opt%></OPTION><%
+ } %></SELECT>
+ <% } else { %>
+ <INPUT NAME="sbf_<%=$_->sbfieldpart%>"
+ VALUE="<%=$sbf_hashref->{$_->name}%>"
+ <%=$_->length ? 'SIZE="'.$_->length.'"' : ''%>>
+ <% } %>
+ </TD>
+ </TR>
+<% } %>
+ </TABLE>
+ <BR>
+ <INPUT TYPE="submit" NAME="submit" VALUE="Submit">
+</FORM>
+</BODY>
+</HTML>
+
diff --git a/httemplate/edit/svc_domain.cgi b/httemplate/edit/svc_domain.cgi
new file mode 100755
index 000000000..ca0e3398f
--- /dev/null
+++ b/httemplate/edit/svc_domain.cgi
@@ -0,0 +1,98 @@
+<!-- mason kludge -->
+<%
+
+my($svcnum, $pkgnum, $svcpart, $kludge_action, $purpose, $part_svc,
+ $svc_domain);
+if ( $cgi->param('error') ) {
+ $svc_domain = new FS::svc_domain ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_domain')
+ } );
+ $svcnum = $svc_domain->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $kludge_action = $cgi->param('action');
+ $purpose = $cgi->param('purpose');
+ $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
+ die "No part_svc entry!" unless $part_svc;
+} else {
+ $kludge_action = '';
+ $purpose = '';
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_domain) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ } else { #adding
+
+ $svc_domain = new FS::svc_domain({});
+
+ foreach $_ (split(/-/,$query)) {
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svcnum='';
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ $svc_domain->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+
+ }
+
+}
+my $action = $svcnum ? 'Edit' : 'Add';
+
+my $svc = $part_svc->getfield('svc');
+
+my $otaker = getotaker;
+
+my $domain = $svc_domain->domain;
+
+my $p1 = popurl(1);
+print header("$action $svc", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print <<END;
+ <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
+ <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
+ <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
+ <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
+END
+
+print qq!<INPUT TYPE="radio" NAME="action" VALUE="N"!;
+print ' CHECKED' if $kludge_action eq 'N';
+print qq!>New!;
+print qq!<BR><INPUT TYPE="radio" NAME="action" VALUE="M"!;
+print ' CHECKED' if $kludge_action eq 'M';
+print qq!>Transfer!;
+
+print <<END;
+<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=63>
+<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="$purpose" SIZE=64>
+<P><INPUT TYPE="submit" VALUE="Submit">
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi
new file mode 100755
index 000000000..0d815b9e5
--- /dev/null
+++ b/httemplate/edit/svc_forward.cgi
@@ -0,0 +1,175 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward);
+if ( $cgi->param('error') ) {
+ $svc_forward = new FS::svc_forward ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_forward')
+ } );
+ $svcnum = $svc_forward->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+} else {
+
+ my($query) = $cgi->keywords;
+
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_forward=qsearchs('svc_forward',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_forward) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ } else { #adding
+
+ $svc_forward = new FS::svc_forward({});
+
+ foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svcnum='';
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ $svc_forward->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+ }
+
+}
+my $action = $svc_forward->svcnum ? 'Edit' : 'Add';
+
+my %email;
+if ($pkgnum) {
+
+ #find all possible user svcnums (and emails)
+
+ #starting with those currently attached
+ if ( $svc_forward->srcsvc ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_forward->srcsvc } );
+ $email{$svc_forward->srcsvc} = $svc_acct->email;
+ }
+ if ( $svc_forward->dstsvc ) {
+ my $svc_acct = qsearchs( 'svc_acct', { 'svcnum' => $svc_forward->dstsvc } );
+ $email{$svc_forward->dstsvc} = $svc_acct->email;
+ }
+
+ #and including the rest for this customer
+ my($u_part_svc,@u_acct_svcparts);
+ foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
+ push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ my($i_cust_pkg);
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ foreach my $i_cust_svc (
+ qsearch( 'cust_svc', { 'pkgnum' => $cust_pkgnum,
+ 'svcpart' => $acct_svcpart } )
+ ) {
+ my $svc_acct =
+ qsearchs( 'svc_acct', { 'svcnum' => $i_cust_svc->svcnum } );
+ $email{$svc_acct->svcnum} = $svc_acct->email;
+ }
+ }
+ }
+
+} elsif ( $action eq 'Edit' ) {
+
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_forward->srcsvc});
+ $email{$svc_forward->srcsvc} = $svc_acct->email;
+
+ $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svc_forward->dstsvc});
+ $email{$svc_forward->dstsvc} = $svc_acct->email;
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my($srcsvc,$dstsvc,$dst)=(
+ $svc_forward->srcsvc,
+ $svc_forward->dstsvc,
+ $svc_forward->dst,
+);
+
+#display
+
+%>
+
+<%= header("Mail Forward $action") %>
+
+<% if ( $cgi->param('error') ) { %>
+ <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT>
+ <BR><BR>
+<% } %>
+
+Service #<%= $svcnum ? "<B>$svcnum</B>" : " (NEW)" %><BR>
+Service: <B><%= $part_svc->svc %></B><BR><BR>
+
+<FORM NAME="dummy">
+
+<%= ntable("#cccccc",2) %>
+<TR><TD ALIGN="right">Email to</TD><TD><SELECT NAME="srcsvc" SIZE=1>
+<% foreach $_ (keys %email) { %>
+ <OPTION<%= $_ eq $srcsvc ? " SELECTED" : "" %> VALUE="<%= $_ %>"><%= $email{$_} %></OPTION>
+<% } %>
+</SELECT></TD></TR>
+
+<%
+ tie my %tied_email, 'Tie::IxHash',
+ '' => 'SELECT DESTINATION',
+ %email,
+ '0' => '(other email address)';
+ my $widget = new HTML::Widgets::SelectLayers(
+ 'selected_layer' => $dstsvc,
+ 'options' => \%tied_email,
+ 'form_name' => 'dummy',
+ 'form_action' => 'process/svc_forward.cgi',
+ 'form_select' => ['srcsvc'],
+ 'html_between' => '</TD></TR></TABLE>',
+ 'layer_callback' => sub {
+ my $layer = shift;
+ my $html = qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!.
+ qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!.
+ qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!.
+ qq!<INPUT TYPE="hidden" NAME="dstsvc" VALUE="$layer">!;
+ if ( $layer eq '0' ) {
+ $html .= ntable("#cccccc",2).
+ '<TR><TD ALIGN="right">Destination email</TD>'.
+ qq!<TD><INPUT TYPE="text" NAME="dst" VALUE="$dst"></TD>!.
+ '</TR></TABLE>';
+ }
+ $html .= '<BR><INPUT TYPE="submit" VALUE="Submit">';
+ $html;
+ },
+ );
+%>
+
+<TR><TD ALIGN="right">Forwards to</TD>
+<TD><%= $widget->html %>
+ </BODY>
+</HTML>
diff --git a/httemplate/edit/svc_www.cgi b/httemplate/edit/svc_www.cgi
new file mode 100644
index 000000000..d2c9ade5c
--- /dev/null
+++ b/httemplate/edit/svc_www.cgi
@@ -0,0 +1,178 @@
+<!-- mason kludge -->
+<%
+
+my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_www );
+if ( $cgi->param('error') ) {
+ $svc_www = new FS::svc_www ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_www')
+ } );
+ $svcnum = $svc_www->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_www=qsearchs('svc_www',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_www) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ } else { #adding
+
+ $svc_www = new FS::svc_www({});
+
+ foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svcnum='';
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ $svc_www->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+
+ }
+}
+my $action = $svc_www->svcnum ? 'Edit' : 'Add';
+
+my( %username, %arec );
+if ($pkgnum) {
+
+ my($u_part_svc,@u_acct_svcparts);
+ foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
+ push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ my($i_cust_pkg);
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ $username{$svc_acct->getfield('svcnum')}=$svc_acct->getfield('username');
+ }
+ }
+ }
+
+
+ my($d_part_svc,@d_acct_svcparts);
+ foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) {
+ push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
+ }
+
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@d_acct_svcparts) {
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ my $domain_rec;
+ foreach $domain_rec ( qsearch('domain_record',{
+ 'svcnum' => $svc_domain->svcnum,
+ 'rectype' => 'A' } ),
+ qsearch('domain_record',{
+ 'svcnum' => $svc_domain->svcnum,
+ 'rectype' => 'CNAME'
+ } ) ) {
+ $arec{$domain_rec->recnum} =
+ $domain_rec->reczone eq '@'
+ ? $svc_domain->domain
+ : $domain_rec->reczone. '.'. $svc_domain->domain;
+ }
+ $arec{'@.'. $svc_domain->domain} = $svc_domain->domain
+ unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum,
+ reczone => '@', } );
+ $arec{'www.'. $svc_domain->domain} = 'www.'. $svc_domain->domain
+ unless qsearchs('domain_record', { svcnum => $svc_domain->svcnum,
+ reczone => 'www', } );
+ }
+ }
+ }
+
+} elsif ( $action eq 'Edit' ) {
+
+ my($domain_rec) = qsearchs('domain_record', { 'recnum'=>$svc_www->recnum });
+ $arec{$svc_www->recnum} = join '.', $domain_rec->recdata, $domain_rec->reczone;
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+
+my $p1 = popurl(1);
+print header("Web Hosting $action", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/svc_www.cgi" METHOD=POST>!;
+
+#display
+
+
+
+#svcnum
+print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
+print qq!Service #<B>!, $svcnum ? $svcnum : "(NEW)", "</B><BR><BR>";
+
+#pkgnum
+print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
+
+#svcpart
+print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
+
+my($recnum,$usersvc)=(
+ $svc_www->recnum,
+ $svc_www->usersvc,
+);
+
+print &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Zone</TD><TD><SELECT NAME="recnum" SIZE=1>';
+foreach $_ (keys %arec) {
+ print "<OPTION", $_ eq $recnum ? " SELECTED" : "",
+ qq! VALUE="$_">$arec{$_}!;
+}
+print "</SELECT></TD></TR>";
+
+print '<TR><TD ALIGN="right">Username</TD><TD><SELECT NAME="usersvc" SIZE=1>';
+foreach $_ (keys %username) {
+ print "<OPTION", ($_ eq $usersvc) ? " SELECTED" : "",
+ qq! VALUE="$_">$username{$_}!;
+}
+print "</SELECT></TD></TR>";
+
+print '</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">';
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+%>
diff --git a/httemplate/graph/money_time-graph.cgi b/httemplate/graph/money_time-graph.cgi
new file mode 100755
index 000000000..944019a7a
--- /dev/null
+++ b/httemplate/graph/money_time-graph.cgi
@@ -0,0 +1,108 @@
+<%
+
+#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+my ($curmon,$curyear) = (localtime(time))[4,5];
+
+#find first month
+my $syear = $cgi->param('syear') || 1899+$curyear;
+my $smonth = $cgi->param('smonth') || $curmon+1;
+
+#find last month
+my $eyear = $cgi->param('eyear') || 1900+$curyear;
+my $emonth = $cgi->param('emonth') || $curmon+1;
+if ( $emonth++>12 ) { $emonth-=12; $eyear++; }
+
+my @labels;
+my %data;
+
+while ( $syear < $eyear || ( $syear == $eyear && $smonth < $emonth ) ) {
+ push @labels, "$smonth/$syear";
+
+ my $speriod = timelocal(0,0,0,1,$smonth-1,$syear);
+ if ( ++$smonth == 13 ) { $syear++; $smonth=1; }
+ my $eperiod = timelocal(0,0,0,1,$smonth-1,$syear);
+
+ my $where = "WHERE _date >= $speriod AND _date < $eperiod";
+
+ # Invoiced
+ my $charged_sql = "SELECT SUM(charged) FROM cust_bill $where";
+ my $charged_sth = dbh->prepare($charged_sql) or die dbh->errstr;
+ $charged_sth->execute or die $charged_sth->errstr;
+ my $charged = $charged_sth->fetchrow_arrayref->[0] || 0;
+
+ push @{$data{charged}}, $charged;
+
+ #accounts receivable
+# my $ar_sql2 = "SELECT SUM(amount) FROM cust_credit $where";
+ my $credited_sql = "SELECT SUM(cust_credit_bill.amount) FROM cust_credit_bill, cust_bill WHERE cust_bill.invnum = cust_credit_bill.invnum AND cust_bill._date >= $speriod AND cust_bill._date < $eperiod";
+ my $credited_sth = dbh->prepare($credited_sql) or die dbh->errstr;
+ $credited_sth->execute or die $credited_sth->errstr;
+ my $credited = $credited_sth->fetchrow_arrayref->[0] || 0;
+
+ #horrible local kludge
+ my $expenses_sql = "SELECT SUM(cust_bill_pkg.setup) FROM cust_bill_pkg, cust_bill, cust_pkg, part_pkg WHERE cust_bill.invnum = cust_bill_pkg.invnum AND cust_bill._date >= $speriod AND cust_bill._date < $eperiod AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%'";
+ my $expenses_sth = dbh->prepare($expenses_sql) or die dbh->errstr;
+ $expenses_sth->execute or die $expenses_sth->errstr;
+ my $expenses = $expenses_sth->fetchrow_arrayref->[0] || 0;
+
+ push @{$data{ar}}, $charged-$credited-$expenses;
+
+ #deferred revenue
+# push @{$data{defer}}, '0';
+
+ #cashflow
+ my $paid_sql = "SELECT SUM(paid) FROM cust_pay $where";
+ my $paid_sth = dbh->prepare($paid_sql) or die dbh->errstr;
+ $paid_sth->execute or die $paid_sth->errstr;
+ my $paid = $paid_sth->fetchrow_arrayref->[0] || 0;
+
+ my $refunded_sql = "SELECT SUM(refund) FROM cust_refund $where";
+ my $refunded_sth = dbh->prepare($refunded_sql) or die dbh->errstr;
+ $refunded_sth->execute or die $refunded_sth->errstr;
+ my $refunded = $refunded_sth->fetchrow_arrayref->[0] || 0;
+
+ #horrible local kludge that doesn't even really work right
+ my $expenses_sql = "SELECT SUM(cust_bill_pay.amount) FROM cust_bill_pay, cust_bill WHERE cust_bill_pay.invnum = cust_bill.invnum AND cust_bill_pay._date >= $speriod AND cust_bill_pay._date < $eperiod AND 0 < ( select count(*) from cust_bill_pkg, cust_pkg, part_pkg WHERE cust_bill.invnum = cust_bill_pkg.invnum AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%' )";
+
+# my $expenses_sql = "SELECT SUM(cust_bill_pay.amount) FROM cust_bill_pay, cust_bill_pkg, cust_bill, cust_pkg, part_pkg WHERE cust_bill_pay.invnum = cust_bill.invnum AND cust_bill.invnum = cust_bill_pkg.invnum AND cust_bill_pay._date >= $speriod AND cust_bill_pay._date < $eperiod AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%'";
+ my $expenses_sth = dbh->prepare($expenses_sql) or die dbh->errstr;
+ $expenses_sth->execute or die $expenses_sth->errstr;
+ my $expenses = $expenses_sth->fetchrow_arrayref->[0] || 0;
+
+ push @{$data{cash}}, $paid-$refunded-$expenses;
+
+}
+
+#my $chart = Chart::LinesPoints->new(1024,480);
+my $chart = Chart::LinesPoints->new(768,480);
+
+$chart->set(
+ #'min_val' => 0,
+ 'legend' => 'bottom',
+ 'legend_labels' => [ #'Invoiced (cust_bill)',
+ 'Accounts receivable (invoices - applied credits)',
+ #'Deferred revenue',
+ 'Actual cashflow (payments - refunds)' ],
+);
+
+my @data = ( \@labels,
+ #map $data{$_}, qw( ar defer cash )
+ #map $data{$_}, qw( charged ar cash )
+ map $data{$_}, qw( ar cash )
+ );
+
+#my $gd = $chart->plot(\@data);
+#open (IMG, ">i_r_c.png");
+#print IMG $gd->png;
+#close IMG;
+
+#$chart->png("i_r_c.png", \@data);
+
+#$chart->cgi_png(\@data);
+
+http_header('Content-Type' => 'image/png' );
+$Response->{ContentType} = 'image/png';
+
+$chart->_set_colors();
+
+%><%= $chart->scalar_png(\@data) %>
diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi
new file mode 100644
index 000000000..e24157ccb
--- /dev/null
+++ b/httemplate/graph/money_time.cgi
@@ -0,0 +1,59 @@
+<!-- mason kludge %>
+<%
+
+#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+my ($curmon,$curyear) = (localtime(time))[4,5];
+
+#find first month
+my $syear = $cgi->param('syear') || 1899+$curyear;
+my $smonth = $cgi->param('smonth') || $curmon+1;
+
+#find last month
+my $eyear = $cgi->param('eyear') || 1900+$curyear;
+my $emonth = $cgi->param('emonth') || $curmon+1;
+
+%>
+
+<HTML>
+ <HEAD>
+ <TITLE>Graphing monetary values over time</TITLE>
+ </HEAD>
+<BODY BGCOLOR="#e8e8e8">
+<IMG SRC="money_time-graph.cgi?<%= $cgi->query_string %>" WIDTH="768" HEIGHT="480">
+<BR>
+<FORM METHOD="POST">
+<INPUT TYPE="checkbox" NAME="ar">
+ Accounts receivable (invoices - applied credits)<BR>
+<INPUT TYPE="checkbox" NAME="charged">
+ Just Invoices<BR>
+<INPUT TYPE="checkbox" NAME="defer">
+ Accounts receivable, with deferred revenue (invoices - applied credits, with charges for annual/semi-annual/quarterly/etc. services deferred over applicable time period) (there has got to be a shorter description for this)<BR>
+<INPUT TYPE="checkbox" NAME="cash">
+ Cashflow (payments - refunds)<BR>
+<BR>
+From <SELECT NAME="smonth">
+<% my @m = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+ foreach my $m ( 1..12 ) { %>
+<OPTION VALUE="<%= $m %>"<%= $m == $smonth ? ' SELECTED' : '' %>><%= $m[$m-1] %>
+<% } %>
+</SELECT>
+<SELECT NAME="syear">
+<% foreach my $y ( 1999 .. 2010 ) { %>
+<OPTION VALUE="<%= $y %>"<%= $y == $syear ? ' SELECTED' : '' %>><%= $y %>
+<% } %>
+</SELECT>
+ to <SELECT NAME="emonth">
+<% foreach my $m ( 1..12 ) { %>
+<OPTION VALUE="<%= $m %>"<%= $m == $emonth ? ' SELECTED' : '' %>><%= $m[$m-1] %>
+<% } %>
+</SELECT>
+<SELECT NAME="eyear">
+<% foreach my $y ( 1999 .. 2010 ) { %>
+<OPTION VALUE="<%= $y %>"<%= $y == $eyear ? ' SELECTED' : '' %>><%= $y %>
+<% } %>
+</SELECT>
+
+<INPUT TYPE="submit" VALUE="Graph">
+</FORM>
+</BODY>
+</HTML>
diff --git a/httemplate/images/mid-logo.png b/httemplate/images/mid-logo.png
new file mode 100644
index 000000000..d993419cc
--- /dev/null
+++ b/httemplate/images/mid-logo.png
Binary files differ
diff --git a/httemplate/images/small-logo.png b/httemplate/images/small-logo.png
new file mode 100644
index 000000000..406a36980
--- /dev/null
+++ b/httemplate/images/small-logo.png
Binary files differ
diff --git a/httemplate/index.html b/httemplate/index.html
new file mode 100644
index 000000000..017ffcd88
--- /dev/null
+++ b/httemplate/index.html
@@ -0,0 +1,223 @@
+<HTML>
+ <HEAD>
+ <TITLE>
+ Freeside Main Menu
+ </TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#FFFFFF">
+ <table width="100%">
+ <tr><td>
+ <IMG BORDER=0 ALT="Silicon Interactive Software Design" SRC="images/small-logo.png">
+ </td><td>
+ <font color="#ff0000" size=7>freeside main menu</font>
+ </td><td align=right valign=bottom>
+ version %%%VERSION%%%
+ <BR><A HREF="http://www.sisd.com/freeside">Freeside home page</A>
+ <BR><A HREF="docs/">Documentation</A>
+ </td></tr>
+ </table>
+
+<BR>
+[<A NAME="customer_service" style="background-color: #cccccc"> Sales / Customer service </A>]
+[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
+[ <A HREF="#reports">Reports</A> ]
+[ <A HREF="#sysadmin">Sysadmin</A> ]
+ <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0" WIDTH="100%" BGCOLOR="#eeeeee">
+ <TR><TH BGCOLOR="#cccccc">Sales / Customer service</TH></TR>
+ <TR><TD>
+ <BR><FONT SIZE="+1"><A HREF="edit/cust_main.cgi">New Customer</A></FONT>
+ <BR>
+ <BR><FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="custnum_on" VALUE="1">Customer # <INPUT TYPE="text" NAME="custnum_text"><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/cust_main.cgi?browse=custnum">all customers by customer number</A></FORM>
+ <FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="last_on" VALUE="1">Last name <INPUT TYPE="text" NAME="last_text"><SELECT NAME="last_type"><OPTION SELECTED VALUE="All">(all)</OPTION><OPTION>Fuzzy<OPTION>Substring</OPTION><OPTION>Exact</OPTION></SELECT><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/cust_main.cgi?browse=last">all customers by last name</A></FORM>
+ <FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="company_on" VALUE="1">Company <INPUT TYPE="text" NAME="company_text"><SELECT NAME="company_type"><OPTION SELECTED VALUE="All">(all)</OPTION><OPTION>Fuzzy<OPTION>Substring</OPTION><OPTION>Exact</OPTION></SELECT><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/cust_main.cgi?browse=company">all customers by company</A></FORM>
+<!-- <FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="address2_on" VALUE="1">Unit <INPUT TYPE="text" NAME="address2_text"><INPUT TYPE="submit" VALUE="Search"></FORM>-->
+ <FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="phone_on" VALUE="1">Phone # <INPUT TYPE="text" NAME="phone_text"><INPUT TYPE="submit" VALUE="Search"></FORM>
+ <BR><FORM ACTION="search/svc_acct.cgi" METHOD="POST">Username <INPUT TYPE="text" NAME="username"><SELECT NAME="username_type"><OPTION VALUE="All">(all)</OPTION><OPTION>Fuzzy</OPTION><OPTION>Substring</OPTION><OPTION SELECTED>Exact</OPTION></SELECT><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_acct.cgi?username">all accounts by username</A> or <A HREF="search/svc_acct.cgi?uid">uid</A></FORM>
+ <BR><FORM ACTION="search/svc_domain.cgi" METHOD="POST">Domain <INPUT TYPE="text" NAME="domain"><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_domain.cgi?domain">all domains</A></FORM>
+<!-- <LI><A HREF="search/svc_forward.html">mail forwards (by ?)</A>-->
+ <BR>
+ </TD></TR>
+ </TABLE>
+
+
+
+ <BR><BR><BR>
+
+
+[ <A HREF="#customer_service">Sales / Customer service</A> ]
+[<A NAME="bookkeeping" style="background-color: #cccccc"> Bookkeeping / Collections </A>]
+[ <A HREF="#reports">Reports</A> ]
+[ <A HREF="#sysadmin">Sysadmin</A> ]
+ <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
+ <TR><TH BGCOLOR="#cccccc">Bookkeeping / Collections</TH></TR>
+ <TR><TD>
+ <BR><A HREF="search/cust_main-quickpay.html">Quick payment entry</A>
+ <BR>
+ <BR><FORM ACTION="search/cust_main.cgi" METHOD="POST">Credit card # <INPUT TYPE="hidden" NAME="card_on" VALUE="1"><INPUT TYPE="text" NAME="card"><INPUT TYPE="submit" VALUE="Search"></FORM>
+ <FORM ACTION="search/cust_bill.cgi" METHOD="POST">Invoice # <INPUT TYPE="text" NAME="invnum" SIZE="8"><INPUT TYPE="submit" VALUE="Search"></FORM>
+ <FORM ACTION="search/cust_pay.cgi" METHOD="POST">Check # <INPUT TYPE="text" NAME="payinfo" SIZE="8"><INPUT TYPE="hidden" NAME="payby" VALUE="BILL"><INPUT TYPE="submit" VALUE="Search"></FORM>
+ <BR><A HREF="browse/cust_pay_batch.cgi">View pending credit card batch</A> <BR><BR><A HREF="search/cust_pkg.html">Packages (by next bill date range)</A>
+ <BR><BR>Invoice reports
+ <UL>
+ <LI><a href="search/cust_bill_event.html">Invoice event errors (failed credit cards)</a>
+ <LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>)
+ <LI>30 day open invoices (<A HREF="search/cust_bill.cgi?OPEN30_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN30_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN30_custnum">by customer number</A>)
+ <LI>60 day open invoices (<A HREF="search/cust_bill.cgi?OPEN60_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN60_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN60_custnum">by customer number</A>)
+ <LI>90 day open invoices (<A HREF="search/cust_bill.cgi?OPEN90_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN90_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN90_custnum">by customer number</A>)
+ <LI>120 day open invoices (<A HREF="search/cust_bill.cgi?OPEN120_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN120_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN120_custnum">by customer number</A>)
+ <LI>all invoices (<A HREF="search/cust_bill.cgi?invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?date">by date</A>) (<A HREF="search/cust_bill.cgi?custnum">by customer number</A>)
+ </UL>
+ <A HREF="search/report_cust_pay.html">Payment report (by type and/or date range)</A>
+ <BR><BR>Financial reports
+ <UL>
+ <LI> <A HREF="search/report_receivables.cgi">current receivables</A>
+ <LI> <A HREF="search/report_tax.html">tax reports</A>
+ <LI> <A HREF="search/report_cc.html">credit card receipts</A>
+ <LI> <A HREF="search/report_credit.html">credit memos</A>
+ </UL>
+ <CENTER><HR WIDTH="94%" NOSHADE></CENTER><BR>
+ <A NAME="admin">Administration</a>
+ <ul>
+ <LI><A HREF="browse/part_pkg.cgi">View/Edit package definitions</A>
+ - One or more services are grouped together into a package and
+ given pricing information. Customers purchase packages, not
+ services.
+<!-- <LI><A HREF="browse/agent_type.cgi">View/Edit agent types</A>
+ - Agent types define groups of package definitions that you can
+ then assign to particular agents.
+ <LI><A HREF="browse/agent.cgi">View/Edit agents</A>
+ - Agents are resellers of your service. Agents may be limited
+ to a subset of your full offerings (via their type).
+-->
+ <LI><A HREF="browse/cust_main_county.cgi">View/Edit locales and tax rates</A>
+ - Change tax rates, or break down a country into states, or a state
+ into counties and assign different tax rates to each.
+ <LI><A HREF="browse/part_bill_event.cgi">View/Edit invoice events</A> - Actions for overdue invoices
+ </ul>
+ <BR>
+ </TD></TR>
+ </TABLE>
+
+
+
+ <BR><BR><BR>
+
+
+
+[ <A HREF="#customer_service">Sales / Customer service</A> ]
+[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
+[<A NAME="reports" style="background-color: #cccccc"> Reports </A>]
+[ <A HREF="#sysadmin">Sysadmin</A> ]
+ <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
+ <TR><TH BGCOLOR="#cccccc">Reports</TH></TR>
+ <TR><TD>
+ <BR>
+ Auditing pre-Freeside services with no customer record
+ <UL>
+ <LI>unlinked accounts (<A HREF="search/svc_acct.cgi?UN_svcnum">by service number</A>) (<A HREF="search/svc_acct.cgi?UN_username">by username</A>) (<A HREF="search/svc_acct.cgi?UN_uid">by uid</A>)
+<!-- <LI>unlinked mail forwards (<A HREF="search/svc_forward.cgi?UN_svcnum">by service number</A>) (by ?)) -->
+ <LI>unlinked domains (<A HREF="search/svc_domain.cgi?UN_svcnum">by service number</A>) (<A HREF="search/svc_domain.cgi?UN_domain">by domain</A>)
+ </UL>
+ Packages
+ <UL>
+ <LI><A HREF="search/cust_pkg.cgi?pkgnum">all packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?SUSP_pkgnum">suspended packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
+ <LI><A HREF="search/cust_pkg.html">packages (by next bill date range)</A>
+ </UL>
+ <A HREF="browse/part_pkg.cgi?active=1">Package definitions (by number of active packages)</A>
+ <BR><BR>Invoices
+ <UL>
+ <LI><a href="search/cust_bill_event.html">Invoice event errors (failed credit cards)</a>
+ <LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>)
+ <LI>30 day open invoices (<A HREF="search/cust_bill.cgi?OPEN30_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN30_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN30_custnum">by customer number</A>)
+ <LI>60 day open invoices (<A HREF="search/cust_bill.cgi?OPEN60_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN60_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN60_custnum">by customer number</A>)
+ <LI>90 day open invoices (<A HREF="search/cust_bill.cgi?OPEN90_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN90_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN90_custnum">by customer number</A>)
+ <LI>120 day open invoices (<A HREF="search/cust_bill.cgi?OPEN120_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN120_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN120_custnum">by customer number</A>)
+ <LI>all invoices (<A HREF="search/cust_bill.cgi?invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?date">by date</A>) (<A HREF="search/cust_bill.cgi?custnum">by customer number</A>)
+ </UL>
+ <A HREF="search/report_cust_pay.html">Payment Report (by type and/or date range)</A>
+ <BR><BR>Financial reports
+ <UL>
+ <LI> <A HREF="search/report_receivables.cgi">current receivables</A>
+ <LI> <A HREF="search/report_tax.html">tax reports</A>
+ <LI> <A HREF="search/report_cc.html">credit card receipts</A>
+ <LI> <A HREF="search/report_credit.html">credit memos</A>
+ </UL>
+ Customers
+ <UL>
+ <LI><A HREF="search/cust_main-otaker.cgi">Search customers by order-taker</A>
+ </UL>
+ <FORM ACTION="search/sql.cgi" METHOD="POST">SQL query: <TT>SELECT </TT><INPUT TYPE="text" NAME="sql" SIZE=32><INPUT TYPE="submit" VALUE="Query"></FORM>
+
+ <BR>
+ </TD></TR>
+ </TABLE>
+
+
+
+ <BR><BR><BR>
+
+
+[ <A HREF="#customer_service">Sales / Customer service</A> ]
+[ <A HREF="#bookkeeping">Bookkeeping / Collections</A> ]
+[ <A HREF="#reports">Reports</A> ]
+[<A NAME="sysadmin" style="background-color: #cccccc"> Sysadmin </A>]
+ <TABLE CELLSPACING=2 CELLPADDING=0 BORDER=0 WIDTH="100%" BGCOLOR="#eeeeee">
+ <TR><TH BGCOLOR="#cccccc">Sysadmin</TH></TR>
+ <TR><TD>
+ <BR>
+ <A HREF="browse/nas.cgi">View active NAS ports</A>
+ <BR><A HREF="browse/queue.cgi">View pending job queue</A>
+ <BR><A HREF="misc/cust_main-import.cgi">Batch import customers from CSV file</A>
+ <BR><A HREF="misc/cust_main-import_charges.cgi">Batch import charges from CSV file</A>
+ <BR><BR><CENTER><HR WIDTH="94%" NOSHADE></CENTER><BR>
+ <A NAME="config" HREF="config/config-view.cgi">Configuration</a><!-- - <font size="+2" color="#ff0000">start here</font> -->
+ <BR><BR><A NAME="admin">Administration</a>
+ <ul>
+ <LI><A HREF="browse/part_export.cgi">View/Edit exports</A>
+ - Provisioning services to external machines, databases and APIs.
+ <LI><A HREF="browse/part_svc.cgi">View/Edit service definitions</A>
+ - Services are items you offer to your customers.
+ <LI><A HREF="browse/part_pkg.cgi">View/Edit package definitions</A>
+ - One or more services are grouped together into a package and
+ given pricing information. Customers purchase packages, not
+ services.
+ <LI><A HREF="browse/agent_type.cgi">View/Edit agent types</A>
+ - Agent types define groups of package definitions that you can
+ then assign to particular agents.
+ <LI><A HREF="browse/agent.cgi">View/Edit agents</A>
+ - Agents are resellers of your service. Agents may be limited
+ to a subset of your full offerings (via their type).
+ <LI><A HREF="browse/part_referral.cgi">View/Edit advertising sources</A>
+ - Where a customer heard about your service. Tracked for
+ informational purposes.
+ <LI><A HREF="browse/cust_main_county.cgi">View/Edit locales and tax rates</A>
+ - Change tax rates, or break down a country into states, or a state
+ into counties and assign different tax rates to each.
+ <LI><A HREF="browse/svc_acct_pop.cgi">View/Edit Access Numbers</A>
+ - Points of Presence
+ <LI><A HREF="browse/part_bill_event.cgi">View/Edit invoice events</A> - Actions for overdue invoices
+ <LI><A HREF="browse/msgcat.cgi">View/Edit message catalog</A> - Change error messages and other customizable labels.
+ <LI><A HREF="browse/part_sb_field.cgi">View/Edit custom svc_broadband fields</A>
+ - Custom broadband service fields for site-specific export/informational data.
+ <LI><A HREF="browse/generic.cgi?part_router_field">View/Edit custom router fields</A>
+ - Custom router fields for site-specific export data.
+ <LI><A HREF="browse/router.cgi">View/Edit routers</A>
+ - Broadband access routers
+ <LI><A HREF="browse/addr_block.cgi">View/Edit address blocks</A>
+ - Manage address blocks and block assignments to broadband routers.
+ </ul>
+ <BR>
+ </TD></TR>
+ </TABLE>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ <BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+ </BODY>
+</HTML>
diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi
new file mode 100755
index 000000000..44d85b880
--- /dev/null
+++ b/httemplate/misc/bill.cgi
@@ -0,0 +1,38 @@
+<%
+
+#untaint custnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d*)$/;
+my $custnum = $1;
+my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
+die "Can't find customer!\n" unless $cust_main;
+
+my $error = $cust_main->bill(
+# 'time'=>$time
+ );
+#&eidiot($error) if $error;
+
+unless ( $error ) {
+ $cust_main->apply_payments;
+ $cust_main->apply_credits;
+
+ $error = $cust_main->collect(
+ # 'invoice-time'=>$time,
+ #'batch_card'=> 'yes',
+ #'batch_card'=> 'no',
+ #'report_badcard'=> 'yes',
+ #'retry_card' => 'yes',
+ 'retry' => 'yes',
+ );
+}
+#&eidiot($error) if $error;
+
+if ( $error ) {
+%>
+<!-- mason kludge -->
+<%
+ &idiot($error);
+} else {
+ print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum");
+}
+%>
diff --git a/httemplate/misc/cancel-unaudited.cgi b/httemplate/misc/cancel-unaudited.cgi
new file mode 100755
index 000000000..11cde968d
--- /dev/null
+++ b/httemplate/misc/cancel-unaudited.cgi
@@ -0,0 +1,31 @@
+<%
+
+my $dbh = dbh;
+
+#untaint svcnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+
+#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+#die "Unknown svcnum!" unless $svc_acct;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+die "Unknown svcnum!" unless $cust_svc;
+&eidiot(qq!This account has already been audited. Cancel the
+ <A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
+ qq!pkgnum"> package</A> instead.!)
+ if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0';
+
+my $error = $cust_svc->cancel;
+
+if ( $error ) {
+ %>
+<!-- mason kludge -->
+<%
+ &eidiot($error);
+} else {
+ print $cgi->redirect(popurl(2));
+}
+
+%>
diff --git a/httemplate/misc/cancel_pkg.cgi b/httemplate/misc/cancel_pkg.cgi
new file mode 100755
index 000000000..0487677df
--- /dev/null
+++ b/httemplate/misc/cancel_pkg.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint pkgnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+
+my $error = $cust_pkg->cancel;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
+
+%>
diff --git a/httemplate/misc/catchall.cgi b/httemplate/misc/catchall.cgi
new file mode 100755
index 000000000..3402b61e6
--- /dev/null
+++ b/httemplate/misc/catchall.cgi
@@ -0,0 +1,133 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my($svc_domain, $svcnum, $pkgnum, $svcpart, $part_svc);
+if ( $cgi->param('error') ) {
+ $svc_domain = new FS::svc_domain ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_domain')
+ } );
+ $svcnum = $svc_domain->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_domain) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ } else {
+
+ die "Invalid (svc_domain) svcnum!";
+
+ }
+}
+
+my %email;
+if ($pkgnum) {
+
+ #find all possible user svcnums (and emails)
+
+ #starting with that currently attached
+ if ($svc_domain->catchall) {
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall});
+ $email{$svc_domain->catchall} = $svc_acct->email;
+ }
+
+ #and including the rest for this customer
+ my($u_part_svc,@u_acct_svcparts);
+ foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
+ push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ my($i_cust_pkg);
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ $email{$svc_acct->getfield('svcnum')}=$svc_acct->email;
+ }
+ }
+ }
+
+} else {
+
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$svc_domain->catchall});
+ $email{$svc_domain->catchall} = $svc_acct->email;
+}
+
+# add an absence of a catchall
+$email{''} = "(none)";
+
+my $p1 = popurl(1);
+print header("Domain Catchall Edit", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/catchall.cgi" METHOD=POST>!;
+
+#display
+
+ #formatting
+ print "<PRE>";
+
+#svcnum
+print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
+print qq!Service #<FONT SIZE=+1><B>!, $svcnum ? $svcnum : " (NEW)", "</B></FONT>";
+
+#pkgnum
+print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
+
+#svcpart
+print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
+
+my($domain,$catchall)=(
+ $svc_domain->domain,
+ $svc_domain->catchall,
+);
+
+print qq!<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">!;
+
+#catchall
+print qq!\n\nMail to <I>(anything)</I>@<B>$domain</B> forwards to <SELECT NAME="catchall" SIZE=1>!;
+foreach $_ (keys %email) {
+ print "<OPTION", $_ eq $catchall ? " SELECTED" : "",
+ qq! VALUE="$_">$email{$_}!;
+}
+print "</SELECT>";
+
+ #formatting
+ print "</PRE>\n";
+
+print qq!<CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>!;
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
new file mode 100755
index 000000000..5346fd9d8
--- /dev/null
+++ b/httemplate/misc/change_pkg.cgi
@@ -0,0 +1,66 @@
+<!-- mason kludge -->
+<%
+
+my $pkgnum;
+if ( $cgi->param('error') ) {
+ #$custnum = $cgi->param('custnum');
+ #%remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
+ $pkgnum = ($cgi->param('remove_pkg'))[0];
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/;
+ #$custnum = $1;
+ $pkgnum = $1;
+ #%remove_pkg = ();
+}
+
+my $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } )
+ or die "unknown pkgnum $pkgnum";
+my $custnum = $cust_pkg->custnum;
+
+my $conf = new FS::Conf;
+
+my $p1 = popurl(1);
+
+my $cust_main = $cust_pkg->cust_main
+ or die "can't get cust_main record for custnum ". $cust_pkg->custnum.
+ " ( pkgnum ". cust_pkg->pkgnum. ")";
+my $agent = $cust_main->agent;
+
+print header("Change Package", menubar(
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ 'Main Menu' => $p,
+));
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT><BR><BR>"
+ if $cgi->param('error');
+
+my $part_pkg = $cust_pkg->part_pkg;
+
+print small_custview( $cust_main, $conf->config('countrydefault') ).
+ qq!<FORM ACTION="${p}edit/process/cust_pkg.cgi" METHOD=POST>!.
+ qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!.
+ qq!<INPUT TYPE="hidden" NAME="remove_pkg" VALUE="$pkgnum">!.
+ '<BR>Current package: '. $part_pkg->pkg. ' - '. $part_pkg->comment.
+ qq!<BR>New package: <SELECT NAME="new_pkgpart"><OPTION VALUE=0></OPTION>!;
+
+foreach my $part_pkg (
+ grep { ! $_->disabled && $_->pkgpart != $cust_pkg->pkgpart }
+ map { $_->part_pkg } $agent->agent_type->type_pkgs
+) {
+ my $pkgpart = $part_pkg->pkgpart;
+ print qq!<OPTION VALUE="$pkgpart"!;
+ print ' SELECTED' if $cgi->param('error')
+ && $cgi->param('new_pkgpart') == $pkgpart;
+ print qq!>$pkgpart: !. $part_pkg->pkg. ' - '. $part_pkg->comment. '</OPTION>';
+}
+
+print <<END;
+</SELECT>
+<BR><BR><INPUT TYPE="submit" VALUE="Change package">
+ </FORM>
+ </BODY>
+</HTML>
+END
+%>
diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi
new file mode 100755
index 000000000..526e128a4
--- /dev/null
+++ b/httemplate/misc/cust_main-cancel.cgi
@@ -0,0 +1,16 @@
+<%
+
+#untaint custnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal custnum";
+my $custnum = $1;
+
+my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+
+my $error = $cust_main->cancel;
+eidiot($error) if $error;
+
+#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum);
+print $cgi->redirect($p);
+
+%>
diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi
new file mode 100644
index 000000000..6b36f478d
--- /dev/null
+++ b/httemplate/misc/cust_main-import.cgi
@@ -0,0 +1,51 @@
+<!-- mason kludge -->
+<%= header('Batch Customer Import') %>
+<FORM ACTION="process/cust_main-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
+Import a CSV file containing customer records.<BR><BR>
+Default file format is CSV, with the following field order: <i>cust_pkg.setup, dayphone, first, last, address1, address2, city, state, zip, comments</i><BR><BR>
+
+<%
+ #false laziness with edit/cust_main.cgi
+ my @agents = qsearch( 'agent', {} );
+ die "No agents created!" unless @agents;
+ my $agentnum = $agents[0]->agentnum; #default to first
+
+ if ( scalar(@agents) == 1 ) {
+%>
+ <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
+<% } else { %>
+ <BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
+ <% foreach my $agent (sort { $a->agent cmp $b->agent } @agents) { %>
+ <OPTION VALUE="<%= $agent->agentnum %>" <%= " SELECTED"x($agent->agentnum==$agentnum) %>><%= $agent->agent %></OPTION>
+ <% } %>
+ </SELECT><BR><BR>
+<% } %>
+
+<%
+ my @referrals = qsearch('part_referral',{});
+ die "No advertising sources created!" unless @referrals;
+ my $refnum = $referrals[0]->refnum; #default to first
+
+ if ( scalar(@referrals) == 1 ) {
+%>
+ <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $refnum %>">
+<% } else { %>
+ <BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
+ <% foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) { %>
+ <OPTION VALUE="<%= $referral->refnum %>" <%= " SELECTED"x($referral->refnum==$refnum) %>><%= $referral->refnum %>: <%= $referral->referral %></OPTION>
+ <% } %>
+ </SELECT><BR><BR>
+<% } %>
+
+ First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
+<% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) { %>
+ <OPTION VALUE="<%= $part_pkg->pkgpart %>"><%= $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
+<% } %>
+</SELECT><BR><BR>
+
+ CSV Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
+ <INPUT TYPE="submit" VALUE="Import">
+ </FORM>
+ </BODY>
+<HTML>
+
diff --git a/httemplate/misc/cust_main-import_charges.cgi b/httemplate/misc/cust_main-import_charges.cgi
new file mode 100644
index 000000000..0822b9eb6
--- /dev/null
+++ b/httemplate/misc/cust_main-import_charges.cgi
@@ -0,0 +1,14 @@
+<!-- mason kludge -->
+<%= header('Batch Customer Charge') %>
+<FORM ACTION="process/cust_main-import_charges.cgi" METHOD="post" ENCTYPE="multipart/form-data">
+Import a CSV file containing customer charges.<BR><BR>
+Default file format is CSV, with the following field order: <i>custnum, amount, description</i><BR><BR>
+If <i>amount</i> is negative, a credit will be applied instead.<BR><BR>
+<BR><BR>
+
+ CSV Filename: <INPUT TYPE="file" NAME="csvfile"><BR><BR>
+ <INPUT TYPE="submit" VALUE="Import">
+ </FORM>
+ </BODY>
+<HTML>
+
diff --git a/httemplate/misc/delete-cust_pay.cgi b/httemplate/misc/delete-cust_pay.cgi
new file mode 100755
index 000000000..3efd918ab
--- /dev/null
+++ b/httemplate/misc/delete-cust_pay.cgi
@@ -0,0 +1,16 @@
+<%
+
+#untaint paynum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal paynum";
+my $paynum = $1;
+
+my $cust_pay = qsearchs('cust_pay',{'paynum'=>$paynum});
+my $custnum = $cust_pay->custnum;
+
+my $error = $cust_pay->delete;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);
+
+%>
diff --git a/httemplate/misc/delete-customer.cgi b/httemplate/misc/delete-customer.cgi
new file mode 100755
index 000000000..430231737
--- /dev/null
+++ b/httemplate/misc/delete-customer.cgi
@@ -0,0 +1,60 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
+
+my($custnum, $new_custnum);
+if ( $cgi->param('error') ) {
+ $custnum = $cgi->param('custnum');
+ $new_custnum = $cgi->param('new_custnum');
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "Illegal query: $query";
+ $custnum = $1;
+ $new_custnum = '';
+}
+my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
+ or die "Customer not found: $custnum";
+
+print header('Delete customer');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print
+ qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
+ qq!<input type="hidden" name="custnum" value="$custnum">!;
+
+if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
+ print "Move uncancelled packages to customer number ",
+ qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
+}
+
+print <<END;
+This will <b>completely remove</b> all traces of this customer record. This
+is <B>not</B> what you want if this is a real customer who has simply
+canceled service with you. For that, cancel all of the customer's packages.
+(you can optionally hide cancelled customers with the <a href="../config/config-view.cgi#hidecancelledcustomers">hidecancelledcustomers</a> configuration option)
+<br>
+<br>Are you <b>absolutely sure</b> you want to delete this customer?
+<br><input type="submit" value="Yes">
+</form></body></html>
+END
+
+#Deleting a customer you have financial records on (i.e. credits) is
+#typically considered fraudulant bookkeeping. Remember, deleting
+#customers should ONLY be used for completely bogus records. You should
+#NOT delete real customers who simply discontinue service.
+#
+#For real customers who simply discontinue service, cancel all of the
+#customer's packages. Customers with all cancelled packages are not
+#billed. There is no need to take further action to prevent billing on
+#customers with all cancelled packages.
+#
+#Also see the "hidecancelledcustomers" and "hidecancelledpackages"
+#configuration options, which will allow you to surpress the display of
+#cancelled customers and packages, respectively.
+
+%>
diff --git a/httemplate/misc/delete-domain_record.cgi b/httemplate/misc/delete-domain_record.cgi
new file mode 100755
index 000000000..dcc2d5022
--- /dev/null
+++ b/httemplate/misc/delete-domain_record.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint recnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal recnum";
+my $recnum = $1;
+
+my $domain_record = qsearchs('domain_record',{'recnum'=>$recnum});
+
+my $error = $domain_record->delete;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "view/svc_domain.cgi?". $domain_record->svcnum);
+
+%>
diff --git a/httemplate/misc/delete-part_export.cgi b/httemplate/misc/delete-part_export.cgi
new file mode 100755
index 000000000..7c4ab8b9d
--- /dev/null
+++ b/httemplate/misc/delete-part_export.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint exportnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal exportnum";
+my $exportnum = $1;
+
+my $part_export = qsearchs('part_export',{'exportnum'=>$exportnum});
+
+my $error = $part_export->delete;
+eidiot($error) if $error;
+
+print $cgi->redirect($p. "browse/part_export.cgi");
+
+%>
diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi
new file mode 100755
index 000000000..9e4ce8b62
--- /dev/null
+++ b/httemplate/misc/expire_pkg.cgi
@@ -0,0 +1,25 @@
+<%
+
+#untaint date & pkgnum
+
+my $date;
+if ( $cgi->param('date') ) {
+ str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
+ $date=$1;
+} else {
+ $date='';
+}
+
+$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+my %hash = $cust_pkg->hash;
+$hash{expire}=$date;
+my $new = new FS::cust_pkg ( \%hash );
+my $error = $new->replace($cust_pkg);
+&eidiot($error) if $error;
+
+print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
+
+%>
diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi
new file mode 100755
index 000000000..79adce88c
--- /dev/null
+++ b/httemplate/misc/link.cgi
@@ -0,0 +1,45 @@
+<!-- mason kludge -->
+<%
+
+my %link_field = (
+ 'svc_acct' => 'username',
+ 'svc_domain' => 'domain',
+ 'svc_charge' => '',
+ 'svc_wo' => '',
+);
+
+my($query) = $cgi->keywords;
+my($pkgnum, $svcpart) = ('', '');
+foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+}
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
+my $svc = $part_svc->getfield('svc');
+my $svcdb = $part_svc->getfield('svcdb');
+my $link_field = $link_field{$svcdb};
+
+print header("Link to existing $svc"),
+ qq!<FORM ACTION="!, popurl(1), qq!process/link.cgi" METHOD=POST>!;
+
+if ( $link_field ) {
+ print <<END;
+ <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
+ <INPUT TYPE="hidden" NAME="link_field" VALUE="$link_field">
+ $link_field of existing service: <INPUT TYPE="text" NAME="link_value">
+END
+} else {
+ print qq!Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">!;
+}
+
+print <<END;
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
+<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
+<P><CENTER><INPUT TYPE="submit" VALUE="Link"></CENTER>
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi
new file mode 100644
index 000000000..2f3b7380d
--- /dev/null
+++ b/httemplate/misc/meta-import.cgi
@@ -0,0 +1,64 @@
+<!-- mason kludge -->
+<%= header('Import') %>
+<FORM ACTION="process/meta-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
+Import data from a DBI data source<BR><BR>
+
+<%
+ #false laziness with edit/cust_main.cgi
+ my @agents = qsearch( 'agent', {} );
+ die "No agents created!" unless @agents;
+ my $agentnum = $agents[0]->agentnum; #default to first
+
+ if ( scalar(@agents) == 1 ) {
+%>
+ <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
+<% } else { %>
+ <BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
+ <% foreach my $agent (sort { $a->agent cmp $b->agent } @agents) { %>
+ <OPTION VALUE="<%= $agent->agentnum %>" <%= " SELECTED"x($agent->agentnum==$agentnum) %>><%= $agent->agent %></OPTION>
+ <% } %>
+ </SELECT><BR><BR>
+<% } %>
+
+<%
+ my @referrals = qsearch('part_referral',{});
+ die "No advertising sources created!" unless @referrals;
+ my $refnum = $referrals[0]->refnum; #default to first
+
+ if ( scalar(@referrals) == 1 ) {
+%>
+ <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $refnum %>">
+<% } else { %>
+ <BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
+ <% foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) { %>
+ <OPTION VALUE="<%= $referral->refnum %>" <%= " SELECTED"x($referral->refnum==$refnum) %>><%= $referral->refnum %>: <%= $referral->referral %></OPTION>
+ <% } %>
+ </SELECT><BR><BR>
+<% } %>
+
+ First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
+<% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) { %>
+ <OPTION VALUE="<%= $part_pkg->pkgpart %>"><%= $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
+<% } %>
+</SELECT><BR><BR>
+
+ <table>
+ <tr>
+ <td align="right">DBI data source: </td>
+ <td><INPUT TYPE="text" NAME="data_source"></td>
+ </tr>
+ <tr>
+ <td align="right">DBI username: </td>
+ <td><INPUT TYPE="text" NAME="username"></td>
+ </tr>
+ <tr>
+ <td align="right">DBI password: </td>
+ <td><INPUT TYPE="text" NAME="password"></td>
+ </tr>
+ </table>
+ <INPUT TYPE="submit" VALUE="Import">
+
+ </FORM>
+ </BODY>
+<HTML>
+
diff --git a/httemplate/misc/print-invoice.cgi b/httemplate/misc/print-invoice.cgi
new file mode 100755
index 000000000..a5500bff2
--- /dev/null
+++ b/httemplate/misc/print-invoice.cgi
@@ -0,0 +1,23 @@
+<%
+
+my $conf = new FS::Conf;
+my $lpr = $conf->config('lpr');
+
+#untaint invnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d*)$/;
+my $invnum = $1;
+my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
+die "Can't find invoice!\n" unless $cust_bill;
+
+ open(LPR,"|$lpr") or die "Can't open $lpr: $!";
+ print LPR $cust_bill->print_text; #( date )
+ close LPR
+ or die $! ? "Error closing $lpr: $!"
+ : "Exit status $? from $lpr";
+
+my $custnum = $cust_bill->getfield('custnum');
+
+print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history");
+
+%>
diff --git a/httemplate/misc/process/catchall.cgi b/httemplate/misc/process/catchall.cgi
new file mode 100755
index 000000000..44a63f9f8
--- /dev/null
+++ b/httemplate/misc/process/catchall.cgi
@@ -0,0 +1,33 @@
+<%
+
+$FS::svc_domain::whois_hack=1;
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum =$1;
+
+my $old = qsearchs('svc_domain',{'svcnum'=>$svcnum}) if $svcnum;
+
+my $new = new FS::svc_domain ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ } ( fields('svc_domain'), qw( pkgnum svcpart ) )
+} );
+
+$new->setfield('action' => 'M');
+
+my $error;
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->getfield('svcnum');
+}
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "catchall.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/misc/process/cust_main-import.cgi b/httemplate/misc/process/cust_main-import.cgi
new file mode 100644
index 000000000..9e1adce54
--- /dev/null
+++ b/httemplate/misc/process/cust_main-import.cgi
@@ -0,0 +1,30 @@
+<%
+
+ my $fh = $cgi->upload('csvfile');
+ #warn $cgi;
+ #warn $fh;
+
+ my $error = defined($fh)
+ ? FS::cust_main::batch_import( {
+ filehandle => $fh,
+ agentnum => scalar($cgi->param('agentnum')),
+ refnum => scalar($cgi->param('refnum')),
+ pkgpart => scalar($cgi->param('pkgpart')),
+ 'fields' => [qw( cust_pkg.setup dayphone first last address1 address2
+ city state zip comments )],
+ } )
+ : 'No file';
+
+ if ( $error ) {
+ %>
+ <!-- mason kludge -->
+ <%
+ eidiot($error);
+# $cgi->param('error', $error);
+# print $cgi->redirect( "${p}cust_main-import.cgi
+ } else {
+ %>
+ <!-- mason kludge -->
+ <%= header('Import sucessful') %> <%
+ }
+%>
diff --git a/httemplate/misc/process/cust_main-import_charges.cgi b/httemplate/misc/process/cust_main-import_charges.cgi
new file mode 100644
index 000000000..14df1bd8d
--- /dev/null
+++ b/httemplate/misc/process/cust_main-import_charges.cgi
@@ -0,0 +1,26 @@
+<%
+
+ my $fh = $cgi->upload('csvfile');
+ #warn $cgi;
+ #warn $fh;
+
+ my $error = defined($fh)
+ ? FS::cust_main::batch_charge( {
+ filehandle => $fh,
+ 'fields' => [qw( custnum amount pkg )],
+ } )
+ : 'No file';
+
+ if ( $error ) {
+ %>
+ <!-- mason kludge -->
+ <%
+ eidiot($error);
+# $cgi->param('error', $error);
+# print $cgi->redirect( "${p}cust_main-import_charges.cgi
+ } else {
+ %>
+ <!-- mason kludge -->
+ <%= header('Import sucessful') %> <%
+ }
+%>
diff --git a/httemplate/misc/process/delete-customer.cgi b/httemplate/misc/process/delete-customer.cgi
new file mode 100755
index 000000000..16bdbaea8
--- /dev/null
+++ b/httemplate/misc/process/delete-customer.cgi
@@ -0,0 +1,29 @@
+<%
+
+my $conf = new FS::Conf;
+die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
+
+$cgi->param('custnum') =~ /^(\d+)$/;
+my $custnum = $1;
+my $new_custnum;
+if ( $cgi->param('new_custnum') ) {
+ $cgi->param('new_custnum') =~ /^(\d+)$/
+ or die "Illegal new customer number: ". $cgi->param('new_custnum');
+ $new_custnum = $1;
+} else {
+ $new_custnum = '';
+}
+my $cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
+ or die "Customer not found: $custnum";
+
+my $error = $cust_main->delete($new_custnum);
+
+if ( $error ) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string );
+} elsif ( $new_custnum ) {
+ print $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum");
+} else {
+ print $cgi->redirect(popurl(3));
+}
+%>
diff --git a/httemplate/misc/process/link.cgi b/httemplate/misc/process/link.cgi
new file mode 100755
index 000000000..5d80adeb9
--- /dev/null
+++ b/httemplate/misc/process/link.cgi
@@ -0,0 +1,43 @@
+<%
+
+$cgi->param('pkgnum') =~ /^(\d+)$/;
+my $pkgnum = $1;
+$cgi->param('svcpart') =~ /^(\d+)$/;
+my $svcpart = $1;
+$cgi->param('svcnum') =~ /^(\d*)$/;
+my $svcnum = $1;
+
+unless ( $svcnum ) {
+ my $part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
+ my $svcdb = $part_svc->getfield('svcdb');
+ $cgi->param('link_field') =~ /^(\w+)$/;
+ my $link_field = $1;
+ my $svc_x = ( grep { $_->cust_svc->svcpart == $svcpart }
+ qsearch( $svcdb, { $link_field => $cgi->param('link_value') })
+ )[0];
+ eidiot("$link_field not found!") unless $svc_x;
+ $svcnum = $svc_x->svcnum;
+}
+
+my $old = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+die "svcnum not found!" unless $old;
+#die "svcnum $svcnum already linked to package ". $old->pkgnum if $old->pkgnum;
+my $new = new FS::cust_svc ({
+ 'svcnum' => $svcnum,
+ 'pkgnum' => $pkgnum,
+ 'svcpart' => $svcpart,
+});
+
+my $error = $new->replace($old);
+
+unless ($error) {
+ #no errors, so let's view this customer.
+ print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum");
+} else {
+%>
+<!-- mason kludge -->
+<%
+ idiot($error);
+}
+
+%>
diff --git a/httemplate/misc/process/meta-import.cgi b/httemplate/misc/process/meta-import.cgi
new file mode 100644
index 000000000..2939c8fb2
--- /dev/null
+++ b/httemplate/misc/process/meta-import.cgi
@@ -0,0 +1,178 @@
+<!-- mason kludge -->
+<%= header('Map tables') %>
+
+<SCRIPT>
+var gSafeOnload = new Array();
+var gSafeOnsubmit = new Array();
+window.onload = SafeOnload;
+function SafeAddOnLoad(f) {
+ gSafeOnload[gSafeOnload.length] = f;
+}
+function SafeOnload() {
+ for (var i=0;i<gSafeOnload.length;i++)
+ gSafeOnload[i]();
+}
+function SafeAddOnSubmit(f) {
+ gSafeOnsubmit[gSafeOnsubmit.length] = f;
+}
+function SafeOnsubmit() {
+ for (var i=0;i<gSafeOnsubmit.length;i++)
+ gSafeOnsubmit[i]();
+}
+</SCRIPT>
+
+<FORM NAME="OneTrueForm" METHOD="POST" ACTION="meta-import.cgi">
+
+<%
+ #use DBIx::DBSchema;
+ my $schema = new_native DBIx::DBSchema
+ map { $cgi->param($_) } qw( data_source username password );
+ foreach my $field (qw( data_source username password )) { %>
+ <INPUT TYPE="hidden" NAME=<%= $field %> VALUE="<%= $cgi->param($field) %>">
+ <% }
+
+ my %schema;
+ use Tie::DxHash;
+ tie %schema, 'Tie::DxHash';
+ if ( $cgi->param('schema') ) {
+ my $schema_string = $cgi->param('schema');
+ %> <INPUT TYPE="hidden" NAME="schema" VALUE="<%=$schema_string%>"> <%
+ %schema = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/
+ or die "guru meditation #420: $_";
+ ( $1 => $2 );
+ }
+ split( /\n/, $schema_string );
+ }
+
+ #first page
+ unless ( $cgi->param('magic') ) { %>
+
+ <INPUT TYPE="hidden" NAME="magic" VALUE="process">
+ <%= hashmaker('schema', [ $schema->tables ],
+ [ grep !/^h_/, dbdef->tables ], ) %>
+ <br><INPUT TYPE="submit" VALUE="done">
+ <%
+
+ #second page
+ } elsif ( $cgi->param('magic') eq 'process' ) { %>
+
+ <INPUT TYPE="hidden" NAME="magic" VALUE="process2">
+ <%
+
+ my %unique;
+ foreach my $table ( keys %schema ) {
+
+ my @from_columns = $schema->table($table)->columns;
+ my @fs_columns = dbdef->table($schema{$table})->columns;
+
+ %>
+ <%= hashmaker( $table.'__'.$unique{$table}++,
+ \@from_columns => \@fs_columns,
+ $table => $schema{$table}, ) %>
+ <br><hr><br>
+ <%
+
+ }
+
+ %>
+ <br><INPUT TYPE="submit" VALUE="done">
+ <%
+
+ #third (results)
+ } elsif ( $cgi->param('magic') eq 'process2' ) {
+
+ print "<pre>\n";
+
+ my %unique;
+ foreach my $table ( keys %schema ) {
+ ( my $spaces = $table ) =~ s/./ /g;
+ print "'$table' => { 'table' => '$schema{$table}',\n".
+ #(length($table) x ' '). " 'map' => {\n";
+ "$spaces 'map' => {\n";
+ my %map = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/
+ or die "guru meditation #420: $_";
+ ( $1 => $2 );
+ }
+ split( /\n/, $cgi->param($table.'__'.$unique{$table}++) );
+ foreach ( keys %map ) {
+ print "$spaces '$_' => '$map{$_}',\n";
+ }
+ print "$spaces },\n";
+ print "$spaces },\n";
+
+ }
+ print "\n</pre>";
+
+ } else {
+ warn "unrecognized magic: ". $cgi->param('magic');
+ }
+
+ %>
+</FORM>
+</BODY>
+</HTML>
+
+ <%
+ #hashmaker widget
+ sub hashmaker {
+ my($name, $from, $to, $labelfrom, $labelto) = @_;
+ $fromsize = scalar(@$from);
+ $tosize = scalar(@$to);
+ "<TABLE><TR><TH>$labelfrom</TH><TH>$labelto</TH></TR><TR><TD>".
+ qq!<SELECT NAME="${name}_from" SIZE=$fromsize>\n!.
+ join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$from ).
+ "</SELECT>\n<BR>".
+ qq!<INPUT TYPE="button" VALUE="refill" onClick="repack_${name}_from()">!.
+ '</TD><TD>'.
+ qq!<SELECT NAME="${name}_to" SIZE=$tosize>\n!.
+ join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$to ).
+ "</SELECT>\n<BR>".
+ qq!<INPUT TYPE="button" VALUE="refill" onClick="repack_${name}_to()">!.
+ '</TD></TR>'.
+ '<TR><TD COLSPAN=2>'.
+ qq!<INPUT TYPE="button" VALUE="map" onClick="toke_$name(this.form)">!.
+ '</TD></TR><TR><TD COLSPAN=2>'.
+ qq!<TEXTAREA NAME="$name" COLS=80 ROWS=8></TEXTAREA>!.
+ '</TD></TR></TABLE>'.
+ "<script>
+ function toke_$name() {
+ fromObject = document.OneTrueForm.${name}_from;
+ for (var i=fromObject.options.length-1;i>-1;i--) {
+ if (fromObject.options[i].selected)
+ fromname = deleteOption_$name(fromObject,i);
+ }
+ toObject = document.OneTrueForm.${name}_to;
+ for (var i=toObject.options.length-1;i>-1;i--) {
+ if (toObject.options[i].selected)
+ toname = deleteOption_$name(toObject,i);
+ }
+ document.OneTrueForm.$name.value = document.OneTrueForm.$name.value + fromname + ' => ' + toname + '\\n';
+ }
+ function deleteOption_$name(object,index) {
+ value = object.options[index].value;
+ object.options[index] = null;
+ return value;
+ }
+ function repack_${name}_from() {
+ var object = document.OneTrueForm.${name}_from;
+ object.options.length = 0;
+ ". join("\n",
+ map { "addOption_$name(object, '$_');\n" }
+ ( sort { $a cmp $b } @$from ) ). "
+ }
+ function repack_${name}_to() {
+ var object = document.OneTrueForm.${name}_to;
+ object.options.length = 0;
+ ". join("\n",
+ map { "addOption_$name(object, '$_');\n" }
+ ( sort { $a cmp $b } @$to ) ). "
+ }
+ function addOption_$name(object,value) {
+ var length = object.length;
+ object.options[length] = new Option(value, value, false, false);
+ }
+ </script>".
+ '';
+ }
+
+%>
diff --git a/httemplate/misc/queue.cgi b/httemplate/misc/queue.cgi
new file mode 100644
index 000000000..ce9c8fbd3
--- /dev/null
+++ b/httemplate/misc/queue.cgi
@@ -0,0 +1,47 @@
+<%
+
+$cgi->param('action') =~ /^(new|del|(retry|remove) selected)$/
+ or die "Illegal action";
+my $action = $1;
+
+my $job;
+if ( $action eq 'new' || $action eq 'del' ) {
+ $cgi->param('jobnum') =~ /^(\d+)$/ or die "Illegal jobnum";
+ my $jobnum = $1;
+ $job = qsearchs('queue', { 'jobnum' => $1 })
+ or die "unknown jobnum $jobnum - ".
+ "it probably completed normally or was removed by another user";
+}
+
+if ( $action eq 'new' ) {
+ my %hash = $job->hash;
+ $hash{'status'} = 'new';
+ $hash{'statustext'} = '';
+ my $new = new FS::queue \%hash;
+ my $error = $new->replace($job);
+ die $error if $error;
+} elsif ( $action eq 'del' ) {
+ my $error = $job->delete;
+ die $error if $error;
+} elsif ( $action =~ /^(retry|remove) selected$/ ) {
+ foreach my $jobnum (
+ map { /^jobnum(\d+)$/; $1; } grep /^jobnum\d+$/, $cgi->param
+ ) {
+ my $job = qsearchs('queue', { 'jobnum' => $jobnum });
+ if ( $action eq 'retry selected' && $job ) { #new
+ my %hash = $job->hash;
+ $hash{'status'} = 'new';
+ $hash{'statustext'} = '';
+ my $new = new FS::queue \%hash;
+ my $error = $new->replace($job);
+ die $error if $error;
+ } elsif ( $action eq 'remove selected' && $job ) { #del
+ my $error = $job->delete;
+ die $error if $error;
+ }
+ }
+}
+
+print $cgi->redirect(popurl(2). "browse/queue.cgi");
+
+%>
diff --git a/httemplate/misc/susp_pkg.cgi b/httemplate/misc/susp_pkg.cgi
new file mode 100755
index 000000000..4a19fa830
--- /dev/null
+++ b/httemplate/misc/susp_pkg.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint pkgnum
+my ($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+
+my $error = $cust_pkg->suspend;
+&eidiot($error) if $error;
+
+print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
+
+%>
diff --git a/httemplate/misc/unapply-cust_pay.cgi b/httemplate/misc/unapply-cust_pay.cgi
new file mode 100755
index 000000000..28643ef6e
--- /dev/null
+++ b/httemplate/misc/unapply-cust_pay.cgi
@@ -0,0 +1,18 @@
+<%
+
+#untaint paynum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal paynum";
+my $paynum = $1;
+
+my $cust_pay = qsearchs('cust_pay', { 'paynum' => $paynum } );
+my $custnum = $cust_pay->custnum;
+
+foreach my $cust_bill_pay ( $cust_pay->cust_bill_pay ) {
+ my $error = $cust_bill_pay->delete;
+ eidiot($error) if $error;
+}
+
+print $cgi->redirect($p. "view/cust_main.cgi?". $custnum);
+
+%>
diff --git a/httemplate/misc/unprovision.cgi b/httemplate/misc/unprovision.cgi
new file mode 100755
index 000000000..8f2a7d13d
--- /dev/null
+++ b/httemplate/misc/unprovision.cgi
@@ -0,0 +1,33 @@
+<%
+
+my $dbh = dbh;
+
+#untaint svcnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+
+#my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+#die "Unknown svcnum!" unless $svc_acct;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+die "Unknown svcnum!" unless $cust_svc;
+#&eidiot(qq!This account has already been audited. Cancel the
+# <A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
+# qq!pkgnum"> package</A> instead.!)
+# if $cust_svc->pkgnum ne '' && $cust_svc->pkgnum ne '0';
+
+my $custnum = $cust_svc->cust_pkg->custnum;
+
+my $error = $cust_svc->cancel;
+
+if ( $error ) {
+ %>
+<!-- mason kludge -->
+<%
+ &eidiot($error);
+} else {
+ print $cgi->redirect(popurl(2)."view/cust_main.cgi?$custnum");
+}
+
+%>
diff --git a/httemplate/misc/unsusp_pkg.cgi b/httemplate/misc/unsusp_pkg.cgi
new file mode 100755
index 000000000..500872983
--- /dev/null
+++ b/httemplate/misc/unsusp_pkg.cgi
@@ -0,0 +1,15 @@
+<%
+
+#untaint pkgnum
+my ($query) = $cgi->keywords;
+$query =~ /^(\d+)$/ || die "Illegal pkgnum";
+my $pkgnum = $1;
+
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+
+my $error = $cust_pkg->unsuspend;
+&eidiot($error) if $error;
+
+print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
+
+%>
diff --git a/httemplate/search/cust_bill.cgi b/httemplate/search/cust_bill.cgi
new file mode 100755
index 000000000..985e3dbf5
--- /dev/null
+++ b/httemplate/search/cust_bill.cgi
@@ -0,0 +1,165 @@
+<%
+
+my $conf = new FS::Conf;
+my $maxrecords = $conf->config('maxsearchrecordsperpage');
+
+my $orderby = ''; #removeme
+
+my $limit = '';
+$limit .= "LIMIT $maxrecords" if $maxrecords;
+
+my $offset = $cgi->param('offset') || 0;
+$limit .= " OFFSET $offset" if $offset;
+
+my($total, $tot_amount, $tot_balance);
+
+my(@cust_bill);
+if ( $cgi->keywords ) {
+ my($query) = $cgi->keywords;
+ my $owed = "charged - ( select coalesce(sum(amount),0) from cust_bill_pay
+ where cust_bill_pay.invnum = cust_bill.invnum )
+ - ( select coalesce(sum(amount),0) from cust_credit_bill
+ where cust_credit_bill.invnum = cust_bill.invnum )";
+ my @where;
+ if ( $query =~ /^(OPEN(\d*)_)?(invnum|date|custnum)$/ ) {
+ my($open, $days, $field) = ($1, $2, $3);
+ $field = "_date" if $field eq 'date';
+ $orderby = "ORDER BY cust_bill.$field";
+ push @where, "0 != $owed" if $open;
+ push @where, "cust_bill._date < ". (time-86400*$days) if $days;
+ } else {
+ die "unknown query string $query";
+ }
+
+ my $extra_sql = scalar(@where) ? 'WHERE '. join(' AND ', @where) : '';
+
+ my $statement = "SELECT COUNT(*), sum(charged), sum($owed)
+ FROM cust_bill $extra_sql";
+ my $sth = dbh->prepare($statement) or die dbh->errstr. " doing $statement";
+ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
+
+ ( $total, $tot_amount, $tot_balance ) = @{$sth->fetchrow_arrayref};
+
+ @cust_bill = qsearch(
+ 'cust_bill',
+ {},
+ "cust_bill.*, $owed as owed",
+ "$extra_sql $orderby $limit"
+ );
+} else {
+ $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/;
+ my $invnum = $2;
+ @cust_bill = qsearchs('cust_bill', { 'invnum' => $invnum } );
+ $total = scalar(@cust_bill);
+}
+
+#if ( scalar(@cust_bill) == 1 ) {
+if ( $total == 1 ) {
+ my $invnum = $cust_bill[0]->invnum;
+ print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect
+} elsif ( scalar(@cust_bill) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot("Invoice not found.");
+} else {
+%>
+<!-- mason kludge -->
+<%
+
+ #begin pager
+ my $pager = '';
+ if ( $total != scalar(@cust_bill) && $maxrecords ) {
+ unless ( $offset == 0 ) {
+ $cgi->param('offset', $offset - $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Previous</FONT></B></A> ';
+ }
+ my $poff;
+ my $page;
+ for ( $poff = 0; $poff < $total; $poff += $maxrecords ) {
+ $page++;
+ if ( $offset == $poff ) {
+ $pager .= qq!<FONT SIZE="+2">$page</FONT> !;
+ } else {
+ $cgi->param('offset', $poff);
+ $pager .= qq!<A HREF="!. $cgi->self_url. qq!">$page</A> !;
+ }
+ }
+ unless ( $offset + $maxrecords > $total ) {
+ $cgi->param('offset', $offset + $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
+ }
+ }
+ #end pager
+
+ print header("Invoice Search Results", menubar(
+ 'Main Menu', popurl(2)
+ )).
+ "$total matching invoices found<BR>".
+ "\$$tot_balance total balance<BR>".
+ "\$$tot_amount total amount<BR>".
+ "<BR>$pager". table(). <<END;
+ <TR>
+ <TH></TH>
+ <TH>Balance</TH>
+ <TH>Amount</TH>
+ <TH>Date</TH>
+ <TH>Contact name</TH>
+ <TH>Company</TH>
+ </TR>
+END
+
+ foreach my $cust_bill ( @cust_bill ) {
+ my($invnum, $owed, $charged, $date ) = (
+ $cust_bill->invnum,
+ sprintf("%.2f", $cust_bill->getfield('owed')),
+ sprintf("%.2f", $cust_bill->charged),
+ $cust_bill->_date,
+ );
+ my $pdate = time2str("%b %d %Y", $date);
+
+ my $rowspan = 1;
+
+ my $view = popurl(2). "view/cust_bill.cgi?$invnum";
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$invnum</FONT></A></TD>
+ <TD ROWSPAN=$rowspan ALIGN="right"><A HREF="$view"><FONT SIZE=-1>\$$owed</FONT></A></TD>
+ <TD ROWSPAN=$rowspan ALIGN="right"><A HREF="$view"><FONT SIZE=-1>\$$charged</FONT></A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$pdate</FONT></A></TD>
+END
+ my $custnum = $cust_bill->custnum;
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+ if ( $cust_main ) {
+ my $cview = popurl(2). "view/cust_main.cgi?". $cust_main->custnum;
+ my ( $name, $company ) = (
+ $cust_main->last. ', '. $cust_main->first,
+ $cust_main->company,
+ );
+ print <<END;
+ <TD ROWSPAN=$rowspan><A HREF="$cview"><FONT SIZE=-1>$name</FONT></A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="$cview"><FONT SIZE=-1>$company</FONT></A></TD>
+END
+ } else {
+ print <<END
+ <TD ROWSPAN=$rowspan COLSPAN=2>WARNING: couldn't find cust_main.custnum $custnum (cust_bill.invnum $invnum)</TD>
+END
+ }
+
+ print "</TR>";
+ }
+ $tot_balance = sprintf("%.2f", $tot_balance);
+ $tot_amount = sprintf("%.2f", $tot_amount);
+ print "</TABLE>$pager<BR>". table(). <<END;
+ <TR><TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD><TH><FONT SIZE=-1>Total<BR>Balance</FONT></TH><TH><FONT SIZE=-1>Total<BR>Amount</FONT></TH></TR>
+ <TR><TD></TD><TD ALIGN="right"><FONT SIZE=-1>\$$tot_balance</FONT></TD><TD ALIGN="right"><FONT SIZE=-1>\$$tot_amount</FONT></TD></TD></TR>
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+}
+
+%>
diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html
new file mode 100755
index 000000000..36e8bc91b
--- /dev/null
+++ b/httemplate/search/cust_bill.html
@@ -0,0 +1,19 @@
+<HTML>
+ <HEAD>
+ <TITLE>Invoice Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Invoice Search
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="cust_bill.cgi" METHOD="post">
+ Search for <B>invoice #</B>:
+ <INPUT TYPE="text" NAME="invnum">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi
new file mode 100644
index 000000000..b76f66b76
--- /dev/null
+++ b/httemplate/search/cust_bill_event.cgi
@@ -0,0 +1,62 @@
+<!-- mason kludge -->
+<%
+
+#false laziness with view/cust_bill.cgi
+
+$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
+my $beginning = str2time($1) || 0;
+
+$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/;
+my $ending = str2time($1) + 86400;
+
+my @cust_bill_event =
+ sort { $a->_date <=> $b->_date }
+ qsearch('cust_bill_event', {
+ _date => { op=> '>=', value=>$beginning },
+ statustext => { op=> '!=', value=>'' },
+# i wish...
+# _date => { op=> '<=', value=>$ending },
+ }, '', "AND _date <= $ending");
+
+%>
+
+<%= header('Failed billing events') %>
+
+<%= table() %>
+<TR>
+ <TH>Event</TH>
+ <TH>Date</TH>
+ <TH>Status</TH>
+ <TH>Invoice</TH>
+ <TH>(bill) name</TH>
+ <TH>company</TH>
+<% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %>
+ <TH>(service) name</TH>
+ <TH>company</TH>
+<% } %>
+</TR>
+
+<% foreach my $cust_bill_event ( @cust_bill_event ) {
+ my $status = $cust_bill_event->status;
+ $status .= ': '.$cust_bill_event->statustext if $cust_bill_event->statustext;
+ my $cust_bill = $cust_bill_event->cust_bill;
+ my $cust_main = $cust_bill->cust_main;
+ my $invlink = "${p}view/cust_bill.cgi?". $cust_bill->invnum;
+ my $custlink = "${p}view/cust_main.cgi?". $cust_main->custnum;
+%>
+<TR>
+ <TD><%= $cust_bill_event->part_bill_event->event %></TD>
+ <TD><%= time2str("%a %b %e %T %Y", $cust_bill_event->_date) %></TD>
+ <TD><%= $status %></TD>
+ <TD><A HREF="<%=$invlink%>">Invoice #<%= $cust_bill->invnum %> (<%= time2str("%D", $cust_bill->_date ) %>)</A></TD>
+ <TD><A HREF="<%=$custlink%>"><%= $cust_main->last. ', '. $cust_main->first %></A></TD>
+ <TD><A HREF="<%=$custlink%>"><%= $cust_main->company %></A></TD>
+ <% if ( defined dbdef->table('cust_main')->column('ship_last') ) { %>
+ <TD><A HREF="<%=$custlink%>"><%= $cust_main->ship_last. ', '. $cust_main->ship_first %></A></TD>
+ <TD><A HREF="<%=$custlink%>"><%= $cust_main->ship_company %></A></TD>
+ <% } %>
+</TR>
+<% } %>
+</TABLE>
+
+</BODY></HTML>
diff --git a/httemplate/search/cust_bill_event.html b/httemplate/search/cust_bill_event.html
new file mode 100755
index 000000000..d76ce3c8c
--- /dev/null
+++ b/httemplate/search/cust_bill_event.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Failed billing events</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Failed billing events</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_bill_event.cgi" METHOD="post">
+ Return <B>failed billing events</B> for period:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_main-otaker.cgi b/httemplate/search/cust_main-otaker.cgi
new file mode 100755
index 000000000..b7173c49c
--- /dev/null
+++ b/httemplate/search/cust_main-otaker.cgi
@@ -0,0 +1,29 @@
+<HTML>
+ <HEAD>
+ <TITLE>Customer Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Customer Search
+ </FONT>
+ <BR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ Search for <B>Order taker</B>:
+ <INPUT TYPE="hidden" NAME="otaker_on" VALUE="TRUE">
+ <% my $dbh = dbh;
+ my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_main")
+ or eidiot $dbh->errstr;
+ $sth->execute() or eidiot $sth->errstr;
+# my @otakers = map { $_->[0] } @{$sth->selectall_arrayref};
+ %>
+ <SELECT NAME="otaker">
+ <% my $otaker; while ( $otaker = $sth->fetchrow_arrayref ) { %>
+ <OPTION><%= $otaker->[0] %></OTAKER>
+ <% } %>
+ </SELECT>
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_main-payinfo.html b/httemplate/search/cust_main-payinfo.html
new file mode 100755
index 000000000..671b5ef08
--- /dev/null
+++ b/httemplate/search/cust_main-payinfo.html
@@ -0,0 +1,20 @@
+<HTML>
+ <HEAD>
+ <TITLE>Customer Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Customer Search
+ </FONT>
+ <BR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ Search for <B>Credit card #</B>:
+ <INPUT TYPE="hidden" NAME="card_on" VALUE="TRUE">
+ <INPUT TYPE="text" NAME="card">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_main-quickpay.html b/httemplate/search/cust_main-quickpay.html
new file mode 100755
index 000000000..9f39db914
--- /dev/null
+++ b/httemplate/search/cust_main-quickpay.html
@@ -0,0 +1,43 @@
+<HTML>
+ <HEAD>
+ <TITLE>Quick payment entry</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Quick payment entry
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ <INPUT TYPE="hidden" NAME="quickpay" VALUE="yes">
+ <INPUT TYPE="checkbox" NAME="last_on" CHECKED> Search for <B>last name</B>:
+ <INPUT TYPE="text" NAME="last_text">
+ using search method: <SELECT NAME="last_type">
+ <OPTION SELECTED>All
+ <OPTION>Fuzzy
+ <OPTION>Substring
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="checkbox" NAME="company_on" CHECKED> Search for <B>company</B>:
+ <INPUT TYPE="text" NAME="company_text">
+ using search methods: <SELECT NAME="company_type">
+ <OPTION SELECTED>All
+ <OPTION>Fuzzy
+ <OPTION>Substring
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="submit" VALUE="Search"> Note: Fuzzy searching can take a while. Please be patient.
+
+ </FORM>
+
+ <HR>Explanation of search methods:
+ <UL>
+ <LI><B>All</B> - Try all search methods.
+ <LI><B>Fuzzy</B> - Searches for matches that are close to your text.
+ <LI><B>Substring</B> - Searches for matches that contain your text.
+ <LI><B>Exact</B> - Finds exact matches only, but much faster than the other search methods.
+ </UL>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
new file mode 100755
index 000000000..5b39a09f2
--- /dev/null
+++ b/httemplate/search/cust_main.cgi
@@ -0,0 +1,668 @@
+<%
+
+my $conf = new FS::Conf;
+my $maxrecords = $conf->config('maxsearchrecordsperpage');
+
+#my $cache;
+
+#my $monsterjoin = <<END;
+#cust_main left outer join (
+# ( cust_pkg left outer join part_pkg using(pkgpart)
+# ) left outer join (
+# (
+# (
+# ( cust_svc left outer join part_svc using (svcpart)
+# ) left outer join svc_acct using (svcnum)
+# ) left outer join svc_domain using(svcnum)
+# ) left outer join svc_forward using(svcnum)
+# ) using (pkgnum)
+#) using (custnum)
+#END
+
+#my $monsterjoin = <<END;
+#cust_main left outer join (
+# ( cust_pkg left outer join part_pkg using(pkgpart)
+# ) left outer join (
+# (
+# (
+# ( cust_svc left outer join part_svc using (svcpart)
+# ) left outer join (
+# svc_acct left outer join (
+# select svcnum, domain, catchall from svc_domain
+# ) as svc_acct_domsvc (
+# svc_acct_svcnum, svc_acct_domain, svc_acct_catchall
+# ) on svc_acct.domsvc = svc_acct_domsvc.svc_acct_svcnum
+# ) using (svcnum)
+# ) left outer join svc_domain using(svcnum)
+# ) left outer join svc_forward using(svcnum)
+# ) using (pkgnum)
+#) using (custnum)
+#END
+
+my $limit = '';
+$limit .= "LIMIT $maxrecords" if $maxrecords;
+
+my $offset = $cgi->param('offset') || 0;
+$limit .= " OFFSET $offset" if $offset;
+
+my $total = 0;
+
+my(@cust_main, $sortby, $orderby);
+if ( $cgi->param('browse')
+ || $cgi->param('otaker_on')
+) {
+
+ my %search = ();
+ if ( $cgi->param('browse') ) {
+ my $query = $cgi->param('browse');
+ if ( $query eq 'custnum' ) {
+ $sortby=\*custnum_sort;
+ $orderby = "ORDER BY custnum";
+ } elsif ( $query eq 'last' ) {
+ $sortby=\*last_sort;
+ $orderby = "ORDER BY LOWER(last || ' ' || first)";
+ } elsif ( $query eq 'company' ) {
+ $sortby=\*company_sort;
+ $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )";
+ } else {
+ die "unknown browse field $query";
+ }
+ } else {
+ $sortby = \*last_sort; #??
+ $orderby = "ORDER BY LOWER(last || ' ' || first)"; #??
+ if ( $cgi->param('otaker_on') ) {
+ $cgi->param('otaker') =~ /^(\w{1,32})$/ or eidiot "Illegal otaker\n";
+ $search{otaker} = $1;
+ } else {
+ die "unknown query...";
+ }
+ }
+
+ my $ncancelled = '';
+
+ if ( driver_name eq 'mysql' ) {
+
+ my $sql = "CREATE TEMPORARY TABLE temp1_$$ TYPE=MYISAM
+ SELECT cust_pkg.custnum,COUNT(*) as count
+ FROM cust_pkg,cust_main
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL
+ OR cust_pkg.cancel = 0 )
+ GROUP BY cust_pkg.custnum";
+ my $sth = dbh->prepare($sql) or die dbh->errstr. " preparing $sql";
+ $sth->execute or die "Error executing \"$sql\": ". $sth->errstr;
+ $sql = "CREATE TEMPORARY TABLE temp2_$$ TYPE=MYISAM
+ SELECT cust_pkg.custnum,COUNT(*) as count
+ FROM cust_pkg,cust_main
+ WHERE cust_pkg.custnum = cust_main.custnum
+ GROUP BY cust_pkg.custnum";
+ $sth = dbh->prepare($sql) or die dbh->errstr. " preparing $sql";
+ $sth->execute or die "Error executing \"$sql\": ". $sth->errstr;
+ }
+
+ if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me
+ || ( $conf->exists('hidecancelledcustomers')
+ && ! $cgi->param('showcancelledcustomers') )
+ ) {
+ #grep { $_->ncancelled_pkgs || ! $_->all_pkgs }
+ if ( driver_name eq 'mysql' ) {
+ $ncancelled = "
+ temp1_$$.custnum = cust_main.custnum
+ AND temp2_$$.custnum = cust_main.custnum
+ AND (temp1_$$.count > 0
+ OR temp2_$$.count = 0 )
+ ";
+ } else {
+ $ncancelled = "
+ 0 < ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL
+ OR cust_pkg.cancel = 0
+ )
+ )
+ OR 0 = ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ )
+ ";
+ }
+
+ }
+
+ #EWWWWWW
+ my $qual = join(' AND ',
+ map { "$_ = ". dbh->quote($search{$_}) } keys %search );
+
+ if ( $ncancelled ) {
+ $qual .= ' AND ' if $qual;
+ $qual .= $ncancelled;
+ }
+
+ $qual = " WHERE $qual" if $qual;
+ my $statement;
+ if ( driver_name eq 'mysql' ) {
+ $statement = "SELECT COUNT(*) FROM cust_main";
+ $statement .= ", temp1_$$, temp2_$$ $qual" if $qual;
+ } else {
+ $statement = "SELECT COUNT(*) FROM cust_main $qual";
+ }
+ my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
+ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
+
+ $total = $sth->fetchrow_arrayref->[0];
+
+ if ( $ncancelled ) {
+ if ( %search ) {
+ $ncancelled = " AND $ncancelled";
+ } else {
+ $ncancelled = " WHERE $ncancelled";
+ }
+ }
+
+ my @just_cust_main;
+ if ( driver_name eq 'mysql' ) {
+ @just_cust_main = qsearch('cust_main', \%search, 'cust_main.*',
+ ",temp1_$$,temp2_$$ $ncancelled $orderby $limit");
+ } else {
+ @just_cust_main = qsearch('cust_main', \%search, '',
+ "$ncancelled $orderby $limit" );
+ }
+ if ( driver_name eq 'mysql' ) {
+ my $sql = "DROP TABLE temp1_$$,temp2_$$;";
+ my $sth = dbh->prepare($sql) or die dbh->errstr. " preparing $sql";
+ $sth->execute or die "Error executing \"$sql\": ". $sth->errstr;
+ }
+ @cust_main = @just_cust_main;
+
+# foreach my $cust_main ( @just_cust_main ) {
+#
+# my @one_cust_main;
+# $FS::Record::DEBUG=1;
+# ( $cache, @one_cust_main ) = jsearch(
+# "$monsterjoin",
+# { 'custnum' => $cust_main->custnum },
+# '',
+# '',
+# 'cust_main',
+# 'custnum',
+# );
+# push @cust_main, @one_cust_main;
+# }
+
+} else {
+ @cust_main=();
+ $sortby = \*last_sort;
+
+ push @cust_main, @{&custnumsearch}
+ if $cgi->param('custnum_on') && $cgi->param('custnum_text');
+ push @cust_main, @{&cardsearch}
+ if $cgi->param('card_on') && $cgi->param('card');
+ push @cust_main, @{&lastsearch}
+ if $cgi->param('last_on') && $cgi->param('last_text');
+ push @cust_main, @{&companysearch}
+ if $cgi->param('company_on') && $cgi->param('company_text');
+ push @cust_main, @{&address2search}
+ if $cgi->param('address2_on') && $cgi->param('address2_text');
+ push @cust_main, @{&phonesearch}
+ if $cgi->param('phone_on') && $cgi->param('phone_text');
+ push @cust_main, @{&referralsearch}
+ if $cgi->param('referral_custnum');
+
+ if ( $cgi->param('company_on') && $cgi->param('company_text') ) {
+ $sortby = \*company_sort;
+ push @cust_main, @{&companysearch};
+ }
+
+ @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main
+ if $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me
+ || ( $conf->exists('hidecancelledcustomers')
+ && ! $cgi->param('showcancelledcustomers') );
+
+ my %saw = ();
+ @cust_main = grep { !$saw{$_->custnum}++ } @cust_main;
+}
+
+my %all_pkgs;
+if ( $conf->exists('hidecancelledpackages' ) ) {
+ %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main;
+} else {
+ %all_pkgs = map { $_->custnum => [ $_->all_pkgs ] } @cust_main;
+}
+#%all_pkgs = ();
+
+if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) {
+ if ( $cgi->param('quickpay') eq 'yes' ) {
+ print $cgi->redirect(popurl(2). "edit/cust_pay.cgi?quickpay=yes;custnum=". $cust_main[0]->custnum);
+ } else {
+ print $cgi->redirect(popurl(2). "view/cust_main.cgi?". $cust_main[0]->custnum);
+ }
+ #exit;
+} elsif ( scalar(@cust_main) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot "No matching customers found!\n";
+} else {
+%>
+<!-- mason kludge -->
+<%
+
+ $total ||= scalar(@cust_main);
+ print header("Customer Search Results",menubar(
+ 'Main Menu', popurl(2)
+ )), "$total matching customers found ";
+
+ #begin pager
+ my $pager = '';
+ if ( $total != scalar(@cust_main) && $maxrecords ) {
+ unless ( $offset == 0 ) {
+ $cgi->param('offset', $offset - $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Previous</FONT></B></A> ';
+ }
+ my $poff;
+ my $page;
+ for ( $poff = 0; $poff < $total; $poff += $maxrecords ) {
+ $page++;
+ if ( $offset == $poff ) {
+ $pager .= qq!<FONT SIZE="+2">$page</FONT> !;
+ } else {
+ $cgi->param('offset', $poff);
+ $pager .= qq!<A HREF="!. $cgi->self_url. qq!">$page</A> !;
+ }
+ }
+ unless ( $offset + $maxrecords > $total ) {
+ $cgi->param('offset', $offset + $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
+ }
+ }
+ #end pager
+
+ if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me
+ || ( $conf->exists('hidecancelledcustomers')
+ && ! $cgi->param('showcancelledcustomers')
+ )
+ ) {
+ $cgi->param('showcancelledcustomers', 1);
+ $cgi->param('offset', 0);
+ print qq!( <a href="!. $cgi->self_url. qq!">show cancelled customers</a> )!;
+ } else {
+ $cgi->param('showcancelledcustomers', 0);
+ $cgi->param('offset', 0);
+ print qq!( <a href="!. $cgi->self_url. qq!">hide cancelled customers</a> )!;
+ }
+ if ( $cgi->param('referral_custnum') ) {
+ $cgi->param('referral_custnum') =~ /^(\d+)$/
+ or eidiot "Illegal referral_custnum\n";
+ my $referral_custnum = $1;
+ my $cust_main = qsearchs('cust_main', { custnum => $referral_custnum } );
+ print '<FORM METHOD=POST>'.
+ qq!<INPUT TYPE="hidden" NAME="referral_custnum" VALUE="$referral_custnum">!.
+ 'referrals of <A HREF="'. popurl(2).
+ "view/cust_main.cgi?$referral_custnum\">$referral_custnum: ".
+ ( $cust_main->company
+ || $cust_main->last. ', '. $cust_main->first ).
+ '</A>';
+ print "\n",<<END;
+ <SCRIPT>
+ function changed(what) {
+ what.form.submit();
+ }
+ </SCRIPT>
+END
+ print ' <SELECT NAME="referral_depth" SIZE="1" onChange="changed(this)">';
+ my $max = 8; #config file
+ $cgi->param('referral_depth') =~ /^(\d*)$/
+ or eidiot "Illegal referral_depth";
+ my $referral_depth = $1;
+
+ foreach my $depth ( 1 .. $max ) {
+ print '<OPTION',
+ ' SELECTED'x($depth == $referral_depth),
+ ">$depth";
+ }
+ print "</SELECT> levels deep".
+ '<NOSCRIPT> <INPUT TYPE="submit" VALUE="change"></NOSCRIPT>'.
+ '</FORM>';
+ }
+
+ print "<BR><BR>". $pager. &table(). <<END;
+ <TR>
+ <TH></TH>
+ <TH>(bill) name</TH>
+ <TH>company</TH>
+END
+
+if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ print <<END;
+ <TH>(service) name</TH>
+ <TH>company</TH>
+END
+}
+
+print <<END;
+ <TH>Packages</TH>
+ <TH COLSPAN=2>Services</TH>
+ </TR>
+END
+
+ my(%saw,$cust_main);
+ my $p = popurl(2);
+ foreach $cust_main (
+ sort $sortby grep(!$saw{$_->custnum}++, @cust_main)
+ ) {
+ my($custnum,$last,$first,$company)=(
+ $cust_main->custnum,
+ $cust_main->getfield('last'),
+ $cust_main->getfield('first'),
+ $cust_main->company,
+ );
+
+ my(@lol_cust_svc);
+ my($rowspan)=0;#scalar( @{$all_pkgs{$custnum}} );
+ foreach ( @{$all_pkgs{$custnum}} ) {
+ #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } );
+ my @cust_svc = $_->cust_svc;
+ push @lol_cust_svc, \@cust_svc;
+ $rowspan += scalar(@cust_svc) || 1;
+ }
+
+ #my($rowspan) = scalar(@{$all_pkgs{$custnum}});
+ my $view;
+ if ( defined $cgi->param('quickpay') && $cgi->param('quickpay') eq 'yes' ) {
+ $view = $p. 'edit/cust_pay.cgi?quickpay=yes;custnum='. $custnum;
+ } else {
+ $view = $p. 'view/cust_main.cgi?'. $custnum;
+ }
+ my $pcompany = $company
+ ? qq!<A HREF="$view"><FONT SIZE=-1>$company</FONT></A>!
+ : '<FONT SIZE=-1>&nbsp;</FONT>';
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$custnum</FONT></A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$last, $first</FONT></A></TD>
+ <TD ROWSPAN=$rowspan>$pcompany</TD>
+END
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ my($ship_last,$ship_first,$ship_company)=(
+ $cust_main->ship_last || $cust_main->getfield('last'),
+ $cust_main->ship_last ? $cust_main->ship_first : $cust_main->first,
+ $cust_main->ship_last ? $cust_main->ship_company : $cust_main->company,
+ );
+ my $pship_company = $ship_company
+ ? qq!<A HREF="$view"><FONT SIZE=-1>$ship_company</FONT></A>!
+ : '<FONT SIZE=-1>&nbsp;</FONT>';
+ print <<END;
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$ship_last, $ship_first</FONT></A></TD>
+ <TD ROWSPAN=$rowspan>$pship_company</A></TD>
+END
+ }
+
+ my($n1)='';
+ foreach ( @{$all_pkgs{$custnum}} ) {
+ my $pkgnum = $_->pkgnum;
+# my $part_pkg = qsearchs( 'part_pkg', { pkgpart => $_->pkgpart } );
+ my $part_pkg = $_->part_pkg;
+
+ my $pkg = $part_pkg->pkg;
+ my $comment = $part_pkg->comment;
+ my $pkgview = $p. 'view/cust_pkg.cgi?'. $pkgnum;
+ my @cust_svc = @{shift @lol_cust_svc};
+ #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } );
+ my $rowspan = scalar(@cust_svc) || 1;
+
+ print $n1, qq!<TD ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg - $comment</FONT></A></TD>!;
+ my($n2)='';
+ foreach my $cust_svc ( @cust_svc ) {
+ my($label, $value, $svcdb) = $cust_svc->label;
+ my($svcnum) = $cust_svc->svcnum;
+ my($sview) = $p.'view';
+ print $n2,qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$label</FONT></A></TD>!,
+ qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$value</FONT></A></TD>!;
+ $n2="</TR><TR>";
+ }
+ #print qq!</TR><TR>\n!;
+ $n1="</TR><TR>";
+ }
+ print "</TR>";
+ }
+
+ print "</TABLE>$pager</BODY></HTML>";
+
+}
+
+#undef $cache; #does this help?
+
+#
+
+sub last_sort {
+ lc($a->getfield('last')) cmp lc($b->getfield('last'))
+ || lc($a->first) cmp lc($b->first);
+}
+
+sub company_sort {
+ return -1 if $a->company && ! $b->company;
+ return 1 if ! $a->company && $b->company;
+ lc($a->company) cmp lc($b->company)
+ || lc($a->getfield('last')) cmp lc($b->getfield('last'))
+ || lc($a->first) cmp lc($b->first);;
+}
+
+sub custnum_sort {
+ $a->getfield('custnum') <=> $b->getfield('custnum');
+}
+
+sub custnumsearch {
+
+ my $custnum = $cgi->param('custnum_text');
+ $custnum =~ s/\D//g;
+ $custnum =~ /^(\d{1,23})$/ or eidiot "Illegal customer number\n";
+ $custnum = $1;
+
+ [ qsearchs('cust_main', { 'custnum' => $custnum } ) ];
+}
+
+sub cardsearch {
+
+ my($card)=$cgi->param('card');
+ $card =~ s/\D//g;
+ $card =~ /^(\d{13,16})$/ or eidiot "Illegal card number\n";
+ my($payinfo)=$1;
+
+ [ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}),
+ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'DCRD'})
+ ];
+}
+
+sub referralsearch {
+ $cgi->param('referral_custnum') =~ /^(\d+)$/
+ or eidiot "Illegal referral_custnum";
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $1 } )
+ or eidiot "Customer $1 not found";
+ my $depth;
+ if ( $cgi->param('referral_depth') ) {
+ $cgi->param('referral_depth') =~ /^(\d+)$/
+ or eidiot "Illegal referral_depth";
+ $depth = $1;
+ } else {
+ $depth = 1;
+ }
+ [ $cust_main->referral_cust_main($depth) ];
+}
+
+sub lastsearch {
+ my(%last_type);
+ my @cust_main;
+ foreach ( $cgi->param('last_type') ) {
+ $last_type{$_}++;
+ }
+
+ $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/
+ or eidiot "Illegal last name";
+ my($last)=$1;
+
+ if ( $last_type{'Exact'} || $last_type{'Fuzzy'} ) {
+ push @cust_main, qsearch( 'cust_main',
+ { 'last' => { 'op' => 'ILIKE',
+ 'value' => $last } } );
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'ship_last' => { 'op' => 'ILIKE',
+ 'value' => $last } } )
+ if defined dbdef->table('cust_main')->column('ship_last');
+ }
+
+ if ( $last_type{'Substring'} || $last_type{'All'} ) {
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'last' => { 'op' => 'ILIKE',
+ 'value' => "%$last%" } } );
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'ship_last' => { 'op' => 'ILIKE',
+ 'value' => "%$last%" } } )
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ }
+
+ if ( $last_type{'Fuzzy'} || $last_type{'All'} ) {
+
+ &FS::cust_main::check_and_rebuild_fuzzyfiles;
+ my $all_last = &FS::cust_main::all_last;
+
+ my %last;
+ if ( $last_type{'Fuzzy'} || $last_type{'All'} ) {
+ foreach ( amatch($last, [ qw(i) ], @$all_last) ) {
+ $last{$_}++;
+ }
+ }
+
+ #if ($last_type{'Sound-alike'}) {
+ #}
+
+ foreach ( keys %last ) {
+ push @cust_main, qsearch('cust_main',{'last'=>$_});
+ push @cust_main, qsearch('cust_main',{'ship_last'=>$_})
+ if defined dbdef->table('cust_main')->column('ship_last');
+ }
+
+ }
+
+ \@cust_main;
+}
+
+sub companysearch {
+
+ my(%company_type);
+ my @cust_main;
+ foreach ( $cgi->param('company_type') ) {
+ $company_type{$_}++
+ };
+
+ $cgi->param('company_text') =~
+ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/
+ or eidiot "Illegal company";
+ my $company = $1;
+
+ if ( $company_type{'Exact'} || $company_type{'Fuzzy'} ) {
+ push @cust_main, qsearch( 'cust_main',
+ { 'company' => { 'op' => 'ILIKE',
+ 'value' => $company } } );
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'ship_company' => { 'op' => 'ILIKE',
+ 'value' => $company } } )
+ if defined dbdef->table('cust_main')->column('ship_last');
+ }
+
+ if ( $company_type{'Substring'} || $company_type{'All'} ) {
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'company' => { 'op' => 'ILIKE',
+ 'value' => "%$company%" } } );
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'ship_company' => { 'op' => 'ILIKE',
+ 'value' => "%$company%" } })
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ }
+
+ if ( $company_type{'Fuzzy'} || $company_type{'All'} ) {
+
+ &FS::cust_main::check_and_rebuild_fuzzyfiles;
+ my $all_company = &FS::cust_main::all_company;
+
+ my %company;
+ if ( $company_type{'Fuzzy'} || $company_type{'All'} ) {
+ foreach ( amatch($company, [ qw(i) ], @$all_company ) ) {
+ $company{$_}++;
+ }
+ }
+
+ #if ($company_type{'Sound-alike'}) {
+ #}
+
+ foreach ( keys %company ) {
+ push @cust_main, qsearch('cust_main',{'company'=>$_});
+ push @cust_main, qsearch('cust_main',{'ship_company'=>$_})
+ if defined dbdef->table('cust_main')->column('ship_last');
+ }
+
+ }
+
+ \@cust_main;
+}
+
+sub address2search {
+ my @cust_main;
+
+ $cgi->param('address2_text') =~
+ /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=]*)$/
+ or eidiot "Illegal address2";
+ my $address2 = $1;
+
+ push @cust_main, qsearch( 'cust_main',
+ { 'address2' => { 'op' => 'ILIKE',
+ 'value' => $address2 } } );
+ push @cust_main, qsearch( 'cust_main',
+ { 'address2' => { 'op' => 'ILIKE',
+ 'value' => $address2 } } )
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ \@cust_main;
+}
+
+sub phonesearch {
+ my @cust_main;
+
+ my $phone = $cgi->param('phone_text');
+
+ #(no longer really) false laziness with Record::ut_phonen
+ #only works with US/CA numbers...
+ $phone =~ s/\D//g;
+ if ( $phone =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/ ) {
+ $phone = "$1-$2-$3";
+ $phone .= " x$4" if $4;
+ } elsif ( $phone =~ /^(\d{3})(\d{4})$/ ) {
+ $phone = "$1-$2";
+ } elsif ( $phone =~ /^(\d{3,4})$/ ) {
+ $phone = $1;
+ } else {
+ eidiot gettext('illegal_phone'). ": $phone";
+ }
+
+ my @fields = qw(daytime night fax);
+ push @fields, qw(ship_daytime ship_night ship_fax)
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ for my $field ( @fields ) {
+ push @cust_main, qsearch ( 'cust_main',
+ { $field => { 'op' => 'LIKE',
+ 'value' => "%$phone%" } } );
+ }
+
+ \@cust_main;
+}
+
+%>
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
new file mode 100755
index 000000000..5a066e453
--- /dev/null
+++ b/httemplate/search/cust_main.html
@@ -0,0 +1,42 @@
+<HTML>
+ <HEAD>
+ <TITLE>Customer Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Customer Search
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="cust_main.cgi" METHOD="post">
+ <INPUT TYPE="checkbox" NAME="last_on" CHECKED> Search for <B>last name</B>:
+ <INPUT TYPE="text" NAME="last_text">
+ using search method: <SELECT NAME="last_type">
+ <OPTION SELECTED>All
+ <OPTION>Fuzzy
+ <OPTION>Substring
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="checkbox" NAME="company_on" CHECKED> Search for <B>company</B>:
+ <INPUT TYPE="text" NAME="company_text">
+ using search methods: <SELECT NAME="company_type">
+ <OPTION SELECTED>All
+ <OPTION>Fuzzy
+ <OPTION>Substring
+ <OPTION>Exact
+ </SELECT>
+
+ <P><INPUT TYPE="submit" VALUE="Search"> Note: Fuzzy searching can take a while. Please be patient.
+
+ </FORM>
+
+ <HR>Explanation of search methods:
+ <UL>
+ <LI><B>All</B> - Try all search methods.
+ <LI><B>Fuzzy</B> - Searches for matches that are close to your text.
+ <LI><B>Substring</B> - Searches for matches that contain your text.
+ <LI><B>Exact</B> - Finds exact matches only, but much faster than the other search methods.
+ </UL>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi
new file mode 100755
index 000000000..7a983703f
--- /dev/null
+++ b/httemplate/search/cust_pay.cgi
@@ -0,0 +1,151 @@
+<%
+
+my $sortby;
+my @cust_pay;
+if ( $cgi->param('magic') && $cgi->param('magic') eq '_date' ) {
+
+ my %search;
+ if ( $cgi->param('payby') ) {
+ $cgi->param('payby') =~ /^(CARD|CHEK|BILL)$/
+ or die "illegal payby ". $cgi->param('payby');
+ $search{'payby'} = $1;
+ }
+
+ #false laziness with cust_pkg.cgi
+ my $range = '';
+ if ( $cgi->param('beginning')
+ && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) {
+ my $beginning = str2time($1);
+ $range = " WHERE _date >= $beginning ";
+ }
+ if ( $cgi->param('ending')
+ && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) {
+ my $ending = str2time($1) + 86400;
+ $range .= ( $range ? ' AND ' : ' WHERE ' ). " _date <= $ending ";
+ }
+ $range =~ s/^\s*WHERE/ AND/ if scalar(keys %search) ;
+
+ @cust_pay = qsearch('cust_pay', \%search, '', $range );
+
+ $sortby = \*date_sort;
+
+} else {
+
+ $cgi->param('payinfo') =~ /^\s*(\d+)\s*$/ or die "illegal payinfo";
+ my $payinfo = $1;
+
+ $cgi->param('payby') =~ /^(\w+)$/ or die "illegal payby";
+ my $payby = $1;
+
+ @cust_pay = qsearch('cust_pay', { 'payinfo' => $payinfo,
+ 'payby' => $payby } );
+ $sortby = \*date_sort;
+
+}
+
+if (0) {
+#if ( scalar(@cust_pay) == 1 ) {
+# my $invnum = $cust_bill[0]->invnum;
+# print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect
+} elsif ( scalar(@cust_pay) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
+ idiot("Payment not found.");
+ #exit;
+} else {
+ my $total = scalar(@cust_pay);
+ my $s = $total > 1 ? 's' : '';
+%>
+<!-- mason kludge -->
+<%
+ print header("Payment Search Results", menubar(
+ 'Main Menu', popurl(2)
+ )), "$total matching payment$s found<BR>", &table(), <<END;
+ <TR>
+ <TH></TH>
+ <TH>Amount</TH>
+ <TH>Date</TH>
+ <TH>Contact name</TH>
+ <TH>Company</TH>
+ </TR>
+END
+
+ my(%saw, $cust_pay);
+ foreach my $cust_pay (
+ sort $sortby grep(!$saw{$_->paynum}++, @cust_pay)
+ ) {
+ my($paynum, $custnum, $payby, $payinfo, $amount, $date ) = (
+ $cust_pay->paynum,
+ $cust_pay->custnum,
+ $cust_pay->payby,
+ $cust_pay->payinfo,
+ sprintf("%.2f", $cust_pay->paid),
+ $cust_pay->_date,
+ );
+ my $pdate = time2str("%b&nbsp;%d&nbsp;%Y", $date);
+
+ my $rowspan = 1;
+
+ my $view = popurl(2). "view/cust_main.cgi?". $custnum.
+ "#". $payby. $payinfo;
+
+ my $payment_info;
+ if ( $payby eq 'CARD' ) {
+ $payment_info = 'Card&nbsp;#'. 'x'x(length($payinfo)-4).
+ substr($payinfo,(length($payinfo)-4));
+ } elsif ( $payby eq 'CHEK' ) {
+ $payment_info = "E-check&nbsp;acct#$payinfo";
+ } elsif ( $payby eq 'BILL' ) {
+ $payment_info = "Check&nbsp;#$payinfo";
+ } else {
+ $payment_info = "$payby&nbsp;$payinfo";
+ }
+
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$payment_info</FONT></A></TD>
+ <TD ROWSPAN=$rowspan ALIGN="right"><A HREF="$view"><FONT SIZE=-1>\$$amount</FONT></A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$pdate</FONT></A></TD>
+END
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
+ if ( $cust_main ) {
+ #my $cview = popurl(2). "view/cust_main.cgi?". $cust_main->custnum;
+ my ( $name, $company ) = (
+ $cust_main->last. ', '. $cust_main->first,
+ $cust_main->company,
+ );
+ print <<END;
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$name</FONT></A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$company</FONT></A></TD>
+END
+ } else {
+ print <<END
+ <TD ROWSPAN=$rowspan COLSPAN=2>WARNING: couldn't find cust_main.custnum $custnum (cust_pay.paynum $paynum)</TD>
+END
+ }
+
+ print "</TR>";
+ }
+ print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+}
+
+#
+
+#sub invnum_sort {
+# $a->invnum <=> $b->invnum;
+#}
+#
+#sub custnum_sort {
+# $a->custnum <=> $b->custnum || $a->invnum <=> $b->invnum;
+#}
+
+sub date_sort {
+ $a->_date <=> $b->_date || $a->invnum <=> $b->invnum;
+}
+%>
diff --git a/httemplate/search/cust_pay.html b/httemplate/search/cust_pay.html
new file mode 100755
index 000000000..3848d66f7
--- /dev/null
+++ b/httemplate/search/cust_pay.html
@@ -0,0 +1,18 @@
+<HTML>
+ <HEAD>
+ <TITLE>Check # Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Check # Search
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="cust_pay.cgi" METHOD="post">
+ Search for <B>check #</B>:
+ <INPUT TYPE="text" NAME="payinfo">
+ <INPUT TYPE="hidden" NAME="payby" VALUE="BILL">
+ <BR><BR><INPUT TYPE="submit" VALUE="Search">
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
new file mode 100755
index 000000000..8b2fd0ca0
--- /dev/null
+++ b/httemplate/search/cust_pkg.cgi
@@ -0,0 +1,350 @@
+<%
+
+my $conf = new FS::Conf;
+my $maxrecords = $conf->config('maxsearchrecordsperpage');
+
+my %part_pkg = map { $_->pkgpart => $_ } qsearch('part_pkg', {});
+
+my $limit = '';
+$limit .= "LIMIT $maxrecords" if $maxrecords;
+
+my $offset = $cgi->param('offset') || 0;
+$limit .= " OFFSET $offset" if $offset;
+
+my $total;
+
+my($query) = $cgi->keywords;
+my $sortby;
+my @cust_pkg;
+
+if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
+ $sortby=\*bill_sort;
+
+ #false laziness with cust_pay.cgi
+ my $range = '';
+ if ( $cgi->param('beginning')
+ && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) {
+ my $beginning = str2time($1);
+ $range = " WHERE bill >= $beginning ";
+ }
+ if ( $cgi->param('ending')
+ && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) {
+ my $ending = str2time($1) + 86400;
+ $range .= ( $range ? ' AND ' : ' WHERE ' ). " bill <= $ending ";
+ }
+
+ #false laziness with below
+ my $statement = "SELECT COUNT(*) FROM cust_pkg $range";
+ warn $statement;
+ my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
+ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
+
+ $total = $sth->fetchrow_arrayref->[0];
+
+ @cust_pkg = qsearch('cust_pkg',{}, '', " $range ORDER BY bill $limit" );
+
+} else {
+
+ my $qual = '';
+ if ( $cgi->param('magic') && $cgi->param('magic') eq 'active' ) {
+
+ $qual = 'WHERE ( susp IS NULL OR susp = 0 )'.
+ ' AND ( cancel IS NULL OR cancel = 0)';
+
+ $sortby = \*pkgnum_sort;
+
+ if ( $cgi->param('pkgpart') =~ /^(\d+)$/ ) {
+ $qual .= " AND pkgpart = $1";
+ }
+
+ } elsif ( $query eq 'pkgnum' ) {
+
+ $sortby=\*pkgnum_sort;
+
+ } elsif ( $query eq 'SUSP_pkgnum' ) {
+
+ $sortby=\*pkgnum_sort;
+
+ $qual = 'WHERE susp IS NOT NULL AND susp != 0';
+
+ } elsif ( $query eq 'APKG_pkgnum' ) {
+
+ $sortby=\*pkgnum_sort;
+
+ #@cust_pkg=();
+ ##perhaps this should go in cust_pkg as a qsearch-like constructor?
+ #my($cust_pkg);
+ #foreach $cust_pkg (
+ # qsearch('cust_pkg',{}, '', "ORDER BY pkgnum $limit" )
+ #) {
+ # my($flag)=0;
+ # my($pkg_svc);
+ # PKG_SVC:
+ # foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) {
+ # if ( $pkg_svc->quantity
+ # > scalar(qsearch('cust_svc',{
+ # 'pkgnum' => $cust_pkg->pkgnum,
+ # 'svcpart' => $pkg_svc->svcpart,
+ # }))
+ # )
+ # {
+ # $flag=1;
+ # last PKG_SVC;
+ # }
+ # }
+ # push @cust_pkg, $cust_pkg if $flag;
+ #}
+
+ if ( driver_name eq 'mysql' ) {
+ #$query = "DROP TABLE temp1_$$,temp2_$$;";
+ #my $sth = dbh->prepare($query);
+ #$sth->execute;
+
+ $query = "CREATE TEMPORARY TABLE temp1_$$ TYPE=MYISAM
+ SELECT cust_svc.pkgnum,cust_svc.svcpart,COUNT(*) as count
+ FROM cust_pkg,cust_svc,pkg_svc
+ WHERE cust_pkg.pkgnum = cust_svc.pkgnum
+ AND cust_svc.svcpart = pkg_svc.svcpart
+ AND cust_pkg.pkgpart = pkg_svc.pkgpart
+ GROUP BY cust_svc.pkgnum,cust_svc.svcpart";
+ my $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
+
+ $sth->execute or die "Error executing \"$query\": ". $sth->errstr;
+
+ $query = "CREATE TEMPORARY TABLE temp2_$$ TYPE=MYISAM
+ SELECT cust_pkg.pkgnum FROM cust_pkg
+ LEFT JOIN pkg_svc ON (cust_pkg.pkgpart=pkg_svc.pkgpart)
+ LEFT JOIN temp1_$$ ON (cust_pkg.pkgnum = temp1_$$.pkgnum
+ AND pkg_svc.svcpart=temp1_$$.svcpart)
+ WHERE ( pkg_svc.quantity > temp1_$$.count
+ OR temp1_$$.pkgnum IS NULL )
+ AND pkg_svc.quantity != 0;";
+ $sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
+ $sth->execute or die "Error executing \"$query\": ". $sth->errstr;
+ $qual = " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum
+ WHERE temp2_$$.pkgnum IS NOT NULL";
+
+ } else {
+
+ $qual = "
+ WHERE 0 <
+ ( SELECT count(*) FROM pkg_svc
+ WHERE pkg_svc.pkgpart = cust_pkg.pkgpart
+ AND pkg_svc.quantity > ( SELECT count(*) FROM cust_svc
+ WHERE cust_svc.pkgnum = cust_pkg.pkgnum
+ AND cust_svc.svcpart = pkg_svc.svcpart
+ )
+ )
+ ";
+
+ }
+
+ } else {
+ die "Empty or unknown QUERY_STRING!";
+ }
+
+ my $statement = "SELECT COUNT(*) FROM cust_pkg $qual";
+ my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
+ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
+
+ $total = $sth->fetchrow_arrayref->[0];
+
+ my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : '';
+ @cust_pkg =
+ qsearch('cust_pkg',{}, '', "$qual ORDER BY ${tblname}pkgnum $limit" );
+
+ if ( driver_name eq 'mysql' ) {
+ $query = "DROP TABLE temp1_$$,temp2_$$;";
+ my $sth = dbh->prepare($query) or die dbh->errstr. " doing $query";
+ $sth->execute; # or die "Error executing \"$query\": ". $sth->errstr;
+ }
+
+}
+
+if ( scalar(@cust_pkg) == 1 ) {
+ my($pkgnum)=$cust_pkg[0]->pkgnum;
+ print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum");
+ #exit;
+} elsif ( scalar(@cust_pkg) == 0 ) { #error
+%>
+<!-- mason kludge -->
+<%
+ eidiot("No packages found");
+} else {
+%>
+<!-- mason kludge -->
+<%
+ $total ||= scalar(@cust_pkg);
+
+ #begin pager
+ my $pager = '';
+ if ( $total != scalar(@cust_pkg) && $maxrecords ) {
+ unless ( $offset == 0 ) {
+ $cgi->param('offset', $offset - $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Previous</FONT></B></A> ';
+ }
+ my $poff;
+ my $page;
+ for ( $poff = 0; $poff < $total; $poff += $maxrecords ) {
+ $page++;
+ if ( $offset == $poff ) {
+ $pager .= qq!<FONT SIZE="+2">$page</FONT> !;
+ } else {
+ $cgi->param('offset', $poff);
+ $pager .= qq!<A HREF="!. $cgi->self_url. qq!">$page</A> !;
+ }
+ }
+ unless ( $offset + $maxrecords > $total ) {
+ $cgi->param('offset', $offset + $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
+ }
+ }
+ #end pager
+
+ print header('Package Search Results',''),
+ "$total matching packages found<BR><BR>$pager", &table(), <<END;
+ <TR>
+ <TH>Package</TH>
+ <TH><FONT SIZE=-1>Setup</FONT></TH>
+END
+
+ print '<TH><FONT SIZE=-1>Last<BR>bill</FONT></TH>'
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
+ print <<END;
+ <TH><FONT SIZE=-1>Next<BR>bill</FONT></TH>
+ <TH><FONT SIZE=-1>Susp.</FONT></TH>
+ <TH><FONT SIZE=-1>Expire</FONT></TH>
+ <TH><FONT SIZE=-1>Cancel</FONT></TH>
+ <TH><FONT SIZE=-1>Cust#</FONT></TH>
+ <TH>(bill) name</TH>
+ <TH>company</TH>
+END
+
+ print '<TH>(service) name</TH><TH>company</TH>'
+ if defined dbdef->table('cust_main')->column('ship_last');
+
+ print '<TH COLSPAN=2>Services</TH></TR>';
+
+ my $n1 = '<TR>';
+ my(%saw,$cust_pkg);
+ foreach $cust_pkg (
+ sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg)
+ ) {
+ my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum});
+ my($pkgnum, $setup, $bill, $susp, $expire, $cancel,
+ $custnum, $last, $first, $company ) = (
+ $cust_pkg->pkgnum,
+ $cust_pkg->getfield('setup')
+ ? time2str("%D", $cust_pkg->getfield('setup') )
+ : '',
+ $cust_pkg->getfield('bill')
+ ? time2str("%D", $cust_pkg->getfield('bill') )
+ : '',
+ $cust_pkg->getfield('susp')
+ ? time2str("%D", $cust_pkg->getfield('susp') )
+ : '',
+ $cust_pkg->getfield('expire')
+ ? time2str("%D", $cust_pkg->getfield('expire') )
+ : '',
+ $cust_pkg->getfield('cancel')
+ ? time2str("%D", $cust_pkg->getfield('cancel') )
+ : '',
+ $cust_pkg->custnum,
+ $cust_main ? $cust_main->last : '',
+ $cust_main ? $cust_main->first : '',
+ $cust_main ? $cust_main->company : '',
+ );
+
+ my $last_bill = $cust_pkg->getfield('last_bill')
+ ? time2str("%D", $cust_pkg->getfield('last_bill') )
+ : ''
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
+ my($ship_last, $ship_first, $ship_company);
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ ($ship_last, $ship_first, $ship_company) = (
+ $cust_main
+ ? ( $cust_main->ship_last || $cust_main->getfield('last') )
+ : '',
+ $cust_main
+ ? ( $cust_main->ship_last
+ ? $cust_main->ship_first
+ : $cust_main->first )
+ : '',
+ $cust_main
+ ? ( $cust_main->ship_last
+ ? $cust_main->ship_company
+ : $cust_main->company )
+ : '',
+ );
+ }
+ my $pkg = $part_pkg{$cust_pkg->pkgpart}->pkg;
+ #$pkg .= ' - '. $part_pkg{$cust_pkg->pkgpart}->comment;
+ my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } );
+ my $rowspan = scalar(@cust_svc) || 1;
+ my $p = popurl(2);
+ print $n1, <<END;
+ <TD ROWSPAN=$rowspan><A HREF="${p}view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum - $pkg</FONT></A></TD>
+ <TD ROWSPAN=$rowspan>$setup</TD>
+END
+
+ print "<TD ROWSPAN=$rowspan>$last_bill</TD>"
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
+ print <<END;
+ <TD ROWSPAN=$rowspan>$bill</TD>
+ <TD ROWSPAN=$rowspan>$susp</TD>
+ <TD ROWSPAN=$rowspan>$expire</TD>
+ <TD ROWSPAN=$rowspan>$cancel</TD>
+END
+ if ( $cust_main ) {
+ print <<END;
+ <TD ROWSPAN=$rowspan><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$custnum</A></FONT></TD>
+ <TD ROWSPAN=$rowspan><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$last, $first</A></FONT></TD>
+ <TD ROWSPAN=$rowspan><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$company</A></FONT></TD>
+END
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ print <<END;
+ <TD ROWSPAN=$rowspan><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$ship_last, $ship_first</A></FONT></TD>
+ <TD ROWSPAN=$rowspan><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$ship_company</A></FONT></TD>
+END
+ }
+ } else {
+ my $colspan = defined dbdef->table('cust_main')->column('ship_last')
+ ? 5 : 3;
+ print <<END;
+ <TD ROWSPAN=$rowspan COLSPAN=$colspan>WARNING: couldn't find cust_main.custnum $custnum (cust_pkg.pkgnum $pkgnum)</TD>
+END
+ }
+
+ my $n2 = '';
+ foreach my $cust_svc ( @cust_svc ) {
+ my($label, $value, $svcdb) = $cust_svc->label;
+ my $svcnum = $cust_svc->svcnum;
+ my $sview = $p. "view";
+ print $n2,qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$label</FONT></A></TD>!,
+ qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$value</FONT></A></TD>!;
+ $n2="</TR><TR>";
+ }
+
+ $n1 = "</TR><TR>";
+
+ }
+ print '</TR>';
+
+ print "</TABLE>$pager</BODY></HTML>";
+
+}
+
+sub pkgnum_sort {
+ $a->getfield('pkgnum') <=> $b->getfield('pkgnum');
+}
+
+sub bill_sort {
+ $a->getfield('bill') <=> $b->getfield('bill');
+}
+
+%>
diff --git a/httemplate/search/cust_pkg.html b/httemplate/search/cust_pkg.html
new file mode 100755
index 000000000..bb0a5407c
--- /dev/null
+++ b/httemplate/search/cust_pkg.html
@@ -0,0 +1,24 @@
+<HTML>
+ <HEAD>
+ <TITLE>Packages</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Packages</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_pkg.cgi" METHOD="post">
+ <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
+ Return <B>packages</B> with next bill date:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/report_cc.cgi b/httemplate/search/report_cc.cgi
new file mode 100755
index 000000000..c2ab726b6
--- /dev/null
+++ b/httemplate/search/report_cc.cgi
@@ -0,0 +1,25 @@
+<!-- mason kludge -->
+<%
+
+my $user = getotaker;
+
+$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
+my $beginning = $1;
+
+$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/;
+my $ending = $1;
+
+print header('Credit Card Recipt Report Results');
+
+open (REPORT, "freeside-cc-receipts-report -v -s $beginning -f $ending $user |");
+
+print '<PRE>';
+while(<REPORT>) {
+ print $_;
+}
+print '</PRE>';
+
+print '</BODY></HTML>';
+
+%>
+
diff --git a/httemplate/search/report_cc.html b/httemplate/search/report_cc.html
new file mode 100755
index 000000000..8653dcc69
--- /dev/null
+++ b/httemplate/search/report_cc.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Credit Card Receipt Report Criteria</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Credit Card Receipt Report Criteria</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="report_cc.cgi" METHOD="post">
+ Return <B>credit card receipt report</B> for period:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/report_credit.cgi b/httemplate/search/report_credit.cgi
new file mode 100755
index 000000000..2adafc06e
--- /dev/null
+++ b/httemplate/search/report_credit.cgi
@@ -0,0 +1,25 @@
+<!-- mason kludge -->
+<%
+
+my $user = getotaker;
+
+$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
+my $beginning = $1;
+
+$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/;
+my $ending = $1;
+
+print header('In House Credit Report Results');
+
+open (REPORT, "freeside-credit-report -v -s $beginning -f $ending $user |");
+
+print '<PRE>';
+while(<REPORT>) {
+ print $_;
+}
+print '</PRE>';
+
+print '</BODY></HTML>';
+
+%>
+
diff --git a/httemplate/search/report_credit.html b/httemplate/search/report_credit.html
new file mode 100755
index 000000000..df9b9581f
--- /dev/null
+++ b/httemplate/search/report_credit.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>In House Credit Report Criteria</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>In House Credit Report Criteria</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="report_credit.cgi" METHOD="post">
+ Return <B>in house credit report</B> for period:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html
new file mode 100644
index 000000000..93053e1ee
--- /dev/null
+++ b/httemplate/search/report_cust_pay.html
@@ -0,0 +1,24 @@
+<HTML>
+ <HEAD>
+ <TITLE>Payment report criteria</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Payment report criteria</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="cust_pay.cgi" METHOD="post">
+ <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
+ Return <SELECT NAME="payby">
+ <OPTION VALUE="">all</OPTION>
+ <OPTION VALUE="CARD">credit card</OPTION>
+ <OPTION VALUE="CHEK">electronic check (ACH)</OPTION>
+ <OPTION VALUE="BILL">check/cash</OPTION>
+ </SELECT> payments for period<BR>
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+ </FORM>
+ <HR>
+ </BODY>
+</HTML>
diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi
new file mode 100755
index 000000000..fdd3779a9
--- /dev/null
+++ b/httemplate/search/report_receivables.cgi
@@ -0,0 +1,19 @@
+<!-- mason kludge -->
+<%
+
+my $user = getotaker;
+
+print header('Current Receivables Report Results');
+
+open (REPORT, "freeside-receivables-report -v $user |");
+
+print '<PRE>';
+while(<REPORT>) {
+ print $_;
+}
+print '</PRE>';
+
+print '</BODY></HTML>';
+
+%>
+
diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
new file mode 100755
index 000000000..ac76fad6e
--- /dev/null
+++ b/httemplate/search/report_tax.cgi
@@ -0,0 +1,25 @@
+<!-- mason kludge -->
+<%
+
+my $user = getotaker;
+
+$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
+my $beginning = $1;
+
+$cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/;
+my $ending = $1;
+
+print header('Tax Report Results');
+
+open (REPORT, "freeside-tax-report -v -s $beginning -f $ending $user |");
+
+print '<PRE>';
+while(<REPORT>) {
+ print $_;
+}
+print '</PRE>';
+
+print '</BODY></HTML>';
+
+%>
+
diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html
new file mode 100755
index 000000000..7bf681b42
--- /dev/null
+++ b/httemplate/search/report_tax.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Tax Report Criteria</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Tax Report Criteria</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="report_tax.cgi" METHOD="post">
+ Return <B>tax report</B> for period:
+ from <INPUT TYPE="text" NAME="beginning"> <i>m/d/y</i>
+ to <INPUT TYPE="text" NAME="ending"> <i>m/d/y</i>
+
+ <P><INPUT TYPE="submit" VALUE="Get Report">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/sql.cgi b/httemplate/search/sql.cgi
new file mode 100755
index 000000000..b83ef039f
--- /dev/null
+++ b/httemplate/search/sql.cgi
@@ -0,0 +1,76 @@
+<%
+
+my $conf = new FS::Conf;
+my $maxrecords = $conf->config('maxsearchrecordsperpage');
+
+my $limit = '';
+$limit .= "LIMIT $maxrecords" if $maxrecords;
+
+my $offset = $cgi->param('offset') || 0;
+$limit .= " OFFSET $offset" if $offset;
+
+my $total;
+
+my $sql = $cgi->param('sql');
+$sql =~ s/^\s*SELECT//i;
+
+my $count_sql = $sql;
+$count_sql =~ s/^(.*)\s+FROM\s/COUNT(*) FROM /i;
+
+my $sth = dbh->prepare("SELECT $count_sql")
+ or eidiot dbh->errstr. " doing $count_sql\n";
+$sth->execute or eidiot "Error executing \"$count_sql\": ". $sth->errstr;
+
+$total = $sth->fetchrow_arrayref->[0];
+
+my $sth = dbh->prepare("SELECT $sql $limit")
+ or eidiot dbh->errstr. " doing $sql\n";
+$sth->execute or eidiot "Error executing \"$sql\": ". $sth->errstr;
+my $rows = $sth->fetchall_arrayref;
+
+%>
+<!-- mason kludge -->
+<%
+
+ #begin pager
+ my $pager = '';
+ if ( $total != scalar(@$rows) && $maxrecords ) {
+ unless ( $offset == 0 ) {
+ $cgi->param('offset', $offset - $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Previous</FONT></B></A> ';
+ }
+ my $poff;
+ my $page;
+ for ( $poff = 0; $poff < $total; $poff += $maxrecords ) {
+ $page++;
+ if ( $offset == $poff ) {
+ $pager .= qq!<FONT SIZE="+2">$page</FONT> !;
+ } else {
+ $cgi->param('offset', $poff);
+ $pager .= qq!<A HREF="!. $cgi->self_url. qq!">$page</A> !;
+ }
+ }
+ unless ( $offset + $maxrecords > $total ) {
+ $cgi->param('offset', $offset + $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
+ }
+ }
+ #end pager
+
+ print header('Query Results', menubar('Main Menu'=>$p) ).
+ "$total total rows<BR><BR>$pager". table().
+ "<TR>";
+ print "<TH>$_</TH>" foreach @{$sth->{NAME}};
+ print "</TR>";
+
+ foreach $row ( @$rows ) {
+ print "<TR>";
+ print "<TD>$_</TD>" foreach @$row;
+ print "</TR>";
+ }
+
+ print "</TABLE>$pager</BODY></HTML>";
+
+%>
diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi
new file mode 100755
index 000000000..e43f4f79b
--- /dev/null
+++ b/httemplate/search/svc_acct.cgi
@@ -0,0 +1,277 @@
+<%
+
+my $conf = new FS::Conf;
+my $maxrecords = $conf->config('maxsearchrecordsperpage');
+
+my $orderby = ''; #removeme
+
+my $limit = '';
+$limit .= "LIMIT $maxrecords" if $maxrecords;
+
+my $offset = $cgi->param('offset') || 0;
+$limit .= " OFFSET $offset" if $offset;
+
+my $total;
+
+my($query)=$cgi->keywords;
+$query ||= ''; #to avoid use of unitialized value errors
+
+my $unlinked = '';
+if ( $query =~ /^UN_(.*)$/ ) {
+ $query = $1;
+ my $empty = driver_name eq 'Pg' ? qq('') : qq("");
+ if ( driver_name eq 'mysql' ) {
+ $unlinked = "LEFT JOIN cust_svc ON cust_svc.svcnum = svc_acct.svcnum
+ WHERE cust_svc.pkgnum IS NULL
+ OR cust_svc.pkgnum = 0
+ OR cust_svc.pkgnum = $empty";
+ } else {
+ $unlinked = "
+ WHERE 0 <
+ ( SELECT count(*) FROM cust_svc
+ WHERE cust_svc.svcnum = svc_acct.svcnum
+ AND ( pkgnum IS NULL OR pkgnum = 0 )
+ )
+ ";
+ }
+}
+
+my $tblname = driver_name eq 'mysql' ? 'svc_acct.' : '';
+my(@svc_acct, $sortby);
+if ( $query eq 'svcnum' ) {
+ $sortby=\*svcnum_sort;
+ $orderby = "ORDER BY ${tblname}svcnum";
+} elsif ( $query eq 'username' ) {
+ $sortby=\*username_sort;
+ $orderby = "ORDER BY ${tblname}username";
+} elsif ( $query eq 'uid' ) {
+ $sortby=\*uid_sort;
+ $orderby = ( $unlinked ? 'AND' : 'WHERE' ).
+ " ${tblname}uid IS NOT NULL ORDER BY ${tblname}uid";
+} else {
+ $sortby=\*uid_sort;
+ @svc_acct = @{&usernamesearch};
+}
+
+if ( $query eq 'svcnum' || $query eq 'username' || $query eq 'uid' ) {
+
+ my $statement = "SELECT COUNT(*) FROM svc_acct $unlinked";
+ my $sth = dbh->prepare($statement)
+ or die dbh->errstr. " doing $statement";
+ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
+
+ $total = $sth->fetchrow_arrayref->[0];
+
+ @svc_acct = qsearch('svc_acct', {}, '', "$unlinked $orderby $limit");
+
+}
+
+if ( scalar(@svc_acct) == 1 ) {
+ my($svcnum)=$svc_acct[0]->svcnum;
+ print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum"); #redirect
+ #exit;
+} elsif ( scalar(@svc_acct) == 0 ) { #error
+%>
+<!-- mason kludge -->
+<%
+ idiot("Account not found");
+} else {
+%>
+<!-- mason kludge -->
+<%
+ $total ||= scalar(@svc_acct);
+
+ #begin pager
+ my $pager = '';
+ if ( $total != scalar(@svc_acct) && $maxrecords ) {
+ unless ( $offset == 0 ) {
+ $cgi->param('offset', $offset - $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Previous</FONT></B></A> ';
+ }
+ my $poff;
+ my $page;
+ for ( $poff = 0; $poff < $total; $poff += $maxrecords ) {
+ $page++;
+ if ( $offset == $poff ) {
+ $pager .= qq!<FONT SIZE="+2">$page</FONT> !;
+ } else {
+ $cgi->param('offset', $poff);
+ $pager .= qq!<A HREF="!. $cgi->self_url. qq!">$page</A> !;
+ }
+ }
+ unless ( $offset + $maxrecords > $total ) {
+ $cgi->param('offset', $offset + $maxrecords);
+ $pager .= '<A HREF="'. $cgi->self_url.
+ '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
+ }
+ }
+ #end pager
+
+ print header("Account Search Results",menubar('Main Menu'=>popurl(2))),
+ "$total matching accounts found<BR><BR>$pager",
+ &table(), <<END;
+ <TR>
+ <TH><FONT SIZE=-1>#</FONT></TH>
+ <TH><FONT SIZE=-1>Username</FONT></TH>
+ <TH><FONT SIZE=-1>Domain</FONT></TH>
+ <TH><FONT SIZE=-1>UID</FONT></TH>
+ <TH><FONT SIZE=-1>Service</FONT></TH>
+ <TH><FONT SIZE=-1>Cust#</FONT></TH>
+ <TH><FONT SIZE=-1>(bill) name</FONT></TH>
+ <TH><FONT SIZE=-1>company</FONT></TH>
+END
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ print <<END;
+ <TH><FONT SIZE=-1>(service) name</FONT></TH>
+ <TH><FONT SIZE=-1>company</FONT></TH>
+END
+ }
+ print "</TR>";
+
+ my(%saw,$svc_acct);
+ my $p = popurl(2);
+ foreach $svc_acct (
+ sort $sortby grep(!$saw{$_->svcnum}++, @svc_acct)
+ ) {
+ my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct->svcnum })
+ or die "No cust_svc record for svcnum ". $svc_acct->svcnum;
+ my $part_svc = qsearchs('part_svc', { 'svcpart' => $cust_svc->svcpart })
+ or die "No part_svc record for svcpart ". $cust_svc->svcpart;
+
+ my $domain;
+ my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc });
+ if ( $svc_domain ) {
+ $domain = "<A HREF=\"${p}view/svc_domain.cgi?". $svc_domain->svcnum.
+ "\">". $svc_domain->domain. "</A>";
+ } else {
+ die "No svc_domain.svcnum record for svc_acct.domsvc: ".
+ $svc_acct->domsvc;
+ }
+ my($cust_pkg,$cust_main);
+ if ( $cust_svc->pkgnum ) {
+ $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc->pkgnum })
+ or die "No cust_pkg record for pkgnum ". $cust_svc->pkgnum;
+ $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg->custnum })
+ or die "No cust_main record for custnum ". $cust_pkg->custnum;
+ }
+ my($svcnum, $username, $uid, $svc, $custnum, $last, $first, $company) = (
+ $svc_acct->svcnum,
+ $svc_acct->getfield('username'),
+ $svc_acct->getfield('uid'),
+ $part_svc->svc,
+ $cust_svc->pkgnum ? $cust_main->custnum : '',
+ $cust_svc->pkgnum ? $cust_main->getfield('last') : '',
+ $cust_svc->pkgnum ? $cust_main->getfield('first') : '',
+ $cust_svc->pkgnum ? $cust_main->company : '',
+ );
+ my($pcustnum) = $custnum
+ ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\"><FONT SIZE=-1>$custnum</FONT></A>"
+ : "<I>(unlinked)</I>"
+ ;
+ my $pname = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$last, $first</A>" : '';
+ my $pcompany = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$company</A>" : '';
+ my($pship_name, $pship_company);
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ my($ship_last, $ship_first, $ship_company) = (
+ $cust_svc->pkgnum ? ( $cust_main->ship_last || $last ) : '',
+ $cust_svc->pkgnum ? ( $cust_main->ship_last
+ ? $cust_main->ship_first
+ : $first
+ ) : '',
+ $cust_svc->pkgnum ? ( $cust_main->ship_last
+ ? $cust_main->ship_company
+ : $company
+ ) : '',
+ );
+ $pship_name = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$ship_last, $ship_first</A>" : '';
+ $pship_company = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$ship_company</A>" : '';
+ }
+ print <<END;
+ <TR>
+ <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD>
+ <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$username</FONT></A></TD>
+ <TD><FONT SIZE=-1>$domain</FONT></TD>
+ <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$uid</FONT></A></TD>
+ <TD><FONT SIZE=-1>$svc</FONT></TH>
+ <TD><FONT SIZE=-1>$pcustnum</FONT></TH>
+ <TD><FONT SIZE=-1>$pname<FONT></TH>
+ <TD><FONT SIZE=-1>$pcompany</FONT></TH>
+END
+ if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+ print <<END;
+ <TD><FONT SIZE=-1>$pship_name<FONT></TH>
+ <TD><FONT SIZE=-1>$pship_company</FONT></TH>
+END
+ }
+ print "</TR>";
+
+ }
+
+ print "</TABLE>$pager<BR>".
+ '</BODY></HTML>';
+
+}
+
+sub svcnum_sort {
+ $a->getfield('svcnum') <=> $b->getfield('svcnum');
+}
+
+sub username_sort {
+ $a->getfield('username') cmp $b->getfield('username');
+}
+
+sub uid_sort {
+ $a->getfield('uid') <=> $b->getfield('uid');
+}
+
+sub usernamesearch {
+
+ my @svc_acct;
+
+ my %username_type;
+ foreach ( $cgi->param('username_type') ) {
+ $username_type{$_}++;
+ }
+
+ $cgi->param('username') =~ /^([\w\-\.\&]+)$/; #untaint username_text
+ my $username = $1;
+
+ if ( $username_type{'Exact'} || $username_type{'Fuzzy'} ) {
+ push @svc_acct, qsearch( 'svc_acct',
+ { 'username' => { 'op' => 'ILIKE',
+ 'value' => $username } } );
+ }
+
+ if ( $username_type{'Substring'} || $username_type{'All'} ) {
+ push @svc_acct, qsearch( 'svc_acct',
+ { 'username' => { 'op' => 'ILIKE',
+ 'value' => "%$username%" } } );
+ }
+
+ if ( $username_type{'Fuzzy'} || $username_type{'All'} ) {
+ &FS::svc_acct::check_and_rebuild_fuzzyfiles;
+ my $all_username = &FS::svc_acct::all_username;
+
+ my %username;
+ if ( $username_type{'Fuzzy'} || $username_type{'All'} ) {
+ foreach ( amatch($username, [ qw(i) ], @$all_username) ) {
+ $username{$_}++;
+ }
+ }
+
+ #if ($username_type{'Sound-alike'}) {
+ #}
+
+ foreach ( keys %username ) {
+ push @svc_acct, qsearch('svc_acct',{'username'=>$_});
+ }
+
+ }
+
+ #[ qsearch('svc_acct',{'username'=>$username}) ];
+ \@svc_acct;
+
+}
+
+%>
diff --git a/httemplate/search/svc_acct.html b/httemplate/search/svc_acct.html
new file mode 100755
index 000000000..742360596
--- /dev/null
+++ b/httemplate/search/svc_acct.html
@@ -0,0 +1,19 @@
+<HTML>
+ <HEAD>
+ <TITLE>Account Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Account Search
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="svc_acct.cgi" METHOD="post">
+ Search for <B>username</B>:
+ <INPUT TYPE="text" NAME="username">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/svc_domain.cgi b/httemplate/search/svc_domain.cgi
new file mode 100755
index 000000000..c0acf1143
--- /dev/null
+++ b/httemplate/search/svc_domain.cgi
@@ -0,0 +1,154 @@
+<%
+
+my $conf = new FS::Conf;
+
+my($query)=$cgi->keywords;
+$query ||= ''; #to avoid use of unitialized value errors
+my(@svc_domain,$sortby);
+if ( $query eq 'svcnum' ) {
+ $sortby=\*svcnum_sort;
+ @svc_domain=qsearch('svc_domain',{});
+} elsif ( $query eq 'domain' ) {
+ $sortby=\*domain_sort;
+ @svc_domain=qsearch('svc_domain',{});
+} elsif ( $query eq 'UN_svcnum' ) {
+ $sortby=\*svcnum_sort;
+ @svc_domain = grep qsearchs('cust_svc',{
+ 'svcnum' => $_->svcnum,
+ 'pkgnum' => '',
+ }), qsearch('svc_domain',{});
+} elsif ( $query eq 'UN_domain' ) {
+ $sortby=\*domain_sort;
+ @svc_domain = grep qsearchs('cust_svc',{
+ 'svcnum' => $_->svcnum,
+ 'pkgnum' => '',
+ }), qsearch('svc_domain',{});
+} else {
+ $cgi->param('domain') =~ /^([\w\-\.]+)$/;
+ my($domain)=$1;
+ #push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain});
+ @svc_domain = qsearchs('svc_domain',{'domain'=>$domain});
+}
+
+if ( scalar(@svc_domain) == 1 ) {
+ print $cgi->redirect(popurl(2). "view/svc_domain.cgi?". $svc_domain[0]->svcnum);
+ #exit;
+} elsif ( scalar(@svc_domain) == 0 ) {
+%>
+<!-- mason kludge -->
+<%
+ eidiot "No matching domains found!\n";
+} else {
+%>
+<!-- mason kludge -->
+<%
+ my($total)=scalar(@svc_domain);
+ print header("Domain Search Results",''), <<END;
+
+ $total matching domains found
+ <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0>
+ <TR>
+ <TH>Service #</TH>
+ <TH>Domain</TH>
+<!-- <TH>Mail to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
+ <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
+-->
+ </TR>
+END
+
+# my(%saw); # if we've multiple domains with the same
+ # svcnum, then we've a corrupt database
+
+ foreach my $svc_domain (
+# sort $sortby grep(!$saw{$_->svcnum}++, @svc_domain)
+ sort $sortby (@svc_domain)
+ ) {
+ my($svcnum,$domain)=(
+ $svc_domain->svcnum,
+ $svc_domain->domain,
+ );
+
+ #don't display all accounts here
+ my $rowspan = 1;
+
+ #my @svc_acct=qsearch('svc_acct',{'domsvc' => $svcnum});
+ #my $rowspan = 0;
+ #
+ #my $n1 = '';
+ #my($svc_acct, @rows);
+ #foreach $svc_acct (
+ # sort {$b->getfield('username') cmp $a->getfield('username')} (@svc_acct)
+ #) {
+ #
+ # my (@forwards) = ();
+ #
+ # my($svcnum,$username)=(
+ # $svc_acct->svcnum,
+ # $svc_acct->username,
+ # );
+ #
+ # my @svc_forward = qsearch( 'svc_forward', { 'srcsvc' => $svcnum } );
+ # my $svc_forward;
+ # foreach $svc_forward (@svc_forward) {
+ # my($dstsvc,$dst) = (
+ # $svc_forward->dstsvc,
+ # $svc_forward->dst,
+ # );
+ # if ($dstsvc) {
+ # my $dst_svc_acct=qsearchs( 'svc_acct', { 'svcnum' => $dstsvc } );
+ # my $destination=$dst_svc_acct->email;
+ # push @forwards, qq!<TD><A HREF="!, popurl(2),
+ # qq!view/svc_acct.cgi?$dstsvc">$destination</A>!,
+ # qq!</TD></TR>!
+ # ;
+ # }else{
+ # push @forwards, qq!<TD>$dst</TD></TR>!
+ # ;
+ # }
+ # }
+ #
+ # push @rows, qq!$n1<TD ROWSPAN=!, (scalar(@svc_forward) || 1),
+ # qq!><A HREF="!. popurl(2). qq!view/svc_acct.cgi?$svcnum">!,
+ # #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser );
+ # ( ($username eq '*') ? "<I>(anything)</I>" : $username ),
+ # qq!\@$domain</A> </TD>!,
+ # ;
+ #
+ # push @rows, @forwards;
+ #
+ # $rowspan += (scalar(@svc_forward) || 1);
+ # $n1 = "</TR><TR>";
+ #}
+ ##end of false laziness
+ #
+ #
+
+ print <<END;
+ <TR>
+ <TD ROWSPAN=$rowspan><A HREF="${p}view/svc_domain.cgi?$svcnum">$svcnum</A></TD>
+ <TD ROWSPAN=$rowspan><A HREF="${p}view/svc_domain.cgi?$svcnum">$domain</A></TD>
+END
+
+ #print @rows;
+ print "</TR>";
+
+ }
+
+ print <<END;
+ </TABLE>
+ </BODY>
+</HTML>
+END
+
+}
+
+sub svcnum_sort {
+ $a->getfield('svcnum') <=> $b->getfield('svcnum');
+}
+
+sub domain_sort {
+ $a->getfield('domain') cmp $b->getfield('domain');
+}
+
+
+%>
diff --git a/httemplate/search/svc_domain.html b/httemplate/search/svc_domain.html
new file mode 100755
index 000000000..94bb9a66d
--- /dev/null
+++ b/httemplate/search/svc_domain.html
@@ -0,0 +1,19 @@
+<HTML>
+ <HEAD>
+ <TITLE>Domain Search</TITLE>
+ </HEAD>
+ <BODY BGCOLOR="#e8e8e8">
+ <FONT SIZE=7>
+ Domain Search
+ </FONT>
+ <BR><BR>
+ <FORM ACTION="svc_domain.cgi" METHOD="post">
+ Search for <B>domain</B>:
+ <INPUT TYPE="text" NAME="domain">
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+ </BODY>
+</HTML>
+
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
new file mode 100755
index 000000000..53d7bc051
--- /dev/null
+++ b/httemplate/view/cust_bill.cgi
@@ -0,0 +1,48 @@
+<!-- mason kludge -->
+<%
+
+#untaint invnum
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $invnum = $1;
+
+my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
+die "Invoice #$invnum not found!" unless $cust_bill;
+my $custnum = $cust_bill->getfield('custnum');
+
+#my $printed = $cust_bill->printed;
+
+print header('Invoice View', menubar(
+ "Main Menu" => $p,
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+));
+
+print qq!<A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A> | !
+ if $cust_bill->owed > 0;
+
+print qq!<A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>!. '<BR><BR>';
+
+#false laziness with search/cust_bill_event.cgi
+
+print table(). '<TR><TH>Event</TH><TH>Date</TH><TH>Status</TH></TR>';
+foreach my $cust_bill_event (
+ sort { $a->_date <=> $b->_date } $cust_bill->cust_bill_event
+) {
+ my $status = $cust_bill_event->status;
+ $status .= ': '. $cust_bill_event->statustext if $cust_bill_event->statustext;
+ print '<TR><TD>'. $cust_bill_event->part_bill_event->event. '</TD><TD>'.
+ time2str("%a %b %e %T %Y", $cust_bill_event->_date). '</TD><TD>'.
+ $status. '</TD></TR>';
+}
+print '</TABLE><BR><PRE>';
+
+print $cust_bill->print_text;
+
+ #formatting
+ print <<END;
+ </PRE></FONT>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
new file mode 100755
index 000000000..c36c9e265
--- /dev/null
+++ b/httemplate/view/cust_main.cgi
@@ -0,0 +1,923 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+#false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so
+my %uiview = ();
+my %uiadd = ();
+foreach my $part_svc ( qsearch('part_svc',{}) ) {
+ $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
+ $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
+}
+
+print header("Customer View", menubar(
+ 'Main Menu' => popurl(2)
+));
+
+print <<END;
+<STYLE TYPE="text/css">
+.package TH { font-size: medium }
+.package TR { font-size: smaller }
+.package .pkgnum { font-size: medium }
+.package .provision { font-weight: bold }
+</STYLE>
+END
+
+die "No customer specified (bad URL)!" unless $cgi->keywords;
+my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
+$query =~ /^(\d+)$/;
+my $custnum = $1;
+my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
+die "Customer not found!" unless $cust_main;
+
+print qq!<A HREF="${p}edit/cust_main.cgi?$custnum">Edit this customer</A>!;
+
+print <<END;
+<SCRIPT>
+function cancel_areyousure(href) {
+ if (confirm("Perminantly delete all services and cancel this customer?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+END
+
+print qq! | <A HREF="javascript:cancel_areyousure('${p}misc/cust_main-cancel.cgi?$custnum')">!.
+ 'Cancel this customer</A>'
+ if $cust_main->ncancelled_pkgs;
+
+print qq! | <A HREF="${p}misc/delete-customer.cgi?$custnum">!.
+ 'Delete this customer</A>'
+ if $conf->exists('deletecustomers');
+
+unless ( $conf->exists('disable_customer_referrals') ) {
+ print qq! | <A HREF="!, popurl(2),
+ qq!edit/cust_main.cgi?referral_custnum=$custnum">!,
+ qq!Refer a new customer</A>!;
+
+ print qq! | <A HREF="!, popurl(2),
+ qq!search/cust_main.cgi?referral_custnum=$custnum">!,
+ qq!View this customer's referrals</A>!;
+}
+
+print '<BR><BR>';
+
+my $signupurl = $conf->config('signupurl');
+if ( $signupurl ) {
+print "This customer's signup URL: ".
+ "<a href=\"$signupurl?ref=$custnum\">$signupurl?ref=$custnum</a><BR><BR>";
+}
+
+print '<A NAME="cust_main"></A>';
+
+print &itable(), '<TR>';
+
+print '<TD VALIGN="top">';
+
+ print "Billing address", &ntable("#cccccc"), "<TR><TD>",
+ &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Contact name</TD>',
+ '<TD COLSPAN=3 BGCOLOR="#ffffff">',
+ $cust_main->last, ', ', $cust_main->first,
+ '</TD>';
+print '<TD ALIGN="right">SS#</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->ss || '&nbsp', '</TD>'
+ if $conf->exists('show_ss');
+
+print '</TR>',
+ '<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->company,
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Address</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->address1,
+ '</TD></TR>',
+ ;
+ print '<TR><TD ALIGN="right">&nbsp;</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->address2, '</TD></TR>'
+ if $cust_main->address2;
+ print '<TR><TD ALIGN="right">City</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->city,
+ '</TD><TD ALIGN="right">State</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->state,
+ '</TD><TD ALIGN="right">Zip</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->zip, '</TD></TR>',
+ '<TR><TD ALIGN="right">Country</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->country,
+ '</TD></TR>',
+ ;
+ my $daytime_label = FS::Msgcat::_gettext('daytime') || 'Day Phone';
+ my $night_label = FS::Msgcat::_gettext('night') || 'Night Phone';
+ print '<TR><TD ALIGN="right">'. $daytime_label.
+ '</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->daytime || '&nbsp', '</TD></TR>',
+ '<TR><TD ALIGN="right">'. $night_label.
+ '</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->night || '&nbsp', '</TD></TR>',
+ '<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->fax || '&nbsp', '</TD></TR>',
+ '</TABLE>', "</TD></TR></TABLE>"
+ ;
+
+ if ( defined $cust_main->dbdef_table->column('ship_last') ) {
+
+ my $pre = $cust_main->ship_last ? 'ship_' : '';
+
+ print "<BR>Service address", &ntable("#cccccc"), "<TR><TD>",
+ &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Contact name</TD>',
+ '<TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}last"), ', ', $cust_main->get("${pre}first"),
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}company"),
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Address</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}address1"),
+ '</TD></TR>',
+ ;
+ print '<TR><TD ALIGN="right">&nbsp;</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}address2"), '</TD></TR>'
+ if $cust_main->get("${pre}address2");
+ print '<TR><TD ALIGN="right">City</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}city"),
+ '</TD><TD ALIGN="right">State</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}state"),
+ '</TD><TD ALIGN="right">Zip</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}zip"), '</TD></TR>',
+ '<TR><TD ALIGN="right">Country</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}country"),
+ '</TD></TR>',
+ ;
+ print '<TR><TD ALIGN="right">'. $daytime_label. '</TD>',
+ '<TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}daytime") || '&nbsp', '</TD></TR>',
+ '<TR><TD ALIGN="right">'. $night_label. '</TD>'.
+ '<TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}night") || '&nbsp', '</TD></TR>',
+ '<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
+ $cust_main->get("${pre}fax") || '&nbsp', '</TD></TR>',
+ '</TABLE>', "</TD></TR></TABLE>"
+ ;
+
+ }
+
+print '</TD>';
+
+print '<TD VALIGN="top">';
+
+ print &ntable("#cccccc"), "<TR><TD>", &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Customer number</TD><TD BGCOLOR="#ffffff">',
+ $custnum, '</TD></TR>',
+ ;
+
+ my @agents = qsearch( 'agent', {} );
+ my $agent;
+ unless ( scalar(@agents) == 1 ) {
+ $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
+ print '<TR><TD ALIGN="right">Agent</TD><TD BGCOLOR="#ffffff">',
+ $agent->agentnum, ": ", $agent->agent, '</TD></TR>';
+ } else {
+ $agent = $agents[0];
+ }
+ my @referrals = qsearch( 'part_referral', {} );
+ unless ( scalar(@referrals) == 1 ) {
+ my $referral = qsearchs('part_referral', {
+ 'refnum' => $cust_main->refnum
+ } );
+ print '<TR><TD ALIGN="right">Advertising source</TD><TD BGCOLOR="#ffffff">',
+ $referral->refnum, ": ", $referral->referral, '</TD></TR>';
+ }
+ print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->otaker, '</TD></TR>';
+
+ print '<TR><TD ALIGN="right">Referring Customer</TD><TD BGCOLOR="#ffffff">';
+ my $referring_cust_main = '';
+ if ( $cust_main->referral_custnum
+ && ( $referring_cust_main =
+ qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
+ )
+ ) {
+ print '<A HREF="'. popurl(1). 'cust_main.cgi?'.
+ $cust_main->referral_custnum. '">'.
+ $cust_main->referral_custnum. ': '.
+ ( $referring_cust_main->company
+ ? $referring_cust_main->company. ' ('.
+ $referring_cust_main->last. ', '. $referring_cust_main->first.
+ ')'
+ : $referring_cust_main->last. ', '. $referring_cust_main->first
+ ).
+ '</A>';
+ }
+ print '</TD></TR>';
+
+ print '</TABLE></TD></TR></TABLE>';
+
+print '<BR>';
+
+if ( $conf->config('payby-default') ne 'HIDE' ) {
+
+ my @invoicing_list = $cust_main->invoicing_list;
+ print "Billing information (",
+ qq!<A HREF="!, popurl(2), qq!misc/bill.cgi?$custnum">!, "Bill now</A>)",
+ &ntable("#cccccc"), "<TR><TD>", &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Tax exempt</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->tax ? 'yes' : 'no',
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Postal invoices</TD><TD BGCOLOR="#ffffff">',
+ ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no',
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Email invoices</TD><TD BGCOLOR="#ffffff">',
+ join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no',
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Billing type</TD><TD BGCOLOR="#ffffff">',
+ ;
+
+ if ( $cust_main->payby eq 'CARD' || $cust_main->payby eq 'DCRD' ) {
+ my $payinfo = $cust_main->payinfo;
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4));
+ print 'Credit card ',
+ ( $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' ),
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Card number</TD><TD BGCOLOR="#ffffff">',
+ $payinfo, '</TD></TR>',
+ '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->paydate, '</TD></TR>',
+ '<TR><TD ALIGN="right">Name on card</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->payname, '</TD></TR>'
+ ;
+ } elsif ( $cust_main->payby eq 'CHEK' || $cust_main->payby eq 'DCHK') {
+ my( $account, $aba ) = split('@', $cust_main->payinfo );
+ print 'Electronic check',
+ ( $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' ),
+ '</TD></TR>',
+ '<TR><TD ALIGN="right">Account number</TD><TD BGCOLOR="#ffffff">',
+ $account, '</TD></TR>',
+ '<TR><TD ALIGN="right">ABA/Routing code</TD><TD BGCOLOR="#ffffff">',
+ $aba, '</TD></TR>',
+ '<TR><TD ALIGN="right">Bank name</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->payname, '</TD></TR>'
+ ;
+ } elsif ( $cust_main->payby eq 'LECB' ) {
+ $cust_main->payinfo =~ /^(\d{3})(\d{3})(\d{4})$/;
+ my $payinfo = "$1-$2-$3";
+ print 'Phone bill billing</TD></TR>',
+ '<TR><TD ALIGN="right">Phone number</TD><TD BGCOLOR="#ffffff">',
+ $payinfo, '</TD></TR>',
+ ;
+ } elsif ( $cust_main->payby eq 'BILL' ) {
+ print 'Billing</TD></TR>';
+ print '<TR><TD ALIGN="right">P.O. </TD><TD BGCOLOR="#ffffff">',
+ $cust_main->payinfo, '</TD></TR>',
+ if $cust_main->payinfo;
+ print '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->paydate, '</TD></TR>',
+ '<TR><TD ALIGN="right">Attention</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->payname, '</TD></TR>',
+ ;
+ } elsif ( $cust_main->payby eq 'COMP' ) {
+ print 'Complimentary</TD></TR>',
+ '<TR><TD ALIGN="right">Authorized by</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->payinfo, '</TD></TR>',
+ '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
+ $cust_main->paydate, '</TD></TR>',
+ ;
+ }
+
+ print "</TABLE></TD></TR></TABLE>";
+
+}
+
+print '</TD></TR></TABLE>';
+
+if ( defined $cust_main->dbdef_table->column('comments')
+ && $cust_main->comments =~ /[^\s\n\r]/ )
+{
+ print "<BR>Comments". &ntable("#cccccc"). "<TR><TD>".
+ &ntable("#cccccc",2).
+ '<TR><TD BGCOLOR="#ffffff"><PRE>'.
+ encode_entities($cust_main->comments).
+ '</PRE></TD></TR></TABLE></TABLE>';
+}
+
+print '</TD></TR></TABLE>';
+
+print '<BR>'.
+ '<FORM ACTION="'.popurl(2).'edit/process/quick-cust_pkg.cgi" METHOD="POST">'.
+ qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!.
+ '<SELECT NAME="pkgpart"><OPTION> ';
+
+foreach my $part_pkg (
+ qsearch( 'part_pkg', { 'disabled' => '' }, '',
+ ' AND 0 < ( SELECT COUNT(*) FROM type_pkgs '.
+ ' WHERE typenum = '. $agent->typenum.
+ ' AND type_pkgs.pkgpart = part_pkg.pkgpart )'
+ )
+) {
+ print '<OPTION VALUE="'. $part_pkg->pkgpart. '">'. $part_pkg->pkg. ' - '.
+ $part_pkg->comment;
+}
+
+print '</SELECT><INPUT TYPE="submit" VALUE="Order Package"></FORM><BR>';
+
+if ( $conf->config('payby-default') ne 'HIDE' ) {
+
+ print '<BR>'.
+ qq!<FORM ACTION="${p}edit/process/quick-charge.cgi" METHOD="POST">!.
+ qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!.
+ qq!Description:<INPUT TYPE="text" NAME="pkg">!.
+ qq!&nbsp;Amount:<INPUT TYPE="text" NAME="amount" SIZE=6>!.
+ qq!&nbsp;!;
+
+ #false laziness w/ edit/part_pkg.cgi
+ if ( $conf->exists('enable_taxclasses') ) {
+ print '<SELECT NAME="taxclass">';
+ my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
+ or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ foreach my $taxclass ( map $_->[0], @{$sth->fetchall_arrayref} ) {
+ print qq!<OPTION VALUE="$taxclass"!;
+ #print ' SELECTED' if $taxclass eq $hashref->{taxclass};
+ print qq!>$taxclass</OPTION>!;
+ }
+ print '</SELECT>';
+ } else {
+ print '<INPUT TYPE="hidden" NAME="taxclass" VALUE="">';
+ }
+
+ print qq!<INPUT TYPE="submit" VALUE="One-time charge"></FORM><BR>!;
+
+}
+
+print <<END;
+<SCRIPT>
+function cust_pkg_areyousure(href) {
+ if (confirm("Permanently delete included services and cancel this package?") == true)
+ window.location.href = href;
+}
+function svc_areyousure(href) {
+ if (confirm("Permanently unprovision and delete this service?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+END
+
+print qq!<BR><A NAME="cust_pkg">Packages</A> !,
+# qq!<BR>Click on package number to view/edit package.!,
+ qq!( <A HREF="!, popurl(2), qq!edit/cust_pkg.cgi?$custnum">Order and cancel packages</A> (preserves services) )!,
+;
+
+#begin display packages
+
+#get package info
+
+my $packages = get_packages($cust_main);
+
+if ( @$packages ) {
+%>
+<TABLE CLASS="package" BORDER=1 CELLSPACING=0 CELLPADDING=2 BORDERCOLOR="#999999">
+<TR>
+ <TH COLSPAN=2>Package</TH>
+ <TH>Status</TH>
+ <TH COLSPAN=2>Services</TH>
+</TR>
+<%
+foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) {
+ my $rowspan = 0;
+
+ if ($pkg->{cancel}) {
+ $rowspan = 0;
+ } else {
+ foreach my $svcpart (@{$pkg->{svcparts}}) {
+ $rowspan += $svcpart->{count};
+ $rowspan++ if ($svcpart->{count} < $svcpart->{quantity});
+ }
+ }
+
+%>
+<!--pkgnum: <%=$pkg->{pkgnum}%>-->
+<TR>
+ <TD ROWSPAN=<%=$rowspan%> CLASS="pkgnum"><%=$pkg->{pkgnum}%></TD>
+ <TD ROWSPAN=<%=$rowspan%>>
+ <%=$pkg->{pkg}%> - <%=$pkg->{comment}%> (&nbsp;<%=pkg_details_link($pkg)%>&nbsp;)<BR>
+<% unless ($pkg->{cancel}) { %>
+ (&nbsp;<%=pkg_change_link($pkg)%>&nbsp;)
+ (&nbsp;<%=pkg_dates_link($pkg)%>&nbsp;|&nbsp;<%=pkg_customize_link($pkg)%>&nbsp;)
+<% } %>
+ </TD>
+<%
+ #foreach (qw(setup last_bill next_bill susp expire cancel)) {
+ # print qq! <TD ROWSPAN=$rowspan>! . pkg_datestr($pkg,$_) . qq!</TD>\n!;
+ #}
+ print "<TD ROWSPAN=$rowspan>". &itable('');
+
+ #move
+ my %freq = (
+ 1 => 'monthly',
+ 2 => 'bi-monthly',
+ 3 => 'quarterly',
+ 6 => 'semi-annually',
+ 12 => 'annually',
+ 24 => 'bi-annually',
+ 36 => 'tri-annually',
+ );
+
+ sub freq {
+ my $freq = shift;
+ exists $freq{$freq} ? $freq{$freq} : "every&nbsp;$freq&nbsp;months";
+ }
+
+ #eomove
+
+ if ( $pkg->{cancel} ) { #status: cancelled
+
+ print '<TR><TD><FONT COLOR="#ff0000"><B>Cancelled&nbsp;</B></FONT></TD>'.
+ '<TD>'. pkg_datestr($pkg,'cancel'). '</TD></TR>';
+ unless ( $pkg->{setup} ) {
+ print '<TR><TD COLSPAN=2>Never billed</TD></TR>';
+ } else {
+ print "<TR><TD>Setup&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'setup'). '</TD></TR>';
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill'). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ print "<TR><TD>Suspended&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'susp'). '</TD></TR>'
+ if $pkg->{'susp'};
+ }
+
+ } else {
+
+ if ( $pkg->{susp} ) { #status: suspended
+ print '<TR><TD><FONT COLOR="#FF9900"><B>Suspended</B>&nbsp;</FONT></TD>'.
+ '<TD>'. pkg_datestr($pkg,'susp'). '</TD></TR>';
+ unless ( $pkg->{setup} ) {
+ print '<TR><TD COLSPAN=2>Never billed</TD></TR>';
+ } else {
+ print "<TR><TD>Setup&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'setup'). '</TD></TR>';
+ }
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill'). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ # next bill ??
+ print "<TR><TD>Expires&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'expire'). '</TD></TR>'
+ if $pkg->{'expire'};
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_unsuspend_link($pkg).
+ '&nbsp;|&nbsp;'. pkg_cancel_link($pkg). '&nbsp;)</TD></TR>';
+
+ } else { #status: active
+
+ unless ( $pkg->{setup} ) { #not setup
+
+ print '<TR><TD COLSPAN=2>Not&nbsp;yet&nbsp;billed&nbsp;(';
+ unless ( $pkg->{freq} ) {
+ print 'one-time&nbsp;charge)</TD></TR>';
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_cancel_link($pkg).
+ '&nbsp;)</TD</TR>';
+ } else {
+ print 'billed&nbsp;'. freq($pkg->{freq}). ')</TD></TR>';
+ }
+
+ } else { #setup
+
+ unless ( $pkg->{freq} ) {
+ print "<TR><TD COLSPAN=2>One-time&nbsp;charge</TD></TR>".
+ '<TR><TD>Billed&nbsp;</TD><TD>'.
+ pkg_datestr($pkg,'setup'). '</TD></TR>';
+ } else {
+ print '<TR><TD COLSPAN=2><FONT COLOR="#00CC00"><B>Active</B></FONT>'.
+ ',&nbsp;billed&nbsp;'. freq($pkg->{freq}). '</TD></TR>'.
+ '<TR><TD>Setup&nbsp;</TD><TD>'.
+ pkg_datestr($pkg, 'setup'). '</TD></TR>';
+ }
+
+ }
+
+ print "<TR><TD>Last&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'last_bill'). '</TD></TR>'
+ if $pkg->{'last_bill'};
+ print "<TR><TD>Next&nbsp;bill&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'next_bill'). '</TD></TR>'
+ if $pkg->{'next_bill'};
+ print "<TR><TD>Expires&nbsp;</TD><TD>".
+ pkg_datestr($pkg, 'expire'). '</TD></TR>'
+ if $pkg->{'expire'};
+ if ( $pkg->{freq} ) {
+ print '<TR><TD COLSPAN=2>(&nbsp;'. pkg_suspend_link($pkg).
+ '&nbsp;|&nbsp;'. pkg_cancel_link($pkg). '&nbsp;)</TD></TR>';
+ }
+
+ }
+
+ }
+
+ print "</TABLE></TD>\n";
+
+ if ($rowspan == 0) { print qq!</TR>\n!; next; }
+
+ my $cnt = 0;
+ foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) {
+ foreach my $service (@{$svcpart->{services}}) {
+ print '<TR>' if ($cnt > 0);
+%>
+ <TD><%=svc_link($svcpart,$service)%></TD>
+ <TD><%=svc_label_link($svcpart,$service)%><BR>(&nbsp;<%=svc_unprovision_link($service)%>&nbsp;)</TD>
+</TR>
+<%
+ $cnt++;
+ }
+ if ($svcpart->{count} < $svcpart->{quantity}) {
+ print qq!<TR>\n! if ($cnt > 0);
+ print qq! <TD COLSPAN=2>!.svc_provision_link($pkg,$svcpart).qq!</TD>\n</TR>\n!;
+ }
+ }
+}
+print '</TABLE>'
+}
+
+#end display packages
+
+
+print <<END;
+<SCRIPT>
+function cust_pay_areyousure(href) {
+ if (confirm("Are you sure you want to delete this payment?")
+ == true)
+ window.location.href = href;
+}
+function cust_pay_unapply_areyousure(href) {
+ if (confirm("Are you sure you want to unapply this payment?")
+ == true)
+ window.location.href = href;
+}
+</SCRIPT>
+END
+
+if ( $conf->config('payby-default') ne 'HIDE' ) {
+
+ #formatting
+ print qq!<BR><BR><A NAME="history">Payment History!.
+ qq!</A> ( !.
+ qq!<A HREF="!. popurl(2). qq!edit/cust_pay.cgi?custnum=$custnum">!.
+ qq!Post payment</A> | !.
+ qq!<A HREF="!. popurl(2). qq!edit/cust_credit.cgi?$custnum">!.
+ qq!Post credit</A> )!;
+
+ #get payment history
+ #
+ # major problem: this whole thing is way too sloppy.
+ # minor problem: the description lines need better formatting.
+
+ my @history = (); #needed for mod_perl :)
+
+ my %target = ();
+
+ my @bills = qsearch('cust_bill',{'custnum'=>$custnum});
+ foreach my $bill (@bills) {
+ my($bref)=$bill->hashref;
+ my $bpre = ( $bill->owed > 0 )
+ ? '<b><font size="+1" color="#ff0000"> Open '
+ : '';
+ my $bpost = ( $bill->owed > 0 ) ? '</font></b>' : '';
+ push @history,
+ $bref->{_date} . qq!\t<A HREF="!. popurl(2). qq!view/cust_bill.cgi?! .
+ $bref->{invnum} . qq!">${bpre}Invoice #! . $bref->{invnum} .
+ qq! (Balance \$! . $bill->owed . qq!)$bpost</A>\t! .
+ $bref->{charged} . qq!\t\t\t!;
+
+ my(@cust_bill_pay)=qsearch('cust_bill_pay',{'invnum'=> $bref->{invnum} } );
+ # my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } );
+ # my($payment);
+ foreach my $cust_bill_pay (@cust_bill_pay) {
+ my $payment = $cust_bill_pay->cust_pay;
+ my($date,$invnum,$payby,$payinfo,$paid)=($payment->_date,
+ $cust_bill_pay->invnum,
+ $payment->payby,
+ $payment->payinfo,
+ $cust_bill_pay->amount,
+ );
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4))
+ if $payby eq 'CARD';
+ my $target = "$payby$payinfo";
+ $payby =~ s/^BILL$/Check #/ if $payinfo;
+ $payby =~ s/^(CARD|COMP)$/$1 /;
+ my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
+ ? qq! (<A HREF="javascript:cust_pay_areyousure('${p}misc/delete-cust_pay.cgi?!. $payment->paynum. qq!')">delete</A>)!
+ : '';
+ my $unapply =
+ $payment->closed !~ /^Y/i && $conf->exists('unapplypayments')
+ ? qq! (<A HREF="javascript:cust_pay_unapply_areyousure('${p}misc/unapply-cust_pay.cgi?!. $payment->paynum. qq!')">unapply</A>)!
+ : '';
+ push @history,
+ "$date\tPayment, Invoice #$invnum ($payby$payinfo)$delete$unapply\t\t$paid\t\t\t$target";
+ }
+
+ my(@cust_credit_bill)=
+ qsearch('cust_credit_bill', { 'invnum'=> $bref->{invnum} } );
+ foreach my $cust_credit_bill (@cust_credit_bill) {
+ my $cust_credit = $cust_credit_bill->cust_credit;
+ my($date, $invnum, $crednum, $amount, $reason, $app_date ) = (
+ $cust_credit->_date,
+ $cust_credit_bill->invnum,
+ $cust_credit_bill->crednum,
+ $cust_credit_bill->amount,
+ $cust_credit->reason,
+ time2str("%D", $cust_credit_bill->_date),
+ );
+ push @history,
+ "$date\tCredit #$crednum: $reason<BR>".
+ "(applied to invoice #$invnum on $app_date)\t\t\t$amount\t";
+ }
+ }
+
+ my @credits = grep { scalar(my @array = $_->cust_credit_refund) }
+ qsearch('cust_credit',{'custnum'=>$custnum});
+ foreach my $credit (@credits) {
+ my($cref)=$credit->hashref;
+ my(@cust_credit_refund)=
+ qsearch('cust_credit_refund', { 'crednum'=> $cref->{crednum} } );
+ foreach my $cust_credit_refund (@cust_credit_refund) {
+ my $cust_refund = $cust_credit_refund->cust_credit;
+ my($date, $crednum, $amount, $reason, $app_date ) = (
+ $credit->_date,
+ $credit->crednum,
+ $cust_credit_refund->amount,
+ $credit->reason,
+ time2str("%D", $cust_credit_refund->_date),
+ );
+ push @history,
+ "$date\tCredit #$crednum: $reason<BR>".
+ "(applied to refund on $app_date)\t\t\t$amount\t";
+ }
+ }
+
+ @credits = grep { $_->credited > 0 }
+ qsearch('cust_credit',{'custnum'=>$custnum});
+ foreach my $credit (@credits) {
+ my($cref)=$credit->hashref;
+ push @history,
+ $cref->{_date} . "\t" .
+ qq!<A HREF="! . popurl(2). qq!edit/cust_credit_bill.cgi?!. $cref->{crednum} . qq!">!.
+ '<b><font size="+1" color="#ff0000">Unapplied credit #' .
+ $cref->{crednum} . "</font></b></A>: ".
+ $cref->{reason} . "\t\t\t" . $credit->credited . "\t";
+ }
+
+ my(@refunds)=qsearch('cust_refund',{'custnum'=> $custnum } );
+ foreach my $refund (@refunds) {
+ my($rref)=$refund->hashref;
+ my($refundnum) = (
+ $refund->refundnum,
+ );
+
+ push @history,
+ $rref->{_date} . "\tRefund #$refundnum, (" .
+ $rref->{payby} . " " . $rref->{payinfo} . ") by " .
+ $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" .
+ $rref->{refund};
+ }
+
+ my @unapplied_payments =
+ grep { $_->unapplied > 0 } qsearch('cust_pay', { 'custnum' => $custnum } );
+ foreach my $payment (@unapplied_payments) {
+ my $payby = $payment->payby;
+ my $payinfo = $payment->payinfo;
+ #false laziness w/above
+ $payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4))
+ if $payby eq 'CARD';
+ my $target = "$payby$payinfo";
+ $payby =~ s/^BILL$/Check #/ if $payinfo;
+ $payby =~ s/^(CARD|COMP)$/$1 /;
+ my $delete = $payment->closed !~ /^Y/i && $conf->exists('deletepayments')
+ ? qq! (<A HREF="javascript:cust_pay_areyousure('${p}misc/delete-cust_pay.cgi?!. $payment->paynum. qq!')">delete</A>)!
+ : '';
+ push @history,
+ $payment->_date. "\t".
+ '<b><font size="+1" color="#ff0000">Unapplied payment #' .
+ $payment->paynum . " ($payby$payinfo)</font></b> ".
+ '(<A HREF="'. popurl(2). 'edit/cust_bill_pay.cgi?'. $payment->paynum. '">'.
+ "apply</A>)$delete".
+ "\t\t" . $payment->unapplied . "\t\t\t$target";
+ }
+
+ #formatting
+ print &table(), <<END;
+ <TR>
+ <TH>Date</TH>
+ <TH>Description</TH>
+ <TH><FONT SIZE=-1>Charge</FONT></TH>
+ <TH><FONT SIZE=-1>Payment</FONT></TH>
+ <TH><FONT SIZE=-1>In-house<BR>Credit</FONT></TH>
+ <TH><FONT SIZE=-1>Refund</FONT></TH>
+ <TH><FONT SIZE=-1>Balance</FONT></TH>
+ </TR>
+END
+
+ #display payment history
+
+ my $balance = 0;
+ foreach my $item (sort keyfield_numerically @history) {
+ my($date,$desc,$charge,$payment,$credit,$refund,$target)=split(/\t/,$item);
+ $charge ||= 0;
+ $payment ||= 0;
+ $credit ||= 0;
+ $refund ||= 0;
+ $balance += $charge - $payment;
+ $balance -= $credit - $refund;
+ $balance = sprintf("%.2f", $balance);
+ $balance =~ s/^\-0\.00$/0.00/; #yay ieee fp
+ $target = '' unless defined $target;
+
+ print "<TR><TD><FONT SIZE=-1>";
+ print qq!<A NAME="$target">! unless $target && $target{$target}++;
+ print time2str("%D",$date);
+ print '</A>' if $target && $target{$target} == 1;
+ print "</FONT></TD>",
+ "<TD><FONT SIZE=-1>$desc</FONT></TD>",
+ "<TD><FONT SIZE=-1>",
+ ( $charge ? "\$".sprintf("%.2f",$charge) : '' ),
+ "</FONT></TD>",
+ "<TD><FONT SIZE=-1>",
+ ( $payment ? "-&nbsp;\$".sprintf("%.2f",$payment) : '' ),
+ "</FONT></TD>",
+ "<TD><FONT SIZE=-1>",
+ ( $credit ? "-&nbsp;\$".sprintf("%.2f",$credit) : '' ),
+ "</FONT></TD>",
+ "<TD><FONT SIZE=-1>",
+ ( $refund ? "\$".sprintf("%.2f",$refund) : '' ),
+ "</FONT></TD>",
+ "<TD><FONT SIZE=-1>\$" . $balance,
+ "</FONT></TD>",
+ "\n";
+ }
+
+ print "</TABLE>";
+
+}
+
+print '</BODY></HTML>';
+
+#subroutiens
+sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0]; }
+
+%>
+
+<%
+
+
+sub get_packages {
+
+my $cust_main = shift or return undef;
+
+my @packages = ();
+
+foreach my $cust_pkg (($conf->exists('hidecancelledpackages') ? ($cust_main->ncancelled_pkgs)
+ : ($cust_main->all_pkgs))) {
+
+ my $part_pkg = $cust_pkg->part_pkg;
+
+ my %pkg = ();
+ $pkg{pkgnum} = $cust_pkg->pkgnum;
+ $pkg{pkg} = $part_pkg->pkg;
+ $pkg{pkgpart} = $part_pkg->pkgpart;
+ $pkg{comment} = $part_pkg->getfield('comment');
+ $pkg{freq} = $part_pkg->freq;
+ $pkg{setup} = $cust_pkg->getfield('setup');
+ $pkg{last_bill} = $cust_pkg->getfield('last_bill');
+ $pkg{next_bill} = $cust_pkg->getfield('bill');
+ $pkg{susp} = $cust_pkg->getfield('susp');
+ $pkg{expire} = $cust_pkg->getfield('expire');
+ $pkg{cancel} = $cust_pkg->getfield('cancel');
+
+ $pkg{svcparts} = [];
+
+ foreach my $pkg_svc (qsearch('pkg_svc', { 'pkgpart' => $part_pkg->pkgpart })) {
+
+ next if ($pkg_svc->quantity == 0);
+
+ my $part_svc = qsearchs('part_svc', { 'svcpart' => $pkg_svc->svcpart });
+
+ my $svcpart = {};
+ $svcpart->{svcpart} = $part_svc->svcpart;
+ $svcpart->{svc} = $part_svc->svc;
+ $svcpart->{svcdb} = $part_svc->svcdb;
+ $svcpart->{quantity} = $pkg_svc->quantity;
+ $svcpart->{count} = 0;
+
+ $svcpart->{services} = [];
+
+ foreach my $cust_svc (qsearch('cust_svc', { 'pkgnum' => $cust_pkg->pkgnum,
+ 'svcpart' => $part_svc->svcpart } )) {
+
+ my $svc = {};
+ $svc->{svcnum} = $cust_svc->svcnum;
+ $svc->{label} = ($cust_svc->label)[1];
+
+ push @{$svcpart->{services}}, $svc;
+
+ $svcpart->{count}++;
+
+ }
+
+ push @{$pkg{svcparts}}, $svcpart;
+
+ }
+
+ push @packages, \%pkg;
+
+}
+
+return \@packages;
+
+}
+
+sub svc_link {
+
+ my ($svcpart, $svc) = (shift,shift) or return '';
+ return qq!<A HREF="${p}view/$svcpart->{svcdb}.cgi?$svc->{svcnum}">$svcpart->{svc}</A>!;
+
+}
+
+sub svc_label_link {
+
+ my ($svcpart, $svc) = (shift,shift) or return '';
+ return qq!<A HREF="${p}view/$svcpart->{svcdb}.cgi?$svc->{svcnum}">$svc->{label}</A>!;
+
+}
+
+sub svc_provision_link {
+ my ($pkg, $svcpart) = (shift,shift) or return '';
+ ( my $svc_nbsp = $svcpart->{svc} ) =~ s/\s+/&nbsp;/g;
+ return qq!<A CLASS="provision" HREF="${p}edit/$svcpart->{svcdb}.cgi?! .
+ qq!pkgnum$pkg->{pkgnum}-svcpart$svcpart->{svcpart}">! .
+ "Provision&nbsp;$svc_nbsp&nbsp;(".
+ ($svcpart->{quantity} - $svcpart->{count}).
+ ')</A>';
+}
+
+sub svc_unprovision_link {
+ my $svc = shift or return '';
+ return qq!<A HREF="javascript:svc_areyousure('${p}misc/unprovision.cgi?$svc->{svcnum}')">Unprovision</A>!;
+}
+
+# This should be generalized to use config options to determine order.
+sub pkgsort_pkgnum_cancel {
+ if ($a->{cancel} and $b->{cancel}) {
+ return ($a->{pkgnum} <=> $b->{pkgnum});
+ } elsif ($a->{cancel} or $b->{cancel}) {
+ return (-1) if ($b->{cancel});
+ return (1) if ($a->{cancel});
+ return (0);
+ } else {
+ return($a->{pkgnum} <=> $b->{pkgnum});
+ }
+}
+
+sub pkg_datestr {
+ my($pkg, $field) = @_ or return '';
+ return '&nbsp;' unless $pkg->{$field};
+ my $format = $conf->exists('pkg_showtimes')
+ ? '<B>%D</B>&nbsp;<FONT SIZE=-3>%l:%M:%S%P&nbsp;%z</FONT>'
+ : '<B>%b&nbsp;%o,&nbsp;%Y</B>';
+ ( my $strip = time2str($format, $pkg->{$field}) ) =~ s/ (\d)/$1/g;
+ $strip;
+}
+
+sub pkg_details_link {
+ my $pkg = shift or return '';
+ return qq!<a href="${p}view/cust_pkg.cgi?$pkg->{pkgnum}">Details</a>!;
+}
+
+sub pkg_change_link {
+ my $pkg = shift or return '';
+ return qq!<a href="${p}misc/change_pkg.cgi?$pkg->{pkgnum}">Change&nbsp;package</a>!;
+}
+
+sub pkg_suspend_link {
+ my $pkg = shift or return '';
+ return qq!<a href="${p}misc/susp_pkg.cgi?$pkg->{pkgnum}">Suspend</a>!;
+}
+
+sub pkg_unsuspend_link {
+ my $pkg = shift or return '';
+ return qq!<a href="${p}misc/unsusp_pkg.cgi?$pkg->{pkgnum}">Unsuspend</a>!;
+}
+
+sub pkg_cancel_link {
+ my $pkg = shift or return '';
+ return qq!<A HREF="javascript:cust_pkg_areyousure('${p}misc/cancel_pkg.cgi?$pkg->{pkgnum}')">Cancel</A>!;
+}
+
+sub pkg_dates_link {
+ my $pkg = shift or return '';
+ return qq!<A HREF="${p}edit/REAL_cust_pkg.cgi?$pkg->{pkgnum}">Edit&nbsp;dates</A>!;
+}
+
+sub pkg_customize_link {
+ my $pkg = shift or return '';
+ return qq!<A HREF="${p}edit/part_pkg.cgi?keywords=$custnum;clone=$pkg->{pkgpart};pkgnum=$pkg->{pkgnum}">Customize</A>!;
+}
+
+%>
+
diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi
new file mode 100755
index 000000000..5f0e6bffc
--- /dev/null
+++ b/httemplate/view/cust_pkg.cgi
@@ -0,0 +1,164 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my %uiview = ();
+my %uiadd = ();
+foreach my $part_svc ( qsearch('part_svc',{}) ) {
+ $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
+ $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
+}
+
+my ($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $pkgnum = $1;
+
+#get package record
+my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+die "No package!" unless $cust_pkg;
+my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
+
+my $custnum = $cust_pkg->getfield('custnum');
+print header('Package View', menubar(
+ "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
+ 'Main Menu' => popurl(2)
+));
+
+#print info
+my ($susp,$cancel,$expire)=(
+ $cust_pkg->getfield('susp'),
+ $cust_pkg->getfield('cancel'),
+ $cust_pkg->getfield('expire'),
+);
+my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
+my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
+my $otaker = $cust_pkg->getfield('otaker');
+
+print <<END;
+<SCRIPT>
+function areyousure(href) {
+ if (confirm("Permanently delete included services and cancel this package?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+END
+
+print "Package information";
+print ' (<A HREF="'. popurl(2). 'misc/unsusp_pkg.cgi?'. $pkgnum.
+ '">unsuspend</A>)'
+ if ( $susp && ! $cancel );
+
+print ' (<A HREF="'. popurl(2). 'misc/susp_pkg.cgi?'. $pkgnum.
+ '">suspend</A>)'
+ unless ( $susp || $cancel );
+
+print ' (<A HREF="javascript:areyousure(\''. popurl(2). 'misc/cancel_pkg.cgi?'.
+ $pkgnum. '\')">cancel</A>)'
+ unless $cancel;
+
+print ' (<A HREF="'. popurl(2). 'edit/REAL_cust_pkg.cgi?'. $pkgnum.
+ '">edit dates</A>)';
+
+print &ntable("#cccccc"), '<TR><TD>', &ntable("#cccccc",2),
+ '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
+ $pkgnum, '</TD></TR>',
+ '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
+ $pkg, '</TD></TR>',
+ '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
+ $comment, '</TD></TR>',
+ '<TR><TD ALIGN="right">Setup date</TD><TD BGCOLOR="#ffffff">',
+ ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '</TD></TR>';
+
+print '<TR><TD ALIGN="right">Last bill date</TD><TD BGCOLOR="#ffffff">',
+ ( $cust_pkg->get('last_bill') ? time2str("%D",$cust_pkg->get('last_bill')) : "&nbsp;" ),
+ '</TD></TR>'
+ if $cust_pkg->dbdef_table->column('last_bill');
+
+print '<TR><TD ALIGN="right">Next bill date</TD><TD BGCOLOR="#ffffff">',
+ ( $bill ? time2str("%D",$bill) : "&nbsp;" ), '</TD></TR>';
+
+print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
+ time2str("%D",$susp), '</TD></TR>' if $susp;
+print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
+ time2str("%D",$expire), '</TD></TR>' if $expire;
+print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
+ time2str("%D",$cancel), '</TD></TR>' if $cancel;
+print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
+ $otaker, '</TD></TR>',
+ '</TABLE></TD></TR></TABLE>';
+
+unless ($expire) {
+ print <<END;
+<FORM ACTION="../misc/expire_pkg.cgi" METHOD="post">
+<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
+Expire (date): <INPUT TYPE="text" NAME="date" VALUE="" >
+<INPUT TYPE="submit" VALUE="Cancel later">
+END
+}
+
+unless ($cancel) {
+
+ #services
+ print '<BR>Service Information', &table();
+
+ #list of services this pkgpart includes
+ my $pkg_svc;
+ my %pkg_svc = ();
+ foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
+ $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
+ }
+
+ #list of records from cust_svc
+ my $svcpart;
+ foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) {
+
+ my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc');
+
+ my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum,
+ 'svcpart'=>$svcpart,
+ });
+
+ my($enum);
+ for $enum ( 1 .. $pkg_svc{$svcpart} ) {
+
+ my($cust_svc);
+ if ( $cust_svc=shift @cust_svc ) {
+ my($svcnum)=$cust_svc->svcnum;
+ my($label, $value, $svcdb) = $cust_svc->label;
+ print <<END;
+<TR><TD><A HREF="$uiview{$svcpart}?$svcnum">(View/Edit) $svc: $value<A></TD></TR>
+END
+ } else {
+ print qq!<TR><TD>!.
+ qq!<A HREF="$uiadd{$svcpart}?pkgnum$pkgnum-svcpart$svcpart">!.
+ qq!(Provision) $svc</A>!;
+
+ print qq! or <A HREF="../misc/link.cgi?pkgnum$pkgnum-svcpart$svcpart">!.
+ qq!(Link to legacy) $svc</A>!
+ if $conf->exists('legacy_link');
+
+ print '</TD></TR>';
+ }
+
+ }
+ warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;;
+ }
+
+ print "</TABLE><FONT SIZE=-1>",
+ "Choose (View/Edit) to view or edit an existing service<BR>",
+ "Choose (Provision) to setup a new service<BR>";
+
+ print "Choose (Link to legacy) to link to a legacy (pre-Freeside) service"
+ if $conf->exists('legacy_link');
+
+ print "</FONT>";
+}
+
+#formatting
+print <<END;
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi
new file mode 100755
index 000000000..599c1d8b9
--- /dev/null
+++ b/httemplate/view/svc_acct.cgi
@@ -0,0 +1,203 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
+die "Unknown svcnum" unless $svc_acct;
+
+#false laziness w/all svc_*.cgi
+my $cust_svc = qsearchs( 'cust_svc' , { 'svcnum' => $svcnum } );
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
+ $custnum = $cust_pkg->custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+#eofalse
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
+die "Unknown svcpart" unless $part_svc;
+
+my $domain;
+if ( $svc_acct->domsvc ) {
+ my $svc_domain = qsearchs('svc_domain', { 'svcnum' => $svc_acct->domsvc } );
+ die "Unknown domain" unless $svc_domain;
+ $domain = $svc_domain->domain;
+} else {
+ die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc;
+}
+
+%>
+
+<SCRIPT>
+function areyousure(href) {
+ if (confirm("Permanently delete this account?") == true)
+ window.location.href = href;
+}
+</SCRIPT>
+
+<%= header('Account View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) account" =>
+ "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" )
+ ),
+ "Main menu" => $p,
+)) %>
+
+<%
+
+#if ( $cust_pkg && $cust_pkg->part_pkg->plan eq 'sqlradacct_hour' ) {
+if ( $part_svc->part_export('sqlradius') ) {
+
+ my $last_bill;
+ my %plandata;
+ if ( $cust_pkg ) {
+ #false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
+ #belong in plan data
+ %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
+ split("\n", $cust_pkg->part_pkg->plandata );
+
+ $last_bill = $cust_pkg->last_bill;
+ } else {
+ $last_bill = 0;
+ %plandata = ();
+ }
+
+ my $seconds = $svc_acct->seconds_since_sqlradacct( $last_bill, time );
+ my $h = int($seconds/3600);
+ my $m = int( ($seconds%3600) / 60 );
+ my $s = $seconds%60;
+
+ my $input = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'AcctInputOctets'
+ ) / 1048576;
+ my $output = $svc_acct->attribute_since_sqlradacct(
+ $last_bill, time, 'AcctOutputOctets'
+ ) / 1048576;
+
+ if ( $seconds ) {
+ print "Online <B>$h</B>h <B>$m</B>m <B>$s</B>s";
+ } else {
+ print 'Has not logged on';
+ }
+
+ if ( $cust_pkg ) {
+ print ' since last bill ('. time2str("%C", $last_bill). ') - '.
+ $plandata{recur_included_hours}. ' total hours in plan<BR>';
+ } else {
+ print ' (no billing cycle available for unaudited account)<BR>';
+ }
+
+ print 'Input: <B>'. sprintf("%.3f", $input). '</B> megabytes<BR>';
+ print 'Output: <B>'. sprintf("%.3f", $output). '</B> megabytes<BR>';
+
+ print '<BR>';
+
+}
+
+#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
+
+print qq!<A HREF="${p}edit/svc_acct.cgi?$svcnum">Edit this information</A><BR>!.
+ &ntable("#cccccc"). '<TR><TD>'. &ntable("#cccccc",2).
+ "<TR><TD ALIGN=\"right\">Service number</TD>".
+ "<TD BGCOLOR=\"#ffffff\">$svcnum</TD></TR>".
+ "<TR><TD ALIGN=\"right\">Service</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $part_svc->svc. "</TD></TR>".
+ "<TR><TD ALIGN=\"right\">Username</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->username. "</TD></TR>"
+;
+
+print "<TR><TD ALIGN=\"right\">Domain</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $domain, "</TD></TR>";
+
+print "<TR><TD ALIGN=\"right\">Password</TD><TD BGCOLOR=\"#ffffff\">";
+my $password = $svc_acct->_password;
+if ( $password =~ /^\*\w+\* (.*)$/ ) {
+ $password = $1;
+ print "<I>(login disabled)</I> ";
+}
+if ( $conf->exists('showpasswords') ) {
+ print '<PRE>'. encode_entities($password). '</PRE>';
+} else {
+ print "<I>(hidden)</I>";
+}
+print "</TR></TD>";
+$password = '';
+
+if ( $conf->exists('security_phrase') ) {
+ my $sec_phrase = $svc_acct->sec_phrase;
+ print '<TR><TD ALIGN="right">Security phrase</TD><TD BGCOLOR="#ffffff">'.
+ $svc_acct->sec_phrase. '</TD></TR>';
+}
+
+my $svc_acct_pop = $svc_acct->popnum
+ ? qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum})
+ : '';
+print "<TR><TD ALIGN=\"right\">Access number</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct_pop->text. '</TD></TR>'
+ if $svc_acct_pop;
+
+if ($svc_acct->uid ne '') {
+ print "<TR><TD ALIGN=\"right\">Uid</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->uid. "</TD></TR>",
+ "<TR><TD ALIGN=\"right\">Gid</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->gid. "</TD></TR>",
+ "<TR><TD ALIGN=\"right\">GECOS</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->finger. "</TD></TR>",
+ "<TR><TD ALIGN=\"right\">Home directory</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->dir. "</TD></TR>",
+ "<TR><TD ALIGN=\"right\">Shell</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->shell. "</TD></TR>",
+ "<TR><TD ALIGN=\"right\">Quota</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->quota. "</TD></TR>"
+ ;
+} else {
+ print "<TR><TH COLSPAN=2>(No shell account)</TH></TR>";
+}
+
+if ($svc_acct->slipip) {
+ print "<TR><TD ALIGN=\"right\">IP address</TD><TD BGCOLOR=\"#ffffff\">".
+ ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
+ ? "<I>(Dynamic)</I>"
+ : $svc_acct->slipip
+ ). "</TD>";
+ my($attribute);
+ foreach $attribute ( grep /^radius_/, fields('svc_acct') ) {
+ #warn $attribute;
+ $attribute =~ /^radius_(.*)$/;
+ my $pattribute = $FS::raddb::attrib{$1};
+ print "<TR><TD ALIGN=\"right\">Radius (reply) $pattribute</TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute).
+ "</TD></TR>";
+ }
+ foreach $attribute ( grep /^rc_/, fields('svc_acct') ) {
+ #warn $attribute;
+ $attribute =~ /^rc_(.*)$/;
+ my $pattribute = $FS::raddb::attrib{$1};
+ print "<TR><TD ALIGN=\"right\">Radius (check) $pattribute: </TD>".
+ "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute).
+ "</TD></TR>";
+ }
+} else {
+ print "<TR><TH COLSPAN=2>(No SLIP/PPP account)</TH></TR>";
+}
+
+print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
+ join('<BR>', $svc_acct->radius_groups). '</TD></TR>';
+
+print '</TABLE></TD></TR></TABLE><BR><BR>';
+
+print join("\n", $conf->config('svc_acct-notes') ). '<BR><BR>'.
+ joblisting({'svcnum'=>$svcnum}, 1). '</BODY></HTML>';
+
+%>
diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi
new file mode 100644
index 000000000..164b5b22c
--- /dev/null
+++ b/httemplate/view/svc_broadband.cgi
@@ -0,0 +1,91 @@
+<!-- mason kludge -->
+<%
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_broadband = qsearchs( 'svc_broadband', { 'svcnum' => $svcnum } )
+ or die "svc_broadband: Unknown svcnum $svcnum";
+
+#false laziness w/all svc_*.cgi
+my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
+ $custnum = $cust_pkg->custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+#eofalse
+
+my $router = $svc_broadband->addr_block->router;
+
+if (not $router) { die "Could not lookup router for svc_broadband (svcnum $svcnum)" };
+
+my (
+ $routername,
+ $routernum,
+ $speed_down,
+ $speed_up,
+ $ip_addr
+ ) = (
+ $router->getfield('routername'),
+ $router->getfield('routernum'),
+ $svc_broadband->getfield('speed_down'),
+ $svc_broadband->getfield('speed_up'),
+ $svc_broadband->getfield('ip_addr')
+ );
+
+
+
+print header('Broadband Service View', menubar(
+ ( ( $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) website" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+ "Main menu" => $p,
+)).
+ qq!<A HREF="${p}edit/svc_broadband.cgi?$svcnum">Edit this information</A><BR>!.
+ ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
+ qq!<TR><TD ALIGN="right">Service number</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Router</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$routernum: $routername</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Download Speed</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$speed_down</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Upload Speed</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$speed_up</TD></TR>!.
+ qq!<TR><TD ALIGN="right">IP Address</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$ip_addr</TD></TR>!.
+ '</TD></TR><TR ROWSPAN="1"><TD></TD></TR>';
+
+
+# foreach my $sb_field
+# ( qsearch('sb_field', { svcnum => $svcnum }) ) {
+# my $part_sb_field = qsearchs('part_sb_field',
+# { sbfieldpart => $sb_field->sbfieldpart });
+# print q!<TR><TD ALIGN="right">! . $part_sb_field->name .
+# q!</TD><TD BGCOLOR="#ffffff">! . $sb_field->value .
+# q!</TD></TR>!;
+# }
+# print '</TABLE>';
+
+
+ my $sb_field = $svc_broadband->sb_field_hashref;
+ foreach (sort { $a cmp $b } keys(%{$sb_field})) {
+ print q!<TR><TD ALIGN="right">! . $_ .
+ q!</TD><TD BGCOLOR="#ffffff">! . $sb_field->{$_} .
+ q!</TD></TR>!;
+ }
+ print '</TABLE>';
+
+
+print '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+ '</BODY></HTML>'
+;
+%>
diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi
new file mode 100755
index 000000000..fd017de46
--- /dev/null
+++ b/httemplate/view/svc_domain.cgi
@@ -0,0 +1,106 @@
+<!-- mason kludge -->
+<%
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_domain = qsearchs('svc_domain',{'svcnum'=>$svcnum});
+die "Unknown svcnum" unless $svc_domain;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ $custnum=$cust_pkg->getfield('custnum');
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
+die "Unknown svcpart" unless $part_svc;
+
+my $email = '';
+if ($svc_domain->catchall) {
+ my $svc_acct = qsearchs('svc_acct',{'svcnum'=> $svc_domain->catchall } );
+ die "Unknown svcpart" unless $svc_acct;
+ $email = $svc_acct->email;
+}
+
+my $domain = $svc_domain->domain;
+
+%>
+
+<%= header('Domain View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) domain" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+ "Main menu" => $p,
+)) %>
+
+Service #<%= $svcnum %>
+<BR>Service: <B><%= $part_svc->svc %></B>
+<BR>Domain name: <B><%= $domain %></B>
+<BR>Catch all email <A HREF="<%= ${p} %>misc/catchall.cgi?<%= $svcnum %>">(change)</A>:
+<%= $email ? "<B>$email</B>" : "<I>(none)<I>" %>
+<BR><BR><A HREF="http://www.geektools.com/cgi-bin/proxy.cgi?query=<%=$domain%>;targetnic=auto">View whois information.</A>
+<BR><BR>
+<SCRIPT>
+ function areyousure(href) {
+ if ( confirm("Remove this record?") == true )
+ window.location.href = href;
+ }
+</SCRIPT>
+
+<% my @records; if ( @records = $svc_domain->domain_record ) { %>
+ <%= ntable("",2) %>
+ <tr><th>Zone</th><th>Type</th><th>Data</th></tr>
+
+ <% foreach my $domain_record ( @records ) {
+ my $type = $domain_record->rectype eq '_mstr'
+ ? "(slave)"
+ : $domain_record->recaf. ' '. $domain_record->rectype;
+ %>
+
+ <tr><td><%= $domain_record->reczone %></td>
+ <td><%= $type %></td>
+ <td><%= $domain_record->recdata %>
+
+ <% unless ( $domain_record->rectype eq 'SOA' ) { %>
+ (<A HREF="javascript:areyousure('<%=$p%>misc/delete-domain_record.cgi?<%=$domain_record->recnum%>')">delete</A>)
+ <% } %>
+ </td></tr>
+ <% } %>
+ </table>
+<% } %>
+
+<BR>
+<FORM METHOD="POST" ACTION="<%=$p%>edit/process/domain_record.cgi">
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%=$svcnum%>">
+<INPUT TYPE="text" NAME="reczone">
+<INPUT TYPE="hidden" NAME="recaf" VALUE="IN"> IN
+ <SELECT NAME="rectype">
+<% foreach (qw( A NS CNAME MX PTR) ) { %>
+ <OPTION VALUE="<%=$_%>"><%=$_%></OPTION>
+<% } %>
+ </SELECT>
+<INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Add record">
+</FORM><BR><BR>or<BR><BR>
+<FORM METHOD="POST" ACTION="<%=$p%>edit/process/domain_record.cgi">
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%=$svcnum%>">
+
+<% if ( @records ) { %> Delete all records and <% } %>
+Slave from nameserver IP
+<INPUT TYPE="hidden" NAME="svcnum" VALUE="<%=$svcnum%>">
+<INPUT TYPE="hidden" NAME="reczone" VALUE="@">
+<INPUT TYPE="hidden" NAME="recaf" VALUE="IN">
+<INPUT TYPE="hidden" NAME="rectype" VALUE="_mstr">
+<INPUT TYPE="text" NAME="recdata"> <INPUT TYPE="submit" VALUE="Slave domain">
+</FORM>
+<BR><BR><%= joblisting({'svcnum'=>$svcnum}, 1) %>
+</BODY></HTML>
diff --git a/httemplate/view/svc_forward.cgi b/httemplate/view/svc_forward.cgi
new file mode 100755
index 000000000..c8d1d6213
--- /dev/null
+++ b/httemplate/view/svc_forward.cgi
@@ -0,0 +1,69 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_forward = qsearchs('svc_forward',{'svcnum'=>$svcnum});
+die "Unknown svcnum" unless $svc_forward;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ $custnum=$cust_pkg->getfield('custnum');
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
+ or die "Unkonwn svcpart";
+
+print header('Mail Forward View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) account" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+ "Main menu" => $p,
+));
+
+my($srcsvc,$dstsvc,$dst) = (
+ $svc_forward->srcsvc,
+ $svc_forward->dstsvc,
+ $svc_forward->dst,
+);
+my $svc = $part_svc->svc;
+my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$srcsvc})
+ or die "Corrupted database: no svc_acct.svcnum matching srcsvc $srcsvc";
+my $source = $svc_acct->email;
+my $destination;
+if ($dstsvc) {
+ my $svc_acct = qsearchs('svc_acct',{'svcnum'=>$dstsvc})
+ or die "Corrupted database: no svc_acct.svcnum matching dstsvc $dstsvc";
+ $destination = $svc_acct->email;
+}else{
+ $destination = $dst;
+}
+
+print qq!<A HREF="${p}edit/svc_forward.cgi?$svcnum">Edit this information</A>!.
+ ntable("#cccccc",2).
+ '<TR><TD ALIGN="right">Service number</TD>'.
+ qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
+ '<TR><TD ALIGN="right">Service</TD>'.
+ qq!<TD BGCOLOR="#ffffff">$svc</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Email to</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$source</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Forwards to </TD>!.
+ qq!<TD BGCOLOR="#ffffff">$destination</TD></TR></TABLE>!.
+ '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+ '</BODY></HTML>'
+;
+
+%>
diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi
new file mode 100644
index 000000000..442614491
--- /dev/null
+++ b/httemplate/view/svc_www.cgi
@@ -0,0 +1,55 @@
+<!-- mason kludge -->
+<%
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_www = qsearchs( 'svc_www', { 'svcnum' => $svcnum } )
+ or die "svc_www: Unknown svcnum $svcnum";
+
+#false laziness w/all svc_*.cgi
+my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
+ $custnum = $cust_pkg->custnum;
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+#eofalse
+
+my $usersvc = $svc_www->usersvc;
+my $svc_acct = qsearchs('svc_acct', { 'svcnum' => $usersvc } )
+ or die "svc_www: Unknown usersvc $usersvc";
+my $email = $svc_acct->email;
+
+my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } )
+ or die "svc_www: Unknown recnum ". $svc_www->recnum;
+
+my $www = $domain_record->zone;
+
+print header('Website View', menubar(
+ ( ( $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) website" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+ "Main menu" => $p,
+)).
+ qq!<A HREF="${p}edit/svc_www.cgi?$svcnum">Edit this information</A><BR>!.
+ ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
+ qq!<TR><TD ALIGN="right">Service number</TD>!.
+ qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
+ qq!<TR><TD ALIGN="right">Website name</TD>!.
+ qq!<TD BGCOLOR="#ffffff"><A HREF="http://$www">$www<A></TD></TR>!.
+ qq!<TR><TD ALIGN="right">Account</TD>!.
+ qq!<TD BGCOLOR="#ffffff"><A HREF="${p}view/svc_acct.cgi?$usersvc">$email</A></TD></TR>!.
+ '</TABLE></TD></TR></TABLE>'.
+ '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
+ '</BODY></HTML>'
+;
+%>
diff --git a/init.d/freeside-init b/init.d/freeside-init
new file mode 100644
index 000000000..68cba8da3
--- /dev/null
+++ b/init.d/freeside-init
@@ -0,0 +1,70 @@
+#! /bin/sh
+#
+# chkconfig: 345 86 16
+# description: Freeside daemons
+
+QUEUED_USER=%%%QUEUED_USER%%%
+
+FREESIDE_PATH="%%%FREESIDE_PATH%%%"
+
+PASSWD_USER=%%%PASSWD_USER%%%
+PASSWD_MACHINE=%%%PASSWD_MACHINE%%%
+
+SIGNUP_USER=%%%SIGNUP_USER%%%
+SIGNUP_MACHINE=%%%SIGNUP_MACHINE%%%
+SIGNUP_AGENTNUM=%%%SIGNUP_AGENTNUM%%%
+SIGNUP_REFNUM=%%%SIGNUP_REFNUM%%%
+
+SELFSERVICE_USER=%%%SELFSERVICE_USER%%%
+SELFSERVICE_MACHINE=%%%SELFSERVICE_MACHINE%%%
+
+case "$1" in
+ start)
+ # Start daemons.
+ echo -n "Starting freeside-queued: "
+ freeside-queued $QUEUED_USER
+ echo "done."
+
+ echo -n "Starting fs_passwd_server: "
+ su freeside -c "$FREESIDE_PATH/fs_passwd/fs_passwd_server $PASSWD_USER $PASSWD_MACHINE" &
+ echo "done."
+
+ echo -n "Starting fs_signup_server: "
+ su freeside -c "$FREESIDE_PATH/fs_signup/fs_signup_server $SIGNUP_USER $SIGNUP_MACHINE $SIGNUP_AGENTNUM $SIGNUP_REFNUM" &
+ echo "done."
+
+ echo -n "Starting freeside-selfservice-server: "
+ freeside-selfservice-server $SELFSERVICE_USER $SELFSERVICE_MACHINE
+ echo "done."
+
+ ;;
+ stop)
+ # Stop daemons.
+ echo -n "Stopping freeside-queued: "
+ kill `cat /var/run/freeside-queued.pid`
+ echo "done."
+
+ echo -n "Stopping fs_passwd_server: "
+ killall fs_passwd_server
+ echo "done."
+
+ echo -n "Stopping fs_signup_server: "
+ killall fs_signup_server
+ echo "done."
+
+ echo -n "Stopping freeside-selfservice-server: "
+ kill `cat /var/run/freeside-selfservice-server.pid`
+ echo "done."
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: freeside {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
+
diff --git a/install/freebsd/INSTALL b/install/freebsd/INSTALL
new file mode 100755
index 000000000..53fc613d1
--- /dev/null
+++ b/install/freebsd/INSTALL
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+( cd /usr/ports/sysutils/portupgrade
+ make install
+)
+
+pkgdb -u
+
+portinstall -PR cvsup-without-gui
+
+cp /usr/share/examples/cvsup/ports-supfile /root
+perl -pi -e 's/CHANGE_THIS/cvsup1/;' /root/ports-supfile
+cvsup /root/ports-supfile
+
+for port in `grep -v '^ *#' ports`; do
+ #cd /usr/ports/$port
+ #make install || exit
+ portinstall -P -R $port || exit
+done
+
+for a in Net::SSH DBIx::DBSchema HTML::Widgets::SelectLayers Time::Duration Business::CreditCard; do perl -MCPAN -e"install $a"; done
+
+su -l pgsql -c initdb
+
+/usr/local/etc/rc.d/010.pgsql.sh start
+
+pw user add freeside -m
+
+su -l pgsql -c 'createuser -P freeside'
+
+su -l freeside -c 'createdb freeside'
+
+#?
+cd ../..
+make install-perl-modules
+make create-config
+make deploy
+
+#edit apache config, etc.
+
diff --git a/install/freebsd/ports b/install/freebsd/ports
new file mode 100644
index 000000000..1e04a424d
--- /dev/null
+++ b/install/freebsd/ports
@@ -0,0 +1,43 @@
+shells/zsh
+misc/screen
+ftp/lftp
+www/apache13-modssl
+www/mod_perl
+net/rsync
+databases/postgresql7
+misc/p5-Array-PrintCols
+devel/p5-Term-Query
+converters/p5-MIME-Base64
+security/p5-Digest-MD5
+security/p5-MD5
+net/p5-URI
+www/p5-HTML-Tagset
+www/p5-HTML-Parser
+net/p5-Net
+misc/p5-Locale-Codes
+net/p5-Net-Whois
+www/p5-libwww
+ #misc/p5-Business-CreditCard
+devel/p5-Data-ShowTable
+mail/p5-Mail-Tools
+devel/p5-TimeDate
+devel/p5-Date-Manip
+misc/p5-File-CounterFile
+devel/p5-FreezeThaw
+devel/p5-String-Approx
+textproc/p5-Text-Template
+databases/p5-DBI
+databases/p5-DBD-Pg
+#databases/p5-DBD-mysql
+databases/p5-DBIx-DataSource
+ #database/p5-DBIx-DBSchema
+ #net/p5-Net-SSH
+textproc/p5-String-ShellQuote
+net/p5-Net-SCP
+www/p5-Apache-ASP
+ #www/p5-HTML-Mason
+devel/p5-Tie-IxHash
+ #devel/p5-Time-Duration
+ #www/p5-HTML-Widgets-SelectLayers
+devel/p5-Storable
+www/p5-Apache-DBI
diff --git a/install/redhat/7.3/INSTALL b/install/redhat/7.3/INSTALL
new file mode 100644
index 000000000..4c07f88e8
--- /dev/null
+++ b/install/redhat/7.3/INSTALL
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+wget ftp://apt-rpm.tuxfamily.org/apt/redhat/7.3/en/i386/RPMS.extra/apt-*i386.rpm
+rpm -i apt*i386.rpm
+cp sources.list /etc/apt/
+apt-get update; apt-get update
+apt-get install apache mod_ssl mod_perl perl-CGI perl-CPAN perl-DBD-MySQL perl-DBD-Pg perl-DBI perl-DateManip perl-Digest-MD5 perl-HTML-Parser perl-HTML-Tagset perl-MIME-Base64 perl-Storable perl-TimeDate perl-URI perl-libnet perl-libwww-perl perl-suidperl rsync postgresql postgresql-docs postgresql-libs postgresql-server screen zsh lftp cvs #openssh
+
+perl -MCPAN -e"install Locale::Country, Net::Whois, Business::CreditCard, \
+ Mail::Internet, File::CounterFile, FreezeThaw, \
+ String::Approx, Text::Template, DBIx::DataSource, \
+ DBIx::DBSchema, Net::SSH, String::ShellQuote, \
+ Net::SCP, Apache::ASP, Tie::IxHash, Time::Duration, \
+ HTML::Widgets::SelectLayers, Apache::DBI"
diff --git a/install/redhat/7.3/sources.list b/install/redhat/7.3/sources.list
new file mode 100644
index 000000000..9a9ad5cdf
--- /dev/null
+++ b/install/redhat/7.3/sources.list
@@ -0,0 +1,2 @@
+rpm ftp://apt-rpm.tuxfamily.org/apt redhat/7.3/en/i386 os updates extra
+rpm-src ftp://apt-rpm.tuxfamily.org/apt redhat/7.3/en/i386 os updates extra
diff --git a/rt/ChangeLog b/rt/ChangeLog
new file mode 100644
index 000000000..549a5cac7
--- /dev/null
+++ b/rt/ChangeLog
@@ -0,0 +1,16016 @@
+2002-07-19 22:47 jesse
+
+ * README:
+
+ Fixed the readme about fastcgi
+
+2002-07-19 22:42 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.14
+
+2002-07-19 01:22 jesse
+
+ * Makefile, bin/rt, webrt/Search/Bulk.html:
+
+ RT-Ticket: 1547
+
+ Bumping the version to 2.0.14-pre4
+ Fixing a typo that pdh caught in Tickets/Bulk.html
+
+2002-07-13 00:22 jesse
+
+ * Makefile:
+
+ Bumped to 2.0.14-pre3
+
+2002-07-13 00:19 jesse
+
+ * bin/webmux.pl:
+
+ modperl handler now speaks Mason 1.11 properly.
+
+2002-07-13 00:00 jesse
+
+ * etc/config.pm:
+
+ Shifted some config defaults to make things easier for newbie users
+
+2002-07-12 13:31 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Now we properly strip long pathnames from attachments uploaded from windows boxes.
+
+2002-07-11 01:41 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Fixing a typo in the mason 11 handler
+
+2002-07-10 14:41 jesse
+
+ * Makefile:
+
+ Bumping the version to 2.0.14-pre2
+
+2002-07-10 14:36 jesse
+
+ * lib/RT/User.pm:
+
+ [no log message]
+
+2002-07-10 14:35 jesse
+
+ * lib/RT/: Queue.pm, Ticket.pm:
+
+ RT-Ticket: 1418
+ RT-Status: resolved
+
+ minor perldoc cleanups from pdh@snapgear
+
+2002-07-10 14:32 jesse
+
+ * bin/rt-mailgate, lib/RT/Action/SendEmail.pm:
+
+ RT-Ticket: 1425
+ RT-Status: resolved
+ RT-Milestone: 2.0.x
+ RT-Subsystem: Mail Sending
+
+ Fixes to create more proper message ids.
+
+2002-07-10 14:28 jesse
+
+ * lib/RT/Ticket.pm:
+
+ RT-Ticket: 1431
+ RT-Status: resolved
+
+ Importing tickets now lets you set the "Resolved" date
+
+2002-07-10 14:17 jesse
+
+ * lib/RT/Tickets.pm:
+
+ RT-Ticket: 1434
+ RT-Status: resolved
+ RT-Subsystem: Core
+ RT-Milestone: 2.0.x
+
+ RT is now smarter about letting you do "or" searches on single-value
+ keyword selections. Thanks to sam hartman.
+
+2002-07-10 14:15 jesse
+
+ * webrt/Ticket/: Display.html, ModifyAll.html:
+
+ RT-Ticket: 1433
+ RT-Status: resolved
+ RT-Milestone: 2.0.x
+ RT-Subsystem: HTML::Mason frontend
+ RT-Severity: Nice to have
+ RT-Broken In: 2.0.13
+ RT-Broken In: 2.0.12
+ RT-Broken In: 2.0.11
+ RT-Broken In: 2.0.10
+ RT-Broken In: 2.0.0
+ RT-Broken In: 2.0.1
+ RT-Broken In: 2.0.2
+ RT-Broken In: 2.0.3
+ RT-Broken In: 2.0.4
+ RT-Broken In: 2.0.5
+ RT-Broken In: 2.0.6
+ RT-Broken In: 2.0.7
+ RT-Broken In: 2.0.8
+ RT-Broken In: 2.0.9
+
+ Some signatures weren't setting off the "don't record comments if the update
+ is only a signature" code. Fixed.
+
+2002-07-10 13:59 jesse
+
+ * lib/RT/Transaction.pm:
+
+ RT-Ticket: 1501
+ RT-Status: resolved
+
+ Fixing docs in Transaction.pm's Message method
+
+2002-07-10 13:19 jesse
+
+ * bin/rt:
+
+ RT-Ticket: 1528
+ RT-Milestone: 2.0.x
+ RT-Subsystem: CLI
+ RT-Severity: Normal
+ RT-Status: resolved
+
+ Fixed docs for cli to say that --limit-status=dead isn't a valid option
+
+2002-06-26 15:22 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ support for mason 1.1
+
+2002-06-26 15:19 jesse
+
+ * Makefile, bin/mason_handler.fcgi, bin/webmux.pl,
+ webrt/Admin/Queues/GroupRights.html,
+ webrt/Admin/Queues/UserRights.html, webrt/Elements/ListActions,
+ webrt/Ticket/Elements/ShowBasics, webrt/Ticket/Elements/ToolBar:
+
+ Adding support for mason 1.10
+
+2002-06-26 15:15 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ Fixed notify cc behavior
+
+2002-06-26 15:13 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ Fixed pseudo-list syntax in To: lines
+
+2002-06-26 15:09 jesse
+
+ * webrt/Search/Bulk.html:
+
+ Added support for bulk comment/reply
+
+2002-05-03 02:07 jesse
+
+ * lib/RT/Ticket.pm:
+
+ RT-Ticket: 1369
+ RT-Status: resolved
+
+ When a ticket has another merged into it, it now has its "LastUpdated" date
+ updated
+
+2002-05-03 01:58 jesse
+
+ * lib/RT/Ticket.pm:
+
+ RT-Ticket: 1412
+ RT-status: resolved
+
+ Fixed a docs bug in Ticket->Import which didn't make it clear that Import
+ took an "Id" parameter and "Create" didn't.
+
+2002-05-03 01:54 jesse
+
+ * webrt/autohandler:
+
+ rt-ticket: 1410
+ rt-status: resolved
+
+ Applied a patch from rich lafferty which prevented NoAuth from not
+ requiring authentication on some fastcgi setups.
+
+ A similar bug bit SelfService.
+
+ This commit fixes that one too.
+
+2002-05-03 01:51 jesse
+
+ * Makefile:
+
+ RT-Ticket: 1272
+ rt-status: resolved
+
+ Applied a patch from Ilya Martynov which allows make insert to work
+ in a scenario where DESTDIR is being set to something funny This may be necessary when installing into AFS
+
+2002-05-03 01:36 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ RT-Ticket: 1367
+ RT-Status: resolved
+
+ Added a check which only sets precedence to bulk if it's not already set,
+ say by a template.
+
+2002-05-03 01:30 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ RT-Ticket: 1370
+ RT-Status: resolved
+
+ From: Jason Edgecombe <jedgecombe@carolina.rr.com>
+ To: rt-devel@lists.fsck.com
+ Subject: [rt-devel] An oversite in Interface/Email.pm
+
+ Hi,
+
+ I found an problem in Interface/Email.pm when I was modifying
+ enhanced mailgate. I have attached a diff of the modifications.
+
+ In the function MailError, it assumes MIMIEOBJ is defined. I added a
+ simple "if" test to only run $MIMEOBJ->sync_headers if $MIMEOBJ is defined.
+
+2002-05-03 01:24 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ RT-Ticket: 1348
+ RT-Status: resolved
+
+ Fixed a bug in mail sending that improperly quoted the usernames of users
+ who had " in their names
+
+2002-04-29 00:39 jesse
+
+ * lib/RT.pm:
+
+ Fixed a tiny typo
+
+2002-04-28 23:46 jesse
+
+ * lib/RT.pm:
+
+ Fixed up the rt log messages.
+
+2002-04-21 02:14 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Fixed a couple bugs in setting owners that were only revealed by the poor data
+ validation on rt.cpan.org
+
+2002-04-21 02:06 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fixed a couple bugs in setting owners that were only revealed by the poor data
+ validation on rt.cpan.org
+
+2002-04-19 00:32 jesse
+
+ * Makefile:
+
+ Adding a new Makefile target to ease packaging.
+
+2002-04-18 12:47 jesse
+
+ * lib/RT/GroupMember.pm:
+
+ RT-Ticket: 1385
+ RT-Broken-In: 2.0.0
+ RT-Broken-In: 2.0.1
+ RT-Broken-In: 2.0.2
+ RT-Broken-In: 2.0.3
+ RT-Broken-In: 2.0.4
+ RT-Broken-In: 2.0.5
+ RT-Broken-In: 2.0.6
+ RT-Broken-In: 2.0.7
+ RT-Broken-In: 2.0.8
+ RT-Broken-In: 2.0.9
+ RT-Broken-In: 2.0.10
+ RT-Broken-In: 2.0.11
+ RT-Broken-In: 2.0.12
+ RT-Broken-In: 2.0.13
+ RT-Status: resolved
+
+ GroupMemmber was looking for the "ModifyGroups" right, when it should have
+ been looking for the "AdminGroups" right
+
+2002-04-05 10:24 jesse
+
+ * webrt/Ticket/Update.html:
+
+ RT-Ticket: 1330
+ RT-Status: Resolved
+
+ Fixed an html escaping bug in Ticket/Update.html
+
+2002-03-27 22:59 jesse
+
+ * Makefile, lib/RT/User.pm:
+
+ Fixed a CRITICAL security bug that allowed remote administrative access
+ to RT without a password. (Security advisory to follow)
+
+2002-03-14 16:15 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.12
+
+2002-03-06 18:57 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.12pre6
+
+2002-03-06 18:57 jesse
+
+ * lib/RT/Transaction.pm:
+
+ Added an update that will make dates changed as parts of transaction updates show up in local time
+
+2002-03-06 18:56 jesse
+
+ * webrt/Admin/Queues/Modify.html:
+
+ Added a note to the queue creation screen about defaults.
+
+2002-03-01 01:41 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ This patch fixes a small problem with printing a message.It checks if themessage is true, not if it has length, so a message containing 0 will notbe printed. From Blair Zajac <blair@orcaware.com>
+
+2002-03-01 01:39 jesse
+
+ * bin/rt:
+
+ RT-Ticket:438
+ RT-Status: resolved
+
+ Added brandon's patch to allow searching for tickets by keyword on the commandline
+
+2002-02-28 02:03 jesse
+
+ * bin/rt:
+
+ RT-Ticket: 1258
+ RT-Milestone: 2.0.x
+ RT-Subsystem: CLI
+ RT-Severity: normal
+ RT-Broken in: 2.0-beta3
+ RT-Broken in: 2.0.1
+ RT-Broken in: 2.0.2
+ RT-Broken in: 2.0.3
+ RT-Broken in: 2.0.4
+ RT-Broken in: 2.0.5
+ RT-Broken in: 2.0.6
+ RT-Broken in: 2.0.7
+ RT-Broken in: 2.0.8
+ RT-Broken in: 2.0.9
+ RT-Broken in: 2.0.10
+ RT-Broken in: 2.0.11
+
+ Removed a line that make --limit-priority and --limit-final-priority not
+ work
+
+2002-02-28 01:49 jesse
+
+ * lib/RT/Action/: Autoreply.pm, SendEmail.pm:
+
+ RT-Ticket: 1196
+ RT-Status: resolved
+
+2002-02-28 01:38 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ RT-Ticket: 1246
+ RT-Status: resolved
+
+2002-02-28 01:38 jesse
+
+ * tools/testdeps:
+
+ Added a couple explicit dependencies to testdeps that should have been there
+ forever ago. you'll only run into this if your cpan doesn't do recursive deps.
+
+2002-02-20 20:45 jesse
+
+ * Makefile, lib/RT/Interface/Web.pm, webrt/Admin/Users/index.html,
+ webrt/Ticket/Update.html:
+
+ Bumped the version to 2.0.12-pre5.
+
+ Web: Fixed a typo in user administration that prevented user listing
+
+ Web: fixed recieve to receive in ticket/update
+
+2002-02-19 03:23 jesse
+
+ * lib/RT/Scrips.pm:
+
+ Fixed a typo. (Added a missing ;)
+
+2002-02-19 01:04 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.12pre4
+
+2002-02-18 18:35 jesse
+
+ * lib/RT/Condition/Generic.pm:
+
+ RT-Ticket: 1194
+
+ cleaned up a reference to "ApplicableTypes", a nonexistent parameter to Condition->new
+
+2002-02-18 18:30 jesse
+
+ * webrt/Elements/Login:
+
+ RT-Ticket: 1226
+ RT-Status: resolved
+
+ Added an explicit reset of the content-type to 'text/html' when displaying hte login page
+
+2002-02-18 18:25 jesse
+
+ * webrt/Admin/Users/index.html:
+
+ rt-ticket: 1190
+ rt-status: resolved
+
+ Modified administrative userlist to make it easier to click on users who have no Name attribute defined
+
+2002-02-18 18:18 jesse
+
+ * webrt/: Elements/Header, SelfService/Elements/Header:
+
+ rt-ticket: 1176
+ rt-status: resolved
+
+ Applied tom's patch which hides the preferences link if the user doesn't have the right to "modify self"
+
+2002-02-18 18:14 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ RT-Ticket: 1165
+ RT-Status: resolved
+
+ exporting the ParseAddressFromHeader subroutine so others can play with it
+
+2002-02-18 18:06 jesse
+
+ * webrt/Ticket/Update.html:
+
+ RT-Ticket:1209
+ RT-Milestone: 2.0.x
+ RT-Status: resolved
+
+ Removed a bogus font tag from the Ticket update screen
+
+2002-02-18 18:00 jesse
+
+ * lib/RT/Interface/Web.pm, webrt/Search/Listing.html:
+
+ RT-Ticket: 1243
+ RT-Status: resolved
+ RT-Milestone: 2.0.x
+ RT-Broken-In: 2.0.8
+ RT-Broken-In: 2.0.9
+ RT-Broken-In: 2.0.10
+ RT-Broken-In: 2.0.11
+ RT-Subsystem: HTML::Mason Frontend
+ RT-Severity: Normal
+
+ Switched the web frontend to use an in-core scalar for uploaded attachment content,
+ rather than a tempfile which wasn't getting cleaned up properly
+
+2002-02-18 16:53 jesse
+
+ * webrt/Search/Listing.html:
+
+ RT-Ticket: 1245
+ Rt-status: resolved
+
+ Applied a patch to nuke duplicate restrictions in the webui.
+
+2002-02-18 16:47 jesse
+
+ * webrt/Admin/Groups/Members.html:
+
+ RT-Ticket: 1421
+ RT-Status: resolved
+
+ moved a label inside a loop to make the ui easier to understand
+
+2002-02-18 16:36 jesse
+
+ * etc/config.pm:
+
+ Set Default for UseFriendlyToLines to 0 by default, to deal with users running
+ redhat who have trouble configuring RT.
+
+2002-02-18 16:31 jesse
+
+ * Makefile, lib/RT/Scrip.pm, tools/insertdata:
+
+ Edited insertdata to insert scrips by default, so that users don't need
+ to go through the configuration task themselves.
+
+ Change the Makefile's WEB_GROUP to www by default for redhat and OSX.
+
+ Correced docs for lib/RT/Scrip new() method
+
+2002-02-08 01:23 jesse
+
+ * webrt/SelfService/Display.html:
+
+ cleanup to "last trans" in SelfService
+
+2002-02-08 00:53 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Generalized "Abort" function to allow other non-html error messages with
+ proper handlers
+
+2002-02-08 00:49 jesse
+
+ * etc/: schema.Pg, schema.mysql:
+
+ removed duplicate indices
+
+2002-02-07 16:41 jesse
+
+ * etc/config.pm:
+
+ Added some docs to the config file from Rich Lafferty
+
+2002-02-04 12:37 jesse
+
+ * lib/RT/Template.pm:
+
+ Output template content to core rather than disk when parsing.
+
+2002-01-28 01:01 jesse
+
+ * webrt/Ticket/Elements/ShowHistory:
+
+ closing lasttrans anchor
+
+2002-01-28 00:59 jesse
+
+ * webrt/Ticket/Elements/ShowHistory:
+
+ Closing the #lasttrans anchor
+
+2002-01-28 00:58 jesse
+
+ * lib/RT/Record.pm:
+
+ RT-Ticket: 1156
+
+ Pulling forward the patch for 1156
+
+2002-01-28 00:57 jesse
+
+ * lib/RT/Record.pm:
+
+ RT-Ticket: 1156
+ RT-Status: resolved
+
+2002-01-28 00:47 jesse
+
+ * bin/mason_handler.fcgi:
+
+ Small fix to the fastcgi handler to make attachment display work better,
+ thanks to rich lafferty.
+
+2002-01-28 00:47 jesse
+
+ * etc/config.pm:
+
+ Removed some extraneous slashes from the config file.
+
+2002-01-28 00:46 jesse
+
+ * README:
+
+ Clarified some readme stuff
+
+2002-01-28 00:44 jesse
+
+ * bin/rt-commit-handler:
+
+ Bringing forward a fix to the cvs commit handler to deal with branched
+ version #s.
+
+2002-01-28 00:40 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.1.1
+
+2002-01-28 00:27 jesse
+
+ * etc/RT_Config.pm:
+
+ file RT_Config.pm was initially added on branch rt-2-1.
+
+2002-01-28 00:27 jesse
+
+ * bin/enhanced-mailgate:
+
+ file enhanced-mailgate was initially added on branch rt-2-1.
+
+2002-01-28 00:27 jesse
+
+ * bin/rt-commit-handler:
+
+ file rt-commit-handler was initially added on branch rt-2-1.
+
+2002-01-28 00:27 jesse
+
+ * Makefile, bin/enhanced-mailgate, bin/mason_handler.fcgi, bin/rt,
+ bin/rt-commit-handler, bin/rt-mailgate, bin/rtadmin, bin/webmux.pl,
+ etc/RT_Config.pm, etc/acl.Oracle, etc/acl.Pg, etc/acl.mysql,
+ etc/config.pm, lib/RT.pm, lib/RT/Handle.pm, lib/RT/User.pm,
+ lib/RT/Watcher.pm, lib/RT/Interface/CLI.pm,
+ lib/RT/Interface/Email.pm, tools/cpan2rpm, tools/initdb,
+ tools/insertdata, tools/testdeps:
+
+ First RT 2.1 checkin. don't expect this to run. (though it does here)
+
+2002-01-25 17:37 jesse
+
+ * README:
+
+ Added a warning to the readme that 2.1 is scary and people shouldn't use it
+
+2002-01-25 17:24 jesse
+
+ * Makefile:
+
+ Branching 2.1.0 and incrementing the makefile to 2.1.
+
+ Welcome to the future.
+
+2002-01-24 13:30 jesse
+
+ * lib/RT/Transaction.pm:
+
+ RT-Ticket: 1201
+ RT-Status: resolved
+
+ Better transaction display for "text" and "message" parts.
+
+2002-01-24 13:00 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ RT-Ticket: 1166
+ RT-Status: resolved
+
+ Implemented better URL regexp matching.
+
+2002-01-24 10:39 jesse
+
+ * bin/rt-mailgate:
+
+ Fixed a typo in a debug message in rt-mailgate
+
+2002-01-24 10:34 jesse
+
+ * lib/RT/Template.pm:
+
+ Switched from bogus mime parsing to using MIME::Parser like we should have
+ from the get-go.
+
+ Used perltidy to clean up template.pm before we started working on it.
+
+2002-01-24 10:28 jesse
+
+ * lib/RT/Record.pm:
+
+ Added a check to LoadByCols which causes postgres mode to not try to lookup
+ lc(undef)
+
+2002-01-24 10:23 jesse
+
+ * webrt/NoAuth/webrt.css:
+
+ Added a new style to the stylesheet to support some new reports
+
+2002-01-24 10:21 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ mail gateway now unfolds long headers on parse.
+
+2002-01-11 15:20 jesse
+
+ * Makefile, lib/RT/Transaction.pm:
+
+ RT-Ticket: 950
+
+ Aoolyed the recommended patch to make blank bodies not get
+ mailed in lieu of the real message
+
+2002-01-11 15:00 jesse
+
+ * Makefile, webrt/Ticket/ModifyAll.html:
+
+ Fixed a small bug that broke the "jumbo" page after 2.0.11
+
+2002-01-11 01:17 jesse
+
+ * bin/rt-mailgate:
+
+ Added a new flag to rt-mailgate to enable setting the owner of new tickets based on +extension
+
+2002-01-11 01:13 jesse
+
+ * webrt/Ticket/: Modify.html, ModifyAll.html:
+
+ Adding a couple ACL checks to better deal with moving tickets to queues the user can't see
+
+2002-01-11 01:11 jesse
+
+ * webrt/Admin/Queues/index.html:
+
+ Fixed typo in ACL check that resulted in "Create Queue" being more restrictive than
+ it needed to be
+
+2002-01-10 19:07 jesse
+
+ * webrt/Ticket/Update.html:
+
+ more tweaking
+
+2002-01-10 19:05 jesse
+
+ * webrt/Ticket/Update.html:
+
+ Cleaned up the Ticekt Update ui some
+
+2002-01-10 19:02 jesse
+
+ * lib/RT/: Attachment.pm, Action/Notify.pm, Condition/Generic.pm:
+
+ Cleanups to make Also-Cc and Also-Bcc go
+
+2002-01-10 19:01 jesse
+
+ * lib/RT/Queue.pm:
+
+ Changed a test to work the way that Test::Inline does now
+
+2002-01-10 18:34 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Changes to attachment to provide the header frobbing necessary to send mail to ccs and bccs
+
+2002-01-10 18:32 jesse
+
+ * Makefile, README, lib/RT/Ticket.pm, tools/insertdata,
+ webrt/Ticket/Update.html, lib/RT/Action/Notify.pm:
+
+ Work on "Explicit Cc" and "Explicit Bcc" for a client
+
+2002-01-10 18:27 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ abstracting out a number to a named variable
+
+2002-01-09 02:24 jesse
+
+ * webrt/Admin/: Groups/index.html, Keywords/index.html:
+
+ A couple tiny ui cleanups (removed some object ids from the UI where they were just being clutter
+
+2002-01-02 21:58 jesse
+
+ * Makefile, README, webrt/Elements/Login:
+
+ Bumped some copyright notices to 2002. bumped version to 2.0.11
+
+2001-12-26 14:59 jesse
+
+ * Makefile:
+
+ Bumping version to 2.0.11pre1
+
+2001-12-26 14:51 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Merges were being over-zealous in what they twiddled the effective id of.
+
+ this meant that far too many tickets would show up in ticket listings.
+
+2001-12-24 18:58 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.10
+
+2001-12-19 00:24 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.10pre4
+
+ fix to makefile to genereate changelog for head
+
+2001-12-18 03:58 jesse
+
+ * lib/RT/Tickets.pm:
+
+ The "null search" was finding all tickets in 2.0.10pre3. Fixed in CVS
+
+2001-12-18 03:53 jesse
+
+ * bin/rt:
+
+ fixed typos in bin/rt that stopped --limit-subject --limit-requestors and --limit-body from
+ working
+
+2001-12-17 15:13 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.10-test3
+
+2001-12-17 14:58 jesse
+
+ * lib/RT/User.pm, tools/insertdata, webrt/Admin/Users/Modify.html:
+
+ RT-Ticket: 935
+ RT-Status: resolved
+
+ cleaned up seph's patch. this enabled me to actually really properly support
+ users with no email address, which meant there were a couple other cleanups
+ to go through too.
+
+2001-12-17 14:26 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Some small cleanups to the IsWatcher stuff.
+
+ Added checks to make sure that watchers aren't duplicated to ticket.pm
+
+2001-12-17 13:04 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Fixed an unclosed anchor which caused IE to render ticket listings wrong.
+
+2001-12-14 18:29 jesse
+
+ * lib/Makefile.PL, tools/testdeps:
+
+ Bumped DBIx::SearchBuilder dependency to 0.48
+
+2001-12-14 18:28 jesse
+
+ * tools/testdeps, webrt/Elements/Login:
+
+ Removed code to special case for bugs in mason < 1.01.
+ Moved us up to a mason 1.02 dependency
+
+2001-12-14 18:26 jesse
+
+ * bin/rt:
+
+ bin/rt: added support for --version, fixed --status = !closed, docced --merge-into
+
+2001-12-14 18:25 jesse
+
+ * Makefile:
+
+ Some stylistic cleanups to the makefile from blair.
+
+2001-12-14 16:42 jesse
+
+ * bin/rtadmin:
+
+ rtadmin had some issues where it would assume a 'name' if called without --name for user group and queue editing.
+
+2001-12-14 16:06 jesse
+
+ * lib/RT/Tickets.pm:
+
+
+ Ticket listings will no longer show tickets which have been merged into others.
+
+ -j
+
+2001-12-14 15:27 jesse
+
+ * lib/RT/User.pm:
+
+ Prevent users from futzing with nobody or rt_System, unless you're setting an email address.
+ (Arguably, that's a bug too)
+
+2001-12-14 14:03 jesse
+
+ * lib/RT/: ACE.pm, Group.pm, GroupMember.pm, Keyword.pm,
+ KeywordSelect.pm, Queue.pm, Scrip.pm, Template.pm, Ticket.pm:
+
+ Standardised on "Permission Denied" instead of having some "Permission denied". Thanks simon.
+
+ -j
+
+2001-12-14 13:46 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Reordered the order that Basics actions are committed, so that Queue changes
+ come after other changes, so that users don't move tickets out of a queue before they have a
+ chance to update them.
+
+2001-12-13 02:18 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Addition to Ticket->Import, so you can set owner by name.
+
+ Fix for a bug in Ticket->AddWatcher that would let privileged watchers without
+ email addresses add others as watchers.
+
+2001-12-03 20:13 jesse
+
+ * Makefile, lib/RT/EasySearch.pm, lib/RT/Keyword.pm,
+ lib/RT/Record.pm, lib/RT/Tickets.pm, lib/RT/User.pm:
+
+ more work on making sure that only the things we want are case sensitive
+ (IE name, content email address should always be insensitive. when loading a row by any field other than ID, that should be case-insensitive)
+
+2001-12-03 19:17 jesse
+
+ * Makefile:
+
+ bumped the version to 2.0.10-test1
+
+2001-12-03 19:14 jesse
+
+ * lib/RT/EasySearch.pm:
+
+ We now default to case sensitive searches, rather than case-insensitive ones.
+ (This should speed up Pg a LOT. We'll be adding in case-insensitive searching
+ for the 13 attributes that matter:
+
+ Watcher->Email
+ User->name
+ User->email
+ User->gecos
+ Ticket->Subject
+ Queue->name
+ KeywordSelect->name
+ Keyword->Name
+ ObjectKeyword->Name
+ Attachment->Subject
+ Attachment->Content
+ Attachment->Headers
+
+2001-12-03 19:13 jesse
+
+ * webrt/: Admin/Queues/Modify.html, Admin/Queues/People.html,
+ Elements/GotoTicket:
+
+ Some small UI cleanups from Hakke
+
+2001-11-29 03:50 jesse
+
+ * webrt/: Elements/SelectEqualityOperator, Elements/SelectOwner,
+ Search/PickRestriction:
+
+ SelectOwner now passes a ticket up the line.
+
+ Priority can now have = and != searches
+
+2001-11-29 03:49 jesse
+
+ * tools/insertdata:
+
+ Cleaned up a template to display Ticket subject, if no transaction subject is given.
+
+2001-11-29 03:48 jesse
+
+ * webrt/Ticket/: Update.html, Elements/EditPeople:
+
+ Now pass in ticket Id, so that "owner" can be someone who only has rights to that tikcet.
+
+2001-11-29 03:47 jesse
+
+ * lib/RT/Ticket.pm:
+
+ FinalPriority should never get set to null if a ticket doesn't have the attribute set on create
+
+ Untake's arguments were debognifed
+
+2001-11-29 03:45 jesse
+
+ * webrt/SelfService/Elements/Header:
+
+ "Logout" no longer shows up when using external auth with SelfService
+
+2001-11-29 03:44 jesse
+
+ * bin/rt:
+
+ Fix for setting priority when creating tickets with the cli
+
+2001-11-29 03:42 jesse
+
+ * bin/rt-mailgate:
+
+ Added support for --ticket-id-from-extension to rt-mailgate
+
+2001-11-14 14:28 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.9
+
+2001-11-13 11:33 jesse
+
+ * Makefile, bin/initacls.Pg, bin/rt:
+
+ rt-ticket:1007
+ rt-status: resolved
+
+ initacls.pg no longer has extranious spaces which break variable assignment for port and host.
+
+ Bumped version to 2.0.9pre9
+
+2001-11-12 13:19 jesse
+
+ * Makefile, bin/initacls.Pg:
+
+ Fix for #1007 (Typo in bin/initacls.Pg)
+ Bumped version to 2.0.9pre8
+
+2001-11-09 18:24 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ URL higlighting should now work with mailto: urls
+
+2001-11-09 18:15 jesse
+
+ * Makefile, webrt/Ticket/Elements/ShowTransaction:
+
+ Cleaned up the url highlighting code
+
+ Bumped the version to 2.0.9pre7
+
+2001-11-09 17:27 jesse
+
+ * Makefile:
+
+ Fixing the new taggy stuff
+
+2001-11-09 17:23 jesse
+
+ * Makefile:
+
+ Fixing the new branchy stuff
+
+2001-11-09 17:07 jesse
+
+ * Makefile, bin/rtadmin, etc/config.pm,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Added a bit of doc to etc/config.pm
+
+ Modified ShowTransaction to more properly escape html
+
+ Fixed some of the cli help for rtadmin
+
+ Added support for branch specification to the makefile
+
+2001-11-08 15:15 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ I can commit on the head. really.
+
+2001-11-08 15:06 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Dealing with defined but blank Owner fields
+
+2001-11-06 18:06 jesse
+
+ * tools/cpan2rpm, tools/initdb, tools/insertdata, tools/testdeps,
+ webrt/autohandler, webrt/index.html, webrt/Admin/index.html,
+ webrt/Admin/Elements/CreateQueueCalled,
+ webrt/Admin/Elements/CreateUserCalled,
+ webrt/Admin/Elements/EditUserComments,
+ webrt/Admin/Elements/GrantQueueRightsTo,
+ webrt/Admin/Elements/GroupTabs, webrt/Admin/Elements/Header,
+ webrt/Admin/Elements/ListGlobalKeywordSelects,
+ webrt/Admin/Elements/ListGlobalScrips,
+ webrt/Admin/Elements/ModifyKeyword,
+ webrt/Admin/Elements/ModifyKeywordSelect,
+ webrt/Admin/Elements/ModifyQueue,
+ webrt/Admin/Elements/ModifyTemplate,
+ webrt/Admin/Elements/ModifyUser,
+ webrt/Admin/Elements/QueueRightsForUser,
+ webrt/Admin/Elements/QueueTabs,
+ webrt/Admin/Elements/SelectKeywordSelect,
+ webrt/Admin/Elements/SelectModifyGroup,
+ webrt/Admin/Elements/SelectModifyKeyword,
+ webrt/Admin/Elements/SelectModifyKeywordSelect,
+ webrt/Admin/Elements/SelectModifyQueue,
+ webrt/Admin/Elements/SelectModifyUser,
+ webrt/Admin/Elements/SelectQueueRights,
+ webrt/Admin/Elements/SelectRights,
+ webrt/Admin/Elements/SelectScrip,
+ webrt/Admin/Elements/SelectScripAction,
+ webrt/Admin/Elements/SelectScripCondition,
+ webrt/Admin/Elements/SelectSingleOrMultiple,
+ webrt/Admin/Elements/SelectTemplate,
+ webrt/Admin/Elements/SelectUsers, webrt/Admin/Elements/SystemTabs,
+ webrt/Admin/Elements/Tabs, webrt/Admin/Elements/UserTabs,
+ webrt/Admin/Global/GroupRights.html,
+ webrt/Admin/Global/Keywords.html, webrt/Admin/Global/Scrips.html,
+ webrt/Admin/Global/Template.html,
+ webrt/Admin/Global/Templates.html,
+ webrt/Admin/Global/UserRights.html, webrt/Admin/Global/index.html,
+ webrt/Admin/Groups/Members.html, webrt/Admin/Groups/Modify.html,
+ webrt/Admin/Groups/Rights.html, webrt/Admin/Groups/index.html,
+ webrt/Admin/KeywordSelects/Modify.html,
+ webrt/Admin/KeywordSelects/index.html,
+ webrt/Admin/Keywords/Modify.html, webrt/Admin/Keywords/index.html,
+ webrt/Admin/Queues/Create.html,
+ webrt/Admin/Queues/GroupRights.html,
+ webrt/Admin/Queues/Keywords.html, webrt/Admin/Queues/Modify.html,
+ webrt/Admin/Queues/People.html, webrt/Admin/Queues/Scrips.html,
+ webrt/Admin/Queues/Template.html,
+ webrt/Admin/Queues/Templates.html,
+ webrt/Admin/Queues/UserRights.html, webrt/Admin/Queues/index.html,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/Prefs.html,
+ webrt/Admin/Users/Rights.html, webrt/Admin/Users/index.html,
+ webrt/Elements/Checkbox, webrt/Elements/CreateTicket,
+ webrt/Elements/CustomHomepageHeader, webrt/Elements/Error,
+ webrt/Elements/Footer, webrt/Elements/GotoTicket,
+ webrt/Elements/Header, webrt/Elements/ListActions,
+ webrt/Elements/Login, webrt/Elements/MessageBox,
+ webrt/Elements/MyRequests, webrt/Elements/MyTickets,
+ webrt/Elements/Quicksearch, webrt/Elements/Refresh,
+ webrt/Elements/Section, webrt/Elements/SelectBoolean,
+ webrt/Elements/SelectDate, webrt/Elements/SelectDateRelation,
+ webrt/Elements/SelectDateType, webrt/Elements/SelectKeyword,
+ webrt/Elements/SelectKeywordOptions, webrt/Elements/SelectLinkType,
+ webrt/Elements/SelectMatch, webrt/Elements/SelectNewTicketQueue,
+ webrt/Elements/SelectOwner, webrt/Elements/SelectQueue,
+ webrt/Elements/SelectResultsPerPage,
+ webrt/Elements/SelectSortOrder, webrt/Elements/SelectStatus,
+ webrt/Elements/SelectTicketSortBy, webrt/Elements/SelectUsers,
+ webrt/Elements/SelectWatcherType, webrt/Elements/ShadedBox,
+ webrt/Elements/Submit, webrt/Elements/Tabs,
+ webrt/Elements/TitleBoxEnd, webrt/Elements/TitleBoxStart,
+ webrt/Elements/ViewUser, webrt/Elements/dayMenu,
+ webrt/Elements/monthMenu, webrt/Elements/yearMenu,
+ webrt/NoAuth/Logout.html, webrt/NoAuth/Reminder.html,
+ webrt/NoAuth/webrt.css, webrt/NoAuth/images/rt.jpg,
+ webrt/NoAuth/images/spacer.gif, webrt/Search/Bulk.html,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction,
+ webrt/Search/RestrictSearch.html, webrt/Search/TicketCell,
+ webrt/SelfService/Closed.html, webrt/SelfService/Create.html,
+ webrt/SelfService/Display.html, webrt/SelfService/Error.html,
+ webrt/SelfService/Prefs.html, webrt/SelfService/Update.html,
+ webrt/SelfService/index.html,
+ webrt/SelfService/Attachment/dhandler,
+ webrt/SelfService/Elements/GotoTicket,
+ webrt/SelfService/Elements/Header,
+ webrt/SelfService/Elements/MyRequests,
+ webrt/SelfService/Elements/Tabs, webrt/Ticket/Create.html,
+ webrt/Ticket/Display.html, webrt/Ticket/History.html,
+ webrt/Ticket/Modify.html, webrt/Ticket/ModifyAll.html,
+ webrt/Ticket/ModifyDates.html, webrt/Ticket/ModifyLinks.html,
+ webrt/Ticket/ModifyPeople.html, webrt/Ticket/Update.html,
+ webrt/Ticket/Attachment/dhandler,
+ webrt/Ticket/Elements/AddWatchers,
+ webrt/Ticket/Elements/EditBasics, webrt/Ticket/Elements/EditDates,
+ webrt/Ticket/Elements/EditKeywordSelects,
+ webrt/Ticket/Elements/EditLinks, webrt/Ticket/Elements/EditPeople,
+ webrt/Ticket/Elements/EditWatchers,
+ webrt/Ticket/Elements/ShowBasics, webrt/Ticket/Elements/ShowDates,
+ webrt/Ticket/Elements/ShowDependencies,
+ webrt/Ticket/Elements/ShowHistory,
+ webrt/Ticket/Elements/ShowKeywordSelects,
+ webrt/Ticket/Elements/ShowLinks,
+ webrt/Ticket/Elements/ShowMemberOf,
+ webrt/Ticket/Elements/ShowMembers,
+ webrt/Ticket/Elements/ShowPeople,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowRequestor,
+ webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction, webrt/Ticket/Elements/Tabs,
+ webrt/Ticket/Elements/ToolBar, webrt/User/Prefs.html:
+
+ Merging rt-1-1 to the head.
+
+ RT 1.0 now lives on the rt-1-0 branch.
+
+2001-11-06 18:03 jesse
+
+ * Makefile, NEWS, README, TODO, bin/initacls.Oracle,
+ bin/initacls.Pg, bin/initacls.mysql, bin/mason_handler.fcgi,
+ bin/mason_handler.scgi, bin/rt, bin/rt-mailgate, bin/rtadmin,
+ bin/rtmux.pl, bin/testdeps.pl, bin/webmux.pl, docs/FAQ,
+ docs/FAQ.html, docs/README.docs, docs/Security,
+ docs/rt-templates.html, docs/rt_users_guide.html,
+ docs/design_docs/CARS, docs/design_docs/TransactionTypes.txt,
+ docs/design_docs/acls, docs/design_docs/basic-definitions.txt,
+ docs/design_docs/cli_spec, docs/design_docs/cvs_integration,
+ docs/design_docs/evil_plans, docs/design_docs/link-definitions.txt,
+ docs/design_docs/local_hacking,
+ docs/design_docs/subscription-definitions.txt,
+ docs/design_docs/users, etc/acl.Oracle, etc/acl.Pg, etc/acl.mysql,
+ etc/config.pm, etc/mysql.acl, etc/rt.spec, etc/schema,
+ etc/schema.Oracle, etc/schema.Pg, etc/schema.mysql, etc/schema.pm,
+ etc/suidrt.c, lib/MANIFEST, lib/MANIFEST.SKIP, lib/Makefile.PL,
+ lib/RT.pm, lib/test.pl, lib/RT/ACE.pm, lib/RT/ACL.pm,
+ lib/RT/Attachment.pm, lib/RT/Attachments.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Date.pm, lib/RT/EasySearch.pm, lib/RT/Group.pm,
+ lib/RT/GroupMember.pm, lib/RT/GroupMembers.pm, lib/RT/Groups.pm,
+ lib/RT/Handle.pm, lib/RT/Keyword.pm, lib/RT/KeywordSelect.pm,
+ lib/RT/KeywordSelects.pm, lib/RT/Keywords.pm, lib/RT/Link.pm,
+ lib/RT/Links.pm, lib/RT/ObjectKeyword.pm, lib/RT/ObjectKeywords.pm,
+ lib/RT/Queue.pm, lib/RT/Queues.pm, lib/RT/Record.pm,
+ lib/RT/Scrip.pm, lib/RT/ScripAction.pm, lib/RT/ScripActions.pm,
+ lib/RT/ScripCondition.pm, lib/RT/ScripConditions.pm,
+ lib/RT/Scrips.pm, lib/RT/Template.pm, lib/RT/Templates.pm,
+ lib/RT/TestHarness.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm,
+ lib/RT/Transaction.pm, lib/RT/Transactions.pm, lib/RT/User.pm,
+ lib/RT/Users.pm, lib/RT/Watcher.pm, lib/RT/Watchers.pm,
+ lib/RT/Action/Autoreply.pm, lib/RT/Action/Generic.pm,
+ lib/RT/Action/Notify.pm, lib/RT/Action/NotifyAsComment.pm,
+ lib/RT/Action/OpenDependent.pm, lib/RT/Action/README.hackers,
+ lib/RT/Action/ResolveMembers.pm, lib/RT/Action/SendEmail.pm,
+ lib/RT/Action/SendPasswordEmail.pm,
+ lib/RT/Action/StallDependent.pm,
+ lib/RT/Condition/AnyTransaction.pm, lib/RT/Condition/Generic.pm,
+ lib/RT/Condition/NewDependency.pm,
+ lib/RT/Condition/StatusChange.pm, lib/RT/Interface/CLI.pm,
+ lib/RT/Interface/Email.pm, lib/RT/Interface/Web.pm:
+
+ Merging rt-1-1 to the head.
+
+ RT 1.0 now lives on the rt-1-0 branch.
+
+2001-11-06 17:57 jesse
+
+ * rt.spec, etc/rt.spec:
+
+ Cleaned up spec file goodness
+
+2001-11-06 16:28 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.9pre5
+
+2001-11-05 00:55 jesse
+
+ * rt.spec, lib/Makefile.PL, tools/testdeps:
+
+ Bumped the searchbuilder dependency to 0.47
+
+2001-11-05 00:54 jesse
+
+ * webrt/Ticket/Update.html:
+
+ Named the ticket update form.
+
+2001-11-05 00:52 jesse
+
+ * etc/config.pm, lib/RT/Handle.pm:
+
+ Added support for postgres' connections-over-ssl
+
+2001-11-05 00:49 jesse
+
+ * webrt/Admin/Elements/SelectRights:
+
+ Updated ACL selecting UI to work properly with browsers that try to auto-select
+ a value in a SELECT
+
+2001-11-02 01:39 jesse
+
+ * Makefile:
+
+ bumped the version to 2.0.9pre4
+
+2001-11-02 01:31 jesse
+
+ * webrt/Ticket/: Display.html, ModifyAll.html:
+
+ Fix to not automatically record comments if nothing was typed.
+
+2001-11-02 00:52 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fix for duplicated requestors on merge. #791
+
+2001-11-01 17:40 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ More tweaking transaction display
+
+2001-11-01 17:36 jesse
+
+ * webrt/: Admin/Users/Modify.html, Ticket/Elements/ShowTransaction:
+
+ Fixed newlines between ticket body and headers.
+
+ Fix for 934: creating users doesn't completely fail (new)
+
+2001-11-01 17:24 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Cleanups to ShowTransaction
+
+2001-11-01 17:10 jesse
+
+ * lib/RT/: Keyword.pm, Interface/Web.pm:
+
+ Fix for loading queue (post 2.0.8) when called by name
+ Fix for _not_ trying to load keywords when called with no value.
+
+2001-10-31 17:38 jesse
+
+ * Makefile:
+
+ Fixed the make dist
+
+2001-10-31 02:56 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.9pre3
+
+2001-10-31 02:54 jesse
+
+ * lib/RT/Action/SendPasswordEmail.pm:
+
+ file SendPasswordEmail.pm was initially added on branch rt-1-1.
+
+2001-10-31 02:54 jesse
+
+ * lib/RT/Action/SendPasswordEmail.pm:
+
+ Added an action to mail a password to the user.
+
+2001-10-31 02:54 jesse
+
+ * bin/rt-mailgate:
+
+ added support to rt-mailgate for putting the queue name in a +extension
+
+2001-10-31 02:52 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Tickets which are created in a "resolved" state will now have their "resolved"
+ date set right.
+
+2001-10-31 02:51 jesse
+
+ * lib/RT/User.pm:
+
+ Started work on "Email password to user"
+
+2001-10-31 02:48 jesse
+
+ * lib/RT/Watcher.pm:
+
+ Added a patch from Simon Cozens which makes sure that a requestor is always a user, rather than an email address.
+
+2001-10-31 02:47 jesse
+
+ * lib/RT/Keyword.pm:
+
+ Added a helper Load function to Keyword to load by Id or Path
+
+2001-10-31 02:42 jesse
+
+ * lib/RT/Template.pm:
+
+
+ Template got new helper functions for loading queue and system templates.
+
+2001-10-31 02:40 jesse
+
+ * bin/rt, bin/rtadmin, lib/RT/Interface/CLI.pm,
+ lib/RT/Interface/Email.pm:
+
+ Bringing forward a security fix from 2.0.8_01. (nonusers could get superuser permissions from the CLI)
+
+2001-10-31 02:37 jesse
+
+ * webrt/: Elements/MyRequests, Elements/MyTickets,
+ Ticket/Create.html:
+
+ Fixed a display bug in mytickets and myrequests which prevented clicking on
+ subjectless email
+
+2001-10-31 02:04 jesse
+
+ * etc/: config.pm, schema.Pg, schema.mysql, schema.pm:
+
+ Lengthened queue name and email addresses in the default DB schema
+
+2001-10-31 02:02 jesse
+
+ * webrt/Ticket/Update.html, lib/RT/Interface/Web.pm:
+
+ Now show the current ticket subject by default in the update subject box.
+ But don't include it in the transaction if it hasn't changed.
+
+2001-10-31 01:09 jesse
+
+ * Makefile, bin/rt, bin/rt-mailgate, bin/rtadmin,
+ lib/RT/Interface/CLI.pm, lib/RT/Interface/Email.pm:
+
+ Security fixes per Jay at mojomole
+
+2001-10-25 17:40 jesse
+
+ * webrt/Search/Listing.html:
+
+ Fixed a bug in new listing display. introduced after 2.0.8
+
+2001-10-24 14:10 jesse
+
+ * Makefile, lib/RT/Ticket.pm:
+
+ Fixed the ticket status changes from open to open bug, thanks to raphael
+ at linkvest.
+
+2001-10-23 17:34 jesse
+
+ * webrt/Ticket/Create.html:
+
+ Some cleanups to the Create form. No new functionality, just a little bit prettier
+
+2001-10-23 17:34 jesse
+
+ * webrt/Elements/SelectTicketSortBy:
+
+ Elements/SelectTicketsSortBy now uses new list of sortable Tickets fields
+ in Tickets.pm
+
+2001-10-23 17:32 jesse
+
+ * webrt/Search/Listing.html:
+
+ Column headings in searches are now clicky, where possible
+
+2001-10-23 17:31 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ URLs in ticket history should now be clicky
+
+2001-10-23 17:26 jesse
+
+ * webrt/Elements/CustomHomepageHeader:
+
+ file CustomHomepageHeader was initially added on branch rt-1-1.
+
+2001-10-23 17:26 jesse
+
+ * webrt/: index.html, Elements/CustomHomepageHeader:
+
+ Added a hook for sites to put their own html in the top of the "Home" page
+
+2001-10-23 17:24 jesse
+
+ * webrt/Elements/: SelectNewTicketQueue, SelectQueue:
+
+ Frefactored SelectQueue to elimintate dupicate code and enable a "too many queues" option
+
+2001-10-23 17:22 jesse
+
+ * lib/: RT.pm, RT/Date.pm, RT/Keyword.pm, RT/KeywordSelect.pm,
+ RT/Keywords.pm, RT/Link.pm, RT/Links.pm, RT/ObjectKeywords.pm,
+ RT/Record.pm, RT/Scrip.pm, RT/ScripActions.pm,
+ RT/ScripConditions.pm, RT/Ticket.pm, RT/Action/SendEmail.pm,
+ RT/Condition/Generic.pm, RT/Interface/CLI.pm,
+ RT/Interface/Email.pm:
+
+ Simple fixes to POD from Feargal Reilly to fix complaints from pod2man
+
+2001-10-23 17:08 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Refactored Tickets.pm a bit to provide better access to fields
+ that tickets can be sorted on.
+
+2001-10-23 17:06 jesse
+
+ * etc/: config.pm, schema.Pg, schema.mysql, schema.pm:
+
+ Added some new indices, based on recommendations from Nobel Tse at Outblaze
+
+ Started to cleanup config.pm to not use deprecated methods when displaying
+ ticket columns.
+
+2001-10-19 15:44 jesse
+
+ * Makefile, bin/initacls.Pg, bin/initacls.mysql, tools/initdb:
+
+ Reverting last patch. it lead to too much brokenness
+
+2001-10-19 15:16 jesse
+
+ * Makefile, bin/initacls.Pg, bin/initacls.mysql, tools/initdb:
+
+ Work on the install procedure to automate it some more. (automatically supply
+ passwords defined in the makefile)
+
+2001-10-19 00:49 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.9pre1
+
+2001-10-19 00:46 jesse
+
+ * docs/design_docs/cvs_integration:
+
+ file cvs_integration was initially added on branch rt-1-1.
+
+2001-10-19 00:46 jesse
+
+ * webrt/NoAuth/images/rt.jpg:
+
+ file rt.jpg was initially added on branch rt-1-1.
+
+2001-10-19 00:46 jesse
+
+ * rt.spec, docs/design_docs/cvs_integration, etc/config.pm,
+ webrt/rt.jpg, webrt/Elements/Header, webrt/Elements/TitleBoxEnd,
+ webrt/Elements/TitleBoxStart, webrt/NoAuth/images/rt.jpg,
+ webrt/SelfService/Elements/Header:
+
+ Refactored images path to have a configurable URL, so it will work with fastcgi ;)
+
+2001-10-19 00:37 jesse
+
+ * webrt/: Elements/Footer, autohandler:
+
+ Added support for timing of page display with &Debug=1
+
+2001-10-19 00:29 jesse
+
+ * lib/RT/User.pm:
+
+ User.pm: a fix to allow you to create multiple users with no email address.
+
+2001-10-19 00:25 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Added sub Due to Tickets.pm. fixes #910
+
+2001-10-19 00:17 jesse
+
+ * etc/rt.spec:
+
+ file rt.spec was initially added on branch rt-1-1.
+
+2001-10-19 00:17 jesse
+
+ * Makefile, rt.spec, etc/rt.spec:
+
+ Some work on the rpm build infrastructure
+
+2001-10-19 00:03 jesse
+
+ * tools/cpan2rpm:
+
+ cpan2rpm doesn't repeat builds of the same distribution, even if we're looking for differnet modules
+
+2001-10-18 23:30 jesse
+
+ * tools/cpan2rpm:
+
+ cpan2rpm has been cleaned up a whole lot. it should actually be somewhat smarter about not doing the same work twice
+
+2001-10-18 22:42 jesse
+
+ * tools/cpan2rpm:
+
+ Added cpan2rpm to the tools directory, for autogenerating rpms of cpan modules
+
+2001-10-18 22:42 jesse
+
+ * tools/cpan2rpm:
+
+ file cpan2rpm was initially added on branch rt-1-1.
+
+2001-10-18 21:20 jesse
+
+ * Makefile, rt.spec:
+
+ Added support for autobuilding an rpm with "make rpm"
+
+2001-10-18 02:15 jesse
+
+ * tools/insertdata:
+
+ Fixed templates to include the ticket subject if it was otherwise blank
+
+2001-10-18 02:14 jesse
+
+ * lib/RT/Interface/Web.pm, webrt/Ticket/Display.html:
+
+ work on web-based ticket creation. fixed bugs setting due dates, etc
+
+2001-10-18 02:13 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ fixed a user creation race condition in the mail gateway
+
+2001-10-18 02:11 jesse
+
+ * webrt/Elements/SelectStatus:
+
+ use the new status abstraction in the web ui
+
+2001-10-18 02:08 jesse
+
+ * tools/testdeps:
+
+ moved to a dbix::searchbuilder 0.46 dependency
+
+2001-10-18 02:07 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Movign away from a deprecated API
+
+2001-10-18 02:07 jesse
+
+ * tools/initdb:
+
+ initdb won't whine if you don't set a host
+
+2001-10-18 02:05 jesse
+
+ * docs/design_docs/evil_plans:
+
+ Added some docs about what 2.2 might hold
+
+2001-10-18 02:00 jesse
+
+ * lib/RT/: Ticket.pm, Queue.pm:
+
+ Abstracted out status enumeration and validation
+
+2001-10-18 01:57 jesse
+
+ * webrt/Ticket/Elements/EditLinks:
+
+ added WebPath to fix some links in showlinks
+
+2001-10-17 16:34 jesse
+
+ * lib/Makefile.PL:
+
+ Bumped searchbuilder dependency to 0.46
+
+2001-10-17 16:33 jesse
+
+ * webrt/Ticket/Elements/ShowHistory:
+
+ Added an optional bit of configuration to not show the "History" header
+
+2001-10-06 03:01 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Added a new option "Show commands" to show tranasaction
+
+2001-10-06 03:00 jesse
+
+ * webrt/Admin/: Keywords/index.html, Queues/index.html:
+
+ Added support for reenabling deleted queues and keywords
+
+2001-10-06 02:57 jesse
+
+ * lib/RT/Condition/Generic.pm:
+
+ Added test harness glue
+
+2001-10-06 02:55 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Added code to detect bogus ticket update types
+
+2001-10-06 02:54 jesse
+
+ * lib/RT/Interface/: CLI.pm, Email.pm:
+
+ Added support for unit testing
+
+2001-10-06 02:51 jesse
+
+ * lib/RT/Handle.pm:
+
+ Added support for unit testing
+
+ Added a test for Database Port definition to stop perl from whining
+
+2001-10-06 02:49 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm, Action/Generic.pm, Action/SendEmail.pm,
+ Attachment.pm, Attachments.pm:
+
+ Added support for unit testing
+
+2001-10-06 02:46 jesse
+
+ * lib/RT/: Tickets.pm, Transaction.pm, Transactions.pm, User.pm,
+ Users.pm, Watcher.pm, Watchers.pm, Queues.pm, Record.pm, Scrip.pm,
+ ScripAction.pm, ScripActions.pm, ScripCondition.pm,
+ ScripConditions.pm, Scrips.pm, Template.pm, Templates.pm:
+
+ Added support for unit testing
+
+2001-10-06 02:43 jesse
+
+ * lib/RT/: Keyword.pm, KeywordSelect.pm, KeywordSelects.pm,
+ Keywords.pm, Link.pm, Links.pm, ObjectKeyword.pm,
+ ObjectKeywords.pm, CurrentUser.pm, Date.pm, EasySearch.pm,
+ Group.pm, GroupMember.pm, GroupMembers.pm, Groups.pm:
+
+ Added support for unit testing
+
+2001-10-06 02:38 jesse
+
+ * lib/RT.pm:
+
+ Added the beginnings of test support to RT.pm
+
+2001-10-06 02:22 jesse
+
+ * lib/RT/TestHarness.pm:
+
+ file TestHarness.pm was initially added on branch rt-1-1.
+
+2001-10-06 02:22 jesse
+
+ * lib/: Makefile.PL, RT/TestHarness.pm:
+
+ First bits of glue for new RT unit testing infrastructure
+
+2001-10-06 02:19 jesse
+
+ * bin/rt:
+
+ bin/rt: Documentation cleanups. removing an unnecessary data tainting check
+
+2001-10-06 02:18 jesse
+
+ * bin/initacls.Pg:
+
+ Fixes to initacls.Pg to allow installation with Unix Domain sockets
+
+2001-10-04 02:01 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.8
+
+2001-10-01 02:44 jesse
+
+ * rt.spec:
+
+ Revved the version of DBIx::SearchBuilder needed in the .spec file
+
+2001-10-01 02:42 jesse
+
+ * Makefile, lib/RT/Interface/Email.pm:
+
+ Fixed the call to MIME::Entity::Build in Email.pm
+
+ Bumped the version to 2.0.8pre3
+
+2001-09-30 23:03 jesse
+
+ * README, bin/rt, lib/RT/Tickets.pm, lib/RT/Interface/Email.pm,
+ webrt/Search/PickRestriction, webrt/Ticket/History.html,
+ webrt/Ticket/Elements/EditBasics,
+ webrt/Ticket/Elements/ShowHistory:
+
+ Code refactoring to allow searching for nonlocal links
+ Cleanup to the Loop prevention stuff (v. 2.0.8pre2)
+ Readme cleanup
+ CLI cleanups. changed "return" to "exit"
+
+2001-09-26 16:31 jesse
+
+ * tools/testdeps:
+
+ Bumped the searchbuilder dependency. to 0.43
+
+2001-09-26 16:28 jesse
+
+ * Makefile, bin/rt, lib/RT/Tickets.pm,
+ webrt/Admin/Queues/Scrips.html:
+
+ Added a fix for ItemsArrayRef to Tickets which causes the Next/Prev links in
+ the web ui to be smarter.
+
+ Fixed a typo in SCrips.html
+
+ Bumped the version to 2.0.8pre2
+
+2001-09-24 20:10 jesse
+
+ * rt.spec:
+
+ file rt.spec was initially added on branch rt-1-1.
+
+2001-09-24 20:10 jesse
+
+ * Makefile, rt.spec:
+
+ Added destdir support to allow building of RPMS.
+ added rt.spec for building of RPMS.
+
+2001-09-21 16:51 jesse
+
+ * Makefile:
+
+ Bumped makefule version to 2.0.8pre1
+
+2001-09-21 16:45 jesse
+
+ * bin/rt, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Interface/Web.pm, webrt/Ticket/Elements/ShowTransaction:
+
+ Fixed a typo in the bin/rt docs
+ Allowed "Force owner change" from bulk update screen.
+
+2001-09-20 22:34 jesse
+
+ * bin/rt, lib/RT/Action/SendEmail.pm, lib/RT/Interface/Email.pm,
+ webrt/Search/Bulk.html, webrt/Ticket/Elements/ShowTransaction:
+
+ Fixes for:
+
+ 888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888862 Re: [rt-users] how does rt --limit-last-updated work?
+
+ 863 Ticket/Elements/ShowTransaction doesn't show headers sometimes
+
+ Fix for a bug in the code that prevents RT from looping with itself.
+
+ Start of work for "force change owner" in Bulk.html
+
+2001-09-19 16:49 jesse
+
+ * bin/initacls.Pg, bin/rt, etc/config.pm, lib/RT/Queue.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, webrt/Elements/Header,
+ webrt/Search/Listing.html, webrt/Ticket/Create.html,
+ webrt/Ticket/Display.html, webrt/Ticket/ModifyAll.html,
+ webrt/Ticket/Update.html, webrt/Ticket/Elements/ShowLinks:
+
+ Fixed a bug that would cause installation on postgres to lose if $PORT wasn't
+ specified
+
+ Changed " to ' in a few places in the config file, to make file and variable
+ names with embedded metacharacters not lose as badly
+
+ Set some logical defaults for Queue->Create, so it's not as likely to fail
+ to create a queue if you leave out some fields
+
+ Ticket->Create: now takes a Starts date. Also, fixed some API docs.
+
+ Tickets: Negative searching on fields like "subject" should now work
+
+ WebUI: Added a pragma NO-CACHE pseudo-header, to stop overzealous browsers from caching RT's pages
+
+ WebUI: changed the "Bookmark this search" link to "Bookmarkable URL for this search"
+
+ WebUI: ticket create now has a "more detail" section
+
+ WebUI: ticket updates no longer have a default subject preset.
+
+ WebUI: fixed a bug in ShowLinks that generated bogus urls within RT if RT wasn't at / on your server
+
+2001-09-13 00:03 jesse
+
+ * Makefile:
+
+ Bumping the version to 2.0.7
+
+2001-09-10 02:18 jesse
+
+ * Makefile:
+
+ Bumped the makefile version to 2.0.7pre1
+
+2001-09-10 02:11 jesse
+
+ * bin/mason_handler.fcgi, lib/RT/User.pm:
+
+ Fixed #883, a permissions caching bug.
+
+ Added the Text::Wrapper dependency to mason_handler.fcgi
+
+2001-09-06 15:59 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Reverted reopen on correspondence to 1.0 behaviour
+
+2001-09-06 15:41 jesse
+
+ * webrt/SelfService/Display.html:
+
+ make row coloring alternate in selfservice transaction history
+
+2001-09-06 15:39 jesse
+
+ * webrt/SelfService/Display.html:
+
+ Fixed cell spacing in selfservice transaction display
+
+2001-09-06 15:33 jesse
+
+ * bin/webmux.pl, webrt/SelfService/Display.html,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/ShowHistory,
+ webrt/Ticket/Elements/ShowKeywordSelects,
+ webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Cleaned up the web ticket transaction display.
+
+2001-09-06 15:32 jesse
+
+ * lib/RT/: ObjectKeyword.pm, Queue.pm:
+
+ Added some docs.
+ Started refactoring Ticket statuses.
+
+2001-09-06 15:32 jesse
+
+ * lib/RT/Ticket.pm:
+
+ $Ticket->SetTold now optionally takes a date to set it to.
+
+2001-09-06 15:30 jesse
+
+ * bin/rt:
+
+ Fixing some docs in bin/rt
+
+2001-09-05 11:00 jesse
+
+ * webrt/Elements/: Header, Refresh:
+
+ Fix for #823 from martin@schapendonk.org
+ Refresh now allows you to turn off refresh.
+
+2001-09-01 19:01 jesse
+
+ * webrt/Elements/MessageBox:
+
+ Fix for [fsck.com #803] Jumbo recording comments accidentally
+
+2001-09-01 18:23 jesse
+
+ * Makefile:
+
+ Bumped the version to 2.0.6
+
+2001-08-28 15:49 jesse
+
+ * Makefile:
+
+ Bumped the version to pre7, fixed a typo in the makefile's install instructions.
+
+2001-08-24 00:13 jesse
+
+ * lib/RT/Attachment.pm:
+
+ importing the Crit->crit typo fix from 2.0.5_01
+
+2001-08-24 00:08 jesse
+
+ * Makefile, lib/RT/Interface/Email.pm:
+
+ Rolled in the 2.05 perl 5.005 compatibility fix.
+ bumped the version to 2.0.6pre6
+
+2001-08-23 19:49 jesse
+
+ * bin/rt-mailgate, tools/initdb:
+
+ fixed initdb to not append a port= to the db connect string unless it needs one.
+
+ added support for $SenderMustExistInExternalDatabase to mailgate.
+
+2001-08-23 19:46 jesse
+
+ * lib/RT/Groups.pm:
+
+ Added a default alphabetical sort order to lib/RT/Groups
+
+2001-08-23 19:45 jesse
+
+ * etc/: config.pm, schema.Pg, schema.mysql, schema.pm:
+
+ Added new indices to schema. Regenerated mysql and postgres schema.
+
+ Cleaned up etc/config.pm's docs some more, based on comments from Christian Gimore
+ Added a default value for RT::OwnerEmail, which was documented by not defined
+ by default
+
+2001-08-22 18:48 jesse
+
+ * bin/rt, lib/RT/Ticket.pm, webrt/Ticket/Update.html:
+
+ bin/rt --create now deals with watchers.
+
+ fixed a typo in Ticket/Update.html introduced after 2.0.5_03
+
+2001-08-22 01:37 jesse
+
+ * Makefile, lib/RT/Tickets.pm, webrt/Admin/Global/Keywords.html:
+
+ Bumped version to 2.0.6-pre5
+
+ Fixed 'deep' merges.
+
+ Fixed a typo in Global/Keywords
+
+2001-08-22 00:41 jesse
+
+ * Makefile, lib/RT/Interface/Email.pm:
+
+ Fixed a couple of bugs in the new email db lookups
+
+2001-08-21 23:57 jesse
+
+ * Makefile, bin/initacls.Oracle, bin/initacls.Pg,
+ bin/initacls.mysql, tools/initdb:
+
+ Added support for setting the database port for postgres and mysql
+
+2001-08-21 23:48 jesse
+
+ * README:
+
+ Updated jesse's email address and shuffled things around a bit.
+
+2001-08-21 23:45 jesse
+
+ * etc/config.pm:
+
+ Added more docs and updated the default config for the external db lookups
+
+2001-08-21 23:35 jesse
+
+ * webrt/: index.html, NoAuth/webrt.css, Search/Listing.html,
+ Search/PickRestriction, Ticket/ModifyDates.html,
+ Ticket/Update.html, Ticket/Elements/ShowHistory,
+ Ticket/Elements/ShowTransaction:
+
+ Added support for autorefresh to / and /Search/Listing.html
+
+ Tightened up Transaction display. Fixed 'full headers' display.
+
+ Cleaned up the ui in ModifyDates a bit
+
+ Cleaned up the ui in Ticket/Update.html
+
+ fixed a few typos in the css file
+
+2001-08-21 23:30 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Added some documentation
+
+2001-08-21 23:25 jesse
+
+ * bin/rt-mailgate:
+
+ Bringing forward a patch to the mailgate from 2.0.5_01
+
+2001-08-21 23:19 jesse
+
+ * webrt/Elements/Refresh:
+
+ file Refresh was initially added on branch rt-1-1.
+
+2001-08-21 23:19 jesse
+
+ * webrt/Elements/Refresh:
+
+ Commiting a Refresh control to cvs
+
+2001-08-21 23:17 jesse
+
+ * bin/rtadmin:
+
+ Fixed cli group creation
+
+2001-08-21 23:12 jesse
+
+ * webrt/Elements/MessageBox:
+
+ Fixed transaction quoting to use the new transaction content quoting method.
+
+2001-08-21 23:07 jesse
+
+ * webrt/Elements/Login:
+
+ Display a version string in the login box.
+
+2001-08-21 23:06 jesse
+
+ * webrt/Elements/Header:
+
+ Added support for refresh to webrt/Elements/Header
+ Don't display the logout link if using external auth.
+
+2001-08-21 23:05 jesse
+
+ * webrt/Admin/Users/Modify.html:
+
+ Little bit of ui and code cleanup to the User editing page
+
+2001-08-21 23:04 jesse
+
+ * lib/RT/Record.pm:
+
+ Fixed broken caching of the CreatorObj
+
+2001-08-21 23:03 jesse
+
+ * lib/RT/Handle.pm:
+
+ Added support for Database port to Handle.pm
+
+2001-08-21 22:50 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Added vivek khera's patch to clean up newline processing for incoming messages
+
+ Removed debugging output from file attachment subroutine
+
+ Added support for setting refresh interval to the search page
+
+2001-08-21 22:46 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Fixed the bug fixed in 2.0.5_?? which called the wrong function for finding
+ sender name
+
+ Altered the mail interface's external user lookup function to be returned
+ a hash of parameters
+
+2001-08-21 22:43 jesse
+
+ * lib/RT/Transaction.pm:
+
+ Added support for Quoting a transaction to the Content sub.
+
+2001-08-16 00:23 jesse
+
+ * Makefile, tools/testdeps:
+
+ dependency on CGI::Cookie 1.20 had reverted.
+ Bumped version to 2.0.5_03
+
+2001-08-15 16:44 jesse
+
+ * Makefile, bin/rt-mailgate, lib/RT/Interface/Email.pm:
+
+ A couple of fixes to the mail gateway to deal with proper processing
+ of sender email addresses
+
+2001-08-15 16:12 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Trying for 2.0.5-01 again
+ Fixed a perl 5.6ism in Interface/Email
+ Fixed a bug in Attachment.pm that would cause a DIE on a fatal error
+
+2001-08-15 16:12 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Trying for 2.0.5-01 again
+ Fixed a bug in Attachment.pm that would cause a DIE on a fatal error
+
+2001-08-15 16:12 jesse
+
+ * Makefile:
+
+ Trying for 2.0.5-01 again
+
+2001-08-15 15:44 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Fixed an error message in Attachment that should never be reached
+ Bumped the Makefile version to 2.0.5_01
+ Fixed an inadvertent perl 5.6ism in the mail gateway.
+
+2001-08-15 15:42 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Fixed an error message in Attachment that should never be reached
+
+ Bumped the Makefile version to 2.0.5_01
+
+2001-08-15 15:42 jesse
+
+ * Makefile:
+
+ Bumped the Makefile version to 2.0.5_01
+
+2001-08-15 01:01 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.6-pre1
+
+2001-08-15 01:00 jesse
+
+ * webrt/: autohandler, Admin/Users/Modify.html, Elements/Login,
+ SelfService/Prefs.html, User/Prefs.html:
+
+ Added support for external authentication to the web ui
+
+2001-08-15 01:00 jesse
+
+ * bin/rt-mailgate, lib/RT/Interface/Email.pm:
+
+ Added support for looking up new users in an external datasource
+
+2001-08-15 00:58 jesse
+
+ * etc/config.pm:
+
+ Added new configuration variables for external authentication for the web ui and
+ to support looking up new users in the mail gateway from a site-defined external datasource.
+
+2001-08-15 00:17 jesse
+
+ * tools/testdeps:
+
+ Fixed testdeps to depend on the right version of CGI.pm
+
+2001-08-14 23:55 jesse
+
+ * Makefile:
+
+ Released RT 2.0.5 No changes since 2.0.5-test3.
+
+2001-08-12 21:13 jesse
+
+ * Makefile, bin/webmux.pl:
+
+ Fixed a typo in webmux.pl created after 2.0.4
+ Bumped the version to 2.0.5-test3
+
+2001-08-12 20:00 jesse
+
+ * docs/manual.pod, lib/RT/Transaction.pm:
+
+ Core: Updated Transaction->Content to be smarter about showing the first
+ message in the transaction.
+
+ Removed the old manual skeleton in docs in favor of the web based docs.
+
+2001-08-12 19:58 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Core: Added a convenience function to RT::Attachemnt to find Children of this attachment.
+ Core: Added code to RT::Attachemnt to allow access to the 'Parent' attribute
+
+2001-08-12 19:55 jesse
+
+ * lib/RT/Attachments.pm:
+
+ Core: A convenience function to search for Attachments by ContentType.
+ Core: Added some docs to RT::Attachments
+
+2001-08-12 19:53 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ WebUI: Show 'comment' and 'correspond' for multipart messages in the per-transaction listing.
+
+2001-08-10 23:59 jesse
+
+ * README:
+
+ README: added more pointers to the 'complete' docs.
+ README: Removed the little bit of configuration info in the readme in favor of the 'complete' docs on the web
+
+2001-08-10 23:58 jesse
+
+ * bin/rt-mailgate:
+
+ mailgate: RT is now less likely to try to send mail to senders which will cause loops
+
+2001-08-10 23:57 jesse
+
+ * webrt/index.html:
+
+ Webui: [home] now gets greyed out when you're there
+
+2001-08-10 15:32 jesse
+
+ * Makefile, webrt/Elements/MessageBox:
+
+ Added a pair of () in webrt/Elements/MessageBox to correct a typo in an if
+ Bumped version to 2.0.5-test2
+
+2001-08-10 00:24 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.5test1
+
+2001-08-10 00:24 jesse
+
+ * lib/RT/Users.pm, webrt/Elements/MessageBox,
+ webrt/Ticket/Elements/AddWatchers, webrt/Ticket/Elements/EditDates:
+
+ Cleanup to date editing ui
+
+ Code cleanups to Elements/MessageBox for more readable and maintainable code
+ Code cleanups to TicketElements/AddWatchers for more readable and maintainable code
+
+2001-08-10 00:23 jesse
+
+ * webrt/Ticket/Elements/: EditLinks, ShowLinks:
+
+ Cleanup to Relationship editing and display ui
+
+2001-08-10 00:21 jesse
+
+ * webrt/Ticket/ModifyDates.html:
+
+ UI cleanups in Ticket/ModifyDates.html
+
+2001-08-10 00:20 jesse
+
+ * webrt/Ticket/ModifyAll.html:
+
+ Jumbo no longer loses ticket update contents.
+
+2001-08-09 20:07 jesse
+
+ * webrt/Admin/Users/index.html:
+
+ Cleaned up Admin/Users search functionality and made it look more like
+ other user searching screens and enables searching for disabled users.
+
+2001-08-09 20:02 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Properly strip trailing spaces from things we're trying to link to.
+
+2001-08-09 20:00 jesse
+
+ * lib/RT/Links.pm:
+
+ By default, try to sort Links by something intelligent when displaying them
+
+2001-08-03 01:52 jesse
+
+ * lib/RT/Action/Autoreply.pm:
+
+ Autoreplies are now from "Queuename" rather than from "RT"
+
+2001-08-02 04:57 jesse
+
+ * webrt/: Admin/Queues/People.html, Elements/Quicksearch,
+ Elements/SelectResultsPerPage, Elements/SelectStatus,
+ Search/PickRestriction:
+
+ WebUI: Fixed a typo in hte 'bookmark this search' link display.
+ WebUI: By default, limit displayed results to 50 per page.
+
+2001-08-02 04:57 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Documented a function in the web ui library
+
+2001-08-02 04:56 jesse
+
+ * etc/config.pm:
+
+ Fixed a typo in the docs in the config file, thanks to sheeri.
+
+2001-08-02 04:55 jesse
+
+ * bin/rt-mailgate:
+
+ rt-mailgate: bug-fix to properly grab 'from' addresses for purposes of determinigng whether something's a mailer-daemon
+
+2001-08-02 04:54 jesse
+
+ * bin/rt:
+
+ Added support for merging to the CLI
+ Cli now works as described when linking tickets. Formerly, you couldn't admit the "+" before an added link
+
+2001-08-02 04:53 jesse
+
+ * webrt/User/Prefs.html:
+
+ Bugfix to allow users to fully delete their rt signatures
+
+2001-07-30 03:54 jesse
+
+ * docs/design_docs/evil_plans:
+
+ file evil_plans was initially added on branch rt-1-1.
+
+2001-07-30 03:54 jesse
+
+ * Makefile, docs/design_docs/evil_plans:
+
+ bumped the version, so as not to get confused users complaining to the lists
+
+ added some notes about what may happen for 2.2
+
+2001-07-30 03:52 jesse
+
+ * webrt/SelfService/Display.html:
+
+ file Display.html was initially added on branch rt-1-1.
+
+2001-07-30 03:52 jesse
+
+ * bin/mason_handler.fcgi, bin/webmux.pl, lib/RT/Interface/Web.pm,
+ webrt/SelfService/Create.html, webrt/SelfService/Details.html,
+ webrt/SelfService/Display.html, webrt/SelfService/Update.html,
+ webrt/SelfService/Elements/GotoTicket,
+ webrt/SelfService/Elements/MyRequests, webrt/Ticket/Create.html,
+ webrt/Ticket/Display.html, webrt/Ticket/Modify.html,
+ webrt/Ticket/ModifyAll.html, webrt/Ticket/ModifyDates.html,
+ webrt/Ticket/ModifyLinks.html, webrt/Ticket/ModifyPeople.html,
+ webrt/Ticket/Update.html, webrt/Ticket/Elements/EditBasics,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Switched SelfService/Details to SelfService/Display to better jibe
+ with the regular UI.
+
+ Added better current-page navigation hints to most per-ticket pages.
+
+ Added support for uploading attachments on ticket create or update.
+
+2001-07-30 03:51 jesse
+
+ * webrt/Admin/Elements/ListGlobalScrips:
+
+ file ListGlobalScrips was initially added on branch rt-1-1.
+
+2001-07-30 03:51 jesse
+
+ * webrt/Admin/: Elements/ListGlobalKeywordSelects,
+ Elements/ListGlobalScrips, Global/Scrips.html,
+ Queues/Keywords.html, Queues/Scrips.html:
+
+ Added some ui to show global scrips and keywordselects in the queue
+ uis for adminning the same.
+
+2001-07-30 03:51 jesse
+
+ * webrt/Admin/Elements/ListGlobalKeywordSelects:
+
+ file ListGlobalKeywordSelects was initially added on branch rt-1-1.
+
+2001-07-30 03:49 jesse
+
+ * TODO:
+
+ Clarified the errata urls
+
+2001-07-30 03:48 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Cleaned up the return values from Ticket->CreateLink. (always return $status, $msg);
+
+2001-07-30 03:48 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ changed the case of the Managed-by header to be less grating
+
+2001-07-30 03:45 jesse
+
+ * bin/rt-mailgate, lib/RT/Interface/Email.pm:
+
+ Moving a bunch of mail gateway library routines to the library where they
+ belong
+
+2001-07-27 01:06 jesse
+
+ * README:
+
+ fixed a typo in the cronjob
+
+2001-07-25 01:05 jesse
+
+ * bin/rt-mailgate, lib/RT/Tickets.pm:
+
+ Fix for mailgateway being unable to send error mail with 'sendmailpipe' mailing
+ Fix for 'blank' searches when using search bookmarking.
+
+2001-07-25 01:00 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.4
+ Fixed bookmarkable searches
+ Fix for sendmailpipe errors in mailgateway
+
+2001-07-24 12:10 jesse
+
+ * Makefile, webrt/Search/PickRestriction:
+
+ Fixed a bug in Search/PickRestriction, thanks to Vivek Khera
+ Bumped version to 2.0.3
+
+2001-07-24 00:28 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.2
+
+2001-07-24 00:21 jesse
+
+ * lib/RT/Tickets.pm, webrt/Elements/Submit,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction:
+
+ Bookmarked searches now keep track of sorting and record count limits
+ New "Refine" button to allow faster updates of search criteria.
+
+2001-07-24 00:01 jesse
+
+ * bin/rt:
+
+ Added support for --limit-queue to RT cli tool
+
+2001-07-23 10:43 jesse
+
+ * Makefile, tools/testdeps:
+
+ Testdeps was accidentally looking for Freeze::Thaw, rather than FreezeThaw
+
+2001-07-23 00:31 jesse
+
+ * Makefile:
+
+ bumped version to 2.0.2test2
+
+2001-07-23 00:30 jesse
+
+ * lib/RT/Tickets.pm, lib/RT/Interface/Web.pm, tools/testdeps,
+ webrt/Search/Listing.html:
+
+ Added support for bookmarkable searches.
+
+2001-07-22 22:12 jesse
+
+ * lib/RT/: KeywordSelect.pm, User.pm:
+
+ Better error checking in User ACL checking
+
+ Fixed an ACL check bug in KeywordSelect.pm, thanks to Matthew Stock.
+
+2001-07-22 22:09 jesse
+
+ * webrt/Admin/Users/index.html:
+
+ Fix for a users search bug and a clarification of another search option.
+
+2001-07-22 22:06 jesse
+
+ * lib/RT/: Keywords.pm, Queues.pm, Users.pm:
+
+ By default, order Queues, Users and Keywords alphabetically
+
+2001-07-22 22:05 jesse
+
+ * Makefile:
+
+ Permissions fix for the data dirs for the fastcgi handler
+
+ rt/etc is now mode 755, rather than 555.
+
+2001-07-22 22:03 jesse
+
+ * bin/mason_handler.fcgi:
+
+ fastcgi handler no longer drops setgidness, so it can deal with session files.
+
+2001-07-22 21:55 jesse
+
+ * etc/config.pm:
+
+ Cleaned up the config file a bit to make installation easier.
+
+2001-07-22 21:52 jesse
+
+ * webrt/Elements/MyRequests:
+
+ Clean up phrasing of the "Tickets I own dialogbox"
+
+2001-07-19 00:57 jesse
+
+ * Makefile:
+
+ Changed Makefile to not use MAN[13]INSTALLSITEPATH per Robert Shaw's changes
+
+2001-07-18 16:20 jesse
+
+ * Makefile, lib/RT/Queue.pm:
+
+ Added a newline to Queue.pm to fix a pod bug
+
+ Bumped version to 2.0.2-test1 to get some feedback
+
+2001-07-18 16:16 jesse
+
+ * lib/RT/User.pm:
+
+ RT should now honor queue-level pseudogroup memebership for ACL checks.
+ Also, simplified some of the queue related ACL checking code.
+
+ Reduced the ACL permissions cache from 30sec to 10sec.
+
+2001-07-18 16:13 jesse
+
+ * lib/RT/Transaction.pm:
+
+ Added BriefDescription, which is just like Description without the "By actor"
+ at the end
+
+ Descriptions Keyword operations should include _which_ keyword select from
+ here on in (also touched the last update to Ticket.pm)
+
+2001-07-18 16:06 jesse
+
+ * lib/RT/Ticket.pm:
+
+ TTicket->Create no longer just adds admin ccs..unless the person doing the add
+ has the right to do so. otherwise, there was an ACL related attack that
+ could happen. luckily none of the UI exposedd this hole yet.
+
+ Ticket->Create should now be able to set keywords on create
+
+ Ticket->Create now reports back non-fatal errors and how they were dealt with
+
+ Ticket->AddKeyword got split into AddKeyword and _AddKeyword. The former
+ has the acl check and calls the latter. the latter just does the adding.
+
+ Ticket->AddKeyword got a Silent flag, which causes a transaction not
+ to be written. useful on ticket create.
+
+2001-07-18 15:59 jesse
+
+ * tools/testdeps:
+
+ Added tests for Apache::Cookie
+ and DBI 1.18 to testdeps
+
+2001-07-18 15:53 jesse
+
+ * webrt/SelfService/: Details.html, Update.html:
+
+ Added the ability for requestors to use the self-service ui to comment on / reply to tickets.
+
+2001-07-18 15:53 jesse
+
+ * webrt/SelfService/Update.html:
+
+ file Update.html was initially added on branch rt-1-1.
+
+2001-07-17 22:12 jesse
+
+ * webrt/Admin/Queues/People.html:
+
+ Fixed a link to Users/Modify.html in Queue/People.html
+
+2001-07-17 22:01 jesse
+
+ * bin/webmux.pl:
+
+ Fix to the solaris chown problem
+
+2001-07-17 18:37 jesse
+
+ * README:
+
+ Fixed typo in the cron job description
+
+2001-07-13 02:17 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Work on tickets.pm to support some new searching options
+
+2001-07-12 19:43 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0.1
+
+2001-07-11 23:17 jesse
+
+ * etc/config.pm:
+
+ No longer log things of less than 'error' to the logfile
+
+2001-07-11 23:16 jesse
+
+ * Makefile, bin/mason_handler.fcgi, bin/rt, bin/rt-mailgate,
+ bin/rtadmin, lib/Makefile.PL, lib/RT.pm, lib/RT/Interface/CLI.pm,
+ lib/RT/Interface/Email.pm:
+
+ Make sure that the setgid programs don't drop setgidness before trying to open logfiles
+
+2001-07-10 20:15 jesse
+
+ * Makefile, lib/Makefile.PL, lib/RT/Tickets.pm,
+ lib/RT/Interface/Web.pm, tools/testdeps:
+
+ Fixes to allow search-by-requestor to search for requestors who don't have RT accounts
+
+2001-07-10 13:53 jesse
+
+ * bin/webmux.pl:
+
+ Fix for the weird sessiondata permissions bug folks have seen on solaris
+
+2001-07-10 11:47 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Change to Tickets.pm to fix description of watcher limits
+
+2001-07-10 11:36 jesse
+
+ * bin/webmux.pl, webrt/Elements/SelectMatch:
+
+ Fixed a bug in webmux.pl that prevented Apache::Cookie support from working
+
+ Fixed a bug in the enw SelectMatch code
+
+2001-07-10 11:20 jesse
+
+ * lib/RT/Ticket.pm, webrt/Elements/SelectMatch,
+ webrt/Search/PickRestriction:
+
+ Cleanup to SelectMatch and PickRestriction to clear up the UI issues
+ with searching for Tickets from a give nrequestor
+
+2001-07-09 10:36 jesse
+
+ * lib/RT/Template.pm:
+
+ Fixed a typo in Template.pm that squashed templates on outgoing mail. (Bug in my untainting fix)
+
+ Bumped version to 2.0.1-test2
+
+2001-07-09 10:36 jesse
+
+ * Makefile:
+
+ Fixed a typo in Template.pm that squashed templates on outgoing mail. (Bug in my untainting fix)
+
+2001-07-08 22:31 jesse
+
+ * README:
+
+ Added some polite comments about supporting the development of RT
+ with contracts, cash or gifts
+
+2001-07-08 20:14 jesse
+
+ * Makefile, bin/mason_handler.fcgi,
+ webrt/SelfService/Elements/ShowTransaction:
+
+ Bumped version to 2.01pre1
+
+ Fixed mason_handler header newlines
+
+2001-07-08 20:12 jesse
+
+ * lib/RT/: ScripAction.pm, ScripCondition.pm, Template.pm,
+ Ticket.pm:
+
+ Taint fixes for ScripAction, ScripCondtion,Template.
+ Header wrapping fix in Template.pm.
+ Fix in Ticket.pm to make EffectiveId a public field.
+
+2001-07-06 18:32 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Applied a patch from ivan to deal with poorly formed mime messages
+ and clean up the attachment proccessing code.
+
+2001-07-06 18:26 jesse
+
+ * webrt/SelfService/Attachment/dhandler:
+
+ file dhandler was initially added on branch rt-1-1.
+
+2001-07-06 18:26 jesse
+
+ * webrt/: SelfService/Details.html,
+ Ticket/Elements/ShowTransaction, SelfService/Attachment/dhandler:
+
+ ShowTransaction now no longer displays 'Comment' and 'Reply' if the user
+ doesn't have the right rights.
+
+ SelfService uses the 'standard' ShowTransaction.
+
+ SelfService now displays Attachments
+
+2001-07-06 18:21 jesse
+
+ * etc/schema.mysql:
+
+ Switched mysql to use LONGTEXT rather than LONGBLOB to get
+ case insensitive searching.
+
+2001-07-06 18:19 jesse
+
+ * bin/mason_handler.fcgi, lib/RT/Interface/Web.pm,
+ webrt/NoAuth/Logout.html:
+
+ Cleanups to deal better with the fastcgi handler.
+
+ Switched to CGI::Fast from FCGI
+
+ ContentType fixes.
+
+ Logging out now clears the session hash, rather than detaching a perfectly good session. (This gets around an obnoxious tainting issue too)
+
+2001-07-06 16:14 jesse
+
+ * webrt/Ticket/Attachment/dhandler:
+
+ Changed default attachment type to text/plain from text/html
+
+2001-07-05 16:48 jesse
+
+ * bin/rt-mailgate, lib/RT/Ticket.pm:
+
+ Updates to make Correspondence on a closed or stalled ticket reopen the ticket
+
+2001-07-04 00:51 jesse
+
+ * bin/rt:
+
+ bin/rt will now show transactions of type 'text'
+
+2001-07-04 00:36 jesse
+
+ * bin/webmux.pl:
+
+ Minor fixes to webmux.pl for content type stuff.
+
+2001-07-03 23:15 jesse
+
+ * lib/RT/Interface/Web.pm, webrt/Admin/Queues/index.html,
+ webrt/Search/PickRestriction:
+
+ Web ui now supports 'SearchByPriority'
+
+2001-07-03 23:14 jesse
+
+ * etc/config.pm:
+
+ Added a few comments about configuration variables
+
+2001-07-03 23:12 jesse
+
+ * webrt/SelfService/Elements/ShowTransaction:
+
+ Now SelfService displays attachments of type 'text'
+
+2001-07-03 23:08 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ With the web ticket display, now display attachments of type 'text' properly.
+ Also, always have a download link.
+
+2001-07-03 23:00 jesse
+
+ * webrt/Ticket/Elements/ShowLinks:
+
+ Changed SubTickets/SuperTickets to Parents/Children
+
+2001-07-03 22:57 jesse
+
+ * Makefile:
+
+ Added notes to the effect that the speedycgi and fastcgi handlers aren't
+ supported.
+
+2001-07-03 22:52 jesse
+
+ * bin/webmux.pl, bin/mason_handler.fcgi,
+ webrt/Ticket/Attachment/dhandler:
+
+ Switched mod_perl hander to use Apache::Cookie
+
+ Refactored mime type handling to properly set the mime type with the modperl
+ handler and the fastcgi handler
+
+ Added untainting for the requirred parts of the fastcgi wrapper.
+ I'm not yet confident that it works properly, but it does the right
+ thing in the trivial case.
+
+2001-06-27 00:11 jesse
+
+ * Makefile:
+
+ Bumped version to 2.0 for release to the unsuspecting masses
+
+2001-06-25 16:28 jesse
+
+ * Makefile, lib/RT/Ticket.pm:
+
+ Fix for a bug introduced by RC2 (while fixing another bug with _Links)
+ which caused Links listings to recurse rather infinitely.
+
+ Bumped RC2 to RC3
+
+2001-06-25 16:25 jesse
+
+ * webrt/Admin/Elements/SelectRights:
+
+ Fix for a crashing bug when editing ACLs without permission
+
+2001-06-25 12:19 jesse
+
+ * Makefile, lib/RT/Ticket.pm:
+
+ Fixed bug in Ticket.pm -> _Links that caused it to return an error
+ rather than an empty links object if permission denied.
+
+ Bumped version to RC2
+
+2001-06-23 02:48 jesse
+
+ * Makefile, README, tools/import-1.0-to-2.0:
+
+ removed 1.0-2.0 importer. (it's now in the contrib archive)
+ updated readme and makefile to know about the change.
+
+ Bumped the version to 2.0.0-RC1. Yeah. That's right. the major version
+ number just got incremented.
+
+2001-06-22 14:50 jesse
+
+ * Makefile, lib/RT/Ticket.pm:
+
+ hopefully a fix for everyone's favorite import bug.
+
+2001-06-20 23:56 jesse
+
+ * webrt/Search/Bulk.html:
+
+ Display cleanups to Bulk.html.
+ Removed bogus nav items
+
+2001-06-20 17:33 jesse
+
+ * NEWS, lib/Makefile.PL:
+
+ Removed the out of date NEWS file. It's been superceeded by the changelog
+
+2001-06-20 17:27 jesse
+
+ * Makefile, README, lib/RT/Ticket.pm, lib/RT/User.pm,
+ lib/RT/Interface/Web.pm, tools/import-1.0-to-2.0, tools/testdeps,
+ webrt/Ticket/Display.html, webrt/Ticket/History.html:
+
+ Fixes for the import problems some folks have been seeing
+ Fixes for the Can't click on URL issues reported by mixo and Carl Potter.
+ Turned off some overly verbose debugging.
+
+ Bumped the version to 1.3.105
+
+2001-06-19 00:34 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.104
+
+2001-06-19 00:25 jesse
+
+ * lib/RT/Tickets.pm:
+
+ A fix for search based on keywords that don't exist. (Some rows would be lost, due to poorly constructed SELECT statements. This change requires DBIx::SearchBuilder 0.39
+
+2001-06-18 15:39 jesse
+
+ * Makefile, README, webrt/Ticket/Elements/ShowTransaction:
+
+ Updated README to note new RT2 Errata list
+ Bumped version to 1.3.103
+ Added comments in ShowTransaction to let you see exact transaction / ticket Ids
+ if you view source.
+
+2001-06-18 15:32 jesse
+
+ * bin/rt:
+
+ Better fomating for cli queue listing.
+
+2001-06-17 16:45 jesse
+
+ * lib/RT/: Transaction.pm, User.pm:
+
+ Added PurgeTransaction datatype for Transactions.
+
+ Removed debugging code from User.pm
+
+2001-06-17 14:36 jesse
+
+ * webrt/Ticket/Elements/Tabs:
+
+ Fix for webui error when displaying next/prev tabs on new tix.
+
+2001-06-15 22:23 jesse
+
+ * Makefile, README:
+
+ Bumped the version to a private pre-test 1.3.103
+
+2001-06-15 22:19 jesse
+
+ * README, lib/RT/Ticket.pm, lib/RT/User.pm:
+
+ Debugging fixes for import oddness folks are having
+
+2001-06-15 01:13 jesse
+
+ * webrt/Search/Bulk.html:
+
+ removed debugging output from bulk.html
+
+2001-06-14 15:53 jesse
+
+ * Makefile, lib/RT/Transactions.pm,
+ webrt/Ticket/Elements/AddWatchers:
+
+ Installation path of man pages is now configurable
+ By default Transactions should now be ordered by date, no matter what their id sequence is.
+ Fixed an html typo in Tickets/Elements/AddWatchers
+
+ Bumped version to 1.3.102
+
+2001-06-14 03:21 jesse
+
+ * Makefile:
+
+ Bumped the version to 1.3.101
+
+2001-06-14 02:47 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Interface/Web.pm, webrt/Elements/Tabs,
+ webrt/Ticket/Elements/Tabs:
+
+ Comments in Ticket.pm about less than optimal design
+ Enhancments to Interface/Web for the bulk ticket manipulation tool.
+ Search navigation was cleaned up a bunch.
+
+2001-06-14 01:52 jesse
+
+ * webrt/Search/Bulk.html:
+
+ file Bulk.html was initially added on branch rt-1-1.
+
+2001-06-14 01:52 jesse
+
+ * webrt/Search/: BuildSearch, Bulk.html, Listing.html, QueueFooter,
+ QueueHeader, QueueItem:
+
+ Be vewwy vewwy quiet. I'm hunting cweeping features.
+ Like the brand new Bulk Ticket manipulator
+
+ Removed some cruft from the repository. (unused files from tobix' first
+ search implementation)
+
+2001-06-13 03:53 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.100
+
+2001-06-13 03:52 jesse
+
+ * bin/mason_handler.fcgi:
+
+ The fastcgi handler works for everything except attachment viewing. I'm going to have to think a bit about how to set
+ content type properly in a nice handler-agnostic manner.
+
+2001-06-13 03:51 jesse
+
+ * bin/rt-mailgate:
+
+ Fixed a warn -> warning in mailgate's logging
+
+2001-06-13 03:50 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Adjusting spacing
+
+2001-06-13 03:50 jesse
+
+ * webrt/Ticket/Elements/Tabs:
+
+
+ Added an error check to the new navigation bars to deal with a possible lack of active search
+
+2001-06-12 21:28 jesse
+
+ * etc/config.pm:
+
+ Clarified required permissions for the RT Logdir
+
+2001-06-12 19:12 jesse
+
+ * etc/config.pm, lib/RT/Queue.pm, lib/RT/Transaction.pm:
+
+ Cleaned up some docs in config.pm and Queue.pm
+ Updated the Transaction Descriptions in transaction.pm to make sure
+ that the Actor is listed.
+
+2001-06-12 18:08 jesse
+
+ * webrt/Ticket/Elements/Tabs:
+
+ Added links to navigate within an existing search.
+
+2001-06-08 23:57 jesse
+
+ * webrt/Ticket/Elements/EditKeywordSelects:
+
+ Made "(empty)" the same between "EditKeywordSelects" and "SearchByKeywordSelect"
+
+2001-06-08 23:51 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Ability to set owner by name when creating tickets.
+ Ability to set timeleft when creating tickets
+
+2001-06-08 23:00 jesse
+
+ * Makefile, README, etc/schema.Pg, lib/RT/Ticket.pm:
+
+ Added an index to etc/schema.Pg
+ Ticket.pm->Create now passes through a few more values that were missing.
+
+ Added doc on imports w/ postgres to the readme.
+
+ bumped the version to 1.3.99
+
+2001-06-08 18:32 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Fix for merging more than one ticket.
+ Fix for req2rt which imported transactions in reverse order.
+
+2001-06-07 16:02 jesse
+
+ * Makefile, lib/RT/Queue.pm, tools/import-1.0-to-2.0:
+
+ Catch a possibly undefined value in Queue::AddWatcher
+ Bumped verion to 1.3.97
+ another attempt at fixing the owner change generation code in import.
+
+2001-06-07 14:59 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ The importer now imports the root user and the general queue.
+
+2001-06-07 12:44 jesse
+
+ * Makefile, etc/config.pm, lib/RT/Interface/Web.pm:
+
+ Support for a seperate local component root for local WebRT mods and additions.
+
+2001-06-06 17:25 jesse
+
+ * README:
+
+ Added instructions for migrating 1.0 instances to 2.0
+
+2001-06-06 16:15 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.95
+
+2001-06-06 16:15 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ Importer should now import tickets created by the req importer
+
+2001-06-06 16:12 jesse
+
+ * bin/initacls.Pg:
+
+ initacls.Pg should now handle pg database on remote machine
+
+2001-06-06 16:05 jesse
+
+ * webrt/Ticket/Elements/ShowRequestor:
+
+ Don't show the 'About this Requestor' box if the user is privileged.
+
+2001-06-06 15:37 jesse
+
+ * lib/RT/Date.pm:
+
+ Now date comparisons against never dtrt.
+
+2001-06-06 15:30 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Search by content now works on the web
+
+2001-06-06 14:22 jesse
+
+ * webrt/Admin/Groups/Members.html:
+
+ Fix for #552: spurious warning when going into group membership editor
+
+2001-06-06 14:14 jesse
+
+ * webrt/Ticket/Elements/EditKeywordSelects:
+
+ keywordSelect selction fix (fsck #555)
+
+2001-06-06 10:57 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Removed spurious 'u' from line 1 of importer.
+ bumped version to 1.3.95-test2
+
+2001-06-06 09:39 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Possible fix for jens' user import troubles.
+ bounced version to 1.3.95-test1
+
+2001-06-06 02:12 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Importer wasn't properly grabbing ACLs. Bumped version to 1.3.94
+
+2001-06-06 01:33 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ Fixed a bug in the 'Make users superusers' code in the importer
+
+2001-06-06 00:41 jesse
+
+ * lib/RT/Ticket.pm:
+
+ fixed a missing =cut (end of perldoc in ticket.pm
+
+2001-06-06 00:40 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ fixing a typo in importer's mime parser
+
+2001-06-06 00:19 jesse
+
+ * Makefile, lib/Makefile.PL, lib/RT/Action/Notify.pm,
+ lib/RT/Action/SendEmail.pm, tools/testdeps:
+
+ Cleaned up some dependencies
+ RT should no longer send mail when there are no recipients. thanks to the nice folks at Sensarray.com for some good debugging.
+
+2001-06-05 23:16 jesse
+
+ * Makefile, bin/webmux.pl, tools/import-1.0-to-2.0:
+
+ Fixed some bogus header parsing in import.
+ web mux now tries to chown files again. (christian's going to test it again ;)
+ Bumped to 1.3.91 for a release
+
+2001-06-05 11:34 jesse
+
+ * webrt/Admin/Users/Modify.html:
+
+ Rephrased the "Privileged" checkbox in AdminUsers.
+
+2001-06-05 11:18 jesse
+
+ * Makefile, bin/webmux.pl, tools/import-1.0-to-2.0,
+ webrt/NoAuth/Logout.html:
+
+ webmux no longer tries to chown its data directories on startup
+ import now handles final_priority
+ Logout.html now refreshes to a login page
+
+2001-06-05 10:42 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ When we added support for 'priority' transactions, we accidentally broke
+ support for 'subject' transactions. fixed now.
+
+2001-06-05 03:25 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Import tool now handles priority changes.
+
+2001-06-05 02:56 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Minor tweak to importer to try even harder to find users in the database before creating new ones.
+
+2001-06-05 02:32 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ importer is now less likely to try to greate nonexitent empty users.
+
+ Makefile now chgrps web ui datafiles
+
+2001-06-05 00:06 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Removed out of date comments in the importer
+ Made the importer grab its libraries from the makefile. (Turned off testing code)
+
+2001-06-05 00:01 jesse
+
+ * Makefile:
+
+ Bumped the version # to 1.3.84 for immediate release
+
+2001-06-04 23:50 jesse
+
+ * Makefile, lib/RT/Ticket.pm, tools/import-1.0-to-2.0:
+
+ Cleanups to Ticket->Import
+ import-1.0-to-2.0 now deals with dates right.
+
+2001-06-04 20:52 jesse
+
+ * lib/RT/Link.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ tools/import-1.0-to-2.0:
+
+ Cleanup to Ticket, Link and User.
+
+ merge now works on import.
+
+ most everything in import other than ticket dates should work now.
+
+2001-06-04 01:34 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ more cleanup
+
+2001-06-04 00:03 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ First cut at importing queue adminccs and acls
+
+2001-06-03 22:16 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ Cleanup and better progress indication
+
+2001-06-03 13:33 jesse
+
+ * lib/RT/Record.pm, lib/RT/Ticket.pm, tools/import-1.0-to-2.0:
+
+ More work on the importer. now it gets transaction creators right and catches requestor email addreses.
+
+2001-06-03 03:43 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm, tools/import-1.0-to-2.0:
+
+ Transaction.pm now allows the caller to turn off scrips (for import)
+ Ticket.pm now has a mostly working import method.
+ import-1.0-to-2.0 seems to have some basic functionality. it's not _working_ yet, but it
+ will do most of what we want it to.
+
+2001-06-02 20:36 jesse
+
+ * webrt/Ticket/Display.html:
+
+ Fix for Ticket #537 Crash when creating ticket without permission to view ticket
+
+2001-06-02 14:22 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ added a couple of todos to the import tool
+
+2001-06-02 14:14 jesse
+
+ * Makefile, tools/import-1.0-to-2.0:
+
+ Work on the importer. it now runs. (note that it probably won't yet _import_ anything)
+
+2001-06-02 12:58 jesse
+
+ * Makefile, bin/webmux.pl, lib/RT/Ticket.pm, lib/RT/Transaction.pm:
+
+ Bumped the version to 1.3.84
+
+ Once again chown mason data directory in webmux.pl, this time
+ using more reliable, dynamic userids, rather than compiled in defaults.
+
+ Added an 'import' method to Ticket, for the RT1 importer.
+
+ Added a Subject method to transaction, to simplify the lives of template authors
+
+2001-06-01 23:38 jesse
+
+ * tools/: import-1.0-to-2.0, insertdata:
+
+ Cleaned up some names and descriptions in insertdata
+
+ First checkin of outline of code of import tool. It's never been run.
+ It's incomplete.
+
+2001-06-01 23:38 jesse
+
+ * tools/import-1.0-to-2.0:
+
+ file import-1.0-to-2.0 was initially added on branch rt-1-1.
+
+2001-05-31 23:27 jesse
+
+ * lib/RT/Tickets.pm:
+
+ Cleaned up Tickets->LimitQueue a bit
+
+2001-05-31 21:22 jesse
+
+ * Makefile, tools/testdeps:
+
+ Fixed testdeps to use new searchbuilder. bumped version to 1.3.83
+
+2001-05-31 21:14 jesse
+
+ * lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Elements/SelectKeyword:
+
+ Logic fixes for keyword select negation
+
+2001-05-31 20:30 jesse
+
+ * lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Elements/SelectKeyword:
+
+ Added support for "Tickets without keyword 'foo'.
+
+2001-05-31 17:32 jesse
+
+ * bin/webmux.pl, lib/RT/Interface/Web.pm,
+ webrt/Ticket/Attachment/dhandler:
+
+ Fix for #522: attachments without names got short shrift.
+ webRT now dies rather than run when users can't log in due to a permissions
+ bug.
+
+2001-05-31 02:57 jesse
+
+ * etc/: schema.Pg, schema.mysql:
+
+ Cleaned up the table indices a bit. for mysql, yanked duplicate indices.
+ for Pg, added an index (we need to regen the schema for pg soon)
+
+2001-05-31 02:46 jesse
+
+ * Makefile, lib/RT/Interface/Web.pm, webrt/Ticket/ModifyAll.html,
+ webrt/Ticket/ModifyPeople.html, webrt/Ticket/Elements/AddWatchers,
+ webrt/Ticket/Elements/EditPeople:
+
+ You can now add watchers by email address
+ Bumped version to 1.3.82
+
+2001-05-29 15:58 jesse
+
+ * webrt/Ticket/Attachment/dhandler:
+
+ Fixed the attachments display bug.
+
+2001-05-29 15:48 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fix for #513 - status update without permissions returns no error message
+
+2001-05-29 00:38 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.81
+
+2001-05-28 20:39 jesse
+
+ * bin/webmux.pl:
+
+ Removed a bogus line from webmux
+
+2001-05-28 20:29 jesse
+
+ * lib/RT/: Ticket.pm, Interface/Web.pm:
+
+ Work to solve 325: updating detritus in update listing
+
+2001-05-28 17:35 jesse
+
+ * bin/rt, etc/schema.mysql, etc/schema.pm, lib/RT/Ticket.pm,
+ lib/RT/Interface/CLI.pm, webrt/Ticket/Attachment/dhandler:
+
+ Work on the CLI to resolve #482. Can't add content when creating tix with the CLI
+ Do a bunch of better error checking on ticket creation.
+
+ Generalized the ticket status checking code.
+
+ Added another index on Attachments for increased speed.
+
+2001-05-28 15:49 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Removed code which auto-opened tickets that were new. It should
+ be a scrip and it's too late in teh release cycle to do this right now.
+
+2001-05-28 15:24 jesse
+
+ * webrt/SelfService/: Details.html, Elements/MyRequests:
+
+ Fixed #506. Non-priv user can't see tickets
+
+2001-05-23 23:53 jesse
+
+ * webrt/SelfService/Elements/MyRequests:
+
+ Fixed MyRequest so it shows your tickets.
+
+2001-05-23 23:18 jesse
+
+ * Makefile:
+
+ Bumped the version to 1.3.80
+
+2001-05-23 23:01 jesse
+
+ * bin/webmux.pl, docs/manual.pod, webrt/Elements/MyRequests,
+ webrt/Elements/MyTickets, webrt/NoAuth/Logout.html,
+ webrt/Ticket/ModifyAll.html:
+
+ Fixed logout bug from 1.3.79 http://fsck.com/rt2/Ticket/Display.html?id=500
+ Fixed bug in jumbo from 1.3.79 http://fsck.com/rt2/Ticket/Display.html?id=496
+ Added a bit of docs about templates to the manual
+
+ Cleaned up the ui for MyRequests and MyTickets a bit.
+
+2001-05-23 12:34 jesse
+
+ * webrt/SelfService/: Prefs.html, index.html:
+
+ Little bit of cleanup to SelfService. added prefs.
+
+2001-05-23 12:34 jesse
+
+ * webrt/SelfService/Prefs.html:
+
+ file Prefs.html was initially added on branch rt-1-1.
+
+2001-05-23 12:07 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.79.
+
+2001-05-23 12:06 jesse
+
+ * README, tools/testdeps:
+
+ Added dependecy on DBIx::SearchBuilder 0.34
+
+2001-05-23 11:43 jesse
+
+ * bin/: rt-mailgate, webmux.pl:
+
+ Made sure that the webui always writes sessions to disk
+ Fixed a typo in the mail gateway.
+
+2001-05-23 00:09 jesse
+
+ * Makefile, bin/rt-mailgate:
+
+ Added a bit of code to rt-mailgate to deal with not properly loading users on
+ ticket creation.
+
+2001-05-22 23:01 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Within Ticket->Create, always get a Queue object as SystemUser for like, defaults and stuff.
+
+2001-05-21 18:12 jesse
+
+ * etc/config.pm:
+
+ Added comments from Feargal about how to configure RT for http urls.
+
+2001-05-21 16:37 jesse
+
+ * Makefile:
+
+ bumped version to 1.3.78
+
+2001-05-21 16:36 jesse
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Display.html:
+
+ Tickets now open when they're new and get acted on.
+
+2001-05-21 16:09 jesse
+
+ * lib/RT/Action/: Autoreply.pm, SendEmail.pm:
+
+ Fix for Ticket #481 $CorrespondAddress= variable in config.pm doesn't work
+
+2001-05-21 15:54 jesse
+
+ * webrt/Elements/MessageBox:
+
+ Added a space at teh end of the line, per the standard convention for signature
+ dashes.
+
+2001-05-21 15:54 jesse
+
+ * webrt/Elements/MessageBox:
+
+ If the user doesn't have a signature, don't include signature dashes
+
+2001-05-21 15:17 jesse
+
+ * lib/RT/Tickets.pm, webrt/Ticket/ModifyAll.html:
+
+ Dead tickets aren't searchable via the ui anymore.
+ ModifyAll is a bit smarter about what to let people do.
+
+2001-05-21 14:02 jesse
+
+ * lib/RT/Keyword.pm, webrt/Admin/Keywords/index.html:
+
+ Editing keywords without permission now actually tells you so.
+
+2001-05-21 13:32 jesse
+
+ * webrt/Admin/: Global/Scrips.html, Queues/Scrips.html:
+
+ Users without permission to delete scrips now get a proper permission denied.
+
+2001-05-21 13:20 jesse
+
+ * webrt/Ticket/: Update.html, Elements/Tabs:
+
+ The ticket update form is now a little smarter about only letting people perform
+ updates that they have the right to perform.
+
+2001-05-17 23:09 jesse
+
+ * Makefile:
+
+ Chmod the makefile in the make dist procedure.
+
+2001-05-17 23:05 jesse
+
+ * README:
+
+ Cleaned up some instructions. Thanks Feargal.
+
+2001-05-17 22:50 jesse
+
+ * Makefile, lib/RT/Transaction.pm, lib/RT/Action/SendEmail.pm,
+ tools/insertdata:
+
+ Fixed scrip actions to activate when there's a missing scripcontent.
+
+ Added a Content method to Transaction.pm
+ Fixed Tempates to use new Content method.
+
+2001-05-17 16:19 jesse
+
+ * lib/RT/Transaction.pm, lib/RT/Action/SendEmail.pm,
+ webrt/Ticket/Display.html, webrt/Ticket/Update.html:
+
+ Better debugging info for some scrips.
+
+ Fixed bugs which prevented status and owner to change on correspondence
+ and comment.
+
+2001-05-17 12:36 jesse
+
+ * Makefile, README:
+
+ Bumped the version. Added Mark Vevers to the thansk in the readme.
+
+2001-05-17 12:34 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Removed some obsolete code. fixed a bug in Comment recording from Mark Vevers
+
+2001-05-16 18:51 jesse
+
+ * Makefile, tools/testdeps:
+
+ Fixed testdeps to not install bogus new DBD::mysql rev.
+ Bumped rev to 1.3.75
+
+2001-05-16 17:30 jesse
+
+ * Makefile:
+
+ bumped to 1.3.74
+
+2001-05-16 17:30 jesse
+
+ * webrt/Admin/Groups/Modify.html:
+
+ Fixed a small bug in Groups editing
+
+2001-05-16 17:21 jesse
+
+ * tools/testdeps:
+
+ Bumped version to 1.3.73.
+ Bumped dependency on searchbuilder to 0.33
+
+2001-05-16 17:15 jesse
+
+ * webrt/: Elements/TitleBoxStart, Ticket/Update.html,
+ Ticket/Elements/Tabs:
+
+ The quick link for 'Resolve' now requests that the user enter a ticket update
+
+2001-05-16 15:45 jesse
+
+ * README, lib/RT/Interface/Web.pm, tools/testdeps,
+ webrt/Ticket/Display.html:
+
+ Added some documentation about what to do if the install fails.
+
+ Specified a minimum working version of DBD::mysql.
+
+ Fixed support for entering updates via the webui.
+
+2001-05-15 00:55 jesse
+
+ * lib/RT/Action/Autoreply.pm:
+
+ Fixed a typo that broke autoreplies
+
+2001-05-15 00:37 jesse
+
+ * tools/testdeps:
+
+ added Errno dependency
+
+2001-05-14 23:44 jesse
+
+ * etc/config.pm, tools/insertdata, webrt/Admin/Queues/People.html:
+
+ Cleaned up a bit of phrasing. cleaned up some extra /s in urls.
+
+2001-05-14 22:49 jesse
+
+ * Makefile, bin/mason_handler.fcgi, bin/mason_handler.scgi, bin/rt,
+ bin/webmux.pl, lib/Makefile.PL, lib/RT/Date.pm,
+ lib/RT/Interface/Web.pm, tools/testdeps:
+
+ Switched from Date::Manip To Graham Barr's Date::Parse
+
+2001-05-14 18:58 jesse
+
+ * lib/RT/Scrips.pm, lib/RT/Ticket.pm, lib/RT/Interface/Web.pm,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/Tabs:
+
+ Work on the web frontend. the "quick" links have been cleaned up and decomplexified.
+
+2001-05-14 17:11 jesse
+
+ * lib/RT/User.pm, lib/RT/Interface/Web.pm,
+ webrt/Admin/Groups/Modify.html, webrt/Admin/Users/Modify.html:
+
+ Cleaned up bugs related to spurious extra display of information in user and group modification and ACL deletion
+ when the user didn't have the right to do so.
+
+2001-05-13 23:05 jesse
+
+ * webrt/Admin/Users/index.html:
+
+ no longer provide a link to create a new user to someone who doesn't have rights to do so.
+
+2001-05-13 22:49 jesse
+
+ * lib/RT/Ticket.pm, tools/insertdata, webrt/Ticket/Modify.html:
+
+ yanked bogus Ticket Queue caching
+ rephrased ticket creation autoreply
+
+2001-05-13 22:15 jesse
+
+ * webrt/User/Prefs.html:
+
+ Added a hack to make sure that session gets written to disk
+
+2001-05-13 22:11 jesse
+
+ * webrt/User/Prefs.html:
+
+ more work on letting users edit their own passwords
+
+2001-05-13 21:40 jesse
+
+ * webrt/Ticket/: Attachment/dhandler, Elements/ShowTransaction:
+
+ Fix for #433. now attachements are displayable after merges.
+
+2001-05-12 17:46 jesse
+
+ * Makefile, lib/Makefile.PL, tools/testdeps, webrt/User/Prefs.html:
+
+ Started work on user prefs. password changing is untested
+
+ Fixed dependency on SB to .31 and bumped version
+
+2001-05-11 12:32 jesse
+
+ * lib/RT/Record.pm:
+
+ turned on use of DBIx::SearchBuilder::Record::Cachable
+
+2001-05-11 12:30 jesse
+
+ * lib/RT/User.pm, webrt/Elements/Quicksearch:
+
+ Redid how the ACL checking works for great perf gains.
+ Added stalled lists to quicksearch.
+
+2001-05-09 20:11 jesse
+
+ * Makefile:
+
+ Bumping the version # so people working off cvs get less confused.
+
+2001-05-09 20:11 jesse
+
+ * bin/rt-mailgate, lib/RT/Queue.pm, lib/RT/Action/Autoreply.pm,
+ lib/RT/Action/Notify.pm, lib/RT/Action/NotifyAsComment.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ Cleanup in the mail sending stuff.
+ fix for ticket 403: RT should no longer send mail when it has
+ no recipients
+
+ fix for #404: Squelch-Replies-To should be a bit more intelligent,
+ since it was rewritten from scratch
+
+ RT should now properly send mail to queue ccs and queue admin ccs
+ when you ask it to
+
+ internally, RT's mail sending stuff now lets you pass around
+ arrays of addresses to send mail to, rather than comma delimited
+ strings. More flexible down the line.
+
+2001-05-09 16:39 jesse
+
+ * README:
+
+ Updated the readme to note the dependency on setuid perl
+
+2001-05-09 16:08 jesse
+
+ * webrt/Ticket/Elements/ShowLinks:
+
+ fix for RT/fsck.com: Ticket #440 [rt-devel] 'Depended on by' doesn't work
+
+2001-05-08 20:48 jesse
+
+ * etc/schema.mysql, etc/schema.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, webrt/Admin/Elements/UserTabs,
+ webrt/Admin/Queues/People.html, webrt/Elements/MyRequests,
+ webrt/Elements/MyTickets, webrt/Elements/Tabs,
+ webrt/Ticket/Elements/ShowBasics,
+ webrt/Ticket/Elements/ShowRequestor:
+
+ Schema.pm now has a few more indices. the mysql schema has been regenerated, but not
+ the Pg or oracle schemas.
+
+ in Ticket.pm, a message got the queue id replaced with the queue name
+
+ removed a spurious variable localization in Transaction.pm
+
+ Removed a pointer to a nonexistent page on admin/user/modify
+
+ Modifying queue watchers now has a more coherent title
+
+ "This user's tickets, My requests and My tickets are now limited to the 25 highest priority items
+ attached to you.
+
+ The "Administration" tab has been changed to the "Configuration" tab
+
+2001-04-04 16:55 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Fixing a comment in the web interface. no functional changes.
+
+2001-04-04 16:52 jesse
+
+ * Makefile:
+
+
+ Bumping the version to 1.3.70 for release
+
+2001-04-04 16:51 jesse
+
+ * lib/RT/User.pm:
+
+ lib/RT/User no longer treats "ModifySelf" as equivalent to "AdminUsers" for the current user.
+
+2001-04-04 15:08 jesse
+
+ * lib/RT/KeywordSelect.pm, lib/RT/Action/Autoreply.pm,
+ webrt/Admin/Global/Keywords.html, webrt/Admin/Queues/Keywords.html:
+
+ Fixed a crashing bug and an ACL violation on keywordselect deletion
+
+2001-04-04 00:19 jesse
+
+ * Makefile:
+
+ bumping version for release
+
+2001-04-03 21:14 jesse
+
+ * Makefile:
+
+ Bumped the version
+
+2001-04-03 21:08 jesse
+
+ * etc/config.pm, lib/RT/Action/Notify.pm:
+
+ Added configuration tweak to not set a :; To header if the user doesn't want it.
+
+2001-04-03 17:32 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ Fix for sendmail null list syntax. : ; is not the same as :; to sendmail
+
+2001-04-03 17:05 jesse
+
+ * webrt/Admin/Queues/: GroupRights.html, UserRights.html:
+
+ removed a couple of stray 's in the html
+
+2001-04-03 16:50 jesse
+
+ * webrt/Elements/Header:
+
+ Dropped doctype back to 4.0 because 4.01 makes mozilla render things funny
+
+2001-04-03 16:47 jesse
+
+ * webrt/Elements/Quicksearch:
+
+ <TABLE>
+ should have been </TABLE>
+
+2001-04-03 16:30 jesse
+
+ * webrt/Elements/Quicksearch:
+
+ Added a feature request/patch from nick@netability.ie
+ http://fsck.com/rt2/Ticket/Display.html?id=345
+
+2001-04-03 16:01 jesse
+
+ * tools/testdeps:
+
+ Adding in testing for params::validate 0.02
+
+2001-04-03 15:46 jesse
+
+ * Makefile:
+
+ Bumped the version slightly for a prerelease
+
+2001-04-03 15:40 jesse
+
+ * lib/RT/Action/Autoreply.pm, lib/RT/Action/SendEmail.pm,
+ tools/insertdata:
+
+ Fixed autoreply by adding a new scrip. some misc. cleanup in SendEmail (method calls were on the wrong object)
+
+2001-04-03 15:40 jesse
+
+ * lib/RT/Action/Autoreply.pm:
+
+ file Autoreply.pm was initially added on branch rt-1-1.
+
+2001-04-03 15:15 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ Fixed a bug in the 'blacklist' regexp
+
+2001-04-03 15:04 jesse
+
+ * etc/config.pm, lib/RT/Action/SendEmail.pm,
+ lib/RT/Interface/Web.pm, webrt/Ticket/Elements/ShowRequestor:
+
+ Two seperate fixes for the "RT doesn't send mail" problem. One that helps fix Mail::Internet->send
+ and one that provides an alternative.
+
+ A fix for a bad link in ShowRequestor.
+
+ Updating fields via the web ui should now be a bit more descriptive
+
+2001-04-03 02:31 jesse
+
+ * webrt/Ticket/ModifyPeople.html:
+
+ Missed one of the mason fixes
+
+2001-04-03 02:31 jesse
+
+ * Makefile, bin/rt-mailgate, etc/config.pm, lib/RT/Date.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm, lib/RT/Watcher.pm,
+ lib/RT/Interface/Web.pm, webrt/Admin/Global/GroupRights.html,
+ webrt/Admin/Global/Keywords.html, webrt/Admin/Global/Scrips.html,
+ webrt/Admin/Global/UserRights.html,
+ webrt/Admin/Keywords/index.html,
+ webrt/Admin/Queues/GroupRights.html,
+ webrt/Admin/Queues/Keywords.html, webrt/Admin/Queues/People.html,
+ webrt/Admin/Queues/Scrips.html, webrt/Admin/Queues/UserRights.html,
+ webrt/Ticket/Modify.html, webrt/Ticket/ModifyAll.html,
+ webrt/Ticket/ModifyDates.html, webrt/Ticket/ModifyPeople.html:
+
+ Added support for parsing Cc and To in the mail gateway
+ (resolves the last work item for beta 2 - #219)
+
+ Ticket due date is no longer set to "right now" if the queue has an
+ undefined "default due in"
+
+ Cleanup warnings in date, ticket and watcher
+
+ fixes for a bunch of mason 1.01 related bugs (Mason changed handling of combined GET and POST, thus breaking RT)
+
+2001-04-02 23:15 jesse
+
+ * README, bin/webmux.pl:
+
+ Cleanup for mason 1.01.
+ Moved Apache::DBI out of the webmux into the instructions
+
+2001-04-02 17:56 jesse
+
+ * tools/initdb:
+
+ Typo fix from "Nick Hilliard" <nick@netability.ie>
+
+2001-04-02 15:32 jesse
+
+ * Makefile, lib/RT/Keyword.pm, webrt/NoAuth/Logout.html:
+
+ Makefile cleanup.
+ Fix for #342 - reported by ivan
+
+ Fix for a bug that clobbered logouts.
+
+2001-04-02 03:09 jesse
+
+ * Makefile:
+
+ Bumped version for release
+
+2001-04-01 19:19 jesse
+
+ * bin/rtadmin, lib/RT/ACE.pm, lib/RT/Interface/Web.pm,
+ webrt/Admin/Elements/SelectRights,
+ webrt/Admin/Global/GroupRights.html,
+ webrt/Admin/Global/UserRights.html,
+ webrt/Admin/Queues/GroupRights.html,
+ webrt/Admin/Queues/UserRights.html:
+
+ Redid the ACL editor so that it's much much faster. and easier to use...if not quite as pretty.
+
+2001-04-01 17:31 jesse
+
+ * webrt/Ticket/Elements/: ShowDates, ShowRequestor:
+
+ fixing a couple of html typos
+
+2001-03-31 03:07 jesse
+
+ * Makefile:
+
+ fixing Changelog generation
+
+2001-03-31 02:52 jesse
+
+ * Makefile:
+
+ Bumped the version.
+
+2001-03-31 02:52 jesse
+
+ * webrt/User/Prefs.html:
+
+ Cleaned up user preferences somewhat. removed things that don't do anything.
+
+ -j
+
+2001-03-31 01:59 jesse
+
+ * bin/rt:
+
+ Fix for #88 RT now lets you use the CLI to search for tickets, based on links to other tickets
+
+2001-03-31 01:20 jesse
+
+ * README:
+
+ Fix for #216: Web session files need better handling and cleanup
+
+2001-03-31 00:49 jesse
+
+ * Makefile, README, bin/rtadmin, bin/webmux.pl, etc/config.pm:
+
+ Moved RT Session data out of /tmp to somewhere that makes more sense.
+ This is the first half of the fix for #216. Now we just need to document the cronjob reaper to kill old sessions
+
+ Cleaned up creation of queues and users in bin/rtadmin
+
+ Updates to the README
+
+2001-03-30 23:44 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fix for http://fsck.com/rt2/Ticket/Display.html?id=324
+ mail from requestors does not reopen ticket
+
+2001-03-30 23:19 jesse
+
+ * bin/rtadmin, lib/RT/Queue.pm, lib/RT/Watcher.pm:
+
+ Work on Watchers and editing watchers from the CLI tool. added support for --list-{queues|users|groups}
+
+2001-03-30 19:31 jesse
+
+ * bin/rt, lib/RT/ACE.pm, lib/RT/Queue.pm, lib/RT/Ticket.pm,
+ lib/RT/Tickets.pm, lib/RT/Watcher.pm, lib/RT/Action/SendEmail.pm,
+ lib/RT/Interface/Web.pm:
+
+ A bunch of reworking of access control for watchers. should be much more robust
+ and more flexible.
+
+ Resolves http://fsck.com/rt2/Ticket/Display.html?id=253 by adding the "Watch" and "WatchAsAdminCc" rights.
+
+2001-03-30 15:41 jesse
+
+ * lib/RT/: Action/Notify.pm, Interface/Web.pm:
+
+ Tiny cleanup in Interface/Web.pm. no functional difference there just being more explicit.
+
+ Fix for #292: Sender of a message is no longer notified of that message.
+
+2001-03-30 02:55 jesse
+
+ * Makefile:
+
+ Bumped the version
+
+2001-03-30 02:37 jesse
+
+ * webrt/Elements/SelectDate:
+
+ Fixed an as-yet-untickled bug in SelectDate that incremented things too much
+
+2001-03-30 02:32 jesse
+
+ * lib/RT/Template.pm, webrt/Admin/Global/Scrips.html:
+
+ Fixes to template creation. stupid typo.
+ Global scrips creation should now work better
+
+2001-03-30 02:12 jesse
+
+ * webrt/: Admin/Elements/GroupTabs, Admin/Groups/Members.html,
+ Admin/Groups/Modify.html, Admin/Users/Modify.html,
+ Elements/ListActions:
+
+ Fix for PseudoGroups having a prompt to add members.
+ some cleanups to not make the "Results" box pop up when it's not wanted.
+
+2001-03-30 01:41 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Attached is a patch to implement the ShowTicketComments in the
+ display of transactions of a ticket.
+
+ Arthur de Jong <arthur@West.NL>
+
+2001-03-30 01:34 jesse
+
+ * lib/RT/Scrip.pm, webrt/Admin/Global/Scrips.html,
+ webrt/Admin/Queues/Scrips.html:
+
+ Fix for 328: Re: [rt-users] 1.3.64 & postgres & scrips
+ there was an ACL bug.
+
+2001-03-28 22:15 jesse
+
+ * Makefile, webrt/autohandler:
+
+ Fixed a tiny bug in the new authandler that caused logout to fail
+
+2001-03-27 22:30 jesse
+
+ * webrt/index.html:
+
+ fixed index.html
+
+2001-03-27 22:26 jesse
+
+ * Makefile, webrt/Admin/Groups/Members.html,
+ webrt/Ticket/Update.html:
+
+ Added a couple of fixes from Arthur at west.nl
+ Groups/Members deals better with multiple selections
+ Ticket/Update now displays queue watchers.
+ bumped the version to 1.3.63
+
+2001-03-27 04:25 jesse
+
+ * docs/manual.pod, webrt/autohandler, webrt/index.html,
+ webrt/Admin/Users/index.html, webrt/Elements/ShadedBox,
+ webrt/Search/Listing.html:
+
+ Lots of cleanup of the auothandler.
+ a tiny bit of doc about an alternative apache configuration.
+ some web ui cleanup so that when you are on a page, your location is more properly hilighted.
+ admin/users includes some more verbiage explaining what's going on.
+
+2001-03-25 00:44 jesse
+
+ * Makefile, lib/RT/Interface/Web.pm:
+
+ Bumped the version.
+ cosmetic fix in Interface/Web.pm
+
+2001-03-23 20:33 jesse
+
+ * lib/RT/: Action/SendEmail.pm, Interface/Web.pm:
+
+ Fixed for TEXTAREA newline bug and Correspondence subject bug.
+
+2001-03-23 00:34 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ : goes outside the '' in undisclosed recipients
+
+2001-03-23 00:30 jesse
+
+ * lib/RT/: ACL.pm, ObjectKeywords.pm:
+
+ Removed some very loud uneccesary debugging statements
+
+2001-03-23 00:27 jesse
+
+ * Makefile, lib/RT/Action/Notify.pm, lib/RT/Action/SendEmail.pm:
+
+ Work on mail sending routines to be more careful about newlines in subjects.
+ And about Undisclosed recipients
+
+2001-03-22 23:17 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ yet another typo in notify.pm
+
+2001-03-22 23:12 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ typo fix
+
+2001-03-22 23:09 jesse
+
+ * lib/RT/Action/: Notify.pm, SendEmail.pm:
+
+ Cleanups and fixes to Notify and SendEmail
+
+2001-03-22 19:46 jesse
+
+ * webrt/Ticket/ModifyAll.html:
+
+ TicketObj->Ticket
+
+2001-03-22 19:42 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ A more functional Undisclosed Recipients;
+
+2001-03-22 19:28 jesse
+
+ * webrt/Ticket/: ModifyAll.html, Elements/Tabs:
+
+ Elements/Tabs now does better access control checking before making
+ buttons available to people.
+
+ ModifyAll.html has a better title and should now update objectkeywords.
+
+2001-03-22 18:18 jesse
+
+ * lib/RT/: Date.pm, Ticket.pm:
+
+ Added a routine to Date.pm to advance the date N days
+
+ Started using queue defaults on Ticket->Create
+
+2001-03-22 18:17 jesse
+
+ * webrt/: autohandler, Elements/Login, NoAuth/Login.html,
+ Search/autohandler, Ticket/autohandler:
+
+ Cleanup of the login process. now you can't accidentally call "Login.html"
+ when you're already logged in.
+ removed a couple of bogus old autohandlers
+
+2001-03-22 18:17 jesse
+
+ * webrt/Elements/Login:
+
+ file Login was initially added on branch rt-1-1.
+
+2001-03-22 14:45 jesse
+
+ * webrt/Ticket/Elements/EditPeople:
+
+ EditPeople should now enforce a list of possible owners reasonably
+
+2001-03-21 21:40 jesse
+
+ * Makefile:
+
+ bumped the version to .60
+
+2001-03-21 21:22 jesse
+
+ * docs/manual.pod:
+
+ Adding some content to the manual. and even more places where the manual is
+ missing content. :/
+
+2001-03-21 12:21 jesse
+
+ * lib/RT/Action/NotifyAsComment.pm:
+
+ NotifyAsComment should now DTRT and send mail from the comments email address
+
+2001-03-21 02:46 jesse
+
+ * Makefile:
+
+ yanked some cruft from the ChangeLog creator
+
+2001-03-21 02:44 jesse
+
+ * Makefile, README:
+
+ Bumped the version. added some people to the readme
+
+2001-03-21 02:39 jesse
+
+ * webrt/Ticket/Elements/ShowBasics:
+
+ Fix for 242: time left displayed via the web ui is now more intuitive
+
+2001-03-21 02:37 jesse
+
+ * bin/rt, bin/rt-mailgate, lib/RT.pm, lib/RT/Attachment.pm,
+ lib/RT/Date.pm, lib/RT/Tickets.pm, lib/RT/User.pm:
+
+ Added more error checking and error handling to the mail gateway
+ finished code in Attachment.pm to handle too-long attachments
+
+ added support for limiting by date to the CLI
+
+ fixed little bugs in user, date and tickets.
+
+2001-03-20 19:02 jesse
+
+ * docs/manual.pod:
+
+ file manual.pod was initially added on branch rt-1-1.
+
+2001-03-20 19:02 jesse
+
+ * docs/manual.pod:
+
+ actually adding the outline of the manual
+
+2001-03-20 19:01 jesse
+
+ * Makefile, bin/rt, docs/API, docs/README.docs, docs/Security,
+ docs/keywords, etc/config.pm:
+
+ Starting the doc cleanup
+
+2001-03-20 15:26 jesse
+
+ * webrt/Elements/SelectTicketSortBy:
+
+ LastUpdated, not LastUpdate
+
+2001-03-20 15:21 jesse
+
+ * webrt/Elements/: SelectDate, SelectTicketSortBy:
+
+ more things to sort by.
+ select date shouldn't insert spurious null dates.
+
+2001-03-20 13:27 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ fixed a typo. $defined is not useful perl ;)
+
+2001-03-20 13:21 jesse
+
+ * lib/RT/Action/: Notify.pm, SendEmail.pm:
+
+ Fixed a couple bugs in Notify and SendEmail that should get mail flowing
+ for transactions without content.
+
+2001-03-20 13:08 jesse
+
+ * webrt/Ticket/: Attachment/dhandler, Elements/ShowTransaction:
+
+ Making web based attachment display deal nicely with too-long message bodies
+
+2001-03-20 04:26 jesse
+
+ * Makefile:
+
+ bumping the version
+
+2001-03-20 04:20 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ regexps with three /s need a leading s ;)
+
+2001-03-20 04:16 jesse
+
+ * bin/rt-mailgate, lib/RT/Template.pm:
+
+ fixing scrips-related mailing stuff. some transaction mailing used to bomb out.
+
+2001-03-20 02:46 jesse
+
+ * Makefile, bin/rt-mailgate, etc/config.pm,
+ lib/RT/Action/SendEmail.pm, tools/insertdata:
+
+ Work on robustification of the mail gateway. including single-transaction
+ blacklisting of addresses that might generate bounces.
+
+2001-03-20 00:41 jesse
+
+ * lib/RT/User.pm:
+
+ Work on user.pm to allow users to be disabled.
+
+2001-03-19 18:03 jesse
+
+ * webrt/: autohandler, Elements/MyRequests, NoAuth/Login.html,
+ NoAuth/Reminder.html:
+
+ fixed the MyRequests bug that caused them not to be listed.
+ nonexistent users no longer get shunted to SelfService.
+
+2001-03-19 15:30 jesse
+
+ * Makefile, bin/mason_handler.fcgi, bin/mason_handler.scgi, bin/rt,
+ bin/rt-mailgate, bin/rtadmin, webrt/Admin/Elements/ModifyTemplate,
+ webrt/Admin/Elements/ModifyUser, webrt/Admin/Global/Template.html,
+ webrt/Admin/Queues/Template.html, webrt/Admin/Users/Modify.html,
+ webrt/Elements/MessageBox:
+
+ Fixes for perl path and textarea bugs noted by Arthur de Jong
+
+2001-03-18 14:58 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Removed an extra signature attachment
+
+2001-03-17 14:57 jesse
+
+ * Makefile:
+
+ bumped version
+
+2001-03-17 14:55 jesse
+
+ * lib/Makefile.PL, lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Elements/Quicksearch, webrt/Elements/SelectDate,
+ webrt/Elements/SelectDateType, webrt/Elements/TitleBoxEnd,
+ webrt/Search/PickRestriction:
+
+ Fixed a bug on simple actions reported by christian.
+ Implemented search by date via web ui
+
+2001-03-16 03:55 jesse
+
+ * Makefile, lib/RT/Interface/Web.pm, webrt/Elements/Header:
+
+ Fixed a tiny typo that prevented objectkeyword editing
+
+2001-03-16 02:29 jesse
+
+ * Makefile:
+
+ Bumped the version.
+
+2001-03-16 02:27 jesse
+
+ * Makefile, README, bin/initacls.Oracle, bin/initacls.Pg,
+ bin/initacls.mysql, bin/initdb.Oracle, tools/initdb:
+
+ some clarifications to the install procedure.
+
+2001-03-16 02:10 jesse
+
+ * lib/RT/Tickets.pm, webrt/Search/Listing.html:
+
+ Fixed #2 WebRT doesn't refresh searches properly. the oldest bug in the bug tracking
+ system ;)
+
+ Fixed Tickets->Count
+
+2001-03-16 01:39 jesse
+
+ * webrt/Admin/: Global/Template.html, Global/Templates.html,
+ Queues/Modify.html, Queues/Template.html, Queues/Templates.html:
+
+ now you can create templates with the web ui.
+
+2001-03-16 00:39 jesse
+
+ * webrt/Ticket/Elements/EditLinks:
+
+ file EditLinks was initially added on branch rt-1-1.
+
+2001-03-16 00:39 jesse
+
+ * webrt/Ticket/ModifyAll.html:
+
+ file ModifyAll.html was initially added on branch rt-1-1.
+
+2001-03-16 00:39 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Interface/Web.pm, webrt/Elements/Tabs,
+ webrt/Ticket/Modify.html, webrt/Ticket/ModifyAll.html,
+ webrt/Ticket/ModifyDates.html, webrt/Ticket/ModifyLinks.html,
+ webrt/Ticket/ModifyPeople.html, webrt/Ticket/ValidateUpdate.html,
+ webrt/Ticket/Elements/EditKeywordSelects,
+ webrt/Ticket/Elements/EditLinks, webrt/Ticket/Elements/EditPeople,
+ webrt/Ticket/Elements/Tabs:
+
+ A bunch of Ticket modification refactoring and cleanup.
+ Added a "ModifyAll" at sam hartman's suggestion
+
+2001-03-14 21:20 jesse
+
+ * bin/rt:
+
+ --id=43-45 should now work. there was a regex typo
+
+2001-03-14 04:37 jesse
+
+ * Makefile, bin/initacls.Oracle, etc/acl.Oracle, etc/acl.mysql,
+ etc/schema.Oracle, etc/user.Oracle, tools/initdb, tools/testdeps:
+
+ reworked init procedures, oracle schema and
+ acl setup for mysql and postgres and oracle.
+
+ RT2 now runs on oracle.
+
+2001-03-14 02:08 jesse
+
+ * etc/acl.Oracle, etc/schema.Oracle, tools/initdb:
+
+ hacking to make oracle work. we're much of the way there. next up:
+ schema updates
+
+2001-03-14 02:08 jesse
+
+ * etc/acl.Oracle:
+
+ file acl.Oracle was initially added on branch rt-1-1.
+
+2001-03-14 01:03 jesse
+
+ * webrt/Admin/Queues/GroupRights.html:
+
+ file GroupRights.html was initially added on branch rt-1-1.
+
+2001-03-14 01:03 jesse
+
+ * webrt/Admin/Queues/UserRights.html:
+
+ file UserRights.html was initially added on branch rt-1-1.
+
+2001-03-14 01:03 jesse
+
+ * Makefile, lib/RT/ACE.pm, lib/RT/Interface/Web.pm, tools/initdb,
+ webrt/Admin/Elements/QueueTabs,
+ webrt/Admin/Global/GroupRights.html, webrt/Admin/Queues/ACL.html,
+ webrt/Admin/Queues/GroupRights.html,
+ webrt/Admin/Queues/UserRights.html, webrt/Elements/Tabs,
+ webrt/NoAuth/webrt.css:
+
+ Cleanup to the ACL editors (consistency)
+ a bit of web ui tuning.
+
+ fixes for initdb issues (thanks, jhutz)
+
+ minor cleanups to ACE.pm
+
+2001-03-13 22:44 jesse
+
+ * lib/RT/Transaction.pm, lib/RT/Transactions.pm, tools/testdeps:
+
+ Updated DBIx::SearchBuilder dependency
+
+ code cleanup and sketching in Transaction.pm and Transactions.pm
+
+2001-03-12 21:14 jesse
+
+ * Makefile, etc/schema.Pg, etc/schema.mysql, tools/initdb,
+ tools/testdeps:
+
+ initdb now caches schema, eliminating the install-time dependency on DBIx::DBSchema.
+
+ this is 1.3.50, folks. it has what I believe to be functional postgres support
+
+2001-03-11 21:58 jesse
+
+ * etc/config.pm, etc/schema.pm, lib/RT/Attachment.pm,
+ lib/RT/Ticket.pm, tools/initdb:
+
+ Cleanup in Ticket.pm
+ Bugfixes to Attachment.pm (for postgres mimencoding supporT)
+
+ reconfigured to use the new DBIx::DBSchema (which isn't out yet. but should
+ be soon)
+
+ still need to do a bit more work on attachments configuration.
+
+2001-03-11 02:45 jesse
+
+ * bin/rt-mailgate:
+
+ file rt-mailgate was initially added on branch rt-1-1.
+
+2001-03-11 02:45 jesse
+
+ * Makefile, README, bin/rt-mailgate, bin/rtmux.pl, bin/webmux.pl,
+ etc/config.pm, etc/schema.Oracle, etc/schema.pm, lib/RT.pm,
+ lib/RT/Attachment.pm, lib/RT/ScripAction.pm, lib/RT/Ticket.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Interface/CLI.pm,
+ lib/RT/Interface/Email.pm, tools/insertdata:
+
+ This is a bit more of a 'comprehensive' diff than I'd intended. That's what
+ I get for working for 1/2 a week at my parents place without real net ;)
+
+ Cleanups in the makefile and readme to make installation simpler and more
+ sensical.
+
+ removed outdated rtmux.pl
+ moved old Interface/Email.pm to bin/rt-mailgate
+ started new baseclass for new mail gateways (Interface/Email.pm)
+
+ first cut implementation of attachment size limits.
+
+ switched mysql to use 'longblob' rather than just 'blob', so
+ that users can submit > 64k attachments. with the next release
+ of DBIx::DBSchema, we should have what we need to get
+ PG attachmetns of more reasonable sizes working.
+
+ first cut implementation of base64 encoding for MIME objects
+ on databases that don't support BLOBs (postgres)
+
+ restructured initdb so we'll be able to support databases
+ for which we need to hand-hack schema.
+
+ added the 'Owner' pseudogroup to insertdata
+
+ fixed the bug in logging for the mail gateway that caused
+ lots of warnings about joins.
+
+ lots of work on the mail gateway to start to clean up and restructure
+ things.
+
+2001-03-10 18:53 jesse
+
+ * tools/initdb:
+
+ Refactoring initdb to make it easier to do things like add oracle support. yay
+
+2001-03-09 15:19 jesse
+
+ * lib/RT/Condition/StatusChange.pm:
+
+ file StatusChange.pm was initially added on branch rt-1-1.
+
+2001-03-09 15:19 jesse
+
+ * Makefile, etc/config.pm, lib/RT/Attachment.pm, lib/RT/Link.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm, lib/RT/Watcher.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Condition/AnyTransaction.pm,
+ lib/RT/Condition/Generic.pm, lib/RT/Condition/StatusChange.pm,
+ tools/insertdata, tools/testdeps:
+
+ OnResolve scrip now works.
+ some cleanup on Scrips and Watchers.
+ commented out some debug messages that aren't immediately useful
+
+2001-03-09 15:15 jesse
+
+ * webrt/Ticket/: ModifyDates.html, Elements/EditWatchers:
+
+ Two bugfixes:
+ one, editdates no longer errors out on 5.005
+ two, links from watchers to the ModifyUser page now work properly
+
+2001-03-08 15:21 jesse
+
+ * Makefile, lib/RT/User.pm, tools/insertdata:
+
+
+ Fixed a bootstrapping bug introduced with the new acls on Create.
+ bumped version to 1.3.49_01
+
+2001-03-07 00:40 jesse
+
+ * lib/: test.pl, RT/ACE.pm, RT/CurrentUser.pm, RT/Group.pm,
+ RT/GroupMember.pm, RT/Keyword.pm, RT/KeywordSelect.pm, RT/Link.pm,
+ RT/Queue.pm, RT/Scrip.pm, RT/ScripAction.pm, RT/Template.pm,
+ RT/Ticket.pm, RT/Transaction.pm, RT/User.pm, RT/Watcher.pm:
+
+ acls for Delete methods that needed them.
+ flat lockouts on Delete methods that needed them.
+
+ test.pl got 'use *' added to it
+
+2001-03-06 18:07 jesse
+
+ * lib/RT/Attachment.pm:
+
+ Backing out changes that broke ->Content
+
+2001-03-06 17:42 jesse
+
+ * Makefile, lib/RT/Attachment.pm, lib/RT/Record.pm,
+ lib/RT/Interface/Web.pm, webrt/Elements/SelectSortOrder,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction:
+
+ work on Attachments.
+ cleanup on sorting and limiting.
+
+2001-03-06 16:26 jesse
+
+ * webrt/Search/PickRestriction:
+
+ adding a header
+
+2001-03-04 19:46 jesse
+
+ * etc/schema.pm:
+
+ Schema change to support postgres
+
+2001-03-04 19:44 jesse
+
+ * lib/RT/Record.pm:
+
+ Small change for new DBIx::SearchBuilder::Record PrimaryKey behaviors..
+
+2001-03-04 19:15 jesse
+
+ * bin/rt:
+
+ rt --id=<int> should work now
+
+2001-03-02 00:26 jesse
+
+ * etc/config.pm, lib/RT/Date.pm, lib/RT/Ticket.pm,
+ webrt/Ticket/ModifyDates.html:
+
+ first pass on dates and timezones...seems to work. for common ops
+
+2001-02-28 16:34 jesse
+
+ * lib/RT/User.pm:
+
+ fix for RT/fsck.com: Ticket #208 User->Create needs more argument checking
+ added a check to User->Create to make sure a name was specified
+
+2001-02-28 08:56 jesse
+
+ * Makefile, bin/rtadmin:
+
+ Enabled the ability to set a user's password via the CLI
+
+2001-02-27 22:09 jesse
+
+ * lib/Makefile.PL, tools/testdeps:
+
+ Bumping required version of searchbuilder in testdeps and lib/Makefile.pl
+
+2001-02-27 22:00 jesse
+
+ * webrt/Elements/SelectKeyword:
+
+ allowing undef keywords
+
+2001-02-27 21:43 jesse
+
+ * webrt/Admin/Queues/Scrips.html:
+
+ Fix for ticket #50. grammar in per queue scrip descriptions
+
+2001-02-27 21:41 jesse
+
+ * tools/insertdata:
+
+ resolving ticket #181- extra \s in the autoreply template
+
+2001-02-27 21:36 jesse
+
+ * Makefile, lib/RT/Transaction.pm, tools/testdeps:
+
+ testdeps now erorrs out if you don't specify a db type.
+
+ queue change transaction descriptions are better.
+
+ bumped the version
+
+2001-02-27 21:12 jesse
+
+ * webrt/Elements/SelectTicketSortBy:
+
+ file SelectTicketSortBy was initially added on branch rt-1-1.
+
+2001-02-27 21:12 jesse
+
+ * webrt/Elements/SelectSortOrder:
+
+ file SelectSortOrder was initially added on branch rt-1-1.
+
+2001-02-27 21:12 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Elements/SelectKeyword, webrt/Elements/SelectResultsPerPage,
+ webrt/Elements/SelectSortOrder, webrt/Elements/SelectTicketSortBy,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction:
+
+ Basic ticket sorting has been implemented.
+ Ticket listing by pages works too.
+
+ a bit of cleanup in the ticket listing. now select by keywords uses the component designed for that purpose
+
+2001-02-26 15:44 jesse
+
+ * lib/RT/Ticket.pm:
+
+ No longer generate spurious watchers transactions when merging tickets.
+
+2001-02-26 03:08 jesse
+
+ * lib/RT/Ticket.pm:
+
+ fixed a typo in a debug message that prevented compilation
+
+2001-02-26 02:53 jesse
+
+ * Makefile:
+
+ bumped the version for release. again.
+
+2001-02-26 02:52 jesse
+
+ * lib/RT/: ACE.pm, Ticket.pm:
+
+ Fixed a variable redef in ticket and an acl granting bug in ACE
+
+2001-02-26 01:24 jesse
+
+ * Makefile, webrt/Ticket/ModifyLinks.html:
+
+ A bit more merging support.
+ Bumped version for release
+
+2001-02-25 22:28 jesse
+
+ * webrt/Ticket/Elements/: ShowHistory, ShowTransaction:
+
+ Cleaning up the transaction display.
+
+2001-02-25 22:22 jesse
+
+ * lib/RT/: Scrip.pm, ScripCondition.pm, Ticket.pm:
+
+ Some bug fixes for merging.
+ Fixed a bug in Scrips that caused an infinite loop if the user had no rights.
+
+2001-02-24 02:42 jesse
+
+ * Makefile, lib/RT/Ticket.pm:
+
+ Fixed a bug that prevented ticket loading from appearing to work
+
+2001-02-23 19:17 jesse
+
+ * Makefile, lib/RT/Ticket.pm, lib/RT/Interface/Web.pm:
+
+ Fixed a typo in Ticket.pm that prevented transaction lists from working
+ fixed a paste error in Web.pm
+
+2001-02-23 17:41 jesse
+
+ * Makefile:
+
+ Bumped the version # for release
+
+2001-02-23 17:31 jesse
+
+ * Makefile, README, bin/initacls.mysql, bin/webmux.pl,
+ lib/RT/ACE.pm, lib/RT/ACL.pm, lib/RT/Link.pm, lib/RT/Queue.pm,
+ lib/RT/Ticket.pm, lib/RT/User.pm, lib/RT/Interface/Web.pm,
+ tools/initdb, tools/testdeps:
+
+ Fixed a bug that made a first install with mysql fail
+ yanked a UNIVERSAL::AUTOLOADER handler I inserted to test things out.
+ Fixed several ACL creation bugs.
+ Initial implementation of merge for the core.
+ Testdeps now does database testing.
+
+ Made Ticket->Load smarter. (nolonger needs a seperate LoadByURI sub.
+
+ fixed bugs in the readme
+
+2001-02-22 01:03 jesse
+
+ * tools/testdeps:
+
+ Updated dependencies.
+
+2001-02-21 17:49 jesse
+
+ * lib/RT/: Ticket.pm, Tickets.pm:
+
+ Cache Queue in Ticket.pm for added perf.
+ formatting cleanup in Tickets.pm
+
+2001-02-20 14:38 jesse
+
+ * webrt/Ticket/Display.html:
+
+ Uncompressed history on summary page...
+
+2001-02-20 14:18 jesse
+
+ * lib/RT/ScripCondition.pm:
+
+ fixed a pod typo
+
+2001-02-20 14:07 jesse
+
+ * Makefile, etc/schema.pm, lib/MANIFEST, tools/insertdata,
+ webrt/Admin/Users/Modify.html,
+ webrt/SelfService/Elements/ShowTransaction,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ removed a false unique index from schema. pm.
+ make web interface and insertdata deal properly with the fact that email addresses
+ should be unique.
+
+ cleaned up ShowTransaction for the webui. (now uses CreatorObj rather than Creator,
+ as it was confusing
+
+2001-02-20 01:42 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm, Attachment.pm, Attachments.pm,
+ CurrentUser.pm, EasySearch.pm, Group.pm, GroupMember.pm,
+ GroupMembers.pm, Groups.pm, Keyword.pm, KeywordSelect.pm,
+ Keywords.pm, Link.pm, Links.pm, ObjectKeyword.pm,
+ ObjectKeywords.pm, Queue.pm, Queues.pm, Record.pm, Scrip.pm,
+ ScripAction.pm, ScripActions.pm, ScripCondition.pm,
+ ScripConditions.pm, Scrips.pm, Template.pm, Templates.pm,
+ Ticket.pm, Tickets.pm, Transaction.pm, Transactions.pm, User.pm,
+ Users.pm, Utils.pm, Watcher.pm, Watchers.pm, Action/SendEmail.pm:
+
+ A major security audit of the codebase has taken place. I was primarily out for
+ ACL related issues, but took care of a number of other minor cleanups at the same time.
+
+2001-02-19 17:16 jesse
+
+ * NEWS:
+
+ fixed a typo in cli_respond_req
+
+2001-02-15 18:02 jesse
+
+ * webrt/SelfService/: Details.html, Error.html:
+
+ fixing bug #90: SelfService calls to Abort use the 'standard' handler. which includes the wrong header.
+
+2001-02-15 18:02 jesse
+
+ * webrt/SelfService/Error.html:
+
+ file Error.html was initially added on branch rt-1-1.
+
+2001-02-15 17:39 jesse
+
+ * webrt/Admin/Elements/SelectSingleOrMultiple:
+
+ file SelectSingleOrMultiple was initially added on branch rt-1-1.
+
+2001-02-15 17:39 jesse
+
+ * lib/RT/Keyword.pm, lib/RT/KeywordSelect.pm,
+ webrt/Admin/Elements/SelectKeywordSelect,
+ webrt/Admin/Elements/SelectSingleOrMultiple,
+ webrt/Admin/Global/Keywords.html, webrt/Admin/Queues/Keywords.html,
+ webrt/Elements/SelectKeyword, webrt/Elements/SelectKeywordOptions,
+ webrt/Ticket/Elements/ModifyTicket:
+
+ KeywordSelect.pm got an ACL bug fixed.
+ Keyword.pm now does recursive searches in Descendants properly.
+
+ KeyworSelect editing via the webui is now much smarter. and cleaner. and better. and faster, and resolving bug 123
+
+2001-02-15 17:39 jesse
+
+ * webrt/Admin/Elements/SelectKeywordSelect:
+
+ file SelectKeywordSelect was initially added on branch rt-1-1.
+
+2001-02-13 22:54 jesse
+
+ * lib/: Makefile.PL, RT/ACE.pm, RT/Keyword.pm, RT/KeywordSelect.pm,
+ RT/Scrip.pm:
+
+ Better ACL handling for ACEs, Keywords and KeywordSelects.
+ specified more accurate versions of some dependencies in lib/Makefile.PL
+
+2001-02-13 12:51 jesse
+
+ * bin/rtadmin, etc/schema.pm, lib/RT/Keyword.pm,
+ lib/RT/KeywordSelect.pm, lib/RT/KeywordSelects.pm,
+ lib/RT/Keywords.pm, lib/RT/Queue.pm, lib/RT/Queues.pm,
+ lib/RT/User.pm, lib/RT/Users.pm, webrt/Admin/Global/Keywords.html,
+ webrt/Admin/Keywords/index.html, webrt/Admin/Queues/Keywords.html,
+ webrt/Admin/Queues/Modify.html, webrt/Admin/Users/Modify.html:
+
+ Implemented 'Disabled' for Keywords, KeywordSelects, Queues and Users.
+ This supplants 'Delete' for these objects which need to exist to guarantee
+ referential integrity.
+
+ Implemented cli and web interfaces to support the new code.
+
+2001-02-12 18:27 jesse
+
+ * README, bin/rtadmin, etc/schema.pm, lib/RT/Attachment.pm,
+ lib/RT/EasySearch.pm, lib/RT/Link.pm, lib/RT/ObjectKeyword.pm,
+ lib/RT/Queue.pm, lib/RT/Queues.pm, lib/RT/Record.pm,
+ lib/RT/ScripAction.pm, lib/RT/ScripCondition.pm,
+ lib/RT/Template.pm, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Watcher.pm, tools/testdeps:
+
+ Cleaned up LastUpdated / Created/ LastUpdatedBy / Creator to all get set on
+ create for all relevant objects.
+
+ Based on discussions with ivan, changed the 'Deleted' flag on various objects to 'Disabled'
+ to better represent its purpose.
+
+ Fully implemented Disable for queue as a prototype.
+
+ fixed queue attribute editing in cli.
+
+2001-02-12 13:59 jesse
+
+ * tools/testdeps:
+
+ specified a minimum known good version of Getopt::Long
+
+2001-02-12 12:38 jesse
+
+ * lib/RT/Queue.pm, webrt/Ticket/Elements/ShowTransaction:
+
+ transaction links work again.
+ admin ccs get listed.
+
+2001-02-11 22:16 jesse
+
+ * Makefile:
+
+ bumped the version # for a new release
+
+2001-02-11 22:13 jesse
+
+ * lib/RT/Queue.pm, lib/RT/Template.pm, tools/insertdata:
+
+ cleaning up queue create.
+
+2001-02-11 22:12 jesse
+
+ * etc/schema.pm:
+
+ started the work on dealing with Deleting records that need to exist to guarantee ref. integrity
+
+2001-02-11 18:40 jesse
+
+ * NEWS:
+
+ imported brandon's url importing code
+
+2001-02-06 22:59 jesse
+
+ * lib/RT/Queue.pm, webrt/Admin/Queues/Modify.html,
+ webrt/Admin/Users/index.html:
+
+ Fixes to Queue.pm to stop it from clobbering the Name.
+
+ fixed a typo in the webui Admin/Users/index.html
+
+2001-02-06 15:22 jesse
+
+ * lib/RT/Queue.pm, webrt/Admin/Elements/QueueRightsForUser,
+ webrt/Admin/Elements/SelectRights,
+ webrt/Ticket/Elements/ShowMembers:
+
+ ACL fixes in Queue.pm.
+ ACL search fies for the web ui.
+ fixed a recursive subticket display bug.
+
+2001-02-06 12:49 jesse
+
+ * Makefile:
+
+ removed the old rt 1.0 lib/rt directory forever. yay
+
+2001-02-06 12:48 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Added a tiny patch from ivan to not extract nested messages. not totally sure about this one yet.
+
+2001-02-02 01:26 jesse
+
+ * Makefile:
+
+ version bumpin
+
+2001-02-02 01:11 jesse
+
+ * bin/rtadmin, lib/RT/Keyword.pm:
+
+ keyword creation, editing and deletion now works via the cli tool.
+
+ This means that for alpha 4, we're *gasp* feature complete. now to fix lots of bugs.
+
+2001-02-01 02:46 jesse
+
+ * bin/rtadmin, lib/RT/Group.pm, lib/RT/Keyword.pm,
+ lib/RT/KeywordSelect.pm, tools/testdeps, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/ShowHistory,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Commandline editing of keywordselects now works.
+
+ Added in a patch to collapse history on the ticket listing
+ page from Byron Ellacott
+
+ Bumped a few dependecy versions. added a File::Spec dependency, since File::Temp
+ gets it not quote right.
+
+2001-01-31 02:08 jesse
+
+ * bin/rtadmin, lib/RT/Group.pm, webrt/Admin/Groups/Members.html:
+
+ Commandline group editing now works. yay. group membership even.
+ the api changed to be easier to work with and more consistent with other functions
+
+2001-01-30 23:12 jesse
+
+ * lib/RT/Interface/Email.pm, webrt/Ticket/Elements/ShowLinks,
+ webrt/Ticket/Elements/ShowRequestor:
+
+ The email interface now uses tempdir from File::Temp for increased security.
+
+ A couple of webui cleanups to display more sensible things.
+
+2001-01-30 16:42 jesse
+
+ * etc/config.pm, lib/RT/User.pm, lib/RT/Interface/Email.pm:
+
+ Added mail-on-error to the mail gateway. now it should tell you when it fails.
+
+ turned off debugging output from ACLs....
+
+2001-01-29 23:58 jesse
+
+ * bin/rtadmin, lib/RT/ACE.pm, lib/RT/ACL.pm, lib/RT/Scrip.pm,
+ lib/RT/ScripAction.pm, lib/RT/ScripCondition.pm, lib/RT/Scrips.pm,
+ lib/RT/Template.pm, lib/RT/Templates.pm, lib/RT/User.pm,
+ lib/RT/Interface/CLI.pm, lib/RT/Interface/Web.pm,
+ webrt/Admin/Elements/SelectTemplate,
+ webrt/Admin/Global/Template.html,
+ webrt/Admin/Global/Templates.html,
+ webrt/Admin/Queues/Template.html:
+
+ A bunch of work on the admin cli (acl editor now works)
+
+ a couple API changes to standardize method names across classes
+ template editing via the web should work better now.
+
+2001-01-29 23:56 jesse
+
+ * webrt/Elements/: TitleBoxEnd, TitleBoxStart:
+
+ Futzing with the title box to make it a bit more consistent
+
+2001-01-29 23:54 jesse
+
+ * lib/RT/Record.pm:
+
+ Removed a redundant sub new
+
+2001-01-29 22:22 jesse
+
+ * lib/RT/Group.pm:
+
+ Groups can now be loaded by name.
+
+2001-01-23 15:46 jesse
+
+ * bin/rtadmin, etc/schema.pm, lib/RT/Queue.pm, lib/RT/Template.pm,
+ lib/RT/Ticket.pm, lib/RT/User.pm, lib/RT/Interface/CLI.pm,
+ tools/initdb:
+
+ initdb now punts on database creation for oracle.
+
+ Ticket->Name removed from code (retargeted to post 2.0 and its own table)
+ Some better error checking in User and Queue.
+
+ Can now edit templates (And create them) from the CLI.
+
+2001-01-22 12:51 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+
+ It's amazing how much effect 3 little letters can have. with this patch,
+ scrips that depend on notify (most everything other than autoreply)
+ just work. woo!
+
+2001-01-22 06:18 jesse
+
+ * lib/RT/Template.pm:
+
+ Fixed a couple ACL bugs in Template::_Set
+
+2001-01-22 05:04 jesse
+
+ * Makefile:
+
+ Bumped the version # because of the schema change
+
+2001-01-22 04:51 jesse
+
+ * lib/RT/Interface/CLI.pm:
+
+ file CLI.pm was initially added on branch rt-1-1.
+
+2001-01-22 04:51 jesse
+
+ * lib/RT/Interface/CLI.pm:
+
+ Added CLI.pm, which rt and adminrt are dependant on
+
+2001-01-22 04:46 jesse
+
+ * bin/rtadmin, lib/MANIFEST, lib/RT/Template.pm:
+
+ a bit more work on rtadmin (the start of template editing)
+
+ added Interface/CLI to the manifest.
+ added a comment to Template.pm
+
+2001-01-22 02:51 jesse
+
+ * Makefile, TODO, bin/mason_handler.scgi, bin/rt, bin/rtadmin,
+ bin/rtmux.pl, bin/webmux.pl, etc/config.pm, etc/schema.Oracle,
+ etc/schema.pm, lib/RT.pm, lib/RT/Attachment.pm,
+ lib/RT/CurrentUser.pm, lib/RT/Group.pm, lib/RT/Link.pm,
+ lib/RT/ObjectKeywords.pm, lib/RT/Queue.pm, lib/RT/Template.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Transaction.pm,
+ lib/RT/User.pm, lib/RT/Users.pm, lib/RT/Watchers.pm,
+ lib/RT/Interface/Email.pm, tools/insertdata,
+ webrt/Admin/Elements/CreateQueueCalled,
+ webrt/Admin/Elements/CreateUserCalled,
+ webrt/Admin/Elements/GrantQueueRightsTo,
+ webrt/Admin/Elements/ModifyKeywordSelect,
+ webrt/Admin/Elements/ModifyQueue,
+ webrt/Admin/Elements/ModifyTemplate,
+ webrt/Admin/Elements/ModifyUser,
+ webrt/Admin/Elements/SelectModifyQueue,
+ webrt/Admin/Elements/SelectModifyUser,
+ webrt/Admin/Elements/SelectTemplate,
+ webrt/Admin/Elements/SelectUsers, webrt/Admin/Global/Scrips.html,
+ webrt/Admin/Global/Template.html,
+ webrt/Admin/Global/Templates.html,
+ webrt/Admin/Global/UserRights.html,
+ webrt/Admin/Groups/Members.html,
+ webrt/Admin/KeywordSelects/index.html, webrt/Admin/Queues/ACL.html,
+ webrt/Admin/Queues/Create.html, webrt/Admin/Queues/Keywords.html,
+ webrt/Admin/Queues/Modify.html, webrt/Admin/Queues/People.html,
+ webrt/Admin/Queues/Scrips.html, webrt/Admin/Queues/Template.html,
+ webrt/Admin/Queues/Templates.html, webrt/Admin/Queues/index.html,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/Prefs.html,
+ webrt/Admin/Users/index.html, webrt/Elements/Header,
+ webrt/Elements/MyRequests, webrt/Elements/MyTickets,
+ webrt/Elements/Quicksearch, webrt/Elements/SelectNewTicketQueue,
+ webrt/Elements/SelectOwner, webrt/Elements/SelectQueue,
+ webrt/Elements/SelectUsers, webrt/SelfService/Details.html,
+ webrt/SelfService/Elements/Header,
+ webrt/SelfService/Elements/MyRequests,
+ webrt/SelfService/Elements/ShowTransaction,
+ webrt/Ticket/Create.html, webrt/Ticket/ModifyLinks.html,
+ webrt/Ticket/autohandler, webrt/Ticket/Elements/AddWatchers,
+ webrt/Ticket/Elements/ShowBasics, webrt/Ticket/Elements/ShowDates,
+ webrt/Ticket/Elements/ShowDependencies,
+ webrt/Ticket/Elements/ShowLinks, webrt/Ticket/Elements/ShowPeople,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ In prep for a true schema freeze, I fixed a number of attribute names that were troublesome for
+ one reason or another.
+
+ Queue->QueueId and User->UserId have been changed to Queue->Name and User->Name, so
+ as not to conflict with queue->id and user->id any more. A number of tables
+ used "Alias" and "Title" and things like that, rather than the somewhat
+ more standard "Name" and "Description"
+
+ Abstracted a bunch of the CLI setup stuff out into lib/RT/Interface/CLI
+
+ Abstracted some of the core DB startup code into RT.pm
+
+ fixed the makefile to handle the new rtadmin.
+
+ lots of updates to the new rtadmin (which works for user editing!)
+
+ fixed a bug in ObjectKeywords->LoadByName....
+
+2001-01-19 04:23 jesse
+
+ * bin/rtadmin:
+
+ A bit of cleanup and a bit more docs. it's now actually implementable with getopt::long
+
+2001-01-19 04:16 jesse
+
+ * bin/rtadmin:
+
+ file rtadmin was initially added on branch rt-1-1.
+
+2001-01-19 04:16 jesse
+
+ * bin/rtadmin:
+
+ Docced the proposed cli for the new rtadmin tool. It's rather more intense than I'd intended
+
+2001-01-19 02:15 jesse
+
+ * lib/RT/User.pm:
+
+ Fixed ACL bug that prevented by-group auth from working
+
+2001-01-19 00:52 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/User.pm, webrt/SelfService/Details.html:
+
+ Work on SelfService (fixing the a permission denied bug)
+
+2001-01-19 00:21 jesse
+
+ * webrt/NoAuth/webrt.css:
+
+ file webrt.css was initially added on branch rt-1-1.
+
+2001-01-19 00:21 jesse
+
+ * webrt/: webrt.css, Elements/Header, NoAuth/webrt.css,
+ SelfService/Details.html, SelfService/Elements/Header:
+
+ webui cleanups
+
+2001-01-19 00:07 jesse
+
+ * bin/rt:
+
+ bug-fixing in bin/rt
+
+2001-01-18 23:47 jesse
+
+ * lib/RT/Link.pm, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ webrt/Ticket/ModifyLinks.html, webrt/Ticket/Elements/ShowLinks,
+ webrt/Ticket/Elements/ShowMembers,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowSummary:
+
+ A bunch of work on links.
+ API cleanups.
+ Ticket-> Members and MemberOf now return Links objects rather than Tickets Objects
+ Edit links via the webui works now
+
+2001-01-18 15:11 jesse
+
+ * HACKING, docs/API:
+
+ Added a bit more documentation and philosophy
+ to the API file. yanked tobix' old out of date "HACKING"
+ doc
+
+2001-01-18 03:18 jesse
+
+ * Makefile, NEWS:
+
+ Headers in incoming mail are now parsed case insensitively.
+
+ Version is now 1.0.7
+
+2001-01-17 16:41 jesse
+
+ * Makefile, tools/testdeps:
+
+ updated searchbuilder dependency in testdeps
+
+ revved version in Makefile for release.
+
+2001-01-17 14:27 jesse
+
+ * Makefile, bin/rt, lib/RT/Date.pm:
+
+ Fixed #45 Permissions bug on redhat 6.0
+ Fixed #51 RT CLI doesn't check for valid user
+
+ Implemented a bunch more searching in bin/rt
+
+ Refactored RT::Date a bit.
+
+ Fixed some unreported permissions eits.
+
+2001-01-16 11:43 jesse
+
+ * webrt/Ticket/Elements/: ShowLinks, ShowMemberOf, ShowMembers,
+ ShowPeople, ShowSummary:
+
+ Cleaned up and shortened the Ticket Display screen
+
+2001-01-16 10:56 jesse
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Modify.html:
+
+ Cleaned up and better documented Ticket->SetStatus
+ Ticket/Modify.html got rid of a whole bunch of evals.
+
+2001-01-15 23:57 jesse
+
+ * Makefile, lib/MANIFEST, lib/RT/Tickets.pm:
+
+ Removed a deleted file from the manifest. revved the version
+
+2001-01-15 15:19 jesse
+
+ * lib/RT/: KeywordSelect.pm, Queue.pm:
+
+ Adding the ability to load keyword selects by name.
+
+2001-01-15 03:49 jesse
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Elements/EditKeywordSelects:
+
+ keyword display now cleaner. doesn't force you to select a keyword if none
+ is selected yet.
+
+2001-01-15 03:36 jesse
+
+ * lib/RT/Ticket.pm:
+
+ SetQueue is no-longer heinously broken. thanks eoin
+
+2001-01-15 03:10 jesse
+
+ * lib/RT/: Queue.pm, User.pm, Action/Notify.pm, Action/Spam.pm:
+
+ removed an old RT::Action that didn't actually do anything useful these days. it'll get replaced later.
+
+ Scrips which sign watchers up for things _actually seem to work_
+ (required some frobbing of watchers)
+
+2001-01-15 02:44 jesse
+
+ * bin/rt, etc/schema.pm, lib/RT/ObjectKeywords.pm, lib/RT/Queue.pm,
+ lib/RT/Template.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm,
+ lib/RT/Watchers.pm, webrt/Elements/ViewUser,
+ webrt/Ticket/Elements/ShowRequestor:
+
+ Added a 'Type' column to templates, to more easily allow for insertable templates for quick responses from customer service folks ,etc.
+ Reworked a bunch of the watchers code to not do its own potentially very bogus caching and to reuse more core code.
+ Oh. and it always returns the expected object type now.
+
+ Redid tobias' old "ViewUser" box to use a set of tickets, rather than a bogus search for watchers (ignoring tickets).
+
+ Fixed a bug in searching for tickets by watcher.
+
+2001-01-15 00:53 jesse
+
+ * bin/rt, webrt/Elements/SelectOwner, webrt/Elements/TitleBoxStart,
+ webrt/NoAuth/Login.html, webrt/Ticket/Elements/ShowSummary:
+
+ Added a bunch of doc to bin/rt. probably should have check to see if it runs ;)
+ TitleBoxStart got the attributes: class, title_href and titleright_href. makes calls to it cleaner.
+ showsummary got a few more links to the places things should go.
+ selectOwner now will actually default to nobody if that's the right value.
+
+2001-01-13 03:22 jesse
+
+ * TODO:
+
+ Changed the TODO file to point to the current TODO list
+
+2001-01-13 03:18 jesse
+
+ * Makefile:
+
+ Bumped version # for release
+
+2001-01-13 03:11 jesse
+
+ * bin/rtmux.pl, lib/RT/Queue.pm, lib/RT/Action/SendEmail.pm:
+
+ Fixing a couple minor things in rtmux and Queue.pm so that the mail interfaces work ok.
+
+2001-01-13 02:34 jesse
+
+ * lib/RT/User.pm:
+
+ Added the ability to generate a random password to RT::User. we don't yet
+ have a nice way to email this information to the user. which is a real bummer.
+
+2001-01-12 17:35 jesse
+
+ * etc/config.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ lib/RT/Interface/Web.pm, webrt/Admin/Users/Modify.html,
+ webrt/SelfService/Create.html, webrt/SelfService/Details.html,
+ webrt/SelfService/Elements/Header, webrt/SelfService/Elements/Tabs:
+
+ Made ACLs for 'Everyone' work. fixed a few other small ACL bugs.
+ Made the 'Requestor-mode' ticket create tool work.
+
+2001-01-12 12:27 jesse
+
+ * webrt/Elements/: SelectDate, SelectOwner:
+
+ Commented out unimplemented select relative date bits.
+ SelectOwner now lets you pick nobody.
+
+2001-01-12 03:16 jesse
+
+ * bin/rt, bin/rtmux.pl, lib/RT/Ticket.pm, tools/testdeps:
+
+ Comments and Correspondence work from the cli now. with and without --source (for source data) and --no-edit (to disable invocation of $EDITOR)
+
+ rt and rtmux.pl now drop setgidness as soon as they can. it's happier this
+ way. really :)
+
+ testdeps now installs File::Temp, which is needed to do safe tempfile usage.
+
+2001-01-12 00:11 jesse
+
+ * webrt/Elements/: MyRequests, MyTickets:
+
+ Bug fix for #47 (Id flows into subject on 'home' screen)
+
+2001-01-11 03:34 jesse
+
+ * webrt/Elements/Header:
+
+ Removed extra spaces from the header
+
+2001-01-11 02:57 jesse
+
+ * webrt/Elements/SelectOwner:
+
+ Made SelectOwner actually show all the right people
+
+2001-01-11 02:53 jesse
+
+ * tools/testdeps:
+
+ Added a requirement for the current DBIx::SearchBuilder to testdeps
+
+2001-01-11 02:28 jesse
+
+ * Makefile:
+
+ revved the version for distribution
+
+2001-01-11 02:28 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Interface/Web.pm,
+ webrt/Elements/Quicksearch, webrt/Elements/TitleBoxStart,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/EditBasics:
+
+ fixed a couple of UI bugs. the 'quick' links in the web ticket view should now all work.
+ Logger->warn -> Logger->warning in the web ui
+
+2001-01-10 17:42 jesse
+
+ * Makefile:
+
+ Bumped to 1.3.33
+
+2001-01-10 01:46 jesse
+
+ * webrt/Ticket/Attachment/dhandler:
+
+ Date: Wed, 10 Jan 2001 16:22:43 +1000 (EST) From: Byron Ellacott <bje@apnic.net> To: rt-devel@fsck.com Subject: Re: [rt-devel] [rt-announce] RT 1.3.30 released List-Id: RT Development <rt-devel.lists.fsck.com> [-- Attachment #1 --] [-- Type: text/PLAIN, Encoding: 7bit, Size: 0.7K --] On Wed, 3 Jan 2001, Jesse wrote: [snip] I noticed 1-3-31 sitting around, so I installed that. I'm giving a demonstration tomorrow, so I've been running through the web UI. I noticed a problem with attachments - HTML::Mason was munging everything to be HTML-nice, but a jpg doesn't display if its < characters are changed to &lt;, and it's not good to have </BODY></HTML> on the end of binary attachments.
+
+2001-01-10 00:24 jesse
+
+ * Makefile:
+
+ Revved the version to 1.3.32
+
+2001-01-09 23:57 jesse
+
+ * webrt/Admin/Users/Rights.html:
+
+ file Rights.html was initially added on branch rt-1-1.
+
+2001-01-09 23:57 jesse
+
+ * lib/RT/Record.pm, lib/RT/User.pm, lib/RT/Interface/Email.pm,
+ tools/insertdata, webrt/Admin/Elements/UserTabs,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/Rights.html,
+ webrt/Elements/Quicksearch, webrt/Elements/TitleBoxEnd,
+ webrt/Elements/TitleBoxStart:
+
+ Did some work on User creation to check for duplicate userids on create.
+ Better user create error checking.
+ Switched the TitleBox UI to a compromise between new and old.
+
+ Did a bit of ui work on web based user modification
+
+2001-01-09 02:15 jesse
+
+ * Makefile, lib/RT/User.pm, tools/insertdata,
+ webrt/Admin/Users/Modify.html:
+
+ shuffling around hte user password stuff. hopefully the user modification issues seen in 1.3.30 will be fixed.
+
+2001-01-09 00:48 jesse
+
+ * webrt/Ticket/History.html:
+
+ file History.html was initially added on branch rt-1-1.
+
+2001-01-09 00:48 jesse
+
+ * docs/keywords:
+
+ file keywords was initially added on branch rt-1-1.
+
+2001-01-09 00:48 jesse
+
+ * bin/mason_handler.scgi:
+
+ file mason_handler.scgi was initially added on branch rt-1-1.
+
+2001-01-09 00:48 jesse
+
+ * Makefile, bin/mason_handler.scgi, bin/webmux.pl, docs/keywords,
+ lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Admin/Elements/GrantQueueRightsTo~,
+ webrt/Ticket/History.html:
+
+ Started to write out notes on a testsuite.
+ Started work on a CGI/SpeedyCGI frontend
+ added a file that was missing in 1.3.30
+
+2001-01-08 14:04 jesse
+
+ * NEWS, README:
+
+ Added a web based due-date patch.
+
+2001-01-06 15:17 jesse
+
+ * etc/schema.pm:
+
+ Added 'Deleted' attributes for tables whose entries can not be safely
+ removed from the database for ref. integrity problems.
+
+2001-01-03 23:07 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.30
+
+2001-01-03 23:02 jesse
+
+ * tools/testdeps:
+
+ file testdeps was initially added on branch rt-1-1.
+
+2001-01-03 23:02 jesse
+
+ * README, bin/testdeps.pl, lib/Makefile.PL, tools/testdeps,
+ webrt/Elements/TitleBoxStart:
+
+ a bit of quick UI work.
+ an update to depend on DBIx::SearchBuilder 0.15 (just releaseD)
+ testdeps moved to tools
+
+2001-01-03 03:21 jesse
+
+ * bin/rt, lib/RT/Tickets.pm:
+
+ ticket searches for integers are a bit more flexible now (and the code's tighter)
+
+ the rtq section of the new bin/rt appears functional, if underdocced.
+
+2001-01-02 22:55 jesse
+
+ * lib/RT/Tickets.pm, lib/RT/Interface/Web.pm,
+ webrt/Search/PickRestriction:
+
+ Imported ivan's keyword search patch, along with a modification to allow
+ for _not_ selecting keywords.
+
+2001-01-02 21:45 jesse
+
+ * Makefile, bin/testdeps.pl, lib/RT/KeywordSelect.pm,
+ lib/RT/ObjectKeyword.pm, lib/RT/ObjectKeywords.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Watchers.pm,
+ lib/RT/Interface/Web.pm, tools/insertdata, webrt/webrt.css,
+ webrt/Elements/Header, webrt/Elements/TitleBoxStart,
+ webrt/Elements/ViewUser, webrt/Search/Listing.html,
+ webrt/Search/PickRestriction, webrt/Ticket/Create.html,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/ShowBasics,
+ webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction, webrt/Ticket/Elements/Tabs:
+
+ Fixed a warning in testdeps (Well, worked around it, anyway)
+ Added some helper functions for keywords and keyword selects.
+
+ did a bunch of UI cleanup. started to color-code the webui
+
+ started work on a generic queue listing format in Tickets.pm
+
+2001-01-02 15:02 jesse
+
+ * webrt/SelfService/Elements/ShowTransaction:
+
+ file ShowTransaction was initially added on branch rt-1-1.
+
+2001-01-02 15:02 jesse
+
+ * webrt/SelfService/: Create.html, Details.html,
+ Elements/GotoTicket, Elements/Header, Elements/ShowTransaction,
+ Elements/Tabs:
+
+ Fleshed out more of the requestor UI.
+ It's good enough for the alpha. yay!
+
+2001-01-02 15:02 jesse
+
+ * webrt/SelfService/Elements/GotoTicket:
+
+ file GotoTicket was initially added on branch rt-1-1.
+
+2001-01-01 19:06 jesse
+
+ * webrt/Ticket/: Modify.html, ModifyDates.html, ModifyPeople.html,
+ Elements/EditBasics, Elements/EditKeywordSelects,
+ Elements/ShowDates, Elements/ShowSummary:
+
+ Even yet still more Technicolor!
+
+2001-01-01 18:42 jesse
+
+ * webrt/NoAuth/images/spacer.gif:
+
+ file spacer.gif was initially added on branch rt-1-1.
+
+2001-01-01 18:42 jesse
+
+ * webrt/NoAuth/Reminder.html:
+
+ file Reminder.html was initially added on branch rt-1-1.
+
+2001-01-01 18:42 jesse
+
+ * webrt/Elements/Section:
+
+ file Section was initially added on branch rt-1-1.
+
+2001-01-01 18:42 jesse
+
+ * lib/RT/CurrentUser.pm, lib/RT/KeywordSelect.pm, webrt/webrt.css,
+ webrt/Admin/Keywords/index.html, webrt/Admin/Queues/People.html,
+ webrt/Elements/Header, webrt/Elements/ListActions,
+ webrt/Elements/MyRequests, webrt/Elements/MyTickets,
+ webrt/Elements/Section, webrt/Elements/Submit,
+ webrt/Elements/TitleBoxEnd, webrt/Elements/TitleBoxStart,
+ webrt/NoAuth/Login.html, webrt/NoAuth/Reminder.html,
+ webrt/NoAuth/images/spacer.gif, webrt/Ticket/Display.html,
+ webrt/Ticket/ModifyPeople.html, webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ A bunch of UI work.
+ Ticket Display is significantly different. and _much_ faster loading.
+ A color style guide for the web ui is forthcoming.
+
+ removed a Die from CurrentUser.
+
+2000-12-30 03:27 jesse
+
+ * webrt/Elements/Tabs:
+
+ fixed a ui nit from ivan
+
+2000-12-30 03:03 jesse
+
+ * webrt/Ticket/Elements/ShowSummary:
+
+ fixed a hyperlink.
+
+2000-12-30 00:07 jesse
+
+ * Makefile:
+
+ bumped version for release
+
+2000-12-30 00:03 jesse
+
+ * etc/config.pm, lib/RT/User.pm,
+ webrt/Admin/Elements/ModifyKeywordSelect,
+ webrt/Admin/Global/Keywords.html,
+ webrt/Admin/KeywordSelects/index.html,
+ webrt/Admin/Keywords/Modify.html, webrt/Admin/Keywords/index.html,
+ webrt/Admin/Queues/Keywords.html, webrt/Admin/Users/index.html:
+
+ Fixed a bug in keyword creation that caused urls and param values to get buggered.
+
+ Passwords are now encrypted in the database
+
+2000-12-29 05:54 jesse
+
+ * bin/rt, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Interface/Web.pm, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/ShowDependencies,
+ webrt/Ticket/Elements/ShowLinks:
+
+ Did a bunch of work on the linking interface. It's now got
+ a much easier API. and it's twice as functional (you can delete links)
+
+ Did the proof-of concept for the link code in the CLI. it'll need
+ fleshing out tomorrow.
+
+ Fleshed out other parts of the CLI.
+
+ stayed up way too late.
+
+2000-12-29 00:30 jesse
+
+ * Makefile, bin/rt, lib/RT/Keyword.pm, lib/RT/Ticket.pm:
+
+ Added keyword support to the CLI.
+ fixed a couple of Keyword core bugs
+
+2000-12-28 03:56 jesse
+
+ * bin/rt, bin/testdeps.pl, lib/RT/Keyword.pm,
+ lib/RT/KeywordSelect.pm, lib/RT/User.pm:
+
+ Removed unused keyword related code. added in a bit of
+ new keyword related code to get "relative" paths of keywords.
+
+ fixed a longstanding warning in ACL checking.
+
+ first 1/2 of keywords support for the new rt cli.
+
+ added Tie::IxHash to testdeps.pl (keywords needs it)
+
+2000-12-27 02:19 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ missed a comma
+
+2000-12-27 01:21 jesse
+
+ * webrt/Admin/Global/Keywords.html:
+
+ file Keywords.html was initially added on branch rt-1-1.
+
+2000-12-27 01:21 jesse
+
+ * etc/schema.pm, lib/RT/ACE.pm, lib/RT/KeywordSelect.pm,
+ lib/RT/KeywordSelects.pm, lib/RT/Queue.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, webrt/Admin/Elements/SystemTabs,
+ webrt/Admin/Global/Keywords.html, webrt/Admin/Queues/Keywords.html,
+ webrt/Ticket/Create.html, webrt/Ticket/ModifyPeople.html,
+ webrt/Ticket/Elements/EditKeywordSelects,
+ webrt/Ticket/Elements/ShowKeywordSelects,
+ webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Added the ability to name keyword selects.
+ first round of ACLing for keywords.
+
+ Added the ability to create KeywordSelects which apply to all queues (Rather than just
+ a single queue)
+
+ misc bigfixes.
+
+2000-12-26 02:56 jesse
+
+ * webrt/Elements/SelectKeywordOptions:
+
+ file SelectKeywordOptions was initially added on branch rt-1-1.
+
+2000-12-26 02:56 jesse
+
+ * webrt/Admin/Keywords/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-12-26 02:56 jesse
+
+ * webrt/Admin/Queues/Keywords.html:
+
+ file Keywords.html was initially added on branch rt-1-1.
+
+2000-12-26 02:56 jesse
+
+ * webrt/Elements/SelectKeyword:
+
+ file SelectKeyword was initially added on branch rt-1-1.
+
+2000-12-26 02:56 jesse
+
+ * bin/webmux.pl, etc/schema.pm, lib/RT/Keyword.pm,
+ lib/RT/KeywordSelect.pm, lib/RT/KeywordSelects.pm,
+ lib/RT/Keywords.pm, lib/RT/ObjectKeyword.pm,
+ lib/RT/ObjectKeywords.pm, lib/RT/Queue.pm, lib/RT/Ticket.pm,
+ lib/RT/Watchers.pm, webrt/Admin/Elements/ModifyKeyword,
+ webrt/Admin/Elements/ModifyKeywordSelect,
+ webrt/Admin/Elements/QueueTabs, webrt/Admin/Elements/Tabs,
+ webrt/Admin/KeywordSelects/index.html,
+ webrt/Admin/Keywords/Modify.html, webrt/Admin/Keywords/index.html,
+ webrt/Admin/Queues/Keywords.html, webrt/Elements/SelectKeyword,
+ webrt/Elements/SelectKeywordOptions, webrt/Ticket/Modify.html,
+ webrt/Ticket/Elements/EditKeywordSelects,
+ webrt/Ticket/Elements/ShowKeywordSelects:
+
+ My first pass at making the keywords stuff work more like the rest of the RT core.
+ A couple of minor fixes on non-keywords things, but mostly this was an
+ edit of the keywords code to:
+ 1. make the admin UI work more like the rest of the admin ui
+ (still need to do "global" keyword selections)
+
+ 2. bring the coding style of the keywords stuff more into line
+ with the rest of the codebase
+
+ 3. flesh out the helper methods in the keywords modules.
+
+2000-12-24 02:04 jesse
+
+ * lib/RT/: Keyword.pm, KeywordSelect.pm, ObjectKeyword.pm:
+
+ A first round of commentary and cleanup on a few modules
+
+2000-12-24 01:34 jesse
+
+ * webrt/Ticket/Elements/ShowKeywordSelects:
+
+ file ShowKeywordSelects was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Ticket/Elements/EditKeywordSelects:
+
+ file EditKeywordSelects was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/: KeywordSelects/Modify.html, Keywords/Modify.html:
+
+ file Modify.html was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/KeywordSelects/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/Elements/ModifyKeyword:
+
+ file ModifyKeyword was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/Elements/ModifyKeywordSelect:
+
+ file ModifyKeywordSelect was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/Elements/SelectModifyKeyword:
+
+ file SelectModifyKeyword was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * webrt/Admin/Elements/SelectModifyKeywordSelect:
+
+ file SelectModifyKeywordSelect was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/ObjectKeyword.pm:
+
+ file ObjectKeyword.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/Keyword.pm:
+
+ file Keyword.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/KeywordSelect.pm:
+
+ file KeywordSelect.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/test.pl:
+
+ file test.pl was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/ObjectKeywords.pm:
+
+ file ObjectKeywords.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/KeywordSelects.pm:
+
+ file KeywordSelects.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT/Keywords.pm:
+
+ file Keywords.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * Makefile, etc/acl.Pg, etc/schema.pm, lib/MANIFEST,
+ lib/MANIFEST.SKIP, lib/Makefile.PL, lib/RT.pm, lib/test.pl,
+ lib/RT/Keyword.pm, lib/RT/KeywordSelect.pm,
+ lib/RT/KeywordSelects.pm, lib/RT/Keywords.pm,
+ lib/RT/ObjectKeyword.pm, lib/RT/ObjectKeywords.pm,
+ lib/RT/Ticket.pm, webrt/Admin/Elements/ModifyKeyword,
+ webrt/Admin/Elements/ModifyKeywordSelect,
+ webrt/Admin/Elements/SelectModifyKeyword,
+ webrt/Admin/Elements/SelectModifyKeywordSelect,
+ webrt/Admin/Elements/Tabs, webrt/Admin/KeywordSelects/Modify.html,
+ webrt/Admin/KeywordSelects/index.html,
+ webrt/Admin/Keywords/Modify.html, webrt/Ticket/Modify.html,
+ webrt/Ticket/Elements/EditBasics,
+ webrt/Ticket/Elements/EditKeywordSelects,
+ webrt/Ticket/Elements/ShowKeywordSelects,
+ webrt/Ticket/Elements/ShowSummary:
+
+ Importing two largish patches from ivan@420.am:
+ First up, ivan switched lib/RT over to using MakeMaker..so now
+ we get man pages for the core modules and a bunch of other cool stuff.
+
+ Second: ivan handed us an almost complete keywords system. Over the next
+ week or two, I'm going to be adding ACL support to the keywords system
+ and starting to integrate bits of it better into the rest of the core
+ (though it's nearly all done already).
+
+ Thanks, ivan!
+
+2000-12-24 01:34 jesse
+
+ * lib/MANIFEST:
+
+ file MANIFEST was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/Makefile.PL:
+
+ file Makefile.PL was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/RT.pm:
+
+ file RT.pm was initially added on branch rt-1-1.
+
+2000-12-24 01:34 jesse
+
+ * lib/MANIFEST.SKIP:
+
+ file MANIFEST.SKIP was initially added on branch rt-1-1.
+
+2000-12-23 23:45 jesse
+
+ * Makefile, webrt/Ticket/Elements/Tabs:
+
+ made the links in the ticket tool bar point to the right places.
+
+2000-12-23 23:15 jesse
+
+ * lib/RT/Ticket.pm:
+
+ fixing a typo and the docs.
+
+2000-12-23 23:12 jesse
+
+ * lib/RT/Ticket.pm:
+
+ the internal function _SetTold shouldn't be hitting an ACL check.
+
+2000-12-23 17:37 jesse
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Display.html,
+ webrt/Ticket/Modify.html, webrt/Ticket/ModifyDates.html,
+ webrt/Ticket/ModifyLinks.html, webrt/Ticket/ModifyPeople.html,
+ webrt/Ticket/Update.html, webrt/Ticket/Elements/Tabs,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ Cleaned up a bit of date diff related functionality.
+
+ Did work on the ticket tool bar.
+
+2000-12-23 16:46 jesse
+
+ * lib/RT/Record.pm:
+
+ Lets try that again..
+
+2000-12-23 16:39 jesse
+
+ * lib/RT/Record.pm:
+
+ LongSinceUpdatedAsString is now actually relative :)
+
+2000-12-23 16:09 jesse
+
+ * lib/RT/Tickets.pm:
+
+ added a default to LimitStatus.
+
+2000-12-23 01:47 jesse
+
+ * bin/: rt, testdeps.pl:
+
+ updated testdeps to require the latest mason (for ease of debugging)
+ the new combined bin/rt actually implements the behavior of rtq and rt -show
+ fully (I believe). next up, more ticket modification and a code cleanup
+
+2000-12-22 18:37 jesse
+
+ * Makefile:
+
+ bumped to 1.3.28 for release
+
+2000-12-19 22:38 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Transaction.pm,
+ lib/RT/Interface/Web.pm, webrt/Elements/Tabs,
+ webrt/Ticket/ModifyPeople.html, webrt/Ticket/Elements/EditPeople,
+ webrt/User/Prefs.html:
+
+ Removed outdated CC request to and BCC request to
+ did some UI touchups.
+
+ started a bit of work in tickets.pm for the new CLI (more explicit searching)
+
+2000-12-19 21:50 jesse
+
+ * bin/rt:
+
+ Modifying ticket requestors from the commandline works. yay.
+ Simplified the commandline arguments a bit too.
+
+2000-12-19 18:37 jesse
+
+ * bin/: mason_handler.fcgi, webmux.pl:
+
+ updaes to webmux.pl to work on with new versions of HTML::Mason
+
+2000-12-19 14:05 jesse
+
+ * webrt/Ticket/Display.html:
+
+ Fixed a bug in Ticket/Display.html that caused navigation not to work within new tickets.
+
+2000-12-19 04:03 jesse
+
+ * bin/rt:
+
+ implemented --history (show ticket history)
+ and --limit-status (limit to a ticket status)
+ just to make sure that this works at all. it does.
+
+ With the new ui, you'll be able to trivially perform actions on large #s of tickets.
+
+2000-12-19 03:38 jesse
+
+ * bin/rt:
+
+ After playing with a few Getopt variants, I've settled on Getopt::Long for now...
+ and implemented the skeleton of the new RT cli. I suspect that with another day's work,
+ it should be mostly functional. yay.
+
+2000-12-19 03:38 jesse
+
+ * bin/rt:
+
+ file rt was initially added on branch rt-1-1.
+
+2000-12-18 19:34 jesse
+
+ * docs/design_docs/cli_spec:
+
+ file cli_spec was initially added on branch rt-1-1.
+
+2000-12-18 19:34 jesse
+
+ * docs/design_docs/cli_spec:
+
+ Added the CLI spec from deborah.
+
+2000-12-18 02:11 jesse
+
+ * webrt/Elements/: CreateTicket, GotoTicket:
+
+ Fixed a basepath error.
+
+2000-12-18 01:19 jesse
+
+ * webrt/Elements/CreateTicket:
+
+ file CreateTicket was initially added on branch rt-1-1.
+
+2000-12-18 01:19 jesse
+
+ * webrt/Elements/GotoTicket:
+
+ file GotoTicket was initially added on branch rt-1-1.
+
+2000-12-18 01:19 jesse
+
+ * README, webrt/Admin/Queues/Modify.html,
+ webrt/Admin/Users/Modify.html, webrt/Elements/CreateTicket,
+ webrt/Elements/GotoTicket, webrt/Search/Listing.html:
+
+ A few more changes from Lee Ann and a couple of files I missed on the earlier checkins.
+
+2000-12-18 01:14 jesse
+
+ * webrt/Admin/Groups/Rights.html:
+
+ file Rights.html was initially added on branch rt-1-1.
+
+2000-12-18 01:14 jesse
+
+ * webrt/Admin/Groups/: Members.html, Rights.html:
+
+ a couple UI tweaks from Lee Ann Goldstein
+
+2000-12-18 00:51 jesse
+
+ * webrt/: Admin/Elements/SystemTabs, Admin/Groups/index.html,
+ Admin/Users/index.html, Elements/Submit, Elements/Tabs:
+
+ More UI hacking. whee
+
+2000-12-17 23:55 jesse
+
+ * webrt/: Elements/SelectNewTicketQueue, Elements/SelectOwner,
+ Elements/Tabs, Ticket/Create.html, Ticket/Elements/Tabs:
+
+ ui hacking to add the "Create Ticket" and "Goto Ticket" ui elements at the top.
+
+2000-12-17 22:17 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ webrt/Elements/MessageBox, webrt/Ticket/Modify.html,
+ webrt/Ticket/ModifyPeople.html:
+
+ Fixing bugs 7,8,28
+
+2000-12-17 02:38 jesse
+
+ * webrt/Ticket/Elements/ShowDates:
+
+ *sigh* typo in ShowDates.
+
+2000-12-17 02:34 jesse
+
+ * lib/RT/Date.pm, webrt/Ticket/Elements/EditDates,
+ webrt/Ticket/Elements/ShowDates:
+
+ A bit of work on Dates. a postgres fix from ivan and some display prettification.
+
+2000-12-17 02:15 jesse
+
+ * Makefile, webrt/Ticket/Elements/TicketToolBox:
+
+ commeted out some toolbar actions which don't work yet.
+
+ bumped the version to 1.3.27 for imminent release.
+
+2000-12-17 01:51 jesse
+
+ * lib/RT/Attachment.pm:
+
+ The ACL problem on attachments was a bootstrapping issue. couldn't check acls because it
+ couldn't necessarily see what to check
+
+2000-12-17 01:44 jesse
+
+ * lib/RT/Attachment.pm:
+
+ acl fix for attachments.
+
+2000-12-17 01:15 jesse
+
+ * lib/RT/Ticket.pm:
+
+ fixing ugly disgusting ACL bugs
+
+2000-12-17 00:35 jesse
+
+ * lib/RT/Transaction.pm, lib/RT/User.pm,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Fixing bugs in Transaction ACLs.
+
+2000-12-16 03:56 jesse
+
+ * webrt/Admin/Groups/Members.html:
+
+ ui nit in admin/groups/members.
+
+2000-12-16 03:31 jesse
+
+ * lib/RT/: Group.pm, GroupMember.pm:
+
+ $object->$SUPER::Foo is wrong. $object->SUPER::Foo is not.
+
+2000-12-16 03:28 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Rights checks for ticket ownership work best when the right that's set is the same
+ as the right that's checked for *sigh*
+
+2000-12-16 03:26 jesse
+
+ * webrt/Admin/Groups/Members.html:
+
+ Fixed a couple bugs in Group mebership administration code.
+
+2000-12-16 03:04 jesse
+
+ * webrt/: Admin/Elements/GroupTabs, Admin/Elements/QueueTabs,
+ Admin/Elements/SystemTabs, Admin/Elements/Tabs,
+ Admin/Elements/UserTabs, Admin/Global/index.html,
+ Admin/Groups/Modify.html, Admin/Groups/index.html,
+ Admin/Queues/People.html, Admin/Queues/index.html,
+ Admin/Users/Modify.html, Admin/Users/index.html,
+ Elements/SelectWatcherType, Elements/Tabs, Ticket/Create.html,
+ Ticket/Display.html, Ticket/Elements/Tabs:
+
+ Bugfix in user admin (no longer automatically revokes "privileged status)
+ a bunch of tab-related UI cleanup. the start of tabs that reflect the current page.
+
+ added the ability to configure queue watchers from the web ui
+
+2000-12-16 03:04 jesse
+
+ * webrt/Admin/Queues/People.html:
+
+ file People.html was initially added on branch rt-1-1.
+
+2000-12-16 00:58 jesse
+
+ * webrt/Admin/Users/index.html:
+
+ typo fixing.
+
+2000-12-15 19:12 jesse
+
+ * webrt/Admin/Global/GroupRights.html:
+
+ file GroupRights.html was initially added on branch rt-1-1.
+
+2000-12-15 19:12 jesse
+
+ * webrt/Admin/Global/UserRights.html:
+
+ file UserRights.html was initially added on branch rt-1-1.
+
+2000-12-15 19:12 jesse
+
+ * webrt/Admin/Elements/GroupTabs:
+
+ file GroupTabs was initially added on branch rt-1-1.
+
+2000-12-15 19:12 jesse
+
+ * lib/RT/ACE.pm, lib/RT/Group.pm, lib/RT/Groups.pm,
+ lib/RT/Record.pm, lib/RT/Scrip.pm, lib/RT/ScripAction.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm, lib/RT/User.pm,
+ lib/RT/Users.pm, tools/insertdata, webrt/Admin/Elements/GroupTabs,
+ webrt/Admin/Elements/SystemTabs, webrt/Admin/Global/ACL.html,
+ webrt/Admin/Global/GroupRights.html,
+ webrt/Admin/Global/UserRights.html,
+ webrt/Admin/Groups/Members.html, webrt/Admin/Groups/Modify.html,
+ webrt/Admin/Groups/index.html, webrt/Admin/Users/Modify.html,
+ webrt/Admin/Users/index.html:
+
+ A bunch of cleanup work on Users and Groups (and a couple of small bugfixes, one
+ which might prevent install of Alpha 2) mostly aimed at improving the admin ui.
+
+ We now have two levels of "Privileged" for a user, 1 which means "can be granted rights"
+ and 2 which means "should not be futzed with by the user"
+
+2000-12-14 23:04 jesse
+
+ * webrt/Ticket/Attachment/dhandler:
+
+ Accidentally left out of the last rev. sorry about that.
+
+2000-12-14 23:04 jesse
+
+ * webrt/Ticket/Attachment/dhandler:
+
+ file dhandler was initially added on branch rt-1-1.
+
+2000-12-12 20:44 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.26. This is RT2 Alpha 2, folks.
+
+2000-12-12 20:34 jesse
+
+ * lib/RT/Attachment.pm, lib/RT/Record.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/User.pm,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Attachment display in the webui now just works [tm] RT2 Alpha 2 will be rolled later tonight.
+
+2000-12-12 19:03 jesse
+
+ * webrt/Admin/Global/Template.html:
+
+ file Template.html was initially added on branch rt-1-1.
+
+2000-12-12 19:03 jesse
+
+ * webrt/Admin/Global/Templates.html:
+
+ file Templates.html was initially added on branch rt-1-1.
+
+2000-12-12 19:03 jesse
+
+ * README, bin/webmux.pl, lib/RT/Attachment.pm, lib/RT/Template.pm,
+ lib/RT/Transaction.pm, webrt/Admin/Elements/SelectTemplate,
+ webrt/Admin/Elements/SystemTabs, webrt/Admin/Global/Template.html,
+ webrt/Admin/Global/Templates.html,
+ webrt/Admin/Queues/Templates.html,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Working on attachments support.
+
+ did some work on global templates
+
+2000-12-12 15:15 jesse
+
+ * lib/RT/Template.pm, lib/RT/Templates.pm, tools/insertdata:
+
+ Core support for system-scoped templates
+
+2000-12-12 14:12 jesse
+
+ * webrt/Admin/: Queues/Modify.html, Users/Create.html,
+ Users/Modify.html:
+
+ Fixed queue and user creation problems.
+
+2000-12-12 03:05 jesse
+
+ * webrt/Ticket/: Link.html, ModifyLinks.html, Elements/ShowSummary,
+ Elements/Tabs:
+
+ Brought the still basic link editing ui into conformance with the rest of the ticket ui
+
+2000-12-12 03:05 jesse
+
+ * webrt/Ticket/ModifyLinks.html:
+
+ file ModifyLinks.html was initially added on branch rt-1-1.
+
+2000-12-12 02:41 jesse
+
+ * webrt/Ticket/: ModifyDates.html, ModifyPeople.html:
+
+ split out the ticket modify screen into 3 more bite-sized pages.
+
+2000-12-12 02:41 jesse
+
+ * webrt/Ticket/ModifyPeople.html:
+
+ file ModifyPeople.html was initially added on branch rt-1-1.
+
+2000-12-12 02:41 jesse
+
+ * webrt/Ticket/ModifyDates.html:
+
+ file ModifyDates.html was initially added on branch rt-1-1.
+
+2000-12-12 02:41 jesse
+
+ * webrt/Ticket/: Modify.html, Elements/Tabs:
+
+ [no log message]
+
+2000-12-11 15:01 jesse
+
+ * webrt/NoAuth/Login.html:
+
+ file Login.html was initially added on branch rt-1-1.
+
+2000-12-11 15:01 jesse
+
+ * webrt/NoAuth/Logout.html:
+
+ file Logout.html was initially added on branch rt-1-1.
+
+2000-12-11 15:01 jesse
+
+ * webrt/: Login.html, Logout.html, autohandler, Elements/Footer,
+ Elements/Header, NoAuth/Login.html, NoAuth/Logout.html:
+
+ Moving Login and Logout around so they work right with the new NoAuth scheme
+
+2000-12-11 05:00 jesse
+
+ * webrt/: Login.html, autohandler:
+
+ fixed a couple login bugs. implemented some logic to deal with different auth classes:
+ /NoAuth/ and /SelfService/
+
+2000-12-11 01:46 jesse
+
+ * webrt/: rt.jpg, Elements/Header, Elements/MyRequests,
+ Elements/MyTickets, Search/Listing.html, Ticket/Create.html,
+ Ticket/Create_Detail.html, Ticket/Display.html, Ticket/Modify.html,
+ Ticket/Update.html, Ticket/Elements/ShowTransaction,
+ Ticket/Elements/Tabs, Ticket/Elements/TicketToolBox:
+
+ Work on ticket display. we're getting there.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Queues/Template.html:
+
+ file Template.html was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Queues/Templates.html:
+
+ file Templates.html was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Elements/QueueTabs:
+
+ file QueueTabs was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Elements/SystemTabs:
+
+ file SystemTabs was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/: Global/Scrips.html, Queues/Scrips.html:
+
+ file Scrips.html was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Elements/UserTabs:
+
+ file UserTabs was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/: Global/ACL.html, Queues/ACL.html:
+
+ file ACL.html was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * webrt/Admin/Global/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-12-10 23:53 jesse
+
+ * Makefile, webrt/index.html, webrt/Admin/ModifyUser,
+ webrt/Admin/index.html, webrt/Admin/Elements/Header,
+ webrt/Admin/Elements/QueueTabs, webrt/Admin/Elements/SystemTabs,
+ webrt/Admin/Elements/Tabs, webrt/Admin/Elements/UserTabs,
+ webrt/Admin/Global/ACL.html, webrt/Admin/Global/Scrips.html,
+ webrt/Admin/Global/index.html, webrt/Admin/Queues/ACL.html,
+ webrt/Admin/Queues/Modify.html, webrt/Admin/Queues/Scrips.html,
+ webrt/Admin/Queues/Template.html,
+ webrt/Admin/Queues/Templates.html, webrt/Admin/Queues/index.html,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/index.html,
+ webrt/Elements/Header, webrt/Elements/Tabs:
+
+ Bunch of work on the web administration framework.
+ Lots of stuff should be much cleaner now.
+
+2000-12-10 01:21 jesse
+
+ * Makefile:
+
+ Bumped version to 1.3.25 for release
+
+2000-12-10 01:15 jesse
+
+ * webrt/: Elements/TitleBoxEnd, Elements/TitleBoxStart,
+ SelfService/Elements/MyRequests, SelfService/Elements/Tabs,
+ Ticket/Update.html, User/Prefs.html:
+
+ Work on SSRI and a bit of overall UI tweaking
+
+2000-12-09 22:48 jesse
+
+ * webrt/SelfService/Elements/Header:
+
+ file Header was initially added on branch rt-1-1.
+
+2000-12-09 22:48 jesse
+
+ * webrt/SelfService/Elements/: Header, MyRequests, Tabs:
+
+ Missed a couple files for SSRI
+
+2000-12-09 22:48 jesse
+
+ * webrt/SelfService/Elements/MyRequests:
+
+ file MyRequests was initially added on branch rt-1-1.
+
+2000-12-09 22:48 jesse
+
+ * webrt/SelfService/Elements/Tabs:
+
+ file Tabs was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/SelfService/Create.html:
+
+ file Create.html was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/SelfService/Details.html:
+
+ file Details.html was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/SelfService/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/SelfService/Closed.html:
+
+ file Closed.html was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/Elements/SelectNewTicketQueue:
+
+ file SelectNewTicketQueue was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/Admin/Groups/Members.html:
+
+ file Members.html was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * webrt/Admin/Elements/SelectUsers:
+
+ file SelectUsers was initially added on branch rt-1-1.
+
+2000-12-09 22:43 jesse
+
+ * lib/RT/CurrentUser.pm, lib/RT/Group.pm, lib/RT/GroupMember.pm,
+ lib/RT/Record.pm, lib/RT/User.pm, lib/RT/Users.pm,
+ webrt/Login.html, webrt/autohandler,
+ webrt/Admin/Elements/SelectModifyGroup,
+ webrt/Admin/Elements/SelectUsers, webrt/Admin/Groups/Members.html,
+ webrt/Admin/Groups/Modify.html, webrt/Admin/Groups/index.html,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/index.html,
+ webrt/Elements/Header, webrt/Elements/SelectNewTicketQueue,
+ webrt/SelfService/Closed.html, webrt/SelfService/Create.html,
+ webrt/SelfService/Details.html, webrt/SelfService/index.html,
+ webrt/User/Prefs.html:
+
+ First rev of SSRI, the Self Service Requestor Interface.
+ Did a bunch of work on groups and the admin UI
+
+2000-12-05 23:24 jesse
+
+ * webrt/Admin/Groups/Modify.html:
+
+ file Modify.html was initially added on branch rt-1-1.
+
+2000-12-05 23:24 jesse
+
+ * webrt/Admin/Groups/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-12-05 23:24 jesse
+
+ * webrt/Admin/Elements/SelectModifyGroup:
+
+ file SelectModifyGroup was initially added on branch rt-1-1.
+
+2000-12-05 23:24 jesse
+
+ * lib/RT/Action/NotifyAsComment.pm:
+
+ file NotifyAsComment.pm was initially added on branch rt-1-1.
+
+2000-12-05 23:24 jesse
+
+ * lib/RT/Group.pm, lib/RT/GroupMembers.pm, lib/RT/Scrip.pm,
+ lib/RT/Action/Notify.pm, lib/RT/Action/NotifyAsComment.pm,
+ lib/RT/Action/SendEmail.pm, tools/insertdata,
+ webrt/Admin/Elements/SelectModifyGroup,
+ webrt/Admin/Groups/Modify.html, webrt/Admin/Groups/index.html,
+ webrt/Admin/Queues/Modify.html, webrt/Admin/Queues/index.html:
+
+ Lots of work on groups. I think the core is basically set. UI has been started
+
+ Scrips got even more work and more code. they now work at least as well as
+ they ever have _and_ they now do it for the right reasons.
+
+2000-12-02 13:44 jesse
+
+ * Makefile:
+
+
+ fixed a local customization in the makefile
+
+2000-12-02 13:34 jesse
+
+ * Makefile:
+
+ bumped version to 1.0.6
+
+2000-12-02 03:22 jesse
+
+ * webrt/Ticket/Link.html:
+
+ file Link.html was initially added on branch rt-1-1.
+
+2000-12-02 03:22 jesse
+
+ * lib/RT/Scrip.pm, lib/RT/ScripActions.pm, lib/RT/Scrips.pm,
+ webrt/Ticket/Link.html:
+
+ catching some stragglers.
+
+2000-12-02 03:22 jesse
+
+ * lib/RT/ScripActions.pm:
+
+ file ScripActions.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * webrt/Admin/Elements/SelectScripAction:
+
+ file SelectScripAction was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * webrt/Admin/Elements/SelectScripCondition:
+
+ file SelectScripCondition was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/: Action/Generic.pm, Condition/Generic.pm:
+
+ file Generic.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/Condition/AnyTransaction.pm:
+
+ file AnyTransaction.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/Condition/NewDependency.pm:
+
+ file NewDependency.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/ScripAction.pm:
+
+ file ScripAction.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/ScripCondition.pm:
+
+ file ScripCondition.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * lib/RT/ScripConditions.pm:
+
+ file ScripConditions.pm was initially added on branch rt-1-1.
+
+2000-12-02 03:20 jesse
+
+ * bin/webmux.pl, docs/design_docs/subscription-definitions.txt,
+ etc/schema.pm, lib/RT/Action.pm, lib/RT/Scrip.pm,
+ lib/RT/ScripAction.pm, lib/RT/ScripCondition.pm,
+ lib/RT/ScripConditions.pm, lib/RT/ScripScope.pm,
+ lib/RT/ScripScopes.pm, lib/RT/Scrips.pm, lib/RT/Transaction.pm,
+ lib/RT/Action/Generic.pm, lib/RT/Action/Notify.pm,
+ lib/RT/Action/OpenDependent.pm, lib/RT/Action/ResolveMembers.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Action/SendEmailOnResolve.pm,
+ lib/RT/Action/StallDependent.pm,
+ lib/RT/Condition/AnyTransaction.pm, lib/RT/Condition/Generic.pm,
+ lib/RT/Condition/NewDependency.pm, tools/insertdata,
+ webrt/Admin/Elements/SelectScripAction,
+ webrt/Admin/Elements/SelectScripCondition:
+
+ Major major major work on scrips
+ scrips now specify a 'Stage' which has only one value for now but should be easier to add in other
+ points in the code where they get called
+
+ What used to be called Scrip got split into ScripCondition and ScripAction
+
+ ScripScope got renamed 'Scrip', like it should have been from the getgo.
+
+ Did some work to the scrip mailing routines.All in all, scrips are much
+ cleaner and more flexible. and at least as functional as they were last night.
+
+ I'll be adjusting the templates as I get to them
+
+2000-12-01 14:02 jesse
+
+ * NEWS:
+
+ fixed a display bug in how we split messages for the webui
+
+2000-11-30 02:18 jesse
+
+ * lib/RT/Action/AutoReply.pm, lib/RT/Action/SendEmail.pm,
+ tools/insertdata:
+
+ Working on cleaning up the Scrips system. The whole templating system
+ was really, really incredibly overdesigned and badly implemented on the first go-round.
+ Over the next few checkins, I'll be cleaning it up and cleaning it out...
+
+2000-11-29 16:31 jesse
+
+ * bin/testdeps.pl:
+
+ updated apache::session dependency
+
+2000-11-29 01:32 jesse
+
+ * lib/RT/ACE.pm, lib/RT/ScripScope.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/User.pm, lib/RT/Action/AutoReply.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Interface/Email.pm,
+ webrt/Admin/Elements/SelectScrip,
+ webrt/Admin/Elements/SelectTemplate,
+ webrt/Ticket/Create_Detail.html:
+
+ Work on scrips all around:
+ web ui cleanups
+ Action::SendEmail cleanups
+
+ work on acls for Ticket creation.
+ now users who only have "CreateTicket" can actually create tickets,
+ even if they can't see the ticket once created.
+ RT1's "allow nonmembers to create requests" can be replicated by
+ granting the metagroup 'requestors' the right "CreateTicket".
+
+ Mail gateway got a lot of debugging stubs. mail gateway now uses
+ modern semantics for Create.
+
+2000-11-28 17:46 jesse
+
+ * lib/RT/User.pm:
+
+ cacheed acl decisions are now properly granular.
+
+2000-11-28 17:39 jesse
+
+ * lib/RT/User.pm:
+
+ Cached ACL decisions are now expire after 2 minutes.
+
+2000-11-28 03:37 jesse
+
+ * etc/config.pm, lib/RT/Ticket.pm, webrt/Ticket/Update.html,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ fixed a small bug in ticket update.
+ fixed a set of bugs in "external" links that were discovered when my roommate suggested
+ that RT could be used as an mp3 playlist server. Now it can. no, you really don't want to.
+ At least until we have asset managment.
+
+2000-11-28 00:20 jesse
+
+ * Makefile, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ a couple little tweask to transaction and sendemail.
+
+ bumped the version #
+
+2000-11-28 00:12 jesse
+
+ * webrt/Ticket/: Display.html, LinkIt.html, ProcessUpdate.html,
+ Update.html, Elements/ShowSummary, Elements/ShowTransaction,
+ Elements/TicketToolBox:
+
+ Work on cleaning up the web ui. got rid of processupdate.html.
+ cleaned up the code in display.html.. linking is no longer nearly as offensive.
+
+2000-11-27 20:26 jesse
+
+ * webrt/Ticket/Elements/ShowRequestor:
+
+ small display fix to not show nobody as a possible requestor
+
+2000-11-27 20:05 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/User.pm, webrt/Ticket/Display.html:
+
+ Updates to how Create handles Requestor, Cc and Admin Cc.
+ it's now much more flexible, cleaner and simpler. yay.
+
+2000-11-27 04:01 jesse
+
+ * webrt/Elements/: Error, Header, MyRequests:
+
+ Web error reporting tweaks.
+ added MyRequests to the front page
+
+2000-11-27 04:01 jesse
+
+ * webrt/Elements/MyRequests:
+
+ file MyRequests was initially added on branch rt-1-1.
+
+2000-11-27 03:30 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Interface/Web.pm,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/ShowHistory:
+
+ more work on ACLs
+
+ Ticket.pm has been fully ACLed.
+ Did work on web ticket create. it's no longer a festering pile of garbage.
+ Now it's more of an office wastepaper basket full of clean white 20lb paper.
+ Seriously, though, it's cleaner. I got rid of some of Tobias' temporary ticket creation
+ code.
+
+2000-11-26 23:45 jesse
+
+ * lib/RT/ACE.pm, lib/RT/GroupMember.pm, lib/RT/Queue.pm,
+ lib/RT/Queues.pm, lib/RT/Template.pm, lib/RT/Ticket.pm,
+ lib/RT/User.pm, lib/RT/Interface/Web.pm, tools/insertdata,
+ webrt/Admin/Elements/ModifyQueue, webrt/Elements/Header,
+ webrt/Elements/Tabs:
+
+
+
+ lots more ACL work.
+ a little bit of UI cleanup.
+
+2000-11-25 01:56 jesse
+
+ * lib/RT/Tickets.pm, webrt/index.html,
+ webrt/Ticket/Elements/ShowDates:
+
+ made "my requests" doable.
+ fixed some ui in showdates.
+
+2000-11-24 20:14 jesse
+
+ * lib/RT/: Queue.pm, User.pm:
+
+ Fixed a couple of bugs in HasSystemRight that make RT install correctly again.
+
+2000-11-24 19:21 jesse
+
+ * etc/schema.pm:
+
+ schema fix to make pg happy
+
+2000-11-22 03:08 jesse
+
+ * webrt/Ticket/Update.html:
+
+ cleaned up the ticket udpdate form. made it more concise.::
+
+2000-11-22 03:04 jesse
+
+ * webrt/Ticket/Update.html:
+
+ cleaning up the ticket update form
+
+2000-11-22 02:49 jesse
+
+ * bin/testdeps.pl:
+
+ bumped searchbuilder dependency to the version now in CPAN...
+
+2000-11-22 02:31 jesse
+
+ * Makefile, lib/RT/ACE.pm, lib/RT/ACL.pm, lib/RT/Action.pm,
+ lib/RT/Attachment.pm, lib/RT/Attachments.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Date.pm, lib/RT/EasySearch.pm, lib/RT/Group.pm,
+ lib/RT/GroupMember.pm, lib/RT/GroupMembers.pm, lib/RT/Groups.pm,
+ lib/RT/Handle.pm, lib/RT/Link.pm, lib/RT/Links.pm, lib/RT/Queue.pm,
+ lib/RT/Queues.pm, lib/RT/Record.pm, lib/RT/Scrip.pm,
+ lib/RT/ScripScope.pm, lib/RT/ScripScopes.pm, lib/RT/Scrips.pm,
+ lib/RT/Template.pm, lib/RT/Templates.pm, lib/RT/Ticket.pm,
+ lib/RT/Tickets.pm, lib/RT/Transaction.pm, lib/RT/Transactions.pm,
+ lib/RT/User.pm, lib/RT/Users.pm, lib/RT/Utils.pm,
+ lib/RT/Watcher.pm, lib/RT/Watchers.pm:
+
+ Bumped version to 1.3.23
+ Added pod headers to most core modules?
+
+2000-11-21 23:05 jesse
+
+ * webrt/Ticket/Elements/ShowSummary:
+
+ removed a dead link
+
+2000-11-21 04:07 jesse
+
+ * Makefile, lib/RT/Queue.pm, lib/RT/Scrip.pm, lib/RT/ScripScope.pm,
+ lib/RT/Transaction.pm, lib/RT/User.pm:
+
+ tmp logfiles now go in /tmp
+ oh. and SCRIPS NOW WORK. RT can send mail.
+ and recieve mail. life is good.
+
+2000-11-21 02:55 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Implemented Ticket->IsWatcher.
+ This is what we needed to make pseudogroup based ACLs work
+
+2000-11-21 00:55 jesse
+
+ * lib/RT/Queue.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ webrt/Elements/Tabs:
+
+ fixed a couple of bugs while I was out and about.
+ Oh. and most of the rest of the ACL core is implemented now.
+ rights for requestor/owner/cc/admincc should now work.
+
+2000-11-20 11:59 jesse
+
+ * lib/RT/ACE.pm, lib/RT/User.pm, tools/insertdata:
+
+ Added "Requestor" and "Everyone" metagroups to tools/insertdata
+
+ Fixed a bug with yet another way to call HasQueueRight.
+
+2000-11-20 00:39 jesse
+
+ * Makefile:
+
+ bumped to 1.3.22 for release
+
+2000-11-20 00:24 jesse
+
+ * webrt/Search/Listing.html:
+
+ fixed a big triggered when clearing empty ticket searches
+
+2000-11-19 23:55 jesse
+
+ * bin/webmux.pl, lib/RT/User.pm:
+
+ fixed a bug that stopped you from specifying an owner on ticket create
+ Watcher and Watchers are now preloaded in the App server.
+
+2000-11-19 23:20 jesse
+
+ * webrt/Ticket/Elements/Tabs:
+
+ file Tabs was initially added on branch rt-1-1.
+
+2000-11-19 23:20 jesse
+
+ * webrt/: index.html, Admin/Elements/Tabs, Elements/Header,
+ Elements/Tabs, Search/Listing.html, Search/RestrictSearch.html,
+ Ticket/Create.html, Ticket/Create_Detail.html, Ticket/Display.html,
+ Ticket/EditWatchers.html, Ticket/Modify.html, Ticket/Update.html,
+ Ticket/Elements/Tabs:
+
+ more UI tweaking. yay.
+
+2000-11-19 17:57 jesse
+
+ * webrt/Elements/Quicksearch:
+
+ file Quicksearch was initially added on branch rt-1-1.
+
+2000-11-19 17:57 jesse
+
+ * webrt/Elements/MyTickets:
+
+ file MyTickets was initially added on branch rt-1-1.
+
+2000-11-19 17:57 jesse
+
+ * webrt/rt.jpg:
+
+ file rt.jpg was initially added on branch rt-1-1.
+
+2000-11-19 17:57 jesse
+
+ * lib/RT/ACE.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm,
+ lib/RT/Interface/Web.pm, webrt/index.html, webrt/rt.jpg,
+ webrt/Elements/MyTickets, webrt/Elements/Quicksearch,
+ webrt/Search/Listing.html:
+
+ A bunch of UI work. we now have a placeholder logo
+
+2000-11-18 03:03 jesse
+
+ * lib/RT/: User.pm, Interface/Web.pm:
+
+ ACL change messages are now properly scoped. so now they don't hang out
+ between sessions
+
+ if a user has a system right, that right now applies to all queues.
+
+2000-11-17 00:19 jesse
+
+ * Makefile:
+
+ Rolled rev 1.3.21. now with an ACL editor.
+
+2000-11-17 00:15 jesse
+
+ * webrt/Admin/Elements/SelectRights:
+
+ file SelectRights was initially added on branch rt-1-1.
+
+2000-11-17 00:15 jesse
+
+ * lib/RT/ACE.pm, lib/RT/Group.pm, lib/RT/Queue.pm,
+ lib/RT/Template.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ lib/RT/Interface/Web.pm, webrt/Admin/Elements/SelectRights:
+
+ Woo! the ACL editor is now much cleaner. and it works. :)
+
+2000-11-16 01:17 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm, Attachment.pm, Attachments.pm,
+ CurrentUser.pm, EasySearch.pm, Group.pm, GroupMember.pm,
+ GroupMembers.pm, Groups.pm, Link.pm, Links.pm, Queue.pm, Queues.pm,
+ Record.pm, Scrip.pm, ScripScope.pm, ScripScopes.pm, Scrips.pm,
+ Template.pm, Templates.pm, Ticket.pm, Transaction.pm,
+ Transactions.pm, User.pm, Users.pm, Watcher.pm, Watchers.pm,
+ Interface/Web.pm:
+
+
+ LEANED UP A WHOLE BUNCH OF NEW ROUTINES. FIXED A FREW ACL BUGS.
+
+2000-11-15 02:29 jesse
+
+ * lib/RT/ACE.pm, lib/RT/ACL.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Queue.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ webrt/Admin/Elements/Tabs, webrt/Elements/Submit:
+
+ refactored ACLS to take out a layer of complexity or two.
+
+2000-11-14 13:17 jesse
+
+ * Makefile:
+
+ bumped the makefuile version
+
+2000-11-13 23:19 jesse
+
+ * bin/webmux.pl, lib/RT/ACL.pm, lib/RT/EasySearch.pm,
+ lib/RT/Group.pm, lib/RT/GroupMember.pm, lib/RT/Record.pm,
+ lib/RT/User.pm:
+
+ A bunch of refactoring to make ACL editable. Lots of work on the ACL editor.
+ Basic user ACLs are now editable.
+ It needs some more refactoring, since I stopped being on quite as much crack
+ over the wekeend and figured out a much less intense way to do a bunch of stuff. Yay.
+
+2000-11-08 14:55 jesse
+
+ * Makefile, NEWS:
+
+ all mail sent out is now sent out precedence "bulk" like it should be.
+
+2000-11-08 01:24 jesse
+
+ * webrt/Admin/Elements/SelectScrip:
+
+ file SelectScrip was initially added on branch rt-1-1.
+
+2000-11-08 01:24 jesse
+
+ * webrt/Admin/Elements/SelectTemplate:
+
+ file SelectTemplate was initially added on branch rt-1-1.
+
+2000-11-08 01:24 jesse
+
+ * etc/schema.pm, lib/RT/ACE.pm, lib/RT/ACL.pm,
+ lib/RT/CurrentUser.pm, lib/RT/Group.pm, lib/RT/Ticket.pm,
+ lib/RT/Tickets.pm, lib/RT/Transaction.pm, lib/RT/User.pm,
+ lib/RT/Users.pm, tools/insertdata,
+ webrt/Admin/Elements/SelectScrip,
+ webrt/Admin/Elements/SelectTemplate:
+
+ A whole slew of work on ACLs and assorted other related things.
+ This involved a lot of cleanup of ACL related code and things it touched.
+ ACL decisions are now being made. (Yes, you're all still superusers) but I
+ think I've got a bunch of the infrastructure cleaned up, so it should be
+ easier to finish off the ACL editor. yay!
+
+ As part of this, I had to add more groups support. all you groups-maniacs should be pleased ;)
+
+2000-11-06 11:55 jesse
+
+ * Makefile:
+
+ Fixed yet another typo in manipulate.pm.
+
+ Bumped version to 1.0.5
+
+2000-11-05 15:24 jesse
+
+ * Makefile:
+
+ A fix for action vs actions in mail manipulate.
+ fixed a typo normailize -> normalize in database/manipulate.pm
+
+2000-11-03 17:54 jesse
+
+ * README, etc/schema.pm, lib/RT/ACE.pm, lib/RT/ACL.pm,
+ lib/RT/CurrentUser.pm, lib/RT/GroupMember.pm, lib/RT/Queue.pm,
+ lib/RT/Ticket.pm, lib/RT/User.pm, lib/RT/Users.pm,
+ lib/RT/Interface/Email.pm, lib/RT/Interface/Web.pm,
+ tools/insertdata, webrt/Admin/ModifyUser,
+ webrt/Admin/Elements/QueueRightsForUser, webrt/Admin/Elements/Tabs,
+ webrt/Elements/SelectOwner:
+
+ A bunch of work on the ACLs. we're getting closer to having a workable ACL
+ editor.
+
+2000-11-03 15:37 jesse
+
+ * Makefile, NEWS:
+
+ We now deal better with merging merged tickets.
+
+ We now properly ignore Precedence: {junk|bulk} headers
+
+2000-10-31 00:06 jesse
+
+ * lib/RT/: ACE.pm, ScripScope.pm:
+
+ Added ACL support to the ScripScope system.
+
+2000-10-29 21:31 jesse
+
+ * Makefile, README, bin/webmux.pl, lib/RT/ACE.pm, lib/RT/Group.pm,
+ lib/RT/Groups.pm, lib/RT/Queue.pm, lib/RT/ScripScope.pm,
+ lib/RT/ScripScopes.pm, lib/RT/Scrips.pm, lib/RT/Template.pm,
+ lib/RT/Templates.pm, lib/RT/Transaction.pm, tools/insertdata:
+
+ A bunch of hacking to the ScripScopes system.
+
+ You can now edit scrips for a given queue.
+ but hey, scrips have no ACL checking yet.
+
+2000-10-29 17:51 jesse
+
+ * etc/schema.pm:
+
+ Added a whole lot of documentation to schema.pm.
+
+2000-10-25 21:09 jesse
+
+ * Makefile, bin/testdeps.pl, etc/schema.pm:
+
+ Updated schema.pm and testdeps to jibe with the current CPAN versions of things.
+ And I bumped the version to 1.3.20
+
+2000-10-23 16:53 jesse
+
+ * Makefile, lib/RT/Date.pm:
+
+ Reverted to using mysql by default.
+ Finished off the postgresql support in the rt core. (well, at least finished the initial support)
+
+2000-10-23 16:35 jesse
+
+ * Makefile, lib/RT/ACE.pm, lib/RT/Ticket.pm, tools/insertdata:
+
+ Cleanups related to making postgres support work right.
+
+2000-10-22 20:57 jesse
+
+ * Makefile, bin/initacls.Pg, bin/testdeps.pl, etc/acl.Pg,
+ etc/config.pm, etc/schema.pm, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Tickets.pm, tools/initdb, tools/insertdata,
+ webrt/Ticket/Display.html:
+
+ merged in ivan's postgres patches.
+ made local ticket links work again. *sigh* SQL evil. eeeeevil.
+
+2000-10-16 16:32 jesse
+
+ * docs/Security:
+
+ file Security was initially added on branch rt-1-1.
+
+2000-10-16 16:32 jesse
+
+ * docs/Security:
+
+ some initial notes on security. targetted at RT admins.
+
+2000-10-16 03:01 jesse
+
+ * lib/RT/: Link.pm, Links.pm, Ticket.pm:
+
+ Fixed a couple of typos in link and links.
+ Ticket->Load will now do the right hting with ticket uris or aliases.
+
+2000-10-16 00:47 jesse
+
+ * etc/config.pm, lib/RT/Link.pm, lib/RT/Links.pm, lib/RT/Ticket.pm:
+
+ The linking interface now uses URIs internally. and it does lots of
+ sanity checking.
+
+ Tickets now understand what their uris should be. you can load tickets by
+ uri. and by alias.
+
+ We need a bit more work to make alias support just transparent, but we're
+ getting really close.
+
+ You shouldn't be able to link to nonexistent local objects any mroe.
+
+2000-10-15 01:57 jesse
+
+ * lib/RT/CurrentUser.pm:
+
+ Added CurrentUser->LoadByGecos.
+ The CLI now uses LoadByGecos to load the currentuser.
+ This means that users other than root might actually be able to use the cli now
+ VS: ----------------------------------------------------------------------
+
+2000-10-15 01:11 jesse
+
+ * Makefile:
+
+ Significantly redid the installation procedure. we're now _much_
+ more careful about what gets installed where and what's owned by whom.
+
+ Oh. and RT's now setgid, rather than setuid. and there's no setuid wrapper anymore
+
+2000-10-15 01:08 jesse
+
+ * etc/: config.pm, suidrt.c:
+
+ Yanked suidrt.c, since we now run setgid.
+
+ rt now logs to /tmp/rt.log.pid.userid
+
+2000-10-14 02:56 jesse
+
+ * bin/rtmux.pl, bin/webmux.pl, etc/schema.pm,
+ lib/RT/CurrentUser.pm, lib/RT/Interface/Email.pm, tools/initdb,
+ tools/insertdata:
+
+ CurrentUser.pm had LoadByEmail and LoadByUserId methods added and they're now
+ actually used most everywhere.
+
+ insertdata doesn't force ids for users now.
+
+ the schema now actually enforces a lot of important uniqueness constraints.
+
+2000-10-13 10:59 jesse
+
+ * etc/schema.mysql:
+
+ Removed the old schema.mysql, lest it lead people astray
+
+2000-10-13 02:27 jesse
+
+ * webrt/Ticket/Elements/: EditPeople, ShowMembers:
+
+ Removed some old warning text that's not true any more.
+ Fixed a relative url problem in "show memebers"
+
+2000-10-12 23:22 jesse
+
+ * Makefile, bin/testdeps.pl:
+
+ updated testdeps.
+ Makefile now defaults to installing rt2 in /opt/rt2
+
+2000-10-12 22:54 jesse
+
+ * Makefile, lib/RT/ACL.pm, lib/RT/Queue.pm, lib/RT/Ticket.pm,
+ lib/RT/User.pm, lib/RT/Users.pm, tools/insertdata,
+ webrt/index.html:
+
+ A couple of links on the front page.
+ Makefile now assumes www-data instead of nobody as the web user. this is not quite right.
+
+ Fixed a little bit of the POD in User.pm.
+
+ Redid how Ticket.pm deals with Owner on create. the new logic should actually catch errors
+ instead of easily letting referential integrity checks just _fail_.
+
+ Insertdata got cleaned up a little bit.
+
+ ACL got its cleaned up a bit
+
+2000-10-11 23:22 jesse
+
+ * webrt/Admin/Elements/QueueRightsForUser:
+
+ file QueueRightsForUser was initially added on branch rt-1-1.
+
+2000-10-11 23:22 jesse
+
+ * lib/RT/Users.pm, webrt/Admin/Elements/QueueRightsForUser:
+
+ Work on ACLs. and the ACL editor
+
+2000-10-11 21:23 jesse
+
+ * tools/insertdata:
+
+ gave root a password
+
+2000-10-11 12:28 jesse
+
+ * Makefile, tools/initdb:
+
+ Databasename changed from RT2 to rt2 to make postgres happier.
+
+ initdb quoting bug fixed.
+
+ debug mode in initdb turned off.
+
+ If you're using mysql and running with ivan's current CVS version of DBIx::DBSchema, RT should once again work.
+
+2000-10-09 02:32 jesse
+
+ * etc/schema.pm, tools/initdb:
+
+ a debugging hook in initdb and defaults (though they don't work just right yet)
+ in schema.pm. Note that we now need DBIx::DBSchema from CVS.
+
+2000-10-09 01:59 jesse
+
+ * Makefile, NEWS, etc/suidrt.c:
+
+ Jan Kujawa fixed a bug in the setuid wrapper
+ Jan Okrouhly fixed some bugs in the merged ticket resolution in the cli.
+
+ Rolled 1.0.5pre3
+
+2000-10-05 17:30 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm:
+
+ more work on RT's acl core
+
+2000-10-05 17:30 jesse
+
+ * webrt/Admin/Elements/: GrantQueueRightsTo, GrantQueueRightsTo~,
+ SelectQueueRights:
+
+ more acl work
+
+2000-10-05 17:30 jesse
+
+ * webrt/Admin/Elements/GrantQueueRightsTo~:
+
+ file GrantQueueRightsTo~ was initially added on branch rt-1-1.
+
+2000-10-05 17:30 jesse
+
+ * webrt/Admin/Elements/GrantQueueRightsTo:
+
+ file GrantQueueRightsTo was initially added on branch rt-1-1.
+
+2000-10-05 17:30 jesse
+
+ * webrt/Admin/Elements/SelectQueueRights:
+
+ file SelectQueueRights was initially added on branch rt-1-1.
+
+2000-10-05 15:49 jesse
+
+ * etc/suidrt.c:
+
+ reordering things in suidrt.c seemed to make them happier.
+
+2000-10-05 15:39 jesse
+
+ * etc/suidrt.c:
+
+ missed a comma
+
+2000-10-05 15:03 jesse
+
+ * bin/testdeps.pl:
+
+ added a dependency test script to make installation by newbies easier.
+
+2000-10-05 15:03 jesse
+
+ * Makefile, README, etc/suidrt.c:
+
+ Major rewrite of suidrt.c by jan kujawa.
+ A couple of bugfixes from Jan Okrouhly
+ Public history should now work right in the cli
+ Web viewing of merged tickets by their old # should now work better.
+
+2000-10-03 20:22 jesse
+
+ * bin/testdeps.pl:
+
+ cleaned up testedeps.pl output
+
+2000-10-03 02:41 jesse
+
+ * tools/insertdata:
+
+ file insertdata was initially added on branch rt-1-1.
+
+2000-10-03 02:41 jesse
+
+ * tools/initdb:
+
+ file initdb was initially added on branch rt-1-1.
+
+2000-10-03 02:41 jesse
+
+ * etc/schema.pm:
+
+ file schema.pm was initially added on branch rt-1-1.
+
+2000-10-03 02:41 jesse
+
+ * Makefile, bin/initdb.Oracle, bin/initdb.Pg, bin/initdb.mysql,
+ bin/testdeps.pl, etc/schema.Pg, etc/schema.pm, lib/RT/ACE.pm,
+ lib/RT/Queue.pm, lib/RT/Scrip.pm, lib/RT/User.pm, tools/initdb,
+ tools/insertdata:
+
+ Fairly massive installation changes.
+ We now use ivan's really cool DBIx::DBschema, which, when things
+ settle out a bit mean that the oracle and postgres (and possibly other) ports
+ get their schema updated automatically.
+
+ The initial seed data is now inserted by tools/insertdata through the RT API.
+
+ ACE::Create now actually works.
+ Same with Scrip::Create.
+ and Queue::Create.
+
+ There are a couple of new installation-only dependencies. One of them (DBSchema) may become a build-only
+ dependency if people whine enough :)
+
+ date/time handling was a casualty of the changes. some things will be handled oddly for now.
+ Once Ivan releases the next DBSchema update, this should get better again. it was
+ the result of a namespace collision between pg and mysql. the timestamp column has
+ different behavior. go fig.
+
+ This version will require DBIx::SearchBuilder 0.06 (aka what I'm about to check in)
+
+2000-10-03 02:07 jesse
+
+ * tools/test:
+
+ blew away old, crufty "extras"
+
+2000-09-28 13:55 jesse
+
+ * lib/RT/Group.pm:
+
+ file Group.pm was initially added on branch rt-1-1.
+
+2000-09-28 13:55 jesse
+
+ * lib/RT/: Group.pm, GroupMember.pm, GroupMembers.pm, Groups.pm:
+
+ Long overdue adding of completely untested (and unused) code for groups in RT.
+ note that this implementation does not assume recursive group membership
+
+2000-09-28 13:55 jesse
+
+ * lib/RT/GroupMember.pm:
+
+ file GroupMember.pm was initially added on branch rt-1-1.
+
+2000-09-28 13:55 jesse
+
+ * lib/RT/GroupMembers.pm:
+
+ file GroupMembers.pm was initially added on branch rt-1-1.
+
+2000-09-28 13:55 jesse
+
+ * lib/RT/Groups.pm:
+
+ file Groups.pm was initially added on branch rt-1-1.
+
+2000-09-18 01:57 jesse
+
+ * lib/RT/: ACE.pm, Queue.pm, Ticket.pm:
+
+ Lots of work on Queue.pm Most cleanups related to queue watchers, but I
+ also added a bit more documentation and fixed a bug that could cause DelWatcher
+ in ticket.pm to delete watchers it shouldn't
+
+2000-09-18 00:03 jesse
+
+ * docs/API, docs/FAQ, docs/README.oracle, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm:
+
+ More documentation. removed outdated docs.
+
+ docs/API now talks about what those of you writing your own RT client
+ code shouldn't be doing. (Which objects you shouldn't touch).
+
+2000-09-18 00:00 jesse
+
+ * README:
+
+ Clarified license terms. RT is available under Version 2 of the GPL.
+ Not version 1. Not some as-yet-unwritten version 3 that says you can only
+ use it if you agree to license your children under the GPL. Version 2.
+
+2000-09-17 19:57 jesse
+
+ * lib/RT/: TicketCollection.pm, User.pm, Interface/Email.pm:
+
+ Removed bogus signature code.
+ Documented User->IsPassword
+ removed --area flag from Mailgateway (We ain't got no stinking areas)
+
+2000-09-17 19:21 jesse
+
+ * etc/schema.Oracle, etc/schema.mysql, lib/RT/ACE.pm,
+ lib/RT/ACL.pm, lib/RT/Scrip.pm, lib/RT/User.pm:
+
+ Ugh. Mysql isn't respecting SQL92 reserved words. which meant that I didn't
+ notice that I was using "Type" and "Action" in my schema.
+ This required a bit of churn to the ACE and User modules.
+
+2000-09-17 17:38 jesse
+
+ * Makefile:
+
+ Ok. I think I've got it now. This is RT 1.3.18. aka RT2 - Alpha 1.
+ The "Bear Suit" Release.
+
+ A formal release announcement is forthcoming.
+
+2000-09-17 17:29 jesse
+
+ * Makefile:
+
+ work on the changelog generator
+
+2000-09-17 17:19 jesse
+
+ * HACKING, Makefile, README, bin/initdb.mysql, bin/testdeps.pl:
+
+ Bumped the required version of SearchBuilder in testdeps, now that it's
+ propagated throughout CPAN
+
+ Replaced initdb.mysql with ivan's new version.
+
+ Tweaked ivan's initdb.mysql to be a little friendlier, create the schema
+ (it was missing a FILEHANDLE in a print statement and deal
+ better with omitted passwords.
+
+ Updated the readme some more.
+
+ Added experimental ChangeLog generation to the make dist process
+
+ Bumped the version number to 1.3.18 for release as alpha1 for RT2 today.
+
+2000-09-17 01:40 jesse
+
+ * Makefile, README, bin/initacls.mysql, bin/testdeps.pl,
+ bin/webmux.pl:
+
+ Bumped the Mason version requirement up, so we avoid the poisoned v 0.88
+ Applied ivan's alpha-1 patches.
+ Did some tweaking for the alpha 1 release.
+ Cleaned up the readme a bit
+
+2000-09-15 01:21 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-09-15 01:17 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Mail gateway now handles followup correspondence properly
+ (It gets the ticket # right)
+
+2000-09-15 01:06 jesse
+
+ * lib/RT/Watcher.pm:
+
+ fixed a typo (left off a > ) in Watcher.pm
+
+2000-09-15 00:59 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Watcher.pm, webrt/Ticket/Modify.html:
+
+ Editing ticket watchers from the webui now works.
+ this required a bunch of work on the internal wathers stuff
+ in ticket.pm.
+ Also added documentation and watcher-related sanity checks
+
+2000-09-14 00:04 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/Watcher.pm,
+ webrt/Elements/SelectWatcherType, webrt/Ticket/Elements/EditPeople,
+ webrt/Ticket/Elements/EditWatchers,
+ webrt/Ticket/Elements/ModifyTicket:
+
+ Some cleanup to Watcher and Ticket. (mainly documentation updates)
+ Added an IsUser sub to Watcher.pm (which tells you if the watcher
+ object refers to a local user or a remote email address)
+
+ the ui for editing tickets should work now.
+ note that the backend for the watchers side of this isn't there
+ yet.
+
+ -j
+
+2000-09-13 18:10 jesse
+
+ * etc/config.pm:
+
+ fixed a configfile typo that would break a new installation
+
+2000-09-12 01:28 jesse
+
+ * lib/RT/Date.pm, lib/RT/Ticket.pm, webrt/Elements/ListActions,
+ webrt/Elements/SelectDate, webrt/Elements/SelectUsers,
+ webrt/Elements/SelectWatcherType, webrt/Ticket/Modify.html,
+ webrt/Ticket/Elements/AddWatchers, webrt/Ticket/Elements/EditDates,
+ webrt/Ticket/Elements/EditPeople,
+ webrt/Ticket/Elements/ModifyTicket:
+
+ TimeWorked is now read/write (which may be a bad idea. but I'm willing to try it.
+ RT::Date now better understands that "never" doesn't mean 1970.
+
+ The web modify interface is getting closer to working.
+ I mainly need to finish making the watchers column go.
+
+2000-09-11 00:37 jesse
+
+ * etc/config.pm:
+
+ Some sanity cleanups to the web queue listing.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/EditDates:
+
+ file EditDates was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/EditWatchers:
+
+ file EditWatchers was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/AddWatchers:
+
+ file AddWatchers was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/EditBasics:
+
+ file EditBasics was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/EditPeople:
+
+ file EditPeople was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/Ticket/Elements/ModifyTicket:
+
+ file ModifyTicket was initially added on branch rt-1-1.
+
+2000-09-11 00:35 jesse
+
+ * webrt/: Login.html, webrt.css, Elements/SelectDate,
+ Elements/SelectMatch, Elements/SelectQueue, Elements/SelectUsers,
+ Elements/ShadedBox, Ticket/EditWatchers.html, Ticket/Modify.html,
+ Ticket/Elements/AddWatchers, Ticket/Elements/EditBasics,
+ Ticket/Elements/EditDates, Ticket/Elements/EditPeople,
+ Ticket/Elements/EditWatcherList, Ticket/Elements/EditWatchers,
+ Ticket/Elements/ModifyTicket, Ticket/Elements/ShowBasics,
+ Ticket/Elements/ShowDates, Ticket/Elements/ShowDependencies,
+ Ticket/Elements/ShowHistory, Ticket/Elements/ShowPeople,
+ Ticket/Elements/ShowSummary, Ticket/Elements/TicketToolBox:
+
+ Lots and lots of work on the webui.
+ The display UI has been cleaned up a bit and the modify UI has been started.
+ It's not in its final for yet, nor is there any logic backing many of the new ui features, but those will come next.
+
+ If I'm remebering my list correctly, this is the one "biggie" before Alpha 1.
+
+ Yay!
+
+2000-09-11 00:35 jesse
+
+ * webrt/Elements/SelectUsers:
+
+ file SelectUsers was initially added on branch rt-1-1.
+
+2000-09-07 00:52 jesse
+
+ * webrt/: Login.html, autohandler, Ticket/Elements/ShowSummary:
+
+ Replaced tobias' web arg preservation code with something that's actually based on _mason_ rather than the external apache object. This should make the fastcgi port easier
+
+ Fixed a bug in showsummary (unqualified WebPath)
+
+2000-09-07 00:30 jesse
+
+ * Makefile, bin/rtmux.pl, lib/RT/Handle.pm:
+
+ Look ma! it should install again (i'd flubbed a bit of the
+ fastcgi mason handler install.
+
+ Oh. and oracle support should work now.
+
+2000-09-06 00:52 jesse
+
+ * webrt/Logout.html:
+
+ Logout.html links you to the right place now
+
+2000-09-05 23:47 jesse
+
+ * webrt/Search/Listing.html:
+
+ YA typo fix
+
+2000-09-05 23:45 jesse
+
+ * webrt/Search/Listing.html:
+
+ Damn I wish I could type tonight. :/ missed an $RT::
+
+2000-09-05 23:43 jesse
+
+ * webrt/: Search/Listing.html, Ticket/Elements/ShowSummary:
+
+ Fixed a few more Absolute url bugs
+
+2000-09-05 23:35 jesse
+
+ * webrt/Elements/Tabs:
+
+ Tabs needed / as the final character for transparent proxying
+
+2000-09-05 22:39 jesse
+
+ * webrt/: Login.html, Admin/Elements/CreateUserCalled,
+ Admin/Elements/ModifyQueue, Admin/Elements/ModifyTemplate,
+ Admin/Elements/ModifyUser, Admin/Users/index.html:
+
+ more work on proper absolute pathing
+
+2000-09-05 22:08 jesse
+
+ * webrt/: Login.html, Admin/Elements/CreateQueueCalled,
+ Admin/Elements/CreateUserCalled, Admin/Elements/ModifyUser,
+ Admin/Users/index.html:
+
+ A bunch of the admin tools weren't properly dealing with absolute pathed requests. it made it impossible to have RT2 anywhere other than at the / of your webserver
+
+2000-09-05 21:40 jesse
+
+ * lib/RT/Handle.pm:
+
+ file Handle.pm was initially added on branch rt-1-1.
+
+2000-09-05 21:40 jesse
+
+ * bin/mason_handler.fcgi:
+
+ file mason_handler.fcgi was initially added on branch rt-1-1.
+
+2000-09-05 21:40 jesse
+
+ * Makefile, bin/mason_handler.fcgi, bin/testdeps.pl,
+ lib/RT/Handle.pm:
+
+ Updated testdeps to ask for the new version of mailtools
+ Added in the new fastcgi handler (not working yet)
+ and RT::Handle, which is a wrapper for SearchBuilder::Handle
+
+2000-09-04 22:52 jesse
+
+ * Makefile, TODO, bin/rtmux.pl, bin/webmux.pl, etc/config.pm,
+ lib/RT/Record.pm, lib/RT/User.pm, lib/RT/Interface/Web.pm,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/ShowRequestor,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ A couple of bugfixes related to the switch to SearchBuilder.
+ A few webui cleanups.
+ A bit of abstraction to make the eventual fastcgi port easier.
+
+2000-09-04 12:48 jesse
+
+ * bin/testdeps.pl, lib/RT/Attachments.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/Watcher.pm, lib/RT/Watchers.pm,
+ lib/RT/Interface/Web.pm, webrt/Ticket/Elements/ShowDates:
+
+ Several batched updates from when pallas was off-net
+
+ UpdateTold changed to SetTold.
+ A bunch of work to get Scrips working.
+ Lots more POD in Ticket.pm
+ Transaction->Describe is better about printing what really happened.
+ Attachments.pm had a typo that prevented it from dealing with multipart messages.
+
+2000-08-31 02:18 jesse
+
+ * Makefile, NEWS, etc/suidrt.c:
+
+ Added ENV squashing to suidrt.c
+
+2000-08-30 14:46 jesse
+
+ * bin/rtmux.pl:
+
+ Rolling in some oracle changes...they're not done yet, but nothing should
+ break with mysql. fixed a typo in rtmux.pl that was introduced with the switch to searchbuilder.
+
+2000-08-29 17:02 jesse
+
+ * README, bin/rtmux.pl, bin/testdeps.pl, bin/webmux.pl,
+ lib/RT/EasySearch.pm, lib/RT/Record.pm:
+
+ MAJOR CHANGE: Switched to the new name of the DBIx:: modules.
+ We now use DBIx::SearchBuilder rather than DBIx::EasySearch and friends.
+ Note that this is only a name and structure change for the module set.
+ The functionality is the same...though seperating out oracle and mysql
+ specific features comes soon.
+
+2000-08-29 16:57 jesse
+
+ * etc/schema.Oracle:
+
+ updated the schema.Oracle
+
+2000-08-29 02:02 jesse
+
+ * webrt/: Elements/SelectWatcherType, Ticket/EditWatchers.html,
+ Ticket/Update.html:
+
+ Started hacking on watchers and ticket update webui a bit.
+ they need a lot more work
+
+2000-08-29 01:51 jesse
+
+ * webrt/Ticket/: Display.html, DisplayHistory, DisplayTransaction,
+ Elements/ShowHistory, Elements/ShowTransaction:
+
+ Made FullHeaders/BriefHeaders work in the webui
+
+2000-08-28 01:46 jesse
+
+ * webrt/Admin/Elements/: CreateUserCalled, ModifyUser:
+
+ Fixed some display buglets from tobi oetiker
+
+2000-08-28 01:31 jesse
+
+ * webrt/Ticket/Update.html:
+
+ Removed some text that harassed the user. that's generally bad policy
+
+2000-08-27 23:56 jesse
+
+ * webrt/: Admin/Elements/Header, Admin/Elements/ModifyTemplate,
+ Admin/Elements/Tabs, Elements/ListActions, Elements/Tabs:
+
+ A few more added helper elements from the webui
+
+2000-08-27 23:56 jesse
+
+ * webrt/Admin/Elements/Header:
+
+ file Header was initially added on branch rt-1-1.
+
+2000-08-27 23:56 jesse
+
+ * webrt/: Admin/Elements/Tabs, Elements/Tabs:
+
+ file Tabs was initially added on branch rt-1-1.
+
+2000-08-27 23:56 jesse
+
+ * webrt/Admin/Elements/ModifyTemplate:
+
+ file ModifyTemplate was initially added on branch rt-1-1.
+
+2000-08-27 23:56 jesse
+
+ * webrt/Elements/ListActions:
+
+ file ListActions was initially added on branch rt-1-1.
+
+2000-08-27 23:54 jesse
+
+ * webrt/Admin/Users/Prefs.html:
+
+ file Prefs.html was initially added on branch rt-1-1.
+
+2000-08-27 23:54 jesse
+
+ * webrt/Admin/: Queues/Create.html, Users/Create.html:
+
+ file Create.html was initially added on branch rt-1-1.
+
+2000-08-27 23:54 jesse
+
+ * webrt/Admin/: Queues/Modify.html, Users/Modify.html:
+
+ file Modify.html was initially added on branch rt-1-1.
+
+2000-08-27 23:54 jesse
+
+ * webrt/Admin/: Queues/index.html, Users/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-08-27 23:54 jesse
+
+ * bin/webmux.pl, lib/RT/Area.pm, lib/RT/Areas.pm, lib/RT/Queue.pm,
+ lib/RT/ScripScopes.pm, lib/RT/Template.pm, lib/RT/Templates.pm,
+ webrt/Admin/CreateQueue.html, webrt/Admin/CreateUser.html,
+ webrt/Admin/EditUser.html, webrt/Admin/ModifyQueue.html,
+ webrt/Admin/ModifyUser.html, webrt/Admin/index.html,
+ webrt/Admin/Elements/CreateQueueCalled,
+ webrt/Admin/Elements/CreateUserCalled,
+ webrt/Admin/Elements/ModifyQueue, webrt/Admin/Elements/ModifyUser,
+ webrt/Admin/Elements/SelectModifyQueue,
+ webrt/Admin/Elements/SelectModifyUser,
+ webrt/Admin/Queues/Create.html, webrt/Admin/Queues/Modify.html,
+ webrt/Admin/Queues/index.html, webrt/Admin/Users/Create.html,
+ webrt/Admin/Users/Modify.html, webrt/Admin/Users/Prefs.html,
+ webrt/Admin/Users/index.html:
+
+ Lots of work on the web admin ui. basic user and queue editing working.
+ and template editing
+
+2000-08-24 15:53 jesse
+
+ * Makefile, README, bin/rtmux.pl, etc/config.pm,
+ lib/RT/Action/SendEmail.pm, webrt/Elements/Footer,
+ webrt/Elements/Header, webrt/Elements/ViewUser,
+ webrt/Ticket/Elements/EditWatcherList:
+
+ The first cut at better configuration.
+
+ Updated the readme
+
+ Made the mail send routine in lib/RT/Action/Email.pm somewhat
+ more configurable (though we're still using printing to a pipe
+ because Mail::Mailer is busted :/)
+
+ Most options moved out of the makefile..this will make packaging
+ possible.
+
+ Fixed a couple places where tobias had been using a non-relative
+ url unnecessarily.
+
+2000-08-22 03:08 jesse
+
+ * Makefile:
+
+ Getting version #s in sync for RT 1.3.15
+
+2000-08-22 03:05 jesse
+
+ * lib/RT/: Scrip.pm, Transaction.pm, Action/AutoReply.pm,
+ Action/SendEmail.pm:
+
+ Work on making sure mail gets sent. It's not "right" yet but it's getting
+ closer.
+
+2000-08-21 19:46 jesse
+
+ * webrt/autohandler:
+
+ Fixed a minor issue that let people "log in as ''"
+
+2000-08-21 01:12 jesse
+
+ * bin/rtmux.pl, etc/config.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm:
+
+ Set a default type in ticket.pm
+ allowed restriction based on type in tickets.pm
+
+ now set the timezone in the config file rather than the rtmux.
+ means it effects webmux.pl too.
+
+2000-08-20 23:41 jesse
+
+ * etc/schema.mysql, lib/RT/Date.pm, webrt/Elements/SelectOwner:
+
+ Standardized StartsBy to Starts.
+ Removed a warning from SelectOwner
+ Fixed a bug in RT::Date->Set(Format => 'unknown')
+
+2000-08-20 01:46 jesse
+
+ * lib/RT/Ticket.pm, webrt/Search/Listing.html,
+ webrt/Ticket/Elements/ShowMemberOf,
+ webrt/Ticket/Elements/ShowMembers:
+
+ Work on MemberOf and Members in Ticket.pm
+ they're both now Tickets objects rather than links objects.
+ and the things that use them have been updated
+
+2000-08-19 03:03 jesse
+
+ * Makefile:
+
+ Bumped the version 1.3.14
+
+2000-08-19 02:49 jesse
+
+ * README, etc/config.pm, lib/RT/Ticket.pm:
+
+ Did some work on logging. switched some carping to some logging.
+
+2000-08-18 02:04 jesse
+
+ * Makefile, README:
+
+ Minor readme updates.
+
+ Bumped the version to 1.3.13
+
+2000-08-18 01:04 jesse
+
+ * lib/RT/Transaction.pm:
+
+ CurrentUser objects act on things. not user Objects. Thanks, Jens
+
+2000-08-17 23:55 jesse
+
+ * webrt/Elements/: SelectOwner, Submit:
+
+ notes in select owner. a bit of tweaking in submit ot make it more visible
+
+2000-08-17 16:16 jesse
+
+ * Makefile:
+
+ Changes to rt-mailgate to properly respect authenticated users
+ when performing %RT RESOLVE commands.
+
+2000-08-17 03:01 jesse
+
+ * lib/RT/Interface/Web.pm:
+
+ Missed a checkin on Web.pm. sorry about that
+
+2000-08-17 02:53 jesse
+
+ * bin/webmux.pl, lib/RT/Database.pm, lib/RT/Date.pm,
+ lib/RT/Ticket.pm, lib/RT/Interface/Web.pm:
+
+ Yanked the ancient lib/RT/Database.pm. It never served any purpose
+ added some functionality to RT::Date. it can now take a date type
+ of 'unknown.' This will "require" Date::Manip and parse it into
+ an ISO style date. note that this should NEVER be called from RT's
+ core due to overhead. It is useful from web interfaces and CLI tools....
+
+ added date::manip as a requirement to webmux.pl (so it gets loaded before
+ client hits)
+
+ cleaned up Interface/Web.pm
+
+ rationalized some of the routines dealing with date stuff in ticket.pm.
+
+ Actual working web date changing should be coming "soon." (where soon is
+ defined as sometime this week)
+
+2000-08-16 14:46 jesse
+
+ * webrt/Elements/Submit:
+
+ file Submit was initially added on branch rt-1-1.
+
+2000-08-16 14:46 jesse
+
+ * webrt/: Login.html, index.html, Elements/Footer, Elements/Header,
+ Elements/Submit, Ticket/Elements/ShowBasics,
+ Ticket/Elements/ShowTransaction:
+
+ Various bits of webui cleanup
+
+2000-08-16 14:16 jesse
+
+ * lib/RT/: Tickets.pm, Interface/Email.pm:
+
+ We can now search for tickets by relationship
+
+2000-08-16 13:18 jesse
+
+ * lib/RT/CurrentUser.pm:
+
+ the real oneline patch that should make rt-mailgate work for new users again.
+
+2000-08-15 01:17 jesse
+
+ * lib/RT/: Tickets.pm, Interface/Web.pm:
+
+ The first round of convenience methods in RT/Tickets.pm
+ Still need to do the ticket relations methods and the
+ date methods
+
+2000-08-14 23:47 jesse
+
+ * webrt/Elements/SelectDateType:
+
+ file SelectDateType was initially added on branch rt-1-1.
+
+2000-08-14 23:47 jesse
+
+ * webrt/Elements/SelectDateType:
+
+ ack. missed this in the wackiness with tonight's earlier checkin.
+
+2000-08-14 19:35 jesse
+
+ * webrt/: Elements/Header, Elements/SelectDate,
+ Elements/SelectQueue, Elements/TitleBoxStart, Search/Listing.html,
+ Search/PickRestriction:
+
+ The rest of the previous commit.
+
+2000-08-14 19:27 jesse
+
+ * etc/config.pm, webrt/Login.html, webrt/Logout.html,
+ webrt/autohandler, webrt/index.html, webrt/webrt.css,
+ webrt/Ticket/autohandler, webrt/Ticket/Elements/ShowMemberOf,
+ webrt/Ticket/Elements/ShowMembers,
+ webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Cleaned up the ticket display a bit.
+ made logout actually properly erase session data
+ protected _everything_ with an autohandler in /
+ prettified Login.html
+ added some options to /Elements/TitleBoxHead...which seems to have been missed
+
+2000-08-14 14:37 jesse
+
+ * README:
+
+ Added a warning about postmaster from JD
+
+2000-08-13 21:57 jesse
+
+ * lib/RT/TicketCollection.pm, lib/RT/Tickets.pm,
+ lib/RT/Interface/Web.pm, webrt/Elements/SelectBoolean,
+ webrt/Elements/SelectDate, webrt/Elements/SelectMatch,
+ webrt/Elements/SelectOwner, webrt/Elements/SelectQueue,
+ webrt/Elements/SelectStatus, webrt/Elements/SelectWatcherType,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction,
+ webrt/Search/TicketCell:
+
+ Significant work on the search and display code.
+ I'm not convinced that this doesn't introduce new bugs.
+ However, you can now search by ticket content.
+
+ I will be reworking Tickets.pm a bit more to add a bunch of convenience methods
+ over then next week or so.
+
+2000-08-12 18:07 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fixed a bug in WatchersAsString. (RT::Watchers wasn't required early enough)
+ this whole routine needs to be redone :/
+
+2000-08-12 18:06 jesse
+
+ * lib/RT/User.pm:
+
+ User->Create CanManipulate now defaults to 0.
+
+2000-08-12 18:05 jesse
+
+ * etc/schema.mysql:
+
+ Updated the default user entries in schema.mysql to have the "CanManipulate"
+ flag set so they'd show up in owner lists.
+
+2000-08-10 19:16 jesse
+
+ * README:
+
+ updated instructions for Apache install
+
+2000-08-10 18:59 jesse
+
+ * etc/schema.mysql:
+
+ the queue values for the first queue were wrong
+
+2000-08-10 17:55 jesse
+
+ * lib/RT/Ticket.pm:
+
+ BUGFIX: _UpdateTold now doesn't record a transaction, as things should be
+
+2000-08-10 15:43 jesse
+
+ * etc/config.pm, etc/schema.Oracle, etc/schema.mysql,
+ lib/RT/Attachment.pm, lib/RT/Record.pm, lib/RT/Scrip.pm,
+ lib/RT/ScripScope.pm, lib/RT/Ticket.pm, lib/RT/TicketCollection.pm,
+ lib/RT/Tickets.pm, lib/RT/Transaction.pm, lib/RT/User.pm,
+ lib/RT/Action/AutoReply.pm, lib/RT/Action/Notify.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Interface/Web.pm,
+ webrt/autohandler, webrt/Elements/Error,
+ webrt/Elements/SelectStatus, webrt/Ticket/Update.html,
+ webrt/Ticket/Elements/ShowBasics,
+ webrt/Ticket/Elements/ShowDependencies,
+ webrt/Ticket/Elements/ShowMemberOf,
+ webrt/Ticket/Elements/ShowMembers,
+ webrt/Ticket/Elements/ShowPeople,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowRequestor,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ Fixed ACL caching bugs
+ Finished adding status "new"
+ cli searching based on status works better.
+
+ API Change. Queue is NO LONGER the Queue Object for a ticket
+ API Change. Owner is NO LONGER the Owner Object for a ticket
+
+ instead, both point to their proper database values and OwnerObj and QueueObj
+ do the right thing throughout. This was rather more code churn than I was hoping for, but we've now got a cleaner, more consistent API that's easier to work
+ with.
+
+ little bits of POD update.
+
+ Cleaned out some unused code.
+
+ Made some error messages more professional.
+
+ We now keep track of date started as well as a "start by" date. these both
+ need a bit more work.
+
+ Calling convention for _Set changed. Rather than three different calling
+ conventions which weren't very extensible, DBIx::Record::_Set and all its
+ subclasses now use paramhash style calling. it's much more extensible and
+ flexible now. (This was necessary for some ACL work, among other things)
+
+2000-08-09 01:11 jesse
+
+ * lib/RT/Record.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ webrt/Elements/SelectStatus, webrt/Elements/dayMenu,
+ webrt/Elements/monthMenu, webrt/Elements/yearMenu:
+
+ ACL Decisions are now cached
+ date menus have a "never" option in the webui
+ added a new status. "new" for tickets that aren't yet open
+
+2000-08-08 01:45 jesse
+
+ * etc/schema.mysql, lib/RT/Queue.pm:
+
+ schema updates.
+ fixed queue->Create
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/ModifyQueue.html:
+
+ file ModifyQueue.html was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/: CreateQueue.html, CreateUser.html,
+ ModifyQueue.html, ModifyUser.html, index.html,
+ Elements/CreateQueueCalled, Elements/CreateUserCalled,
+ Elements/ModifyQueue, Elements/ModifyUser,
+ Elements/SelectModifyQueue, Elements/SelectModifyUser:
+
+ Started the new web admin interface.
+ it can now edit queues and users and create queues and users
+ I'm fairly leery of its user handling stuff. particularly passwords
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/CreateUser.html:
+
+ file CreateUser.html was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/SelectModifyUser:
+
+ file SelectModifyUser was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/ModifyUser:
+
+ file ModifyUser was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/CreateUserCalled:
+
+ file CreateUserCalled was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/ModifyUser.html:
+
+ file ModifyUser.html was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/CreateQueue.html:
+
+ file CreateQueue.html was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/ModifyQueue:
+
+ file ModifyQueue was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/SelectModifyQueue:
+
+ file SelectModifyQueue was initially added on branch rt-1-1.
+
+2000-08-08 01:44 jesse
+
+ * webrt/Admin/Elements/CreateQueueCalled:
+
+ file CreateQueueCalled was initially added on branch rt-1-1.
+
+2000-08-07 22:28 jesse
+
+ * etc/schema.mysql, lib/RT/Date.pm, lib/RT/Ticket.pm,
+ lib/RT/Users.pm:
+
+ added a few ticket attributes for forwards compatibility
+ fixed another ACL problem in users.pm
+ fixed a date display bug
+
+2000-08-07 01:03 jesse
+
+ * lib/RT/Transaction.pm, webrt/Ticket/Create.html,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Transaction.pm had some lingering ACL bugs ($CurrentUser) isn't a reasonable
+ global in core library routines :/
+
+ Working on spawning subtickets.
+
+2000-08-07 00:31 jesse
+
+ * webrt/User/Prefs.html:
+
+ file Prefs.html was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Ticket/Elements/ShowDependencies:
+
+ file ShowDependencies was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Ticket/Elements/ShowReferences:
+
+ file ShowReferences was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Ticket/Elements/ShowMembers:
+
+ file ShowMembers was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Ticket/Elements/ShowMemberOf:
+
+ file ShowMemberOf was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Admin/EditUser.html:
+
+ file EditUser.html was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * webrt/Admin/Elements/EditUserComments:
+
+ file EditUserComments was initially added on branch rt-1-1.
+
+2000-08-07 00:31 jesse
+
+ * etc/config.pm, lib/RT/Ticket.pm, webrt/EditUserComments.html,
+ webrt/ViewUser.html, webrt/webrt.css, webrt/Admin/EditUser.html,
+ webrt/Admin/ModifyUser, webrt/Admin/Elements/EditUserComments,
+ webrt/Elements/Error, webrt/Elements/Header,
+ webrt/Elements/SelectOwner, webrt/Ticket/Create.html,
+ webrt/Ticket/Create_Detail.html, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/EditWatcherList,
+ webrt/Ticket/Elements/ShowDependencies,
+ webrt/Ticket/Elements/ShowMemberOf,
+ webrt/Ticket/Elements/ShowMembers,
+ webrt/Ticket/Elements/ShowPeople,
+ webrt/Ticket/Elements/ShowReferences,
+ webrt/Ticket/Elements/ShowSummary, webrt/User/Prefs.html:
+
+ Did a bunch of work on the webui. cleaned up a lot of the link display stuff
+ did some work on ticket create
+
+ dependencies and subtickets are now listed in the ticketview. yay!
+
+2000-08-05 19:47 jesse
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Elements/ShowSummary:
+
+ more Nobody fixes in Ticket.pm
+ justification fixes in ShowSummary
+
+2000-08-05 18:50 jesse
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ The webui can now process updates.
+ it needed YA currentuser fix
+
+2000-08-05 18:43 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Ticket::Create(Owner => now takes either a user object or a userid.
+ and defaults to nobody.
+
+2000-08-05 17:51 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-08-05 17:49 jesse
+
+ * lib/RT/: Date.pm, Interface/Email.pm:
+
+ fixed a few more bugs in the mailgateway. it can create tickets now.
+ fixed an undefined default in the cli query
+ made the date routine not spit out a stupid warning
+
+2000-08-05 17:21 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ fixed typos in the mailgate. thanks gary
+
+2000-08-05 00:16 jesse
+
+ * Makefile, NEWS, webrt/Login.html, webrt/autohandler,
+ webrt/webrt.css:
+
+ little tweaks to the webui.
+ bumped the version to 1.3.11 for distribution
+
+2000-08-04 18:45 jesse
+
+ * README, bin/rtmux.pl, bin/webmux.pl, lib/RT/Areas.pm,
+ lib/RT/Attachments.pm, lib/RT/Date.pm, lib/RT/Link.pm,
+ lib/RT/Links.pm, lib/RT/Queue.pm, lib/RT/Queues.pm,
+ lib/RT/Record.pm, lib/RT/ScripScopes.pm, lib/RT/Scrips.pm,
+ lib/RT/Template.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm,
+ lib/RT/Transaction.pm, lib/RT/Transactions.pm, lib/RT/Users.pm,
+ lib/RT/Watchers.pm, lib/RT/Interface/Web.pm,
+ webrt/Admin/ModifyUser, webrt/Elements/SelectOwner,
+ webrt/Elements/SelectQueue, webrt/Elements/ViewUser,
+ webrt/Ticket/Display.html, webrt/Ticket/LinkIt.html,
+ webrt/Ticket/Elements/ShowPeople:
+
+ When creating an object, you ALWAYS need to pass in the current user
+ or acls break. we were a bit too lax about this before.
+
+ this was a major round of bugfixing for the webui
+
+2000-08-04 15:41 jesse
+
+ * Makefile, lib/RT/CurrentUser.pm, lib/RT/User.pm, webrt/webrt.css,
+ webrt/Elements/Header, webrt/Search/Listing.html,
+ webrt/Search/autohandler, webrt/Ticket/autohandler:
+
+ Queue listing doesn't have that ugly blue any more. And its code for
+ setting row color is a bit cleaner.
+
+ we now actually _check_ passwords for web logins.
+
+ webrt.css now has slightly darker hyperlinks.
+
+ CurrentUser->IsPassword now uses the UserObj
+
+ users can't use null passwords for authentication.
+
+2000-08-03 02:19 jesse
+
+ * lib/RT/Interface/Web.pm, webrt/Elements/ShadedBox,
+ webrt/Elements/TitleBoxStart:
+
+ misc fixes to the webui and a leftover fix to the cli.
+
+ the webui needs to have some of its internals gutted and
+ put back together. it feels very kludgy and not really "planned"
+
+2000-08-03 02:04 jesse
+
+ * lib/RT/: Record.pm, Scrip.pm, Ticket.pm, Tickets.pm,
+ Transaction.pm, Action/SendEmail.pm:
+
+ made status changes work. (RT::Action::SendEmail was being stupid
+ and not error checking until it was too late)
+
+ removed more use of hardwired SQL "now()"
+
+ moved the handling of LastUpdated into RT::Record. from DBIx::Record
+
+2000-08-03 01:09 jesse
+
+ * lib/RT/Queue.pm:
+
+ fixed a bug in the cli that kept ticket creates from working.
+ queue->hasright's calling convention changed.
+
+2000-08-03 00:59 jesse
+
+ * Makefile:
+
+ fixed a makefile typo. added back the comment about pg
+
+2000-08-03 00:42 jesse
+
+ * docs/design_docs/users:
+
+ file users was initially added on branch rt-1-1.
+
+2000-08-03 00:42 jesse
+
+ * etc/user.Oracle:
+
+ file user.Oracle was initially added on branch rt-1-1.
+
+2000-08-03 00:42 jesse
+
+ * etc/schema.Oracle:
+
+ file schema.Oracle was initially added on branch rt-1-1.
+
+2000-08-03 00:42 jesse
+
+ * bin/initacls.Oracle, bin/initdb.Oracle, docs/README.oracle,
+ docs/design_docs/users, etc/schema.Oracle, etc/user.Oracle:
+
+ A first cut at oracle support from Dave Morgan <dmorgan@bartertrust.com>.
+ It is pretty much untested and guaranteed to break. Among other
+ things, the schema isn't current. but it's a start.
+ Thanks, Dave!
+
+2000-08-03 00:42 jesse
+
+ * docs/README.oracle:
+
+ file README.oracle was initially added on branch rt-1-1.
+
+2000-08-03 00:42 jesse
+
+ * bin/initacls.Oracle:
+
+ file initacls.Oracle was initially added on branch rt-1-1.
+
+2000-08-03 00:42 jesse
+
+ * bin/initdb.Oracle:
+
+ file initdb.Oracle was initially added on branch rt-1-1.
+
+2000-08-03 00:31 jesse
+
+ * docs/design_docs/local_hacking:
+
+ file local_hacking was initially added on branch rt-1-1.
+
+2000-08-03 00:31 jesse
+
+ * HACKING, Makefile, docs/FAQ.html, docs/actions.html,
+ docs/admin.html, docs/attributes.html, docs/outline.html,
+ docs/rt_users_guide.html, docs/design_docs/local_hacking:
+
+ doc updates. removed outdated 1.x docs
+
+2000-08-02 23:53 jesse
+
+ * etc/config.pm:
+
+ added some comments from tobias
+
+2000-08-02 00:20 jesse
+
+ * Makefile, NEWS, TODO, etc/config.pm, etc/schema.mysql,
+ lib/RT/ACE.pm, lib/RT/ACL.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Date.pm, lib/RT/Queue.pm, lib/RT/Record.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/User.pm,
+ lib/RT/Interface/Email.pm:
+
+
+ Weekend of 1 Aug 2000
+ ---------------------
+ I spent the weekend in DC visiting family. This meant I got a bit of
+ code written ;) Sadly, I have no access to the CVS server,
+ so I'll be batching a bunch of commits.
+
+ 1. Enabled CLI admin tool
+ 2. Added ACL listing functionality to the CLI admin tool.
+ 3. Enhanced RT::Queue->Grant such that it works with the structure of RT2
+ ACLs
+ 4. Made the Logging framework actually log errors to STDERR.
+ (This makes debugging the CLI tools much easier. It also means
+ that the cli tools explain _why_ they're dying.)
+ 5. Fully expunged use of Mysql's SQL keyword "now()". I'd have left this
+ stuff in, except mysql doesn't seem to deal well with the idea that the
+ entire world isn't one timezone. On top of that, it doesn't seem to
+ have a way to force it into GMT mode that doesn't involve modifying init
+ scripts. *sigh*
+ 6. Did a whole bunch more work on the ACL checking in RT::User
+ 7. Wrote up some preliminary docs on local hacks to RT
+ 8. Added in a routine to allow local canonicalization of email addresses
+ 9. Added in the concept of "Disabled users" To preserve RT2's database
+ Integrity, whacking user accounts would be a bad thing. So, instead,
+ we've got the concept of 'disabled' users. A disabled user fails ANY
+ ACL check, ANY password check and doesn't appear in any lists of ACLs.
+ (note that the lastmost statement isn't yet true)
+
+ 10. rtadmin user -enable and rtadmin user -disable now work.
+ 11. ACLs are now enforced for many ticket related actions.
+ (this does mean that you'll want to insert some acls like those below)
+
+ INSERT INTO ACL VALUES (1,0,'User','SuperUser','Queue',0);
+ INSERT INTO ACL VALUES (2,3,'User','CreateTicket','Queue',0);
+ INSERT INTO ACL VALUES (3,3,'User','ShowTicket','Ticket',0);
+ INSERT INTO ACL VALUES (4,3,'User','ShowTicketHistory','Ticket',0);
+ INSERT INTO ACL VALUES (6,3,'User','CreateTicket','Queue',1);
+ INSERT INTO ACL VALUES (7,3,'User','ModifyTicket','Ticket',1);
+ INSERT INTO ACL VALUES (8,1,'User','Superuser','System',0);
+ INSERT INTO ACL VALUES (9,0,'Everyone','Superuser','System',0);
+
+2000-08-02 00:17 jesse
+
+ * bin/: rtmux.pl, testdeps.pl:
+
+ Bumped us up to requiring Log::Dispatch 1.6.
+ Cleaned up testdeps a bit. Now, you knwo it passes.
+
+2000-07-27 03:01 jesse
+
+ * Makefile:
+
+ Bumped the version to 1.3.9
+ Rolled RT 1.3.9
+
+2000-07-27 02:37 jesse
+
+ * lib/RT/Date.pm, lib/RT/Ticket.pm, webrt/Elements/ViewUser,
+ webrt/Ticket/Elements/ShowDates, webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction, bin/webmux.pl:
+
+ Fixed a bug with null due dates.
+ Made RT/Date deal with a time of -1 as "Never"
+ made html escaping on included entities on webrt default.
+
+2000-07-27 02:01 jesse
+
+ * lib/RT/Date.pm:
+
+ file Date.pm was initially added on branch rt-1-1.
+
+2000-07-27 02:01 jesse
+
+ * README, lib/RT/Date.pm, lib/RT/Record.pm, lib/RT/Ticket.pm,
+ bin/testdeps.pl:
+
+ Moved Date managment routines from DBIx::Record to RT::Record.
+ Initial Checkin of RT::Date, a lightweight Date object capable
+ of doing everything RT needs. Oh. and it's fully documented in POD.
+
+ Converted RT::Record and RT::Ticket and the cli to use RT::Date instead
+ of Date::Kronos. The CLI now feels _much_ zippier and code within
+ RT::Ticket is a bit easier to read.
+
+2000-07-27 01:55 jesse
+
+ * etc/schema.mysql:
+
+ removed extraneous whitespace
+
+2000-07-27 01:51 jesse
+
+ * lib/RT/Attachment.pm:
+
+ changed the header on attachment.pm
+
+2000-07-24 10:17 tobiasb
+
+ * lib/RT/Interface/Web.pm, webrt/ViewUser.html,
+ webrt/Search/TicketCell, webrt/Ticket/Display.html,
+ webrt/Ticket/ProcessUpdate.html, webrt/Ticket/Update.html:
+
+ Moved some things to Web.pm, made some nifty options for getting tickets from the listing in a new window
+
+2000-07-24 06:56 tobiasb
+
+ * lib/RT/User.pm:
+
+ Some TODOs
+
+2000-07-24 06:54 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Some comments and TODOs.
+
+ I fixed one simple TODO about putting in pid + rand into the name of
+ the temp directory needed for parsing the mime entity.
+
+2000-07-24 00:52 jesse
+
+ * lib/RT/User.pm:
+
+ Added a few comments where they really should be
+
+2000-07-24 00:48 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ Did a bunch of cleanup work on Interface/Email.pm
+ It could still use more.
+
+2000-07-23 03:50 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Added the method 'TimeWorkedAsString'. Ok, I'll start looking into Date::Kronos shortly :)
+
+2000-07-22 20:10 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ [no log message]
+
+2000-07-22 20:05 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Inserted a reference to [fsck 290] in a TODO-comment.
+
+2000-07-22 13:06 tobiasb
+
+ * lib/RT/Interface/Web.pm, webrt/Search/Listing.html:
+
+ Moved stuff from Listing.html to Web.pm, sub ProcessSearchQuery (suggestions to a better name for the sub?)
+
+2000-07-21 15:11 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Interface/Web.pm,
+ webrt/Search/Listing.html:
+
+ bugfixing
+
+2000-07-21 11:09 tobiasb
+
+ * etc/schema.mysql:
+
+ Bugfix
+
+2000-07-21 10:57 tobiasb
+
+ * webrt/index.html:
+
+ Now it's possible to select queue from the start page
+
+2000-07-21 10:35 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/Ticket.pm, webrt/Elements/Header,
+ webrt/Elements/SelectOwner, webrt/Ticket/Elements/EditWatcherList:
+
+ bugfixes, comments. I restricted the Owner-list to those that CanManipulate - this should eventually go away when we have proper access control. Tiny improvement of EditWatcherList - it's now possible to edit user information if the user is found.
+
+2000-07-21 05:48 tobiasb
+
+ * lib/RT/CurrentUser.pm:
+
+ bugfix
+
+2000-07-21 00:08 jesse
+
+ * lib/RT/ACE.pm, lib/RT/Attachment.pm, lib/RT/Queue.pm,
+ lib/RT/Ticket.pm, lib/RT/User.pm, webrt/EditUserComments.html:
+
+ Cleaned up language in EditUserComments
+
+ did work on watchers in ui/cli/admin and Ticket.pm and User.pm
+ cleaned up code in Ticket.pm
+
+ Start of some work on acls in Queue.pm
+
+2000-07-20 22:13 tobiasb
+
+ * lib/RT/Interface/Web.pm, webrt/Elements/SelectWatcherType,
+ webrt/Ticket/Display.html, webrt/Ticket/EditWatchers.html,
+ webrt/Ticket/Elements/EditWatcherList,
+ webrt/Ticket/Elements/ShowHistory, webrt/Ticket/Elements/ShowLinks,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ Some code improvements, added one popular demand here; to avoid spending too much time clicking around, it should be possible to show all histoies of member requests at the same page.
+
+2000-07-20 18:31 tobiasb
+
+ * lib/RT/CurrentUser.pm:
+
+ Fixing a bit. Please try to remember to test code before committing
+ it :)
+
+2000-07-20 18:09 tobiasb
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ once more I've committed without testing..
+
+2000-07-20 18:02 tobiasb
+
+ * lib/RT/CurrentUser.pm:
+
+ Removed a compile-time bug
+
+2000-07-20 17:48 tobiasb
+
+ * lib/RT/User.pm:
+
+ bugfix
+
+2000-07-20 17:39 tobiasb
+
+ * etc/config.pm, lib/RT/Ticket.pm, lib/RT/User.pm,
+ lib/RT/Watcher.pm, lib/RT/Interface/Web.pm,
+ webrt/Ticket/Display.html:
+
+ bugfixes + conflict resolving at the signature + moved something to Web.pm from Display.html
+
+2000-07-20 17:31 jesse
+
+ * lib/RT/: CurrentUser.pm, User.pm:
+
+ Culled some not-for-now signature stuff.
+ Cleaned up and optimised CurrentUser->UserObj
+
+2000-07-20 16:39 jesse
+
+ * Makefile, NEWS:
+
+ doing some work for a customer. rt-mailgate --help should tell you
+ about the fabulous new mail mode
+
+2000-07-20 15:39 tobiasb
+
+ * lib/RT/Interface/Web.pm, webrt/Ticket/Display.html:
+
+ moving things from the template to Web.pm was not as straight-forwarded as I had hoped.
+
+2000-07-20 15:20 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/CurrentUser.pm, lib/RT/User.pm,
+ lib/RT/Interface/Web.pm, webrt/Ticket/Display.html:
+
+ Started moving stuff to Web.pm, fixed and tested signatures
+
+2000-07-20 14:50 tobiasb
+
+ * lib/RT/: CurrentUser.pm, User.pm:
+
+ moved signature from currentuser to user (but does it make sense, anyway? Signatures is something 'personal' that belongs only to the current user?)
+
+2000-07-20 14:43 tobiasb
+
+ * webrt/ViewUser.html:
+
+ bugfix ... hmpf, always test before committing .. always test before committing ...
+
+2000-07-20 14:33 tobiasb
+
+ * lib/RT/Interface/Web.pm, webrt/ViewUser.html:
+
+ bugfix
+
+2000-07-20 14:11 tobiasb
+
+ * lib/RT/Interface/Web.pm:
+
+ file Web.pm was initially added on branch rt-1-1.
+
+2000-07-20 14:11 tobiasb
+
+ * lib/RT/Interface/Web.pm:
+
+ I'm considering to move things from Display.html and ProcessUpdate.html to Web.pm. Comments?
+
+2000-07-20 14:06 jesse
+
+ * lib/RT/Watcher.pm:
+
+ Removed the bogus code frol lib/RT/Watcher.pm
+
+2000-07-20 13:39 jesse
+
+ * lib/RT/User.pm:
+
+ reversed some bogus code
+
+2000-07-20 11:44 tobiasb
+
+ * webrt/Ticket/Elements/EditWatcherList:
+
+ file EditWatcherList was initially added on branch rt-1-1.
+
+2000-07-20 11:44 tobiasb
+
+ * webrt/Elements/SelectWatcherType:
+
+ file SelectWatcherType was initially added on branch rt-1-1.
+
+2000-07-20 11:44 tobiasb
+
+ * webrt/: Elements/SelectWatcherType,
+ Ticket/Elements/EditWatcherList:
+
+ Now it's possible to edit ticket and queue watchers. It's really horrible, but at least it works
+
+2000-07-20 11:43 tobiasb
+
+ * webrt/Ticket/: EditWatchers.html, Update.html:
+
+ Small comment
+
+2000-07-20 11:40 tobiasb
+
+ * webrt/Ticket/Update.html:
+
+ Linked in the 'edit watchers' functionality
+
+2000-07-20 11:27 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Watcher.pm,
+ webrt/Ticket/EditWatchers.html:
+
+ Now it's possible to edit ticket and queue watchers. It's really horrible, but at least it works
+
+2000-07-20 11:27 tobiasb
+
+ * lib/RT/User.pm:
+
+ bugfix
+
+2000-07-20 11:23 tobiasb
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ This is sort of a local hack, I guess it should be separated ... but maybe not. if content-type =~ /^text/(?\!plain)/, there is now a link for 'view this as plain text', which might be useful for unknown text formats and for viewing 'code'
+
+2000-07-20 02:59 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm:
+
+ I'm committing ACE.pm and ACL.pm so people can get a bit of a taste of what I'm doing. They don't work, they probably don't even compile yet, but they're not getting called from the rest of the code yet.
+
+ These aren't the droids you're looking for.
+
+2000-07-20 02:58 jesse
+
+ * lib/RT/User.pm:
+
+ updated User.pm to match the schema
+
+2000-07-19 16:45 tobiasb
+
+ * webrt/Ticket/EditWatchers.html:
+
+ file EditWatchers.html was initially added on branch rt-1-1.
+
+2000-07-19 16:45 tobiasb
+
+ * webrt/Ticket/EditWatchers.html:
+
+ This should be a template for adding and removing watchers; will be completed tomorrow
+
+2000-07-19 16:10 tobiasb
+
+ * webrt/: Logout.html, ViewUser.html, Search/Listing.html,
+ Ticket/Display.html, Ticket/Update.html,
+ Ticket/Elements/ShowPeople, Ticket/Elements/ShowSummary:
+
+ It's now possible to edit user data (realname, userid, email) from the web ui
+
+2000-07-19 16:04 tobiasb
+
+ * lib/RT/: CurrentUser.pm, Ticket.pm, Watcher.pm,
+ Interface/Email.pm:
+
+ Worked a bit with requestors; 1) if we already have a user object at the requestor, we should use it. 2) it should be possible to edit the users email without also updating the watcher email if those are the same. 3) if a user enters an email with a different from address, but can be identified as a previous user (by equal real name or other means of authentication), the email field in the watcher table should be used
+
+2000-07-19 10:06 tobiasb
+
+ * webrt/Elements/Header:
+
+ bugfixing
+
+2000-07-19 08:53 tobiasb
+
+ * webrt/webrt.css:
+
+ Our web designer didn't like red table borders
+
+2000-07-19 08:52 tobiasb
+
+ * webrt/: Elements/Header, Search/Listing.html:
+
+ Fun #440: Popular wish: Fixed alternating colours at the lines in Listing.html
+
+2000-07-19 07:41 tobiasb
+
+ * webrt/webrt.css:
+
+ oddline for use in Listing.html
+
+2000-07-19 06:54 tobiasb
+
+ * webrt/Elements/Header:
+
+ nicer
+
+2000-07-19 06:51 tobiasb
+
+ * webrt/: index.html, Elements/Header:
+
+ Fun #666; Form 'view bug #xxx' from display and the front page
+
+2000-07-18 04:17 tobiasb
+
+ * etc/schema.mysql:
+
+ bug #286; two nines in schema.sql
+
+2000-07-14 11:40 tobiasb
+
+ * webrt/Search/TicketCell:
+
+ I'm currently trying to fix it so that each user can put in options in the session information (or should it rather be in the DB?) about whether they want tickets to pop up in separate windows or not.
+
+2000-07-14 10:47 tobiasb
+
+ * etc/schema.mysql, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Action/StallDependent.pm,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ added a scrip for stalling members upon membership linking ... now it's impossible for a request to make a link to itself ... now it's possible to open a request from the ticket display
+
+2000-07-14 09:29 tobiasb
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ TODO: Public comments are currently beeing threated as private
+ comments (that's better than it beeing ignored ... at least at the
+ moment)
+
+ Now it skips trying to build a MIME entity if there are no message.
+
+2000-07-14 09:11 tobiasb
+
+ * webrt/ViewUser.html:
+
+ Bugfix
+
+2000-07-14 09:09 tobiasb
+
+ * webrt/Search/Listing.html:
+
+ Killed a warning
+
+2000-07-13 13:31 tobiasb
+
+ * webrt/index.html:
+
+ Typo
+
+2000-07-13 11:44 tobiasb
+
+ * webrt/Elements/Header:
+
+ huh? seems like I've lost the control of CVS a bit today :)
+
+2000-07-13 11:43 tobiasb
+
+ * webrt/Elements/Header:
+
+ [no log message]
+
+2000-07-13 11:36 jesse
+
+ * webrt/index.html:
+
+ tobix missed a &>
+
+2000-07-13 11:08 tobiasb
+
+ * webrt/: Search/RestrictSearch.html, Ticket/Display.html,
+ Ticket/ProcessUpdate.html, Ticket/Update.html:
+
+ Dealt with the footer; it does not need overriding anywhere, and is thus placed in the autohandler
+
+2000-07-13 11:04 tobiasb
+
+ * webrt/: Logout.html, ViewUser.html, autohandler, index.html,
+ Elements/Header, Search/Listing.html, Ticket/Modify.html,
+ Ticket/ValidateUpdate.html:
+
+ Dealt with the header module; it's now in the .html templates, not in autohandler ... the title should be nice and informative in all the templates ... and the instance name is viewed along with the header
+
+2000-07-13 07:26 tobiasb
+
+ * lib/RT/Link.pm, lib/RT/Ticket.pm, webrt/index.html,
+ webrt/Elements/SelectResultsPerPage, webrt/Search/Listing.html,
+ webrt/Search/PickRestriction:
+
+ small bugfix + better handling of LimitResultsOnPage
+
+2000-07-12 14:09 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm:
+
+ bugfix'es. duplicated linking actions are now turned down.
+
+2000-07-12 01:39 jesse
+
+ * etc/schema.mysql:
+
+ updated the schema for User objects. now they've got _even more_ data.
+ and better extension capabilities.
+
+2000-07-12 00:10 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/Scrip.pm, lib/RT/ScripScope.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Action/StallDependent.pm,
+ webrt/Elements/SelectResultsPerPage, webrt/Elements/ViewUser,
+ webrt/Ticket/Create.html, webrt/Ticket/Elements/ShowTransaction:
+
+ Debugged a bit and removed some critical bugs
+
+2000-07-11 14:43 tobiasb
+
+ * webrt/Elements/ViewUser:
+
+ <% $User->Comments || "No comment entered about this user" |h %>
+
+ "|h" seems like some random noise, or have I misunderstood something?
+
+2000-07-11 12:19 tobiasb
+
+ * etc/schema.mysql:
+
+ Comments
+
+2000-07-11 11:30 tobiasb
+
+ * lib/RT/Transaction.pm, lib/RT/Action/AutoReply.pm,
+ webrt/Logout.html, webrt/ViewUser.html:
+
+ more debug logging + some bugfixing (exception handling)
+
+2000-07-10 20:09 jesse
+
+ * bin/testdeps.pl, etc/schema.mysql, lib/RT/Ticket.pm:
+
+ work on ACLs. some acl decisions are now made.
+
+2000-07-10 17:13 jesse
+
+ * etc/schema.mysql, lib/RT/ACL.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Queue.pm, lib/RT/Record.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/User.pm, lib/RT/Interface/Email.pm,
+ webrt/Ticket/Display.html:
+
+ Wow. all kinds of work.
+
+ Beginning of implementation of ACLs. lots of code cleanup.
+
+ schema changes for Groups and Acls.
+
+ we now use MIMEObj EVERYWHERE instead of MIMEEntity.
+
+2000-06-29 20:36 jesse
+
+ * Makefile:
+
+ bumped to 1.0.4pre2
+ fixed perms issue for lib/templates
+
+2000-06-29 16:11 jesse
+
+ * Makefile, etc/schema:
+
+ makefile fixes. bump to 1.0.4pre1
+ schema.mysql has a longer phone number field
+
+2000-06-26 15:35 jesse
+
+ * README:
+
+ [no log message]
+
+2000-06-26 15:10 jesse
+
+ * Makefile, bin/rtmux.pl, bin/testdeps.pl:
+
+ added Date::Manip to testdeps.pl
+ set $ENV{'TZ'} in bin/rtmux.pl to deal with a bug in Date::Manip
+ bumped the version to 1.3.8
+
+2000-06-26 14:38 jesse
+
+ * bin/testdeps.pl:
+
+ added Date::Kronos to testdeps.pl
+
+2000-06-26 14:36 jesse
+
+ * bin/testdeps.pl:
+
+ added Time::Seconds to testdeps.pl
+
+2000-06-26 14:31 jesse
+
+ * bin/testdeps.pl, webrt/autohandler, webrt/webrt.css,
+ webrt/Elements/ViewUser, webrt/Ticket/Elements/ShowTransaction:
+
+ various hacking for RTCon pilsen. a much enhanced testdeps.pl
+
+2000-06-16 10:51 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ some commentary.
+
+2000-06-16 08:57 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Sort of a bugfix
+
+2000-06-16 08:56 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ Removed some old garbage
+
+ TODO: Fix message trailer
+
+2000-06-16 04:37 tobiasb
+
+ * lib/RT/: Attachment.pm, Record.pm, Ticket.pm, Transaction.pm:
+
+ It's no longer mandatory to have a Creator in every RT table. It's just to set them 'read/auto'-accessible. This should fix bug #275
+
+2000-06-15 16:43 tobiasb
+
+ * etc/config.pm, lib/RT/Attachment.pm, lib/RT/Link.pm,
+ lib/RT/Ticket.pm, webrt/Elements/MessageBox,
+ webrt/Ticket/Display.html, webrt/Ticket/LinkIt.html,
+ webrt/Ticket/ProcessUpdate.html, webrt/Ticket/Update.html,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ some few bugfixes + some work to get 'reply-linking' working. In my local version of RT (only changes in the config.pm) people can now enter a 'FAQ-tag', and the right article from KB is automaticly inserted in the reply.
+
+2000-06-15 12:22 tobiasb
+
+ * webrt/ViewUser.html:
+
+ file ViewUser.html was initially added on branch rt-1-1.
+
+2000-06-15 12:22 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/CurrentUser.pm, lib/RT/Ticket.pm,
+ lib/RT/User.pm, lib/RT/Interface/Email.pm, webrt/ViewUser.html,
+ webrt/autohandler, webrt/Elements/Error, webrt/Elements/Footer,
+ webrt/Elements/Header, webrt/Elements/ViewUser,
+ webrt/Ticket/ProcessUpdate.html, webrt/Ticket/Update.html,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ lots of bugfixes and some enhancements:
+ - signature in replies
+ - Creator, LastUpdated etc. should be updated in User.pm
+ - The message headers of inbound requests is now decoded ... this is
+ some sort of a hack as it discards charset information in the header.
+ Anyway, in those cases where the header data will be in the same charset
+ as the body, this works out nicely.
+ - I'm allowing a user to see what data is stored at him. We might need ACLs
+ for the user comment. Also, this one is placed directly on the root, so
+ it will break if the user is not logged in. Also, the page and the module
+ is 'ViewUser', 'ShowUser' would be more consistent.
+ - Prettified the ShowTransaction header
+
+2000-06-15 09:02 tobiasb
+
+ * etc/schema.mysql:
+
+ Added "Signature" to the Users table and worked a bit at the comments
+
+2000-06-14 09:24 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ webrt/Ticket/Display.html, webrt/Ticket/Elements/TicketToolBox:
+
+ Tons of minor bugfixes and enhancements
+
+2000-06-14 09:19 tobiasb
+
+ * etc/schema.mysql:
+
+ Added this:
+
+ ##TODO: Get Notify.pm to support OldOwner + fix a template
+ #INSERT INTO Scrips VALUES (20, 'NotifyOldOwnerOnSteal',
+ # 'Sends mail to the old owner when the ticket is stolen',
+ # 'Steal','Notify',10,'OldOwner',1,NULL,1,NULL);
+
+2000-06-14 06:54 tobiasb
+
+ * etc/schema.mysql, lib/RT/Attachment.pm, lib/RT/Record.pm,
+ lib/RT/Ticket.pm, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/ShowDates:
+
+ minor enhancements and bugfixes
+
+2000-06-14 03:30 tobiasb
+
+ * etc/schema.mysql:
+
+ I just noticed that Jesse already had a 'resolution' attribute in the ticket. I guess that covers the same as my 'state' attribute
+
+2000-06-14 00:12 tobiasb
+
+ * lib/RT/Attachment.pm, webrt/Elements/ViewUser,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction,
+ webrt/Ticket/Elements/ShowDates:
+
+ Some enhancements and bugfixes
+
+2000-06-13 23:26 tobiasb
+
+ * webrt/Ticket/Elements/ShowDates:
+
+ improved
+
+2000-06-13 20:42 tobiasb
+
+ * etc/schema.mysql:
+
+ Bugfix
+
+2000-06-13 15:53 tobiasb
+
+ * lib/RT/TicketCollection.pm, webrt/Search/Listing.html:
+
+ Trying to get search on requestor to work - unsuccessful so far :/
+
+2000-06-13 10:23 tobiasb
+
+ * webrt/: autohandler, Ticket/Display.html,
+ Ticket/Elements/TicketToolBox:
+
+ Some bugfixes
+
+2000-06-13 06:41 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Bugfix
+
+2000-06-09 14:43 tobiasb
+
+ * webrt/EditUserComments.html:
+
+ Hm, aaaalways check if everything is working before committing. Argh.
+
+2000-06-09 14:30 tobiasb
+
+ * webrt/: EditUserComments.html, autohandler, Elements/Error,
+ Elements/ViewUser:
+
+ added a minimum interface for editing comments about users
+
+2000-06-09 12:53 tobiasb
+
+ * webrt/Ticket/Elements/ShowRequestor:
+
+ file ShowRequestor was initially added on branch rt-1-1.
+
+2000-06-09 12:53 tobiasb
+
+ * webrt/Elements/ViewUser:
+
+ file ViewUser was initially added on branch rt-1-1.
+
+2000-06-09 12:53 tobiasb
+
+ * webrt/EditUserComments.html:
+
+ file EditUserComments.html was initially added on branch rt-1-1.
+
+2000-06-09 12:53 tobiasb
+
+ * etc/schema.mysql, lib/RT/Ticket.pm, lib/RT/User.pm,
+ lib/RT/Users.pm, lib/RT/Watcher.pm, lib/RT/Interface/Email.pm,
+ webrt/EditUserComments.html, webrt/Elements/ViewUser,
+ webrt/Ticket/ProcessUpdate.html, webrt/Ticket/Elements/ShowPeople,
+ webrt/Ticket/Elements/ShowRequestor,
+ webrt/Ticket/Elements/ShowSummary:
+
+ added a large section in the ticket view for earlier requests (stubbed) by the same requestor and comments about the requestor (the interface for editing those comments are stubbed)
+
+2000-06-09 04:32 tobiasb
+
+ * etc/schema.mysql:
+
+ Added "Lang" to the users table
+
+2000-06-08 10:17 tobiasb
+
+ * etc/config.pm, etc/schema.mysql, lib/RT/Ticket.pm,
+ webrt/Elements/SelectMatch, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ Added 'UpdateTold' sub to Tickets. Some minor bugfixes and enhancements. Not much testing done.
+
+2000-06-08 08:19 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm, lib/RT/Watcher.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Interface/Email.pm,
+ webrt/Ticket/Update.html:
+
+ A bit of debugging, and I managed to remove some annoying warnings
+
+2000-06-08 08:10 tobiasb
+
+ * etc/schema.mysql:
+
+ bugfix
+
+2000-06-08 07:59 tobiasb
+
+ * etc/schema.mysql:
+
+ Removed the area in one template.
+
+2000-06-08 07:55 tobiasb
+
+ * etc/schema.mysql:
+
+ # I think it might make sense replacing "TIMESTAMP" with "DATETIME"
+ # for mysql. Yes, indeed, I'll do that right away.
+
+2000-06-08 06:53 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Removed some redundant lines.
+
+2000-06-08 06:38 tobiasb
+
+ * etc/schema.mysql:
+
+ Inserted table AlternateEmails (commented out as for now).
+
+ One bugfix (typo) in the ACL table.
+
+2000-06-08 06:31 tobiasb
+
+ * etc/schema.mysql:
+
+ Grouped into folders
+
+2000-06-08 05:47 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/Ticket.pm, webrt/Login.html,
+ webrt/Search/Listing.html, webrt/Ticket/ProcessUpdate.html,
+ webrt/Ticket/Elements/ShowTransaction,
+ webrt/Ticket/Elements/TicketToolBox:
+
+ bugfixes + improvements requested from the support team; kill & take link from the front page, table borders in listing, reduced header printing ...
+
+2000-06-07 16:15 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ webrt/Elements/MessageBox, webrt/Ticket/Elements/ShowTransaction:
+
+ bugfixes
+
+2000-06-07 15:46 tobiasb
+
+ * etc/schema.mysql:
+
+ bugfix
+
+2000-06-07 15:42 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm:
+
+ bugfixes
+
+2000-06-07 15:22 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Now, if some Record decendant can _Accessible('Created', auto) and _Accessible('LastUpdated', auto), they will be set automaticly (at least, that's the theory)
+
+2000-06-07 14:16 tobiasb
+
+ * etc/schema.mysql:
+
+ mysql autosets the first TIMESTAMP in the table on every
+ update/insert.
+
+2000-06-07 12:33 tobiasb
+
+ * webrt/autohandler:
+
+ The error handling here seems to work now ... but only for documents
+ at the root. I thought those autohandlers were called recursively?
+
+2000-06-07 12:12 tobiasb
+
+ * etc/config.pm, lib/RT/Record.pm, lib/RT/Ticket.pm:
+
+ working with those pesky dates
+
+2000-06-07 11:51 tobiasb
+
+ * bin/webmux.pl:
+
+ bugfix
+
+2000-06-07 08:37 tobiasb
+
+ * README:
+
+ Added Date::Kronos (not on CPAN yet) to README
+
+2000-06-07 08:17 tobiasb
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Different Comment and Reply links. They link to the same page, but the default
+ action is changed.
+
+2000-06-07 07:36 tobiasb
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Now it doesn't display looooong text/plain attachments.
+
+ We have a lot of ~1M text/plain attachments in our RT queue.
+
+ I'm trying to hack my webrt.cgi to show attachments upon a
+ "PickUpTransaction" parameter. I don't know how to do it in the
+ mason/mod_perl model.
+
+2000-06-07 04:09 tobiasb
+
+ * webrt/Elements/MessageBox:
+
+ bugfix
+
+2000-06-06 18:44 jesse
+
+ * etc/schema.mysql:
+
+ removed an outdated table
+
+2000-06-06 15:42 jesse
+
+ * webrt/Login.html:
+
+ changed the name of the mason package to RT::Mason, so it didn't conflict with other instances
+ on the same webserver
+
+ fixed a couple of Log::Dispatch(warn)s to (warning)s
+
+ removed tobix' weird session crunching code that was messign me up
+
+2000-06-06 15:42 jesse
+
+ * etc/config.pm, lib/RT/Ticket.pm:
+
+ changed the name of the mason package to RT::Mason, so it didn't conflict with other instances
+ on the same webserver
+
+ fixed a couple of Log::Dispatch(warn)s to (warning)s
+
+2000-06-06 15:41 jesse
+
+ * bin/webmux.pl:
+
+ changed the name of the mason package to RT::Mason, so it didn't conflict with other instances
+ on the same webserver
+
+ f
+
+2000-06-06 15:41 jesse
+
+ * README:
+
+ changed the name of the mason package to RT::Mason, so it didn't conflict with other instances
+ on the same webserver
+
+2000-06-06 14:40 tobiasb
+
+ * webrt/Ticket/: Update.html, Elements/TicketToolBox:
+
+ I'm trying to set default action in Update.html dependent on which link the
+ user clicked at (update, comment or reply). I'll continue tomorrow (dinnertime
+ now :)
+
+2000-06-06 14:11 tobiasb
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ bugfix
+
+2000-06-06 13:48 jesse
+
+ * etc/config.pm:
+
+ changed Log::Dispatch::VERSION (1.2) which didn't work
+ to the more standard perl syntax: use Log::Dispatch 1.2;
+
+ \ed an @ that tobix left in rtmux.pl
+
+2000-06-06 13:47 jesse
+
+ * bin/rtmux.pl:
+
+ \ed an @ that tobix left in rtmux.pl
+
+2000-06-06 13:32 jesse
+
+ * Makefile:
+
+ :%s/ / / in the makefile (convert spaces to tabs)
+
+2000-06-06 13:15 tobiasb
+
+ * README:
+
+ Mostly doc changes
+
+2000-06-06 11:36 tobiasb
+
+ * etc/config.pm:
+
+ bugfix
+
+2000-06-06 11:15 tobiasb
+
+ * docs/FAQ:
+
+ Added some few tips
+
+2000-06-06 11:05 tobiasb
+
+ * bin/rtmux.pl:
+
+ putted in some warnings about things that doesn't work
+
+2000-06-06 04:21 tobiasb
+
+ * README:
+
+ added comments about DBMS'es
+
+2000-06-05 16:54 tobiasb
+
+ * Makefile:
+
+ more bugfixes
+
+2000-06-05 16:46 tobiasb
+
+ * Makefile:
+
+ bgfx
+
+2000-06-05 14:01 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-06-05 09:26 tobiasb
+
+ * README, etc/config.pm, etc/schema.mysql, webrt/autohandler:
+
+ done some documentation fixes
+
+2000-06-05 07:14 tobiasb
+
+ * README:
+
+ updated the STATUS
+
+2000-06-02 03:32 tobiasb
+
+ * etc/schema.mysql, lib/RT/Action/SendEmail.pm,
+ lib/RT/Interface/Email.pm, webrt/autohandler, webrt/Elements/Error:
+
+ bugfix
+
+2000-06-01 23:28 tobiasb
+
+ * webrt/Ticket/Elements/TicketToolBox:
+
+ file TicketToolBox was initially added on branch rt-1-1.
+
+2000-06-01 23:28 tobiasb
+
+ * etc/config.pm, etc/schema.mysql, lib/RT/Link.pm,
+ lib/RT/Ticket.pm, lib/RT/Action/SendEmail.pm,
+ lib/RT/Interface/Email.pm, webrt/autohandler, webrt/Elements/Error,
+ webrt/Elements/SelectOwner, webrt/Ticket/Create_Detail.html,
+ webrt/Ticket/Display.html, webrt/Ticket/ProcessUpdate.html,
+ webrt/Ticket/Update.html, webrt/Ticket/Elements/TicketToolBox:
+
+ ... better logging (logs a warning when it's dieing during an eval) ... maybe the URL in the mails will work now ... misc bugfixes ... some better foldings ... better error handling in the WebUI (not tested! You should absolutely see this, I have a feeling it's unsmart. Check autohandler and Elements/Error) ... misc features added (default values on selectowners now work, auto-fill-in of requestor on create, auto-fill-in of subject on spawn, viewing actions on the ProcessUpdate, ProcessUpdate fixed up a bit ... hm, that's it)
+
+2000-06-01 20:54 tobiasb
+
+ * bin/testdeps.pl:
+
+ Added Text::Wrapper for quoting of wide messages
+
+2000-06-01 20:50 tobiasb
+
+ * lib/RT/Transaction.pm, lib/RT/Action/StallDependent.pm,
+ lib/RT/Interface/Email.pm, webrt/Login.html,
+ webrt/Ticket/autohandler, webrt/Ticket/Elements/ShowLinks:
+
+ lots of bugfixes and minor enhancements
+
+2000-06-01 02:58 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-06-01 02:20 jesse
+
+ * Makefile, NEWS:
+
+ work on the web ui. cleanups to the comment and reply pages as well as the
+ queue view and the ticket detail page
+
+2000-05-31 14:28 tobiasb
+
+ * etc/config.pm, webrt/Search/Listing.html,
+ webrt/Search/TicketCell, webrt/Ticket/Display.html:
+
+ Popular demand: A link for taking an action from the listing page (reduces the change for concurrency problems)
+
+2000-05-31 13:59 tobiasb
+
+ * webrt/Search/autohandler:
+
+ Uh, some weird debugging stuff came into the last commit - I should
+ have checked better.
+
+ Some of those autohandlers seems like copies of each other. There
+ must be better ways to do this (i.e. separating all the common stuff
+ into some module)?
+
+2000-05-31 13:52 tobiasb
+
+ * lib/RT/Transaction.pm, lib/RT/Interface/Email.pm,
+ webrt/Search/Listing.html, webrt/Search/PickRestriction,
+ webrt/Search/autohandler, webrt/Ticket/Display.html,
+ webrt/Ticket/Elements/ShowHistory:
+
+ popular demands; more navigation ({back to listing} and {last transaction}) and misc details
+
+2000-05-31 12:20 tobiasb
+
+ * webrt/Elements/SelectMatch:
+
+ This one is plain ugly at the moment. Anyway, it's ment for a more advanced 'regexp match / glob match / word match / substring match / total match'
+
+2000-05-31 12:20 tobiasb
+
+ * webrt/Elements/SelectMatch:
+
+ file SelectMatch was initially added on branch rt-1-1.
+
+2000-05-31 11:55 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ bugfix
+
+2000-05-31 09:53 tobiasb
+
+ * webrt/: Elements/SelectStatus, Ticket/Update.html:
+
+ Some popular demands from the support dept;
+
+ I've made it possible to kill by selecting status dead
+
+ Response is the default action. I've added a cryptical line which
+ might or might not give a warning. Ideally, I guess we should do the comment /
+ reply selection through submit buttons rather than through a select menu - what
+ di you think?
+
+2000-05-30 22:46 tobiasb
+
+ * etc/config.pm, lib/RT/Attachment.pm:
+
+ Ah ... I had forgotten signatures. Some stubbed work, I'll continue tomorrow
+
+2000-05-30 22:31 tobiasb
+
+ * lib/RT/Attachment.pm, lib/RT/Attachments.pm, lib/RT/Record.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm, webrt/Login.html,
+ webrt/Elements/MessageBox, webrt/Search/Listing.html,
+ webrt/Ticket/autohandler, webrt/Ticket/Elements/ShowTransaction:
+
+ Quoting works now ... fixed some other misc details + bugfixes ... and I've moved the date handling to RT::Record, it will be completed tomorrow (I hopecvs diff -uw | less)
+
+2000-05-30 20:31 tobiasb
+
+ * webrt/Ticket/Create_Detail.html:
+
+ Removed those annoying blink tags.. :)
+
+2000-05-30 20:14 tobiasb
+
+ * webrt/: Elements/MessageBox, Ticket/Create_Detail.html:
+
+ Still working on that MessageBox
+
+2000-05-30 20:09 tobiasb
+
+ * webrt/: Elements/MessageBox, Ticket/Update.html:
+
+ Separated out the MessageBox
+
+2000-05-30 20:09 tobiasb
+
+ * webrt/Elements/MessageBox:
+
+ file MessageBox was initially added on branch rt-1-1.
+
+2000-05-30 19:56 tobiasb
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ Changed <BLOCKQUOTE> to <pre> for the message content.
+
+ TODO: We really should HTML'ify and/or HTML-escape the Content.
+
+2000-05-29 06:59 tobiasb
+
+ * Makefile:
+
+ Some bugfixes, but absolutely not tested.
+
+2000-05-26 12:11 tobiasb
+
+ * webrt/Search/Listing.html:
+
+ Now it runs /Elements/Header - I was a bit annoyed because it was missing Title
+
+2000-05-26 10:11 tobiasb
+
+ * webrt/Ticket/Display.html:
+
+ Seems like I had introduced an error here
+
+2000-05-24 21:50 jesse
+
+ * lib/RT/Ticket.pm, lib/RT/TicketCollection.pm, lib/RT/Tickets.pm,
+ webrt/Search/Listing.html, webrt/Ticket/Display.html:
+
+ Working on persistable web queries. Introduced RT::TicketCollection
+ Arguably this should be in RT::Tickets. and may be some day
+
+2000-05-24 21:50 jesse
+
+ * lib/RT/TicketCollection.pm:
+
+ file TicketCollection.pm was initially added on branch rt-1-1.
+
+2000-05-24 08:00 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ It should also be possible to "unlink" something (i.e. if a link was
+ wrongly set). This is not implemented, but at least mails with
+ an "unlink" command will not bounce now.
+
+2000-05-23 18:49 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ Made the transaction text from a link action a bit more readable,
+ though this still needs quite some work.
+
+2000-05-23 16:57 jesse
+
+ * Makefile:
+
+ Bumped to 1.3.7
+
+2000-05-23 10:12 tobiasb
+
+ * etc/config.pm, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Interface/Email.pm, webrt/Ticket/Display.html:
+
+ I've started looking at the mail interface. Now linking works through the mailgate, though we need some info in the docs. I'm proposing that it should accept both commands in the headerlines ("RT-Command: Link/Resolve/Whatever blahblah") and traditional commands in the mail ("%RT Link", "%RT Resolve", etc), though I've only supported the first one yet. Look at the comments in Email.pm for details.
+
+2000-05-23 10:04 tobiasb
+
+ * lib/RT/Scrip.pm:
+
+ Bugfix/optimalization or something?
+
+2000-05-22 19:09 tobiasb
+
+ * lib/RT/Ticket.pm, webrt/Ticket/Create_Detail.html,
+ webrt/Ticket/Display.html, webrt/Ticket/LinkIt.html:
+
+ I'm not very happy about some comprimises, choises and short-cuts I've done here, but anyway linking & spawning seems to work now.
+
+2000-05-22 18:05 tobiasb
+
+ * lib/RT/Transaction.pm, lib/RT/Action/AutoReply.pm,
+ webrt/Ticket/Create.html, webrt/Ticket/Create_Detail.html,
+ webrt/Ticket/Display.html, webrt/Ticket/LinkIt.html:
+
+ all changes here are either related to getting the Create working from the web, or harmless details
+
+2000-05-22 17:39 tobiasb
+
+ * webrt/Ticket/Display.html:
+
+ $Subject => $Subject||(no subject given)
+
+ TODO: HTML-escape
+
+2000-05-22 17:38 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Removed VerboseSubject and HTMLSubject
+
+2000-05-22 17:24 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ I do use $Ticket->Subject (and other stuff as well) frequently when
+ I'm editing Mason. There is two issues;
+
+ 1) Things might look freaked if the ticket has no subject, i.e. Display.html
+
+ 2) Things might get totally whacko if the subject contains HTML code.
+
+ I could ensure the "right" behaviour all the places by using
+ HTML::Entities::encode (I've done it one place), and by always using
+ $Subject||"(No subject)". Anyway, I think it might be more
+ appropriate to have a sub RT::Ticket::VerboseSubject and
+ RT::Ticket::HTMLSubject.
+
+ What do you think?
+
+2000-05-22 16:51 tobiasb
+
+ * webrt/Ticket/Display.html:
+
+ It seems like it can create and view new transactions now.
+
+ My next step will be to fix linking
+
+2000-05-22 16:47 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ I should never commit before testing ... I should never commit before testing ... I should never commit before ...
+
+ bugfix.
+
+2000-05-22 16:38 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ I'm trying to get a better propagation of error messages. I'm a bit
+ amused to find lots of things that shouldn't pass `perl -w' and `use
+ strict'?
+
+2000-05-22 15:52 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Removed a debug (?) line that was commented out:
+
+ # print "From is $From\n";
+
+ ...and inserted some other logging:
+
+ - logs an info message with ticket id, subject and queue upon
+ successful message creation.
+
+ - logs a warning if it couldn't be created.
+
+2000-05-22 14:11 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ In RT::Ticket::Create: Defaulting queue to 'general', and warning when it's not set
+
+2000-05-22 14:06 tobiasb
+
+ * README:
+
+ Added a 'rt-comment' to the recommended mail configuration
+
+2000-05-22 14:04 tobiasb
+
+ * Makefile:
+
+ added a comment-mail-alias
+
+2000-05-22 14:03 tobiasb
+
+ * etc/config.pm:
+
+ Hm ... $RT::CorrespondAddress is used in AutoReply.pm, while only
+ $MailAlias is set in config.pm. I'm not sure if this is the Right(tm)
+ solution, but anyway ... I added those two lines, additions to the
+ Makefile and README file is coming up shortly ...
+
+ $CorrespondAddress=$MailAlias;
+ $CommentAddress="!!RT_COMMENT_MAIL_ALIAS!!";
+
+2000-05-22 12:53 tobiasb
+
+ * webrt/Ticket/Create_Detail.html:
+
+ fixed up a bug caused by too quick usage of cut&paste
+
+2000-05-22 12:01 tobiasb
+
+ * webrt/Ticket/Create_Detail.html:
+
+ Done some work making this page look OK. Now I will put in some logic
+ in Display.html for creating and linking requests.
+
+2000-05-22 05:30 tobiasb
+
+ * webrt/Elements/SelectOwner:
+
+ # TODO: respect the ACLs!!
+ # This will be a list of some thousands requestors with the current scheme.
+
+2000-05-19 12:37 tobiasb
+
+ * webrt/Ticket/Create.html:
+
+ Added a box for setting link information. Only a web mockup, the
+ logic doesn't work yet. Feel free to do whatever you'd like with this
+ one. It might make sense to move this to the details page.
+
+2000-05-19 12:17 jesse
+
+ * webrt/Ticket/LinkIt.html:
+
+ Code and formatting cleanups
+
+2000-05-19 11:23 tobiasb
+
+ * etc/config.pm:
+
+ Removed some weird stuff
+
+2000-05-19 10:59 jesse
+
+ * webrt/: index.html, Search/PickRestriction:
+
+ fixed some typos
+
+2000-05-19 10:59 jesse
+
+ * etc/config.pm:
+
+ cleaned up the config file a bit
+
+ <M-}>CVS: etc/config.pm
+
+2000-05-19 08:42 tobiasb
+
+ * bin/testdeps.pl, bin/webmux.pl, webrt/Elements/SelectLinkType,
+ webrt/Ticket/Display.html, webrt/Ticket/LinkIt.html,
+ webrt/Ticket/ProcessUpdate.html, webrt/Ticket/Elements/ShowSummary,
+ webrt/Ticket/Elements/ShowTransaction:
+
+ Started the work getting links to work. While the linking doesn't work yet, this is a hint about how I think things might work
+
+2000-05-19 08:42 tobiasb
+
+ * webrt/Elements/SelectLinkType:
+
+ file SelectLinkType was initially added on branch rt-1-1.
+
+2000-05-19 08:42 tobiasb
+
+ * webrt/Ticket/LinkIt.html:
+
+ file LinkIt.html was initially added on branch rt-1-1.
+
+2000-05-18 14:46 jesse
+
+ * lib/RT/Ticket.pm:
+
+ a tiny bit of doc added to Ticket.pm
+ still not happy with the format
+
+2000-05-18 10:56 tobiasb
+
+ * webrt/Ticket/autohandler:
+
+ undo of last commit; only local modifications for debugging
+
+2000-05-18 10:51 tobiasb
+
+ * webrt/: Search/Listing.html, Ticket/Elements/ShowTransaction:
+
+ the previous commit had wrong loginfo; those files are modified according to the latest changes in etc/config.pm
+
+2000-05-18 10:42 jesse
+
+ * webrt/Elements/SelectResultsPerPage:
+
+ adding missing file
+
+2000-05-18 10:41 tobiasb
+
+ * webrt/: index.html, Search/Listing.html, Ticket/autohandler,
+ Ticket/Elements/ShowTransaction:
+
+ A front page for navigation. This one needs work; Masonifying, generalizing and possibilities for customizations needs to be implemented
+
+2000-05-18 10:41 tobiasb
+
+ * webrt/index.html:
+
+ file index.html was initially added on branch rt-1-1.
+
+2000-05-18 10:36 tobiasb
+
+ * webrt/Elements/SelectResultsPerPage:
+
+ Added an empty file as for now
+
+2000-05-18 10:36 tobiasb
+
+ * webrt/Elements/SelectResultsPerPage:
+
+ file SelectResultsPerPage was initially added on branch rt-1-1.
+
+2000-05-18 05:48 tobiasb
+
+ * etc/config.pm:
+
+ I'm planning to deal with web customizations with one hash RT::WebOptions in config.pm. This hash might contain callbacks and maybe names of extra Mason modules to pull in. What do you think?
+
+2000-05-17 19:08 jesse
+
+ * webrt/Search/autohandler:
+
+ file autohandler was initially added on branch rt-1-1.
+
+2000-05-17 19:08 jesse
+
+ * webrt/Search/: Listing.html, PickRestriction, autohandler:
+
+ Work on searches. in the cli -maxitems <n> now does the right thing
+
+2000-05-16 17:48 jesse
+
+ * webrt/Ticket/Elements/ShowLinks:
+
+ file ShowLinks was initially added on branch rt-1-1.
+
+2000-05-16 17:48 jesse
+
+ * bin/rtmux.pl, bin/webmux.pl, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Action/OpenDependent.pm, lib/RT/Action/ResolveMembers.pm,
+ lib/RT/Action/Spam.pm, lib/RT/Action/StallDependent.pm,
+ webrt/Elements/Error, webrt/Ticket/Elements/ShowLinks,
+ webrt/Ticket/Elements/ShowSummary:
+
+ Converted the new link code to a fully oo setup, rahter than a mishmash of
+ procedural and oo. seperated out webrt/Ticket/Elements/ShowLinks
+
+ It's by no means done, but it does seem to work.
+
+ jesse
+
+2000-05-16 12:30 tobiasb
+
+ * Makefile, etc/config.pm, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ webrt/Ticket/Elements/ShowSummary:
+
+ Done quite some work at the right hand 'Other Links' window (well, it's not good enough, and it also lists dependencies as for now). Jesse, you might want to do something with ShowSummary, my Mason code seems horribly ugly.
+
+2000-05-16 09:18 tobiasb
+
+ * etc/config.pm:
+
+ (...)
+ # A hash table of convertion subs to be used for transforming RT Link
+ # URIs to URLs in the web interface. If you want to use RT towards
+ # locally installed databases, this is the right place to configure it.
+ # (TODO!)
+ my %URI2HTML=
+ (
+ 'fsck.com-rt' => sub {warn "stub!";},
+ 'mozilla.com-bugzilla' => sub {warn "stub!";},
+ 'fsck.com-kb' => sub {warn "stub!"}
+ );
+ (...)
+
+ I will also make a sub RT::Links::URI2HTML which gives smart links to
+ internal references, and passes other URIs to this hash table, and
+ eventually we should make default subs for KB and RT.
+
+ What do you think of this idea?
+
+2000-05-16 04:58 tobiasb
+
+ * lib/RT/: Link.pm, Ticket.pm:
+
+ Enabled link display in the CLI
+
+2000-05-16 04:43 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ Seems like I had broken something...(bugfix)
+
+2000-05-13 19:56 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Right, we need to work a bit with the links API.
+
+ - we need an AllLinks sub. How to tell EasySearch to give both links
+ where we're BASE and were we're TARGET?
+
+ - we need an "unresolved dependencies" according to the current
+ design. How to tell if a dependency is unresolved? Dependencies can
+ point out of this RT instance!
+
+ - we might need more subs, but not right now anyway.
+
+2000-05-12 11:32 tobiasb
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ partly a bugfix; 'QouteTransaction=attachment-id' doesn't work very well for transactions without attachment. Maybe that link should only be for attachments, and not for transactions. Anyway, I changed it to transaction-id instead. And I also added 'spawn' to the title; I think 'spawning' should be done through the same page. 'spawn' is when creating a new request that is linked up somehow to the old one. Maybe it rather should be titled 'forward' or 'create new' or something?
+
+2000-05-12 07:54 tobiasb
+
+ * webrt/: Elements/Error, Ticket/Display.html:
+
+ Bugfixing ... ehrm, why don't I test things before committing? :)
+
+2000-05-12 07:34 tobiasb
+
+ * webrt/Elements/Error:
+
+ It logs errors now
+
+2000-05-12 07:32 tobiasb
+
+ * webrt/Ticket/Display.html:
+
+ dies if element can't be loaded
+
+2000-05-12 06:55 tobiasb
+
+ * webrt/Login.html:
+
+ seems like CGI won't take a combined get+post
+
+2000-05-12 06:51 tobiasb
+
+ * etc/config.pm:
+
+ bugfix
+
+2000-05-11 12:45 jesse
+
+ * webrt/Elements/ShadedBox:
+
+ file ShadedBox was initially added on branch rt-1-1.
+
+2000-05-11 12:45 jesse
+
+ * webrt/Elements/ShadedBox:
+
+ missed this one before. it's somewhat misnamed right now. basically, it
+ prints a title and content.
+
+2000-05-11 12:39 jesse
+
+ * webrt/Elements/: TitleBoxEnd, TitleBoxStart:
+
+ the title box for webui
+
+2000-05-11 12:39 jesse
+
+ * webrt/Elements/TitleBoxStart:
+
+ file TitleBoxStart was initially added on branch rt-1-1.
+
+2000-05-11 12:39 jesse
+
+ * webrt/Elements/TitleBoxEnd:
+
+ file TitleBoxEnd was initially added on branch rt-1-1.
+
+2000-05-11 12:37 jesse
+
+ * webrt/Ticket/: Display.html, Elements/ShowSummary:
+
+ hrml cleanup. it's not as pretty, but man does it render faster
+
+2000-05-11 01:07 jesse
+
+ * webrt/: Elements/Footer, Elements/Header, Ticket/Display.html,
+ Ticket/Elements/ShowHistory, Ticket/Elements/ShowSummary,
+ Ticket/Elements/ShowTransaction:
+
+
+ Cleanup
+ \
+
+2000-05-11 00:46 tobiasb
+
+ * TODO:
+
+ Added a list
+
+2000-05-10 23:43 jesse
+
+ * webrt/webrt.css:
+
+ file webrt.css was initially added on branch rt-1-1.
+
+2000-05-10 23:43 jesse
+
+ * webrt/webrt.css:
+
+ The base stylesheet.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowSummary:
+
+ file ShowSummary was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowTransaction:
+
+ file ShowTransaction was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowDates:
+
+ file ShowDates was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowHistory:
+
+ file ShowHistory was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ToolBar:
+
+ file ToolBar was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowBasics:
+
+ file ShowBasics was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/Ticket/Elements/ShowPeople:
+
+ file ShowPeople was initially added on branch rt-1-1.
+
+2000-05-10 23:41 jesse
+
+ * webrt/: Elements/Header, Ticket/Display.html,
+ Ticket/DisplayHeader, Ticket/DisplaySummary, Ticket/DisplayTicket,
+ Ticket/ProcessUpdate.html, Ticket/ToolBar, Ticket/autohandler,
+ Ticket/Elements/ShowBasics, Ticket/Elements/ShowDates,
+ Ticket/Elements/ShowHistory, Ticket/Elements/ShowPeople,
+ Ticket/Elements/ShowSummary, Ticket/Elements/ShowTransaction,
+ Ticket/Elements/ToolBar:
+
+ Work on the web ui. mostly on the ticket display interface
+
+2000-05-10 15:43 tobiasb
+
+ * README:
+
+ Added a comment about how to do the CGI :) Well:
+
+ To get it up running even without mod_perl, you will need to
+ consult Tobix or the rt-devel mailinglist. Tobix is actively working
+ on a (Fast)CGI version, but as for now he has been too lazy to update
+ the template for the cgi executable.
+
+2000-05-10 15:39 tobiasb
+
+ * webrt/Ticket/Create_Detail.html:
+
+ added a require statement. No effect for the mod_perl version, but makes sense for a CGI version.
+
+2000-05-09 05:35 tobiasb
+
+ * bin/webmux.pl:
+
+ Better formatting
+
+2000-05-08 05:01 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ bugfix
+
+2000-05-05 19:20 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ This one shouldn't loop now - though it's not tested :)
+
+2000-05-05 19:15 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Fixing up the loop control. When a possible loop occurs, an error
+ flag is set, and a new header field RT-Loop-Alarm appears. I feel a
+ bit bad about the latter, we are indeed changing an email after it
+ arrived to the system, which I think is a bad thing - but anyway not
+ as bad as dropping the email completely. My idea is that the Actions,
+ particularly the SendEmail.pm Action remain silent when this header
+ field is set.
+
+2000-05-05 19:01 tobiasb
+
+ * etc/config.pm:
+
+ Added this about logging to the comments:
+
+ # It might generally make sense to send error and higher by email to
+ # some administrator. For heavens sake; be sure that the email goes
+ # directly to a mailbox, and not via RT :) Mail loops will generate a
+ # critical log message.
+
+2000-05-05 16:47 jesse
+
+ * bin/testdeps.pl:
+
+ Added Log::Dispatch to testdeps.pl
+
+2000-05-05 13:04 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ bugfix
+
+2000-05-05 12:47 tobiasb
+
+ * etc/config.pm:
+
+ I need help, I can't really figure out from this;
+
+ When commenting out the $SIG{__DIE__} stuff, everything works fine.
+
+ When having this line in the config:
+
+ $SIG{__DIE__} = sub {$RT::Logger->log(level=>'crit',message=>$_[0]); print STDERR $_[0]; exit(-1);};
+
+ I get this error:
+
+ Can't locate Mail/Field/addrlist.pm in @INC (@INC contains: /tmp/FunRT /tmp/DBIx /etc/rt /usr/local/lib/perl5/5.6.0/i686-linux /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/i686-linux /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) at (eval 115)[/usr/local/lib/perl5/site_perl/5.6.0/Mail/Field.pm:87] line 3.
+
+ WTF???
+
+2000-05-05 10:29 tobiasb
+
+ * bin/rtmux.pl:
+
+ I guess this should block that stupid warnings
+
+2000-05-05 10:01 tobiasb
+
+ * etc/config.pm:
+
+ Added Log::Dispatch. I also have added those comments, which I would
+ like comments on (:
+
+ # Most (if not all?) $RT:: global variables should be here. I'd
+ # suggest putting session information in another Namespace (main:: or
+ # RT::main or maybe something like that).
+
+ #use strict;
+
+ #use vars qw/%SitePolicy $dirmode $transactionmode $DatabasePassword $rtname $domain $host $DatabaseHost $DatabaseUser $RT::DatabaseName $DatabaseType $user_passwd_min $MailAlias $WebrtImagePath $web_auth_mechanism $web_auth_cookies_allow_no_path $DefaultLocale $LocalePath $Nobody $Logger/;
+
+ I'm not sure if "use strict" breaks, but at least "use vars" breaks
+ bigtime as we are using it other places (like rtmux.pl). I suggest
+ using another package name for the execution logic. What do you
+ think?
+
+2000-05-05 08:07 tobiasb
+
+ * Makefile:
+
+ Added RT_LOGFILE, and comments on how to fix advanced logging
+
+2000-05-05 02:31 jesse
+
+ * bin/rtmux.pl:
+
+ a bit of performance hacking. now require mason and cgi rather than 'use'ing them
+
+2000-05-05 02:22 jesse
+
+ * lib/RT/: Action.pm, Scrip.pm, ScripScope.pm, Template.pm,
+ Ticket.pm, Transaction.pm, Action/AutoReply.pm,
+ Action/SendEmail.pm, Action/Spam.pm:
+
+ Cleaned up a couple minor things (like precedence, again) and changed "FixSubject" to "SetSubjectTag"
+
+ Fixed the memory leak in Transaction.pm (it wasn't letting go of Scrip objects)
+ The fix was a bit of a "large mallet on a small nail" in that I'm now _explicitly_ destroying ScripObjects two different ways and don't quite understand why I have to do it. It does, however, work.
+
+2000-05-04 09:00 tobiasb
+
+ * lib/RT/Action/Spam.pm:
+
+ Completely untested - but I guess this should do real spamming, that
+ is one email for each request(or).
+
+2000-05-04 08:59 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ bugfix
+
+2000-05-04 07:04 tobiasb
+
+ * lib/RT/Action/: AutoReply.pm, SendEmail.pm:
+
+ Precedence: Bulk should only be set for AutoReply
+
+2000-05-04 05:29 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ sub FixSubject sets the RT tag (unless it is already there). I moved
+ it out from Prepare because I need to override this behaviour when
+ Spamming people.
+
+2000-05-04 01:34 jesse
+
+ * etc/schema.mysql:
+
+ spec some defaults in the schema
+
+2000-05-04 01:32 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Bugfix to ticket.pm for better handling of default values for some queue fields
+
+2000-05-03 14:19 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Sorry, the last commit on this file was not really a bugfix. I'd say all Ticket (Transaction) Actions should return status, message and eventually optional things after the message.
+
+2000-05-03 14:16 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Bugfix
+
+2000-05-03 14:13 tobiasb
+
+ * lib/RT/Action/: ResolveMembers.pm, Spam.pm:
+
+ Those actually seems to work :)
+
+2000-05-03 14:13 tobiasb
+
+ * lib/RT/Action/Spam.pm:
+
+ file Spam.pm was initially added on branch rt-1-1.
+
+2000-05-03 14:13 tobiasb
+
+ * lib/RT/Action/ResolveMembers.pm:
+
+ file ResolveMembers.pm was initially added on branch rt-1-1.
+
+2000-05-03 14:13 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ gubfix
+
+2000-05-03 14:00 tobiasb
+
+ * etc/schema.mysql:
+
+ Bugfix
+
+2000-05-03 13:29 tobiasb
+
+ * etc/schema.mysql:
+
+ Commented out the AutoReplies table.
+
+2000-05-03 13:17 tobiasb
+
+ * lib/RT/Action/AutoReply.pm:
+
+ Putted in "#TODO: " comments for avoiding duplicate AutoReplies.
+
+2000-05-03 13:15 tobiasb
+
+ * etc/schema.mysql:
+
+ Added a table AutoReplies to avoid sending the same autoreply template
+ more than once to each requestor.
+
+ Eventually entries should be removed (i.e. after a week) through the
+ (upcoming?) timer system (eventually through the good, old crontab(5))
+
+2000-05-03 11:48 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ LinkTo and LinkFrom are tested a bit, and they seem to work OK now.
+
+2000-05-03 11:02 tobiasb
+
+ * etc/schema.mysql:
+
+ Bugfix.
+
+2000-05-03 07:40 tobiasb
+
+ * etc/schema.mysql:
+
+ I'm putting ResolveGroupTicket on hold. It's just not important.
+
+2000-05-02 18:05 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Starting to add a bit of inline pod documentation. the style isn't finalized yet
+
+2000-05-02 14:30 tobiasb
+
+ * lib/RT/Action/OpenDependent.pm:
+
+ file OpenDependent.pm was initially added on branch rt-1-1.
+
+2000-05-02 14:30 tobiasb
+
+ * etc/schema.mysql, lib/RT/Link.pm, lib/RT/Ticket.pm,
+ lib/RT/Action/OpenDependent.pm, lib/RT/Action/StallDependent.pm:
+
+ I just got DependsOn Links to work as they should in the CLI :)
+
+2000-05-02 13:36 tobiasb
+
+ * lib/RT/Links.pm:
+
+ file Links.pm was initially added on branch rt-1-1.
+
+2000-05-02 13:36 tobiasb
+
+ * lib/RT/: Links.pm, Ticket.pm, Action/StallDependent.pm:
+
+ [no log message]
+
+2000-05-02 13:07 tobiasb
+
+ * lib/RT/Action/StallDependent.pm:
+
+ Bugfix. Also, only Open requests should be Stalled.
+
+2000-05-02 13:01 tobiasb
+
+ * lib/RT/: Ticket.pm, Action/StallDependent.pm:
+
+ Bugfixing
+
+2000-05-02 12:21 tobiasb
+
+ * lib/RT/: Ticket.pm, Action/StallDependent.pm:
+
+ bugfixes
+
+2000-05-02 11:55 tobiasb
+
+ * etc/schema.mysql:
+
+ Added TobiX-style logic scrips for DependsOn link and MemberOf link.
+
+2000-05-02 07:55 tobiasb
+
+ * lib/RT/: Link.pm, Ticket.pm:
+
+ oup, forgot to keep a consistant style
+ base => Base
+ target => Target
+ etc
+
+2000-05-02 07:55 tobiasb
+
+ * Makefile, etc/config.pm:
+
+ forgot to commit those changes ... configuration for the URI method
+
+2000-05-02 05:45 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Agh, compile error.
+
+2000-05-02 05:30 tobiasb
+
+ * lib/RT/Action/StallDependent.pm:
+
+ file StallDependent.pm was initially added on branch rt-1-1.
+
+2000-05-02 05:30 tobiasb
+
+ * lib/RT/Action/: README.hackers, StallDependent.pm:
+
+ Ok, so lets put all Actions into one directory - though I'd say it would be better for future hackers to orient themselves if we grouped them somehow.
+
+2000-05-02 00:11 jesse
+
+ * Makefile:
+
+ Version bumping
+
+2000-05-01 17:16 jesse
+
+ * lib/RT/Ticket.pm:
+
+ moved URIIsLocal closer to other linking routines.
+
+2000-05-01 10:16 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Made the transaction data a bit "nicer", should look something like:
+
+ THIS DependsOn 4323 as of 342
+ <URI> DependsOn THIS as of 343
+
+2000-05-01 08:58 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Changed URL -> URI
+
+ Changed NewLink and ReverseLink to LinkTo and LinkFrom
+
+ Added one byte to indicate if it's a From-link or a To-link in the
+ transaction data.
+
+2000-05-01 01:52 jesse
+
+ * etc/schema.mysql:
+
+ fixed a few typos in the schema
+
+2000-05-01 01:50 jesse
+
+ * lib/RT/ACL.pm:
+
+ Initial sketches at RT::ACL.pm. there's no running code here yet.
+
+2000-05-01 01:48 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Fixed Ticket->URL. changed queue->load to queue->Load
+
+2000-05-01 01:04 jesse
+
+ * bin/rtmux.pl:
+
+ Fixed improper rt program selection code.
+
+2000-05-01 00:14 jesse
+
+ * lib/RT/Queue.pm:
+
+ a stub for ACL work.
+
+2000-04-30 13:28 tobiasb
+
+ * lib/RT/Link.pm:
+
+ file Link.pm was initially added on branch rt-1-1.
+
+2000-04-30 13:28 tobiasb
+
+ * lib/RT/: Link.pm, Ticket.pm:
+
+ Link.pm
+
+2000-04-30 13:13 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Added a static method URIIsLocal which checks if it's a local URI or not.
+
+2000-04-28 14:20 jesse
+
+ * lib/RT/Transaction.pm:
+
+ Cleaned up some comments and formatting. and did a bit of reorganizing
+ of routines to more closely model other files. Oh. i finally have
+ emacs doing proper indenting per perlstyle. so we'll hopefully start
+ to get better about that :) Tobix has only been bugging me for a year
+
+2000-04-28 09:05 tobiasb
+
+ * lib/RT/Action/README.hackers:
+
+ Just some documentation for future hackers :)
+
+2000-04-28 09:05 tobiasb
+
+ * lib/RT/Action/README.hackers:
+
+ file README.hackers was initially added on branch rt-1-1.
+
+2000-04-28 08:20 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Started the work of implementing links
+
+2000-04-28 04:40 tobiasb
+
+ * etc/schema.mysql:
+
+ Didn't we once agree that we needed "state" (user-configurable logic)
+ and "status" (fixed open/stalled/resolved/dead)? :)
+
+2000-04-28 01:17 jesse
+
+ * lib/RT/Ticket.pm:
+
+ didn't balance parens. grr
+
+2000-04-28 00:54 jesse
+
+ * lib/RT/Ticket.pm:
+
+ a bunch of cleanup.. a bunch more folding mode braces.
+ a few minor (still not in any codepath) changes for the start of some
+ acls work
+
+2000-04-28 00:51 jesse
+
+ * docs/design_docs/link-definitions.txt:
+
+ a few comments, additions and clarifications. nothing really major
+
+2000-04-27 02:06 jesse
+
+ * docs/design_docs/acls:
+
+ more thoughts on ACLs. this time including some code snippits.
+
+2000-04-27 02:01 jesse
+
+ * etc/schema.mysql:
+
+ added the schema for the new ACL system.
+ responded to tobix' comments about GECOS.
+
+2000-04-26 14:58 tobiasb
+
+ * docs/design_docs/subscription-definitions.txt:
+
+ marginal updates to reflect that scrips/actions can be used for more things than subscriptions (the whole document might need a rename)
+
+2000-04-26 14:50 tobiasb
+
+ * docs/design_docs/link-definitions.txt, etc/schema.mysql:
+
+ only insignificant comments - some made weeks ago
+
+2000-04-26 12:59 jesse
+
+ * docs/design_docs/link-definitions.txt:
+
+ some comments on link definitions
+ my comments are marked with # as the first character of the line.
+
+2000-04-26 02:27 tobiasb
+
+ * docs/design_docs/: link-definitions.txt,
+ subscription-definitions.txt:
+
+ updates
+
+2000-04-26 00:14 jesse
+
+ * docs/design_docs/acls:
+
+ some more hacking on acls design
+
+2000-04-25 17:58 jesse
+
+ * docs/design_docs/acls:
+
+ thoughts on acls
+
+2000-04-24 00:17 jesse
+
+ * webrt/Ticket/Create_Detail.html:
+
+ file Create_Detail.html was initially added on branch rt-1-1.
+
+2000-04-24 00:17 jesse
+
+ * webrt/Ticket/Create_Detail.html:
+
+ some work on create. nothing ready for consumption yet.
+
+2000-04-24 00:16 jesse
+
+ * webrt/: Logout.html, Elements/Footer, Elements/Header,
+ Elements/SelectQueue, Ticket/Create.html, Ticket/Display.html,
+ Ticket/ProcessUpdate.html, Ticket/SetOwner, Ticket/SetStatus,
+ Ticket/Update.html, Ticket/autohandler:
+
+ Look ma, $session{'CurrentUser'} contains the current user object.
+ you can depend on this being set if the user's authenticated.
+
+2000-04-24 00:16 jesse
+
+ * webrt/Logout.html:
+
+ file Logout.html was initially added on branch rt-1-1.
+
+2000-04-24 00:14 jesse
+
+ * Makefile, bin/testdeps.pl, bin/webmux.pl:
+
+ Added Apache::Session support to the HTML::Mason version of things.
+
+2000-04-23 19:45 jesse
+
+ * bin/testdeps.pl:
+
+ added a little script to test perl dependencies.
+ it should probably get integrated into the makefile
+
+2000-04-23 19:45 jesse
+
+ * bin/testdeps.pl:
+
+ file testdeps.pl was initially added on branch rt-1-1.
+
+2000-04-23 17:28 jesse
+
+ * Makefile, docs/design_docs/acls, etc/schema.mysql:
+
+ installation seems to work a bit better now
+
+2000-04-20 02:18 jesse
+
+ * webrt/Login.html:
+
+ Removing cruft from login.html
+
+2000-04-20 02:17 jesse
+
+ * webrt/Ticket/autohandler:
+
+ Look ma! this autohandler seems to make webauth (with $pass = $user ) work.
+
+2000-04-20 02:09 jesse
+
+ * webrt/: autohandler, Ticket/autohandler:
+
+ file autohandler was initially added on branch rt-1-1.
+
+2000-04-20 02:09 jesse
+
+ * webrt/Login.html:
+
+ file Login.html was initially added on branch rt-1-1.
+
+2000-04-20 02:09 jesse
+
+ * Makefile, bin/webmux.pl, webrt/Login.html, webrt/autohandler,
+ webrt/Ticket/autohandler:
+
+ Doing work on cookie-based authentication for WebRT. The basic idea
+ is that the autohandler in each directory (unless the global handlers can be made to work) will check to see if the user is authenticated. If they are, then it keeps going happily. otherwise, it forces the user to login with the form in /Login.html, which should eventually be smart enough to put them back to where they want to go.
+
+2000-04-18 02:43 jesse
+
+ * docs/design_docs/acls:
+
+ checking in design work on ACLs. a bit more work, such as notes
+ on order of evaluation and a rough implementation plan and then I'll
+ implement
+
+2000-04-13 11:58 tobiasb
+
+ * etc/config.pm:
+
+ Introduced all columns we need locally, that is all columns as of RT
+ 1.0, except due, area and priorities. I guess somebody might want to
+ add those columns as well :)
+
+2000-04-13 11:52 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ hrmwell, you did introduse a slight bug here.. :)
+
+2000-04-13 11:26 tobiasb
+
+ * webrt/Search/: Listing.html, TicketCell:
+
+ Looks gruesome, but hey - it works\!
+
+2000-04-13 11:26 tobiasb
+
+ * webrt/Search/TicketCell:
+
+ file TicketCell was initially added on branch rt-1-1.
+
+2000-04-13 10:52 tobiasb
+
+ * etc/config.pm:
+
+ agh..
+
+2000-04-13 10:50 tobiasb
+
+ * etc/config.pm:
+
+ Added the site configurable option "QueueListingCols". It should also
+ be possible to override this one at least through the query, but it
+ might not be trivial. (maybe you have better suggestions?)
+
+2000-04-13 10:23 tobiasb
+
+ * webrt/Search/QueueItem:
+
+ I think I want to remove this one, I have other thoughts about how to
+ handle this - let's discuss it more when I've made some implementation :)
+
+2000-04-13 10:05 tobiasb
+
+ * webrt/Search/Listing.html:
+
+ Added this:
+
+ # TODO: This one should _not_ be here, rather somewhere else
+ # (suggestions?). It might eventually read the cookies, user
+ # configuration information from the DB, queue configuration information
+ # from the DB, etc. It should be object oriented. But what object can
+ # it belong to, and how should it get access to all this data?
+
+ sub _cfg {
+ my $key=shift;
+ return $ARGS{$key} || $RT::SitePolicy{$key};
+ }
+
+2000-04-13 10:05 tobiasb
+
+ * etc/config.pm:
+
+ Added a hash for "tunable" configurations:
+
+ # This is where RT's preferences are kept track of
+
+ package RT;
+
+ # Different "tunable" configuration options should be in this hash:
+ %SitePolicy=();
+
+2000-04-13 02:30 jesse
+
+ * lib/RT/Ticket.pm:
+
+ Ticket::clean became Ticket::_CleanAddressesAsString
+ references to clean changed accordingly. i feel a bit dirty not
+ making this $self->_CleanAddressesAsString.
+
+2000-04-12 08:53 tobiasb
+
+ * webrt/: Elements/SelectStatus, Ticket/ProcessUpdate.html,
+ Ticket/Update.html:
+
+ bugfixes and insignificant enhancements
+
+2000-04-12 07:14 tobiasb
+
+ * webrt/Elements/yearMenu:
+
+ "Last year" is now (by default) available
+
+2000-04-12 07:11 tobiasb
+
+ * webrt/Search/PickRestriction:
+
+ Changed the default to select one queue, not select "anything but" a queue.
+
+2000-04-12 07:07 tobiasb
+
+ * webrt/Search/PickRestriction:
+
+ Added a stupid "under construction" message.
+
+2000-04-12 07:00 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Ehm .. the last commit message should be more descriptive;
+
+ From the README:
+
+ rt: |"/path/to/rt/bin/rt-mailgate general correspond"
+ | |
+ <<queue-name>----/ |
+ |
+ <<correspond or comment depending on whether |
+ the mail shoud be resent to the requestor>---/
+ "action" here will make this address only
+ parse actions in the message without
+ recording the message as a transaction
+ of its own"
+
+ ...while the implementation required "correspond general"
+
+2000-04-12 06:58 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ This was not in sync with the README
+
+2000-04-12 06:50 tobiasb
+
+ * webrt/Search/PickRestriction:
+
+ Bugfix
+
+2000-04-12 06:45 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Agh, should have tested before committing :)
+
+2000-04-12 06:44 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Fixd SetOwner to allow stealing and to respect the new Nobody user
+
+2000-04-12 05:19 tobiasb
+
+ * webrt/Elements/SelectQueue:
+
+ Now this one actually works
+
+2000-04-11 07:30 tobiasb
+
+ * webrt/Elements/SelectQueue:
+
+ This won't work yet.
+
+2000-04-11 07:17 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ Ehr...right. Still fixing at the same bug; the IsInbound sub didn't work....well
+
+2000-04-11 07:08 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm:
+
+ argh .. I should learn to test the bugfixes before committing
+
+2000-04-11 06:46 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ bugfix
+
+2000-04-11 06:42 tobiasb
+
+ * lib/RT/Template.pm, lib/RT/Ticket.pm, webrt/Elements/SelectOwner,
+ webrt/Ticket/ProcessUpdate.html:
+
+ bugfixes
+
+2000-04-11 05:47 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ bugfixing
+
+2000-04-11 04:46 tobiasb
+
+ * lib/RT/Watchers.pm:
+
+ Bugfix
+
+2000-04-11 04:41 tobiasb
+
+ * etc/config.pm, lib/RT/Ticket.pm:
+
+ I'm trying to fix this nobody user..
+
+2000-04-11 04:36 tobiasb
+
+ * etc/schema.mysql:
+
+ I'm trying to fix this nobody user..
+
+2000-04-11 04:29 tobiasb
+
+ * lib/RT/Queue.pm, webrt/Ticket/ProcessUpdate.html:
+
+ Bugfixing
+
+2000-04-11 03:16 tobiasb
+
+ * webrt/Search/Listing.html:
+
+ Insignificant. Oh, how should errors be trapped?
+
+2000-04-11 00:40 jesse
+
+ * lib/RT/: Queue.pm, Ticket.pm, Watchers.pm:
+
+ all the watcher types now have AsString methods. this was done by dropping
+ an EmailsAsString method into RT::Watcher
+
+2000-04-10 23:04 tobiasb
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ Added those use statements
+
+ This page seems very broken in Netscape.
+
+2000-04-10 23:00 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Darn, I thought I had tested this. Well, now it should work!?
+
+2000-04-10 22:54 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ ...some work is needed to get Watchers work OK. I commented out my
+ try on it, so now it will ignore queue watchers (it simply ignored all
+ watchers as it was).
+
+2000-04-10 14:29 tobiasb
+
+ * webrt/Ticket/: DisplayTicket, DisplayTransaction:
+
+ Update and Modify-links
+
+2000-04-10 14:20 tobiasb
+
+ * webrt/Ticket/DisplayTransaction:
+
+ Added an "act" link and touched the comments
+
+2000-04-10 14:11 tobiasb
+
+ * webrt/Ticket/DisplaySummary:
+
+ Reinserted the "Last Contact" and "Last Update" lines, but they're "cleaned" a bit.
+
+ (btw, this seems like a crude copy from the cli, does the cli have similar problems?)
+
+2000-04-10 13:51 tobiasb
+
+ * webrt/Ticket/DisplaySummary:
+
+ Hacking a bit on this
+
+2000-04-10 13:48 tobiasb
+
+ * webrt/Ticket/: DisplayTransaction, Update.html:
+
+ Hacking a bit on this
+
+2000-04-10 13:18 tobiasb
+
+ * webrt/Ticket/Modify.html:
+
+ 'undo' (well, not really :)
+
+2000-04-10 13:13 tobiasb
+
+ * webrt/Ticket/Update.html:
+
+ This 'fix' is maybe only temporary?
+
+2000-04-10 13:08 tobiasb
+
+ * webrt/Ticket/Modify.html:
+
+ I'd daresay this one is superceded by Update.html?
+
+2000-04-10 13:07 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ just added some comments
+
+2000-04-10 12:52 tobiasb
+
+ * webrt/Ticket/DisplaySummary:
+
+ This 'fix' is maybe only temporary?
+
+2000-04-10 10:35 tobiasb
+
+ * webrt/: Elements/SelectBoolean, Search/Listing.html:
+
+ insignificant changes
+
+2000-04-10 06:53 tobiasb
+
+ * webrt/Elements/SelectOwner:
+
+ Insignificant fix (wouldn't work here without)
+
+2000-04-10 05:38 tobiasb
+
+ * bin/rtmux.pl:
+
+ Might be a bugfix
+
+2000-04-09 16:56 jesse
+
+ * lib/RT/Users.pm, webrt/Elements/SelectBoolean,
+ webrt/Elements/SelectOwner, webrt/Search/Listing.html,
+ webrt/Search/PickRestriction:
+
+ I can now get a listing of tickets whose owner is or isn't a given owner.
+ and it even lists them. Next, I'll probably make searches for
+ other attributes work.
+ the plan of attack is requestor, then probably ticket content (as a test
+ of whether this whole system works ;)
+
+2000-04-07 20:41 jesse
+
+ * webrt/Search/Listing.html:
+
+ Added the first bit of code to support queue/owner/requestor/subject search.
+ This will make up the core of the web search functionality of the first release of the webui. (not the 2.0 release, but the "tobix needs it now) release.
+
+2000-04-07 14:53 tobiasb
+
+ * etc/schema.mysql, lib/RT/Ticket.pm, lib/RT/Watchers.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ hm ... seems like I forgot to commit my last work
+
+2000-04-07 03:55 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm:
+
+ it almost works now
+
+2000-04-06 17:40 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ development
+
+2000-04-06 17:21 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm, Action/Notify.pm,
+ Action/SendEmail.pm:
+
+ ouch, found a lot of fatal stubs
+
+2000-04-06 16:54 tobiasb
+
+ * etc/schema.mysql, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Action/Notify.pm, lib/RT/Action/SendEmail.pm:
+
+ still fighting with the mail handling
+
+2000-04-06 16:12 tobiasb
+
+ * etc/schema.mysql, lib/RT/Scrips.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/Action/Notify.pm:
+
+ New snapshot of development. Note the change I've done in the Type recognizion
+ when selecting the right Scrips in Transaction::Create - it should be more
+ flexible this way (replaced "ne" with "!~"). Check the change to schema for
+ an example of how this is more flexible.
+
+2000-04-06 15:36 tobiasb
+
+ * lib/RT/Action/Notify.pm:
+
+ Recipient finder
+
+2000-04-06 15:35 tobiasb
+
+ * etc/schema.mysql, lib/RT/Template.pm, lib/RT/Action/SendEmail.pm:
+
+ Snapshot; I'm not finished debugging yet, but this should (hopefully) be
+ very close to actually work.
+
+2000-04-06 11:38 tobiasb
+
+ * docs/FAQ:
+
+ this clearly needs a lot more work ...
+
+2000-04-06 11:31 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ ...ah, this felt good.
+
+ Checked the recent version of Mailtools at CPAN, so I used the "right"
+ method for sending emails.
+
+ I also added back again the SetRecipients method, and documented it in
+ the POD.
+
+ I think I will get this working in a couple of hours, so please don't
+ disturb me saying that you disagree very much to those changes.. :)
+
+2000-04-06 10:46 tobiasb
+
+ * etc/schema.mysql:
+
+ Bugfixing
+
+2000-04-06 10:40 tobiasb
+
+ * etc/schema.mysql:
+
+ I think that I will get this up working during the next few hours.
+
+ If I eventually get it working, I'd really appreciate that you don't
+ wreck it until the web interface is working and until we've discussed
+ the design thoroughly and come down to some consensus about it.
+
+2000-04-06 06:22 tobiasb
+
+ * webrt/Elements/Checkbox:
+
+ This is not my turf ... and I don't know what I'm doing ... anyway, it didn't work, but now it works (?) :)
+
+2000-04-06 01:49 jesse
+
+ * lib/RT/Action/SendEmailOnResolve.pm:
+
+ file SendEmailOnResolve.pm was initially added on branch rt-1-1.
+
+2000-04-06 01:49 jesse
+
+ * Makefile, etc/schema.mysql, lib/RT/Template.pm,
+ lib/RT/Action/MailComment.pm, lib/RT/Action/MailCorrespondence.pm,
+ lib/RT/Action/Notify.pm, lib/RT/Action/NotifyOnResolve.pm,
+ lib/RT/Action/SendEmail.pm, lib/RT/Action/SendEmailOnResolve.pm:
+
+ Ok, i think i significantly cut down the complexity of the actions we've got
+ so far. I nuked the old notify rules, as they were superceeded by my more
+ capable SendEmail.pm There are still a few things I'm not happy with...
+ like, the way that scrips, scripscopes and templates are related. it needs
+ some thought and cleanup. but i think it'll work just fine for now.
+
+ I redid the templates and scrips to fit with the revised actions and added
+ some more docs to SendEmail.pm
+
+ the generic RT::Action should deal with templates, not SendEmail, I think,
+ but I'm leaving that abstraction for another day.
+
+ Oh, the Argument from the scrip is now passed into the template as $T::Argument.
+
+2000-04-05 23:24 jesse
+
+ * webrt/Elements/Checkbox:
+
+ stylistic cleanup
+ using an explicit defined ($foo)
+
+2000-04-05 18:02 tobiasb
+
+ * webrt/: Elements/Checkbox, Search/PickRestriction:
+
+ Only minor corrections
+
+2000-04-05 17:43 tobiasb
+
+ * webrt/Search/PickRestriction:
+
+ It certainly doesn't work okay ... I think I should look into it a bit ...
+
+2000-04-05 17:08 tobiasb
+
+ * webrt/Search/PickRestriction:
+
+ Added ugly submit button
+
+2000-04-05 10:34 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Temporary implementation of kill
+
+ As mentionated earlier, I think the right thing is to just set status
+ 'dead' and then eventually do some garbage collection later.
+
+2000-04-05 08:55 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ More error handling
+
+2000-04-05 08:51 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ added some comments around the dies pointing out that we need better error handling.
+
+2000-04-05 05:34 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Doh...I'm really stupid sometimes...
+
+2000-04-05 05:31 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ For some weird reason (perl 5.6.0 bug?) it wouldn't work here without this fix.
+
+2000-04-05 00:35 jesse
+
+ * docs/design_docs/acls:
+
+ initial musings on acls for 2.0
+
+2000-04-05 00:35 jesse
+
+ * docs/design_docs/acls:
+
+ file acls was initially added on branch rt-1-1.
+
+2000-04-04 09:52 tobiasb
+
+ * etc/schema.mysql:
+
+ Language idea
+
+2000-04-04 02:17 jesse
+
+ * Makefile, README, bin/rtmux.pl, etc/config.pm:
+
+ The first little bits of structure for future L10n support
+
+2000-04-03 12:40 tobiasb
+
+ * Makefile, bin/rtmux.pl:
+
+ Cleaned out yet some more visible configuration bugs
+
+2000-04-03 12:29 tobiasb
+
+ * README:
+
+ Some fixes
+
+2000-04-03 10:44 tobiasb
+
+ * Makefile, bin/rtmux.pl:
+
+ Just a configuration fix.
+
+2000-04-03 01:26 jesse
+
+ * Makefile, bin/rtmux.pl:
+
+ Ok, I've modified rtmux.pl and Makefile to add in the first bits of stub
+ code for running Mason as a cgi. it compiles and appears to invoke.
+ but I haven't tested it under a webserver. I've gotta get to sleep now, but
+ figured this would give tobias a leg up with his testing today.
+
+ Subject: RE: [Mason] Mason under CGI (was: replacing storyserver)
+ Author: Ilmari Karonen <iltzu@sci.fi>
+ Date: Fri, 17 Sep 1999 15:10:20 +0300 (EET DST)
+
+ On Thu, 16 Sep 1999, Ben Munoz wrote:
+ > I'm running Apache 1.3.6 on NT. I'm looking to install HTML::Mason and see
+ > what it can do, but from what I've read, I can't install mod_perl with the
+ > current version of ActiveState's Perl, which I have installed on my machine.
+
+ I realize this is probably not what you were asking for, but I'd like to
+ mention here my recent (yesterday) experience in setting up Mason under
+ plain ol' CGI.
+
+ Setting: One Mason top level component plus a few subcomponents on a
+ development server with mod_perl and Mason. One production server with the
+ least possible selection of modules. (Not even mod_so!)
+
+ Needed to quickly get the Mason component up and running on the second
+ server. Installing Mason itself and a few other perl modules was easy.
+ But adding mod_perl was definitely out of the question.
+
+ What I did was take the usual handler.pl, copy it to cgi-bin, deleting
+ everything from "my $ah = new HTML::Mason::ApacheHandler" onward
+ inclusive, and replacing it with the following:
+
+ use CGI;
+ my $q = new CGI;
+
+ # This routine comes from ApacheHandler.pm:
+ my (%args);
+ foreach my $key ( $q->param ) {
+ foreach my $value ( $q->param($key) ) {
+ if (exists($args{$key})) {
+ if (ref($args{$key})) {
+ $args{$key} = [@{$args{$key}}, $value];
+ } else {
+ $args{$key} = [$args{$key}, $value];
+ }
+ } else {
+ $args{$key} = $value;
+ }
+ }
+
+ my $comp = $ENV{'PATH_TRANSLATED'};
+ my $root = $interp->comp_root;
+ $comp ~= s/^$root// or die "Component outside comp_root";
+
+ $interp->exec($comp, %args);
+
+ This, plus an Action line in httpd.conf mapping *.mas to this script, has
+ so far done the job just fine.
+
+ One problem I noticed was that this all would've been much harder if I
+ hadn't been familiar with the way ApacheHandler.pm uses CGI.pm and hadn't
+ known where to find that parsing routine. IMHO it'd be a good idea to
+ separate this loop into a user-callable subroutine.
+
+ (Note: this was Mason 0.6.mumble - I have no experience with the newer
+ versions.)
+
+ --
+ Ilmari Karonen (iltzu@sci.fi)
+ http://www.sci.fi/~iltzu/
+
+ _______________________________________________
+ Mason maillist - Mason@netizen.com.au
+ http://netizen.com.au/mailman/listinfo/mason
+
+2000-04-03 00:49 jesse
+
+ * bin/rtmux.pl, etc/schema.mysql, lib/RT/Action.pm,
+ lib/RT/CurrentUser.pm, lib/RT/Scrip.pm, lib/RT/ScripScopes.pm,
+ lib/RT/Template.pm, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Watchers.pm, lib/RT/Action/AutoReply.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ Well, that was an exciting afternoon! Er, an exciting evening!
+ *grin* AutoReply now works. which means that all the infrastructure for
+ scrips is back in place. It required refactoring things a bit. as cool
+ as making RT::Template a MIME::Entity seemed, I just couldn't get it to work
+ right, so now, it just creates a MIME::Entity when it needs it, which is
+ probably better anyway. I simplified templates a bit. Now they only have
+ access to the Ticket and Transaction. This may not be wise, but we'll see.
+
+ Also, I merged the two blobs per template (headers and body).
+
+2000-03-31 08:25 tobiasb
+
+ * bin/webmux.pl:
+
+ rmvd dupl line
+
+2000-03-31 02:47 jesse
+
+ * Makefile:
+
+ removed old webui hooks from the makefile. bumped the version to 1.3.0
+
+2000-03-31 02:32 jesse
+
+ * webrt/Elements/Error:
+
+ file Error was initially added on branch rt-1-1.
+
+2000-03-31 02:32 jesse
+
+ * webrt/Ticket/DisplayTicket:
+
+ file DisplayTicket was initially added on branch rt-1-1.
+
+2000-03-31 02:32 jesse
+
+ * webrt/: Elements/Error, Elements/SelectStatus,
+ Ticket/Display.html, Ticket/DisplayTicket,
+ Ticket/DisplayTransaction, Ticket/ProcessUpdate.html,
+ Ticket/Update.html:
+
+ Ticket/Update.html will now allow you to submit a ticket update.
+ It's the RT2 equivalent of RT1.0's "comment" and "correspond" pages...
+ with a bit of added value. it's not a global "modify ticket" page. that comes
+ next. but it's where 90% of your single-ticket action will take place.
+
+2000-03-31 02:28 jesse
+
+ * lib/RT/Ticket.pm:
+
+ TimeTaken should increment now
+
+2000-03-31 02:26 jesse
+
+ * README:
+
+ added the mason dependency to the README
+
+2000-03-31 02:25 jesse
+
+ * bin/webmux.pl:
+
+ added some uses to the webmux so I don't have to add them to each page that
+ calls them
+
+2000-03-30 00:44 jesse
+
+ * webrt/Search/PickRestriction:
+
+ made the variable names in PickRestriction look more like the parameter names
+ in EasySearch. Wanna guess why?
+
+2000-03-29 23:52 jesse
+
+ * webrt/Search/RestrictSearch.html:
+
+ file RestrictSearch.html was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Search/PickRestriction:
+
+ file PickRestriction was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/Footer:
+
+ file Footer was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/: Elements/Checkbox, Elements/Footer, Elements/Header,
+ Elements/SelectBoolean, Elements/SelectDate,
+ Elements/SelectDateRelation, Elements/SelectOwner,
+ Elements/SelectQueue, Elements/SelectStatus, Elements/dayMenu,
+ Elements/monthMenu, Elements/yearMenu, Search/PickRestriction,
+ Search/RestrictSearch.html:
+
+ A bunch of infrasturcture work on the Ticket Search interface. it doesn't
+ have any real logic behind it. that's next.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectBoolean:
+
+ file SelectBoolean was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/dayMenu:
+
+ file dayMenu was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectStatus:
+
+ file SelectStatus was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectQueue:
+
+ file SelectQueue was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/yearMenu:
+
+ file yearMenu was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/Checkbox:
+
+ file Checkbox was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/Header:
+
+ file Header was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectOwner:
+
+ file SelectOwner was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/monthMenu:
+
+ file monthMenu was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectDateRelation:
+
+ file SelectDateRelation was initially added on branch rt-1-1.
+
+2000-03-29 23:52 jesse
+
+ * webrt/Elements/SelectDate:
+
+ file SelectDate was initially added on branch rt-1-1.
+
+2000-03-29 00:33 jesse
+
+ * etc/schema.mysql:
+
+ added a generic "RefersTo" ticket type to the comments.
+ changed the types of Link.Base and Link.Target to VARCHAR(255) from INT(11)
+
+2000-03-28 05:16 tobiasb
+
+ * README, tools/test:
+
+ darn, it seems like I'll need to install mod-perl ... actually I haven't done that earlier..
+
+2000-03-28 00:13 jesse
+
+ * Makefile, lib/RT/Record.pm, lib/RT/Transaction.pm,
+ webrt/Search/Listing.html, webrt/Search/QueueItem:
+
+ webrt/Search/Listing.html now gives a basic listing of all open tickets
+ It even has links to the _still display only_ Display.html for each ticket
+
+2000-03-27 23:55 jesse
+
+ * webrt/Ticket/DisplayTransaction:
+
+ missed this one. sorry.
+
+2000-03-27 23:55 jesse
+
+ * webrt/Ticket/DisplayTransaction:
+
+ file DisplayTransaction was initially added on branch rt-1-1.
+
+2000-03-27 23:54 jesse
+
+ * webrt/Ticket/: Display.html, DisplayHistory:
+
+ Hey. Look Ticket/Display.html?id=<int> works!
+
+2000-03-27 22:35 jesse
+
+ * webrt/Ticket/ToolBar:
+
+ file ToolBar was initially added on branch rt-1-1.
+
+2000-03-27 22:35 jesse
+
+ * webrt/Ticket/DisplaySummary:
+
+ file DisplaySummary was initially added on branch rt-1-1.
+
+2000-03-27 22:35 jesse
+
+ * webrt/Ticket/DisplayHistory:
+
+ file DisplayHistory was initially added on branch rt-1-1.
+
+2000-03-27 22:35 jesse
+
+ * README, webrt/Ticket/DisplayHistory, webrt/Ticket/DisplaySummary,
+ webrt/Ticket/ToolBar:
+
+ Work on WebRT, including a README update!
+
+ check out http://s.ly/~jesse/2000_03_28_171606_shot.jpg
+
+2000-03-27 22:31 jesse
+
+ * lib/RT/Watchers.pm:
+
+ Bugfix in Watchers AdministrativeCc -> AdminCc
+
+2000-03-27 22:30 jesse
+
+ * webrt/Ticket/: Display.html, Displaysummary, Update.html:
+
+ Work on WebUI. Display.html has slight functionality
+
+2000-03-27 22:13 tobiasb
+
+ * docs/design_docs/basic-definitions.txt, tools/test:
+
+ minor
+
+2000-03-27 21:50 tobiasb
+
+ * tools/test:
+
+ added some stuff to the test script
+
+2000-03-27 21:32 tobiasb
+
+ * lib/RT/: ScripScope.pm, Transaction.pm:
+
+ bugfixing
+
+2000-03-27 21:22 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ ...well, even more bugs...
+
+2000-03-27 21:09 tobiasb
+
+ * lib/RT/: Scrip.pm, ScripScope.pm, Template.pm, Transaction.pm:
+
+ First level bugfixing completed; Now the create (from the cli) calls up the action (though as earlier mentionated no emails are sent).
+
+2000-03-27 20:54 tobiasb
+
+ * lib/RT/Scrip.pm:
+
+ bgfx
+
+2000-03-27 20:47 tobiasb
+
+ * lib/RT/Scrip.pm:
+
+ Bugfix
+
+2000-03-27 20:22 tobiasb
+
+ * lib/RT/ScripScope.pm:
+
+ bugfix
+
+2000-03-27 20:19 tobiasb
+
+ * docs/design_docs/basic-definitions.txt:
+
+ clarified
+
+2000-03-27 18:58 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ The recipients aren't set anywhere as far as I can see ... and I'm really uncertain what you've thought of with SetEnvelopeTo vs SetTo, etc. You'd better take a look. Obviously, this won't work until the recipients are set somehow
+
+2000-03-27 18:40 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ I've mostly only added comments. Anyway, I must say that I like this
+ code. (maybe I'll say something different when I've tried debugging it
+ ;)
+
+2000-03-27 17:59 tobiasb
+
+ * lib/RT/ScripScope.pm:
+
+ bugfix
+
+2000-03-27 17:57 tobiasb
+
+ * lib/RT/Action.pm:
+
+ comment/folding bugfix
+
+2000-03-27 17:56 tobiasb
+
+ * docs/design_docs/basic-definitions.txt:
+
+ file basic-definitions.txt was initially added on branch rt-1-1.
+
+2000-03-27 17:56 tobiasb
+
+ * docs/design_docs/basic-definitions.txt:
+
+ (no comment :)
+
+2000-03-27 17:55 tobiasb
+
+ * docs/design_docs/link-definitions.txt:
+
+ I think maybe those additions might be appreciated by Rouillard ... and this was (hopefully) the last thing I do with design documentation/discussion until 1.3 is finished :)
+
+2000-03-27 17:33 tobiasb
+
+ * docs/design_docs/link-definitions.txt:
+
+ Doh ... I really shouldn't waste my time on this now ...
+
+2000-03-27 17:17 tobiasb
+
+ * lib/RT/Scrip.pm:
+
+ Did you ever try to see if those modules would pass `perl -c'? :)
+
+2000-03-27 16:44 jesse
+
+ * etc/schema.mysql, lib/RT/Action.pm, lib/RT/Scrip.pm,
+ lib/RT/ScripScope.pm, lib/RT/Action/AutoReply.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ Lots of works on Scrip, ScripScope, Action. Tobias: wanna take a look?
+ Basically, now Templates are autoloaded by RT::Scrip.pm and passed into
+ the Action as TemplateObj. Also, Templates are now of type MIME::Entity,
+ which means that they have all the attributes of mail messages and can
+ just be sent.
+
+2000-03-27 16:20 tobiasb
+
+ * docs/design_docs/: TransactionTypes.txt, link-definitions.txt:
+
+ Linking definitions
+
+2000-03-27 16:20 tobiasb
+
+ * docs/design_docs/link-definitions.txt:
+
+ file link-definitions.txt was initially added on branch rt-1-1.
+
+2000-03-27 16:01 tobiasb
+
+ * docs/README.docs:
+
+ Updated the README to reflect that the docs are old :)
+
+2000-03-27 15:45 tobiasb
+
+ * README:
+
+ status update
+
+2000-03-27 15:41 tobiasb
+
+ * lib/RT/ScripScope.pm:
+
+ minor string fix
+
+2000-03-27 15:36 tobiasb
+
+ * docs/design_docs/subscription-definitions.txt:
+
+ How does the system determinate whom to send mail to?
+
+ The ScripScope table in the DB should indicate whether a Scrip is relevant
+ for a queue or not /* TobiX thinks that this might eventually be extended to
+ keywords, tickets, etc, and not only Queues */ ... the Scope table should
+ indicate whether the Scrip is relevant for a given transaction type ... then
+ the given Action should determinate whether it applies or not, and finally
+ the Action has to find out (via the Watchers table) whom it applies to, and
+ how to contact them ... and the Template tells how the mails that are sent
+ out should look like.
+
+2000-03-27 12:33 jesse
+
+ * lib/RT/ScripScopes.pm:
+
+ file ScripScopes.pm was initially added on branch rt-1-1.
+
+2000-03-27 12:33 jesse
+
+ * lib/RT/: ScripScope.pm, ScripScopes.pm:
+
+ a bit more stub work on ScripScopes for tobias.
+ more work after lunch
+
+2000-03-27 07:18 tobiasb
+
+ * lib/RT/ScripScope.pm:
+
+ test..?
+
+2000-03-27 07:04 tobiasb
+
+ * lib/RT/: ScripScope.pm, Scrips.pm:
+
+ Initiated work to get the code understand the Scrips/Scripscope split
+
+2000-03-27 07:04 tobiasb
+
+ * lib/RT/ScripScope.pm:
+
+ file ScripScope.pm was initially added on branch rt-1-1.
+
+2000-03-27 06:55 tobiasb
+
+ * etc/schema.mysql:
+
+ Added yet a stupid design thought as a comment:
+
+ # {{{ TABLE ScripScope
+ (...)
+ Queue INT(11), #Queue Id 0 for global
+ # (maybe there might be conditions where otherb
+ # Scopes apply, i.e. a ticket, keyword, owner, etc?)
+
+2000-03-27 00:45 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ Oops. forgot to commit Notify.pm
+
+2000-03-27 00:45 jesse
+
+ * lib/RT/Action/Notify.pm:
+
+ file Notify.pm was initially added on branch rt-1-1.
+
+2000-03-27 00:44 jesse
+
+ * lib/RT/Action/NotifyOnResolve.pm:
+
+ file NotifyOnResolve.pm was initially added on branch rt-1-1.
+
+2000-03-27 00:44 jesse
+
+ * etc/schema.mysql, lib/RT/Ticket.pm,
+ lib/RT/Action/NotifyOnResolve.pm, lib/RT/Action/NotifyWatchers.pm:
+
+ Work on Notify (Formerly NotifyWatchers)
+ Work on NotifyOnResolve (Formerly NotifyWatchersOnResolve)
+
+ They don't _work_ per se. But they're getting closer. I'm wondering
+ whether we want to do something smarter with all the addresses we're passing
+ in to make it easier to remove specific ones...for example, we currently
+ have no way to _not_ send mail to the reuqestor.
+
+2000-03-26 18:13 jesse
+
+ * lib/RT/Action/: AutoReply.pm, SendEmail.pm:
+
+ AutoReply is now a proper subclass of SendEmail.pm
+ Maybe tonight, I'll try to get through some work on the Scrips and ScripScope stuff to make it work again.
+ then to wrok on NotifyWatchers.pm
+
+2000-03-25 01:03 jesse
+
+ * Makefile, lib/RT/Template.pm, lib/RT/Ticket.pm,
+ lib/RT/Action/SendEmail.pm:
+
+ Work on the templating system. I actually gutted Template.pm and SendEmail.pm
+ (sorry tobix :/) Basically RT::Template is now A MIME::Entity object, which
+ means that the various things one can do to mail messages can now be done to
+ RT::Template objects, once you run $TemplateObj->Parse on them..
+ SendEmail was cleaned up somewhat to be less intimidating to people who aren't
+ as comfortable with big chunks of fairly dense perl. Oh and it's a heck of a
+ lot more subclassable now ;)
+
+ Fixed a tiny bug in Ticket.pm resulting from the changes to Watchers.
+
+2000-03-24 08:29 tobiasb
+
+ * tools/test:
+
+ I'm making a test suite which is intended to be run off from the Makefile after an install
+
+2000-03-24 08:29 tobiasb
+
+ * tools/test:
+
+ file test was initially added on branch rt-1-1.
+
+2000-03-24 08:06 tobiasb
+
+ * etc/schema.mysql:
+
+ Added some more noise
+
+2000-03-23 23:41 jesse
+
+ * subscription-definitions.txt,
+ docs/design_docs/subscription-definitions.txt, etc/schema.mysql,
+ lib/RT/Action/NotifyWatchers.pm, lib/RT/Action/SendEmail.pm:
+
+ A little bit of cleanup to the SendEmail and NotifyWatchers actions.
+ I probably did more damage than good, but that's what I get for messing
+ with code that makes little sense to me.
+
+2000-03-23 23:41 jesse
+
+ * docs/design_docs/subscription-definitions.txt:
+
+ file subscription-definitions.txt was initially added on branch rt-1-1.
+
+2000-03-23 22:19 jesse
+
+ * webrt/Search/BuildSearch:
+
+ Testing the setgid repository. commiting an empty file
+
+2000-03-23 22:19 jesse
+
+ * webrt/Search/BuildSearch:
+
+ file BuildSearch was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * webrt/Search/QueueFooter:
+
+ file QueueFooter was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * webrt/Search/QueueItem:
+
+ file QueueItem was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * webrt/Search/QueueHeader:
+
+ file QueueHeader was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * webrt/Admin/ModifyUser:
+
+ file ModifyUser was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * lib/RT/Action/NotifyWatchers.pm:
+
+ file NotifyWatchers.pm was initially added on branch rt-1-1.
+
+2000-03-23 00:50 jesse
+
+ * Makefile, bin/rtmux.pl, etc/schema.mysql, lib/RT/Queue.pm,
+ lib/RT/Scrip.pm, lib/RT/Ticket.pm, lib/RT/Watcher.pm,
+ lib/RT/Action/NotifyWatchers.pm, webrt/Admin/ModifyUser,
+ webrt/Search/Listing.html, webrt/Search/QueueFooter,
+ webrt/Search/QueueHeader, webrt/Search/QueueItem,
+ webrt/Ticket/Displaysummary:
+
+ Did a bit of hacking on webrt2
+ Redid the watchers system according to what I posted earlier to rt-devel
+ Scrips have now broken..but we'll get them working again really soon.
+ Queue Cc and AdminCc now exist in cli adminrt.
+
+2000-03-22 14:56 tobiasb
+
+ * subscription-definitions.txt:
+
+ definitions in the subscription system
+
+2000-03-22 14:56 tobiasb
+
+ * subscription-definitions.txt:
+
+ file subscription-definitions.txt was initially added on branch rt-1-1.
+
+2000-03-22 14:42 tobiasb
+
+ * etc/schema.mysql:
+
+ This is a suggestion about a simple splitting of the Scrips table. I
+ think the admin tools will be significantly easier to set up if we do
+ it this way. An administrator can through some UI just add and remove
+ Scrips from a queue.
+
+2000-03-22 01:02 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm, Action.pm, Area.pm, Areas.pm,
+ Attachment.pm, Attachments.pm, CurrentUser.pm, EasySearch.pm,
+ Queue.pm, Queues.pm, Record.pm, Scrip.pm, Scrips.pm, Template.pm,
+ Templates.pm, Ticket.pm, Tickets.pm, Transaction.pm,
+ Transactions.pm, User.pm, Users.pm, Utils.pm, Watcher.pm,
+ Watchers.pm, Action/AutoReply.pm, Action/MailComment.pm,
+ Action/SendEmail.pm, Interface/Email.pm:
+
+ This may look like a lot of code. but it's not.
+ It's merely the result of running
+
+ perl -pi.bak -e 's/sub (.*?){\n/# {{{ sub $1\nsub $1 {\n/; s/^}$/}\n# }}}/'
+
+ basically, this adds # {{{ sub function
+ and # }}}
+ around all the function names. The main reason to do this is for
+ emacs fold-minor-mode. It makes things a lot easier to read.
+ In an ideal world, we'd have perl-aware folding editor and there'd be
+ no need for this markup
+
+2000-03-21 20:38 jesse
+
+ * lib/RT/: Queue.pm, Ticket.pm, Watcher.pm, Watchers.pm:
+
+ Work on watchers.
+
+2000-03-20 15:21 jesse
+
+ * etc/schema.mysql:
+
+ Modified the schema for my "New Improved Watchers" system. Basically,
+ now you'll be able to tie a template to a given watch. along with a
+ boolean "send mail" flag. We'll need a special "Mail Watchers" action to
+ make this all work..but the code should be pretty easy.
+
+ jesse
+
+2000-03-20 05:27 tobiasb
+
+ * bin/initdb.mysql:
+
+ bugfix
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/Create.html:
+
+ file Create.html was initially added on branch rt-1-1.
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/DisplayHeader:
+
+ file DisplayHeader was initially added on branch rt-1-1.
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/SetOwner:
+
+ file SetOwner was initially added on branch rt-1-1.
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/SetStatus:
+
+ file SetStatus was initially added on branch rt-1-1.
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/: Create.html, Display.html, DisplayHeader,
+ Displaysummary, SetOwner, SetStatus, Update.html:
+
+ More work on the basic webui
+
+2000-03-17 15:20 jesse
+
+ * webrt/Ticket/Displaysummary:
+
+ file Displaysummary was initially added on branch rt-1-1.
+
+2000-03-17 11:32 tobiasb
+
+ * bin/initdb.mysql:
+
+ Bugfix, the password passing didn't work as it should.
+
+2000-03-17 10:52 tobiasb
+
+ * etc/schema.mysql:
+
+ - Slashed away the old "MailQueueMembersOn..." junk.
+
+ - Added Scrips to the Watchers table. ... the Watchers/Scrips system
+ seems quite flexible .. BUT .. I have a certain feeling that it might
+ be hard to make administration tools that helps a non-hacking
+ administrator to find out which mails are sent where, etc. Well,
+ that's something we'll have to worry about later :)
+
+2000-03-17 08:47 tobiasb
+
+ * Makefile, etc/schema.mysql:
+
+ removed some instanses of 'su' that really shouldn't be needed, and which also broke on anything but GNU shellutils
+
+2000-03-17 07:32 tobiasb
+
+ * README:
+
+ Some additions and changes to reflect that this is, after all, a
+ development version. Meri, do you subscribe to cvs-commit? :)
+
+2000-03-17 06:01 tobiasb
+
+ * etc/schema.mysql:
+
+ # Those subscription field are not used in RT 1.1 as I see it.
+ # I think we should modify the Scrips system so it by default
+ # respects those fields.
+ MailOwnerOnTransaction INT, # notify owner on transaction
+ MailMembersOnTransaction INT, # notify list members on transaction
+ MailRequestorOnTransaction INT, # notify requestor on transaction
+ MailRequestorOnCreation INT, # notify user on creation
+ MailMembersOnCorrespondence INT, # notify members on creation
+ MailMembersOnComment INT, # notify members on comment
+
+2000-03-16 16:31 jesse
+
+ * webrt/: Search/Listing.html, Ticket/Display.html,
+ Ticket/Modify.html, Ticket/ProcessUpdate.html, Ticket/Update.html,
+ Ticket/ValidateUpdate.html:
+
+ The beginnings of the All New! Web UI based around HTML::Mason
+ There's nothing functional here yet. but it's a start at a framework.
+ Ticket/Update.html is probably the closest to "real" code so far.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Ticket/ValidateUpdate.html:
+
+ file ValidateUpdate.html was initially added on branch rt-1-1.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Ticket/Display.html:
+
+ file Display.html was initially added on branch rt-1-1.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Ticket/Modify.html:
+
+ file Modify.html was initially added on branch rt-1-1.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Search/Listing.html:
+
+ file Listing.html was initially added on branch rt-1-1.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Ticket/ProcessUpdate.html:
+
+ file ProcessUpdate.html was initially added on branch rt-1-1.
+
+2000-03-16 16:31 jesse
+
+ * webrt/Ticket/Update.html:
+
+ file Update.html was initially added on branch rt-1-1.
+
+2000-03-16 14:46 tobiasb
+
+ * Makefile:
+
+ Changed the default database name from rt to RT to avoid confusion with previously installed versions of rt
+
+2000-03-16 02:34 tobiasb
+
+ * lib/RT/User.pm:
+
+ Bugfixes: It was impossible not to give requests to somebody.
+
+2000-03-16 01:32 tobiasb
+
+ * lib/RT/Interface/Email.pm:
+
+ Bugfixes
+
+ was
+
+ if ($CurrentUser->Id == 0) {
+ #If it fails, create a user
+
+ now
+
+ unless ($CurrentUser->Id) {
+ #If it fails, create a user
+
+ as Id returned undef.
+
+ Changed 'Queue' to 'QueueTag'.
+
+ Added some few comments
+
+2000-03-14 00:40 jesse
+
+ * README:
+
+ Modified the README for the beginnings of the new webui
+
+2000-03-14 00:39 jesse
+
+ * bin/: rtmux.pl, webmux.pl:
+
+ added webmux. modified rtmux.pl to clean out some cruft
+
+2000-03-14 00:39 jesse
+
+ * bin/webmux.pl:
+
+ file webmux.pl was initially added on branch rt-1-1.
+
+2000-03-13 12:53 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ rt-mailgate has now recieved and logged correspondence and comments with current schema.
+
+2000-03-08 23:26 jesse
+
+ * lib/RT/: Ticket.pm, Transaction.pm:
+
+ DBIx cleanups to deal with load by id when id is null
+ Work on comment and correspond. Eventually, we'll get the
+ per-transaction cc and bcc working.
+
+2000-03-08 18:22 jesse
+
+ * bin/rtmux.pl, lib/RT/Queue.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/User.pm:
+
+ rtq works a bit better
+ rtadmin works again.
+ rtadmin -user create
+ -user modify
+ both seem to work ok
+
+ rt -create now makes sure a queue exists and permits ticket creation
+ rt -create now make sure a prospective owner has queue membership.
+
+2000-03-02 17:23 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Action/SendEmail.pm, etc/schema.mysql:
+
+ resolve, open, take (if unowned, at least) seems to work
+
+2000-03-02 16:10 tobiasb
+
+ * lib/RT/: Ticket.pm, Ticket.pm:
+
+ Bugfixing
+
+2000-03-02 14:35 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Correspondence almost works
+
+2000-03-02 13:26 tobiasb
+
+ * lib/RT/Ticket.pm, lib/RT/Action/MailComment.pm, etc/schema.mysql:
+
+ Comments almost work now (from the cli)
+
+2000-03-02 12:38 tobiasb
+
+ * lib/RT/Action/: MailComment.pm, MailCorrespondence.pm:
+
+ one minor bugfix + some comments
+
+2000-03-01 23:58 jesse
+
+ * NEWS:
+
+ brought the news up to date.
+ nuked old /contrib
+ nuked old /etc/templates.
+
+ bedtime now.
+
+2000-03-01 23:57 jesse
+
+ * NEWS:
+
+ brought the news up to date (a bit)
+
+2000-03-01 23:50 jesse
+
+ * Makefile:
+
+ removed a lot of outdated cruft.
+ Bumped the version to 1.1.11 for a release later this week.
+
+2000-03-01 23:18 jesse
+
+ * lib/RT/: Ticket.pm, Interface/Email.pm:
+
+ The mail gateway now lets you create, comment and correspond on tickets.
+ Ticket->Owner now deals better when the owner is NULL
+
+2000-03-01 21:27 jesse
+
+ * HACKING:
+
+ minor comments added to hacking
+
+2000-03-01 21:20 jesse
+
+ * HACKING:
+
+ Trivial change to HACKING to test commitinfo
+
+2000-03-01 21:09 jesse
+
+ * lib/RT/Interface/Email.pm:
+
+ file Email.pm was initially added on branch rt-1-1.
+
+2000-03-01 21:09 jesse
+
+ * bin/rtmux.pl, lib/RT/Interface/Email.pm:
+
+ work on mailgate
+
+2000-03-01 18:36 tobiasb
+
+ * docs/design_docs/TransactionTypes.txt, etc/schema.mysql:
+
+ Some loose thoughts only ... as comments and a doc which I'm not sure
+ if it's possible to understand by others than me anyway :)
+
+ Anyway, it is too complex. We'll just continue following the current design.
+
+2000-03-01 18:36 tobiasb
+
+ * docs/design_docs/TransactionTypes.txt:
+
+ file TransactionTypes.txt was initially added on branch rt-1-1.
+
+2000-03-01 17:51 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Seems like it's a lot of things that doesn't work here.
+
+2000-03-01 16:26 tobiasb
+
+ * etc/schema.mysql:
+
+ Ehm ... maybe I forgot to commit this one. It contains some fixes.
+
+2000-03-01 16:08 jesse
+
+ * TODO:
+
+ ripped a bit of obsolete code from rtmux.pl
+ updated the TODO to reference the production instance of RT.
+
+2000-03-01 14:48 jesse
+
+ * bin/rtmux.pl:
+
+ removed the old web ui hooks from rtmux.pl
+
+2000-03-01 12:12 tobiasb
+
+ * lib/RT/: Action.pm, Scrip.pm, Template.pm, Ticket.pm,
+ Watchers.pm, Action/AutoReply.pm, Action/SendEmail.pm:
+
+ I've done some debugging and polishing. I hope it won't break with stuff you're eventually working with
+
+2000-02-29 16:58 tobiasb
+
+ * lib/RT/: Queue.pm, Ticket.pm, Watchers.pm:
+
+ One sort of bugfix..
+
+2000-02-29 16:35 tobiasb
+
+ * lib/RT/: Queue.pm, Template.pm, Ticket.pm, Watcher.pm,
+ Watchers.pm, Action/SendEmail.pm:
+
+ Scrips work for me. Well, I'm not that sure anyway. I had actually
+ expected one email to drop in for each Scrip - but I only got the
+ AutoReply and the Correspondence. Maybe I should debug even more.
+
+2000-02-29 14:29 tobiasb
+
+ * lib/RT/Watchers.pm:
+
+ LimitToTicket updated (not tested, though)
+ LimitToQueue added (not tested, though)
+
+2000-02-29 14:27 tobiasb
+
+ * etc/schema.mysql:
+
+
+ # Primarly used by RT::Actions::SendEmail as well as some subclasses
+ # to determinate whom to send emails to. This scheme should work out
+ # better than the scheme under RT 1.0, and should suit most users.
+ # For more fine grained control, it's possible to create tables as you
+ # like and make a new subclass of RT::Actions::SendEmail where the
+ # SetRecepients sub is overloaded :)
+
+ CREATE TABLE Watchers (
+ id int(11) AUTO_INCREMENT PRIMARY KEY,
+ Value int(11),
+ Scope varchar(16), # Might be "Queue" and "Ticket" as for now
+ # ... might be extended to "Keywords", "Owners", etc.
+ Email VARCHAR(255),
+ Type VARCHAR(16), #Requestor, Cc, Bcc
+ Creator INT(11),
+ Created TIMESTAMP,
+ LastUpdatedBy INT(11),
+ LastUpdated TIMESTAMP
+ )\g
+
+2000-02-29 13:40 tobiasb
+
+ * etc/schema.mysql:
+
+ CREATE TABLE Watchers (
+ id int(11) AUTO_INCREMENT PRIMARY KEY,
+ Ticket int(11), # 0 for all
+ Queue int(11), # 0 for all
+ # We might consider adding more power here,
+ # i.e. TransactionType, Scrip, etc
+ Email VARCHAR(255),
+ Type VARCHAR(16), #Requestor, Cc, Bcc
+ Creator INT(11),
+ Created TIMESTAMP,
+ LastUpdatedBy INT(11),
+ LastUpdated TIMESTAMP
+ )\g
+
+2000-02-29 10:43 tobiasb
+
+ * etc/schema.mysql:
+
+ Template.{content and title} => Content and Title - since we use
+ UpperCase in the rest of the DD.
+
+2000-02-29 10:31 tobiasb
+
+ * etc/schema.mysql:
+
+ Blob, that is..
+
+2000-02-29 10:12 tobiasb
+
+ * etc/schema.mysql:
+
+ Added ExtraHeaders as VARCHAR(255). 255 characters should be enough
+ for storing some few extra header lines, but anyway maybe it should
+ have been blob instead?
+
+2000-02-29 09:51 tobiasb
+
+ * lib/RT/: Attachment.pm, Action/AutoReply.pm, Action/SendEmail.pm:
+
+ I've continued the work on mail sending. There is still some missing
+ stuff:
+
+ 1. EasySearch/Scrips issue - currently it doesn't properly output "
+ all scrips that has (queue=0 or queue=this) and (type="any" or type=this)".
+
+ 2. A serious stub in RT::Action::SendEmail - I don't know where to find
+ "interessted parties". I think it could be nice putting queue watchers
+ in the same table as ticket watchers.
+
+2000-02-29 09:42 tobiasb
+
+ * lib/RT/Scrips.pm:
+
+ Hack - everything that applies for a Correspondence action also
+ applies for a Create action (I'd daresay).
+
+2000-02-29 07:02 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ Some insignificant changes. Well, one marginally significant; it
+ shouldn't $Scrip->Commit unless $Scrip->Prepare()
+
+2000-02-29 04:12 tobiasb
+
+ * etc/schema.mysql:
+
+ I've started at general transaction emails.
+
+2000-02-29 03:58 tobiasb
+
+ * lib/RT/Watchers.pm:
+
+ Added an Emails method. It can be used like:
+
+ print join(",", @{$Watchers->Emails("Requestors")});
+
+ or
+
+ $Watchers->LimitToRequestors;
+ $Emails=$Watchers->Emails;
+
+ ...
+
+2000-02-29 02:31 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ Sender => RT-Originator
+
+2000-02-29 00:40 jesse
+
+ * README:
+
+ Added Into Netowrks and Funcom to the thanks at the top of the readme
+ `
+
+2000-02-28 23:20 jesse
+
+ * Makefile:
+
+ RT 1.1.10 released. Tobix has autoreply basically working :)
+
+2000-02-28 22:49 jesse
+
+ * Makefile, NEWS, README:
+
+ Fixed a longstanding bug in the WebRT administrator
+ added a note about stripmime to the readme.
+ added a bit of code from curl.com that adds functionality to rtq for reporting
+
+2000-02-28 22:17 jesse
+
+ * Makefile, NEWS:
+
+ bumped the version for release of 1.0.2
+
+2000-02-28 11:33 tobiasb
+
+ * lib/RT/: Template.pm, Transaction.pm, Action/AutoReply.pm,
+ Action/SendEmail.pm:
+
+ AutoReply seems to work now ... except that rtadmin didn't set email
+ aliases for the queue, so the mail bounces with invalid from address.
+ I won't look more at this until tomorrow. You're very welcome to take
+ over for a while if you feel like it :)
+
+2000-02-28 11:29 tobiasb
+
+ * etc/schema.mysql:
+
+ AutoReply seems to work now
+
+2000-02-28 08:18 tobiasb
+
+ * HACKING:
+
+ Added some hints and misc. Please look through.
+
+2000-02-28 05:25 tobiasb
+
+ * lib/RT/: Ticket.pm, Transaction.pm, Action/AutoReply.pm,
+ Action/SendEmail.pm:
+
+ - The queue tag rather than queue id is delievered from the cli, this
+ broke in Ticket::Create. Fixed.
+
+ - The Attachments have to be assigned to a transaction before Scrips
+ is run. Now the Attachments are delievered as a part of the parameters
+ to Transaction::Create
+
+2000-02-27 23:28 tobiasb
+
+ * etc/schema.mysql:
+
+ Fixed the AutoReply template ... still not tested, though.
+
+2000-02-27 22:04 tobiasb
+
+ * lib/RT/Action/: AutoReply.pm, SendEmail.pm:
+
+ I think we can nuke the old rt/lib/rt/support/mail.pm now - everything
+ should be located in SendEmail.pm, AutoReply.pm and Template.pm by now :)
+
+ It's not tested yet, and the templates needs upgrading. Anyway, I will
+ probably not mess more around with the perl code as for now.
+
+2000-02-27 21:43 tobiasb
+
+ * bin/rtmux.pl:
+
+ Seems like $rtversion="!!RT_VERSION!!" had disappeared. I renamed the
+ variable to $VERSION.
+
+2000-02-27 21:22 jesse
+
+ * lib/RT/Ticket.pm:
+
+ dates now display in the cli.
+
+2000-02-27 20:53 tobiasb
+
+ * lib/RT/Templates.pm:
+
+ Fixed DBIx::EasySearch => RT::EasySearch
+
+2000-02-27 20:53 tobiasb
+
+ * lib/RT/Template.pm:
+
+ Method Template::Parse added, Text::Template used for the moment.
+
+ (sigh ... that means my next worktask will be to update the
+ templates...)
+
+2000-02-27 20:49 jesse
+
+ * lib/RT/Ticket.pm:
+
+ so. Ticket->Create now actually figures out ccs and bccs and requestors from the mime
+ object passed in to it.
+
+2000-02-27 19:05 jesse
+
+ * lib/RT/Transaction.pm:
+
+ added a comment for tobias about a new line that didn't make sense.
+
+2000-02-27 18:46 jesse
+
+ * lib/RT/: Ticket.pm, Watchers.pm:
+
+ watchers updates.
+
+2000-02-27 17:25 tobiasb
+
+ * lib/RT/Template.pm:
+
+ file Template.pm was initially added on branch rt-1-1.
+
+2000-02-27 17:25 tobiasb
+
+ * lib/RT/: Attachment.pm, Template.pm, Templates.pm,
+ Action/AutoReply.pm, Action/SendEmail.pm:
+
+ Development snapshot. I guess I'll have it working in half an hour
+ with _efficient_ working, that is some four hours working at my
+ current efficiency rate :/
+
+2000-02-27 17:25 tobiasb
+
+ * lib/RT/Templates.pm:
+
+ file Templates.pm was initially added on branch rt-1-1.
+
+2000-02-27 16:43 tobiasb
+
+ * etc/schema.mysql:
+
+ Added some templates
+
+2000-02-27 11:19 tobiasb
+
+ * lib/RT/: Scrip.pm, Transaction.pm:
+
+ development snapshot
+
+2000-02-27 10:31 tobiasb
+
+ * lib/RT/Action/: AutoReply.pm, MailComment.pm,
+ MailCorrespondence.pm, SendEmail.pm:
+
+ I've started bashing at the mail sending functionallity. It seemed quite
+ stubbed to me.
+
+2000-02-24 03:44 tobiasb
+
+ * etc/schema.mysql:
+
+ minor bug in comment
+
+2000-02-24 03:24 tobiasb
+
+ * lib/RT/Action/SendEmail.pm:
+
+ clearing out a potential weird bug
+
+2000-02-24 00:27 jesse
+
+ * lib/RT/Scrips.pm:
+
+ Fixed a typo in my code near tobix' changes to Scrips.pm. his changes look good.
+
+2000-02-24 00:03 jesse
+
+ * Makefile, NEWS, README:
+
+ little fix to mail manipulate from "Heather L. Sherman" <heather@idealab.com>
+
+2000-02-23 17:06 tobiasb
+
+ * lib/RT/: Scrips.pm, Action/SendEmail.pm:
+
+ Some small fixes. You'd better look through it, as I'm not completely sure what I'm doing :)
+
+2000-02-23 16:07 tobiasb
+
+ * etc/schema.mysql:
+
+ An insert entry here reffers to SendMail.pm, while the file is SendEmail.pm
+
+2000-02-23 15:26 jesse
+
+ * docs/rt-templates.html:
+
+ [no log message]
+
+2000-02-23 11:38 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Could not get 'rt -create' working. It seems more sane now, but I'm not really sure what I'm doing ... so you should have a peek at it. I changed $Id->SUPER::_Set("EffectiveId",$id); to $self->SUPER::_Set etc
+
+2000-02-22 23:35 jesse
+
+ * lib/RT/InterestedParty.pm:
+
+ removed vestigal code
+
+2000-02-22 23:25 jesse
+
+ * etc/schema.mysql, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/Transactions.pm, lib/RT/Watchers.pm:
+
+ A bit more work on watchers. we're getting close.
+ rtq works today.
+ rt -create basically works.
+ rt -take works.
+
+ rt -show will now start to show ownership changes.
+
+2000-02-22 08:06 jesse
+
+ * Makefile, etc/schema.mysql, lib/RT/Ticket.pm:
+
+ Work on Watchers. Most of the code needed to make this work is now
+ present. sadly I haven't even _tried_ to run it yet.
+
+2000-02-21 01:33 jesse
+
+ * lib/RT/Watcher.pm:
+
+ file Watcher.pm was initially added on branch rt-1-1.
+
+2000-02-21 01:33 jesse
+
+ * lib/RT/: InterestedParties.pm, InterestedParties.pm~,
+ Notification.pm, Ticket.pm, Watcher.pm, Watchers.pm:
+
+ Renamed interested parties to "Watchers"
+ Watchers are now keyed by EmailAddress rather than UserId. Not every CC will have an rt account, i think
+
+2000-02-21 01:33 jesse
+
+ * lib/RT/Watchers.pm:
+
+ file Watchers.pm was initially added on branch rt-1-1.
+
+2000-02-20 18:28 jesse
+
+ * lib/RT/InterestedParties.pm~:
+
+ file InterestedParties.pm~ was initially added on branch rt-1-1.
+
+2000-02-20 18:28 jesse
+
+ * lib/RT/InterestedParties.pm:
+
+ file InterestedParties.pm was initially added on branch rt-1-1.
+
+2000-02-20 18:28 jesse
+
+ * lib/RT/InterestedParty.pm:
+
+ file InterestedParty.pm was initially added on branch rt-1-1.
+
+2000-02-20 18:28 jesse
+
+ * lib/RT/: InterestedParties.pm, InterestedParties.pm~,
+ InterestedParty.pm:
+
+ [no log message]
+
+2000-02-20 18:24 jesse
+
+ * etc/schema.mysql, lib/RT/Ticket.pm:
+
+ [no log message]
+
+2000-02-20 15:27 jesse
+
+ * etc/schema.mysql, lib/RT/Action.pm, lib/RT/Scrip.pm,
+ lib/RT/Action/AutoReply.pm, lib/RT/Action/SendEmail.pm:
+
+ Work on scrips. stubs for the webui
+
+2000-02-19 17:45 jesse
+
+ * lib/RT/: Action.pm, Scrip.pm:
+
+ work on actions. checking in for eric to take a look
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/Action/AutoReply.pm:
+
+ file AutoReply.pm was initially added on branch rt-1-1.
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/Action/MailCorrespondence.pm:
+
+ file MailCorrespondence.pm was initially added on branch rt-1-1.
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/Action.pm:
+
+ file Action.pm was initially added on branch rt-1-1.
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/Action/MailComment.pm:
+
+ file MailComment.pm was initially added on branch rt-1-1.
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/: Action.pm, Action/AutoReply.pm, Action/MailComment.pm,
+ Action/MailCorrespondence.pm, Action/SendEmail.pm:
+
+ As it turns out, Action needed to be abstracted a bit and renamed.
+
+ I'm also making the Object syntax a bit.
+
+2000-02-19 16:48 jesse
+
+ * lib/RT/Action/SendEmail.pm:
+
+ file SendEmail.pm was initially added on branch rt-1-1.
+
+2000-02-17 09:19 jesse
+
+ * etc/schema.mysql, lib/RT/Scrip.pm, lib/RT/Scrips.pm,
+ lib/RT/Transaction.pm:
+
+ The base architecture for Scrips to work should now be in place.
+ Next up: write example "Actions" (gotta move the Scrips directory to Actions)
+ for the scrip handlers to use.
+
+2000-02-16 09:59 jesse
+
+ * lib/RT/: Scrip.pm, Transaction.pm:
+
+ Starting to make scrips actually work
+
+2000-02-10 23:24 jesse
+
+ * lib/RT/Scrips.pm:
+
+ file Scrips.pm was initially added on branch rt-1-1.
+
+2000-02-10 23:24 jesse
+
+ * lib/RT/: Scrip.pm, Scrips.pm, Transaction.pm:
+
+ more work stubbing scrips. but now my arms hurt badly enough that i'm going to log out.
+
+2000-02-10 23:24 jesse
+
+ * lib/RT/Scrip.pm:
+
+ file Scrip.pm was initially added on branch rt-1-1.
+
+2000-01-31 02:38 tobiasb
+
+ * README, lib/RT/Attachments.pm:
+
+ does the commit automail work now?
+
+2000-01-30 23:54 jesse
+
+ * NEWS, README, etc/schema.mysql, lib/RT/CurrentUser.pm,
+ lib/RT/Record.pm, lib/RT/User.pm:
+
+ Work on the User object.
+ The mail gateway now autocreates users. (This will make more sense
+ once we start tying tickets to users by means of the InterestedParties table.
+
+2000-01-29 01:33 jesse
+
+ * Makefile:
+
+ makefile cleanup. including removing the C compiler and template and
+ transaction directories
+
+2000-01-29 01:30 jesse
+
+ * Makefile:
+
+ removed C compiler from the makefile
+
+2000-01-29 01:25 jesse
+
+ * Makefile:
+
+ Removed C compiler from the makefile. we just don't need it anymore
+
+2000-01-29 01:22 jesse
+
+ * Makefile:
+
+ bumped version to 1-1-8
+
+2000-01-29 01:20 jesse
+
+ * Makefile:
+
+ removed template and transaction paths from the makefile.
+ (to test new cvs wrappers and cuz they should be gona anyway)
+
+2000-01-29 00:26 jesse
+
+ * etc/schema.mysql:
+
+ Started to do work on scrips. see the schema for how it would work.
+
+2000-01-28 20:04 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Some modifications and bugfixes on the messages popping up after a `successful' correspondence/comment
+
+2000-01-28 19:47 tobiasb
+
+ * lib/RT/Ticket.pm:
+
+ Removed some annoying warnings. I don't know if this is the "right"
+ way to remove them, but it works (for me, at least), it's an easy
+ way to do it, and it's harmless;
+
+ instead of writing
+ $var_that_might_be_undef
+ I write
+ $var_that_might_be_undef || ""
+ eventually with parantheses, and eventually with "" replaced by 0, or maybe
+ (not tested) even undef.
+
+2000-01-28 13:22 tobiasb
+
+ * Makefile:
+
+ Two substitution parameters was forgotten in config.pm
+
+2000-01-28 13:12 tobiasb
+
+ * etc/schema.mysql:
+
+ Oups, committed the wrong file
+
+2000-01-28 13:10 tobiasb
+
+ * Makefile, etc/schema.mysql:
+
+ Two substitution parameters was forgotten in config.pm
+
+2000-01-27 04:09 tobiasb
+
+ * Makefile, bin/initdb.mysql:
+
+ small password fix
+
+2000-01-25 23:26 jesse
+
+ * Makefile:
+
+ bumped the version to 1.1.7 for tonight's release.
+
+2000-01-25 23:12 jesse
+
+ * lib/RT/: Attachments.pm, Ticket.pm, Transaction.pm:
+
+ DBIx::EasySearch now has a -> First method. which is like -> Next, but picks
+ the first element
+
+ DBIx::Record -> now returns '' rather than undef for null values. it's less
+ likely to break interfaces.
+
+2000-01-25 16:36 tobiasb
+
+ * README:
+
+ aargh
+
+2000-01-25 16:31 tobiasb
+
+ * TODO:
+
+ test
+
+2000-01-25 14:57 tobiasb
+
+ * etc/schema.mysql:
+
+ bugfix
+
+2000-01-25 14:44 tobiasb
+
+ * Makefile:
+
+ removed obsoleteness
+
+2000-01-25 14:37 tobiasb
+
+ * README:
+
+ The UPGRADE section of the README was inaccurate
+
+2000-01-25 14:31 tobiasb
+
+ * lib/RT/Transaction.pm:
+
+ comment bug
+
+2000-01-24 01:45 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-01-24 01:43 jesse
+
+ * Makefile, NEWS, lib/RT/Attachment.pm, lib/RT/Attachments.pm,
+ lib/RT/Record.pm, lib/RT/Ticket.pm, lib/RT/Tickets.pm,
+ lib/RT/Transaction.pm, lib/RT/Transactions.pm:
+
+
+ * Attachments support in code. rtq now basically works
+ Mailgate creates new tickets
+ rt -show now works a bit (doesn't display transaction content yet)
+ rt -subject works. several other commandline tools work
+
+2000-01-23 18:32 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-01-23 18:27 jesse
+
+ * Makefile:
+
+ [no log message]
+
+2000-01-23 18:19 jesse
+
+ * etc/schema.mysql, lib/RT/Attachment.pm, lib/RT/Attachments.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm:
+
+ Work to make attachments work. So far we've got something that puts attachments
+ in the database.
+
+2000-01-21 12:25 tobiasb
+
+ * README:
+
+ doc-bugfix
+
+2000-01-18 23:56 jesse
+
+ * lib/RT/Ticket.pm:
+
+ work on the mail gateway. (mainly disemboweled it)
+
+2000-01-18 00:34 jesse
+
+ * lib/RT/Attachments.pm:
+
+ file Attachments.pm was initially added on branch rt-1-1.
+
+2000-01-18 00:34 jesse
+
+ * docs/API:
+
+ file API was initially added on branch rt-1-1.
+
+2000-01-18 00:34 jesse
+
+ * lib/RT/Attachment.pm:
+
+ file Attachment.pm was initially added on branch rt-1-1.
+
+2000-01-18 00:34 jesse
+
+ * HACKING:
+
+ file HACKING was initially added on branch rt-1-1.
+
+2000-01-18 00:34 jesse
+
+ * HACKING, Makefile, docs/API, etc/schema.mysql,
+ lib/RT/Attachment.pm, lib/RT/Attachments.pm, lib/RT/CurrentUser.pm,
+ lib/RT/Queue.pm, lib/RT/Record.pm, lib/RT/Ticket.pm,
+ lib/RT/Transaction.pm, lib/RT/Utils.pm:
+
+ work on attachments.
+ work on structure
+
+2000-01-17 12:59 jesse
+
+ * Makefile, etc/schema.mysql, lib/RT/ACE.pm, lib/RT/ACL.pm,
+ lib/RT/CurrentUser.pm, lib/RT/Queue.pm, lib/RT/Queues.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Transaction.pm,
+ lib/RT/Transactions.pm, lib/RT/User.pm, lib/RT/Users.pm:
+
+ work on create. work on attachments. upcased the table names.
+
+2000-01-14 15:34 jesse
+
+ * etc/schema.mysql:
+
+ work on schema
+
+2000-01-14 14:47 jesse
+
+ * NEWS, etc/schema:
+
+ schema change to make long email addresses work better for queue members.
+
+2000-01-14 01:07 jesse
+
+ * lib/RT/: EasySearch.pm, Record.pm, Ticket.pm, Tickets.pm,
+ Transaction.pm:
+
+ basic searches now work.
+ comments almost work.
+ creates are having an issue with effectiveid not getting set.
+
+2000-01-13 18:04 jesse
+
+ * Makefile, lib/RT/EasySearch.pm, lib/RT/Tickets.pm:
+
+ [no log message]
+
+2000-01-13 15:03 jesse
+
+ * lib/RT/Utils.pm:
+
+ file Utils.pm was initially added on branch rt-1-1.
+
+2000-01-13 15:03 jesse
+
+ * lib/RT/Utils.pm:
+
+ [no log message]
+
+2000-01-09 20:38 jesse
+
+ * lib/RT/EasySearch.pm:
+
+ file EasySearch.pm was initially added on branch rt-1-1.
+
+2000-01-09 20:38 jesse
+
+ * lib/RT/: EasySearch.pm, Queue.pm, Queues.pm, Record.pm,
+ Tickets.pm:
+
+ added RT/EasySearch.pm
+
+ rtadmin queue -list will now show all queues.
+ removed some debugging output
+
+2000-01-04 01:21 jesse
+
+ * etc/schema.mysql, lib/RT/CurrentUser.pm, lib/RT/Queue.pm,
+ lib/RT/Record.pm, lib/RT/Ticket.pm, lib/RT/Transaction.pm,
+ lib/RT/User.pm:
+
+ Lots of work. first working ticket update.
+
+2000-01-04 01:21 jesse
+
+ * lib/RT/CurrentUser.pm:
+
+ file CurrentUser.pm was initially added on branch rt-1-1.
+
+2000-01-03 07:40 tobiasb
+
+ * README, README:
+
+ bugfix
+
+2000-01-03 01:39 jesse
+
+ * lib/RT/: Record.pm, Ticket.pm, User.pm:
+
+ basic create support working.
+ more boackend and abstraction work
+
+2000-01-02 22:04 jesse
+
+ * lib/RT/Ticket.pm:
+
+ [no log message]
+
+2000-01-02 20:31 jesse
+
+ * lib/RT/: ACE.pm, Area.pm, Queue.pm, Record.pm, Ticket.pm,
+ Transaction.pm, User.pm:
+
+ work on a buit more abstraction
+
+2000-01-01 19:01 jesse
+
+ * etc/schema.mysql, lib/RT/ACE.pm, lib/RT/Ticket.pm,
+ lib/RT/User.pm:
+
+ work on Ticket.pm, schema.
+ things are starting to use immutable ids when referring to other tables.
+
+1999-12-30 02:13 jesse
+
+ * Makefile, etc/schema.mysql, lib/RT/Queue.pm, lib/RT/Record.pm,
+ lib/RT/User.pm:
+
+ reworked things to use autoloaded functions.
+
+1999-12-29 00:24 jesse
+
+ * Makefile, bin/rtmux.pl, etc/schema.mysql, lib/RT/ACE.pm,
+ lib/RT/Area.pm, lib/RT/Queue.pm, lib/RT/Record.pm,
+ lib/RT/Ticket.pm, lib/RT/Transaction.pm, lib/RT/User.pm:
+
+ lots of changes. some of them not quite done perfectly.
+ but admin is closer
+
+1999-12-28 01:39 jesse
+
+ * bin/rtmux.pl, etc/config.pm, lib/RT/ACE.pm, lib/RT/ACL.pm,
+ lib/RT/Area.pm, lib/RT/Areas.pm, lib/RT/Notification.pm,
+ lib/RT/Queue.pm, lib/RT/Queues.pm, lib/RT/Record.pm,
+ lib/RT/Ticket.pm, lib/RT/Tickets.pm, lib/RT/Transaction.pm,
+ lib/RT/Transactions.pm, lib/RT/User.pm, lib/RT/Users.pm:
+
+ rtadmin will now invoke and exit.
+
+1999-12-27 19:54 jesse
+
+ * Makefile, bin/initacls.mysql, bin/rtmux.pl, etc/acl.mysql,
+ etc/config.pm, lib/RT/Record.pm:
+
+ first steps toward runability
+
+1999-12-27 01:51 jesse
+
+ * Makefile, bin/rtmux.pl, etc/config.pm:
+
+ trying to get the config worked out
+
+1999-12-26 21:58 jesse
+
+ * Makefile, Makefile:
+
+ [no log message]
+
+1999-12-26 21:55 jesse
+
+ * Makefile, Makefile:
+
+ [no log message]
+
+1999-12-26 21:53 jesse
+
+ * Makefile, Makefile, Makefile:
+
+ [no log message]
+
+1999-12-26 21:51 jesse
+
+ * Makefile, Makefile, Makefile:
+
+ [no log message]
+
+1999-12-26 21:45 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-12-26 21:42 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-12-26 21:34 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-12-26 21:19 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-12-26 18:35 jesse
+
+ * Makefile:
+
+ work on the makefile
+
+1999-12-26 17:42 jesse
+
+ * lib/RT/User.pm:
+
+ more fixes for the new Handle object
+
+1999-12-26 17:03 jesse
+
+ * bin/rtmux.pl, lib/RT/ACL.pm, lib/RT/Areas.pm, lib/RT/Queues.pm,
+ lib/RT/Tickets.pm, lib/RT/Transactions.pm, lib/RT/Users.pm:
+
+ more work on making everything use DBIx::Handle
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Ticket.pm:
+
+ file Ticket.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Queue.pm:
+
+ file Queue.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Transaction.pm:
+
+ file Transaction.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Notification.pm:
+
+ file Notification.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/ACE.pm:
+
+ file ACE.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Areas.pm:
+
+ file Areas.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/ACL.pm:
+
+ file ACL.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Users.pm:
+
+ file Users.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Database.pm:
+
+ file Database.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Tickets.pm:
+
+ file Tickets.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Queues.pm:
+
+ file Queues.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Transactions.pm:
+
+ file Transactions.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Area.pm:
+
+ file Area.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/: ACE.pm, ACL.pm, Area.pm, Areas.pm, Database.pm,
+ Notification.pm, Queue.pm, Queues.pm, Record.pm, Ticket.pm,
+ Tickets.pm, Transaction.pm, Transactions.pm, User.pm, Users.pm:
+
+ moving things to a more sane directory
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/Record.pm:
+
+ file Record.pm was initially added on branch rt-1-1.
+
+1999-12-26 15:58 jesse
+
+ * lib/RT/User.pm:
+
+ file User.pm was initially added on branch rt-1-1.
+
+1999-12-23 01:05 jesse
+
+ * Makefile, NEWS:
+
+ 23 Dec 1999
+ -----------
+
+ * Enabled a status = unresolved option for the web ui. thanks to
+ brandon allbery <allbery@ece.cmu.edu> and Marion Hakanson <hakanson@cse.ogi.edu>
+
+ * Made most of the permissions and directory changes from Marion
+ Hakanson <hakanson@cse.ogi.edu> generally cleaned things up. but DID not
+ include the changes to the directory creation, file copying and permission
+ fixing code to enable RT_VAR_DIR
+
+ * Made the web ui use $MESSAGE_FONT when putting up the compose window.
+ Marion Hakanson <hakanson@cse.ogi.edu>
+
+ * Genericised the templates to not mention the mythical "systems group"
+
+1999-12-19 01:54 jesse
+
+ * Makefile, etc/schema.mysql:
+
+ work on ticket, transaction.
+ schema cleanup
+
+1999-12-18 13:25 jesse
+
+ * etc/schema:
+
+ removed obsolete schema
+
+1999-12-17 01:28 jesse
+
+ * Makefile:
+
+ set version
+
+1999-12-17 01:27 jesse
+
+ * etc/: config.pm, schema.mysql:
+
+ more cleanup. we're getting there. just another zillion hours or so
+
+1999-12-15 23:56 jesse
+
+ * docs/: FAQ, FAQ.html:
+
+ faq updates committed
+
+1999-12-15 23:26 jesse
+
+ * README:
+
+ updates to tobix' additions
+
+1999-12-15 18:32 tobiasb
+
+ * README:
+
+ duh
+
+1999-12-15 18:04 tobiasb
+
+ * README:
+
+ Some few pitfalls mentionated
+
+1999-12-09 00:38 jesse
+
+ * etc/schema.mysql:
+
+ work on Ticket and Transaction.
+ we're getting there.
+
+1999-12-08 03:40 tobiasb
+
+ * etc/suidrt.c:
+
+ bugfixes
+
+1999-12-06 21:41 jesse
+
+ * Makefile, NEWS:
+
+ [no log message]
+
+1999-12-06 06:27 tobiasb
+
+ * Makefile:
+
+ insignificant output fix
+
+1999-12-04 03:30 jesse
+
+ * NEWS, etc/schema.mysql:
+
+ [no log message]
+
+1999-12-04 01:46 jesse
+
+ * NEWS:
+
+ Fixed tobix-induced bug in lib/rt/database/manipulate.pm
+ that'll teach him to make untested fixes to the stable branch.
+
+1999-12-02 13:18 tobiasb
+
+ * etc/schema:
+
+ I'm unfortunately not even half on the way in my merging. I'm in a hurry, some small notes:
+
+ 1.1:
+ - work on dependencies done
+ - work on mail distribution done.
+ - requires sub dist_list
+ - requires sub open_parents
+ - requires sub add_link
+
+ Dependencies & linking in general.
+
+ Mail distribution. The distribution list is set by a &dist_list
+ sub. The transaction mail is never sent out for comments and
+ correspondence, but people who subscribe all transactions will get the
+ comments and correspondence.
+
+1999-12-02 03:10 tobiasb
+
+ * etc/mysql.acl:
+
+ This file is renamed
+
+1999-12-02 03:05 tobiasb
+
+ * etc/: schema.Pg, schema.mysql:
+
+ This file was fucked up, I don't know why. I'll just truncate it for now
+
+1999-12-02 02:56 jesse
+
+ * Makefile:
+
+ bumped version
+
+1999-12-02 02:54 tobiasb
+
+ * etc/schema:
+
+ Added links (dependency + knowledge db)
+
+1999-12-02 01:42 jesse
+
+ * Makefile:
+
+ some makefile cleanup
+
+1999-12-01 23:16 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-12-01 23:10 jesse
+
+ * bin/rtmux.pl, etc/schema.mysql:
+
+ mots of work on the new backend.
+ cliadmin is mostly up to date.
+ no, i haven't run any of the code :)
+
+1999-11-30 21:52 jesse
+
+ * etc/: acl.Pg, schema.mysql:
+
+ [no log message]
+
+1999-11-23 17:21 jesse
+
+ * docs/design_docs/CARS:
+
+ file CARS was initially added on branch rt-1-1.
+
+1999-11-23 17:21 jesse
+
+ * README, docs/design_docs/CARS, etc/schema.mysql:
+
+ schema hacking for rt-1-1 features.
+
+1999-11-18 21:40 jesse
+
+ * Makefile, Makefile, Makefile:
+
+ [no log message]
+
+1999-11-17 17:36 tobiasb
+
+ * NEWS:
+
+ merged in changes from 1.0
+
+1999-11-16 23:09 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-11-08 20:54 jesse
+
+ * NEWS:
+
+ fixed a longstanding bug in cli/query
+
+1999-11-08 18:02 jesse
+
+ * Makefile, NEWS, etc/config.pm:
+
+ [no log message]
+
+1999-11-05 03:50 tobiasb
+
+ * Makefile, NEWS, README, bin/initacls.mysql, bin/initdb.mysql,
+ etc/acl.mysql, etc/config.pm:
+
+ patch from khamer integrated - no testing done, however
+
+1999-10-22 14:09 tobiasb
+
+ * etc/schema:
+
+ merged 1.1-changes
+
+1999-10-22 12:14 tobiasb
+
+ * NEWS, etc/mysql.acl, etc/schema:
+
+ Merged in changes from 1.0. I haven't checked that things works quite well, anyway.
+
+1999-10-21 16:21 jesse
+
+ * Makefile, NEWS:
+
+ changes to date_diff, some of the oldest code in RT
+
+1999-10-21 07:07 tobiasb
+
+ * docs/actions.txt, docs/admin.txt, docs/attributes.txt,
+ docs/outline.txt, docs/rt_users_guide.html, etc/config.pm:
+
+ merged from 1.0
+
+1999-10-20 23:16 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-10-20 22:25 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-10-20 21:58 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-10-20 21:43 jesse
+
+ * Makefile, NEWS:
+
+ [no log message]
+
+1999-10-20 10:33 tobiasb
+
+ * Makefile, NEWS, README, README.91UPGRADE, TODO,
+ bin/initacls.mysql, bin/initdb.mysql, docs/README.docs:
+
+ Merged 1.0-development into 1.1
+
+1999-10-20 01:23 jesse
+
+ * Makefile, NEWS:
+
+
+ 20 Oct 1999
+ -----------
+ * RT now uses a queue's mail alias when sending mail.
+
+1999-10-20 00:44 jesse
+
+ * Makefile, NEWS:
+
+
+ 20 Oct 1999
+ -----------
+
+ * Using the web UI to send correspondence should no longer not
+ sent the correspondence if there are CCs, BCCs or the actor is
+ the same as the requestor. thanks to <douglas@arepa.com> for
+ pointing out the deficiency.
+
+1999-10-13 19:32 jesse
+
+ * Makefile, TODO:
+
+ Released version 1.0 Updated the TODO file.
+
+1999-10-06 18:01 jesse
+
+ * Makefile:
+
+ bumped version
+
+1999-10-06 17:57 jesse
+
+ * Makefile, NEWS, README, docs/README.docs:
+
+ [no log message]
+
+1999-10-06 17:48 jesse
+
+ * docs/: FAQ, FAQ.html, README.docs, actions.html, actions.txt,
+ admin.html, admin.txt, attributes.html, attributes.txt,
+ outline.html, outline.txt, rt_users_guide.html:
+
+ major documentation updates from mbrader
+
+1999-10-04 14:22 jesse
+
+ * Makefile, NEWS:
+
+ bumped the version to 1.0.0pre2
+
+1999-10-01 01:39 jesse
+
+ * Makefile:
+
+ fixed a makefile typo
+
+1999-10-01 01:37 jesse
+
+ * NEWS, README, README.91UPGRADE:
+
+ updated readme
+
+1999-10-01 01:07 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-10-01 00:22 jesse
+
+ * NEWS, etc/config.pm:
+
+
+ 30 Sep 1999
+ -----------
+
+ * Fixed a bug which caused RT to go crazy when comments were submitted
+ by may without a ticket #.
+
+ The following changes are from johnl@microware.com
+
+ 1. Directories were not getting created with the correct modes under /usr/local/rt/transactions. The umask() takes an octal file mode mask, not a file mode. In addition I read the comments about $dirmode not working when doing the mkdir's in content.pm. I also fixed content.pm to use $dirmode. The main problem was the $dirmode was being set to a string instead of an octal number.
+
+ Fixes to database.pm
+ 1. The first hunk fixes problem where the call to write_content is passing $time. This variable does not exist. It looked like $time was supposed to be the current time. ($time always == 0). I changed all occurances of $time to time (IE: time()). 2. The first hunk also passes $in_time instead of $time. 3. The rest of the hunks fix $time and replace them with time().
+
+ 27 Sep 1999
+ -----------
+ Fixed a bug which caused the priority not to get set to the default
+ when requests were created in the webui. Thanks to <Elmar.Knipp@knipp.de>
+
+1999-09-23 23:16 anoncvs
+
+ * Makefile:
+
+ [no log message]
+
+1999-09-23 23:09 anoncvs
+
+ * Makefile, Makefile:
+
+ [no log message]
+
+1999-09-23 23:07 anoncvs
+
+ * Makefile:
+
+ [no log message]
+
+1999-09-23 23:01 anoncvs
+
+ * Makefile:
+
+ [no log message]
+
+1999-09-23 22:52 anoncvs
+
+ * Makefile:
+
+ [no log message]
+
+1999-08-08 22:20 tobiasb
+
+ * etc/schema:
+
+ ups
+
+1999-08-07 02:27 tobiasb
+
+ * etc/schema:
+
+ in-work
+
+1999-08-04 02:48 tobiasb
+
+ * Makefile, NEWS:
+
+ Merge
+
+1999-08-03 22:38 jesse
+
+ * NEWS:
+
+ first cut of -trans
+
+1999-08-03 22:27 jesse
+
+ * Makefile, NEWS:
+
+ reved the version to .99.9. tiny mail manipulate fix
+
+1999-08-03 11:31 tobiasb
+
+ * bin/initdb.mysql:
+
+ file initdb.mysql was initially added on branch rt-1-1.
+
+1999-08-03 11:31 tobiasb
+
+ * bin/initdb.Pg:
+
+ file initdb.Pg was initially added on branch rt-1-1.
+
+1999-08-03 11:31 tobiasb
+
+ * bin/initacls.mysql:
+
+ file initacls.mysql was initially added on branch rt-1-1.
+
+1999-08-03 11:31 tobiasb
+
+ * bin/: initacls.Pg, initacls.mysql, initdb.Pg, initdb.mysql:
+
+ Scripts for initing the DB
+
+1999-08-03 11:31 tobiasb
+
+ * bin/initacls.Pg:
+
+ file initacls.Pg was initially added on branch rt-1-1.
+
+1999-08-03 10:31 tobiasb
+
+ * etc/schema.mysql:
+
+ file schema.mysql was initially added on branch rt-1-1.
+
+1999-08-03 10:31 tobiasb
+
+ * etc/schema.Pg:
+
+ file schema.Pg was initially added on branch rt-1-1.
+
+1999-08-03 10:31 tobiasb
+
+ * etc/acl.mysql:
+
+ file acl.mysql was initially added on branch rt-1-1.
+
+1999-08-03 10:31 tobiasb
+
+ * etc/acl.Pg:
+
+ file acl.Pg was initially added on branch rt-1-1.
+
+1999-08-03 10:31 tobiasb
+
+ * Makefile, etc/acl.Pg, etc/acl.mysql, etc/mysql.acl, etc/schema,
+ etc/schema.Pg, etc/schema.mysql:
+
+ More work on the move to a DBMS-independent RT. The Makefile and executables _really_ need some testing and eventually debugging.
+
+1999-08-03 02:14 tobiasb
+
+ * Makefile, etc/config.pm:
+
+ It seems to me that I've somehow managed to go to DBI...WebRT seems to work locally, but that's the only testing I've done
+
+1999-08-02 07:07 tobiasb
+
+ * etc/schema:
+
+ in-work
+
+1999-07-29 02:55 tobiasb
+
+ * etc/schema:
+
+ uuuurghh
+
+1999-07-28 10:42 tobiasb
+
+ * README:
+
+ One small update on the work to link requests...
+
+1999-07-27 07:08 tobiasb
+
+ * NEWS:
+
+ 1.0-gospel
+
+1999-07-27 06:48 tobiasb
+
+ * etc/schema:
+
+ asdfjlsadfhjkhdfawhi
+
+1999-07-26 21:21 jesse
+
+ * Makefile, NEWS:
+
+ fixes to the mail gateway header handling
+ added cli rtq flags to the help
+
+1999-07-26 07:03 tobiasb
+
+ * NEWS:
+
+ Merge
+
+1999-07-24 20:43 jesse
+
+ * Makefile:
+
+ bumpted the version
+
+1999-07-24 20:40 jesse
+
+ * NEWS:
+
+ added a few options to the cli query engine. area limitying and display of due dates.
+
+1999-07-23 03:20 tobiasb
+
+ * NEWS:
+
+ Some merges
+
+1999-07-23 02:56 tobiasb
+
+ * etc/schema:
+
+ With generic links
+
+1999-07-22 23:13 jesse
+
+ * Makefile, NEWS:
+
+ 22 Jul 99 (Jesse)
+ -----------------
+ Inital cleanup to the web ticket view. I'd like to significantly
+ compact and simplify that display. More tables are probably in
+ order. Additionally, I want to get rid of all those buttons "I
+ changed this." There's just no need for them. we can write logic
+ to do that for us. Also, I bumped the version to 1.1.1. I'd like
+ to do this 'linux-kernel-esque' The 1.1.x
+ series will be a development series leading toward 1.2. Once we
+ get the DB changes in, I'll feel comfortable rolling a 'releaseable'
+ 1.1 version for people who like pain.
+
+1999-07-21 23:47 jesse
+
+ * Makefile, NEWS:
+
+ 21 July 1999
+ ------------
+
+ Fix for [fsck #102] Better checks in is_not_a_requestor. this should fix
+ issues with external users being equated with queue members.
+
+ Fix for [fsck #114] Comment from bin/rt was accidentaly access controlled.
+
+ Fix for [fsck #113] Display of requests users can't manipulate should now give
+ ian error
+
+1999-07-20 23:40 tobiasb
+
+ * etc/schema:
+
+ For a general way of linking WebRT requests to other web-based DBs
+
+1999-07-20 21:42 tobiasb
+
+ * NEWS:
+
+ [no log message]
+
+1999-07-20 21:11 tobiasb
+
+ * NEWS:
+
+ Hmf.
+
+1999-07-20 21:07 tobiasb
+
+ * README, etc/config.pm:
+
+ updated for Internet::Mail
+
+1999-07-20 21:01 tobiasb
+
+ * Makefile:
+
+ updated for Internet::Mail
+
+1999-07-20 01:21 jesse
+
+ * NEWS:
+
+ Fix for [fsck #88] WebUI area SELECT bug.
+
+ Fix for [fsck #90] A small html bug in WebRT
+
+ Fix for [fsck #92] "Allow non-members to create requests" appeared twice
+ in the WebAdmin
+
+ Fix for [fsck #94] web ui forms are now 78 chars wide
+
+1999-07-20 00:09 jesse
+
+ * NEWS:
+
+ 19 July 1999
+ ------------
+ Fix for [fsck #104] We no longer try to reset the user's uid after writing
+ transaction content to the filesystem. This should help out Net/OpenBSD
+ compatibility
+
+ Removed some legacy support for glimpse searching
+
+ Fix for [fsck #115] The web ticket list should now wrap reasonably, so it's
+ printable.
+
+1999-07-19 03:26 tobiasb
+
+ * NEWS:
+
+ some updates
+
+1999-07-17 13:14 tobiasb
+
+ * NEWS:
+
+ Updated a bit
+
+1999-07-16 23:42 tobiasb
+
+ * Makefile:
+
+ Version number 1.pre1.1 - what do you think about it?
+
+1999-07-16 22:49 tobiasb
+
+ * bin/rtmux.pl:
+
+ Filled in a missing comment
+
+1999-07-16 22:46 tobiasb
+
+ * Makefile:
+
+ Set version to 1.1.0pre1, and changed /opt/rt to /usr/local/rt, I'd
+ daresay the next is more widely preffered.
+
+1999-07-16 18:36 tobiasb
+
+ * COPYING, Makefile, NEWS, README, README.91UPGRADE, TODO,
+ bin/rtmux.pl, docs/FAQ, docs/FAQ.html, docs/README.docs,
+ docs/actions.html, docs/actions.txt, docs/admin.html,
+ docs/admin.txt, docs/attributes.html, docs/attributes.txt,
+ docs/outline.html, docs/outline.txt, etc/config.pm, etc/mysql.acl,
+ etc/schema, etc/suidrt.c:
+
+ Imported Tobix' current version
+
+1999-07-08 02:10 jesse
+
+ * Makefile, NEWS, TODO:
+
+ Rolled .99.8
+
+1999-07-07 15:37 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-07-07 00:45 jesse
+
+ * Makefile, NEWS:
+
+ updated makefile and news.
+
+1999-07-06 22:58 jesse
+
+ * NEWS:
+
+ 6 Jul 99
+ --------
+ Now, if you move a request to a new queue, it won't disown it if the same person can own reqs in the new queue. [fsck #75] (untested)
+
+ Fixed a problem with cli create not properly handling due dates ([fsck #67])
+ Fixed a duplicate --help entry for bin/rt [fsck #69]
+ Fixed bugs fsck #68/77: Odness Merging RT requests
+
+ Transactions from merged requests will now be displayed along with the request id of the request that transaction was originially associated with.
+
+ Fixed [fsck #74], which was reported by charlie brady:
+ Messages are sent out from the mail interface with content first, then
+ "--- Headers Follow ---", then the headers. In our vanilla sendmail setup,
+ before the headers is a UUCP style deliver notification "From blah Tue Jul
+ 6 18:13:01 1999" line. This is interpreted by many mail agents as a
+ message delimiter, so that what is seen in the mail agent is not one, but
+ two messages. This is easily fixed by using the conventional quoting
+ mechanism...
+ Fixed [fsck #71] WebRT: "User" should be "Requestor"
+
+1999-07-06 21:35 jesse
+
+ * NEWS:
+
+ resovled #71, #74. worked on merge functionality
+
+1999-06-29 17:39 jesse
+
+ * Makefile, NEWS:
+
+ [no log message]
+
+1999-06-29 17:20 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-06-24 00:52 jesse
+
+ * Makefile, NEWS, README, TODO:
+
+ lots of touchups.
+
+1999-06-23 23:29 jesse
+
+ * NEWS:
+
+ moved to CGI.pm's form parser.
+
+1999-06-17 01:49 jesse
+
+ * NEWS:
+
+ edited news
+
+1999-06-16 23:21 jesse
+
+ * Makefile, NEWS:
+
+ Fixed an auth bug.
+
+1999-06-15 02:13 jesse
+
+ * Makefile:
+
+ upped the version to .99.8pre5
+
+1999-06-15 02:09 jesse
+
+ * Makefile, NEWS:
+
+ lots of misc changes. see the diff to the news file
+
+1999-05-12 20:37 jesse
+
+ * Makefile, NEWS:
+
+ cookies hacked to deal with the fact that netscape can't handle path=/
+
+1999-05-12 01:57 jesse
+
+ * Makefile:
+
+ bumped the version number to .99.8pre3
+
+1999-05-12 01:56 jesse
+
+ * NEWS:
+
+ Made error messages on the web admin interface more prominent.
+
+ All the following changes are from tobix:
+
+ Correspondence from RT now properly reflect the name of the sender
+ in the "from" header.
+
+ Automated messages now properly have a "Precedence: bulk" header
+
+ A stupid error with rt::mail_alias has been fixed
+
+ Tobix' patch removes headers from all correspondence. I'm relatively
+ afraid of this change, so I'm going to comment it out for now.
+
+ rtadmin (the commandline has a new tool) :
+ -update <passwd> <admin> [<users>] updates user(s) from the
+ /etc/passwd file. If no users are specified, ALL
+ of /etc/passwd will be processed.
+
+1999-05-11 16:46 jesse
+
+ * Makefile, NEWS, README:
+
+ mail loop fix from toby
+
+1999-05-09 20:35 jesse
+
+ * Makefile:
+
+ bumped version numbers
+
+1999-05-09 20:35 jesse
+
+ * Makefile, NEWS, README:
+
+ updated makefile and news
+
+1999-05-09 20:17 jesse
+
+ * bin/rtmux.pl:
+
+ modifications to cookies support to md5 hash the password.
+ modification to allow non-nph web ui
+
+1999-05-05 02:39 jesse
+
+ * NEWS:
+
+ fixed some cookies/frames problems
+
+1999-05-05 02:10 jesse
+
+ * Makefile, NEWS:
+
+ fixed bugs in web auth from charlie brady
+
+1999-05-03 21:44 jesse
+
+ * Makefile:
+
+ bumped the version #
+
+1999-04-28 16:03 jesse
+
+ * Makefile:
+
+ bumped version
+
+1999-04-28 16:03 jesse
+
+ * NEWS:
+
+ updated content.pm to spit errors.
+
+1999-04-27 02:58 jesse
+
+ * Makefile:
+
+ downed the makefile version
+
+1999-04-27 02:57 jesse
+
+ * Makefile:
+
+ fixed a makefile bug
+
+1999-04-26 21:57 jesse
+
+ * NEWS, README:
+
+ added configuration info about mod_auth_mysql
+
+1999-04-26 21:45 jesse
+
+ * Makefile, etc/config.pm:
+
+ Updated authetication stuff with patches from ingo. updated them further.
+ Added the ability to configure whether external authentication is done for webrt
+ added the ability to turn off ie compatibility mode
+
+1999-04-23 19:31 jesse
+
+ * Makefile, NEWS, README, TODO:
+
+ started to update the README and Makefile
+
+1999-04-13 04:00 jesse
+
+ * Makefile:
+
+ fixed totally fuxored makefile
+
+1999-04-13 03:28 jesse
+
+ * README:
+
+ noted that there's a dependency on gnu make
+
+1999-04-13 03:07 jesse
+
+ * Makefile:
+
+ bumped version
+
+1999-04-13 03:06 jesse
+
+ * NEWS:
+
+ updated news
+
+1999-04-08 04:36 jesse
+
+ * docs/rt.gif:
+
+ added the gif to the docs
+
+1999-04-08 04:35 jesse
+
+ * NEWS:
+
+ fixes for new mysql modules
+
+1999-04-07 23:57 jesse
+
+ * NEWS:
+
+ updates
+
+1999-04-07 02:14 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-04-07 02:09 jesse
+
+ * Makefile, README:
+
+ fixes for cookie auth from charlie brady
+
+1999-04-06 06:30 jesse
+
+ * Makefile, NEWS, README:
+
+ misc changes to support cookie authentication
+
+1999-04-03 04:57 jesse
+
+ * NEWS, docs/FAQ, docs/FAQ.html, docs/README.docs,
+ docs/actions.html, docs/actions.txt, docs/admin.html,
+ docs/admin.txt, docs/attributes.html, docs/attributes.txt,
+ docs/outline.html, docs/outline.txt:
+
+ major update of the docs from adam.
+
+1999-04-03 04:49 jesse
+
+ * Makefile:
+
+ makefile hackery to ease installs slightly.
+
+1999-03-21 20:24 jesse
+
+ * Makefile:
+
+ updated makefile
+
+1999-03-21 20:22 jesse
+
+ * NEWS, README:
+
+ mail changes
+
+1999-03-08 14:50 jesse
+
+ * NEWS:
+
+ turned off the troll
+
+1999-03-08 14:02 jesse
+
+ * Makefile:
+
+ fixed makefile bogosity for ACLs
+
+1999-03-04 01:50 jesse
+
+ * Makefile, NEWS:
+
+ fixed a subject line parsing error.
+
+1999-02-26 22:29 jesse
+
+ * NEWS:
+
+ added a check to make sure you don't merge ar equest into a non-existent other request
+
+1999-02-26 21:43 jesse
+
+ * README.91UPGRADE, README.FIRST, TODO:
+
+ moved readme.fdirst to readmne.91upgrade
+
+1999-02-26 19:59 jesse
+
+ * Makefile, NEWS:
+
+ updated makefile: added upgrade-noclobber
+
+1999-02-24 19:11 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-02-23 14:41 jesse
+
+ * NEWS:
+
+ updated bnews
+
+1999-02-23 03:20 jesse
+
+ * docs/: actions.txt, admin.txt, attributes.txt:
+
+ added updates for adam for the docs.
+
+ updated the news
+
+1999-02-23 03:20 jesse
+
+ * NEWS:
+
+ updated the news
+
+1999-02-21 01:56 jesse
+
+ * Makefile:
+
+ fixed the .4
+
+1999-02-21 01:53 jesse
+
+ * Makefile:
+
+ fixed make pre
+
+1999-02-20 23:27 jesse
+
+ * Makefile:
+
+ addded back predist
+
+1999-02-20 16:36 jesse
+
+ * NEWS:
+
+ edited the news to reflect changes
+
+1999-02-20 14:56 jesse
+
+ * Makefile, NEWS:
+
+ bumped the version to .99.4 for testing.
+
+1999-02-20 14:48 jesse
+
+ * etc/mysql.acl:
+
+ updated acls so they'll work with newer versions of mysql 3.22
+
+1999-01-20 02:21 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1999-01-20 02:13 jesse
+
+ * Makefile:
+
+ On another note, here is a fix for the "HTML turd" reported by Benji
+ Cline in lib/rt/ui/web/forms.pm:
+ ========== diff -r0.99.2 forms.pm
+ 87c87 < $u = 0;
+ --- > $u = 1;
+ 91c91 < $u = 1; --- > $u = 0;
+ ==========
+
+ With this patch applied, v0.99.2 (0.99.3?) appears to be as solid as v0.9.18, if not more
+ so.
+
+ Upgraded the version to .99.3
+
+1999-01-16 20:44 jesse
+
+ * NEWS:
+
+ [no log message]
+
+1999-01-16 20:39 jesse
+
+ * Makefile:
+
+ fixed a web acls bug. incremented the version.
+
+1999-01-16 01:22 jesse
+
+ * Makefile:
+
+ bumped version to .99.1
+
+1999-01-16 01:20 jesse
+
+ * Makefile, NEWS:
+
+ fixed some web admin sillyness..acls work better.
+ we no longer dump back to the main menu quite as gratuitously.
+ acls are no longer broken on the CLI either.
+
+1998-12-16 01:31 jesse
+
+ * Makefile:
+
+ fixed the following things:
+
+ From owner-rt-users@horked.fsck.com Tue Nov 24 02:24:03 1998
+ Return-Path: <owner-rt-users@lists.fsck.com>
+ Received: (from majordomo@localhost)
+ by horked.fsck.com (8.8.7/8.8.7) id CAA11181
+ for rt-users-outgoing; Tue, 24 Nov 1998 02:24:01 -0500
+ X-Authentication-Warning: horked.fsck.com: majordomo set sender to owner-rt-users@lists.fsck.com using -f
+ Received: from modgud.nordicdms.com (h21-168-107.nordicdms.com [207.21.168.107] (may be forged))
+ by horked.fsck.com (8.8.7/8.8.7) with SMTP id CAA11177
+ for <rt-users@lists.fsck.com>; Tue, 24 Nov 1998 02:23:58 -0500
+ Received: (qmail 6211 invoked by alias); 24 Nov 1998 07:25:59 -0000
+ Message-ID: <19981124072559.6209.qmail@modgud.nordicdms.com>
+ Received: (qmail 6197 invoked from network); 24 Nov 1998 07:25:59 -0000
+ Received: from mail-ftp.nordicdms.com (HELO mail-ftp) (207.21.168.100)
+ by mail.nordicdms.com with SMTP; 24 Nov 1998 07:25:59 -0000
+ From: "Dave Walton" <walton@nordicdms.com>
+ Organization: Nordic Entertainment Worldwide
+ To: Jesse <jrvincent@wesleyan.edu>, rt-users@lists.fsck.com
+ Date: Mon, 23 Nov 1998 23:25:58 -0800
+ MIME-Version: 1.0
+ Content-type: text/plain; charset=US-ASCII
+ Content-transfer-encoding: 7BIT
+ Subject: Two bugfixes
+ Reply-to: walton@nordicdms.com
+ In-reply-to: <19981013013318.H18644@horked.fsck.com>
+ References: <19981013042506.9798.qmail@modgud.nordicdms.com>; from Dave Walton on Mon, Oct 12, 1998 at 09:25:06PM -0700
+ X-mailer: Pegasus Mail for Win32 (v3.01d)
+ Sender: owner-rt-users@lists.fsck.com
+ Precedence: bulk
+
+ 1. A backwards search was causing lib/rt/ui/web/support.pm to
+ crash when data that looks like an invalid regex is present in the
+ message headers.
+ ------------------------------------------------------------
+ # diff support.old.pm support.pm
+ 44c44
+ < ($headers_ignore !~ /$field/i)) {
+ ---
+ > ($field !~ /$headers_ignore/i)) {
+ ------------------------------------------------------------
+
+ 2. HTML buglet in lib/rt/ui/web/manipulate.pm.
+ ------------------------------------------------------------
+ # diff manipulate.old.pm manipulate.pm
+ 894c894
+ < <font color=\"\$fg_color\">
+ ---
+ > <font color=\"$fg_color\">
+ ------------------------------------------------------------
+
+ Dave
+
+ ----------------------------------------------------------------------
+ Dave Walton
+ Webmaster, Postmaster Nordic Entertainment Worldwide
+ walton@nordicdms.com http://www.nordicdms.com
+ ----------------------------------------------------------------------
+
+ From benji@hnt.com Fri Nov 20 14:28:44 1998
+ Return-Path: <benji@hnt.com>
+ Received: from horked.fsck.com (jesse@localhost [127.0.0.1])
+ by horked.fsck.com (8.8.7/8.8.7) with ESMTP id OAA04739
+ for <jesse@localhost>; Fri, 20 Nov 1998 14:28:44 -0500
+ Received: from mail.wesleyan.edu
+ by horked.fsck.com (fetchmail-4.3.2 POP3 run by jrvincent)
+ for <jesse@localhost> (single-drop); Fri Nov 20 14:28:44 1998
+ Received: from columbus.hnt.com (columbus.hnt.com [208.221.11.10]) by mail.wesleyan.edu (8.8.6/8.7.3) with ESMTP id OAA18408 for <jrvincent@wesleyan.edu>; Fri, 20 Nov 1998 14:30:34 -0500 (EST)
+ Received: from peppermint.hnt.com (peppermint.hnt.com [208.221.11.51])
+ by columbus.hnt.com (8.9.1/8.9.1/HnT-980729) with ESMTP id OAA26134
+ for <jrvincent@wesleyan.edu>; Fri, 20 Nov 1998 14:30:32 -0500 (EST)
+ Received: from localhost by peppermint.hnt.com (8.9.1/8.9.1/HnT-nullclient-980724) with ESMTP id OAA02733
+ for <jrvincent@wesleyan.edu>; Fri, 20 Nov 1998 14:30:32 -0500 (EST)
+ X-Authentication-Warning: peppermint.hnt.com: benji owned process doing -bs
+ Date: Fri, 20 Nov 1998 14:30:31 -0500 (EST)
+ From: Benjamin Cline <benji@hnt.com>
+ To: Jesse <jrvincent@mail.wesleyan.edu>
+ Subject: Re: 0.9.20 is out
+ In-Reply-To: <19981120005718.F28841@horked.fsck.com>
+ Message-ID: <Pine.GSO.4.05.9811201427100.2438-100000@peppermint.hnt.com>
+ MIME-Version: 1.0
+ Content-Type: TEXT/PLAIN; charset=US-ASCII
+ X-UIDL: 4f1695a69f7cdbefcfce9198121fef95
+
+ I think I've found a buglet in 0.9.20, I had to add an extra curly bracket
+ ("}") to the end of lib/rt/database/admin.pm (just before the "1;") to get
+ it to work right.
+
+ benji
+
+ P.S. Sorry if that's not the most coherent bug report/fix, I'm afraid I'm
+ not much of a perl hacker.
+
+ On Fri, 20 Nov 1998, Jesse wrote:
+
+ > ftp://horked.fsck.com/pub/rt/devel/rt-0.9.20.tar.gz
+ >
+ > 19 Nov 98
+ > ---------
+ >
+ > Incorportated patches from Dave Walton to fix a typo, replace an
+ > accidentally
+ > blown away library and add a "last acted" column to the web ui.
+ > incremented version to .9.20
+ >
+ >
+ > jesse
+ >
+ > --
+ > jesse reed vincent -- jrvincent@wesleyan.edu -- jesse@fsck.com
+ > pgp keyprint: 50 41 9C 03 D0 BC BC C8 2C B9 77 26 6F E1 EB 91
+ > --------------------------------------------------------------
+ > They'll take my private key when they pry it from my cold dead fingers!
+ >
+
+ --
+ Benjamin R. Cline Harrison & Troxell, Inc. benji@hnt.com
+ Quis Custodiet Ipsos Custodes?
+
+ From adam@baz.org Fri Nov 13 17:07:09 1998
+ Return-Path: <adam@baz.org>
+ Received: from horked.fsck.com (jesse@localhost [127.0.0.1])
+ by horked.fsck.com (8.8.7/8.8.7) with ESMTP id RAA10943
+ for <jesse@localhost>; Fri, 13 Nov 1998 17:07:09 -0500
+ Received: from mail.wesleyan.edu
+ by horked.fsck.com (fetchmail-4.3.2 POP3 run by jrvincent)
+ for <jesse@localhost> (single-drop); Fri Nov 13 17:07:09 1998
+ Received: from impei.baz.org (adam@impei.baz.org [139.167.64.229]) by mail.wesleyan.edu (8.8.6/8.7.3) with ESMTP id RAA08425 for <jrvincent@wesleyan.edu>; Fri, 13 Nov 1998 17:08:38 -0500 (EST)
+ Received: (from adam@localhost)
+ by impei.baz.org (8.8.7/8.8.8) id RAA18674
+ for jrvincent@wesleyan.edu; Fri, 13 Nov 1998 17:08:38 -0500
+ Message-ID: <19981113170837.A18668@baz.org>
+ Date: Fri, 13 Nov 1998 17:08:37 -0500
+ From: secret agent man <adam@baz.org>
+ To: "J.R.Ewing" <jrvincent@mail.wesleyan.edu>
+ Subject: RT bug, mebbe?
+ Mime-Version: 1.0
+ X-Mailer: Mutt 0.93.2i
+ Content-Type: text/plain; charset=us-ascii
+ X-UIDL: 5563064ca159a5eee88e16843932a45f
+
+ <jailbait> q: If you leave the field blank when clicking on "create new
+ (queue|user) named", it goes to the create screen with an empty field that
+ can't be filled. It should either be editable there or it should reject
+ you.
+
+ A
+
+ --
+ Everything I needed to know about life I learned <adam@baz.org>
+ from killing smarter people and eating their brains. adam hirsch
+
+1998-11-20 00:45 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-11-20 00:28 jesse
+
+ * Makefile, NEWS:
+
+ 19 Nov 98
+ ---------
+
+ Incorportated patches from Dave Walton to fix a typo, replace an accidentally
+ blown away library and add a "last acted" column to the web ui.
+ incremented version to .9.20
+
+1998-11-18 02:26 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-10-13 03:37 jesse
+
+ * Makefile, README, etc/mysql.acl:
+
+ shiny:% cat >> changes ~ 10:53PM:tt
+ 2. Made comments and replies update date_acted.
+
+ -- Dave Walton
+
+ Ok.. I know this is being picky, but, in rt/lib/ui/web/support.pm, the
+ subroutine "content_header", at line 290, should have:
+ print "<head><title>WebRT</title></head>\n";
+
+ Otherwise, when running in frames, you never get a title on the page. :(
+
+ No biggie...
+
+ -Rich
+
+ Oh, one other.
+
+ 8. etc/mysql.acl, line 5
+ The RT_MYSQL_HOST entry on that line doesn't make any sense
+ when MySQL is on a different host than RT. That should be
+ RT_HOST, or some such thing.
+
+ Dave
+
+ After just upgrading to Apache 1.3.0 from 1.2.5, I figured I would make it
+ known that, in the file <apache_src_dir>/src/main/util_script.c, you have
+ to define SECURITY_HOLE_PASS_AUTHORIZATION to allow for RT's authorization
+ to work properly.
+ -Rich
+
+ On Tue, Oct 06, 1998 at 09:19:07PM -0700, Dave Walton wrote:
+ > I just discovered that if there is an error in add_correspondence, the
+ > mail interface discards the incoming mail without comment. To
+ > correct this, I took the following steps:
+ >
+ In mail.pm, there's a space before :
+
+ From: $rt::mail_alias
+
+ This causes problems in some mail clients, putting the From: line on the
+ same line as the subject. If the spaces are removed this is fixed.
+
+ Regards,
+ From: "Andrew Foster" <adf@fl.net.au>
+
+1998-09-11 01:15 jesse
+
+ * docs/README.docs:
+
+ updated lists for rt docs.
+
+1998-09-08 03:23 jesse
+
+ * NEWS:
+
+ updated news
+
+1998-09-08 03:18 jesse
+
+ * Makefile, NEWS, README, etc/config.pm:
+
+ Final bug fixes for .9.18
+
+1998-08-09 17:43 jesse
+
+ * NEWS, README, TODO:
+
+ All kinds of crazy updates for .9.18. Mostly from serge zhuk
+
+1998-08-04 03:09 jesse
+
+ * NEWS:
+
+ first round of updates from serge
+
+1998-06-26 17:07 jesse
+
+ * Makefile, NEWS:
+
+ modified makefile and news
+
+1998-06-26 16:34 jesse
+
+ * docs/: README.docs, actions.txt, admin.txt, attributes.txt,
+ outline.txt:
+
+ Added documentation from <adam@apocalypse.org>
+
+1998-06-25 17:06 jesse
+
+ * Makefile, README, etc/config.pm:
+
+ removed refs to glimpse
+
+1998-06-25 15:46 jesse
+
+ * Makefile:
+
+ dist fixes
+
+1998-06-25 15:44 jesse
+
+ * Makefile:
+
+ dist fixes
+
+1998-06-25 14:09 jesse
+
+ * Makefile:
+
+ edited dist. maker
+
+1998-05-21 22:40 jesse
+
+ * Makefile:
+
+ added httpd.conf configurator for cern
+
+1998-04-27 20:17 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-04-20 14:53 jesse
+
+ * Makefile:
+
+ bumped version to .9.14.
+
+1998-04-20 14:53 jesse
+
+ * Makefile:
+
+ bumped version to .9.13.1
+
+1998-04-19 03:14 jesse
+
+ * Makefile:
+
+ updated version number.
+ now explicitly create rt-etc-dir
+
+1998-04-16 21:40 jesse
+
+ * bin/rtmux.pl:
+
+ removed a spurious addition to the lib path from the mux
+ abstracted a bunch of stuff out of the mux and throughout the makefile.
+ like program names.
+
+1998-04-16 21:39 jesse
+
+ * Makefile:
+
+ abstracted a bunch of stuff out of the mux and throughout the makefile.
+ like program names.
+
+1998-04-16 19:47 jesse
+
+ * COPYING, Makefile, NEWS, README, README.FIRST, TODO:
+
+ commiting updates
+
+1998-04-08 13:35 jesse
+
+ * etc/config.pm:
+
+ fixed typos in config.pm that prevented mail from working with .9.11
+ bumped version to .12
+
+1998-04-08 13:34 jesse
+
+ * Makefile:
+
+ bumped version to .12
+
+1998-04-02 21:30 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-04-02 21:27 jesse
+
+ * Makefile:
+
+ fixed make dist
+
+1998-04-02 15:36 jesse
+
+ * Makefile, Makefile:
+
+ [no log message]
+
+1998-04-02 15:29 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-04-02 15:25 jesse
+
+ * etc/config.pm:
+
+ split mail program and mail program flags
+ hopefully fixed make dist
+
+1998-04-02 15:25 jesse
+
+ * Makefile:
+
+ hopefully fixed make dist
+
+1998-04-02 11:02 jesse
+
+ * Makefile, NEWS:
+
+ updated news
+
+1998-04-02 10:55 jesse
+
+ * Makefile:
+
+ [no log message]
+
+1998-04-02 10:31 jesse
+
+ * etc/config.pm:
+
+ reshuffled files that the user won't be changing out of etc and into lib
+ this includes generic templates and images for the web ui
+ updated src and makefiles accordingly.
+ verbosifoed part of config.pm
+
+1998-04-02 10:31 jesse
+
+ * Makefile:
+
+ reshuffled files that the user won't be changing out of etc and into lib
+ this includes generic templates and images for the web ui
+ updated src and makefiles accordingly.
+
+1998-04-02 10:20 jesse
+
+ * Makefile:
+
+ built more auto-dist stuff
+
+1998-04-02 03:22 jesse
+
+ * README:
+
+ added apache patch to readme
+
+1998-04-02 03:13 jesse
+
+ * Makefile, README, TODO, etc/config.pm:
+
+ updated makefile and readme and todo
+ added toggle for mysql 3.21
+ moved sendmail flags to makefile for compat w 8.6
+
+1998-02-08 21:12 jesse
+
+ * Makefile:
+
+ make upgrade now calls mux-install
+
+1998-01-30 22:31 jesse
+
+ * Makefile, README, README.FIRST:
+
+ added bits to upgrade from .9.1
+ made make upgrade upgrade the conf file
+
+1998-01-27 01:56 jesse
+
+ * NEWS:
+
+ updated news
+
+1998-01-27 01:48 jesse
+
+ * Makefile:
+
+ started a make dist
+
+1998-01-26 17:59 jesse
+
+ * Makefile, README, README.FIRST:
+
+ updated readme
+
+1998-01-21 18:37 jesse
+
+ * Makefile:
+
+ fixes to makefile to allow for proper specification of database as local.
+ added "you are logged in as..." to web/support...
+ changed sendmail options in mail.pm/
+
+1998-01-14 23:49 jesse
+
+ * Makefile, etc/mysql.acl:
+
+ incremented version number
+
+1998-01-09 14:48 jesse
+
+ * bin/rtmux.pl:
+
+ added taint safeness for $ENV{'ENV}
+ updated makefile version number
+
+1998-01-09 14:47 jesse
+
+ * Makefile:
+
+ updated makefile version number
+
+1998-01-08 16:17 jesse
+
+ * README.FIRST:
+
+ ipdated readme.first.
+
+1998-01-08 14:53 jesse
+
+ * etc/suidrt.c:
+
+ made suidrt.c work
+ updated the mux
+
+1998-01-08 14:53 jesse
+
+ * bin/rtmux.pl:
+
+ updated the mux
+
+1998-01-08 13:10 jesse
+
+ * Makefile:
+
+ more fixes to make suid wrapper stuff work.
+
+1998-01-08 12:51 jesse
+
+ * bin/rtmux.pl:
+
+ made rtmux attempt to work with the suid wrapper
+
+1998-01-08 12:48 jesse
+
+ * etc/suidrt.c:
+
+ added back suidrt.c. blech.
+
+1998-01-08 12:44 jesse
+
+ * Makefile, bin/rtmux.pl:
+
+ brought back suidrt.c
+ bleck.
+
+1998-01-07 18:06 jesse
+
+ * Makefile:
+
+ added a sane mode for $(RT_PATH)
+
+1998-01-07 00:37 jesse
+
+ * Makefile, README.FIRST:
+
+ added basic old upgrade instructions.
+ added info to README.FIRST about upgrading.
+
+1998-01-07 00:31 jesse
+
+ * bin/rtmux.pl:
+
+ made mailing work.
+
+1998-01-06 10:27 jesse
+
+ * bin/rtmux.pl:
+
+ made the mux require ui::mail before it tried to invoke it.
+
+1998-01-04 02:26 jesse
+
+ * README:
+
+ told users to read readme.first.
+
+1998-01-04 02:25 jesse
+
+ * README, README.FIRST:
+
+ added readme.first
+
+1998-01-04 02:12 jesse
+
+ * Makefile:
+
+ updated webadmin interface. fixed some logout problems. fixed an html bug in web-manip.
+
+1998-01-02 01:14 jesse
+
+ * Makefile, bin/rtmux.pl:
+
+ fixed more problems w/ making cliadmin run
+ merged mux-install and mux-links into one section of makefile
+
+1998-01-02 00:59 jesse
+
+ * Makefile, NEWS, README, TODO, bin/rtmux.pl, etc/config.pm:
+
+ fixed typo in Makefile: install-libs -> libs-install
+
+1998-01-01 03:07 jesse
+
+ * Makefile, bin/rtmux.pl:
+
+ commented makefile better
+ added more stuff for taint checks to rtmux.pl
+ fixed a non-frames web bug in FormComment
+
+1997-12-31 01:55 jesse
+
+ * Makefile, bin/rtmux.pl, etc/config.pm:
+
+ lots of cleanup to get web interface running.
+ beginnigs of taint-safe scripts.
+
+1997-12-30 23:49 jesse
+
+ * Makefile, bin/rtmux.pl:
+
+ cleanup in cli admin.pm, cli query.pm, the mux, the makefile
+ database routines now assign an effective serial # to a request when you get
+ the fact's serial number
+
+1997-12-30 22:56 jesse
+
+ * Makefile, README, bin/rtmux.pl:
+
+ remodded rtmux to use correct vars for command line arguments.
+ moved RT_VERSION to makefile.
+ updated README for new install procedure
+
+1997-12-30 01:09 jesse
+
+ * Makefile, etc/config.pm, etc/mysql.acl:
+
+ fixed typo in web/admin.pm
+ set up config.pm mysql.acl and rtmux.pl to get themselves parsed from the makefile.
+ removed last vestiges of C
+
+1997-12-28 18:59 jesse
+
+ * Makefile, etc/schema:
+
+ removed suidrt for a preparation to move to a c-free system
+ added provisions for token-parsing to makefile
+
+1997-12-28 03:10 jesse
+
+ * etc/schema:
+
+ added tags to schema
+
+1997-12-28 02:48 jesse
+
+ * Makefile:
+
+ started to modify toplevel makefile
+
+1997-12-19 03:04 jesse
+
+ * lib/rtmux.pl:
+
+ moved the executable rtmux.pl to bin, where it belongs.
+ made sure bin/cgi gets created on checkout
+
+1997-12-19 03:03 jesse
+
+ * bin/rtmux.pl:
+
+ moved the executable rtmux.pl to bin, where it belongs.
+
+1997-12-18 19:05 jesse
+
+ * lib/rtmux.pl:
+
+ worked on the mux
+
+1997-12-09 15:14 jesse
+
+ * TODO:
+
+ added things for v1.0 to the todo list
+
+1997-12-09 02:03 jesse
+
+ * etc/config.pm:
+
+ broke configuration out into config.pm
+
+1997-12-09 01:54 jesse
+
+ * COPYING, Makefile, NEWS, README, TODO, etc/mysql.acl, etc/schema:
+
+ initial commit after i nuked the repository
+
+1997-12-09 01:54 jesse
+
+ * COPYING, Makefile, NEWS, README, TODO, etc/mysql.acl, etc/schema:
+
+ Initial revision
+
diff --git a/rt/Makefile b/rt/Makefile
index 644722109..fe01b71c1 100644
--- a/rt/Makefile
+++ b/rt/Makefile
@@ -1,49 +1,18 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2002 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-
-
-#
-# DO NOT HAND-EDIT the file named 'Makefile'. This file is autogenerated.
-# Have a look at "configure" and "Makefile.in" instead
-#
-
+# $Header: /home/cvs/cvsroot/freeside/rt/Makefile,v 1.1 2002-08-12 06:17:06 ivan Exp $
+# RT is Copyright 1996-2002 Jesse Vincent <jesse@bestpractical.com>
+# It is distributed under the terms of the GNU General Public License, version 2
PERL = /usr/bin/perl
-CONFIG_FILE_PATH = /opt/rt3/etc
-CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_Config.pm
-SITE_CONFIG_FILE = $(CONFIG_FILE_PATH)/RT_SiteConfig.pm
-
-
-RT_VERSION_MAJOR = 3
+RT_VERSION_MAJOR = 2
RT_VERSION_MINOR = 0
-RT_VERSION_PATCH = 4
+RT_VERSION_PATCH = 14
+
RT_VERSION = $(RT_VERSION_MAJOR).$(RT_VERSION_MINOR).$(RT_VERSION_PATCH)
TAG = rt-$(RT_VERSION_MAJOR)-$(RT_VERSION_MINOR)-$(RT_VERSION_PATCH)
+BRANCH = HEAD
# This is the group that all of the installed files will be chgrp'ed to.
RTGROUP = rt
@@ -58,8 +27,7 @@ LIBS_OWNER = root
# Group that should own all of RT's libraries, generally root.
LIBS_GROUP = bin
-WEB_USER = www
-WEB_GROUP = www
+
# {{{ Files and directories
@@ -69,22 +37,33 @@ WEB_GROUP = www
DESTDIR =
-RT_PATH = /opt/rt3
-RT_ETC_PATH = /opt/rt3/etc
-RT_BIN_PATH = /opt/rt3/bin
-RT_SBIN_PATH = /opt/rt3/sbin
-RT_LIB_PATH = /opt/rt3/lib
-RT_MAN_PATH = /opt/rt3/man
-RT_VAR_PATH = /opt/rt3/var
-RT_DOC_PATH = /opt/rt3/share/doc
-RT_LOCAL_PATH = /opt/rt3/local
-LOCAL_ETC_PATH = /opt/rt3/local/etc
-LOCAL_LEXICON_PATH = /opt/rt3/local/po
-MASON_HTML_PATH = /opt/rt3/share/html
-MASON_LOCAL_HTML_PATH = /opt/rt3/local/html
-MASON_DATA_PATH = /opt/rt3/var/mason_data
-MASON_SESSION_PATH = /opt/rt3/var/session_data
-RT_LOG_PATH = /opt/rt3/var/log
+# RT_PATH is the name of the directory you want make to install RT in
+# RT must be installed in its own directory (don't set this to /usr/local)
+
+RT_PATH = /opt/rt2
+
+# The rest of these paths are all configurable, but you probably don't want to
+# put them elsewhere
+
+RT_LIB_PATH = $(RT_PATH)/lib
+RT_ETC_PATH = $(RT_PATH)/etc
+RT_CONFIG_PATH = $(RT_ETC_PATH)
+RT_BIN_PATH = $(RT_PATH)/bin
+RT_MAN_PATH = $(RT_PATH)/man
+MASON_HTML_PATH = $(RT_PATH)/WebRT/html
+
+
+# RT allows sites to overlay the default web ui with
+# local customizations Those files can be placed in MASON_LOCAL_HTML_PATH
+
+MASON_LOCAL_HTML_PATH = $(RT_PATH)/local/WebRT/html
+
+# RT needs to be able to write to MASON_DATA_PATH and MASON_SESSION_PATH
+# RT will create and chown these directories. Don't just set them to /tmp
+MASON_DATA_PATH = $(RT_PATH)/WebRT/data
+MASON_SESSION_PATH = $(RT_PATH)/WebRT/sessiondata
+
+RT_LOG_PATH = /tmp
# RT_READABLE_DIR_MODE is the mode of directories that are generally meant
# to be accessable
@@ -92,33 +71,25 @@ RT_READABLE_DIR_MODE = 0755
-
-# {{{ all these define the places that RT's binaries should get installed
+# The location of your rt configuration file
+RT_CONFIG = $(RT_CONFIG_PATH)/config.pm
# RT_MODPERL_HANDLER is the mason handler script for mod_perl
RT_MODPERL_HANDLER = $(RT_BIN_PATH)/webmux.pl
+
# RT_FASTCGI_HANDLER is the mason handler script for FastCGI
+# THIS HANDLER IS NOT CURRENTLY SUPPORTED
RT_FASTCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.fcgi
-# RT_WIN32_FASTCGI_HANDLER is the mason handler script for FastCGI
-RT_WIN32_FASTCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.svc
-# RT's admin CLI
-RT_CLI_ADMIN_BIN = $(RT_BIN_PATH)/rtadmin
-# RT's mail gateway
-RT_MAILGATE_BIN = $(RT_BIN_PATH)/rt-mailgate
-# RT's cron tool
-RT_CRON_BIN = $(RT_BIN_PATH)/rt-crontool
-# }}}
-
-SETGID_BINARIES = $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
- $(DESTDIR)/$(RT_WIN32_FASTCGI_HANDLER)
+# RT_SPEEDYCGI_HANDLER is the mason handler script for SpeedyCGI
+# THIS HANDLER IS NOT CURRENTLY SUPPORTED
+RT_SPEEDYCGI_HANDLER = $(RT_BIN_PATH)/mason_handler.scgi
-BINARIES = $(DESTDIR)/$(RT_MODPERL_HANDLER) \
- $(DESTDIR)/$(RT_MAILGATE_BIN) \
- $(DESTDIR)/$(RT_CRON_BIN) \
- $(SETGID_BINARIES)
-SYSTEM_BINARIES = $(DESTDIR)/$(RT_SBIN_PATH)/
+# The following are the names of the various binaries which make up RT
+RT_CLI_BIN = $(RT_BIN_PATH)/rt
+RT_CLI_ADMIN_BIN = $(RT_BIN_PATH)/rtadmin
+RT_MAILGATE_BIN = $(RT_BIN_PATH)/rt-mailgate
# }}}
@@ -128,19 +99,34 @@ SYSTEM_BINARIES = $(DESTDIR)/$(RT_SBIN_PATH)/
# DB_TYPE defines what sort of database RT trys to talk to
# "mysql" is known to work.
# "Pg" is known to work
+# "Oracle" is in the early stages of working.
DB_TYPE = mysql
+# DB_HOME is where the Database's commandline tools live. $DB_HOME/bin
+# should contain the binaries themselves, e.g. if "which mysql" gives
+# "/usr/local/mysql/bin/mysql", $DB_HOME should be "/usr/local/mysql"
+
+DB_HOME = /usr
+
# Set DBA to the name of a unix account with the proper permissions and
-# environment to run your commandline SQL sbin
+# environment to run your commandline SQL tools
# Set DB_DBA to the name of a DB user with permission to create new databases
+# Set DB_DBA_PASSWORD to that user's password (if you don't, you'll be prompted
+# later)
# For mysql, you probably want 'root'
# For Pg, you probably want 'postgres'
# For oracle, you want 'system'
DB_DBA = root
+DB_DBA_PASSWORD =
+
+#
+# Set this to the Fully Qualified Domain Name of your database server.
+# If the database is local, rather than on a remote host, using "localhost"
+# will greatly enhance performance.
DB_HOST = localhost
@@ -150,9 +136,6 @@ DB_HOST = localhost
DB_PORT =
-
-
-
#
# Set this to the canonical name of the interface RT will be talking to the
# database on. If you said that the RT_DB_HOST above was "localhost," this
@@ -166,72 +149,81 @@ DB_RT_HOST = localhost
# set this to the name you want to give to the RT database in
# your database server. For Oracle, this should be the name of your sid
-DB_DATABASE = rt3
+DB_DATABASE = rt2
+
+# Set this to the name of the rt database user
+
DB_RT_USER = rt_user
+
+# Set this to the password used by the rt database user
+# *** Change This Before Installation***
+
DB_RT_PASS = rt_pass
# }}}
+# {{{ Web configuration
-####################################################################
+# The user your webserver runs as. needed so that webrt can cache mason
+# objectcode
-all: default
+WEB_USER = www
+WEB_GROUP = rt
+
+# }}}
+
+
+####################################################################
+# No user servicable parts below this line. Frob at your own risk #
+####################################################################
default:
@echo "Please read RT's readme before installing. Not doing so could"
@echo "be dangerous."
-
+install: dirs initialize.$(DB_TYPE) upgrade insert instruct
instruct:
@echo "Congratulations. RT has been installed. "
- @echo ""
- @echo ""
- @echo "You must now configure RT by editing $(SITE_CONFIG_FILE)."
- @echo ""
- @echo "(You will definitely need to set RT's database password before continuing."
- @echo " Not doing so could be very dangerous)"
- @echo ""
- @echo "After that, you need to initialize RT's database by running"
- @echo " 'make initialize-database'"
+ @echo "You must now configure it by editing $(RT_CONFIG)."
+ @echo "From here on in, you should refer to the users guide."
-# @echo " or by executing "
-# @echo " '$(RT_SBIN_PATH)/rt-setup-database --action init \ "
-# @echo " --dba $(DB_DBA) --prompt-for-dba-password'"
+insert: insert-install
+ $(PERL) -I$(DESTDIR)/$(RT_ETC_PATH) -I$(DESTDIR)/$(RT_LIB_PATH) $(DESTDIR)/$(RT_ETC_PATH)/insertdata
+upgrade: dirs config-replace upgrade-noclobber upgrade-instruct
upgrade-instruct:
@echo "Congratulations. RT has been upgraded. You should now check-over"
- @echo "$(CONFIG_FILE) for any necessary site customization. Additionally,"
+ @echo "$(RT_CONFIG) for any necessary site customization. Additionally,"
@echo "you should update RT's system database objects by running "
- @echo " ls etc/upgrade"
- @echo "For each file in that directory whose name is greater than"
- @echo "your previously installed RT version, run:"
- @echo " $(RT_SBIN_PATH)/rt-setup-database --action insert --datafile etc/upgrade/<version>"
-
-
-upgrade: dirs upgrade-noclobber upgrade-instruct
+ @echo " $(RT_ETC_PATH)/insertdata <version>"
+ @echo "where <version> is the version of RT you're upgrading from."
-upgrade-noclobber: config-install libs-install html-install bin-install local-install doc-install fixperms
+upgrade-noclobber: insert-install libs-install html-install bin-install nondestruct
+nondestruct: fixperms
-# {{{ dependencies
testdeps:
- $(PERL) ./sbin/rt-test-dependencies --with-$(DB_TYPE)
+ $(PERL) ./tools/testdeps -warn $(DB_TYPE)
fixdeps:
- $(PERL) ./sbin/rt-test-dependencies --install --with-$(DB_TYPE)
+ $(PERL) ./tools/testdeps -fix $(DB_TYPE)
-#}}}
-# {{{ fixperms
+
+all:
+ @echo "Read the readme."
+
fixperms:
# Make the libraries readable
- chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
+ chmod -R $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_PATH)
chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH)
chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
- chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(RT_LIB_PATH)
+
+ chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_BIN_PATH)
+ chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_BIN_PATH)
chmod $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_BIN_PATH)
@@ -245,19 +237,36 @@ fixperms:
chown -R $(BIN_OWNER) $(DESTDIR)/$(RT_ETC_PATH)
chgrp -R $(RTGROUP) $(DESTDIR)/$(RT_ETC_PATH)
- chmod 0550 $(DESTDIR)/$(CONFIG_FILE)
- chmod 0550 $(DESTDIR)/$(SITE_CONFIG_FILE)
+ chmod 0550 $(DESTDIR)/$(RT_CONFIG)
# Make the interfaces executable and setgid rt
- chown $(BIN_OWNER) $(BINARIES)
- chgrp $(RTGROUP) $(BINARIES)
- chmod 0755 $(BINARIES)
- chmod g+s $(SETGID_BINARIES)
+ chown $(BIN_OWNER) $(DESTDIR)/$(RT_MAILGATE_BIN) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
+ $(DESTDIR)/$(RT_CLI_BIN) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
+
+ chgrp $(RTGROUP) $(DESTDIR)/$(RT_MAILGATE_BIN) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
+ $(DESTDIR)/$(RT_CLI_BIN) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
+
+ chmod 0755 $(DESTDIR)/$(RT_MAILGATE_BIN) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
+ $(DESTDIR)/$(RT_CLI_BIN) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
+
+ chmod g+s $(DESTDIR)/$(RT_MAILGATE_BIN) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
+ $(DESTDIR)/$(RT_CLI_BIN) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
# Make the web ui readable by all.
chmod -R u+rwX,go-w,go+rX $(DESTDIR)/$(MASON_HTML_PATH) \
- $(DESTDIR)/$(MASON_LOCAL_HTML_PATH) \
- $(DESTDIR)/$(LOCAL_LEXICON_PATH)
+ $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
chown -R $(LIBS_OWNER) $(DESTDIR)/$(MASON_HTML_PATH) \
$(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(MASON_HTML_PATH) \
@@ -270,216 +279,140 @@ fixperms:
$(DESTDIR)/$(MASON_SESSION_PATH)
chgrp -R $(WEB_GROUP) $(DESTDIR)/$(MASON_DATA_PATH) \
$(DESTDIR)/$(MASON_SESSION_PATH)
-# }}}
-
-fixperms-nosetgid: fixperms
- @echo "You should never be running RT this way. it's unsafe"
- chmod 0555 $(SETGID_BINARIES)
- chmod 0555 $(DESTDIR)/$(CONFIG_FILE)
- chmod 0555 $(DESTDIR)/$(SITE_CONFIG_FILE)
-
-# {{{ dirs
dirs:
- mkdir -p $(DESTDIR)/$(RT_LOG_PATH)
+ mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)
- mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/cache
- mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/etc
- mkdir -p $(DESTDIR)/$(MASON_DATA_PATH)/obj
mkdir -p $(DESTDIR)/$(MASON_SESSION_PATH)
+ mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
+ mkdir -p $(DESTDIR)/$(RT_LIB_PATH)
mkdir -p $(DESTDIR)/$(MASON_HTML_PATH)
mkdir -p $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
- mkdir -p $(DESTDIR)/$(LOCAL_ETC_PATH)
- mkdir -p $(DESTDIR)/$(LOCAL_LEXICON_PATH)
-# }}}
-
-install: config-install dirs files-install fixperms instruct
-
-files-install: libs-install etc-install bin-install sbin-install html-install local-install doc-install
-
-config-install:
- mkdir -p $(DESTDIR)/$(CONFIG_FILE_PATH)
- cp etc/RT_Config.pm $(DESTDIR)/$(CONFIG_FILE)
- [ -f $(DESTDIR)/$(SITE_CONFIG_FILE) ] || cp etc/RT_SiteConfig.pm $(DESTDIR)/$(SITE_CONFIG_FILE)
-
- chgrp $(RTGROUP) $(DESTDIR)/$(CONFIG_FILE)
- chown $(BIN_OWNER) $(DESTDIR)/$(CONFIG_FILE)
-
- chgrp $(RTGROUP) $(DESTDIR)/$(SITE_CONFIG_FILE)
- chown $(BIN_OWNER) $(DESTDIR)/$(SITE_CONFIG_FILE)
-
- @echo "Installed configuration. about to install rt in $(RT_PATH)"
-
-test:
- $(PERL) -Ilib lib/t/00smoke.t
-
-regression-nosetgid-quiet: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl
- $(PERL) sbin/regression_harness
-
-regression-nosetgid: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods fixperms-nosetgid apachectl
- $(PERL) lib/t/02regression.t
-
-regression: config-install dirs files-install libs-install sbin-install bin-install regression-instruct regression-reset-db testify-pods apachectl
- $(PERL) lib/t/02regression.t
-
-regression-quiet:
- $(PERL) sbin/regression_harness
-
-regression-instruct:
- @echo "About to wipe your database for a regression test. ABORT NOW with Control-C"
-
-
-# {{{ database-installation
-
-regression-reset-db:
- $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --dba-password ''
- $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --dba-password ''
-
-initialize-database:
- $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action init --dba $(DB_DBA) --prompt-for-dba-password
-
-dropdb:
- $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/rt-setup-database --action drop --dba $(DB_DBA) --prompt-for-dba-password
-
-insert-approval-data:
- $(PERL) $(DESTDIR)/$(RT_SBIN_PATH)/insert_approval_scrips
-# }}}
-# {{{ libs-install
libs-install:
[ -d $(DESTDIR)/$(RT_LIB_PATH) ] || mkdir $(DESTDIR)/$(RT_LIB_PATH)
- -cp -rp lib/* $(DESTDIR)/$(RT_LIB_PATH)
-# }}}
+ chown -R $(LIBS_OWNER) $(DESTDIR)/$(RT_LIB_PATH)
+ chgrp -R $(LIBS_GROUP) $(DESTDIR)/$(RT_LIB_PATH)
+ chmod -R $(RT_READABLE_DIR_MODE) $(DESTDIR)/$(RT_LIB_PATH)
+ ( cd ./lib; \
+ $(PERL) Makefile.PL INSTALLSITELIB=$(DESTDIR)/$(RT_LIB_PATH) \
+ INSTALLMAN1DIR=$(DESTDIR)/$(RT_MAN_PATH)/man1 \
+ INSTALLMAN3DIR=$(DESTDIR)/$(RT_MAN_PATH)/man3 \
+ && make \
+ && make test \
+ && $(PERL) -p -i -e " s'!!RT_VERSION!!'$(RT_VERSION)'g;" blib/lib/RT.pm ;\
+ make install \
+ INSTALLSITEMAN1DIR=$(DESTDIR)/$(RT_MAN_PATH)/man1 \
+ INSTALLSITEMAN3DIR=$(DESTDIR)/$(RT_MAN_PATH)/man3 \
+ )
-# {{{ html-install
html-install:
- [ -d $(DESTDIR)/$(MASON_HTML_PATH) ] || mkdir $(DESTDIR)/$(MASON_HTML_PATH)
- -cp -rp ./html/* $(DESTDIR)/$(MASON_HTML_PATH)
-# }}}
+ cp -rp ./webrt/* $(DESTDIR)/$(MASON_HTML_PATH)
-# {{{ doc-install
-doc-install:
- # RT 3.0.0 - RT 3.0.2 would accidentally create a file instead of a dir
- -[ -f $(DESTDIR)/$(RT_DOC_PATH) ] && rm $(DESTDIR)/$(RT_DOC_PATH)
- [ -d $(DESTDIR)/$(RT_DOC_PATH) ] || mkdir $(DESTDIR)/$(RT_DOC_PATH)
- -cp -rp ./README $(DESTDIR)/$(RT_DOC_PATH)
-# }}}
-# {{{ etc-install
-etc-install:
- mkdir -p $(DESTDIR)/$(RT_ETC_PATH)
- -cp -rp \
- etc/acl.* \
- etc/initialdata \
- etc/schema.* \
- $(DESTDIR)/$(RT_ETC_PATH)
-# }}}
+genschema:
+ $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' generate
-# {{{ sbin-install
-sbin-install:
- mkdir -p $(DESTDIR)/$(RT_SBIN_PATH)
- chmod +x sbin/rt-setup-database \
- sbin/rt-test-dependencies
- -cp -rp \
- sbin/rt-setup-database \
- sbin/rt-test-dependencies \
- $(DESTDIR)/$(RT_SBIN_PATH)
+initialize.Pg: createdb initdb.dba acls
-# }}}
+initialize.mysql: createdb acls initdb.rtuser
-# {{{ bin-install
+initialize.Oracle: acls initdb.rtuser
-bin-install:
- mkdir -p $(DESTDIR)/$(RT_BIN_PATH)
- chmod +x bin/rt-mailgate \
- bin/rt-crontool
- -cp -rp \
- bin/rt-mailgate \
- bin/mason_handler.fcgi \
- bin/mason_handler.svc \
- bin/webmux.pl \
- bin/rt-crontool \
- $(DESTDIR)/$(RT_BIN_PATH)
-# }}}
+acls:
+ cp etc/acl.$(DB_TYPE) '$(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)'
+ $(PERL) -p -i -e " s'!!DB_TYPE!!'"$(DB_TYPE)"'g;\
+ s'!!DB_HOST!!'"$(DB_HOST)"'g;\
+ s'!!DB_RT_PASS!!'"$(DB_RT_PASS)"'g;\
+ s'!!DB_RT_HOST!!'"$(DB_RT_HOST)"'g;\
+ s'!!DB_RT_USER!!'"$(DB_RT_USER)"'g;\
+ s'!!DB_DATABASE!!'"$(DB_DATABASE)"'g;" $(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)
+ bin/initacls.$(DB_TYPE) '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DBA_PASSWORD)' '$(DB_DATABASE)' '$(DESTDIR)/$(RT_ETC_PATH)/acl.$(DB_TYPE)'
-# {{{ local-install
-local-install:
- -cp -rp ./local/html/* $(DESTDIR)/$(MASON_LOCAL_HTML_PATH)
- -cp -rp ./local/po/* $(DESTDIR)/$(LOCAL_LEXICON_PATH)
- -cp -rp ./local/etc/* $(DESTDIR)/$(LOCAL_ETC_PATH)
-# }}}
-
-# {{{ Best Practical Build targets -- no user servicable parts inside
-
-
-POD2TEST_EXE = sbin/extract_pod_tests
-
-testify-pods:
- [ -d lib/t/autogen ] || mkdir lib/t/autogen
- find lib -name \*pm |grep -v \*.in |xargs -n 1 $(PERL) $(POD2TEST_EXE)
- find bin -type f |grep -v \~ | grep -v "\.in" | xargs -n 1 $(PERL) $(POD2TEST_EXE)
+dropdb:
+ $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' drop
-regenerate-catalogs:
- $(PERL) sbin/extract-message-catalog
-license-tag:
- $(PERL) sbin/license_tag
+createdb:
+ $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' create
+initdb.dba:
+ $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_DBA)' '$(DB_DATABASE)' insert
-factory: initialize-database
- cd lib; $(PERL) ../sbin/factory $(DB_DATABASE) RT
+initdb.rtuser:
+ $(PERL) tools/initdb '$(DB_TYPE)' '$(DB_HOME)' '$(DB_HOST)' '$(DB_PORT)' '$(DB_RT_USER)' '$(DB_DATABASE)' insert
-commit:
- aegis -build ; aegis -diff ; aegis -test; aegis -develop_end
-integrate:
- aegis -integrate_begin; aegis -build; aegis -diff; aegis -test ; aegis -integrate_pass
-predist: commit tag-and-tar
+insert-install:
+ cp -rp ./tools/insertdata \
+ $(DESTDIR)/$(RT_ETC_PATH)
+ $(PERL) -p -i -e " s'!!RT_ETC_PATH!!'$(RT_ETC_PATH)'g;\
+ s'!!RT_LIB_PATH!!'$(RT_LIB_PATH)'g;"\
+ $(DESTDIR)/$(RT_ETC_PATH)/insertdata
-tag-and-release-baseline:
- aegis -cp -ind Makefile -output /tmp/Makefile.tagandrelease; \
- $(MAKE) -f /tmp/Makefile.tagandrelease tag-and-release-never-by-hand
+bin-install:
+ cp -p ./bin/webmux.pl $(DESTDIR)/$(RT_MODPERL_HANDLER)
+ cp -p ./bin/rt-mailgate $(DESTDIR)/$(RT_MAILGATE_BIN)
+ cp -p ./bin/rtadmin $(DESTDIR)/$(RT_CLI_ADMIN_BIN)
+ cp -p ./bin/rt $(DESTDIR)/$(RT_CLI_BIN)
+ cp -p ./bin/mason_handler.fcgi $(DESTDIR)/$(RT_FASTCGI_HANDLER)
+ cp -p ./bin/mason_handler.scgi $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER)
+
+ $(PERL) -p -i -e "s'!!RT_PATH!!'"$(RT_PATH)"'g;\
+ s'!!PERL!!'"$(PERL)"'g;\
+ s'!!RT_VERSION!!'"$(RT_VERSION)"'g;\
+ s'!!RT_ETC_PATH!!'"$(RT_CONFIG_PATH)"'g;\
+ s'!!RT_LIB_PATH!!'"$(RT_LIB_PATH)"'g;"\
+ $(DESTDIR)/$(RT_MODPERL_HANDLER) \
+ $(DESTDIR)/$(RT_FASTCGI_HANDLER) \
+ $(DESTDIR)/$(RT_SPEEDYCGI_HANDLER) \
+ $(DESTDIR)/$(RT_CLI_BIN) \
+ $(DESTDIR)/$(RT_CLI_ADMIN_BIN) \
+ $(DESTDIR)/$(RT_MAILGATE_BIN)
+
+
+config-replace:
+ -[ -f $(DESTDIR)/$(RT_CONFIG) ] && \
+ mv $(DESTDIR)/$(RT_CONFIG) $(DESTDIR)/$(RT_CONFIG).old && \
+ chmod 000 $(DESTDIR)/$(RT_CONFIG).old
+ cp -rp ./etc/config.pm $(DESTDIR)/$(RT_CONFIG)
+ $(PERL) -p -i -e "\
+ s'!!DB_TYPE!!'"$(DB_TYPE)"'g;\
+ s'!!DB_HOST!!'"$(DB_HOST)"'g;\
+ s'!!DB_PORT!!'"$(DB_PORT)"'g;\
+ s'!!DB_RT_PASS!!'"$(DB_RT_PASS)"'g;\
+ s'!!DB_RT_USER!!'"$(DB_RT_USER)"'g;\
+ s'!!DB_DATABASE!!'"$(DB_DATABASE)"'g;\
+ s'!!MASON_HTML_PATH!!'"$(MASON_HTML_PATH)"'g;\
+ s'!!MASON_LOCAL_HTML_PATH!!'"$(MASON_LOCAL_HTML_PATH)"'g;\
+ s'!!MASON_SESSION_PATH!!'"$(MASON_SESSION_PATH)"'g;\
+ s'!!MASON_DATA_PATH!!'"$(MASON_DATA_PATH)"'g;\
+ s'!!RT_LOG_PATH!!'"$(RT_LOG_PATH)"'g;\
+ s'!!RT_VERSION!!'"$(RT_VERSION)"'g;\
+ " $(DESTDIR)/$(RT_CONFIG)
-# Running this target in a working directory is
-# WRONG WRONG WRONG.
-# it will tag the current baseline with the version of RT defined
-# in the currently-being-worked-on makefile. which is wrong.
-# you want tag-and-release-baseline
+commit:
+ cvs commit
-tag-and-release-never-by-hand:
- aegis --delta-name $(TAG)
+predist: commit
+ cvs tag -r $(BRANCH) -F $(TAG)
rm -rf /tmp/$(TAG)
- mkdir /tmp/$(TAG)
- cd /tmp/$(TAG); \
- aegis -cp -ind -delta $(TAG) . ;\
- make reconfigure;\
- chmod 600 Makefile;\
- aegis --report --project rt.$(RT_VERSION_MAJOR) \
- --page_width 80 \
- --page_length 9999 \
- --change $(RT_VERSION_MINOR) --output Changelog Change_Log
-
+ cvs co -d /tmp/$(TAG) -r $(TAG) rt
+ cd /tmp/$(TAG); chmod 600 Makefile; /usr/local/bin/cvs2cl.pl \
+ --no-wrap --separate-header \
+ --window 120
cd /tmp; tar czvf /home/ftp/pub/rt/devel/$(TAG).tar.gz $(TAG)/
chmod 644 /home/ftp/pub/rt/devel/$(TAG).tar.gz
+dist: commit predist
+ rm -rf /home/ftp/pub/rt/devel/rt.tar.gz
+ ln -s ./$(TAG).tar.gz /home/ftp/pub/rt/devel/rt.tar.gz
-reconfigure:
- aclocal -I m4
- autoconf
- chmod 755 ./configure
- ./configure
rpm:
(cd ..; tar czvf /usr/src/redhat/SOURCES/rt.tar.gz rt)
rpm -ba etc/rt.spec
-
-
-apachectl:
- apachectl stop
- sleep 3
- apachectl start
-# }}}
diff --git a/rt/README b/rt/README
index 7c5e4d47a..d16100c5f 100755
--- a/rt/README
+++ b/rt/README
@@ -1,167 +1,139 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-RT is an enterprise-grade issue tracking system. It allows
-organizations to keep track of their to-do lists, who is working
-on which tasks, what's already been done, and when tasks were
-completed. It is available under the terms of version 2 of the GNU
-General Public License (GPL), so it doesn't cost anything to set
-up and use.
+$Header: /home/cvs/cvsroot/freeside/rt/README,v 1.1 2002-08-12 06:17:06 ivan Exp $
+RT is (c) 1996-2002 by Jesse Vincent <jesse@bestpractical.com>
+RT is licensed to you under the terms of version 2 of the GNU General
+Public License.
- Jesse Vincent
- Best Practical Solutions, LLC
- March 2003
-
-REQUIRED PACKAGES:
-------------------
-
-o Perl 5.8.0 or later (http://www.perl.com).
-
- (If you intend to use the FastCGI or SpeedyCGI support, you
- need to make sure that perl has been built with support for
- setgid perl scripts.)`
-
- Perl 5.6.1 is currently deprecated and will be officially desupported
- in a future release
-
-o A DB backend; MySQL is recommended ( http://www.mysql.com )
- Currently supported: Mysql 4.0.13 or later.
- Postgres 7.2 or later.
-
- Mysql 3.23.46 or newer with support for InnoDB
- is currently deprecated and will be officially
- desupported in a future release.
-
-o Apache version 1.3.x or 2.x (http://httpd.apache.org)
- with mod_perl -- (http://perl.apache.org )
- or a webserver with FastCGI support (www.fastcgi.com)
+If you don't have a copy of the GPL, you've been living in a cave,
+but one should be included in this distribution.
- mod_perl 2.0 isn't quite ready for prime_time just yet;
- Best Practical Solutions strongly recommends that sites use
- Apache 1.3 or FastCGI.
- Compiling mod_perl on Apache 1.3.x as a DSO has been known
- to have massive stability problems and is not recommended.
+INSTALLATION INSTRUCTIONS
+-------------------------
- mod_perl 1.x must be build with EVERYTHING=1
+These instructions are a summary of those at http://www.fsck.com/rtfm/
+The docs on the web at www.fsck.com/rtfm/ are likely to be more up to
+date and complete than this document. You should consult them before
+proceeding.
- RT's FastCGI handler runs setgid to the 'rt' group to
- protect RT's database password. You may need to install
- a special "suidperl" package or reconfigure your perl
- setup to support "setuid scripts" if you intend to use RT
- with FastCGI.
-
- Debian GNU/* 3.0+: the package which installs suidperl is
- called perl-suid, and should work without any tweaking.
+REQUIRED PACKAGES:
+------------------
- FreeBSD 4.2+: the package is called sperl, and should
- install a suidperl that just works
+o Perl5.005_03 or later with support for setgid perl scripts
+ RT's command line and mail gateway tools run setgid to the 'rt' group
+ to protect RT's database password. You may need to install a special
+ "suidperl" package or reconfigure your perl setup to support
+ "setuid scripts".
- Conectiva Linux 6.0+: suidperl is installed by default when
- perl is installed, but the program /bin/suidperl is not setuid.
- You must use chmod to make it setuid.
+o A DB backend; MySQL is recommended ( http://www.mysql.com )
+ Currently supported: Mysql 3.23.38 or newer.
+ (Some older releases had crippling SQL bugs)
+ Postgres 7.1 or newer.
+o Apache + mod_perl -- ( http://perl.apache.org)
+ or A webserver with FastCGI support (www.fastcgi.com)
+ If you compile mod_perl as a DSO, you're on your own. It's known
+ to have massive stability problems.
+ mod_perl must be build with EVERYTHING=1
o Various and sundry perl modules
- A tool included with RT takes care of the installation of
- most of these automatically during the install process.
-
- The tool supplied with RT uses Perl's CPAN system
- (http://www.cpan.org) to install modules. Some operating
- systems package all or some of the modules required and
- you may be better off installing the modules that way.
+ RT takes care of the installation of most of these automatically
+ during the "make testdeps" and "make fixdeps" stages below
GENERAL INSTALLATION
--------------------
-This is a rough guide to installing RT. For more detail, you'll want
-to read 'Chapter 2: Installing' in RT's manual, available at
-http://www.bestpractical.com/rt
-
1 Unpack this distribution SOMWHERE OTHER THAN where you want to install RT
Granted, you've already got it open. To do this cleanly:
- tar xzvf rt.tar.gz -C /tmp
+ tar xzvf rt.tar.gz -C /tmp
-2 Run the "configure" script.
+2 Check over /tmp/rt/Makefile
- ./configure --help to see the list of options
- ./configure (with the flags you want)
+ There are many variables you NEED to customize for your site.
+ Even if you are just upgrading, you must set ALL variables.
-3 Satisfy RT's myriad dependencies.
+3 Satisfy RT's myriad dependencies. There's a perl script in rt/tools
+ called testdeps that uses CPAN to automate all of this.
3.1 Check for compliance:
-
- perl sbin/rt-test-dependencies \
- --with-<databasename> --with-<web-environment>
-
- databasename is one of: mysql, postgres
- web-environment is one of: fastcgi, modperl1, modperl2
+ make testdeps
-3.2 If there are unsatisfied dependencies, install them by hand or run:
+3.2 If there are unsatisfied dependencies, install them by hand or run
+ make fixdeps
+
+ (You may need to install Apache::Session and Apache::DBI by hand.
- perl sbin/rt-test-dependencies \
- --with-<databasename> --with-<web-environment> --install
-
+ You might need to install Msql-Mysql-Modules by hand.
+ perl -MCPAN -e'install DBD::mysql::Install' should do it for you.
+ )
3.3 Check to make sure everything was installed properly:
-
- perl sbin/rt-test-dependencies \
- --with-<databasename> --with-<web-environment>
+ make testdeps
4 Create a group called 'rt'
5a FOR A NEW INSTALLATION:
As root, type:
- make install (replace "make" with the local name for
- Make, if you need to)
+ make install (replace "make" with the local name for
+ Make, if you need to)
-
- make initialize-database
+ If the make fails, type:
+ make dropdb
+ and start over from step 5a
+5b FOR UPGRADING: (Within the RT 2.0.x series)
- If the make fails, type:
- make dropdb
- and start over from step 5a
+ Make a backup of /path/to/rt/etc/config.pm
+
+ As root, type:
+ make upgrade (replace "make" with the local name for
+ Make, if you need to)
-5b FOR UPGRADING: (Within the RT 3.0.x series)
+ This will build new binaries, config files and libraries without
+ overwriting your RT database.
- As root, type:
- make upgrade (replace "make" with the local name for
- Make, if you need to)
+ WARNING: This WILL clobber your existing configuration file!
+
+ The install process will then instruct you to update your RT system
+ database objects by running rt/etc/insertdata <version> where
+ <version> is the version of RT you're upgrading from.
- This will build new binaries, config files and libraries without
- overwriting your RT database.
- It may then instruct you to update your RT system database objects
+
+5c FOR UPGRADING (From 1.0.x):
+
+ Follow the instructions for installing RT 2.0.
-6 Edit etc/RT_SiteConfig.pm in your RT installation directory, by specifying
- any values you need to change from the defaults in etc/RT_Config.pm
+ Once you have installed RT 2.0, download import-1.0-to-2.0
+ from http://www.fsck.com/pub/rt/contrib/2.0/rt-addons
+
+ Edit the configuration defaults in import-1.0-to-2.0
+
+ If you don't set $DEFAULTQUEUE to the name of one of your
+ RT 1.0 queues, THE IMPORT WILL FAIL.
+
+ perl ./import-1.0-to-2.0
+
+ The import tool will do its thing. If you're using postgres, you'll
+ need to execute the following SQL statement within your RT2 database:
+
+ select setval('tickets_id_seq', (select max(id) from tickets));
+
+ It imports:
+ Queues, Areas, Users, Acls, Mailing Rules, Queue Members,
+ Tickets and Transactions.
+
+ It DOES NOT IMPORT:
+ Attachments removed by stripmime or Templates.
+
+6 Edit etc/config.pm in your RT installation directory. In many
+ cases sensible defaults have been included. In others, you MUST
+ supply a value.
7 Configure the email and web gateways, as described below.
@@ -170,81 +142,97 @@ http://www.bestpractical.com/rt
NOTE: root's password for the web interface is "password"
(without the quotes.) Not changing this is a SECURITY risk
-9 Configure RT per the instructions in RT's manual.
+9 Configure RT per the instructions at http://www.fsck.com/rtfm/
- Until you do this, RT will not be able to send or receive email,
+ Until you do this, RT will not be able to send or recieve email,
nor will it be more than marginally functional. This is not an
optional step.
-THE WEB INTERFACE
------------------
+SETTING UP THE MAIL GATEWAY
+---------------------------
-RT's web interface is based around HTML::Mason, which works best with the mod_perl
-perl interpreter within Apache httpd. Alternatively, support for the FastCGI
-(and plain CGI) interface is also provided as 'bin/mason_handler.fcgi'.
+An alias for the initial queue will need to be made in either your
+global mail aliases file (if you are using NIS) or locally on your
+machine.
+
+Add the following lines to /etc/aliases (or your local equivalent) :
+
+rt: "|/path/to/rt2/bin/rt-mailgate --queue general --action correspond"
+rt-comment: "|/path/to/rt2/bin/rt-mailgate --queue general --action comment"
+ | |
+ <queue-name>----/ |
+ |
+ <correspond or comment depending on whether |
+ the mail should be resent to the requestor>---/
+
+
+
+THE WEB UI
+----------
+
+RT's web ui is based around HTML::Mason, which works well with the mod_perl
+perl interpreter within Apache httpd as well as with a webserver which
+supports FastCGI. (Instructions for configuring RT for use with FastCGI
+are available at http://www.fsck.com/rtfm/ )
Apache
- You'll need to add a few lines to your httpd.conf telling it about RT:
+ RT Uses HTML::Mason. You'll need to add a few lines to your
+ httpd.conf telling it to use rt's web ui. If you have mod-perl
+ (you should, the perl scripts will go quite a bit faster around with
+ it), you can do something like this:
+
<VirtualHost your.ip.address>
- ServerName your.rt.server.hostname
- DocumentRoot /opt/rt3/share/html
- AddDefaultCharset UTF-8
-
- # this line applies to Apache2+mod_perl2 only
- PerlModule Apache2 Apache::compat
-
- PerlModule Apache::DBI
- PerlRequire /opt/rt3/bin/webmux.pl
-
- # this section applies to Apache 1 only
- <Location />
- SetHandler perl-script
- PerlHandler RT::Mason
- </Location>
-
- # this section applies to Apache2+mod_perl2 only
- <FilesMatch "\.html$">
- SetHandler perl-script
- PerlHandler RT::Mason
- </FilesMatch>
- <LocationMatch "/Attachment/">
- SetHandler perl-script
- PerlHandler RT::Mason
- </LocationMatch>
- <LocationMatch "/REST/">
- SetHandler perl-script
- PerlHandler RT::Mason
- </LocationMatch>
+DocumentRoot /path/to/rt2/WebRT/html
+ServerName your.rt.server.hostname
+PerlModule Apache::DBI
+PerlFreshRestart On
+PerlRequire /path/to/rt2/bin/webmux.pl
+<Location />
+ SetHandler perl-script
+ PerlHandler RT::Mason
+</Location>
</VirtualHost>
+Additionally, you should set up a cron job to remove stale session data.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+ WARNING: Don't install this cron job or run this find command if your
+ MASON_SESSION_PATH (known in config.pm as $MasonSessionDir)
+ points to a directory that could EVER contain any file that's not
+ a Apache::Session datafile.
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-SETTING UP THE MAIL GATEWAY
----------------------------
+# Every hour, nuke session files and lockfiles that haven't been
+# touched in 10 hours
-An alias for the initial queue will need to be made in either your
-global mail aliases file (if you are using NIS) or locally on your
-machine.
-
-Add the following lines to /etc/aliases (or your local equivalent) :
+0 * * * * find /path/to/rt2/WebRT/sessiondata -type f -amin +600 -exec rm {} \;
-rt: "|/opt/rt3/bin/rt-mailgate --queue general --action correspond --url http://localhost/"
-rt-comment: "|/opt/rt3/bin/rt-mailgate --queue general --action comment --url http://localhost/"
- | | |
- <queue-name>----/ | |
- | |
- <correspond or comment depending on whether | |
- the mail should be resent to the requestor>---/ |
- |
- <URL for RT's web interface>---/
+
+THE CLI
+-------
+ Binaries for the CLI are located in rt/bin
+ You've got:
+
+ "rt" (manipulate or display requests)
+ "rtadmin" (modify queues, users and acls)
+
+ Both of these programs take --help as an option.
BUGS
----
-To report a bug, send email to rt-3.0-bugs@fsck.com.
+Known issues with releases of RT2 are listed at
+<URL:http://fsck.com/rt2/NoAuth/Errata.html>. This includes every bug known
+to exist in each release of RT. (When prompted, login as guest/guest)
+
+To find out more about currently open bugs, check out the live
+Buglist at <URL:http://fsck.com/rt2/NoAuth/Buglist.html>.
+(When prompted, login as guest/guest)
+
+To report a bug, send an email to rt-2.0-bugs@fsck.com.
GETTING HELP
------------
@@ -261,8 +249,8 @@ information about commercial support options, please send email to
RT-USERS MAILINGLIST
--------------------
-To keep up to date on the latest RT tips, techniques and extensions,
-you probably want to join the rt-users mailing list. Send a message to:
+To keep up to date on the latest RT tips, techniques and extections,
+you probably want to join the rt-users mailinglist. Send a message to:
rt-users-request@lists.fsck.com
@@ -270,31 +258,79 @@ With the body of the message consisting of only the word:
subscribe
-If you're interested in hacking on RT, you'll want to subscribe to
+If you're interested in hacking on rt, you'll want to subscribe to
rt-devel@lists.fsck.com. Subscribe to it with instructions similar to
those above.
Address questions about the stable release to the rt-users list, and
questions about the development version to the rt-devel list. If you feel
-your questions are best not asked publicly, send them personally to
+your questions are best not asked publically, send them personally to
<jesse@bestpractical.com>.
+If you want to be informed of every commit to the CVS repository,
+subscribe to rt-commit@fsck.com using similar instructions to those above.
+
RT WEBSITE
----------
For current information about RT, check out the RT website at
- http://www.bestpractical.com/
-
-You'll find screenshots, a pointer to the current version of RT, contributed
-patches, and lots of other great stuff.
+http://www.bestpractical.com/rt You'll find screenshots, a pointer
+to the current version of rt, contributed patches and lots of other great
+stuff.
TROUBLESHOOTING
---------------
+All errors will be appended to a logfile, which lives in /tmp/rt.log.* unless
+you've reconfigured it. Check etc/config.pm for details.
+
If the solution to the problem you're running into isn't obvious and you've
-checked the FAQ, feel free to send mail to rt-users@fsck.com (for released
+checked the FAQ, feel free to send mail to rt-users@fsck.com (for release
versions of RT) or rt-devel@fsck.com (for development versions).
+GIVING SOMETHING BACK
+---------------------
+
+RT is free software. You are not obligated to pay for it. You should be
+aware, however, that bestpractical.com's sole source of revenue is commercial
+work related to RT. If you are able, either a contract to extend RT in some
+way that would be useful to your organization, a financial contribution, or
+even something off the author's amazon wishlist
+ ( http://www.amazon.com/exec/obidos/wishlist/2GMHUDAFBT2XR/ )
+would be much appreciated.
+
Thanks!
+
+
+CREDITS
+-------
+
+A lot of people are responsible for making RT a better program. Many
+thanks to Lauren Burka, who originally tasked me with writing this beast.
+She forced me to use a database backend. I've thanked her for it every
+day since. Rich West rewrote this readme and did some UI hacking. Adam
+Hirsch, Kit Kraysha, Robin Garner, Jens Glaser, John Adams, Trey Belew,
+Sean Dague, Nathan Mehl, Kee Hinckley, Rich West, Dale Bewley, Serge Zhuk,
+John Lengeling, Elmar Knipp, Gerald Abshez, Dave Hull, Dave Schenet,
+Dave Walton, Jan Okrouhly, Tobias Brox, Lamont Lucas, Charlie Brady,
+Robin Shostack, Eric Mumpower, Jerrod Wiesman, Adam Hammer, Ivan Kohler, Alex
+Pilosov, Mary Alderdice, Deborah Kaplan, Jens von Bülow, Tristan Horn,
+Lee Ann Goldstein, Karel P Kerezman, Feargal Reilly, Christian Steger,
+Christian Kurz, JD Falk, Arthur de Jong, Ben Carter, Mark Vevers
+and many others
+have all contributed bug reports, code or ideas that have helped RT along.
+
+Arepa, Inc, Utopia Inc, Wesleyan University and The Leftbank Operation
+have paid me to maintain RT and release it to the public. Without their
+support RT would not exist.
+
+If I've left you out, please drop me a line ....it wasn't intentional.
+
+
+ Enjoy
+
+ Jesse Vincent
+ <jesse@bestpractical.com>
+ Best Practical Solutions, LLC
diff --git a/rt/TODO b/rt/TODO
new file mode 100755
index 000000000..3d1b7d02e
--- /dev/null
+++ b/rt/TODO
@@ -0,0 +1,9 @@
+Errata for RT 2.x can be found at http://fsck.com/rt2/NoAuth/Errata.html
+
+A list of all open issues, including those which haven't been added
+to the official Errata lists, can be found at
+http://fsck.com/rt2/NoAuth/Buglist.html
+
+If you want to look at bugs in more detail, you may need to login as guest with a password of 'guest'
+
+
diff --git a/rt/bin/initacls.Oracle b/rt/bin/initacls.Oracle
new file mode 100644
index 000000000..8d05f45e1
--- /dev/null
+++ b/rt/bin/initacls.Oracle
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+DATABASEHOME=$1
+HOSTNAME=$2
+PORT=$3
+DATABASEADMIN=$4
+DBAPASSWD=$5
+DATABASENAME=$6
+DATABASEACLS=$7
+
+BINDIR=${DATABASEHOME}/bin
+
+echo "DBHOME = $DATABASEHOME"
+echo "HOSTNAME = $HOSTNAME"
+echo "PORT = $PORT"
+echo "DATABASEADMIN = $DATABASEADMIN"
+echo "DBAPASSWD = $DBAPASSWD"
+echo "DATABASENAME = $DATABASENAME"
+
+PATH=$PATH:$BINDIR
+export PATH
+
+echo "Please enter ${DATABASEADMIN}'s password for the SID ${DATABASENAME} to create an rt user";
+
+$BINDIR/sqlplus ${DATABASEADMIN}@${DATABASENAME} @$DATABASEACLS
+
diff --git a/rt/bin/initacls.Pg b/rt/bin/initacls.Pg
new file mode 100755
index 000000000..82e32de74
--- /dev/null
+++ b/rt/bin/initacls.Pg
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+DATABASEHOME=$1
+HOSTNAME=$2
+PORT=$3
+DATABASEADMIN=$4
+DBAPASSWD=$5
+DATABASENAME=$6
+DATABASEACLS=$7
+
+BINDIR=${DATABASEHOME}/bin
+
+
+PATH=$PATH:$BINDIR
+export PATH
+
+echo "Enter the postgres administrator's database password to create a new user for rt"
+
+if [ "fnord$PORT" != "fnord" ]; then
+ PORT="-p $PORT"
+fi;
+
+if [ "fnord$HOSTNAME" != "fnord" ]; then
+ HOSTNAME="-h $HOSTNAME"
+fi;
+
+psql $HOSTNAME $PORT -d $DATABASENAME -f $DATABASEACLS -U $DATABASEADMIN
+
diff --git a/rt/bin/initacls.mysql b/rt/bin/initacls.mysql
new file mode 100755
index 000000000..17e63f837
--- /dev/null
+++ b/rt/bin/initacls.mysql
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+DATABASEHOME=$1
+HOSTNAME=$2
+PORT=$3
+DATABASEADMIN=$4
+DBAPASSWD=$5
+DATABASENAME=$6
+DATABASEACLS=$7
+
+BINDIR=${DATABASEHOME}/bin
+
+PATH=$PATH:$BINDIR
+export PATH
+
+echo "Enter the mysql administrator's database password to create a new user for RT"
+$BINDIR/mysql --host=${HOSTNAME} --port=${PORT} --user=${DATABASEADMIN} -p${DBAPASSWD} mysql < $DATABASEACLS
+
+echo "Enter the mysql administrator's database password to nondestructively reload the database"
+$BINDIR/mysqladmin --host=${HOSTNAME} --port=${PORT} --user=${DATABASEADMIN} -p${DBAPASSWD} reload
diff --git a/rt/bin/mason_handler.fcgi b/rt/bin/mason_handler.fcgi
index 431eccbd3..e8a4e128f 100755
--- a/rt/bin/mason_handler.fcgi
+++ b/rt/bin/mason_handler.fcgi
@@ -1,54 +1,221 @@
-#!/usr/bin/perl
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#!!!PERL!!
+# $Header: /home/cvs/cvsroot/freeside/rt/bin/mason_handler.fcgi,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# RT is (c) 1996-2001 Jesse Vincent (jesse@fsck.com);
use strict;
-use File::Basename;
-require ('/opt/rt3/bin/webmux.pl');
+$ENV{'PATH'} = '/bin:/usr/bin'; # or whatever you need
+$ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
+$ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
+$ENV{'ENV'} = '' if defined $ENV{'ENV'};
+$ENV{'IFS'} = '' if defined $ENV{'IFS'};
-my $h = &RT::Interface::Web::NewCGIHandler();
-# Enter CGI::Fast mode, which should also work as a vanilla CGI script.
-require CGI::Fast;
+# We really don't want apache to try to eat all vm
+# see http://perl.apache.org/guide/control.html#Preventing_mod_perl_Processes_Fr
+
+
+package RT::Mason;
+#use CGI qw(-private_tempfiles); # pull in CGI with the private tempfiles
+ #option predefined
+use HTML::Mason; # brings in subpackages: Parser, Interp, etc.
+
+use vars qw($VERSION %session $Nobody $SystemUser $cgi);
+
+# List of modules that you want to use from components (see Admin
+# manual for details)
+
+#Clean up our umask...so that the session files aren't world readable, writable or executable
+umask(0077);
+
+
+
+$VERSION="!!RT_VERSION!!";
+
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+
+#This drags in RT's config.pm
+use config;
+use Carp;
+
+{
+ package HTML::Mason::Commands;
+ use vars qw(%session $ContentType);
+
+ use RT;
+ use RT::Ticket;
+ use RT::Tickets;
+ use RT::Transaction;
+ use RT::Transactions;
+ use RT::User;
+ use RT::Users;
+ use RT::CurrentUser;
+ use RT::Template;
+ use RT::Templates;
+ use RT::Queue;
+ use RT::Queues;
+ use RT::ScripAction;
+ use RT::ScripActions;
+ use RT::ScripCondition;
+ use RT::ScripConditions;
+ use RT::Scrip;
+ use RT::Scrips;
+ use RT::Group;
+ use RT::Groups;
+ use RT::Keyword;
+ use RT::Keywords;
+ use RT::ObjectKeyword;
+ use RT::ObjectKeywords;
+ use RT::KeywordSelect;
+ use RT::KeywordSelects;
+ use RT::GroupMember;
+ use RT::GroupMembers;
+ use RT::Watcher;
+ use RT::Watchers;
+ use RT::Handle;
+ use RT::Interface::Web;
+ use MIME::Entity;
+ use CGI::Cookie;
+ use Date::Parse;
+ use HTML::Entities;
+ use Text::Wrapper;
+
+ #TODO: make this use DBI
+ use Apache::Session::File;
+ use CGI::Fast;
+
+ # set the page's content type.
+ # In this case, just save it to a variable that we can pull later;
+ sub SetContentType {
+ $ContentType = shift;
+ }
+ sub CGIObject {
+ return $RT::Mason::cgi;
+ }
+}
+
+
+my ($output, $parser, $interp);
+if ($HTML::Mason::VERSION < 1.0902) {
+ require HTML::Mason::ApacheHandler;
+
+ $parser = &RT::Interface::Web::NewParser(allow_globals => [%session]);
+
+ $interp = &RT::Interface::Web::NewInterp(parser=>$parser,
+ allow_recursive_autohandlers => 1,
+ out_method => \$output);
+}
+else {
+ $interp = &RT::Interface::Web::NewInterp(
+ allow_globals => [%session],
+ default_escape_flags => 'h',
+
+ out_method => \$output);
+}
+# Die if WebSessionDir doesn't exist or we can't write to it
+
+stat ($RT::MasonSessionDir);
+die "Can't read and write $RT::MasonSessionDir"
+ unless (( -d _ ) and ( -r _ ) and ( -w _ ));
+
RT::Init();
# Response loop
-while ( my $cgi = CGI::Fast->new ) {
- # the whole point of fastcgi requires the env to get reset here..
- # So we must squash it again
- $ENV{'PATH'} = '/bin:/usr/bin';
- $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
- $ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
- $ENV{'ENV'} = '' if defined $ENV{'ENV'};
- $ENV{'IFS'} = '' if defined $ENV{'IFS'};
-
- unless ($h->interp->comp_exists($cgi->path_info)) {
- $cgi->path_info($cgi->path_info . "/index.html");
+while ($RT::Mason::cgi = new CGI::Fast) {
+
+ $HTML::Mason::Commands::ContentType = 'text/html';
+
+ # This routine comes from ApacheHandler.pm:
+ my (%args, $cookie);
+ foreach my $key ( $cgi->param ) {
+ foreach my $value ( $cgi->param($key) ) {
+ if (exists($args{$key})) {
+ if (ref($args{$key})) {
+ $args{$key} = [@{$args{$key}}, $value];
+ } else {
+ $args{$key} = [$args{$key}, $value];
+ }
+ } else {
+ $args{$key} = $value;
+ }
+
+ }
+
}
- $h->handle_cgi_object($cgi);
- # _should_ always be tied
-}
+
-1;
+ my $comp = $ENV{'PATH_INFO'};
+
+ if ($comp =~ /^(.*)$/) { # untaint the path info. apache should
+ # never hand us a bogus path.
+ # We should be more careful here.
+ $comp = $1;
+ }
+
+ if ($comp =~ /\/$/) {
+ $comp .= "index.html";
+ }
+
+ #This is all largely cut and pasted from mason's session_handler.pl
+
+ # {{{ Cookies
+ my %cookies = fetch CGI::Cookie();
+
+ eval {
+ my $session_id = undef;
+
+ #Get the session id and untaint it
+ if ($cookies{'AF_SID'} && $cookies{'AF_SID'}->value() =~ /^(.*)$/) {
+ $session_id = $1;
+ }
+
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File',
+ $session_id,
+ { Directory => $RT::MasonSessionDir,
+ LockDirectory => $RT::MasonSessionDir,
+ } ;
+ };
+
+ if ( $@ ) {
+ # If the session is invalid, create a new session.
+ if ( $@ =~ m#^Object does not exist in the data store# ) {
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File', undef,
+ { Directory => $RT::MasonSessionDir,
+ LockDirectory => $RT::MasonSessionDir,
+ };
+ undef $cookies{'AF_SID'};
+ }
+ else {
+ die "$@ \nProbably means that RT Couldn't write to session directory '$RT::MasonSessionDir'. Check that this directory's permissions are correct.";
+ }
+ }
+
+ if ( !$cookies{'AF_SID'} ) {
+ $cookie = new CGI::Cookie
+ (-name=>'AF_SID',
+ -value=>$HTML::Mason::Commands::session{_session_id},
+ -path => '/',);
+
+ } else {
+ $cookie = undef;
+ }
+
+ # }}}
+
+ $output = '';
+ eval {
+ my $status = $interp->exec($comp, %args);
+ };
+
+ if ($@) {
+ $output = "<PRE>$@</PRE>";
+ }
+
+ print "Content-Type: $HTML::Mason::Commands::ContentType\r\n";
+ print "Set-Cookie: $cookie\r\n" if ($cookie);
+ print "\r\n";
+ print $output;
+ untie %HTML::Mason::Commands::session;
+
+}
diff --git a/rt/bin/mason_handler.scgi b/rt/bin/mason_handler.scgi
index 8e1135c2f..b9846c898 100755
--- a/rt/bin/mason_handler.scgi
+++ b/rt/bin/mason_handler.scgi
@@ -1,41 +1,193 @@
-#!/usr/local/bin/speedy
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#!!!PERL!! -w
+
+#!/usr/bin/speedy -- -t600 -M8
+# $Header: /home/cvs/cvsroot/freeside/rt/bin/mason_handler.scgi,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# RT is (c) 1996-2001 Jesse Vincent (jesse@fsck.com);
+#
+# Contains code derived from mason.cgi
+# mason.cgi is Copyright December 2000 Joshua Kronengold (mneme@io.com,
+# mneme@cyberspace.org). All Rights Reserved.
use strict;
-require ('/opt/rt3/bin/webmux.pl');
+# {{{ Clean out the environment a little bit
+$ENV{'PATH'} = '/bin:/usr/bin'; # or whatever you need
+$ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
+$ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
+$ENV{'ENV'} = '' if defined $ENV{'ENV'};
+$ENV{'IFS'} = '' if defined $ENV{'IFS'};
+# }}}
+
+package RT::Mason;
+use HTML::Mason; # brings in subpackages: Parser, Interp, etc.
+use vars qw($VERSION %session $Nobody $SystemUser);
+
+# List of modules that you want to use from components (see Admin
+# manual for details)
+
+$VERSION="!!RT_VERSION!!";
+
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+
+
+#This drags in RT's config.pm
+use config;
+use Carp;
+
+use HTML::Mason::FakeApache;
+use CGI;
+
+# {{{ Set up CGI environment and grab CGI params:
-my $h = &RT::Interface::Web::NewCGIHandler();
+my $r=new HTML::Mason::FakeApache;
-require CGI;
+$|=1; # set output to non-buffered.
-RT::Init();
+my %cgi;
+CGI::ReadParse(\%cgi); # %cgi is now a tied hash containing our params.
-my $cgi = CGI->new;
-unless ($h->interp->comp_exists($cgi->path_info)) {
- $cgi->path_info($cgi->path_info . "/index.html");
+my $q=$cgi{CGI}; # $q now contains the object tied to %cgi.
+# }}}
+
+# {{{ require what we need
+{
+ package HTML::Mason::Commands;
+
+ use vars qw(%session);
+
+ use RT::Ticket;
+ use RT::Tickets;
+ use RT::Transaction;
+ use RT::Transactions;
+ use RT::User;
+ use RT::Users;
+ use RT::CurrentUser;
+ use RT::Template;
+ use RT::Templates;
+ use RT::Queue;
+ use RT::Queues;
+ use RT::ScripAction;
+ use RT::ScripActions;
+ use RT::ScripCondition;
+ use RT::ScripConditions;
+ use RT::Scrip;
+ use RT::Scrips;
+ use RT::Group;
+ use RT::Groups;
+ use RT::Keyword;
+ use RT::Keywords;
+ use RT::ObjectKeyword;
+ use RT::ObjectKeywords;
+ use RT::KeywordSelect;
+ use RT::KeywordSelects;
+ use RT::GroupMember;
+ use RT::GroupMembers;
+ use RT::Watcher;
+ use RT::Watchers;
+ use RT::Handle;
+ use RT::Interface::Web;
+ use MIME::Entity;
+ use CGI::Cookie;
+ use Date::Parse;
+ use HTML::Entities;
+
+
+ use Apache::Session::File;
+
+
}
-$h->handle_cgi_object($cgi);
+# }}}
+
+# {{{ RT Database setup
+ $RT::Handle = new RT::Handle;
+
+ $RT::Handle->Connect;
+
+ use RT::CurrentUser;
+
+ #RT's system user is a genuine database user. its id lives here
+ $RT::SystemUser = new RT::CurrentUser();
+ $RT::SystemUser->LoadByName('RT_System');
+
+ #RT's "nobody user" is a genuine database user. its ID lives here.
+ $RT::Nobody = new RT::CurrentUser();
+ $RT::Nobody->LoadByName('Nobody');
+
+
+# }}}
+
+
+
+
+# {{{ Deal with cookies
+
+my %cookies = fetch CGI::Cookie();
+eval {
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File',
+ ( $cookies{'AF_SID'} ? $cookies{'AF_SID'}->value() : undef );
+};
+
+if ( $@ ) {
+ # If the session is invalid, create a new session.
+ if ( $@ =~ m#^Object does not exist in the data store# ) {
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File', undef;
+ undef $cookies{'AF_SID'};
+ }
+}
+
+if ( !$cookies{'AF_SID'} ) {
+ my $cookie = new CGI::Cookie(
+ -name=>'AF_SID',
+ -value=>$HTML::Mason::Commands::session{_session_id},
+ -path => '/');
+ print 'Set-Cookie: '. $cookie."\r\n";
+}
+
+# }}}
+
+my $path=$ENV{PATH_INFO} || "/"; $path=~s/\'/\\\'/g;
+
+my $type=`/usr/bin/file '$RT::MasonComponentRoot/$path'`;
+
+# {{{ if it's a text file, handle it with mason.
+if($type=~/text|directory/) {
+ my ($out, %mason_params);
+ my $parser = RT::Interface::Web::NewParser(allow_globals=>[qw($r)]);
+ $mason_params{parser}=$parser;
+ $r->content_type('text/html');
+ # (get cookies line) ...
+ $r->access_hash('headers_in','Cookie',$ENV{HTTP_COOKIE});
+ $r->{'args@'}=[];
+ $mason_params{out_method}=\$out;
+
+ my $interp = RT::Interface::Web::NewInterp(%mason_params);
+
+ $interp->set_global(r=>$r);
+ $interp->exec($path,%cgi);
+ $r->send_http_header();
+ print $out;
+}
+# }}}
+
+# {{{ if it's not a text file, just stream it out.
+
+else { # file is binary, damn it
+ my $mime_type;
+ if ( $mime_type=
+ eval{ use MIME::Types;
+ my($type,$encoding)=MIME::Types::by_suffix($path);
+ $type; }) {
+ print $q->header($mime_type);
+ $path=~s/[\|\>\<\&]//g;
+ open F,"$RT::MasonComponentRoot/$path" or
+ die "couldn't open $path -- $!";
+ print while <F>;
+ close F;
+ } else {
+ die "couldn't resolve type of non-text file (!@; $type) -- install Mime::Types\n";
+ }
+ }
+
+# }}}
-1;
+untie %HTML::Mason::Commands::session;
diff --git a/rt/bin/rt-mailgate b/rt/bin/rt-mailgate
index b30443638..e6f0d95c5 100755
--- a/rt/bin/rt-mailgate
+++ b/rt/bin/rt-mailgate
@@ -1,587 +1,367 @@
-#!/usr/bin/perl -w
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-
-=head1 NAME
-
-rt-mailgate - Mail interface to RT3.
-
-=begin testing
-
-use RT::I18N;
-
-
-# {{{ Test new ticket creation by root who is privileged and superuser
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: root\@localhost
-To: rt\@example.com
-Subject: This is a test of new ticket creation
-
-Blah!
-Foob!
-EOF
-close (MAIL);
-
-use RT::Tickets;
-my $tickets = RT::Tickets->new($RT::SystemUser);
-$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$tickets->Limit(FIELD => 'id', OPERATOR => '>', VALUE => '0');
-my $tick = $tickets->First();
-ok (UNIVERSAL::isa($tick,'RT::Ticket'));
-ok ($tick->Id, "found ticket ".$tick->Id);
-ok ($tick->Subject eq 'This is a test of new ticket creation', "Created the ticket");
+#!!!PERL!! -w
-# }}}
-
-
-# {{{This is a test of new ticket creation as an unknown user
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
-Subject: This is a test of new ticket creation as an unknown user
-
-Blah!
-Foob!
-EOF
-close (MAIL);
-
-$tickets = RT::Tickets->new($RT::SystemUser);
-$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$tickets->Limit(FIELD => 'id' ,OPERATOR => '>', VALUE => '0');
-$tick = $tickets->First();
-ok ($tick->Id, "found ticket ".$tick->Id);
-ok ($tick->Subject ne 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
-my $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist@example.com');
-ok( $u->Id == 0, " user does not exist and was not created by failed ticket submission");
-
-
-# }}}
-
-# {{{ now everybody can create tickets. can a random unkown user create tickets?
-
-my $g = RT::Group->new($RT::SystemUser);
-$g->LoadSystemInternalGroup('Everyone');
-ok( $g->Id, "Found 'everybody'");
-
-my ($val,$msg) = $g->PrincipalObj->GrantRight(Right => 'CreateTicket');
-ok ($val, "Granted everybody the right to create tickets - $msg");
-
-sleep(60); # gotta sleep so the remote process' ACL cache times out
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist\@example.com
-To: rt\@example.com
-Subject: This is a test of new ticket creation as an unknown user
-
-Blah!
-Foob!
-EOF
-close (MAIL);
+# $Header: /home/cvs/cvsroot/freeside/rt/bin/rt-mailgate,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
-$tickets = RT::Tickets->new($RT::SystemUser);
-$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$tickets->Limit(FIELD => 'id' ,OPERATOR => '>', VALUE => '0');
-$tick = $tickets->First();
-ok ($tick->Id, "found ticket ".$tick->Id);
-ok ($tick->Subject eq 'This is a test of new ticket creation as an unknown user', "failed to create the new ticket from an unprivileged account");
-my $u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist@example.com');
-ok( $u->Id != 0, " user does not exist and was created by ticket submission");
+package RT;
+use strict;
+use vars qw($VERSION $Handle $Nobody $SystemUser);
+
+$VERSION="!!RT_VERSION!!";
+
+
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+
+use RT::Interface::Email qw(CleanEnv LoadConfig DBConnect
+ GetCurrentUser
+ GetMessageContent
+ CheckForLoops
+ CheckForSuspiciousSender
+ CheckForAutoGenerated
+ ParseMIMEEntityFromSTDIN
+ ParseTicketId
+ MailError
+ ParseCcAddressesFromHead
+ ParseSenderAddressFromHead
+ ParseErrorsToAddressFromHead
+ );
+
+#Clean out all the nasties from the environment
+CleanEnv();
+
+#Load etc/config.pm and drop privs
+LoadConfig();
+
+#Connect to the database and get RT::SystemUser and RT::Nobody loaded
+DBConnect();
+
+#Drop setgid permissions
+RT::DropSetGIDPermissions();
+
+use RT::Ticket;
+use RT::Queue;
+use MIME::Parser;
+use File::Temp;
+use Mail::Address;
+
+
+#Set some sensible defaults
+my $Queue = 1;
+my $time = time;
+my $Action = "correspond";
+
+my ($Verbose, $ReturnTid, $Debug);
+my ($From, $TicketId, $Subject,$SquelchReplies);
+
+# using --owner-from-extension, this will let you set ticket owner on create
+my $AssignTicketTo = undef;
+my ($status, $msg);
+
+# {{{ parse commandline
+
+while (my $flag = shift @ARGV) {
+ if (($flag eq '-v') or ($flag eq '--verbose')) {
+ $Verbose = 1;
+ }
+ if (($flag eq '-t') or ($flag eq '--ticketid')) {
+ $ReturnTid = 1;
+ }
+
+ if (($flag eq '-d') or ($flag eq '--debug')) {
+ $RT::Logger->debug("Debug mode enabled\n");
+ $Debug = 1;
+ }
+
+ if (($flag eq '-q') or ($flag eq '--queue')) {
+ $Queue = shift @ARGV;
+ }
+ if ($flag eq '--ticket-id-from-extension') {
+ $TicketId = $ENV{'EXTENSION'};
+ }
+ if ($flag eq '--queue-from-extension') {
+ $Queue = $ENV{'EXTENSION'};
+ }
+ if ($flag eq '--owner-from-extension') {
+ $AssignTicketTo = $ENV{'EXTENSION'};
+ }
+
+ if (($flag eq '-a') or ($flag eq '--action')) {
+ $Action = shift @ARGV;
+ }
+
+
+}
# }}}
+# get the current mime entity from stdin
+my ($entity, $head) = ParseMIMEEntityFromSTDIN();
-# {{{ can another random reply to a ticket without being granted privs? answer should be no.
-
-
-#($val,$msg) = $g->PrincipalObj->GrantRight(Right => 'CreateTicket');
-#ok ($val, "Granted everybody the right to create tickets - $msg");
-#sleep(60); # gotta sleep so the remote process' ACL cache times out
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
-
-Blah!
-Foob!
-EOF
-close (MAIL);
-
-$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2@example.com');
-ok( $u->Id == 0, " user does not exist and was not created by ticket correspondence submission");
-# }}}
-# {{{ can another random reply to a ticket after being granted privs? answer should be yes
+#Get someone to send runtime errors to;
+my $ErrorsTo = ParseErrorsToAddressFromHead($head);
+#Get us a current user object.
+my $CurrentUser = GetCurrentUser($head, $entity, $ErrorsTo);
-($val,$msg) = $g->PrincipalObj->GrantRight(Right => 'ReplyToTicket');
-ok ($val, "Granted everybody the right to reply to tickets - $msg");
-sleep(60); # gotta sleep so the remote process' ACL cache times out
+# We've already performed a warning and sent the mail off to somewhere safe ($RTOwner).
+# this is _exceedingly_ unlikely but we don't want to keep going if we don't have a current user
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist-2\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a reply as an unknown user
+unless ($CurrentUser->Id) {
+ exit(1);
+}
-Blah!
-Foob!
-EOF
-close (MAIL);
+my $MessageId = $head->get('Message-Id') ||
+ "<no-message-id-".time.rand(2000)."\@.$RT::Organization>";
+#Pull apart the subject line
+$Subject = $head->get('Subject') || "[no subject]";
+chomp $Subject;
-$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-2@example.com');
-ok( $u->Id != 0, " user exists and was created by ticket correspondence submission");
+# Get the ticket ID unless it's already set
+$TicketId = ParseTicketId($Subject) unless ($TicketId);
-# }}}
+#Set up a queue object
+my $QueueObj = RT::Queue->new($CurrentUser);
+$QueueObj->Load($Queue);
+unless ($QueueObj->id ) {
-# {{{ can another random comment on a ticket without being granted privs? answer should be no.
+ MailError(To => $RT::OwnerEmail,
+ Subject => "RT Bounce: $Subject",
+ Explanation => "RT couldn't find the queue: $Queue",
+ MIMEObj => $entity);
+}
-#($val,$msg) = $g->PrincipalObj->GrantRight(Right => 'CreateTicket');
-#ok ($val, "Granted everybody the right to create tickets - $msg");
-#sleep(60); # gotta sleep so the remote process' ACL cache times out
+# {{{ Lets check for mail loops of various sorts.
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action comment"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
+my $IsAutoGenerated = CheckForAutoGenerated($head);
-Blah!
-Foob!
-EOF
-close (MAIL);
+my $IsSuspiciousSender = CheckForSuspiciousSender($head);
-$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3@example.com');
-ok( $u->Id == 0, " user does not exist and was not created by ticket comment submission");
+my $IsALoop = CheckForLoops($head);
-# }}}
-# {{{ can another random reply to a ticket after being granted privs? answer should be yes
+#If the message is autogenerated, we need to know, so we can not
+# send mail to the sender
+if ($IsSuspiciousSender || $IsAutoGenerated || $IsALoop) {
+ $SquelchReplies = 1;
-($val,$msg) = $g->PrincipalObj->GrantRight(Right => 'CommentOnTicket');
-ok ($val, "Granted everybody the right to reply to tickets - $msg");
-sleep(60); # gotta sleep so the remote process' ACL cache times out
+ $ErrorsTo = $RT::OwnerEmail;
+
+ #TODO: Is what we want to do here really
+ # "Make the requestor cease to get mail from RT"?
+ # This might wreak havoc with vacation-mailing users.
+ # Maybe have a "disabled for bouncing" state that gets
+ # turned off when we get a legit incoming message
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action comment"), "Opened the mailgate - $@");
-print MAIL <<EOF;
-From: doesnotexist-3\@example.com
-To: rt\@example.com
-Subject: [example.com #@{[$tick->Id]}] This is a test of a comment as an unknown user
-
-Blah!
-Foob!
-EOF
-close (MAIL);
+}
-$u = RT::User->new($RT::SystemUser);
-$u->Load('doesnotexist-3@example.com');
-ok( $u->Id != 0, " user exists and was created by ticket comment submission");
+# {{{ Warn someone if it's a loop
+
+# Warn someone if it's a loop, before we drop it on the ground
+if ($IsALoop) {
+ $RT::Logger->crit("RT Received mail ($MessageId) from itself.");
+
+ #Should we mail it to RTOwner?
+ if ($RT::LoopsToRTOwner) {
+ MailError(To => $RT::OwnerEmail,
+ Subject => "RT Bounce: $Subject",
+ Explanation => "RT thinks this message may be a bounce",
+ MIMEObj => $entity);
+
+ #Do we actually want to store it?
+ exit unless ($RT::StoreLoops);
+ }
+}
# }}}
-# {{{ Testing preservation of binary attachments
-# Get a binary blob (Best Practical logo)
+ #Don't let the user stuff the RT-Squelch-Replies-To header.
+ if ($head->get('RT-Squelch-Replies-To')) {
+ $head->add('RT-Relocated-Squelch-Replies-To',
+ $head->get('RT-Squelch-Replies-To'));
+ $head->delete('RT-Squelch-Replies-To')
+ }
-# Create a mime entity with an attachment
-use MIME::Entity;
-my $entity = MIME::Entity->build( From => 'root@localhost',
- To => 'rt@localhost',
- Subject => 'binary attachment test',
- Data => ['This is a test of a binary attachment']);
+if ($SquelchReplies) {
+ ## TODO: This is a hack. It should be some other way to
+ ## indicate that the transaction should be "silent".
-# currently in lib/t/autogen
-$entity->attach(Path => '../../../html/NoAuth/images/spacer.gif',
- Type => 'image/gif',
- Encoding => 'base64');
-
-# Create a ticket with a binary attachment
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-
-$entity->print(\*MAIL);
-
-close (MAIL);
-
-my $tickets = RT::Tickets->new($RT::SystemUser);
-$tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$tickets->Limit(FIELD => 'id', OPERATOR => '>', VALUE => '0');
- $tick = $tickets->First();
-ok (UNIVERSAL::isa($tick,'RT::Ticket'));
-ok ($tick->Id, "found ticket ".$tick->Id);
-ok ($tick->Subject eq 'binary attachment test', "Created the ticket - ".$tick->Id);
-
-my $file = `cat ../../../html/NoAuth/images/spacer.gif`;
-ok ($file, "Read in the logo image");
-
-
- use Digest::MD5;
-warn "for the raw file the content is ".Digest::MD5::md5_base64($file);
-
-
-
-# Verify that the binary attachment is valid in the database
-my $attachments = RT::Attachments->new($RT::SystemUser);
-$attachments->Limit(FIELD => 'ContentType', VALUE => 'image/gif');
-ok ($attachments->Count == 1, 'Found only one gif in the database');
-my $attachment = $attachments->First;
-my $acontent = $attachment->Content;
-
- warn "coming from the database, the content is ".Digest::MD5::md5_base64($acontent);
-
-is( $acontent, $file, 'The attachment isn\'t screwed up in the database.');
-# Log in as root
-use Getopt::Long;
-use LWP::UserAgent;
-
-
-# Grab the binary attachment via the web ui
-my $ua = LWP::UserAgent->new();
-
-my $full_url = "http://localhost/Ticket/Attachment/".$attachment->TransactionId."/".$attachment->id."/spacer.gif?&user=root&pass=password";
-my $r = $ua->get( $full_url);
-
-
-# Verify that the downloaded attachment is the same as what we uploaded.
-is($file, $r->content, 'The attachment isn\'t screwed up in download');
-
-
-
-# }}}
-
-# {{{ Simple I18N testing
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-
-print MAIL <<EOF;
-From: root\@localhost
-To: rtemail\@example.com
-Subject: This is a test of I18N ticket creation
-Content-Type: text/plain; charset="utf-8"
-
-2 accented lines
-\303\242\303\252\303\256\303\264\303\273
-\303\241\303\251\303\255\303\263\303\272
-bye
-EOF
-close (MAIL);
-
-my $unitickets = RT::Tickets->new($RT::SystemUser);
-$unitickets->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$unitickets->Limit(FIELD => 'id', OPERATOR => '>', VALUE => '0');
-my $unitick = $unitickets->First();
-ok (UNIVERSAL::isa($unitick,'RT::Ticket'));
-ok ($unitick->Id, "found ticket ".$unitick->Id);
-ok ($unitick->Subject eq 'This is a test of I18N ticket creation', "Created the ticket - ". $unitick->Subject);
-
-
-
-my $unistring = "\303\241\303\251\303\255\303\263\303\272";
-Encode::_utf8_on($unistring);
-is ($unitick->Transactions->First->Content, $unitick->Transactions->First->Attachments->First->Content, "Content is ". $unitick->Transactions->First->Attachments->First->Content);
-ok($unitick->Transactions->First->Attachments->First->Content =~ /$unistring/i, $unitick->Id." appears to be unicode ". $unitick->Transactions->First->Attachments->First->Id);
-# supposedly I18N fails on the second message sent in.
-
-ok(open(MAIL, "|/opt/rt3/bin/rt-mailgate --url http://localhost/ --queue general --action correspond"), "Opened the mailgate - $@");
-
-print MAIL <<EOF;
-From: root\@localhost
-To: rtemail\@example.com
-Subject: This is a test of I18N ticket creation
-Content-Type: text/plain; charset="utf-8"
-
-2 accented lines
-\303\242\303\252\303\256\303\264\303\273
-\303\241\303\251\303\255\303\263\303\272
-bye
-EOF
-close (MAIL);
-
-my $tickets2 = RT::Tickets->new($RT::SystemUser);
-$tickets2->OrderBy(FIELD => 'id', ORDER => 'DESC');
-$tickets2->Limit(FIELD => 'id', OPERATOR => '>', VALUE => '0');
-my $tick2 = $tickets2->First();
-ok (UNIVERSAL::isa($tick2,'RT::Ticket'));
-ok ($tick2->Id, "found ticket ".$tick2->Id);
-ok ($tick2->Subject eq 'This is a test of I18N ticket creation', "Created the ticket");
-
-
-
-my $unistring = "\303\241\303\251\303\255\303\263\303\272";
-Encode::_utf8_on($unistring);
-
-ok ($tick2->Transactions->First->Content =~ $unistring, "It appears to be unicode - ".$tick2->Transactions->First->Content);
+ my ($Sender, $junk) = ParseSenderAddressFromHead($head);
+ $head->add('RT-Squelch-Replies-To', $Sender);
+}
# }}}
-($val,$msg) = $g->PrincipalObj->RevokeRight(Right => 'CreateTicket');
-ok ($val, $msg);
+# {{{ If we require that the sender be found in an external DB and they're not
+# forward this message to RTOwner
-=end testing
+if ($RT::LookupSenderInExternalDatabase &&
+ $RT::SenderMustExistInExternalDatabase ) {
-=cut
-
-
-use strict;
-use Getopt::Long;
-use LWP::UserAgent;
-
-use constant EX_TEMPFAIL => 75;
-
-my %opts;
-GetOptions( \%opts, "queue=s", "action=s", "url=s", "jar=s", "help", "debug", "extension=s" );
-
-if ( $opts{help} ) {
- require Pod::Usage;
- import Pod::Usage;
- pod2usage("RT Mail Gateway\n");
- exit 1; # Don't want to succeed if this is really an email!
+ MailError(To => $RT::OwnerEmail,
+ Subject => "RT Bounce: $Subject",
+ Explanation => "RT couldn't find requestor via its external database lookup",
+ MIMEObj => $entity);
+
}
-for (qw(url)) {
- die "$0 invoked improperly\n\nNo $_ provided to mail gateway!\n" unless $opts{$_};
-}
-
-undef $/;
-my $message = <>;
-my $ua = LWP::UserAgent->new();
-$ua->cookie_jar( { file => $opts{jar} } );
-
-my %args = (
- queue => $opts{queue},
- action => $opts{action},
- message => $message,
- SessionType => 'REST', # Surpress login box
-);
-
+# }}}
-if ($opts{'extension'}) {
- $args{$opts{'extension'}} = $ENV{'EXTENSION'};
+# {{{ elsif we don't have a ticket Id, we're creating a new ticket
+
+
+
+elsif (!defined($TicketId)) {
+
+ # {{{ Create a new ticket
+ if ($Action =~ /correspond/) {
+
+ # open a new ticket
+ my @Requestors = ($CurrentUser->id);
+
+ my @Cc;
+ if ($RT::ParseNewMessageForTicketCcs) {
+ @Cc = ParseCcAddressesFromHead(Head => $head,
+ CurrentUser => $CurrentUser,
+ QueueObj => $QueueObj );
+ }
+
+ my $Ticket = new RT::Ticket($CurrentUser);
+ my ($id, $Transaction, $ErrStr) =
+ $Ticket->Create ( Queue => $Queue,
+ Subject => $Subject,
+ Owner => $AssignTicketTo,
+ Requestor => \@Requestors,
+ Cc => \@Cc,
+ MIMEObj => $entity
+ );
+ if ($id == 0 ) {
+ MailError( To => $ErrorsTo,
+ Subject => "Ticket creation failed",
+ Explanation => $ErrStr,
+ MIMEObj => $entity
+ );
+ $RT::Logger->error("Create failed: $id / $Transaction / $ErrStr ");
+ }
+ }
+
+ # }}}
+
+ else {
+ #TODO Return an error message
+ MailError( To => $ErrorsTo,
+ Subject => "No ticket id specified",
+ Explanation => "$Action aliases require a TicketId to work on",
+ MIMEObj => $entity
+ );
+
+ $RT::Logger->crit("$Action aliases require a TicketId to work on ".
+ "(from ".$CurrentUser->UserObj->EmailAddress.") ".
+ $MessageId);
+ }
}
-# Set up cookie here.
-
-my $full_url = $opts{'url'}. "/REST/1.0/NoAuth/mail-gateway";
-warn "Connecting to $full_url" if $opts{'debug'};
-
-
-
-my $r = $ua->post( $full_url, {%args} );
-check_failure($r);
-
-my $content = $r->content;
-warn $content if ($opts{debug});
-
-if ( $content !~ /^(ok|not ok)/ ) {
-
- # It's not the server's fault if the mail is bogus. We just want to know that
- # *something* came out of the server.
- die <<EOF
-RT server error.
-
-The RT server which handled your email did not behave as expected. It
-said:
-
-$content
-EOF
-
-}
+# }}}
-sub check_failure {
- my $r = shift;
- return if $r->is_success();
-
- # This ordinarily oughtn't to be able to happen, suggests a bug in RT.
- # So only load these heavy modules when they're needed.
- require HTML::TreeBuilder;
- require HTML::FormatText;
-
- my $error = $r->error_as_HTML;
- my $tree = HTML::TreeBuilder->new->parse($error);
- $tree->eof;
-
- # It'll be a cold day in hell before RT sends out bounces in HTML
- my $formatter = HTML::FormatText->new( leftmargin => 0,
- rightmargin => 50 );
- warn $formatter->format($tree);
- warn "This is $0 exiting because of an undefined server error" if ($opts{debug});
- exit EX_TEMPFAIL;
+# {{{ If we've got a ticket ID, update the ticket
+
+else {
+
+ # If the action is comment, add a comment.
+ if ($Action =~ /comment/i){
+
+ my $Ticket = new RT::Ticket($CurrentUser);
+ $Ticket->Load($TicketId);
+ unless ($Ticket->Id) {
+ MailError( To => $ErrorsTo,
+ Subject => "Comment not recorded",
+ Explanation => "Could not find a ticket with id $TicketId",
+ MIMEObj => $entity
+ );
+ #Return an error message saying that Ticket "#foo" wasn't found.
+ }
+
+ ($status, $msg) = $Ticket->Comment(MIMEObj=>$entity);
+ unless ($status) {
+ #Warn the sender that we couldn't actually submit the comment.
+ MailError( To => $ErrorsTo,
+ Subject => "Comment not recorded",
+ Explanation => $msg,
+ MIMEObj => $entity
+ );
+ }
+ }
+
+ # If the message is correspondence, add it to the ticket
+ elsif ($Action =~ /correspond/i) {
+ my $Ticket = RT::Ticket->new($CurrentUser);
+ $Ticket->Load($TicketId);
+
+ #TODO: Check for error conditions
+ ($status, $msg) = $Ticket->Correspond(MIMEObj => $entity);
+ unless ($status) {
+
+ #Return mail to the sender with an error
+ MailError( To => $ErrorsTo,
+ Subject => "Correspondence not recorded",
+ Explanation => $msg,
+ MIMEObj => $entity
+ );
+ }
+ }
+
+ else {
+ #Return mail to the sender with an error
+ MailError( To => $ErrorsTo,
+ Subject => "RT Configuration error",
+ Explanation => "'$Action' not a recognized action.".
+ " Your RT administrator has misconfigured ".
+ "the mail aliases which invoke RT" ,
+ MIMEObj => $entity
+ );
+
+ $RT::Logger->crit("$Action type unknown for $MessageId");
+
+ }
+
}
+# }}}
-=head1 SYNOPSIS
-
- rt-mailgate --help : this text
-
-Usual invocation (from MTA):
-
- rt-mailgate --action (correspond|comment) --queue queuename
- --url http://your.rt.server/
- [ --extension (queue|action|ticket)
-
-See C<man rt-mailgate> for more.
-
-=head1 OPTIONS
-
-=over 3
-
-=item C<--action>
-
-Specifies whether this is a correspondence or comment address.
-
-=item C<--queue>
-
-Reflects which queue this address handles.
-
-=item C<--url>
-
-The location of the web server for your RT instance.
-
-
-=item C<--extension> OPTIONAL
-
-Some MTAs will route mail sent to user-foo@host or user+foo@host to user@host
-and present "foo" in the environment variable $EXTENSION. By specifying
-the value "queue" for this parameter, the queue this message should be
-submitted to will be set to the value of $EXTENSION. By specifying
-"ticket", $EXTENSION will be interpreted as the id of the ticket this message
-is related to. "action" will allow the user to specify either "comment" or
-"correspond" in the address extension.
-
-
-=head1 DESCRIPTION
-
-The RT mail gateway is the primary mechanism for communicating with RT
-via email. This program simply directs the email to the RT web server,
-which handles filing correspondence and sending out any required mail.
-It is designed to be run as part of the mail delivery process, either
-called directly by the MTA or C<procmail>, or in a F<.forward> or
-equivalent.
-
-=head1 SETUP
-
-Much of the set up of the mail gateway depends on your MTA and mail
-routing configuration. However, you will need first of all to create an
-RT user for the mail gateway and assign it a password; this helps to
-ensure that mail coming into the web server did originate from the
-gateway.
-
-Next, you need to route mail to C<rt-mailgate> for the queues you're
-monitoring. For instance, if you're using F</etc/aliases> and you have a
-"bugs" queue, you will want something like this:
-
- bugs: "|/opt/rt3/bin/rt-mailgate --queue bugs --action correspond
- --url http://rt.mycorp.com/"
-
- bugs-comment: "|/opt/rt3/bin/rt-mailgate --queue bugs --action comment
- --url http://rt.mycorp.com/"
-
-Note that you don't have to run your RT server on your mail server, as
-the mail gateway will happily relay to a different machine.
-
-=head1 CUSTOMIZATION
-
-By default, the mail gateway will accept mail from anyone. However,
-there are situations in which you will want to authenticate users
-before allowing them to communicate with the system. You can do this
-via a plug-in mechanism in the RT configuration.
-
-You can set the array C<@RT::MailPlugins> to be a list of plugins. The
-default plugin, if this is not given, is C<Auth::MailFrom> - that is,
-authentication of the person is done based on the C<From> header of the
-email. If you have additional filters or authentication mechanisms, you
-can list them here and they will be called in order:
-
- @RT::MailPlugins = (
- "Filter::SpamAssassin",
- "Auth::LDAP",
- # ...
- );
-
-See the documentation for any additional plugins you have.
-
-You may also put Perl subroutines into the C<@RT::MailPlugins> array, if
-they behave as described below.
-
-=head1 WRITING PLUGINS
-
-What's actually going on in the above is that C<@RT::MailPlugins> is a
-list of Perl modules; RT prepends C<RT::Interface::Email::> to the name,
-to form a package name, and then C<use>'s this module. The module is
-expected to provide a C<GetCurrentUser> subroutine, which takes a hash of
-several parameters:
-
-=over 4
-
-=item Message
-
-A C<MIME::Entity> object representing the email
-=item CurrentUser
-
-An C<RT::CurrentUser> object
-
-=item AuthStat
-
-The authentication level returned from the previous plugin.
-
-=item Ticket [OPTIONAL]
-
-The ticket under discussion
-
-=item Queue [OPTIONAL]
-
-If we don't already have a ticket id, we need to know which queue we're talking about
+$RT::Handle->Disconnect();
-=item Action
-The action being performed. At the moment, it's one of "comment" or "correspond"
+# Everything below this line is a helper sub. most of them will eventually
+# move to Interface::Email
-=back 4
+#When we call die, trap it and log->crit with the value of the die.
+$SIG{__DIE__} = sub {
+ unless ($^S || !defined $^S ) {
+ $RT::Logger->crit("$_[0]");
+ MailError( To => $ErrorsTo,
+ Bcc => $RT::OwnerEmail,
+ Subject => "RT Critical error. Message not recorded!",
+ Explanation => "$_[0]",
+ MIMEObj => $entity
+ );
+ exit(-1);
+ }
+ else {
+ #Get out of here if we're in an eval
+ die $_[0];
+ }
+};
-It returns two values, the new C<RT::CurrentUser> object, and the new
-authentication level. The authentication level can be zero, not allowed
-to communicate with RT at all, (a "permission denied" error is mailed to
-the correspondent) or one, which is the normal mode of operation.
-Additionally, if C<-1> is returned, then the processing of the plug-ins
-stops immediately and the message is ignored.
-=cut
+1;
diff --git a/rt/bin/rtadmin b/rt/bin/rtadmin
new file mode 100644
index 000000000..25ba1b06a
--- /dev/null
+++ b/rt/bin/rtadmin
@@ -0,0 +1,1040 @@
+#!!!PERL!! -w
+#
+# $Header: /home/cvs/cvsroot/freeside/rt/bin/Attic/rtadmin,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# RT is (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
+
+use strict;
+use Carp;
+use Getopt::Long qw(:config pass_through);
+
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+
+use RT::Interface::CLI qw(CleanEnv LoadConfig DBConnect
+ GetCurrentUser GetMessageContent);
+
+#Clean out all the nasties from the environment
+CleanEnv();
+
+#Load etc/config.pm and drop privs
+LoadConfig();
+
+#Connect to the database and get RT::SystemUser and RT::Nobody loaded
+DBConnect();
+
+#Drop setgid permissions
+RT::DropSetGIDPermissions();
+
+#Get the current user all loaded
+my $CurrentUser = GetCurrentUser();
+
+unless ($CurrentUser->Id) {
+ print "No RT user found. Please consult your RT administrator.\n";
+ exit(1);
+}
+
+
+
+
+PickMode();
+
+
+# {{{ Help
+
+sub Help {
+
+ # {{{ help_acl
+my $help_acl ="
+ Access control
+ --grant-right <right>
+ --revoke-right <right>
+ --userid <user>
+ --groupid <group>
+ --list-rights";
+
+# }}}
+
+ # {{{ help_keyword_sel
+my $help_keyword_sel = "
+ Keyword Selections
+ --add-keyword-select
+ --modify-keyword-select <name>
+ --ks-name <name>
+ --ks-keyword <keyword>
+ --ks-single
+ --ks-multiple
+ --ks-depth <int>
+
+ --disable-keyword-select <name>";
+# }}}
+
+ # {{{ help_scrip
+my $help_scrip = "
+ Scrips
+ --create-scrip
+ --scrip-condition <condition name or id>
+ --scrip-action <action name or id>
+ --scrip-template <template name or id>
+
+ --delete-scrip <id>
+ --list-scrips";
+
+# }}}
+
+ # {{{ help_template
+my $help_template = "
+ Templates
+ --delete-template [<id>|<name>]
+ --display-template [<id>|<name>]
+
+ --create-template
+ --modify-template [<id>|<name>]
+ Flags for --create-template and --modify-template
+ --template-name
+ --template-description
+ --template-edit-content
+
+ --list-templates";
+
+# }}}
+
+
+print <<EOF;
+
+USAGE: rtadmin --user <userid> [Userflags]
+ rtadmin --list-users
+ rtadmin --queue <queueid> [Queueflags]
+ rtadmin --list-queues
+ rtadmin --group [groupflags]
+ rtadmin --list-groups
+ rtadmin --system [SystemFlags]
+ rtadmin --keyword [keywordflags]
+
+User configuration for --user <userid>
+
+ --disable
+ --create
+ --display
+
+ Core Attributes
+ --userid
+ --gecos
+ --password
+ --emailaddress
+ --privileged
+ --comments
+ --signature
+ --organization
+
+ Names
+ --realname
+ --nickname
+
+ Auth and external info
+ --externalcontactinfoid
+ --contactinfosystem
+ --externalauthid
+ --authsystem
+
+ Phone numbers
+ --pagerphone
+ --workphone
+ --mobilemphone
+ --homephone
+
+ Paper address
+ --address1
+ --address2
+ --city
+ --state
+ --zip
+ --country
+ --freeformcontactqinfo
+
+
+Group Configuration for --group <groupid>
+ --create
+ --delete
+ --display
+
+ --name <new name>
+ --description <new description>
+
+
+
+ --add-member <userid>
+ --delete-member <userid>
+ --list-members
+
+Queue Configuration for --queue <queueid>
+ --create
+ --disable
+ --display
+
+ --name <name>
+ --correspondaddress <email address>
+ --commentaddress <email address>
+ --initialpriority <int>
+ --finalpriority <int>
+ --defaultduein <days>
+
+ --add-cc <email address>
+ --delete-cc <email address>
+ --add-admincc <email address>
+ --delete-admincc <email address>
+ --list-watchers
+
+
+
+$help_acl
+
+$help_keyword_sel
+
+$help_template
+
+$help_scrip
+
+
+System configuration for --system
+
+$help_acl
+
+$help_keyword_sel
+
+$help_template
+
+$help_scrip
+
+
+Keyword configuration for --keyword <fully qualified name>
+ --list-children
+ --create-child <name>
+ --disable
+ --name <new name>
+ --description <new description>
+
+EOF
+
+
+
+}
+
+# }}}
+
+# {{{ PickMode
+
+sub PickMode {
+ my ($user,$group, $queue, $system, $keyword, $listusers,
+ $listgroups, $listqueues, $help);
+
+
+ GetOptions ('help|h|usage' => \$help,
+ 'user=s' => \$user,
+ 'queue=s' => \$queue,
+ 'group=s' => \$group,
+ 'system' => \$system,
+ 'keyword=s', => \$keyword,
+ 'list-users' => \$listusers,
+ 'list-queues' => \$listqueues,
+ 'list-groups' => \$listgroups,
+ );
+
+
+
+ if ($user) { AdminUser($user) }
+ elsif ($group) { AdminGroup($group) }
+ elsif ($queue) { AdminQueue($queue) }
+ elsif ($system) { AdminSystem($system) }
+ elsif ($keyword) { AdminKeywords($keyword) }
+ elsif ($listusers) { ListUsers() }
+ elsif ($listgroups) { ListGroups() }
+ elsif ($listqueues) { ListQueues() }
+ elsif ($help) { Help()}
+ else {
+ print "No command found\n";
+ }
+ exit(0);
+}
+
+# }}}
+
+# {{{ AdminUser
+
+sub AdminUser {
+ my $user=shift;
+ my %args;
+
+ GetOptions(\%args,
+ 'create', 'disable|delete', 'display',
+ 'Name=s', 'Gecos=s', 'Password=s',
+ 'EmailAddress=s', 'Privileged=s', 'Comments=s', 'Signature=s',
+ 'Organization=s', 'RealName=s', 'NickName=s',
+ 'ExternalContactInfoId=s', 'ContactInfoSystem=s',
+ 'ExternalAuthId=s', 'AuthSystem=s',
+ 'HomePhone=s', 'WorkPhone=s', 'MobilePhone=s', 'PagerPhone=s',
+ 'Address1=s', 'Address2=s', 'City=s', 'State=s', 'Zip=s',
+ 'Country=s', 'FreeformContactInfo=s');
+
+ my $user_obj = new RT::User($CurrentUser);
+
+
+ #Create the user if we need to
+ if ($args{'create'}) {
+ my ($status, $msg) =
+ $user_obj->Create( Name => ($args{'Name'} || $user),
+ Gecos => $args{'Gecos'},
+ Password => $args{'Password'},
+ EmailAddress => $args{'EmailAddress'},
+ Privileged => $args{'Privileged'},
+ Comments => $args{'Comments'},
+ Signature => $args{'Signature'},
+ Organization => $args{'Organization'},
+ RealName => $args{'RealName'},
+ NickName => $args{'NickName'},
+ ExternalContactInfoId => $args{'ExternalContactInfoId'},
+ ContactInfoSystem => $args{'ContactInfoSystem'},
+ ExternalAuthId => $args{'ExternalAuthId'},
+ AuthSystem => $args{'AuthSystem'},
+ HomePhone => $args{'HomePhone'},
+ WorkPhone => $args{'WorkPhone'},
+ MobilePhone => $args{'MobilePhone'},
+ PagerPhone => $args{'PagerPhone'},
+ Address1 => $args{'Address1'},
+ Address2 => $args{'Address2'},
+ City => $args{'City'},
+ State => $args{'State'},
+ Zip => $args{'Zip'},
+ FreeformContactInfo => $args{'FreeformContactInfo'}
+ );
+
+ print "$msg\n";
+ return();
+
+ }
+ else {
+
+
+ #Load the user
+ $user_obj->Load($user);
+
+ unless ($user_obj->id) {
+ print "User '$user' not found\n";
+ return();
+ }
+
+
+
+ #modify the user if we need to
+ my @attributes = ('Name', 'Gecos',
+ 'EmailAddress', 'Privileged', 'Comments', 'Signature',
+ 'Organization', 'RealName', 'NickName',
+ 'ExternalContactInfoId', 'ContactInfoSystem',
+ 'ExternalAuthId', 'AuthSystem',
+ 'HomePhone', 'WorkPhone', 'MobilePhone', 'PagerPhone',
+ 'Address1', 'Address2', 'City', 'State', 'Zip',
+ 'Country', 'FreeformContactInfo');
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"$attrib"})) and
+ ($user_obj->$attrib() ne $args{"$attrib"})) {
+
+ my $method = "Set$attrib";
+ my ($val, $msg) = $user_obj->$method($args{"$attrib"});
+ print "User ".$user_obj->Name. " $attrib: $msg\n";
+
+ }
+ }
+
+ if (exists ($args{'Password'})) {
+ my ($code, $msg);
+ ($code, $msg) = $user_obj->SetPassword($args{'Password'});
+ print "User ". $user_obj->Name. ' Password: '. $msg . "\n";
+ }
+
+ #Check if we need to display the user
+ if ($args{'display'}) {
+ foreach my $attrib (@attributes) {
+ next if ($attrib eq 'Password'); #Can't see the password
+ printf("%22.22s %-64s\n",$attrib, ($user_obj->$attrib()||'(undefined)'));
+
+ }
+ }
+
+ #Check if we need to delete the user
+ if ($args{'disable'}) {
+ my ($val, $msg) = $user_obj->SetDisabled(1);
+ print "$msg\n";
+ }
+
+ }
+}
+
+# }}}
+
+# {{{ AdminQueue
+
+sub AdminQueue {
+ my $queue=shift;
+ my %args;
+
+ GetOptions(\%args,
+ 'create', 'disable|delete', 'display',
+ 'Name=s', 'CorrespondAddress=s', 'Description=s',
+ 'CommentAddress=s', 'InitialPriority=n', 'FinalPriority=n',
+ 'DefaultDueIn=n',
+
+ 'add-cc=s@', 'add-admincc=s@',
+ 'delete-cc=s@', 'delete-admincc=s@',
+ 'list-watchers', 'create-template'
+ );
+
+ use RT::Queue;
+ my $queue_obj = new RT::Queue($CurrentUser);
+
+ #Create the queue if we need to
+ if ($args{'create'}) {
+ my ($status, $msg) =
+ $queue_obj->Create(
+ Name => ($args{'Name'} || $queue) ,
+ CorrespondAddress => $args{'CorrespondAddress'},
+ Description => $args{'Description'},
+ CommentAddress => $args{'CommentAddress'},
+ InitialPriority => $args{'InitialPriority'},
+ FinalPriority => $args{'FinalPriority'},
+ DefaultDueIn => $args{'DefaultDueIn'}
+ );
+
+ print "$msg\n";
+ }
+ else {
+ #Load the queue
+ $queue_obj->Load($queue);
+
+ unless ($queue_obj->id) {
+ print "Queue '$queue' not found\n";
+ return();
+ }
+
+ #modify if we need to
+ my @attributes = qw(Name CorrespondAddress Description
+ CommentAddress InitialPriority FinalPriority
+ DefaultDueIn
+ );
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"$attrib"})) and
+ ($queue_obj->$attrib() ne $args{"$attrib"})) {
+
+ my $method = "Set$attrib";
+ my ($val, $msg) = $queue_obj->$method($args{"$attrib"});
+ print "Queue ".$queue_obj->Name. " $attrib: $msg\n";
+
+ }
+ }
+
+
+ #Check if we need to display the queue
+ if ($args{'display'}) {
+ foreach my $attrib (@attributes) {
+ printf("%22.22s %-64s\n",$attrib, ($queue_obj->$attrib()||'(undefined)'));
+
+ }
+ }
+
+ foreach my $person (@{$args{'add-cc'}}) {
+ my ($val, $msg) = $queue_obj->AddCc(Email => $person);
+ print "$msg\n";
+ }
+ foreach my $person (@{$args{'add-admincc'}}) {
+ my ($val, $msg) = $queue_obj->AddAdminCc(Email => $person);
+ print "$msg\n";
+ }
+
+ foreach my $person (@{$args{'delete-cc'}}) {
+ my ($val, $msg) = $queue_obj->DeleteCc($person);
+ print "$msg\n";
+ }
+ foreach my $person (@{$args{'delete-admincc'}}) {
+ my ($val, $msg) = $queue_obj->DeleteAdminCc($person);
+ print "$msg\n";
+ }
+
+ if ($args{'list-watchers'}) {
+ require RT::Watchers;
+ my $watchers = new RT::Watchers($CurrentUser);
+ $watchers->LimitToQueue($queue_obj->id);
+ while (my $watcher = $watchers->Next()) {
+ printf("%10s %-60s\n",
+ $watcher->Type, $watcher->Email );
+ }
+ }
+
+ AdminTemplates($queue_obj->Id());
+ AdminScrips($queue_obj->Id());
+ AdminRights($queue_obj->Id());
+ AdminKeywordSelects($queue_obj->Id());
+
+ #Check if we need to delete the queue
+ if ($args{'disable'}) {
+ my ($val, $msg) = $queue_obj->SetDisabled(1);
+ print "$msg\n";
+ }
+
+ }
+}
+
+# }}}
+
+# {{{ AdminKeywords
+
+sub AdminKeywords {
+ my $keyword = shift;
+
+ my %args;
+ GetOptions(\%args, 'list-children', 'create-child=s', 'disable|delete', 'Name=s', 'Description=s');
+
+ use RT::Keyword;
+
+ my $key_obj = new RT::Keyword($CurrentUser);
+ my $key_id;
+
+ #If we're dealing with the root of the keyword list
+ if ($keyword eq '/') {
+ $key_id=0;
+ }
+ else {
+ my ($val, $msg) = $key_obj->LoadByPath( $keyword );
+ unless ($val) {
+ print $msg ."\n";
+ }
+ $key_id = $key_obj->Id();
+ }
+
+ if ($args{'create-child'}) {
+ my $child = new RT::Keyword($CurrentUser);
+
+ my ($val, $msg) = $child->Create( Parent => $key_id,
+ Name => $args{'create-child'},
+ );
+ print $msg ."\n";
+ }
+
+ elsif ($args{'list-children'}) {
+ my $keywords;
+ if ($key_obj->id) {
+ $keywords = $key_obj->Children();
+ }
+ #If we didn't actually have a keyword object, we need to create our own Keywords object.
+ else {
+ $keywords = new RT::Keywords($CurrentUser);
+ $keywords->LimitToParent(0);
+ }
+
+ while (my $key=$keywords->Next) {
+ print $key->Name;
+ if ($key->Description) {
+ print " (" . $key->Description .")";
+ }
+ print "\n";
+ }
+
+
+ }
+
+ #Else we wanna do some modification.
+ else {
+
+ #If we didn't load a keyword, get out
+ return(undef) unless ($key_obj->Id);
+
+
+ my @attributes = qw( Name Description );
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"$attrib"})) and
+ ($key_obj->$attrib() ne $args{"$attrib"})) {
+
+ my $method = "Set$attrib";
+ my ($val, $msg) = $key_obj->$method($args{"$attrib"});
+
+ print "Keyword ".$key_obj->Name. " $attrib: $msg\n"; }
+ }
+
+ if ($args{'disable'}) {
+ $key_obj->SetDisabled(1);
+
+ }
+
+ }
+}
+
+# }}}
+
+# {{{ AdminKeywordSelects
+
+sub AdminKeywordSelects {
+ my $queue = shift;
+ # O for queue means global
+
+ my %args;
+ GetOptions(\%args, 'add-keyword-select','disable-keyword-select|delete-keyword-select=s',
+ 'modify-keyword-select=s',
+ 'keyword-select-Keyword|ks-keyword=s',
+ 'keyword-select-Single|ks-single',
+ 'keyword-select-Multiple|ks-multiple',
+ 'keyword-select-Depth|ks-depth=i',
+ 'keyword-select-Name|ks-name=s'
+ );
+
+ # sanitize single vs multiple.
+ if ($args{'keyword-select-Multiple'}) {
+ $args{'keyword-select-Single'} = 0;
+ }
+
+ use RT::KeywordSelect;
+ my $keysel_obj = new RT::KeywordSelect($CurrentUser);
+ if ($args{'add-keyword-select'}) {
+
+ my ($val, $msg) = $keysel_obj->Create( Keyword => $args{'keyword-select-Keyword'},
+ Depth => $args{'keyword-select-Depth'},
+ Single => $args{'keyword-select-Single'},
+ Name => $args{'keyword-select-Name'},
+ ObjectType => 'Ticket',
+ ObjectField => 'Queue',
+ ObjectValue => $queue);
+ print $msg ."\n";
+ }
+ elsif ($args{'modify-keyword-select'}) {
+ $keysel_obj->LoadByName(Name => $args{'modify-keyword-select'},
+ Queue => $queue
+ );
+
+ unless ($keysel_obj->Id()) {
+ print "Keyword select not found\n";
+ return();
+ }
+ my @attributes = qw( Name Keyword Single Depth );
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"keyword-select-$attrib"})) and
+ ($keysel_obj->$attrib() ne $args{"keyword-select-$attrib"})) {
+
+ my $method = "Set$attrib";
+ my ($val, $msg) = $keysel_obj->$method($args{"keyword-select-$attrib"});
+
+ print "Keyword select ".$keysel_obj->Name. " $attrib: $msg\n"; }
+ }
+
+
+ }
+
+
+ elsif ($args{'disable-keyword-select'}) {
+ $keysel_obj->LoadByName(Name => $args{'disable-keyword-select'},
+ Queue => $queue);
+
+ $keysel_obj->SetDisabled(1);
+
+ }
+}
+
+# }}}
+
+# {{{ AdminGroup
+
+sub AdminGroup {
+ my $group = shift;
+
+ my (%args);
+
+ GetOptions(\%args,
+ 'create', 'delete', 'display',
+ 'Name=s', 'Description=s',
+
+ 'add-member=s@', 'delete-member=s@',
+ 'list-members'
+ );
+
+
+ use RT::Group;
+ my $group_obj = new RT::Group($CurrentUser);
+ unless ($group) {
+ print "Group not specified.\n";
+ return();
+ }
+
+
+ #Create the group if we need to
+ if ($args{'create'}) {
+ my ($val, $msg) = $group_obj->Create( Name => ($args{'Name'} || $group),
+ Description => $args{'Description'} );
+ print $msg ."\n";
+ }
+ #otherwise we load it
+ else {
+ $group_obj->Load($group);
+ }
+
+ #If we have no group object, get the hell out
+ unless ($group_obj->Id) {
+ print "Group not found.\n";
+ }
+
+ if ($args{'delete'}) {
+ my ($val, $msg) = $group_obj->Delete();
+ print $msg ."\n";
+ return();
+ }
+
+
+
+ #modify if we need to
+ my @attributes = qw(Name Description
+
+ );
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"$attrib"})) and
+ ($group_obj->$attrib() ne $args{"$attrib"})) {
+
+ my $method = "Set$attrib";
+ my ($val, $msg) = $group_obj->$method($args{"$attrib"});
+ print "Group ".$group_obj->Name. " $attrib: $msg\n";
+
+ }
+ }
+
+ foreach my $user (@{$args{'add-member'}}) {
+ my ($val, $msg) = $group_obj->AddMember($user);
+ print $msg. "\n";
+ }
+ foreach my $user (@{$args{'delete-member'}}) {
+ my ($val, $msg) = $group_obj->DeleteMember($user);
+ print $msg ."\n";
+ }
+
+ if ($args{'list-members'}) {
+ my $members = $group_obj->MembersObj();
+ while (my $member = $members->Next()) {
+ print $member->UserObj->Name() ."\n";
+ }
+ }
+
+}
+
+# }}}
+
+# {{{ AdminSystem
+sub AdminSystem {
+ print "In AdminSystem\n";
+
+ AdminTemplates(0);
+ AdminScrips(0);
+ AdminRights(0);
+ AdminKeywordSelects(0);
+}
+# }}}
+
+# {{{ sub AdminTemplates
+
+sub AdminTemplates {
+ my $queue = shift;
+ #Queue = 0 means 'global';
+
+ my %args;
+
+
+ GetOptions(\%args, 'list-templates', 'create-template','modify-template=s',
+ 'delete-template=s', 'display-template=s',
+ 'template-Name=s', 'template-Description=s',
+ 'template-edit-content!');
+
+ # {{{ List templates
+ if ($args{'list-templates'}) {
+ print "Templates for $queue\n";
+ require RT::Templates;
+ my $templates = new RT::Templates($CurrentUser);
+ if ($queue != 0) {
+ $templates->LimitToQueue($queue);
+ }
+ else {
+ $templates->LimitToGlobal();
+ }
+ while (my $template = $templates->Next) {
+ print $template->Id.": ".$template->Name." - " . $template->Description ."\n";
+ }
+ }
+
+ # }}}
+
+ require RT::Template;
+ my $template = new RT::Template($CurrentUser);
+ if ($args{'delete-template'}) {
+ $template->Load($args{'delete-template'});
+ unless ($template->id) {
+ print "Couldn't load template";
+ return(undef);
+ }
+ my ($val, $msg) = $template->Delete();
+ print "$msg\n";
+ }
+ elsif ($args{'create-template'}) {
+ #TODO edit the template content
+ my $content;
+
+ my $linesref = GetMessageContent(CurrentUser => $CurrentUser,
+ Edit => 1);
+
+ $content = join("\n", @{$linesref});
+
+
+ my ($val, $msg) = $template->Create(Name => $args{'template-Name'},
+ Description => $args{'template-Description'},
+ Content => $content,
+ Queue => $queue);
+ print "$msg\n";
+ }
+ elsif ($args{'modify-template'}) {
+
+ $template->Load($args{'modify-template'});
+ unless ($template->Id()) {
+ print "Template not found\n";
+ return();
+ }
+ my @attributes = qw( Name Description );
+ foreach my $attrib (@attributes) {
+ if ( (exists ($args{"template-$attrib"})) and
+ ($template->$attrib() ne $args{"template-$attrib"})) {
+
+ my $method = "Set$attrib";
+ my $val = $template->$method($args{"template-$attrib"});
+
+ }
+ }
+ if ($args{'template-edit-content'}) {
+
+ my $linesref = GetMessageContent(CurrentUser => $CurrentUser,
+ Content => $template->Content,
+ Edit => 1);
+
+ my $content = join("\n", @{$linesref});
+ my ($val) = $template->SetContent($content);
+ print $val."\n";
+ }
+
+ }
+ if ($args{'display-template'}) {
+ $template->Load($args{'display-template'});
+ print $template->Name . "\n". $template->Description ."\n". $template->Content."\n";
+ }
+}
+
+# }}}
+
+# {{{ sub AdminScrips
+
+sub AdminScrips {
+ my $queue = shift;
+ #Queue = 0 means 'global';
+
+ my %args;
+
+
+ GetOptions(\%args, 'list-scrips', 'create-scrip','modify-scrip=s',
+ 'scrip-action=s', 'scrip-template=s', 'scrip-condition=s',
+ 'delete-scrip=s');
+
+
+ # {{{ List entries
+ if ($args{'list-scrips'}) {
+ print "Scrips for $queue\n";
+ require RT::Scrips;
+ my $scrips = new RT::Scrips($CurrentUser);
+ if ($queue != 0) {
+ $scrips->LimitToQueue($queue);
+ }
+ else {
+ $scrips->LimitToGlobal();
+ }
+ while (my $scrip = $scrips->Next) {
+ print $scrip->Id.": If ".
+ $scrip->ConditionObj->Name." then " .
+ $scrip->ActionObj->Name." with template " .
+ $scrip->TemplateObj->Name."\n";
+ }
+ }
+
+ # }}}
+
+ require RT::Scrip;
+ my $scrip = new RT::Scrip($CurrentUser);
+ if ($args{'delete-scrip'}) {
+ $scrip->Load($args{'delete-scrip'});
+ unless ($scrip->id) {
+ print "Couldn't load scrip";
+ return(undef);
+ }
+ my ($val, $msg) = $scrip->Delete();
+ print "$msg\n";
+ }
+ elsif ($args{'create-scrip'}) {
+ my ($val, $msg) = $scrip->Create( ScripAction => $args{'scrip-action'},
+ ScripCondition => $args{'scrip-condition'},
+ Template => $args{'scrip-template'},
+ Queue => $queue);
+
+ print "$msg\n";
+ }
+}
+
+# }}}
+
+# {{{ sub AdminRights
+
+sub AdminRights {
+ my $queue = shift;
+ #Queue = 0 means 'global';
+
+ my ($scope, $appliesto);
+ if ($queue == 0) {
+ $scope = 'System';
+ $appliesto = 0;
+ }
+ else {
+ $scope = 'Queue';
+ $appliesto = $queue;
+ }
+
+ my %args;
+ GetOptions(\%args,
+ 'grant-right|add-right|new-right|create-right=s@',
+ 'revoke-right|del-right|delete-right=s@',
+ 'list-rights', 'userid=s@', 'groupid=s@',
+ );
+
+
+ # {{{ List entries
+ if ($args{'list-rights'}) {
+ require RT::ACL;
+ my $acl = new RT::ACL($CurrentUser);
+ if ($queue != 0) {
+ $acl->LimitToQueue($queue);
+ }
+ else {
+ $acl->LimitToSystem();
+ }
+ while (my $ace = $acl->Next) {
+ print $ace->RightScope;
+
+ #Print the queue name if we have it.
+ print " " . $ace->AppliesToObj->Name if (defined $ace->AppliesToObj);
+
+ print ": ". $ace->PrincipalType . " " .$ace->PrincipalObj->Name .
+ " has right " . $ace->RightName ."\n";
+
+ }
+ }
+
+ # }}}
+
+ require RT::ACE;
+
+ # {{{ Build up an array of principals
+ my (@principals);
+ my $i = 0;
+ foreach my $group (@{$args{'groupid'}}) {
+
+
+ my $princ = new RT::Group($CurrentUser);
+ $princ->Load("$group");
+ if ($princ->id) {
+ $principals[$i]->{'type'} = 'Group';
+ $principals[$i]->{'id'} = $princ->id();
+ $i++;
+ }
+ else {
+ print "Could not find group $group\n";
+ }
+ }
+
+
+ foreach my $user (@{$args{'userid'}}) {
+ my $princ = new RT::User($CurrentUser);
+ $princ->Load("$user");
+ if ($princ->id) {
+ $principals[$i]->{'type'} = 'User';
+ $principals[$i]->{'id'} = $princ->id();
+ $i++;
+ }
+ else {
+ print "Could not find user $user.\n";
+ }
+ }
+ # }}}
+
+
+ foreach my $principal (@principals) {
+
+ # {{{ Delete rights that need deleting
+ foreach my $right (@{$args{'revoke-right'}}) {
+ my $ace = new RT::ACE($CurrentUser);
+ $RT::Logger->debug("Trying to delete a right: $right \n");
+ my ($val, $msg) = $ace->LoadByValues( RightName => $right,
+ RightScope => $scope,
+ PrincipalType => $principal->{'type'},
+ PrincipalId => $principal->{'id'},
+ RightAppliesTo => $appliesto);
+
+ unless ($val) {
+ print "Right $right not found for" . $principal->{'type'} . " " .
+ $principal->{'id'} . " in scope $scope ($appliesto)\n";
+ next;
+ }
+ my ($delval, $delmsg) =$ace->Delete;
+ print "$delmsg\n";
+
+
+ }
+
+ # }}}
+
+ # {{{ grant rights that need granting
+ foreach my $right (@{$args{'grant-right'}}) {
+ my $ace = new RT::ACE($CurrentUser);
+ my ($val, $msg) = $ace->Create(RightName => $right,
+ PrincipalType => $principal->{'type'},
+ PrincipalId => $principal->{'id'},
+ RightScope => $scope,
+ RightAppliesTo => $appliesto);
+
+ print $msg . "\n";
+ }
+
+ # }}}
+ }
+
+}
+
+# }}}
+
+
+sub ListUsers {
+ require RT::Users;
+ my $users = new RT::Users($CurrentUser);
+ $users->UnLimit();
+ while (my $user = $users->Next()) {
+ printf ("%16s %-16s\n",$user->Name(), $user->EmailAddress());
+ }
+}
+sub ListQueues {
+ require RT::Queues;
+ my $queues = new RT::Queues($CurrentUser);
+ $queues->UnLimit();
+ while (my $queue = $queues->Next()) {
+ printf ("%16s %-16s\n",$queue->Name(), $queue->Description());
+ }
+}
+
+sub ListGroups {
+ require RT::Groups;
+ my $groups = new RT::Groups($CurrentUser);
+ $groups->UnLimit();
+ while (my $group = $groups->Next()) {
+ printf ("%16s %-16s\n",$group->Name(), $group->Description());
+ }
+}
diff --git a/rt/bin/webmux.pl b/rt/bin/webmux.pl
index 21cb83f5e..6e1ae06de 100755
--- a/rt/bin/webmux.pl
+++ b/rt/bin/webmux.pl
@@ -1,125 +1,177 @@
-#!/usr/bin/perl
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/bin/Attic/webmux.pl,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# RT is (c) 1996-2000 Jesse Vincent (jesse@fsck.com);
use strict;
+$ENV{'PATH'} = '/bin:/usr/bin'; # or whatever you need
+$ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
+$ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
+$ENV{'ENV'} = '' if defined $ENV{'ENV'};
+$ENV{'IFS'} = '' if defined $ENV{'IFS'};
-BEGIN {
- $ENV{'PATH'} = '/bin:/usr/bin'; # or whatever you need
- $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
- $ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
- $ENV{'ENV'} = '' if defined $ENV{'ENV'};
- $ENV{'IFS'} = '' if defined $ENV{'IFS'};
-}
-use lib ("/opt/rt3/local/lib", "/opt/rt3/lib");
-use RT;
+# We really don't want apache to try to eat all vm
+# see http://perl.apache.org/guide/control.html#Preventing_mod_perl_Processes_Fr
+
package RT::Mason;
-use CGI qw(-private_tempfiles); #bring this in before mason, to make sure we
- #set private_tempfiles
+use CGI qw(-private_tempfiles); #bring this in before mason, to make sure we
+ #set private_tempfiles
+use HTML::Mason::ApacheHandler (args_method => 'CGI');
+use HTML::Mason; # brings in subpackages: Parser, Interp, etc.
-BEGIN {
- if ($CGI::MOD_PERL) {
- require HTML::Mason::ApacheHandler;
- }
- else {
- require HTML::Mason::CGIHandler;
- }
-}
+use vars qw($VERSION %session $Nobody $SystemUser $r $m);
-use HTML::Mason; # brings in subpackages: Parser, Interp, etc.
+# List of modules that you want to use from components (see Admin
+# manual for details)
-use vars qw($Nobody $SystemUser $r);
+#Clean up our umask...so that the session files aren't world readable, writable or executable
+umask(0077);
-#This drags in RT's config.pm
-RT::LoadConfig();
-use Carp;
+
+$VERSION="!!RT_VERSION!!";
-{
- package HTML::Mason::Commands;
- use vars qw(%session);
-
- use RT::Tickets;
- use RT::Transactions;
- use RT::Users;
- use RT::CurrentUser;
- use RT::Templates;
- use RT::Queues;
- use RT::ScripActions;
- use RT::ScripConditions;
- use RT::Scrips;
- use RT::Groups;
- use RT::GroupMembers;
- use RT::CustomFields;
- use RT::CustomFieldValues;
- use RT::TicketCustomFieldValues;
-
- use RT::Interface::Web;
- use MIME::Entity;
- use Text::Wrapper;
- use CGI::Cookie;
- use Time::ParseDate;
- use HTML::Entities;
-}
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+#This drags in RT's config.pm
+use config;
+use Carp;
+{
+ package HTML::Mason::Commands;
+ use vars qw(%session $m);
+
+ use RT;
+ use RT::Ticket;
+ use RT::Tickets;
+ use RT::Transaction;
+ use RT::Transactions;
+ use RT::User;
+ use RT::Users;
+ use RT::CurrentUser;
+ use RT::Template;
+ use RT::Templates;
+ use RT::Queue;
+ use RT::Queues;
+ use RT::ScripAction;
+ use RT::ScripActions;
+ use RT::ScripCondition;
+ use RT::ScripConditions;
+ use RT::Scrip;
+ use RT::Scrips;
+ use RT::Group;
+ use RT::Groups;
+ use RT::Keyword;
+ use RT::Keywords;
+ use RT::ObjectKeyword;
+ use RT::ObjectKeywords;
+ use RT::KeywordSelect;
+ use RT::KeywordSelects;
+ use RT::GroupMember;
+ use RT::GroupMembers;
+ use RT::Watcher;
+ use RT::Watchers;
+ use RT::Handle;
+ use RT::Interface::Web;
+ use MIME::Entity;
+ use Text::Wrapper;
+ use Apache::Cookie;
+ use Date::Parse;
+ use HTML::Entities;
+
+ #TODO: make this use DBI
+ use Apache::Session::File;
+
+ # Set this page's content type to whatever we are called with
+ sub SetContentType {
+ my $type = shift;
+ $RT::Mason::r->content_type($type);
+ }
+
+ sub CGIObject {
+ $m->cgi_object();
+ }
+
+ }
+my ($parser, $interp, $ah);
+if ($HTML::Mason::VERSION < 1.0902) {
+ $parser = &RT::Interface::Web::NewParser(allow_globals => [%session]);
+
+ $interp = &RT::Interface::Web::NewInterp(parser=>$parser,
+ allow_recursive_autohandlers => 1,
+ );
+
+ $ah = &RT::Interface::Web::NewApacheHandler($interp);
+} else {
+ $ah = &RT::Interface::Web::NewMason11ApacheHandler();
+}
# Activate the following if running httpd as root (the normal case).
# Resets ownership of all files created by Mason at startup.
-# Note that mysql uses DB for sessions, so there's no need to do this.
-unless ($RT::DatabaseType =~ /(mysql|Pg)/) {
- # Clean up our umask to protect session files
- umask(0077);
-
-if ( $CGI::MOD_PERL) {
- chown( Apache->server->uid, Apache->server->gid, [$RT::MasonSessionDir] )
- if Apache->server->can('uid');
- }
- # Die if WebSessionDir doesn't exist or we can't write to it
- stat($RT::MasonSessionDir);
- die "Can't read and write $RT::MasonSessionDir"
- unless ( ( -d _ ) and ( -r _ ) and ( -w _ ) );
-}
+#
+chown (Apache->server->uid, Apache->server->gid,
+ [$RT::MasonSessionDir]);
+
+
+chown (Apache->server->uid, Apache->server->gid,
+ $ah->interp->files_written);
+
+# Die if WebSessionDir doesn't exist or we can't write to it
+
+stat ($RT::MasonSessionDir);
+die "Can't read and write $RT::MasonSessionDir"
+ unless (( -d _ ) and ( -r _ ) and ( -w _ ));
-my $ah = &RT::Interface::Web::NewApacheHandler() if $CGI::MOD_PERL;
sub handler {
($r) = @_;
-
+
RT::Init();
-
+
# We don't need to handle non-text items
- return -1 if defined( $r->content_type ) && $r->content_type !~ m|^text/|io;
+ return -1 if defined($r->content_type) && $r->content_type !~ m|^text/|io;
+
+ #This is all largely cut and pasted from mason's session_handler.pl
+
+ my %cookies = Apache::Cookie::parse($r->header_in('Cookie'));
+
+ eval {
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File',
+ ( $cookies{'AF_SID'} ? $cookies{'AF_SID'}->value() : undef ),
+ { Directory => $RT::MasonSessionDir,
+ LockDirectory => $RT::MasonSessionDir,
+ } ;
+ };
+
+ if ( $@ ) {
+ # If the session is invalid, create a new session.
+ if ( $@ =~ m#^Object does not exist in the data store# ) {
+ tie %HTML::Mason::Commands::session, 'Apache::Session::File', undef,
+ { Directory => $RT::MasonSessionDir,
+ LockDirectory => $RT::MasonSessionDir,
+ };
+ undef $cookies{'AF_SID'};
+ }
+ else {
+ die "RT Couldn't write to session directory '$RT::MasonSessionDir'. Check that this directory's permissions are correct.";
+ }
+ }
+
+ if ( !$cookies{'AF_SID'} ) {
+ my $cookie = new Apache::Cookie
+ ($r,
+ -name=>'AF_SID',
+ -value=>$HTML::Mason::Commands::session{_session_id},
+ -path => '/',);
+ $cookie->bake;
- my %session;
+ }
my $status = $ah->handle_request($r);
- undef (%session);
-
- $RT::Logger->crit("Transaction not committed. Usually indicates a software fault. Data loss may have occurred") if $RT::Handle->TransactionDepth;
+ untie %HTML::Mason::Commands::session;
+
return $status;
-}
-
+
+ }
1;
+
diff --git a/rt/docs/design_docs/acls b/rt/docs/design_docs/acls
index bb093adcb..3b9d8567c 100644
--- a/rt/docs/design_docs/acls
+++ b/rt/docs/design_docs/acls
@@ -1,50 +1,206 @@
+$Header: /home/cvs/cvsroot/freeside/rt/docs/design_docs/acls,v 1.1 2002-08-12 06:17:07 ivan Exp $
-Does principal baz have right foo for object bar
-What rights does user baz have for object bar
+# {{{ Requirements
-# {{{ Which principals have right foo for object bar
+Here's the rough scheme I was thinking of for RT2 acls. Thoughts? I think
+it's a lot more flexible than RT 1.0, but not so crazily complex that
+it will be impossible to implement. One of the "interesting" features
+is the ability to grant acls based on watcher status. This now lives
+in design-docs/acls
+ jesse
-if ($args{'ObjectType'} eq 'Ticket') {
- $or_check_ticket_roles = " OR ( Groups.Domain = 'TicketRole' AND Groups.Instance = '".$args{'ObjectId'}."') ";
- # If we're looking at ticket rights, we also want to look at the associated queue rights.
- # this is a little bit hacky, but basically, now that we've done the ticket roles magic, we load the queue object
- # and ask all the rest of our questions about the queue.
- my $tick = RT::Ticket->new($RT::SystemUser);
- $tick->Load($args{'ObjectId'});
- $args{'ObjectType'} = 'Queue';
- $args{'ObjectId'} = $tick->QueueObj->Id();
+Who can rights be granted to:
-}
-if ($args{'ObjectType'} eq 'Queue') {
- $or_check_roles = " OR ( ( (Groups.Domain = 'QueueRole' AND Groups.Instance = '".$args{'ObjectId'}."') $or_check_ticket_roles )
- AND Groups.Type = ACL.PrincipalType AND Groups.Id = Principals.ObjectId AND Principals.PrincipalType = 'Group') ";
-}
+ users whose id is <foo>
+ users who are watchers of type <requestor/cc/admincc> for <queue/ticket> <id>
+ users who are watchers of type <requestor/cc/admincc> for <this ticket / this queue>
+
+
+what scope do these rights apply to
+ queue <id>
+ system
+
+
+What rights can be granted
+ Display Ticket
+ Manipulate Ticket
+ Only users with manipulate ticket level access will see comments
+ Maniplulate Ticket Status
+ Create Ticket
+
+ Admin Queue Watchers
+ Admin Ticket Watchers
+ Admin user accounts
+ Admin scrips
+ Admin scripscopes
+ Admin Queue ACLS
+ Admin System ACLs
+
+# }}}
+
+
+# {{{ Prinicpals These are the entities in your Access Control Element
+#
+
+Principal: What user does this right apply to
+
+ Made up of:
+ PrincipalScope, PrincipalType and PrincipalId
+
+
+ User:
+ Scope: User
+ Type: null
+ Id: A userid or 0
+
+ Owner:
+ Scope: Owner
+ Type: null
+ Id: none
+
+
+ Watchers:
+
+ Scope: Ticket
+ Type: Requestors; Cc; AdminCc
+ Id: A ticket id or 0 for "this ticket"
+
+ Scope: Queue
+ Type: Cc; AdminCc
+ Id: A queue id or 0 for "this queue"
+
+
+# }}}
+
+# {{{ Object: What object does this right apply to
+
+ Object is composed of an ObjectType and an ObjectId
+
+ Type: System
+ Id: NULL
+
+ Type: Queue
+ Id: Integer ref to queue id or 0 for all queues
+
+# }}}
+
+# {{{ Right: (What does this entry give the principal the right to do)
+
+
+
+ For the Object System:
+ System::SetACL
+ System::AdminScrips
-if (defined $args{'ObjectType'} ) {
- $or_look_at_object_rights = " OR (ACL.ObjectType = '".$args{'ObjectType'}."' AND ACL.ObjectId = '".$args{'ObjectId'}."') ";
+ User::Display
+ User::Create
+ User::Destroy
+ User::Modify
+ User::SetPassword
+
+
+ For the Object "Queue":
+ Queue::Admin
+ Queue::SetACL
+ Queue::Create
+ Queue::Display
+ Queue::Destroy
+ Queue::ModifyWatchers
+ Ticket::Create
+ Ticket::Destory
+ Ticket::Display
+ Ticket::Update
+ Ticket::UpdateRequestors
+ Ticket::UpdateCc
+ Ticket::UpdateAdminCc
+ Ticket::NotifyWatchers
+
+
+ DEFERRED
+
+ Ticket::SetStatus: (Values)
+ Open
+ Resolved
+ Stalled
+ <null> means any
+
+
+# }}}
+
+
+# {{{ Implementation:
+
+# {{{ SQL Schema
+CREATE TABLE ACL (
+ id int not null primary_key autoincrement,
+ PrinicpalId INT(11),
+ PrincipalType VARCHAR(16),
+ PrincipalScope VARCHAR(16),
+ ObjectType VARCHAR(16),
+ ObjectId INT,
+ Right VARCHAR(16)
+);
+
+# }}}
+
+# {{{ perl implementation of rights searches
+
+sub Principals {
+if (defined $Ticket) {
+ return "($UserPrincipal) OR ($OwnerPrincipal) OR ($WatchersPrincipal)";
+ }
+else {
+ return "($UserPrincipal) OR ($WatchersPrincipal)";
+ }
}
+
+$Principals = " ($UserPrincipal) OR ($OwnerPrincipal) OR ($WatchersPrincipal)";
+
+$UserPrincipal = " ( ACE.PrincipalScope = 'User') AND
+ ( ACE.PrincipalId = $User OR ACE.PrincipalId = 0)";
-my $query = "SELECT Users.* from ACL, Groups, Users, Principals, Principals UserPrinc, CachedGroupMembers WHERE
- Users.id = UserPrinc.ObjectId AND UserPrinc.PrincipalType = 'User' AND
- Principals.Id = CachedGroupMembers.GroupId AND
- CachedGroupMembers.MemberId = UserPrinc.ObjectId AND
- UserPrinc.PrincipalType = 'User' AND
- (ACL.RightName = 'SuperUser' OR ACL.RightName = '$right') AND
- (ACL.ObjectType = 'System' $or_look_at_object_rights) AND
- (
- (ACL.PrincipalId = Principals.Id AND
- Principals.ObjectId = Groups.Id AND
- ACL.PrincipalType = 'Group' AND
- (Groups.Domain = 'SystemInternal' OR Groups.Domain = 'UserDefined' OR Groups.Domain = 'ACLEquivalence')
- )
- $or_check_roles
- )";
+$OwnerPrincipal = " ( ACE.PrinciaplScope = 'Owner') AND
+ ( Tickets.Owner = "$User ) AND
+ ( Tickets.Id = $Ticket)";
+
+$WatchersPrincipal = " ( ACE.PrincipalScope = Watchers.Scope ) AND
+ ( ACE.PrincipalType = Watchers.Type ) AND
+ ( ACL.PrincipalId = Watchers.Value ) AND
+ ( Watchers.Owner = $User )";
+
+$QueueObject = "( ACE.ObjectType = 'Queue' and (ACE.ObjectId = $Queue OR ACE.ObjectId = 0)";
+
+$SystemObject = "( ACE.ObjectType = 'System' )";
+
+
+# This select statement would figure out if A user has $Right at the queue level
+
+SELECT ACE.id from ACE, Watchers, Tickets WHERE (
+ $QueueObject
+ AND ( ACE.Right = $Right)
+ AND ($Principals))
+
+# This select statement would figure outif a user has $Right for the "System"
+
+SELECT ACE.id from ACE, Watchers, Tickets WHERE (
+ ($SystemObject) AND ( ACE.Right = $Right ) AND ($Principals))
# }}}
-What objects does principal baz have right foo for
-;
+# }}}
+
+# {{{ Examples
+#
+
+# }}}
+
+
+
+Unaddressed issues:
+
+ There needs to be a more refined method for grouping users, such that members of the customer service department
+can't change sysadmins' passwords.
diff --git a/rt/docs/design_docs/basic-definitions.txt b/rt/docs/design_docs/basic-definitions.txt
new file mode 100644
index 000000000..23d2c5748
--- /dev/null
+++ b/rt/docs/design_docs/basic-definitions.txt
@@ -0,0 +1,54 @@
+(todo ... basically, those are untouched from 1.0)
+Ticket
+Queue
+(...more?)
+
+Requestor
+
+ (...definition of a requestor .. blahblah)
+
+ I'm often doing a distinction between "Internal Requestors" and "External
+ Requestors" (see below). The system doesn't make any difference between
+ requestors, but the distinction might be useful to discuss usage patterns,
+ templates and configurations.
+
+
+External Requestor
+
+ Might be a customer or a potential customer. The External Requestor
+ should be treated as a VIP. (S)he shouldn't need to see too much of RT.
+ The support (s)he gets should be as personal as possible. The external
+ requestor might eventually get access to the Web UI, but only to track
+ her/his own requests. If you're not planning to use RT for handling
+ external customers, all your requestors are probably "Internal
+ Requestors".
+
+
+Watcher
+
+ Somebody that are "subscribing" to a queue or a ticket (or something
+ differently). Basicly, somebody watching a queue or a ticket should get
+ all updates by email. A requestor is a (special) watcher.
+
+
+Regular Watcher
+
+ People within the same organization, people that have read access to whole
+ queues.
+
+ I consider "Regular Watchers" as well as "Internal Requestors" as more
+ robust and capable human beeings than the fragile customers. We don't
+ mind letting them get entagled with RT, and we let them access the Web UI.
+ They can live with beeing just the Cc or Bcc at an email.
+
+
+Internal Requestor
+
+ An Internal Requestor is usually internal to the company. He might be 1st
+ line support sending matters to tech support or similar. Might be an
+ internal employee sending matters to tech support (or even 1st line
+ support if he's not sure where to send matters). It might also be that
+ "ordinary" requestors actually might be treated as intelligent human
+ beeings rather than VIPs, i.e. in open source projects ... we'll still
+ call them "Internal Requestors" as they don't need the special VIP
+ treatment.
diff --git a/rt/docs/design_docs/cli_spec b/rt/docs/design_docs/cli_spec
index ae5f29f76..48a7f34e1 100644
--- a/rt/docs/design_docs/cli_spec
+++ b/rt/docs/design_docs/cli_spec
@@ -1,31 +1,354 @@
-Things the cli must do
- create ticket
- comment
- reply
- update ticket metadata
- search for tickets
- update a bunch of tickets.
- list tickets
- login/logout
+Find tickets to operate on:
+ --id=<tickets> Find only tickets in the range <tickets>
+ synonyms:
+ --limit-id, --tickets, --limit-tickets
+ --limit-queue=<queue>
+ --limit-status=<status>
+ --limit-owner=<owner>
+ --limit-priority=<priority>
+ --limit-requestor=<email>
+ --limit-subject=<string> (Subject contains)
+ --limit-body=<string> (body contains)
+ --limit-created=(before/after) <date>
+ --limit-due=(before/after) <date>
+ --limit-starts=(before/after) <date>
+ --limit-started=(before/after) <date>
+ --limit-first=<int> Start on the <int>th row returned by the
+ database
+ --limit-rows=<int> Find only <int> rows
-should support multiple rt servers
+Display:
+ --show shows a ticket history
+ --history ditto
-create/edit/update should use EDITOR or take from a file or stdin
+ --summary default option. shows a ticket summary
+ --format Optional format string. If not specified,
+ uses the value of ENV{'RT_LISTING_FORMAT'}
+ or an internal default
+
-should be able to update ticket sttributes from a commandline without invoking an editor or needing to use stdin.
+Basic ticket editing:
-login/logout should store RT session cookies rather than constantly transmitting the username/password combo.
+ --status=(open|stall|resolve|kill)
+ --subject=<string>
+ --owner=<owner>
+ --queue=<queue>
+ --time-left=<minutes>
-rtserver and rt username should come from env variables. but should be able to be overridden by commandline options.
+Watcher-related editing:
-rt password should be able to be specified on the commandline (say from a script) or, failing that be prompted for within the application (as rt's sbin/initdb script does) ...or maybe able to be read from a stash file on disk.
+ --add-requestor=<email>
+ --del-requestor=<email>
+ --add-cc=<email>
+ --del-cc=<email>
+ --add-admincc=<email>
+ --del-admincc=<email>
-must be able to dowaload attachments from cli.
-
- it might also be cool to be able to generate session-length urls for attavhments so you can use a browser. but that's not necessary.
+Priority related editing:
+ --priority=<int>
+ --final-priority=<int>
-I'm envisioning this as similar to the subversion cli, actually.
+Date related editing:
+
+ --due=date
+ --starts=date
+ --started=date
+ --contacted=date
+
+
+
+Ticket updates:
+
+ --comment
+ --reply | --respond
+
+
+Links
+
+ --add-link
+ --type=<DependsOn|MemberOf|RelatedTo>
+ needs one of:
+ --target=<ticketid>
+ --base=<ticketid>
+
+ --del-link <link-id>
+
+
+
+Condiments:
+ any update can take:
+
+ --time-taken <minutes>
+
+ Ticket updates can take:
+
+ --source -- specify a source file to read the content from
+ --edit = give me an editor to edit the message
+ --no-edit = don't give me an editor to edit the message.
+
+
+
+
+----- Forwarded message from deborah kaplan <deborah@curl.com> -----
+
+Date: Fri, 14 Apr 2000 11:43:18 -0400 (EDT)
+From: deborah kaplan <deborah@curl.com>
+To: Jesse <jesse@fsck.com>
+Subject: Re: [rt-devel] RT Projects list
+
+Finally, here is the functional spec for the command line
+interface. This is for the user interface only; if you think
+this is right, I will add the administrative interface as well.
+Should I post to rt-devel, add to the ticket, or just modify
+based on your kibbitzing? When you are happy with it I'll start
+the code.
+
+-deborah
+
+
+RT command line interface functional specification
+Author: Deborah Kaplan (Deborah@suberic.net)
+Version:0.1
+
+Requirements:
+
+RT needs a CLI for various reasons. If a user is restricted to a
+dumb terminal, she needs to be able to access the RT database and
+manipulate it fully. The full functionality of both the RT
+database and the RT administrative interface should be available
+from this CLI.
+
+There are two possible types of CLI which I will discuss here.
+The first is a curses-style interface, which allows the user to
+move about a series of menus and choices, usually using arrow
+keys. As RT supplies a Web interface, there is no need for this
+curses-style interface to be written as part of RT. Instead, the
+RT developers should pick one tty-based Web browser (e.g. lynx,
+w3m) and make sure that all of the RT pages are easily readable
+with that tty based browser. Installation of that browser should
+be recommended in the RT installation documentation as a
+supported method of accessing RT from a tty.
+
+The second possible type of CLI is more minimal: a series of
+commands which can be run at a UNIX command prompt which provide
+full functionality to the RT database and administrative
+interface. There are two major benefits to this second type of
+CLI. First of all, in order to use this CLI, you need no extra
+tools (Web browsers, etc.). All that is required is a UNIX
+command line prompt and an installation of RT. Secondly, a user
+of RT who has a very specific command to run and who knows the
+appropriate CLI commands can accomplish her task much more
+quickly with a single command then she could navigating through a
+menu based interface.
+
+In the specification, I will describe the second type of CLI.
+
+Caveats:
+
+This specification draws heavily on the structure of formatting
+command line options for cvs. RT faces a smaller version of the
+same kinds of problems cvs faces: we want to create a very rich
+command set without sacrificing ease-of-use.
+
+I am not wedded to any specific command names if they seem
+impractical; I merely am proposing the command names that seem
+reasonable to me at this moment.
+
+Finally, I am finding the functioning of the web UI from RT 1.
+If the functionality differs greatly in RT 2, I will need to
+modify this specification.
+
+Specification:
+
+There are two commands: "rt", which is the primary interface to
+the database, and "rtadmin", which is the administrative
+interface to the database.
+
+The format of an rt command is as follows:
+
+ rt <command>
+ <command> is one of:
+
+ - help
+ print an overview of the commands which can be run
+
+ - print <queue> <options>
+ with no options, dump to the screen a list of all open
+ requests in <queue> -- the equivalent of "Display Queue" in
+ the existing Web interface.
+
+ <queue> is the name of an RT queue
+ <option> is either:
+
+ -f <filename> | --filename <filename>
+ where <filename> is the name of a file (defaulting to
+ ~/.rtrc) in which the options described below can be
+ placed in the format "^ <long option name> <option value>
+ $".
+
+ Or a series of the following options:
+
+ -o <owner name> | --owner <owner name>: restrict tickets
+ viewed to those owned by <owner name>.
+ This option can be used multiple times in one call of
+ the rt command in order to produce a list which
+ contains tickets owned by multiple owners. Giving the
+ empty string ("") as an option to this switch will
+ restrict tickets viewed to those which have no owner.
+ If this switch is given with no argument, the option
+ defaults to the user name of the currently running
+ process.
+
+ -r <requestor name> | --requestor <requestor name>:
+ restrict tickets viewed to those requested by <requestor
+ name>.
+ This option can be used multiple times in one call of
+ the rt command in order to produce a list which
+ contains tickets requested by multiple requesters. If
+ this switch is given with no arguments, it produces an
+ error.
+
+ -s <status> | --status <status>: restrict tickets viewed
+ to those with the status named in <status>.
+ This option can be used multiple times in one call of
+ the rt command in order to produce a list which
+ contains tickets with multiple statuses (statii?
+ Dragon NaturallySpeaking recognizes "statuses" as a
+ word). This option defaults to status "open".
+
+ -j <subject> | --subject <subject>: restrict tickets
+ viewed to those which contain <subject> as a substring in
+ the subject field of the ticket.
+ This command can be used multiple times in one call of
+ the rt command in order to produce a list which
+ contains tickets with various subject substrings. If
+ the option is called with no argument, the result is
+ an error.
+
+ -h | --help: print a usage message.
+
+ -n | --number: print out a specific ticket.
+ This command can be used multiple times to produce a
+ list which contains multiple tickets. If the option
+ is called with no argument, the result is an error.
+
+ This completes all of the print options which are available
+ in the Web interface, except the sort options. I maintain
+ that this command is already excessively complex, and that
+ adding functionality which can be replicated easily by
+ standard UNIX tools is unnecessary added complexity. I
+ recommend that the man pages and documentation for this
+ option contain an example of a command line run (e.g. of rt |
+ awk) which replicates the sorting functionality provided by
+ the Web interface.
+
+ - edit <ticket> <options>
+ with no options, or with no <ticket>, produces the same
+ output as the --help option.
+ Otherwise, edits the ticket with number <ticket> as
+ indicated in the options given. All options listed below
+ except for --help and --number can be used in conjunction
+ with one another to change many features of the same ticket
+ all at once.
+
+ -h | --help: print usage message
+
+ -s <status> | --status <status>: change the status to the
+ status listed in <status>.
+ No <status> listed, or 1 listed it does not come from
+ a list of approve statuses, produces an error.
+
+ -o <owner name> | --owner <owner name>: set to the owner
+ of the ticket the owner named.
+ Follows whatever convention is finally decided on for
+ the requirement to steal a ticket that is owned by
+ somebody else. No <owner named> listed has the user
+ who is running the rt program take the ticket. If
+ that user is not a valid owner, or the 1 listed does
+ not come from a list of approve names, produces an
+ error.
+
+ -r <requestor name> | --requestor <requestor name>: sets
+ the requestor to <requestor name>.
+ Follows any conventions that the Web UI follows to
+ make sure that this is a legal name. If not legal, or
+ left blank, produces an error.
+
+ -j <subject> | --subject <subject>: sets the subject of
+ the ticket to <subject>.
+ If the option is called with no argument, the result
+ is an error.
+
+ -n <number one> <number 2> | --number <number one>
+ <number 2>: merges ticket number <number one> into ticket
+ <number 2>.
+ If both arguments are not provided, the result is an
+ error.
+
+ -q <queue> | --queue <queue>: set the queue to that
+ named.
+ If <queue> is not listed, or the 1 listed does not
+ come from a list of approve queues, produces an
+ error.
+
+ -a <area> | --area <area>: set the area of the ticket to
+ that named.
+ If <area> is not listed, or the 1 listed does not come
+ from a list of approve areas, produces an error.
+
+ -c <time stamp> | --contact <time stamp>: sets the last
+ user contact field, and produces an error if the format
+ is invalid.
+ If the argument is left blank, sets the last user
+ contact field to now.
+
+ -p <priority> | --priority <priority>: sets the current
+ priority to the 1 listed.
+ Produces an error if the argument is left blank.
+
+ -f <priority> | --final <priority>: sets the final
+ priority to the 1 listed.
+ Produces an error if the arguments left blank.
+
+ -d <date due> | --datedue <date due>: sets the due date
+ to the 1 listed.
+ Produces an error if the argument is left blank, or if
+ the format is invalid.
+
+ - comment <options>
+ with no options, this command reads from standard input
+ until it sees EOF and appends that to the ticket as a
+ comment.
+
+ -h | --help: print usage message
+
+ -c | --comment: append as a comment. This is the default behavior.
+
+ -r | --reply: append as a reply.
+
+ -f <filename> | --file <filename>: can be used with
+ either the comment or reply options. Instead of reading
+ from standard input, read the text of the comment or
+ reply from the file <filename>.
+
+ - report <options>
+ this command is a place holder for reporting functionality
+ which does not yet exist. It will probably have the
+ default behavior to select reports at the command line or
+ choose default reports from a .rtrc file. In a future
+ version, it can output graphs in some graphical format.
+
+
+
+----- End forwarded message -----
+
+--
+jesse reed vincent -- root@eruditorum.org -- jesse@fsck.com
+70EBAC90: 2A07 FC22 7DB4 42C1 9D71 0108 41A3 3FB3 70EB AC90
+
+"If IBM _wanted_ to make clones, we could make them cheaper and faster than
+anyone else!" - An IBM Rep. visiting Vassar College's Comp Sci Department.
diff --git a/rt/docs/design_docs/evil_plans b/rt/docs/design_docs/evil_plans
index 5b5cc58c1..34b9f81a2 100644
--- a/rt/docs/design_docs/evil_plans
+++ b/rt/docs/design_docs/evil_plans
@@ -3,7 +3,8 @@ Current planned 2.2 feature list. subject to change.
Core
-
+Should Make "Owner" a watcher type, rather than a special ticket attribute,
+ under the hood. This wins for ACL and code consistency reasons.
Web UI
@@ -66,6 +67,8 @@ nice Scrips could apply to a list of queues, rather than just one queue or
Custom fields
+Must "KeywordSelects" become "Custom Fields"
+Should String and multi-string custom fields.
Nice Date custom fields
Nice Some way to order and group custom fields.
Nice Default values
@@ -76,6 +79,8 @@ Nice Make custom fields apply to an enumerated list of queues,
Web infrastructure
+Must Full fastcgi support.
+
Installation
@@ -111,7 +116,7 @@ Nice Export full ticket metadata and history as XML
Note: I currently favor the REST philosophy that GET and POST to specific,
defined URLs provides everything one needs to build comprehensive
web services without the massive added complexity of a SOAP or XML-RPC
- framework. Sadly, the world doesn't agree with me
+ framework.
ACLs:
diff --git a/rt/docs/design_docs/local_hacking b/rt/docs/design_docs/local_hacking
new file mode 100644
index 000000000..c06d1126d
--- /dev/null
+++ b/rt/docs/design_docs/local_hacking
@@ -0,0 +1,32 @@
+To facilitate local hacking, RT needs a mechanism to allow site administrators
+to easily add HTML templates for the web ui and to replace sections
+of code in RT's core modules _without_ having to modify those modules
+
+We'll use several methods to achieve this goal.
+
+ Webui
+ HTML::Mason allows users to create multiple
+component hierarchies. RT should ship with a local component root
+defined and available. This root should be configured as the "primary"
+component root.
+
+
+ Core modules
+
+ This gets a bit trickier. we want to allow people to trivially
+subclass core modules and to use those subclasses throughout the code.
+
+The way we're going to handle this is by setting up a number of subroutines
+in config.pm that look something like this:
+
+sub NewTicketObj {
+ eval "require $TicketClass";
+ my $object = new $TicketClass;
+ return ($object);
+}
+
+# This variable is used for ref type checking
+$TicketClass = "RT::Ticket";
+
+we could use an eval around the require and thus completely avoid specifying
+the object in two places. which feels like a win. but i'm worried about perf.
diff --git a/rt/docs/rt.gif b/rt/docs/rt.gif
new file mode 100755
index 000000000..693b06238
--- /dev/null
+++ b/rt/docs/rt.gif
Binary files differ
diff --git a/rt/etc/acl.Oracle b/rt/etc/acl.Oracle
index c8667c031..59d35a028 100644
--- a/rt/etc/acl.Oracle
+++ b/rt/etc/acl.Oracle
@@ -1,10 +1,9 @@
-sub acl {
-return (
-"CREATE USER ${RT::DatabaseUser} identified by ${RT::DatabasePassword}".
-"temporary tablespace TEMP" .
-"default tablespace USERS" .
-"quota unlimited on USERS;" ,
-"grant connect, resource to ${RT::DatabaseUser};",
-"exit;");
-}
-1;
+CREATE USER !!DB_RT_USER!! identified by !!DB_RT_PASS!!
+temporary tablespace TEMP
+default tablespace USERS
+quota unlimited on USERS;
+
+grant connect, resource to !!DB_RT_USER!!;
+
+exit;
+
diff --git a/rt/etc/acl.Pg b/rt/etc/acl.Pg
index 16ea71b2d..13ac41dcf 100755
--- a/rt/etc/acl.Pg
+++ b/rt/etc/acl.Pg
@@ -1,63 +1,39 @@
-sub acl {
- my $dbh = shift;
+drop user !!DB_RT_USER!!;
+create user !!DB_RT_USER!! with password '!!DB_RT_PASS!!' NOCREATEDB NOCREATEUSER;
- my @acls;
+grant select, insert, update, delete on Groups to !!DB_RT_USER!!;
+grant select, insert, update, delete on Groups_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on ACL to !!DB_RT_USER!!;
+grant select, insert, update, delete on ACL_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Watchers to !!DB_RT_USER!!;
+grant select, insert, update, delete on Watchers_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Links to !!DB_RT_USER!!;
+grant select, insert, update, delete on Links_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Users to !!DB_RT_USER!!;
+grant select, insert, update, delete on Users_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Tickets to !!DB_RT_USER!!;
+grant select, insert, update, delete on Tickets_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on GroupMembers to !!DB_RT_USER!!;
+grant select, insert, update, delete on GroupMembers_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Queues to !!DB_RT_USER!!;
+grant select, insert, update, delete on Queues_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Transactions to !!DB_RT_USER!!;
+grant select, insert, update, delete on Transactions_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on ScripActions to !!DB_RT_USER!!;
+grant select, insert, update, delete on ScripActions_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on ScripConditions to !!DB_RT_USER!!;
+grant select, insert, update, delete on ScripConditions_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Scrips to !!DB_RT_USER!!;
+grant select, insert, update, delete on Scrips_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Attachments to !!DB_RT_USER!!;
+grant select, insert, update, delete on Attachments_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Templates to !!DB_RT_USER!!;
+grant select, insert, update, delete on Templates_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on Keywords to !!DB_RT_USER!!;
+grant select, insert, update, delete on Keywords_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on ObjectKeywords to !!DB_RT_USER!!;
+grant select, insert, update, delete on ObjectKeywords_id_seq to !!DB_RT_USER!!;
+grant select, insert, update, delete on KeywordSelects to !!DB_RT_USER!!;
+grant select, insert, update, delete on KeywordSelects_id_seq to !!DB_RT_USER!!;
- my @tables = qw (
- attachments_id_seq
- Attachments
- queues_id_seq
- Queues
- links_id_seq
- Links
- principals_id_seq
- Principals
- groups_id_seq
- Groups
- scripconditions_id_seq
- ScripConditions
- transactions_id_seq
- Transactions
- scrips_id_seq
- Scrips
- acl_id_seq
- ACL
- groupmembers_id_seq
- GroupMembers
- cachedgroupmembers_id_seq
- CachedGroupMembers
- users_id_seq
- Users
- tickets_id_seq
- Tickets
- scripactions_id_seq
- ScripActions
- templates_id_seq
- Templates
- ticketcustomfieldvalues_id_s
- TicketCustomFieldValues
- customfields_id_seq
- CustomFields
- customfieldvalues_id_seq
- CustomFieldValues
- sessions
- );
-
- # if there's already an rt_user, drop it.
- my @row =
- $dbh->selectrow_array( "select usename from pg_user where usename = '" . $RT::DatabaseUser."'" );
- if ( $row[0] ) {
- push @acls, "drop user ${RT::DatabaseUser};",;
- }
-
- push @acls, "create user ${RT::DatabaseUser} with password '${RT::DatabasePassword}' NOCREATEDB NOCREATEUSER;";
- foreach my $table (@tables) {
- push @acls,
- "GRANT SELECT, INSERT, UPDATE, DELETE ON $table to "
- . $RT::DatabaseUser . ";";
-
- }
- return (@acls);
-}
-1;
diff --git a/rt/etc/acl.mysql b/rt/etc/acl.mysql
index 0ecaa3b15..7feb376f5 100755
--- a/rt/etc/acl.mysql
+++ b/rt/etc/acl.mysql
@@ -1,8 +1,4 @@
-sub acl {
-return (
-"USE mysql;",
-"DELETE FROM user WHERE user = '${RT::DatabaseUser}';",
-"DELETE FROM db where db = '${RT::DatabaseName}';",
-"GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON ${RT::DatabaseName}.* TO ${RT::DatabaseUser}\@${RT::DatabaseRTHost} IDENTIFIED BY '${RT::DatabasePassword}';");
-}
-1;
+
+DELETE FROM user WHERE user like '!!DB_RT_USER!!';
+DELETE FROM db where db LIKE '!!DB_DATABASE!!';
+GRANT SELECT,INSERT,CREATE,INDEX,UPDATE,DELETE ON !!DB_DATABASE!!.* TO !!DB_RT_USER!!@!!DB_RT_HOST!! IDENTIFIED BY '!!DB_RT_PASS!!';
diff --git a/rt/etc/config.pm b/rt/etc/config.pm
new file mode 100755
index 000000000..52b1a0b25
--- /dev/null
+++ b/rt/etc/config.pm
@@ -0,0 +1,473 @@
+# $Header: /home/cvs/cvsroot/freeside/rt/etc/Attic/config.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+package RT;
+
+# {{{ Base Configuration
+
+# $rtname the string that RT will look for in mail messages to
+# figure out what ticket a new piece of mail belongs to
+
+# Your domain name is recommended, so as not to pollute the namespace.
+# once you start using a given tag, you should probably never change it.
+# (otherwise, mail for existing tickets won't get put in the right place
+
+$rtname="example.com";
+
+# You should set this to your organization's DNS domain. For example,
+# fsck.com or asylum.arkham.ma.us. It's used by the linking interface to
+# guarantee that ticket URIs are unique and easy to construct.
+
+$Organization = "example.com";
+
+# $user_passwd_min defines the minimum length for user passwords. Setting
+# it to 0 disables this check
+$MinimumPasswordLength = "5";
+
+# $Timezone is used to convert times entered by users into GMT and back again
+# It should be set to a timezone recognized by your local unix box.
+$Timezone = 'US/Eastern';
+
+# LogDir is where RT writes its logfiles.
+# This directory should be writable by your rt group
+$LogDir = "!!RT_LOG_PATH!!";
+
+# }}}
+
+# {{{ Database Configuration
+
+# Database driver beeing used - i.e. MySQL.
+$DatabaseType="!!DB_TYPE!!";
+
+# The domain name of your database server
+# If you're running mysql and it's on localhost,
+# leave it blank for enhanced performance
+$DatabaseHost="!!DB_HOST!!";
+
+# The port that your database server is running on. Ignored unless it's
+# a positive integer. It's usually safe to leave this blank
+$DatabasePort="!!DB_PORT!!";
+
+
+#The name of the database user (inside the database)
+$DatabaseUser='!!DB_RT_USER!!';
+
+# Password the DatabaseUser should use to access the database
+$DatabasePassword='!!DB_RT_PASS!!';
+
+
+# The name of the RT's database on your database server
+$DatabaseName='!!DB_DATABASE!!';
+
+# If you're using Postgres and have compiled in SSL support,
+# set DatabaseRequireSSL to 1 to turn on SSL communication
+$DatabaseRequireSSL=undef;
+
+# }}}
+
+# {{{ Incoming mail gateway configuration
+
+
+# OwnerEmail is the address of a human who manages RT. RT will send
+# errors generated by the mail gateway to this address. This address
+# should _not_ be an address that's managed by your RT instance.
+
+$OwnerEmail = 'root';
+
+# If $LoopsToRTOwner is defined, RT will send mail that it believes
+# might be a loop to $RT::OwnerEmail
+
+$LoopsToRTOwner = 1;
+
+# If $StoreLoopss is defined, RT will record messages that it believes
+# to be part of mail loops.
+# As it does this, it will try to be careful not to send mail to the
+# sender of these messages
+
+$StoreLoops = undef;
+
+
+# $MaxAttachmentSize sets the maximum size (in bytes) of attachments stored
+# in the database.
+
+# For mysql and oracle, we set this size at 10 megabytes.
+# If you're running a postgres version earlier than 7.1, you will need
+# to drop this to 8192. (8k)
+
+$MaxAttachmentSize = 10000000;
+
+# $TruncateLongAttachments: if this is set to a non-undef value,
+# RT will truncate attachments longer than MaxAttachmentLength.
+
+$TruncateLongAttachments = undef;
+
+
+# $DropLongAttachments: if this is set to a non-undef value,
+# RT will silently drop attachments longer than MaxAttachmentLength.
+
+$DropLongAttachments = undef;
+
+# If $ParseNewMessageForTicketCcs is true, RT will attempt to divine
+# Ticket 'Cc' watchers from the To and Cc lines of incoming messages
+# Be forewarned that if you have _any_ addresses which forward mail to
+# RT automatically and you enable this option without modifying
+# "IsRTAddress" below, you will get yourself into a heap of trouble.
+# And well, this is free software, so there isn't a warrantee, but
+# I disclaim all ability to help you if you do enable this without
+# modifying IsRTAddress below.
+
+$ParseNewMessageForTicketCcs = undef;
+
+# IsRTAddress is used to make sure RT doesn't add itself as a ticket CC if
+# the setting above is enabled.
+
+sub IsRTAddress {
+ my $address = shift;
+
+ # Example: the following rule would tell RT not to Cc
+ # "tickets@noc.example.com"
+ # return(1) if ($address =~ /^tickets\@noc.example.com$/i);
+
+ return(undef)
+}
+
+# CanonicalizeAddress converts email addresses into canonical form.
+# it takes one email address in and returns the proper canonical
+# form. You can dump whatever your proper local config is in here
+
+sub CanonicalizeAddress {
+ my $email = shift;
+ # Example: the following rule would treat all email
+ # coming from a subdomain as coming from second level domain
+ # foo.com
+ #$email =~ s/\@(.*).foo.com/\@foo.com/;
+ return ($email)
+}
+
+# If $LookupSenderInExternalDatabase is defined, RT will attempt to
+# verify the incoming message sender with a known source, using the
+# LookupExternalUserInfo routine below
+
+$LookupSenderInExternalDatabase = undef;
+
+# If $SenderMustExistInExternalDatabase is true, RT will refuse to
+# create non-privileged accounts for unknown users if you are using
+# the "LookupSenderInExternalDatabase" option.
+# Instead, an error message will be mailed and RT will forward the
+# message to $RTOwner.
+#
+# If you are not using $LookupSenderInExternalDatabase, this option
+# has no effect.
+#
+# If you define an AutoRejectRequest template, RT will use this
+# template for the rejection message.
+
+$SenderMustExistInExternalDatabase = undef;
+
+# LookupExternalUserInfo is a site-definable method for synchronizing
+# incoming users with an external data source.
+#
+# This routine takes a tuple of EmailAddress and FriendlyName
+# EmailAddress is the user's email address, ususally taken from
+# an email message's From: header.
+# FriendlyName is a freeform string, ususally taken from the "comment"
+# portion of an email message's From: header.
+#
+# It returns (FoundInExternalDatabase, ParamHash);
+#
+# FoundInExternalDatabase must be set to 1 before return if the user was
+# found in the external database.
+#
+# ParamHash is a Perl parameter hash which can contain at least the following
+# fields. These fields are used to populate RT's users database when the user
+# is created
+#
+# EmailAddress is the email address that RT should use for this user.
+# Name is the 'Name' attribute RT should use for this user.
+# 'Name' is used for things like access control and user lookups.
+# RealName is what RT should display as the user's name when displaying
+# 'friendly' names
+
+sub LookupExternalUserInfo {
+ my ($EmailAddress, $RealName) = @_;
+
+ my $FoundInExternalDatabase = 1;
+ my %params = {};
+
+ #Name is the RT username you want to use for this user.
+ $params{'Name'} = $EmailAddress;
+ $params{'EmailAddress'} = $EmailAddress;
+ $params{'RealName'} = $RealName;
+
+ # See RT's contributed code for examples.
+ # http://www.fsck.com/pub/rt/contrib/
+ return ($FoundInExternalDatabase, %params);
+}
+
+# }}}
+
+# {{{ Outgoing mail configuration
+
+# RT is designed such that any mail which already has a ticket-id associated
+# with it will get to the right place automatically.
+
+# $CorrespondAddress and $CommentAddress are the default addresses
+# that will be listed in From: and Reply-To: headers of correspondence
+# and comment mail tracked by RT, unless overridden by a queue-specific
+# address.
+
+$CorrespondAddress='RT::CorrespondAddress.not.set';
+
+$CommentAddress='RT::CommentAddress.not.set';
+
+
+#Sendmail Configuration
+
+# $MailCommand defines which method RT will use to try to send mail
+# We know that 'sendmailpipe' works fairly well.
+# If 'sendmailpipe' doesn't work well for you, try 'sendmail'
+#
+# Note that you should remove the '-t' from $SendmailArguments
+# if you use 'sendmail rather than 'sendmailpipe'
+
+$MailCommand = 'sendmailpipe';
+
+# $SendmailArguments defines what flags to pass to $Sendmail
+# assuming you picked 'sendmail' or 'sendmailpipe' as the $MailCommand above.
+# If you picked 'sendmailpipe', you MUST add a -t flag to $SendmailArguments
+
+# These options are good for most sendmail wrappers and workalikes
+$SendmailArguments="-oi -t";
+
+# These arguments are good for sendmail brand sendmail 8 and newer
+#$SendmailArguments="-oi -t -ODeliveryMode=b -OErrorMode=m";
+
+# If you selected 'sendmailpipe' above, you MUST specify the path
+# to your sendmail binary in $SendmailPath.
+# !! If you did not # select 'sendmailpipe' above, this has no effect!!
+$SendmailPath = "/usr/sbin/sendmail";
+
+# RT can optionally set a "Friendly" 'To:' header when sending messages to
+# Ccs or AdminCcs (rather than having a blank 'To:' header.
+
+# This feature DOES NOT WORK WITH SENDMAIL[tm] BRAND SENDMAIL
+# If you are using sendmail, rather than postfix, qmail, exim or some other MTA,
+# you _must_ disable this option.
+
+$UseFriendlyToLine = 0;
+
+
+# }}}
+
+# {{{ Logging
+
+# Logging. The default is to log anything except debugging
+# information to a logfile. Check the Log::Dispatch POD for
+# information about how to get things by syslog, mail or anything
+# else, get debugging info in the log, etc.
+
+# It might generally make
+# sense to send error and higher by email to some administrator.
+# If you do this, be careful that this email isn't sent to this RT instance.
+
+
+# the minimum level error that will be logged to the specific device.
+# levels from lowest to highest:
+# debug info notice warning error critical alert emergency
+
+
+# Mail loops will generate a critical log message.
+
+$LogToScreen = 'error';
+$LogToFile = 'error';
+#$LogToFileNamed = "$LogDir/rt.log.".$$.".".$<; #log to rt.log.<pid>.<user>
+$LogToFileNamed = "$LogDir/rt.log".$<; #log to rt.log.user;
+
+# }}}
+
+# {{{ Web interface configuration
+
+
+
+# Define the directory name to be used for images in rt web
+# documents.
+
+# If you're putting the web ui somewhere other than at the root of
+# your server
+# $WebPath requires a leading / but no trailing /
+
+$WebPath = "";
+
+# This is the Scheme, server and port for constructing urls to webrt
+# $WebBaseURL doesn't need a trailing /
+
+$WebBaseURL = "http://RT::WebBaseURL.not.configured:80";
+
+$WebURL = $WebBaseURL . $WebPath . "/";
+
+
+
+# $WebImagesURL points to the base URL where RT can find its images.
+# If you're running the FastCGI version of the RT web interface,
+# you should make RT's WebRT/html/NoAuth/images directory available on
+# a static web server and supply that URL as $WebImagesURL.
+
+$WebImagesURL = $WebURL."NoAuth/images/";
+
+# $RTLogoURL points to the URL of the RT logo displayed in the web UI
+
+$LogoURL = $WebImagesURL."rt.jpg";
+
+# If $WebExternalAuth is defined, RT will defer to the environment's
+# REMOTE_USER variable.
+
+$WebExternalAuth = undef;
+
+# $MasonComponentRoot is where your rt instance keeps its mason html files
+# (this should be autoconfigured during 'make install' or 'make upgrade')
+
+$MasonComponentRoot = "!!MASON_HTML_PATH!!";
+
+# $MasonLocalComponentRoot is where your rt instance keeps its site-local
+# mason html files.
+# (this should be autoconfigured during 'make install' or 'make upgrade')
+
+$MasonLocalComponentRoot = "!!MASON_LOCAL_HTML_PATH!!";
+
+# $MasonDataDir Where mason keeps its datafiles
+# (this should be autoconfigured during 'make install' or 'make upgrade')
+
+$MasonDataDir = "!!MASON_DATA_PATH!!";
+
+# RT needs to put session data (for preserving state between connections
+# via the web interface)
+$MasonSessionDir = "!!MASON_SESSION_PATH!!";
+
+
+
+#This is from tobias' prototype web search UI. it may stay and it may go.
+%WebOptions=
+ (
+ # This is for putting in more user-actions at the Transaction
+ # bar. I will typically add "Enter bug in Bugzilla" here.:
+ ExtraTransactionActions => sub { return ""; },
+
+ # Here you can modify the list view. Be aware that the web
+ # interface might crash if TicketAttribute is wrongly set.
+
+ QueueListingCols =>
+ [
+ { Header => 'Id',
+ TicketLink => 1,
+ TicketAttribute => 'Id'
+ },
+
+ { Header => 'Subject',
+ TicketAttribute => 'Subject'
+ },
+ { Header => 'Requestor(s)',
+ TicketAttribute => 'RequestorsAsString'
+ },
+ { Header => 'Status',
+ TicketAttribute => 'Status'
+ },
+
+
+ { Header => 'Queue',
+ TicketAttribute => 'QueueObj->Name'
+ },
+
+
+
+ { Header => 'Told',
+ TicketAttribute => 'ToldObj->AgeAsString'
+ },
+
+ { Header => 'Age',
+ TicketAttribute => 'CreatedObj->AgeAsString'
+ },
+
+ { Header => 'Last',
+ TicketAttribute => 'LastUpdatedObj->AgeAsString'
+ },
+
+ # TODO: It would be nice with a link here to the Owner and all
+ # other request owned by this Owner.
+ { Header => 'Owner',
+ TicketAttribute => 'OwnerObj->Name'
+ },
+
+
+ { Header => 'Take',
+ TicketLink => 1,
+ Constant => 'Take',
+ ExtraLinks => '&Action=Take'
+ },
+
+ ]
+ );
+
+# }}}
+
+# {{{ RT Linking Interface
+
+# $TicketBaseURI is the Base path of the URI for local tickets
+
+# You shouldn't need to touch this. it's used to link tickets both locally
+# and remotely
+
+$TicketBaseURI = "fsck.com-rt://$Organization/$rtname/ticket/";
+
+# A hash table of conversion subs to be used for transforming RT Link
+# URIs to URLs in the web interface. If you want to use RT towards
+# locally installed databases, this is the right place to configure it.
+
+%URI2HTTP=
+ (
+ 'http' => sub {return @_;},
+ 'https' => sub {return @_;},
+ 'ftp' => sub {return @_;},
+ 'fsck.com-rt' => sub {warn "stub!";},
+ 'mozilla.org-bugzilla' => sub {warn "stub!"},
+ 'fsck.com-kb' => sub {warn "stub!"}
+ );
+
+
+# A hash table of subs for fetching content from an URI
+%ContentFromURI=
+ (
+ 'fsck.com-rt' => sub {warn "stub!";},
+ 'mozilla.org-bugzilla' => sub {warn "stub!"},
+ 'fsck.com-kb' => sub {warn "stub!"}
+ );
+
+# }}}
+
+# {{{ No User servicable parts inside
+
+############################################
+############################################
+############################################
+#
+# Don't edit anything below this line unless you really know
+# what you're doing
+#
+#
+############################################
+############################################
+
+# TODO: get this stuff out of the config file and into RT.pm
+
+#Set up us the timezone
+$ENV{'TZ'} = $Timezone; #TODO: Bogus hack to deal with Date::Manip whining
+
+# Configure sendmail if we're using Entity->send('sendmail')
+if ($MailCommand eq 'sendmail') {
+ $MailParams = $SendmailArguments;
+}
+
+
+
+# }}}
+
+
+1;
diff --git a/rt/etc/schema.Pg b/rt/etc/schema.Pg
index ba0d6fc6c..21d981b4a 100755
--- a/rt/etc/schema.Pg
+++ b/rt/etc/schema.Pg
@@ -1,578 +1,267 @@
-------------------------------------------------------------------
--- My2Pg 1.23 translated dump
---
-------------------------------------------------------------------
-
-BEGIN;
-
-
-
-
---
--- Sequences for table ATTACHMENTS
---
-
-CREATE SEQUENCE attachments_id_seq;
-
--- {{{ Attachments
-
+CREATE TABLE KeywordSelects (
+ id serial NOT NULL ,
+ Name varchar(255) ,
+ Keyword integer ,
+ Single integer ,
+ Depth integer NOT NULL DEFAULT 0 ,
+ ObjectType varchar(32) NOT NULL ,
+ ObjectField varchar(32) ,
+ ObjectValue varchar(255) ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
+);
+CREATE INDEX KeywordSelects1 ON KeywordSelects (Keyword);
+CREATE INDEX KeywordSelects2 ON KeywordSelects (ObjectType, ObjectField, ObjectValue);
CREATE TABLE Attachments (
- id INTEGER DEFAULT nextval('attachments_id_seq'),
+ id serial NOT NULL ,
TransactionId integer NOT NULL ,
- Parent integer NOT NULL DEFAULT 0 ,
- MessageId varchar(160) NULL ,
- Subject varchar(255) NULL ,
- Filename varchar(255) NULL ,
- ContentType varchar(80) NULL ,
- ContentEncoding varchar(80) NULL ,
- Content text NULL ,
- Headers text NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
+ Parent integer ,
+ MessageId varchar(160) ,
+ Subject varchar(255) ,
+ Filename varchar(255) ,
+ ContentType varchar(80) ,
+ ContentEncoding varchar(80) ,
+ Content TEXT ,
+ Headers TEXT ,
+ Creator integer ,
+ Created timestamp ,
PRIMARY KEY (id)
-
);
-
-CREATE INDEX Attachments1 ON Attachments (Parent) ;
-CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
-CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
--- }}}
-
--- {{{ Queues
-
-
---
--- Sequences for table QUEUES
---
-
-CREATE SEQUENCE queues_id_seq;
-
+CREATE INDEX Attachments1 ON Attachments (Parent);
+CREATE INDEX Attachments2 ON Attachments (TransactionId);
+CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId);
CREATE TABLE Queues (
- id INTEGER DEFAULT nextval('queues_id_seq'),
- Name varchar(200) NOT NULL ,
- Description varchar(255) NULL ,
- CorrespondAddress varchar(120) NULL ,
- CommentAddress varchar(120) NULL ,
- InitialPriority integer NOT NULL DEFAULT 0 ,
- FinalPriority integer NOT NULL DEFAULT 0 ,
- DefaultDueIn integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ Name varchar(120) NOT NULL ,
+ Description varchar(120) ,
+ CorrespondAddress varchar(120) ,
+ CommentAddress varchar(120) ,
+ InitialPriority integer ,
+ FinalPriority integer ,
+ DefaultDueIn integer ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-
);
-CREATE UNIQUE INDEX Queues1 ON Queues (Name) ;
-
--- }}}
-
--- {{{ Links
-
-
-
---
--- Sequences for table LINKS
---
-
-CREATE SEQUENCE links_id_seq;
-
+CREATE UNIQUE INDEX Queues1 ON Queues (Name);
CREATE TABLE Links (
- id INTEGER DEFAULT nextval('links_id_seq'),
- Base varchar(240) NULL ,
- Target varchar(240) NULL ,
+ id serial NOT NULL ,
+ Base varchar(240) ,
+ Target varchar(240) ,
Type varchar(20) NOT NULL ,
- LocalTarget integer NOT NULL DEFAULT 0 ,
- LocalBase integer NOT NULL DEFAULT 0 ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
+ LocalTarget integer ,
+ LocalBase integer ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
+ Creator integer ,
+ Created timestamp ,
PRIMARY KEY (id)
-
);
-CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type) ;
-
--- }}}
-
--- {{{ Principals
-
-
-
---
--- Sequences for table PRINCIPALS
---
-
-CREATE SEQUENCE principals_id_seq;
-
-CREATE TABLE Principals (
- id INTEGER DEFAULT nextval('principals_id_seq') not null,
- PrincipalType VARCHAR(16) not null,
- ObjectId integer,
- Disabled int2 NOT NULL DEFAULT 0 ,
- PRIMARY KEY (id)
-
-);
-
-CREATE INDEX Principals2 ON Principals (ObjectId);
-
-
--- }}}
-
--- {{{ Groups
-
-
-
---
--- Sequences for table GROUPS
---
-
-CREATE SEQUENCE groups_id_seq;
-
+CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type);
CREATE TABLE Groups (
- id INTEGER DEFAULT nextval('groups_id_seq'),
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- Domain varchar(64),
- Type varchar(64),
- Instance varchar(64),
+ id serial NOT NULL ,
+ Name varchar(16) ,
+ Description varchar(64) ,
+ Pseudo integer NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
+);
+CREATE UNIQUE INDEX Groups1 ON Groups (Name);
+CREATE TABLE Watchers (
+ id serial NOT NULL ,
+ Type varchar(16) ,
+ Scope varchar(16) ,
+ Value integer ,
+ Email varchar(255) ,
+ Quiet integer ,
+ Owner integer ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
PRIMARY KEY (id)
-
);
-CREATE UNIQUE INDEX Groups1 ON Groups (Domain,Instance,Type,id, Name);
-CREATE INDEX Groups2 On Groups (Type, Instance, Domain);
-
-
--- }}}
-
--- {{{ ScripConditions
-
-
-
---
--- Sequences for table SCRIPCONDITIONS
---
-
-CREATE SEQUENCE scripconditions_id_seq;
-
+CREATE INDEX Watchers1 ON Watchers (Scope, Value, Type, Owner);
CREATE TABLE ScripConditions (
- id INTEGER DEFAULT nextval('scripconditions_id_seq'),
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- ExecModule varchar(60) NULL ,
- Argument varchar(255) NULL ,
- ApplicableTransTypes varchar(60) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ Name varchar(255) ,
+ Description varchar(255) ,
+ ExecModule varchar(60) ,
+ Argument varchar(255) ,
+ ApplicableTransTypes varchar(60) ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
PRIMARY KEY (id)
-
);
-
--- }}}
-
--- {{{ Transactions
-
-
---
--- Sequences for table TRANSACTIONS
---
-
-CREATE SEQUENCE transactions_id_seq;
-
CREATE TABLE Transactions (
- id INTEGER DEFAULT nextval('transactions_id_seq'),
- EffectiveTicket integer NOT NULL DEFAULT 0 ,
- Ticket integer NOT NULL DEFAULT 0 ,
- TimeTaken integer NOT NULL DEFAULT 0 ,
- Type varchar(20) NULL ,
- Field varchar(40) NULL ,
- OldValue varchar(255) NULL ,
- NewValue varchar(255) NULL ,
- Data varchar(100) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ EffectiveTicket integer ,
+ Ticket integer ,
+ TimeTaken integer ,
+ Type varchar(20) ,
+ Field varchar(40) ,
+ OldValue varchar(255) ,
+ NewValue varchar(255) ,
+ Data varchar(100) ,
+ Creator integer ,
+ Created timestamp ,
PRIMARY KEY (id)
-
);
CREATE INDEX Transactions1 ON Transactions (Ticket);
CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
-
--- }}}
-
--- {{{ Scrips
-
-
-
---
--- Sequences for table SCRIPS
---
-
-CREATE SEQUENCE scrips_id_seq;
-
CREATE TABLE Scrips (
- id INTEGER DEFAULT nextval('scrips_id_seq'),
- Description varchar(255),
- ScripCondition integer NOT NULL DEFAULT 0 ,
- ScripAction integer NOT NULL DEFAULT 0 ,
- ConditionRules text NULL ,
- ActionRules text NULL ,
- CustomIsApplicableCode text NULL ,
- CustomPrepareCode text NULL ,
- CustomCommitCode text NULL ,
- Stage varchar(32) NULL ,
- Queue integer NOT NULL DEFAULT 0 ,
- Template integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ ScripCondition integer ,
+ ScripAction integer ,
+ Stage varchar(32) ,
+ Queue integer ,
+ Template integer ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
PRIMARY KEY (id)
-
);
-
--- }}}
-
--- {{{ ACL
-
-
---
--- Sequences for table ACL
---
-
-CREATE SEQUENCE acl_id_seq;
-
CREATE TABLE ACL (
- id INTEGER DEFAULT nextval('acl_id_seq'),
- PrincipalType varchar(25) NOT NULL,
-
- PrincipalId integer NOT NULL ,
- RightName varchar(25) NOT NULL ,
- ObjectType varchar(25) NOT NULL ,
- ObjectId integer NOT NULL DEFAULT 0,
- DelegatedBy integer NOT NULL DEFAULT 0,
- DelegatedFrom integer NOT NULL DEFAULT 0,
+ id serial NOT NULL ,
+ PrincipalId integer ,
+ PrincipalType varchar(25) ,
+ RightName varchar(25) ,
+ RightScope varchar(25) ,
+ RightAppliesTo integer ,
PRIMARY KEY (id)
-
);
-
-CREATE INDEX ACL1 on ACL(RightName, ObjectType, ObjectId,PrincipalType,PrincipalId);
-
-
--- }}}
-
--- {{{ GroupMembers
-
-
-
---
--- Sequences for table GROUPMEMBERS
---
-
-CREATE SEQUENCE groupmembers_id_seq;
-
+CREATE INDEX ACL1 ON ACL (RightScope, PrincipalId);
+CREATE INDEX ACL2 ON ACL (RightScope, RightAppliesTo, RightName, PrincipalType, PrincipalId);
CREATE TABLE GroupMembers (
- id INTEGER DEFAULT nextval('groupmembers_id_seq'),
- GroupId integer NOT NULL DEFAULT 0,
- MemberId integer NOT NULL DEFAULT 0,
+ id serial NOT NULL ,
+ GroupId integer ,
+ UserId integer ,
+ PRIMARY KEY (id)
+);
+CREATE UNIQUE INDEX GroupMembers1 ON GroupMembers (GroupId, UserId);
+CREATE TABLE ObjectKeywords (
+ id serial NOT NULL ,
+ Keyword integer NOT NULL ,
+ KeywordSelect integer NOT NULL ,
+ ObjectType varchar(32) NOT NULL ,
+ ObjectId integer NOT NULL ,
PRIMARY KEY (id)
-
);
-
--- }}}
-
--- {{{ GroupMembersCache
-
-
-
---
--- Sequences for table CACHEDGROUPMEMBERS
---
-
-CREATE SEQUENCE cachedgroupmembers_id_seq;
-
-CREATE TABLE CachedGroupMembers (
- id int DEFAULT nextval('cachedgroupmembers_id_seq'),
- GroupId int,
- MemberId int,
- Via int,
- ImmediateParentId int,
- Disabled int2 NOT NULL DEFAULT 0 ,
- PRIMARY KEY (id)
-
+CREATE UNIQUE INDEX ObjectKeywords1 ON ObjectKeywords (ObjectId, ObjectType, KeywordSelect, Keyword);
+CREATE INDEX ObjectKeywords2 ON ObjectKeywords (ObjectId, ObjectType);
+CREATE INDEX ObjectKeywords3 ON ObjectKeywords (Keyword);
+CREATE TABLE Keywords (
+ id serial NOT NULL ,
+ Name varchar(255) NOT NULL ,
+ Description varchar(255) ,
+ Parent integer ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
);
-
-CREATE INDEX CachedGroupMembers2 on CachedGroupMembers (MemberId);
-CREATE INDEX CachedGroupMembers3 on CachedGroupMembers (GroupId);
-CREATE INDEX DisGrouMem on CachedGroupMembers (GroupId,MemberId,Disabled);
-
--- }}}
-
--- {{{ Users
-
-
-
---
--- Sequences for table USERS
---
-
-CREATE SEQUENCE users_id_seq;
-
+CREATE UNIQUE INDEX Keywords1 ON Keywords (Name, Parent);
+CREATE INDEX Keywords2 ON Keywords (Name);
+CREATE INDEX Keywords3 ON Keywords (Parent);
CREATE TABLE Users (
- id INTEGER DEFAULT nextval('users_id_seq'),
- Name varchar(200) NOT NULL ,
- Password varchar(40) NULL ,
- Comments text NULL ,
- Signature text NULL ,
- EmailAddress varchar(120) NULL ,
- FreeformContactInfo text NULL ,
- Organization varchar(200) NULL ,
- RealName varchar(120) NULL ,
- NickName varchar(16) NULL ,
- Lang varchar(16) NULL ,
- EmailEncoding varchar(16) NULL ,
- WebEncoding varchar(16) NULL ,
- ExternalContactInfoId varchar(100) NULL ,
- ContactInfoSystem varchar(30) NULL ,
- ExternalAuthId varchar(100) NULL ,
- AuthSystem varchar(30) NULL ,
- Gecos varchar(16) NULL ,
- HomePhone varchar(30) NULL ,
- WorkPhone varchar(30) NULL ,
- MobilePhone varchar(30) NULL ,
- PagerPhone varchar(30) NULL ,
- Address1 varchar(200) NULL ,
- Address2 varchar(200) NULL ,
- City varchar(100) NULL ,
- State varchar(100) NULL ,
- Zip varchar(16) NULL ,
- Country varchar(50) NULL ,
- Timezone varchar(50) NULL ,
- PGPKey text NULL,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ Name varchar(120) NOT NULL ,
+ Password varchar(40) ,
+ Comments TEXT ,
+ Signature TEXT ,
+ EmailAddress varchar(120) ,
+ FreeformContactInfo TEXT ,
+ Organization varchar(200) ,
+ Privileged integer ,
+ RealName varchar(120) ,
+ Nickname varchar(16) ,
+ Lang varchar(16) ,
+ EmailEncoding varchar(16) ,
+ WebEncoding varchar(16) ,
+ ExternalContactInfoId varchar(100) ,
+ ContactInfoSystem varchar(30) ,
+ ExternalAuthId varchar(100) ,
+ AuthSystem varchar(30) ,
+ Gecos varchar(16) ,
+ HomePhone varchar(30) ,
+ WorkPhone varchar(30) ,
+ MobilePhone varchar(30) ,
+ PagerPhone varchar(30) ,
+ Address1 varchar(200) ,
+ Address2 varchar(200) ,
+ City varchar(100) ,
+ State varchar(100) ,
+ Zip varchar(16) ,
+ Country varchar(50) ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-
);
-
-
-CREATE UNIQUE INDEX Users1 ON Users (Name) ;
-CREATE INDEX Users2 ON Users (Name);
+CREATE UNIQUE INDEX Users1 ON Users (Name);
CREATE INDEX Users3 ON Users (id, EmailAddress);
CREATE INDEX Users4 ON Users (EmailAddress);
-
-
--- }}}
-
--- {{{ Tickets
-
-
-
---
--- Sequences for table TICKETS
---
-
-CREATE SEQUENCE tickets_id_seq;
-
CREATE TABLE Tickets (
- id INTEGER DEFAULT nextval('tickets_id_seq'),
- EffectiveId integer NOT NULL DEFAULT 0 ,
- Queue integer NOT NULL DEFAULT 0 ,
- Type varchar(16) NULL ,
- IssueStatement integer NOT NULL DEFAULT 0 ,
- Resolution integer NOT NULL DEFAULT 0 ,
- Owner integer NOT NULL DEFAULT 0 ,
- Subject varchar(200) NULL DEFAULT '[no subject]' ,
- InitialPriority integer NOT NULL DEFAULT 0 ,
- FinalPriority integer NOT NULL DEFAULT 0 ,
- Priority integer NOT NULL DEFAULT 0 ,
- TimeEstimated integer NOT NULL DEFAULT 0 ,
- TimeWorked integer NOT NULL DEFAULT 0 ,
- Status varchar(10) NULL ,
- TimeLeft integer NOT NULL DEFAULT 0 ,
- Told TIMESTAMP NULL ,
- Starts TIMESTAMP NULL ,
- Started TIMESTAMP NULL ,
- Due TIMESTAMP NULL ,
- Resolved TIMESTAMP NULL ,
-
-
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ EffectiveId integer ,
+ Queue integer ,
+ Type varchar(16) ,
+ IssueStatement integer ,
+ Resolution integer ,
+ Owner integer ,
+ Subject varchar(200) DEFAULT '[no subject]' ,
+ InitialPriority integer ,
+ FinalPriority integer ,
+ Priority integer ,
+ Status varchar(10) ,
+ TimeWorked integer ,
+ TimeLeft integer ,
+ Told timestamp ,
+ Starts timestamp ,
+ Started timestamp ,
+ Due timestamp ,
+ Resolved timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
+ Creator integer ,
+ Created timestamp ,
Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-
);
-
-CREATE INDEX Tickets1 ON Tickets (Queue, Status) ;
-CREATE INDEX Tickets2 ON Tickets (Owner) ;
-CREATE INDEX Tickets3 ON Tickets (EffectiveId) ;
-CREATE INDEX Tickets4 ON Tickets (id, Status) ;
-CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ;
-
--- }}}
-
--- {{{ ScripActions
-
-
-
---
--- Sequences for table SCRIPACTIONS
---
-
-CREATE SEQUENCE scripactions_id_seq;
-
+CREATE INDEX Tickets1 ON Tickets (Queue, Status);
+CREATE INDEX Tickets2 ON Tickets (Owner);
+CREATE INDEX Tickets3 ON Tickets (EffectiveId);
+CREATE INDEX Tickets4 ON Tickets (id, Status);
+CREATE INDEX Tickets5 ON Tickets (id, EffectiveId);
CREATE TABLE ScripActions (
- id INTEGER DEFAULT nextval('scripactions_id_seq'),
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- ExecModule varchar(60) NULL ,
- Argument varchar(255) NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
+ id serial NOT NULL ,
+ Name varchar(255) ,
+ Description varchar(255) ,
+ ExecModule varchar(60) ,
+ Argument varchar(255) ,
+ Creator integer ,
+ Created timestamp ,
+ LastUpdatedBy integer ,
+ LastUpdated timestamp ,
PRIMARY KEY (id)
-
);
-
--- }}}
-
--- {{{ Templates
-
-
-
---
--- Sequences for table TEMPLATES
---
-
-CREATE SEQUENCE templates_id_seq;
-
CREATE TABLE Templates (
- id INTEGER DEFAULT nextval('templates_id_seq'),
- Queue integer NOT NULL DEFAULT 0 ,
- Name varchar(200) NOT NULL ,
- Description varchar(255) NULL ,
- Type varchar(16) NULL ,
- Language varchar(16) NULL ,
- TranslationOf integer NOT NULL DEFAULT 0 ,
- Content text NULL ,
- LastUpdated TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- PRIMARY KEY (id)
-
-);
-
--- }}}
-
--- {{{ TicketCustomFieldValues
-
-
-
---
--- Sequences for table TICKETCUSTOMFIELDVALUES
---
-
-CREATE SEQUENCE ticketcustomfieldvalues_id_s;
-
-CREATE TABLE TicketCustomFieldValues (
- id INTEGER DEFAULT nextval('ticketcustomfieldvalues_id_s'),
- Ticket int NOT NULL ,
- CustomField int NOT NULL ,
- Content varchar(255) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
- PRIMARY KEY (id)
-
-);
-
--- }}}
-
--- {{{ CustomFields
-
-
-
---
--- Sequences for table CUSTOMFIELDS
---
-
-CREATE SEQUENCE customfields_id_seq;
-
-CREATE TABLE CustomFields (
- id INTEGER DEFAULT nextval('customfields_id_seq'),
- Name varchar(200) NULL ,
- Type varchar(200) NULL ,
+ id serial NOT NULL ,
Queue integer NOT NULL DEFAULT 0 ,
- Description varchar(255) NULL ,
- SortOrder integer NOT NULL DEFAULT 0 ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
- Disabled int2 NOT NULL DEFAULT 0 ,
+ Name varchar(40) NOT NULL ,
+ Description varchar(120) ,
+ Type varchar(16) ,
+ Language varchar(16) ,
+ TranslationOf integer ,
+ Content TEXT ,
+ LastUpdated timestamp ,
+ LastUpdatedBy integer ,
+ Creator integer ,
+ Created timestamp ,
PRIMARY KEY (id)
-
-);
-
--- }}}
-
--- {{{ CustomFieldValues
-
-
-
---
--- Sequences for table CUSTOMFIELDVALUES
---
-
-CREATE SEQUENCE customfieldvalues_id_seq;
-
-CREATE TABLE CustomFieldValues (
- id INTEGER DEFAULT nextval('customfieldvalues_id_seq'),
- CustomField int NOT NULL ,
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- SortOrder integer NOT NULL DEFAULT 0 ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created TIMESTAMP NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated TIMESTAMP NULL ,
- PRIMARY KEY (id)
-
-);
-
--- }}}
-
--- {{{ Sessions
-
--- sessions is used by Apache::Session to keep sessions in the database.
--- We should have a reaper script somewhere.
-
-CREATE TABLE sessions (
- id char(32) NOT NULL,
- a_session bytea,
- LastUpdated TIMESTAMP not null default current_timestamp,
- PRIMARY KEY (id)
-
);
-
--- }}}
-
-
-
-COMMIT;
diff --git a/rt/etc/schema.mysql b/rt/etc/schema.mysql
index 46f8ec562..7e715c201 100755
--- a/rt/etc/schema.mysql
+++ b/rt/etc/schema.mysql
@@ -1,9 +1,21 @@
-# {{{ Attachments
-
+CREATE TABLE KeywordSelects (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ Name varchar(255) NULL ,
+ Keyword integer NULL ,
+ Single integer NULL ,
+ Depth integer NOT NULL DEFAULT 0 ,
+ ObjectType varchar(32) NOT NULL ,
+ ObjectField varchar(32) NULL ,
+ ObjectValue varchar(255) NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
+ PRIMARY KEY (id)
+);
+CREATE INDEX KeywordSelects1 ON KeywordSelects (Keyword);
+CREATE INDEX KeywordSelects2 ON KeywordSelects (ObjectType, ObjectField, ObjectValue);
CREATE TABLE Attachments (
id INTEGER NOT NULL AUTO_INCREMENT,
TransactionId integer NOT NULL ,
- Parent integer NOT NULL DEFAULT 0 ,
+ Parent integer NULL ,
MessageId varchar(160) NULL ,
Subject varchar(255) NULL ,
Filename varchar(255) NULL ,
@@ -11,222 +23,161 @@ CREATE TABLE Attachments (
ContentEncoding varchar(80) NULL ,
Content LONGTEXT NULL ,
Headers LONGTEXT NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX Attachments1 ON Attachments (Parent) ;
-CREATE INDEX Attachments2 ON Attachments (TransactionId) ;
-CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId) ;
-# }}}
-
-# {{{ Queues
+);
+CREATE INDEX Attachments1 ON Attachments (Parent);
+CREATE INDEX Attachments2 ON Attachments (TransactionId);
+CREATE INDEX Attachments3 ON Attachments (Parent, TransactionId);
CREATE TABLE Queues (
id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NOT NULL ,
- Description varchar(255) NULL ,
+ Name varchar(120) NOT NULL ,
+ Description varchar(120) NULL ,
CorrespondAddress varchar(120) NULL ,
CommentAddress varchar(120) NULL ,
- InitialPriority integer NOT NULL DEFAULT 0 ,
- FinalPriority integer NOT NULL DEFAULT 0 ,
- DefaultDueIn integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
+ InitialPriority integer NULL ,
+ FinalPriority integer NULL ,
+ DefaultDueIn integer NULL ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-CREATE UNIQUE INDEX Queues1 ON Queues (Name) ;
-CREATE INDEX Queues2 ON Queues (Disabled) ;
-
-# }}}
-
-# {{{ Links
-
+);
+CREATE UNIQUE INDEX Queues1 ON Queues (Name);
CREATE TABLE Links (
id INTEGER NOT NULL AUTO_INCREMENT,
Base varchar(240) NULL ,
Target varchar(240) NULL ,
Type varchar(20) NOT NULL ,
- LocalTarget integer NOT NULL DEFAULT 0 ,
- LocalBase integer NOT NULL DEFAULT 0 ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LocalTarget integer NULL ,
+ LocalBase integer NULL ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type) ;
-CREATE INDEX Links2 ON Links (Base, Type) ;
-CREATE INDEX Links3 ON Links (Target, Type) ;
-
-# }}}
-
-# {{{ Principals
-
-CREATE TABLE Principals (
- id INTEGER AUTO_INCREMENT not null,
- PrincipalType VARCHAR(16) not null,
- ObjectId integer, # foreign key to Users or Groups, depending
- Disabled int2 NOT NULL DEFAULT 0 ,
- PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX Principals2 ON Principals (ObjectId);
-
-# }}}
-
-# {{{ Groups
-
+);
+CREATE UNIQUE INDEX Links1 ON Links (Base, Target, Type);
CREATE TABLE Groups (
id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- Domain varchar(64),
- Type varchar(64),
- Instance varchar(64),
+ Name varchar(16) NULL ,
+ Description varchar(64) NULL ,
+ Pseudo integer NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX Groups1 ON Groups (Domain,Instance,Type,id);
-CREATE INDEX Groups2 On Groups (Type, Instance, Domain);
-
-# }}}
-
-# {{{ ScripConditions
-
+);
+CREATE UNIQUE INDEX Groups1 ON Groups (Name);
+CREATE TABLE Watchers (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ Type varchar(16) NULL ,
+ Scope varchar(16) NULL ,
+ Value integer NULL ,
+ Email varchar(255) NULL ,
+ Quiet integer NULL ,
+ Owner integer NULL ,
+ Creator integer NULL ,
+ Created DATETIME NULL ,
+ LastUpdatedBy integer NULL ,
+ LastUpdated DATETIME NULL ,
+ PRIMARY KEY (id)
+);
+CREATE INDEX Watchers1 ON Watchers (Scope, Value, Type, Owner);
CREATE TABLE ScripConditions (
id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NULL ,
+ Name varchar(255) NULL ,
Description varchar(255) NULL ,
ExecModule varchar(60) NULL ,
Argument varchar(255) NULL ,
ApplicableTransTypes varchar(60) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ Transactions
+);
CREATE TABLE Transactions (
id INTEGER NOT NULL AUTO_INCREMENT,
- EffectiveTicket integer NOT NULL DEFAULT 0 ,
- Ticket integer NOT NULL DEFAULT 0 ,
- TimeTaken integer NOT NULL DEFAULT 0 ,
+ EffectiveTicket integer NULL ,
+ Ticket integer NULL ,
+ TimeTaken integer NULL ,
Type varchar(20) NULL ,
Field varchar(40) NULL ,
OldValue varchar(255) NULL ,
NewValue varchar(255) NULL ,
Data varchar(100) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
+);
CREATE INDEX Transactions1 ON Transactions (Ticket);
CREATE INDEX Transactions2 ON Transactions (EffectiveTicket);
-
-# }}}
-
-# {{{ Scrips
-
CREATE TABLE Scrips (
id INTEGER NOT NULL AUTO_INCREMENT,
- Description varchar(255),
- ScripCondition integer NOT NULL DEFAULT 0 ,
- ScripAction integer NOT NULL DEFAULT 0 ,
- ConditionRules text NULL ,
- ActionRules text NULL ,
- CustomIsApplicableCode text NULL ,
- CustomPrepareCode text NULL ,
- CustomCommitCode text NULL ,
+ ScripCondition integer NULL ,
+ ScripAction integer NULL ,
Stage varchar(32) NULL ,
- Queue integer NOT NULL DEFAULT 0 ,
- Template integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
+ Queue integer NULL ,
+ Template integer NULL ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ ACL
+);
CREATE TABLE ACL (
id INTEGER NOT NULL AUTO_INCREMENT,
- PrincipalType varchar(25) NOT NULL, #"User" "Group", "Owner", "Cc" "AdminCc", "Requestor", "Requestor"
-
- PrincipalId integer NOT NULL , #Foreign key to principals
- RightName varchar(25) NOT NULL ,
- ObjectType varchar(25) NOT NULL ,
- ObjectId integer NOT NULL default 0,
- DelegatedBy integer NOT NULL default 0, #foreign key to principals with a userid
- DelegatedFrom integer NOT NULL default 0, #foreign key to ACL
+ PrincipalId integer NULL ,
+ PrincipalType varchar(25) NULL ,
+ RightName varchar(25) NULL ,
+ RightScope varchar(25) NULL ,
+ RightAppliesTo integer NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX ACL1 on ACL(RightName, ObjectType, ObjectId,PrincipalType,PrincipalId);
-
-# }}}
-
-# {{{ GroupMembers
-
+);
+CREATE INDEX ACL1 ON ACL (RightScope, PrincipalId);
+CREATE INDEX ACL2 ON ACL (RightScope, RightAppliesTo, RightName, PrincipalType, PrincipalId);
CREATE TABLE GroupMembers (
id INTEGER NOT NULL AUTO_INCREMENT,
- GroupId integer NOT NULL DEFAULT 0,
- MemberId integer NOT NULL DEFAULT 0, #Foreign key to Principals
+ GroupId integer NULL ,
+ UserId integer NULL ,
+ PRIMARY KEY (id)
+);
+CREATE UNIQUE INDEX GroupMembers1 ON GroupMembers (GroupId, UserId);
+CREATE TABLE ObjectKeywords (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ Keyword integer NOT NULL ,
+ KeywordSelect integer NOT NULL ,
+ ObjectType varchar(32) NOT NULL ,
+ ObjectId integer NOT NULL ,
+ PRIMARY KEY (id)
+);
+CREATE UNIQUE INDEX ObjectKeywords1 ON ObjectKeywords (ObjectId, ObjectType, KeywordSelect, Keyword);
+CREATE INDEX ObjectKeywords2 ON ObjectKeywords (ObjectId, ObjectType);
+CREATE INDEX ObjectKeywords3 ON ObjectKeywords (Keyword);
+CREATE TABLE Keywords (
+ id INTEGER NOT NULL AUTO_INCREMENT,
+ Name varchar(255) NOT NULL ,
+ Description varchar(255) NULL ,
+ Parent integer NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-CREATE UNIQUE INDEX GroupMembers1 on GroupMembers (GroupId, MemberId);
-
-
-# }}}
-
-# {{{ GroupMembersCache
-
-create table CachedGroupMembers (
- id int auto_increment,
- GroupId int, # foreign key to Principals
- MemberId int, # foreign key to Principals
- Via int, #foreign key to CachedGroupMembers. (may point to $self->id)
- ImmediateParentId int, #foreign key to prinicpals.
- # this points to the group that the member is
- # a member of, for ease of deletes.
- Disabled int2 NOT NULL DEFAULT 0 , # if this cached group member is a member of this group by way of a disabled
- # group or this group is disabled, this will be set to 1
- # this allows us to not find members of disabled subgroups when listing off
- # group members recursively.
- # Also, this allows us to have the ACL system elide members of disabled groups
- PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX DisGrouMem on CachedGroupMembers (GroupId,MemberId,Disabled);
-CREATE INDEX GrouMem on CachedGroupMembers (GroupId,MemberId);
-
-# }}}
-
-# {{{ Users
-
+);
+CREATE UNIQUE INDEX Keywords1 ON Keywords (Name, Parent);
+CREATE INDEX Keywords2 ON Keywords (Name);
+CREATE INDEX Keywords3 ON Keywords (Parent);
CREATE TABLE Users (
id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NOT NULL ,
+ Name varchar(120) NOT NULL ,
Password varchar(40) NULL ,
Comments blob NULL ,
Signature blob NULL ,
EmailAddress varchar(120) NULL ,
FreeformContactInfo blob NULL ,
Organization varchar(200) NULL ,
+ Privileged integer NULL ,
RealName varchar(120) NULL ,
- NickName varchar(16) NULL ,
+ Nickname varchar(16) NULL ,
Lang varchar(16) NULL ,
EmailEncoding varchar(16) NULL ,
WebEncoding varchar(16) NULL ,
@@ -245,172 +196,72 @@ CREATE TABLE Users (
State varchar(100) NULL ,
Zip varchar(16) NULL ,
Country varchar(50) NULL ,
- Timezone varchar(50) NULL ,
- PGPKey text NULL,
-
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
+ Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-
-CREATE UNIQUE INDEX Users1 ON Users (Name) ;
-CREATE INDEX Users2 ON Users (Name);
+);
+CREATE UNIQUE INDEX Users1 ON Users (Name);
CREATE INDEX Users3 ON Users (id, EmailAddress);
CREATE INDEX Users4 ON Users (EmailAddress);
-
-
-# }}}
-
-# {{{ Tickets
-
CREATE TABLE Tickets (
id INTEGER NOT NULL AUTO_INCREMENT,
- EffectiveId integer NOT NULL DEFAULT 0 ,
- Queue integer NOT NULL DEFAULT 0 ,
+ EffectiveId integer NULL ,
+ Queue integer NULL ,
Type varchar(16) NULL ,
- IssueStatement integer NOT NULL DEFAULT 0 ,
- Resolution integer NOT NULL DEFAULT 0 ,
- Owner integer NOT NULL DEFAULT 0 ,
+ IssueStatement integer NULL ,
+ Resolution integer NULL ,
+ Owner integer NULL ,
Subject varchar(200) NULL DEFAULT '[no subject]' ,
- InitialPriority integer NOT NULL DEFAULT 0 ,
- FinalPriority integer NOT NULL DEFAULT 0 ,
- Priority integer NOT NULL DEFAULT 0 ,
- TimeEstimated integer NOT NULL DEFAULT 0 ,
- TimeWorked integer NOT NULL DEFAULT 0 ,
+ InitialPriority integer NULL ,
+ FinalPriority integer NULL ,
+ Priority integer NULL ,
Status varchar(10) NULL ,
- TimeLeft integer NOT NULL DEFAULT 0 ,
+ TimeWorked integer NULL ,
+ TimeLeft integer NULL ,
Told DATETIME NULL ,
Starts DATETIME NULL ,
Started DATETIME NULL ,
Due DATETIME NULL ,
Resolved DATETIME NULL ,
-
-
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
Disabled int2 NOT NULL DEFAULT 0 ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX Tickets1 ON Tickets (Queue, Status) ;
-CREATE INDEX Tickets2 ON Tickets (Owner) ;
-CREATE INDEX Tickets3 ON Tickets (EffectiveId) ;
-CREATE INDEX Tickets4 ON Tickets (id, Status) ;
-CREATE INDEX Tickets5 ON Tickets (id, EffectiveId) ;
-CREATE INDEX Tickets6 ON Tickets (EffectiveId, Type) ;
-
-# }}}
-
-# {{{ ScripActions
-
+);
+CREATE INDEX Tickets1 ON Tickets (Queue, Status);
+CREATE INDEX Tickets2 ON Tickets (Owner);
+CREATE INDEX Tickets3 ON Tickets (EffectiveId);
+CREATE INDEX Tickets4 ON Tickets (id, Status);
+CREATE INDEX Tickets5 ON Tickets (id, EffectiveId);
CREATE TABLE ScripActions (
id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NULL ,
+ Name varchar(255) NULL ,
Description varchar(255) NULL ,
ExecModule varchar(60) NULL ,
Argument varchar(255) NULL ,
- Creator integer NOT NULL DEFAULT 0 ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
LastUpdated DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ Templates
-
+);
CREATE TABLE Templates (
id INTEGER NOT NULL AUTO_INCREMENT,
Queue integer NOT NULL DEFAULT 0 ,
- Name varchar(200) NOT NULL ,
- Description varchar(255) NULL ,
+ Name varchar(40) NOT NULL ,
+ Description varchar(120) NULL ,
Type varchar(16) NULL ,
Language varchar(16) NULL ,
- TranslationOf integer NOT NULL DEFAULT 0 ,
+ TranslationOf integer NULL ,
Content blob NULL ,
LastUpdated DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- Creator integer NOT NULL DEFAULT 0 ,
- Created DATETIME NULL ,
- PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ TicketCustomFieldValues
-
-CREATE TABLE TicketCustomFieldValues (
- id INTEGER NOT NULL AUTO_INCREMENT,
- Ticket int NOT NULL ,
- CustomField int NOT NULL ,
- Content varchar(255) NULL ,
-
- Creator integer NOT NULL DEFAULT 0 ,
+ LastUpdatedBy integer NULL ,
+ Creator integer NULL ,
Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated DATETIME NULL ,
- PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ CustomFields
-
-CREATE TABLE CustomFields (
- id INTEGER NOT NULL AUTO_INCREMENT,
- Name varchar(200) NULL ,
- Type varchar(200) NULL ,
- Queue integer NOT NULL DEFAULT 0 ,
- Description varchar(255) NULL ,
- SortOrder integer NOT NULL DEFAULT 0 ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated DATETIME NULL ,
- Disabled int2 NOT NULL DEFAULT 0 ,
- PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-CREATE INDEX CustomFields1 on CustomFields (Disabled, Queue);
-
-
-# }}}
-
-# {{{ CustomFieldValues
-
-CREATE TABLE CustomFieldValues (
- id INTEGER NOT NULL AUTO_INCREMENT,
- CustomField int NOT NULL ,
- Name varchar(200) NULL ,
- Description varchar(255) NULL ,
- SortOrder integer NOT NULL DEFAULT 0 ,
-
- Creator integer NOT NULL DEFAULT 0 ,
- Created DATETIME NULL ,
- LastUpdatedBy integer NOT NULL DEFAULT 0 ,
- LastUpdated DATETIME NULL ,
PRIMARY KEY (id)
-) TYPE=InnoDB;
-
-# }}}
-
-# {{{ Sessions
-
-# sessions is used by Apache::Session to keep sessions in the database.
-# We should have a reaper script somewhere.
-
-CREATE TABLE sessions (
- id char(32) NOT NULL,
- a_session LONGTEXT,
- LastUpdated TIMESTAMP,
- PRIMARY KEY (id)
);
-
-# }}}
diff --git a/rt/etc/schema.pm b/rt/etc/schema.pm
new file mode 100644
index 000000000..44e143ecd
--- /dev/null
+++ b/rt/etc/schema.pm
@@ -0,0 +1,349 @@
+# column, type, nullability, length, default, database-local
+
+my $gratuitous = {
+
+'Groups' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', 'NULL', '16', '', '',
+ 'Description', 'varchar', 'NULL', '64', '', '',
+ 'Pseudo', 'integer', '', '', '0', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ['Name'] ],
+ 'index' => [ ],
+},
+
+'ACL' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'PrincipalId', 'integer', 'NULL', '', '', '',
+ 'PrincipalType', 'varchar', 'NULL', '25', '', '',
+ 'RightName', 'varchar', 'NULL', '25', '', '',
+ 'RightScope', 'varchar', 'NULL', '25', '', '',
+ 'RightAppliesTo', 'integer', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ['RightScope', 'PrincipalId'],
+ ['RightScope','RightAppliesTo','RightName','PrincipalType','PrincipalId'] ],
+},
+
+'Watchers' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Type', 'varchar', 'NULL', '16', '', '',
+ 'Scope', 'varchar', 'NULL', '16', '', '',
+ 'Value', 'integer', 'NULL', '', '', '',
+ 'Email', 'varchar', 'NULL', '255', '', '',
+ 'Quiet', 'integer', 'NULL', '', '', '',
+ 'Owner', 'integer', 'NULL', '', '', '',
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ['Scope','Value','Type','Owner'] ],
+},
+
+'Links' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Base', 'varchar', 'NULL', '240', '', '',
+ 'Target', 'varchar', 'NULL', '240', '', '',
+ 'Type', 'varchar', '', '20', '', '',
+ 'LocalTarget', 'integer', 'NULL', '', '', '',
+ 'LocalBase', 'integer', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ['Base', 'Target', 'Type'] ],
+ 'index' => [ ],
+},
+
+'Users' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', '', '120', '', '',
+ 'Password', 'varchar', 'NULL', '40', '', '',
+ 'Comments', 'blob', 'NULL', '', '', '',
+ 'Signature', 'blob', 'NULL', '', '', '',
+ 'EmailAddress', 'varchar', 'NULL', '120', '', '',
+ 'FreeformContactInfo', 'blob', 'NULL', '', '', '',
+ 'Organization', 'varchar', 'NULL', '200', '', '',
+ 'Privileged', 'integer', 'NULL', '', '', '',
+ 'RealName', 'varchar', 'NULL', '120', '', '',
+ 'Nickname', 'varchar', 'NULL', '16', '', '',
+ 'Lang', 'varchar', 'NULL', '16', '', '',
+ 'EmailEncoding', 'varchar', 'NULL', '16', '', '',
+ 'WebEncoding', 'varchar', 'NULL', '16', '', '',
+ 'ExternalContactInfoId', 'varchar', 'NULL', '100', '', '',
+ 'ContactInfoSystem', 'varchar', 'NULL', '30', '', '',
+ 'ExternalAuthId', 'varchar', 'NULL', '100', '', '',
+ 'AuthSystem', 'varchar', 'NULL', '30', '', '',
+ 'Gecos', 'varchar', 'NULL', '16', '', '',
+ 'HomePhone', 'varchar', 'NULL', '30', '', '',
+ 'WorkPhone', 'varchar', 'NULL', '30', '', '',
+ 'MobilePhone', 'varchar', 'NULL', '30', '', '',
+ 'PagerPhone', 'varchar', 'NULL', '30', '', '',
+ 'Address1', 'varchar', 'NULL', '200', '', '',
+ 'Address2', 'varchar', 'NULL', '200', '', '',
+ 'City', 'varchar', 'NULL', '100', '', '',
+ 'State', 'varchar', 'NULL', '100', '', '',
+ 'Zip', 'varchar', 'NULL', '16', '', '',
+ 'Country', 'varchar', 'NULL', '50', '', '',
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ 'Disabled', 'int2', '','','0','',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ['Name'] ],
+ 'index' => [ ['Name'],
+ ['id', 'EmailAddress'],
+ ['EmailAddress'] ],
+},
+
+'Tickets' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'EffectiveId', 'integer', 'NULL', '', '', '',
+ 'Queue', 'integer', 'NULL', '', '', '',
+ 'Type', 'varchar', 'NULL', '16', '', '',
+ 'IssueStatement', 'integer', 'NULL', '', '', '',
+ 'Resolution', 'integer', 'NULL', '', '', '',
+ 'Owner', 'integer', 'NULL', '', '', '',
+ 'Subject', 'varchar', 'NULL', '200', '[no subject]', '',
+ 'InitialPriority', 'integer', 'NULL', '', '', '',
+ 'FinalPriority', 'integer', 'NULL', '', '', '',
+ 'Priority', 'integer', 'NULL', '', '', '',
+ 'Status', 'varchar', 'NULL', '10', '', '',
+ 'TimeWorked', 'integer', 'NULL', '', '', '',
+ 'TimeLeft', 'integer', 'NULL', '', '', '',
+ 'Told', 'timestamp', 'NULL', '', '', '',
+ 'Starts', 'timestamp', 'NULL', '', '', '',
+ 'Started', 'timestamp', 'NULL', '', '', '',
+ 'Due', 'timestamp', 'NULL', '', '', '',
+ 'Resolved', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'Disabled', 'int2', '','','0','',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ [] ],
+ 'index' => [ ['Queue', 'Status'],
+ ['Owner'],
+ ['EffectiveId'],
+ ['id', 'Status'],
+ ['id', 'EffectiveId'] ],
+},
+
+'GroupMembers' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'GroupId', 'integer', 'NULL', '', '', '', #foreign key, Groups::id
+ 'UserId', 'integer', 'NULL', '', '', '', #foreign key, Users::id
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ['GroupId', 'UserId'] ],
+ 'index' => [ ],
+},
+
+'Queues' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', '', '120', '', '', #Textual 'name' for this queue
+ 'Description', 'varchar', 'NULL', '120', '', '', #Textual descr. of this
+ #queue
+ 'CorrespondAddress', 'varchar', 'NULL', '120', '', '',
+ 'CommentAddress', 'varchar', 'NULL', '120', '', '',
+ 'InitialPriority', 'integer', 'NULL', '', '', '',
+ 'FinalPriority', 'integer', 'NULL', '', '', '',
+ 'DefaultDueIn', 'integer', 'NULL', '', '', '',
+
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ 'Disabled', 'int2', '','','0','',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ['Name'] ],
+ 'index' => [ ],
+},
+
+'Transactions' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'EffectiveTicket', 'integer', 'NULL', '', '', '',
+ 'Ticket', 'integer', 'NULL', '', '', '', #Foreign key Ticket::id
+ 'TimeTaken', 'integer', 'NULL', '', '', '', #Time spent on this trans in min
+ 'Type', 'varchar', 'NULL', '20', '', '',
+ 'Field', 'varchar', 'NULL', '40', '', '', #If it's a "Set" transaction, what
+ #field was set.
+ 'OldValue', 'varchar', 'NULL', '255', '', '',
+ 'NewValue', 'varchar', 'NULL', '255', '', '',
+ 'Data', 'varchar', 'NULL', '100', '', '',
+
+
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ['Ticket'], ['EffectiveTicket'] ],
+},
+
+'ScripActions' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', 'NULL', '255', '', '', # Alias
+ 'Description', 'varchar', 'NULL', '255', '', '', #Textual description
+ 'ExecModule', 'varchar', 'NULL', '60', '', '', #This calles RT::Action::___
+ 'Argument', 'varchar', 'NULL', '255', '', '', #We can pass a single argument
+ #to the scrip. sometimes, it's who to send mail to.
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ],
+},
+
+'ScripConditions' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', 'NULL', '255', '', '', # Alias
+ 'Description', 'varchar', 'NULL', '255', '', '', #Textual description
+ 'ExecModule', 'varchar', 'NULL', '60', '', '', #This calles RT::Condition::
+ 'Argument', 'varchar', 'NULL', '255', '', '', #We can pass a single argument
+ #to the scrip. sometimes, it's who to send mail to.
+ 'ApplicableTransTypes', 'varchar', 'NULL', '60', '', '',#Transaction types this scrip
+ # acts on. comma or / delimited is just great.
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ],
+},
+'Scrips' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'ScripCondition', 'integer', 'NULL', '', '', '', #Foreign key ScripConditions::id
+ 'ScripAction', 'integer', 'NULL', '', '', '', #Foreign key ScripActions::id
+ 'Stage', 'varchar', 'NULL', '32','','', #What stage does this scrip
+ #Happen in. for now, everything is 'TransactionCreate',
+ 'Queue', 'integer', 'NULL', '', '', '', #Foreign key Queues::id
+ 'Template', 'integer', 'NULL', '', '', '', #Foreign key Templates::id
+
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ],
+},
+
+'Attachments' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'TransactionId', 'integer', '', '', '', '', #Foreign key Transactions::Id
+ 'Parent', 'integer', 'NULL', '', '', '', # Attachments::Id
+ 'MessageId', 'varchar', 'NULL', '160', '', '', #RFC822 messageid, if any
+ 'Subject', 'varchar', 'NULL', '255', '', '',
+ 'Filename', 'varchar', 'NULL', '255', '', '',
+ 'ContentType', 'varchar', 'NULL', '80', '', '',
+ 'ContentEncoding', 'varchar', 'NULL', '80', '', '',
+ 'Content', 'long varbinary', 'NULL', '', '', '',
+ 'Headers', 'long varbinary', 'NULL', '', '', '',
+
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ ],
+ 'index' => [ ['Parent'], ['TransactionId'], ['Parent', 'TransactionId'] ],
+},
+
+'Templates' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Queue', 'integer', 'NOT NULL', '', '0', '',
+ 'Name', 'varchar', '', '40', '', '',
+ 'Description', 'varchar', 'NULL', '120', '', '',
+ 'Type', 'varchar', 'NULL', '16', '','',
+ 'Language', 'varchar', 'NULL', '16', '', '',
+ 'TranslationOf', 'integer', 'NULL', '', '', '',
+ 'Content', 'blob', 'NULL', '', '', '',
+ 'LastUpdated', 'timestamp', 'NULL', '', '', '',
+ 'LastUpdatedBy', 'integer', 'NULL', '', '', '',
+ 'Creator', 'integer', 'NULL', '', '', '',
+ 'Created', 'timestamp', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ [''] ],
+ 'index' => [ ],
+},
+
+'Keywords' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name', 'varchar', 'NOT NULL', '255', '', '',
+ 'Description', 'varchar', 'NULL', '255', '', '',
+ 'Parent', 'integer', 'NULL', '', '', '',
+ 'Disabled', 'int2', '','','0','',
+],
+ 'primary_key' => 'id',
+ 'unique' => [ [ 'Name', 'Parent' ] ],
+ 'index' => [ [ 'Name', ], [ 'Parent' ] ],
+},
+
+'ObjectKeywords' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Keyword', 'integer', 'NOT NULL', '', '', '',
+ 'KeywordSelect', 'integer', 'NOT NULL', '', '', '',
+ 'ObjectType', 'varchar', 'NOT NULL', '32', '', '',
+ 'ObjectId', 'integer', 'NOT NULL', '', '', '',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ [ 'ObjectId', 'ObjectType','KeywordSelect', 'Keyword' ] ],
+ 'index' => [ [ 'ObjectId', 'ObjectType' ] , ['Keyword'] ],
+
+},
+
+'KeywordSelects' => {
+ 'columns' => [
+ 'id', 'serial', '', '', '', '',
+ 'Name','varchar','NULL','255','','',
+ 'Keyword', 'integer', 'NULL', '', '', '',
+ 'Single', 'integer', 'NULL', '', '', '',
+ 'Depth', 'integer', 'NOT NULL', '', 0, '',
+ 'ObjectType', 'varchar', 'NOT NULL', '32', '', '',
+ 'ObjectField', 'varchar', 'NULL', '32', '', '',
+ 'ObjectValue', 'varchar', 'NULL', '255', '', '',
+ 'Disabled', 'int2', '','','0','',
+ ],
+ 'primary_key' => 'id',
+ 'unique' => [ [ ] ],
+ 'index' => [ [ 'Keyword' ], [ 'ObjectType', 'ObjectField', 'ObjectValue'] ],
+},
+
+};
diff --git a/rt/lib/MANIFEST b/rt/lib/MANIFEST
new file mode 100644
index 000000000..cda386be5
--- /dev/null
+++ b/rt/lib/MANIFEST
@@ -0,0 +1,57 @@
+MANIFEST
+MANIFEST.SKIP
+Makefile.PL
+RT.pm
+test.pl
+RT/ACE.pm
+RT/ACL.pm
+RT/Action/Generic.pm
+RT/Action/NotifyAsComment.pm
+RT/Action/OpenDependent.pm
+RT/Action/SendEmail.pm
+RT/Action/StallDependent.pm
+RT/Action/Notify.pm
+RT/Action/ResolveMembers.pm
+RT/Attachment.pm
+RT/Attachments.pm
+RT/Condition/AnyTransaction.pm
+RT/Condition/Generic.pm
+RT/Condition/NewDependency.pm
+RT/CurrentUser.pm
+RT/Date.pm
+RT/EasySearch.pm
+RT/Group.pm
+RT/GroupMember.pm
+RT/GroupMembers.pm
+RT/Groups.pm
+RT/Handle.pm
+RT/Interface/CLI.pm
+RT/Interface/Email.pm
+RT/Interface/Web.pm
+RT/Keyword.pm
+RT/Keywords.pm
+RT/KeywordSelect.pm
+RT/KeywordSelects.pm
+RT/Link.pm
+RT/Links.pm
+RT/ObjectKeyword.pm
+RT/ObjectKeywords.pm
+RT/Queue.pm
+RT/Queues.pm
+RT/Record.pm
+RT/Scrip.pm
+RT/Scrips.pm
+RT/ScripAction.pm
+RT/ScripActions.pm
+RT/ScripCondition.pm
+RT/ScripConditions.pm
+RT/Template.pm
+RT/Templates.pm
+RT/Ticket.pm
+RT/Tickets.pm
+RT/Transaction.pm
+RT/Transactions.pm
+RT/User.pm
+RT/Users.pm
+RT/Watcher.pm
+RT/Watchers.pm
diff --git a/rt/lib/MANIFEST.SKIP b/rt/lib/MANIFEST.SKIP
new file mode 100644
index 000000000..ae335e78a
--- /dev/null
+++ b/rt/lib/MANIFEST.SKIP
@@ -0,0 +1 @@
+CVS/
diff --git a/rt/lib/Makefile.PL b/rt/lib/Makefile.PL
new file mode 100644
index 000000000..c0e1af28c
--- /dev/null
+++ b/rt/lib/Makefile.PL
@@ -0,0 +1,49 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ 'NAME' => 'RT',
+ 'VERSION_FROM' => 'RT.pm', # finds $VERSION
+ 'PREREQ_PM' => {
+ 'DBI' => 1.16,
+ 'DBIx::SearchBuilder' => '0.48',
+ 'Date::Parse' => 0,
+ 'Date::Format' => 0,
+ 'MIME::Entity' => 5.108,
+ 'Mail::Mailer' => '1.20',
+ 'Log::Dispatch' => 1.6,
+ 'HTML::Entities' => 0,
+ 'Text::Wrapper' => 0,
+ 'Text::Template' => 0,
+ 'Getopt::Long' => 2.24,
+ },
+);
+
+ {
+ package MY;
+ sub top_targets {
+ my($self) = @_;
+ my $out = "POD2TEST_EXE = pod2test\n";
+
+ $out .= $self->SUPER::top_targets(@_);
+ # $out =~ s/^(pure_all\b.*)/$1 testifypods/m;
+
+ $out .= "\n\ntestifypods : \n";
+
+ my @pods = (keys %{$self->{MAN1PODS}},
+ keys %{$self->{MAN3PODS}});
+
+ foreach my $pod (@pods) {
+ (my $test = $pod) =~ s/\.(pm|pod)$//;
+ $test =~ s/^lib\W//;
+ $test =~ s/\W/-/;
+ $test =~ s/\//__/g;
+ $test = "autogen-$test.t";
+ $out .= "\t$self->{NOECHO}\$(POD2TEST_EXE) ".
+ "$pod t/$test \n";
+ }
+
+ return $out;
+ }
+ }
+
diff --git a/rt/lib/RT.pm b/rt/lib/RT.pm
index 90c332bc0..1cfc428ee 100644
--- a/rt/lib/RT.pm
+++ b/rt/lib/RT.pm
@@ -1,82 +1,11 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2002 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-
-
package RT;
-use strict;
-use RT::I18N;
+use RT::Handle;
use RT::CurrentUser;
-use RT::System;
-
-use vars qw($VERSION $System $SystemUser $Nobody $Handle $Logger
- $CORE_CONFIG_FILE
- $SITE_CONFIG_FILE
- $VENDOR_CONFIG_FILE
- $BasePath
- $EtcPath
- $VarPath
- $LocalPath
- $LocalEtcPath
- $LocalLexiconPath
- $LogDir
- $MasonComponentRoot
- $MasonLocalComponentRoot
- $MasonDataDir
- $MasonSessionDir
-);
-
-$VERSION = '3.0.4';
-$CORE_CONFIG_FILE = "/opt/rt3/etc/RT_Config.pm";
-$SITE_CONFIG_FILE = "/opt/rt3/etc/RT_SiteConfig.pm";
-
-$BasePath = '/opt/rt3';
-
-$EtcPath = '/opt/rt3/etc';
-$VarPath = '/opt/rt3/var';
-$LocalPath = '/opt/rt3/local';
-$LocalEtcPath = '/opt/rt3/local/etc';
-$LocalLexiconPath = '/opt/rt3/local/po';
-
-# $MasonComponentRoot is where your rt instance keeps its mason html files
-
-$MasonComponentRoot = '/opt/rt3/share/html';
-
-# $MasonLocalComponentRoot is where your rt instance keeps its site-local
-# mason html files.
-
-$MasonLocalComponentRoot = '/opt/rt3/local/html';
-
-# $MasonDataDir Where mason keeps its datafiles
-
-$MasonDataDir = '/opt/rt3/var/mason_data';
-
-# RT needs to put session data (for preserving state between connections
-# via the web interface)
-$MasonSessionDir = '/opt/rt3/var/session_data';
+use strict;
+use vars qw($VERSION $SystemUser $Nobody $Handle $Logger);
+$VERSION = '!!RT_VERSION!!';
=head1 NAME
@@ -85,45 +14,19 @@ $MasonSessionDir = '/opt/rt3/var/session_data';
=head1 SYNOPSIS
A fully featured request tracker package
+
=head1 DESCRIPTION
=cut
-=item LoadConfig
-
-Load RT's config file. First, go after the core config file.
-After that, try to load the vendor config.
-After that, go after the site config.
-
-=cut
-
-sub LoadConfig {
- local *Set = sub { $_[0] = $_[1] unless defined $_[0] };
- if ( -f "$SITE_CONFIG_FILE" ) {
- require $SITE_CONFIG_FILE
- || die ("Couldn't load RT config file '$SITE_CONFIG_FILE'\n$@");
- }
- require $CORE_CONFIG_FILE
- || die ("Couldn't load RT config file '$CORE_CONFIG_FILE'\n$@");
- RT::I18N->Init;
-}
-
-=item Init
-
- Conenct to the database, set up logging.
-
-=cut
-
sub Init {
- require RT::Handle;
#Get a database connection
- unless ($Handle && $Handle->dbh->ping) {
- $Handle = RT::Handle->new();
- }
+ $Handle = new RT::Handle($RT::DatabaseType);
$Handle->Connect();
+
#RT's system user is a genuine database user. its id lives here
$SystemUser = new RT::CurrentUser();
$SystemUser->LoadByName('RT_System');
@@ -131,9 +34,7 @@ sub Init {
#RT's "nobody user" is a genuine database user. its ID lives here.
$Nobody = new RT::CurrentUser();
$Nobody->LoadByName('Nobody');
-
- $System = RT::System->new();
-
+
InitLogging();
}
@@ -150,81 +51,30 @@ sub InitLogging {
$, = '';
use Log::Dispatch 1.6;
+ use Log::Dispatch::File;
+ use Log::Dispatch::Screen;
- unless ($RT::Logger) {
-
- $RT::Logger=Log::Dispatch->new();
+ $Logger=Log::Dispatch->new();
if ($RT::LogToFile) {
+ my $filename = $RT::LogToFileNamed || "$RT::LogDir/rt.log";
- unless (-d $RT::LogDir && -w $RT::LogDir) {
- # localizing here would be hard when we don't have a current user yet
- # die $self->loc("Log directory [_1] not found or couldn't be written.\n RT can't run.", $RT::LogDir);
- die ("Log directory $RT::LogDir not found or couldn't be written.\n RT can't run.");
- }
-
- my $filename;
- if ($RT::LogToFileNamed =~ m![/\\]!) {
- # looks like an absolute path.
- $filename = $RT::LogToFileNamed;
- }
- else {
- $filename = "$RT::LogDir/$RT::LogToFileNamed";
- }
- require Log::Dispatch::File;
-
-
- $RT::Logger->add(Log::Dispatch::File->new
+ $Logger->add(Log::Dispatch::File->new
( name=>'rtlog',
min_level=> $RT::LogToFile,
filename=> $filename,
mode=>'append',
- callbacks => sub { my %p = @_;
- my ($package, $filename, $line) = caller(5);
- return "[".gmtime(time)."] [".$p{level}."]: $p{message} ($filename:$line)\n"}
-
-
-
+ callbacks => sub {my %p=@_; return "[".gmtime(time)."] [".$p{level}."]: $p{message}\n"}
+
));
}
if ($RT::LogToScreen) {
- require Log::Dispatch::Screen;
- $RT::Logger->add(Log::Dispatch::Screen->new
+ $Logger->add(Log::Dispatch::Screen->new
( name => 'screen',
min_level => $RT::LogToScreen,
- callbacks => sub { my %p = @_;
- my ($package, $filename, $line) = caller(5);
- return "[".gmtime(time)."] [".$p{level}."]: $p{message} ($filename:$line)\n"
- },
-
- stderr => 1
- ));
- }
- if ($RT::LogToSyslog) {
- require Log::Dispatch::Syslog;
- $RT::Logger->add(Log::Dispatch::Syslog->new
- ( name => 'syslog',
- ident => 'RT',
- min_level => $RT::LogToSyslog,
- callbacks => sub { my %p = @_;
- my ($package, $filename, $line) = caller(5);
-
- # syswrite() cannot take utf8; turn it off here.
- Encode::_utf8_off($p{message});
-
- if ($p{level} eq 'debug') {
-
- return "$p{message}\n" }
- else {
- return "$p{message} ($filename:$line)\n"}
- },
-
stderr => 1
));
}
-
- }
-
# {{{ Signal handlers
## This is the default handling of warnings and die'ings in the code
@@ -238,7 +88,6 @@ $SIG{__WARN__} = sub {$RT::Logger->warning($_[0])};
$SIG{__DIE__} = sub {
unless ($^S || !defined $^S ) {
- $RT::Handle->Rollback();
$RT::Logger->crit("$_[0]");
exit(-1);
}
@@ -278,6 +127,10 @@ sub DropSetGIDPermissions {
}
+=head1 NAME
+
+RT - Request Tracker
+
=head1 SYNOPSIS
=head1 BUGS
@@ -287,6 +140,7 @@ sub DropSetGIDPermissions {
=begin testing
+ok (require RT::TestHarness);
ok ($RT::Nobody->Name() eq 'Nobody', "Nobody is nobody");
ok ($RT::Nobody->Name() ne 'root', "Nobody isn't named root");
@@ -298,7 +152,4 @@ ok ($RT::SystemUser->Name() ne 'noname', "The system user isn't noname");
=cut
-eval "require RT_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT_Local.pm});
-
1;
diff --git a/rt/lib/RT/ACE.pm b/rt/lib/RT/ACE.pm
index 1501a125e..d4681cf44 100755
--- a/rt/lib/RT/ACE.pm
+++ b/rt/lib/RT/ACE.pm
@@ -1,304 +1,774 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ACE.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
-RT::ACE
-
+ RT::ACE - RT\'s ACE object
=head1 SYNOPSIS
+ use RT::ACE;
+ my $ace = new RT::ACE($CurrentUser);
+
+
=head1 DESCRIPTION
+
=head1 METHODS
+=begin testing
+
+ok(require RT::TestHarness);
+ok(require RT::ACE);
+
+=end testing
+
=cut
package RT::ACE;
-use RT::Record;
+use RT::Record;
+@ISA= qw(RT::Record);
+use vars qw (%SCOPES
+ %QUEUERIGHTS
+ %SYSTEMRIGHTS
+ %LOWERCASERIGHTNAMES
+ );
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+%SCOPES = (
+ System => 'System-level right',
+ Queue => 'Queue-level right'
+ );
-sub _Init {
- my $self = shift;
+# {{{ Descriptions of rights
+
+# Queue rights are the sort of queue rights that can only be granted
+# to real people or groups
+%QUEUERIGHTS = (
+ SeeQueue => 'Can this principal see this queue',
+ AdminQueue => 'Create, delete and modify queues',
+ ShowACL => 'Display Access Control List',
+ ModifyACL => 'Modify Access Control List',
+ ModifyQueueWatchers => 'Modify the queue watchers',
+ AdminKeywordSelects => 'Create, delete and modify keyword selections',
+
+
+ ModifyTemplate => 'Modify email templates for this queue',
+ ShowTemplate => 'Display email templates for this queue',
+ ModifyScrips => 'Modify Scrips for this queue',
+ ShowScrips => 'Display Scrips for this queue',
+
+ ShowTicket => 'Show ticket summaries',
+ ShowTicketComments => 'Show ticket private commentary',
+
+ Watch => 'Sign up as a ticket Requestor or ticket or queue Cc',
+ WatchAsAdminCc => 'Sign up as a ticket or queue AdminCc',
+ CreateTicket => 'Create tickets in this queue',
+ ReplyToTicket => 'Reply to tickets',
+ CommentOnTicket => 'Comment on tickets',
+ OwnTicket => 'Own tickets',
+ ModifyTicket => 'Modify tickets',
+ DeleteTicket => 'Delete tickets'
+
+ );
- $self->Table('ACL');
- $self->SUPER::_Init(@_);
-}
+# System rights are rights granted to the whole system
+%SYSTEMRIGHTS = (
+ SuperUser => 'Do anything and everything',
+ AdminKeywords => 'Creatte, delete and modify keywords',
+ AdminGroups => 'Create, delete and modify groups',
+ AdminUsers => 'Create, Delete and Modify users',
+ ModifySelf => 'Modify one\'s own RT account',
+ );
+# }}}
+# {{{ Descriptions of principals
-=item Create PARAMHASH
+%TICKET_METAPRINCIPALS = ( Owner => 'The owner of a ticket',
+ Requestor => 'The requestor of a ticket',
+ Cc => 'The CC of a ticket',
+ AdminCc => 'The administrative CC of a ticket',
+ );
-Create takes a hash of values and creates a row in the database:
+# }}}
- varchar(25) 'PrincipalType'.
- int(11) 'PrincipalId'.
- varchar(25) 'RightName'.
- varchar(25) 'ObjectType'.
- int(11) 'ObjectId'.
- int(11) 'DelegatedBy'.
- int(11) 'DelegatedFrom'.
+# {{{ We need to build a hash of all rights, keyed by lower case names
+
+#since you can't do case insensitive hash lookups
+
+foreach $right (keys %QUEUERIGHTS) {
+ $LOWERCASERIGHTNAMES{lc $right}=$right;
+}
+foreach $right (keys %SYSTEMRIGHTS) {
+ $LOWERCASERIGHTNAMES{lc $right}=$right;
+}
+
+# }}}
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ACL";
+ return($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub LoadByValues
+
+=head2 LoadByValues PARAMHASH
+
+Load an ACE by specifying a paramhash with the following fields:
+
+ PrincipalId => undef,
+ PrincipalType => undef,
+ RightName => undef,
+ RightScope => undef,
+ RightAppliesTo => undef,
=cut
+sub LoadByValues {
+ my $self = shift;
+ my %args = (PrincipalId => undef,
+ PrincipalType => undef,
+ RightName => undef,
+ RightScope => undef,
+ RightAppliesTo => undef,
+ @_);
+
+ $self->LoadByCols (PrincipalId => $args{'PrincipalId'},
+ PrincipalType => $args{'PrincipalType'},
+ RightName => $args{'RightName'},
+ RightScope => $args{'RightScope'},
+ RightAppliesTo => $args{'RightAppliesTo'}
+ );
+
+ #If we couldn't load it.
+ unless ($self->Id) {
+ return (0, "ACE not found");
+ }
+ # if we could
+ return ($self->Id, "ACE Loaded");
+
+}
+
+# }}}
+# {{{ sub Create
+=head2 Create <PARAMS>
+
+PARAMS is a parameter hash with the following elements:
+
+ PrincipalType => "Queue"|"User"
+ PrincipalId => an intentifier you can use to ->Load a user or group
+ RightName => the name of a right. in any case
+ RightScope => "System" | "Queue"
+ RightAppliesTo => a queue id or undef
+
+=cut
sub Create {
my $self = shift;
- my %args = (
- PrincipalType => '',
- PrincipalId => '0',
- RightName => '',
- ObjectType => '',
- ObjectId => '0',
- DelegatedBy => '0',
- DelegatedFrom => '0',
-
- @_);
- $self->SUPER::Create(
- PrincipalType => $args{'PrincipalType'},
- PrincipalId => $args{'PrincipalId'},
- RightName => $args{'RightName'},
- ObjectType => $args{'ObjectType'},
- ObjectId => $args{'ObjectId'},
- DelegatedBy => $args{'DelegatedBy'},
- DelegatedFrom => $args{'DelegatedFrom'},
-);
-
+ my %args = ( PrincipalId => undef,
+ PrincipalType => undef,
+ RightName => undef,
+ RightScope => undef,
+ RightAppliesTo => undef,
+ @_
+ );
+
+ # {{{ Validate the principal
+ my ($princ_obj);
+ if ($args{'PrincipalType'} eq 'User') {
+ $princ_obj = new RT::User($RT::SystemUser);
+
+ }
+ elsif ($args{'PrincipalType'} eq 'Group') {
+ require RT::Group;
+ $princ_obj = new RT::Group($RT::SystemUser);
+ }
+ else {
+ return (0, 'Principal type '.$args{'PrincipalType'} . ' is invalid.');
+ }
+
+ $princ_obj->Load($args{'PrincipalId'});
+ my $princ_id = $princ_obj->Id();
+
+ unless ($princ_id) {
+ return (0, 'Principal '.$args{'PrincipalId'}.' not found.');
+ }
+
+ # }}}
+
+ #TODO allow loading of queues by name.
+
+ # {{{ Check the ACL
+ if ($args{'RightScope'} eq 'System') {
+
+ unless ($self->CurrentUserHasSystemRight('ModifyACL')) {
+ $RT::Logger->error("Permission Denied.");
+ return(undef);
+ }
+ }
+
+ elsif ($args{'RightScope'} eq 'Queue') {
+ unless ($self->CurrentUserHasQueueRight( Queue => $args{'RightAppliesTo'},
+ Right => 'ModifyACL')) {
+ return (0, 'Permission Denied.');
+ }
+
+
+
+
+ }
+ #If it's not a scope we recognise, something scary is happening.
+ else {
+ $RT::Logger->err("RT::ACE->Create got a scope it didn't recognize: ".
+ $args{'RightScope'}." Bailing. \n");
+ return(0,"System error. Unable to grant rights.");
+ }
+
+ # }}}
+
+ # {{{ Canonicalize and check the right name
+ $args{'RightName'} = $self->CanonicalizeRightName($args{'RightName'});
+
+ #check if it's a valid RightName
+ if ($args{'RightScope'} eq 'Queue') {
+ unless (exists $QUEUERIGHTS{$args{'RightName'}}) {
+ return(0, 'Invalid right');
+ }
+ }
+ elsif ($args{'RightScope' eq 'System'}) {
+ unless (exists $SYSTEMRIGHTS{$args{'RightName'}}) {
+ return(0, 'Invalid right');
+ }
+ }
+ # }}}
+
+ # Make sure the right doesn't already exist.
+ $self->LoadByCols (PrincipalId => $princ_id,
+ PrincipalType => $args{'PrincipalType'},
+ RightName => $args{'RightName'},
+ RightScope => $args {'RightScope'},
+ RightAppliesTo => $args{'RightAppliesTo'}
+ );
+ if ($self->Id) {
+ return (0, 'That user already has that right');
+ }
+
+ my $id = $self->SUPER::Create( PrincipalId => $princ_id,
+ PrincipalType => $args{'PrincipalType'},
+ RightName => $args{'RightName'},
+ RightScope => $args {'RightScope'},
+ RightAppliesTo => $args{'RightAppliesTo'}
+ );
+
+
+ if ($id > 0 ) {
+ return ($id, 'Right Granted');
+ }
+ else {
+ $RT::Logger->err('System error. right not granted.');
+ return(0, 'System Error. right not granted');
+ }
}
+# }}}
-=item id
+# {{{ sub Delete
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+=head2 Delete
+Delete this object.
=cut
+sub Delete {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('ModifyACL')) {
+ return (0, 'Permission Denied');
+ }
+
+
+ my ($val,$msg) = $self->SUPER::Delete(@_);
+ if ($val) {
+ return ($val, 'ACE Deleted');
+ }
+ else {
+ return (0, 'ACE could not be deleted');
+ }
+}
-=item PrincipalType
+# }}}
-Returns the current value of PrincipalType.
-(In the database, PrincipalType is stored as varchar(25).)
+# {{{ sub _BootstrapRight
+=head2 _BootstrapRight
+Grant a right with no error checking and no ACL. this is _only_ for
+installation. If you use this routine without jesse@fsck.com's explicit
+written approval, he will hunt you down and make you spend eternity
+translating mozilla's code into FORTRAN or intercal.
-=item SetPrincipalType VALUE
+=cut
+
+sub _BootstrapRight {
+ my $self = shift;
+ my %args = @_;
+
+ my $id = $self->SUPER::Create( PrincipalId => $args{'PrincipalId'},
+ PrincipalType => $args{'PrincipalType'},
+ RightName => $args{'RightName'},
+ RightScope => $args {'RightScope'},
+ RightAppliesTo => $args{'RightAppliesTo'}
+ );
+
+ if ($id > 0 ) {
+ return ($id);
+ }
+ else {
+ $RT::Logger->err('System error. right not granted.');
+ return(undef);
+ }
+
+}
+
+# }}}
+# {{{ sub CanonicalizeRightName
-Set PrincipalType to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, PrincipalType will be stored as a varchar(25).)
+=head2 CanonicalizeRightName <RIGHT>
+Takes a queue or system right name in any case and returns it in
+the correct case. If it's not found, will return undef.
=cut
+sub CanonicalizeRightName {
+ my $self = shift;
+ my $right = shift;
+ $right = lc $right;
+ if (exists $LOWERCASERIGHTNAMES{"$right"}) {
+ return ($LOWERCASERIGHTNAMES{"$right"});
+ }
+ else {
+ return (undef);
+ }
+}
+
+# }}}
-=item PrincipalId
+# {{{ sub QueueRights
-Returns the current value of PrincipalId.
-(In the database, PrincipalId is stored as int(11).)
+=head2 QueueRights
+Returns a hash of all the possible rights at the queue scope
+=cut
-=item SetPrincipalId VALUE
+sub QueueRights {
+ return (%QUEUERIGHTS);
+}
+# }}}
-Set PrincipalId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, PrincipalId will be stored as a int(11).)
+# {{{ sub SystemRights
+=head2 SystemRights
+
+Returns a hash of all the possible rights at the system scope
=cut
+sub SystemRights {
+ return (%SYSTEMRIGHTS);
+}
-=item RightName
-Returns the current value of RightName.
-(In the database, RightName is stored as varchar(25).)
+# }}}
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ PrincipalId => 'read/write',
+ PrincipalType => 'read/write',
+ RightName => 'read/write',
+ RightScope => 'read/write',
+ RightAppliesTo => 'read/write'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
+}
+# }}}
-=item SetRightName VALUE
+# {{{ sub AppliesToObj
+=head2 AppliesToObj
-Set RightName to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, RightName will be stored as a varchar(25).)
+If the AppliesTo is a queue, returns the queue object. If it's
+the system object, returns undef. If the user has no rights, returns undef.
+=cut
+
+sub AppliesToObj {
+ my $self = shift;
+ if ($self->RightScope eq 'Queue') {
+ my $appliesto_obj = new RT::Queue($self->CurrentUser);
+ $appliesto_obj->Load($self->RightAppliesTo);
+ return($appliesto_obj);
+ }
+ elsif ($self->RightScope eq 'System') {
+ return (undef);
+ }
+ else {
+ $RT::Logger->warning("$self -> AppliesToObj called for an object ".
+ "of an unknown scope:" . $self->RightScope);
+ return(undef);
+ }
+}
+
+# }}}
+
+# {{{ sub PrincipalObj
+
+=head2 PrincipalObj
+
+If the AppliesTo is a group, returns the group object.
+If the AppliesTo is a user, returns the user object.
+Otherwise, it logs a warning and returns undef.
=cut
+sub PrincipalObj {
+ my $self = shift;
+ my ($princ_obj);
+
+ if ($self->PrincipalType eq 'Group') {
+ use RT::Group;
+ $princ_obj = new RT::Group($self->CurrentUser);
+ }
+ elsif ($self->PrincipalType eq 'User') {
+ $princ_obj = new RT::User($self->CurrentUser);
+ }
+ else {
+ $RT::Logger->warning("$self -> PrincipalObj called for an object ".
+ "of an unknown principal type:" .
+ $self->PrincipalType ."\n");
+ return(undef);
+ }
+
+ $princ_obj->Load($self->PrincipalId);
+ return($princ_obj);
+
+}
+
+# }}}
+
+# {{{ ACL related methods
+
+# {{{ sub _Set
+
+sub _Set {
+ my $self = shift;
+ return (0, "ACEs can only be created and deleted.");
+}
-=item ObjectType
+# }}}
-Returns the current value of ObjectType.
-(In the database, ObjectType is stored as varchar(25).)
+# {{{ sub _Value
+sub _Value {
+ my $self = shift;
+ unless ($self->CurrentUserHasRight('ShowACL')) {
+ return (undef);
+ }
-=item SetObjectType VALUE
+ return ($self->__Value(@_));
+}
+
+# }}}
-Set ObjectType to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ObjectType will be stored as a varchar(25).)
+# {{{ sub CurrentUserHasQueueRight
+=head2 CurrentUserHasQueueRight ( Queue => QUEUEID, Right => RIGHTNANAME )
+
+Check to see whether the current user has the specified right for the specified queue.
=cut
+sub CurrentUserHasQueueRight {
+ my $self = shift;
+ my %args = (Queue => undef,
+ Right => undef,
+ @_
+ );
+ return ($self->HasRight( Right => $args{'Right'},
+ Principal => $self->CurrentUser->UserObj,
+ Queue => $args{'Queue'}));
+}
+
+# }}}
+
+# {{{ sub CurrentUserHasSystemRight
+=head2 CurrentUserHasSystemRight RIGHTNAME
+
+Check to see whether the current user has the specified right for the 'system' scope.
+
+=cut
+
+sub CurrentUserHasSystemRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->HasRight( Right => $right,
+ Principal => $self->CurrentUser->UserObj,
+ System => 1
+ ));
+}
+
-=item ObjectId
+# }}}
-Returns the current value of ObjectId.
-(In the database, ObjectId is stored as int(11).)
+# {{{ sub CurrentUserHasRight
+=item CurrentUserHasRight RIGHT
+Takes a rightname as a string.
+Helper menthod for HasRight. Presets Principal to CurrentUser then
+calls HasRight.
-=item SetObjectId VALUE
+=cut
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->HasRight( Principal => $self->CurrentUser->UserObj,
+ Right => $right,
+ ));
+}
-Set ObjectId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ObjectId will be stored as a int(11).)
+# }}}
+# {{{ sub HasRight
+
+=item HasRight
+
+Takes a param-hash consisting of "Right" and "Principal" Principal is
+an RT::User object or an RT::CurrentUser object. "Right" is a textual
+Right string that applies to KeywordSelects
=cut
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => undef,
+ Queue => undef,
+ System => undef,
+ @_ );
+
+ #If we're explicitly specifying a queue, as we need to do on create
+ if (defined $args{'Queue'}) {
+ return ($args{'Principal'}->HasQueueRight(Right => $args{'Right'},
+ Queue => $args{'Queue'}));
+ }
+ #else if we're specifying to check a system right
+ elsif ((defined $args{'System'}) and (defined $args{'Right'})) {
+ return( $args{'Principal'}->HasSystemRight( $args{'Right'} ));
+ }
+
+ elsif ($self->__Value('RightScope') eq 'System') {
+ return $args{'Principal'}->HasSystemRight($args{'Right'});
+ }
+ elsif ($self->__Value('RightScope') eq 'Queue') {
+ return $args{'Principal'}->HasQueueRight( Queue => $self->__Value('RightAppliesTo'),
+ Right => $args{'Right'} );
+ }
+ else {
+ $RT::Logger->warning("$self: Trying to check an acl for a scope we ".
+ "don't understand:" . $self->__Value('RightScope') ."\n");
+ return undef;
+ }
-=item DelegatedBy
-Returns the current value of DelegatedBy.
-(In the database, DelegatedBy is stored as int(11).)
+}
+# }}}
+# }}}
-=item SetDelegatedBy VALUE
+1;
+__DATA__
-Set DelegatedBy to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, DelegatedBy will be stored as a int(11).)
+# {{{ POD
+=head1 Out of date docs
-=cut
+=head2 Table Structure
+PrincipalType, PrincipalId, Right,Scope,AppliesTo
-=item DelegatedFrom
+=head1 The docs are out of date. so you know.
-Returns the current value of DelegatedFrom.
-(In the database, DelegatedFrom is stored as int(11).)
+=head1 Scopes
+Scope is the scope of the right granted, not the granularity of the grant.
+For example, Queue and Ticket rights are both granted for a "queue."
+Rights with a scope of 'System' don't have an AppliesTo. (They're global).
+Rights with a scope of "Queue" are rights that act on a queue.
+Rights with a scope of "System" are rights that act on some other aspect
+of the system.
-=item SetDelegatedFrom VALUE
+=item Queue
+=item System
-Set DelegatedFrom to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, DelegatedFrom will be stored as a int(11).)
+=head1 Rights
+=head2 Scope: Queue
-=cut
+=head2 Queue rights that apply to a ticket within a queue
+Create Ticket in <queue>
+ Name: Create
+ Principals: <user> <group>
+Display Ticket Summary in <queue>
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- PrincipalType =>
- {read => 1, write => 1, type => 'varchar(25)', default => ''},
- PrincipalId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- RightName =>
- {read => 1, write => 1, type => 'varchar(25)', default => ''},
- ObjectType =>
- {read => 1, write => 1, type => 'varchar(25)', default => ''},
- ObjectId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- DelegatedBy =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- DelegatedFrom =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
+ Name: Show
+ Principals: <user> <group> Owner Requestor Cc AdminCc
- }
-};
+Display Ticket History <queue>
+ Name: ShowHistory
+ Principals: <user> <group> Owner Requestor Cc AdminCc
- eval "require RT::ACE_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ACE_Overlay.pm}) {
- die $@;
- };
+Display Ticket Private Comments <queue>
- eval "require RT::ACE_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ACE_Vendor.pm}) {
- die $@;
- };
+ Name: ShowComments
+ Principals: <user> <group> Owner Requestor Cc AdminCc
- eval "require RT::ACE_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ACE_Local.pm}) {
- die $@;
- };
+Reply to Ticket in <queue>
+ Name: Reply
+ Principals: <user> <group> Owner Requestor Cc AdminCc
+Comment on Ticket in <queue>
+ Name: Comment
+ Principals: <user> <group> Owner Requestor Cc AdminCc
-=head1 SEE ALSO
+Modify Ticket in <queue>
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+ Name: Modify
+ Principals: <user> <group> Owner Requestor Cc AdminCc
-These overlay files can contain new subs or subs to replace existing subs in this module.
+Delete Tickets in <queue>
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+ Name: Delete
+ Principals: <user> <group> Owner Requestor Cc AdminCc
- no warnings qw(redefine);
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 Queue Rights that apply to a whole queue
-RT::ACE_Overlay, RT::ACE_Vendor, RT::ACE_Local
+These rights can only be granted to "real people"
-=cut
+List Tickets in <queue>
+ Name: ListQueue
+ Principals: <user> <group>
-1;
+Know that <queue> exists
+
+ Name: See
+ Principals: <user> <group>
+
+Display queue settings
+
+ Name: Explore
+ Principals: <user> <group>
+
+Modify Queue Watchers for <queue>
+
+ Name: ModifyQueueWatchers
+ Principals: <user> <group>
+
+Modify Queue Attributes for <queue>
+
+ Name: ModifyQueue
+ Principals: <user> <group>
+
+Modify Queue ACL for queue <queue>
+
+ Name: ModifyACL
+ Principals: <user> <group>
+
+
+=head2 Rights that apply to the System scope
+
+=head2 SystemRights
+
+Create Queue
+
+ Name: CreateQueue
+ Principals: <user> <group>
+Delete Queue
+
+ Name: DeleteQueue
+ Principals: <user> <group>
+
+Create Users
+
+ Name: CreateUser
+ Principals: <user> <group>
+
+Delete Users
+
+ Name: DeleteUser
+ Principals: <user> <group>
+
+Modify Users
+
+ Name: ModifyUser
+ Principals: <user> <group>
+
+Modify Self
+ Name: ModifySelf
+ Principals: <user> <group>
+
+Browse Users
+
+ Name: BrowseUsers (NOT IMPLEMENTED in 2.0)
+ Principals: <user> <group>
+
+Modify Self
+
+ Name: ModifySelf
+ Principals: <user> <group>
+
+Modify System ACL
+
+ Name: ModifyACL
+ Principals: <user> <group>
+
+=head1 The Principal Side of the ACE
+
+=head2 PrincipalTypes,PrincipalIds in our Neighborhood
+
+ User,<userid>
+ Group,<groupip>
+ Everyone,NULL
+
+=cut
+
+# }}}
diff --git a/rt/lib/RT/ACL.pm b/rt/lib/RT/ACL.pm
index 81f59c6d0..444a4c2af 100755
--- a/rt/lib/RT/ACL.pm
+++ b/rt/lib/RT/ACL.pm
@@ -1,115 +1,308 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ACL.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Distributed under the terms of the GNU GPL
+# Copyright (c) 2000 Jesse Vincent <jesse@fsck.com>
=head1 NAME
- RT::ACL -- Class Description
-
+ RT::ACL - collection of RT ACE objects
+
=head1 SYNOPSIS
- use RT::ACL
+ use RT::ACL;
+my $ACL = new RT::ACL($CurrentUser);
=head1 DESCRIPTION
=head1 METHODS
+=begin testing
+
+ok(require RT::TestHarness);
+ok(require RT::ACL);
+
+=end testing
+
=cut
package RT::ACL;
-
-use RT::SearchBuilder;
+use RT::EasySearch;
use RT::ACE;
+@ISA= qw(RT::EasySearch);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ACL";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_));
+
+}
+# }}}
+
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return(RT::ACE->new($self->CurrentUser));
+}
+# }}}
+
+=head2 Next
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+Hand out the next ACE that was found
+=cut
-sub _Init {
+# {{{ sub Next
+sub Next {
my $self = shift;
- $self->{'table'} = 'ACL';
- $self->{'primary_key'} = 'id';
+
+ my $ACE = $self->SUPER::Next();
+ if ((defined($ACE)) and (ref($ACE))) {
+
+ if ( $ACE->CurrentUserHasRight('ShowACL') or
+ $ACE->CurrentUserHasRight('ModifyACL')
+ ) {
+ return($ACE);
+ }
+
+ #If the user doesn't have the right to show this ACE
+ else {
+ return($self->Next());
+ }
+ }
+ #if there never was any ACE
+ else {
+ return(undef);
+ }
+
+}
+# }}}
- return ( $self->SUPER::_Init(@_) );
-}
+=head1 Limit the ACL to a specific scope
+
+There are two real scopes right now:
+
+=item Queue is for rights that apply to a single queue
+
+=item System is for rights that apply to the System (rights that aren't queue related)
-=item NewItem
-Returns an empty new RT::ACE item
+=head2 LimitToQueue
+
+Takes a single queueid as its argument.
+
+Limit the ACL to just a given queue when supplied with an integer queue id.
=cut
-sub NewItem {
+sub LimitToQueue {
my $self = shift;
- return(RT::ACE->new($self->CurrentUser));
+ my $queue = shift;
+
+
+
+ $self->Limit( FIELD =>'RightScope',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => 'Queue');
+ $self->Limit( FIELD =>'RightScope',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => 'Ticket');
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'RightAppliesTo',
+ VALUE => $queue );
+
+}
+
+
+=head2 LimitToSystem()
+
+Limit the ACL to system rights
+
+=cut
+
+sub LimitToSystem {
+ my $self = shift;
+
+ $self->Limit( FIELD =>'RightScope',
+ VALUE => 'System');
+}
+
+
+=head2 LimitRightTo
+
+Takes a single RightName as its only argument.
+Limits the search to the right $right.
+$right is a right listed in perldoc RT::ACE
+
+=cut
+
+sub LimitRightTo {
+ my $self = shift;
+ my $right = shift;
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'RightName',
+ VALUE => $right );
+
+}
+
+=head1 Limit to a specifc set of principals
+
+=head2 LimitPrincipalToUser
+
+Takes a single userid as its only argument.
+Limit the ACL to a just a specific user.
+
+=cut
+
+sub LimitPrincipalToUser {
+ my $self = shift;
+ my $user = shift;
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalType',
+ VALUE => 'User' );
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalId',
+ VALUE => $user );
+
+}
+
+
+=head2 LimitPrincipalToGroup
+
+Takes a single group as its only argument.
+Limit the ACL to just a specific group.
+
+=cut
+
+sub LimitPrincipalToGroup {
+ my $self = shift;
+ my $group = shift;
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalType',
+ VALUE => 'Group' );
+
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalId',
+ VALUE => $group );
+
+}
+
+=head2 LimitPrincipalToType($type)
+
+Takes a single argument, $type.
+Limit the ACL to just a specific principal type
+
+$type is one of:
+ TicketOwner
+ TicketRequestor
+ TicketCc
+ TicketAdminCc
+ Everyone
+ User
+ Group
+
+=cut
+
+sub LimitPrincipalToType {
+ my $self=shift;
+ my $type=shift;
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalType',
+ VALUE => $type );
}
- eval "require RT::ACL_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ACL_Overlay.pm}) {
- die $@;
- };
- eval "require RT::ACL_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ACL_Vendor.pm}) {
- die $@;
- };
+=head2 LimitPrincipalToId
- eval "require RT::ACL_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ACL_Local.pm}) {
- die $@;
- };
+Takes a single argument, the numeric Id of the principal to limit this ACL to. Repeated calls to this
+function will broaden the scope of the search to include all principals listed.
+
+=cut
+
+sub LimitPrincipalToId {
+ my $self = shift;
+ my $id = shift;
+
+ if ($id =~ /^\d+$/) {
+ $self->Limit(ENTRYAGGREGATOR => 'OR',
+ FIELD => 'PrincipalId',
+ VALUE => $id );
+ }
+ else {
+ $RT::Logger->warn($self."->LimitPrincipalToId called with '$id' as an id");
+ return undef;
+ }
+}
+#wrap around _DoSearch so that we can build the hash of returned
+#values
+sub _DoSearch {
+ my $self = shift;
+ # $RT::Logger->debug("Now in ".$self."->_DoSearch");
+ my $return = $self->SUPER::_DoSearch(@_);
+ # $RT::Logger->debug("In $self ->_DoSearch. return from SUPER::_DoSearch was $return\n");
+ $self->_BuildHash();
+ return ($return);
+}
-=head1 SEE ALSO
+#Build a hash of this ACL's entries.
+sub _BuildHash {
+ my $self = shift;
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+ while (my $entry = $self->Next) {
+ my $hashkey = $entry->RightScope . "-" .
+ $entry->RightAppliesTo . "-" .
+ $entry->RightName . "-" .
+ $entry->PrincipalId . "-" .
+ $entry->PrincipalType;
-These overlay files can contain new subs or subs to replace existing subs in this module.
+ $self->{'as_hash'}->{"$hashkey"} =1;
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+ }
+}
- no warnings qw(redefine);
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+# {{{ HasEntry
-RT::ACL_Overlay, RT::ACL_Vendor, RT::ACL_Local
+=head2 HasEntry
=cut
+sub HasEntry {
+
+ my $self = shift;
+ my %args = ( RightScope => undef,
+ RightAppliesTo => undef,
+ RightName => undef,
+ PrincipalId => undef,
+ PrincipalType => undef,
+ @_ );
+
+ #if we haven't done the search yet, do it now.
+ $self->_DoSearch();
+
+ if ($self->{'as_hash'}->{ $args{'RightScope'} . "-" .
+ $args{'RightAppliesTo'} . "-" .
+ $args{'RightName'} . "-" .
+ $args{'PrincipalId'} . "-" .
+ $args{'PrincipalType'}
+ } == 1) {
+ return(1);
+ }
+ else {
+ return(undef);
+ }
+}
+# }}}
1;
diff --git a/rt/lib/RT/Action/Autoreply.pm b/rt/lib/RT/Action/Autoreply.pm
index 81f7bddfa..624888e94 100755
--- a/rt/lib/RT/Action/Autoreply.pm
+++ b/rt/lib/RT/Action/Autoreply.pm
@@ -1,31 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Autoreply.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
package RT::Action::Autoreply;
require RT::Action::SendEmail;
-
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Action::SendEmail);
@@ -41,7 +17,7 @@ Sets the recipients of this message to this ticket's Requestor.
sub SetRecipients {
my $self=shift;
- push(@{$self->{'To'}}, $self->TicketObj->Requestors->MemberEmailAddresses);
+ push(@{$self->{'To'}}, @{$self->TicketObj->Requestors->Emails});
return(1);
}
@@ -63,7 +39,6 @@ sub SetReturnAddress {
@_
);
- my $replyto;
if ($args{'is_comment'}) {
$replyto = $self->TicketObj->QueueObj->CommentAddress ||
$RT::CommentAddress;
@@ -74,9 +49,7 @@ sub SetReturnAddress {
}
unless ($self->TemplateObj->MIMEObj->head->get('From')) {
- my $friendly_name = $self->TicketObj->QueueObj->Description ||
- $self->TicketObj->QueueObj->Name;
- $friendly_name =~ s/"/\\"/g;
+ my $friendly_name=$self->TicketObj->QueueObj->Name;
$self->SetHeader('From', "\"$friendly_name\" <$replyto>");
}
@@ -88,9 +61,4 @@ sub SetReturnAddress {
# }}}
-eval "require RT::Action::Autoreply_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Vendor.pm});
-eval "require RT::Action::Autoreply_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/Generic.pm b/rt/lib/RT/Action/Generic.pm
index 007d299c7..ecfd4ab1a 100755
--- a/rt/lib/RT/Action/Generic.pm
+++ b/rt/lib/RT/Action/Generic.pm
@@ -1,26 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Generic.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
=head1 NAME
RT::Action::Generic - a generic baseclass for RT Actions
@@ -35,6 +16,7 @@
=begin testing
+ok (require RT::TestHarness);
ok (require RT::Action::Generic);
=end testing
@@ -43,8 +25,6 @@ ok (require RT::Action::Generic);
package RT::Action::Generic;
-use strict;
-
# {{{ sub new
sub new {
my $proto = shift;
@@ -56,13 +36,6 @@ sub new {
}
# }}}
-# {{{ sub new
-sub loc {
- my $self = shift;
- return $self->{'ScripObj'}->loc(@_);
-}
-# }}}
-
# {{{ sub _Init
sub _Init {
my $self = shift;
@@ -114,13 +87,6 @@ sub TemplateObj {
}
# }}}
-# {{{ sub ScripObj
-sub ScripObj {
- my $self = shift;
- return($self->{'ScripObj'});
-}
-# }}}
-
# {{{ sub Type
sub Type {
my $self = shift;
@@ -136,7 +102,7 @@ sub Type {
# {{{ sub Commit
sub Commit {
my $self = shift;
- return(0, $self->loc("Commit Stubbed"));
+ return(0,"Commit Stubbed");
}
# }}}
@@ -146,7 +112,7 @@ sub Commit {
# {{{ sub Describe
sub Describe {
my $self = shift;
- return $self->loc("No description for [_1]", ref $self);
+ return ("No description for " . ref $self);
}
# }}}
@@ -156,7 +122,7 @@ sub Describe {
# {{{ sub Prepare
sub Prepare {
my $self = shift;
- return (0, $self->loc("Prepare Stubbed"));
+ return (0,"Prepare Stubbed");
}
# }}}
@@ -186,10 +152,4 @@ sub DESTROY {
}
# }}}
-
-eval "require RT::Action::Generic_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Vendor.pm});
-eval "require RT::Action::Generic_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/Notify.pm b/rt/lib/RT/Action/Notify.pm
index 1e4e4c073..6dca4fd41 100755
--- a/rt/lib/RT/Action/Notify.pm
+++ b/rt/lib/RT/Action/Notify.pm
@@ -1,31 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Notify.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
package RT::Action::Notify;
require RT::Action::SendEmail;
-
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Action::SendEmail);
# {{{ sub SetRecipients
@@ -33,14 +9,14 @@ use vars qw/@ISA/;
=head2 SetRecipients
Sets the recipients of this meesage to Owner, Requestor, AdminCc, Cc or All.
-Explicitly B<does not> notify the creator of the transaction by default
+Explicitly B<does not> notify the creator of the transaction.
=cut
sub SetRecipients {
my $self = shift;
- my $arg = $self->Argument;
+ $arg = $self->Argument;
$arg =~ s/\bAll\b/Owner,Requestor,AdminCc,Cc/;
@@ -48,14 +24,14 @@ sub SetRecipients {
if ($arg =~ /\bOtherRecipients\b/) {
- if ($self->TransactionObj->Attachments->First) {
- push (@Cc, $self->TransactionObj->Attachments->First->GetHeader('RT-Send-Cc'));
- push (@Bcc, $self->TransactionObj->Attachments->First->GetHeader('RT-Send-Bcc'));
+ if ($self->TransactionObj->Message->First) {
+ push (@Cc, $self->TransactionObj->Message->First->GetHeader('RT-Send-Cc'));
+ push (@Bcc, $self->TransactionObj->Message->First->GetHeader('RT-Send-Bcc'));
}
}
if ( $arg =~ /\bRequestor\b/ ) {
- push ( @To, $self->TicketObj->Requestors->MemberEmailAddresses );
+ push ( @To, @{ $self->TicketObj->Requestors->Emails } );
}
@@ -64,12 +40,12 @@ sub SetRecipients {
#If we have a To, make the Ccs, Ccs, otherwise, promote them to To
if (@To) {
- push ( @Cc, $self->TicketObj->Cc->MemberEmailAddresses );
- push ( @Cc, $self->TicketObj->QueueObj->Cc->MemberEmailAddresses );
+ push ( @Cc, @{ $self->TicketObj->Cc->Emails } );
+ push ( @Cc, @{ $self->TicketObj->QueueObj->Cc->Emails } );
}
else {
- push ( @Cc, $self->TicketObj->Cc->MemberEmailAddresses );
- push ( @To, $self->TicketObj->QueueObj->Cc->MemberEmailAddresses );
+ push ( @Cc, @{ $self->TicketObj->Cc->Emails } );
+ push ( @To, @{ $self->TicketObj->QueueObj->Cc->Emails } );
}
}
@@ -89,16 +65,15 @@ sub SetRecipients {
}
if ( $arg =~ /\bAdminCc\b/ ) {
- push ( @Bcc, $self->TicketObj->AdminCc->MemberEmailAddresses );
- push ( @Bcc, $self->TicketObj->QueueObj->AdminCc->MemberEmailAddresses );
+ push ( @Bcc, @{ $self->TicketObj->AdminCc->Emails } );
+ push ( @Bcc, @{ $self->TicketObj->QueueObj->AdminCc->Emails } );
}
if ($RT::UseFriendlyToLine) {
unless (@To) {
- push (
- @PseudoTo,
- sprintf($RT::FriendlyToLineFormat, $arg, $self->TicketObj->id),
- );
+ push ( @PseudoTo,
+ "\"$arg of $RT::rtname Ticket #"
+ . $self->TicketObj->id . "\":;" );
}
}
@@ -106,17 +81,14 @@ sub SetRecipients {
#Strip the sender out of the To, Cc and AdminCc and set the
# recipients fields used to build the message by the superclass.
- # unless a flag is set
- if ($RT::NotifyActor) {
- @{ $self->{'To'} } = @To;
- @{ $self->{'Cc'} } = @Cc;
- @{ $self->{'Bcc'} } = @Bcc;
- }
- else {
- @{ $self->{'To'} } = grep ( !/^$creator$/, @To );
- @{ $self->{'Cc'} } = grep ( !/^$creator$/, @Cc );
- @{ $self->{'Bcc'} } = grep ( !/^$creator$/, @Bcc );
- }
+
+ $RT::Logger->debug("$self: To is ".join(",",@To));
+ $RT::Logger->debug("$self: Cc is ".join(",",@Cc));
+ $RT::Logger->debug("$self: Bcc is ".join(",",@Bcc));
+
+ @{ $self->{'To'} } = grep ( !/^$creator$/, @To );
+ @{ $self->{'Cc'} } = grep ( !/^$creator$/, @Cc );
+ @{ $self->{'Bcc'} } = grep ( !/^$creator$/, @Bcc );
@{ $self->{'PseudoTo'} } = @PseudoTo;
return (1);
@@ -124,9 +96,4 @@ sub SetRecipients {
# }}}
-eval "require RT::Action::Notify_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Vendor.pm});
-eval "require RT::Action::Notify_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/NotifyAsComment.pm b/rt/lib/RT/Action/NotifyAsComment.pm
index 210e4ab15..c72bfff13 100755
--- a/rt/lib/RT/Action/NotifyAsComment.pm
+++ b/rt/lib/RT/Action/NotifyAsComment.pm
@@ -1,31 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/NotifyAsComment.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
package RT::Action::NotifyAsComment;
require RT::Action::Notify;
-
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Action::Notify);
@@ -45,11 +21,5 @@ sub SetReturnAddress {
return($self->SUPER::SetReturnAddress(is_comment => 1));
}
-
-eval "require RT::Action::NotifyAsComment_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Vendor.pm});
-eval "require RT::Action::NotifyAsComment_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/OpenDependent.pm b/rt/lib/RT/Action/OpenDependent.pm
new file mode 100644
index 000000000..b271e4709
--- /dev/null
+++ b/rt/lib/RT/Action/OpenDependent.pm
@@ -0,0 +1,55 @@
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Attic/OpenDependent.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# This Action will open the BASE if a dependent is resolved.
+
+package RT::Action::OpenDependent;
+require RT::Action::Generic;
+require RT::Links;
+@ISA=qw(RT::Action::Generic);
+
+#Do what we need to do and send it out.
+
+#What does this type of Action does
+
+# {{{ sub Describe
+sub Describe {
+ my $self = shift;
+ return (ref $self . " will stall a [local] BASE if it's open and a dependency link is created.");
+}
+# }}}
+
+
+# {{{ sub Prepare
+sub Prepare {
+ # nothing to prepare
+ return 1;
+}
+# }}}
+
+sub Commit {
+ my $self = shift;
+
+ my $Links=RT::Links->new($RT::SystemUser);
+ $Links->Limit(FIELD => 'Type', VALUE => 'DependsOn');
+ $Links->Limit(FIELD => 'Target', VALUE => $self->TicketObj->id);
+
+ while (my $Link=$Links->Next()) {
+ next unless $Link->BaseIsLocal;
+ my $base=RT::Ticket->new($self->TicketObj->CurrentUser);
+ # Todo: Only work if Base is a plain ticket num:
+ $base->Load($Link->Base);
+ $base->Open if $base->Status eq 'stalled';
+ }
+}
+
+
+# Applicability checked in Commit.
+
+# {{{ sub IsApplicable
+sub IsApplicable {
+ my $self = shift;
+ 1;
+ return 1;
+}
+# }}}
+
+1;
diff --git a/rt/lib/RT/Action/ResolveMembers.pm b/rt/lib/RT/Action/ResolveMembers.pm
index 02ff3a58c..00547ebe8 100644
--- a/rt/lib/RT/Action/ResolveMembers.pm
+++ b/rt/lib/RT/Action/ResolveMembers.pm
@@ -1,34 +1,8 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
# This Action will resolve all members of a resolved group ticket
package RT::Action::ResolveMembers;
require RT::Action::Generic;
require RT::Links;
-
-use strict;
-use vars qw/@ISA/;
@ISA=qw(RT::Action::Generic);
#Do what we need to do and send it out.
@@ -38,7 +12,7 @@ use vars qw/@ISA/;
# {{{ sub Describe
sub Describe {
my $self = shift;
- return $self->loc("[_1] will resolve all members of a resolved group ticket.", ref $self);
+ return (ref $self . " will resolve all members of a resolved group ticket.");
}
# }}}
@@ -59,7 +33,7 @@ sub Commit {
while (my $Link=$Links->Next()) {
# Todo: Try to deal with remote URIs as well
- next unless $Link->BaseURI->IsLocal;
+ next unless $Link->BaseIsLocal;
my $base=RT::Ticket->new($self->TicketObj->CurrentUser);
# Todo: Only work if Base is a plain ticket num:
$base->Load($Link->Base);
@@ -79,10 +53,5 @@ sub IsApplicable {
}
# }}}
-eval "require RT::Action::ResolveMembers_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/ResolveMembers_Vendor.pm});
-eval "require RT::Action::ResolveMembers_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/ResolveMembers_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/SendEmail.pm b/rt/lib/RT/Action/SendEmail.pm
index dac8fc8e7..e3abb1154 100755
--- a/rt/lib/RT/Action/SendEmail.pm
+++ b/rt/lib/RT/Action/SendEmail.pm
@@ -1,44 +1,20 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/SendEmail.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 1996-2002 Jesse Vincent <jesse@bestpractical.com>
# Portions Copyright 2000 Tobias Brox <tobix@cpan.org>
+# Released under the terms of version 2 of the GNU Public License
package RT::Action::SendEmail;
require RT::Action::Generic;
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Action::Generic);
-use MIME::Words qw(encode_mimeword);
-
-use RT::EmailParser;
=head1 NAME
-RT::Action::SendEmail - An Action which users can use to send mail
-or can subclassed for more specialized mail sending behavior.
-RT::Action::AutoReply is a good example subclass.
+ RT::Action::SendEmail - An Action which users can use to send mail
+ or can subclassed for more specialized mail sending behavior.
+ RT::Action::AutoReply is a good example subclass.
+
=head1 SYNOPSIS
@@ -60,6 +36,7 @@ the comments for the SetRecipients sub).
=begin testing
+ok (require RT::TestHarness);
ok (require RT::Action::SendEmail);
=end testing
@@ -77,266 +54,158 @@ perl(1).
# {{{ Scrip methods (_Init, Commit, Prepare, IsApplicable)
-# {{{ sub _Init
+# {{{ sub _Init
# We use _Init from RT::Action
# }}}
-# {{{ sub Commit
+# {{{ sub Commit
#Do what we need to do and send it out.
-sub Commit {
+sub Commit {
my $self = shift;
-
- my $MIMEObj = $self->TemplateObj->MIMEObj;
- my $msgid = $MIMEObj->head->get('Message-Id');
- chomp $msgid;
- $RT::Logger->info($msgid." #".$self->TicketObj->id."/".$self->TransactionObj->id." - Scrip ". $self->ScripObj->id ." ".$self->ScripObj->Description);
#send the email
-
- # Weed out any RT addresses. We really don't want to talk to ourselves!
- @{$self->{'To'}} = RT::EmailParser::CullRTAddresses("", @{$self->{'To'}});
- @{$self->{'Cc'}} = RT::EmailParser::CullRTAddresses("", @{$self->{'Cc'}});
- @{$self->{'Bcc'}} = RT::EmailParser::CullRTAddresses("", @{$self->{'Bcc'}});
+
# If there are no recipients, don't try to send the message.
# If the transaction has content and has the header RT-Squelch-Replies-To
-
- if ( defined $self->TransactionObj->Attachments->First() ) {
-
- my $squelch = $self->TransactionObj->Attachments->First->GetHeader( 'RT-Squelch-Replies-To');
-
- if ($squelch) {
- my @blacklist = split ( /,/, $squelch );
-
- # Cycle through the people we're sending to and pull out anyone on the
- # system blacklist
-
- foreach my $person_to_yank (@blacklist) {
- $person_to_yank =~ s/\s//g;
- @{ $self->{'To'} } =
- grep ( !/^$person_to_yank$/, @{ $self->{'To'} } );
- @{ $self->{'Cc'} } =
- grep ( !/^$person_to_yank$/, @{ $self->{'Cc'} } );
- @{ $self->{'Bcc'} } =
- grep ( !/^$person_to_yank$/, @{ $self->{'Bcc'} } );
- }
- }
+
+ if (defined $self->TransactionObj->Message->First()) {
+ my $headers = $self->TransactionObj->Message->First->Headers();
+
+ if ($headers =~ /^RT-Squelch-Replies-To: (.*?)$/si) {
+ my @blacklist = split(/,/,$1);
+
+ # Cycle through the people we're sending to and pull out anyone on the
+ # system blacklist
+
+ foreach my $person_to_yank (@blacklist) {
+ $person_to_yank =~ s/\s//g;
+ @{$self->{'To'}} = grep (!/^$person_to_yank$/, @{$self->{'To'}});
+ @{$self->{'Cc'}} = grep (!/^$person_to_yank$/, @{$self->{'Cc'}});
+ @{$self->{'Bcc'}} = grep (!/^$person_to_yank$/, @{$self->{'Bcc'}});
+ }
+ }
}
-
- # Go add all the Tos, Ccs and Bccs that we need to to the message to
+
+ # Go add all the Tos, Ccs and Bccs that we need to to the message to
# make it happy, but only if we actually have values in those arrays.
+
+ $self->SetHeader('To', join(',', @{$self->{'To'}}))
+ if (@{$self->{'To'}});
+ $self->SetHeader('Cc', join(',' , @{$self->{'Cc'}}))
+ if (@{$self->{'Cc'}});
+ $self->SetHeader('Bcc', join(',', @{$self->{'Bcc'}}))
+ if (@{$self->{'Bcc'}});;
+
+ my $MIMEObj = $self->TemplateObj->MIMEObj;
+
- $self->SetHeader( 'To', join ( ',', @{ $self->{'To'} } ) )
- if ( $self->{'To'} && @{ $self->{'To'} } );
- $self->SetHeader( 'Cc', join ( ',', @{ $self->{'Cc'} } ) )
- if ( $self->{'Cc'} && @{ $self->{'Cc'} } );
- $self->SetHeader( 'Bcc', join ( ',', @{ $self->{'Bcc'} } ) )
- if ( $self->{'Cc'} && @{ $self->{'Bcc'} } );
-
-
- $self->SetHeader('MIME-Version', '1.0');
-
- # try to convert message body from utf-8 to $RT::EmailOutputEncoding
- $self->SetHeader( 'Content-Type', 'text/plain; charset="utf-8"' );
-
- RT::I18N::SetMIMEEntityToEncoding( $MIMEObj, $RT::EmailOutputEncoding, 'mime_words_ok' );
- $self->SetHeader( 'Content-Type', 'text/plain; charset="' . $RT::EmailOutputEncoding . '"' );
-
-
- # Build up a MIME::Entity that looks like the original message.
-
- my $do_attach = $self->TemplateObj->MIMEObj->head->get('RT-Attach-Message');
-
- if ($do_attach) {
- $self->TemplateObj->MIMEObj->head->delete('RT-Attach-Message');
-
- my $attachments = RT::Attachments->new($RT::SystemUser);
- $attachments->Limit( FIELD => 'TransactionId',
- VALUE => $self->TransactionObj->Id );
- $attachments->OrderBy('id');
-
- my $transaction_content_obj = $self->TransactionObj->ContentObj;
-
- # attach any of this transaction's attachments
- while ( my $attach = $attachments->Next ) {
-
- # Don't attach anything blank
- next unless ( $attach->ContentLength );
-
- # We want to make sure that we don't include the attachment that's being sued as the "Content" of this message"
- next
- if ( $transaction_content_obj
- && $transaction_content_obj->Id == $attach->Id
- && $transaction_content_obj->ContentType =~ qr{text/plain}i
- );
- $MIMEObj->make_multipart('mixed');
- $MIMEObj->attach( Type => $attach->ContentType,
- Charset => $attach->OriginalEncoding,
- Data => $attach->OriginalContent,
- Filename => $self->MIMEEncodeString( $attach->Filename, $RT::EmailOutputEncoding ),
- Encoding => '-SUGGEST');
- }
-
- }
-
-
- my $retval = $self->SendMessage($MIMEObj);
-
-
- return ($retval);
-}
-
-# }}}
-
-# {{{ sub Prepare
-
-sub Prepare {
- my $self = shift;
-
- # This actually populates the MIME::Entity fields in the Template Object
-
- unless ( $self->TemplateObj ) {
- $RT::Logger->warning("No template object handed to $self\n");
- }
-
- unless ( $self->TransactionObj ) {
- $RT::Logger->warning("No transaction object handed to $self\n");
-
- }
-
- unless ( $self->TicketObj ) {
- $RT::Logger->warning("No ticket object handed to $self\n");
-
- }
-
- my ( $result, $message ) = $self->TemplateObj->Parse(
- Argument => $self->Argument,
- TicketObj => $self->TicketObj,
- TransactionObj => $self->TransactionObj
- );
- if ($result) {
-
- # Header
- $self->SetSubject();
- $self->SetSubjectToken();
- $self->SetRecipients();
- $self->SetReturnAddress();
- $self->SetRTSpecialHeaders();
- if ($RT::EmailOutputEncoding) {
-
- # l10n related header
- $self->SetHeaderAsEncoding( 'Subject', $RT::EmailOutputEncoding );
- }
- }
-
- return $result;
-
-}
-
-# }}}
-
-# }}}
-
-# {{{ SendMessage
-=head2 SendMessage MIMEObj
-
-sends the message using RT's preferred API.
-TODO: Break this out to a seperate module
-
-=cut
-
-sub SendMessage {
- my $self = shift;
- my $MIMEObj = shift;
-
- my $msgid = $MIMEObj->head->get('Message-Id');
-
-
+ $MIMEObj->make_singlepart;
+
+
#If we don't have any recipients to send to, don't send a message;
- unless ( $MIMEObj->head->get('To')
- || $MIMEObj->head->get('Cc')
- || $MIMEObj->head->get('Bcc') ) {
- $RT::Logger->info($msgid. " No recipients found. Not sending.\n");
- return (1);
+ unless ($MIMEObj->head->get('To') ||
+ $MIMEObj->head->get('Cc') ||
+ $MIMEObj->head->get('Bcc') ) {
+ $RT::Logger->debug("$self: No recipients found. Not sending.\n");
+ return(1);
}
# PseudoTo (fake to headers) shouldn't get matched for message recipients.
# If we don't have any 'To' header, drop in the pseudo-to header.
- $self->SetHeader( 'To', join ( ',', @{ $self->{'PseudoTo'} } ) )
- if ( $self->{'PseudoTo'} && ( @{ $self->{'PseudoTo'} } )
- and ( !$MIMEObj->head->get('To') ) );
- if ( $RT::MailCommand eq 'sendmailpipe' ) {
- eval {
- open( MAIL, "|$RT::SendmailPath $RT::SendmailArguments" );
- print MAIL $MIMEObj->as_string;
- close(MAIL);
- };
- if ($@) {
- $RT::Logger->crit($msgid. "Could not send mail. -".$@ );
- }
+ $self->SetHeader('To', join(',', @{$self->{'PseudoTo'}}))
+ if ( (@{$self->{'PseudoTo'}}) and (! $MIMEObj->head->get('To')));
+
+ if ($RT::MailCommand eq 'sendmailpipe') {
+ open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
+ print MAIL $MIMEObj->as_string;
+ close(MAIL);
}
else {
- my @mailer_args = ($RT::MailCommand);
- local $ENV{MAILADDRESS};
-
- if ( $RT::MailCommand eq 'sendmail' ) {
- push @mailer_args, $RT::SendmailArguments;
- }
- elsif ( $RT::MailCommand eq 'smtp' ) {
- $ENV{MAILADDRESS} = $RT::SMTPFrom || $MIMEObj->head->get('From');
- push @mailer_args, (Server => $RT::SMTPServer);
- push @mailer_args, (Debug => $RT::SMTPDebug);
- }
- else {
- push @mailer_args, $RT::MailParams;
+ unless ($MIMEObj->send($RT::MailCommand, $RT::MailParams)) {
+ $RT::Logger->crit("$self: Could not send mail for ".
+ $self->TransactionObj . "\n");
+ return(0);
}
-
- unless ( $MIMEObj->send( @mailer_args ) ) {
- $RT::Logger->crit($msgid. "Could not send mail." );
- return (0);
- }
}
+
+ return (1);
+
+}
+# }}}
+# {{{ sub Prepare
- my $success = ($msgid. " sent To: ".$MIMEObj->head->get('To') . " Cc: ".$MIMEObj->head->get('Cc') . " Bcc: ".$MIMEObj->head->get('Bcc'));
- $success =~ s/\n//gi;
- $RT::Logger->info($success);
+sub Prepare {
+ my $self = shift;
+
+ # This actually populates the MIME::Entity fields in the Template Object
+
+ unless ($self->TemplateObj) {
+ $RT::Logger->warning("No template object handed to $self\n");
+ }
+
+ unless ($self->TransactionObj) {
+ $RT::Logger->warning("No transaction object handed to $self\n");
+
+ }
+
+ unless ($self->TicketObj) {
+ $RT::Logger->warning("No ticket object handed to $self\n");
+
+ }
+
+
+ $self->TemplateObj->Parse(Argument => $self->Argument,
+ TicketObj => $self->TicketObj,
+ TransactionObj => $self->TransactionObj);
+
+ # Header
+
+ $self->SetSubject();
+
+ $self->SetSubjectToken();
+
+ $self->SetRecipients();
+
+ $self->SetReturnAddress();
- return (1);
+ $self->SetRTSpecialHeaders();
+
+ return 1;
+
}
# }}}
+# }}}
+
# {{{ Deal with message headers (Set* subs, designed for easy overriding)
# {{{ sub SetRTSpecialHeaders
-=head2 SetRTSpecialHeaders
-
-This routine adds all the random headers that RT wants in a mail message
-that don't matter much to anybody else.
-
-=cut
+# This routine adds all the random headers that RT wants in a mail message
+# that don't matter much to anybody else.
sub SetRTSpecialHeaders {
my $self = shift;
-
+
$self->SetReferences();
$self->SetMessageID();
-
+
$self->SetPrecedence();
- $self->SetHeader( 'X-RT-Loop-Prevention', $RT::rtname );
- $self->SetHeader( 'RT-Ticket',
- $RT::rtname . " #" . $self->TicketObj->id() );
- $self->SetHeader( 'Managed-by',
- "RT $RT::VERSION (http://www.bestpractical.com/rt/)" );
+ $self->SetHeader('X-RT-Loop-Prevention', $RT::rtname);
+ $self->SetHeader('RT-Ticket', $RT::rtname. " #".$self->TicketObj->id());
+ $self->SetHeader
+ ('Managed-by',"RT $RT::VERSION (http://bestpractical.com/rt/)");
+
+ $self->SetHeader('RT-Originator', $self->TransactionObj->CreatorObj->EmailAddress);
+ return();
+
+}
- $self->SetHeader( 'RT-Originator',
- $self->TransactionObj->CreatorObj->EmailAddress );
- return ();
-}
# {{{ sub SetReferences
@@ -349,126 +218,105 @@ sub SetRTSpecialHeaders {
=cut
sub SetReferences {
- my $self = shift;
+ my $self = shift;
+
+ # TODO: this one is broken. What is this email really a reply to?
+ # If it's a reply to an incoming message, we'll need to use the
+ # actual message-id from the appropriate Attachment object. For
+ # incoming mails, we would like to preserve the In-Reply-To and/or
+ # References.
- # TODO: this one is broken. What is this email really a reply to?
- # If it's a reply to an incoming message, we'll need to use the
- # actual message-id from the appropriate Attachment object. For
- # incoming mails, we would like to preserve the In-Reply-To and/or
- # References.
+ $self->SetHeader
+ ('In-Reply-To', "<rt-".$self->TicketObj->id().
+ "\@".$RT::rtname.">");
- $self->SetHeader( 'In-Reply-To',
- "<rt-" . $self->TicketObj->id() . "\@" . $RT::rtname . ">" );
- # TODO We should always add References headers for all message-ids
- # of previous messages related to this ticket.
+ # TODO We should always add References headers for all message-ids
+ # of previous messages related to this ticket.
}
# }}}
# {{{ sub SetMessageID
-=head2 SetMessageID
-
-Without this one, threading won't work very nice in email agents.
-Anyway, I'm not really sure it's that healthy if we need to send
-several separate/different emails about the same transaction.
-
-=cut
+# Without this one, threading won't work very nice in email agents.
+# Anyway, I'm not really sure it's that healthy if we need to send
+# several separate/different emails about the same transaction.
sub SetMessageID {
- my $self = shift;
+ my $self = shift;
- # TODO this one might be sort of broken. If we have several scrips +++
- # sending several emails to several different persons, we need to
- # pull out different message-ids. I'd suggest message ids like
- # "rt-ticket#-transaction#-scrip#-receipient#"
-
- $self->SetHeader( 'Message-ID',
- "<rt-"
- . $RT::VERSION ."-"
- . $self->TicketObj->id() . "-"
- . $self->TransactionObj->id() . "."
- . rand(20) . "\@"
- . $RT::Organization . ">" )
+ # TODO this one might be sort of broken. If we have several scrips +++
+ # sending several emails to several different persons, we need to
+ # pull out different message-ids. I'd suggest message ids like
+ # "rt-ticket#-transaction#-scrip#-receipient#"
+
+ $self->SetHeader
+ ('Message-ID', "<rt-".$self->TicketObj->id().
+ "-".
+ $self->TransactionObj->id()."." .rand(20) . "\@".$RT::Organization.">")
unless $self->TemplateObj->MIMEObj->head->get('Message-ID');
}
-# }}}
# }}}
-# {{{ sub SetReturnAddress
-
-=head2 SetReturnAddress is_comment => BOOLEAN
-
-Calculate and set From and Reply-To headers based on the is_comment flag.
+# }}}
-=cut
+# {{{ sub SetReturnAddress
sub SetReturnAddress {
- my $self = shift;
- my %args = ( is_comment => 0,
- @_ );
-
- # From and Reply-To
- # $args{is_comment} should be set if the comment address is to be used.
- my $replyto;
-
- if ( $args{'is_comment'} ) {
- $replyto = $self->TicketObj->QueueObj->CommentAddress
- || $RT::CommentAddress;
- }
- else {
- $replyto = $self->TicketObj->QueueObj->CorrespondAddress
- || $RT::CorrespondAddress;
- }
-
- unless ( $self->TemplateObj->MIMEObj->head->get('From') ) {
- if ($RT::UseFriendlyFromLine) {
- my $friendly_name = $self->TransactionObj->CreatorObj->RealName;
- if ( $friendly_name =~ /^"(.*)"$/ ) { # a quoted string
- $friendly_name = $1;
- }
-
- $friendly_name =~ s/"/\\"/g;
- $self->SetHeader( 'From',
- sprintf($RT::FriendlyFromLineFormat,
- $self->MIMEEncodeString( $friendly_name, $RT::EmailOutputEncoding ), $replyto),
- );
- }
- else {
- $self->SetHeader( 'From', $replyto );
- }
- }
-
- unless ( $self->TemplateObj->MIMEObj->head->get('Reply-To') ) {
- $self->SetHeader( 'Reply-To', "$replyto" );
- }
-
+ my $self = shift;
+ my %args = ( is_comment => 0,
+ @_ );
+
+ # From and Reply-To
+ # $args{is_comment} should be set if the comment address is to be used.
+ my $replyto;
+
+ if ($args{'is_comment'}) {
+ $replyto = $self->TicketObj->QueueObj->CommentAddress ||
+ $RT::CommentAddress;
+ }
+ else {
+ $replyto = $self->TicketObj->QueueObj->CorrespondAddress ||
+ $RT::CorrespondAddress;
+ }
+
+ unless ($self->TemplateObj->MIMEObj->head->get('From')) {
+ my $friendly_name=$self->TransactionObj->CreatorObj->RealName;
+
+ if ($friendly_name =~ /^\S+\@\S+$/) { # A "bare" mail address
+ $friendly_name =~ s/"/\\"/g;
+ $friendly_name = qq|"$friendly_name"|;
+ }
+
+
+ # TODO: this "via RT" should really be site-configurable.
+ $self->SetHeader('From', "\"$friendly_name via RT\" <$replyto>");
+ }
+
+ unless ($self->TemplateObj->MIMEObj->head->get('Reply-To')) {
+ $self->SetHeader('Reply-To', "$replyto");
+ }
+
}
# }}}
# {{{ sub SetHeader
-=head2 SetHeader FIELD, VALUE
-
-Set the FIELD of the current MIME object into VALUE.
-
-=cut
-
sub SetHeader {
- my $self = shift;
- my $field = shift;
- my $val = shift;
-
- chomp $val;
- chomp $field;
- $self->TemplateObj->MIMEObj->head->fold_length( $field, 10000 );
- $self->TemplateObj->MIMEObj->head->replace( $field, $val );
- return $self->TemplateObj->MIMEObj->head->get($field);
+ my $self = shift;
+ my $field = shift;
+ my $val = shift;
+
+ chomp $val;
+ chomp $field;
+ $self->TemplateObj->MIMEObj->head->fold_length($field,10000);
+ $self->TemplateObj->MIMEObj->head->add($field, $val);
+ return $self->TemplateObj->MIMEObj->head->get($field);
}
# }}}
@@ -483,29 +331,21 @@ Dummy method to be overriden by subclasses which want to set the recipients.
sub SetRecipients {
my $self = shift;
- return ();
+ return();
}
# }}}
# {{{ sub SetTo
-=head2 SetTo
-
-Takes a string that is the addresses you want to send mail to
-
-=cut
-
sub SetTo {
- my $self = shift;
+ my $self=shift;
my $addresses = shift;
- return $self->SetHeader( 'To', $addresses );
+ return $self->SetHeader('To',$addresses);
}
-
# }}}
# {{{ sub SetCc
-
=head2 SetCc
Takes a string that is the addresses you want to Cc
@@ -513,12 +353,11 @@ Takes a string that is the addresses you want to Cc
=cut
sub SetCc {
- my $self = shift;
+ my $self=shift;
my $addresses = shift;
- return $self->SetHeader( 'Cc', $addresses );
+ return $self->SetHeader('Cc', $addresses);
}
-
# }}}
# {{{ sub SetBcc
@@ -528,24 +367,23 @@ sub SetCc {
Takes a string that is the addresses you want to Bcc
=cut
-
sub SetBcc {
- my $self = shift;
+ my $self=shift;
my $addresses = shift;
- return $self->SetHeader( 'Bcc', $addresses );
+ return $self->SetHeader('Bcc', $addresses);
}
# }}}
-# {{{ sub SetPrecedence
+# {{{ sub SetPrecedence
sub SetPrecedence {
- my $self = shift;
+ my $self = shift;
- unless ( $self->TemplateObj->MIMEObj->head->get("Precedence") ) {
- $self->SetHeader( 'Precedence', "bulk" );
- }
+ unless ($self->TemplateObj->MIMEObj->head->get("Precedence")) {
+ $self->SetHeader('Precedence', "bulk");
+ }
}
# }}}
@@ -561,125 +399,70 @@ the transaction's subject.
=cut
sub SetSubject {
- my $self = shift;
+ my $self = shift;
+ unless ($self->TemplateObj->MIMEObj->head->get('Subject')) {
+ my $message=$self->TransactionObj->Message;
+ my $ticket=$self->TicketObj->Id;
+
my $subject;
+
+ if ($self->{'Subject'}) {
+ $subject = $self->{'Subject'};
+ }
+ elsif (($message->First()) &&
+ ($message->First->Headers)) {
+ $header = $message->First->Headers();
+ $header =~ s/\n\s+/ /g;
+ if ( $header =~ /^Subject: (.*?)$/m ) {
+ $subject = $1;
+ }
+ else {
+ $subject = $self->TicketObj->Subject();
+ }
+
+ }
+ else {
+ $subject = $self->TicketObj->Subject();
+ }
+
+ $subject =~ s/(\r\n|\n|\s)/ /gi;
- unless ( $self->TemplateObj->MIMEObj->head->get('Subject') ) {
- my $message = $self->TransactionObj->Attachments;
- my $ticket = $self->TicketObj->Id;
-
- if ( $self->{'Subject'} ) {
- $subject = $self->{'Subject'};
- }
- elsif ( ( $message->First() )
- && ( $message->First->Headers ) ) {
- my $header = $message->First->Headers();
- $header =~ s/\n\s+/ /g;
- if ( $header =~ /^Subject: (.*?)$/m ) {
- $subject = $1;
- }
- else {
- $subject = $self->TicketObj->Subject();
- }
-
- }
- else {
- $subject = $self->TicketObj->Subject();
- }
-
- $subject =~ s/(\r\n|\n|\s)/ /gi;
-
- chomp $subject;
- $self->SetHeader( 'Subject', $subject );
-
+ chomp $subject;
+ $self->SetHeader('Subject',$subject);
+
}
- return ($subject);
+ return($subject);
}
-
# }}}
# {{{ sub SetSubjectToken
=head2 SetSubjectToken
-This routine fixes the RT tag in the subject. It's unlikely that you want to overwrite this.
+ This routine fixes the RT tag in the subject. It's unlikely that you want to overwrite this.
=cut
sub SetSubjectToken {
- my $self = shift;
- my $tag = "[$RT::rtname #" . $self->TicketObj->id . "]";
- my $sub = $self->TemplateObj->MIMEObj->head->get('Subject');
- unless ( $sub =~ /\Q$tag\E/ ) {
- $sub =~ s/(\r\n|\n|\s)/ /gi;
- chomp $sub;
- $self->TemplateObj->MIMEObj->head->replace( 'Subject', "$tag $sub" );
- }
+ my $self=shift;
+ my $tag = "[$RT::rtname #".$self->TicketObj->id."]";
+ my $sub = $self->TemplateObj->MIMEObj->head->get('Subject');
+ unless ($sub =~ /\Q$tag\E/) {
+ $sub =~ s/(\r\n|\n|\s)/ /gi;
+ chomp $sub;
+ $self->TemplateObj->MIMEObj->head->replace('Subject', "$tag $sub");
+ }
}
# }}}
# }}}
-# {{{
-
-=head2 SetHeaderAsEncoding($field_name, $charset_encoding)
-
-This routine converts the field into specified charset encoding.
-
-=cut
-
-sub SetHeaderAsEncoding {
- my $self = shift;
- my ( $field, $enc ) = ( shift, shift );
-
- if ($field eq 'From' and $RT::SMTPFrom) {
- $self->TemplateObj->MIMEObj->head->replace( $field, $RT::SMTPFrom );
- return;
- }
-
- my $value = $self->TemplateObj->MIMEObj->head->get($field);
-
- # don't bother if it's us-ascii
-
- # See RT::I18N, 'NOTES: Why Encode::_utf8_off before Encode::from_to'
-
- $value = $self->MIMEEncodeString($value, $enc);
-
- $self->TemplateObj->MIMEObj->head->replace( $field, $value );
-
-
-}
-# }}}
-
-# {{{ MIMENcodeString
-
-=head2 MIMEEncodeString STRING ENCODING
-
-Takes a string and a possible encoding and returns the string wrapped in MIME goo.
-
-=cut
-
-sub MIMEEncodeString {
- my $self = shift;
- my $value = shift;
- my $enc = shift;
+__END__
- chomp $value;
- return ($value) unless $value =~ /[^\x20-\x7e]/;
-
- $value =~ s/\s*$//;
- Encode::_utf8_off($value);
- my $res = Encode::from_to( $value, "utf-8", $enc );
- $value = encode_mimeword( $value, 'B', $enc );
-}
+# {{{ POD
# }}}
-eval "require RT::Action::SendEmail_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Vendor.pm});
-eval "require RT::Action::SendEmail_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Local.pm});
-
1;
diff --git a/rt/lib/RT/Action/SendPasswordEmail.pm b/rt/lib/RT/Action/SendPasswordEmail.pm
new file mode 100755
index 000000000..91bb3c1cb
--- /dev/null
+++ b/rt/lib/RT/Action/SendPasswordEmail.pm
@@ -0,0 +1,170 @@
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/Attic/SendPasswordEmail.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 2001 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
+
+package RT::Action::SendPasswordEmail;
+require RT::Action::Generic;
+
+@ISA = qw(RT::Action::Generic);
+
+
+=head1 NAME
+
+ RT::Action::SendGenericEmail - An Action which users can use to send mail
+ or can subclassed for more specialized mail sending behavior.
+
+
+
+=head1 SYNOPSIS
+
+ require RT::Action::SendPasswordEmail;
+
+
+=head1 DESCRIPTION
+
+Basically, you create another module RT::Action::YourAction which ISA
+RT::Action::SendEmail.
+
+If you want to set the recipients of the mail to something other than
+the addresses mentioned in the To, Cc, Bcc and headers in
+the template, you should subclass RT::Action::SendEmail and override
+either the SetRecipients method or the SetTo, SetCc, etc methods (see
+the comments for the SetRecipients sub).
+
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Action::SendPasswordEmail);
+
+=end testing
+
+
+=head1 AUTHOR
+
+Jesse Vincent <jesse@bestpractical.com>
+
+=head1 SEE ALSO
+
+perl(1).
+
+=cut
+
+# {{{ Scrip methods (_Init, Commit, Prepare, IsApplicable)
+
+# {{{ sub Commit
+
+#Do what we need to do and send it out.
+
+sub Commit {
+ my $self = shift;
+ #send the email
+
+
+
+
+
+ my $MIMEObj = $self->TemplateObj->MIMEObj;
+
+
+ $MIMEObj->make_singlepart;
+
+ #If we don\'t have any recipients to send to, don\'t send a message;
+ unless ($MIMEObj->head->get('To')) {
+ $RT::Logger->debug("$self: No recipients found. Not sending.\n");
+ return(1);
+ }
+
+ if ($RT::MailCommand eq 'sendmailpipe') {
+ open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
+ print MAIL $MIMEObj->as_string;
+ close(MAIL);
+ }
+ else {
+ unless ($MIMEObj->send($RT::MailCommand, $RT::MailParams)) {
+ $RT::Logger->crit("$self: Could not send mail for ".
+ $self->TransactionObj . "\n");
+ return(0);
+ }
+ }
+
+ return (1);
+
+}
+# }}}
+
+# {{{ sub Prepare
+
+sub Prepare {
+ my $self = shift;
+
+ # This actually populates the MIME::Entity fields in the Template Object
+
+ unless ($self->TemplateObj) {
+ $RT::Logger->warning("No template object handed to $self\n");
+ }
+
+
+ unless ($self->TemplateObj->MIMEObj->head->get('Reply-To')) {
+ $self->SetHeader('Reply-To',$RT::CorrespondAddress );
+ }
+
+
+ $self->SetHeader('Precedence', "bulk");
+ $self->SetHeader('X-RT-Loop-Prevention', $RT::rtname);
+ $self->SetHeader
+ ('Managed-by',"Request Tracker $RT::VERSION (http://www.fsck.com/projects/rt/)");
+
+ $self->TemplateObj->Parse(Argument => $self->Argument);
+
+
+ return 1;
+}
+
+# }}}
+
+# }}}
+
+
+# {{{ sub SetTo
+
+=head2 SetTo EMAIL
+
+Sets this message's "To" field to EMAIL
+
+=cut
+
+sub SetTo {
+ my $self = shift;
+ my $to = shift;
+ $self->SetHeader('To',$to);
+}
+
+# }}}
+
+# {{{ sub SetHeader
+
+sub SetHeader {
+ my $self = shift;
+ my $field = shift;
+ my $val = shift;
+
+ chomp $val;
+ chomp $field;
+ $self->TemplateObj->MIMEObj->head->fold_length($field,10000);
+ $self->TemplateObj->MIMEObj->head->add($field, $val);
+ return $self->TemplateObj->MIMEObj->head->get($field);
+}
+
+# }}}
+
+
+
+__END__
+
+# {{{ POD
+
+# }}}
+
+1;
+
diff --git a/rt/lib/RT/Action/StallDependent.pm b/rt/lib/RT/Action/StallDependent.pm
new file mode 100644
index 000000000..09d3448a8
--- /dev/null
+++ b/rt/lib/RT/Action/StallDependent.pm
@@ -0,0 +1,68 @@
+# This Action will stall the BASE if a dependency or membership link
+# (according to argument) is created and if BASE is open.
+
+# TODO: Rename this .pm
+
+package RT::Action::StallDependent;
+require RT::Action::Generic;
+@ISA=qw|RT::Action::Generic|;
+
+# {{{ sub Describe
+sub Describe {
+ my $self = shift;
+ return (ref $self . " will stall a [local] BASE if it's dependent [or member] of a linked up request.");
+}
+# }}}
+
+
+# {{{ sub Prepare
+sub Prepare {
+ # nothing to prepare
+ return 1;
+}
+# }}}
+
+sub Commit {
+ my $self = shift;
+ # Find all Dependent
+ my $arg=$self->Argument || "DependsOn";
+ unless ($self->TransactionObj->Data =~ /^([^ ]+) $arg /) {
+ warn; return 0;
+ }
+ my $base_id=$1;
+ my $base;
+ if ($1 eq "THIS") {
+ $base=$self->TicketObj;
+ } else {
+ $base_id=&RT::Link::_IsLocal(undef, $base_id) || return 0;
+ $base=RT::Ticket->new($self->TicketObj->CurrentUser);
+ $base->Load($base_id);
+ }
+ $base->Stall if $base->Status eq 'open';
+ return 0;
+}
+
+
+# {{{ sub IsApplicable
+
+# Only applicable if:
+# 1. the link action is a dependency
+# 2. BASE is a local ticket
+
+sub IsApplicable {
+ my $self = shift;
+
+ my $arg=$self->Argument || "DependsOn";
+
+ # 1:
+ $self->TransactionObj->Data =~ /^([^ ]*) $arg / || return 0;
+
+ # 2:
+ # (dirty!)
+ &RT::Link::_IsLocal(undef,$1) || return 0;
+
+ return 1;
+}
+# }}}
+
+1;
diff --git a/rt/lib/RT/Attachment.pm b/rt/lib/RT/Attachment.pm
index 2ed520162..916ac355e 100755
--- a/rt/lib/RT/Attachment.pm
+++ b/rt/lib/RT/Attachment.pm
@@ -1,372 +1,423 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attachment.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 2000 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
=head1 NAME
-RT::Attachment
-
+ RT::Attachment -- an RT attachment object
=head1 SYNOPSIS
-=head1 DESCRIPTION
+ use RT::Attachment;
-=head1 METHODS
-=cut
-
-package RT::Attachment;
-use RT::Record;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
-
-sub _Init {
- my $self = shift;
-
- $self->Table('Attachments');
- $self->SUPER::_Init(@_);
-}
+=head1 DESCRIPTION
+This module should never be instantiated directly by client code. it's an internal
+module which should only be instantiated through exported APIs in Ticket, Queue and other
+similar objects.
+=head1 METHODS
-=item Create PARAMHASH
+=begin testing
-Create takes a hash of values and creates a row in the database:
+ok (require RT::TestHarness);
+ok (require RT::Attachment);
- int(11) 'TransactionId'.
- int(11) 'Parent'.
- varchar(160) 'MessageId'.
- varchar(255) 'Subject'.
- varchar(255) 'Filename'.
- varchar(80) 'ContentType'.
- varchar(80) 'ContentEncoding'.
- longtext 'Content'.
- longtext 'Headers'.
+=end testing
=cut
-
-
-
-sub Create {
- my $self = shift;
- my %args = (
- TransactionId => '0',
- Parent => '0',
- MessageId => '',
- Subject => '',
- Filename => '',
- ContentType => '',
- ContentEncoding => '',
- Content => '',
- Headers => '',
-
- @_);
- $self->SUPER::Create(
- TransactionId => $args{'TransactionId'},
- Parent => $args{'Parent'},
- MessageId => $args{'MessageId'},
- Subject => $args{'Subject'},
- Filename => $args{'Filename'},
- ContentType => $args{'ContentType'},
- ContentEncoding => $args{'ContentEncoding'},
- Content => $args{'Content'},
- Headers => $args{'Headers'},
-);
-
+package RT::Attachment;
+use RT::Record;
+use MIME::Base64;
+use vars qw|@ISA|;
+@ISA= qw(RT::Record);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Attachments";
+ return($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub _ClassAccessible
+sub _ClassAccessible {
+ {
+ TransactionId => { 'read'=>1, 'public'=>1, },
+ MessageId => { 'read'=>1, },
+ Parent => { 'read'=>1, },
+ ContentType => { 'read'=>1, },
+ Subject => { 'read'=>1, },
+ Content => { 'read'=>1, },
+ ContentEncoding => { 'read'=>1, },
+ Headers => { 'read'=>1, },
+ Filename => { 'read'=>1, },
+ Creator => { 'read'=>1, 'auto'=>1, },
+ Created => { 'read'=>1, 'auto'=>1, },
+ };
+}
+# }}}
+# {{{ sub TransactionObj
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
-
-
-=item TransactionId
-
-Returns the current value of TransactionId.
-(In the database, TransactionId is stored as int(11).)
-
-
-
-=item SetTransactionId VALUE
-
-
-Set TransactionId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TransactionId will be stored as a int(11).)
+=head2 TransactionObj
+Returns the transaction object asscoiated with this attachment.
=cut
+sub TransactionObj {
+ require RT::Transaction;
+ my $self=shift;
+ unless (exists $self->{_TransactionObj}) {
+ $self->{_TransactionObj}=RT::Transaction->new($self->CurrentUser);
+ $self->{_TransactionObj}->Load($self->TransactionId);
+ }
+ return $self->{_TransactionObj};
+}
-=item Parent
-
-Returns the current value of Parent.
-(In the database, Parent is stored as int(11).)
-
-
-
-=item SetParent VALUE
+# }}}
+# {{{ sub Create
-Set Parent to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Parent will be stored as a int(11).)
+=head2 Create
+Create a new attachment. Takes a paramhash:
+
+ 'Attachment' Should be a single MIME body with optional subparts
+ 'Parent' is an optional Parent RT::Attachment object
+ 'TransactionId' is the mandatory id of the Transaction this attachment is associated with.;
=cut
+sub Create {
+ my $self = shift;
+ my ($id);
+ my %args = ( id => 0,
+ TransactionId => 0,
+ Parent => 0,
+ Attachment => undef,
+ @_
+ );
+
+
+ #For ease of reference
+ my $Attachment = $args{'Attachment'};
+
+ #if we didn't specify a ticket, we need to bail
+ if ( $args{'TransactionId'} == 0) {
+ $RT::Logger->crit("RT::Attachment->Create couldn't, as you didn't specify a transaction\n");
+ return (0);
+
+ }
+
+ #If we possibly can, collapse it to a singlepart
+ $Attachment->make_singlepart;
+
+ #Get the subject
+ my $Subject = $Attachment->head->get('subject',0);
+ defined($Subject) or $Subject = '';
+ chomp($Subject);
+
+ #Get the filename
+ my $Filename = $Attachment->head->recommended_filename;
+
+ if ($Attachment->parts) {
+ $id = $self->SUPER::Create(TransactionId => $args{'TransactionId'},
+ Parent => 0,
+ ContentType => $Attachment->mime_type,
+ Headers => $Attachment->head->as_string,
+ Subject => $Subject,
+
+ );
+ foreach my $part ($Attachment->parts) {
+ my $SubAttachment = new RT::Attachment($self->CurrentUser);
+ $SubAttachment->Create(TransactionId => $args{'TransactionId'},
+ Parent => $id,
+ Attachment => $part,
+ ContentType => $Attachment->mime_type,
+ Headers => $Attachment->head->as_string(),
+
+ );
+ }
+ return ($id);
+ }
+
+
+ #If it's not multipart
+ else {
+
+ my $ContentEncoding = 'none';
+
+ my $Body = $Attachment->bodyhandle->as_string;
+
+ #get the max attachment length from RT
+ my $MaxSize = $RT::MaxAttachmentSize;
+
+ #if the current attachment contains nulls and the
+ #database doesn't support embedded nulls
+
+ if ( (! $RT::Handle->BinarySafeBLOBs) &&
+ ( $Body =~ /\x00/ ) ) {
+ # set a flag telling us to mimencode the attachment
+ $ContentEncoding = 'base64';
+
+ #cut the max attchment size by 25% (for mime-encoding overhead.
+ $RT::Logger->debug("Max size is $MaxSize\n");
+ $MaxSize = $MaxSize * 3/4;
+ }
+
+ #if the attachment is larger than the maximum size
+ if (($MaxSize) and ($MaxSize < length($Body))) {
+ # if we're supposed to truncate large attachments
+ if ($RT::TruncateLongAttachments) {
+ # truncate the attachment to that length.
+ $Body = substr ($Body, 0, $MaxSize);
+
+ }
+
+ # elsif we're supposed to drop large attachments on the floor,
+ elsif ($RT::DropLongAttachments) {
+ # drop the attachment on the floor
+ $RT::Logger->info("$self: Dropped an attachment of size ". length($Body).
+ "\n". "It started: ". substr($Body, 0, 60) . "\n");
+ return(undef);
+ }
+ }
+ # if we need to mimencode the attachment
+ if ($ContentEncoding eq 'base64') {
+ # base64 encode the attachment
+ $Body = MIME::Base64::encode_base64($Body);
+
+ }
+
+ my $id = $self->SUPER::Create(TransactionId => $args{'TransactionId'},
+ ContentType => $Attachment->mime_type,
+ ContentEncoding => $ContentEncoding,
+ Parent => $args{'Parent'},
+ Content => $Body,
+ Headers => $Attachment->head->as_string,
+ Subject => $Subject,
+ Filename => $Filename,
+ );
+ return ($id);
+ }
+}
-=item MessageId
-
-Returns the current value of MessageId.
-(In the database, MessageId is stored as varchar(160).)
-
-
+# }}}
-=item SetMessageId VALUE
+# {{{ sub Content
-Set MessageId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, MessageId will be stored as a varchar(160).)
+=head2 Content
+Returns the attachment's content. if it's base64 encoded, decode it
+before returning it.
=cut
-
-=item Subject
-
-Returns the current value of Subject.
-(In the database, Subject is stored as varchar(255).)
-
+sub Content {
+ my $self = shift;
+ if ( $self->ContentEncoding eq 'none' || ! $self->ContentEncoding ) {
+ return $self->_Value('Content');
+ } elsif ( $self->ContentEncoding eq 'base64' ) {
+ return MIME::Base64::decode_base64($self->_Value('Content'));
+ } else {
+ return( "Unknown ContentEncoding ". $self->ContentEncoding);
+ }
+}
-=item SetSubject VALUE
+# }}}
+# {{{ sub Children
-Set Subject to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Subject will be stored as a varchar(255).)
+=head2 Children
+ Returns an RT::Attachments object which is preloaded with all Attachments objects with this Attachment\'s Id as their 'Parent'
=cut
+sub Children {
+ my $self = shift;
+
+ my $kids = new RT::Attachments($self->CurrentUser);
+ $kids->ChildrenOf($self->Id);
+ return($kids);
+}
-=item Filename
-
-Returns the current value of Filename.
-(In the database, Filename is stored as varchar(255).)
-
-
-
-=item SetFilename VALUE
-
-
-Set Filename to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Filename will be stored as a varchar(255).)
-
-
-=cut
+# }}}
+# {{{ UTILITIES
-=item ContentType
+# {{{ sub Quote
-Returns the current value of ContentType.
-(In the database, ContentType is stored as varchar(80).)
+sub Quote {
+ my $self=shift;
+ my %args=(Reply=>undef, # Prefilled reply (i.e. from the KB/FAQ system)
+ @_);
-=item SetContentType VALUE
+ my ($quoted_content, $body, $headers);
+ my $max=0;
+ # TODO: Handle Multipart/Mixed (eventually fix the link in the
+ # ShowHistory web template?)
+ if ($self->ContentType =~ m{^(text/plain|message)}i) {
+ $body=$self->Content;
-Set ContentType to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ContentType will be stored as a varchar(80).)
+ # Do we need any preformatting (wrapping, that is) of the message?
+ # Remove quoted signature.
+ $body =~ s/\n-- \n(.*)$//s;
-=cut
+ # What's the longest line like?
+ foreach (split (/\n/,$body)) {
+ $max=length if ( length > $max);
+ }
+ if ($max>76) {
+ require Text::Wrapper;
+ my $wrapper=new Text::Wrapper
+ (
+ columns => 70,
+ body_start => ($max > 70*3 ? ' ' : ''),
+ par_start => ''
+ );
+ $body=$wrapper->wrap($body);
+ }
-=item ContentEncoding
+ $body =~ s/^/> /gm;
-Returns the current value of ContentEncoding.
-(In the database, ContentEncoding is stored as varchar(80).)
+ $body = '[' . $self->TransactionObj->CreatorObj->Name() . ' - ' . $self->TransactionObj->CreatedAsString()
+ . "]:\n\n"
+ . $body . "\n\n";
+ } else {
+ $body = "[Non-text message not quoted]\n\n";
+ }
+
+ $max=60 if $max<60;
+ $max=70 if $max>78;
+ $max+=2;
+ return (\$body, $max);
+}
+# }}}
-=item SetContentEncoding VALUE
+# {{{ sub NiceHeaders - pulls out only the most relevant headers
+=head2 NiceHeaders
-Set ContentEncoding to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ContentEncoding will be stored as a varchar(80).)
+Returns the To, From, Cc, Date and Subject headers.
+It is a known issue that this breaks if any of these headers are not
+properly unfolded.
=cut
+sub NiceHeaders {
+ my $self=shift;
+ my $hdrs="";
+ for (split(/\n/,$self->Headers)) {
+ $hdrs.="$_\n" if /^(To|From|RT-Send-Cc|Cc|Date|Subject): /i
+ }
+ return $hdrs;
+}
+# }}}
-=item Content
-
-Returns the current value of Content.
-(In the database, Content is stored as longtext.)
-
-
-
-=item SetContent VALUE
-
+# {{{ sub Headers
-Set Content to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Content will be stored as a longtext.)
+=head2 Headers
+Returns this object's headers as a string. This method specifically
+removes the RT-Send-Bcc: header, so as to never reveal to whom RT sent a Bcc.
+We need to record the RT-Send-Cc and RT-Send-Bcc values so that we can actually send
+out mail. (The mailing rules are seperated from the ticket update code by
+an abstraction barrier that makes it impossible to pass this data directly
=cut
+sub Headers {
+ my $self = shift;
+ my $hdrs="";
+ for (split(/\n/,$self->SUPER::Headers)) {
+ $hdrs.="$_\n" unless /^(RT-Send-Bcc): /i
+ }
+ return $hdrs;
+}
-=item Headers
-
-Returns the current value of Headers.
-(In the database, Headers is stored as longtext.)
-
-
-
-=item SetHeaders VALUE
-
-
-Set Headers to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Headers will be stored as a longtext.)
-
-
-=cut
+# }}}
-=item Creator
+# {{{ sub GetHeader
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+=head2 GetHeader ( 'Tag')
+Returns the value of the header Tag as a string. This bypasses the weeding out
+done in Headers() above.
=cut
+sub GetHeader {
+ my $self = shift;
+ my $tag = shift;
+ foreach my $line (split(/\n/,$self->SUPER::Headers)) {
+ $RT::Logger->debug( "Does $line match $tag\n");
+ if ($line =~ /^$tag:\s+(.*)$/i) { #if we find the header, return its value
+ return ($1);
+ }
+ }
+
+ # we found no header. return an empty string
+ return undef;
+}
+# }}}
-=item Created
+# {{{ sub _Value
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+=head2 _Value
+Takes the name of a table column.
+Returns its value as a string, if the user passes an ACL check
=cut
+sub _Value {
+ my $self = shift;
+ my $field = shift;
+
+
+ #if the field is public, return it.
+ if ($self->_Accessible($field, 'public')) {
+ #$RT::Logger->debug("Skipping ACL check for $field\n");
+ return($self->__Value($field));
+
+ }
+
+ #If it's a comment, we need to be extra special careful
+ elsif ( (($self->TransactionObj->CurrentUserHasRight('ShowTicketComments')) and
+ ($self->TransactionObj->Type eq 'Comment') ) or
+ ($self->TransactionObj->CurrentUserHasRight('ShowTicket'))) {
+
+ return($self->__Value($field));
+ }
+ #if they ain't got rights to see, don't let em
+ else {
+ return(undef);
+ }
+
+
+}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- TransactionId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Parent =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- MessageId =>
- {read => 1, write => 1, type => 'varchar(160)', default => ''},
- Subject =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- Filename =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- ContentType =>
- {read => 1, write => 1, type => 'varchar(80)', default => ''},
- ContentEncoding =>
- {read => 1, write => 1, type => 'varchar(80)', default => ''},
- Content =>
- {read => 1, write => 1, type => 'longtext', default => ''},
- Headers =>
- {read => 1, write => 1, type => 'longtext', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::Attachment_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Attachment_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Attachment_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::Attachment_Overlay, RT::Attachment_Vendor, RT::Attachment_Local
-
-=cut
+# }}}
+# }}}
1;
diff --git a/rt/lib/RT/Attachments.pm b/rt/lib/RT/Attachments.pm
index 177cdd094..73cd350a4 100755
--- a/rt/lib/RT/Attachments.pm
+++ b/rt/lib/RT/Attachments.pm
@@ -1,115 +1,99 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attachments.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Attachments -- Class Description
-
+ RT::Attachments - a collection of RT::Attachment objects
+
=head1 SYNOPSIS
- use RT::Attachments
+ use RT::Attachments;
=head1 DESCRIPTION
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in Ticket, Queue and other similar objects.
+
=head1 METHODS
-=cut
-package RT::Attachments;
+=begin testing
-use RT::SearchBuilder;
-use RT::Attachment;
+ok (require RT::TestHarness);
+ok (require RT::Attachments);
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=end testing
+=cut
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Attachments';
- $self->{'primary_key'} = 'id';
+package RT::Attachments;
+use RT::EasySearch;
- return ( $self->SUPER::_Init(@_) );
-}
+@ISA= qw(RT::EasySearch);
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "Attachments";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_));
+}
+# }}}
-=item NewItem
-Returns an empty new RT::Attachment item
+# {{{ sub ContentType
-=cut
+=head2 ContentType (VALUE => 'text/plain', ENTRYAGGREGATOR => 'OR', OPERATOR => '=' )
-sub NewItem {
- my $self = shift;
- return(RT::Attachment->new($self->CurrentUser));
-}
+Limit result set to attachments of ContentType 'TYPE'...
- eval "require RT::Attachments_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Overlay.pm}) {
- die $@;
- };
+=cut
- eval "require RT::Attachments_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Vendor.pm}) {
- die $@;
- };
- eval "require RT::Attachments_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Local.pm}) {
- die $@;
- };
+sub ContentType {
+ my $self = shift;
+ my %args = ( VALUE => 'text/plain',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ @_);
+ $self->Limit ( FIELD => 'ContentType',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ ENTRYAGGREGATOR => $args{'ENTRYAGGREGATOR'});
+}
+# }}}
+# {{{ sub ChildrenOf
+=head2 ChildrenOf ID
-=head1 SEE ALSO
+Limit result set to children of Attachment ID
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+=cut
-These overlay files can contain new subs or subs to replace existing subs in this module.
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+sub ChildrenOf {
+ my $self = shift;
+ my $attachment = shift;
+ $self->Limit ( FIELD => 'Parent',
+ VALUE => $attachment);
+}
+# }}}
- no warnings qw(redefine);
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+ use RT::Attachment;
+ my $item = new RT::Attachment($self->CurrentUser);
+ return($item);
+}
+# }}}
+ 1;
-RT::Attachments_Overlay, RT::Attachments_Vendor, RT::Attachments_Local
-=cut
-1;
diff --git a/rt/lib/RT/Condition/AnyTransaction.pm b/rt/lib/RT/Condition/AnyTransaction.pm
index 4519fcf5a..83e5de6ce 100644
--- a/rt/lib/RT/Condition/AnyTransaction.pm
+++ b/rt/lib/RT/Condition/AnyTransaction.pm
@@ -1,33 +1,10 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Condition/AnyTransaction.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU General Public License
package RT::Condition::AnyTransaction;
require RT::Condition::Generic;
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);
@@ -42,10 +19,5 @@ sub IsApplicable {
return(1);
}
-eval "require RT::Condition::AnyTransaction_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyTransaction_Vendor.pm});
-eval "require RT::Condition::AnyTransaction_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyTransaction_Local.pm});
-
1;
diff --git a/rt/lib/RT/Condition/Generic.pm b/rt/lib/RT/Condition/Generic.pm
index bd269315e..393f4b786 100755
--- a/rt/lib/RT/Condition/Generic.pm
+++ b/rt/lib/RT/Condition/Generic.pm
@@ -1,26 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Condition/Generic.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
=head1 NAME
RT::Condition::Generic - ;
@@ -48,6 +29,7 @@
=begin testing
+ok (require RT::TestHarness);
ok (require RT::Condition::Generic);
=end testing
@@ -57,11 +39,6 @@ ok (require RT::Condition::Generic);
package RT::Condition::Generic;
-use RT::Base;
-use strict;
-use vars qw/@ISA/;
-@ISA = qw(RT::Base);
-
# {{{ sub new
sub new {
my $proto = shift;
@@ -84,6 +61,7 @@ sub _Init {
ApplicableTransTypes => undef,
@_ );
+
$self->{'Argument'} = $args{'Argument'};
$self->{'ScripObj'} = $args{'ScripObj'};
$self->{'TicketObj'} = $args{'TicketObj'};
@@ -122,19 +100,6 @@ sub TicketObj {
}
# }}}
-# {{{ sub ScripObj
-
-=head2 ScripObj
-
-Return the Scrip object we're talking about
-
-=cut
-
-sub ScripObj {
- my $self = shift;
- return($self->{'ScripObj'});
-}
-# }}}
# {{{ sub TransactionObj
=head2 TransactionObj
@@ -172,7 +137,7 @@ sub ApplicableTransTypes {
# {{{ sub Describe
sub Describe {
my $self = shift;
- return ($self->loc("No description for [_1]", ref $self));
+ return ("No description for " . ref $self);
}
# }}}
@@ -202,10 +167,4 @@ sub DESTROY {
}
# }}}
-
-eval "require RT::Condition::Generic_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Vendor.pm});
-eval "require RT::Condition::Generic_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Local.pm});
-
1;
diff --git a/rt/lib/RT/Condition/NewDependency.pm b/rt/lib/RT/Condition/NewDependency.pm
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/rt/lib/RT/Condition/NewDependency.pm
diff --git a/rt/lib/RT/Condition/StatusChange.pm b/rt/lib/RT/Condition/StatusChange.pm
index 8afabcda0..56419b2c7 100644
--- a/rt/lib/RT/Condition/StatusChange.pm
+++ b/rt/lib/RT/Condition/StatusChange.pm
@@ -1,34 +1,10 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Condition/StatusChange.pm,v 1.1 2002-08-12 06:17:08 ivan Exp $
+# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU General Public License
package RT::Condition::StatusChange;
require RT::Condition::Generic;
-use strict;
-use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);
@@ -50,10 +26,5 @@ sub IsApplicable {
}
}
-eval "require RT::Condition::StatusChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/StatusChange_Vendor.pm});
-eval "require RT::Condition::StatusChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/StatusChange_Local.pm});
-
1;
diff --git a/rt/lib/RT/CurrentUser.pm b/rt/lib/RT/CurrentUser.pm
index 4ca2f9891..6997ddbac 100755
--- a/rt/lib/RT/CurrentUser.pm
+++ b/rt/lib/RT/CurrentUser.pm
@@ -1,26 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/CurrentUser.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-1999 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
=head1 NAME
RT::CurrentUser - an RT object representing the current user
@@ -38,6 +19,7 @@
=begin testing
+ok (require RT::TestHarness);
ok (require RT::CurrentUser);
=end testing
@@ -46,14 +28,10 @@ ok (require RT::CurrentUser);
package RT::CurrentUser;
-
use RT::Record;
-use RT::I18N;
-
-use strict;
-use vars qw/@ISA/;
@ISA= qw(RT::Record);
+
# {{{ sub _Init
#The basic idea here is that $self->CurrentUser is always supposed
@@ -70,7 +48,7 @@ sub _Init {
$self->Load($Name);
}
- $self->CurrentUser($self);
+ $self->_MyCurrentUser($self);
}
# }}}
@@ -78,8 +56,7 @@ sub _Init {
# {{{ sub Create
sub Create {
- my $self = shift;
- return (0, $self->loc('Permission Denied'));
+ return (0, 'Permission Denied');
}
# }}}
@@ -87,8 +64,7 @@ sub Create {
# {{{ sub Delete
sub Delete {
- my $self = shift;
- return (0, $self->loc('Permission Denied'));
+ return (0, 'Permission Denied');
}
# }}}
@@ -108,7 +84,7 @@ sub UserObj {
use RT::User;
$self->{'UserObj'} = RT::User->new($self);
unless ($self->{'UserObj'}->Load($self->Id)) {
- $RT::Logger->err($self->loc("Couldn't load [_1] from the users database.\n", $self->Id));
+ $RT::Logger->err("Couldn't load ".$self->Id. "from the users database.\n");
}
}
@@ -116,42 +92,6 @@ sub UserObj {
}
# }}}
-# {{{ sub PrincipalObj
-
-=head2 PrincipalObj
-
- Returns this user's principal object. this is just a helper routine for
- $self->UserObj->PrincipalObj
-
-=cut
-
-sub PrincipalObj {
- my $self = shift;
- return($self->UserObj->PrincipalObj);
-}
-
-
-# }}}
-
-
-# {{{ sub PrincipalId
-
-=head2 PrincipalId
-
- Returns this user's principal Id. this is just a helper routine for
- $self->UserObj->PrincipalId
-
-=cut
-
-sub PrincipalId {
- my $self = shift;
- return($self->UserObj->PrincipalId);
-}
-
-
-# }}}
-
-
# {{{ sub _Accessible
sub _Accessible {
my $self = shift;
@@ -180,8 +120,6 @@ Takes the email address of the user to load.
sub LoadByEmail {
my $self = shift;
my $identifier = shift;
-
- $identifier = RT::User::CanonicalizeEmailAddress(undef, $identifier);
$self->LoadByCol("EmailAddress",$identifier);
@@ -287,88 +225,46 @@ sub Privileged {
# }}}
+# {{{ Convenient ACL methods
-# {{{ sub HasRight
+=head2 HasQueueRight
-=head2 HasRight
-
-calls $self->UserObj->HasRight with the arguments passed in
+calls $self->UserObj->HasQueueRight with the arguments passed in
=cut
-sub HasRight {
- my $self = shift;
- return ($self->UserObj->HasRight(@_));
+sub HasQueueRight {
+ my $self = shift;
+ return ($self->UserObj->HasQueueRight(@_));
}
-# }}}
-
-# {{{ Localization
-
-=head2 LanguageHandle
+=head2 HasSystemRight
-Returns this current user's langauge handle. Should take a language
-specification. but currently doesn't
+calls $self->UserObj->HasSystemRight with the arguments passed in
-=begin testing
-
-ok (my $cu = RT::CurrentUser->new('root'));
-ok (my $lh = $cu->LanguageHandle);
-ok ($lh != undef);
-ok ($lh->isa('Locale::Maketext'));
-ok ($cu->loc('TEST_STRING') eq "Concrete Mixer", "Localized TEST_STRING into English");
-ok ($lh = $cu->LanguageHandle('fr'));
-ok ($cu->loc('Before') eq "Avant", "Localized TEST_STRING into Frenc");
-
-=end testing
+=cut
-=cut
-sub LanguageHandle {
- my $self = shift;
- if ((!defined $self->{'LangHandle'}) ||
- (!UNIVERSAL::can($self->{'LangHandle'}, 'maketext')) ||
- (@_)) {
- $self->{'LangHandle'} = RT::I18N->get_handle(@_);
- }
- # Fall back to english.
- unless ($self->{'LangHandle'}) {
- die "We couldn't get a dictionary. Nye mogu naidti slovar. No puedo encontrar dictionario.";
- }
- return ($self->{'LangHandle'});
+sub HasSystemRight {
+ my $self = shift;
+ return ($self->UserObj->HasSystemRight(@_));
}
+# }}}
-sub loc {
- my $self = shift;
- return '' if $_[0] eq '';
-
- my $handle = $self->LanguageHandle;
-
- if (@_ == 1) {
- # pre-scan the lexicon hashes to return _AUTO keys verbatim,
- # to keep locstrings containing '[' and '~' from tripping over Maketext
- return $_[0] unless grep { exists $_->{$_[0]} } @{ $handle->_lex_refs };
- }
+# {{{ sub HasRight
- return $handle->maketext(@_);
-}
+=head2 HasSystemRight
-sub loc_fuzzy {
- my $self = shift;
- return '' if $_[0] eq '';
+calls $self->UserObj->HasRight with the arguments passed in
- # XXX: work around perl's deficiency when matching utf8 data
- return $_[0] if Encode::is_utf8($_[0]);
- my $result = $self->LanguageHandle->maketext_fuzzy(@_);
+=cut
- return($result);
+sub HasRight {
+ my $self = shift;
+ return ($self->UserObj->HasRight(@_));
}
-# }}}
-eval "require RT::CurrentUser_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/CurrentUser_Vendor.pm});
-eval "require RT::CurrentUser_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/CurrentUser_Local.pm});
+# }}}
1;
diff --git a/rt/lib/RT/Date.pm b/rt/lib/RT/Date.pm
index 355370ada..d56997174 100644
--- a/rt/lib/RT/Date.pm
+++ b/rt/lib/RT/Date.pm
@@ -1,26 +1,7 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Date.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
=head1 NAME
RT::Date - a simple Object Oriented date.
@@ -47,15 +28,7 @@ ok (require RT::Date);
package RT::Date;
-
use Time::Local;
-
-use RT::Base;
-
-use strict;
-use vars qw/@ISA/;
-@ISA = qw/RT::Base/;
-
use vars qw($MINUTE $HOUR $DAY $WEEK $MONTH $YEAR);
$MINUTE = 60;
@@ -72,7 +45,6 @@ sub new {
my $class = ref($proto) || $proto;
my $self = {};
bless ($self, $class);
- $self->CurrentUser(@_);
$self->Unix(0);
return $self;
}
@@ -89,114 +61,91 @@ if $args->{'Format'} is 'unix', takes the number of seconds since the epoch
If $args->{'Format'} is ISO, tries to parse an ISO date.
-If $args->{'Format'} is 'unknown', require Time::ParseDate and make it figure
-things out. This is a heavyweight operation that should never be called from
-within RT's core. But it's really useful for something like the textbox date
-entry where we let the user do whatever they want.
+If $args->{'Format'} is 'unknown', require Date::Parse and make it figure things
+out. This is a heavyweight operation that should never be called from within
+RT's core. But it's really useful for something like the textbox date entry
+where we let the user do whatever they want.
If $args->{'Value'} is 0, assumes you mean never.
-=begin testing
-
-use_ok(RT::Date);
-my $date = RT::Date->new($RT::SystemUser);
-$date->Set(Format => 'unix', Value => '0');
-ok ($date->ISO eq '1970-01-01 00:00:00', "Set a date to midnight 1/1/1970 GMT");
-
-=end testing
=cut
sub Set {
my $self = shift;
my %args = ( Format => 'unix',
- Value => time,
- @_ );
- if ( !$args{'Value'}
- || ( ( $args{'Value'} =~ /^\d*$/ ) and ( $args{'Value'} == 0 ) ) ) {
- $self->Unix(-1);
- return ( $self->Unix() );
- }
-
- if ( $args{'Format'} =~ /^unix$/i ) {
- $self->Unix( $args{'Value'} );
+ Value => time,
+ @_);
+ if (($args{'Value'} =~ /^\d*$/) and ($args{'Value'} == 0)) {
+ $self->Unix(-1);
+ return($self->Unix());
}
- elsif ( $args{'Format'} =~ /^(sql|datemanip|iso)$/i ) {
- $args{'Value'} =~ s!/!-!g;
-
- if (( $args{'Value'} =~ /^(\d{4}?)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/ )
- || ( $args{'Value'} =~
- /^(\d{4}?)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/ )
- || ( $args{'Value'} =~
- /^(\d{4}?)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)\+00$/ )
- || ($args{'Value'} =~ /^(\d{4}?)(\d\d)(\d\d)(\d\d):(\d\d):(\d\d)$/ )
- ) {
-
- my $year = $1;
- my $mon = $2;
- my $mday = $3;
- my $hours = $4;
- my $min = $5;
- my $sec = $6;
-
- #timegm expects month as 0->11
- $mon--;
-
- #now that we've parsed it, deal with the case where everything
- #was 0
- if ( $mon == -1 ) {
- $self->Unix(-1);
- }
- else {
-
- #Dateamnip strings aren't in GMT.
- if ( $args{'Format'} =~ /^datemanip$/i ) {
- $self->Unix(
- timelocal( $sec, $min, $hours, $mday, $mon, $year ) );
- }
-
- #ISO and SQL dates are in GMT
- else {
- $self->Unix(
- timegm( $sec, $min, $hours, $mday, $mon, $year ) );
- }
-
- $self->Unix(-1) unless $self->Unix;
- }
- }
- else {
- use Carp;
- Carp::cluck;
- $RT::Logger->debug(
- "Couldn't parse date $args{'Value'} as a $args{'Format'}");
-
- }
+ if ($args{'Format'} =~ /^unix$/i) {
+ $self->Unix($args{'Value'});
}
- elsif ( $args{'Format'} =~ /^unknown$/i ) {
- require Time::ParseDate;
-
- #Convert it to an ISO format string
-
- my $date = Time::ParseDate::parsedate($args{'Value'},
- UK => $RT::DateDayBeforeMonth,
- PREFER_PAST => $RT::AmbiguousDayInPast,
- PREFER_FUTURE => !($RT::AmbiguousDayInPast));
-
- #This date has now been set to a date in the _local_ timezone.
- #since ISO dates are known to be in GMT (for RT's purposes);
-
- $RT::Logger->debug( "RT::Date used date::parse to make "
- . $args{'Value'}
- . " $date\n" );
-
- return ( $self->Set( Format => 'unix', Value => "$date" ) );
+
+ elsif ($args{'Format'} =~ /^(sql|datemanip|iso)$/i) {
+
+ if (($args{'Value'} =~ /^(\d{4}?)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/) ||
+ ($args{'Value'} =~ /^(\d{4}?)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/) ||
+ ($args{'Value'} =~ /^(\d{4}?)-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)\+00$/) ||
+ ($args{'Value'} =~ /^(\d{4}?)(\d\d)(\d\d)(\d\d):(\d\d):(\d\d)$/)) {
+
+ my $year = $1;
+ my $mon = $2;
+ my $mday = $3;
+ my $hours = $4;
+ my $min = $5;
+ my $sec = $6;
+
+ #timegm expects month as 0->11
+ $mon--;
+
+ #now that we've parsed it, deal with the case where everything
+ #was 0
+ if ($mon == -1) {
+ $self->Unix(-1);
+ } else {
+
+ #Dateamnip strings aren't in GMT.
+ if ($args{'Format'} =~ /^datemanip$/i) {
+ $self->Unix(timelocal($sec,$min,$hours,$mday,$mon,$year));
+ }
+ #ISO and SQL dates are in GMT
+ else {
+ $self->Unix(timegm($sec,$min,$hours,$mday,$mon,$year));
+ }
+
+ $self->Unix(-1) unless $self->Unix;
+ }
+ }
+ else {
+ use Carp;
+ Carp::cluck;
+ $RT::Logger->debug( "Couldn't parse date $args{'Value'} as a $args{'Format'}");
+
+ }
}
+ elsif ($args{'Format'} =~ /^unknown$/i) {
+ require Date::Parse;
+ #Convert it to an ISO format string
+
+ my $date = Date::Parse::str2time($args{'Value'});
+
+ #This date has now been set to a date in the _local_ timezone.
+ #since ISO dates are known to be in GMT (for RT's purposes);
+
+ $RT::Logger->debug("RT::Date used date::parse to make ".$args{'Value'} . " $date\n");
+
+
+ return ($self->Set( Format => 'unix', Value => "$date"));
+ }
else {
- die "Unknown Date format: " . $args{'Format'} . "\n";
+ die "Unknown Date format: ".$args{'Format'}."\n";
}
-
- return ( $self->Unix() );
+
+ return($self->Unix());
}
# }}}
@@ -283,59 +232,47 @@ sub DiffAsString {
# {{{ sub DurationAsString
-
=head2 DurationAsString
Takes a number of seconds. returns a string describing that duration
=cut
-sub DurationAsString {
+sub DurationAsString{
- my $self = shift;
+ my $self=shift;
my $duration = shift;
-
- my ( $negative, $s );
-
- $negative = 1 if ( $duration < 0 );
+
+ my ($negative, $s);
+
+ $negative = 'ago' if ($duration < 0);
$duration = abs($duration);
- my $time_unit;
- if ( $duration < $MINUTE ) {
- $s = $duration;
- $time_unit = $self->loc("sec");
- }
- elsif ( $duration < ( 2 * $HOUR ) ) {
- $s = int( $duration / $MINUTE );
- $time_unit = $self->loc("min");
- }
- elsif ( $duration < ( 2 * $DAY ) ) {
- $s = int( $duration / $HOUR );
- $time_unit = $self->loc("hours");
- }
- elsif ( $duration < ( 2 * $WEEK ) ) {
- $s = int( $duration / $DAY );
- $time_unit = $self->loc("days");
- }
- elsif ( $duration < ( 2 * $MONTH ) ) {
- $s = int( $duration / $WEEK );
- $time_unit = $self->loc("weeks");
- }
- elsif ( $duration < $YEAR ) {
- $s = int( $duration / $MONTH );
- $time_unit = $self->loc("months");
- }
- else {
- $s = int( $duration / $YEAR );
- $time_unit = $self->loc("years");
- }
- if (0) { # For now, never display the "AGO" # $negative) {
- return $self->loc( "[_1] [_2] ago", $s, $time_unit );
- }
- else {
- return $self->loc( "[_1] [_2]", $s, $time_unit );
+ if($duration < $MINUTE) {
+ $s=$duration;
+ $string="sec";
+ } elsif($duration < (2 * $HOUR)) {
+ $s = int($duration/$MINUTE);
+ $string="min";
+ } elsif($duration < (2 * $DAY)) {
+ $s = int($duration/$HOUR);
+ $string="hours";
+ } elsif($duration < (2 * $WEEK)) {
+ $s = int($duration/$DAY);
+ $string="days";
+ } elsif($duration < (2 * $MONTH)) {
+ $s = int($duration/$WEEK);
+ $string="weeks";
+ } elsif($duration < $YEAR) {
+ $s = int($duration/$MONTH);
+ $string="months";
+ } else {
+ $s = int($duration/$YEAR);
+ $string="years";
}
+
+ return ("$s $string $negative");
}
# }}}
@@ -366,64 +303,12 @@ Returns the object\'s time as a string with the current timezone.
sub AsString {
my $self = shift;
- return ($self->loc("Not set")) if ($self->Unix <= 0);
-
- my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($self->Unix);
+ return ("Not set") if ($self->Unix <= 0);
- return $self->loc("[_1] [_2] [_3] [_4]:[_5]:[_6] [_7]", $self->GetWeekday($wday), $self->GetMonth($mon), map {sprintf "%02d", $_} ($mday, $hour, $min, $sec), ($year+1900));
+ return (scalar(localtime($self->Unix)));
}
# }}}
-# {{{ GetWeekday
-=head2 GetWeekday DAY
-
-Takes an integer day of week and returns a localized string for that day of week
-
-=cut
-
-sub GetWeekday {
- my $self = shift;
- my $dow = shift;
-
- return $self->loc('Mon.') if ($dow == 1);
- return $self->loc('Tue.') if ($dow == 2);
- return $self->loc('Wed.') if ($dow == 3);
- return $self->loc('Thu.') if ($dow == 4);
- return $self->loc('Fri.') if ($dow == 5);
- return $self->loc('Sat.') if ($dow == 6);
- return $self->loc('Sun.') if ($dow == 0);
-}
-
-# }}}
-
-# {{{ GetMonth
-=head2 GetMonth DAY
-
-Takes an integer month and returns a localized string for that month
-
-=cut
-
-sub GetMonth {
- my $self = shift;
- my $mon = shift;
-
- # We do this rather than an array so that we don't call localize 12x what we need to
- return $self->loc('Jan.') if ($mon == 0);
- return $self->loc('Feb.') if ($mon == 1);
- return $self->loc('Mar.') if ($mon == 2);
- return $self->loc('Apr.') if ($mon == 3);
- return $self->loc('May.') if ($mon == 4);
- return $self->loc('Jun.') if ($mon == 5);
- return $self->loc('Jul.') if ($mon == 6);
- return $self->loc('Aug.') if ($mon == 7);
- return $self->loc('Sep.') if ($mon == 8);
- return $self->loc('Oct.') if ($mon == 9);
- return $self->loc('Nov.') if ($mon == 10);
- return $self->loc('Dec.') if ($mon == 11);
-}
-
-# }}}
-
# {{{ sub AddSeconds
=head2 sub AddSeconds
@@ -540,18 +425,12 @@ pull from a 'Timezone' attribute of the CurrentUser
sub LocalTimezone {
my $self = shift;
-
- return $self->CurrentUser->Timezone
- if $self->CurrentUser and $self->CurrentUser->can('Timezone');
-
+
return ($RT::Timezone);
}
# }}}
-eval "require RT::Date_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Date_Vendor.pm});
-eval "require RT::Date_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Date_Local.pm});
+
1;
diff --git a/rt/lib/RT/EasySearch.pm b/rt/lib/RT/EasySearch.pm
new file mode 100755
index 000000000..bcbfa01b2
--- /dev/null
+++ b/rt/lib/RT/EasySearch.pm
@@ -0,0 +1,115 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/EasySearch.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+=head1 NAME
+
+ RT::EasySearch - a baseclass for RT collection objects
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+
+=head1 METHODS
+
+
+=begin testing
+
+ok (require RT::EasySearch);
+
+=end testing
+
+
+=cut
+
+package RT::EasySearch;
+use DBIx::SearchBuilder;
+@ISA= qw(DBIx::SearchBuilder);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'user'} = shift;
+ unless(defined($self->CurrentUser)) {
+ use Carp;
+ Carp::confess("$self was created without a CurrentUser");
+ $RT::Logger->err("$self was created without a CurrentUser\n");
+ return(0);
+ }
+ $self->SUPER::_Init( 'Handle' => $RT::Handle);
+}
+# }}}
+
+# {{{ sub LimitToEnabled
+
+=head2 LimitToEnabled
+
+Only find items that haven\'t been disabled
+
+=cut
+
+sub LimitToEnabled {
+ my $self = shift;
+
+ $self->Limit( FIELD => 'Disabled',
+ VALUE => '0',
+ OPERATOR => '=' );
+}
+# }}}
+
+# {{{ sub LimitToDisabled
+
+=head2 LimitToDeleted
+
+Only find items that have been deleted.
+
+=cut
+
+sub LimitToDeleted {
+ my $self = shift;
+
+ $self->{'find_disabled_rows'} = 1;
+ $self->Limit( FIELD => 'Disabled',
+ OPERATOR => '=',
+ VALUE => '1'
+ );
+}
+# }}}
+
+
+# {{{ sub Limit
+
+=head2 Limit PARAMHASH
+
+This Limit sub calls SUPER::Limit, but defaults "CASESENSITIVE" to 1, thus
+making sure that by default lots of things don't do extra work trying to
+match lower(colname) agaist lc($val);
+
+=cut
+
+sub Limit {
+ my $self = shift;
+ my %args = ( CASESENSITIVE => 1,
+ @_ );
+
+ return $self->SUPER::Limit(%args);
+}
+
+# {{{ sub CurrentUser
+
+=head2 CurrentUser
+
+ Returns the current user as an RT::User object.
+
+=cut
+
+sub CurrentUser {
+ my $self = shift;
+ return ($self->{'user'});
+}
+# }}}
+
+
+1;
+
+
diff --git a/rt/lib/RT/Group.pm b/rt/lib/RT/Group.pm
index 4dcef3f07..005601f5e 100755
--- a/rt/lib/RT/Group.pm
+++ b/rt/lib/RT/Group.pm
@@ -1,258 +1,364 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Group.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 2000 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
+#
#
-
-use strict;
-
=head1 NAME
-RT::Group
-
+ RT::Group - RT\'s group object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::Group;
-use RT::Record;
+ use RT::Group;
+my $group = new RT::Group($CurrentUser);
+=head1 DESCRIPTION
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+An RT group object.
-sub _Init {
- my $self = shift;
+=head1 AUTHOR
- $self->Table('Groups');
- $self->SUPER::_Init(@_);
-}
+Jesse Vincent, jesse@fsck.com
+=head1 SEE ALSO
+RT
+=head1 METHODS
-=item Create PARAMHASH
+=begin testing
-Create takes a hash of values and creates a row in the database:
+ok (require RT::TestHarness);
+ok (require RT::Group);
- varchar(200) 'Name'.
- varchar(255) 'Description'.
- varchar(64) 'Domain'.
- varchar(64) 'Type'.
- varchar(64) 'Instance'.
+=end testing
=cut
+package RT::Group;
+use RT::Record;
+use RT::GroupMember;
+use RT::ACE;
+use vars qw|@ISA|;
+@ISA= qw(RT::Record);
-sub Create {
- my $self = shift;
- my %args = (
- Name => '',
- Description => '',
- Domain => '',
- Type => '',
- Instance => '',
-
- @_);
- $self->SUPER::Create(
- Name => $args{'Name'},
- Description => $args{'Description'},
- Domain => $args{'Domain'},
- Type => $args{'Type'},
- Instance => $args{'Instance'},
-);
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Groups";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ Name => 'read/write',
+ Description => 'read/write',
+ Pseudo => 'read'
+ );
+ return $self->SUPER::_Accessible(@_, %Cols);
+}
+# }}}
+# {{{ sub Load
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+=head2 Load
+Load a group object from the database. Takes a single argument.
+If the argument is numerical, load by the column 'id'. Otherwise, load by
+the "Name" column which is the group's textual name
=cut
+sub Load {
+ my $self = shift;
+ my $identifier = shift || return undef;
+
+ #if it's an int, load by id. otherwise, load by name.
+ if ($identifier !~ /\D/) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ $self->LoadByCol("Name",$identifier);
+ }
+}
-=item Name
-
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
-
-
-
-=item SetName VALUE
+# }}}
+# {{{ sub Create
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
+=head2 Create
+Takes a paramhash with three named arguments: Name, Description and Pseudo.
+Pseudo is used internally by RT for certain special ACL decisions.
=cut
+sub Create {
+ my $self = shift;
+ my %args = ( Name => undef,
+ Description => undef,
+ Pseudo => 0,
+ @_);
+
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ $RT::Logger->warning($self->CurrentUser->Name ." Tried to create a group without permission.");
+ return(0, 'Permission Denied');
+ }
+
+ my $retval = $self->SUPER::Create(Name => $args{'Name'},
+ Description => $args{'Description'},
+ Pseudo => $args{'Pseudo'});
+
+ return ($retval);
+}
-=item Description
-
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
-
-
-
-=item SetDescription VALUE
+# }}}
+# {{{ sub Delete
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
+=head2 Delete
+Delete this object
=cut
+sub Delete {
+ my $self = shift;
+
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ return (0, 'Permission Denied');
+ }
+
+ return($self->SUPER::Delete(@_));
+}
-=item Domain
-
-Returns the current value of Domain.
-(In the database, Domain is stored as varchar(64).)
-
+# }}}
+# {{{ MembersObj
-=item SetDomain VALUE
+=head2 MembersObj
+Returns an RT::GroupMembers object of this group's members.
-Set Domain to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Domain will be stored as a varchar(64).)
+=cut
+sub MembersObj {
+ my $self = shift;
+ unless (defined $self->{'members_obj'}) {
+ use RT::GroupMembers;
+ $self->{'members_obj'} = new RT::GroupMembers($self->CurrentUser);
+
+ #If we don't have rights, don't include any results
+ $self->{'members_obj'}->LimitToGroup($self->id);
+
+ }
+ return ($self->{'members_obj'});
+
+}
-=cut
+# }}}
+# {{{ AddMember
-=item Type
+=head2 AddMember
-Returns the current value of Type.
-(In the database, Type is stored as varchar(64).)
+AddMember adds a user to this group. It takes a user id.
+Returns a two value array. the first value is true on successful
+addition or 0 on failure. The second value is a textual status msg.
+=cut
+sub AddMember {
+ my $self = shift;
+ my $new_member = shift;
+
+ my $new_member_obj = new RT::User($self->CurrentUser);
+ $new_member_obj->Load($new_member);
+
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ #User has no permission to be doing this
+ return(0, "Permission Denied");
+ }
+
+ unless ($new_member_obj->Id) {
+ $RT::Logger->debug("Couldn't find user $new_member");
+ return(0, "Couldn't find user");
+ }
+
+ if ($self->HasMember($new_member_obj->Id)) {
+ #User is already a member of this group. no need to add it
+ return(0, "Group already has member");
+ }
+
+ my $member_object = new RT::GroupMember($self->CurrentUser);
+ $member_object->Create( UserId => $new_member_obj->Id,
+ GroupId => $self->id );
+ return(1, "Member added");
+}
-=item SetType VALUE
+# }}}
+# {{{ HasMember
-Set Type to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Type will be stored as a varchar(64).)
+=head2 HasMember
+Takes a user Id and returns a GroupMember Id if that user is a member of
+this group.
+Returns undef if the user isn't a member of the group or if the current
+user doesn't have permission to find out. Arguably, it should differentiate
+between ACL failure and non membership.
=cut
+sub HasMember {
+ my $self = shift;
+ my $user_id = shift;
-=item Instance
+ #Try to cons up a member object using "LoadByCols"
-Returns the current value of Instance.
-(In the database, Instance is stored as varchar(64).)
+ my $member_obj = new RT::GroupMember($self->CurrentUser);
+ $member_obj->LoadByCols( UserId => $user_id, GroupId => $self->id);
+ #If we have a member object
+ if (defined $member_obj->id) {
+ return ($member_obj->id);
+ }
+ #If Load returns no objects, we have an undef id.
+ else {
+ return(undef);
+ }
+}
-=item SetInstance VALUE
+# }}}
+# {{{ DeleteMember
-Set Instance to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Instance will be stored as a varchar(64).)
+=head2 DeleteMember
+Takes the user id of a member.
+If the current user has apropriate rights,
+removes that GroupMember from this group.
+Returns a two value array. the first value is true on successful
+addition or 0 on failure. The second value is a textual status msg.
=cut
+sub DeleteMember {
+ my $self = shift;
+ my $member = shift;
+
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ #User has no permission to be doing this
+ return(0,"Permission Denied");
+ }
+
+ my $member_user_obj = new RT::User($self->CurrentUser);
+ $member_user_obj->Load($member);
+
+ unless ($member_user_obj->Id) {
+ $RT::Logger->debug("Couldn't find user $member");
+ return(0, "User not found");
+ }
+
+ my $member_obj = new RT::GroupMember($self->CurrentUser);
+ unless ($member_obj->LoadByCols ( UserId => $member_user_obj->Id,
+ GroupId => $self->Id )) {
+ return(0, "Couldn\'t load member"); #couldn\'t load member object
+ }
+
+ #If we couldn't load it, return undef.
+ unless ($member_obj->Id()) {
+ return (0, "Group has no such member");
+ }
+
+ #Now that we've checked ACLs and sanity, delete the groupmember
+ my $val = $member_obj->Delete();
+ if ($val) {
+ return ($val, "Member deleted");
+ }
+ else {
+ return (0, "Member not deleted");
+ }
+}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- Domain =>
- {read => 1, write => 1, type => 'varchar(64)', default => ''},
- Type =>
- {read => 1, write => 1, type => 'varchar(64)', default => ''},
- Instance =>
- {read => 1, write => 1, type => 'varchar(64)', default => ''},
+# {{{ ACL Related routines
- }
-};
+# {{{ GrantQueueRight
+=head2 GrantQueueRight
- eval "require RT::Group_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Group_Overlay.pm}) {
- die $@;
- };
+Grant a queue right to this group. Takes a paramhash of which the elements
+RightAppliesTo and RightName are important.
- eval "require RT::Group_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Group_Vendor.pm}) {
- die $@;
- };
+=cut
- eval "require RT::Group_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Group_Local.pm}) {
- die $@;
- };
+sub GrantQueueRight {
+
+ my $self = shift;
+ my %args = ( RightScope => 'Queue',
+ RightName => undef,
+ RightAppliesTo => undef,
+ PrincipalType => 'Group',
+ PrincipalId => $self->Id,
+ @_);
+
+ #ACLs get checked in ACE.pm
+
+ my $ace = new RT::ACE($self->CurrentUser);
+
+ return ($ace->Create(%args));
+}
+# }}}
+# {{{ GrantSystemRight
+=head2 GrantSystemRight
-=head1 SEE ALSO
+Grant a system right to this group.
+The only element that's important to set is RightName.
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
+=cut
+sub GrantSystemRight {
+
+ my $self = shift;
+ my %args = ( RightScope => 'System',
+ RightName => undef,
+ RightAppliesTo => 0,
+ PrincipalType => 'Group',
+ PrincipalId => $self->Id,
+ @_);
+
+ # ACLS get checked in ACE.pm
+
+ my $ace = new RT::ACE($self->CurrentUser);
+ return ($ace->Create(%args));
+}
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
- no warnings qw(redefine);
+# }}}
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-RT::Group_Overlay, RT::Group_Vendor, RT::Group_Local
+# {{{ sub _Set
+sub _Set {
+ my $self = shift;
-=cut
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ return (0, 'Permission Denied');
+ }
+ return ($self->SUPER::_Set(@_));
-1;
+}
+# }}}
diff --git a/rt/lib/RT/GroupMember.pm b/rt/lib/RT/GroupMember.pm
index 8de1a73fe..69de50b42 100755
--- a/rt/lib/RT/GroupMember.pm
+++ b/rt/lib/RT/GroupMember.pm
@@ -1,189 +1,136 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/GroupMember.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 2000 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
=head1 NAME
-RT::GroupMember
-
+ RT::GroupMember - a member of an RT Group
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::GroupMember;
-use RT::Record;
-
+RT::GroupMember should never be called directly. It should generally
+only be accessed through the helper functions in RT::Group;
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+=head1 DESCRIPTION
-sub _Init {
- my $self = shift;
- $self->Table('GroupMembers');
- $self->SUPER::_Init(@_);
-}
+=head1 METHODS
+=begin testing
-=item Create PARAMHASH
+ok (require RT::TestHarness);
+ok (require RT::GroupMember);
-Create takes a hash of values and creates a row in the database:
+=end testing
- int(11) 'GroupId'.
- int(11) 'MemberId'.
=cut
+package RT::GroupMember;
+use RT::Record;
+use vars qw|@ISA|;
+@ISA= qw(RT::Record);
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "GroupMembers";
+ return($self->SUPER::_Init(@_));
+}
+# }}}
-
-sub Create {
+# {{{ sub _Accessible
+sub _Accessible {
my $self = shift;
- my %args = (
- GroupId => '0',
- MemberId => '0',
-
- @_);
- $self->SUPER::Create(
- GroupId => $args{'GroupId'},
- MemberId => $args{'MemberId'},
-);
+ my %Cols = (
+ GroupId => 'read',
+ UserId => 'read'
+ );
+ return $self->SUPER::_Accessible(@_, %Cols);
}
+# }}}
+# {{{ sub Create
+# a helper method for Add
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
-
-
-=item GroupId
-
-Returns the current value of GroupId.
-(In the database, GroupId is stored as int(11).)
-
-
-
-=item SetGroupId VALUE
+sub Create {
+ my $self = shift;
+ my %args = ( GroupId => undef,
+ UserId => undef,
+ @_
+ );
+
+ unless( $self->CurrentUser->HasSystemRight('AdminGroups')) {
+ return (0, 'Permission Denied');
+ }
+
+ return ($self->SUPER::Create(GroupId => $args{'GroupId'},
+ UserId => $args{'UserId'}))
+}
+# }}}
+# {{{ sub Add
-Set GroupId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, GroupId will be stored as a int(11).)
+=head2 Add
+Takes a paramhash of UserId and GroupId. makes that user a memeber
+of that group
=cut
+sub Add {
+ my $self = shift;
+ return ($self->Create(@_));
+}
+# }}}
-=item MemberId
-
-Returns the current value of MemberId.
-(In the database, MemberId is stored as int(11).)
-
-
-
-=item SetMemberId VALUE
-
+# {{{ sub Delete
-Set MemberId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, MemberId will be stored as a int(11).)
+=head2 Delete
+Takes no arguments. deletes the currently loaded member from the
+group in question.
=cut
+sub Delete {
+ my $self = shift;
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ return (0, 'Permission Denied');
+ }
+ return($self->SUPER::Delete(@_));
+}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- GroupId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- MemberId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
-
- }
-};
-
-
- eval "require RT::GroupMember_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::GroupMember_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::GroupMember_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
+# {{{ sub UserObj
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 UserObj
-RT::GroupMember_Overlay, RT::GroupMember_Vendor, RT::GroupMember_Local
+Returns an RT::User object for the user specified by $self->UserId
=cut
+sub UserObj {
+ my $self = shift;
+ unless (defined ($self->{'user_obj'})) {
+ $self->{'user_obj'} = new RT::User($self->CurrentUser);
+ $self->{'user_obj'}->Load($self->UserId);
+ }
+ return($self->{'user_obj'});
+}
-1;
+# {{{ sub _Set
+sub _Set {
+ my $self = shift;
+ unless ($self->CurrentUser->HasSystemRight('AdminGroups')) {
+ return (0, 'Permission Denied');
+ }
+ return($self->SUPER::_Set(@_));
+}
+# }}}
diff --git a/rt/lib/RT/GroupMembers.pm b/rt/lib/RT/GroupMembers.pm
index 31cb9536f..a90a2a899 100755
--- a/rt/lib/RT/GroupMembers.pm
+++ b/rt/lib/RT/GroupMembers.pm
@@ -1,115 +1,73 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/GroupMembers.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::GroupMembers -- Class Description
-
+ RT::GroupMembers - a collection of RT::GroupMember objects
+
=head1 SYNOPSIS
- use RT::GroupMembers
+ use RT::GroupMembers;
=head1 DESCRIPTION
=head1 METHODS
-=cut
-package RT::GroupMembers;
+=begin testing
-use RT::SearchBuilder;
-use RT::GroupMember;
+ok (require RT::TestHarness);
+ok (require RT::GroupMembers);
+
+=end testing
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=cut
+package RT::GroupMembers;
+use RT::EasySearch;
+use RT::GroupMember;
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'GroupMembers';
- $self->{'primary_key'} = 'id';
+@ISA= qw(RT::EasySearch);
- return ( $self->SUPER::_Init(@_) );
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "GroupMembers";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_) );
}
+# }}}
+# {{{ sub LimitToGroup
-=item NewItem
+=head2 LimitToGroup
-Returns an empty new RT::GroupMember item
+Takes a group id as its only argument. Limits the current search to that
+group object
=cut
-sub NewItem {
+sub LimitToGroup {
my $self = shift;
- return(RT::GroupMember->new($self->CurrentUser));
-}
-
- eval "require RT::GroupMembers_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Overlay.pm}) {
- die $@;
- };
+ my $group = shift;
- eval "require RT::GroupMembers_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Vendor.pm}) {
- die $@;
- };
+ return ($self->Limit(
+ VALUE => "$group",
+ FIELD => 'GroupId',
+ ENTRYAGGREGATOR => 'OR',
+ ));
- eval "require RT::GroupMembers_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+}
+# }}}
-RT::GroupMembers_Overlay, RT::GroupMembers_Vendor, RT::GroupMembers_Local
-
-=cut
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return(RT::GroupMember->new($self->CurrentUser))
+}
+# }}}
1;
diff --git a/rt/lib/RT/Groups.pm b/rt/lib/RT/Groups.pm
index 29f12a5a0..f44f1fdb3 100755
--- a/rt/lib/RT/Groups.pm
+++ b/rt/lib/RT/Groups.pm
@@ -1,115 +1,100 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Groups.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Groups -- Class Description
-
+ RT::Groups - a collection of RT::Group objects
+
=head1 SYNOPSIS
- use RT::Groups
+ use RT::Groups;
+ my $groups = $RT::Groups->new($CurrentUser);
+ $groups->LimitToReal();
+ while (my $group = $groups->Next()) {
+ print $group->Id ." is a group id\n";
+ }
=head1 DESCRIPTION
=head1 METHODS
-=cut
-
-package RT::Groups;
-use RT::SearchBuilder;
-use RT::Group;
+=begin testing
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+ok (require RT::TestHarness);
+ok (require RT::Groups);
+=end testing
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Groups';
- $self->{'primary_key'} = 'id';
+=cut
+package RT::Groups;
+use RT::EasySearch;
+use RT::Groups;
- return ( $self->SUPER::_Init(@_) );
-}
+@ISA= qw(RT::EasySearch);
+# {{{ sub _Init
-=item NewItem
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Groups";
+ $self->{'primary_key'} = "id";
-Returns an empty new RT::Group item
+ $self->OrderBy( ALIAS => 'main',
+ FIELD => 'Name',
+ ORDER => 'ASC');
-=cut
-sub NewItem {
- my $self = shift;
- return(RT::Group->new($self->CurrentUser));
+ return ( $self->SUPER::_Init(@_));
}
+# }}}
- eval "require RT::Groups_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Groups_Overlay.pm}) {
- die $@;
- };
+# {{{ LimitToReal
- eval "require RT::Groups_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Groups_Vendor.pm}) {
- die $@;
- };
+=head2 LimitToReal
- eval "require RT::Groups_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Groups_Local.pm}) {
- die $@;
- };
+Make this groups object return only "real" groups, which can be
+granted rights and have members assigned to them
+=cut
+sub LimitToReal {
+ my $self = shift;
+ return ($self->Limit( FIELD => 'Pseudo',
+ VALUE => '0',
+ OPERATOR => '='));
-=head1 SEE ALSO
+}
+# }}}
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+# {{{ sub LimitToPseudo
-These overlay files can contain new subs or subs to replace existing subs in this module.
+=head2 LimitToPseudo
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+Make this groups object return only "pseudo" groups, which can be
+granted rights but whose membership lists are determined dynamically.
- no warnings qw(redefine);
+=cut
+
+ sub LimitToPseudo {
+ my $self = shift;
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+ return ($self->Limit( FIELD => 'Pseudo',
+ VALUE => '1',
+ OPERATOR => '='));
-RT::Groups_Overlay, RT::Groups_Vendor, RT::Groups_Local
+}
+# }}}
-=cut
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return (RT::Group->new($self->CurrentUser));
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm
index 5cdb65e5b..6b74f361b 100644
--- a/rt/lib/RT/Handle.pm
+++ b/rt/lib/RT/Handle.pm
@@ -1,26 +1,5 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Handle.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
=head1 NAME
RT::Handle - RT's database handle
@@ -43,16 +22,14 @@ ok(require RT::Handle);
package RT::Handle;
-use strict;
-use vars qw/@ISA/;
-
eval "use DBIx::SearchBuilder::Handle::$RT::DatabaseType;
+
\@ISA= qw(DBIx::SearchBuilder::Handle::$RT::DatabaseType);";
+
#TODO check for errors here.
=head2 Connect
-Connects to RT's database handle.
Takes nothing. Calls SUPER::Connect with the needed args
=cut
@@ -61,41 +38,16 @@ sub Connect {
my $self=shift;
# Unless the database port is a positive integer, we really don't want to pass it.
-
-$self->SUPER::Connect(
- User => $RT::DatabaseUser,
- Password => $RT::DatabasePassword,
- );
-
-}
-
-=item BuildDSN
-
-Build the DSN for the RT database. doesn't take any parameters, draws all that
-from the config file.
-
-=cut
-
-
-sub BuildDSN {
- my $self = shift;
$RT::DatabasePort = undef unless (defined $RT::DatabasePort && $RT::DatabasePort =~ /^(\d+)$/);
-$RT::DatabaseHost = undef unless (defined $RT::DatabaseHost && $RT::DatabaseHost ne '');
- $self->SUPER::BuildDSN(Host => $RT::DatabaseHost,
+$self->SUPER::Connect(Host => $RT::DatabaseHost,
Database => $RT::DatabaseName,
+ User => $RT::DatabaseUser,
+ Password => $RT::DatabasePassword,
Port => $RT::DatabasePort,
Driver => $RT::DatabaseType,
RequireSSL => $RT::DatabaseRequireSSL,
- DisconnectHandleOnDestroy => 1
);
-
}
-
-eval "require RT::Handle_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Handle_Vendor.pm});
-eval "require RT::Handle_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Handle_Local.pm});
-
1;
diff --git a/rt/lib/RT/Interface/CLI.pm b/rt/lib/RT/Interface/CLI.pm
index a3c840af5..a3bf92d5f 100644
--- a/rt/lib/RT/Interface/CLI.pm
+++ b/rt/lib/RT/Interface/CLI.pm
@@ -1,31 +1,9 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-use strict;
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Interface/CLI.pm,v 1.1 2002-08-12 06:17:08 ivan Exp $
+# RT is (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
-use RT;
package RT::Interface::CLI;
+use strict;
BEGIN {
@@ -33,14 +11,14 @@ BEGIN {
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
- $VERSION = do { my @r = (q$Revision: 1.1.1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
+ $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
@ISA = qw(Exporter);
# your exported package globals go here,
# as well as any optionally exported functions
- @EXPORT_OK = qw(&CleanEnv
- &GetCurrentUser &GetMessageContent &debug &loc);
+ @EXPORT_OK = qw(&CleanEnv &LoadConfig &DBConnect
+ &GetCurrentUser &GetMessageContent &debug);
}
=head1 NAME
@@ -49,28 +27,25 @@ BEGIN {
=head1 SYNOPSIS
- use lib "/path/to/rt/libraries/";
+ use lib "!!RT_LIB_PATH!!";
+ use lib "!!RT_ETC_PATH!!";
- use RT::Interface::CLI qw(CleanEnv
- GetCurrentUser GetMessageContent loc);
+ use RT::Interface::CLI qw(CleanEnv LoadConfig DBConnect
+ GetCurrentUser GetMessageContent);
#Clean out all the nasties from the environment
CleanEnv();
- #let's talk to RT'
- use RT;
+ #Load etc/config.pm and drop privs
+ LoadConfig();
- #Load RT's config file
- RT::LoadConfig();
+ #Connect to the database and get RT::SystemUser and RT::Nobody loaded
+ DBConnect();
- # Connect to the database. set up loggign
- RT::Init();
#Get the current user all loaded
my $CurrentUser = GetCurrentUser();
- print loc('Hello!'); # Synonym of $CuurentUser->loc('Hello!');
-
=head1 DESCRIPTION
@@ -78,6 +53,7 @@ BEGIN {
=begin testing
+ok(require RT::TestHarness);
ok(require RT::Interface::CLI);
=end testing
@@ -101,10 +77,35 @@ sub CleanEnv {
+=head2 LoadConfig
+
+Loads RT's config file and then drops setgid privileges.
+
+=cut
+
+sub LoadConfig {
+
+ #This drags in RT's config.pm
+ use config;
+
+}
+
+
+
+=head2 DBConnect
+
+ Calls RT::Init, which creates a database connection and then creates $RT::Nobody
+ and $RT::SystemUser
+
+=cut
+
+
+sub DBConnect {
+ use RT;
+ RT::Init();
+}
-{
- my $CurrentUser; # shared betwen GetCurrentUser and loc
# {{{ sub GetCurrentUser
@@ -114,14 +115,15 @@ sub CleanEnv {
loaded with that user. if the current user isn't found, returns a copy of RT::Nobody.
=cut
-
sub GetCurrentUser {
+ my ($Gecos, $CurrentUser);
+
require RT::CurrentUser;
#Instantiate a user object
- my $Gecos= ($^O eq 'MSWin32') ? Win32::LoginName() : (getpwuid($<))[0];
+ $Gecos=(getpwuid($<))[0];
#If the current user is 0, then RT will assume that the User object
#is that of the currentuser.
@@ -132,29 +134,10 @@ sub GetCurrentUser {
unless ($CurrentUser->Id) {
$RT::Logger->debug("No user with a unix login of '$Gecos' was found. ");
}
-
return($CurrentUser);
}
# }}}
-
-# {{{ sub loc
-
-=head2 loc
-
- Synonym of $CurrentUser->loc().
-
-=cut
-
-sub loc {
- die "No current user yet" unless $CurrentUser ||= RT::CurrentUser->new;
- return $CurrentUser->loc(@_);
-}
-# }}}
-
-}
-
-
# {{{ sub GetMessageContent
=head2 GetMessageContent
@@ -238,9 +221,4 @@ sub debug {
# }}}
-eval "require RT::Interface::CLI_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/CLI_Vendor.pm});
-eval "require RT::Interface::CLI_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/CLI_Local.pm});
-
1;
diff --git a/rt/lib/RT/Interface/Email.pm b/rt/lib/RT/Interface/Email.pm
index bc1a55da2..e95436091 100755
--- a/rt/lib/RT/Interface/Email.pm
+++ b/rt/lib/RT/Interface/Email.pm
@@ -1,58 +1,41 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Interface/Email.pm,v 1.1 2002-08-12 06:17:08 ivan Exp $
+# RT is (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
+
package RT::Interface::Email;
use strict;
use Mail::Address;
use MIME::Entity;
-use RT::EmailParser;
-
BEGIN {
use Exporter ();
use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
# set the version for version checking
- $VERSION = do { my @r = (q$Revision: 1.1.1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
+ $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
@ISA = qw(Exporter);
# your exported package globals go here,
# as well as any optionally exported functions
- @EXPORT_OK = qw(
- &CreateUser
+ @EXPORT_OK = qw(&CleanEnv
+ &LoadConfig
+ &DBConnect
+ &GetCurrentUser
&GetMessageContent
&CheckForLoops
&CheckForSuspiciousSender
&CheckForAutoGenerated
+ &ParseMIMEEntityFromSTDIN
+ &ParseTicketId
&MailError
&ParseCcAddressesFromHead
&ParseSenderAddressFromHead
- &ParseErrorsToAddressFromHead
- &ParseAddressFromHeader
- &Gateway);
+ &ParseErrorsToAddressFromHead
+ &ParseAddressFromHeader
+
+ &debug);
}
=head1 NAME
@@ -64,13 +47,28 @@ BEGIN {
use lib "!!RT_LIB_PATH!!";
use lib "!!RT_ETC_PATH!!";
- use RT::Interface::Email qw(Gateway CreateUser);
+ use RT::Interface::Email qw(CleanEnv LoadConfig DBConnect
+ );
+
+ #Clean out all the nasties from the environment
+ CleanEnv();
+
+ #Load etc/config.pm and drop privs
+ LoadConfig();
+
+ #Connect to the database and get RT::SystemUser and RT::Nobody loaded
+ DBConnect();
+
+
+ #Get the current user all loaded
+ my $CurrentUser = GetCurrentUser();
=head1 DESCRIPTION
=begin testing
+ok(require RT::TestHarness);
ok(require RT::Interface::Email);
=end testing
@@ -81,6 +79,71 @@ ok(require RT::Interface::Email);
=cut
+=head2 CleanEnv
+
+Removes some of the nastiest nasties from the user\'s environment.
+
+=cut
+
+sub CleanEnv {
+ $ENV{'PATH'} = '/bin:/usr/bin'; # or whatever you need
+ $ENV{'CDPATH'} = '' if defined $ENV{'CDPATH'};
+ $ENV{'SHELL'} = '/bin/sh' if defined $ENV{'SHELL'};
+ $ENV{'ENV'} = '' if defined $ENV{'ENV'};
+ $ENV{'IFS'} = '' if defined $ENV{'IFS'};
+}
+
+
+
+=head2 LoadConfig
+
+Loads RT's config file and then drops setgid privileges.
+
+=cut
+
+sub LoadConfig {
+
+ #This drags in RT's config.pm
+ use config;
+
+}
+
+
+
+=head2 DBConnect
+
+ Calls RT::Init, which creates a database connection and then creates $RT::Nobody
+ and $RT::SystemUser
+
+=cut
+
+
+sub DBConnect {
+ use RT;
+ RT::Init();
+}
+
+
+
+# {{{ sub debug
+
+sub debug {
+ my $val = shift;
+ my ($debug);
+ if ($val) {
+ $RT::Logger->debug($val."\n");
+ if ($debug) {
+ print STDERR "$val\n";
+ }
+ }
+ if ($debug) {
+ return(1);
+ }
+}
+
+# }}}
+
+
# {{{ sub CheckForLoops
sub CheckForLoops {
@@ -144,6 +207,82 @@ sub CheckForAutoGenerated {
# }}}
+# {{{ sub ParseMIMEEntityFromSTDIN
+
+sub ParseMIMEEntityFromSTDIN {
+
+ # Create a new parser object:
+
+ my $parser = new MIME::Parser;
+
+ # {{{ Config $parser to store large attacments in temp dir
+
+ ## TODO: Does it make sense storing to disk at all? After all, we
+ ## need to put each msg as an in-core scalar before saving it to
+ ## the database, don't we?
+
+ ## At the same time, we should make sure that we nuke attachments
+ ## Over max size and return them
+
+ ## TODO: Remove the temp dir when we don't need it any more.
+
+ my $AttachmentDir = File::Temp::tempdir (TMPDIR => 1, CLEANUP => 1);
+
+ # Set up output directory for files:
+ $parser->output_dir("$AttachmentDir");
+
+ #If someone includes a message, don't extract it
+ $parser->extract_nested_messages(0);
+
+
+ # Set up the prefix for files with auto-generated names:
+ $parser->output_prefix("part");
+
+ # If content length is <= 20000 bytes, store each msg as in-core scalar;
+ # Else, write to a disk file (the default action):
+
+ $parser->output_to_core(20000);
+
+ # }}} (temporary directory)
+
+ #Ok. now that we're set up, let's get the stdin.
+ my $entity;
+ unless ($entity = $parser->read(\*STDIN)) {
+ die "couldn't parse MIME stream";
+ }
+ #Now we've got a parsed mime object.
+
+ # Get the head, a MIME::Head:
+ my $head = $entity->head;
+
+
+ # Unfold headers that are have embedded newlines
+ $head->unfold;
+
+ # TODO - information about the charset is lost here!
+ $head->decode;
+
+ return ($entity, $head);
+
+}
+# }}}
+
+# {{{ sub ParseTicketId
+
+sub ParseTicketId {
+ my $Subject = shift;
+ my ($Id);
+
+ if ($Subject =~ s/\[$RT::rtname \#(\d+)\]//i) {
+ $Id = $1;
+ $RT::Logger->debug("Found a ticket ID. It's $Id");
+ return($Id);
+ }
+ else {
+ return(undef);
+ }
+}
+# }}}
# {{{ sub MailError
sub MailError {
@@ -174,8 +313,8 @@ sub MailError {
if ($mimeobj) {
$mimeobj->sync_headers();
$entity->add_part($mimeobj);
- }
-
+ }
+
if ($RT::MailCommand eq 'sendmailpipe') {
open (MAIL, "|$RT::SendmailPath $RT::SendmailArguments") || return(0);
print MAIL $entity->as_string;
@@ -188,66 +327,144 @@ sub MailError {
# }}}
-# {{{ Create User
+# {{{ sub GetCurrentUser
+
+sub GetCurrentUser {
+ my $head = shift;
+ my $entity = shift;
+ my $ErrorsTo = shift;
-sub CreateUser {
- my ($Username, $Address, $Name, $ErrorsTo, $entity) = @_;
- my $NewUser = RT::User->new($RT::SystemUser);
+ my %UserInfo = ();
- # This data is tainted by some Very Broken mailers.
- # (Sometimes they send raw ISO 8859-1 data here. fear that.
- require Encode;
- $Username = Encode::encode(utf8 => $Username, Encode::FB_PERLQQ()) if defined $Username;
- $Name = Encode::encode(utf8 => $Name, Encode::FB_PERLQQ()) if defined $Name;
-
- my ($Val, $Message) =
- $NewUser->Create(Name => ($Username || $Address),
- EmailAddress => $Address,
- RealName => $Name,
- Password => undef,
- Privileged => 0,
- Comments => 'Autocreated on ticket submission'
- );
+ #Suck the address of the sender out of the header
+ my ($Address, $Name) = ParseSenderAddressFromHead($head);
- unless ($Val) {
-
- # Deal with the race condition of two account creations at once
- #
- if ($Username) {
- $NewUser->LoadByName($Username);
- }
-
- unless ($NewUser->Id) {
- $NewUser->LoadByEmail($Address);
- }
-
- unless ($NewUser->Id) {
- MailError( To => $ErrorsTo,
- Subject => "User could not be created",
- Explanation => "User creation failed in mailgateway: $Message",
- MIMEObj => $entity,
- LogLevel => 'crit'
- );
- }
+ #This will apply local address canonicalization rules
+ $Address = RT::CanonicalizeAddress($Address);
+
+ #If desired, synchronize with an external database
+
+ my $UserFoundInExternalDatabase = 0;
+
+ # Username is the 'Name' attribute of the user that RT uses for things
+ # like authentication
+ my $Username = undef;
+ if ($RT::LookupSenderInExternalDatabase) {
+ ($UserFoundInExternalDatabase, %UserInfo) =
+ RT::LookupExternalUserInfo($Address, $Name);
+
+ $Address = $UserInfo{'EmailAddress'};
+ $Username = $UserInfo{'Name'};
}
-
- #Load the new user object
+
my $CurrentUser = RT::CurrentUser->new();
- $CurrentUser->LoadByEmail($Address);
-
- unless ($CurrentUser->id) {
- $RT::Logger->warning("Couldn't load user '$Address'.". "giving up");
- MailError( To => $ErrorsTo,
- Subject => "User could not be loaded",
- Explanation => "User '$Address' could not be loaded in the mail gateway",
- MIMEObj => $entity,
- LogLevel => 'crit'
- );
- }
+
+ # First try looking up by a username, if we got one from the external
+ # db lookup. Next, try looking up by email address. Failing that,
+ # try looking up by users who have this user's email address as their
+ # username.
+
+ if ($Username) {
+ $CurrentUser->LoadByName($Username);
+ }
+
+ unless ($CurrentUser->Id) {
+ $CurrentUser->LoadByEmail($Address);
+ }
- return $CurrentUser;
+ #If we can't get it by email address, try by name.
+ unless ($CurrentUser->Id) {
+ $CurrentUser->LoadByName($Address);
+ }
+
+
+ unless ($CurrentUser->Id) {
+ #If we couldn't load a user, determine whether to create a user
+
+ # {{{ If we require an incoming address to be found in the external
+ # user database, reject the incoming message appropriately
+ if ( $RT::LookupSenderInExternalDatabase &&
+ $RT::SenderMustExistInExternalDatabase &&
+ !$UserFoundInExternalDatabase) {
+
+ my $Message = "Sender's email address was not found in the user database.";
+
+ # {{{ This code useful only if you've defined an AutoRejectRequest template
+
+ require RT::Template;
+ my $template = new RT::Template($RT::Nobody);
+ $template->Load('AutoRejectRequest');
+ $Message = $template->Content || $Message;
+
+ # }}}
+
+ MailError( To => $ErrorsTo,
+ Subject => "Ticket Creation failed: user could not be created",
+ Explanation => $Message,
+ MIMEObj => $entity,
+ LogLevel => 'notice'
+ );
+
+ return($CurrentUser);
+
+ }
+ # }}}
+
+ else {
+ my $NewUser = RT::User->new($RT::SystemUser);
+
+ my ($Val, $Message) =
+ $NewUser->Create(Name => ($Username || $Address),
+ EmailAddress => $Address,
+ RealName => "$Name",
+ Password => undef,
+ Privileged => 0,
+ Comments => 'Autocreated on ticket submission'
+ );
+
+ unless ($Val) {
+
+ # Deal with the race condition of two account creations at once
+ #
+ if ($Username) {
+ $NewUser->LoadByName($Username);
+ }
+
+ unless ($NewUser->Id) {
+ $NewUser->LoadByEmail($Address);
+ }
+
+ unless ($NewUser->Id) {
+ MailError( To => $ErrorsTo,
+ Subject => "User could not be created",
+ Explanation => "User creation failed in mailgateway: $Message",
+ MIMEObj => $entity,
+ LogLevel => 'crit'
+ );
+ }
+ }
+ }
+
+ #Load the new user object
+ $CurrentUser->LoadByEmail($Address);
+
+ unless ($CurrentUser->id) {
+ $RT::Logger->warning("Couldn't load user '$Address'.". "giving up");
+ MailError( To => $ErrorsTo,
+ Subject => "User could not be loaded",
+ Explanation => "User '$Address' could not be loaded in the mail gateway",
+ MIMEObj => $entity,
+ LogLevel => 'crit'
+ );
+
+ }
+ }
+
+ return ($CurrentUser);
+
}
-# }}}
+# }}}
+
# {{{ ParseCcAddressesFromHead
=head2 ParseCcAddressesFromHead HASHREF
@@ -272,11 +489,11 @@ sub ParseCcAddressesFromHead {
foreach my $AddrObj (@ToObjs, @CcObjs) {
my $Address = $AddrObj->address;
- $Address = $args{'CurrentUser'}->UserObj->CanonicalizeEmailAddress($Address);
+ $Address = RT::CanonicalizeAddress($Address);
next if ($args{'CurrentUser'}->EmailAddress =~ /^$Address$/i);
next if ($args{'QueueObj'}->CorrespondAddress =~ /^$Address$/i);
next if ($args{'QueueObj'}->CommentAddress =~ /^$Address$/i);
- next if (RT::EmailParser::IsRTAddress(undef, $Address));
+ next if (RT::IsRTAddress($Address));
push (@Addresses, $Address);
}
@@ -351,7 +568,8 @@ sub ParseAddressFromHeader{
}
my $Name = ($AddrObj->phrase || $AddrObj->comment || $AddrObj->address);
-
+
+
#Lets take the from and load a user object.
my $Address = $AddrObj->address;
@@ -360,289 +578,4 @@ sub ParseAddressFromHeader{
# }}}
-
-=head2 Gateway
-
-This performs all the "guts" of the mail rt-mailgate program, and is
-designed to be called from the web interface with a message, user
-object, and so on.
-
-=cut
-
-sub Gateway {
- my %args = ( message => undef,
- queue => 1,
- action => 'correspond',
- ticket => undef,
- @_ );
-
- # Validate the action
- unless ( $args{'action'} =~ /^(comment|correspond|action)$/ ) {
-
- # Can't safely loc this. What object do we loc around?
- return ( 0, "Invalid 'action' parameter", undef );
- }
-
- my $parser = RT::EmailParser->new();
- $parser->ParseMIMEEntityFromScalar( $args{'message'} );
-
- my $Message = $parser->Entity();
- my $head = $Message->head;
-
- my ( $CurrentUser, $AuthStat, $status, $error );
-
- my $ErrorsTo = ParseErrorsToAddressFromHead($head);
-
- my $MessageId = $head->get('Message-Id')
- || "<no-message-id-" . time . rand(2000) . "\@.$RT::Organization>";
-
- #Pull apart the subject line
- my $Subject = $head->get('Subject') || '';
- chomp $Subject;
-
-
- $args{'ticket'} ||= $parser->ParseTicketId($Subject);
-
- my $SystemTicket;
- if ($args{'ticket'} ) {
- $SystemTicket = RT::Ticket->new($RT::SystemUser);
- $SystemTicket->Load($args{'ticket'});
- }
-
- #Set up a queue object
- my $SystemQueueObj = RT::Queue->new($RT::SystemUser);
- $SystemQueueObj->Load( $args{'queue'} );
-
-
- # We can safely have no queue of we have a known-good ticket
- unless ( $args{'ticket'} || $SystemQueueObj->id ) {
- MailError(
- To => $RT::OwnerEmail,
- Subject => "RT Bounce: $Subject",
- Explanation => "RT couldn't find the queue: " . $args{'queue'},
- MIMEObj => $Message );
- return ( 0, "RT couldn't find the queue: " . $args{'queue'}, undef );
- }
-
- # Authentication Level
- # -1 - Get out. this user has been explicitly declined
- # 0 - User may not do anything (Not used at the moment)
- # 1 - Normal user
- # 2 - User is allowed to specify status updates etc. a la enhanced-mailgate
-
- push @RT::MailPlugins, "Auth::MailFrom" unless @RT::MailPlugins;
- # Since this needs loading, no matter what
-
- for (@RT::MailPlugins) {
- my $Code;
- my $NewAuthStat;
- if ( ref($_) eq "CODE" ) {
- $Code = $_;
- }
- else {
- $_ = "RT::Interface::Email::$_" unless /^RT::Interface::Email::/;
- eval "require $_;";
- if ($@) {
- die ("Couldn't load module $_: $@");
- next;
- }
- no strict 'refs';
- if ( !defined( $Code = *{ $_ . "::GetCurrentUser" }{CODE} ) ) {
- die ("No GetCurrentUser code found in $_ module");
- next;
- }
- }
-
- ( $CurrentUser, $NewAuthStat ) = $Code->( Message => $Message,
- CurrentUser => $CurrentUser,
- AuthLevel => $AuthStat,
- Action => $args{'action'},
- Ticket => $SystemTicket,
- Queue => $SystemQueueObj );
-
- # You get the highest level of authentication you were assigned.
- last if $AuthStat == -1;
- $AuthStat = $NewAuthStat if $NewAuthStat > $AuthStat;
- }
-
- # {{{ If authentication fails and no new user was created, get out.
- if ( !$CurrentUser or !$CurrentUser->Id or $AuthStat == -1 ) {
-
- # If the plugins refused to create one, they lose.
- MailError(
- Subject => "Could not load a valid user",
- Explanation => <<EOT,
-RT could not load a valid user, and RT's configuration does not allow
-for the creation of a new user for your email.
-
-Your RT administrator needs to grant 'Everyone' the right 'CreateTicket'
-for this queue.
-
-EOT
- MIMEObj => $Message,
- LogLevel => 'error' )
- unless $AuthStat == -1;
- return ( 0, "Could not load a valid user", undef );
- }
-
- # }}}
-
- # {{{ Lets check for mail loops of various sorts.
- my $IsAutoGenerated = CheckForAutoGenerated($head);
-
- my $IsSuspiciousSender = CheckForSuspiciousSender($head);
-
- my $IsALoop = CheckForLoops($head);
-
- my $SquelchReplies = 0;
-
- #If the message is autogenerated, we need to know, so we can not
- # send mail to the sender
- if ( $IsSuspiciousSender || $IsAutoGenerated || $IsALoop ) {
- $SquelchReplies = 1;
- $ErrorsTo = $RT::OwnerEmail;
- }
-
- # }}}
-
- # {{{ Drop it if it's disallowed
- if ( $AuthStat == 0 ) {
- MailError(
- To => $ErrorsTo,
- Subject => "Permission Denied",
- Explanation => "You do not have permission to communicate with RT",
- MIMEObj => $Message );
- }
-
- # }}}
- # {{{ Warn someone if it's a loop
-
- # Warn someone if it's a loop, before we drop it on the ground
- if ($IsALoop) {
- $RT::Logger->crit("RT Recieved mail ($MessageId) from itself.");
-
- #Should we mail it to RTOwner?
- if ($RT::LoopsToRTOwner) {
- MailError( To => $RT::OwnerEmail,
- Subject => "RT Bounce: $Subject",
- Explanation => "RT thinks this message may be a bounce",
- MIMEObj => $Message );
-
- #Do we actually want to store it?
- return ( 0, "Message Bounced", undef ) unless ($RT::StoreLoops);
- }
- }
-
- # }}}
-
- # {{{ Squelch replies if necessary
- # Don't let the user stuff the RT-Squelch-Replies-To header.
- if ( $head->get('RT-Squelch-Replies-To') ) {
- $head->add( 'RT-Relocated-Squelch-Replies-To',
- $head->get('RT-Squelch-Replies-To') );
- $head->delete('RT-Squelch-Replies-To');
- }
-
- if ($SquelchReplies) {
- ## TODO: This is a hack. It should be some other way to
- ## indicate that the transaction should be "silent".
-
- my ( $Sender, $junk ) = ParseSenderAddressFromHead($head);
- $head->add( 'RT-Squelch-Replies-To', $Sender );
- }
-
- # }}}
-
- my $Ticket = RT::Ticket->new($CurrentUser);
-
- # {{{ If we don't have a ticket Id, we're creating a new ticket
- if ( !$args{'ticket'} ) {
-
- # {{{ Create a new ticket
-
- my @Cc;
- my @Requestors = ( $CurrentUser->id );
-
- if ($RT::ParseNewMessageForTicketCcs) {
- @Cc = ParseCcAddressesFromHead( Head => $head,
- CurrentUser => $CurrentUser,
- QueueObj => $SystemQueueObj );
- }
-
- my ( $id, $Transaction, $ErrStr ) = $Ticket->Create(
- Queue => $SystemQueueObj->Id,
- Subject => $Subject,
- Requestor => \@Requestors,
- Cc => \@Cc,
- MIMEObj => $Message );
- if ( $id == 0 ) {
- MailError( To => $ErrorsTo,
- Subject => "Ticket creation failed",
- Explanation => $ErrStr,
- MIMEObj => $Message );
- $RT::Logger->error("Create failed: $id / $Transaction / $ErrStr ");
- return ( 0, "Ticket creation failed", $Ticket );
- }
-
- # }}}
- }
-
- # }}}
-
- # If the action is comment, add a comment.
- elsif ( $args{'action'} =~ /^(comment|correspond)$/i ) {
- $Ticket->Load($args{'ticket'});
- unless ( $Ticket->Id ) {
- my $message = "Could not find a ticket with id ".$args{'ticket'};
- MailError( To => $ErrorsTo,
- Subject => "Message not recorded",
- Explanation => $message,
- MIMEObj => $Message );
-
- return ( 0, $message);
- }
-
- my ( $status, $msg );
- if ( $args{'action'} =~ /^correspond$/ ) {
- ( $status, $msg ) = $Ticket->Correspond( MIMEObj => $Message );
- }
- else {
- ( $status, $msg ) = $Ticket->Comment( MIMEObj => $Message );
- }
- unless ($status) {
-
- #Warn the sender that we couldn't actually submit the comment.
- MailError( To => $ErrorsTo,
- Subject => "Message not recorded",
- Explanation => $msg,
- MIMEObj => $Message );
- return ( 0, "Message not recorded", $Ticket );
- }
- }
-
- else {
-
- #Return mail to the sender with an error
- MailError( To => $ErrorsTo,
- Subject => "RT Configuration error",
- Explanation => "'"
- . $args{'action'}
- . "' not a recognized action."
- . " Your RT administrator has misconfigured "
- . "the mail aliases which invoke RT",
- MIMEObj => $Message );
- $RT::Logger->crit( $args{'action'} . " type unknown for $MessageId" );
- return ( 0, "Configuration error: " . $args{'action'} . " not a recognized action", $Ticket );
-
- }
-
-
-return ( 1, "Success", $Ticket );
-}
-
-eval "require RT::Interface::Email_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email_Vendor.pm});
-eval "require RT::Interface::Email_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email_Local.pm});
-
1;
diff --git a/rt/lib/RT/Interface/Web.pm b/rt/lib/RT/Interface/Web.pm
index 5097f54a4..6b5272848 100644
--- a/rt/lib/RT/Interface/Web.pm
+++ b/rt/lib/RT/Interface/Web.pm
@@ -1,214 +1,129 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+## $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Interface/Web.pm,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
## Portions Copyright 2000 Tobias Brox <tobix@fsck.com>
+## Copyright 1996-2002 Jesse Vincent <jesse@bestpractical.com>
## This is a library of static subs to be used by the Mason web
## interface to RT
-
-=head1 NAME
-
-RT::Interface::Web
-
-=begin testing
-
-use_ok(RT::Interface::Web);
-
-=end testing
-
-=cut
-
-
package RT::Interface::Web;
-use strict;
+# {{{ sub NewParser
+=head2 NewParser
-
-
-# {{{ sub NewApacheHandler
-
-=head2 NewApacheHandler
-
- Takes extra options to pass to HTML::Mason::ApacheHandler->new
- Returns a new Mason::ApacheHandler object
+ Returns a new Mason::Parser object. Takes a param hash of things
+ that get passed to HTML::Mason::Parser. Currently hard coded to only
+ take the parameter 'allow_globals'.
=cut
-sub NewApacheHandler {
- require HTML::Mason::ApacheHandler;
- my $ah = new HTML::Mason::ApacheHandler(
-
- comp_root => [
- [ local => $RT::MasonLocalComponentRoot ],
- [ standard => $RT::MasonComponentRoot ]
- ],
- args_method => "CGI",
- default_escape_flags => 'h',
- allow_globals => [qw(%session)],
- data_dir => "$RT::MasonDataDir",
+sub NewParser {
+ my %args = (
+ allow_globals => undef,
@_
);
- $ah->interp->set_escape( h => \&RT::Interface::Web::EscapeUTF8 );
-
- return ($ah);
+ my $parser = new HTML::Mason::Parser(
+ default_escape_flags => 'h',
+ allow_globals => $args{'allow_globals'}
+ );
+ return ($parser);
}
# }}}
-# {{{ sub NewCGIHandler
+# {{{ sub NewInterp
-=head2 NewCGIHandler
+=head2 NewInterp
- Returns a new Mason::CGIHandler object
+ Takes a paremeter hash. Needs a param called 'parser' which is a reference
+ to an HTML::Mason::Parser.
+ returns a new Mason::Interp object
=cut
-sub NewCGIHandler {
- my %args = (
- @_
- );
-
- my $handler = HTML::Mason::CGIHandler->new(
+sub NewInterp {
+ my %params = (
comp_root => [
[ local => $RT::MasonLocalComponentRoot ],
[ standard => $RT::MasonComponentRoot ]
],
data_dir => "$RT::MasonDataDir",
- default_escape_flags => 'h',
- allow_globals => [qw(%session)]
+ @_
);
-
-
- $handler->interp->set_escape( h => \&RT::Interface::Web::EscapeUTF8 );
+ #We allow recursive autohandlers to allow for RT auth.
- return ($handler);
+ use HTML::Mason::Interp;
+ my $interp = new HTML::Mason::Interp(%params);
}
-# }}}
+# }}}
-# {{{ EscapeUTF8
+# {{{ sub NewApacheHandler
-=head2 EscapeUTF8 SCALARREF
+=head2 NewApacheHandler
-does a css-busting but minimalist escaping of whatever html you're passing in.
+ Takes a Mason::Interp object
+ Returns a new Mason::ApacheHandler object
=cut
-sub EscapeUTF8 {
- my $ref = shift;
- my $val = $$ref;
- use bytes;
- $val =~ s/&/&#38;/g;
- $val =~ s/</&lt;/g;
- $val =~ s/>/&gt;/g;
- $val =~ s/\(/&#40;/g;
- $val =~ s/\)/&#41;/g;
- $val =~ s/"/&#34;/g;
- $val =~ s/'/&#39;/g;
- $$ref = $val;
- Encode::_utf8_on($$ref);
-
+sub NewApacheHandler {
+ my $interp = shift;
+ my $ah = new HTML::Mason::ApacheHandler( interp => $interp );
+ return ($ah);
}
# }}}
-package HTML::Mason::Commands;
-use strict;
-use vars qw/$r $m %session/;
-
-
-# {{{ loc
+# {{{ sub NewMason11ApacheHandler
-=head2 loc ARRAY
+=head2 NewMason11ApacheHandler
-loc is a nice clean global routine which calls $session{'CurrentUser'}->loc()
-with whatever it's called with. If there is no $session{'CurrentUser'},
-it creates a temporary user, so we have something to get a localisation handle
-through
+ Returns a new Mason::ApacheHandler object
=cut
-sub loc {
-
- if ($session{'CurrentUser'} &&
- UNIVERSAL::can($session{'CurrentUser'}, 'loc')){
- return($session{'CurrentUser'}->loc(@_));
- }
- else {
- my $u = RT::CurrentUser->new($RT::SystemUser);
- return ($u->loc(@_));
- }
+sub NewMason11ApacheHandler {
+ my %args = ( default_escape_flags => 'h',
+ allow_globals => [%session],
+ comp_root => [
+ [ local => $RT::MasonLocalComponentRoot ],
+ [ standard => $RT::MasonComponentRoot ]
+ ],
+ data_dir => "$RT::MasonDataDir",
+ args_method => 'CGI'
+ );
+ my $ah = new HTML::Mason::ApacheHandler(%args);
+ return ($ah);
}
# }}}
-# {{{ loc_fuzzy
-
-=head2 loc_fuzzy STRING
-loc_fuzzy is for handling localizations of messages that may already
-contain interpolated variables, typically returned from libraries
-outside RT's control. It takes the message string and extracts the
-variable array automatically by matching against the candidate entries
-inside the lexicon file.
-
-=cut
-sub loc_fuzzy {
- my $msg = shift;
-
- if ($session{'CurrentUser'} &&
- UNIVERSAL::can($session{'CurrentUser'}, 'loc')){
- return($session{'CurrentUser'}->loc_fuzzy($msg));
- }
- else {
- my $u = RT::CurrentUser->new($RT::SystemUser);
- return ($u->loc_fuzzy($msg));
- }
-}
# }}}
+package HTML::Mason::Commands;
# {{{ sub Abort
# Error - calls Error and aborts
sub Abort {
- if ($session{'ErrorDocument'} &&
- $session{'ErrorDocumentType'}) {
- $r->content_type($session{'ErrorDocumentType'});
- $m->comp($session{'ErrorDocument'} , Why => shift);
+ if ( $session{'ErrorDocument'} && $session{'ErrorDocumentType'} ) {
+ SetContentType( $session{'ErrorDocumentType'} );
+ $m->comp( $session{'ErrorDocument'}, Why => shift );
$m->abort;
- }
- else {
- $m->comp("/Elements/Error" , Why => shift);
+ }
+ else {
+ SetContentType('text/html');
+ $m->comp( "/Elements/Error", Why => shift );
$m->abort;
}
}
@@ -220,7 +135,6 @@ sub Abort {
=head2 CreateTicket ARGS
Create a new ticket, using Mason's %ARGS. returns @results.
-
=cut
sub CreateTicket {
@@ -244,45 +158,38 @@ sub CreateTicket {
my $starts = new RT::Date( $session{'CurrentUser'} );
$starts->Set( Format => 'unknown', Value => $ARGS{'Starts'} );
- my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} );
- my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} );
- my @AdminCc = split ( /\s*,\s*/, $ARGS{'AdminCc'} );
+ my @Requestors = split ( /,/, $ARGS{'Requestors'} );
+ my @Cc = split ( /,/, $ARGS{'Cc'} );
+ my @AdminCc = split ( /,/, $ARGS{'AdminCc'} );
my $MIMEObj = MakeMIMEEntity(
Subject => $ARGS{'Subject'},
From => $ARGS{'From'},
Cc => $ARGS{'Cc'},
Body => $ARGS{'Content'},
+ AttachmentFieldName => 'Attach'
);
- if ($ARGS{'Attachments'}) {
- $MIMEObj->make_multipart;
- $MIMEObj->add_part($_) foreach values %{$ARGS{'Attachments'}};
- }
-
my %create_args = (
- Queue => $ARGS{'Queue'},
- Owner => $ARGS{'Owner'},
- InitialPriority => $ARGS{'InitialPriority'},
- FinalPriority => $ARGS{'FinalPriority'},
- TimeLeft => $ARGS{'TimeLeft'},
- TimeEstimated => $ARGS{'TimeEstimated'},
- TimeWorked => $ARGS{'TimeWorked'},
+ Queue => $ARGS{Queue},
+ Owner => $ARGS{Owner},
+ InitialPriority => $ARGS{InitialPriority},
+ FinalPriority => $ARGS{FinalPriority},
+ TimeLeft => $ARGS{TimeLeft},
+ TimeWorked => $ARGS{TimeWorked},
Requestor => \@Requestors,
Cc => \@Cc,
AdminCc => \@AdminCc,
- Subject => $ARGS{'Subject'},
- Status => $ARGS{'Status'},
+ Subject => $ARGS{Subject},
+ Status => $ARGS{Status},
Due => $due->ISO,
Starts => $starts->ISO,
MIMEObj => $MIMEObj
);
- foreach my $arg (%ARGS) {
- if ($arg =~ /^CustomField-(\d+)(.*?)$/) {
- next if ($arg =~ /-Magic$/);
- $create_args{"CustomField-".$1} = $ARGS{"$arg"};
- }
- }
+
+ # we need to get any KeywordSelect-<integer> fields into %create_args..
+ grep { $_ =~ /^KeywordSelect-/ &&{ $create_args{$_} = $ARGS{$_} } } %ARGS;
+
my ( $id, $Trans, $ErrMsg ) = $Ticket->Create(%create_args);
unless ( $id && $Trans ) {
Abort($ErrMsg);
@@ -309,7 +216,7 @@ sub CreateTicket {
}
}
- push ( @Actions, split("\n", $ErrMsg) );
+ push ( @Actions, $ErrMsg );
unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
Abort( "No permission to view newly created ticket #"
. $Ticket->id . "." );
@@ -376,38 +283,80 @@ sub ProcessUpdateMessage {
my $Message = MakeMIMEEntity(
Subject => $args{ARGSRef}->{'UpdateSubject'},
Body => $args{ARGSRef}->{'UpdateContent'},
+ AttachmentFieldName => 'UpdateAttachment'
);
- if ($args{ARGSRef}->{'UpdateAttachments'}) {
- $Message->make_multipart;
- $Message->add_part($_) foreach values %{$args{ARGSRef}->{'UpdateAttachments'}};
- }
-
- ## TODO: Implement public comments
- if ( $args{ARGSRef}->{'UpdateType'} =~ /^(private|public)$/ ) {
- my ( $Transaction, $Description ) = $args{TicketObj}->Comment(
- CcMessageTo => $args{ARGSRef}->{'UpdateCc'},
- BccMessageTo => $args{ARGSRef}->{'UpdateBcc'},
- MIMEObj => $Message,
- TimeTaken => $args{ARGSRef}->{'UpdateTimeWorked'}
- );
- push ( @{ $args{Actions} }, $Description );
- }
- elsif ( $args{ARGSRef}->{'UpdateType'} eq 'response' ) {
- my ( $Transaction, $Description ) = $args{TicketObj}->Correspond(
- CcMessageTo => $args{ARGSRef}->{'UpdateCc'},
- BccMessageTo => $args{ARGSRef}->{'UpdateBcc'},
- MIMEObj => $Message,
- TimeTaken => $args{ARGSRef}->{'UpdateTimeWorked'}
- );
- push ( @{ $args{Actions} }, $Description );
- }
+ ## Check whether this was a refresh or not.
+
+ # Match Correspondence or Comments.
+ my $trans_flag = -2;
+ my $trans_type = undef;
+ my $orig_trans = $args{ARGSRef}->{'UpdateType'};
+ if ( $orig_trans =~ /^(private|public)$/ ) {
+ $trans_type = "Comment";
+ }elsif ( $orig_trans eq 'response' ) {
+ $trans_type = "Correspond";
+ }
+
+ # Do we have a transaction that we need to update on? session
+ if( defined( $trans_type ) ){
+ $trans_flag = 0;
+
+ # Prepare a checksum.
+ # See perldoc -f unpack for example of this.
+ my $this_checksum = unpack("%32C*", $Message->body_as_string ) % 65535;
+
+ # The above *could* generate duplicate checksums. Crosscheck with
+ # the length.
+ my $this_length = length( $Message->body_as_string );
+
+ # Don't forget the ticket id.
+ my $this_id = $args{TicketObj}->id;
+
+ # Check whether the previous transaction in the
+ # ticket is the same as the current transaction.
+ if( defined( $session{'prev_trans_type'} ) && defined( $session{'prev_trans_chksum'} ) && defined( $session{'prev_trans_length'} ) && defined( $session{'prev_trans_tickid'} ) ){
+ if( $session{'prev_trans_type'} eq $orig_trans && $session{'prev_trans_chksum'} == $this_checksum && $session{'prev_trans_length'} == $this_length && $session{'prev_trans_tickid'} == $this_id ){
+ # Its the same as the previous transaction for this user.
+ $trans_flag = -1;
+ }
+ }
+
+ # Store them for next time.
+ $session{'prev_trans_type'} = $orig_trans;
+ $session{'prev_trans_chksum'} = $this_checksum;
+ $session{'prev_trans_length'} = $this_length;
+ $session{'prev_trans_tickid'} = $this_id;
+
+ if( $trans_flag == -1 ){
+ push ( @{ $args{'Actions'} },
+"This appears to be a duplicate of your previous update (please do not refresh this page)" );
+ }
+
+
+ if ( $trans_type eq 'Comment' && $trans_flag >= 0 ) {
+ my ( $Transaction, $Description ) = $args{TicketObj}->Comment(
+ CcMessageTo => $args{ARGSRef}->{'UpdateCc'},
+ BccMessageTo => $args{ARGSRef}->{'UpdateBcc'},
+ MIMEObj => $Message,
+ TimeTaken => $args{ARGSRef}->{'UpdateTimeWorked'}
+ );
+ push ( @{ $args{Actions} }, $Description );
+ }
+ elsif ( $trans_type eq 'Correspond' && $trans_flag >= 0 ) {
+ my ( $Transaction, $Description ) = $args{TicketObj}->Correspond(
+ CcMessageTo => $args{ARGSRef}->{'UpdateCc'},
+ BccMessageTo => $args{ARGSRef}->{'UpdateBcc'},
+ MIMEObj => $Message,
+ TimeTaken => $args{ARGSRef}->{'UpdateTimeWorked'}
+ );
+ push ( @{ $args{Actions} }, $Description );
+ }
+ }
else {
push ( @{ $args{'Actions'} },
- loc("Update type was neither correspondence nor comment.").
- " ".
- loc("Update not recorded.")
- );
+ "Update type was neither correspondence nor comment. Update not recorded"
+ );
}
}
}
@@ -433,66 +382,61 @@ sub MakeMIMEEntity {
Cc => undef,
Body => undef,
AttachmentFieldName => undef,
- map Encode::encode_utf8($_), @_,
+ @_
);
#Make the update content have no 'weird' newlines in it
$args{'Body'} =~ s/\r\n/\n/gs;
- my $Message;
- {
- # MIME::Head is not happy in utf-8 domain. This only happens
- # when processing an incoming email (so far observed).
- no utf8;
- use bytes;
- $Message = MIME::Entity->build(
- Subject => $args{'Subject'} || "",
- From => $args{'From'},
- Cc => $args{'Cc'},
- Data => [ $args{'Body'} ]
- );
- }
-
- my $cgi_object = $m->cgi_object;
+ my $Message = MIME::Entity->build(
+ Subject => $args{'Subject'} || "",
+ From => $args{'From'},
+ Cc => $args{'Cc'},
+ Data => [ $args{'Body'} ]
+ );
- if (my $filehandle = $cgi_object->upload( $args{'AttachmentFieldName'} ) ) {
+ my $cgi_object = CGIObject();
+ if ( $cgi_object->param( $args{'AttachmentFieldName'} ) ) {
+ my $cgi_filehandle =
+ $cgi_object->upload( $args{'AttachmentFieldName'} );
+ use File::Temp qw(tempfile tempdir);
- use File::Temp qw(tempfile tempdir);
+ #foreach my $filehandle (@filenames) {
- #foreach my $filehandle (@filenames) {
+ # my ( $fh, $temp_file ) = tempfile();
- my ( $fh, $temp_file ) = tempfile();
+ #$binmode $fh; #thank you, windows
- binmode $fh; #thank you, windows
- my ($buffer);
- while ( my $bytesread = read( $filehandle, $buffer, 4096 ) ) {
- print $fh $buffer;
- }
+ # We're having trouble with tempfiles not getting created. Let's try it with
+ # a scalar instead
- my $uploadinfo = $cgi_object->uploadInfo($filehandle);
+ my ( $buffer, @file );
- # Prefer the cached name first over CGI.pm stringification.
- my $filename = $RT::Mason::CGI::Filename;
- $filename = "$filehandle" unless defined($filename);
-
- $filename =~ s#^.*[\\/]##;
+ while ( my $bytesread = read( $cgi_filehandle, $buffer, 4096 ) ) {
+ push ( @file, $buffer );
+ }
- $Message->attach(
- Path => $temp_file,
- Filename => $filename,
- Type => $uploadinfo->{'Content-Type'},
- );
- close($fh);
+ $RT::Logger->debug($file);
+ my $filename = "$cgi_filehandle";
+ $filename =~ s#^(.*)/##;
+ $filename =~ s#^(.*)\\##;
+ my $uploadinfo = $cgi_object->uploadInfo($cgi_filehandle);
+ $Message->attach(
+ Data => \@file,
+
+ #Path => $temp_file,
+ Filename => $filename,
+ Type => $uploadinfo->{'Content-Type'}
+ );
- # }
+ #close($fh);
+ #unlink($temp_file);
+ # }
}
-
$Message->make_singlepart();
- RT::I18N::SetMIMEEntityToUTF8($Message); # convert text parts into utf-8
-
return ($Message);
}
@@ -541,9 +485,6 @@ sub ProcessSearchQuery {
elsif ( $args{ARGS}->{'GotoPage'} eq 'Prev' ) {
$session{'tickets'}->PrevPage;
}
- elsif ( $args{ARGS}->{'GotoPage'} > 0 ) {
- $session{'tickets'}->GotoPage( $args{ARGS}->{GotoPage} - 1 );
- }
# }}}
@@ -635,12 +576,8 @@ sub ProcessSearchQuery {
# }}}
# {{{ Limit Subject
if ( $args{ARGS}->{'ValueOfSubject'} ne '' ) {
- my $val = $args{ARGS}->{'ValueOfSubject'};
- if ($args{ARGS}->{'SubjectOp'} =~ /like/) {
- $val = "%".$val."%";
- }
$session{'tickets'}->LimitSubject(
- VALUE => $val,
+ VALUE => $args{ARGS}->{'ValueOfSubject'},
OPERATOR => $args{ARGS}->{'SubjectOp'},
);
}
@@ -648,59 +585,40 @@ sub ProcessSearchQuery {
# }}}
# {{{ Limit Dates
if ( $args{ARGS}->{'ValueOfDate'} ne '' ) {
+
my $date = ParseDateToISO( $args{ARGS}->{'ValueOfDate'} );
$args{ARGS}->{'DateType'} =~ s/_Date$//;
- if ( $args{ARGS}->{'DateType'} eq 'Updated' ) {
- $session{'tickets'}->LimitTransactionDate(
- VALUE => $date,
- OPERATOR => $args{ARGS}->{'DateOp'},
- );
- }
- else {
- $session{'tickets'}->LimitDate( FIELD => $args{ARGS}->{'DateType'},
- VALUE => $date,
- OPERATOR => $args{ARGS}->{'DateOp'},
- );
- }
+ $session{'tickets'}->LimitDate(
+ FIELD => $args{ARGS}->{'DateType'},
+ VALUE => $date,
+ OPERATOR => $args{ARGS}->{'DateOp'},
+ );
}
# }}}
# {{{ Limit Content
- if ( $args{ARGS}->{'ValueOfAttachmentField'} ne '' ) {
- my $val = $args{ARGS}->{'ValueOfAttachmentField'};
- if ($args{ARGS}->{'AttachmentFieldOp'} =~ /like/) {
- $val = "%".$val."%";
- }
- $session{'tickets'}->Limit(
- FIELD => $args{ARGS}->{'AttachmentField'},
- VALUE => $val,
- OPERATOR => $args{ARGS}->{'AttachmentFieldOp'},
+ if ( $args{ARGS}->{'ValueOfContent'} ne '' ) {
+ $session{'tickets'}->LimitContent(
+ VALUE => $args{ARGS}->{'ValueOfContent'},
+ OPERATOR => $args{ARGS}->{'ContentOp'},
);
}
# }}}
+ # {{{ Limit KeywordSelects
- # {{{ Limit CustomFields
-
- foreach my $arg ( keys %{ $args{ARGS} } ) {
- my $id;
- if ( $arg =~ /^CustomField(\d+)$/ ) {
- $id = $1;
- }
- else {
- next;
- }
- next unless ( $args{ARGS}->{$arg} );
-
- my $form = $args{ARGS}->{$arg};
- my $oper = $args{ARGS}->{ "CustomFieldOp" . $id };
- foreach my $value ( ref($form) ? @{$form} : ($form) ) {
+ foreach my $KeywordSelectId (
+ map { /^KeywordSelect(\d+)$/; $1 }
+ grep { /^KeywordSelect(\d+)$/; } keys %{ $args{ARGS} }
+ )
+ {
+ my $form = $args{ARGS}->{"KeywordSelect$KeywordSelectId"};
+ my $oper = $args{ARGS}->{"KeywordSelectOp$KeywordSelectId"};
+ foreach my $KeywordId ( ref($form) ? @{$form} : ($form) ) {
+ next unless ($KeywordId);
my $quote = 1;
- if ($oper =~ /like/i) {
- $value = "%".$value."%";
- }
- if ( $value =~ /^null$/i ) {
+ if ( $KeywordId =~ /^null$/i ) {
#Don't quote the string 'null'
$quote = 0;
@@ -709,16 +627,17 @@ sub ProcessSearchQuery {
$oper = 'IS' if ( $oper eq '=' );
$oper = 'IS NOT' if ( $oper eq '!=' );
}
- $session{'tickets'}->LimitCustomField( CUSTOMFIELD => $id,
- OPERATOR => $oper,
- QUOTEVALUE => $quote,
- VALUE => $value );
+ $session{'tickets'}->LimitKeyword(
+ KEYWORDSELECT => $KeywordSelectId,
+ OPERATOR => $oper,
+ QUOTEVALUE => $quote,
+ KEYWORD => $KeywordId
+ );
}
}
# }}}
-
}
# }}}
@@ -735,7 +654,7 @@ Returns an ISO date and time in GMT
sub ParseDateToISO {
my $date = shift;
- my $date_obj = RT::Date->new($session{'CurrentUser'});
+ my $date_obj = new RT::Date($CurrentUser);
$date_obj->Set(
Format => 'unknown',
Value => $date
@@ -761,83 +680,173 @@ sub Config {
# {{{ sub ProcessACLChanges
sub ProcessACLChanges {
+ my $ACLref = shift;
my $ARGSref = shift;
+ my @CheckACL = @$ACLref;
my %ARGS = %$ARGSref;
my ( $ACL, @results );
+ # {{{ Add rights
+ foreach $ACL (@CheckACL) {
+ my ($Principal);
- foreach my $arg (keys %ARGS) {
- if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) {
- my $principal_id = $1;
- my $object_type = $2;
- my $object_id = $3;
- my $rights = $ARGS{$arg};
+ next unless ($ACL);
- my $principal = RT::Principal->new($session{'CurrentUser'});
- $principal->Load($principal_id);
+ # Parse out what we're really talking about.
+ if ( $ACL =~ /^(.*?)-(\d+)-(.*?)-(\d+)/ ) {
+ my $PrincipalType = $1;
+ my $PrincipalId = $2;
+ my $Scope = $3;
+ my $AppliesTo = $4;
- my $obj;
+ # {{{ Create an object called Principal
+ # so we can do rights operations
- if ($object_type eq 'RT::Queue') {
- $obj = RT::Queue->new($session{'CurrentUser'});
- $obj->Load($object_id);
- } elsif ($object_type eq 'RT::Group') {
- $obj = RT::Group->new($session{'CurrentUser'});
- $obj->Load($object_id);
+ if ( $PrincipalType eq 'User' ) {
+ $Principal = new RT::User( $session{'CurrentUser'} );
+ }
+ elsif ( $PrincipalType eq 'Group' ) {
+ $Principal = new RT::Group( $session{'CurrentUser'} );
+ }
+ else {
+ Abort("$PrincipalType unknown principal type");
+ }
- } elsif ($object_type eq 'RT::System') {
- $obj = $RT::System;
- } else {
- push (@results, loc("System Error").
- loc("Rights could not be granted for [_1]", $object_type));
- next;
+ $Principal->Load($PrincipalId)
+ || Abort("$PrincipalType $PrincipalId couldn't be loaded");
+
+ # }}}
+
+ # {{{ load up an RT::ACL object with the same current vals of this ACL
+
+ my $CurrentACL = new RT::ACL( $session{'CurrentUser'} );
+ if ( $Scope eq 'Queue' ) {
+ $CurrentACL->LimitToQueue($AppliesTo);
}
+ elsif ( $Scope eq 'System' ) {
+ $CurrentACL->LimitToSystem();
+ }
+
+ $CurrentACL->LimitPrincipalToType($PrincipalType);
+ $CurrentACL->LimitPrincipalToId($PrincipalId);
+
+ # }}}
+
+ # {{{ Get the values of the select we're working with
+ # into an array. it will contain all the new rights that have
+ # been granted
+ #Hack to turn the ACL returned into an array
+ my @rights =
+ ref( $ARGS{"GrantACE-$ACL"} ) eq 'ARRAY'
+ ? @{ $ARGS{"GrantACE-$ACL"} }
+ : ( $ARGS{"GrantACE-$ACL"} );
+
+ # }}}
+
+ # {{{ Add any rights we need.
- my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg});
foreach my $right (@rights) {
next unless ($right);
- my ($val, $msg) = $principal->GrantRight(Object => $obj, Right => $right);
- push (@results, $msg);
- }
- }
- elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) {
- my $principal_id = $1;
- my $object_type = $2;
- my $object_id = $3;
- my $right = $4;
-
- my $principal = RT::Principal->new($session{'CurrentUser'});
- $principal->Load($principal_id);
- next unless ($right);
- my $obj;
-
- if ($object_type eq 'RT::Queue') {
- $obj = RT::Queue->new($session{'CurrentUser'});
- $obj->Load($object_id);
- } elsif ($object_type eq 'RT::Group') {
- $obj = RT::Group->new($session{'CurrentUser'});
- $obj->Load($object_id);
-
- } elsif ($object_type eq 'RT::System') {
- $obj = $RT::System;
- } else {
- push (@results, loc("System Error").
- loc("Rights could not be revoked for [_1]", $object_type));
- next;
+
+ #if the right that's been selected wasn't there before, add it.
+ unless (
+ $CurrentACL->HasEntry(
+ RightScope => "$Scope",
+ RightName => "$right",
+ RightAppliesTo => "$AppliesTo",
+ PrincipalType => $PrincipalType,
+ PrincipalId => $Principal->Id
+ )
+ )
+ {
+
+ #Add new entry to list of rights.
+ if ( $Scope eq 'Queue' ) {
+ my $Queue = new RT::Queue( $session{'CurrentUser'} );
+ $Queue->Load($AppliesTo);
+ unless ( $Queue->id ) {
+ Abort("Couldn't find a queue called $AppliesTo");
+ }
+
+ my ( $val, $msg ) = $Principal->GrantQueueRight(
+ RightAppliesTo => $Queue->id,
+ RightName => "$right"
+ );
+
+ if ($val) {
+ push ( @results,
+ "Granted right $right to "
+ . $Principal->Name
+ . " for queue "
+ . $Queue->Name );
+ }
+ else {
+ push ( @results, $msg );
+ }
+ }
+ elsif ( $Scope eq 'System' ) {
+ my ( $val, $msg ) = $Principal->GrantSystemRight(
+ RightAppliesTo => $AppliesTo,
+ RightName => "$right"
+ );
+ if ($val) {
+ push ( @results, "Granted system right '$right' to "
+ . $Principal->Name );
+ }
+ else {
+ push ( @results, $msg );
+ }
+ }
+ }
}
- my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => $right);
- push (@results, $msg);
+
+ # }}}
}
+ }
+ # }}} Add rights
- }
+ # {{{ remove any rights that have been deleted
- return (@results);
+ my @RevokeACE =
+ ref( $ARGS{"RevokeACE"} ) eq 'ARRAY'
+ ? @{ $ARGS{"RevokeACE"} }
+ : ( $ARGS{"RevokeACE"} );
+ foreach my $aceid (@RevokeACE) {
+
+ my $right = new RT::ACE( $session{'CurrentUser'} );
+ $right->Load($aceid);
+ next unless ( $right->id );
+
+ my $phrase = "Revoked "
+ . $right->PrincipalType . " "
+ . $right->PrincipalObj->Name
+ . "'s right to "
+ . $right->RightName;
+
+ if ( $right->RightScope eq 'System' ) {
+ $phrase .= ' across all queues.';
+ }
+ else {
+ $phrase .= ' for the queue ' . $right->AppliesToObj->Name . '.';
+ }
+ my ( $val, $msg ) = $right->Delete();
+ if ($val) {
+ push ( @results, $phrase );
+ }
+ else {
+ push ( @results, $msg );
+ }
}
+ # }}}
+
+ return (@results);
+}
+
# }}}
# {{{ sub UpdateRecordObj
@@ -855,7 +864,6 @@ sub UpdateRecordObject {
ARGSRef => undef,
AttributesRef => undef,
Object => undef,
- AttributePrefix => undef,
@_
);
@@ -864,94 +872,17 @@ sub UpdateRecordObject {
my $object = $args{'Object'};
my $attributes = $args{'AttributesRef'};
my $ARGSRef = $args{'ARGSRef'};
- foreach my $attribute (@$attributes) {
- my $value;
- if ( defined $ARGSRef->{$attribute} ) {
- $value = $ARGSRef->{$attribute};
- }
- elsif (
- defined( $args{'AttributePrefix'} )
- && defined(
- $ARGSRef->{ $args{'AttributePrefix'} . "-" . $attribute }
- )
- ) {
- $value = $ARGSRef->{ $args{'AttributePrefix'} . "-" . $attribute };
-
- } else {
- next;
- }
-
- $value =~ s/\r\n/\n/gs;
-
- if ($value ne $object->$attribute()){
-
- my $method = "Set$attribute";
- my ( $code, $msg ) = $object->$method($value);
-
- push @results, loc($attribute) . ': ' . loc_fuzzy($msg);
-=for loc
- "[_1] could not be set to [_2].", # loc
- "That is already the current value", # loc
- "No value sent to _Set!\n", # loc
- "Illegal value for [_1]", # loc
- "The new value has been set.", # loc
- "No column specified", # loc
- "Immutable field", # loc
- "Nonexistant field?", # loc
- "Invalid data", # loc
- "Couldn't find row", # loc
- "Missing a primary key?: [_1]", # loc
- "Found Object", # loc
-=cut
- };
- }
- return (@results);
-}
-
-# }}}
-
-# {{{ Sub ProcessCustomFieldUpdates
-
-sub ProcessCustomFieldUpdates {
- my %args = (
- CustomFieldObj => undef,
- ARGSRef => undef,
- @_
- );
-
- my $Object = $args{'CustomFieldObj'};
- my $ARGSRef = $args{'ARGSRef'};
- my @attribs = qw( Name Type Description Queue SortOrder);
- my @results = UpdateRecordObject(
- AttributesRef => \@attribs,
- Object => $Object,
- ARGSRef => $ARGSRef
- );
+ foreach $attribute (@$attributes) {
+ if ( ( defined $ARGSRef->{"$attribute"} )
+ and ( $ARGSRef->{"$attribute"} ne $object->$attribute() ) )
+ {
+ $ARGSRef->{"$attribute"} =~ s/\r\n/\n/gs;
- if ( $ARGSRef->{ "CustomField-" . $Object->Id . "-AddValue-Name" } ) {
-
- my ( $addval, $addmsg ) = $Object->AddValue(
- Name =>
- $ARGSRef->{ "CustomField-" . $Object->Id . "-AddValue-Name" },
- Description => $ARGSRef->{ "CustomField-"
- . $Object->Id
- . "-AddValue-Description" },
- SortOrder => $ARGSRef->{ "CustomField-"
- . $Object->Id
- . "-AddValue-SortOrder" },
- );
- push ( @results, $addmsg );
- }
- my @delete_values = (
- ref $ARGSRef->{ 'CustomField-' . $Object->Id . '-DeleteValue' } eq
- 'ARRAY' )
- ? @{ $ARGSRef->{ 'CustomField-' . $Object->Id . '-DeleteValue' } }
- : ( $ARGSRef->{ 'CustomField-' . $Object->Id . '-DeleteValue' } );
- foreach my $id (@delete_values) {
- next unless defined $id;
- my ( $err, $msg ) = $Object->DeleteValue($id);
- push ( @results, $msg );
+ my $method = "Set$attribute";
+ my ( $code, $msg ) = $object->$method( $ARGSRef->{"$attribute"} );
+ push @results, "$attribute: $msg";
+ }
}
return (@results);
}
@@ -982,7 +913,6 @@ sub ProcessTicketBasics {
Subject
FinalPriority
Priority
- TimeEstimated
TimeWorked
TimeLeft
Status
@@ -1004,7 +934,7 @@ sub ProcessTicketBasics {
);
# We special case owner changing, so we can use ForceOwnerChange
- if ( $ARGSRef->{'Owner'} && ( $TicketObj->Owner != $ARGSRef->{'Owner'} ) ) {
+ if ( $ARGSRef->{'Owner'} && ( $TicketObj->Owner ne $ARGSRef->{'Owner'} ) ) {
my ($ChownType);
if ( $ARGSRef->{'ForceOwnerChange'} ) {
$ChownType = "Force";
@@ -1015,7 +945,7 @@ sub ProcessTicketBasics {
my ( $val, $msg ) =
$TicketObj->SetOwner( $ARGSRef->{'Owner'}, $ChownType );
- push ( @results, $msg );
+ push ( @results, "$msg" );
}
# }}}
@@ -1025,142 +955,6 @@ sub ProcessTicketBasics {
# }}}
-# {{{ Sub ProcessTicketCustomFieldUpdates
-
-sub ProcessTicketCustomFieldUpdates {
- my %args = (
- ARGSRef => undef,
- @_
- );
-
- my @results;
-
- my $ARGSRef = $args{'ARGSRef'};
-
- # Build up a list of tickets that we want to work with
- my %tickets_to_mod;
- my %custom_fields_to_mod;
- foreach my $arg ( keys %{$ARGSRef} ) {
- if ( $arg =~ /^Ticket-(\d+)-CustomField-(\d+)-/ ) {
-
- # For each of those tickets, find out what custom fields we want to work with.
- $custom_fields_to_mod{$1}{$2} = 1;
- }
- }
-
- # For each of those tickets
- foreach my $tick ( keys %custom_fields_to_mod ) {
- my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
- $Ticket->Load($tick);
-
- # For each custom field
- foreach my $cf ( keys %{ $custom_fields_to_mod{$tick} } ) {
-
- my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
- $CustomFieldObj->LoadById($cf);
-
- foreach my $arg ( keys %{$ARGSRef} ) {
- # since http won't pass in a form element with a null value, we need
- # to fake it
- if ($arg =~ /^(.*?)-Values-Magic$/ ) {
- # We don't care about the magic, if there's really a values element;
- next if (exists $ARGSRef->{$1.'-Values'}) ;
-
- $arg = $1."-Values";
- $ARGSRef->{$1."-Values"} = undef;
-
- }
- next unless ( $arg =~ /^Ticket-$tick-CustomField-$cf-/ );
- my @values =
- ( ref( $ARGSRef->{$arg} ) eq 'ARRAY' )
- ? @{ $ARGSRef->{$arg} }
- : ( $ARGSRef->{$arg} );
- if ( ( $arg =~ /-AddValue$/ ) || ( $arg =~ /-Value$/ ) ) {
- foreach my $value (@values) {
- next unless ($value);
- my ( $val, $msg ) = $Ticket->AddCustomFieldValue(
- Field => $cf,
- Value => $value
- );
- push ( @results, $msg );
- }
- }
- elsif ( $arg =~ /-DeleteValues$/ ) {
- foreach my $value (@values) {
- next unless ($value);
- my ( $val, $msg ) = $Ticket->DeleteCustomFieldValue(
- Field => $cf,
- Value => $value
- );
- push ( @results, $msg );
- }
- }
- elsif ( $arg =~ /-Values$/ and $CustomFieldObj->Type !~ /Entry/) {
- my $cf_values = $Ticket->CustomFieldValues($cf);
-
- my %values_hash;
- foreach my $value (@values) {
- next unless ($value);
-
- # build up a hash of values that the new set has
- $values_hash{$value} = 1;
-
- unless ( $cf_values->HasEntry($value) ) {
- my ( $val, $msg ) = $Ticket->AddCustomFieldValue(
- Field => $cf,
- Value => $value
- );
- push ( @results, $msg );
- }
-
- }
- while ( my $cf_value = $cf_values->Next ) {
- unless ( $values_hash{ $cf_value->Content } == 1 ) {
- my ( $val, $msg ) = $Ticket->DeleteCustomFieldValue(
- Field => $cf,
- Value => $cf_value->Content
- );
- push ( @results, $msg);
-
- }
-
- }
- }
- elsif ( $arg =~ /-Values$/ ) {
- my $cf_values = $Ticket->CustomFieldValues($cf);
-
- # keep everything up to the point of difference, delete the rest
- my $delete_flag;
- foreach my $old_cf (@{$cf_values->ItemsArrayRef}) {
- if (!$delete_flag and @values and $old_cf->Content eq $values[0]) {
- shift @values;
- next;
- }
-
- $delete_flag ||= 1;
- $old_cf->Delete;
- }
-
- # now add/replace extra things, if any
- foreach my $value (@values) {
- my ( $val, $msg ) = $Ticket->AddCustomFieldValue(
- Field => $cf,
- Value => $value
- );
- push ( @results, $msg );
- }
- }
- else {
- push ( @results, "User asked for an unknown update type for custom field " . $cf->Name . " for ticket " . $Ticket->id );
- }
- }
- }
- return (@results);
- }
-}
-
-# }}}
-
# {{{ sub ProcessTicketWatchers
=head2 ProcessTicketWatchers ( TicketObj => $Ticket, ARGSRef => \%ARGS );
@@ -1184,22 +978,18 @@ sub ProcessTicketWatchers {
foreach my $key ( keys %$ARGSRef ) {
- # {{{ Delete deletable watchers
- if ( ( $key =~ /^Ticket-DelWatcher-Type-(.*)-Principal-(\d+)$/ ) ) {
- my ( $code, $msg ) =
- $Ticket->DeleteWatcher(PrincipalId => $2,
- Type => $1);
+ # Delete deletable watchers
+ if ( ( $key =~ /^DelWatcher(\d*)$/ ) and ( $ARGSRef->{$key} ) ) {
+ my ( $code, $msg ) = $Ticket->DeleteWatcher($1);
push @results, $msg;
}
# Delete watchers in the simple style demanded by the bulk manipulator
elsif ( $key =~ /^Delete(Requestor|Cc|AdminCc)$/ ) {
- my ( $code, $msg ) = $Ticket->DeleteWatcher( Type => $ARGSRef->{$key}, PrincipalId => $1 );
+ my ( $code, $msg ) = $Ticket->DeleteWatcher( $ARGSRef->{$key}, $1 );
push @results, $msg;
}
- # }}}
-
# Add new wathchers by email address
elsif ( ( $ARGSRef->{$key} =~ /^(AdminCc|Cc|Requestor)$/ )
and ( $key =~ /^WatcherTypeEmail(\d*)$/ ) )
@@ -1224,11 +1014,12 @@ sub ProcessTicketWatchers {
# Add new watchers by owner
elsif ( ( $ARGSRef->{$key} =~ /^(AdminCc|Cc|Requestor)$/ )
- and ( $key =~ /^Ticket-AddWatcher-Principal-(\d*)$/ ) ) {
+ and ( $key =~ /^WatcherTypeUser(\d*)$/ ) )
+ {
#They're in this order because otherwise $1 gets clobbered :/
my ( $code, $msg ) =
- $Ticket->AddWatcher( Type => $ARGSRef->{$key}, PrincipalId => $1 );
+ $Ticket->AddWatcher( Type => $ARGSRef->{$key}, Owner => $1 );
push @results, $msg;
}
}
@@ -1270,7 +1061,7 @@ sub ProcessTicketDates {
);
#Run through each field in this list. update the value if apropriate
- foreach my $field (@date_fields) {
+ foreach $field (@date_fields) {
my ( $code, $msg );
my $DateObj = RT::Date->new( $session{'CurrentUser'} );
@@ -1307,9 +1098,11 @@ Returns an array of results messages.
=cut
sub ProcessTicketLinks {
- my %args = ( TicketObj => undef,
- ARGSRef => undef,
- @_ );
+ my %args = (
+ TicketObj => undef,
+ ARGSRef => undef,
+ @_
+ );
my $Ticket = $args{'TicketObj'};
my $ARGSRef = $args{'ARGSRef'};
@@ -1325,9 +1118,11 @@ sub ProcessTicketLinks {
push @results,
"Trying to delete: Base: $base Target: $target Type $type";
- my ( $val, $msg ) = $Ticket->DeleteLink( Base => $base,
- Type => $type,
- Target => $target );
+ my ( $val, $msg ) = $Ticket->DeleteLink(
+ Base => $base,
+ Type => $type,
+ Target => $target
+ );
push @results, $msg;
@@ -1338,23 +1133,26 @@ sub ProcessTicketLinks {
my @linktypes = qw( DependsOn MemberOf RefersTo );
foreach my $linktype (@linktypes) {
- if ( $ARGSRef->{ $Ticket->Id . "-$linktype" } ) {
- for my $luri ( split ( / /, $ARGSRef->{ $Ticket->Id . "-$linktype" } ) ) {
- $luri =~ s/\s*$//; # Strip trailing whitespace
- my ( $val, $msg ) = $Ticket->AddLink( Target => $luri,
- Type => $linktype );
- push @results, $msg;
- }
+
+ for my $luri ( split ( / /, $ARGSRef->{ $Ticket->Id . "-$linktype" } ) )
+ {
+ $luri =~ s/\s*$//; # Strip trailing whitespace
+ my ( $val, $msg ) = $Ticket->AddLink(
+ Target => $luri,
+ Type => $linktype
+ );
+ push @results, $msg;
}
- if ( $ARGSRef->{ "$linktype-" . $Ticket->Id } ) {
- for my $luri ( split ( / /, $ARGSRef->{ "$linktype-" . $Ticket->Id } ) ) {
- my ( $val, $msg ) = $Ticket->AddLink( Base => $luri,
- Type => $linktype );
+ for my $luri ( split ( / /, $ARGSRef->{ "$linktype-" . $Ticket->Id } ) )
+ {
+ my ( $val, $msg ) = $Ticket->AddLink(
+ Base => $luri,
+ Type => $linktype
+ );
- push @results, $msg;
- }
- }
+ push @results, $msg;
+ }
}
#Merge if we need to
@@ -1369,9 +1167,121 @@ sub ProcessTicketLinks {
# }}}
-eval "require RT::Interface::Web_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web_Vendor.pm});
-eval "require RT::Interface::Web_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web_Local.pm});
+# {{{ sub ProcessTicketObjectKeywords
+
+=head2 ProcessTicketObjectKeywords ( TicketObj => $Ticket, ARGSRef => \%ARGS );
+
+Returns an array of results messages.
+
+=cut
+
+sub ProcessTicketObjectKeywords {
+ my %args = (
+ TicketObj => undef,
+ ARGSRef => undef,
+ @_
+ );
+
+ my $TicketObj = $args{'TicketObj'};
+ my $ARGSRef = $args{'ARGSRef'};
+
+ my (@results);
+
+ # {{{ set ObjectKeywords.
+
+ my $KeywordSelects = $TicketObj->QueueObj->KeywordSelects;
+
+ # iterate through all the keyword selects for this queue
+ while ( my $KeywordSelect = $KeywordSelects->Next ) {
+
+ # {{{ do some setup
+
+ # if we have KeywordSelectMagic for this keywordselect:
+ next
+ unless
+ defined $ARGSRef->{ 'KeywordSelectMagic' . $KeywordSelect->id };
+
+ # Lets get a hash of the possible values to work with
+ my $value = $ARGSRef->{ 'KeywordSelect' . $KeywordSelect->id } || [];
+
+ #lets get all those values in a hash. regardless of # of entries
+ #we'll use this for adding and deleting keywords from this object.
+ my %values = map { $_ => 1 } ref($value) ? @{$value} : ($value);
+
+ # Load up the ObjectKeywords for this KeywordSelect for this ticket
+ my $ObjectKeys = $TicketObj->KeywordsObj( $KeywordSelect->id );
+
+ # }}}
+ # {{{ add new keywords
+
+ foreach my $key ( keys %values ) {
+
+ #unless the ticket has that keyword for that keyword select,
+ unless ( $ObjectKeys->HasEntry($key) ) {
+
+ #Add the keyword
+ my ( $result, $msg ) = $TicketObj->AddKeyword(
+ Keyword => $key,
+ KeywordSelect => $KeywordSelect->id
+ );
+ push ( @results, $msg );
+ }
+ }
+
+ # }}}
+ # {{{ Delete unused keywords
+
+ #redo this search, so we don't ask it to delete things that are already gone
+ # such as when a single keyword select gets its value changed.
+ $ObjectKeys = $TicketObj->KeywordsObj( $KeywordSelect->id );
+
+ while ( my $TicketKey = $ObjectKeys->Next ) {
+
+ # if the hash defined above doesn\'t contain the keyword mentioned,
+ unless ( $values{ $TicketKey->Keyword } ) {
+
+ #I'd really love to just call $keyword->Delete, but then
+ # we wouldn't get a transaction recorded
+ my ( $result, $msg ) = $TicketObj->DeleteKeyword(
+ Keyword => $TicketKey->Keyword,
+ KeywordSelect => $KeywordSelect->id
+ );
+ push ( @results, $msg );
+ }
+ }
+
+ # }}}
+ }
+
+ #Iterate through the keyword selects for BulkManipulator style access
+ while ( my $KeywordSelect = $KeywordSelects->Next ) {
+ if ( $ARGSRef->{ "AddToKeywordSelect" . $KeywordSelect->Id } ) {
+
+ #Add the keyword
+ my ( $result, $msg ) = $TicketObj->AddKeyword(
+ Keyword =>
+ $ARGSRef->{ "AddToKeywordSelect" . $KeywordSelect->Id },
+ KeywordSelect => $KeywordSelect->id
+ );
+ push ( @results, $msg );
+ }
+ if ( $ARGSRef->{ "DeleteFromKeywordSelect" . $KeywordSelect->Id } ) {
+
+ #Delete the keyword
+ my ( $result, $msg ) = $TicketObj->DeleteKeyword(
+ Keyword =>
+ $ARGSRef->{ "DeleteFromKeywordSelect" . $KeywordSelect->Id },
+ KeywordSelect => $KeywordSelect->id
+ );
+ push ( @results, $msg );
+ }
+ }
+
+ # }}}
+
+ return (@results);
+}
+
+# }}}
1;
diff --git a/rt/lib/RT/Keyword.pm b/rt/lib/RT/Keyword.pm
new file mode 100644
index 000000000..a41e0a585
--- /dev/null
+++ b/rt/lib/RT/Keyword.pm
@@ -0,0 +1,446 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/Keyword.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+=head1 NAME
+
+ RT::Keyword - Manipulate an RT::Keyword record
+
+=head1 SYNOPSIS
+
+ use RT::Keyword;
+
+ my $keyword = RT::Keyword->new($CurrentUser);
+ $keyword->Create( Name => 'tofu',
+ Description => 'fermented soy beans',
+ );
+
+
+ my $keyword2 = RT::Keyword->new($CurrentUser);
+ $keyword2->Create( Name => 'beast',
+ Description => 'a wild animal',
+ Parent => $keyword->id(),
+ );
+
+=head1 DESCRIPTION
+
+An B<RT::Keyword> object is an arbitrary string.
+
+=head1 METHODS
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Scrip);
+
+=end testing
+
+
+=cut
+package RT::Keyword;
+
+use strict;
+use vars qw(@ISA);
+use Tie::IxHash;
+use RT::Record;
+use RT::Keywords;
+
+@ISA = qw(RT::Record);
+
+# {{{ Core methods
+
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Keywords";
+ $self->SUPER::_Init(@_);
+}
+
+sub _Accessible {
+ my $self = shift;
+ my %cols = (
+ Name => 'read/write', #the keyword itself
+ Description => 'read/write', #a description of the keyword
+ Parent => 'read/write', #optional id of another B<RT::Keyword>, allowing keywords to be arranged hierarchically
+ Disabled => 'read/write'
+ );
+ return ($self->SUPER::_Accessible( @_, %cols));
+
+}
+
+# }}}
+
+
+=over 4
+
+=item new CURRENT_USER
+
+Takes a single argument, an RT::CurrentUser object. Instantiates a new
+(uncreated) RT::Keyword object.
+
+=cut
+
+# {{{ sub Create
+
+=item Create KEY => VALUE, ...
+
+Takes a list of key/value pairs and creates a the object. Returns the id of
+the newly created record, or false if there was an error.
+
+Keys are:
+
+Name - the keyword itself
+Description - (not yet used)
+Parent - optional link to another B<RT::Keyword>, allowing keyword to be arranged in a hierarchical fashion. Can be specified by id or Name.
+
+=cut
+
+sub Create {
+ my $self = shift;
+ my %args = (Name => undef,
+ Description => undef,
+ Parent => 0,
+ @_);
+
+ unless ($self->CurrentUserHasRight('AdminKeywords')) {
+ return (0, 'Permission Denied');
+ }
+
+ if ( $args{'Parent'} && $args{'Parent'} !~ /^\d+$/ ) {
+ $RT::Logger->err( "can't yet specify parents by name, sorry: ". $args{'Parent'});
+ return(0,'Parent must be specified by id');
+ }
+
+ my $val = $self->SUPER::Create(Name => $args{'Name'},
+ Description => $args{'Description'},
+ Parent => $args{'Parent'}
+ );
+ if ($val) {
+ return ($val, 'Keyword created');
+ }
+ else {
+ return(0,'Could not create keyword');
+ }
+}
+
+# }}}
+
+# {{{ sub Delete
+
+sub Delete {
+ my $self = shift;
+
+ return (0, 'Deleting this object would break referential integrity.');
+}
+
+# }}}
+
+# {{{ sub LoadByPath
+
+=head2 LoadByPath STRING
+
+LoadByPath takes a string. Whatever character starts the string is assumed to be a delimter. The routine parses the keyword path description and tries to load the keyword
+described by that path. It returns a numerical status and a textual message.
+A non-zero status means 'Success'.
+
+=cut
+
+sub LoadByPath {
+ my $self = shift;
+
+ my $path = shift;
+
+ my $delimiter = substr($path,0,1);
+ my @path_elements = split($delimiter, $path);
+
+ #throw awya the first bogus path element
+ shift @path_elements;
+
+ my $parent = 0;
+ my ($tempkey);
+ #iterate through all the path elements loading up a
+ #keyword object. when we're done, this object becomes
+ #whatever the last tempkey object was.
+ while (my $name = shift @path_elements) {
+
+ $tempkey = new RT::Keyword($self->CurrentUser);
+
+ my $loaded = $tempkey->LoadByNameAndParentId($name, $parent);
+
+ #Set the new parent for loading its child.
+ $parent = $tempkey->Id;
+
+ #If the parent Id is 0, then we're not recursing through the tree
+ # time to bail
+ return (0, "Couldn't find keyword") unless ($tempkey->id());
+
+ }
+ #Now that we're through with the loop, the last keyword loaded
+ # is the the one we wanted.
+ # we shouldn't need to explicitly load it like this. but we do. Thanks SQL
+
+ $self->Load($tempkey->Id);
+
+ return (1, 'Keyword loaded');
+}
+
+
+# }}}
+
+# {{{ sub LoadByNameAndParentId
+
+=head2 LoadByNameAndParentId NAME PARENT_ID
+
+Takes two arguments, a keyword name and a parent id. Loads a keyword into
+ the current object.
+
+=cut
+
+sub LoadByNameAndParentId {
+ my $self = shift;
+ my $name = shift;
+ my $parentid = shift;
+
+ my $val = $self->LoadByCols( Name => $name, Parent => $parentid);
+ if ($self->Id) {
+ return ($self->Id, 'Keyword loaded');
+ }
+ else {
+ return (0, 'Keyword could not be found');
+ }
+ }
+
+# }}}
+
+
+# {{{ sub Load
+
+=head2 Load KEYWORD
+
+Loads KEYWORD, either by id if it's an integer or by Path, otherwise
+
+=cut
+
+sub Load {
+ my $self = shift;
+ my $id = shift;
+
+ if (!$id) {
+ return (0, 'No keyword defined');
+ }
+ if ($id =~ /^(\d+)$/) {
+ return ($self->SUPER::Load($id));
+ }
+ else {
+ return($self->LoadByPath($id));
+ }
+}
+
+
+# }}}
+
+# {{{ sub Path
+
+=item Path
+
+ Returns this Keyword's full path going back to the root. (eg /OS/Unix/Linux/Redhat if
+this keyword is "Redhat" )
+
+=cut
+
+sub Path {
+ my $self = shift;
+
+ if ($self->Parent == 0) {
+ return ("/".$self->Name);
+ }
+ else {
+ return ( $self->ParentObj->Path . "/" . $self->Name);
+ }
+
+}
+
+# }}}
+
+# {{{ sub RelativePath
+
+=head2 RelativePath KEYWORD_OBJ
+
+Takes a keyword object. Returns this keyword's path relative to that
+keyword.
+
+=item Bugs
+
+Currently assumes that the "other" keyword is a predecessor of this keyword
+
+=cut
+
+sub RelativePath {
+ my $self = shift;
+ my $OtherKey = shift;
+
+ my $OtherPath = $OtherKey->Path();
+ my $MyPath = $self->Path;
+ $MyPath =~ s/^$OtherPath\///g;
+ return ($MyPath);
+}
+
+
+# }}}
+
+# {{{ sub ParentObj
+
+=item ParentObj
+
+ Returns an RT::Keyword object of this Keyword's 'parents'
+
+=cut
+
+sub ParentObj {
+ my $self = shift;
+
+ my $ParentObj = new RT::Keyword($self->CurrentUser);
+ $ParentObj->Load($self->Parent);
+ return ($ParentObj);
+}
+
+# }}}
+
+# {{{ sub Children
+
+=item Children
+
+Return an RT::Keywords object this Object's children.
+
+=cut
+
+sub Children {
+ my $self = shift;
+
+ my $Children = new RT::Keywords($self->CurrentUser);
+ $Children->LimitToParent($self->id);
+ return ($Children);
+}
+
+# }}}
+
+# {{{ sub Descendents
+
+=item Descendents [ NUM_GENERATIONS [ EXCLUDE_HASHREF ] ]
+
+Returns an ordered (see L<Tie::IxHash>) hash reference of the descendents of
+this keyword, possibly limited to a given number of generations. The keys
+are B<RT::Keyword> I<id>s, and the values are strings containing the I<Name>s
+of those B<RT::Keyword>s.
+
+=cut
+
+sub Descendents {
+ my $self = shift;
+ my $generations = shift || 0;
+ my $exclude = shift || {};
+ my %results;
+
+
+ tie %results, 'Tie::IxHash';
+ my $Keywords = new RT::Keywords($self->CurrentUser);
+ $Keywords->LimitToParent($self->id || 0 ); #If we have no id, start at the top
+
+ while ( my $Keyword = $Keywords->Next ) {
+
+ next if defined $exclude->{ $Keyword->id };
+ $results{ $Keyword->id } = $Keyword->Name;
+
+ if ( $generations == 0 || $generations > 1 ) {
+ #if we're limiting to some number of generations,
+ # decrement the number of generations
+
+ my $nextgen = $generations;
+ $nextgen-- if ( $nextgen > 1 );
+
+ my $kids = $Keyword->Descendents($nextgen, \%results);
+
+ foreach my $kid ( keys %{$kids}) {
+ $results{"$kid"} = $Keyword->Name. "/". $kids->{"$kid"};
+ }
+ }
+ }
+ return(\%results);
+}
+
+# }}}
+
+# {{{ ACL related methods
+
+# {{{ sub _Set
+
+# does an acl check and then passes off the call
+sub _Set {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('AdminKeywords')) {
+ return (0,'Permission Denied');
+ }
+ return $self->SUPER::_Set(@_);
+}
+
+# }}}
+
+# {{{ sub CurrentUserHasRight
+
+=head2 CurrentUserHasRight
+
+Helper menthod for HasRight. Presets Principal to CurrentUser then
+calls HasRight.
+
+=cut
+
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->HasRight( Principal => $self->CurrentUser->UserObj,
+ Right => $right ));
+
+}
+
+# }}}
+
+# {{{ sub HasRight
+
+=head2 HasRight
+
+Takes a param-hash consisting of "Right" and "Principal" Principal is
+an RT::User object or an RT::CurrentUser object. "Right" is a textual
+Right string that applies to Keywords.
+
+=cut
+
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => undef,
+ @_ );
+
+ return( $args{'Principal'}->HasSystemRight( $args{'Right'}) );
+
+}
+# }}}
+
+# }}}
+
+=back
+
+=head1 AUTHOR
+
+Ivan Kohler <ivan-rt@420.am>
+
+=head1 BUGS
+
+Yes.
+
+=head1 SEE ALSO
+
+L<RT::Keywords>, L<RT::ObjectKeyword>, L<RT::ObjectKeywords>, L<RT::Ticket>,
+L<RT::Record>
+
+[A=cut
+
+1;
+
diff --git a/rt/lib/RT/KeywordSelect.pm b/rt/lib/RT/KeywordSelect.pm
new file mode 100644
index 000000000..6865216fd
--- /dev/null
+++ b/rt/lib/RT/KeywordSelect.pm
@@ -0,0 +1,452 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/KeywordSelect.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+package RT::KeywordSelect;
+
+use strict;
+use vars qw(@ISA);
+use RT::Record;
+use RT::Keyword;
+
+@ISA = qw(RT::Record);
+
+# {{{ POD
+
+=head1 NAME
+
+ RT::KeywordSelect - Manipulate an RT::KeywordSelect record
+
+=head1 SYNOPSIS
+
+ use RT::KeywordSelect;
+
+ my $keyword_select = RT::KeywordSelect->new($CurrentUser);
+ $keyword_select->Create(
+ Keyword => 20,
+ ObjectType => 'Ticket',
+ Name => 'Choices'
+ );
+
+ my $keyword_select = RT::KeywordSelect->new($CurrentUser);
+ $keyword_select->Create(
+ Name => 'Choices',
+ Keyword => 20,
+ ObjectType => 'Ticket',
+ ObjectField => 'Queue',
+ ObjectValue => 1,
+ Single => 1,
+ Depth => 4,
+ );
+
+=head1 DESCRIPTION
+
+An B<RT::KeywordSelect> object is a link between a Keyword and a object
+type (one of: Ticket), titled by the I<Name> field of the B<RT::Keyword> such
+that:
+
+=over 4
+
+=item Object display will contain a field, titled with the I<Name> field and
+ showing any descendent keywords which are related to this object via the
+ B<RT::ObjectKeywords> table.
+
+=item Object creation for this object will contain a field titled with the
+ I<Name> field and containing the descendents of the B<RT::Keyword> as
+ choices. If the I<Single> field of this B<RT::KeywordSelect> is true, each
+ object must be associated (via an B<RT::ObjectKeywords> record) to a single
+ descendent. If the I<Single> field is false, each object may be connect to
+ zero, one, or many descendents.
+
+=item Searches for this object type will contain a selection field titled with
+ the I<Name> field and containing the descendents of the B<RT::Keyword> as
+ choices.
+
+=item If I<ObjectField> is defined (one of: Queue), all of the above apply only
+ when the value of I<ObjectField> (Queue) in B<ObjectType> (Ticket) matches
+ I<ObjectValue>.
+
+=back
+
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::KeywordSelects);
+
+=end testing
+
+
+=head1 METHODS
+
+
+=cut
+
+
+=over 4
+
+=item new CURRENT_USER
+
+Takes a single argument, an RT::CurrentUser object. Instantiates a new
+(uncreated) RT::KeywordSelect object.
+
+=cut
+# }}}
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "KeywordSelects";
+ $self->SUPER::_Init(@_);
+}
+# }}}
+
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ Name => 'read/write',
+ Keyword => 'read/write', # link to Keywords. Can be specified by id
+ Single => 'read/write', # bool (described below)
+
+ Depth => 'read/write', #- If non-zero, limits the descendents to this number of levels deep.
+ ObjectType => 'read/write', # currently only C<Ticket>
+ ObjectField => 'read/write', #optional, currently only C<Queue>
+ ObjectValue => 'read/write', #constrains KeywordSelect function to when B<ObjectType>.I<ObjectField> equals I<ObjectValue>
+ Disabled => 'read/write'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
+}
+# }}}
+
+# {{{ sub LoadByName
+
+=head2 LoadByName( Name => [NAME], Queue => [QUEUE_ID])
+. Takes a queue id and a keyword select name.
+ tries to load the keyword select for that queue. if that fails, it tries to load it
+ without a queue specified.
+
+=cut
+
+
+sub LoadByName {
+ my $self = shift;
+ my %args = ( Name => undef,
+ Queue => undef,
+ @_
+ );
+ if ($args{'Queue'}) {
+ #Try to get the keyword select for this queue
+ $self->LoadByCols( Name => $args{'Name'},
+ ObjectType => 'Ticket',
+ ObjectField => 'Queue',
+ ObjectValue => $args{'Queue'});
+ }
+ unless ($self->Id) { #if that failed to load an object
+ #Try to get the keyword select of that name that's global
+ $self->LoadByCols( Name => $args{'Name'},
+ ObjectType => 'Ticket',
+ ObjectField => 'Queue',
+ ObjectValue => '0');
+ }
+
+ return($self->Id);
+
+}
+
+# }}}
+
+# {{{ sub Create
+=item Create KEY => VALUE, ...
+
+Takes a list of key/value pairs and creates a the object. Returns the id of
+the newly created record, or false if there was an error.
+
+Keys are:
+
+Keyword - link to Keywords. Can be specified by id.
+Name - A name for this KeywordSelect
+Single - bool (described above)
+Depth - If non-zero, limits the descendents to this number of levels deep.
+ObjectType - currently only C<Ticket>
+ObjectField - optional, currently only C<Queue>
+ObjectValue - constrains KeywordSelect function to when B<ObjectType>.I<ObjectField> equals I<ObjectValue>
+
+=cut
+
+sub Create {
+ my $self = shift;
+ my %args = ( Keyword => undef,
+ Single => 1,
+ Depth => 0,
+ Name => undef,
+ ObjectType => undef,
+ ObjectField => undef,
+ ObjectValue => undef,
+ @_);
+
+ #If we're talking about a keyword select based on a ticket's 'Queue' field
+ if ( ($args{'ObjectField'} eq 'Queue') and
+ ($args{'ObjectType'} eq 'Ticket')) {
+
+ #If we're talking about a keywordselect for all queues
+ if ($args{'ObjectValue'} == 0) {
+ unless( $self->CurrentUserHasSystemRight('AdminKeywordSelects')) {
+ return (0, 'Permission Denied');
+ }
+ }
+ #otherwise, we're talking about a keywordselect for a specific queue
+ else {
+ unless ($self->CurrentUserHasQueueRight( Right => 'AdminKeywordSelects',
+ Queue => $args{'ObjectValue'})) {
+ return (0, 'Permission Denied');
+ }
+ }
+ }
+ else {
+ return (0, "Can't create a KeywordSelect for that object/field combo");
+ }
+
+ my $Keyword = new RT::Keyword($self->CurrentUser);
+
+ if ( $args{'Keyword'} && $args{'Keyword'} !~ /^\d+$/ ) {
+ $Keyword->LoadByPath($args{'Keyword'});
+ }
+ else {
+ $Keyword->Load($args{'Keyword'});
+ }
+
+ unless ($Keyword->Id) {
+ $RT::Logger->debug("Keyword ".$args{'Keyword'} ." not found\n");
+ return(0, 'Keyword not found');
+ }
+
+ $args{'Name'} = $Keyword->Name if (!$args{'Name'});
+
+ my $val = $self->SUPER::Create( Name => $args{'Name'},
+ Keyword => $Keyword->Id,
+ Single => $args{'Single'},
+ Depth => $args{'Depth'},
+ ObjectType => $args{'ObjectType'},
+ ObjectField => $args{'ObjectField'},
+ ObjectValue => $args{'ObjectValue'});
+ if ($val) {
+ return ($val, 'KeywordSelect Created');
+ }
+ else {
+ return (0, 'System error. KeywordSelect not created');
+
+ }
+}
+# }}}
+
+# {{{ sub Delete
+
+sub Delete {
+ my $self = shift;
+
+ return (0, 'Deleting this object would break referential integrity.');
+}
+
+# }}}
+
+
+# {{{ sub SetDisabled
+
+=head2 Sub SetDisabled
+
+Toggles the KeywordSelect's disabled flag.
+
+
+=cut
+
+sub SetDisabled {
+ my $self = shift;
+ my $value = shift;
+
+ unless ($self->CurrentUserHasRight('AdminKeywordSelects')) {
+ return (0, "Permission Denied");
+ }
+ return($self->_Set(Field => 'Disabled', Value => $value));
+}
+
+# }}}
+
+# {{{ sub KeywordObj
+
+=item KeywordObj
+
+Returns the B<RT::Keyword> referenced by the I<Keyword> field.
+
+=cut
+
+sub KeywordObj {
+ my $self = shift;
+
+ my $Keyword = new RT::Keyword($self->CurrentUser);
+ $Keyword->Load( $self->Keyword ); #or ?
+ return($Keyword);
+}
+# }}}
+
+# {{{ sub Object
+
+=item Object
+
+Returns the object (currently only RT::Queue) specified by ObjectField and ObjectValue.
+
+=cut
+
+sub Object {
+ my $self = shift;
+ if ( $self->ObjectField eq 'Queue' ) {
+ my $Queue = new RT::Queue($self->CurrentUser);
+ $Queue->Load( $self->ObjectValue );
+ return ($Queue);
+ } else {
+ $RT::Logger->error("$self trying to load an object value for a non-queue object");
+ return (undef);
+ }
+}
+
+# }}}
+
+# {{{ sub _Set
+
+# does an acl check, then passes off the call
+sub _Set {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('AdminKeywordSelects')) {
+ return (0, "Permission Denied");
+ }
+
+ return ($self->SUPER::_Set(@_));
+
+}
+
+# }}}
+
+
+# {{{ sub CurrentUserHasQueueRight
+
+=head2 CurrentUserHasQueueRight ( Queue => QUEUEID, Right => RIGHTNANAME )
+
+Check to see whether the current user has the specified right for the specified queue.
+
+=cut
+
+sub CurrentUserHasQueueRight {
+ my $self = shift;
+ my %args = (Queue => undef,
+ Right => undef,
+ @_
+ );
+ return ($self->HasRight( Right => $args{'Right'},
+ Principal => $self->CurrentUser->UserObj,
+ Queue => $args{'Queue'}));
+}
+
+# }}}
+
+# {{{ sub CurrentUserHasSystemRight
+
+=head2 CurrentUserHasSystemRight RIGHTNAME
+
+Check to see whether the current user has the specified right for the 'system' scope.
+
+=cut
+
+sub CurrentUserHasSystemRight {
+ my $self = shift;
+ my $right = shift;
+ $RT::Logger->debug("$self in hashsysright for right $right\n");
+ return ($self->HasRight( Right => $right,
+ System => 1,
+ Principal => $self->CurrentUser->UserObj));
+}
+
+# }}}
+
+# {{{ sub CurrentUserHasRight
+
+=item CurrentUserHasRight RIGHT [QUEUEID]
+
+Takes a rightname as a string. Can take a queue id as a second
+optional parameter, which can be useful to a routine like create.
+Helper menthod for HasRight. Presets Principal to CurrentUser then
+calls HasRight.
+
+=cut
+
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->HasRight( Principal => $self->CurrentUser->UserObj,
+ Right => $right,
+ ));
+}
+
+# }}}
+
+# {{{ sub HasRight
+
+=item HasRight
+
+Takes a param-hash consisting of "Right" and "Principal" Principal is
+an RT::User object or an RT::CurrentUser object. "Right" is a textual
+Right string that applies to KeywordSelects
+
+=cut
+
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => undef,
+ Queue => undef,
+ System => undef,
+ @_ );
+
+ #If we're explicitly specifying a queue, as we need to do on create
+ if ($args{'Queue'}) {
+ return ($args{'Principal'}->HasQueueRight(Right => $args{'Right'},
+ Queue => $args{'Queue'}));
+ }
+ #else if we're specifying to check a system right
+ elsif ($args{'System'}) {
+ return( $args{'Principal'}->HasSystemRight( $args{'Right'} ));
+ }
+
+ #else if we 're using the object's queue
+ elsif (($self->__Value('ObjectField') eq 'Queue') and
+ ($self->__Value('ObjectValue') > 0 )) {
+ return ($args{'Principal'}->HasQueueRight(Right => $args{'Right'},
+ Queue => $self->__Value('ObjectValue') ));
+ }
+
+ #If the object is system scoped.
+ else {
+ return( $args{'Principal'}->HasSystemRight( $args{'Right'} ));
+ }
+}
+
+# }}}
+
+=back
+
+=head1 AUTHORS
+
+Ivan Kohler <ivan-rt@420.am>, Jesse Vincent <jesse@fsck.com>
+
+=head1 BUGS
+
+The ACL system for this object is more byzantine than it should be. reworking it eventually
+would be a good thing.
+
+=head1 SEE ALSO
+
+L<RT::KeywordSelects>, L<RT::Keyword>, L<RT::Keywords>, L<RT::ObjectKeyword>,
+L<RT::ObjectKeywords>, L<RT::Record>
+
+=cut
+
+1;
+
diff --git a/rt/lib/RT/KeywordSelects.pm b/rt/lib/RT/KeywordSelects.pm
new file mode 100644
index 000000000..c220b39f9
--- /dev/null
+++ b/rt/lib/RT/KeywordSelects.pm
@@ -0,0 +1,143 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/KeywordSelects.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Scrip);
+
+=end testing
+
+=cut
+
+
+package RT::KeywordSelects;
+
+use strict;
+use vars qw( @ISA );
+use RT::EasySearch;
+use RT::KeywordSelect;
+
+@ISA = qw( RT::EasySearch );
+
+# {{{ _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = 'KeywordSelects';
+ $self->{'primary_key'} = 'id';
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub _DoSearch
+
+=head2 _DoSearch
+
+ A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that _Disabled rows never get seen unless
+we're explicitly trying to see them.
+
+=cut
+
+sub _DoSearch {
+ my $self = shift;
+
+ #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
+ unless($self->{'find_disabled_rows'}) {
+ $self->LimitToEnabled();
+ }
+
+ return($self->SUPER::_DoSearch(@_));
+
+}
+
+# }}}
+
+# {{{ sub LimitToQueue
+=head2 LimitToQueue
+
+Takes a queue id. Limits the returned set to KeywordSelects for that queue.
+Repeated calls will be OR'd together.
+
+=cut
+
+sub LimitToQueue {
+ my $self = shift;
+ my $queue = shift;
+
+ $self->Limit( FIELD => 'ObjectValue',
+ VALUE => $queue,
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR'
+ );
+
+ $self->Limit( FIELD => 'ObjectType',
+ VALUE => 'Ticket',
+ OPERATOR => '=');
+
+ $self->Limit( FIELD => 'ObjectField',
+ VALUE => 'Queue',
+ OPERATOR => '=');
+
+
+}
+# }}}
+
+# {{{ sub LimitToGlobals
+
+=head2 LimitToGlobals
+
+Limits the returned set to KeywordSelects for all queues.
+Repeated calls will be OR'd together.
+
+=cut
+
+sub LimitToGlobals {
+ my $self = shift;
+
+ $self->Limit( FIELD => 'ObjectType',
+ VALUE => 'Ticket',
+ OPERATOR => '=');
+
+ $self->Limit( FIELD => 'ObjectField',
+ VALUE => 'Queue',
+ OPERATOR => '=');
+
+ $self->Limit( FIELD => 'ObjectValue',
+ VALUE => '0',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR'
+ );
+
+}
+# }}}
+
+# {{{ sub IncludeGlobals
+=head2 IncludeGlobals
+
+Include KeywordSelects which apply globally in the set of returned results
+
+=cut
+
+
+sub IncludeGlobals {
+ my $self = shift;
+ $self->Limit( FIELD => 'ObjectValue',
+ VALUE => '0',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR'
+ );
+
+
+}
+# }}}
+
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ #my $Handle = shift;
+ return (new RT::KeywordSelect($self->CurrentUser));
+}
+# }}}
+1;
+
diff --git a/rt/lib/RT/Keywords.pm b/rt/lib/RT/Keywords.pm
new file mode 100644
index 000000000..a9ecda2bc
--- /dev/null
+++ b/rt/lib/RT/Keywords.pm
@@ -0,0 +1,106 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/Keywords.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+=head1 NAME
+
+ RT::Keywords - a collection of RT::Keyword objects
+
+=head1 SYNOPSIS
+
+ use RT::Keywords;
+ my $keywords = RT::Keywords->new($user);
+ $keywords->LimitToParent(0);
+ while my ($keyword = $keywords->Next()) {
+ print $keyword->Name ."\n";
+ }
+
+
+=head1 DESCRIPTION
+
+
+=head1 METHODS
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Keywords);
+
+=end testing
+
+=cut
+
+package RT::Keywords;
+
+use strict;
+use vars qw( @ISA );
+use RT::EasySearch;
+use RT::Keyword;
+
+@ISA = qw( RT::EasySearch );
+
+
+# {{{ sub _Init
+
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = 'Keywords';
+ $self->{'primary_key'} = 'id';
+
+ # By default, order by name
+ $self->OrderBy( ALIAS => 'main',
+ FIELD => 'Name',
+ ORDER => 'ASC');
+
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub _DoSearch
+
+=head2 _DoSearch
+
+ A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that _Disabled rows never get seen unless
+we're explicitly trying to see them.
+
+=cut
+
+sub _DoSearch {
+ my $self = shift;
+
+ #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
+ unless($self->{'find_disabled_rows'}) {
+ $self->LimitToEnabled();
+ }
+
+ return($self->SUPER::_DoSearch(@_));
+
+}
+
+# }}}
+
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return (RT::Keyword->new($self->CurrentUser));
+}
+# }}}
+
+# {{{ sub LimitToParent
+
+=head2 LimitToParent
+
+Takes a parent id and limits the returned keywords to children of that parent.
+
+=cut
+
+sub LimitToParent {
+ my $self = shift;
+ my $parent = shift;
+ $self->Limit( FIELD => 'Parent',
+ VALUE => $parent,
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR' );
+}
+# }}}
+
+1;
+
diff --git a/rt/lib/RT/Link.pm b/rt/lib/RT/Link.pm
index 962c378a8..885ffe3ed 100644
--- a/rt/lib/RT/Link.pm
+++ b/rt/lib/RT/Link.pm
@@ -1,302 +1,373 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Link.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-1999 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
=head1 NAME
-RT::Link
-
+ RT::Link - an RT Link object
=head1 SYNOPSIS
+ use RT::Link;
+
=head1 DESCRIPTION
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in Ticket other similar objects.
+
=head1 METHODS
-=cut
-package RT::Link;
-use RT::Record;
+=begin testing
+ok (require RT::TestHarness);
+ok (require RT::Link);
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+=end testing
-sub _Init {
- my $self = shift;
+=cut
- $self->Table('Links');
- $self->SUPER::_Init(@_);
+package RT::Link;
+use RT::Record;
+use Carp;
+@ISA= qw(RT::Record);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Links";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub Create
+=head2 Create PARAMHASH
-
-=item Create PARAMHASH
-
-Create takes a hash of values and creates a row in the database:
-
- varchar(240) 'Base'.
- varchar(240) 'Target'.
- varchar(20) 'Type'.
- int(11) 'LocalTarget'.
- int(11) 'LocalBase'.
+Create a new link object. Takes 'Base', 'Target' and 'Type'.
+Returns undef on failure or a Link Id on success.
=cut
-
-
-
-sub Create {
+sub Create {
my $self = shift;
- my %args = (
- Base => '',
- Target => '',
- Type => '',
- LocalTarget => '0',
- LocalBase => '0',
-
- @_);
- $self->SUPER::Create(
- Base => $args{'Base'},
- Target => $args{'Target'},
- Type => $args{'Type'},
- LocalTarget => $args{'LocalTarget'},
- LocalBase => $args{'LocalBase'},
-);
-
+ my %args = ( Base => undef,
+ Target => undef,
+ Type => undef,
+ @_ # get the real argumentlist
+ );
+
+ my $BaseURI = $self->CanonicalizeURI($args{'Base'});
+ my $TargetURI = $self->CanonicalizeURI($args{'Target'});
+
+ unless (defined $BaseURI) {
+ $RT::Logger->warning ("$self couldn't resolve base:'".$args{'Base'}.
+ "' into a URI\n");
+ return (undef);
+ }
+ unless (defined $TargetURI) {
+ $RT::Logger->warning ("$self couldn't resolve target:'".$args{'Target'}.
+ "' into a URI\n");
+ return(undef);
+ }
+
+ my $LocalBase = $self->_IsLocal($BaseURI);
+ my $LocalTarget = $self->_IsLocal($TargetURI);
+ my $id = $self->SUPER::Create(Base => "$BaseURI",
+ Target => "$TargetURI",
+ LocalBase => $LocalBase,
+ LocalTarget => $LocalTarget,
+ Type => $args{'Type'});
+ return ($id);
}
+# }}}
+
+# {{{ sub Load
+=head2 Load
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+ Load an RT::Link object from the database. Takes one parameter or three.
+ One parameter is the id of an entry in the links table. Three parameters are a tuple of (base, linktype, target);
=cut
+sub Load {
+ my $self = shift;
+ my $identifier = shift;
+ my $linktype = shift if (@_);
+ my $target = shift if (@_);
+
+ if ($target) {
+ my $BaseURI = $self->CanonicalizeURI($identifier);
+ my $TargetURI = $self->CanonicalizeURI($target);
+ $self->LoadByCols( Base => $BaseURI,
+ Type => $linktype,
+ Target => $TargetURI
+ ) || return (0, "Couldn't load link");
+ }
+
+ elsif ($identifier =~ /^\d+$/) {
+ $self->LoadById($identifier) ||
+ return (0, "Couldn't load link");
+ }
+ else {
+ return (0, "That's not a numerical id");
+ }
+}
-=item Base
-
-Returns the current value of Base.
-(In the database, Base is stored as varchar(240).)
+# }}}
+# {{{ sub TargetObj
+=head2 TargetObj
-=item SetBase VALUE
+=cut
+sub TargetObj {
+ my $self = shift;
+ return $self->_TicketObj('base',$self->Target);
+}
+# }}}
-Set Base to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Base will be stored as a varchar(240).)
+# {{{ sub BaseObj
+=head2 BaseObj
=cut
-
-=item Target
-
-Returns the current value of Target.
-(In the database, Target is stored as varchar(240).)
-
+sub BaseObj {
+ my $self = shift;
+ return $self->_TicketObj('target',$self->Base);
+}
+# }}}
+
+# {{{ sub _TicketObj
+sub _TicketObj {
+ my $self = shift;
+ my $name = shift;
+ my $ref = shift;
+ my $tag="$name\_obj";
+
+ unless (exists $self->{$tag}) {
+
+ $self->{$tag}=RT::Ticket->new($self->CurrentUser);
+
+ #If we can get an actual ticket, load it up.
+ if ($self->_IsLocal($ref)) {
+ $self->{$tag}->Load($ref);
+ }
+ }
+ return $self->{$tag};
+}
+# }}}
+
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ LocalBase => 'read',
+ LocalTarget => 'read',
+ Base => 'read',
+ Target => 'read',
+ Type => 'read',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
+}
+# }}}
-=item SetTarget VALUE
+# Static methods:
+# {{{ sub BaseIsLocal
-Set Target to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Target will be stored as a varchar(240).)
+=head2 BaseIsLocal
+Returns true if the base of this link is a local ticket
=cut
+sub BaseIsLocal {
+ my $self = shift;
+ return $self->_IsLocal($self->Base);
+}
-=item Type
-
-Returns the current value of Type.
-(In the database, Type is stored as varchar(20).)
-
-
-
-=item SetType VALUE
+# }}}
+# {{{ sub TargetIsLocal
-Set Type to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Type will be stored as a varchar(20).)
+=head2 TargetIsLocal
+Returns true if the target of this link is a local ticket
=cut
+sub TargetIsLocal {
+ my $self = shift;
+ return $self->_IsLocal($self->Target);
+}
-=item LocalTarget
-
-Returns the current value of LocalTarget.
-(In the database, LocalTarget is stored as int(11).)
-
-
-
-=item SetLocalTarget VALUE
+# }}}
+# {{{ sub _IsLocal
-Set LocalTarget to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, LocalTarget will be stored as a int(11).)
+=head2 _IsLocal URI
+When handed a URI returns the local ticket id if it\'s local. otherwise returns undef.
=cut
+sub _IsLocal {
+ my $self = shift;
+ my $URI=shift;
+ unless ($URI) {
+ $RT::Logger->warning ("$self _IsLocal called without a URI\n");
+ return (undef);
+ }
+ # TODO: More thorough check
+ if ($URI =~ /^$RT::TicketBaseURI(\d+)$/) {
+ return($1);
+ }
+ else {
+ return (undef);
+ }
+}
+# }}}
-=item LocalBase
-
-Returns the current value of LocalBase.
-(In the database, LocalBase is stored as int(11).)
-
-
-
-=item SetLocalBase VALUE
+# {{{ sub BaseAsHREF
-Set LocalBase to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, LocalBase will be stored as a int(11).)
+=head2 BaseAsHREF
+Returns an HTTP url to access the base of this link
=cut
+sub BaseAsHREF {
+ my $self = shift;
+ return $self->AsHREF($self->Base);
+}
+# }}}
-=item LastUpdatedBy
+# {{{ sub TargetAsHREF
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+=head2 TargetAsHREF
+return an HTTP url to access the target of this link
=cut
+sub TargetAsHREF {
+ my $self = shift;
+ return $self->AsHREF($self->Target);
+}
+# }}}
-=item LastUpdated
-
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+# {{{ sub AsHREF - Converts Link URIs to HTTP URLs
+=head2 URI
+Takes a URI and returns an http: url to access that object.
=cut
+sub AsHREF {
+ my $self=shift;
+ my $URI=shift;
+ if ($self->_IsLocal($URI)) {
+ my $url=$RT::WebURL . "Ticket/Display.html?id=$URI";
+ return($url);
+ }
+ else {
+ my ($protocol) = $URI =~ m|(.*?)://|;
+ unless (exists $RT::URI2HTTP{$protocol}) {
+ $RT::Logger->warning("Linking for protocol $protocol not defined in the config file!");
+ return("");
+ }
+ return $RT::URI2HTTP{$protocol}->($URI);
+ }
+}
+# }}}
+
+# {{{ sub GetContent - gets the content from a link
+sub GetContent {
+ my ($self, $URI)= @_;
+ if ($self->_IsLocal($URI)) {
+ die "stub";
+ } else {
+ # Find protocol
+ if ($URI =~ m|^(.*?)://|) {
+ if (exists $RT::ContentFromURI{$1}) {
+ return $RT::ContentFromURI{$1}->($URI);
+ } else {
+ warn "No sub exists for fetching the content from a $1 in $URI";
+ }
+ } else {
+ warn "No protocol specified in $URI";
+ }
+ }
+}
+# }}}
-=item Creator
-
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
-
-
-=cut
-
+# {{{ sub CanonicalizeURI
-=item Created
+=head2 CanonicalizeURI
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+Takes a single argument: some form of ticket identifier.
+Returns its canonicalized URI.
+Bug: ticket aliases can't have :// in them. URIs must have :// in them.
=cut
-
-
-sub _ClassAccessible {
- {
+sub CanonicalizeURI {
+ my $self = shift;
+ my $id = shift;
+
+
+ #If it's a local URI, load the ticket object and return its URI
+ if ($id =~ /^$RT::TicketBaseURI/) {
+ my $ticket = new RT::Ticket($self->CurrentUser);
+ $ticket->Load($id);
+ #If we couldn't find a ticket, return undef.
+ return undef unless (defined $ticket->Id);
+ #$RT::Logger->debug("$self -> CanonicalizeURI was passed $id and returned ".$ticket->URI ." (uri)\n");
+ return ($ticket->URI);
+ }
+ #If it's a remote URI, we're going to punt for now
+ elsif ($id =~ '://' ) {
+ return ($id);
+ }
+
+ #If the base is an integer, load it as a ticket
+ elsif ( $id =~ /^\d+$/ ) {
+
+ #$RT::Logger->debug("$self -> CanonicalizeURI was passed $id. It's a ticket id.\n");
+ my $ticket = new RT::Ticket($self->CurrentUser);
+ $ticket->Load($id);
+ #If we couldn't find a ticket, return undef.
+ return undef unless (defined $ticket->Id);
+ #$RT::Logger->debug("$self returned ".$ticket->URI ." (id #)\n");
+ return ($ticket->URI);
+ }
+
+ #It's not a URI. It's not a numerical ticket ID
+ else {
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Base =>
- {read => 1, write => 1, type => 'varchar(240)', default => ''},
- Target =>
- {read => 1, write => 1, type => 'varchar(240)', default => ''},
- Type =>
- {read => 1, write => 1, type => 'varchar(20)', default => ''},
- LocalTarget =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- LocalBase =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::Link_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Link_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Link_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Link_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Link_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Link_Local.pm}) {
- die $@;
- };
-
-
-
+ #If we couldn't find a ticket, return undef.
+ return( undef);
+
+ }
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::Link_Overlay, RT::Link_Vendor, RT::Link_Local
-
-=cut
+
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/Links.pm b/rt/lib/RT/Links.pm
index 7a1773af9..a8180caf0 100644
--- a/rt/lib/RT/Links.pm
+++ b/rt/lib/RT/Links.pm
@@ -1,115 +1,90 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Links.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Links -- Class Description
-
+ RT::Links - A collection of Link objects
+
=head1 SYNOPSIS
- use RT::Links
+ use RT::Links;
+ my $links = new RT::Links($CurrentUser);
=head1 DESCRIPTION
=head1 METHODS
-=cut
-package RT::Links;
+=begin testing
-use RT::SearchBuilder;
-use RT::Link;
-
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+ok (require RT::TestHarness);
+ok (require RT::Links);
+=end testing
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Links';
- $self->{'primary_key'} = 'id';
+=cut
+package RT::Links;
+use RT::EasySearch;
+use RT::Link;
- return ( $self->SUPER::_Init(@_) );
-}
+@ISA= qw(RT::EasySearch);
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "Links";
+ $self->{'primary_key'} = "id";
-=item NewItem
-Returns an empty new RT::Link item
+ return ( $self->SUPER::_Init(@_));
+}
+# }}}
-=cut
+# {{{ sub Limit
+sub Limit {
+ my $self = shift;
+ my %args = ( ENTRYAGGREGATOR => 'AND',
+ OPERATOR => '=',
+ @_);
+
+ #if someone's trying to search for tickets, try to resolve the uris for searching.
+
+ if ( ( $args{'OPERATOR'} eq '=') and
+ ( $args{'FIELD'} eq 'Base') or ($args{'FIELD'} eq 'Target')
+ ) {
+ my $dummy = $self->NewItem();
+ $uri = $dummy->CanonicalizeURI($args{'VALUE'});
+ }
+
+
+ # If we're limiting by target, order by base
+ # (Order by the thing that's changing)
+
+ if ( ($args{'FIELD'} eq 'Target') or
+ ($args{'FIELD'} eq 'LocalTarget') ) {
+ $self->OrderBy (ALIAS => 'main',
+ FIELD => 'Base',
+ ORDER => 'ASC');
+ }
+ elsif ( ($args{'FIELD'} eq 'Base') or
+ ($args{'FIELD'} eq 'LocalBase') ) {
+ $self->OrderBy (ALIAS => 'main',
+ FIELD => 'Target',
+ ORDER => 'ASC');
+ }
+
+
+ $self->SUPER::Limit(%args);
+}
+# }}}
-sub NewItem {
+# {{{ sub NewItem
+sub NewItem {
my $self = shift;
return(RT::Link->new($self->CurrentUser));
}
+# }}}
+ 1;
- eval "require RT::Links_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Links_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Links_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Links_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Links_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Links_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::Links_Overlay, RT::Links_Vendor, RT::Links_Local
-
-=cut
-
-
-1;
diff --git a/rt/lib/RT/ObjectKeyword.pm b/rt/lib/RT/ObjectKeyword.pm
new file mode 100644
index 000000000..287d41fab
--- /dev/null
+++ b/rt/lib/RT/ObjectKeyword.pm
@@ -0,0 +1,192 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/ObjectKeyword.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Released under the terms of the GNU Public License
+
+=head1 NAME
+
+ RT::ObjectKeyword -- a keyword tied to an object in the database
+
+=head1 SYNOPSIS
+
+ use RT::ObjectKeyword;
+
+
+=head1 DESCRIPTION
+
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in Ticket, Queue and other similar objects.
+
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::ObjectKeyword);
+
+=end testing
+
+=head1 METHODS
+
+=cut
+
+package RT::ObjectKeyword;
+
+use strict;
+use vars qw(@ISA);
+use RT::Record;
+
+@ISA = qw(RT::Record);
+
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ObjectKeywords";
+ $self->SUPER::_Init(@_);
+}
+
+sub _Accessible {
+ my $self = shift;
+
+ my %cols = (
+ Keyword => 'read/write', #link to the B<RT::Keyword>
+ KeywordSelect => 'read/write', #link to the B<RT::KeywordSelect>
+ ObjectType => 'read/write', #currently only C<Ticket>
+ ObjectId => 'read/write', #link to the object specified in I<ObjectType>
+ );
+ return ($self->SUPER::_Accessible( @_, %cols));
+}
+
+
+
+# TODO - post 2.0. add in _Set and _Value, so we can ACL them. protected at another API level
+
+
+=head1 NAME
+
+ RT::ObjectKeyword - Manipulate an RT::ObjectKeyword record
+
+=head1 SYNOPSIS
+
+ use RT::ObjectKeyword;
+
+ my $keyword = RT::ObjectKeyword->new($CurrentUser);
+ $keyword->Create;
+
+=head1 DESCRIPTION
+
+An B<RT::ObjectKeyword> object associates an B<RT::Keyword> with another
+object (currently only B<RT::Ticket>.
+
+This module should B<NEVER> be called directly by client code. its API is entirely through RT ticket or other objects which can have keywords assigned.
+
+
+=head1 METHODS
+
+=over 4
+
+=item new CURRENT_USER
+
+Takes a single argument, an RT::CurrentUser object. Instantiates a new
+(uncreated) RT::ObjectKeyword object.
+
+=cut
+
+# {{{ sub Create
+
+=item Create KEY => VALUE, ...
+
+Takes a list of key/value pairs and creates a the object. Returns the id of
+the newly created record, or false if there was an error.
+
+Keys are:
+
+Keyword - link to the B<RT::Keyword>
+ObjectType - currently only C<Ticket>
+ObjectId - link to the object specified in I<ObjectType>
+
+=cut
+
+
+sub Create {
+ my $self = shift;
+ my %args = (Keyword => undef,
+ KeywordSelect => undef,
+ ObjectType => undef,
+ ObjectId => undef,
+ @_);
+
+ #TODO post 2.0 ACL check
+
+ return ($self->SUPER::Create( Keyword => $args{'Keyword'},
+ KeywordSelect => $args{'KeywordSelect'},
+ ObjectType => $args{'ObjectType'},
+ ObjectId => $args{'ObjectId'}))
+}
+# }}}
+
+# {{{ sub KeywordObj
+
+=item KeywordObj
+
+Returns an B<RT::Keyword> object of the Keyword associated with this ObjectKeyword.
+
+=cut
+
+sub KeywordObj {
+ my $self = shift;
+ my $keyword = new RT::Keyword($self->CurrentUser);
+ $keyword->Load($self->Keyword);
+ return ($keyword);
+}
+# }}}
+
+# {{{ sub KeywordSelectObj
+
+=item KeywordSelectObj
+
+Returns an B<RT::KeywordSelect> object of the KeywordSelect associated with this ObjectKeyword.
+
+=cut
+
+sub KeywordSelectObj {
+ my $self = shift;
+ my $keyword_sel = new RT::KeywordSelect($self->CurrentUser);
+ $keyword_sel->Load($self->KeywordSelect);
+ return ($keyword_sel);
+}
+# }}}
+
+# {{{ sub KeywordRelativePath
+
+=item KeywordRelativePath
+
+Returns a string of the Keyword's path relative to this ObjectKeyword's KeywordSelect
+
+
+
+=cut
+
+sub KeywordRelativePath {
+ my $self = shift;
+ return($self->KeywordObj->RelativePath(
+ $self->KeywordSelectObj->KeywordObj->Path));
+
+}
+# }}}
+
+=back
+
+=head1 AUTHOR
+
+Ivan Kohler <ivan-rt@420.am>
+
+=head1 BUGS
+
+Yes.
+
+=head1 SEE ALSO
+
+L<RT::ObjectKeywords>, L<RT::Keyword>, L<RT::Keywords>, L<RT::Ticket>,
+L<RT::Record>
+
+=cut
+
+1;
+
diff --git a/rt/lib/RT/ObjectKeywords.pm b/rt/lib/RT/ObjectKeywords.pm
new file mode 100644
index 000000000..5df996e37
--- /dev/null
+++ b/rt/lib/RT/ObjectKeywords.pm
@@ -0,0 +1,234 @@
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/ObjectKeywords.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
+package RT::ObjectKeywords;
+
+use strict;
+use vars qw( @ISA );
+
+=head1 NAME
+
+ RT::ObjectKeywords - note warning
+
+=head1 WARNING
+
+This module should B<NEVER> be called directly by client code. its API is entirely through RT ticket or other objects which can have keywords assigned.
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::ObjectKeywords);
+
+=end testing
+
+=cut
+
+use RT::EasySearch;
+use RT::ObjectKeyword;
+
+@ISA = qw( RT::EasySearch );
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = 'ObjectKeywords';
+ $self->{'primary_key'} = 'id';
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return (new RT::ObjectKeyword($self->CurrentUser));
+}
+# }}}
+
+# {{{ sub LimitToKeywordSelect
+
+=head2 LimitToKeywordSelect
+
+ Takes a B<RT::KeywordSelect> id or Nameas its single argument. limits the returned set of ObjectKeywords
+to ObjectKeywords which apply to that ticket
+
+=cut
+
+
+sub LimitToKeywordSelect {
+ my $self = shift;
+ my $keywordselect = shift;
+
+ if ($keywordselect =~ /^\d+$/) {
+
+ $self->Limit(FIELD => 'KeywordSelect',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => "$keywordselect");
+ }
+
+ #We're limiting by name. time to be klever
+ else {
+ my $ks = $self->NewAlias('KeywordSelects');
+ $self->Join(ALIAS1 => $ks, FIELD1 => 'id',
+ ALIAS2 => 'main', FIELD2 => 'KeywordSelect');
+
+ $self->Limit( ALIAS => "$ks",
+ FIELD => 'Name',
+ VALUE => "$keywordselect",
+ OPERATOR => "=",
+ ENTRYAGGREGATOR => "OR");
+
+ $self->Limit ( ALIAS => "$ks",
+ FIELD => 'ObjectType',
+ VALUE => 'Ticket',
+ OPERATOR => '=',
+ );
+
+ $self->Limit ( ALIAS => "$ks",
+ FIELD => 'ObjectField',
+ VALUE => 'Queue',
+ OPERATOR => '=',
+ );
+
+
+ # TODO +++ we need to be able to limit the returned
+ # keywordselects to ones that apply only to this queue
+ # $self->Limit( ALIAS => "$ks",
+ # FIELD => 'ObjectValue',
+ # VALUE => $self->QueueObj->Id,
+ # OPERATOR => "=",
+ # ENTRYAGGREGATOR => "OR");
+
+ }
+
+
+
+}
+
+# }}}
+
+# {{{ LimitToTicket
+
+=head2 LimitToTicket TICKET_ID
+
+ Takes an B<RT::Ticket> id as its single argument. limits the returned set of ObjectKeywords
+to ObjectKeywords which apply to that ticket
+
+=cut
+
+sub LimitToTicket {
+ my $self = shift;
+ my $ticket = shift;
+ $self->Limit(FIELD => 'ObjectId',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => "$ticket");
+
+ $self->Limit(FIELD => 'ObjectType',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => "Ticket");
+
+}
+
+# }}}
+
+# {{{ sub _DoSearch
+#wrap around _DoSearch so that we can build the hash of returned
+#values
+
+sub _DoSearch {
+ my $self = shift;
+ # $RT::Logger->debug("Now in ".$self."->_DoSearch");
+ my $return = $self->SUPER::_DoSearch(@_);
+ # $RT::Logger->debug("In $self ->_DoSearch. return from SUPER::_DoSearch was $return\n");
+ $self->_BuildHash();
+ return ($return);
+}
+# }}}
+
+# {{{ sub _BuildHash
+#Build a hash of this ACL's entries.
+sub _BuildHash {
+ my $self = shift;
+
+ while (my $entry = $self->Next) {
+
+ my $hashkey = $entry->Keyword;
+ $self->{'as_hash'}->{"$hashkey"} =1;
+ }
+
+}
+# }}}
+
+# {{{ HasEntry
+
+=head2 HasEntry KEYWORD_ID
+
+ Takes a keyword id and returns true if this ObjectKeywords object has an entry for that
+keyword. Returns undef otherwise.
+
+=cut
+
+sub HasEntry {
+
+ my $self = shift;
+ my $keyword = shift;
+
+
+ #if we haven't done the search yet, do it now.
+ $self->_DoSearch();
+
+ # $RT::Logger->debug("Now in ".$self."->HasEntry\n");
+
+
+ if ($self->{'as_hash'}->{ $keyword } == 1) {
+ return(1);
+ }
+ else {
+ return(undef);
+ }
+}
+
+# }}}
+
+# {{{ sub RelativePaths
+
+=head2 RelativePaths
+
+# Return a (reference to a) list of KeywordRelativePaths
+
+=cut
+
+sub RelativePaths {
+ my $self = shift;
+
+ my @list;
+
+ # Here $key is a RT::ObjectKeyword
+ while (my $key=$self->Next()) {
+ push(@list, $key->KeywordRelativePath);
+ }
+ return(\@list);
+}
+# }}}
+
+# {{{ sub RelativePathsAsString
+
+=head2 RelativePathsAsString
+
+# Returns the RT::ObjectKeywords->RelativePaths as a comma seperated string
+
+=cut
+
+sub RelativePathsAsString {
+ my $self = shift;
+ return(join(", ",@{$self->KeywordRelativePaths}));
+}
+# }}}
+
+1;
+
diff --git a/rt/lib/RT/Queue.pm b/rt/lib/RT/Queue.pm
index b362c9f0d..1656903b3 100755
--- a/rt/lib/RT/Queue.pm
+++ b/rt/lib/RT/Queue.pm
@@ -1,371 +1,944 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Queue.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
-RT::Queue
-
+ RT::Queue - an RT Queue object
=head1 SYNOPSIS
+ use RT::Queue;
+
=head1 DESCRIPTION
+
=head1 METHODS
+=begin testing
+use RT::TestHarness;
+
+use RT::Queue;
+
+=end testing
+
=cut
+
+
package RT::Queue;
-use RT::Record;
+use RT::Record;
+
+@ISA= qw(RT::Record);
+
+use vars (@STATUS);
+
+@STATUS = qw(new open stalled resolved dead);
+
+=head2 StatusArray
+
+Returns an array of all statuses for this queue
+
+=cut
+
+sub StatusArray {
+ my $self = shift;
+ return (@STATUS);
+}
+
+
+=head2 IsValidStatus VALUE
+
+Returns true if VALUE is a valid status. Otherwise, returns 0
+
+=for testing
+my $q = new RT::Queue($RT::SystemUser);
+ok($q->IsValidStatus('new')== 1, 'New is a valid status');
+ok($q->IsValidStatus('f00')== 0, 'f00 is not a valid status');
+
+=cut
+
+sub IsValidStatus {
+ my $self = shift;
+ my $value = shift;
+
+ my $retval = grep (/^$value$/, $self->StatusArray);
+ return ($retval);
+
+}
+
+
+
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Queues";
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub _Accessible
+
+sub _Accessible {
+ my $self = shift;
+ my %Cols = ( Name => 'read/write',
+ CorrespondAddress => 'read/write',
+ Description => 'read/write',
+ CommentAddress => 'read/write',
+ InitialPriority => 'read/write',
+ FinalPriority => 'read/write',
+ DefaultDueIn => 'read/write',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto',
+ Disabled => 'read/write',
+
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
+}
+
+# }}}
+# {{{ sub Create
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+=head2 Create
-sub _Init {
- my $self = shift;
+Create takes the name of the new queue
+If you pass the ACL check, it creates the queue and returns its queue id.
- $self->Table('Queues');
- $self->SUPER::_Init(@_);
+=cut
+
+sub Create {
+ my $self = shift;
+ my %args = ( Name => undef,
+ CorrespondAddress => '',
+ Description => '',
+ CommentAddress => '',
+ InitialPriority => "0",
+ FinalPriority => "0",
+ DefaultDueIn => "0",
+ @_);
+
+ unless ($self->CurrentUser->HasSystemRight('AdminQueue')) { #Check them ACLs
+ return (0, "No permission to create queues")
+ }
+
+ unless ($self->ValidateName($args{'Name'})) {
+ return(0, 'Queue already exists');
+ }
+ #TODO better input validation
+
+ my $id = $self->SUPER::Create(%args);
+ unless ($id) {
+ return (0, 'Queue could not be created');
+ }
+
+ return ($id, "Queue $id created");
}
+# }}}
+# {{{ sub Delete
+sub Delete {
+ my $self = shift;
+ return (0, 'Deleting this object would break referential integrity');
+}
+# }}}
-=item Create PARAMHASH
+# {{{ sub SetDisabled
-Create takes a hash of values and creates a row in the database:
+=head2 SetDisabled
- varchar(200) 'Name'.
- varchar(255) 'Description'.
- varchar(120) 'CorrespondAddress'.
- varchar(120) 'CommentAddress'.
- int(11) 'InitialPriority'.
- int(11) 'FinalPriority'.
- int(11) 'DefaultDueIn'.
- smallint(6) 'Disabled'.
+Takes a boolean.
+1 will cause this queue to no longer be avaialble for tickets.
+0 will re-enable this queue
=cut
+# }}}
+# {{{ sub Load
+=head2 Load
-sub Create {
+Takes either a numerical id or a textual Name and loads the specified queue.
+
+=cut
+
+sub Load {
my $self = shift;
- my %args = (
- Name => '',
- Description => '',
- CorrespondAddress => '',
- CommentAddress => '',
- InitialPriority => '0',
- FinalPriority => '0',
- DefaultDueIn => '0',
- Disabled => '0',
+
+ my $identifier = shift;
+ if (!$identifier) {
+ return (undef);
+ }
+
+ if ($identifier !~ /\D/) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ $self->LoadByCol("Name", $identifier);
+ }
+
+ return ($self->Id);
- @_);
- $self->SUPER::Create(
- Name => $args{'Name'},
- Description => $args{'Description'},
- CorrespondAddress => $args{'CorrespondAddress'},
- CommentAddress => $args{'CommentAddress'},
- InitialPriority => $args{'InitialPriority'},
- FinalPriority => $args{'FinalPriority'},
- DefaultDueIn => $args{'DefaultDueIn'},
- Disabled => $args{'Disabled'},
-);
}
+# }}}
+# {{{ sub ValidateName
+=head2 ValidateName NAME
-=item id
+Takes a queue name. Returns true if it's an ok name for
+a new queue. Returns undef if there's already a queue by that name.
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+=cut
+sub ValidateName {
+ my $self = shift;
+ my $name = shift;
+
+ my $tempqueue = new RT::Queue($RT::SystemUser);
+ $tempqueue->Load($name);
+
+ #If we couldn't load it :)
+ unless ($tempqueue->id()) {
+ return(1);
+ }
+
+ #If this queue exists, return undef
+ #Avoid the ACL check.
+ if ($tempqueue->Name()){
+ return(undef);
+ }
+
+ #If the queue doesn't exist, return 1
+ else {
+ return(1);
+ }
+
+}
+
+
+# }}}
+
+# {{{ sub Templates
+
+=head2 Templates
+
+Returns an RT::Templates object of all of this queue's templates.
=cut
+sub Templates {
+ my $self = shift;
+
-=item Name
+ my $templates = RT::Templates->new($self->CurrentUser);
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
+ if ($self->CurrentUserHasRight('ShowTemplate')) {
+ $templates->LimitToQueue($self->id);
+ }
+
+ return ($templates);
+}
+
+# }}}
+# {{{ Dealing with watchers
+# {{{ sub Watchers
-=item SetName VALUE
+=head2 Watchers
+Watchers returns a Watchers object preloaded with this queue\'s watchers.
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
+=cut
+sub Watchers {
+ my $self = shift;
+
+ require RT::Watchers;
+ my $watchers =RT::Watchers->new($self->CurrentUser);
+
+ if ($self->CurrentUserHasRight('SeeQueue')) {
+ $watchers->LimitToQueue($self->id);
+ }
+
+ return($watchers);
+}
+
+# }}}
+
+# {{{ sub WatchersAsString
+=head2 WatchersAsString
+
+Returns a string of all queue watchers email addresses concatenated with ','s.
=cut
+sub WatchersAsString {
+ my $self=shift;
+ return($self->Watchers->EmailsAsString());
+}
+
+# }}}
+
+# {{{ sub AdminCcAsString
-=item Description
+=head2 AdminCcAsString
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
+Takes nothing. returns a string: All Ticket/Queue AdminCcs.
+=cut
-=item SetDescription VALUE
+sub AdminCcAsString {
+ my $self=shift;
+
+ return($self->AdminCc->EmailsAsString());
+ }
+# }}}
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
+# {{{ sub CcAsString
+=head2 CcAsString
+
+B<Returns> String: All Queue Ccs as a comma delimited set of email addresses.
=cut
+sub CcAsString {
+ my $self=shift;
+
+ return ($self->Cc->EmailsAsString());
+}
+
+# }}}
+
+# {{{ sub Cc
+
+=head2 Cc
+
+Takes nothing.
+Returns a watchers object which contains this queue\'s Cc watchers
-=item CorrespondAddress
+=cut
-Returns the current value of CorrespondAddress.
-(In the database, CorrespondAddress is stored as varchar(120).)
+sub Cc {
+ my $self = shift;
+ my $cc = $self->Watchers();
+ if ($self->CurrentUserHasRight('SeeQueue')) {
+ $cc->LimitToCc();
+ }
+ return ($cc);
+}
+# A helper function for Cc, so that we can call it from the ACL checks
+# without going through acl checks.
+sub _Cc {
+ my $self = shift;
+ my $cc = $self->Watchers();
+ $cc->LimitToCc();
+ return($cc);
+
+}
-=item SetCorrespondAddress VALUE
+# }}}
+# {{{ sub AdminCc
-Set CorrespondAddress to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, CorrespondAddress will be stored as a varchar(120).)
+=head2 AdminCc
+Takes nothing.
+Returns this queue's administrative Ccs as an RT::Watchers object
=cut
+sub AdminCc {
+ my $self = shift;
+ my $admin_cc = $self->Watchers();
+ if ($self->CurrentUserHasRight('SeeQueue')) {
+ $admin_cc->LimitToAdminCc();
+ }
+ return($admin_cc);
+}
+
+#helper function for AdminCc so we can call it without ACLs
+sub _AdminCc {
+ my $self = shift;
+ my $admin_cc = $self->Watchers();
+ $admin_cc->LimitToAdminCc();
+ return($admin_cc);
+}
-=item CommentAddress
+# }}}
-Returns the current value of CommentAddress.
-(In the database, CommentAddress is stored as varchar(120).)
+# {{{ IsWatcher, IsCc, IsAdminCc
+
+# {{{ sub IsWatcher
+
+# a generic routine to be called by IsRequestor, IsCc and IsAdminCc
+
+=head2 IsWatcher
+
+Takes a param hash with the attributes Type and User. User is either a user object or string containing an email address. Returns true if that user or string
+is a queue watcher. Returns undef otherwise
+
+=cut
+
+sub IsWatcher {
+ my $self = shift;
+
+ my %args = ( Type => 'Requestor',
+ Id => undef,
+ Email => undef,
+ @_
+ );
+ #ACL check - can't do it. we need this method for ACL checks
+ # unless ($self->CurrentUserHasRight('SeeQueue')) {
+ # return(undef);
+ # }
+
+
+ my %cols = ('Type' => $args{'Type'},
+ 'Scope' => 'Queue',
+ 'Value' => $self->Id
+ );
+ if (defined ($args{'Id'})) {
+ if (ref($args{'Id'})){ #If it's a ref, assume it's an RT::User object;
+ #Dangerous but ok for now
+ $cols{'Owner'} = $args{'Id'}->Id;
+ }
+ elsif ($args{'Id'} =~ /^\d+$/) { # if it's an integer, it's an RT::User obj
+ $cols{'Owner'} = $args{'Id'};
+ }
+ else {
+ $cols{'Email'} = $args{'Id'};
+ }
+ }
+
+ if (defined $args{'Email'}) {
+ $cols{'Email'} = $args{'Email'};
+ }
+
+ my ($description);
+ $description = join(":",%cols);
+
+ #If we've cached a positive match...
+ if (defined $self->{'watchers_cache'}->{"$description"}) {
+ if ($self->{'watchers_cache'}->{"$description"} == 1) {
+ return(1);
+ }
+ #If we've cached a negative match...
+ else {
+ return(undef);
+ }
+ }
+
+ require RT::Watcher;
+ my $watcher = new RT::Watcher($self->CurrentUser);
+ $watcher->LoadByCols(%cols);
+
+
+ if ($watcher->id) {
+ $self->{'watchers_cache'}->{"$description"} = 1;
+ return(1);
+ }
+ else {
+ $self->{'watchers_cache'}->{"$description"} = 0;
+ return(undef);
+ }
+
+}
+# }}}
+# {{{ sub IsCc
-=item SetCommentAddress VALUE
+=head2 IsCc
+Takes a string. Returns true if the string is a Cc watcher of the current queue
-Set CommentAddress to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, CommentAddress will be stored as a varchar(120).)
+=item Bugs
+Should also be able to handle an RT::User object
=cut
-=item InitialPriority
+sub IsCc {
+ my $self = shift;
+ my $cc = shift;
+
+ return ($self->IsWatcher( Type => 'Cc', Id => $cc ));
+
+}
+
+# }}}
+
+# {{{ sub IsAdminCc
+
+=head2 IsAdminCc
+
+Takes a string. Returns true if the string is an AdminCc watcher of the current queue
-Returns the current value of InitialPriority.
-(In the database, InitialPriority is stored as int(11).)
+=item Bugs
+Should also be able to handle an RT::User object
+
+=cut
+
+sub IsAdminCc {
+ my $self = shift;
+ my $admincc = shift;
+
+ return ($self->IsWatcher( Type => 'AdminCc', Id => $admincc ));
+
+}
+# }}}
-=item SetInitialPriority VALUE
+# }}}
+# {{{ sub AddWatcher
-Set InitialPriority to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, InitialPriority will be stored as a int(11).)
+=head2 AddWatcher
+Takes a paramhash of Email, Owner and Type. Type is one of 'Cc' or 'AdminCc',
+We need either an Email Address in Email or a userid in Owner
=cut
+sub AddWatcher {
+ my $self = shift;
+ my %args = ( Email => undef,
+ Type => undef,
+ Owner => 0,
+ @_
+ );
+
+ # {{{ Check ACLS
+ #If the watcher we're trying to add is for the current user
+ if ( ( ( defined $args{'Email'}) &&
+ ( $args{'Email'} eq $self->CurrentUser->EmailAddress) ) or
+ ($args{'Owner'} eq $self->CurrentUser->Id)) {
+
+ # If it's an AdminCc and they don't have
+ # 'WatchAsAdminCc' or 'ModifyQueueWatchers', bail
+ if ($args{'Type'} eq 'AdminCc') {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers') or
+ $self->CurrentUserHasRight('WatchAsAdminCc')) {
+ return(0, 'Permission Denied');
+ }
+ }
+
+ # If it's a Requestor or Cc and they don't have
+ # 'Watch' or 'ModifyQueueWatchers', bail
+ elsif ($args{'Type'} eq 'Cc') {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers') or
+ $self->CurrentUserHasRight('Watch')) {
+ return(0, 'Permission Denied');
+ }
+ }
+ else {
+ $RT::Logger->warn("$self -> AddWatcher hit code".
+ " it never should. We got passed ".
+ " a type of ". $args{'Type'});
+ return (0,'Error in parameters to $self AddWatcher');
+ }
+ }
+ # If the watcher isn't the current user
+ # and the current user doesn't have 'ModifyQueueWatchers'
+ # bail
+ else {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers')) {
+ return (0, "Permission Denied");
+ }
+ }
+ # }}}
+
+ require RT::Watcher;
+ my $Watcher = new RT::Watcher ($self->CurrentUser);
+ return ($Watcher->Create(Scope => 'Queue',
+ Value => $self->Id,
+ Email => $args{'Email'},
+ Type => $args{'Type'},
+ Owner => $args{'Owner'}
+ ));
+}
-=item FinalPriority
+# }}}
-Returns the current value of FinalPriority.
-(In the database, FinalPriority is stored as int(11).)
+# {{{ sub AddCc
+=head2 AddCc
+Add a Cc to this queue.
+Takes a paramhash of Email and Owner.
+We need either an Email Address in Email or a userid in Owner
-=item SetFinalPriority VALUE
+=cut
-Set FinalPriority to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, FinalPriority will be stored as a int(11).)
+sub AddCc {
+ my $self = shift;
+ return ($self->AddWatcher( Type => 'Cc', @_));
+}
+# }}}
+# {{{ sub AddAdminCc
+
+=head2 AddAdminCc
+
+Add an Administrative Cc to this queue.
+Takes a paramhash of Email and Owner.
+We need either an Email Address in Email or a userid in Owner
=cut
+sub AddAdminCc {
+ my $self = shift;
+ return ($self->AddWatcher( Type => 'AdminCc', @_));
+}
+# }}}
+
+# {{{ sub DeleteWatcher
+
+=head2 DeleteWatcher id [type]
-=item DefaultDueIn
+DeleteWatcher takes a single argument which is either an email address
+or a watcher id.
+If the first argument is an email address, you need to specify the watcher type you're talking
+about as the second argument. Valid values are 'Cc' or 'AdminCc'.
+It removes that watcher from this Queue\'s list of watchers.
-Returns the current value of DefaultDueIn.
-(In the database, DefaultDueIn is stored as int(11).)
+=cut
-=item SetDefaultDueIn VALUE
+sub DeleteWatcher {
+ my $self = shift;
+ my $id = shift;
+
+ my $type;
+
+ $type = shift if (@_);
+
+
+ require RT::Watcher;
+ my $Watcher = new RT::Watcher($self->CurrentUser);
+
+ #If it\'s a numeric watcherid
+ if ($id =~ /^(\d*)$/) {
+ $Watcher->Load($id);
+ }
+
+ #Otherwise, we'll assume it's an email address
+ elsif ($type) {
+ my ($result, $msg) =
+ $Watcher->LoadByValue( Email => $id,
+ Scope => 'Queue',
+ Value => $self->id,
+ Type => $type);
+ return (0,$msg) unless ($result);
+ }
+
+ else {
+ return(0,"Can\'t delete a watcher by email address without specifying a type");
+ }
+
+ # {{{ Check ACLS
+
+ #If the watcher we're trying to delete is for the current user
+ if ($Watcher->Email eq $self->CurrentUser->EmailAddress) {
+
+ # If it's an AdminCc and they don't have
+ # 'WatchAsAdminCc' or 'ModifyQueueWatchers', bail
+ if ($Watcher->Type eq 'AdminCc') {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers') or
+ $self->CurrentUserHasRight('WatchAsAdminCc')) {
+ return(0, 'Permission Denied');
+ }
+ }
+
+ # If it's a Cc and they don't have
+ # 'Watch' or 'ModifyQueueWatchers', bail
+ elsif ($Watcher->Type eq 'Cc') {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers') or
+ $self->CurrentUserHasRight('Watch')) {
+ return(0, 'Permission Denied');
+ }
+ }
+ else {
+ $RT::Logger->warn("$self -> DeleteWatcher hit code".
+ " it never should. We got passed ".
+ " a type of ". $args{'Type'});
+ return (0,'Error in parameters to $self DeleteWatcher');
+ }
+ }
+ # If the watcher isn't the current user
+ # and the current user doesn't have 'ModifyQueueWatchers'
+ # bail
+ else {
+ unless ($self->CurrentUserHasRight('ModifyQueueWatchers')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ # }}}
+
+ unless (($Watcher->Scope eq 'Queue') and
+ ($Watcher->Value == $self->id) ) {
+ return (0, "Not a watcher for this queue");
+ }
+
+
+ #Clear out the watchers hash.
+ $self->{'watchers'} = undef;
+
+ my $retval = $Watcher->Delete();
+
+ unless ($retval) {
+ return(0,"Watcher could not be deleted.");
+ }
+
+ return(1, "Watcher deleted");
+}
+
+# {{{ sub DeleteCc
+=head2 DeleteCc EMAIL
-Set DefaultDueIn to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, DefaultDueIn will be stored as a int(11).)
+Takes an email address. It calls DeleteWatcher with a preset
+type of 'Cc'
=cut
+sub DeleteCc {
+ my $self = shift;
+ my $id = shift;
+ return ($self->DeleteWatcher ($id, 'Cc'))
+}
+
+# }}}
-=item Creator
+# {{{ sub DeleteAdminCc
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+=head2 DeleteAdminCc EMAIL
+
+Takes an email address. It calls DeleteWatcher with a preset
+type of 'AdminCc'
=cut
+sub DeleteAdminCc {
+ my $self = shift;
+ my $id = shift;
+ return ($self->DeleteWatcher ($id, 'AdminCc'))
+}
-=item Created
+# }}}
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+# }}}
+
+# }}}
+
+# {{{ Dealing with keyword selects
+
+# {{{ sub AddKeywordSelect
+
+=head2 AddKeywordSelect
+
+Takes a paramhash of Name, Keyword, Depth and Single. Adds a new KeywordSelect for
+this queue with those attributes.
=cut
-=item LastUpdatedBy
+sub AddKeywordSelect {
+ my $self = shift;
+ my %args = ( Keyword => undef,
+ Depth => undef,
+ Single => undef,
+ Name => undef,
+ @_);
+
+ #ACLS get handled in KeywordSelect
+ my $NewKeywordSelect = new RT::KeywordSelect($self->CurrentUser);
+
+ return ($NewKeywordSelect->Create (Keyword => $args{'Keyword'},
+ Depth => $args{'Depth'},
+ Name => $args{'Name'},
+ Single => $args{'Single'},
+ ObjectType => 'Ticket',
+ ObjectField => 'Queue',
+ ObjectValue => $self->Id()
+ ) );
+}
+
+# }}}
+
+# {{{ sub KeywordSelect
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+=head2 KeywordSelect([NAME])
+Takes the name of a keyword select for this queue or that's global.
+Returns the relevant KeywordSelect object. Prefers a keywordselect that's
+specific to this queue over a global one. If it can't find the proper
+Keword select or the user doesn't have permission, returns an empty
+KeywordSelect object
=cut
+sub KeywordSelect {
+ my $self = shift;
+ my $name = shift;
+
+ require RT::KeywordSelect;
+
+ my $select = RT::KeywordSelect->new($self->CurrentUser);
+ if ($self->CurrentUserHasRight('SeeQueue')) {
+ $select->LoadByName( Name => $name, Queue => $self->Id);
+ }
+ return ($select);
+}
+
-=item LastUpdated
+# }}}
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+# {{{ sub KeywordSelects
+=head2 KeywordSelects
+
+Returns an B<RT::KeywordSelects> object containing the collection of
+B<RT::KeywordSelect> objects which apply to this queue. (Both queue specific keyword selects
+and global keyword selects.
=cut
+sub KeywordSelects {
+ my $self = shift;
-=item Disabled
-Returns the current value of Disabled.
-(In the database, Disabled is stored as smallint(6).)
+ use RT::KeywordSelects;
+ my $KeywordSelects = new RT::KeywordSelects($self->CurrentUser);
+ if ($self->CurrentUserHasRight('SeeQueue')) {
+ $KeywordSelects->LimitToQueue($self->id);
+ $KeywordSelects->IncludeGlobals();
+ }
+ return ($KeywordSelects);
+}
+# }}}
+# }}}
-=item SetDisabled VALUE
+# {{{ ACCESS CONTROL
+# {{{ sub ACL
-Set Disabled to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Disabled will be stored as a smallint(6).)
+=head2 ACL
+#Returns an RT::ACL object of ACEs everyone who has anything to do with this queue.
=cut
+sub ACL {
+ my $self = shift;
+
+ use RT::ACL;
+ my $acl = new RT::ACL($self->CurrentUser);
+
+ if ($self->CurrentUserHasRight('ShowACL')) {
+ $acl->LimitToQueue($self->Id);
+ }
+
+ return ($acl);
+}
+
+# }}}
+
+# {{{ sub _Set
+sub _Set {
+ my $self = shift;
+ unless ($self->CurrentUserHasRight('AdminQueue')) {
+ return(0, 'Permission Denied');
+ }
+ return ($self->SUPER::_Set(@_));
+}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- CorrespondAddress =>
- {read => 1, write => 1, type => 'varchar(120)', default => ''},
- CommentAddress =>
- {read => 1, write => 1, type => 'varchar(120)', default => ''},
- InitialPriority =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- FinalPriority =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- DefaultDueIn =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- Disabled =>
- {read => 1, write => 1, type => 'smallint(6)', default => '0'},
+# {{{ sub _Value
- }
-};
+sub _Value {
+ my $self = shift;
+ unless ($self->CurrentUserHasRight('SeeQueue')) {
+ return (undef);
+ }
- eval "require RT::Queue_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Queue_Overlay.pm}) {
- die $@;
- };
+ return ($self->__Value(@_));
+}
- eval "require RT::Queue_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Queue_Vendor.pm}) {
- die $@;
- };
+# }}}
- eval "require RT::Queue_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Queue_Local.pm}) {
- die $@;
- };
+# {{{ sub CurrentUserHasRight
+=head2 CurrentUserHasRight
+Takes one argument. A textual string with the name of the right we want to check.
+Returns true if the current user has that right for this queue.
+Returns undef otherwise.
+=cut
-=head1 SEE ALSO
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+ return ($self->HasRight( Principal=> $self->CurrentUser,
+ Right => "$right"));
-These overlay files can contain new subs or subs to replace existing subs in this module.
+}
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+# }}}
- no warnings qw(redefine);
+# {{{ sub HasRight
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 HasRight
-RT::Queue_Overlay, RT::Queue_Vendor, RT::Queue_Local
+Takes a param hash with the fields 'Right' and 'Principal'.
+Principal defaults to the current user.
+Returns true if the principal has that right for this queue.
+Returns undef otherwise.
=cut
+# TAKES: Right and optional "Principal" which defaults to the current user
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => $self->CurrentUser,
+ @_);
+ unless(defined $args{'Principal'}) {
+ $RT::Logger->debug("Principal undefined in Queue::HasRight");
+
+ }
+ return($args{'Principal'}->HasQueueRight(QueueObj => $self,
+ Right => $args{'Right'}));
+}
+# }}}
+
+# }}}
1;
diff --git a/rt/lib/RT/Queues.pm b/rt/lib/RT/Queues.pm
index 60aec9086..ab58d8d6d 100755
--- a/rt/lib/RT/Queues.pm
+++ b/rt/lib/RT/Queues.pm
@@ -1,115 +1,123 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Queues.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Queues -- Class Description
-
+ RT::Queues - a collection of RT::Queue objects
+
=head1 SYNOPSIS
- use RT::Queues
+ use RT::Queues;
=head1 DESCRIPTION
=head1 METHODS
-=cut
-package RT::Queues;
+=begin testing
-use RT::SearchBuilder;
-use RT::Queue;
+ok (require RT::TestHarness);
+ok (require RT::Queues);
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=end testing
+=cut
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Queues';
- $self->{'primary_key'} = 'id';
+package RT::Queues;
+use RT::EasySearch;
+@ISA= qw(RT::EasySearch);
+
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Queues";
+ $self->{'primary_key'} = "id";
+ # By default, order by name
+ $self->OrderBy( ALIAS => 'main',
+ FIELD => 'Name',
+ ORDER => 'ASC');
- return ( $self->SUPER::_Init(@_) );
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub _DoSearch
-=item NewItem
+=head2 _DoSearch
-Returns an empty new RT::Queue item
+ A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that _Disabled rows never get seen unless
+we're explicitly trying to see them.
=cut
-sub NewItem {
+sub _DoSearch {
my $self = shift;
- return(RT::Queue->new($self->CurrentUser));
+
+ #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
+ unless($self->{'find_disabled_rows'}) {
+ $self->LimitToEnabled();
+ }
+
+ return($self->SUPER::_DoSearch(@_));
+
}
- eval "require RT::Queues_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Queues_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Queues_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Queues_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Queues_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Queues_Local.pm}) {
- die $@;
- };
+# }}}
+
+# {{{ sub Limit
+sub Limit {
+ my $self = shift;
+ my %args = ( ENTRYAGGREGATOR => 'AND',
+ @_);
+ $self->SUPER::Limit(%args);
+}
+# }}}
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ my $item;
+ use RT::Queue;
+ $item = new RT::Queue($self->CurrentUser);
+ return($item);
+}
+# }}}
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
+# {{{ sub Next
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 Next
-RT::Queues_Overlay, RT::Queues_Vendor, RT::Queues_Local
+Returns the next queue that this user can see.
=cut
-
+
+sub Next {
+ my $self = shift;
+
+
+ my $Queue = $self->SUPER::Next();
+ if ((defined($Queue)) and (ref($Queue))) {
+
+ if ($Queue->CurrentUserHasRight('SeeQueue')) {
+ return($Queue);
+ }
+
+ #If the user doesn't have the right to show this queue
+ else {
+ return($self->Next());
+ }
+ }
+ #if there never was any queue
+ else {
+ return(undef);
+ }
+
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/Record.pm b/rt/lib/RT/Record.pm
index 6962221ea..5340f7de4 100755
--- a/rt/lib/RT/Record.pm
+++ b/rt/lib/RT/Record.pm
@@ -1,26 +1,5 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Record.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+
=head1 NAME
RT::Record - Base class for RT record objects
@@ -41,31 +20,20 @@ ok (require RT::Record);
=cut
+
package RT::Record;
+use DBIx::SearchBuilder::Record::Cachable;
use RT::Date;
use RT::User;
-use RT::Base;
-use DBIx::SearchBuilder::Record::Cachable;
-
-use strict;
-use vars qw/@ISA/;
-
-@ISA = qw(RT::Base);
-
-if ($RT::DontCacheSearchBuilderRecords ) {
- push (@ISA, 'DBIx::SearchBuilder::Record');
-} else {
- push (@ISA, 'DBIx::SearchBuilder::Record::Cachable');
-
-}
+@ISA= qw(DBIx::SearchBuilder::Record::Cachable);
# {{{ sub _Init
-sub _Init {
- my $self = shift;
- $self->CurrentUser(@_);
-
+sub _Init {
+ my $self = shift;
+ $self->_MyCurrentUser(@_);
+
}
# }}}
@@ -80,108 +48,68 @@ The primary keys for RT classes is 'id'
sub _PrimaryKeys {
my $self = shift;
- return ( ['id'] );
+ return(['id']);
}
# }}}
-# {{{ sub _Handle
-sub _Handle {
+# {{{ sub _MyCurrentUser
+
+sub _MyCurrentUser {
my $self = shift;
- return ($RT::Handle);
+
+ $self->CurrentUser(@_);
+ if(!defined($self->CurrentUser)) {
+ use Carp;
+ Carp::cluck();
+ $RT::Logger->err("$self was created without a CurrentUser\n");
+ return(0);
+ }
}
# }}}
-# {{{ sub Create
-
-=item Create PARAMHASH
-
-Takes a PARAMHASH of Column -> Value pairs.
-If any Column has a Validate$PARAMNAME subroutine defined and the
-value provided doesn't pass validation, this routine returns
-an error.
-
-If this object's table has any of the following atetributes defined as
-'Auto', this routine will automatically fill in their values.
-
-=cut
-
-sub Create {
- my $self = shift;
- my %attribs = (@_);
- foreach my $key ( keys %attribs ) {
- my $method = "Validate$key";
- unless ( $self->$method( $attribs{$key} ) ) {
- if (wantarray) {
- return ( 0, $self->loc('Invalid value for [_1]', $key) );
- }
- else {
- return (0);
- }
- }
- }
- my $now = RT::Date->new( $self->CurrentUser );
- $now->Set( Format => 'unix', Value => time );
- $attribs{'Created'} = $now->ISO() if ( $self->_Accessible( 'Created', 'auto' ) && !$attribs{'Created'});
-
- if ($self->_Accessible( 'Creator', 'auto' ) && !$attribs{'Creator'}) {
- $attribs{'Creator'} = $self->CurrentUser->id || '0';
- }
- $attribs{'LastUpdated'} = $now->ISO()
- if ( $self->_Accessible( 'LastUpdated', 'auto' ) && !$attribs{'LastUpdated'});
-
- $attribs{'LastUpdatedBy'} = $self->CurrentUser->id || '0'
- if ( $self->_Accessible( 'LastUpdatedBy', 'auto' ) && !$attribs{'LastUpdatedBy'});
-
- my $id = $self->SUPER::Create(%attribs);
- if ( UNIVERSAL::isa( $id, 'Class::ReturnValue' ) ) {
- if ( $id->errno ) {
- if (wantarray) {
- return ( 0,
- $self->loc( "Internal Error: [_1]", $id->{error_message} ) );
- }
- else {
- return (0);
- }
- }
- }
- # If the object was created in the database,
- # load it up now, so we're sure we get what the database
- # has. Arguably, this should not be necessary, but there
- # isn't much we can do about it.
-
- unless ($id) {
- if (wantarray) {
- return ( $id, $self->loc('Object could not be created') );
- }
- else {
- return ($id);
- }
-
- }
-
- if (UNIVERSAL::isa('errno',$id)) {
- exit(0);
- warn "It's here!";
- return(undef);
- }
-
- $self->Load($id) if ($id);
-
+# {{{ sub _Handle
+sub _Handle {
+ my $self = shift;
+ return($RT::Handle);
+}
+# }}}
+# {{{ sub Create
- if (wantarray) {
- return ( $id, $self->loc('Object created') );
- }
- else {
- return ($id);
+sub Create {
+ my $self = shift;
+ my $now = new RT::Date($self->CurrentUser);
+ $now->Set(Format=> 'unix', Value => time);
+ push @_, 'Created', $now->ISO()
+ if ($self->_Accessible('Created', 'auto'));
+
+
+ push @_, 'Creator', $self->{'user'}->id
+ if $self->_Accessible('Creator', 'auto');
+
+ push @_, 'LastUpdated', $now->ISO()
+ if ($self->_Accessible('LastUpdated', 'auto'));
+
+ push @_, 'LastUpdatedBy', $self->{'user'}->id
+ if $self->_Accessible('LastUpdatedBy', 'auto');
+
+
+
+ my $id = $self->SUPER::Create(@_);
+
+ if ($id) {
+ $self->Load($id);
}
-
+
+ return($id);
+
}
# }}}
+
# {{{ sub LoadByCols
=head2 LoadByCols
@@ -197,33 +125,28 @@ sub LoadByCols {
# If this database is case sensitive we need to uncase objects for
# explicit loading
- if ( $self->_Handle->CaseSensitive ) {
- my %newhash;
- foreach my $key ( keys %hash ) {
-
- # If we've been passed an empty value, we can't do the lookup.
- # We don't need to explicitly downcase integers or an id.
- if ( $key =~ '^id$'
- || !defined( $hash{$key} )
- || $hash{$key} =~ /^\d+$/
- )
- {
- $newhash{$key} = $hash{$key};
- }
- else {
- $newhash{ "lower(" . $key . ")" } = lc( $hash{$key} );
- }
- }
-
- # We've clobbered everything we care about. bash the old hash
- # and replace it with the new hash
- %hash = %newhash;
+ if ($self->_Handle->CaseSensitive) {
+ my %newhash;
+ foreach my $key (keys %hash) {
+ # If we've been passed an empty value, we can't do the lookup.
+ # We don't need to explicitly downcase integers or an id.
+ if ($key =~ '^id$' || $hash{$key} =~/^\d+$/ || !defined ($hash{$key}) ) {
+ $newhash{$key} = $hash{$key};
+ }
+ else {
+ $newhash{"lower(".$key.")"} = lc($hash{$key});
+ }
+ }
+ $self->SUPER::LoadByCols(%newhash);
+ }
+ else {
+ $self->SUPER::LoadByCols(%hash);
}
- $self->SUPER::LoadByCols(%hash);
}
# }}}
+
# {{{ Datehandling
# There is room for optimizations in most of those subs:
@@ -231,10 +154,10 @@ sub LoadByCols {
# {{{ LastUpdatedObj
sub LastUpdatedObj {
- my $self = shift;
- my $obj = new RT::Date( $self->CurrentUser );
-
- $obj->Set( Format => 'sql', Value => $self->LastUpdated );
+ my $self=shift;
+ my $obj = new RT::Date($self->CurrentUser);
+
+ $obj->Set(Format => 'sql', Value => $self->LastUpdated);
return $obj;
}
@@ -243,11 +166,12 @@ sub LastUpdatedObj {
# {{{ CreatedObj
sub CreatedObj {
- my $self = shift;
- my $obj = new RT::Date( $self->CurrentUser );
-
- $obj->Set( Format => 'sql', Value => $self->Created );
+ my $self=shift;
+ my $obj = new RT::Date($self->CurrentUser);
+
+ $obj->Set(Format => 'sql', Value => $self->Created);
+
return $obj;
}
@@ -258,10 +182,9 @@ sub CreatedObj {
# TODO: This should be deprecated
#
sub AgeAsString {
- my $self = shift;
- return ( $self->CreatedObj->AgeAsString() );
+ my $self=shift;
+ return($self->CreatedObj->AgeAsString());
}
-
# }}}
# {{{ LastUpdatedAsString
@@ -269,13 +192,12 @@ sub AgeAsString {
# TODO this should be deprecated
sub LastUpdatedAsString {
- my $self = shift;
- if ( $self->LastUpdated ) {
- return ( $self->LastUpdatedObj->AsString() );
-
- }
- else {
- return "never";
+ my $self=shift;
+ if ($self->LastUpdated) {
+ return ($self->LastUpdatedObj->AsString());
+
+ } else {
+ return "never";
}
}
@@ -287,9 +209,8 @@ sub LastUpdatedAsString {
#
sub CreatedAsString {
my $self = shift;
- return ( $self->CreatedObj->AsString() );
+ return ($self->CreatedObj->AsString());
}
-
# }}}
# {{{ LongSinceUpdateAsString
@@ -297,47 +218,42 @@ sub CreatedAsString {
# TODO This should be deprecated
#
sub LongSinceUpdateAsString {
- my $self = shift;
- if ( $self->LastUpdated ) {
-
- return ( $self->LastUpdatedObj->AgeAsString() );
-
- }
- else {
- return "never";
+ my $self=shift;
+ if ($self->LastUpdated) {
+
+ return ($self->LastUpdatedObj->AgeAsString());
+
+ } else {
+ return "never";
}
}
-
# }}}
# }}} Datehandling
+
# {{{ sub _Set
-sub _Set {
- my $self = shift;
+sub _Set {
+ my $self = shift;
- my %args = (
- Field => undef,
- Value => undef,
- IsSQL => undef,
- @_
- );
+ my %args = ( Field => undef,
+ Value => undef,
+ IsSQL => undef,
+ @_ );
- #if the user is trying to modify the record
- # TODO: document _why_ this code is here
- if ( ( !defined( $args{'Field'} ) ) || ( !defined( $args{'Value'} ) ) ) {
- $args{'Value'} = 0;
- }
+ #if the user is trying to modify the record
+ if ((!defined ($args{'Field'})) || (!defined ($args{'Value'}))) {
+ $args{'Value'} = 0;
+ }
- $self->_SetLastUpdated();
- my ( $val, $msg ) = $self->SUPER::_Set(
- Field => $args{'Field'},
- Value => $args{'Value'},
- IsSQL => $args{'IsSQL'}
- );
+ $self->_SetLastUpdated();
+ $self->SUPER::_Set(Field => $args{'Field'},
+ Value => $args{'Value'},
+ IsSQL => $args{'IsSQL'});
+
+
}
-
# }}}
# {{{ sub _SetLastUpdated
@@ -352,20 +268,16 @@ It takes no options. Arguably, this is a bug
sub _SetLastUpdated {
my $self = shift;
use RT::Date;
- my $now = new RT::Date( $self->CurrentUser );
+ my $now = new RT::Date($self->CurrentUser);
$now->SetToNow();
- if ( $self->_Accessible( 'LastUpdated', 'auto' ) ) {
- my ( $msg, $val ) = $self->__Set(
- Field => 'LastUpdated',
- Value => $now->ISO
- );
+ if ($self->_Accessible('LastUpdated','auto')) {
+ my ($msg, $val) = $self->__Set( Field => 'LastUpdated',
+ Value => $now->ISO);
}
- if ( $self->_Accessible( 'LastUpdatedBy', 'auto' ) ) {
- my ( $msg, $val ) = $self->__Set(
- Field => 'LastUpdatedBy',
- Value => $self->CurrentUser->id
- );
+ if ($self->_Accessible('LastUpdatedBy','auto')) {
+ my ($msg, $val) = $self->__Set( Field => 'LastUpdatedBy',
+ Value => $self->CurrentUser->id);
}
}
@@ -379,16 +291,15 @@ Returns an RT::User object with the RT account of the creator of this row
=cut
-sub CreatorObj {
- my $self = shift;
- unless ( exists $self->{'CreatorObj'} ) {
-
- $self->{'CreatorObj'} = RT::User->new( $self->CurrentUser );
- $self->{'CreatorObj'}->Load( $self->Creator );
- }
- return ( $self->{'CreatorObj'} );
+sub CreatorObj {
+ my $self = shift;
+ unless (exists $self->{'CreatorObj'}) {
+
+ $self->{'CreatorObj'} = RT::User->new($self->CurrentUser);
+ $self->{'CreatorObj'}->Load($self->Creator);
+ }
+ return($self->{'CreatorObj'});
}
-
# }}}
# {{{ sub LastUpdatedByObj
@@ -400,56 +311,35 @@ sub CreatorObj {
=cut
sub LastUpdatedByObj {
- my $self = shift;
- unless ( exists $self->{LastUpdatedByObj} ) {
- $self->{'LastUpdatedByObj'} = RT::User->new( $self->CurrentUser );
- $self->{'LastUpdatedByObj'}->Load( $self->LastUpdatedBy );
+ my $self=shift;
+ unless (exists $self->{LastUpdatedByObj}) {
+ $self->{'LastUpdatedByObj'}=RT::User->new($self->CurrentUser);
+ $self->{'LastUpdatedByObj'}->Load($self->LastUpdatedBy);
}
return $self->{'LastUpdatedByObj'};
}
# }}}
+# {{{ sub CurrentUser
-require Encode::compat if $] < 5.007001;
-require Encode;
+=head2 CurrentUser
-sub __Value {
- my $self = shift;
- my $field = shift;
- my %args = ( decode_utf8 => 1,
- @_ );
+If called with an argument, sets the current user to that user object.
+This will affect ACL decisions, etc.
+Returns the current user
- unless (defined $field && $field) {
- $RT::Logger->error("$self __Value called with undef field");
- }
- my $value = $self->SUPER::__Value($field);
-
- return('') if ( !defined($value) || $value eq '');
-
- return Encode::decode_utf8($value) || $value if $args{'decode_utf8'};
- return $value;
-}
+=cut
-# Set up defaults for DBIx::SearchBuilder::Record::Cachable
+sub CurrentUser {
+ my $self = shift;
-sub _CacheConfig {
- {
- 'cache_p' => 1,
- 'fast_update_p' => 1,
- 'cache_for_sec' => 30,
+ if (@_) {
+ $self->{'user'} = shift;
}
+ return ($self->{'user'});
}
+# }}}
-=head2 _DecodeUTF8
-
- When passed a string will "decode" it int a proper UTF-8 string
-
-=cut
-
-eval "require RT::Record_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Record_Vendor.pm});
-eval "require RT::Record_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Record_Local.pm});
1;
diff --git a/rt/lib/RT/Scrip.pm b/rt/lib/RT/Scrip.pm
index a69dde04e..aef011ca3 100755
--- a/rt/lib/RT/Scrip.pm
+++ b/rt/lib/RT/Scrip.pm
@@ -1,500 +1,372 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Scrip.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
-RT::Scrip
-
+ RT::Scrip - an RT Scrip object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::Scrip;
-use RT::Record;
-use RT::Queue;
-use RT::Template;
-use RT::ScripCondition;
-use RT::ScripAction;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
-
-sub _Init {
- my $self = shift;
-
- $self->Table('Scrips');
- $self->SUPER::_Init(@_);
-}
-
+ use RT::Scrip;
+=head1 DESCRIPTION
+=head1 METHODS
-=item Create PARAMHASH
+=begin testing
-Create takes a hash of values and creates a row in the database:
+ok (require RT::TestHarness);
+ok (require RT::Scrip);
- varchar(255) 'Description'.
- int(11) 'ScripCondition'.
- int(11) 'ScripAction'.
- text 'ConditionRules'.
- text 'ActionRules'.
- text 'CustomIsApplicableCode'.
- text 'CustomPrepareCode'.
- text 'CustomCommitCode'.
- varchar(32) 'Stage'.
- int(11) 'Queue'.
- int(11) 'Template'.
+=end testing
=cut
+package RT::Scrip;
+use RT::Record;
+@ISA= qw(RT::Record);
-
-
-sub Create {
+# {{{ sub _Init
+sub _Init {
my $self = shift;
- my %args = (
- Description => '',
- ScripCondition => '0',
- ScripAction => '0',
- ConditionRules => '',
- ActionRules => '',
- CustomIsApplicableCode => '',
- CustomPrepareCode => '',
- CustomCommitCode => '',
- Stage => '',
- Queue => '0',
- Template => '0',
-
- @_);
- $self->SUPER::Create(
- Description => $args{'Description'},
- ScripCondition => $args{'ScripCondition'},
- ScripAction => $args{'ScripAction'},
- ConditionRules => $args{'ConditionRules'},
- ActionRules => $args{'ActionRules'},
- CustomIsApplicableCode => $args{'CustomIsApplicableCode'},
- CustomPrepareCode => $args{'CustomPrepareCode'},
- CustomCommitCode => $args{'CustomCommitCode'},
- Stage => $args{'Stage'},
- Queue => $args{'Queue'},
- Template => $args{'Template'},
-);
-
+ $self->{'table'} = "Scrips";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
-
-
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
-
-
-=item Description
-
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
-
-
-
-=item SetDescription VALUE
-
-
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
-
-
-=cut
-
-
-=item ScripCondition
-
-Returns the current value of ScripCondition.
-(In the database, ScripCondition is stored as int(11).)
-
-
-
-=item SetScripCondition VALUE
-
-
-Set ScripCondition to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ScripCondition will be stored as a int(11).)
-
-
-=cut
-
-
-=item ScripConditionObj
-
-Returns the ScripCondition Object which has the id returned by ScripCondition
-
-
-=cut
-
-sub ScripConditionObj {
- my $self = shift;
- my $ScripCondition = RT::ScripCondition->new($self->CurrentUser);
- $ScripCondition->Load($self->__Value('ScripCondition'));
- return($ScripCondition);
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = ( ScripAction => 'read/write',
+ ScripCondition => 'read/write',
+ Stage => 'read/write',
+ Queue => 'read/write',
+ Template => 'read/write',
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
}
+# }}}
-=item ScripAction
+# {{{ sub Create
-Returns the current value of ScripAction.
-(In the database, ScripAction is stored as int(11).)
+=head2 Create
+Creates a new entry in the Scrips table. Takes a paramhash with the attributes:
+ Queue A queue id or 0 for a global scrip
+ Template A template ID or name.
+ Behavior is undefined if you have multiple items with
+ the same name
+ ScripAction A ScripAction id or name
+ Behavior is undefined if you have multiple items with
+ the same name
+ ScripCondition A ScripCondition id or name
+ Behavior is undefined if you have multiple items with
+ the same name
-=item SetScripAction VALUE
-
-
-Set ScripAction to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ScripAction will be stored as a int(11).)
-
+Returns (retval, msg);
+retval is 0 for failure or scrip id. msg is a textual description of what happened.
=cut
-
-=item ScripActionObj
-
-Returns the ScripAction Object which has the id returned by ScripAction
-
-
-=cut
-
-sub ScripActionObj {
- my $self = shift;
- my $ScripAction = RT::ScripAction->new($self->CurrentUser);
- $ScripAction->Load($self->__Value('ScripAction'));
- return($ScripAction);
+sub Create {
+ my $self = shift;
+ my %args = ( Queue => undef,
+ Template => undef,
+ ScripAction => undef,
+ ScripCondition => undef,
+ Stage => 'TransactionCreate',
+ @_
+ );
+
+
+ if ($args{'Queue'} == 0 ) {
+ unless ($self->CurrentUser->HasSystemRight('ModifyScrips')) {
+ return (0, 'Permission Denied');
+ }
+ }
+ else {
+ my $QueueObj = new RT::Queue($self->CurrentUser);
+ $QueueObj->Load($args{'Queue'});
+ unless ($QueueObj->id()) {
+ return (0,'Invalid queue');
+ }
+ unless ($QueueObj->CurrentUserHasRight('ModifyScrips')) {
+ return (0, 'Permssion Denied');
+ }
+ }
+
+ #TODO +++ validate input
+
+ require RT::ScripAction;
+ my $action = new RT::ScripAction($self->CurrentUser);
+ $action->Load($args{'ScripAction'});
+ return (0, "Action ".$args{'ScripAction'}." not found") unless $action->Id;
+
+ require RT::Template;
+ my $template = new RT::Template($self->CurrentUser);
+ $template->Load($args{'Template'});
+ return (0, 'Template not found') unless $template->Id;
+
+ require RT::ScripCondition;
+ my $condition = new RT::ScripCondition($self->CurrentUser);
+ $condition->Load($args{'ScripCondition'});
+
+ unless ($condition->Id) {
+ return (0, 'Condition not found');
+ }
+
+ my $id = $self->SUPER::Create(Queue => $args{'Queue'},
+ Template => $template->Id,
+ ScripCondition => $condition->id,
+ Stage => $args{'Stage'},
+ ScripAction => $action->Id
+ );
+ return ($id, 'Scrip Created');
}
-=item ConditionRules
+# }}}
-Returns the current value of ConditionRules.
-(In the database, ConditionRules is stored as text.)
+# {{{ sub Delete
+=head2 Delete
-
-=item SetConditionRules VALUE
-
-
-Set ConditionRules to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ConditionRules will be stored as a text.)
-
+Delete this object
=cut
+sub Delete {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('ModifyScrips')) {
+ return (0, 'Permission Denied');
+ }
+
+ return ($self->SUPER::Delete(@_));
+}
+# }}}
-=item ActionRules
-
-Returns the current value of ActionRules.
-(In the database, ActionRules is stored as text.)
-
-
-
-=item SetActionRules VALUE
-
+# {{{ sub QueueObj
-Set ActionRules to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ActionRules will be stored as a text.)
+=head2 QueueObj
+Retuns an RT::Queue object with this Scrip\'s queue
=cut
+sub QueueObj {
+ my $self = shift;
+
+ if (!$self->{'QueueObj'}) {
+ require RT::Queue;
+ $self->{'QueueObj'} = RT::Queue->new($self->CurrentUser);
+ $self->{'QueueObj'}->Load($self->Queue);
+ }
+ return ($self->{'QueueObj'});
+}
-=item CustomIsApplicableCode
-
-Returns the current value of CustomIsApplicableCode.
-(In the database, CustomIsApplicableCode is stored as text.)
-
-
+# }}}
-=item SetCustomIsApplicableCode VALUE
+# {{{ sub ActionObj
-Set CustomIsApplicableCode to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, CustomIsApplicableCode will be stored as a text.)
+=head2 ActionObj
+Retuns an RT::Action object with this Scrip\'s Action
=cut
+sub ActionObj {
+ my $self = shift;
+
+ unless (defined $self->{'ScripActionObj'}) {
+ require RT::ScripAction;
+
+ $self->{'ScripActionObj'} = RT::ScripAction->new($self->CurrentUser);
+ #TODO: why are we loading Actions with templates like this.
+ # two seperate methods might make more sense
+ $self->{'ScripActionObj'}->Load($self->ScripAction, $self->Template);
+ }
+ return ($self->{'ScripActionObj'});
+}
-=item CustomPrepareCode
-
-Returns the current value of CustomPrepareCode.
-(In the database, CustomPrepareCode is stored as text.)
-
-
-
-=item SetCustomPrepareCode VALUE
+# }}}
-Set CustomPrepareCode to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, CustomPrepareCode will be stored as a text.)
+# {{{ sub TemplateObj
+=head2 TemplateObj
+Retuns an RT::Template object with this Scrip\'s Template
=cut
+sub TemplateObj {
+ my $self = shift;
+
+ unless (defined $self->{'TemplateObj'}) {
+ require RT::Template;
+ $self->{'TemplateObj'} = RT::Template->new($self->CurrentUser);
+ $self->{'TemplateObj'}->Load($self->Template);
+ }
+ return ($self->{'TemplateObj'});
+}
-=item CustomCommitCode
-
-Returns the current value of CustomCommitCode.
-(In the database, CustomCommitCode is stored as text.)
-
-
-
-=item SetCustomCommitCode VALUE
-
+# }}}
-Set CustomCommitCode to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, CustomCommitCode will be stored as a text.)
+# {{{ sub Prepare
+=head2 Prepare
+Calls the action object's prepare method
=cut
+sub Prepare {
+ my $self = shift;
+ $self->ActionObj->Prepare(@_);
+}
-=item Stage
-
-Returns the current value of Stage.
-(In the database, Stage is stored as varchar(32).)
-
-
-
-=item SetStage VALUE
-
+# }}}
-Set Stage to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Stage will be stored as a varchar(32).)
+# {{{ sub Commit
+=head2 Commit
+Calls the action object's commit method
=cut
+sub Commit {
+ my $self = shift;
+ $self->ActionObj->Commit(@_);
+}
-=item Queue
-
-Returns the current value of Queue.
-(In the database, Queue is stored as int(11).)
-
-
-
-=item SetQueue VALUE
-
-
-Set Queue to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Queue will be stored as a int(11).)
-
-
-=cut
-
+# }}}
-=item QueueObj
+# {{{ sub ConditionObj
-Returns the Queue Object which has the id returned by Queue
+=head2 ConditionObj
+Retuns an RT::ScripCondition object with this Scrip's IsApplicable
=cut
-sub QueueObj {
- my $self = shift;
- my $Queue = RT::Queue->new($self->CurrentUser);
- $Queue->Load($self->__Value('Queue'));
- return($Queue);
+sub ConditionObj {
+ my $self = shift;
+
+ unless (defined $self->{'ScripConditionObj'}) {
+ require RT::ScripCondition;
+ $self->{'ScripConditionObj'} = RT::ScripCondition->new($self->CurrentUser);
+ $self->{'ScripConditionObj'}->Load($self->ScripCondition);
+ }
+ return ($self->{'ScripConditionObj'});
}
-=item Template
-
-Returns the current value of Template.
-(In the database, Template is stored as int(11).)
-
-
-
-=item SetTemplate VALUE
+# }}}
+# {{{ sub IsApplicable
-Set Template to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Template will be stored as a int(11).)
+=head2 IsApplicable
+Calls the Condition object\'s IsApplicable method
=cut
+sub IsApplicable {
+ my $self = shift;
+ return ($self->ConditionObj->IsApplicable(@_));
+}
-=item TemplateObj
-
-Returns the Template Object which has the id returned by Template
-
-
-=cut
+# }}}
-sub TemplateObj {
- my $self = shift;
- my $Template = RT::Template->new($self->CurrentUser);
- $Template->Load($self->__Value('Template'));
- return($Template);
+# {{{ sub DESTROY
+sub DESTROY {
+ my $self = shift;
+ $self->{'ActionObj'} = undef;
}
+# }}}
-=item Creator
+# {{{ ACL related methods
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+# {{{ sub _Set
+# does an acl check and then passes off the call
+sub _Set {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('ModifyScrips')) {
+ $RT::Logger->debug("CurrentUser can't modify Scrips for ".$self->Queue."\n");
+ return (0, 'Permission Denied');
+ }
+ return $self->__Set(@_);
+}
-=cut
+# }}}
+# {{{ sub _Value
+# does an acl check and then passes off the call
+sub _Value {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('ShowScrips')) {
+ $RT::Logger->debug("CurrentUser can't modify Scrips for ".$self->__Value('Queue')."\n");
+ return (undef);
+ }
+
+ return $self->__Value(@_);
+}
+# }}}
-=item Created
+# {{{ sub CurrentUserHasRight
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+=head2 CurrentUserHasRight
+Helper menthod for HasRight. Presets Principal to CurrentUser then
+calls HasRight.
=cut
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->HasRight( Principal => $self->CurrentUser->UserObj,
+ Right => $right ));
+
+}
-=item LastUpdatedBy
-
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
-
-
-=cut
-
+# }}}
-=item LastUpdated
+# {{{ sub HasRight
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+=head2 HasRight
+Takes a param-hash consisting of "Right" and "Principal" Principal is
+an RT::User object or an RT::CurrentUser object. "Right" is a textual
+Right string that applies to Scrips.
=cut
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => undef,
+ @_ );
+
+ if ((defined $self->SUPER::_Value('Queue')) and ($self->SUPER::_Value('Queue') != 0)) {
+ return ( $args{'Principal'}->HasQueueRight(
+ Right => $args{'Right'},
+ Queue => $self->SUPER::_Value('Queue'),
+ Principal => $args{'Principal'}
+ )
+ );
+
+ }
+ else {
+ return( $args{'Principal'}->HasSystemRight( $args{'Right'}) );
+ }
+}
+# }}}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- ScripCondition =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- ScripAction =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- ConditionRules =>
- {read => 1, write => 1, type => 'text', default => ''},
- ActionRules =>
- {read => 1, write => 1, type => 'text', default => ''},
- CustomIsApplicableCode =>
- {read => 1, write => 1, type => 'text', default => ''},
- CustomPrepareCode =>
- {read => 1, write => 1, type => 'text', default => ''},
- CustomCommitCode =>
- {read => 1, write => 1, type => 'text', default => ''},
- Stage =>
- {read => 1, write => 1, type => 'varchar(32)', default => ''},
- Queue =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Template =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::Scrip_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Scrip_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Scrip_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::Scrip_Overlay, RT::Scrip_Vendor, RT::Scrip_Local
-
-=cut
+1;
-1;
diff --git a/rt/lib/RT/ScripAction.pm b/rt/lib/RT/ScripAction.pm
index 26824df5d..471ad9191 100755
--- a/rt/lib/RT/ScripAction.pm
+++ b/rt/lib/RT/ScripAction.pm
@@ -1,279 +1,200 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# Copyright 1999-2000 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripAction.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
-RT::ScripAction
-
+ RT::ScripAction - RT Action object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::ScripAction;
-use RT::Record;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+ use RT::ScripAction;
-sub _Init {
- my $self = shift;
-
- $self->Table('ScripActions');
- $self->SUPER::_Init(@_);
-}
+=head1 DESCRIPTION
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in other modules.
+=begin testing
-=item Create PARAMHASH
+ok (require RT::TestHarness);
+ok (require RT::ScripAction);
-Create takes a hash of values and creates a row in the database:
+=end testing
- varchar(200) 'Name'.
- varchar(255) 'Description'.
- varchar(60) 'ExecModule'.
- varchar(255) 'Argument'.
+=head1 METHODS
=cut
+package RT::ScripAction;
+use RT::Record;
+@ISA= qw(RT::Record);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ScripActions";
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
-
-
-sub Create {
+# {{{ sub _Accessible
+sub _Accessible {
my $self = shift;
- my %args = (
- Name => '',
- Description => '',
- ExecModule => '',
- Argument => '',
-
- @_);
- $self->SUPER::Create(
- Name => $args{'Name'},
- Description => $args{'Description'},
- ExecModule => $args{'ExecModule'},
- Argument => $args{'Argument'},
-);
-
+ my %Cols = ( Name => 'read',
+ Description => 'read',
+ ExecModule => 'read',
+ Argument => 'read',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
}
+# }}}
-
-
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
+# {{{ sub Create
+=head2 Create
+
+ Takes a hash. Creates a new Action entry.
+ should be better documented.
=cut
+sub Create {
+ my $self = shift;
+ #TODO check these args and do smart things.
+ return($self->SUPER::Create(@_));
+}
+# }}}
-=item Name
-
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
-
-
-
-=item SetName VALUE
-
-
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
-
-
-=cut
-
-
-=item Description
-
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
-
-
-
-=item SetDescription VALUE
-
-
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
-
-
-=cut
-
-
-=item ExecModule
-
-Returns the current value of ExecModule.
-(In the database, ExecModule is stored as varchar(60).)
-
-
-
-=item SetExecModule VALUE
-
-
-Set ExecModule to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExecModule will be stored as a varchar(60).)
-
-
-=cut
-
-
-=item Argument
-
-Returns the current value of Argument.
-(In the database, Argument is stored as varchar(255).)
-
-
-
-=item SetArgument VALUE
-
-
-Set Argument to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Argument will be stored as a varchar(255).)
-
-
-=cut
-
-
-=item Creator
-
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
-
-
-=cut
-
-
-=item Created
-
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
-
-
-=cut
+# {{{ sub Delete
+sub Delete {
+ my $self = shift;
+
+ return (0, "ScripAction->Delete not implemented");
+}
+# }}}
+# {{{ sub Load
+sub Load {
+ my $self = shift;
+ my $identifier = shift;
+
+ if (!$identifier) {
+ return (0, 'Input error');
+ }
+
+ if ($identifier !~ /\D/) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ $self->LoadByCol('Name', $identifier);
+
+ }
+
+ if (@_) {
+ # Set the template Id to the passed in template
+ my $template = shift;
+
+ $self->{'Template'} = $template;
+ }
+ return ($self->Id, 'ScripAction loaded');
+}
+# }}}
-=item LastUpdatedBy
+# {{{ sub LoadAction
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+=head2 LoadAction HASH
+ Takes a hash consisting of TicketObj and TransactionObj. Loads an RT::Action:: module.
=cut
+sub LoadAction {
+ my $self = shift;
+ my %args = ( TransactionObj => undef,
+ TicketObj => undef,
+ @_ );
+
+ #TODO: Put this in an eval
+ $self->ExecModule =~ /^(\w+)$/;
+ my $module = $1;
+ my $type = "RT::Action::". $module;
+
+ $RT::Logger->debug("now requiring $type\n");
+ eval "require $type" || die "Require of $type failed.\n$@\n";
+
+ $self->{'Action'} = $type->new ( 'ScripActionObj' => $self,
+ 'TicketObj' => $args{'TicketObj'},
+ 'TransactionObj' => $args{'TransactionObj'},
+ 'TemplateObj' => $self->TemplateObj,
+ 'Argument' => $self->Argument,
+ );
+}
+# }}}
-=item LastUpdated
+# {{{ sub TemplateObj
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+=head2 TemplateObj
+Return this action\'s template object
=cut
+sub TemplateObj {
+ my $self = shift;
+ return undef unless $self->{Template};
+ if (!$self->{'TemplateObj'}) {
+ require RT::Template;
+ $self->{'TemplateObj'} = RT::Template->new($self->CurrentUser);
+ $self->{'TemplateObj'}->LoadById($self->{'Template'});
+
+ }
+
+ return ($self->{'TemplateObj'});
+}
+# }}}
+# The following methods call the action object
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- ExecModule =>
- {read => 1, write => 1, type => 'varchar(60)', default => ''},
- Argument =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::ScripAction_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::ScripAction_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::ScripAction_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+# {{{ sub Prepare
-These overlay files can contain new subs or subs to replace existing subs in this module.
+sub Prepare {
+ my $self = shift;
+ return ($self->{'Action'}->Prepare());
+
+}
+# }}}
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+# {{{ sub Commit
+sub Commit {
+ my $self = shift;
+ return($self->{'Action'}->Commit());
+
+
+}
+# }}}
- no warnings qw(redefine);
+# {{{ sub Describe
+sub Describe {
+ my $self = shift;
+ return ($self->{'Action'}->Describe());
+
+}
+# }}}
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+# {{{ sub DESTROY
+sub DESTROY {
+ my $self=shift;
+ $self->{'Action'} = undef;
+ $self->{'TemplateObj'} = undef;
+}
+# }}}
-RT::ScripAction_Overlay, RT::ScripAction_Vendor, RT::ScripAction_Local
-=cut
+1;
-1;
diff --git a/rt/lib/RT/ScripActions.pm b/rt/lib/RT/ScripActions.pm
index 614ff374f..ec6141559 100755
--- a/rt/lib/RT/ScripActions.pm
+++ b/rt/lib/RT/ScripActions.pm
@@ -1,115 +1,70 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripActions.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::ScripActions -- Class Description
-
+ RT::ScripActions - Collection of Action objects
+
=head1 SYNOPSIS
- use RT::ScripActions
+ use RT::ScripActions;
+
=head1 DESCRIPTION
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::ScripActions);
+
+=end testing
+
=head1 METHODS
=cut
package RT::ScripActions;
-
-use RT::SearchBuilder;
+use RT::EasySearch;
use RT::ScripAction;
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
-
+@ISA= qw(RT::EasySearch);
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'ScripActions';
- $self->{'primary_key'} = 'id';
-
-
- return ( $self->SUPER::_Init(@_) );
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ScripActions";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_));
}
-
-
-=item NewItem
-
-Returns an empty new RT::ScripAction item
-
-=cut
-
-sub NewItem {
- my $self = shift;
- return(RT::ScripAction->new($self->CurrentUser));
+# }}}
+
+# {{{ sub LimitToType
+sub LimitToType {
+ my $self = shift;
+ my $type = shift;
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => "$type")
+ if defined $type;
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => "Correspond")
+ if $type eq "Create";
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => 'any');
+
}
+# }}}
- eval "require RT::ScripActions_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Overlay.pm}) {
- die $@;
- };
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return(RT::ScripAction->new($self->CurrentUser));
- eval "require RT::ScripActions_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::ScripActions_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::ScripActions_Overlay, RT::ScripActions_Vendor, RT::ScripActions_Local
-
-=cut
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/ScripCondition.pm b/rt/lib/RT/ScripCondition.pm
index fe0aa2d5a..253502bd4 100755
--- a/rt/lib/RT/ScripCondition.pm
+++ b/rt/lib/RT/ScripCondition.pm
@@ -1,302 +1,192 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# Copyright 1999-2000 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripCondition.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
-RT::ScripCondition
-
+ RT::ScripCondition - RT scrip conditional
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
+ use RT::ScripCondition;
-package RT::ScripCondition;
-use RT::Record;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
-
-sub _Init {
- my $self = shift;
-
- $self->Table('ScripConditions');
- $self->SUPER::_Init(@_);
-}
+=head1 DESCRIPTION
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in other modules.
+=begin testing
-=item Create PARAMHASH
+ok (require RT::TestHarness);
+ok (require RT::ScripCondition);
-Create takes a hash of values and creates a row in the database:
+=end testing
- varchar(200) 'Name'.
- varchar(255) 'Description'.
- varchar(60) 'ExecModule'.
- varchar(255) 'Argument'.
- varchar(60) 'ApplicableTransTypes'.
+=head1 METHODS
=cut
+package RT::ScripCondition;
+use RT::Record;
+@ISA= qw(RT::Record);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ScripConditions";
+ return ($self->SUPER::_Init(@_));
+}
+# }}}
-
-
-sub Create {
+# {{{ sub _Accessible
+sub _Accessible {
my $self = shift;
- my %args = (
- Name => '',
- Description => '',
- ExecModule => '',
- Argument => '',
- ApplicableTransTypes => '',
-
- @_);
- $self->SUPER::Create(
- Name => $args{'Name'},
- Description => $args{'Description'},
- ExecModule => $args{'ExecModule'},
- Argument => $args{'Argument'},
- ApplicableTransTypes => $args{'ApplicableTransTypes'},
-);
-
+ my %Cols = ( Name => 'read',
+ Description => 'read',
+ ApplicableTransTypes => 'read',
+ ExecModule => 'read',
+ Argument => 'read',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
}
+# }}}
+# {{{ sub Create
-
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
-
-
-=item Name
-
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
-
-
-
-=item SetName VALUE
-
-
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
-
+=head2 Create
+
+ Takes a hash. Creates a new Condition entry.
+ should be better documented.
=cut
+sub Create {
+ my $self = shift;
+ return($self->SUPER::Create(@_));
+}
+# }}}
-=item Description
-
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
-
-
-
-=item SetDescription VALUE
-
-
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
-
-
-=cut
-
-
-=item ExecModule
-
-Returns the current value of ExecModule.
-(In the database, ExecModule is stored as varchar(60).)
-
-
-
-=item SetExecModule VALUE
-
-
-Set ExecModule to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExecModule will be stored as a varchar(60).)
-
-
-=cut
-
-
-=item Argument
-
-Returns the current value of Argument.
-(In the database, Argument is stored as varchar(255).)
-
-
-
-=item SetArgument VALUE
-
+# {{{ sub Delete
-Set Argument to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Argument will be stored as a varchar(255).)
+=head2 Delete
+No API available for deleting things just yet.
=cut
+sub Delete {
+ my $self = shift;
+ return(0,'Unimplemented');
+}
+# }}}
-=item ApplicableTransTypes
-
-Returns the current value of ApplicableTransTypes.
-(In the database, ApplicableTransTypes is stored as varchar(60).)
-
-
-
-=item SetApplicableTransTypes VALUE
-
+# {{{ sub Load
-Set ApplicableTransTypes to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ApplicableTransTypes will be stored as a varchar(60).)
+=head2 Load IDENTIFIER
+Loads a condition takes a name or ScripCondition id.
=cut
+sub Load {
+ my $self = shift;
+ my $identifier = shift;
+
+ unless (defined $identifier) {
+ return (undef);
+ }
+
+ if ($identifier !~ /\D/) {
+ return ($self->SUPER::LoadById($identifier));
+ }
+ else {
+ return ($self->LoadByCol('Name', $identifier));
+ }
+}
+# }}}
-=item Creator
+# {{{ sub LoadCondition
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+=head2 LoadCondition HASH
+takes a hash which has the following elements: TransactionObj and TicketObj.
+Loads the Condition module in question.
=cut
-=item Created
-
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
-
+sub LoadCondition {
+ my $self = shift;
+ my %args = ( TransactionObj => undef,
+ TicketObj => undef,
+ @_ );
+
+ #TODO: Put this in an eval
+ $self->ExecModule =~ /^(\w+)$/;
+ my $module = $1;
+ my $type = "RT::Condition::". $module;
+
+ $RT::Logger->debug("now requiring $type\n");
+ eval "require $type" || die "Require of $type failed.\n$@\n";
+
+ $self->{'Condition'} = $type->new ( 'ScripConditionObj' => $self,
+ 'TicketObj' => $args{'TicketObj'},
+ 'TransactionObj' => $args{'TransactionObj'},
+ 'Argument' => $self->Argument,
+ 'ApplicableTransTypes' => $self->ApplicableTransTypes,
+ );
+}
+# }}}
-=cut
+# {{{ The following methods call the Condition object
-=item LastUpdatedBy
+# {{{ sub Describe
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+=head2 Describe
+Helper method to call the condition module\'s Describe method.
=cut
+sub Describe {
+ my $self = shift;
+ return ($self->{'Condition'}->Describe());
+
+}
+# }}}
-=item LastUpdated
+# {{{ sub IsApplicable
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+=head2 IsApplicable
+Helper method to call the condition module\'s IsApplicable method.
=cut
+sub IsApplicable {
+ my $self = shift;
+ return ($self->{'Condition'}->IsApplicable());
+
+}
+# }}}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- ExecModule =>
- {read => 1, write => 1, type => 'varchar(60)', default => ''},
- Argument =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- ApplicableTransTypes =>
- {read => 1, write => 1, type => 'varchar(60)', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::ScripCondition_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::ScripCondition_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::ScripCondition_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+# {{{ sub DESTROY
+sub DESTROY {
+ my $self=shift;
+ $self->{'Condition'} = undef;
+}
+# }}}
-RT::ScripCondition_Overlay, RT::ScripCondition_Vendor, RT::ScripCondition_Local
-=cut
+1;
-1;
diff --git a/rt/lib/RT/ScripConditions.pm b/rt/lib/RT/ScripConditions.pm
index 34f788d9c..236e6718d 100755
--- a/rt/lib/RT/ScripConditions.pm
+++ b/rt/lib/RT/ScripConditions.pm
@@ -1,115 +1,69 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/ScripConditions.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::ScripConditions -- Class Description
-
-=head1 SYNOPSIS
-
- use RT::ScripConditions
-
-=head1 DESCRIPTION
-
-
-=head1 METHODS
-
-=cut
+ RT::ScripConditions - Collection of Action objects
-package RT::ScripConditions;
+=head1 SYNOPSIS
-use RT::SearchBuilder;
-use RT::ScripCondition;
+ use RT::ScripConditions;
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=head1 DESCRIPTION
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'ScripConditions';
- $self->{'primary_key'} = 'id';
- return ( $self->SUPER::_Init(@_) );
-}
+=begin testing
+ok (require RT::TestHarness);
+ok (require RT::ScripConditions);
-=item NewItem
+=end testing
-Returns an empty new RT::ScripCondition item
+=head1 METHODS
=cut
-sub NewItem {
- my $self = shift;
- return(RT::ScripCondition->new($self->CurrentUser));
+package RT::ScripConditions;
+use RT::EasySearch;
+use RT::ScripCondition;
+@ISA= qw(RT::EasySearch);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "ScripConditions";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_));
}
+# }}}
+
+# {{{ sub LimitToType
+sub LimitToType {
+ my $self = shift;
+ my $type = shift;
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => "$type")
+ if defined $type;
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => "Correspond")
+ if $type eq "Create";
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Type',
+ VALUE => 'any');
+
+}
+# }}}
- eval "require RT::ScripConditions_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::ScripConditions_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::ScripConditions_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::ScripConditions_Overlay, RT::ScripConditions_Vendor, RT::ScripConditions_Local
-
-=cut
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return(RT::ScripCondition->new($self->CurrentUser));
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/Scrips.pm b/rt/lib/RT/Scrips.pm
index a39443136..90be847d8 100755
--- a/rt/lib/RT/Scrips.pm
+++ b/rt/lib/RT/Scrips.pm
@@ -1,115 +1,127 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# Copyright 1999-2001 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Scrips.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Scrips -- Class Description
-
+ RT::Scrips - a collection of RT Scrip objects
+
=head1 SYNOPSIS
- use RT::Scrips
+ use RT::Scrips;
=head1 DESCRIPTION
=head1 METHODS
-=cut
-package RT::Scrips;
+=begin testing
-use RT::SearchBuilder;
-use RT::Scrip;
+ok (require RT::TestHarness);
+ok (require RT::Scrips);
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=end testing
+=cut
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Scrips';
- $self->{'primary_key'} = 'id';
+package RT::Scrips;
+use RT::EasySearch;
+use RT::Scrip;
+@ISA= qw(RT::EasySearch);
- return ( $self->SUPER::_Init(@_) );
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Scrips";
+ $self->{'primary_key'} = "id";
+ return ( $self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub LimitToQueue
-=item NewItem
+=head2 LimitToQueue
-Returns an empty new RT::Scrip item
+Takes a queue id (numerical) as its only argument. Makes sure that
+Scopes it pulls out apply to this queue (or another that you've selected with
+another call to this method
=cut
-sub NewItem {
- my $self = shift;
- return(RT::Scrip->new($self->CurrentUser));
+sub LimitToQueue {
+ my $self = shift;
+ my $queue = shift;
+
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Queue',
+ VALUE => "$queue")
+ if defined $queue;
+
}
+# }}}
- eval "require RT::Scrips_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Overlay.pm}) {
- die $@;
- };
+# {{{ sub LimitToGlobal
- eval "require RT::Scrips_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Vendor.pm}) {
- die $@;
- };
+=head2 LimitToGlobal
- eval "require RT::Scrips_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Local.pm}) {
- die $@;
- };
+Makes sure that
+Scopes it pulls out apply to all queues (or another that you've selected with
+another call to this method or LimitToQueue
+=cut
+sub LimitToGlobal {
+ my $self = shift;
+
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Queue',
+ VALUE => 0);
+
+}
+# }}}
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+
+ return(new RT::Scrip($self->CurrentUser));
+}
+# }}}
- no warnings qw(redefine);
+# {{{ sub Next
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 Next
-RT::Scrips_Overlay, RT::Scrips_Vendor, RT::Scrips_Local
+Returns the next scrip that this user can see.
=cut
-
+
+sub Next {
+ my $self = shift;
+
+
+ my $Scrip = $self->SUPER::Next();
+ if ((defined($Scrip)) and (ref($Scrip))) {
+
+ if ($Scrip->CurrentUserHasRight('ShowScrips')) {
+ return($Scrip);
+ }
+
+ #If the user doesn't have the right to show this scrip
+ else {
+ return($self->Next());
+ }
+ }
+ #if there never was any scrip
+ else {
+ return(undef);
+ }
+
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm
index f73ea3ed6..3ef96c7df 100755
--- a/rt/lib/RT/Template.pm
+++ b/rt/lib/RT/Template.pm
@@ -1,363 +1,395 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Template.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 1996-2002 Jesse Vincent <jesse@bestpractical.com>
+# Portions Copyright 2000 Tobias Brox <tobix@cpan.org>
+# Released under the terms of the GNU General Public License
=head1 NAME
-RT::Template
-
+ RT::Template - RT's template object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::Template;
-use RT::Record;
-use RT::Queue;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
-
-sub _Init {
- my $self = shift;
-
- $self->Table('Templates');
- $self->SUPER::_Init(@_);
-}
+ use RT::Template;
+=head1 DESCRIPTION
+=head1 METHODS
-=item Create PARAMHASH
+=begin testing
-Create takes a hash of values and creates a row in the database:
+ok(require RT::TestHarness);
+ok(require RT::Template);
- int(11) 'Queue'.
- varchar(200) 'Name'.
- varchar(255) 'Description'.
- varchar(16) 'Type'.
- varchar(16) 'Language'.
- int(11) 'TranslationOf'.
- blob 'Content'.
+=end testing
=cut
+package RT::Template;
+use RT::Record;
+use MIME::Entity;
+use MIME::Parser;
+@ISA = qw(RT::Record);
+# {{{ sub _Init
-sub Create {
+sub _Init {
my $self = shift;
- my %args = (
- Queue => '0',
- Name => '',
- Description => '',
- Type => '',
- Language => '',
- TranslationOf => '0',
- Content => '',
-
- @_);
- $self->SUPER::Create(
- Queue => $args{'Queue'},
- Name => $args{'Name'},
- Description => $args{'Description'},
- Type => $args{'Type'},
- Language => $args{'Language'},
- TranslationOf => $args{'TranslationOf'},
- Content => $args{'Content'},
-);
-
+ $self->{'table'} = "Templates";
+ return ( $self->SUPER::_Init(@_) );
}
+# }}}
+# {{{ sub _Accessible
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ id => 'read',
+ Name => 'read/write',
+ Description => 'read/write',
+ Type => 'read/write', #Type is one of Action or Message
+ Content => 'read/write',
+ Queue => 'read/write',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+ );
+ return $self->SUPER::_Accessible( @_, %Cols );
+}
+# }}}
-=item Queue
+# {{{ sub _Set
-Returns the current value of Queue.
-(In the database, Queue is stored as int(11).)
+sub _Set {
+ my $self = shift;
+ # use super::value or we get acl blocked
+ if ( ( defined $self->SUPER::_Value('Queue') )
+ && ( $self->SUPER::_Value('Queue') == 0 ) )
+ {
+ unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) {
+ return ( 0, 'Permission Denied' );
+ }
+ }
+ else {
+
+ unless ( $self->CurrentUserHasQueueRight('ModifyTemplate') ) {
+ return ( 0, 'Permission Denied' );
+ }
+ }
+ return ( $self->SUPER::_Set(@_) );
+}
-=item SetQueue VALUE
+# }}}
+# {{{ sub _Value
-Set Queue to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Queue will be stored as a int(11).)
+=head2 _Value
+Takes the name of a table column.
+Returns its value as a string, if the user passes an ACL check
=cut
+sub _Value {
-=item QueueObj
-
-Returns the Queue Object which has the id returned by Queue
+ my $self = shift;
+ my $field = shift;
+ #If the current user doesn't have ACLs, don't let em at it.
+ #use super::value or we get acl blocked
+ if ( ( !defined $self->__Value('Queue') )
+ || ( $self->__Value('Queue') == 0 ) )
+ {
+ unless ( $self->CurrentUser->HasSystemRight('ShowTemplate') ) {
+ return (undef);
+ }
+ }
+ else {
+ unless ( $self->CurrentUserHasQueueRight('ShowTemplate') ) {
+ return (undef);
+ }
+ }
+ return ( $self->__Value($field) );
-=cut
-
-sub QueueObj {
- my $self = shift;
- my $Queue = RT::Queue->new($self->CurrentUser);
- $Queue->Load($self->__Value('Queue'));
- return($Queue);
}
-=item Name
-
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
-
-
+# }}}
-=item SetName VALUE
+# {{{ sub Load
+=head2 Load <identifer>
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
-
+Load a template, either by number or by name
=cut
+sub Load {
+ my $self = shift;
+ my $identifier = shift;
-=item Description
-
-Returns the current value of Description.
-(In the database, Description is stored as varchar(255).)
+ if ( !$identifier ) {
+ return (undef);
+ }
+ if ( $identifier !~ /\D/ ) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ $self->LoadByCol( 'Name', $identifier );
+ }
+}
-=item SetDescription VALUE
+# }}}
+# {{{ sub LoadGlobalTemplate
-Set Description to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Description will be stored as a varchar(255).)
+=head2 LoadGlobalTemplate NAME
+Load the global tempalte with the name NAME
=cut
+sub LoadGlobalTemplate {
+ my $self = shift;
+ my $id = shift;
-=item Type
-
-Returns the current value of Type.
-(In the database, Type is stored as varchar(16).)
-
-
+ return ( $self->LoadQueueTemplate( Queue => 0, Name => $id ) );
+}
-=item SetType VALUE
+# }}}
+# {{{ sub LoadQueueTemplate
-Set Type to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Type will be stored as a varchar(16).)
+=head2 LoadQueueTemplate (Queue => QUEUEID, Name => NAME)
+Loads the Queue template named NAME for Queue QUEUE.
=cut
+sub LoadQueueTemplate {
+ my $self = shift;
+ my %args = (
+ Queue => undef,
+ Name => undef
+ );
-=item Language
+ return ( $self->LoadByCols( Name => $args{'Name'}, Queue => {'Queue'} ) );
-Returns the current value of Language.
-(In the database, Language is stored as varchar(16).)
+}
+# }}}
+# {{{ sub Create
-=item SetLanguage VALUE
+=head2 Create
+Takes a paramhash of Content, Queue, Name and Description.
+Name should be a unique string identifying this Template.
+Description and Content should be the template's title and content.
+Queue should be 0 for a global template and the queue # for a queue-specific
+template.
-Set Language to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Language will be stored as a varchar(16).)
+Returns the Template's id # if the create was successful. Returns undef for
+unknown database failure.
=cut
+sub Create {
+ my $self = shift;
+ my %args = (
+ Content => undef,
+ Queue => 0,
+ Description => '[no description]',
+ Type => 'Action', #By default, template are 'Action' templates
+ Name => undef,
+ @_
+ );
+
+ if ( $args{'Queue'} == 0 ) {
+ unless ( $self->CurrentUser->HasSystemRight('ModifyTemplate') ) {
+ return (undef);
+ }
+ }
+ else {
+ my $QueueObj = new RT::Queue( $self->CurrentUser );
+ $QueueObj->Load( $args{'Queue'} ) || return ( 0, 'Invalid queue' );
+
+ unless ( $QueueObj->CurrentUserHasRight('ModifyTemplate') ) {
+ return (undef);
+ }
+ }
+
+ my $result = $self->SUPER::Create(
+ Content => $args{'Content'},
+ Queue => $args{'Queue'},
+ ,
+ Description => $args{'Description'},
+ Name => $args{'Name'}
+ );
+
+ return ($result);
-=item TranslationOf
-
-Returns the current value of TranslationOf.
-(In the database, TranslationOf is stored as int(11).)
-
-
+}
-=item SetTranslationOf VALUE
+# }}}
+# {{{ sub Delete
-Set TranslationOf to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TranslationOf will be stored as a int(11).)
+=head2 Delete
+Delete this template.
=cut
+sub Delete {
+ my $self = shift;
-=item Content
+ unless ( $self->CurrentUserHasRight('ModifyTemplate') ) {
+ return ( 0, 'Permission Denied' );
+ }
-Returns the current value of Content.
-(In the database, Content is stored as blob.)
+ return ( $self->SUPER::Delete(@_) );
+}
+# }}}
+# {{{ sub MIMEObj
+sub MIMEObj {
+ my $self = shift;
+ return ( $self->{'MIMEObj'} );
+}
-=item SetContent VALUE
+# }}}
+# {{{ sub Parse
-Set Content to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Content will be stored as a blob.)
+=item Parse
+ This routine performs Text::Template parsing on thte template and then imports the
+ results into a MIME::Entity so we can really use it
+ It returns a tuple of (val, message)
+ If val is 0, the message contains an error message
=cut
+sub Parse {
+ my $self = shift;
-=item LastUpdated
-
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
-
+ #We're passing in whatever we were passed. it's destined for _ParseContent
+ my $content = $self->_ParseContent(@_);
-=cut
+ #Lets build our mime Entity
+ my $parser = MIME::Parser->new();
+
+ # Do work on the parsed template in memory, rather than on disk
+ $parser->output_to_core(1);
-=item LastUpdatedBy
+ ### Should we forgive normally-fatal errors?
+ $parser->ignore_errors(1);
+ $self->{'MIMEObj'} = eval { $parser->parse_data($content) };
+ $error = ( $@ || $parser->last_error );
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+ if ($error) {
+ $RT::Logger->error("$error");
+ return ( 0, $error );
+ }
+ # Unfold all headers
+ $self->{'MIMEObj'}->head->unfold();
-=cut
+ return ( 1, "Template parsed" );
+
+}
-=item Creator
+# }}}
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+# {{{ sub _ParseContent
+# Perform Template substitutions on the template
-=cut
+sub _ParseContent {
+ my $self = shift;
+ my %args = (
+ Argument => undef,
+ TicketObj => undef,
+ TransactionObj => undef,
+ @_
+ );
+
+ # Might be subject to change
+ use Text::Template;
+
+ $T::Ticket = $args{'TicketObj'};
+ $T::Transaction = $args{'TransactionObj'};
+ $T::Argument = $args{'Argument'};
+ $T::rtname = $RT::rtname;
+
+ # We need to untaint the content of the template, since we'll be working
+ # with it
+ my $content = $self->Content();
+ $content =~ s/^(.*)$/$1/;
+ $template = Text::Template->new(
+ TYPE => STRING,
+ SOURCE => $content
+ );
+
+ my $retval = $template->fill_in( PACKAGE => T );
+ return ($retval);
+}
+# }}}
-=item Created
+# {{{ sub QueueObj
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+=head2 QueueObj
+Takes nothing. returns this ticket's queue object
=cut
+sub QueueObj {
+ my $self = shift;
+ if ( !defined $self->{'queue'} ) {
+ require RT::Queue;
+ $self->{'queue'} = RT::Queue->new( $self->CurrentUser );
+
+ unless ( $self->{'queue'} ) {
+ $RT::Logger->crit(
+ "RT::Queue->new(" . $self->CurrentUser . ") returned false" );
+ return (undef);
+ }
+ my ($result) = $self->{'queue'}->Load( $self->__Value('Queue') );
+
+ }
+ return ( $self->{'queue'} );
+}
+# }}}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Queue =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Description =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- Type =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- Language =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- TranslationOf =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Content =>
- {read => 1, write => 1, type => 'blob', default => ''},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::Template_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Template_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Template_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Template_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Template_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Template_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
+# {{{ sub CurrentUserHasQueueRight
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 CurrentUserHasQueueRight
-RT::Template_Overlay, RT::Template_Vendor, RT::Template_Local
+Helper function to call the template's queue's CurrentUserHasQueueRight with the passed in args.
=cut
+sub CurrentUserHasQueueRight {
+ my $self = shift;
+ return ( $self->QueueObj->CurrentUserHasRight(@_) );
+}
+# }}}
1;
diff --git a/rt/lib/RT/Templates.pm b/rt/lib/RT/Templates.pm
index 37db84086..b5b483c96 100755
--- a/rt/lib/RT/Templates.pm
+++ b/rt/lib/RT/Templates.pm
@@ -1,115 +1,122 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Templates.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Templates -- Class Description
-
+ RT::Templates - a collection of RT Template objects
+
=head1 SYNOPSIS
- use RT::Templates
+ use RT::Templates;
=head1 DESCRIPTION
=head1 METHODS
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Templates);
+
+=end testing
+
=cut
package RT::Templates;
+use RT::EasySearch;
+@ISA= qw(RT::EasySearch);
-use RT::SearchBuilder;
-use RT::Template;
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+# {{{ sub _Init
+=head2 _Init
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Templates';
- $self->{'primary_key'} = 'id';
+ Returns RT::Templates specific init info like table and primary key names
+=cut
- return ( $self->SUPER::_Init(@_) );
+sub _Init {
+
+ my $self = shift;
+ $self->{'table'} = "Templates";
+ $self->{'primary_key'} = "id";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ LimitToNotInQueue
-=item NewItem
+=head2 LimitToNotInQueue
-Returns an empty new RT::Template item
+Takes a queue id # and limits the returned set of templates to those which
+aren't that queue's templates.
=cut
-sub NewItem {
+sub LimitToNotInQueue {
my $self = shift;
- return(RT::Template->new($self->CurrentUser));
+ my $queue_id = shift;
+ $self->Limit(FIELD => 'Queue',
+ VALUE => "$queue_id",
+ OPERATOR => '!='
+ );
}
+# }}}
- eval "require RT::Templates_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Templates_Overlay.pm}) {
- die $@;
- };
+# {{{ LimitToGlobal
- eval "require RT::Templates_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Templates_Vendor.pm}) {
- die $@;
- };
+=head2 LimitToGlobal
- eval "require RT::Templates_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Templates_Local.pm}) {
- die $@;
- };
+Takes no arguments. Limits the returned set to "Global" templates
+which can be used with any queue.
+=cut
+sub LimitToGlobal {
+ my $self = shift;
+ my $queue_id = shift;
+ $self->Limit(FIELD => 'Queue',
+ VALUE => "0",
+ OPERATOR => '='
+ );
+}
+# }}}
+# {{{ LimitToQueue
-=head1 SEE ALSO
+=head2 LimitToQueue
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+Takes a queue id # and limits the returned set of templates to that queue's
+templates
-These overlay files can contain new subs or subs to replace existing subs in this module.
+=cut
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+sub LimitToQueue {
+ my $self = shift;
+ my $queue_id = shift;
+ $self->Limit(FIELD => 'Queue',
+ VALUE => "$queue_id",
+ OPERATOR => '='
+ );
+}
+# }}}
- no warnings qw(redefine);
+# {{{ sub NewItem
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 NewItem
-RT::Templates_Overlay, RT::Templates_Vendor, RT::Templates_Local
+Returns a new empty Template object
=cut
+sub NewItem {
+ my $self = shift;
+
+ use RT::Template;
+ my $item = new RT::Template($self->CurrentUser);
+ return($item);
+}
+# }}}
1;
+
diff --git a/rt/lib/RT/TestHarness.pm b/rt/lib/RT/TestHarness.pm
new file mode 100644
index 000000000..160e9e636
--- /dev/null
+++ b/rt/lib/RT/TestHarness.pm
@@ -0,0 +1,14 @@
+use lib "/opt/rt2/etc/";
+
+use RT::Interface::CLI qw(CleanEnv LoadConfig DBConnect
+ GetCurrentUser GetMessageContent);
+
+#Clean out all the nasties from the environment
+CleanEnv();
+
+#Load etc/config.pm and drop privs
+LoadConfig();
+
+
+use RT;
+RT::Init;
diff --git a/rt/lib/RT/Ticket.pm b/rt/lib/RT/Ticket.pm
index 2f075a20c..f7275e4e3 100755
--- a/rt/lib/RT/Ticket.pm
+++ b/rt/lib/RT/Ticket.pm
@@ -1,662 +1,3004 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Ticket.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
#
-use strict;
-
-
=head1 NAME
-RT::Ticket
-
+ RT::Ticket - RT ticket object
=head1 SYNOPSIS
+ use RT::Ticket;
+ my $ticket = new RT::Ticket($CurrentUser);
+ $ticket->Load($ticket_id);
+
=head1 DESCRIPTION
+This module lets you manipulate RT\'s ticket object.
+
+
=head1 METHODS
=cut
+
+
package RT::Ticket;
-use RT::Record;
use RT::Queue;
+use RT::User;
+use RT::Record;
+use RT::Link;
+use RT::Links;
+use RT::Date;
+use RT::Watcher;
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+@ISA= qw(RT::Record);
-sub _Init {
- my $self = shift;
- $self->Table('Tickets');
- $self->SUPER::_Init(@_);
+=begin testing
+
+use RT::TestHarness;
+
+ok(require RT::Ticket, "Loading the RT::Ticket library");
+
+=end testing
+
+=cut
+
+# {{{ sub _Init
+
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Tickets";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub Load
+=head2 Load
+Takes a single argument. This can be a ticket id, ticket alias or
+local ticket uri. If the ticket can't be loaded, returns undef.
+Otherwise, returns the ticket id.
-=item Create PARAMHASH
+=cut
+
+sub Load {
+ my $self = shift;
+ my $id = shift;
+
+ #TODO modify this routine to look at EffectiveId and do the recursive load
+ # thing. be careful to cache all the interim tickets we try so we don't loop forever.
+
+ #If it's a local URI, turn it into a ticket id
+ if ($id =~ /^$RT::TicketBaseURI(\d+)$/) {
+ $id = $1;
+ }
+ #If it's a remote URI, we're going to punt for now
+ elsif ($id =~ '://' ) {
+ return (undef);
+ }
+
+ #If we have an integer URI, load the ticket
+ if ( $id =~ /^\d+$/ ) {
+ my $ticketid = $self->LoadById($id);
+
+ unless ($ticketid) {
+ $RT::Logger->debug("$self tried to load a bogus ticket: $id\n");
+ return(undef);
+ }
+ }
+
+ #It's not a URI. It's not a numerical ticket ID. Punt!
+ else {
+ return(undef);
+ }
+
+ #If we're merged, resolve the merge.
+ if (($self->EffectiveId) and
+ ($self->EffectiveId != $self->Id)) {
+ return ($self->Load($self->EffectiveId));
+ }
+
+ #Ok. we're loaded. lets get outa here.
+ return ($self->Id);
+
+}
-Create takes a hash of values and creates a row in the database:
+# }}}
- int(11) 'EffectiveId'.
- int(11) 'Queue'.
- varchar(16) 'Type'.
- int(11) 'IssueStatement'.
- int(11) 'Resolution'.
- int(11) 'Owner'.
- varchar(200) 'Subject' defaults to '[no subject]'.
- int(11) 'InitialPriority'.
- int(11) 'FinalPriority'.
- int(11) 'Priority'.
- int(11) 'TimeEstimated'.
- int(11) 'TimeWorked'.
- varchar(10) 'Status'.
- int(11) 'TimeLeft'.
- datetime 'Told'.
- datetime 'Starts'.
- datetime 'Started'.
- datetime 'Due'.
- datetime 'Resolved'.
- smallint(6) 'Disabled'.
+# {{{ sub LoadByURI
+
+=head2 LoadByURI
+
+Given a local ticket URI, loads the specified ticket.
=cut
+sub LoadByURI {
+ my $self = shift;
+ my $uri = shift;
+
+ if ($uri =~ /^$RT::TicketBaseURI(\d+)$/) {
+ my $id = $1;
+ return ($self->Load($id));
+ }
+ else {
+ return(undef);
+ }
+}
+
+# }}}
+
+# {{{ sub Create
+=head2 Create (ARGS)
+Arguments: ARGS is a hash of named parameters. Valid parameters are:
+
+ Queue - Either a Queue object or a Queue Name
+ Requestor - A reference to a list of RT::User objects, email addresses or RT user Names
+ Cc - A reference to a list of RT::User objects, email addresses or Names
+ AdminCc - A reference to a list of RT::User objects, email addresses or Names
+ Type -- The ticket\'s type. ignore this for now
+ Owner -- This ticket\'s owner. either an RT::User object or this user\'s id
+ Subject -- A string describing the subject of the ticket
+ InitialPriority -- an integer from 0 to 99
+ FinalPriority -- an integer from 0 to 99
+ Status -- any valid status (Defined in RT::Queue)
+ TimeWorked -- an integer
+ TimeLeft -- an integer
+ Starts -- an ISO date describing the ticket\'s start date and time in GMT
+ Due -- an ISO date describing the ticket\'s due date and time in GMT
+ MIMEObj -- a MIME::Entity object with the content of the initial ticket request.
+
+ KeywordSelect-<id> -- an array of keyword ids for that keyword select
+
+
+Returns: TICKETID, Transaction Object, Error Message
+
+
+=begin testing
+
+my $t = RT::Ticket->new($RT::SystemUser);
+
+ok( $t->Create(Queue => 'General', Subject => 'This is a subject'), "Ticket Created");
+
+ok ( my $id = $t->Id, "Got ticket id");
+
+=end testing
+
+=cut
sub Create {
my $self = shift;
- my %args = (
- EffectiveId => '0',
- Queue => '0',
- Type => '',
- IssueStatement => '0',
- Resolution => '0',
- Owner => '0',
- Subject => '[no subject]',
- InitialPriority => '0',
- FinalPriority => '0',
- Priority => '0',
- TimeEstimated => '0',
- TimeWorked => '0',
- Status => '',
- TimeLeft => '0',
- Told => '',
- Starts => '',
- Started => '',
- Due => '',
- Resolved => '',
- Disabled => '0',
+
+ my %args = (
+ Queue => undef,
+ Requestor => undef,
+ Cc => undef,
+ AdminCc => undef,
+ Type => 'ticket',
+ Owner => $RT::Nobody->UserObj,
+ Subject => '[no subject]',
+ InitialPriority => undef,
+ FinalPriority => undef,
+ Status => 'new',
+ TimeWorked => "0",
+ TimeLeft => 0,
+ Due => undef,
+ Starts => undef,
+ MIMEObj => undef,
+ @_);
+
+ my ($ErrStr, $QueueObj, $Owner, $resolved);
+ my (@non_fatal_errors);
+
+ my $now = RT::Date->new($self->CurrentUser);
+ $now->SetToNow();
+
+ if ( (defined($args{'Queue'})) && (!ref($args{'Queue'})) ) {
+ $QueueObj=RT::Queue->new($RT::SystemUser);
+ $QueueObj->Load($args{'Queue'});
+ }
+ elsif (ref($args{'Queue'}) eq 'RT::Queue') {
+ $QueueObj=RT::Queue->new($RT::SystemUser);
+ $QueueObj->Load($args{'Queue'}->Id);
+ }
+ else {
+ $RT::Logger->debug("$self ". $args{'Queue'} .
+ " not a recognised queue object.");
+ }
+
+ #Can't create a ticket without a queue.
+ unless (defined ($QueueObj)) {
+ $RT::Logger->debug( "$self No queue given for ticket creation.");
+ return (0, 0,'Could not create ticket. Queue not set');
+ }
+
+ #Now that we have a queue, Check the ACLS
+ unless ($self->CurrentUser->HasQueueRight(Right => 'CreateTicket',
+ QueueObj => $QueueObj )) {
+ return (0,0,"No permission to create tickets in the queue '".
+ $QueueObj->Name."'.");
+ }
+
+ #Since we have a queue, we can set queue defaults
+ #Initial Priority
+
+ # If there's no queue default initial priority and it's not set, set it to 0
+ $args{'InitialPriority'} = ($QueueObj->InitialPriority || 0)
+ unless (defined $args{'InitialPriority'});
+
+ #Final priority
+
+ # If there's no queue default final priority and it's not set, set it to 0
+ $args{'FinalPriority'} = ($QueueObj->FinalPriority || 0)
+ unless (defined $args{'FinalPriority'});
+
+
+ #TODO we should see what sort of due date we're getting, rather +
+ # than assuming it's in ISO format.
+
+ #Set the due date. if we didn't get fed one, use the queue default due in
+ my $due = new RT::Date($self->CurrentUser);
+ if (defined $args{'Due'}) {
+ $due->Set (Format => 'ISO',
+ Value => $args{'Due'});
+ }
+ elsif (defined ($QueueObj->DefaultDueIn)) {
+ $due->SetToNow;
+ $due->AddDays($QueueObj->DefaultDueIn);
+ }
+
+ my $starts = new RT::Date($self->CurrentUser);
+ if (defined $args{'Starts'}) {
+ $starts->Set (Format => 'ISO',
+ Value => $args{'Starts'});
+ }
+
+
+ # {{{ Deal with setting the owner
+
+ if (ref($args{'Owner'}) eq 'RT::User') {
+ $Owner = $args{'Owner'};
+ }
+ #If we've been handed something else, try to load the user.
+ elsif ($args{'Owner'}) {
+ $Owner = new RT::User($self->CurrentUser);
+ $Owner->Load($args{'Owner'});
+
+ }
+ #If we can't handle it, call it nobody
+ else {
+ if (ref($args{'Owner'})) {
+ $RT::Logger->warning("$ticket ->Create called with an Owner of ".
+ "type ".ref($args{'Owner'}) .". Defaulting to nobody.\n");
+
+ push @non_fatal_errors, "Invalid owner. Defaulting to 'nobody'.";
+ }
+ else {
+ $RT::Logger->warning("$self ->Create called with an ".
+ "unknown datatype for Owner: ".$args{'Owner'} .
+ ". Defaulting to Nobody.\n");
+ }
+ }
+
+ #If we have a proposed owner and they don't have the right
+ #to own a ticket, scream about it and make them not the owner
+ if ((defined ($Owner)) and
+ ($Owner->Id != $RT::Nobody->Id) and
+ (!$Owner->HasQueueRight( QueueObj => $QueueObj,
+ Right => 'OwnTicket'))) {
+
+ $RT::Logger->warning("$self user ".$Owner->Name . "(".$Owner->id .
+ ") was proposed ".
+ "as a ticket owner but has no rights to own ".
+ "tickets in this queue\n");
+
+ push @non_fatal_errors, "Invalid owner. Defaulting to 'nobody'.";
+
+ $Owner = undef;
+ }
+
+ #If we haven't been handed a valid owner, make it nobody.
+ unless (defined ($Owner)) {
+ $Owner = new RT::User($self->CurrentUser);
+ $Owner->Load($RT::Nobody->UserObj->Id);
+ }
+
+ # }}}
+
+ unless ($self->ValidateStatus($args{'Status'})) {
+ return (0,0,'Invalid value for status');
+ }
+
+ if ($args{'Status'} eq 'resolved') {
+ $resolved = $now->ISO;
+ } else{
+ $resolved = undef;
+ }
+
+ my $id = $self->SUPER::Create(
+ Queue => $QueueObj->Id,
+ Owner => $Owner->Id,
+ Subject => $args{'Subject'},
+ InitialPriority => $args{'InitialPriority'},
+ FinalPriority => $args{'FinalPriority'},
+ Priority => $args{'InitialPriority'},
+ Status => $args{'Status'},
+ TimeWorked => $args{'TimeWorked'},
+ TimeLeft => $args{'TimeLeft'},
+ Type => $args{'Type'},
+ Starts => $starts->ISO,
+ Resolved => $resolved,
+ Due => $due->ISO
+ );
+ #Set the ticket's effective ID now that we've created it.
+ my ($val, $msg) = $self->__Set(Field => 'EffectiveId', Value => $id);
+
+ unless ($val) {
+ $RT::Logger->err("$self ->Create couldn't set EffectiveId: $msg\n");
+ }
+
- @_);
- $self->SUPER::Create(
- EffectiveId => $args{'EffectiveId'},
- Queue => $args{'Queue'},
- Type => $args{'Type'},
- IssueStatement => $args{'IssueStatement'},
- Resolution => $args{'Resolution'},
- Owner => $args{'Owner'},
- Subject => $args{'Subject'},
- InitialPriority => $args{'InitialPriority'},
- FinalPriority => $args{'FinalPriority'},
- Priority => $args{'Priority'},
- TimeEstimated => $args{'TimeEstimated'},
- TimeWorked => $args{'TimeWorked'},
- Status => $args{'Status'},
- TimeLeft => $args{'TimeLeft'},
- Told => $args{'Told'},
- Starts => $args{'Starts'},
- Started => $args{'Started'},
- Due => $args{'Due'},
- Resolved => $args{'Resolved'},
- Disabled => $args{'Disabled'},
-);
+ my $watcher;
+ foreach $watcher (@{$args{'Cc'}}) {
+ my ($wval, $wmsg) =
+ $self->_AddWatcher( Type => 'Cc', Person => $watcher, Silent => 1);
+ push @non_fatal_errors, $wmsg unless ($wval);
+ }
+
+ foreach $watcher (@{$args{'Requestor'}}) {
+ my ($wval, $wmsg) =
+ $self->_AddWatcher( Type => 'Requestor', Person => $watcher, Silent => 1);
+ push @non_fatal_errors, $wmsg unless ($wval);
+ }
+
+ foreach $watcher (@{$args{'AdminCc'}}) {
+ # Note that we're using AddWatcher, rather than _AddWatcher, as we
+ # actually _want_ that ACL check. Otherwise, random ticket creators
+ # could make themselves adminccs and maybe get ticket rights. that would
+ # be poor
+ my ($wval, $wmsg) =
+ $self->AddWatcher( Type => 'AdminCc', Person => $watcher, Silent => 1);
+ push @non_fatal_errors, $wmsg unless ($wval);
+ }
+
+ # Iterate through all the KeywordSelect-<int> params passed in, calling _AddKeyword
+ # for each of them
+
+
+ foreach my $key (keys %args) {
+
+ next unless ($key =~ /^KeywordSelect-(.*)$/);
+
+ my $ks = $1;
+
+
+ my @keywords = ref($args{$key}) eq 'ARRAY' ?
+ @{$args{$key}} : ($args{$key});
+
+ foreach my $keyword (@keywords) {
+ my ($kval, $kmsg) = $self->_AddKeyword(KeywordSelect => $ks,
+ Keyword => $keyword,
+ Silent => 1);
+ }
+ push @non_fatal_errors, $kmsg unless ($kval);
+ }
+
+
+
+ #Add a transaction for the create
+ my ($Trans, $Msg, $TransObj) =
+ $self->_NewTransaction( Type => "Create",
+ TimeTaken => 0,
+ MIMEObj=>$args{'MIMEObj'});
+
+ # Logging
+ if ($self->Id && $Trans) {
+ $ErrStr = "Ticket ".$self->Id . " created in queue '". $QueueObj->Name.
+ "'.\n" . join("\n", @non_fatal_errors);
+
+ $RT::Logger->info($ErrStr);
+ }
+ else {
+ # TODO where does this get errstr from?
+ $RT::Logger->warning("Ticket couldn't be created: $ErrStr");
+ }
+
+ return($self->Id, $TransObj->Id, $ErrStr);
+}
+# }}}
+
+# {{{ sub Import
+
+=head2 Import PARAMHASH
+
+Import a ticket.
+Doesn\'t create a transaction.
+Doesn\'t supply queue defaults, etc.
+
+Arguments are identical to Create(), with the addition of
+ Id - Ticket Id
+
+Returns: TICKETID
+
+=cut
+
+
+sub Import {
+ my $self = shift;
+ my ( $ErrStr, $QueueObj, $Owner);
+
+ my %args = (id => undef,
+ EffectiveId => undef,
+ Queue => undef,
+ Requestor => undef,
+ Type => 'ticket',
+ Owner => $RT::Nobody->Id,
+ Subject => '[no subject]',
+ InitialPriority => undef,
+ FinalPriority => undef,
+ Status => 'new',
+ TimeWorked => "0",
+ Due => undef,
+ Created => undef,
+ Updated => undef,
+ Resolved => undef,
+ Told => undef,
+ @_);
+
+ if ( (defined($args{'Queue'})) && (!ref($args{'Queue'})) ) {
+ $QueueObj=RT::Queue->new($RT::SystemUser);
+ $QueueObj->Load($args{'Queue'});
+ #TODO error check this and return 0 if it\'s not loading properly +++
+ }
+ elsif (ref($args{'Queue'}) eq 'RT::Queue') {
+ $QueueObj=RT::Queue->new($RT::SystemUser);
+ $QueueObj->Load($args{'Queue'}->Id);
+ }
+ else {
+ $RT::Logger->debug("$self ". $args{'Queue'} .
+ " not a recognised queue object.");
+ }
+
+ #Can't create a ticket without a queue.
+ unless (defined ($QueueObj) and $QueueObj->Id) {
+ $RT::Logger->debug( "$self No queue given for ticket creation.");
+ return (0,'Could not create ticket. Queue not set');
+ }
+
+ #Now that we have a queue, Check the ACLS
+ unless ($self->CurrentUser->HasQueueRight(Right => 'CreateTicket',
+ QueueObj => $QueueObj )) {
+ return (0,"No permission to create tickets in the queue '".
+ $QueueObj->Name."'.");
+ }
+
+
+
+
+ # {{{ Deal with setting the owner
+
+ # Attempt to take user object, user name or user id.
+ # Assign to nobody if lookup fails.
+ if (defined ($args{'Owner'})) {
+ if ( ref($args{'Owner'}) ) {
+ $Owner = $args{'Owner'};
+ }
+ else {
+ $Owner = new RT::User($self->CurrentUser);
+ $Owner->Load($args{'Owner'});
+ if ( ! defined($Owner->id) ) {
+ $Owner->Load($RT::Nobody->id);
+ }
+ }
+ }
+
+
+ #If we have a proposed owner and they don't have the right
+ #to own a ticket, scream about it and make them not the owner
+ if ((defined ($Owner)) and
+ ($Owner->Id != $RT::Nobody->Id) and
+ (!$Owner->HasQueueRight( QueueObj => $QueueObj,
+ Right => 'OwnTicket'))) {
+
+ $RT::Logger->warning("$self user ".$Owner->Name . "(".$Owner->id .
+ ") was proposed ".
+ "as a ticket owner but has no rights to own ".
+ "tickets in '".$QueueObj->Name."'\n");
+
+ $Owner = undef;
+ }
+
+ #If we haven't been handed a valid owner, make it nobody.
+ unless (defined ($Owner)) {
+ $Owner = new RT::User($self->CurrentUser);
+ $Owner->Load($RT::Nobody->UserObj->Id);
+ }
+
+ # }}}
+
+ unless ($self->ValidateStatus($args{'Status'})) {
+ return (0,"'$args{'Status'}' is an invalid value for status");
+ }
+
+ $self->{'_AccessibleCache'}{Created} = { 'read'=>1, 'write'=>1 };
+ $self->{'_AccessibleCache'}{Creator} = { 'read'=>1, 'auto'=>1 };
+ $self->{'_AccessibleCache'}{LastUpdated} = { 'read'=>1, 'write'=>1 };
+ $self->{'_AccessibleCache'}{LastUpdatedBy} = { 'read'=>1, 'auto'=>1 };
+
+
+ # If we're coming in with an id, set that now.
+ my $EffectiveId = undef;
+ if ($args{'id'}) {
+ $EffectiveId = $args{'id'};
+
+ }
+
+
+ my $id = $self->SUPER::Create(
+ id => $args{'id'},
+ EffectiveId => $EffectiveId,
+ Queue => $QueueObj->Id,
+ Owner => $Owner->Id,
+ Subject => $args{'Subject'},
+ InitialPriority => $args{'InitialPriority'},
+ FinalPriority => $args{'FinalPriority'},
+ Priority => $args{'InitialPriority'},
+ Status => $args{'Status'},
+ TimeWorked => $args{'TimeWorked'},
+ Type => $args{'Type'},
+ Created => $args{'Created'},
+ Told => $args{'Told'},
+ LastUpdated => $args{'Updated'},
+ Resolved => $args{Resolved},
+ Due => $args{'Due'},
+ );
+
+
+
+ # If the ticket didn't have an id
+ # Set the ticket's effective ID now that we've created it.
+ if ($args{'id'} ) {
+ $self->Load($args{'id'});
+ }
+ else {
+ my ($val, $msg) = $self->__Set(Field => 'EffectiveId', Value => $id);
+
+ unless ($val) {
+ $RT::Logger->err($self."->Import couldn't set EffectiveId: $msg\n");
+ }
+ }
+
+ my $watcher;
+ foreach $watcher (@{$args{'Cc'}}) {
+ $self->_AddWatcher( Type => 'Cc', Person => $watcher, Silent => 1);
+ }
+ foreach $watcher (@{$args{'AdminCc'}}) {
+ $self->_AddWatcher( Type => 'AdminCc', Person => $watcher, Silent => 1);
+ }
+ foreach $watcher (@{$args{'Requestor'}}) {
+ $self->_AddWatcher( Type => 'Requestor', Person => $watcher, Silent => 1);
+ }
+
+ return($self->Id, $ErrStr);
}
+# }}}
+# {{{ sub Delete
+
+sub Delete {
+ my $self = shift;
+ return (0, 'Deleting this object would violate referential integrity.'.
+ ' That\'s bad.');
+}
+# }}}
-=item id
+# {{{ Routines dealing with watchers.
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+# {{{ Routines dealing with adding new watchers
+# {{{ sub AddWatcher
+
+=head2 AddWatcher
+
+AddWatcher takes a parameter hash. The keys are as follows:
+
+Email
+Type
+Owner
+
+If the watcher you\'re trying to set has an RT account, set the Owner paremeter to their User Id. Otherwise, set the Email parameter to their Email address.
=cut
+sub AddWatcher {
+ my $self = shift;
+ my %args = ( Email => undef,
+ Type => undef,
+ Owner => undef,
+ @_
+ );
+
+ # {{{ Check ACLS
+ #If the watcher we're trying to add is for the current user
+ if ( ( $self->CurrentUser->EmailAddress &&
+ ($args{'Email'} eq $self->CurrentUser->EmailAddress) ) or
+ ($args{'Owner'} eq $self->CurrentUser->Id)
+ ) {
+
+
+ # If it's an AdminCc and they don't have
+ # 'WatchAsAdminCc' or 'ModifyTicket', bail
+ if ($args{'Type'} eq 'AdminCc') {
+ unless ($self->CurrentUserHasRight('ModifyTicket') or
+ $self->CurrentUserHasRight('WatchAsAdminCc')) {
+ return(0, 'Permission Denied');
+ }
+ }
+
+ # If it's a Requestor or Cc and they don't have
+ # 'Watch' or 'ModifyTicket', bail
+ elsif (($args{'Type'} eq 'Cc') or
+ ($args{'Type'} eq 'Requestor')) {
+
+ unless ($self->CurrentUserHasRight('ModifyTicket') or
+ $self->CurrentUserHasRight('Watch')) {
+ return(0, 'Permission Denied');
+ }
+ }
+ else {
+ $RT::Logger->warn("$self -> AddWatcher hit code".
+ " it never should. We got passed ".
+ " a type of ". $args{'Type'});
+ return (0,'Error in parameters to TicketAddWatcher');
+ }
+ }
+ # If the watcher isn't the current user
+ # and the current user doesn't have 'ModifyTicket'
+ # bail
+ else {
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+ }
+ # }}}
+
+ return ($self->_AddWatcher(%args));
+}
+
-=item EffectiveId
+#This contains the meat of AddWatcher. but can be called from a routine like
+# Create, which doesn't need the additional acl check
+sub _AddWatcher {
+ my $self = shift;
+ my %args = (
+ Type => undef,
+ Silent => undef,
+ Email => undef,
+ Owner => 0,
+ Person => undef,
+ @_ );
+
+
+
+ #clear the watchers cache
+ $self->{'watchers_cache'} = undef;
+
+ if (defined $args{'Person'}) {
+ #if it's an RT::User object, pull out the id and shove it in Owner
+ if (ref ($args{'Person'}) =~ /RT::User/) {
+ $args{'Owner'} = $args{'Person'}->id;
+ }
+ #if it's an int, shove it in Owner
+ elsif ($args{'Person'} =~ /^\d+$/) {
+ $args{'Owner'} = $args{'Person'};
+ }
+ #if it's an email address, shove it in Email
+ else {
+ $args{'Email'} = $args{'Person'};
+ }
+ }
+
+ # Turn an email address int a watcher if we possibly can.
+ if ($args{'Email'}) {
+ my $watcher = new RT::User($self->CurrentUser);
+ $watcher->LoadByEmail($args{'Email'});
+ if ($watcher->Id) {
+ $args{'Owner'} = $watcher->Id;
+ delete $args{'Email'};
+ }
+ }
+
+
+ # see if this user is already a watcher. if we have an owner, check it
+ # otherwise, we've got an email-address watcher. use that.
+
+ if ($self->IsWatcher(Type => $args{'Type'},
+ Id => ($args{'Owner'} || $args{'Email'}) ) ) {
+
+
+ return(0, 'That user is already that sort of watcher for this ticket');
+ }
+
+
+ require RT::Watcher;
+ my $Watcher = new RT::Watcher ($self->CurrentUser);
+ my ($retval, $msg) = ($Watcher->Create( Value => $self->Id,
+ Scope => 'Ticket',
+ Email => $args{'Email'},
+ Type => $args{'Type'},
+ Owner => $args{'Owner'},
+ ));
+
+ unless ($args{'Silent'}) {
+ $self->_NewTransaction( Type => 'AddWatcher',
+ NewValue => $Watcher->Email,
+ Field => $Watcher->Type);
+ }
+
+ return ($retval, $msg);
+}
+
+# }}}
+
+# {{{ sub AddRequestor
-Returns the current value of EffectiveId.
-(In the database, EffectiveId is stored as int(11).)
+=head2 AddRequestor
+AddRequestor takes what AddWatcher does, except it presets
+the "Type" parameter to \'Requestor\'
+=cut
+
+sub AddRequestor {
+ my $self = shift;
+ return ($self->AddWatcher ( Type => 'Requestor', @_));
+}
-=item SetEffectiveId VALUE
+# }}}
+# {{{ sub AddCc
-Set EffectiveId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, EffectiveId will be stored as a int(11).)
+=head2 AddCc
+AddCc takes what AddWatcher does, except it presets
+the "Type" parameter to \'Cc\'
=cut
+sub AddCc {
+ my $self = shift;
+ return ($self->AddWatcher ( Type => 'Cc', @_));
+}
+# }}}
+
+# {{{ sub AddAdminCc
+
+=head2 AddAdminCc
-=item Queue
+AddAdminCc takes what AddWatcher does, except it presets
+the "Type" parameter to \'AdminCc\'
-Returns the current value of Queue.
-(In the database, Queue is stored as int(11).)
+=cut
+sub AddAdminCc {
+ my $self = shift;
+ return ($self->AddWatcher ( Type => 'AdminCc', @_));
+}
+# }}}
-=item SetQueue VALUE
+# }}}
+# {{{ sub DeleteWatcher
-Set Queue to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Queue will be stored as a int(11).)
+=head2 DeleteWatcher id [type]
+
+DeleteWatcher takes a single argument which is either an email address
+or a watcher id.
+If the first argument is an email address, you need to specify the watcher type you're talking
+about as the second argument. Valid values are 'Requestor', 'Cc' or 'AdminCc'.
+It removes that watcher from this Ticket\'s list of watchers.
=cut
+#TODO It is lame that you can't call this the same way you can call AddWatcher
-=item QueueObj
+sub DeleteWatcher {
+ my $self = shift;
+ my $id = shift;
+
+ my $type;
+
+ $type = shift if (@_);
+
+ my $Watcher = new RT::Watcher($self->CurrentUser);
+
+ #If it\'s a numeric watcherid
+ if ($id =~ /^(\d*)$/) {
+ $Watcher->Load($id);
+ }
+
+ #Otherwise, we'll assume it's an email address
+ elsif ($type) {
+ my ($result, $msg) =
+ $Watcher->LoadByValue( Email => $id,
+ Scope => 'Ticket',
+ Value => $self->id,
+ Type => $type);
+ return (0,$msg) unless ($result);
+ }
+
+ else {
+ return(0,"Can\'t delete a watcher by email address without specifying a type");
+ }
+
+ # {{{ Check ACLS
+
+ #If the watcher we're trying to delete is for the current user
+ if ($Watcher->Email eq $self->CurrentUser->EmailAddress) {
+
+ # If it's an AdminCc and they don't have
+ # 'WatchAsAdminCc' or 'ModifyTicket', bail
+ if ($Watcher->Type eq 'AdminCc') {
+ unless ($self->CurrentUserHasRight('ModifyTicket') or
+ $self->CurrentUserHasRight('WatchAsAdminCc')) {
+ return(0, 'Permission Denied');
+ }
+ }
+
+ # If it's a Requestor or Cc and they don't have
+ # 'Watch' or 'ModifyTicket', bail
+ elsif (($Watcher->Type eq 'Cc') or
+ ($Watcher->Type eq 'Requestor')) {
+
+ unless ($self->CurrentUserHasRight('ModifyTicket') or
+ $self->CurrentUserHasRight('Watch')) {
+ return(0, 'Permission Denied');
+ }
+ }
+ else {
+ $RT::Logger->warn("$self -> DeleteWatcher hit code".
+ " it never should. We got passed ".
+ " a type of ". $args{'Type'});
+ return (0,'Error in parameters to $self DeleteWatcher');
+ }
+ }
+ # If the watcher isn't the current user
+ # and the current user doesn't have 'ModifyTicket'
+ # bail
+ else {
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ # }}}
+
+ unless (($Watcher->Scope eq 'Ticket') and
+ ($Watcher->Value == $self->id) ) {
+ return (0, "Not a watcher for this ticket");
+ }
+
+
+ #Clear out the watchers hash.
+ $self->{'watchers'} = undef;
+
+ #If we\'ve validated that it is a watcher for this ticket
+ $self->_NewTransaction ( Type => 'DelWatcher',
+ OldValue => $Watcher->Email,
+ Field => $Watcher->Type,
+ );
+
+ my $retval = $Watcher->Delete();
+
+ unless ($retval) {
+ return(0,"Watcher could not be deleted. Database inconsistency possible.");
+ }
+
+ return(1, "Watcher deleted");
+}
-Returns the Queue Object which has the id returned by Queue
+# {{{ sub DeleteRequestor
+
+=head2 DeleteRequestor EMAIL
+
+Takes an email address. It calls DeleteWatcher with a preset
+type of 'Requestor'
=cut
-sub QueueObj {
- my $self = shift;
- my $Queue = RT::Queue->new($self->CurrentUser);
- $Queue->Load($self->__Value('Queue'));
- return($Queue);
+sub DeleteRequestor {
+ my $self = shift;
+ my $id = shift;
+ return ($self->DeleteWatcher ($id, 'Requestor'))
}
-=item Type
+# }}}
-Returns the current value of Type.
-(In the database, Type is stored as varchar(16).)
+# {{{ sub DeleteCc
+=head2 DeleteCc EMAIL
+Takes an email address. It calls DeleteWatcher with a preset
+type of 'Cc'
-=item SetType VALUE
+=cut
+
+sub DeleteCc {
+ my $self = shift;
+ my $id = shift;
+ return ($self->DeleteWatcher ($id, 'Cc'))
+}
-Set Type to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Type will be stored as a varchar(16).)
+# }}}
+# {{{ sub DeleteAdminCc
+
+=head2 DeleteAdminCc EMAIL
+
+Takes an email address. It calls DeleteWatcher with a preset
+type of 'AdminCc'
+
+
+=cut
+
+sub DeleteAdminCc {
+ my $self = shift;
+ my $id = shift;
+ return ($self->DeleteWatcher ($id, 'AdminCc'))
+}
+
+# }}}
+
+
+# }}}
+
+# {{{ sub Watchers
+
+=head2 Watchers
+
+Watchers returns a Watchers object preloaded with this ticket\'s watchers.
+
+# It should return only the ticket watchers. the actual FooAsString
+# methods capture the queue watchers too. I don't feel thrilled about this,
+# but we don't want the Cc Requestors and AdminCc objects to get filled up
+# with all the queue watchers too. we've got seperate objects for that.
+ # should we rename these as s/(.*)AsString/$1Addresses/ or somesuch?
=cut
+sub Watchers {
+ my $self = shift;
+
+ require RT::Watchers;
+ my $watchers=RT::Watchers->new($self->CurrentUser);
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ $watchers->LimitToTicket($self->id);
+ }
+
+ return($watchers);
+
+}
-=item IssueStatement
+# }}}
-Returns the current value of IssueStatement.
-(In the database, IssueStatement is stored as int(11).)
+# {{{ a set of [foo]AsString subs that will return the various sorts of watchers for a ticket/queue as a comma delineated string
+=head2 RequestorsAsString
+ B<Returns> String: All Ticket Requestor email addresses as a string.
-=item SetIssueStatement VALUE
+=cut
+sub RequestorsAsString {
+ my $self=shift;
-Set IssueStatement to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, IssueStatement will be stored as a int(11).)
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return undef;
+ }
+
+ return ($self->Requestors->EmailsAsString() );
+}
+=head2 WatchersAsString
+
+B<Returns> String: All Ticket Watchers email addresses as a string
=cut
+sub WatchersAsString {
+ my $self=shift;
-=item Resolution
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ return ($self->Watchers->EmailsAsString());
-Returns the current value of Resolution.
-(In the database, Resolution is stored as int(11).)
+}
+=head2 AdminCcAsString
+returns String: All Ticket AdminCc email addresses as a string
-=item SetResolution VALUE
+=cut
-Set Resolution to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Resolution will be stored as a int(11).)
+sub AdminCcAsString {
+ my $self=shift;
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return undef;
+ }
+
+ return ($self->AdminCc->EmailsAsString());
+
+}
+
+=head2 CcAsString
+
+returns String: All Ticket Ccs as a string of email addresses
=cut
+sub CcAsString {
+ my $self=shift;
+
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return undef;
+ }
+
+ return ($self->Cc->EmailsAsString());
+
+}
+
+# }}}
-=item Owner
+# {{{ Routines that return RT::Watchers objects of Requestors, Ccs and AdminCcs
-Returns the current value of Owner.
-(In the database, Owner is stored as int(11).)
+# {{{ sub Requestors
+=head2 Requestors
+Takes nothing.
+Returns this ticket's Requestors as an RT::Watchers object
-=item SetOwner VALUE
+=cut
+sub Requestors {
+ my $self = shift;
+
+ my $requestors = $self->Watchers();
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ $requestors->LimitToRequestors();
+ }
+
+ return($requestors);
+
+}
-Set Owner to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Owner will be stored as a int(11).)
+# }}}
+# {{{ sub Cc
+
+=head2 Cc
+
+Takes nothing.
+Returns a watchers object which contains this ticket's Cc watchers
=cut
+sub Cc {
+ my $self = shift;
+
+ my $cc = $self->Watchers();
+
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ $cc->LimitToCc();
+ }
+
+ return($cc);
+
+}
+
+# }}}
-=item Subject
+# {{{ sub AdminCc
-Returns the current value of Subject.
-(In the database, Subject is stored as varchar(200).)
+=head2 AdminCc
+Takes nothing.
+Returns this ticket\'s administrative Ccs as an RT::Watchers object
+
+=cut
+
+sub AdminCc {
+ my $self = shift;
+
+ my $admincc = $self->Watchers();
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ $admincc->LimitToAdminCc();
+ }
+ return($admincc);
+}
+# }}}
-=item SetSubject VALUE
+# }}}
+# {{{ IsWatcher,IsRequestor,IsCc, IsAdminCc
-Set Subject to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Subject will be stored as a varchar(200).)
+# {{{ sub IsWatcher
+# a generic routine to be called by IsRequestor, IsCc and IsAdminCc
+=head2 IsWatcher
+
+Takes a param hash with the attributes Type and User. User is either a user object or string containing an email address. Returns true if that user or string
+is a ticket watcher. Returns undef otherwise
=cut
+sub IsWatcher {
+ my $self = shift;
-=item InitialPriority
+ my %args = ( Type => 'Requestor',
+ Email => undef,
+ Id => undef,
+ @_
+ );
+
+ my %cols = ('Type' => $args{'Type'},
+ 'Scope' => 'Ticket',
+ 'Value' => $self->Id,
+ 'Owner' => undef,
+ 'Email' => undef
+ );
+
+ if (ref($args{'Id'})){
+ #If it's a ref, it's an RT::User object;
+ $cols{'Owner'} = $args{'Id'}->Id;
+ }
+ elsif ($args{'Id'} =~ /^\d+$/) {
+ # if it's an integer, it's a reference to an RT::User obj
+ $cols{'Owner'} = $args{'Id'};
+ }
+ else {
+ $cols{'Email'} = $args{'Id'};
+ }
+
+ if ($args{'Email'}) {
+ $cols{'Email'} = $args{'Email'};
+ }
+
+ my $description = join(":",%cols);
+
+ #If we've cached a positive match...
+ if (defined $self->{'watchers_cache'}->{"$description"}) {
+ if ($self->{'watchers_cache'}->{"$description"} == 1) {
+ return(1);
+ }
+ else { #If we've cached a negative match...
+ return(undef);
+ }
+ }
+
+
+ my $watcher = new RT::Watcher($self->CurrentUser);
+ $watcher->LoadByCols(%cols);
+
+
+ if ($watcher->id) {
+ $self->{'watchers_cache'}->{"$description"} = 1;
+ return(1);
+ }
+ else {
+ $self->{'watchers_cache'}->{"$description"} = 0;
+ return(undef);
+ }
+
+}
+# }}}
-Returns the current value of InitialPriority.
-(In the database, InitialPriority is stored as int(11).)
+# {{{ sub IsRequestor
+=head2 IsRequestor
+
+ Takes an email address, RT::User object or integer (RT user id)
+ Returns true if the string is a requestor of the current ticket.
-=item SetInitialPriority VALUE
+=cut
+sub IsRequestor {
+ my $self = shift;
+ my $person = shift;
+
+ return ($self->IsWatcher(Type => 'Requestor', Id => $person));
+
+};
-Set InitialPriority to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, InitialPriority will be stored as a int(11).)
+# }}}
+# {{{ sub IsCc
+
+=head2 IsCc
+
+Takes a string. Returns true if the string is a Cc watcher of the current ticket.
=cut
+sub IsCc {
+ my $self = shift;
+ my $cc = shift;
+
+ return ($self->IsWatcher( Type => 'Cc', Id => $cc ));
+
+}
+
+# }}}
+
+# {{{ sub IsAdminCc
-=item FinalPriority
+=head2 IsAdminCc
-Returns the current value of FinalPriority.
-(In the database, FinalPriority is stored as int(11).)
+Takes a string. Returns true if the string is an AdminCc watcher of the current ticket.
+=cut
+sub IsAdminCc {
+ my $self = shift;
+ my $person = shift;
+
+ return ($self->IsWatcher( Type => 'AdminCc', Id => $person ));
+
+}
-=item SetFinalPriority VALUE
+# }}}
+# {{{ sub IsOwner
-Set FinalPriority to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, FinalPriority will be stored as a int(11).)
+=head2 IsOwner
+ Takes an RT::User object. Returns true if that user is this ticket's owner.
+returns undef otherwise
=cut
+sub IsOwner {
+ my $self = shift;
+ my $person = shift;
+
+
+ # no ACL check since this is used in acl decisions
+ # unless ($self->CurrentUserHasRight('ShowTicket')) {
+ # return(undef);
+ # }
+
+
+ #Tickets won't yet have owners when they're being created.
+ unless ($self->OwnerObj->id) {
+ return(undef);
+ }
+
+ if ($person->id == $self->OwnerObj->id) {
+ return(1);
+ }
+ else {
+ return(undef);
+ }
+}
+
+
+# }}}
+
+# }}}
+
+# }}}
-=item Priority
+# {{{ Routines dealing with queues
-Returns the current value of Priority.
-(In the database, Priority is stored as int(11).)
+# {{{ sub ValidateQueue
+sub ValidateQueue {
+ my $self = shift;
+ my $Value = shift;
+
+ #TODO I don't think this should be here. We shouldn't allow anything to have an undef queue,
+ if (!$Value) {
+ $RT::Logger->warning( " RT:::Queue::ValidateQueue called with a null value. this isn't ok.");
+ return (1);
+ }
+
+ my $QueueObj = RT::Queue->new($self->CurrentUser);
+ my $id = $QueueObj->Load($Value);
+
+ if ($id) {
+ return (1);
+ }
+ else {
+ return (undef);
+ }
+}
+
+# }}}
+# {{{ sub SetQueue
-=item SetPriority VALUE
+sub SetQueue {
+ my $self = shift;
+ my $NewQueue = shift;
+
+ #Redundant. ACL gets checked in _Set;
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+
+ my $NewQueueObj = RT::Queue->new($self->CurrentUser);
+ $NewQueueObj->Load($NewQueue);
+
+ unless ($NewQueueObj->Id()) {
+ return (0, "That queue does not exist");
+ }
+
+ if ($NewQueueObj->Id == $self->QueueObj->Id) {
+ return (0, 'That is the same value');
+ }
+ unless ($self->CurrentUser->HasQueueRight(Right =>'CreateTicket',
+ QueueObj => $NewQueueObj )) {
+ return (0, "You may not create requests in that queue.");
+ }
+
+ unless ($self->OwnerObj->HasQueueRight(Right=> 'OwnTicket',
+ QueueObj => $NewQueueObj)) {
+ $self->Untake();
+ }
+
+ return($self->_Set(Field => 'Queue', Value => $NewQueueObj->Id()));
+
+}
+# }}}
-Set Priority to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Priority will be stored as a int(11).)
+# {{{ sub QueueObj
+=head2 QueueObj
+
+Takes nothing. returns this ticket's queue object
=cut
+sub QueueObj {
+ my $self = shift;
+
+ my $queue_obj = RT::Queue->new($self->CurrentUser);
+ #We call __Value so that we can avoid the ACL decision and some deep recursion
+ my ($result) = $queue_obj->Load($self->__Value('Queue'));
+ return ($queue_obj);
+}
+
+
+# }}}
+
+# }}}
-=item TimeEstimated
+# {{{ Date printing routines
-Returns the current value of TimeEstimated.
-(In the database, TimeEstimated is stored as int(11).)
+# {{{ sub DueObj
+=head2 DueObj
+ Returns an RT::Date object containing this ticket's due date
-=item SetTimeEstimated VALUE
+=cut
+sub DueObj {
+ my $self = shift;
+
+ my $time = new RT::Date($self->CurrentUser);
+
+ # -1 is RT::Date slang for never
+ if ($self->Due) {
+ $time->Set(Format => 'sql', Value => $self->Due );
+ }
+ else {
+ $time->Set(Format => 'unix', Value => -1);
+ }
+
+ return $time;
+}
+# }}}
+# {{{ sub DueAsString
-Set TimeEstimated to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TimeEstimated will be stored as a int(11).)
+=head2 DueAsString
+Returns this ticket's due date as a human readable string
=cut
+sub DueAsString {
+ my $self = shift;
+ return $self->DueObj->AsString();
+}
+
+# }}}
+
+# {{{ sub GraceTimeAsString
-=item TimeWorked
+=head2 GraceTimeAsString
-Returns the current value of TimeWorked.
-(In the database, TimeWorked is stored as int(11).)
+Return the time until this ticket is due as a string
+=cut
+
+# TODO This should be deprecated
+sub GraceTimeAsString {
+ my $self=shift;
+
+ if ($self->Due) {
+ return ($self->DueObj->AgeAsString());
+ } else {
+ return "";
+ }
+}
-=item SetTimeWorked VALUE
+# }}}
-Set TimeWorked to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TimeWorked will be stored as a int(11).)
+# {{{ sub ResolvedObj
+=head2 ResolvedObj
+
+ Returns an RT::Date object of this ticket's 'resolved' time.
=cut
+sub ResolvedObj {
+ my $self = shift;
-=item Status
+ my $time = new RT::Date($self->CurrentUser);
+ $time->Set(Format => 'sql', Value => $self->Resolved);
+ return $time;
+}
+# }}}
-Returns the current value of Status.
-(In the database, Status is stored as varchar(10).)
+# {{{ sub SetStarted
+=head2 SetStarted
+Takes a date in ISO format or undef
+Returns a transaction id and a message
+The client calls "Start" to note that the project was started on the date in $date.
+A null date means "now"
-=item SetStatus VALUE
+=cut
+
+sub SetStarted {
+ my $self = shift;
+ my $time = shift || 0;
+
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ #We create a date object to catch date weirdness
+ my $time_obj = new RT::Date($self->CurrentUser());
+ if ($time != 0) {
+ $time_obj->Set(Format => 'ISO', Value => $time);
+ }
+ else {
+ $time_obj->SetToNow();
+ }
+
+ #Now that we're starting, open this ticket
+ #TODO do we really want to force this as policy? it should be a scrip
+
+ #We need $TicketAsSystem, in case the current user doesn't have
+ #ShowTicket
+ #
+ my $TicketAsSystem = new RT::Ticket($RT::SystemUser);
+ $TicketAsSystem->Load($self->Id);
+ if ($TicketAsSystem->Status eq 'new') {
+ $TicketAsSystem->Open();
+ }
+
+ return ($self->_Set(Field => 'Started', Value =>$time_obj->ISO));
+
+}
+
+# }}}
+# {{{ sub StartedObj
-Set Status to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Status will be stored as a varchar(10).)
+=head2 StartedObj
+ Returns an RT::Date object which contains this ticket's
+'Started' time.
=cut
-=item TimeLeft
+sub StartedObj {
+ my $self = shift;
+
+ my $time = new RT::Date($self->CurrentUser);
+ $time->Set(Format => 'sql', Value => $self->Started);
+ return $time;
+}
+# }}}
+
+# {{{ sub StartsObj
-Returns the current value of TimeLeft.
-(In the database, TimeLeft is stored as int(11).)
+=head2 StartsObj
+ Returns an RT::Date object which contains this ticket's
+'Starts' time.
+=cut
-=item SetTimeLeft VALUE
+sub StartsObj {
+ my $self = shift;
+
+ my $time = new RT::Date($self->CurrentUser);
+ $time->Set(Format => 'sql', Value => $self->Starts);
+ return $time;
+}
+# }}}
+# {{{ sub ToldObj
-Set TimeLeft to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TimeLeft will be stored as a int(11).)
+=head2 ToldObj
+ Returns an RT::Date object which contains this ticket's
+'Told' time.
=cut
-=item Told
+sub ToldObj {
+ my $self = shift;
+
+ my $time = new RT::Date($self->CurrentUser);
+ $time->Set(Format => 'sql', Value => $self->Told);
+ return $time;
+}
+
+# }}}
-Returns the current value of Told.
-(In the database, Told is stored as datetime.)
+# {{{ sub LongSinceToldAsString
+# TODO this should be deprecated
-=item SetTold VALUE
+sub LongSinceToldAsString {
+ my $self = shift;
+ if ($self->Told) {
+ return $self->ToldObj->AgeAsString();
+ } else {
+ return "Never";
+ }
+}
+# }}}
-Set Told to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Told will be stored as a datetime.)
+# {{{ sub ToldAsString
+=head2 ToldAsString
+
+A convenience method that returns ToldObj->AsString
+
+TODO: This should be deprecated
=cut
-=item Starts
+sub ToldAsString {
+ my $self = shift;
+ if ($self->Told) {
+ return $self->ToldObj->AsString();
+ }
+ else {
+ return("Never");
+ }
+}
+# }}}
-Returns the current value of Starts.
-(In the database, Starts is stored as datetime.)
+# {{{ sub TimeWorkedAsString
+=head2 TimeWorkedAsString
+Returns the amount of time worked on this ticket as a Text String
-=item SetStarts VALUE
+=cut
+
+sub TimeWorkedAsString {
+ my $self=shift;
+ return "0" unless $self->TimeWorked;
+
+ #This is not really a date object, but if we diff a number of seconds
+ #vs the epoch, we'll get a nice description of time worked.
+
+ my $worked = new RT::Date($self->CurrentUser);
+ #return the #of minutes worked turned into seconds and written as
+ # a simple text string
+
+ return($worked->DurationAsString($self->TimeWorked*60));
+}
+# }}}
-Set Starts to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Starts will be stored as a datetime.)
+# }}}
+
+# {{{ Routines dealing with correspondence/comments
+
+# {{{ sub Comment
+
+=head2 Comment
+
+Comment on this ticket.
+Takes a hashref with the follwoing attributes:
+
+MIMEObj, TimeTaken, CcMessageTo, BccMessageTo
=cut
+sub Comment {
+ my $self = shift;
+
+ my %args = (
+ CcMessageTo => undef,
+ BccMessageTo => undef,
+ MIMEObj => undef,
+ TimeTaken => 0,
+ @_ );
+
+ unless (($self->CurrentUserHasRight('CommentOnTicket')) or
+ ($self->CurrentUserHasRight('ModifyTicket'))) {
+ return (0, "Permission Denied");
+ }
+
+ unless ($args{'MIMEObj'}) {
+ return(0,"No correspondence attached");
+ }
+
+ # If we've been passed in CcMessageTo and BccMessageTo fields,
+ # add them to the mime object for passing on to the transaction handler
+ # The "NotifyOtherRecipients" scripAction will look for RT--Send-Cc: and
+ # RT-Send-Bcc: headers
+
+ $args{'MIMEObj'}->head->add('RT-Send-Cc', $args{'CcMessageTo'});
+ $args{'MIMEObj'}->head->add('RT-Send-Bcc', $args{'BccMessageTo'});
+
+ #Record the correspondence (write the transaction)
+ my ($Trans, $Msg, $TransObj) = $self->_NewTransaction( Type => 'Comment',
+ Data =>($args{'MIMEObj'}->head->get('subject') || 'No Subject'),
+ TimeTaken => $args{'TimeTaken'},
+ MIMEObj => $args{'MIMEObj'}
+ );
+
+
+ return ($Trans, "The comment has been recorded");
+}
-=item Started
+# }}}
-Returns the current value of Started.
-(In the database, Started is stored as datetime.)
+# {{{ sub Correspond
+=head2 Correspond
+Correspond on this ticket.
+Takes a hashref with the following attributes:
-=item SetStarted VALUE
+MIMEObj, TimeTaken, CcMessageTo, BccMessageTo
-Set Started to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Started will be stored as a datetime.)
+=cut
+
+sub Correspond {
+ my $self = shift;
+ my %args = (
+ CcMessageTo => undef,
+ BccMessageTo => undef,
+ MIMEObj => undef,
+ TimeTaken => 0,
+ @_ );
+
+ unless (($self->CurrentUserHasRight('ReplyToTicket')) or
+ ($self->CurrentUserHasRight('ModifyTicket'))) {
+ return (0, "Permission Denied");
+ }
+
+ unless ($args{'MIMEObj'}) {
+ return(0,"No correspondence attached");
+ }
+
+ # If we've been passed in CcMessageTo and BccMessageTo fields,
+ # add them to the mime object for passing on to the transaction handler
+ # The "NotifyOtherRecipients" scripAction will look for RT-Send-Cc: and RT-Send-Bcc:
+ # headers
+
+ $args{'MIMEObj'}->head->add('RT-Send-Cc', $args{'CcMessageTo'});
+ $args{'MIMEObj'}->head->add('RT-Send-Bcc', $args{'BccMessageTo'});
+
+ #Record the correspondence (write the transaction)
+ my ($Trans,$msg, $TransObj) = $self->_NewTransaction
+ (Type => 'Correspond',
+ Data => ($args{'MIMEObj'}->head->get('subject') || 'No Subject'),
+ TimeTaken => $args{'TimeTaken'},
+ MIMEObj=> $args{'MIMEObj'}
+ );
+
+ # TODO this bit of logic should really become a scrip for 2.2
+ my $TicketAsSystem = new RT::Ticket($RT::SystemUser);
+ $TicketAsSystem->Load($self->Id);
+
+ if (
+ ($TicketAsSystem->Status ne 'open') and
+ ($TicketAsSystem->Status ne 'new')
+ ) {
+
+ my $oldstatus = $TicketAsSystem->Status();
+ $TicketAsSystem->__Set(Field => 'Status', Value => 'open');
+ $TicketAsSystem->_NewTransaction
+ ( Type => 'Set',
+ Field => 'Status',
+ OldValue => $oldstatus,
+ NewValue => 'open',
+ Data => 'Ticket auto-opened on incoming correspondence'
+ );
+ }
+
+ unless ($Trans) {
+ $RT::Logger->err("$self couldn't init a transaction ($msg)\n");
+ return ($Trans, "correspondence (probably) not sent", $args{'MIMEObj'});
+ }
+
+ #Set the last told date to now if this isn't mail from the requestor.
+ #TODO: Note that this will wrongly ack mail from any non-requestor as a "told"
+
+ unless ($TransObj->IsInbound) {
+ $self->_SetTold;
+ }
+
+ return ($Trans, "correspondence sent");
+}
+
+# }}}
+
+# }}}
+
+# {{{ Routines dealing with Links and Relations between tickets
+# {{{ Link Collections
+
+# {{{ sub Members
+
+=head2 Members
+
+ This returns an RT::Links object which references all the tickets
+which are 'MembersOf' this ticket
=cut
+sub Members {
+ my $self = shift;
+ return ($self->_Links('Target', 'MemberOf'));
+}
+
+# }}}
+
+# {{{ sub MemberOf
-=item Due
+=head2 MemberOf
-Returns the current value of Due.
-(In the database, Due is stored as datetime.)
+ This returns an RT::Links object which references all the tickets that this
+ticket is a 'MemberOf'
+=cut
+sub MemberOf {
+ my $self = shift;
+ return ($self->_Links('Base', 'MemberOf'));
+}
-=item SetDue VALUE
+# }}}
+# {{{ RefersTo
-Set Due to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Due will be stored as a datetime.)
+=head2 RefersTo
+ This returns an RT::Links object which shows all references for which this ticket is a base
=cut
+sub RefersTo {
+ my $self = shift;
+ return ($self->_Links('Base', 'RefersTo'));
+}
-=item Resolved
+# }}}
-Returns the current value of Resolved.
-(In the database, Resolved is stored as datetime.)
+# {{{ ReferredToBy
+=head2 ReferredToBy
+ This returns an RT::Links object which shows all references for which this ticket is a target
-=item SetResolved VALUE
+=cut
+sub ReferredToBy {
+ my $self = shift;
+ return ($self->_Links('Target', 'RefersTo'));
+}
-Set Resolved to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Resolved will be stored as a datetime.)
+# }}}
+# {{{ DependedOnBy
+
+=head2 DependedOnBy
+
+ This returns an RT::Links object which references all the tickets that depend on this one
=cut
+sub DependedOnBy {
+ my $self = shift;
+ return ($self->_Links('Target','DependsOn'));
+}
+# }}}
-=item LastUpdatedBy
+# {{{ DependsOn
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+=head2 DependsOn
+ This returns an RT::Links object which references all the tickets that this ticket depends on
=cut
+sub DependsOn {
+ my $self = shift;
+ return ($self->_Links('Base','DependsOn'));
+}
+# }}}
-=item LastUpdated
+# {{{ sub _Links
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+sub _Links {
+ my $self = shift;
+
+ #TODO: Field isn't the right thing here. but I ahave no idea what mnemonic ---
+ #tobias meant by $f
+ my $field = shift;
+ my $type =shift || "";
+
+ unless ($self->{"$field$type"}) {
+ $self->{"$field$type"} = new RT::Links($self->CurrentUser);
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+
+ $self->{"$field$type"}->Limit(FIELD=>$field, VALUE=>$self->URI);
+ $self->{"$field$type"}->Limit(FIELD=>'Type',
+ VALUE=>$type) if ($type);
+ }
+ }
+ return ($self->{"$field$type"});
+}
+
+# }}}
+
+# }}}
+
+
+# {{{ sub DeleteLink
+
+=head2 DeleteLink
+
+Delete a link. takes a paramhash of Base, Target and Type.
+Either Base or Target must be null. The null value will
+be replaced with this ticket\'s id
+
+=cut
+
+sub DeleteLink {
+ my $self = shift;
+ my %args = ( Base => undef,
+ Target => undef,
+ Type => undef,
+ @_ );
+
+ #check acls
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ $RT::Logger->debug("No permission to delete links\n");
+ return (0, 'Permission Denied');
+
+
+ }
+
+ #we want one of base and target. we don't care which
+ #but we only want _one_
+
+ if ($args{'Base'} and $args{'Target'}) {
+ $RT::Logger->debug("$self ->_DeleteLink. got both Base and Target\n");
+ return (0, 'Can\'t specifiy both base and target');
+ }
+ elsif ($args{'Base'}) {
+ $args{'Target'} = $self->Id();
+ }
+ elsif ($args{'Target'}) {
+ $args{'Base'} = $self->Id();
+ }
+ else {
+ $RT::Logger->debug("$self: Base or Target must be specified\n");
+ return (0, 'Either base or target must be specified');
+ }
+
+ my $link = new RT::Link($self->CurrentUser);
+ $RT::Logger->debug("Trying to load link: ". $args{'Base'}." ". $args{'Type'}. " ". $args{'Target'}. "\n");
+
+ $link->Load($args{'Base'}, $args{'Type'}, $args{'Target'});
+
+
+
+ #it's a real link.
+ if ($link->id) {
+ $RT::Logger->debug("We're going to delete link ".$link->id."\n");
+ $link->Delete();
+
+ my $TransString=
+ "Ticket $args{'Base'} no longer $args{Type} ticket $args{'Target'}.";
+ my ($Trans, $Msg, $TransObj) = $self->_NewTransaction
+ (Type => 'DeleteLink',
+ Field => $args{'Type'},
+ Data => $TransString,
+ TimeTaken => 0
+ );
+
+ return ($linkid, "Link deleted ($TransString)", $transactionid);
+ }
+ #if it's not a link we can find
+ else {
+ $RT::Logger->debug("Couldn't find that link\n");
+ return (0, "Link not found");
+ }
+}
+
+# }}}
+
+# {{{ sub AddLink
+
+=head2 AddLink
+
+Takes a paramhash of Type and one of Base or Target. Adds that link to this ticket.
=cut
+sub AddLink {
+ my $self = shift;
+ my %args = ( Target => '',
+ Base => '',
+ Type => '',
+ @_ );
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ if ($args{'Base'} and $args{'Target'}) {
+ $RT::Logger->debug("$self tried to delete a link. both base and target were specified\n");
+ return (0, 'Can\'t specifiy both base and target');
+ }
+ elsif ($args{'Base'}) {
+ $args{'Target'} = $self->Id();
+ }
+ elsif ($args{'Target'}) {
+ $args{'Base'} = $self->Id();
+ }
+ else {
+ return (0, 'Either base or target must be specified');
+ }
+
+ # {{{ We don't want references to ourself
+ if ($args{Base} eq $args{Target}) {
+ return (0, "Can\'t link a ticket to itself");
+ }
+
+ # }}}
+
+ # If the base isn't a URI, make it a URI.
+ # If the target isn't a URI, make it a URI.
+
+ # {{{ Check if the link already exists - we don't want duplicates
+ my $old_link= new RT::Link ($self->CurrentUser);
+ $old_link->Load($args{'Base'}, $args{'Type'}, $args{'Target'});
+ if ($old_link->Id) {
+ $RT::Logger->debug("$self Somebody tried to duplicate a link");
+ return ($old_link->id, "Link already exists",0);
+ }
+ # }}}
+
+ # Storing the link in the DB.
+ my $link = RT::Link->new($self->CurrentUser);
+ my ($linkid) = $link->Create(Target => $args{Target},
+ Base => $args{Base},
+ Type => $args{Type});
+
+ unless ($linkid) {
+ return (0,"Link could not be created");
+ }
+ #Write the transaction
+
+ my $TransString="Ticket $args{'Base'} $args{Type} ticket $args{'Target'}.";
+
+ my ($Trans, $Msg, $TransObj) = $self->_NewTransaction
+ (Type => 'AddLink',
+ Field => $args{'Type'},
+ Data => $TransString,
+ TimeTaken => 0
+ );
+
+ return ($Trans, "Link created ($TransString)");
+
+
+}
+# }}}
+
+# {{{ sub URI
+
+=head2 URI
+
+Returns this ticket's URI
+
+=cut
+
+sub URI {
+ my $self = shift;
+ return $RT::TicketBaseURI.$self->id;
+}
+
+# }}}
-=item Creator
+# {{{ sub MergeInto
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+=head2 MergeInto
+MergeInto take the id of the ticket to merge this ticket into.
+=cut
+
+sub MergeInto {
+ my $self = shift;
+ my $MergeInto = shift;
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ # Load up the new ticket.
+ my $NewTicket = RT::Ticket->new($RT::SystemUser);
+ $NewTicket->Load($MergeInto);
+
+ # make sure it exists.
+ unless (defined $NewTicket->Id) {
+ return (0, 'New ticket doesn\'t exist');
+ }
+
+
+ # Make sure the current user can modify the new ticket.
+ unless ($NewTicket->CurrentUserHasRight('ModifyTicket')) {
+ $RT::Logger->debug("failed...");
+ return (0, "Permission Denied");
+ }
+
+ $RT::Logger->debug("checking if the new ticket has the same id and effective id...");
+ unless ($NewTicket->id == $NewTicket->EffectiveId) {
+ $RT::Logger->err('$self trying to merge into '.$NewTicket->Id .
+ ' which is itself merged.\n');
+ return (0, "Can't merge into a merged ticket. ".
+ "You should never get this error");
+ }
+
+
+ # We use EffectiveId here even though it duplicates information from
+ # the links table becasue of the massive performance hit we'd take
+ # by trying to do a seperate database query for merge info everytime
+ # loaded a ticket.
+
+
+ #update this ticket's effective id to the new ticket's id.
+ my ($id_val, $id_msg) = $self->__Set(Field => 'EffectiveId',
+ Value => $NewTicket->Id());
+
+ unless ($id_val) {
+ $RT::Logger->error("Couldn't set effective ID for ".$self->Id.
+ ": $id_msg");
+ return(0,"Merge failed. Couldn't set EffectiveId");
+ }
+
+ my ($status_val, $status_msg) = $self->__Set(Field => 'Status',
+ Value => 'resolved');
+
+ unless ($status_val) {
+ $RT::Logger->error("$self couldn't set status to resolved.".
+ "RT's Database may be inconsistent.");
+ }
+
+ #make a new link: this ticket is merged into that other ticket.
+ $self->AddLink( Type =>'MergedInto',
+ Target => $NewTicket->Id() );
+
+ #add all of this ticket's watchers to that ticket.
+ my $watchers = $self->Watchers();
+
+ while (my $watcher = $watchers->Next()) {
+ unless (
+ ($watcher->Owner &&
+ $NewTicket->IsWatcher (Type => $watcher->Type,
+ Id => $watcher->Owner)) or
+ ($watcher->Email &&
+ $NewTicket->IsWatcher (Type => $watcher->Type,
+ Id => $watcher->Email))
+ ) {
+
+
+
+ $NewTicket->_AddWatcher(Silent => 1,
+ Type => $watcher->Type,
+ Email => $watcher->Email,
+ Owner => $watcher->Owner);
+ }
+ }
+
+
+ #find all of the tickets that were merged into this ticket.
+ my $old_mergees = new RT::Tickets($self->CurrentUser);
+ $old_mergees->Limit( FIELD => 'EffectiveId',
+ OPERATOR => '=',
+ VALUE => $self->Id );
+
+ # update their EffectiveId fields to the new ticket's id
+ while (my $ticket = $old_mergees->Next()) {
+ my ($val, $msg) = $ticket->__Set(Field => 'EffectiveId',
+ Value => $NewTicket->Id());
+ }
+ $NewTicket->_SetLastUpdated;
+
+ return ($TransactionObj, "Merge Successful");
+}
+
+# }}}
+
+# }}}
+
+# {{{ Routines dealing with keywords
+
+# {{{ sub KeywordsObj
+
+=head2 KeywordsObj [KEYWORD_SELECT_ID]
+
+ Returns an B<RT::ObjectKeywords> object preloaded with this ticket's ObjectKeywords.
+If the optional KEYWORD_SELECT_ID parameter is set, limit the keywords object to that keyword
+select.
=cut
+sub KeywordsObj {
+ my $self = shift;
+ my $keyword_select;
+
+ $keyword_select = shift if (@_);
+
+ use RT::ObjectKeywords;
+ my $Keywords = new RT::ObjectKeywords($self->CurrentUser);
+
+ #ACL check
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ $Keywords->LimitToTicket($self->id);
+ if ($keyword_select) {
+ $Keywords->LimitToKeywordSelect($keyword_select);
+ }
+ }
+ return ($Keywords);
+}
+# }}}
+
+# {{{ sub AddKeyword
-=item Created
+=head2 AddKeyword
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+Takes a paramhash of Keyword and KeywordSelect. If Keyword is a valid choice
+for KeywordSelect, creates a KeywordObject. If the KeywordSelect says this should
+be a single KeywordObject, automatically removes the old value.
+ Issues: probably doesn't enforce the depth restrictions or make sure that keywords
+are coming from the right part of the tree. really should.
=cut
+sub AddKeyword {
+ my $self = shift;
+ #ACL check
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, 'Permission Denied');
+ }
+
+ return($self->_AddKeyword(@_));
+
+}
+
-=item Disabled
+# Helper version of AddKeyword without that pesky ACL check
+sub _AddKeyword {
+ my $self = shift;
+ my %args = ( KeywordSelect => undef, # id of a keyword select record
+ Keyword => undef, #id of the keyword to add
+ Silent => 0,
+ @_
+ );
+
+ my ($OldValue);
+
+ #TODO make sure that $args{'Keyword'} is valid for $args{'KeywordSelect'}
+
+ #TODO: make sure that $args{'KeywordSelect'} applies to this ticket's queue.
+
+ my $Keyword = new RT::Keyword($self->CurrentUser);
+ unless ($Keyword->Load($args{'Keyword'}) ) {
+ $RT::Logger->err("$self Couldn't load Keyword ".$args{'Keyword'} ."\n");
+ return(0, "Couldn't load keyword");
+ }
+
+ my $KeywordSelectObj = new RT::KeywordSelect($self->CurrentUser);
+ unless ($KeywordSelectObj->Load($args{'KeywordSelect'})) {
+ $RT::Logger->err("$self Couldn't load KeywordSelect ".$args{'KeywordSelect'});
+ return(0, "Couldn't load keywordselect");
+ }
+
+ my $Keywords = $self->KeywordsObj($KeywordSelectObj->id);
+
+ #If the ticket already has this keyword, just get out of here.
+ if ($Keywords->HasEntry($Keyword->id)) {
+ return(0, "That is already the current value");
+ }
+
+ #If the keywordselect wants this to be a singleton:
+
+ if ($KeywordSelectObj->Single) {
+
+ #Whack any old values...keep track of the last value that we get.
+ #we shouldn't need a loop ehre, but we do it anyway, to try to
+ # help keep the database clean.
+ while (my $OldKey = $Keywords->Next) {
+ $OldValue = $OldKey->KeywordObj->Name;
+ $OldKey->Delete();
+ }
+
+
+ }
+
+ # create the new objectkeyword
+ my $ObjectKeyword = new RT::ObjectKeyword($self->CurrentUser);
+ my $result = $ObjectKeyword->Create( Keyword => $Keyword->Id,
+ ObjectType => 'Ticket',
+ ObjectId => $self->Id,
+ KeywordSelect => $KeywordSelectObj->Id );
+
+
+ # record a single transaction, unless we were told not to
+ unless ($args{'Silent'}) {
+ my ($TransactionId, $Msg, $TransactionObj) =
+ $self->_NewTransaction( Type => 'Keyword',
+ Field => $KeywordSelectObj->Id,
+ OldValue => $OldValue,
+ NewValue => $Keyword->Name );
+ }
+ return ($TransactionId, "Keyword ".$ObjectKeyword->KeywordObj->Name ." added.");
+
+}
+
+# }}}
+
+# {{{ sub DeleteKeyword
+
+=head2 DeleteKeyword
+
+ Takes a paramhash. Deletes the Keyword denoted by the I<Keyword> parameter from this
+ ticket's object keywords.
-Returns the current value of Disabled.
-(In the database, Disabled is stored as smallint(6).)
+=cut
+
+sub DeleteKeyword {
+ my $self = shift;
+ my %args = ( Keyword => undef,
+ KeywordSelect => undef,
+ @_ );
+
+ #ACL check
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, 'Permission Denied');
+ }
+
+
+ #Load up the ObjectKeyword we\'re talking about
+ my $ObjectKeyword = new RT::ObjectKeyword($self->CurrentUser);
+ $ObjectKeyword->LoadByCols(Keyword => $args{'Keyword'},
+ KeywordSelect => $args{'KeywordSelect'},
+ ObjectType => 'Ticket',
+ ObjectId => $self->id()
+ );
+
+ #if we can\'t find it, bail
+ unless ($ObjectKeyword->id) {
+ $RT::Logger->err("Couldn't find the keyword ".$args{'Keyword'} .
+ " for keywordselect ". $args{'KeywordSelect'} .
+ "for ticket ".$self->id );
+ return (undef, "Couldn't load keyword while trying to delete it.");
+ };
+
+ #record transaction here.
+ my ($TransactionId, $Msg, $TransObj) =
+ $self->_NewTransaction( Type => 'Keyword',
+ OldValue => $ObjectKeyword->KeywordObj->Name);
+
+ $ObjectKeyword->Delete();
+
+ return ($TransactionId, "Keyword ".$ObjectKeyword->KeywordObj->Name ." deleted.");
+
+}
+# }}}
+# }}}
-=item SetDisabled VALUE
+# {{{ Routines dealing with ownership
+# {{{ sub OwnerObj
-Set Disabled to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Disabled will be stored as a smallint(6).)
+=head2 OwnerObj
+Takes nothing and returns an RT::User object of
+this ticket's owner
=cut
+sub OwnerObj {
+ my $self = shift;
+
+ #If this gets ACLed, we lose on a rights check in User.pm and
+ #get deep recursion. if we need ACLs here, we need
+ #an equiv without ACLs
+
+ $owner = new RT::User ($self->CurrentUser);
+ $owner->Load($self->__Value('Owner'));
+
+ #Return the owner object
+ return ($owner);
+}
+
+# }}}
+
+# {{{ sub OwnerAsString
+
+=head2 OwnerAsString
+
+Returns the owner's email address
+
+=cut
+
+sub OwnerAsString {
+ my $self = shift;
+ return($self->OwnerObj->EmailAddress);
+
+}
+
+# }}}
+
+# {{{ sub SetOwner
+=head2 SetOwner
+
+Takes two arguments:
+ the Id or Name of the owner
+and (optionally) the type of the SetOwner Transaction. It defaults
+to 'Give'. 'Steal' is also a valid option.
+
+=cut
+
+sub SetOwner {
+ my $self = shift;
+ my $NewOwner = shift;
+ my $Type = shift || "Give";
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ my $NewOwnerObj = RT::User->new($self->CurrentUser);
+ my $OldOwnerObj = $self->OwnerObj;
+
+ $NewOwnerObj->Load($NewOwner);
+ if (!$NewOwnerObj->Id) {
+ return (0, "That user does not exist");
+ }
+
+ #If thie ticket has an owner and it's not the current user
+
+ if (($Type ne 'Steal' ) and ($Type ne 'Force') and #If we're not stealing
+ ($self->OwnerObj->Id != $RT::Nobody->Id ) and #and the owner is set
+ ($self->CurrentUser->Id ne $self->OwnerObj->Id())) { #and it's not us
+ return(0, "You can only reassign tickets that you own or that are unowned");
+ }
+
+ #If we've specified a new owner and that user can't modify the ticket
+ elsif (($NewOwnerObj->Id) and
+ (!$NewOwnerObj->HasQueueRight(Right => 'OwnTicket',
+ QueueObj => $self->QueueObj,
+ TicketObj => $self))
+ ) {
+ return (0, "That user may not own requests in that queue");
+ }
+
+
+ #If the ticket has an owner and it's the new owner, we don't need
+ #To do anything
+ elsif (($self->OwnerObj) and ($NewOwnerObj->Id eq $self->OwnerObj->Id)) {
+ return(0, "That user already owns that request");
+ }
+
+
+ my ($trans,$msg)=$self->_Set(Field => 'Owner',
+ Value => $NewOwnerObj->Id,
+ TimeTaken => 0,
+ TransactionType => $Type);
+
+ if ($trans) {
+ $msg = "Owner changed from ".$OldOwnerObj->Name." to ".$NewOwnerObj->Name;
+ }
+ return ($trans, $msg);
+
+}
+
+# }}}
+
+# {{{ sub Take
+
+=head2 Take
+
+A convenince method to set the ticket's owner to the current user
+
+=cut
+
+sub Take {
+ my $self = shift;
+ return ($self->SetOwner($self->CurrentUser->Id, 'Take'));
+}
+
+# }}}
+
+# {{{ sub Untake
+
+=head2 Untake
+
+Convenience method to set the owner to 'nobody' if the current user is the owner.
+
+=cut
+
+sub Untake {
+ my $self = shift;
+ return($self->SetOwner($RT::Nobody->UserObj->Id, 'Untake'));
+}
+# }}}
+
+# {{{ sub Steal
+
+=head2 Steal
+
+A convenience method to change the owner of the current ticket to the
+current user. Even if it's owned by another user.
+
+=cut
+
+sub Steal {
+ my $self = shift;
+
+ if ($self->IsOwner($self->CurrentUser)) {
+ return (0,"You already own this ticket");
+ } else {
+ return($self->SetOwner($self->CurrentUser->Id, 'Steal'));
+
+ }
+
+}
+
+# }}}
+
+# }}}
+
+# {{{ Routines dealing with status
+
+# {{{ sub ValidateStatus
+
+=head2 ValidateStatus STATUS
+
+Takes a string. Returns true if that status is a valid status for this ticket.
+Returns false otherwise.
+
+=cut
+
+sub ValidateStatus {
+ my $self = shift;
+ my $status = shift;
+
+ #Make sure the status passed in is valid
+ unless ($self->QueueObj->IsValidStatus($status)) {
+ return (undef);
+ }
+
+ return (1);
+
+}
+
+
+# }}}
+
+# {{{ sub SetStatus
+
+=head2 SetStatus STATUS
+
+Set this ticket\'s status. STATUS can be one of: new, open, stalled, resolved or dead.
+
+=cut
+
+sub SetStatus {
+ my $self = shift;
+ my $status = shift;
+
+ #Check ACL
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, 'Permission Denied');
+ }
+
+ my $now = new RT::Date($self->CurrentUser);
+ $now->SetToNow();
+
+ #If we're changing the status from new, record that we've started
+ if (($self->Status =~ /new/) && ($status ne 'new')) {
+ #Set the Started time to "now"
+ $self->_Set(Field => 'Started',
+ Value => $now->ISO,
+ RecordTransaction => 0);
+ }
+
+
+ if ($status eq 'resolved') {
+ #When we resolve a ticket, set the 'Resolved' attribute to now.
+ $self->_Set(Field => 'Resolved',
+ Value => $now->ISO,
+ RecordTransaction => 0);
+ }
+
+
+ #Actually update the status
+ return($self->_Set(Field => 'Status',
+ Value => $status,
+ TimeTaken => 0,
+ TransactionType => 'Status'));
+}
+
+# }}}
+
+# {{{ sub Kill
+
+=head2 Kill
+
+Takes no arguments. Marks this ticket for garbage collection
+
+=cut
+
+sub Kill {
+ my $self = shift;
+ return ($self->SetStatus('dead'));
+ # TODO: garbage collection
+}
+
+# }}}
+
+# {{{ sub Stall
+
+=head2 Stall
+
+Sets this ticket's status to stalled
+
+=cut
+
+sub Stall {
+ my $self = shift;
+ return ($self->SetStatus('stalled'));
+}
+
+# }}}
+
+# {{{ sub Open
+
+=head2 Open
+
+Sets this ticket\'s status to Open
+
+=cut
+
+sub Open {
+ my $self = shift;
+ return ($self->SetStatus('open'));
+}
+
+# }}}
+
+# {{{ sub Resolve
+
+=head2 Resolve
+
+Sets this ticket\'s status to Resolved
+
+=cut
+
+sub Resolve {
+ my $self = shift;
+ return ($self->SetStatus('resolved'));
+}
+
+# }}}
+
+# }}}
+
+# {{{ Actions + Routines dealing with transactions
+
+# {{{ sub SetTold and _SetTold
+
+=head2 SetTold ISO [TIMETAKEN]
+
+Updates the told and records a transaction
+
+=cut
+
+sub SetTold {
+ my $self=shift;
+ my $told;
+ $told = shift if (@_);
+ my $timetaken=shift || 0;
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ my $datetold = new RT::Date($self->CurrentUser);
+ if ($told) {
+ $datetold->Set( Format => 'iso',
+ Value => $told);
+ }
+ else {
+ $datetold->SetToNow();
+ }
+
+ return($self->_Set(Field => 'Told',
+ Value => $datetold->ISO,
+ TimeTaken => $timetaken,
+ TransactionType => 'Told'));
+}
+
+=head2 _SetTold
+
+Updates the told without a transaction or acl check. Useful when we're sending replies.
+
+=cut
+
+sub _SetTold {
+ my $self=shift;
+
+ my $now = new RT::Date($self->CurrentUser);
+ $now->SetToNow();
+ #use __Set to get no ACLs ;)
+ return($self->__Set(Field => 'Told',
+ Value => $now->ISO));
+}
+
+# }}}
+
+# {{{ sub Transactions
+
+=head2 Transactions
+
+ Returns an RT::Transactions object of all transactions on this ticket
+
+=cut
+
+sub Transactions {
+ my $self = shift;
+
+ use RT::Transactions;
+ my $transactions = RT::Transactions->new($self->CurrentUser);
+
+ #If the user has no rights, return an empty object
+ if ($self->CurrentUserHasRight('ShowTicket')) {
+ my $tickets = $transactions->NewAlias('Tickets');
+ $transactions->Join( ALIAS1 => 'main',
+ FIELD1 => 'Ticket',
+ ALIAS2 => $tickets,
+ FIELD2 => 'id');
+ $transactions->Limit( ALIAS => $tickets,
+ FIELD => 'EffectiveId',
+ VALUE => $self->id());
+ # if the user may not see comments do not return them
+ unless ($self->CurrentUserHasRight('ShowTicketComments')) {
+ $transactions->Limit( FIELD => 'Type',
+ OPERATOR => '!=',
+ VALUE => "Comment");
+ }
+ }
+
+ return($transactions);
+}
+
+# }}}
+
+# {{{ sub _NewTransaction
+
+sub _NewTransaction {
+ my $self = shift;
+ my %args = ( TimeTaken => 0,
+ Type => undef,
+ OldValue => undef,
+ NewValue => undef,
+ Data => undef,
+ Field => undef,
+ MIMEObj => undef,
+ @_ );
+
+
+ require RT::Transaction;
+ my $trans = new RT::Transaction($self->CurrentUser);
+ my ($transaction, $msg) =
+ $trans->Create( Ticket => $self->Id,
+ TimeTaken => $args{'TimeTaken'},
+ Type => $args{'Type'},
+ Data => $args{'Data'},
+ Field => $args{'Field'},
+ NewValue => $args{'NewValue'},
+ OldValue => $args{'OldValue'},
+ MIMEObj => $args{'MIMEObj'}
+ );
+
+ $RT::Logger->warning($msg) unless $transaction;
+
+ $self->_SetLastUpdated;
+
+ if (defined $args{'TimeTaken'} ) {
+ $self->_UpdateTimeTaken($args{'TimeTaken'});
+ }
+ return($transaction, $msg, $trans);
+}
+
+# }}}
+
+# }}}
+
+# {{{ PRIVATE UTILITY METHODS. Mostly needed so Ticket can be a DBIx::Record
+
+# {{{ sub _ClassAccessible
sub _ClassAccessible {
{
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- EffectiveId =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Queue =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Type =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- IssueStatement =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Resolution =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Owner =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Subject =>
- {read => 1, write => 1, type => 'varchar(200)', default => '[no subject]'},
- InitialPriority =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- FinalPriority =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Priority =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- TimeEstimated =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- TimeWorked =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Status =>
- {read => 1, write => 1, type => 'varchar(10)', default => ''},
- TimeLeft =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Told =>
- {read => 1, write => 1, type => 'datetime', default => ''},
- Starts =>
- {read => 1, write => 1, type => 'datetime', default => ''},
- Started =>
- {read => 1, write => 1, type => 'datetime', default => ''},
- Due =>
- {read => 1, write => 1, type => 'datetime', default => ''},
- Resolved =>
- {read => 1, write => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- Disabled =>
- {read => 1, write => 1, type => 'smallint(6)', default => '0'},
-
- }
-};
+ EffectiveId => { 'read' => 1, 'write' => 1, 'public' => 1 },
+ Queue => { 'read' => 1, 'write' => 1 },
+ Requestors => { 'read' => 1, 'write' => 1 },
+ Owner => { 'read' => 1, 'write' => 1 },
+ Subject => { 'read' => 1, 'write' => 1 },
+ InitialPriority => { 'read' => 1, 'write' => 1 },
+ FinalPriority => { 'read' => 1, 'write' => 1 },
+ Priority => { 'read' => 1, 'write' => 1 },
+ Status => { 'read' => 1, 'write' => 1 },
+ TimeWorked => { 'read' => 1, 'write' => 1 },
+ TimeLeft => { 'read' => 1, 'write' => 1 },
+ Created => { 'read' => 1, 'auto' => 1 },
+ Creator => { 'read' => 1, 'auto' => 1 },
+ Told => { 'read' => 1, 'write' => 1 },
+ Resolved => {'read' => 1},
+ Starts => { 'read' => 1, 'write' => 1 },
+ Started => { 'read' => 1, 'write' => 1 },
+ Due => { 'read' => 1, 'write' => 1 },
+ Creator => { 'read' => 1, 'auto' => 1 },
+ Created => { 'read' => 1, 'auto' => 1 },
+ LastUpdatedBy => { 'read' => 1, 'auto' => 1 },
+ LastUpdated => { 'read' => 1, 'auto' => 1 }
+ };
+
+}
+
+# }}}
+
+# {{{ sub _Set
+
+sub _Set {
+ my $self = shift;
+
+ unless ($self->CurrentUserHasRight('ModifyTicket')) {
+ return (0, "Permission Denied");
+ }
+
+ my %args = (Field => undef,
+ Value => undef,
+ TimeTaken => 0,
+ RecordTransaction => 1,
+ TransactionType => 'Set',
+ @_
+ );
+ #if the user is trying to modify the record
+
+ #Take care of the old value we really don't want to get in an ACL loop.
+ # so ask the super::_Value
+ my $Old=$self->SUPER::_Value("$args{'Field'}");
+
+ #Set the new value
+ my ($ret, $msg)=$self->SUPER::_Set(Field => $args{'Field'},
+ Value=> $args{'Value'});
+
+ #If we can't actually set the field to the value, don't record
+ # a transaction. instead, get out of here.
+ if ($ret==0) {return (0,$msg);}
+
+ if ($args{'RecordTransaction'} == 1) {
+
+ my ($Trans, $Msg, $TransObj) =
+ $self->_NewTransaction(Type => $args{'TransactionType'},
+ Field => $args{'Field'},
+ NewValue => $args{'Value'},
+ OldValue => $Old,
+ TimeTaken => $args{'TimeTaken'},
+ );
+ return ($Trans,$TransObj->Description);
+ }
+ else {
+ return ($ret, $msg);
+ }
+}
+# }}}
- eval "require RT::Ticket_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Overlay.pm}) {
- die $@;
- };
+# {{{ sub _Value
- eval "require RT::Ticket_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Vendor.pm}) {
- die $@;
- };
+=head2 _Value
- eval "require RT::Ticket_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Local.pm}) {
- die $@;
- };
+Takes the name of a table column.
+Returns its value as a string, if the user passes an ACL check
+=cut
+sub _Value {
+
+ my $self = shift;
+ my $field = shift;
+
+
+ #if the field is public, return it.
+ if ($self->_Accessible($field, 'public')) {
+ #$RT::Logger->debug("Skipping ACL check for $field\n");
+ return($self->SUPER::_Value($field));
+
+ }
+
+ #If the current user doesn't have ACLs, don't let em at it.
+
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return (undef);
+ }
+ return($self->SUPER::_Value($field));
+
+}
+# }}}
-=head1 SEE ALSO
+# {{{ sub _UpdateTimeTaken
+
+=head2 _UpdateTimeTaken
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+This routine will increment the timeworked counter. it should
+only be called from _NewTransaction
-These overlay files can contain new subs or subs to replace existing subs in this module.
+=cut
+
+sub _UpdateTimeTaken {
+ my $self = shift;
+ my $Minutes = shift;
+ my ($Total);
+
+ $Total = $self->SUPER::_Value("TimeWorked");
+ $Total = ($Total || 0) + ($Minutes || 0);
+ $self->SUPER::_Set(Field => "TimeWorked",
+ Value => $Total);
+
+ return ($Total);
+}
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+# }}}
- no warnings qw(redefine);
+# }}}
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+# {{{ Routines dealing with ACCESS CONTROL
-RT::Ticket_Overlay, RT::Ticket_Vendor, RT::Ticket_Local
+# {{{ sub CurrentUserHasRight
+
+=head2 CurrentUserHasRight
+
+ Takes the textual name of a Ticket scoped right (from RT::ACE) and returns
+1 if the user has that right. It returns 0 if the user doesn't have that right.
=cut
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+
+ return ($self->HasRight( Principal=> $self->CurrentUser->UserObj(),
+ Right => "$right"));
+
+}
+
+# }}}
+
+# {{{ sub HasRight
+
+=head2 HasRight
+
+ Takes a paramhash with the attributes 'Right' and 'Principal'
+ 'Right' is a ticket-scoped textual right from RT::ACE
+ 'Principal' is an RT::User object
+
+ Returns 1 if the principal has the right. Returns undef if not.
+
+=cut
+
+sub HasRight {
+ my $self = shift;
+ my %args = ( Right => undef,
+ Principal => undef,
+ @_);
+
+ unless ((defined $args{'Principal'}) and (ref($args{'Principal'}))) {
+ $RT::Logger->warning("Principal attrib undefined for Ticket::HasRight");
+ }
+
+ return($args{'Principal'}->HasQueueRight(TicketObj => $self,
+ Right => $args{'Right'}));
+}
+
+# }}}
+
+# }}}
+
1;
+
+=head1 AUTHOR
+
+Jesse Vincent, jesse@fsck.com
+
+=head1 SEE ALSO
+
+RT
+
+=cut
+
+
diff --git a/rt/lib/RT/Tickets.pm b/rt/lib/RT/Tickets.pm
index b6b349144..dd91126c4 100755
--- a/rt/lib/RT/Tickets.pm
+++ b/rt/lib/RT/Tickets.pm
@@ -1,115 +1,1789 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Tickets.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
-use strict;
+=head1 NAME
+ RT::Tickets - A collection of Ticket objects
-=head1 NAME
- RT::Tickets -- Class Description
-
=head1 SYNOPSIS
- use RT::Tickets
+ use RT::Tickets;
+ my $tickets = new RT::Tickets($CurrentUser);
=head1 DESCRIPTION
+ A collection of RT::Tickets.
=head1 METHODS
+=begin testing
+
+ok (require RT::TestHarness);
+ok (require RT::Tickets);
+
+=end testing
+
=cut
package RT::Tickets;
-
-use RT::SearchBuilder;
+use RT::EasySearch;
use RT::Ticket;
+@ISA= qw(RT::EasySearch);
+
+use vars qw(%TYPES @SORTFIELDS);
+
+# {{{ TYPES
+
+%TYPES = ( Status => 'ENUM',
+ Queue => 'ENUM',
+ Type => 'ENUM',
+ Creator => 'ENUM',
+ LastUpdatedBy => 'ENUM',
+ Owner => 'ENUM',
+ EffectiveId => 'INT',
+ id => 'INT',
+ InitialPriority => 'INT',
+ FinalPriority => 'INT',
+ Priority => 'INT',
+ TimeLeft => 'INT',
+ TimeWorked => 'INT',
+ MemberOf => 'LINK',
+ DependsOn => 'LINK',
+ HasMember => 'LINK',
+ HasDepender => 'LINK',
+ RelatedTo => 'LINK',
+ Told => 'DATE',
+ StartsBy => 'DATE',
+ Started => 'DATE',
+ Due => 'DATE',
+ Resolved => 'DATE',
+ LastUpdated => 'DATE',
+ Created => 'DATE',
+ Subject => 'STRING',
+ Type => 'STRING',
+ Content => 'TRANSFIELD',
+ ContentType => 'TRANSFIELD',
+ TransactionDate => 'TRANSDATE',
+ Watcher => 'WATCHERFIELD',
+ LinkedTo => 'LINKFIELD',
+ Keyword => 'KEYWORDFIELD'
+
+ );
+
+
+# }}}
+
+# {{{ sub SortFields
+
+@SORTFIELDS = qw(id Status Owner Created Due Starts Started
+ Queue Subject Told Started
+ Resolved LastUpdated Priority TimeWorked TimeLeft);
+
+=head2 SortFields
+
+Returns the list of fields that lists of tickets can easily be sorted by
+
+=cut
+
+
+sub SortFields {
+ my $self = shift;
+ return(@SORTFIELDS);
+}
+
+
+# }}}
+
+# {{{ Limit the result set based on content
+
+# {{{ sub Limit
+
+=head2 Limit
+
+Takes a paramhash with the fields FIELD, OPERATOR, VALUE and DESCRIPTION
+Generally best called from LimitFoo methods
+
+=cut
+sub Limit {
+ my $self = shift;
+ my %args = ( FIELD => undef,
+ OPERATOR => '=',
+ VALUE => undef,
+ DESCRIPTION => undef,
+ @_
+ );
+ $args{'DESCRIPTION'} = "Autodescribed: ".$args{'FIELD'} . $args{'OPERATOR'} . $args{'VALUE'},
+ if (!defined $args{'DESCRIPTION'}) ;
+
+ my $index = $self->_NextIndex;
+
+ #make the TicketRestrictions hash the equivalent of whatever we just passed in;
+
+ %{$self->{'TicketRestrictions'}{$index}} = %args;
+
+ $self->{'RecalcTicketLimits'} = 1;
+
+ # If we're looking at the effective id, we don't want to append the other clause
+ # which limits us to tickets where id = effective id
+ if ($args{'FIELD'} eq 'EffectiveId') {
+ $self->{'looking_at_effective_id'} = 1;
+ }
+
+ return ($index);
+}
+
+# }}}
+
+
+
+
+=head2 FreezeLimits
+
+Returns a frozen string suitable for handing back to ThawLimits.
+
+=cut
+# {{{ sub FreezeLimits
+
+sub FreezeLimits {
+ my $self = shift;
+ require FreezeThaw;
+ return (FreezeThaw::freeze($self->{'TicketRestrictions'},
+ $self->{'restriction_index'}
+ ));
+}
+
+# }}}
+
+=head2 ThawLimits
+
+Take a frozen Limits string generated by FreezeLimits and make this tickets
+object have that set of limits.
+
+=cut
+# {{{ sub ThawLimits
+
+sub ThawLimits {
+ my $self = shift;
+ my $in = shift;
+
+ #if we don't have $in, get outta here.
+ return undef unless ($in);
+
+ $self->{'RecalcTicketLimits'} = 1;
+
+ require FreezeThaw;
+
+ #We don't need to die if the thaw fails.
+
+ eval {
+ ($self->{'TicketRestrictions'},
+ $self->{'restriction_index'}
+ ) = FreezeThaw::thaw($in);
+ }
+
+}
+
+# }}}
+
+# {{{ Limit by enum or foreign key
+
+# {{{ sub LimitQueue
+
+=head2 LimitQueue
+
+LimitQueue takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of = or !=. (It defaults to =).
+VALUE is a queue id.
+
+=cut
+
+sub LimitQueue {
+ my $self = shift;
+ my %args = (VALUE => undef,
+ OPERATOR => '=',
+ @_);
+
+ #TODO VALUE should also take queue names and queue objects
+ my $queue = new RT::Queue($self->CurrentUser);
+ $queue->Load($args{'VALUE'});
+
+ #TODO check for a valid queue here
+
+ $self->Limit (FIELD => 'Queue',
+ VALUE => $queue->id(),
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Queue ' . $args{'OPERATOR'}. " ". $queue->Name
+ );
+
+}
+# }}}
+
+# {{{ sub LimitStatus
+
+=head2 LimitStatus
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of = or !=.
+VALUE is a status.
+
+=cut
+
+sub LimitStatus {
+ my $self = shift;
+ my %args = ( OPERATOR => '=',
+ @_);
+ $self->Limit (FIELD => 'Status',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Status ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitType
+
+=head2 LimitType
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of = or !=, it defaults to "=".
+VALUE is a string to search for in the type of the ticket.
+
+=cut
+
+sub LimitType {
+ my $self = shift;
+ my %args = (OPERATOR => '=',
+ VALUE => undef,
+ @_);
+ $self->Limit (FIELD => 'Type',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Type ' . $args{'OPERATOR'}. " ". $args{'Limit'},
+ );
+}
+
+# }}}
+
+# }}}
+
+# {{{ Limit by string field
+
+# {{{ sub LimitSubject
+
+=head2 LimitSubject
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of = or !=.
+VALUE is a string to search for in the subject of the ticket.
+
+=cut
+
+sub LimitSubject {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'Subject',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Subject ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# }}}
+
+# {{{ Limit based on ticket numerical attributes
+# Things that can be > < = !=
+
+# {{{ sub LimitId
+
+=head2 LimitId
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a ticket Id to search for
+
+=cut
+
+sub LimitId {
+ my $self = shift;
+ my %args = (OPERATOR => '=',
+ @_);
+
+ $self->Limit (FIELD => 'id',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Id ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitPriority
+
+=head2 LimitPriority
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a value to match the ticket\'s priority against
+
+=cut
+
+sub LimitPriority {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'Priority',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Priority ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitInitialPriority
+
+=head2 LimitInitialPriority
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a value to match the ticket\'s initial priority against
+
+
+=cut
+
+sub LimitInitialPriority {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'InitialPriority',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Initial Priority ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitFinalPriority
+
+=head2 LimitFinalPriority
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a value to match the ticket\'s final priority against
+
+=cut
+
+sub LimitFinalPriority {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'FinalPriority',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Final Priority ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitTimeWorked
+
+=head2 LimitTimeWorked
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a value to match the ticket's TimeWorked attribute
+
+=cut
+
+sub LimitTimeWorked {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'TimeWorked',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Time worked ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# {{{ sub LimitTimeLeft
+
+=head2 LimitTimeLeft
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, >, < or !=.
+VALUE is a value to match the ticket's TimeLeft attribute
+
+=cut
+
+sub LimitTimeLeft {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'TimeLeft',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Time left ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+
+# }}}
+
+# {{{ Limiting based on attachment attributes
+
+# {{{ sub LimitContent
+
+=head2 LimitContent
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, LIKE, NOT LIKE or !=.
+VALUE is a string to search for in the body of the ticket
+
+=cut
+sub LimitContent {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'Content',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Ticket content ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+
+# }}}
+# {{{ sub LimitContentType
+
+=head2 LimitContentType
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of =, LIKE, NOT LIKE or !=.
+VALUE is a content type to search ticket attachments for
+
+=cut
+
+sub LimitContentType {
+ my $self = shift;
+ my %args = (@_);
+ $self->Limit (FIELD => 'ContentType',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Ticket content type ' . $args{'OPERATOR'}. " ". $args{'VALUE'},
+ );
+}
+# }}}
+
+# }}}
+
+# {{{ Limiting based on people
+
+# {{{ sub LimitOwner
+
+=head2 LimitOwner
+
+Takes a paramhash with the fields OPERATOR and VALUE.
+OPERATOR is one of = or !=.
+VALUE is a user id.
+
+=cut
+
+sub LimitOwner {
+ my $self = shift;
+ my %args = ( OPERATOR => '=',
+ @_);
+
+ my $owner = new RT::User($self->CurrentUser);
+ $owner->Load($args{'VALUE'});
+ $self->Limit (FIELD => 'Owner',
+ VALUE => $owner->Id,
+ OPERATOR => $args{'OPERATOR'},
+ DESCRIPTION => 'Owner ' . $args{'OPERATOR'}. " ". $owner->Name()
+ );
+
+}
+
+# }}}
+
+# {{{ Limiting watchers
+
+# {{{ sub LimitWatcher
+
+
+=head2 LimitWatcher
+
+ Takes a paramhash with the fields OPERATOR, TYPE and VALUE.
+ OPERATOR is one of =, LIKE, NOT LIKE or !=.
+ VALUE is a value to match the ticket\'s watcher email addresses against
+ TYPE is the sort of watchers you want to match against. Leave it undef if you want to search all of them
+
+=cut
+
+sub LimitWatcher {
+ my $self = shift;
+ my %args = ( OPERATOR => '=',
+ VALUE => undef,
+ TYPE => undef,
+ @_);
+
+
+ #build us up a description
+ my ($watcher_type, $desc);
+ if ($args{'TYPE'}) {
+ $watcher_type = $args{'TYPE'};
+ }
+ else {
+ $watcher_type = "Watcher";
+ }
+ $desc = "$watcher_type ".$args{'OPERATOR'}." ".$args{'VALUE'};
+
+
+ $self->Limit (FIELD => 'Watcher',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+ TYPE => $args{'TYPE'},
+ DESCRIPTION => "$desc"
+ );
+}
+
+# }}}
+
+# {{{ sub LimitRequestor
+
+=head2 LimitRequestor
+
+It\'s like LimitWatcher, but it presets TYPE to Requestor
+
+=cut
+
+
+sub LimitRequestor {
+ my $self = shift;
+ $self->LimitWatcher(TYPE=> 'Requestor', @_);
+}
+
+# }}}
+
+# {{{ sub LimitCc
+
+=head2 LimitCC
+
+It\'s like LimitWatcher, but it presets TYPE to Cc
+
+=cut
+
+sub LimitCc {
+ my $self = shift;
+ $self->LimitWatcher(TYPE=> 'Cc', @_);
+}
+
+# }}}
+
+# {{{ sub LimitAdminCc
+
+=head2 LimitAdminCc
+
+It\'s like LimitWatcher, but it presets TYPE to AdminCc
+
+=cut
+
+sub LimitAdminCc {
+ my $self = shift;
+ $self->LimitWatcher(TYPE=> 'AdminCc', @_);
+}
+
+# }}}
+
+# }}}
+
+# }}}
+
+# {{{ Limiting based on links
+
+# {{{ LimitLinkedTo
+
+=head2 LimitLinkedTo
+
+LimitLinkedTo takes a paramhash with two fields: TYPE and TARGET
+TYPE limits the sort of relationship we want to search on
+
+TARGET is the id or URI of the TARGET of the link
+(TARGET used to be 'TICKET'. 'TICKET' is deprecated, but will be treated as TARGET
+
+=cut
+
+sub LimitLinkedTo {
+ my $self = shift;
+ my %args = (
+ TICKET => undef,
+ TARGET => undef,
+ TYPE => undef,
+ @_);
+
+
+ $self->Limit( FIELD => 'LinkedTo',
+ BASE => undef,
+ TARGET => ($args{'TARGET'} || $args{'TICKET'}),
+ TYPE => $args{'TYPE'},
+ DESCRIPTION => "Tickets ".$args{'TYPE'}." by ".($args{'TARGET'} || $args{'TICKET'})
+ );
+}
+
+
+# }}}
+
+# {{{ LimitLinkedFrom
+
+=head2 LimitLinkedFrom
+
+LimitLinkedFrom takes a paramhash with two fields: TYPE and BASE
+TYPE limits the sort of relationship we want to search on
+
+
+BASE is the id or URI of the BASE of the link
+(BASE used to be 'TICKET'. 'TICKET' is deprecated, but will be treated as BASE
+
+
+=cut
+
+sub LimitLinkedFrom {
+ my $self = shift;
+ my %args = ( BASE => undef,
+ TICKET => undef,
+ TYPE => undef,
+ @_);
+
+
+ $self->Limit( FIELD => 'LinkedTo',
+ TARGET => undef,
+ BASE => ($args{'BASE'} || $args{'TICKET'}),
+ TYPE => $args{'TYPE'},
+ DESCRIPTION => "Tickets " .($args{'BASE'} || $args{'TICKET'}) ." ".$args{'TYPE'}
+ );
+}
+
+
+# }}}
+
+# {{{ LimitMemberOf
+sub LimitMemberOf {
+ my $self = shift;
+ my $ticket_id = shift;
+ $self->LimitLinkedTo ( TARGET=> "$ticket_id",
+ TYPE => 'MemberOf',
+ );
+
+}
+# }}}
+
+# {{{ LimitHasMember
+sub LimitHasMember {
+ my $self = shift;
+ my $ticket_id =shift;
+ $self->LimitLinkedFrom ( BASE => "$ticket_id",
+ TYPE => 'MemberOf',
+ );
+
+}
+# }}}
+
+# {{{ LimitDependsOn
+
+sub LimitDependsOn {
+ my $self = shift;
+ my $ticket_id = shift;
+ $self->LimitLinkedTo ( TARGET => "$ticket_id",
+ TYPE => 'DependsOn',
+ );
+
+}
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+# }}}
+# {{{ LimitDependedOnBy
-sub _Init {
+sub LimitDependedOnBy {
my $self = shift;
- $self->{'table'} = 'Tickets';
- $self->{'primary_key'} = 'id';
+ my $ticket_id = shift;
+ $self->LimitLinkedFrom ( BASE => "$ticket_id",
+ TYPE => 'DependsOn',
+ );
+
+}
+
+# }}}
- return ( $self->SUPER::_Init(@_) );
+# {{{ LimitRefersTo
+
+sub LimitRefersTo {
+ my $self = shift;
+ my $ticket_id = shift;
+ $self->LimitLinkedTo ( TARGET => "$ticket_id",
+ TYPE => 'RefersTo',
+ );
+
}
+# }}}
+
+# {{{ LimitReferredToBy
+
+sub LimitReferredToBy {
+ my $self = shift;
+ my $ticket_id = shift;
+ $self->LimitLinkedFrom ( BASE=> "$ticket_id",
+ TYPE => 'RefersTo',
+ );
+
+}
+
+# }}}
+
+# }}}
+
+# {{{ limit based on ticket date attribtes
+
+# {{{ sub LimitDate
-=item NewItem
+=head2 LimitDate (FIELD => 'DateField', OPERATOR => $oper, VALUE => $ISODate)
-Returns an empty new RT::Ticket item
+Takes a paramhash with the fields FIELD OPERATOR and VALUE.
+
+OPERATOR is one of > or <
+VALUE is a date and time in ISO format in GMT
+FIELD is one of Starts, Started, Told, Created, Resolved, LastUpdated
+
+There are also helper functions of the form LimitFIELD that eliminate
+the need to pass in a FIELD argument.
=cut
-sub NewItem {
+sub LimitDate {
my $self = shift;
- return(RT::Ticket->new($self->CurrentUser));
+ my %args = (
+ FIELD => undef,
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+
+ @_);
+
+ #Set the description if we didn't get handed it above
+ unless ($args{'DESCRIPTION'} ) {
+ $args{'DESCRIPTION'} = $args{'FIELD'} . " " .$args{'OPERATOR'}. " ". $args{'VALUE'} . " GMT"
+ }
+
+ $self->Limit (%args);
+
}
- eval "require RT::Tickets_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Overlay.pm}) {
- die $@;
- };
+# }}}
- eval "require RT::Tickets_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Vendor.pm}) {
- die $@;
- };
- eval "require RT::Tickets_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Local.pm}) {
- die $@;
- };
+sub LimitCreated {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Created', @_);
+}
+sub LimitDue {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Due', @_);
+}
+sub LimitStarts {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Starts', @_);
-=head1 SEE ALSO
+}
+sub LimitStarted {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Started', @_);
+}
+sub LimitResolved {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Resolved', @_);
+}
+sub LimitTold {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'Told', @_);
+}
+sub LimitLastUpdated {
+ my $self = shift;
+ $self->LimitDate( FIELD => 'LastUpdated', @_);
+}
+#
+# {{{ sub LimitTransactionDate
+
+=head2 LimitTransactionDate (OPERATOR => $oper, VALUE => $ISODate)
+
+Takes a paramhash with the fields FIELD OPERATOR and VALUE.
+
+OPERATOR is one of > or <
+VALUE is a date and time in ISO format in GMT
+
+
+=cut
+
+sub LimitTransactionDate {
+ my $self = shift;
+ my %args = (
+ FIELD => 'TransactionDate',
+ VALUE => $args{'VALUE'},
+ OPERATOR => $args{'OPERATOR'},
+
+ @_);
+
+ #Set the description if we didn't get handed it above
+ unless ($args{'DESCRIPTION'} ) {
+ $args{'DESCRIPTION'} = $args{'FIELD'} . " " .$args{'OPERATOR'}. " ". $args{'VALUE'} . " GMT"
+ }
+
+ $self->Limit (%args);
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+}
+
+# }}}
+
+# }}}
+
+# {{{ sub LimitKeyword
-These overlay files can contain new subs or subs to replace existing subs in this module.
+=head2 LimitKeyword
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+Takes a paramhash of key/value pairs with the following keys:
- no warnings qw(redefine);
+=over 4
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=item KEYWORDSELECT - KeywordSelect id
-RT::Tickets_Overlay, RT::Tickets_Vendor, RT::Tickets_Local
+=item OPERATOR - (for KEYWORD only - KEYWORDSELECT operator is always `=')
+
+=item KEYWORD - Keyword id
+
+=back
=cut
+sub LimitKeyword {
+ my $self = shift;
+ my %args = ( KEYWORD => undef,
+ KEYWORDSELECT => undef,
+ OPERATOR => '=',
+ DESCRIPTION => undef,
+ FIELD => 'Keyword',
+ QUOTEVALUE => 1,
+ @_
+ );
+
+ use RT::KeywordSelect;
+ my $KeywordSelect = RT::KeywordSelect->new($self->CurrentUser);
+ $KeywordSelect->Load($args{KEYWORDSELECT});
+
+
+ # Below, We're checking to see whether the keyword we're searching for
+ # is null or not.
+ # This could probably be rewritten to be easier to read and understand
+
+
+ #If we are looking to compare with a null value.
+ if ($args{'OPERATOR'} =~ /is/i) {
+ if ($args{'OPERATOR'} =~ /^is$/i) {
+ $args{'DESCRIPTION'} ||= "Keyword Selection ". $KeywordSelect->Name . " has no value";
+ }
+ elsif ($args{'OPERATOR'} =~ /^is not$/i) {
+ $args{'DESCRIPTION'} ||= "Keyword Selection ". $KeywordSelect->Name . " has a value";
+ }
+ }
+ # if we're not looking to compare with a null value
+ else {
+ use RT::Keyword;
+ my $Keyword = RT::Keyword->new($self->CurrentUser);
+ $Keyword->Load($args{KEYWORD});
+ $args{'DESCRIPTION'} ||= "Keyword Selection " . $KeywordSelect->Name. " $args{OPERATOR} ". $Keyword->Name;
+ }
+
+ $args{SingleValued} = $KeywordSelect->Single();
+
+
+ my $index = $self->_NextIndex;
+ %{$self->{'TicketRestrictions'}{$index}} = %args;
+
+ $self->{'RecalcTicketLimits'} = 1;
+ return ($index);
+}
+
+# }}}
+
+# {{{ sub _NextIndex
+
+=head2 _NextIndex
+
+Keep track of the counter for the array of restrictions
+
+=cut
+
+sub _NextIndex {
+ my $self = shift;
+ return ($self->{'restriction_index'}++);
+}
+# }}}
+
+# }}}
+
+# {{{ Core bits to make this a DBIx::SearchBuilder object
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Tickets";
+ $self->{'RecalcTicketLimits'} = 1;
+ $self->{'looking_at_effective_id'} = 0;
+ $self->{'restriction_index'} =1;
+ $self->{'primary_key'} = "id";
+ $self->SUPER::_Init(@_);
+
+}
+# }}}
+
+# {{{ sub NewItem
+sub NewItem {
+ my $self = shift;
+ return(RT::Ticket->new($self->CurrentUser));
+
+}
+# }}}
+
+# {{{ sub Count
+sub Count {
+ my $self = shift;
+ $self->_ProcessRestrictions if ($self->{'RecalcTicketLimits'} == 1 );
+ return($self->SUPER::Count());
+}
+# }}}
+
+# {{{ sub ItemsArrayRef
+
+=head2 ItemsArrayRef
+
+Returns a reference to the set of all items found in this search
+
+=cut
+
+sub ItemsArrayRef {
+ my $self = shift;
+ my @items;
+
+ my $placeholder = $self->_ItemsCounter;
+ $self->GotoFirstItem();
+ while (my $item = $self->Next) {
+ push (@items, $item);
+ }
+
+ $self->GotoItem($placeholder);
+ return(\@items);
+}
+# }}}
+
+# {{{ sub Next
+sub Next {
+ my $self = shift;
+
+ $self->_ProcessRestrictions if ($self->{'RecalcTicketLimits'} == 1 );
+
+ my $Ticket = $self->SUPER::Next();
+ if ((defined($Ticket)) and (ref($Ticket))) {
+
+ #Make sure we _never_ show dead tickets
+ #TODO we should be doing this in the where clause.
+ #but you can't do multiple clauses on the same field just yet :/
+
+ if ($Ticket->Status eq 'dead') {
+ return($self->Next());
+ }
+ elsif ($Ticket->CurrentUserHasRight('ShowTicket')) {
+ return($Ticket);
+ }
+
+ #If the user doesn't have the right to show this ticket
+ else {
+ return($self->Next());
+ }
+ }
+ #if there never was any ticket
+ else {
+ return(undef);
+ }
+
+}
+# }}}
+
+# }}}
+
+# {{{ Deal with storing and restoring restrictions
+
+# {{{ sub LoadRestrictions
+
+=head2 LoadRestrictions
+
+LoadRestrictions takes a string which can fully populate the TicketRestrictons hash.
+TODO It is not yet implemented
+
+=cut
+
+# }}}
+
+# {{{ sub DescribeRestrictions
+
+=head2 DescribeRestrictions
+
+takes nothing.
+Returns a hash keyed by restriction id.
+Each element of the hash is currently a one element hash that contains DESCRIPTION which
+is a description of the purpose of that TicketRestriction
+
+=cut
+
+sub DescribeRestrictions {
+ my $self = shift;
+
+ my ($row, %listing);
+
+ foreach $row (keys %{$self->{'TicketRestrictions'}}) {
+ $listing{$row} = $self->{'TicketRestrictions'}{$row}{'DESCRIPTION'};
+ }
+ return (%listing);
+}
+# }}}
+
+# {{{ sub RestrictionValues
+
+=head2 RestrictionValues FIELD
+
+Takes a restriction field and returns a list of values this field is restricted
+to.
+
+=cut
+
+sub RestrictionValues {
+ my $self = shift;
+ my $field = shift;
+ map $self->{'TicketRestrictions'}{$_}{'VALUE'},
+ grep {
+ $self->{'TicketRestrictions'}{$_}{'FIELD'} eq $field
+ && $self->{'TicketRestrictions'}{$_}{'OPERATOR'} eq "="
+ }
+ keys %{$self->{'TicketRestrictions'}};
+}
+
+# }}}
+
+# {{{ sub ClearRestrictions
+
+=head2 ClearRestrictions
+
+Removes all restrictions irretrievably
+
+=cut
+
+sub ClearRestrictions {
+ my $self = shift;
+ delete $self->{'TicketRestrictions'};
+ $self->{'looking_at_effective_id'} = 0;
+ $self->{'RecalcTicketLimits'} =1;
+}
+
+# }}}
+
+# {{{ sub DeleteRestriction
+
+=head2 DeleteRestriction
+
+Takes the row Id of a restriction (From DescribeRestrictions' output, for example.
+Removes that restriction from the session's limits.
+
+=cut
+
+
+sub DeleteRestriction {
+ my $self = shift;
+ my $row = shift;
+ delete $self->{'TicketRestrictions'}{$row};
+
+ $self->{'RecalcTicketLimits'} = 1;
+ #make the underlying easysearch object forget all its preconceptions
+}
+
+# }}}
+
+# {{{ sub _ProcessRestrictions
+
+sub _ProcessRestrictions {
+ my $self = shift;
+
+ #Need to clean the EasySearch slate because it makes things too sticky
+ $self->CleanSlate();
+
+ #Blow away ticket aliases since we'll need to regenerate them for a new search
+ delete $self->{'TicketAliases'};
+ delete $self->{KeywordsAliases};
+
+ my $row;
+
+ foreach $row (keys %{$self->{'TicketRestrictions'}}) {
+ my $restriction = $self->{'TicketRestrictions'}{$row};
+ # {{{ if it's an int
+
+ if ($TYPES{$restriction->{'FIELD'}} eq 'INT' ) {
+ if ($restriction->{'OPERATOR'} =~ /^(=|!=|>|<|>=|<=)$/) {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => $restriction->{'OPERATOR'},
+ VALUE => $restriction->{'VALUE'},
+ );
+ }
+ }
+ # }}}
+ # {{{ if it's an enum
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'ENUM') {
+
+ if ($restriction->{'OPERATOR'} eq '=') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'OR',
+ OPERATOR => '=',
+ VALUE => $restriction->{'VALUE'},
+ );
+ }
+ elsif ($restriction->{'OPERATOR'} eq '!=') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => '!=',
+ VALUE => $restriction->{'VALUE'},
+ );
+ }
+
+ }
+ # }}}
+ # {{{ if it's a date
+
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'DATE') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => $restriction->{'OPERATOR'},
+ VALUE => $restriction->{'VALUE'},
+ );
+ }
+ # }}}
+ # {{{ if it's a string
+
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'STRING') {
+
+ if ($restriction->{'OPERATOR'} eq '=') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'OR',
+ OPERATOR => '=',
+ VALUE => $restriction->{'VALUE'},
+ CASESENSITIVE => 0
+ );
+ }
+ elsif ($restriction->{'OPERATOR'} eq '!=') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => '!=',
+ VALUE => $restriction->{'VALUE'},
+ CASESENSITIVE => 0
+ );
+ }
+ elsif ($restriction->{'OPERATOR'} eq 'LIKE') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => 'LIKE',
+ VALUE => $restriction->{'VALUE'},
+ CASESENSITIVE => 0
+ );
+ }
+ elsif ($restriction->{'OPERATOR'} eq 'NOT LIKE') {
+ $self->SUPER::Limit( FIELD => $restriction->{'FIELD'},
+ ENTRYAGGREGATOR => 'AND',
+ OPERATOR => 'NOT LIKE',
+ VALUE => $restriction->{'VALUE'},
+ CASESENSITIVE => 0
+ );
+ }
+ }
+
+ # }}}
+ # {{{ if it's Transaction content that we're hunting for
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'TRANSFIELD') {
+
+ #Basically, we want to make sure that the limits apply to the same attachment,
+ #rather than just another attachment for the same ticket, no matter how many
+ #clauses we lump on.
+ #We put them in TicketAliases so that they get nuked when we redo the join.
+
+ unless (defined $self->{'TicketAliases'}{'TransFieldAlias'}) {
+ $self->{'TicketAliases'}{'TransFieldAlias'} = $self->NewAlias ('Transactions');
+ }
+ unless (defined $self->{'TicketAliases'}{'TransFieldAttachAlias'}){
+ $self->{'TicketAliases'}{'TransFieldAttachAlias'} = $self->NewAlias('Attachments');
+
+ }
+ #Join transactions to attachments
+ $self->Join( ALIAS1 => $self->{'TicketAliases'}{'TransFieldAttachAlias'},
+ FIELD1 => 'TransactionId',
+ ALIAS2 => $self->{'TicketAliases'}{'TransFieldAlias'}, FIELD2=> 'id');
+
+ #Join transactions to tickets
+ $self->Join( ALIAS1 => 'main', FIELD1 => $self->{'primary_key'},
+ ALIAS2 =>$self->{'TicketAliases'}{'TransFieldAlias'}, FIELD2 => 'Ticket');
+
+ #Search for the right field
+ $self->SUPER::Limit(ALIAS => $self->{'TicketAliases'}{'TransFieldAttachAlias'},
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => $restriction->{'FIELD'},
+ OPERATOR => $restriction->{'OPERATOR'} ,
+ VALUE => $restriction->{'VALUE'},
+ CASESENSITIVE => 0
+ );
+
+
+ }
+
+ # }}}
+ # {{{ if it's a Transaction date that we're hunting for
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'TRANSDATE') {
+
+ #Basically, we want to make sure that the limits apply to the same attachment,
+ #rather than just another attachment for the same ticket, no matter how many
+ #clauses we lump on.
+ #We put them in TicketAliases so that they get nuked when we redo the join.
+
+ unless (defined $self->{'TicketAliases'}{'TransFieldAlias'}) {
+ $self->{'TicketAliases'}{'TransFieldAlias'} = $self->NewAlias ('Transactions');
+ }
+
+ #Join transactions to tickets
+ $self->Join( ALIAS1 => 'main', FIELD1 => $self->{'primary_key'},
+ ALIAS2 =>$self->{'TicketAliases'}{'TransFieldAlias'}, FIELD2 => 'Ticket');
+
+ #Search for the right field
+ $self->SUPER::Limit(ALIAS => $self->{'TicketAliases'}{'TransFieldAlias'},
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => 'Created',
+ OPERATOR => $restriction->{'OPERATOR'} ,
+ VALUE => $restriction->{'VALUE'} );
+ }
+
+ # }}}
+ # {{{ if it's a relationship that we're hunting for
+
+ # Takes FIELD: which is something like "LinkedTo"
+ # takes TARGET or BASE which is the TARGET or BASE id that we're searching for
+ # takes TYPE which is the type of link we're looking for.
+
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'LINKFIELD') {
+
+
+ my $LinkAlias = $self->NewAlias ('Links');
+
+
+ #Make sure we get the right type of link, if we're restricting it
+ if ($restriction->{'TYPE'}) {
+ $self->SUPER::Limit(ALIAS => $LinkAlias,
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => 'Type',
+ OPERATOR => '=',
+ VALUE => $restriction->{'TYPE'} );
+ }
+
+ #If we're trying to limit it to things that are target of
+ if ($restriction->{'TARGET'}) {
+
+
+ # If the TARGET is an integer that means that we want to look at the LocalTarget
+ # field. otherwise, we want to look at the "Target" field
+
+ my ($matchfield);
+ if ($restriction->{'TARGET'} =~/^(\d+)$/) {
+ $matchfield = "LocalTarget";
+ }
+ else {
+ $matchfield = "Target";
+ }
+
+ $self->SUPER::Limit(ALIAS => $LinkAlias,
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => $matchfield,
+ OPERATOR => '=',
+ VALUE => $restriction->{'TARGET'} );
+
+
+ #If we're searching on target, join the base to ticket.id
+ $self->Join( ALIAS1 => 'main', FIELD1 => $self->{'primary_key'},
+ ALIAS2 => $LinkAlias,
+ FIELD2 => 'LocalBase');
+
+
+
+
+ }
+ #If we're trying to limit it to things that are base of
+ elsif ($restriction->{'BASE'}) {
+
+
+ # If we're trying to match a numeric link, we want to look at LocalBase,
+ # otherwise we want to look at "Base"
+
+ my ($matchfield);
+ if ($restriction->{'BASE'} =~/^(\d+)$/) {
+ $matchfield = "LocalBase";
+ }
+ else {
+ $matchfield = "Base";
+ }
+
+
+ $self->SUPER::Limit(ALIAS => $LinkAlias,
+ ENTRYAGGREGATOR => 'AND',
+ FIELD => $matchfield,
+ OPERATOR => '=',
+ VALUE => $restriction->{'BASE'} );
+
+ #If we're searching on base, join the target to ticket.id
+ $self->Join( ALIAS1 => 'main', FIELD1 => $self->{'primary_key'},
+ ALIAS2 => $LinkAlias,
+ FIELD2 => 'LocalTarget');
+
+ }
+
+ }
+
+ # }}}
+ # {{{ if it's a watcher that we're hunting for
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'WATCHERFIELD') {
+
+ my $Watch = $self->NewAlias('Watchers');
+
+ #Join watchers to users
+ my $User = $self->Join( TYPE => 'left',
+ ALIAS1 => $Watch,
+ FIELD1 => 'Owner',
+ TABLE2 => 'Users',
+ FIELD2 => 'id',
+ );
+
+ #Join Ticket to watchers
+ $self->Join( ALIAS1 => 'main', FIELD1 => 'id',
+ ALIAS2 => $Watch, FIELD2 => 'Value');
+
+
+ #Make sure we're only talking about ticket watchers
+ $self->SUPER::Limit( ALIAS => $Watch,
+ FIELD => 'Scope',
+ VALUE => 'Ticket',
+ OPERATOR => '=');
+
+
+ # Find email address watchers
+ $self->SUPER::Limit( SUBCLAUSE => 'WatcherEmailAddress',
+ ALIAS => $Watch,
+ FIELD => 'Email',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => $restriction->{'VALUE'},
+ OPERATOR => $restriction->{'OPERATOR'},
+ CASESENSITIVE => 0
+ );
+
+
+
+ #Find user watchers
+ $self->SUPER::Limit(
+ SUBCLAUSE => 'WatcherEmailAddress',
+ ALIAS => $User,
+ FIELD => 'EmailAddress',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => $restriction->{'VALUE'},
+ OPERATOR => $restriction->{'OPERATOR'},
+ CASESENSITIVE => 0
+ );
+
+
+ #If we only want a specific type of watchers, then limit it to that
+ if ($restriction->{'TYPE'}) {
+ $self->SUPER::Limit( ALIAS => $Watch,
+ FIELD => 'Type',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => $restriction->{'TYPE'},
+ OPERATOR => '=');
+ }
+ }
+
+ # }}}
+ # {{{ if it's a keyword
+ elsif ($TYPES{$restriction->{'FIELD'}} eq 'KEYWORDFIELD') {
+
+ my $null_columns_ok;
+
+ my $ObjKeywordsAlias;
+ $ObjKeywordsAlias = $self->{KeywordsAliases}{$restriction->{'KEYWORDSELECT'}}
+ if $restriction->{SingleValued};
+ unless (defined $ObjKeywordsAlias) {
+ $ObjKeywordsAlias = $self->Join(
+ TYPE => 'left',
+ ALIAS1 => 'main',
+ FIELD1 => 'id',
+ TABLE2 => 'ObjectKeywords',
+ FIELD2 => 'ObjectId'
+ );
+ if ($restriction->{'SingleValued'}) {
+ $self->{KeywordsAliases}{$restriction->{'KEYWORDSELECT'}}
+ = $ObjKeywordsAlias;
+ }
+ }
+
+
+ $self->SUPER::Limit(
+ ALIAS => $ObjKeywordsAlias,
+ FIELD => 'Keyword',
+ OPERATOR => $restriction->{'OPERATOR'},
+ VALUE => $restriction->{'KEYWORD'},
+ QUOTEVALUE => $restriction->{'QUOTEVALUE'},
+ ENTRYAGGREGATOR => 'OR',
+ );
+
+ if ( ($restriction->{'OPERATOR'} =~ /^IS$/i) or
+ ($restriction->{'OPERATOR'} eq '!=') ) {
+
+ $null_columns_ok=1;
+
+ }
+
+ #If we're trying to find tickets where the keyword isn't somethng, also check ones where it _IS_ null
+ if ( $restriction->{'OPERATOR'} eq '!=') {
+ $self->SUPER::Limit(
+ ALIAS => $ObjKeywordsAlias,
+ FIELD => 'Keyword',
+ OPERATOR => 'IS',
+ VALUE => 'NULL',
+ QUOTEVALUE => 0,
+ ENTRYAGGREGATOR => 'OR',
+ );
+ }
+
+
+ $self->SUPER::Limit(LEFTJOIN => $ObjKeywordsAlias,
+ FIELD => 'KeywordSelect',
+ VALUE => $restriction->{'KEYWORDSELECT'},
+ ENTRYAGGREGATOR => 'OR');
+
+
+
+ $self->SUPER::Limit( ALIAS => $ObjKeywordsAlias,
+ FIELD => 'ObjectType',
+ VALUE => 'Ticket',
+ ENTRYAGGREGATOR => 'AND');
+
+ if ($null_columns_ok) {
+ $self->SUPER::Limit(ALIAS => $ObjKeywordsAlias,
+ FIELD => 'ObjectType',
+ OPERATOR => 'IS',
+ VALUE => 'NULL',
+ QUOTEVALUE => 0,
+ ENTRYAGGREGATOR => 'OR');
+ }
+
+ }
+ # }}}
+
+
+ }
+
+
+ # here, we make sure we don't get any tickets that have been merged into other tickets
+ # (Ticket Id == Ticket EffectiveId
+ # note that we _really_ don't want to do this if we're already looking at the effectiveid
+ if ($self->_isLimited && (! $self->{'looking_at_effective_id'})) {
+ $self->SUPER::Limit( FIELD => 'EffectiveId',
+ OPERATOR => '=',
+ QUOTEVALUE => 0,
+ VALUE => 'main.id'); #TODO, we shouldn't be hard coding the tablename to main.
+ }
+ $self->{'RecalcTicketLimits'} = 0;
+}
+
+# }}}
+
+# }}}
+
+# {{{ Deal with displaying rows of the listing
+
+#
+# Everything in this section is stub code for 2.2
+# It's not part of the API. It's not for your use
+# It's not for our use.
+#
+
+
+# {{{ sub SetListingFormat
+
+=head2 SetListingFormat
+
+Takes a single Format string as specified below. parses that format string and makes the various listing output
+things DTRT.
+
+=item Format strings
+
+Format strings are made up of a chain of Elements delimited with vertical pipes (|).
+Elements of a Format string
+
+
+FormatString: Element[::FormatString]
+
+Element: AttributeName[;HREF=<URL>][;TITLE=<TITLE>]
+
+AttributeName Id | Subject | Status | Owner | Priority | InitialPriority | TimeWorked | TimeLeft |
+
+ Keywords[;SELECT=<KeywordSelect>] |
+
+ <Created|Starts|Started|Contacted|Due|Resolved>Date<AsString|AsISO|AsAge>
+
+
+=cut
+
+
+
+
+#accept a format string
+
+
+
+sub SetListingFormat {
+ my $self = shift;
+ my $listing_format = shift;
+
+ my ($element, $attribs);
+ my $i = 0;
+ foreach $element (split (/::/,$listing_format)) {
+ if ($element =~ /^(.*?);(.*)$/) {
+ $element = $1;
+ $attribs = $2;
+ }
+ $self->{'format_string'}->[$i]->{'Element'} = $element;
+ foreach $attrib (split (/;/, $attribs)) {
+ my $value = "";
+ if ($attrib =~ /^(.*?)=(.*)$/) {
+ $attrib = $1;
+ $value = $2;
+ }
+ $self->{'format_string'}->[$i]->{"$attrib"} = $val;
+
+ }
+
+ }
+ return(1);
+}
+
+# }}}
+
+# {{{ sub HeaderAsHTML
+sub HeaderAsHTML {
+ my $self = shift;
+ my $header = "";
+ my $col;
+ foreach $col ( @{[ $self->{'format_string'} ]}) {
+ $header .= "<TH>" . $self->_ColumnTitle($self->{'format_string'}->[$col]) . "</TH>";
+
+ }
+ return ($header);
+}
+# }}}
+
+# {{{ sub HeaderAsText
+#Print text header
+sub HeaderAsText {
+ my $self = shift;
+ my ($header);
+
+ return ($header);
+}
+# }}}
+
+# {{{ sub TicketAsHTMLRow
+#Print HTML row
+sub TicketAsHTMLRow {
+ my $self = shift;
+ my $Ticket = shift;
+ my ($row, $col);
+ foreach $col (@{[$self->{'format_string'}]}) {
+ $row .= "<TD>" . $self->_TicketColumnValue($ticket,$self->{'format_string'}->[$col]) . "</TD>";
+
+ }
+ return ($row);
+}
+# }}}
+
+# {{{ sub TicketAsTextRow
+#Print text row
+sub TicketAsTextRow {
+ my $self = shift;
+ my ($row);
+
+ #TODO implement
+
+ return ($row);
+}
+# }}}
+
+# {{{ _ColumnTitle {
+
+sub _ColumnTitle {
+ my $self = shift;
+
+ # Attrib is a hash
+ my $attrib = shift;
+
+ # return either attrib->{'TITLE'} or..
+ if ($attrib->{'TITLE'}) {
+ return($attrib->{'TITLE'});
+ }
+ # failing that, Look up the title in a hash
+ else {
+ #TODO create $self->{'ColumnTitles'};
+ return ($self->{'ColumnTitles'}->{$attrib->{'Element'}});
+ }
+
+}
+
+# }}}
+
+# {{{ _TicketColumnValue
+sub _TicketColumnValue {
+ my $self = shift;
+ my $Ticket = shift;
+ my $attrib = shift;
+
+
+ my $out;
+
+ SWITCH: {
+ /^id/i && do {
+ $out = $Ticket->id;
+ last SWITCH;
+ };
+ /^subj/i && do {
+ last SWITCH;
+ $Ticket->Subject;
+ };
+ /^status/i && do {
+ last SWITCH;
+ $Ticket->Status;
+ };
+ /^prio/i && do {
+ last SWITCH;
+ $Ticket->Priority;
+ };
+ /^finalprio/i && do {
+
+ last SWITCH;
+ $Ticket->FinalPriority
+ };
+ /^initialprio/i && do {
+
+ last SWITCH;
+ $Ticket->InitialPriority;
+ };
+ /^timel/i && do {
+
+ last SWITCH;
+ $Ticket->TimeWorked;
+ };
+ /^timew/i && do {
+
+ last SWITCH;
+ $Ticket->TimeLeft;
+ };
+
+ /^(.*?)date(.*)$/i && do {
+ my $o = $1;
+ my $m = $2;
+ my ($obj);
+ #TODO: optimize
+ $obj = $Ticket->DueObj if $o =~ /due/i;
+ $obj = $Ticket->CreatedObj if $o =~ /created/i;
+ $obj = $Ticket->StartsObj if $o =~ /starts/i;
+ $obj = $Ticket->StartedObj if $o =~ /started/i;
+ $obj = $Ticket->ToldObj if $o =~ /told/i;
+ $obj = $Ticket->LastUpdatedObj if $o =~ /lastu/i;
+
+ $method = 'ISO' if $m =~ /iso/i;
+
+ $method = 'AsString' if $m =~ /asstring/i;
+ $method = 'AgeAsString' if $m =~ /age/i;
+ last SWITCH;
+ $obj->$method();
+
+ };
+
+ /^watcher/i && do {
+ last SWITCH;
+ $Ticket->WatchersAsString();
+ };
+
+ /^requestor/i && do {
+ last SWITCH;
+ $Ticket->RequestorsAsString();
+ };
+ /^cc/i && do {
+ last SWITCH;
+ $Ticket->CCAsString();
+ };
+
+
+ /^admincc/i && do {
+ last SWITCH;
+ $Ticket->AdminCcAsString();
+ };
+
+ /^keywords/i && do {
+ last SWITCH;
+ #Limit it to the keyword select we're talking about, if we've got one.
+ my $objkeys =$Ticket->KeywordsObj($attrib->{'SELECT'});
+ $objkeys->KeywordRelativePathsAsString();
+ };
+
+ }
+
+}
+
+# }}}
+
+# }}}
+
+# {{{ POD
+=head2 notes
+"Enum" Things that get Is, IsNot
+
+
+"Int" Things that get Is LessThan and GreaterThan
+id
+InitialPriority
+FinalPriority
+Priority
+TimeLeft
+TimeWorked
+
+"Text" Things that get Is, Like
+Subject
+TransactionContent
+
+
+"Link" OPERATORs
+
+
+"Date" OPERATORs Is, Before, After
+ =cut
+# }}}
1;
diff --git a/rt/lib/RT/Transaction.pm b/rt/lib/RT/Transaction.pm
index ca491a6c7..ee1f069b2 100755
--- a/rt/lib/RT/Transaction.pm
+++ b/rt/lib/RT/Transaction.pm
@@ -1,364 +1,783 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Transaction.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# Copyright 1999-2001 Jesse Vincent <jesse@fsck.com>
+# Released under the terms of the GNU Public License
=head1 NAME
-RT::Transaction
-
+ RT::Transaction - RT\'s transaction object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::Transaction;
-use RT::Record;
-use RT::Ticket;
-
-
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
+ use RT::Transaction;
-sub _Init {
- my $self = shift;
- $self->Table('Transactions');
- $self->SUPER::_Init(@_);
-}
+=head1 DESCRIPTION
+Each RT::Transaction describes an atomic change to a ticket object
+or an update to an RT::Ticket object.
+It can have arbitrary MIME attachments.
+=head1 METHODS
-=item Create PARAMHASH
+=begin testing
-Create takes a hash of values and creates a row in the database:
+ok(require RT::TestHarness);
+ok(require RT::Transaction);
- int(11) 'EffectiveTicket'.
- int(11) 'Ticket'.
- int(11) 'TimeTaken'.
- varchar(20) 'Type'.
- varchar(40) 'Field'.
- varchar(255) 'OldValue'.
- varchar(255) 'NewValue'.
- varchar(100) 'Data'.
+=end testing
=cut
+package RT::Transaction;
+use RT::Record;
+@ISA= qw(RT::Record);
+
+use RT::Attachments;
-
-sub Create {
+# {{{ sub _Init
+sub _Init {
my $self = shift;
- my %args = (
- EffectiveTicket => '0',
- Ticket => '0',
- TimeTaken => '0',
- Type => '',
- Field => '',
- OldValue => '',
- NewValue => '',
- Data => '',
-
- @_);
- $self->SUPER::Create(
- EffectiveTicket => $args{'EffectiveTicket'},
- Ticket => $args{'Ticket'},
- TimeTaken => $args{'TimeTaken'},
- Type => $args{'Type'},
- Field => $args{'Field'},
- OldValue => $args{'OldValue'},
- NewValue => $args{'NewValue'},
- Data => $args{'Data'},
-);
+ $self->{'table'} = "Transactions";
+ return ($self->SUPER::_Init(@_));
}
+# }}}
+# {{{ sub Create
+=head2 Create
-=item id
+Create a new transaction.
-Returns the current value of id.
-(In the database, id is stored as int(11).)
+This routine should _never_ be called anything other Than RT::Ticket. It should not be called
+from client code. Ever. Not ever. If you do this, we will hunt you down. and break your kneecaps.
+Then the unpleasant stuff will start.
+TODO: Document what gets passed to this
=cut
+sub Create {
+ my $self = shift;
+ my %args = ( id => undef,
+ TimeTaken => 0,
+ Ticket => 0 ,
+ Type => 'undefined',
+ Data => '',
+ Field => undef,
+ OldValue => undef,
+ NewValue => undef,
+ MIMEObj => undef,
+ ActivateScrips => 1,
+ @_
+ );
+
+ #if we didn't specify a ticket, we need to bail
+ unless ( $args{'Ticket'} ) {
+ return(0, "RT::Transaction->Create couldn't, as you didn't specify a ticket id");
+ }
+
+ #lets create our transaction
+ my $id = $self->SUPER::Create(Ticket => $args{'Ticket'},
+ TimeTaken => $args{'TimeTaken'},
+ Type => $args{'Type'},
+ Data => $args{'Data'},
+ Field => $args{'Field'},
+ OldValue => $args{'OldValue'},
+ NewValue => $args{'NewValue'},
+ Created => $args{'Created'}
+ );
+ $self->Load($id);
+ $self->_Attach($args{'MIMEObj'})
+ if defined $args{'MIMEObj'};
+
+ #Provide a way to turn off scrips if we need to
+ if ($args{'ActivateScrips'}) {
+
+ #We're really going to need a non-acled ticket for the scrips to work
+ my $TicketAsSystem = RT::Ticket->new($RT::SystemUser);
+ $TicketAsSystem->Load($args{'Ticket'}) ||
+ $RT::Logger->err("$self couldn't load ticket $args{'Ticket'}\n");
+
+ my $TransAsSystem = RT::Transaction->new($RT::SystemUser);
+ $TransAsSystem->Load($self->id) ||
+ $RT::Logger->err("$self couldn't load a copy of itself as superuser\n");
+
+ # {{{ Deal with Scrips
+
+ #Load a scripscopes object
+ use RT::Scrips;
+ my $PossibleScrips = RT::Scrips->new($RT::SystemUser);
+
+ $PossibleScrips->LimitToQueue($TicketAsSystem->QueueObj->Id); #Limit it to $Ticket->QueueObj->Id
+ $PossibleScrips->LimitToGlobal(); # or to "global"
+ my $ConditionsAlias = $PossibleScrips->NewAlias('ScripConditions');
+
+ $PossibleScrips->Join(ALIAS1 => 'main', FIELD1 => 'ScripCondition',
+ ALIAS2 => $ConditionsAlias, FIELD2=> 'id');
+
+
+ #We only want things where the scrip applies to this sort of transaction
+ $PossibleScrips->Limit(ALIAS=> $ConditionsAlias,
+ FIELD=>'ApplicableTransTypes',
+ OPERATOR => 'LIKE',
+ VALUE => $args{'Type'},
+ ENTRYAGGREGATOR => 'OR',
+ );
+
+ # Or where the scrip applies to any transaction
+ $PossibleScrips->Limit(ALIAS=> $ConditionsAlias,
+ FIELD=>'ApplicableTransTypes',
+ OPERATOR => 'LIKE',
+ VALUE => "Any",
+ ENTRYAGGREGATOR => 'OR',
+ );
+
+ #Iterate through each script and check it's applicability.
+
+ while (my $Scrip = $PossibleScrips->Next()) {
+
+ #TODO: properly deal with errors raised in this scrip loop
+
+ #$RT::Logger->debug("$self now dealing with ".$Scrip->Id. "\n");
+ eval {
+ local $SIG{__DIE__} = sub { $RT::Logger->error($_[0])};
+
+
+ #Load the scrip's Condition object
+ $Scrip->ConditionObj->LoadCondition(TicketObj => $TicketAsSystem,
+ TransactionObj => $TransAsSystem);
+
+
+ #If it's applicable, prepare and commit it
+
+ $RT::Logger->debug ("$self: Checking condition ".$Scrip->ConditionObj->Name. "...\n");
+
+ if ( $Scrip->IsApplicable() ) {
+
+ $RT::Logger->debug ("$self: Matches condition ".$Scrip->ConditionObj->Name. "...\n");
+ #TODO: handle some errors here
+
+ $Scrip->ActionObj->LoadAction(TicketObj => $TicketAsSystem,
+ TransactionObj => $TransAsSystem);
+
+
+ if ($Scrip->Prepare()) {
+ $RT::Logger->debug("$self: Prepared " .
+ $Scrip->ActionObj->Name . "\n");
+ if ($Scrip->Commit()) {
+ $RT::Logger->debug("$self: Committed " .
+ $Scrip->ActionObj->Name . "\n");
+ }
+ else {
+ $RT::Logger->info("$self: Failed to commit ".
+ $Scrip->ActionObj->Name . "\n");
+ }
+ }
+ else {
+ $RT::Logger->info("$self: Failed to prepare " .
+ $Scrip->ActionObj->Name . "\n");
+ }
+
+ #We're done with it. lets clean up.
+ #TODO: something else isn't letting these get garbage collected. check em out.
+ $Scrip->ActionObj->DESTROY();
+ $Scrip->ConditionObj->DESTROY;
+ }
+
+
+ else {
+ $RT::Logger->debug ("$self: Doesn't match condition ".$Scrip->ConditionObj->Name. "...\n");
+
+ # TODO: why doesn't this catch all the ScripObjs we create.
+ # and why do we explictly need to destroy them?
+ $Scrip->ConditionObj->DESTROY;
+ }
+ }
+ }
+
+ # }}}
+
+ }
+
+ return ($id, "Transaction Created");
+}
-=item EffectiveTicket
+# }}}
-Returns the current value of EffectiveTicket.
-(In the database, EffectiveTicket is stored as int(11).)
+# {{{ sub Delete
+sub Delete {
+ my $self = shift;
+ return (0, 'Deleting this object could break referential integrity');
+}
+# }}}
-=item SetEffectiveTicket VALUE
+# {{{ Routines dealing with Attachments
+# {{{ sub Message
-Set EffectiveTicket to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, EffectiveTicket will be stored as a int(11).)
+=head2 Message
+ Returns the RT::Attachments Object which contains the "top-level" object
+ attachment for this transaction
=cut
+sub Message {
-=item Ticket
-
-Returns the current value of Ticket.
-(In the database, Ticket is stored as int(11).)
-
-
-
-=item SetTicket VALUE
-
-
-Set Ticket to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Ticket will be stored as a int(11).)
+ my $self = shift;
+
+ if (!defined ($self->{'message'}) ){
+
+ $self->{'message'} = new RT::Attachments($self->CurrentUser);
+ $self->{'message'}->Limit(FIELD => 'TransactionId',
+ VALUE => $self->Id);
+
+ $self->{'message'}->ChildrenOf(0);
+ }
+ return($self->{'message'});
+}
+# }}}
+# {{{ sub Content
-=cut
+=head2 Content PARAMHASH
+If this transaction has attached mime objects, returns the first text/ part.
+Otherwise, returns undef.
-=item TicketObj
-
-Returns the Ticket Object which has the id returned by Ticket
+Takes a paramhash. If the $args{'Quote'} parameter is set, wraps this message
+at $args{'Wrap'}. $args{'Wrap'} defaults to 70.
=cut
-sub TicketObj {
- my $self = shift;
- my $Ticket = RT::Ticket->new($self->CurrentUser);
- $Ticket->Load($self->__Value('Ticket'));
- return($Ticket);
+sub Content {
+ my $self = shift;
+ my %args = ( Quote => 0,
+ Wrap => 70,
+ @_ );
+
+ my $content = undef;
+
+ # If we don\'t have any content, return undef now.
+ unless ($self->Message->First) {
+ return (undef);
+ }
+
+ # Get the set of toplevel attachments to this transaction.
+ my $MIMEObj = $self->Message->First();
+
+ # If it's a message or a plain part, just return the
+ # body.
+ if ($MIMEObj->ContentType() =~ '^(text|message)(/|$)') {
+ $content = $MIMEObj->Content();
+ }
+
+ # If it's a multipart object, first try returning the first
+ # text/plain part.
+
+ elsif ($MIMEObj->ContentType() =~ '^multipart/') {
+ my $plain_parts = $MIMEObj->Children();
+ $plain_parts->ContentType(VALUE => 'text/plain');
+
+ # If we actully found a part, return its content
+ if ($plain_parts->First &&
+ $plain_parts->First->Content ne '') {
+ $content = $plain_parts->First->Content;
+ }
+
+ # If that fails, return the first text/ or message/ part
+ # which has some content.
+
+ else {
+ my $all_parts = $MIMEObj->Children();
+ while (($content == undef) &&
+ (my $part = $all_parts->Next)) {
+ if (($part->ContentType() =~ '^(text|message)(/|$)') and
+ ($part->Content())) {
+ $content = $part->Content;
+ }
+ }
+ }
+
+ }
+ # If all else fails, return a message that we couldn't find
+ # any content
+ else {
+ $content = 'This transaction appears to have no content';
+ }
+
+ if ($args{'Quote'}) {
+ # Remove quoted signature.
+ $content =~ s/\n-- \n(.*)$//s;
+
+ # What's the longest line like?
+ foreach (split (/\n/,$content)) {
+ $max=length if ( length > $max);
+ }
+
+ if ($max>76) {
+ require Text::Wrapper;
+ my $wrapper=new Text::Wrapper
+ (
+ columns => $args{'Wrap'},
+ body_start => ($max > 70*3 ? ' ' : ''),
+ par_start => ''
+ );
+ $content=$wrapper->wrap($content);
+ }
+
+ $content =~ s/^/> /gm;
+ $content = '[' . $self->CreatorObj->Name() . ' - ' . $self->CreatedAsString()
+ . "]:\n\n"
+ . $content . "\n\n";
+
+ }
+
+ return ($content);
}
+# }}}
-=item TimeTaken
-
-Returns the current value of TimeTaken.
-(In the database, TimeTaken is stored as int(11).)
-
-
-
-=item SetTimeTaken VALUE
-
-
-Set TimeTaken to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, TimeTaken will be stored as a int(11).)
+# {{{ sub Subject
+=head2 Subject
+If this transaction has attached mime objects, returns the first one's subject
+Otherwise, returns null
+
=cut
+sub Subject {
+ my $self = shift;
+ if ($self->Message->First) {
+ return ($self->Message->First->Subject);
+ }
+ else {
+ return (undef);
+ }
+}
+# }}}
-=item Type
-
-Returns the current value of Type.
-(In the database, Type is stored as varchar(20).)
-
-
-
-=item SetType VALUE
-
+# {{{ sub Attachments
-Set Type to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Type will be stored as a varchar(20).)
+=head2 Attachments
+ Returns all the RT::Attachment objects which are attached
+to this transaction. Takes an optional parameter, which is
+a ContentType that Attachments should be restricted to.
=cut
-=item Field
-
-Returns the current value of Field.
-(In the database, Field is stored as varchar(40).)
-
-
+sub Attachments {
+ my $self = shift;
+ my $Types = '';
+ $Types = shift if (@_);
+
+ my $Attachments = new RT::Attachments($self->CurrentUser);
+
+ #If it's a comment, return an empty object if they don't have the right to see it
+ if ($self->Type eq 'Comment') {
+ unless ($self->CurrentUserHasRight('ShowTicketComments')) {
+ return ($Attachments);
+ }
+ }
+ #if they ain't got rights to see, return an empty object
+ else {
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return ($Attachments);
+ }
+ }
+
+ $Attachments->Limit(FIELD => 'TransactionId',
+ VALUE => $self->Id);
+
+ # Get the attachments in the order they're put into
+ # the database. Arguably, we should be returning a tree
+ # of attachments, not a set...but no current app seems to need
+ # it.
+
+ $Attachments->OrderBy(ALIAS => 'main',
+ FIELD => 'Id',
+ ORDER => 'asc');
+
+ if ($Types) {
+ $Attachments->ContentType( VALUE => "$Types",
+ OPERATOR => "LIKE");
+ }
+
+
+ return($Attachments);
+
+}
-=item SetField VALUE
+# }}}
+# {{{ sub _Attach
-Set Field to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Field will be stored as a varchar(40).)
+=head2 _Attach
+A private method used to attach a mime object to this transaction.
=cut
+sub _Attach {
+ my $self = shift;
+ my $MIMEObject = shift;
+
+ if (!defined($MIMEObject)) {
+ $RT::Logger->error("$self _Attach: We can't attach a mime object if you don't give us one.\n");
+ return(0, "$self: no attachment specified");
+ }
+
+
+ use RT::Attachment;
+ my $Attachment = new RT::Attachment ($self->CurrentUser);
+ $Attachment->Create(TransactionId => $self->Id,
+ Attachment => $MIMEObject);
+ return ($Attachment, "Attachment created");
+
+}
-=item OldValue
-
-Returns the current value of OldValue.
-(In the database, OldValue is stored as varchar(255).)
-
+# }}}
+# }}}
-=item SetOldValue VALUE
+# {{{ Routines dealing with Transaction Attributes
+# {{{ sub TicketObj
-Set OldValue to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, OldValue will be stored as a varchar(255).)
+=head2 TicketObj
+Returns this transaction's ticket object.
=cut
+sub TicketObj {
+ my $self = shift;
+ if (! exists $self->{'TicketObj'}) {
+ $self->{'TicketObj'} = new RT::Ticket($self->CurrentUser);
+ $self->{'TicketObj'}->Load($self->Ticket);
+ }
+
+ return $self->{'TicketObj'};
+}
+# }}}
-=item NewValue
-
-Returns the current value of NewValue.
-(In the database, NewValue is stored as varchar(255).)
-
-
-
-=item SetNewValue VALUE
-
+# {{{ sub Description
-Set NewValue to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, NewValue will be stored as a varchar(255).)
+=head2 Description
+Returns a text string which describes this transaction
=cut
-=item Data
-
-Returns the current value of Data.
-(In the database, Data is stored as varchar(100).)
-
+sub Description {
+ my $self = shift;
+ #Check those ACLs
+ #If it's a comment, we need to be extra special careful
+ if ($self->__Value('Type') eq 'Comment') {
+ unless ($self->CurrentUserHasRight('ShowTicketComments')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ #if they ain't got rights to see, don't let em
+ else {
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ if (!defined($self->Type)) {
+ return("No transaction type specified");
+ }
+
+ return ($self->BriefDescription . " by " . $self->CreatorObj->Name);
+}
-=item SetData VALUE
+# }}}
+# {{{ sub BriefDescription
-Set Data to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Data will be stored as a varchar(100).)
+=head2 BriefDescription
+Returns a text string which briefly describes this transaction
=cut
-=item Creator
+sub BriefDescription {
+ my $self = shift;
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+ #Check those ACLs
+ #If it's a comment, we need to be extra special careful
+ if ($self->__Value('Type') eq 'Comment') {
+ unless ($self->CurrentUserHasRight('ShowTicketComments')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ #if they ain't got rights to see, don't let em
+ else {
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return (0, "Permission Denied");
+ }
+ }
+
+ if (!defined($self->Type)) {
+ return("No transaction type specified");
+ }
+
+ if ($self->Type eq 'Create'){
+ return("Ticket created");
+ }
+ elsif ($self->Type =~ /Status/) {
+ if ($self->Field eq 'Status') {
+ if ($self->NewValue eq 'dead') {
+ return ("Ticket killed");
+ }
+ else {
+ return( "Status changed from ". $self->OldValue .
+ " to ". $self->NewValue);
+
+ }
+ }
+ # Generic:
+ return ($self->Field." changed from ".($self->OldValue||"(empty value)").
+ " to ".$self->NewValue );
+ }
+
+ if ($self->Type eq 'Correspond') {
+ return("Correspondence added");
+ }
+
+ elsif ($self->Type eq 'Comment') {
+ return( "Comments added");
+ }
+
+ elsif ($self->Type eq 'Keyword') {
+
+ my $field = 'Keyword';
+
+ if ($self->Field) {
+ my $keywordsel = new RT::KeywordSelect ($self->CurrentUser);
+ $keywordsel->Load($self->Field);
+ $field = $keywordsel->Name();
+ }
+
+ if ($self->OldValue eq '') {
+ return ($field." ".$self->NewValue." added");
+ }
+ elsif ($self->NewValue eq '') {
+ return ($field." ".$self->OldValue." deleted");
+
+ }
+ else {
+ return ($field." ".$self->OldValue . " changed to ".
+ $self->NewValue);
+ }
+ }
+
+ elsif ($self->Type eq 'Untake'){
+ return( "Untaken");
+ }
+
+ elsif ($self->Type eq "Take") {
+ return( "Taken");
+ }
+
+ elsif ($self->Type eq "Force") {
+ my $Old = RT::User->new($self->CurrentUser);
+ $Old->Load($self->OldValue);
+ my $New = RT::User->new($self->CurrentUser);
+ $New->Load($self->NewValue);
+ return "Owner forcibly changed from ".$Old->Name . " to ". $New->Name;
+ }
+ elsif ($self->Type eq "Steal") {
+ my $Old = RT::User->new($self->CurrentUser);
+ $Old->Load($self->OldValue);
+ return "Stolen from ".$Old->Name;
+ }
+
+ elsif ($self->Type eq "Give") {
+ my $New = RT::User->new($self->CurrentUser);
+ $New->Load($self->NewValue);
+ return( "Given to ".$New->Name);
+ }
+
+ elsif ($self->Type eq 'AddWatcher'){
+ return( $self->Field." ". $self->NewValue ." added");
+ }
+
+ elsif ($self->Type eq 'DelWatcher'){
+ return( $self->Field." ".$self->OldValue ." deleted");
+ }
+
+ elsif ($self->Type eq 'Subject') {
+ return( "Subject changed to ".$self->Data);
+ }
+ elsif ($self->Type eq 'Told') {
+ return( "User notified");
+ }
+
+ elsif ($self->Type eq 'AddLink') {
+ return ($self->Data);
+ }
+ elsif ($self->Type eq 'DeleteLink') {
+ return ($self->Data);
+ }
+ elsif ($self->Type eq 'Set') {
+ if ($self->Field eq 'Queue') {
+ my $q1 = new RT::Queue($self->CurrentUser);
+ $q1->Load($self->OldValue);
+ my $q2 = new RT::Queue($self->CurrentUser);
+ $q2->Load($self->NewValue);
+ return ($self->Field . " changed from " . $q1->Name . " to ".
+ $q2->Name);
+ }
+
+ # Write the date/time change at local time:
+ elsif ($self->Field =~ /Due|Starts|Started|Told/) {
+ my $t1 = new RT::Date($self->CurrentUser);
+ $t1->Set(Format => 'ISO', Value => $self->NewValue);
+ my $t2 = new RT::Date($self->CurrentUser);
+ $t2->Set(Format => 'ISO', Value => $self->OldValue);
+ return ($self->Field . " changed from " . $t2->AsString .
+ " to ".$t1->AsString);
+ }
+ else {
+ return ($self->Field . " changed from " . $self->OldValue .
+ " to ".$self->NewValue);
+ }
+ }
+ elsif ($self->Type eq 'PurgeTransaction') {
+ return ("Transaction ".$self->Data. " purged");
+ }
+ else {
+ return ("Default: ". $self->Type ."/". $self->Field .
+ " changed from " . $self->OldValue .
+ " to ".$self->NewValue);
+
+ }
+}
+# }}}
-=cut
+# {{{ Utility methods
+# {{{ sub IsInbound
-=item Created
-
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+=head2 IsInbound
+Returns true if the creator of the transaction is a requestor of the ticket.
+Returns false otherwise
=cut
+sub IsInbound {
+ my $self=shift;
+ return ($self->TicketObj->IsRequestor($self->CreatorObj));
+}
+# }}}
+
+# }}}
+
+# {{{ sub _Accessible
+
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ TimeTaken => 'read',
+ Ticket => 'read/public',
+ Type=> 'read',
+ Field => 'read',
+ Data => 'read',
+ NewValue => 'read',
+ OldValue => 'read',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ );
+ return $self->SUPER::_Accessible(@_, %Cols);
+}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- EffectiveTicket =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Ticket =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- TimeTaken =>
- {read => 1, write => 1, type => 'int(11)', default => '0'},
- Type =>
- {read => 1, write => 1, type => 'varchar(20)', default => ''},
- Field =>
- {read => 1, write => 1, type => 'varchar(40)', default => ''},
- OldValue =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- NewValue =>
- {read => 1, write => 1, type => 'varchar(255)', default => ''},
- Data =>
- {read => 1, write => 1, type => 'varchar(100)', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
+# }}}
+# }}}
- eval "require RT::Transaction_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
- die $@;
- };
+# {{{ sub _Set
- eval "require RT::Transaction_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
- die $@;
- };
+sub _Set {
+ my $self = shift;
+ return(0, 'Transactions are immutable');
+}
- eval "require RT::Transaction_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
- die $@;
- };
+# }}}
+# {{{ sub _Value
+=head2 _Value
+Takes the name of a table column.
+Returns its value as a string, if the user passes an ACL check
-=head1 SEE ALSO
+=cut
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+sub _Value {
-These overlay files can contain new subs or subs to replace existing subs in this module.
+ my $self = shift;
+ my $field = shift;
+
+
+ #if the field is public, return it.
+ if ($self->_Accessible($field, 'public')) {
+ return($self->__Value($field));
+
+ }
+ #If it's a comment, we need to be extra special careful
+ if ($self->__Value('Type') eq 'Comment') {
+ unless ($self->CurrentUserHasRight('ShowTicketComments')) {
+ return (undef);
+ }
+ }
+ #if they ain't got rights to see, don't let em
+ else {
+ unless ($self->CurrentUserHasRight('ShowTicket')) {
+ return (undef);
+ }
+ }
+
+ return($self->__Value($field));
+
+}
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+# }}}
- no warnings qw(redefine);
+# {{{ sub CurrentUserHasRight
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+=head2 CurrentUserHasRight RIGHT
-RT::Transaction_Overlay, RT::Transaction_Vendor, RT::Transaction_Local
+Calls $self->CurrentUser->HasQueueRight for the right passed in here.
+passed in here.
=cut
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+ return ($self->CurrentUser->HasQueueRight(Right => "$right",
+ TicketObj => $self->TicketObj));
+}
+
+# }}}
1;
diff --git a/rt/lib/RT/Transactions.pm b/rt/lib/RT/Transactions.pm
index 23a475ac6..2ae98f286 100755
--- a/rt/lib/RT/Transactions.pm
+++ b/rt/lib/RT/Transactions.pm
@@ -1,115 +1,78 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+#$Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Transactions.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
=head1 NAME
- RT::Transactions -- Class Description
-
+ RT::Transactions - a collection of RT Transaction objects
+
=head1 SYNOPSIS
- use RT::Transactions
+ use RT::Transactions;
+
=head1 DESCRIPTION
=head1 METHODS
-=cut
+=begin testing
-package RT::Transactions;
-
-use RT::SearchBuilder;
-use RT::Transaction;
+ok (require RT::TestHarness);
+ok (require RT::Transactions);
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+=end testing
+=cut
-sub _Init {
- my $self = shift;
- $self->{'table'} = 'Transactions';
- $self->{'primary_key'} = 'id';
+package RT::Transactions;
+use RT::EasySearch;
+@ISA= qw(RT::EasySearch);
+use RT::Transaction;
- return ( $self->SUPER::_Init(@_) );
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "Transactions";
+ $self->{'primary_key'} = "id";
+
+ # By default, order by the date of the transaction, rather than ID.
+ $self->OrderBy( ALIAS => 'main',
+ FIELD => 'Created',
+ ORDER => 'ASC');
+
+ return ( $self->SUPER::_Init(@_));
}
+# }}}
-
-=item NewItem
-
-Returns an empty new RT::Transaction item
-
-=cut
-
-sub NewItem {
+# {{{ sub NewItem
+sub NewItem {
my $self = shift;
+
return(RT::Transaction->new($self->CurrentUser));
}
-
- eval "require RT::Transactions_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::Transactions_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::Transactions_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Local.pm}) {
- die $@;
- };
+# }}}
+=head2 example methods
+ Queue RT::Queue or Queue Id
+ Ticket RT::Ticket or Ticket Id
-=head1 SEE ALSO
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::Transactions_Overlay, RT::Transactions_Vendor, RT::Transactions_Local
+LimitDate
+
+Type TRANSTYPE
+Field STRING
+OldValue OLDVAL
+NewValue NEWVAL
+Data DATA
+TimeTaken
+Actor USEROBJ/USERID
+ContentMatches STRING
=cut
1;
+
diff --git a/rt/lib/RT/User.pm b/rt/lib/RT/User.pm
index cbc10f5b4..4e8554030 100755
--- a/rt/lib/RT/User.pm
+++ b/rt/lib/RT/User.pm
@@ -1,854 +1,1222 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
-
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/User.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
=head1 NAME
-RT::User
-
+ RT::User - RT User object
=head1 SYNOPSIS
-=head1 DESCRIPTION
-
-=head1 METHODS
-
-=cut
-
-package RT::User;
-use RT::Record;
-
+ use RT::User;
-use vars qw( @ISA );
-@ISA= qw( RT::Record );
-
-sub _Init {
- my $self = shift;
+=head1 DESCRIPTION
- $self->Table('Users');
- $self->SUPER::_Init(@_);
-}
+=head1 METHODS
+=begin testing
+ok(require RT::TestHarness);
+ok(require RT::User);
+=end testing
-=item Create PARAMHASH
-
-Create takes a hash of values and creates a row in the database:
-
- varchar(200) 'Name'.
- varchar(40) 'Password'.
- blob 'Comments'.
- blob 'Signature'.
- varchar(120) 'EmailAddress'.
- blob 'FreeformContactInfo'.
- varchar(200) 'Organization'.
- varchar(120) 'RealName'.
- varchar(16) 'NickName'.
- varchar(16) 'Lang'.
- varchar(16) 'EmailEncoding'.
- varchar(16) 'WebEncoding'.
- varchar(100) 'ExternalContactInfoId'.
- varchar(30) 'ContactInfoSystem'.
- varchar(100) 'ExternalAuthId'.
- varchar(30) 'AuthSystem'.
- varchar(16) 'Gecos'.
- varchar(30) 'HomePhone'.
- varchar(30) 'WorkPhone'.
- varchar(30) 'MobilePhone'.
- varchar(30) 'PagerPhone'.
- varchar(200) 'Address1'.
- varchar(200) 'Address2'.
- varchar(100) 'City'.
- varchar(100) 'State'.
- varchar(16) 'Zip'.
- varchar(50) 'Country'.
- varchar(50) 'Timezone'.
- text 'PGPKey'.
=cut
+package RT::User;
+use RT::Record;
+@ISA= qw(RT::Record);
-
-sub Create {
+# {{{ sub _Init
+sub _Init {
my $self = shift;
- my %args = (
- Name => '',
- Password => '',
- Comments => '',
- Signature => '',
- EmailAddress => '',
- FreeformContactInfo => '',
- Organization => '',
- RealName => '',
- NickName => '',
- Lang => '',
- EmailEncoding => '',
- WebEncoding => '',
- ExternalContactInfoId => '',
- ContactInfoSystem => '',
- ExternalAuthId => '',
- AuthSystem => '',
- Gecos => '',
- HomePhone => '',
- WorkPhone => '',
- MobilePhone => '',
- PagerPhone => '',
- Address1 => '',
- Address2 => '',
- City => '',
- State => '',
- Zip => '',
- Country => '',
- Timezone => '',
- PGPKey => '',
-
- @_);
- $self->SUPER::Create(
- Name => $args{'Name'},
- Password => $args{'Password'},
- Comments => $args{'Comments'},
- Signature => $args{'Signature'},
- EmailAddress => $args{'EmailAddress'},
- FreeformContactInfo => $args{'FreeformContactInfo'},
- Organization => $args{'Organization'},
- RealName => $args{'RealName'},
- NickName => $args{'NickName'},
- Lang => $args{'Lang'},
- EmailEncoding => $args{'EmailEncoding'},
- WebEncoding => $args{'WebEncoding'},
- ExternalContactInfoId => $args{'ExternalContactInfoId'},
- ContactInfoSystem => $args{'ContactInfoSystem'},
- ExternalAuthId => $args{'ExternalAuthId'},
- AuthSystem => $args{'AuthSystem'},
- Gecos => $args{'Gecos'},
- HomePhone => $args{'HomePhone'},
- WorkPhone => $args{'WorkPhone'},
- MobilePhone => $args{'MobilePhone'},
- PagerPhone => $args{'PagerPhone'},
- Address1 => $args{'Address1'},
- Address2 => $args{'Address2'},
- City => $args{'City'},
- State => $args{'State'},
- Zip => $args{'Zip'},
- Country => $args{'Country'},
- Timezone => $args{'Timezone'},
- PGPKey => $args{'PGPKey'},
-);
-
+ $self->{'table'} = "Users";
+ return($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub _Accessible
+
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ # {{{ Core RT info
+ Name => 'public/read/write/admin',
+ Password => 'write',
+ Comments => 'read/write/admin',
+ Signature => 'read/write',
+ EmailAddress => 'public/read/write',
+ PagerEmailAddress => 'read/write',
+ FreeformContactInfo => 'read/write',
+ Organization => 'public/read/write/admin',
+ Disabled => 'public/read/write/admin', #To modify this attribute, we have helper
+ #methods
+ Privileged => 'read/write/admin', # 0=no 1=user 2=system
+
+ # }}}
+
+ # {{{ Names
+
+ RealName => 'public/read/write',
+ NickName => 'public/read/write',
+ # }}}
+
+ # {{{ Localization and Internationalization
+ Lang => 'public/read/write',
+ EmailEncoding => 'public/read/write',
+ WebEncoding => 'public/read/write',
+ # }}}
+
+ # {{{ External ContactInfo Linkage
+ ExternalContactInfoId => 'public/read/write/admin',
+ ContactInfoSystem => 'public/read/write/admin',
+ # }}}
+
+ # {{{ User Authentication identifier
+ ExternalAuthId => 'public/read/write/admin',
+ #Authentication system used for user
+ AuthSystem => 'public/read/write/admin',
+ Gecos => 'public/read/write/admin', #Gecos is the name of the fields in a
+ # unix passwd file. In this case, it refers to "Unix Username"
+ # }}}
+
+ # {{{ Telephone numbers
+ HomePhone => 'read/write',
+ WorkPhone => 'read/write',
+ MobilePhone => 'read/write',
+ PagerPhone => 'read/write',
+
+ # }}}
+
+ # {{{ Paper Address
+ Address1 => 'read/write',
+ Address2 => 'read/write',
+ City => 'read/write',
+ State => 'read/write',
+ Zip => 'read/write',
+ Country => 'read/write',
+ # }}}
+
+ # {{{ Core DBIx::Record Attributes
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+
+ # }}}
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
}
+# }}}
+# {{{ sub Create
-=item id
-
-Returns the current value of id.
-(In the database, id is stored as int(11).)
-
-
-=cut
-
-
-=item Name
-
-Returns the current value of Name.
-(In the database, Name is stored as varchar(200).)
-
-
-
-=item SetName VALUE
-
-
-Set Name to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Name will be stored as a varchar(200).)
-
-
-=cut
-
-
-=item Password
-
-Returns the current value of Password.
-(In the database, Password is stored as varchar(40).)
-
-
-
-=item SetPassword VALUE
-
-
-Set Password to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Password will be stored as a varchar(40).)
-
-
-=cut
-
-
-=item Comments
-
-Returns the current value of Comments.
-(In the database, Comments is stored as blob.)
-
-
-
-=item SetComments VALUE
-
-
-Set Comments to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Comments will be stored as a blob.)
-
-
-=cut
-
-
-=item Signature
-
-Returns the current value of Signature.
-(In the database, Signature is stored as blob.)
-
-
-
-=item SetSignature VALUE
-
-
-Set Signature to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Signature will be stored as a blob.)
-
-
-=cut
-
-
-=item EmailAddress
-
-Returns the current value of EmailAddress.
-(In the database, EmailAddress is stored as varchar(120).)
-
-
-
-=item SetEmailAddress VALUE
-
-
-Set EmailAddress to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, EmailAddress will be stored as a varchar(120).)
-
-
-=cut
-
-
-=item FreeformContactInfo
-
-Returns the current value of FreeformContactInfo.
-(In the database, FreeformContactInfo is stored as blob.)
-
-
-
-=item SetFreeformContactInfo VALUE
-
-
-Set FreeformContactInfo to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, FreeformContactInfo will be stored as a blob.)
-
-
-=cut
-
-
-=item Organization
-
-Returns the current value of Organization.
-(In the database, Organization is stored as varchar(200).)
-
-
-
-=item SetOrganization VALUE
-
-
-Set Organization to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Organization will be stored as a varchar(200).)
-
-
-=cut
-
-
-=item RealName
-
-Returns the current value of RealName.
-(In the database, RealName is stored as varchar(120).)
-
-
-
-=item SetRealName VALUE
-
-
-Set RealName to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, RealName will be stored as a varchar(120).)
-
-
-=cut
-
-
-=item NickName
-
-Returns the current value of NickName.
-(In the database, NickName is stored as varchar(16).)
-
-
-
-=item SetNickName VALUE
-
-
-Set NickName to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, NickName will be stored as a varchar(16).)
-
-
-=cut
-
-
-=item Lang
-
-Returns the current value of Lang.
-(In the database, Lang is stored as varchar(16).)
-
-
-
-=item SetLang VALUE
-
-
-Set Lang to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Lang will be stored as a varchar(16).)
-
-
-=cut
-
-
-=item EmailEncoding
-
-Returns the current value of EmailEncoding.
-(In the database, EmailEncoding is stored as varchar(16).)
-
-
+sub Create {
+ my $self = shift;
+ my %args = (Privileged => 0,
+ @_ # get the real argumentlist
+ );
+
+ #Check the ACL
+ unless ($self->CurrentUserHasRight('AdminUsers')) {
+ return (0, 'No permission to create users');
+ }
+
+ if (! $args{'Password'}) {
+ $args{'Password'} = '*NO-PASSWORD*';
+ }
+ elsif (length($args{'Password'}) < $RT::MinimumPasswordLength) {
+ return(0,"Password too short");
+ }
+ else {
+ my $salt = join '', ('.','/',0..9,'A'..'Z','a'..'z')[rand 64, rand 64];
+ $args{'Password'} = crypt($args{'Password'}, $salt);
+ }
+
+
+ #TODO Specify some sensible defaults.
+
+ unless (defined ($args{'Name'})) {
+ return(0, "Must specify 'Name' attribute");
+ }
+
+
+ #SANITY CHECK THE NAME AND ABORT IF IT'S TAKEN
+ if ($RT::SystemUser) { #This only works if RT::SystemUser has been defined
+ my $TempUser = RT::User->new($RT::SystemUser);
+ $TempUser->Load($args{'Name'});
+ return (0, 'Name in use') if ($TempUser->Id);
+
+ return(0, 'Email address in use')
+ unless ($self->ValidateEmailAddress($args{'EmailAddress'}));
+ }
+ else {
+ $RT::Logger->warning("$self couldn't check for pre-existing ".
+ " users on create. This will happen".
+ " on installation\n");
+ }
+
+ my $id = $self->SUPER::Create(%args);
+
+ #If the create failed.
+ unless ($id) {
+ return (0, 'Could not create user');
+ }
+
+
+ #TODO post 2.0
+ #if ($args{'SendWelcomeMessage'}) {
+ # #TODO: Check if the email exists and looks valid
+ # #TODO: Send the user a "welcome message"
+ #}
+
+ return ($id, 'User created');
+}
-=item SetEmailEncoding VALUE
+# }}}
+# {{{ sub _BootstrapCreate
-Set EmailEncoding to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, EmailEncoding will be stored as a varchar(16).)
+#create a user without validating _any_ data.
+#To be used only on database init.
-=cut
+sub _BootstrapCreate {
+ my $self = shift;
+ my %args = (@_);
+ $args{'Password'} = "*NO-PASSWORD*";
+ my $id = $self->SUPER::Create(%args);
+
+ #If the create failed.
+ return (0, 'Could not create user')
+ unless ($id);
-=item WebEncoding
+ return ($id, 'User created');
+}
-Returns the current value of WebEncoding.
-(In the database, WebEncoding is stored as varchar(16).)
+# }}}
+# {{{ sub Delete
+sub Delete {
+ my $self = shift;
+
+ return(0, 'Deleting this object would violate referential integrity');
+
+}
-=item SetWebEncoding VALUE
+# }}}
+# {{{ sub Load
-Set WebEncoding to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, WebEncoding will be stored as a varchar(16).)
+=head2 Load
+Load a user object from the database. Takes a single argument.
+If the argument is numerical, load by the column 'id'. Otherwise, load by
+the "Name" column which is the user's textual username.
=cut
+sub Load {
+ my $self = shift;
+ my $identifier = shift || return undef;
+
+ #if it's an int, load by id. otherwise, load by name.
+ if ($identifier !~ /\D/) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ $self->LoadByCol("Name",$identifier);
+ }
+}
-=item ExternalContactInfoId
-
-Returns the current value of ExternalContactInfoId.
-(In the database, ExternalContactInfoId is stored as varchar(100).)
-
+# }}}
-=item SetExternalContactInfoId VALUE
+# {{{ sub LoadByEmail
+=head2 LoadByEmail
-Set ExternalContactInfoId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExternalContactInfoId will be stored as a varchar(100).)
+Tries to load this user object from the database by the user's email address.
=cut
+sub LoadByEmail {
+ my $self=shift;
+ my $address = shift;
-=item ContactInfoSystem
-
-Returns the current value of ContactInfoSystem.
-(In the database, ContactInfoSystem is stored as varchar(30).)
-
+ # Never load an empty address as an email address.
+ unless ($address) {
+ return(undef);
+ }
+ $address = RT::CanonicalizeAddress($address);
+ #$RT::Logger->debug("Trying to load an email address: $address\n");
+ return $self->LoadByCol("EmailAddress", $address);
+}
+# }}}
-=item SetContactInfoSystem VALUE
+# {{{ sub ValidateEmailAddress
-Set ContactInfoSystem to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ContactInfoSystem will be stored as a varchar(30).)
+=head2 ValidateEmailAddress ADDRESS
+Returns true if the email address entered is not in use by another user or is
+undef or ''. Returns false if it's in use.
=cut
+sub ValidateEmailAddress {
+ my $self = shift;
+ my $Value = shift;
-=item ExternalAuthId
-
-Returns the current value of ExternalAuthId.
-(In the database, ExternalAuthId is stored as varchar(100).)
-
+ # if the email address is null, it's always valid
+ return (1) if(!$Value || $Value eq "");
+ my $TempUser = RT::User->new($RT::SystemUser);
+ $TempUser->LoadByEmail($Value);
-=item SetExternalAuthId VALUE
-
-
-Set ExternalAuthId to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, ExternalAuthId will be stored as a varchar(100).)
-
-
-=cut
-
-
-=item AuthSystem
+ if( $TempUser->id &&
+ ($TempUser->id != $self->id)) { # if we found a user with that address
+ # it's invalid to set this user's address to it
+ return(undef);
+ }
+ else { #it's a valid email address
+ return(1);
+ }
+}
-Returns the current value of AuthSystem.
-(In the database, AuthSystem is stored as varchar(30).)
+# }}}
-=item SetAuthSystem VALUE
+# {{{ sub SetRandomPassword
-Set AuthSystem to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, AuthSystem will be stored as a varchar(30).)
+=head2 SetRandomPassword
+Takes no arguments. Returns a status code and a new password or an error message.
+If the status is 1, the second value returned is the new password.
+If the status is anything else, the new value returned is the error code.
=cut
-
-=item Gecos
-
-Returns the current value of Gecos.
-(In the database, Gecos is stored as varchar(16).)
-
-
-
-=item SetGecos VALUE
-
-
-Set Gecos to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Gecos will be stored as a varchar(16).)
-
-
-=cut
+sub SetRandomPassword {
+ my $self = shift;
-=item HomePhone
+ unless ($self->CurrentUserCanModify('Password')) {
+ return (0, "Permission Denied");
+ }
+
+ my $pass = $self->GenerateRandomPassword(6,8);
-Returns the current value of HomePhone.
-(In the database, HomePhone is stored as varchar(30).)
+ # If we have "notify user on
+ my ($val, $msg) = $self->SetPassword($pass);
+
+ #If we got an error return the error.
+ return (0, $msg) unless ($val);
+
+ #Otherwise, we changed the password, lets return it.
+ return (1, $pass);
+
+}
+# }}}
-=item SetHomePhone VALUE
+# {{{ sub ResetPassword
-Set HomePhone to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, HomePhone will be stored as a varchar(30).)
+=head2 ResetPassword
+Returns status, [ERROR or new password]. Resets this user\'s password to
+a randomly generated pronouncable password and emails them, using a
+global template called "RT_PasswordChange", which can be overridden
+with global templates "RT_PasswordChange_Privileged" or "RT_PasswordChange_NonPrivileged"
+for privileged and Non-privileged users respectively.
=cut
-
-=item WorkPhone
-
-Returns the current value of WorkPhone.
-(In the database, WorkPhone is stored as varchar(30).)
-
+sub ResetPassword {
+ my $self = shift;
+
+ unless ($self->CurrentUserCanModify('Password')) {
+ return (0, "Permission Denied");
+ }
+ my ($status, $pass) = $self->SetRandomPassword();
+
+ unless ($status) {
+ return (0, "$pass");
+ }
+
+ my $template = RT::Template->new($self->CurrentUser);
+
+
+ if ($self->IsPrivileged) {
+ $template->LoadGlobalTemplate('RT_PasswordChange_Privileged');
+ }
+ else {
+ $template->LoadGlobalTemplate('RT_PasswordChange_Privileged');
+ }
+
+ unless ($template->Id) {
+ $template->LoadGlobalTemplate('RT_PasswordChange');
+ }
+
+ unless ($template->Id) {
+ $RT::Logger->crit("$self tried to send ".$self->Name." a password reminder ".
+ "but couldn't find a password change template");
+ }
+
+ my $notification = RT::Action::SendPasswordEmail->new(TemplateObj => $template,
+ Argument => $pass);
+
+ $notification->SetTo($self->EmailAddress);
+
+ my ($ret);
+ $ret = $notification->Prepare();
+ if ($ret) {
+ $ret = $notification->Commit();
+ }
+
+ if ($ret) {
+ return(1, 'New password notification sent');
+ } else {
+ return (0, 'Notification could not be sent');
+ }
+
+}
-=item SetWorkPhone VALUE
+# }}}
+# {{{ sub GenerateRandomPassword
-Set WorkPhone to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, WorkPhone will be stored as a varchar(30).)
+=head2 GenerateRandomPassword MIN_LEN and MAX_LEN
+Returns a random password between MIN_LEN and MAX_LEN characters long.
=cut
-
-=item MobilePhone
-
-Returns the current value of MobilePhone.
-(In the database, MobilePhone is stored as varchar(30).)
+sub GenerateRandomPassword {
+ my $self = shift;
+ my $min_length = shift;
+ my $max_length = shift;
+
+ #This code derived from mpw.pl, a bit of code with a sordid history
+ # Its notes:
+
+ # Perl cleaned up a bit by Jesse Vincent 1/14/2001.
+ # Converted to perl from C by Marc Horowitz, 1/20/2000.
+ # Converted to C from Multics PL/I by Bill Sommerfeld, 4/21/86.
+ # Original PL/I version provided by Jerry Saltzer.
+
+
+ my ($frequency, $start_freq, $total_sum, $row_sums);
+
+ #When munging characters, we need to know where to start counting letters from
+ my $a = ord('a');
+
+ # frequency of English digraphs (from D Edwards 1/27/66)
+ $frequency =
+ [ [ 4, 20, 28, 52, 2, 11, 28, 4, 32, 4, 6, 62, 23,
+ 167, 2, 14, 0, 83, 76, 127, 7, 25, 8, 1, 9, 1 ], # aa - az
+ [ 13, 0, 0, 0, 55, 0, 0, 0, 8, 2, 0, 22, 0,
+ 0, 11, 0, 0, 15, 4, 2, 13, 0, 0, 0, 15, 0 ], # ba - bz
+ [ 32, 0, 7, 1, 69, 0, 0, 33, 17, 0, 10, 9, 1,
+ 0, 50, 3, 0, 10, 0, 28, 11, 0, 0, 0, 3, 0 ], # ca - cz
+ [ 40, 16, 9, 5, 65, 18, 3, 9, 56, 0, 1, 4, 15,
+ 6, 16, 4, 0, 21, 18, 53, 19, 5, 15, 0, 3, 0 ], # da - dz
+ [ 84, 20, 55, 125, 51, 40, 19, 16, 50, 1, 4, 55, 54,
+ 146, 35, 37, 6, 191, 149, 65, 9, 26, 21, 12, 5, 0 ], # ea - ez
+ [ 19, 3, 5, 1, 19, 21, 1, 3, 30, 2, 0, 11, 1,
+ 0, 51, 0, 0, 26, 8, 47, 6, 3, 3, 0, 2, 0 ], # fa - fz
+ [ 20, 4, 3, 2, 35, 1, 3, 15, 18, 0, 0, 5, 1,
+ 4, 21, 1, 1, 20, 9, 21, 9, 0, 5, 0, 1, 0 ], # ga - gz
+ [ 101, 1, 3, 0, 270, 5, 1, 6, 57, 0, 0, 0, 3,
+ 2, 44, 1, 0, 3, 10, 18, 6, 0, 5, 0, 3, 0 ], # ha - hz
+ [ 40, 7, 51, 23, 25, 9, 11, 3, 0, 0, 2, 38, 25,
+ 202, 56, 12, 1, 46, 79, 117, 1, 22, 0, 4, 0, 3 ], # ia - iz
+ [ 3, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 0,
+ 0, 4, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0 ], # ja - jz
+ [ 1, 0, 0, 0, 11, 0, 0, 0, 13, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 6, 2, 1, 0, 2, 0, 1, 0 ], # ka - kz
+ [ 44, 2, 5, 12, 62, 7, 5, 2, 42, 1, 1, 53, 2,
+ 2, 25, 1, 1, 2, 16, 23, 9, 0, 1, 0, 33, 0 ], # la - lz
+ [ 52, 14, 1, 0, 64, 0, 0, 3, 37, 0, 0, 0, 7,
+ 1, 17, 18, 1, 2, 12, 3, 8, 0, 1, 0, 2, 0 ], # ma - mz
+ [ 42, 10, 47, 122, 63, 19, 106, 12, 30, 1, 6, 6, 9,
+ 7, 54, 7, 1, 7, 44, 124, 6, 1, 15, 0, 12, 0 ], # na - nz
+ [ 7, 12, 14, 17, 5, 95, 3, 5, 14, 0, 0, 19, 41,
+ 134, 13, 23, 0, 91, 23, 42, 55, 16, 28, 0, 4, 1 ], # oa - oz
+ [ 19, 1, 0, 0, 37, 0, 0, 4, 8, 0, 0, 15, 1,
+ 0, 27, 9, 0, 33, 14, 7, 6, 0, 0, 0, 0, 0 ], # pa - pz
+ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0 ], # qa - qz
+ [ 83, 8, 16, 23, 169, 4, 8, 8, 77, 1, 10, 5, 26,
+ 16, 60, 4, 0, 24, 37, 55, 6, 11, 4, 0, 28, 0 ], # ra - rz
+ [ 65, 9, 17, 9, 73, 13, 1, 47, 75, 3, 0, 7, 11,
+ 12, 56, 17, 6, 9, 48, 116, 35, 1, 28, 0, 4, 0 ], # sa - sz
+ [ 57, 22, 3, 1, 76, 5, 2, 330, 126, 1, 0, 14, 10,
+ 6, 79, 7, 0, 49, 50, 56, 21, 2, 27, 0, 24, 0 ], # ta - tz
+ [ 11, 5, 9, 6, 9, 1, 6, 0, 9, 0, 1, 19, 5,
+ 31, 1, 15, 0, 47, 39, 31, 0, 3, 0, 0, 0, 0 ], # ua - uz
+ [ 7, 0, 0, 0, 72, 0, 0, 0, 28, 0, 0, 0, 0,
+ 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0 ], # va - vz
+ [ 36, 1, 1, 0, 38, 0, 0, 33, 36, 0, 0, 4, 1,
+ 8, 15, 0, 0, 0, 4, 2, 0, 0, 1, 0, 0, 0 ], # wa - wz
+ [ 1, 0, 2, 0, 0, 1, 0, 0, 3, 0, 0, 0, 0,
+ 0, 1, 5, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0 ], # xa - xz
+ [ 14, 5, 4, 2, 7, 12, 12, 6, 10, 0, 0, 3, 7,
+ 5, 17, 3, 0, 4, 16, 30, 0, 0, 5, 0, 0, 0 ], # ya - yz
+ [ 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] ]; # za - zz
+
+ #We need to know the totals for each row
+ $row_sums =
+ [ map { my $sum = 0; map { $sum += $_ } @$_; $sum } @$frequency ];
+
+
+ #Frequency with which a given letter starts a word.
+ $start_freq =
+ [ 1299, 425, 725, 271, 375, 470, 93, 223, 1009, 24, 20, 355, 379,
+ 319, 823, 618, 21, 317, 962, 1991, 271, 104, 516, 6, 16, 14 ];
+
+ $total_sum = 0; map { $total_sum += $_ } @$start_freq;
+
+
+ my $length = $min_length + int(rand($max_length-$min_length));
+
+ my $char = $self->GenerateRandomNextChar($total_sum, $start_freq);
+ my @word = ($char+$a);
+ for (2..$length) {
+ $char = $self->_GenerateRandomNextChar($row_sums->[$char], $frequency->[$char]);
+ push(@word, $char+$a);
+ }
+
+ #Return the password
+ return pack("C*",@word);
+
+}
+#A private helper function for RandomPassword
+# Takes a row summary and a frequency chart for the next character to be searched
+sub _GenerateRandomNextChar {
+ my $self = shift;
+ my($all, $freq) = @_;
+ my($pos, $i);
+
+ for ($pos = int(rand($all)), $i=0;
+ $pos >= $freq->[$i];
+ $pos -= $freq->[$i], $i++) {};
+
+ return($i);
+}
-=item SetMobilePhone VALUE
+# }}}
+# {{{ sub SetPassword
-Set MobilePhone to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, MobilePhone will be stored as a varchar(30).)
+=head2 SetPassword
+Takes a string. Checks the string's length and sets this user's password
+to that string.
=cut
+sub SetPassword {
+ my $self = shift;
+ my $password = shift;
+
+ unless ($self->CurrentUserCanModify('Password')) {
+ return(0, 'Permission Denied');
+ }
+
+ if (! $password) {
+ return(0, "No password set");
+ }
+ elsif (length($password) < $RT::MinimumPasswordLength) {
+ return(0,"Password too short");
+ }
+ else {
+ my $salt = join '', ('.','/',0..9,'A'..'Z','a'..'z')[rand 64, rand 64];
+ return ( $self->SUPER::SetPassword(crypt($password, $salt)) );
+ }
+
+}
-=item PagerPhone
-
-Returns the current value of PagerPhone.
-(In the database, PagerPhone is stored as varchar(30).)
-
-
-
-=item SetPagerPhone VALUE
+# }}}
+# {{{ sub IsPassword
-Set PagerPhone to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, PagerPhone will be stored as a varchar(30).)
+=head2 IsPassword
+Returns true if the passed in value is this user's password.
+Returns undef otherwise.
=cut
+sub IsPassword {
+ my $self = shift;
+ my $value = shift;
+
+ #TODO there isn't any apparent way to legitimately ACL this
+
+ # RT does not allow null passwords
+ if ((!defined ($value)) or ($value eq '')) {
+ return(undef);
+ }
+ if ($self->Disabled) {
+ $RT::Logger->info("Disabled user ".$self->Name." tried to log in");
+ return(undef);
+ }
+
+ if ( ($self->__Value('Password') eq '') ||
+ ($self->__Value('Password') eq undef) ) {
+ return(undef);
+ }
+ if ($self->__Value('Password') eq crypt($value, $self->__Value('Password'))) {
+ return (1);
+ }
+ else {
+ return (undef);
+ }
+}
-=item Address1
-
-Returns the current value of Address1.
-(In the database, Address1 is stored as varchar(200).)
-
-
-
-=item SetAddress1 VALUE
-
-
-Set Address1 to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Address1 will be stored as a varchar(200).)
-
-
-=cut
+# }}}
+# {{{ sub SetDisabled
-=item Address2
+=head2 Sub SetDisabled
-Returns the current value of Address2.
-(In the database, Address2 is stored as varchar(200).)
+Toggles the user's disabled flag.
+If this flag is
+set, all password checks for this user will fail. All ACL checks for this
+user will fail. The user will appear in no user listings.
+=cut
+# }}}
-=item SetAddress2 VALUE
+# {{{ ACL Related routines
+# {{{ GrantQueueRight
-Set Address2 to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Address2 will be stored as a varchar(200).)
+=head2 GrantQueueRight
+Grant a queue right to this user. Takes a paramhash of which the elements
+RightAppliesTo and RightName are important.
=cut
+sub GrantQueueRight {
+
+ my $self = shift;
+ my %args = ( RightScope => 'Queue',
+ RightName => undef,
+ RightAppliesTo => undef,
+ PrincipalType => 'User',
+ PrincipalId => $self->Id,
+ @_);
+
+ #ACL check handled in ACE.pm
+
+ require RT::ACE;
+
+# $RT::Logger->debug("$self ->GrantQueueRight right:". $args{'RightName'} .
+# " applies to queue ".$args{'RightAppliesTo'}."\n");
+
+ my $ace = new RT::ACE($self->CurrentUser);
+
+ return ($ace->Create(%args));
+}
-=item City
-
-Returns the current value of City.
-(In the database, City is stored as varchar(100).)
-
-
-
-=item SetCity VALUE
+# }}}
+# {{{ GrantSystemRight
-Set City to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, City will be stored as a varchar(100).)
+=head2 GrantSystemRight
+Grant a system right to this user.
+The only element that's important to set is RightName.
=cut
+sub GrantSystemRight {
+
+ my $self = shift;
+ my %args = ( RightScope => 'System',
+ RightName => undef,
+ RightAppliesTo => 0,
+ PrincipalType => 'User',
+ PrincipalId => $self->Id,
+ @_);
+
+
+ #ACL check handled in ACE.pm
+
+ require RT::ACE;
+ my $ace = new RT::ACE($self->CurrentUser);
+
+ return ($ace->Create(%args));
+}
-=item State
-
-Returns the current value of State.
-(In the database, State is stored as varchar(100).)
+# }}}
+# {{{ sub HasQueueRight
+=head2 HasQueueRight
-=item SetState VALUE
+Takes a paramhash which can contain
+these items:
+ TicketObj => RT::Ticket or QueueObj => RT::Queue or Queue => integer
+ IsRequestor => undef, (for bootstrapping create)
+ Right => 'Right'
-Set State to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, State will be stored as a varchar(100).)
+Returns 1 if this user has the right specified in the paramhash. for the queue
+passed in.
+Returns undef if they don't
=cut
+sub HasQueueRight {
+ my $self = shift;
+ my %args = ( TicketObj => undef,
+ QueueObj => undef,
+ Queue => undef,
+ IsRequestor => undef,
+ Right => undef,
+ @_);
+
+ my ($IsRequestor, $IsCc, $IsAdminCc, $IsOwner);
+
+ if (defined $args{'Queue'}) {
+ $args{'QueueObj'} = new RT::Queue($self->CurrentUser);
+ $args{'QueueObj'}->Load($args{'Queue'});
+ }
+
+ if (defined $args{'TicketObj'}) {
+ $args{'QueueObj'} = $args{'TicketObj'}->QueueObj();
+ }
+
+ # {{{ Validate and load up the QueueId
+ unless ((defined $args{'QueueObj'}) and ($args{'QueueObj'}->Id)) {
+ require Carp;
+ $RT::Logger->debug(Carp::cluck ("$self->HasQueueRight Couldn't find a queue id"));
+ return undef;
+ }
+
+ # }}}
+
+
+ # Figure out whether a user has the right we're asking about.
+ # first see if they have the right personally for the queue in question.
+ my $retval = $self->_HasRight(Scope => 'Queue',
+ AppliesTo => $args{'QueueObj'}->Id,
+ Right => $args{'Right'},
+ IsOwner => $IsOwner);
+
+ return ($retval) if (defined $retval);
+
+ # then we see whether they have the right personally globally.
+ $retval = $self->HasSystemRight( $args{'Right'});
+
+ return ($retval) if (defined $retval);
+
+ # now that we know they don't have the right personally,
+
+ # {{{ Find out about whether the current user is a Requestor, Cc, AdminCc or Owner
+
+ if (defined $args{'TicketObj'}) {
+ if ($args{'TicketObj'}->IsRequestor($self)) {#user is requestor
+ $IsRequestor = 1;
+ }
+
+ if ($args{'TicketObj'}->IsCc($self)) { #If user is a cc
+ $IsCc = 1;
+ }
+
+ if ($args{'TicketObj'}->IsAdminCc($self)) { #If user is an admin cc
+ $IsAdminCc = 1;
+ }
+
+ if ($args{'TicketObj'}->IsOwner($self)) { #If user is an owner
+ $IsOwner = 1;
+ }
+ }
+
+ if (defined $args{'QueueObj'}) {
+ if ($args{'QueueObj'}->IsCc($self)) { #If user is a cc
+ $IsCc = 1;
+ }
+ if ($args{'QueueObj'}->IsAdminCc($self)) { #If user is an admin cc
+ $IsAdminCc = 1;
+ }
+
+ }
+ # }}}
+
+ # then see whether they have the right for the queue as a member of a metagroup
+
+ $retval = $self->_HasRight(Scope => 'Queue',
+ AppliesTo => $args{'QueueObj'}->Id,
+ Right => $args{'Right'},
+ IsOwner => $IsOwner,
+ IsCc => $IsCc,
+ IsAdminCc => $IsAdminCc,
+ IsRequestor => $IsRequestor
+ );
+
+ return ($retval) if (defined $retval);
+
+ # then we see whether they have the right globally as a member of a metagroup
+ $retval = $self->HasSystemRight( $args{'Right'},
+ (IsOwner => $IsOwner,
+ IsCc => $IsCc,
+ IsAdminCc => $IsAdminCc,
+ IsRequestor => $IsRequestor
+ ) );
+
+ #If they haven't gotten it by now, they just lose.
+ return ($retval);
+
+}
-=item Zip
-
-Returns the current value of Zip.
-(In the database, Zip is stored as varchar(16).)
-
-
-
-=item SetZip VALUE
+# }}}
+
+# {{{ sub HasSystemRight
+=head2 HasSystemRight
-Set Zip to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Zip will be stored as a varchar(16).)
+takes an array of a single value and a paramhash.
+The single argument is the right being passed in.
+the param hash is some additional data. (IsCc, IsOwner, IsAdminCc and IsRequestor)
+Returns 1 if this user has the listed 'right'. Returns undef if this user doesn't.
=cut
+sub HasSystemRight {
+ my $self = shift;
+ my $right = shift;
+
+ my %args = ( IsOwner => undef,
+ IsCc => undef,
+ IsAdminCc => undef,
+ IsRequestor => undef,
+ @_);
+
+ unless (defined $right) {
+
+ $RT::Logger->debug("$self RT::User::HasSystemRight was passed in no right.");
+ return(undef);
+ }
+ return ( $self->_HasRight ( Scope => 'System',
+ AppliesTo => '0',
+ Right => $right,
+ IsOwner => $args{'IsOwner'},
+ IsCc => $args{'IsCc'},
+ IsAdminCc => $args{'IsAdminCc'},
+ IsRequestor => $args{'IsRequestor'},
+
+ )
+ );
+
+}
-=item Country
-
-Returns the current value of Country.
-(In the database, Country is stored as varchar(50).)
-
-
-
-=item SetCountry VALUE
-
-
-Set Country to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Country will be stored as a varchar(50).)
-
+# }}}
-=cut
+# {{{ sub _HasRight
+=head2 sub _HasRight (Right => 'right', Scope => 'scope', AppliesTo => int, ExtendedPrincipals => SQL)
-=item Timezone
+_HasRight is a private helper method for checking a user's rights. It takes
+several options:
-Returns the current value of Timezone.
-(In the database, Timezone is stored as varchar(50).)
+=item Right is a textual right name
+=item Scope is a textual scope name. (As of July these were Queue, Ticket and System
+=item AppliesTo is the numerical Id of the object identified in the scope. For tickets, this is the queue #. for queues, this is the queue #
-=item SetTimezone VALUE
+=item ExtendedPrincipals is an SQL select clause which assumes that the only
+table in play is ACL. It's used by HasQueueRight to pass in which
+metaprincipals apply. Actually, it's probably obsolete. TODO: remove it.
+Returns 1 if a matching ACE was found.
-Set Timezone to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, Timezone will be stored as a varchar(50).)
-
+Returns undef if no ACE was found.
=cut
-=item PGPKey
-
-Returns the current value of PGPKey.
-(In the database, PGPKey is stored as text.)
-
-
+sub _HasRight {
+
+ my $self = shift;
+ my %args = ( Right => undef,
+ Scope => undef,
+ AppliesTo => undef,
+ IsRequestor => undef,
+ IsCc => undef,
+ IsAdminCc => undef,
+ IsOwner => undef,
+ ExtendedPrincipals => undef,
+ @_);
+
+ if ($self->Disabled) {
+ $RT::Logger->debug ("Disabled User: ".$self->Name.
+ " failed access check for ".$args{'Right'}.
+ " to object ".$args{'Scope'}."/".
+ $args{'AppliesTo'}."\n");
+ return (undef);
+ }
+
+ if (!defined $args{'Right'}) {
+ $RT::Logger->debug("_HasRight called without a right\n");
+ return(undef);
+ }
+ elsif (!defined $args{'Scope'}) {
+ $RT::Logger->debug("_HasRight called without a scope\n");
+ return(undef);
+ }
+ elsif (!defined $args{'AppliesTo'}) {
+ $RT::Logger->debug("_HasRight called without an AppliesTo object\n");
+ return(undef);
+ }
+
+ #If we've cached a win or loss for this lookup say so
+
+ #TODO Security +++ check to make sure this is complete and right
+
+ #Construct a hashkey to cache decisions in
+ my ($hashkey);
+ { #it's ugly, but we need to turn off warning, cuz we're joining nulls.
+ local $^W=0;
+ $hashkey =$self->Id .":". join(':',%args);
+ }
+
+ # $RT::Logger->debug($hashkey."\n");
+
+ #Anything older than 10 seconds needs to be rechecked
+ my $cache_timeout = (time - 10);
+
+
+ if ((defined $self->{'rights'}{"$hashkey"}) &&
+ ($self->{'rights'}{"$hashkey"} == 1 ) &&
+ (defined $self->{'rights'}{"$hashkey"}{'set'} ) &&
+ ($self->{'rights'}{"$hashkey"}{'set'} > $cache_timeout)) {
+# $RT::Logger->debug("Cached ACL win for ".
+# $args{'Right'}.$args{'Scope'}.
+# $args{'AppliesTo'}."\n");
+ return ($self->{'rights'}{"$hashkey"});
+ }
+ elsif ((defined $self->{'rights'}{"$hashkey"}) &&
+ ($self->{'rights'}{"$hashkey"} == -1) &&
+ (defined $self->{'rights'}{"$hashkey"}{'set'}) &&
+ ($self->{'rights'}{"$hashkey"}{'set'} > $cache_timeout)) {
+
+# $RT::Logger->debug("Cached ACL loss decision for ".
+# $args{'Right'}.$args{'Scope'}.
+# $args{'AppliesTo'}."\n");
+
+ return(undef);
+ }
+
+
+ my $RightClause = "(RightName = '$args{'Right'}')";
+ my $ScopeClause = "(RightScope = '$args{'Scope'}')";
+
+ #If an AppliesTo was passed in, we should pay attention to it.
+ #otherwise, none is needed
+
+ $ScopeClause = "($ScopeClause AND (RightAppliesTo = $args{'AppliesTo'}))"
+ if ($args{'AppliesTo'});
+
+
+ # The generic principals clause looks for users with my id
+ # and Rights that apply to _everyone_
+ my $PrincipalsClause = "((PrincipalType = 'User') AND (PrincipalId = ".$self->Id."))";
+
+
+ # If the user is the superuser, grant them the damn right ;)
+ my $SuperUserClause =
+ "(RightName = 'SuperUser') AND (RightScope = 'System') AND (RightAppliesTo = 0)";
+
+ # If we've been passed in an extended principals clause, we should lump it
+ # on to the existing principals clause. it'll make life easier
+ if ($args{'ExtendedPrincipals'}) {
+ $PrincipalsClause = "(($PrincipalsClause) OR ".
+ "($args{'ExtendedPrincipalsClause'}))";
+ }
+
+ my $GroupPrincipalsClause = "((ACL.PrincipalType = 'Group') ".
+ "AND (ACL.PrincipalId = Groups.Id) AND (GroupMembers.GroupId = Groups.Id) ".
+ " AND (GroupMembers.UserId = ".$self->Id."))";
+
+
+
+
+ # {{{ A bunch of magic statements that make the metagroups listed
+ # work. basically, we if the user falls into the right group,
+ # we add the type of ACL check needed
+ my (@MetaPrincipalsSubClauses, $MetaPrincipalsClause);
+
+ #The user is always part of the 'Everyone' Group
+ push (@MetaPrincipalsSubClauses, "((Groups.Name = 'Everyone') AND
+ (PrincipalType = 'Group') AND
+ (Groups.Id = PrincipalId))");
+
+ if ($args{'IsAdminCc'}) {
+ push (@MetaPrincipalsSubClauses, "((Groups.Name = 'AdminCc') AND
+ (PrincipalType = 'Group') AND
+ (Groups.Id = PrincipalId))");
+ }
+ if ($args{'IsCc'}) {
+ push (@MetaPrincipalsSubClauses, " ((Groups.Name = 'Cc') AND
+ (PrincipalType = 'Group') AND
+ (Groups.Id = PrincipalId))");
+ }
+ if ($args{'IsRequestor'}) {
+ push (@MetaPrincipalsSubClauses, " ((Groups.Name = 'Requestor') AND
+ (PrincipalType = 'Group') AND
+ (Groups.Id = PrincipalId))");
+ }
+ if ($args{'IsOwner'}) {
+
+ push (@MetaPrincipalsSubClauses, " ((Groups.Name = 'Owner') AND
+ (PrincipalType = 'Group') AND
+ (Groups.Id = PrincipalId))");
+ }
+
+ # }}}
+
+ my ($GroupRightsQuery, $MetaGroupRightsQuery, $IndividualRightsQuery, $hitcount);
+
+ # {{{ If there are any metaprincipals to be checked
+ if (@MetaPrincipalsSubClauses) {
+ #chop off the leading or
+ #TODO redo this with an array and a join
+ $MetaPrincipalsClause = join (" OR ", @MetaPrincipalsSubClauses);
+
+ $MetaGroupRightsQuery = "SELECT COUNT(ACL.id) FROM ACL, Groups".
+ " WHERE " .
+ " ($ScopeClause) AND ($RightClause) AND ($MetaPrincipalsClause)";
+
+ # {{{ deal with checking if the user has a right as a member of a metagroup
+
+# $RT::Logger->debug("Now Trying $MetaGroupRightsQuery\n");
+ $hitcount = $self->_Handle->FetchResult($MetaGroupRightsQuery);
+
+ #if there's a match, the right is granted
+ if ($hitcount) {
+ $self->{'rights'}{"$hashkey"}{'set'} = time;
+ $self->{'rights'}{"$hashkey"} = 1;
+ return (1);
+ }
+
+# $RT::Logger->debug("No ACL matched MetaGroups query: $MetaGroupRightsQuery\n");
+
+ # }}}
+
+ }
+ # }}}
+
+ # {{{ deal with checking if the user has a right as a member of a group
+ # This query checks to se whether the user has the right as a member of a
+ # group
+ $GroupRightsQuery = "SELECT COUNT(ACL.id) FROM ACL, GroupMembers, Groups".
+ " WHERE " .
+ " (((($ScopeClause) AND ($RightClause)) OR ($SuperUserClause)) ".
+ " AND ($GroupPrincipalsClause))";
+
+ # $RT::Logger->debug("Now Trying $GroupRightsQuery\n");
+ $hitcount = $self->_Handle->FetchResult($GroupRightsQuery);
+
+ #if there's a match, the right is granted
+ if ($hitcount) {
+ $self->{'rights'}{"$hashkey"}{'set'} = time;
+ $self->{'rights'}{"$hashkey"} = 1;
+ return (1);
+ }
+
+# $RT::Logger->debug("No ACL matched $GroupRightsQuery\n");
+
+ # }}}
+
+ # {{{ Check to see whether the user has a right as an individual
+
+ # This query checks to see whether the current user has the right directly
+ $IndividualRightsQuery = "SELECT COUNT(ACL.id) FROM ACL WHERE ".
+ " ((($ScopeClause) AND ($RightClause)) OR ($SuperUserClause)) " .
+ " AND ($PrincipalsClause)";
+
+
+ $hitcount = $self->_Handle->FetchResult($IndividualRightsQuery);
+
+ if ($hitcount) {
+ $self->{'rights'}{"$hashkey"}{'set'} = time;
+ $self->{'rights'}{"$hashkey"} = 1;
+ return (1);
+ }
+ # }}}
+
+ else { #If the user just doesn't have the right
+
+# $RT::Logger->debug("No ACL matched $IndividualRightsQuery\n");
+
+ #If nothing matched, return 0.
+ $self->{'rights'}{"$hashkey"}{'set'} = time;
+ $self->{'rights'}{"$hashkey"} = -1;
+
+
+ return (undef);
+ }
+}
-=item SetPGPKey VALUE
+# }}}
+# {{{ sub CurrentUserCanModify
-Set PGPKey to VALUE.
-Returns (1, 'Status message') on success and (0, 'Error Message') on failure.
-(In the database, PGPKey will be stored as a text.)
+=head2 CurrentUserCanModify RIGHT
+If the user has rights for this object, either because
+he has 'AdminUsers' or (if he\'s trying to edit himself and the right isn\'t an
+admin right) 'ModifySelf', return 1. otherwise, return undef.
=cut
+sub CurrentUserCanModify {
+ my $self = shift;
+ my $right = shift;
+
+ if ($self->CurrentUserHasRight('AdminUsers')) {
+ return (1);
+ }
+ #If the field is marked as an "administrators only" field,
+ # don\'t let the user touch it.
+ elsif ($self->_Accessible($right, 'admin')) {
+ return(undef);
+ }
+
+ #If the current user is trying to modify themselves
+ elsif ( ($self->id == $self->CurrentUser->id) and
+ ($self->CurrentUserHasRight('ModifySelf'))) {
+ return(1);
+ }
+
+ #If we don\'t have a good reason to grant them rights to modify
+ # by now, they lose
+ else {
+ return(undef);
+ }
+
+}
-=item Creator
+# }}}
-Returns the current value of Creator.
-(In the database, Creator is stored as int(11).)
+# {{{ sub CurrentUserHasRight
+=head2 CurrentUserHasRight
+
+ Takes a single argument. returns 1 if $Self->CurrentUser
+ has the requested right. returns undef otherwise
=cut
+sub CurrentUserHasRight {
+ my $self = shift;
+ my $right = shift;
+
+ return ($self->CurrentUser->HasSystemRight($right));
+}
-=item Created
+# }}}
-Returns the current value of Created.
-(In the database, Created is stored as datetime.)
+# {{{ sub _Set
-=cut
+sub _Set {
+ my $self = shift;
+
+ my %args = (Field => undef,
+ Value => undef,
+ @_
+ );
+ # Nobody is allowed to futz with RT_System or Nobody unless they
+ # want to change an email address. For 2.2, neither should have an email address
-=item LastUpdatedBy
+ if ($self->Privileged == 2) {
+ return (0, "Can not modify system users");
+ }
+ unless ($self->CurrentUserCanModify($args{'Field'})) {
+ return (0, "Permission Denied");
+ }
-Returns the current value of LastUpdatedBy.
-(In the database, LastUpdatedBy is stored as int(11).)
+
+ #Set the new value
+ my ($ret, $msg)=$self->SUPER::_Set(Field => $args{'Field'},
+ Value=> $args{'Value'});
+
+ return ($ret, $msg);
+}
-=cut
-
+# }}}
-=item LastUpdated
+# {{{ sub _Value
-Returns the current value of LastUpdated.
-(In the database, LastUpdated is stored as datetime.)
+=head2 _Value
+Takes the name of a table column.
+Returns its value as a string, if the user passes an ACL check
=cut
+sub _Value {
+
+ my $self = shift;
+ my $field = shift;
+
+ #If the current user doesn't have ACLs, don't let em at it.
+
+ my @PublicFields = qw( Name EmailAddress Organization Disabled
+ RealName NickName Gecos ExternalAuthId
+ AuthSystem ExternalContactInfoId
+ ContactInfoSystem );
+
+ #if the field is public, return it.
+ if ($self->_Accessible($field, 'public')) {
+ return($self->SUPER::_Value($field));
+
+ }
+ #If the user wants to see their own values, let them
+ elsif ($self->CurrentUser->Id == $self->Id) {
+ return($self->SUPER::_Value($field));
+ }
+ #If the user has the admin users right, return the field
+ elsif ($self->CurrentUserHasRight('AdminUsers')) {
+ return($self->SUPER::_Value($field));
+ }
+ else {
+ return(undef);
+ }
+
+}
-sub _ClassAccessible {
- {
-
- id =>
- {read => 1, type => 'int(11)', default => ''},
- Name =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Password =>
- {read => 1, write => 1, type => 'varchar(40)', default => ''},
- Comments =>
- {read => 1, write => 1, type => 'blob', default => ''},
- Signature =>
- {read => 1, write => 1, type => 'blob', default => ''},
- EmailAddress =>
- {read => 1, write => 1, type => 'varchar(120)', default => ''},
- FreeformContactInfo =>
- {read => 1, write => 1, type => 'blob', default => ''},
- Organization =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- RealName =>
- {read => 1, write => 1, type => 'varchar(120)', default => ''},
- NickName =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- Lang =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- EmailEncoding =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- WebEncoding =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- ExternalContactInfoId =>
- {read => 1, write => 1, type => 'varchar(100)', default => ''},
- ContactInfoSystem =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- ExternalAuthId =>
- {read => 1, write => 1, type => 'varchar(100)', default => ''},
- AuthSystem =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- Gecos =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- HomePhone =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- WorkPhone =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- MobilePhone =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- PagerPhone =>
- {read => 1, write => 1, type => 'varchar(30)', default => ''},
- Address1 =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- Address2 =>
- {read => 1, write => 1, type => 'varchar(200)', default => ''},
- City =>
- {read => 1, write => 1, type => 'varchar(100)', default => ''},
- State =>
- {read => 1, write => 1, type => 'varchar(100)', default => ''},
- Zip =>
- {read => 1, write => 1, type => 'varchar(16)', default => ''},
- Country =>
- {read => 1, write => 1, type => 'varchar(50)', default => ''},
- Timezone =>
- {read => 1, write => 1, type => 'varchar(50)', default => ''},
- PGPKey =>
- {read => 1, write => 1, type => 'text', default => ''},
- Creator =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- Created =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
- LastUpdatedBy =>
- {read => 1, auto => 1, type => 'int(11)', default => '0'},
- LastUpdated =>
- {read => 1, auto => 1, type => 'datetime', default => ''},
-
- }
-};
-
-
- eval "require RT::User_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/User_Overlay.pm}) {
- die $@;
- };
-
- eval "require RT::User_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/User_Vendor.pm}) {
- die $@;
- };
-
- eval "require RT::User_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/User_Local.pm}) {
- die $@;
- };
-
-
-
-
-=head1 SEE ALSO
-
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
-
-These overlay files can contain new subs or subs to replace existing subs in this module.
-
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
-
- no warnings qw(redefine);
-
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
-
-RT::User_Overlay, RT::User_Vendor, RT::User_Local
-
-=cut
-
+# }}}
+# }}}
1;
+
diff --git a/rt/lib/RT/Users.pm b/rt/lib/RT/Users.pm
index d58f69653..f4a97268c 100755
--- a/rt/lib/RT/Users.pm
+++ b/rt/lib/RT/Users.pm
@@ -1,115 +1,281 @@
-# BEGIN LICENSE BLOCK
-#
-# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
-#
-# (Except where explictly superceded by other copyright notices)
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# Unless otherwise specified, all modifications, corrections or
-# extensions to this work which alter its source code become the
-# property of Best Practical Solutions, LLC when submitted for
-# inclusion in the work.
-#
-#
-# END LICENSE BLOCK
-# Autogenerated by DBIx::SearchBuilder factory (by <jesse@bestpractical.com>)
-# WARNING: THIS FILE IS AUTOGENERATED. ALL CHANGES TO THIS FILE WILL BE LOST.
-#
-# !! DO NOT EDIT THIS FILE !!
-#
-
-use strict;
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Users.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-1999 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
=head1 NAME
- RT::Users -- Class Description
-
+ RT::Users - Collection of RT::User objects
+
=head1 SYNOPSIS
- use RT::Users
+ use RT::Users;
+
=head1 DESCRIPTION
=head1 METHODS
+=begin testing
+
+ok(require RT::TestHarness);
+ok(require RT::Users);
+
+=end testing
+
=cut
package RT::Users;
+use RT::EasySearch;
+@ISA = qw(RT::EasySearch);
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+ $self->{'table'} = "Users";
+ $self->{'primary_key'} = "id";
+
+ # By default, order by name
+ $self->OrderBy( ALIAS => 'main',
+ FIELD => 'Name',
+ ORDER => 'ASC');
+
+ return ($self->SUPER::_Init(@_));
+
+}
+# }}}
+
+# {{{ sub _DoSearch
+
+=head2 _DoSearch
+
+ A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that _Disabled rows never get seen unless
+we're explicitly trying to see them.
+
+=cut
+
+sub _DoSearch {
+ my $self = shift;
+
+ #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
+ unless($self->{'find_disabled_rows'}) {
+ $self->LimitToEnabled();
+ }
+
+ return($self->SUPER::_DoSearch(@_));
+
+}
+
+# }}}
+
+# {{{ sub NewItem
+
+sub NewItem {
+ my $self = shift;
-use RT::SearchBuilder;
-use RT::User;
+ use RT::User;
+ my $item = new RT::User($self->CurrentUser);
+ return($item);
+}
+# }}}
+
+# {{{ LimitToEmail
+=head2 LimitToEmail
-use vars qw( @ISA );
-@ISA= qw(RT::SearchBuilder);
+Takes one argument. an email address. limits the returned set to
+that email address
+=cut
-sub _Init {
+sub LimitToEmail {
my $self = shift;
- $self->{'table'} = 'Users';
- $self->{'primary_key'} = 'id';
+ my $addr = shift;
+ $self->Limit(FIELD => 'EmailAddress', VALUE => "$addr");
+}
+
+# }}}
+
+# {{{ MemberOfGroup
+
+=head2 MemberOfGroup
+
+takes one argument, a group id number. Limits the returned set
+to members of a given group
+
+=cut
+
+sub MemberOfGroup {
+ my $self = shift;
+ my $group = shift;
+
+ return ("No group specified") if (!defined $group);
+
+ my $groupalias = $self->NewAlias('GroupMembers');
+
+ $self->Join( ALIAS1 => 'main', FIELD1 => 'id',
+ ALIAS2 => "$groupalias", FIELD2 => 'Name');
+
+ $self->Limit (ALIAS => "$groupalias",
+ FIELD => 'GroupId',
+ VALUE => "$group",
+ OPERATOR => "="
+ );
+}
+
+# }}}
+
+# {{{ LimitToPrivileged
+
+=head2 LimitToPrivileged
+
+Limits to users who can be made members of ACLs and groups
+=cut
- return ( $self->SUPER::_Init(@_) );
+sub LimitToPrivileged {
+ my $self = shift;
+ $self->Limit( FIELD => 'Privileged',
+ OPERATOR => '=',
+ VALUE => '1');
}
+# }}}
+
+
+
+# {{{ LimitToSystem
-=item NewItem
+=head2 LimitToSystem
-Returns an empty new RT::User item
+Limits to users who can be granted rights, but who should
+never have their rights modified by a user or be made members of groups.
=cut
-sub NewItem {
+sub LimitToSystem {
my $self = shift;
- return(RT::User->new($self->CurrentUser));
+ $self->Limit( FIELD => 'Privileged',
+ OPERATOR => '=',
+ VALUE => '2');
}
- eval "require RT::Users_Overlay";
- if ($@ && $@ !~ qr{^Can't locate RT/Users_Overlay.pm}) {
- die $@;
- };
+# }}}
+
+# {{{ HasQueueRight
+
+=head2 HasQueueRight
+
+Takes a queue id as its first argument. Queue Id "0" is treated by RT as "applies to all queues"
+Takes a specific right as an optional second argument
+
+Limits the returned set to users who have rights in the queue specified, personally. If the optional second argument is supplied, limits to users who have been explicitly granted that right.
+
+
+
+This should not be used as an ACL check, but only for obtaining lists of
+users with explicit rights in a given queue.
+
+=cut
+
+sub HasQueueRight {
+ my $self = shift;
+ my $queue = shift;
+ my $right;
+
+ $right = shift if (@_);
+
- eval "require RT::Users_Vendor";
- if ($@ && $@ !~ qr{^Can't locate RT/Users_Vendor.pm}) {
- die $@;
- };
+ my $acl_alias = $self->NewAlias('ACL');
+ $self->Join( ALIAS1 => 'main', FIELD1 => 'id',
+ ALIAS2 => $acl_alias, FIELD2 => 'PrincipalId');
+ $self->Limit (ALIAS => $acl_alias,
+ FIELD => 'PrincipalType',
+ OPERATOR => '=',
+ VALUE => 'User');
- eval "require RT::Users_Local";
- if ($@ && $@ !~ qr{^Can't locate RT/Users_Local.pm}) {
- die $@;
- };
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightAppliesTo',
+ OPERATOR => '=',
+ VALUE => "$queue");
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightScope',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => 'Queue');
-=head1 SEE ALSO
-This class allows "overlay" methods to be placed
-into the following files _Overlay is for a System overlay by the original author,
-_Vendor is for 3rd-party vendor add-ons, while _Local is for site-local customizations.
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightScope',
+ OPERATOR => '=',
+ ENTRYAGGREGATOR => 'OR',
+ VALUE => 'Ticket');
-These overlay files can contain new subs or subs to replace existing subs in this module.
-If you'll be working with perl 5.6.0 or greater, each of these files should begin with the line
+ #TODO: is this being initialized properly if the right isn't there?
+ if (defined ($right)) {
+
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightName',
+ OPERATOR => '=',
+ VALUE => "$right");
+
+
+ };
- no warnings qw(redefine);
-so that perl does not kick and scream when you redefine a subroutine or variable in your overlay.
+}
+
+
+
+# }}}
+
+# {{{ HasSystemRight
-RT::Users_Overlay, RT::Users_Vendor, RT::Users_Local
+=head2 HasSystemRight
+
+Takes one optional argument:
+ The name of a System level right.
+
+Limits the returned set to users who have been granted system rights, personally. If the optional argument is passed in, limits to users who have been granted the explicit right listed. Please see the note attached to LimitToQueueRights
=cut
+sub HasSystemRight {
+ my $self = shift;
+ my $right = shift if (@_);
+ my $acl_alias = $self->NewAlias('ACL');
+
+
+ $self->Join( ALIAS1 => 'main', FIELD1 => 'id',
+ ALIAS2 => $acl_alias, FIELD2 => 'PrincipalId');
+ $self->Limit (ALIAS => $acl_alias,
+ FIELD => 'PrincipalType',
+ OPERATOR => '=',
+ VALUE => 'User');
+
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightScope',
+ OPERATOR => '=',
+ VALUE => 'System');
+
+
+ #TODO: is this being initialized properly if the right isn't there?
+ if (defined ($right)) {
+ $self->Limit(ALIAS => $acl_alias,
+ FIELD => 'RightName',
+ OPERATOR => '=',
+ VALUE => "$right");
+
+ }
+
+
+}
+
+# }}}
1;
+
diff --git a/rt/lib/RT/Watcher.pm b/rt/lib/RT/Watcher.pm
new file mode 100755
index 000000000..c7c6100cf
--- /dev/null
+++ b/rt/lib/RT/Watcher.pm
@@ -0,0 +1,313 @@
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/Watcher.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2001 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
+=head1 NAME
+
+ RT::Watcher - RT Watcher object
+
+=head1 SYNOPSIS
+
+ use RT::Watcher;
+
+
+=head1 DESCRIPTION
+
+This module should never be called directly by client code. it\'s an internal module which
+should only be accessed through exported APIs in Ticket, Queue and other similar objects.
+
+=head1 METHODS
+
+=begin testing
+
+ok(require RT::TestHarness);
+ok(require RT::Watcher);
+
+=end testing
+
+=cut
+
+package RT::Watcher;
+use RT::Record;
+@ISA= qw(RT::Record);
+
+
+# {{{ sub _Init
+
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "Watchers";
+ return ($self->SUPER::_Init(@_));
+
+}
+# }}}
+
+# {{{ sub Create
+
+=head2 Create PARAMHASH
+
+Create a new watcher object with the following Attributes:
+
+Scope: Ticket or Queue
+Value: Ticket or queue id
+Type: Requestor, Cc or AdminCc. Requestor is not supported for a scope of \'Queue\'
+Email: The email address of the watcher. If the email address maps to an RT User, this is resolved
+to an Owner object instead.
+Owner: The RT user id of the \'owner\' of this watcher object.
+
+=cut
+
+sub Create {
+ my $self = shift;
+ my %args = (
+ Owner => undef,
+ Email => undef,
+ Value => undef,
+ Scope => undef,
+ Type => undef,
+ Quiet => 0,
+ @_ # get the real argumentlist
+ );
+
+ #Do we have someone this applies to?
+ unless (($args{'Owner'} =~ /^(\d+)$/) || ($args{'Email'} =~ /\@/)) {
+ return (0, "No user or email address specified");
+ }
+
+ #if we only have an email address, try to resolve it to an owner
+ if ($args{'Owner'} == 0) {
+ my $User = new RT::User($RT::SystemUser);
+ $User->LoadByEmail($args{'Email'});
+ if ($User->id) {
+ $args{'Owner'} = $User->id;
+ delete $args{'Email'};
+ }
+ }
+
+
+ if ($args{'Type'} eq "Requestor" and $args{'Owner'} == 0) {
+ # Requestors *MUST* have an account
+
+ my $Address = RT::CanonicalizeAddress($args{'Email'});
+
+ my $NewUser = RT::User->new($RT::SystemUser);
+ my ($Val, $Message) =
+ $NewUser->Create(Name => $Address,
+ EmailAddress => $Address,
+ RealName => $Address,
+ Password => undef,
+ Privileged => 0,
+ Comments => 'Autocreated on ticket submission'
+ );
+ return (0, "Could not create watcher for requestor")
+ unless $Val;
+ if ($NewUser->id) {
+ $args{'Owner'} = $NewUser->id;
+ delete $args{'Email'};
+ }
+ }
+
+
+
+
+ #Make sure we\'ve got a valid type
+ #TODO --- move this to ValidateType
+ return (0, "Invalid Type")
+ unless ($args{'Type'} =~ /^(Requestor|Cc|AdminCc)$/i);
+
+ my $id = $self->SUPER::Create(%args);
+ if ($id) {
+ return (1,"Interest noted");
+ }
+ else {
+ return (0, "Error adding watcher");
+ }
+}
+# }}}
+
+# {{{ sub Load
+
+=head2 Load ID
+
+ Loads a watcher by the primary key of the watchers table ($Watcher->id)
+
+=cut
+
+sub Load {
+ my $self = shift;
+ my $identifier = shift;
+
+ if ($identifier !~ /\D/) {
+ $self->SUPER::LoadById($identifier);
+ }
+ else {
+ return (0, "That's not a numerical id");
+ }
+}
+
+# }}}
+
+# {{{ sub LoadByValue
+
+=head2 LoadByValue PARAMHASH
+
+LoadByValue takes a parameter hash with the following attributes:
+
+ Email, Owner, Scope, Type, Value
+
+The same rules enforced at create are enforced by Load.
+
+Returns a tuple of (retval, msg). Retval is 1 on success and 0 on failure.
+msg describes what happened in a human readable form.
+
+=cut
+
+sub LoadByValue {
+ my $self = shift;
+ my %args = ( Email => undef,
+ Owner => undef,
+ Scope => undef,
+ Type => undef,
+ Value => undef,
+ @_);
+
+ #TODO: all this code is being copied from Create. that\'s silly
+
+ #Do we have someone this applies to?
+ unless (($args{'Owner'} =~ /^(\d*)$/) || ($args{'Email'} =~ /\@/)) {
+ return (0, "No user or email address specified");
+ }
+
+ #if we only have an email address, try to resolve it to an owner
+ unless ($args{'Owner'}) {
+ my $User = new RT::User($RT::SystemUser);
+ $User->LoadByEmail($args{'Email'});
+ if ($User->id > 0) {
+ $args{'Owner'} = $User->id;
+ delete $args{'Email'};
+ }
+ }
+
+ if ((defined ($args{'Type'})) and
+ ($args{'Type'} !~ /^(Requestor|Cc|AdminCc)$/i)) {
+ return (0, "Invalid Type");
+ }
+ if ($args{'Owner'}) {
+ $self->LoadByCols( Type => $args{'Type'},
+ Value => $args{'Value'},
+ Owner => $args{'Owner'},
+ Scope => $args{'Scope'},
+ );
+ }
+ else {
+ $self->LoadByCols( Type => $args{'Type'},
+ Email => $args{'Email'},
+ Value => $args{'Value'},
+ Scope => $args{'Scope'},
+ );
+ }
+ unless ($self->Id) {
+ return(0, "Couldn\'t find that watcher");
+ }
+ return (1, "Watcher loaded");
+}
+
+# }}}
+
+# {{{ sub OwnerObj
+
+=head2 OwnerObj
+
+Return an RT Owner Object for this Watcher, if we have one
+
+=cut
+
+sub OwnerObj {
+ my $self = shift;
+ if (!defined $self->{'OwnerObj'}) {
+ require RT::User;
+ $self->{'OwnerObj'} = RT::User->new($self->CurrentUser);
+ if ($self->Owner) {
+ $self->{'OwnerObj'}->Load($self->Owner);
+ } else {
+ return $RT::Nobody->UserObj;
+ }
+ }
+ return ($self->{'OwnerObj'});
+}
+# }}}
+
+# {{{ sub Email
+
+=head2 Email
+
+This custom data accessor does the right thing and returns
+the 'Email' attribute of this Watcher object. If that's undefined,
+it returns the 'EmailAddress' attribute of its 'Owner' object, which is
+an RT::User object.
+
+=cut
+
+sub Email {
+ my $self = shift;
+
+ # IF Email is defined, return that. Otherwise, return the Owner's email address
+ if (defined($self->__Value('Email'))) {
+ return ($self->__Value('Email'));
+ }
+ elsif ($self->Owner) {
+ return ($self->OwnerObj->EmailAddress);
+ }
+ else {
+ return ("Data error");
+ }
+}
+# }}}
+
+# {{{ sub IsUser
+
+=head2 IsUser
+
+Returns true if this watcher object is tied to a user object. (IE it
+isn't sending to some other email address).
+Otherwise, returns undef
+
+=cut
+
+sub IsUser {
+ my $self = shift;
+ # if this watcher has an email address glued onto it,
+ # return undef
+
+ if (defined($self->__Value('Email'))) {
+ return undef;
+ }
+ else {
+ return 1;
+ }
+}
+
+# }}}
+
+# {{{ sub _Accessible
+sub _Accessible {
+ my $self = shift;
+ my %Cols = (
+ Email => 'read/write',
+ Scope => 'read/write',
+ Value => 'read/write',
+ Type => 'read/write',
+ Quiet => 'read/write',
+ Owner => 'read/write',
+ Creator => 'read/auto',
+ Created => 'read/auto',
+ LastUpdatedBy => 'read/auto',
+ LastUpdated => 'read/auto'
+ );
+ return($self->SUPER::_Accessible(@_, %Cols));
+}
+# }}}
+
+1;
+
diff --git a/rt/lib/RT/Watchers.pm b/rt/lib/RT/Watchers.pm
new file mode 100755
index 000000000..c55adda3f
--- /dev/null
+++ b/rt/lib/RT/Watchers.pm
@@ -0,0 +1,226 @@
+# $Header: /home/cvs/cvsroot/freeside/rt/lib/RT/Attic/Watchers.pm,v 1.1 2002-08-12 06:17:07 ivan Exp $
+# (c) 1996-2000 Jesse Vincent <jesse@fsck.com>
+# This software is redistributable under the terms of the GNU GPL
+
+=head1 NAME
+
+ RT::Watchers - Collection of RT Watcher objects
+
+=head1 SYNOPSIS
+
+ use RT::Watchers;
+ my $watchers = new RT::Watchers($CurrentUser);
+ while (my $watcher = $watchers->Next()) {
+ print $watcher->Id . "is a watcher";
+ }
+
+=head1 DESCRIPTION
+
+This module should never be called directly by client code. it's an internal module which
+should only be accessed through exported APIs in Ticket, Queue and other similar objects.
+
+
+=head1 METHODS
+
+=begin testing
+
+ok(require RT::TestHarness);
+ok(require RT::Watchers);
+
+=end testing
+
+=cut
+
+package RT::Watchers;
+
+use strict;
+use vars qw( @ISA );
+
+
+require RT::EasySearch;
+require RT::Watcher;
+@ISA= qw(RT::EasySearch);
+
+
+# {{{ sub _Init
+sub _Init {
+ my $self = shift;
+
+ $self->{'table'} = "Watchers";
+ $self->{'primary_key'} = "id";
+ return($self->SUPER::_Init(@_));
+}
+# }}}
+
+# {{{ sub Limit
+
+=head2 Limit
+
+ A wrapper around RT::EasySearch::Limit which sets
+the default entry aggregator to 'AND'
+
+=cut
+
+sub Limit {
+ my $self = shift;
+ my %args = ( ENTRYAGGREGATOR => 'AND',
+ @_);
+
+ $self->SUPER::Limit(%args);
+}
+# }}}
+
+# {{{ sub LimitToTicket
+
+=head2 LimitToTicket
+
+Takes a single arg which is a ticket id
+Limits to watchers of that ticket
+
+=cut
+
+sub LimitToTicket {
+ my $self = shift;
+ my $ticket = shift;
+ $self->Limit( ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Value',
+ VALUE => $ticket);
+ $self->Limit (ENTRYAGGREGATOR => 'AND',
+ FIELD => 'Scope',
+ VALUE => 'Ticket');
+}
+# }}}
+
+# {{{ sub LimitToQueue
+
+=head2 LimitToQueue
+
+Takes a single arg, which is a queue id
+Limits to watchers of that queue.
+
+=cut
+
+sub LimitToQueue {
+ my $self = shift;
+ my $queue = shift;
+ $self->Limit (ENTRYAGGREGATOR => 'OR',
+ FIELD => 'Value',
+ VALUE => $queue);
+ $self->Limit (ENTRYAGGREGATOR => 'AND',
+ FIELD => 'Scope',
+ VALUE => 'Queue');
+}
+# }}}
+
+# {{{ sub LimitToType
+
+=head2 LimitToType
+
+Takes a single string as its argument. That string is a watcher type
+which is one of 'Requestor', 'Cc' or 'AdminCc'
+Limits to watchers of that type
+
+=cut
+
+
+sub LimitToType {
+ my $self = shift;
+ my $type = shift;
+ $self->Limit(FIELD => 'Type',
+ VALUE => "$type");
+}
+# }}}
+
+# {{{ sub LimitToRequestors
+
+=head2 LimitToRequestors
+
+Limits to watchers of type 'Requestor'
+
+=cut
+
+sub LimitToRequestors {
+ my $self = shift;
+ $self->LimitToType("Requestor");
+}
+# }}}
+
+# {{{ sub LimitToCc
+
+=head2 LimitToCc
+
+Limits to watchers of type 'Cc'
+
+=cut
+
+sub LimitToCc {
+ my $self = shift;
+ $self->LimitToType("Cc");
+}
+# }}}
+
+# {{{ sub LimitToAdminCc
+
+=head2 LimitToAdminCc
+
+Limits to watchers of type AdminCc
+
+=cut
+
+sub LimitToAdminCc {
+ my $self = shift;
+ $self->LimitToType("AdminCc");
+}
+# }}}
+
+# {{{ sub Emails
+
+=head2 Emails
+
+# Return a (reference to a) list of emails
+
+=cut
+
+sub Emails {
+ my $self = shift;
+ my @list; # List is a list of watcher email addresses
+
+ # $watcher is an RT::Watcher object
+ while (my $watcher=$self->Next()) {
+ push(@list, $watcher->Email);
+ }
+ return \@list;
+}
+# }}}
+
+# {{{ sub EmailsAsString
+
+=head2 EmailsAsString
+
+# Returns the RT::Watchers->Emails as a comma seperated string
+
+=cut
+
+sub EmailsAsString {
+ my $self = shift;
+ return(join(", ",@{$self->Emails}));
+}
+# }}}
+
+# {{{ sub NewItem
+
+
+
+sub NewItem {
+ my $self = shift;
+
+ use RT::Watcher;
+ my $item = new RT::Watcher($self->CurrentUser);
+ return($item);
+}
+# }}}
+1;
+
+
+
+
diff --git a/rt/lib/test.pl b/rt/lib/test.pl
new file mode 100644
index 000000000..f0da5df27
--- /dev/null
+++ b/rt/lib/test.pl
@@ -0,0 +1,52 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use RT;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
+use RT::Record;
+use RT::EasySearch;
+use RT::Handle;
+use RT::Ticket;
+use RT::Tickets;
+use RT::ACE;
+use RT::ACL;
+use RT::Watcher;
+use RT::Watchers;
+use RT::Scrip;
+use RT::Scrips;
+use RT::ScripAction;
+use RT::ScripCondition;
+use RT::ScripActions;
+use RT::ScripConditions;
+use RT::Transaction;
+use RT::Transactions;
+use RT::Group;
+use RT::GroupMembers;
+use RT::User;
+use RT::Users;
+use RT::CurrentUser;
+use RT::Attachment;
+use RT::Attachments;
+use RT::Keyword;
+use RT::Keywords;
+use RT::KeywordSelect;
+use RT::KeywordSelects;
+use RT::ObjectKeyword;
+use RT::ObjectKeywords;
+use RT::Date;
+
diff --git a/rt/tools/cpan2rpm b/rt/tools/cpan2rpm
new file mode 100644
index 000000000..9b54cb912
--- /dev/null
+++ b/rt/tools/cpan2rpm
@@ -0,0 +1,299 @@
+#!/usr/bin/perl -w
+
+
+# Take a perl tarball and make a specfile for it. Now with bundles.
+#
+# Copyright 2000,2001 Simon Wilkinson. All rights reserved.
+#
+# 10/18/2001 - <jesse@bestpractical.com>
+# Added resolution of prereq_pm modules
+#
+# This program is free software; you can redistribute it
+# and/or modify it under the same terms as Perl itself.
+#
+
+use strict;
+
+use CPAN;
+use POSIX;
+use Sys::Hostname;
+use File::Basename;
+use Getopt::Long;
+
+use vars qw ($DEBUG $ARCH $builddir $seen @report);
+
+$ARCH = 'i386';
+
+$DEBUG = 0;
+# Icky globals
+
+my $release;
+my $package;
+
+$seen = {};
+
+
+sub usage
+{
+ print STDERR <<EOM;
+
+Usage: cpan2rpm [--release <release>] [--builddir <rpm build dir>] <Perl::Module>
+
+Where:
+<release> is the release number of the RPM you wish to produce
+<Perl::Module> is the name of the module to build
+EOM
+ exit(1);
+}
+
+
+my $ret=GetOptions("release" => \$release,
+ "builddir=s" => \$builddir);
+
+$package=$ARGV[0];
+usage() if !$package;
+$release=1 if !$release;
+
+
+$builddir=ExtractRpmMacro($ENV{HOME}."/.rpmmacros","_topdir") if !$builddir;
+$builddir=ExtractRpmMacro("/etc/rpm/macros","_topdir") if !$builddir;
+$builddir=getcwd() if !$builddir;
+
+die "Build directory $builddir doesn't look like an RPM build root\n"
+ if ((! -d "$builddir/SPECS") || (! -d "$builddir/SOURCES"));
+
+process($package,$release);
+
+print join("\n",@report)."\n";
+
+sub process {
+ my ($infile,$release)=@_;
+
+
+
+# Convert our installation list into an unbundled one
+ unbundle($infile);
+
+ print "Building $infile\n";
+
+ cpan2rpm($infile,$builddir,$release);
+
+}
+
+# Given a Module, try to split it into its required components - this
+# currently only handles Bundles, but could also be extended to deal with
+# prereqs as well.
+
+sub unbundle {
+ my ($item) = @_;
+
+ if ($item=~/Bundle::/) {
+ my $obj=CPAN::Shell->expand('Bundle',$item);
+
+ foreach my $kid ($obj->contains) {
+ process($kid,$release);
+ }
+ }
+}
+
+
+sub cpan2rpm($$$) {
+ my ($infile,$builddir,$release) = @_;
+
+ my $ret;
+
+ my $obj=CPAN::Shell->expand('Module',$infile);
+
+ print "CPAN tells us the following about $infile:\n",$obj->as_string if ($DEBUG);
+
+ $ret=fetch_source($obj,$builddir);
+ $ret=build_specfile($obj,$builddir,$release) if !$ret;
+
+ return $ret;
+}
+
+# FIXME: Some error handling in the function below wouldn't go amiss ...
+sub fetch_source {
+ my ($obj,$builddir)=@_;
+
+ # Minor Sanity checks
+ my $id=$obj->{ID};
+
+ return "Error: No file for $id\n"
+ if $obj->cpan_file eq "N/A";
+ return "Error: $id says 'Contact Author'\n"
+ if $obj->cpan_file =~ /^Contact Author/;
+ return "Error: $id is contained within Perl itself!\n"
+ if ($obj->cpan_file =~/perl-5\.\d?\.\d?\.tar\.gz/xo);
+
+ # We do this so we can take advantage of CPAN's object caching. This is
+ # pinched from the CPAN::Distribution::get method, which we can't use
+ # directly, as it untars the package as well - which we let RPM do.
+
+ my $dist = $CPAN::META->instance('CPAN::Distribution',$obj->cpan_file);
+
+
+ my($local_wanted) =
+ MM->catfile($CPAN::Config->{keep_source_where},
+ "authors",
+ "id",
+ split("/",$dist->{ID})
+ );
+
+ my $local_file = CPAN::FTP->localize("authors/id/$dist->{ID}", $local_wanted);
+
+ $dist->{localfile} = $local_file;
+
+ $dist->verifyMD5 if ($CPAN::META->has_inst('MD5'));
+
+
+ # Find all the prereqs for this distribution, then build em.
+ # TODO this should be somewhere else
+
+ $dist->make;
+ build_prereqs( $dist->prereq_pm());
+
+
+
+ my $infile=basename($obj->cpan_file);
+
+ File::Copy::copy($local_file,"$builddir/SOURCES/$infile");
+
+ return undef;
+}
+
+
+sub build_prereqs($) {
+ my ($prereqs) = @_;
+
+ foreach my $prereq (keys %{$prereqs}) {
+ process ($prereq, $release);
+ }
+}
+sub build_specfile($$$) {
+ my ($obj,$builddir,$release) = @_;
+
+ my $source=basename($obj->cpan_file);
+
+ # don't go through dependencies on something we've already dealt with
+ return() if ($seen->{$source});
+ $seen->{$source} = 1;
+
+my ($name,$version)=($source=~/(.*)-(.*)\.tar\.gz/);
+ return "Couldn't get a name for $source\n" if !$name;
+ return "Couldn't get a version for $source\n" if !$version;
+
+ my $summary="$name module for perl";
+ my $description=$obj->{description};
+ $description= $summary if !$description;
+
+ open(SPEC, ">$builddir/SPECS/perl-$name.spec")
+ or die "Couldn't open perl-$name.spec for writing.";
+ print SPEC <<EOF;
+
+Summary: $summary
+Name: perl-$name
+Version: $version
+Release: $release
+Copyright: distributable
+Group: Applications/CPAN
+Source0: $source
+Url: http://www.cpan.org
+BuildRoot: /var/tmp/perl-${name}-buildroot/
+Requires: perl
+
+%description
+This is a perl module, autogenerated by cpan2rpm. The original package's
+description was:
+
+$description
+
+%prep
+%setup -q -n $name-%{version}
+
+%build
+CFLAGS="\$RPM_OPT_FLAGS" perl Makefile.PL
+make
+
+%clean
+rm -rf \$RPM_BUILD_ROOT
+
+%install
+rm -rf \$RPM_BUILD_ROOT
+eval `perl '-V:installarchlib'`
+mkdir -p \$RPM_BUILD_ROOT/\$installarchlib
+make PREFIX=\$RPM_BUILD_ROOT/usr install
+/usr/lib/rpm/brp-compress
+find \$RPM_BUILD_ROOT/usr -type f -print | sed "s\@^\$RPM_BUILD_ROOT\@\@g" | grep -v perllocal.pod > $name-$version-filelist
+
+%files -f ${name}-${version}-filelist
+%defattr(-,root,root)
+
+%changelog
+EOF
+ print SPEC "* ",POSIX::strftime("%a %b %d %Y",localtime()), " ",$ENV{USER}," <",$ENV{USER},"\@",hostname(),">\n";
+ print SPEC "- Spec file automatically generated by cpan2rpm\n";
+
+ close(SPEC);
+
+ system("rpm -ba $builddir/SPECS/perl-$name.spec >/dev/null") == 0
+ or push (@report, "RPM of $source failed with : $!\n");
+
+ system("rpm -Uvh $builddir/RPMS/$ARCH/perl-$name-$version-$release.$ARCH.rpm") == 0
+ or warn "RPM of $source could not be installed: $!\n";
+
+ push (@report, "Built perl-$name-$version-$release.$ARCH.rpm");
+}
+
+sub ExtractRpmMacro {
+ my ($file,$macro) = @_;
+
+ my $handle=new IO::File;
+
+ if (!$handle->open($file)) {
+ return undef;
+ }
+
+ while(<$handle>) {
+ if (/\%$macro (.*)/) {
+ return $1;
+ }
+ }
+
+ return undef;
+}
+
+=head1 NAME
+
+cpan2rpm - fetch and convert CPAN packages to RPMs
+
+=head1 SYNOPSIS
+
+cpan2rpm --release <release> <package>
+
+=head1 DESCRIPTION
+
+cpan2rpm provides a quick way of creating RPM packages from perl modules
+published on CPAN. It interfaces with the perl CPAN module to fetch the
+file from the selected mirror, and then creates a spec file from the
+information in CPAN, and invokes RPM on that spec file.
+
+Files are created in the users RPM build root.
+
+=head1 OPTIONS
+
+=over 4
+
+=item release
+
+Sets the release number of the created RPMs.
+
+=back
+
+=head1 SEE ALSO
+
+rpm(1)
+
+=head1 AUTHOR
+
+Simon Wilkinson <sxw@sxw.org.uk>
diff --git a/rt/tools/initdb b/rt/tools/initdb
new file mode 100644
index 000000000..ffb1ae3b0
--- /dev/null
+++ b/rt/tools/initdb
@@ -0,0 +1,216 @@
+#!/usr/bin/perl -w
+# $Header: /home/cvs/cvsroot/freeside/rt/tools/Attic/initdb,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+use strict;
+use vars qw($PROMPT $SCHEMA_FILE $SCHEMA_DIR
+ $ACTION $DEBUG $DB_TYPE $DB_HOME
+ $DB_HOST $DB_PORT $DB_DBA $DB_DATABASE $DB_DBA_PASSWORD);
+
+use DBI;
+use DBIx::DataSource qw( create_database drop_database );
+
+
+$|=1; #unbuffer that output.
+
+$DEBUG=0;
+$PROMPT = 1; #by default, should at least *ask* before nuking databases
+$SCHEMA_DIR ="etc";
+$SCHEMA_FILE = "$SCHEMA_DIR/schema.pm"; #hmm
+
+($DB_TYPE, $DB_HOME, $DB_HOST, $DB_PORT, $DB_DBA, $DB_DATABASE, $ACTION) = @ARGV;
+
+
+if ($DEBUG) {
+ print_config_params();
+}
+my $dsn = "dbi:$DB_TYPE:";
+
+if (($DB_TYPE eq 'Pg') or ($DB_TYPE eq 'mysql')) {
+ $dsn .= "dbname=$DB_DATABASE";
+ if ($DB_HOST) {
+ $dsn .= ";host=$DB_HOST";
+ }
+ if ($DB_PORT) {
+ $dsn .= ";port=$DB_PORT";
+ }
+}
+elsif ($DB_TYPE eq 'Oracle') {
+ $dsn .= "$DB_DATABASE";
+}
+
+
+if ($ACTION eq 'create') {
+ unless ($DB_TYPE eq 'Oracle') {
+ print "Now creating a database for RT.\n";
+ prompt_for_dba_password();
+ create_db();
+ }
+}
+elsif ($ACTION eq 'drop' ) {
+ unless ($DB_TYPE eq 'Oracle') {
+ print "Now dropping the RT2 database.\n";
+ prompt_for_dba_password();
+ drop_db();
+ }
+}
+elsif ($ACTION eq 'insert' ) {
+ print "Now populating database schema.\n";
+ prompt_for_dba_password();
+ insert_schema();
+}
+elsif ($ACTION eq 'generate') {
+ prompt_for_dba_password();
+ generate_schema();
+}
+else {
+ print STDERR '$ACTION unspecified. Makefile error. It was '.$ACTION ;
+ exit(-1);
+}
+
+
+# {{{ sub prompt_for_dba_password
+
+sub prompt_for_dba_password {
+ print "Enter the $DB_TYPE password for $DB_DBA: ";
+
+ system "stty -echo";
+ $DB_DBA_PASSWORD = scalar(<STDIN>); #keep off commandline
+ system "stty echo";
+ chomp $DB_DBA_PASSWORD;
+
+}
+# }}}
+
+# {{{ sub print_config_params
+sub print_config_params {
+ print <<END;
+Database creation parameters:
+
+DB_TYPE = $DB_TYPE
+DB_HOME = $DB_HOME
+DB_HOST = $DB_HOST
+DB_DBA = $DB_DBA
+DB_DBA_PASSWORD = <hidden>
+DB_DATABASE = $DB_DATABASE
+END
+}
+# }}}
+
+# {{{ sub drop_db
+sub drop_db {
+
+ if ( $PROMPT ) {
+ print <<END;
+
+About to drop $DB_TYPE database $DB_DATABASE.
+WARNING: This will erase all data in $DB_DATABASE.
+If you have an existing RT 2.x installation, this will destroy all your data.
+i
+END
+ exit unless _yesno();
+
+ }
+
+
+ print "\nDropping $DB_TYPE database $DB_DATABASE.\n";
+ drop_database( $dsn, $DB_DBA, $DB_DBA_PASSWORD )
+ or warn $DBIx::DataSource::errstr;
+
+
+}
+# }}}
+
+# {{{ sub generate_schema
+sub generate_schema {
+ my @schema = generate_schema_from_hash();
+ print "Generating schema for $DB_TYPE...";
+
+ system('mv', "$SCHEMA_DIR/schema.$DB_TYPE", "$SCHEMA_DIR/schema.$DB_TYPE.bak")
+ if (-f "$SCHEMA_DIR/schema.$DB_TYPE");
+ open(SCHEMA, ">$SCHEMA_DIR/schema.$DB_TYPE");
+ foreach my $line (@schema) {
+ print SCHEMA "$line;\n";
+ }
+ close(SCHEMA);
+ print "done.\n";
+}
+# }}}
+
+# {{{ sub insert_schema
+sub insert_schema {
+ my (@schema);
+ print "\nCreating database schema.\n";
+
+ my $dbh = DBI->connect( $dsn, $DB_DBA, $DB_DBA_PASSWORD ) or die $DBI::errstr;
+
+ if ( -f "$SCHEMA_DIR/schema.$DB_TYPE") {
+ open (SCHEMA, "<$SCHEMA_DIR/schema.$DB_TYPE");
+ my $statement = "";
+ foreach my $line (<SCHEMA>) {
+ $statement .= $line;
+ if ($line =~ /;$/) {
+ $statement =~ s/;$//g;
+ push @schema, $statement;
+ $statement = "";
+ }
+ }
+ }
+
+ else {
+ @schema = generate_schema_from_hash();
+ }
+
+ foreach my $statement (@schema) {
+ print STDERR $statement if $DEBUG;
+ my $sth = $dbh->prepare($statement) or die $dbh->errstr;
+ unless ($sth->execute) {
+ print STDERR "Problem with statement:\n $statement\n";
+ die $sth->errstr;
+ }
+ }
+
+
+ $dbh->disconnect;
+ print "schema sucessfully inserted\n";
+
+}
+# }}}
+
+# {{{ sub generate_schema_from_hash
+sub generate_schema_from_hash {
+ my (@schema);
+
+ require DBIx::DBSchema;
+ my $schema_href = do "$SCHEMA_FILE" or die $@ || $!;
+ my $schema = DBIx::DBSchema->pretty_read($schema_href);
+
+
+ foreach my $statement ( $schema->sql($dsn, $DB_DBA, $DB_DBA_PASSWORD ) ) {
+ print STDERR $statement if $DEBUG;
+ chomp $statement;
+ push @schema, $statement;
+
+ }
+ return (@schema);
+
+}
+# }}}
+
+# {{{ sub create_db
+sub create_db {
+
+ print "\nCreating $DB_TYPE database $DB_DATABASE.\n";
+ create_database( $dsn, $DB_DBA, $DB_DBA_PASSWORD )
+ or die $DBIx::DataSource::errstr;
+
+}
+# }}}
+
+# {{{ sub _yesno
+sub _yesno {
+ print "Proceed [y/N]:";
+ my $x = scalar(<STDIN>);
+ $x =~ /^y/i;
+}
+
+# }}}
diff --git a/rt/tools/insertdata b/rt/tools/insertdata
new file mode 100755
index 000000000..b3e76e623
--- /dev/null
+++ b/rt/tools/insertdata
@@ -0,0 +1,618 @@
+#!/usr/bin/perl -w
+#
+# $Header: /home/cvs/cvsroot/freeside/rt/tools/Attic/insertdata,v 1.1 2002-08-12 06:17:08 ivan Exp $
+# RT is (c) 1996-2002 Jesse Vincent (jesse@bestpractical.com);
+
+package RT;
+use strict;
+use vars qw($VERSION $Handle $Nobody $SystemUser $item);
+
+use lib "!!RT_LIB_PATH!!";
+use lib "!!RT_ETC_PATH!!";
+
+#This drags in RT's config.pm
+use config;
+use Carp;
+
+use RT::Handle;
+use RT::User;
+use RT::CurrentUser;
+
+#
+my $LastVersion = shift || undef;
+my $LastMinorVersion = undef;
+
+#connect to the db
+$RT::Handle = new RT::Handle($RT::DatabaseType);
+$RT::Handle->Connect();
+
+#Put together a current user object so we can create a User object
+my $CurrentUser = new RT::CurrentUser();
+
+if ($LastVersion) {
+ if ( $LastVersion =~ /^2.0.(\d+)$/ ) {
+ $LastMinorVersion = $1;
+ print "Looking for new objects to add to the database"
+ . " since $LastVersion\n\n";
+ }
+ else {
+ print "This tool does not support upgrades from development releases "
+ . "or non 2.0.x versions";
+ }
+}
+else { # this is a virgin install
+ print "Checking for existing system user...";
+ my $test_user = RT::User->new($CurrentUser);
+ $test_user->Load('RT_System');
+ if ( $test_user->id ) {
+ print "Found!\n\nYou appear to have already run insertdata.\n"
+ . "Exiting, so as not to clobber your existing data. To ERASE your\n"
+ . "RT database and start over, type 'make dropdb; make install' in\n"
+ . "the RT installation directory. If you just meant to upgrade the\n"
+ . "content of your database, rerun this program as: \n",
+ " $0 <version>\n"
+ . "where <version> is the last RELEASED version of RT you installed\n"
+ . "for example, if you're upgrading from 2.0.4, you'd type:\n"
+ . " $0 2.0.4\n";
+ exit(-1);
+
+ }
+ else {
+ print "not found. This appears to be a new installation";
+ }
+
+ print "Creating system user...";
+ my $RT_System = new RT::User($CurrentUser);
+
+ my ( $val, $msg ) = $RT_System->_BootstrapCreate(
+ Name => 'RT_System',
+ RealName => 'The RT System itself',
+ Comments =>
+'Do not delete or modify this user. It is integral to RT\'s internal database structures',
+ Privileged => '2',
+ Creator => '1'
+ );
+
+ if ($val) {
+ print "done.\n";
+ }
+ else {
+ print "$msg\n";
+ exit(1);
+ }
+
+}
+
+#now that we bootstrapped that little bit, we can use the standard RT cli
+# helpers to do what we need
+
+use RT::Interface::CLI qw(CleanEnv LoadConfig DBConnect
+ GetCurrentUser GetMessageContent);
+
+#Clean out all the nasties from the environment
+CleanEnv();
+
+#Load etc/config.pm and drop privs
+LoadConfig();
+
+#Connect to the database and get RT::SystemUser and RT::Nobody loaded
+DBConnect();
+
+$CurrentUser->LoadByName('RT_System');
+
+# {{{ Users
+
+my @users;
+
+unless ($LastVersion) {
+ @users = (
+ {
+ Name => 'Nobody',
+ RealName => 'Nobody in particular',
+ Comments => 'Do not delete or modify this user. It is integral '
+ . 'to RT\'s internal data structures',
+ Privileged => '2',
+ },
+
+ {
+ Name => 'root',
+ Gecos => 'root',
+ RealName => 'Enoch Root',
+ Password => 'password',
+ EmailAddress => "root\@localhost",
+ Comments => 'SuperUser',
+ Privileged => '1',
+ }
+ );
+}
+
+# }}}
+
+# {{{ Groups
+
+my @groups;
+unless ($LastVersion) {
+ @groups = (
+ {
+ Name => 'Everyone',
+ Description => 'Pseudogroup for internal use',
+ Pseudo => '1',
+ },
+ {
+ Name => 'Owner',
+ Description => 'Pseudogroup for internal use',
+ Pseudo => '1',
+ },
+ {
+ Name => 'Requestor',
+ Description => 'Pseudogroup for internal use',
+ Pseudo => '1',
+ },
+ {
+ Name => 'Cc',
+ Description => 'Pseudogroup for internal use',
+ Pseudo => '1',
+ },
+ {
+ Name => 'AdminCc',
+ Description => 'Pseudogroup for internal use',
+ Pseudo => '1',
+ },
+ );
+}
+
+# }}}
+
+# {{{ ACL
+my @acl;
+
+unless ($LastVersion) {
+ @acl = ( #TODO: make this actually take the serial # granted to root.
+ {
+ PrincipalId => '1',
+ PrincipalType => 'User',
+ RightName => 'SuperUser',
+ RightScope => 'System',
+ RightAppliesTo => '0'
+ },
+ {
+ PrincipalId => '2',
+ PrincipalType => 'User',
+ RightName => 'SuperUser',
+ RightScope => 'System',
+ RightAppliesTo => '0'
+ },
+
+ {
+ PrincipalId => '3',
+ PrincipalType => 'User',
+ RightName => 'SuperUser',
+ RightScope => 'System',
+ RightAppliesTo => '0'
+ }
+
+ );
+}
+
+# }}}
+
+# {{{ Queues
+
+my @queues;
+unless ($LastVersion) {
+ @queues = (
+ {
+ Name => 'general',
+ Description => 'The default queue',
+ CorrespondAddress => "rt\@localhost",
+ CommentAddress => "rt-comment\@localhost"
+ }
+ );
+}
+
+# }}}
+
+# {{{ ScripActions
+
+my @ScripActions;
+
+unless ($LastVersion) {
+ @ScripActions = (
+
+ {
+ Name => 'AutoreplyToRequestors',
+ Description =>
+'Always sends a message to the requestors independent of message sender',
+ ExecModule => 'Autoreply',
+ Argument => 'Requestor'
+ },
+ {
+ Name => 'NotifyRequestors',
+ Description => 'Sends a message to the requestors',
+ ExecModule => 'Notify',
+ Argument => 'Requestor'
+ },
+ {
+ Name => 'NotifyOwnerAsComment',
+ Description => 'Sends mail to the owner',
+ ExecModule => 'NotifyAsComment',
+ Argument => 'Owner'
+ },
+ {
+ Name => 'NotifyOwner',
+ Description => 'Sends mail to the owner',
+ ExecModule => 'Notify',
+ Argument => 'Owner'
+ },
+ {
+ Name => 'NotifyAdminCcsAsComment',
+ Description => 'Sends mail to the administrative Ccs as a comment',
+ ExecModule => 'NotifyAsComment',
+ Argument => 'AdminCc'
+ },
+ {
+ Name => 'NotifyAdminCcs',
+ Description => 'Sends mail to the administrative Ccs',
+ ExecModule => 'Notify',
+ Argument => 'AdminCc'
+ },
+
+ {
+ Name => 'NotifyRequestorsAndCcsAsComment',
+ Description => 'Send mail to requestors and Ccs as a comment',
+ ExecModule => 'NotifyAsComment',
+ Argument => 'Requestor,Cc'
+ },
+
+ {
+ Name => 'NotifyRequestorsAndCcs',
+ Description => 'Send mail to requestors and Ccs',
+ ExecModule => 'Notify',
+ Argument => 'Requestor,Cc'
+ },
+
+ {
+ Name => 'NotifyAllWatchersAsComment',
+ Description => 'Send mail to all watchers',
+ ExecModule => 'NotifyAsComment',
+ Argument => 'All'
+ },
+ {
+ Name => 'NotifyAllWatchers',
+ Description => 'Send mail to all watchers',
+ ExecModule => 'Notify',
+ Argument => 'All'
+ },
+ );
+}
+
+if ( $LastMinorVersion < 12 ) {
+ push (
+ @ScripActions,
+ {
+ Name => 'NotifyOtherRecipientsAsComment',
+ Description => 'Sends mail to explicitly listed Ccs and Bccs',
+ ExecModule => 'NotifyAsComment',
+ Argument => 'OtherRecipients'
+ },
+ {
+ Name => 'NotifyOtherRecipients',
+ Description => 'Sends mail to explicitly listed Ccs and Bccs',
+ ExecModule => 'Notify',
+ Argument => 'OtherRecipients'
+ },
+ );
+}
+
+# }}}
+
+# {{{ ScripConditions
+
+my @ScripConditions;
+unless ($LastVersion) {
+ @ScripConditions = (
+ {
+ Name => 'OnCreate',
+ Description => 'When a ticket is created',
+ ApplicableTransTypes => 'Create',
+ ExecModule => 'AnyTransaction',
+ },
+
+ {
+ Name => 'OnTransaction',
+ Description => 'When anything happens',
+ ApplicableTransTypes => 'Any',
+ ExecModule => 'AnyTransaction',
+ },
+ {
+
+ Name => 'OnCorrespond',
+ Description => 'Whenever correspondence comes in',
+ ApplicableTransTypes => 'Correspond',
+ ExecModule => 'AnyTransaction',
+ },
+
+ {
+
+ Name => 'OnComment',
+ Description => 'Whenever comments come in',
+ ApplicableTransTypes => 'Comment',
+ ExecModule => 'AnyTransaction'
+ },
+ {
+
+ Name => 'OnStatus',
+ Description => 'Whenever a ticket\'s status changes',
+ ApplicableTransTypes => 'Status',
+ ExecModule => 'AnyTransaction',
+
+ },
+ {
+ Name => 'OnResolve',
+ Description => 'Whenever a ticket is resolved.',
+ ApplicableTransTypes => 'Status',
+ ExecModule => 'StatusChange',
+ Argument => 'resolved'
+
+ },
+
+ );
+}
+
+# }}}
+
+# {{{ Templates
+my @templates;
+
+unless ($LastVersion) {
+ @templates = (
+ {
+ Queue => '0',
+ Name => 'Autoreply',
+ Description => 'Default Autoresponse Template',
+ Content => 'Subject: AutoReply: {$Ticket->Subject}
+
+
+Greetings,
+
+This message has been automatically generated in response to the
+creation of a trouble ticket regarding:
+ "{$Ticket->Subject()}",
+a summary of which appears below.
+
+There is no need to reply to this message right now. Your ticket has been
+assigned an ID of [{$rtname} #{$Ticket->id()}].
+
+Please include the string:
+
+ [{$rtname} #{$Ticket->id}]
+
+in the subject line of all future correspondence about this issue. To do so,
+you may reply to this message.
+
+ Thank you,
+ {$Ticket->QueueObj->CorrespondAddress()}
+
+-------------------------------------------------------------------------
+{$Transaction->Content()}
+'
+ },
+
+ {
+
+ # id => 2,
+ Queue => '0',
+ Name => 'Transaction',
+ Description => 'Default transaction template',
+ Content => '
+
+
+{$Transaction->CreatedAsString}: Request {$Ticket->id} was acted upon.
+Transaction: {$Transaction->Description}
+ Queue: {$Ticket->QueueObj->Name}
+ Subject: {$Transaction->Subject || $Ticket->Subject || "(No subject given)"}
+ Owner: {$Ticket->OwnerObj->Name}
+ Requestors: {$Ticket->Requestors->EmailsAsString()}
+ Status: {$Ticket->Status}
+ Ticket <URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
+-------------------------------------------------------------------------
+{$Transaction->Content()}'
+ },
+
+ {
+
+ Queue => '0',
+ Name => 'AdminCorrespondence',
+ Description => 'Default admin correspondence template',
+ Content => '
+
+
+<URL: {$RT::WebURL}Ticket/Display.html?id={$Ticket->id} >
+
+{$Transaction->Content()}'
+ },
+
+ {
+ Queue => '0',
+ Name => 'Correspondence',
+ Description => 'Default correspondence template',
+ Content => '
+
+{$Transaction->Content()}'
+ },
+
+ {
+ Queue => '0',
+ Name => 'AdminComment',
+ Description => 'Default admin comment template',
+ Content =>
+'Subject: [Comment] {my $s=($Transaction->Subject||$Ticket->Subject); $s =~ s/\\[Comment\\]//g; $comment =~ s/^Re//i; $s;}
+
+
+{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
+This is a comment. It is not sent to the Requestor(s):
+
+{$Transaction->Content()}
+'
+ },
+
+ {
+ Queue => '0',
+ Name => 'StatusChange',
+ Description => 'Ticket status changed',
+ Content => 'Subject: Status Changed to: {$Transaction->NewValue}
+
+
+{$RT::WebURL}Ticket/Display.html?id={$Ticket->id}
+
+{$Transaction->Content()}
+'
+ },
+
+ {
+
+ Queue => '0',
+ Name => 'Resolved',
+ Description => 'Ticket Resolved',
+ Content => 'Subject: Ticket Resolved
+
+According to our records, your request has been resolved. If you have any
+further questions or concerns, please respond to this message.
+'
+ }
+ );
+}
+
+# }}}
+
+# {{{ Scrips;
+
+my @scrips;
+unless ($LastVersion) {
+ @scrips = (
+ { Queue => 0,
+ ScripCondition => 'OnCreate',
+ ScripAction => 'AutoreplyToRequestors',
+ Template => 'Autoreply'
+ },
+ { Queue => 0,
+ ScripCondition => 'OnCreate',
+ ScripAction => 'NotifyAdminCcs',
+ Template => 'Transaction',
+ },
+ { Queue => 0,
+ ScripCondition => 'OnCorrespond',
+ ScripAction => 'NotifyAllWatchers',
+ Template => 'Correspondence',
+ },
+ { Queue => 0,
+ ScripCondition => 'OnComment',
+ ScripAction => 'NotifyAdminCcsAsComment',
+ Template => 'AdminComment',
+ },
+ )
+}
+if ( $LastMinorVersion < 12 ) {
+ push (
+ @scrips,
+ { Queue => 0,
+ ScripCondition => 'OnComment',
+ ScripAction => 'NotifyOtherRecipientsAsComment',
+ Template => 'Correspondence',
+ },
+ { Queue => 0,
+ ScripCondition => 'OnCorrespond',
+ ScripAction => 'NotifyOtherRecipients',
+ Template => 'Correspondence',
+ },
+ );
+}
+# }}}
+
+print "Creating ACL...";
+use RT::ACE;
+for $item (@acl) {
+ my $new_entry = new RT::ACE($CurrentUser);
+
+ #Using an internal function. this should never be used outside of the bootstrap script
+ my $return = $new_entry->_BootstrapRight(%$item);
+ print $return. ".";
+}
+print "done.\n";
+
+print "Creating users...";
+use RT::User;
+foreach $item (@users) {
+ my $new_entry = new RT::User($CurrentUser);
+ my ( $return, $msg ) = $new_entry->Create(%$item);
+ print "(Error: $msg)" unless ($return);
+ print $return. ".";
+}
+print "done.\n";
+
+print "Creating groups...";
+use RT::Group;
+foreach $item (@groups) {
+ my $new_entry = new RT::Group($CurrentUser);
+ my $return = $new_entry->Create(%$item);
+ print $return. ".";
+}
+print "done.\n";
+
+print "Creating queues...";
+use RT::Queue;
+for $item (@queues) {
+ my $new_entry = new RT::Queue($CurrentUser);
+ my ( $return, $msg ) = $new_entry->Create(%$item);
+ print "(Error: $msg)" unless ($return);
+ print $return. ".";
+}
+
+print "done.\n";
+print "Creating ScripActions...";
+
+use RT::ScripAction;
+for $item (@ScripActions) {
+ my $new_entry = new RT::ScripAction($CurrentUser);
+ my $return = $new_entry->Create(%$item);
+ print $return. ".";
+}
+
+print "done.\n";
+print "Creating ScripConditions...";
+
+use RT::ScripCondition;
+for $item (@ScripConditions) {
+ my $new_entry = new RT::ScripCondition($CurrentUser);
+ my $return = $new_entry->Create(%$item);
+ print $return. ".";
+}
+
+print "done.\n";
+
+print "Creating templates...";
+
+use RT::Template;
+for $item (@templates) {
+ my $new_entry = new RT::Template($CurrentUser);
+ my $return = $new_entry->Create(%$item);
+ print $return. ".";
+}
+print "done.\n";
+
+print "Creating Scrips...";
+
+use RT::Scrip;
+for $item (@scrips) {
+ my $new_entry = RT::Scrip->new($CurrentUser);
+ my ($return,$msg) = $new_entry->Create(%$item);
+ print "(Error: $msg)" unless ($return);
+ print $return.".";
+
+}
+print "done.\n";
+
+$RT::Handle->Disconnect();
+
+1;
+
diff --git a/rt/tools/testdeps b/rt/tools/testdeps
new file mode 100644
index 000000000..ddc338107
--- /dev/null
+++ b/rt/tools/testdeps
@@ -0,0 +1,115 @@
+#!/usr/bin/perl -w
+
+# $Header: /home/cvs/cvsroot/freeside/rt/tools/Attic/testdeps,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+# Copyright 2000 Jesse Vincent <jesse@fsck.com>
+# Distributed under the GNU General Public License
+#
+
+#
+# This is just a basic script that checks to make sure that all
+# the modules needed by RT before you can install it.
+#
+
+use strict;
+
+use vars qw($mode $dbd $module @modules);
+
+$mode = shift || print_help();
+$dbd = shift || print_help();
+
+@modules = qw(
+Digest::MD5
+Storable
+DBI 1.18
+DBIx::DataSource 0.02
+DBIx::SearchBuilder 0.48
+HTML::Entities
+MLDBM
+Net::Domain
+Net::SMTP
+Params::Validate 0.02
+HTML::Mason 1.02
+CGI::Cookie 1.20
+Apache::Cookie
+Apache::Session 1.53
+Date::Parse
+Date::Format
+MIME::Entity 5.108
+Mail::Mailer 1.20
+Getopt::Long 2.24
+Tie::IxHash
+Text::Wrapper
+Text::Template
+File::Spec 0.8
+Errno
+FreezeThaw
+File::Temp
+Log::Dispatch 1.6
+);
+
+
+if ($dbd =~ /mysql/i) {
+ push @modules, ('DBD::mysql','2.0416');
+}
+elsif ($dbd =~ /oracle/i) {
+ push @modules, ('DBD::Oracle','');
+}
+elsif ($dbd =~ /pg/i) {
+ push @modules, ('DBD::Pg','');
+}
+use CPAN;
+
+while ($module= shift @modules) {
+ my $version = "";
+ $version = " ". shift (@modules) . " " if ($modules[0] =~ /^([\d\.]*)$/);
+ print "Checking for $module$version";
+ eval "use $module$version" ;
+ if ($@) {
+ &resolve_dependency($module, $version)
+ }
+ else {
+ print "...found\n";
+ }
+}
+
+sub print_help {
+print <<EOF;
+
+$0 FLAG DBTYPE
+
+
+$0 is a tool for RT that will tell you if you've got all
+the modules RT depends on properly installed.
+
+Flags: (only one flag is valid for a given run)
+
+-quiet will check to see if we've got everything we need
+ and will exit with a return code of (1) if we don't.
+
+-warn will tell you what isn't properly installed
+
+-fix will use CPAN to magically make everything better
+
+DBTYPE is one of:
+ oracle, pg, mysql
+
+EOF
+
+exit(0);
+}
+
+sub resolve_dependency {
+ my $module = shift;
+ my $version = shift;
+ print "....$module$version not installed.";
+ if ($mode =~ /-f/) {
+ $module = "DBD::mysql::Install" if ($module =~ /DBD::mysql/);
+
+ print "Installing with CPAN...";
+ CPAN::install($module);
+ }
+ print "\n";
+ exit(1) if ($mode =~ /-q/);
+}
+
diff --git a/rt/webrt/Admin/Elements/CreateQueueCalled b/rt/webrt/Admin/Elements/CreateQueueCalled
new file mode 100755
index 000000000..aeed6e786
--- /dev/null
+++ b/rt/webrt/Admin/Elements/CreateQueueCalled
@@ -0,0 +1,3 @@
+<FORM METHOD=get ACTION="<% $RT::WebPath %>/Admin/Queues/Create.html">
+Create a queue called <INPUT NAME="Name" size=10><input type=submit>
+</form>
diff --git a/rt/webrt/Admin/Elements/CreateUserCalled b/rt/webrt/Admin/Elements/CreateUserCalled
new file mode 100755
index 000000000..7e4bb7554
--- /dev/null
+++ b/rt/webrt/Admin/Elements/CreateUserCalled
@@ -0,0 +1,3 @@
+<FORM METHOD=get ACTION="<%$RT::WebPath%>/Admin/Users/Create.html">
+New user called <INPUT NAME="Name" size=10><input type=submit value="Create">
+</form>
diff --git a/rt/webrt/Admin/Elements/EditUserComments b/rt/webrt/Admin/Elements/EditUserComments
new file mode 100755
index 000000000..1ac7e187f
--- /dev/null
+++ b/rt/webrt/Admin/Elements/EditUserComments
@@ -0,0 +1,9 @@
+<& /Elements/Header, Title => "Comments about $name" &>
+These comments aren't generally visible to the user:<br>
+<input type="hidden" name="id" value="<%$id%>">
+<TEXTAREA COLS=60 ROWS=15 WRAP=SOFT NAME="Comments"><% $UserObj->Comments %></TEXTAREA>
+</FORM>
+
+<%ARGS>
+$UserObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/GrantQueueRightsTo b/rt/webrt/Admin/Elements/GrantQueueRightsTo
new file mode 100755
index 000000000..3850a18f2
--- /dev/null
+++ b/rt/webrt/Admin/Elements/GrantQueueRightsTo
@@ -0,0 +1,30 @@
+<BR>
+
+% if ($msg) {
+<%$msg%>
+% } elsif ($Users) {
+<ul>
+% while (my $u = $Users->Next ) {
+<li> <%$u->Name%> (<%$u->RealName%>) <& SelectQueueRights, Name => "GrantTo".$u->id &>
+% }
+</ul>
+% }
+
+<%INIT>
+my ($msg, $Users);
+if (!$ARGS{'UserString'}) {
+$msg = "No users selected.";
+ }
+else {
+ $Users = new RT::Users($session{'CurrentUser'});
+ $Users->Limit(FIELD => $ARGS{'UserField'},
+ VALUE => $ARGS{'UserString'},
+ OPERATOR => $ARGS{'UserOp'});
+ }
+</%INIT>
+
+<%ARGS>
+$UserField => 'Name'
+$UserOp => '='
+$UserString => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/GroupTabs b/rt/webrt/Admin/Elements/GroupTabs
new file mode 100755
index 000000000..261bef1e2
--- /dev/null
+++ b/rt/webrt/Admin/Elements/GroupTabs
@@ -0,0 +1,18 @@
+<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Groups/' &>
+<hr>
+<%INIT>
+my $subtabs = {
+ Basics => { title => 'Basics',
+ path => "Admin/Groups/Modify.html?id=". $GroupObj->id
+ }
+ };
+
+unless ($GroupObj->Pseudo) {
+$subtabs->{'Members'} = { title => 'Members',
+ path => "Admin/Groups/Members.html?id=".$GroupObj->id };
+}
+</%INIT>
+
+<%ARGS>
+$GroupObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/Header b/rt/webrt/Admin/Elements/Header
new file mode 100755
index 000000000..95acdac7e
--- /dev/null
+++ b/rt/webrt/Admin/Elements/Header
@@ -0,0 +1,5 @@
+<& /Elements/Header, Title => $Title &>
+
+<%ARGS>
+$Title => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/ListGlobalKeywordSelects b/rt/webrt/Admin/Elements/ListGlobalKeywordSelects
new file mode 100644
index 000000000..b24d68989
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ListGlobalKeywordSelects
@@ -0,0 +1,15 @@
+% while (my $KeywordSelect = $KeywordSelects->Next()) {
+
+<%$KeywordSelect->Name %>:
+<% $KeywordSelect->Single ? 'Single' : 'Multiple' %>
+children of
+<% $KeywordSelect->KeywordObj->Path %>
+% if ($KeywordSelect->Depth) {
+ up to <%$KeywordSelect->Depth%> levels deep
+% }
+<BR>
+%}
+<%INIT>
+my $KeywordSelects = RT::KeywordSelects->new($session{'CurrentUser'});
+$KeywordSelects->LimitToGlobals();
+</%INIT>
diff --git a/rt/webrt/Admin/Elements/ListGlobalScrips b/rt/webrt/Admin/Elements/ListGlobalScrips
new file mode 100755
index 000000000..2f044bf52
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ListGlobalScrips
@@ -0,0 +1,10 @@
+% while (my $scrip = $Scrips->Next ) {
+<% $scrip->ConditionObj->Name %>
+<% $scrip->ActionObj->Name %>
+with template <% $scrip->TemplateObj->Name %>
+<BR>
+% }
+<%init>
+my $Scrips = new RT::Scrips ($session{'CurrentUser'});
+$Scrips->LimitToGlobal();
+</%INIT>
diff --git a/rt/webrt/Admin/Elements/ModifyKeyword b/rt/webrt/Admin/Elements/ModifyKeyword
new file mode 100644
index 000000000..4b01c3692
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ModifyKeyword
@@ -0,0 +1,95 @@
+<FORM METHOD="get" ACTION="<%$RT::WebPath%>/Admin/Keywords/Modify.html">
+[<%$title |n %>]<BR>
+
+<INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
+Keyword <INPUT NAME="Name" VALUE="<% $Keyword->Name %>"><BR>
+
+Parent <SELECT NAME="Parent">
+ <OPTION VALUE=""<% defined($Keyword->Parent) ? '' : ' SELECTED' %>>-</OPTION>
+%while ( $parent = $parents->Next ) {
+ <OPTION VALUE="<% $parent->id %>"<% defined($Keyword->Parent) && $parent->id == $Keyword->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
+%}
+</SELECT>
+
+
+Kids <FONT SIZE="-2">(separate by
+<INPUT TYPE="radio" NAME="delim" VALUE="n"<% $delim eq 'n' ? ' CHECKED' : '' %>>
+line or
+<INPUT TYPE="radio" NAME="delim" VALUE="s"<% $delim eq 's' ? ' CHECKED' : '' %>>
+whitespace)</FONT><BR>
+
+<TEXTAREA NAME="Kids" ROWS=4><% $kidstring %></TEXTAREA>
+<BR>
+
+<& /Elements/Submit, Label => $submit &>
+</FORM>
+
+<%INIT>
+
+my $Keyword = new RT::Keyword($session{CurrentUser});
+my ($title, $submit, %kids, $kid);
+
+if ( $Create ) {
+ $title = "Create a new Keyword";
+ $submit = "Create";
+ $id = "new";
+ %kids = ();
+ $Parent = ''; #silence
+} elsif ( $id eq 'new' ) {
+ $id = $Keyword->Create( Name => $Name, Parent => $Parent )
+ or Abort("can't create keyword Name=>$Name, Parent=>$Parent");
+} else {
+ $Keyword->Load($id) || Abort("Can't load keyword id $id");
+ #foreach my $field ( grep eval "defined(\$$_)", qw( Name Parent )) {
+ # eval "\$Keyword->Set(\$field=>\$$field); #sigh
+ #}
+ $Keyword->SetName($Name) if defined($Name);
+ $Keyword->SetParent($Parent) if defined($Parent);
+}
+
+$title = "Modify the Keyword <B>". $Keyword->Name. "</B>";
+$submit = "Modify";
+
+my $kids = new RT::Keywords($session{CurrentUser});
+$kids->Limit( FIELD => 'Parent', VALUE => $id, OPERATOR => '=' );
+$kids{$kid->Name} = $kid while $kid = $kids->Next;
+
+if ( defined($Kids) ) {
+ my %newkids;
+ if ( $delim eq 'n' ) {
+ %newkids = map { $_=>1 } split(/\n/, $Kids);
+ } elsif ( $delim eq 's' ) {
+ %newkids = map { $_=>1 } split(' ', $Kids);
+ } else {
+ Abort("'$delim' isn't a valid keyword delimiter.");
+ }
+ foreach ( grep { ! defined($newkids{$_}) } keys %kids ) {
+ $kids{$_}->Delete;
+ delete $kids{$_};
+ }
+ foreach ( grep { ! defined($kids{$_}) } keys %newkids ) {
+ $kids{$_} = new RT::Keyword($session{CurrentUser});
+ $kids{$_}->Create( Name => $_, Parent => $id )
+ or Abort("can't create keyword Name=>$_, Parent=>$id");
+ }
+
+}
+
+
+my $parent;
+my $parents = new RT::Keywords($session{CurrentUser});
+$parents->UnLimit;
+
+$delim = ( grep /\s/, keys %kids ) ? 'n' : 's';
+my $kidstring = join("\n", keys %kids);
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Create => undef
+$Name => undef
+$Parent => undef
+$Kids => undef
+$delim => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/ModifyKeywordSelect b/rt/webrt/Admin/Elements/ModifyKeywordSelect
new file mode 100644
index 000000000..470e62929
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ModifyKeywordSelect
@@ -0,0 +1,120 @@
+ <FORM NAME="ModifyKeywordSelect" METHOD=POST ACTION="<%$RT::WebPath%>/Admin/KeywordSelects/Modify.html">
+
+ [<%$title |n %>]
+ <BR>
+
+ <INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
+ Keyword
+ <SELECT NAME="Parent">
+
+%while ( $parent = $parents->Next ) {
+
+ <OPTION VALUE="<% $parent->id %>" <% defined($KeywordSelect->Parent) && $parent->id == $KeywordSelect->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
+
+% }
+
+ </SELECT>
+ <BR>
+ Object
+ <SELECT NAME="ObjectType">
+ <OPTION SELECTED>Ticket</OPTION>
+ </SELECT>
+ <BR>
+
+<SCRIPT>
+function addOption(text, value, defaultselected, selected) {
+ var option = new Option(text, value, defaultselected, selected )
+ var length = document.ModifyKeywordSelect.ObjectValue.length;
+ document.ModifyKeywordSelect.ObjectValue.options[length] = option
+}
+function ChangeObjectValue(what) {
+ Value = what.options[what.selectedIndex].value
+ if ( Value == "(none)" ) {
+ document.ModifyKeywordSelect.ObjectValue.options.length = 0
+ addOption("(n/a)", "", false, false)
+ }
+ if ( Value == "Queue" ) {
+ document.ModifyKeywordSelect.ObjectValue.options.length = 0
+%foreach $queue ( keys %queues ) {
+ addOption("<% $queues{$queue} %>", "<% $queue %>", false, <% $queue == $KeywordSelect->ObjectValue ? 'true' : 'false' %> )
+%}
+ }
+}
+</SCRIPT>
+
+ Limit to <SELECT NAME="ObjectField" onChange="ChangeObjectValue(this)">
+ <OPTION VALUE="" <% $KeywordSelect->ObjectField ? '' : ' SELECTED' %>>(none)</OPTION>
+ <OPTION VALUE="Queue" <% $KeywordSelect->ObjectField eq 'Queue' ? ' SELECTED' : '' %>>Queue</OPTION>
+ </SELECT>
+ <SELECT NAME="ObjectValue">
+ <OPTION VALUE="<% $KeywordSelect->ObjectValue %>">
+ <% $KeywordSelect->ObjectField ? $queues{$KeywordSelect->ObjectValue} : "(n/a)" %></OPTION>
+ </SELECT><BR>
+ <INPUT TYPE="hidden" NAME="SingleMagic" VALUE="1">
+ <INPUT TYPE="checkbox" NAME="Single" VALUE="1" <% $KeywordSelect->Single ? ' CHECKED' : '' %>>Allow single selection only<BR>
+ Limit to <INPUT TYPE="text" NAME="Generations" SIZE="2" VALUE="<% $KeywordSelect->Generations %>"> generations (0 = no limit)<BR>
+ <& /Elements/Submit, Label => $submit &>
+
+</FORM>
+
+<%INIT>
+
+
+my $KeywordSelect = new RT::KeywordSelect($session{CurrentUser});
+
+my($title, $submit);
+
+if ( $Create ) {
+ $title = "Create a new KeywordSelect";
+ $submit = "Create";
+ $id = "new";
+} else {
+ if ( $id eq 'new' ) {
+ $id = $KeywordSelect->Create (
+ Parent => $Parent,
+ ObjectType => $ObjectType,
+ ObjectField => $ObjectField,
+ ObjectValue => $ObjectValue,
+ Single => $Single,
+ Generations => $Generations,
+ ) or Abort "can't create KeywordSelect";
+ } else {
+ $KeywordSelect->Load($id) || Abort("Can't load keyword id $id");
+ #false laziness
+ $KeywordSelect->SetParent($Parent) if defined($Parent);
+ $KeywordSelect->SetObjectType($ObjectType) if defined($ObjectType);
+ $KeywordSelect->SetObjectField($ObjectField) if defined($ObjectField);
+ $KeywordSelect->SetObjectValue($ObjectValue) if defined($ObjectValue);
+ $KeywordSelect->SetSingle($Single) if defined($SingleMagic);
+ $KeywordSelect->SetGenerations($Generations) if defined($Generations);
+ }
+ $title = "Modify the KeywordSelect <B>". $KeywordSelect->KeywordObj->Name. "</B>";
+ $submit = "Modify";
+
+}
+
+ my $parents = new RT::Keywords($session{CurrentUser});
+ $parents->UnLimit;
+ my $parent;
+
+my $queues = new RT::Queues($session{CurrentUser});
+$queues->UnLimit;
+
+my %queues;
+my $queue;
+$queues{$queue->id} = $queue->Name while $queue = $queues->Next;
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Create => undef
+$Parent => undef
+$ObjectType => undef
+$ObjectField => undef
+$ObjectValue => undef
+$Single => undef
+$SingleMagic => undef
+$Generations => undef
+</%ARGS>
+
diff --git a/rt/webrt/Admin/Elements/ModifyQueue b/rt/webrt/Admin/Elements/ModifyQueue
new file mode 100755
index 000000000..a641c81af
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ModifyQueue
@@ -0,0 +1,56 @@
+
+<& /Elements/TitleBoxStart, title => 'Editing Configuration for queue '.$QueueObj->Id &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST>
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>">
+<TABLE>
+<TR><TD ALIGN=RIGHT>
+Queue Name:
+</TD>
+<TD><INPUT name="Name" value="<%$QueueObj->Name%>"></TD>
+</TR><TR>
+<TD ALIGN=RIGHT>
+Description:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$QueueObj->Description%>" size=60></TD></TR>
+<TR>
+<TD ALIGN=RIGHT>
+Correspondence Address:
+</TD><TD>
+<INPUT name="CorrespondAddress" value="<%$QueueObj->CorrespondAddress%>">
+</TD>
+<TD ALIGN=RIGHT>
+
+Comment Address: </TD><TD>
+<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>">
+</TD>
+</TR><TR>
+
+<TD ALIGN=RIGHT>
+Priority starts at:
+</TD><TD><INPUT NAME="InitialPriority" value="<%$QueueObj->InitialPriority %>">
+</TD>
+<TD ALIGN=RIGHT>
+Over time, priority moves toward:
+</TD><TD><INPUT NAME="FinalPriority" value="<%$QueueObj->FinalPriority %>">
+</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT>
+Requests should be due in:
+</TD><TD>
+<INPUT NAME="DefaultDueIn" VALUE="<%$QueueObj->DefaultDueIn%>"> days.
+</TD>
+</TR>
+</TABLE>
+<& /Elements/Submit &>
+</form>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+
+</%INIT>
+
+<%ARGS>
+
+
+$QueueObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/ModifyTemplate b/rt/webrt/Admin/Elements/ModifyTemplate
new file mode 100755
index 000000000..6e4f8a379
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ModifyTemplate
@@ -0,0 +1,78 @@
+
+<& /Elements/TitleBoxStart, title => 'Editing Configuration for user '.$UserObj->Name &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/ModifyUser.html" METHOD=POST>
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>">
+
+Name: <input name="Name" value="<%$UserObj->Name%>">
+<BR>
+New Password: <input type=password name="Pass1"><BR>
+Retype Password: <input type=password name="Pass2"><BR>
+
+Comments: <TEXTAREA name="Comments" COLS=20 ROWS=5>
+<%$UserObj->Comments%></TEXTAREA>
+
+<BR>
+Signature: <TEXTAREA COLS=80 ROWS=5 name="Signature">
+<%$UserObj->Signature%>"></TEXTAREA>
+<BR>
+EmailAddress: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>">
+<BR>
+FreeformContactInfo: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>">
+<BR>
+Organization: <input name="Organization" value="<%$UserObj->Organization%>">
+<BR>
+RealName: <input name="RealName" value="<%$UserObj->RealName%>">
+<BR>
+NickName: <input name="NickName" value="<%$UserObj->NickName%>">
+<BR>
+Lang: <input name="Lang" value="<%$UserObj->Lang%>">
+<BR>
+EmailEncoding: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>">
+<BR>
+WebEncoding: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>">
+<BR>
+ExternalContactInfoId: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>">
+<BR>
+ContactInfoSystem: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>">
+<BR>
+Gecos: <input name="Gecos" value="<%$UserObj->Gecos%>">
+<BR>
+ExternalAuthId: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>">
+<BR>
+AuthSystem: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>">
+<BR>
+HomePhone: <input name="HomePhone" value="<%$UserObj->HomePhone%>">
+<BR>
+WorkPhone: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>">
+<BR>
+MobilePhone: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>">
+<BR>
+PagerPhone: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>">
+<BR>
+Address1: <input name="Address1" value="<%$UserObj->Address1%>">
+<BR>
+Address2: <input name="Address2" value="<%$UserObj->Address2%>">
+<BR>
+City: <input name="City" value="<%$UserObj->City%>">
+<BR>
+State: <input name="State" value="<%$UserObj->State%>">
+<BR>
+Zip: <input name="Zip" value="<%$UserObj->Zip%>">
+<BR>
+Country: <input name="Country" value="<%$UserObj->Country%>">
+<BR>
+
+<input type=submit>
+</form>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+
+</%INIT>
+
+<%ARGS>
+
+
+$UserObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/ModifyUser b/rt/webrt/Admin/Elements/ModifyUser
new file mode 100755
index 000000000..53aa027c0
--- /dev/null
+++ b/rt/webrt/Admin/Elements/ModifyUser
@@ -0,0 +1,77 @@
+
+<& /Elements/TitleBoxStart, title => 'Editing Configuration for user '.$UserObj->Name &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST>
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>">
+
+Name: <input name="Name" value="<%$UserObj->Name%>">
+<BR>
+New Password: <input type=password name="Pass1"><BR>
+Retype Password: <input type=password name="Pass2"><BR>
+
+Comments: <TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL>
+<%$UserObj->Comments%></TEXTAREA>
+
+<BR>
+Signature: <TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD>
+<%$UserObj->Signature%></TEXTAREA>
+<BR>
+EmailAddress: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>">
+<BR>
+FreeformContactInfo: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>">
+<BR>
+Organization: <input name="Organization" value="<%$UserObj->Organization%>">
+<BR>
+RealName: <input name="RealName" value="<%$UserObj->RealName%>">
+<BR>
+NickName: <input name="NickName" value="<%$UserObj->NickName%>">
+<BR>
+Lang: <input name="Lang" value="<%$UserObj->Lang%>">
+<BR>
+EmailEncoding: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>">
+<BR>
+WebEncoding: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>">
+<BR>
+ExternalContactInfoId: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>">
+<BR>
+ContactInfoSystem: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>">
+<BR>
+Gecos: <input name="Gecos" value="<%$UserObj->Gecos%>">
+<BR>
+ExternalAuthId: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>">
+<BR>
+AuthSystem: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>">
+<BR>
+HomePhone: <input name="HomePhone" value="<%$UserObj->HomePhone%>">
+<BR>
+WorkPhone: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>">
+<BR>
+MobilePhone: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>">
+<BR>
+PagerPhone: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>">
+<BR>
+Address1: <input name="Address1" value="<%$UserObj->Address1%>">
+<BR>
+Address2: <input name="Address2" value="<%$UserObj->Address2%>">
+<BR>
+City: <input name="City" value="<%$UserObj->City%>">
+<BR>
+State: <input name="State" value="<%$UserObj->State%>">
+<BR>
+Zip: <input name="Zip" value="<%$UserObj->Zip%>">
+<BR>
+Country: <input name="Country" value="<%$UserObj->Country%>">
+<BR>
+<& /Elements/Submit &>
+</form>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+
+</%INIT>
+
+<%ARGS>
+
+
+$UserObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/QueueRightsForUser b/rt/webrt/Admin/Elements/QueueRightsForUser
new file mode 100644
index 000000000..e62a124ce
--- /dev/null
+++ b/rt/webrt/Admin/Elements/QueueRightsForUser
@@ -0,0 +1,17 @@
+<UL>
+%while(my $ACE = $ACL->Next) {
+
+<LI><checkbox name="delete_ace_<%$ACE->id%>"> <%$ACE->RightName%> (<%$ACE->UserObj->RealName%>)
+
+%}
+</UL>
+
+<%INIT>
+my $ACL = new RT::ACL($session{'CurrentUser'});
+$ACL->LimitToQueue($QueueObj->id);
+$ACL->LimitPrincipalToUser($PrincipalId);
+</%INIT>
+<%ARGS>
+$PrincipalId => undef
+$QueueObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/QueueTabs b/rt/webrt/Admin/Elements/QueueTabs
new file mode 100755
index 000000000..b7da7e007
--- /dev/null
+++ b/rt/webrt/Admin/Elements/QueueTabs
@@ -0,0 +1,36 @@
+<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Queues/' &>
+<hr>
+<%INIT>
+ my $subtabs = {
+ A => { title => 'Basics',
+ path => "Admin/Queues/Modify.html?id=".$id,
+ },
+ B => { title => 'Watchers',
+ path => "Admin/Queues/People.html?id=".$id,
+ },
+
+ C => { title => 'Scrips',
+ path => "Admin/Queues/Scrips.html?id=".$id,
+ },
+ D => { title => 'Templates',
+ path => "Admin/Queues/Templates.html?id=".$id,
+ },
+ E => { title => 'Keyword Selections',
+ path => "Admin/Queues/Keywords.html?id=".$id,
+ },
+ F => { title => 'Group Rights',
+ path => "Admin/Queues/GroupRights.html?id=".$id,
+ },
+ G => { title => 'User Rights',
+ path => "Admin/Queues/UserRights.html?id=".$id,
+ },
+
+
+
+};
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectKeywordSelect b/rt/webrt/Admin/Elements/SelectKeywordSelect
new file mode 100644
index 000000000..f5a8d77cd
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectKeywordSelect
@@ -0,0 +1,22 @@
+<input size=10 name="<%$NamePrefix%>-Name" value="<% $KeywordSelect->Name %>">:
+<& /Admin/Elements/SelectSingleOrMultiple,
+ Name => $NamePrefix.'-Single',
+ Default => $KeywordSelect->Single &>
+
+children of
+<& /Elements/SelectKeyword, Root => '0',
+ Name => $NamePrefix.'-Keyword',
+ Default => $KeywordSelect->KeywordObj->Id &>
+ up to <input name="<%$NamePrefix%>-Depth" size=2 value="<%$KeywordSelect->Depth%>"> levels deep.
+<%INIT>
+unless ($NamePrefix) {
+ $NamePrefix = $KeywordSelect->Id;
+}
+$NamePrefix = "KeywordSelect-$NamePrefix";
+
+</%INIT>
+
+<%ARGS>
+$KeywordSelect => undef
+$NamePrefix => undef
+</%ARGS> \ No newline at end of file
diff --git a/rt/webrt/Admin/Elements/SelectModifyGroup b/rt/webrt/Admin/Elements/SelectModifyGroup
new file mode 100644
index 000000000..45d437f41
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectModifyGroup
@@ -0,0 +1,10 @@
+%while ( $Group = $Groups->Next) {
+<A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR>
+%}
+<%INIT>
+my ($Group);
+my $Groups = new RT::Groups($session{'CurrentUser'});
+$Groups->UnLimit;
+</%INIT>
+<%ARGS>
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectModifyKeyword b/rt/webrt/Admin/Elements/SelectModifyKeyword
new file mode 100644
index 000000000..6af223229
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectModifyKeyword
@@ -0,0 +1,13 @@
+%while ( $keyword = $keywords->Next ) {
+<A HREF="/Admin/Keywords/Modify.html?id=<%$keyword->id%>"><%$keyword->id%>: <%$keyword->Name%></a><BR>
+%}
+
+<%INIT>
+
+use RT::Keywords;
+
+my $keyword;
+my $keywords = new RT::Keywords $session{CurrentUser};
+$keywords->UnLimit;
+</%INIT>
+
diff --git a/rt/webrt/Admin/Elements/SelectModifyKeywordSelect b/rt/webrt/Admin/Elements/SelectModifyKeywordSelect
new file mode 100644
index 000000000..c91eb6cfe
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectModifyKeywordSelect
@@ -0,0 +1,13 @@
+%while ( $keywordselect = $keywordselects->Next ) {
+<A HREF="/Admin/KeywordSelects/Modify.html?id=<%$keywordselect->id%>"><%$keywordselect->id%>: ( <%$keywordselect->Parent%>: <%$keywordselect->KeywordObj->Name%> )</a><BR>
+%}
+
+<%INIT>
+
+use RT::KeywordSelects;
+
+my $keywordselect;
+my $keywordselects = new RT::KeywordSelects $session{CurrentUser};
+$keywordselects->UnLimit;
+</%INIT>
+
diff --git a/rt/webrt/Admin/Elements/SelectModifyQueue b/rt/webrt/Admin/Elements/SelectModifyQueue
new file mode 100755
index 000000000..1c6cd7d5e
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectModifyQueue
@@ -0,0 +1,10 @@
+%while ( $queue = $queues->Next) {
+<A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR>
+%}
+<%INIT>
+my ($queue);
+my $queues = new RT::Queues($session{'CurrentUser'});
+$queues->UnLimit;
+</%INIT>
+<%ARGS>
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectModifyUser b/rt/webrt/Admin/Elements/SelectModifyUser
new file mode 100755
index 000000000..da49212e4
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectModifyUser
@@ -0,0 +1,26 @@
+%while ( $user = $users->Next) {
+<A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR>
+%}
+<%INIT>
+my ($user);
+my $users = new RT::Users($session{'CurrentUser'});
+$users->Limit(FIELD => 'id',
+ VALUE => $RT::SystemUser->id,
+ OPERATOR => '!=' );
+
+if (defined $IdLike) {
+$users->Limit(FIELD => 'Name',
+ VALUE => $IdLike,
+ OPERATOR => 'LIKE' );
+}
+if (defined $EmailLike) {
+$users->Limit(FIELD => 'EmailAddress',
+ VALUE => $EmailLike,
+ OPERATOR => 'LIKE');
+
+}
+</%INIT>
+<%ARGS>
+$IdLike => undef
+$EmailLike => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectQueueRights b/rt/webrt/Admin/Elements/SelectQueueRights
new file mode 100755
index 000000000..6861d40c6
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectQueueRights
@@ -0,0 +1,29 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Admin/Elements/Attic/SelectQueueRights,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="">-</OPTION>
+%foreach $right (@rights) {
+<OPTION VALUE="<%$right%>" <%($Default eq $right) && 'SELECTED'%>><%$right%></OPTION>
+% }
+</SELECT>
+<%ONCE>
+
+use RT::ACE;
+my $ACE = new RT::ACE($session{'CurrentUser'});
+my %QueueRights = $ACE->QueueRights;
+my %TicketRights = $ACE->TicketRights;
+
+my ($key, $right, @rights);
+
+foreach $key (sort keys %QueueRights) {
+push (@rights, $QueueRights{$key} . " ($key)");
+}
+foreach $key (sort keys %TicketRights) {
+push (@rights, $TicketRights{$key} . " ($key)");
+}
+</%ONCE>
+<%ARGS>
+$Name => undef
+$Default => undef
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectRights b/rt/webrt/Admin/Elements/SelectRights
new file mode 100644
index 000000000..0ac774985
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectRights
@@ -0,0 +1,58 @@
+<INPUT TYPE=HIDDEN NAME="CheckACL" VALUE="<%$ACLDesc%>">
+ <TABLE BORDER=0>
+<TR>
+<TD valign=top>
+<h3>New rights</h3>
+<SELECT SIZE=5 MULTIPLE NAME="GrantACE-<%$ACLDesc%>">
+% foreach $right (sort keys %Rights) {
+ <OPTION VALUE="<%$right%>"
+ ><%$right%></OPTION>
+% }
+<OPTION VALUE="" SELECTED>(no value)</OPTION>
+</SELECT>
+</TD>
+<TD valign=top>
+<h3>Current rights</h3>
+<i>(Check box to revoke right)</i> <BR>
+% while (my $right = $ACLObj->Next()) {
+% if ($right->RightName) {
+<input type=checkbox value="<%$right->Id%>" name="RevokeACE"> <%$right->RightName%><br>
+% }
+% }
+</TD>
+</TR>
+</TABLE>
+<%INIT>
+ my ($right, $ACLDesc, $AppliesTo, %Rights);
+
+
+ my $ACLObj = new RT::ACL($session{'CurrentUser'});
+ my $ACE = new RT::ACE($session{'CurrentUser'});
+
+ if ($Scope eq 'Queue') {
+ $AppliesTo = $QueueObj->Id;
+ $ACLObj->LimitToQueue($AppliesTo);
+ %Rights = $ACE->QueueRights();
+ }
+ elsif ($Scope eq 'System') {
+ $AppliesTo = 0;
+ $ACLObj->LimitToSystem();
+ %Rights = ( $ACE->SystemRights , $ACE->QueueRights());
+ }
+
+ if ($PrincipalType eq 'Group') {
+ $ACLObj->LimitPrincipalToGroup($PrincipalObj->Id);
+ }
+ elsif ($PrincipalType eq 'User') {
+ $ACLObj->LimitPrincipalToUser($PrincipalObj->Id);
+ }
+
+ $ACLDesc = "$PrincipalType-".$PrincipalObj->Id."-$Scope-$AppliesTo";
+</%INIT>
+
+<%ARGS>
+$PrincipalType => undef
+$PrincipalObj => undef
+$Scope => undef
+$QueueObj => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectScrip b/rt/webrt/Admin/Elements/SelectScrip
new file mode 100755
index 000000000..4ae15d8c3
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectScrip
@@ -0,0 +1,25 @@
+<SELECT NAME=<%$Name%>>
+<OPTION VALUE=""
+<% $Default eq undef && 'SELECTED' %>
+>-</OPTION>
+%while (my $Scrip = $Scrips->Next) {
+<OPTION VALUE=<%$Scrip->Id%>
+<% $Scrip->Id == $Default && 'SELECTED' %>
+><%$Scrip->Name%>
+</OPTION>
+%}
+</SELECT>
+
+<%INIT>
+my $Scrips = RT::Scrips->new($session{'CurrentUser'});
+$Scrips->UnLimit;
+
+
+
+</%INIT>
+<%ARGS>
+
+$Default => undef
+$Name => 'Scrip'
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectScripAction b/rt/webrt/Admin/Elements/SelectScripAction
new file mode 100644
index 000000000..08a173493
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectScripAction
@@ -0,0 +1,25 @@
+<SELECT NAME=<%$Name%>>
+<OPTION VALUE=""
+<% $Default eq undef && 'SELECTED' %>
+>-</OPTION>
+%while (my $ScripAction = $ScripActions->Next) {
+<OPTION VALUE=<%$ScripAction->Id%>
+<% $ScripAction->Id == $Default && 'SELECTED' %>
+><%$ScripAction->Name%>
+</OPTION>
+%}
+</SELECT>
+
+<%INIT>
+my $ScripActions = RT::ScripActions->new($session{'CurrentUser'});
+$ScripActions->UnLimit;
+
+
+
+</%INIT>
+<%ARGS>
+
+$Default => undef
+$Name => 'ScripAction'
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectScripCondition b/rt/webrt/Admin/Elements/SelectScripCondition
new file mode 100644
index 000000000..434f0c4ae
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectScripCondition
@@ -0,0 +1,25 @@
+<SELECT NAME=<%$Name%>>
+<OPTION VALUE=""
+<% $Default eq undef && 'SELECTED' %>
+>-</OPTION>
+%while (my $ScripCondition = $ScripConditions->Next) {
+<OPTION VALUE=<%$ScripCondition->Id%>
+<% $ScripCondition->Id == $Default && 'SELECTED' %>
+><%$ScripCondition->Name%>
+</OPTION>
+%}
+</SELECT>
+
+<%INIT>
+my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'});
+$ScripConditions->UnLimit;
+
+
+
+</%INIT>
+<%ARGS>
+
+$Default => undef
+$Name => 'ScripCondition'
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectSingleOrMultiple b/rt/webrt/Admin/Elements/SelectSingleOrMultiple
new file mode 100644
index 000000000..307b0211c
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectSingleOrMultiple
@@ -0,0 +1,20 @@
+ <select name="<%$Name%>">
+ <option value="1" <%$SingleDefault%>>Single</option>
+ <option value="0" <%$MultipleDefault%>>Multiple</option>
+ </select>
+
+
+<%INIT>
+my ($SingleDefault, $MultipleDefault);
+if ($Default == 1) {
+ $SingleDefault = "SELECTED";
+}
+elsif ($Default == 0 ) {
+ $MultipleDefault = "SELECTED";
+}
+
+</%INIT>
+<%ARGS>
+$Name => 'Single'
+$Default => 1
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectTemplate b/rt/webrt/Admin/Elements/SelectTemplate
new file mode 100755
index 000000000..76550dc4e
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectTemplate
@@ -0,0 +1,37 @@
+<SELECT NAME=<%$Name%>>
+<OPTION VALUE=""
+<% $Default eq 'none' && 'SELECTED' %>
+>-</OPTION>
+%while (my $Template = $PrimaryTemplates->Next) {
+<OPTION VALUE=<%$Template->Id%>
+<% ($Template->Id == $Default) && 'SELECTED' %>
+><%$Template->Name%>
+</OPTION>
+%}
+%while (my $Template = $OtherTemplates->Next) {
+<OPTION VALUE=<%$Template->Id%>
+<% ($Template->Id == $Default) && 'SELECTED'%>
+>Global template: <%$Template->Name%>
+</OPTION>
+%}
+</SELECT>
+
+<%INIT>
+
+
+my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'});
+if ($DefaultQueue != 0) {
+$PrimaryTemplates->LimitToQueue($DefaultQueue);
+}
+
+my $OtherTemplates = RT::Templates->new($session{'CurrentUser'});
+$OtherTemplates->LimitToGlobal($DefaultQueue);
+
+</%INIT>
+<%ARGS>
+
+$Default => 'none'
+$DefaultQueue => undef
+$Name => 'Template'
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SelectUsers b/rt/webrt/Admin/Elements/SelectUsers
new file mode 100644
index 000000000..af51c60f9
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SelectUsers
@@ -0,0 +1,17 @@
+<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10>
+%while (my $user = $users->Next) {
+<OPTION VALUE="<%$user->id%>"><%$user->Name%>
+%}
+</SELECT>
+
+<%INIT>
+my $users = new RT::Users($session{'CurrentUser'});
+
+$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' );
+$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' );
+$users->LimitToPrivileged();
+
+</%INIT>
+<%ARGS>
+$Name => 'Users'
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/SystemTabs b/rt/webrt/Admin/Elements/SystemTabs
new file mode 100755
index 000000000..f8b23128b
--- /dev/null
+++ b/rt/webrt/Admin/Elements/SystemTabs
@@ -0,0 +1,31 @@
+<& /Admin/Elements/Tabs, subtabs => $subtabs, current_tab => 'Admin/Global/', current_subtab => $current_subtab &>
+<hr>
+<%INIT>
+ my $subtabs = {
+
+ A => { title => 'Scrips',
+ path => 'Admin/Global/Scrips.html',
+ },
+ Ba => { title => 'Keyword Selections',
+ path => 'Admin/Global/Keywords.html',
+ },
+
+ B => { title => 'Templates',
+ path => 'Admin/Global/Templates.html',
+ },
+ C => { title => 'Group Rights',
+ path => 'Admin/Global/GroupRights.html',
+ },
+ D => { title => 'User Rights',
+ path => 'Admin/Global/UserRights.html',
+ }
+
+
+};
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$current_subtab => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/Tabs b/rt/webrt/Admin/Elements/Tabs
new file mode 100755
index 000000000..ee6d82b58
--- /dev/null
+++ b/rt/webrt/Admin/Elements/Tabs
@@ -0,0 +1,31 @@
+<& /Elements/Tabs, tabs => $tabs, subtabs => $subtabs, current_toptab => 'Admin/', current_tab => $current_tab, current_subtab => $current_subtab&>
+
+<hr>
+
+<%INIT>
+ my $tabs = { Users => { title => 'Users',
+ path => 'Admin/Users/',
+ },
+ Groups => { title => 'Groups',
+ path => 'Admin/Groups/',
+ },
+ Queues => { title => 'Queues',
+ path => 'Admin/Queues/',
+ },
+ System => { 'title' => 'Global',
+ path => 'Admin/Global/',
+ },
+ Keywords => { title => 'Keywords',
+ path => 'Admin/Keywords/',
+ },
+
+
+ };
+</%INIT>
+
+
+<%ARGS>
+$subtabs => undef
+$current_tab => undef
+$current_subtab => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Elements/UserTabs b/rt/webrt/Admin/Elements/UserTabs
new file mode 100755
index 000000000..bbf17314d
--- /dev/null
+++ b/rt/webrt/Admin/Elements/UserTabs
@@ -0,0 +1,21 @@
+<& /Admin/Elements/Tabs, subtabs => $subtabs,
+ current_tab => 'Admin/Users/',
+ current_subtab => $current_subtab &>
+<hr>
+<%INIT>
+my $subtabs = {
+ Queues => { title => 'Basics',
+ path => "Admin/Users/Modify.html?id=".$id
+ },
+# Scrips => { title => 'Rights',
+# path => "Admin/Users/Rights.html?id=".$id
+# }
+
+ };
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$current_subtab => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/GroupRights.html b/rt/webrt/Admin/Global/GroupRights.html
new file mode 100755
index 000000000..26b7e1fe2
--- /dev/null
+++ b/rt/webrt/Admin/Global/GroupRights.html
@@ -0,0 +1,78 @@
+<& /Admin/Elements/Header, Title => 'Modify System ACLS' &>
+<& /Admin/Elements/SystemTabs &>
+
+<& /Elements/ListActions, actions => \@results &>
+ <FORM METHOD=POST action="GroupRights.html">
+
+
+
+<h2>Modify global rights for groups</h2>
+
+<TABLE>
+<TR><TD>Pseudogroups</TD></TR>
+% while (my $GroupObj = $PseudoGroups->Next()) {
+
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $GroupObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj,
+ PrincipalType => 'Group',
+ Scope => 'System' &>
+ </TD>
+ </TR>
+
+% }
+
+<TR><TD>Groups</TD></TR>
+
+% while (my $GroupObj = $Groups->Next()) {
+
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $GroupObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj,
+ PrincipalType => 'Group',
+ Scope => 'System' &>
+ </TD>
+ </TR>
+
+% }
+
+ </TABLE>
+ <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &>
+ </FORM>
+
+ <%INIT>
+
+ #Update the acls.
+ my @results = ProcessACLChanges(\@CheckACL, \%ARGS);
+
+
+ # {{{ do basic initialization.
+
+
+
+ # Find out which groups we want to display ACL selects for.
+ my $Groups = new RT::Groups($session{'CurrentUser'});
+ #TODO: limit this to non-pseudogroups
+ $Groups->LimitToReal();
+
+
+ my $PseudoGroups = new RT::Groups($session{'CurrentUser'});
+ #TODO: limit this to non-pseudogroups
+ $PseudoGroups->LimitToPseudo;
+
+ # }}}
+
+
+
+
+ </%INIT>
+
+<%ARGS>
+@CheckACL => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/Keywords.html b/rt/webrt/Admin/Global/Keywords.html
new file mode 100644
index 000000000..bf7bbd266
--- /dev/null
+++ b/rt/webrt/Admin/Global/Keywords.html
@@ -0,0 +1,97 @@
+<& /Admin/Elements/Header, Title => 'Edit keywords' &>
+<& /Admin/Elements/SystemTabs &>
+<& /Elements/ListActions, actions => \@actions &>
+
+<& /Elements/TitleBoxStart, title => $description &>
+
+ <FORM METHOD=POST ACTION="Keywords.html">
+
+% if ($KeywordSelects->Count > 0 ) {
+<TABLE>
+<TR><TD>Delete</TD></TR>
+% while (my $keywordselect = $KeywordSelects->Next ) {
+<TR>
+ <TD><INPUT TYPE="CHECKBOX" NAME="KeywordSelect-<%$keywordselect->Id%>-Delete"></TD>
+ <TD><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $keywordselect &></TD>
+</TR>
+% }
+</TABLE>
+% }
+
+Add a global keyword selection:
+%my $ks = new RT::KeywordSelect($session{'CurrentUser'});
+<ul>
+<li><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $ks, NamePrefix => 'new' &></li>
+</ul>
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+</FORM>
+
+
+
+<%init>
+my (@actions);
+
+my $description = "Modify global Keyword selections";
+
+my $KeywordSelects = new RT::KeywordSelects ($session{'CurrentUser'});
+
+unless ($KeywordSelects->LimitToGlobals()) {
+ Abort("Couldn't load KeywordSelects.");
+}
+
+
+# {{{ if we're trying to create a new keyword select
+
+if ($ARGS{'KeywordSelect-new-Name'}) {
+ my $NewKeywordSelect = new RT::KeywordSelect($session{'CurrentUser'});
+
+ my ($retval, $msg) = $NewKeywordSelect->Create ( Keyword => $ARGS{'KeywordSelect-new-Keyword'},
+ ObjectField => 'Queue',
+ ObjectType => 'Ticket',
+ ObjectValue => 0,
+ Name => $ARGS{'KeywordSelect-new-Name'},
+ Single => $ARGS{'KeywordSelect-new-Single'},
+ Depth => $ARGS{'KeywordSelect-new-Depth'}
+ );
+ push (@actions, $msg);
+}
+# }}}
+
+# {{{ if we're trying to delete the keywordselect
+foreach my $key (keys %ARGS) {
+ if ($key =~ /^KeywordSelect-(\d+)-Delete$/) {
+ my $id = $1;
+ my $keywordselect = new RT::KeywordSelect($session{'CurrentUser'});
+ $keywordselect->Load($id) || push @actions, "Couldn't load keywordSelect";
+ my ($val, $msg) = $keywordselect->SetDisabled(1);
+ if ($val) {
+ push @actions, 'KeywordSelect disabled.';
+ }
+ else {
+ push @actions, $msg;
+ }
+ }
+}
+# }}}
+# {{{ if we're modifying keyword selects
+my @fields = qw(Name Keyword Single Depth);
+
+while (my $ks = $KeywordSelects->Next) {
+ foreach my $field (@fields) {
+ if (defined ($ARGS{"KeywordSelect-".$ks->Id."-".$field}) &&
+ ($ARGS{"KeywordSelect-".$ks->Id."-".$field} ne $ks->$field())) {
+
+ my $method = "Set$field";
+ my ($val, $msg) = $ks->$method($ARGS{"KeywordSelect-".$ks->Id."-".$field});
+ push @actions, "Keyword Select ". $ks->Name."/$field:".$msg;
+ }
+ }
+}
+# }}}
+
+</%init>
+
+<%ARGS>
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/Scrips.html b/rt/webrt/Admin/Global/Scrips.html
new file mode 100755
index 000000000..e55f8b3de
--- /dev/null
+++ b/rt/webrt/Admin/Global/Scrips.html
@@ -0,0 +1,95 @@
+<& /Admin/Elements/Header, Title => 'Edit scrips' &>
+<& /Admin/Elements/SystemTabs &>
+
+<& /Elements/ListActions, actions => \@actions &>
+
+<& /Elements/TitleBoxStart, title => "Modify global scrips" &>
+
+ <FORM METHOD=POST ACTION="Scrips.html">
+
+% if ($Scrips->Count > 0 ) {
+<TABLE>
+<TR>
+<TD>Delete
+</TD>
+<TD>
+</TR>
+
+% while (my $scrip = $Scrips->Next ) {
+<TR>
+<TD>
+<INPUT TYPE="CHECKBOX" NAME="DeleteScrip-<%$scrip->Id%>">
+</TD>
+<TD>
+<% $scrip->ConditionObj->Name %>
+<% $scrip->ActionObj->Name %>
+with template <% $scrip->TemplateObj->Name %>
+</TD>
+</TR>
+% }
+
+</TABLE>
+
+% }
+Add a scrip which will apply to all queues:
+<ul>
+<li>Condition: <& /Admin/Elements/SelectScripCondition, Name => 'NewScripCondition' &>
+ Action: <& /Admin/Elements/SelectScripAction, Name => 'NewScripAction' &>
+ Template: <& /Admin/Elements/SelectTemplate, Name => 'NewScripTemplate' &>
+
+</ul>
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+</FORM>
+<%init>
+my (@actions, $description);
+
+my $Scrips = new RT::Scrips ($session{'CurrentUser'});
+$Scrips->LimitToGlobal();
+
+
+
+
+if ($NewScripAction and $NewScripCondition) {
+ my $NewScrip = new RT::Scrip($session{'CurrentUser'});
+
+ my ($retval, $msg) = $NewScrip->Create ( ScripAction => $NewScripAction,
+ ScripCondition => $NewScripCondition,
+ Stage => 'TransactionCreate',
+ Queue => 0,
+ Template => $NewScripTemplate);
+ if (defined $retval) {
+ push @actions, $msg;
+ }
+ else {
+ push @actions, $msg;
+ }
+}
+
+# {{{ deal with modifying and deleting existing scrips
+my ($key );
+foreach $key (keys %ARGS) {
+ # {{{ if we're trying to delete the scrip
+ if ($key =~ /^DeleteScrip-(\d+)/) {
+ my $id = $1;
+ my $scrip = new RT::Scrip($session{'CurrentUser'});
+ $scrip->Load($id);
+ my ($retval, $msg) = $scrip->Delete;
+ if ($retval) {
+ push @actions, "Scrip deleted";
+ }
+ else {
+ push @actions, $msg;
+ }
+ }
+ # }}}
+}
+# }}}
+</%init>
+
+<%ARGS>
+$NewScripCondition => undef
+$NewScripAction => undef
+$NewScripTemplate => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/Template.html b/rt/webrt/Admin/Global/Template.html
new file mode 100755
index 000000000..856d2ee8f
--- /dev/null
+++ b/rt/webrt/Admin/Global/Template.html
@@ -0,0 +1,66 @@
+<& /Admin/Elements/Header, title => "Modify template ".$TemplateObj->id&>
+<& /Admin/Elements/SystemTabs &>
+<& /Elements/ListActions, actions => \@results &>
+
+<& /Elements/TitleBoxStart, title => $title &>
+
+<FORM METHOD=POST ACTION="Template.html">
+%if ($create ) {
+<INPUT TYPE=HIDDEN NAME=template VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=template VALUE="<%$TemplateObj->Id%>">
+% }
+
+%# hang onto the queue id
+<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>">
+
+
+Name: <input name="Name" VALUE="<%$TemplateObj->Name%>" SIZE=20><BR>
+Description: <input name="Description" VALUE="<%$TemplateObj->Description%>" SIZE=80><BR>
+
+<TEXTAREA NAME=Content ROWS=25 COLS=80 WRAP=SOFT>
+<%$TemplateObj->Content%></TEXTAREA>
+
+<& /Elements/TitleBoxEnd&>
+<&/Elements/Submit&>
+</FORM>
+
+
+
+<%INIT>
+
+my $TemplateObj = new RT::Template($session{'CurrentUser'});
+my ($title, @results);
+
+if ($create) {
+ $title = "Create a template";
+}
+
+else {
+ if ($template eq 'new') {
+ my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name);
+ Abort("Could not create template: $msg") unless ($val);
+ push @results, $msg;
+ $title = 'Created template ' . $TemplateObj->Name();
+ }
+ else {
+ $TemplateObj->Load($template) || Abort('No Template');
+ $title = 'Editing template ' . $TemplateObj->Name();
+ }
+
+
+}
+if ($TemplateObj->Id()) {
+ my @attribs = qw( Description Content Queue Name);
+ my @aresults = UpdateRecordObject( AttributesRef => \@attribs,
+ Object => $TemplateObj,
+ ARGSRef => \%ARGS);
+ push @results, @aresults;
+}
+</%INIT>
+<%ARGS>
+$Queue => undef
+$template => undef
+$create => undef
+$Name => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/Templates.html b/rt/webrt/Admin/Global/Templates.html
new file mode 100755
index 000000000..cf388e521
--- /dev/null
+++ b/rt/webrt/Admin/Global/Templates.html
@@ -0,0 +1,24 @@
+<& /Admin/Elements/Header, Title => 'Edit system templates' &>
+<& /Admin/Elements/SystemTabs &>
+
+<& /Elements/TitleBoxStart, title => 'Edit system templates' &>
+<UL>
+<LI><A href="Template.html?create=1&Queue=0">Create a new template</A><BR><BR>
+
+
+%while (my $TemplateObj = $Templates->Next) {
+
+<LI><A HREF="Template.html?template=<%$TemplateObj->id()%>"><%$TemplateObj->id()%>/<%$TemplateObj->Name%>: <%$TemplateObj->Description%></a><BR>
+
+%}
+
+<& /Elements/TitleBoxEnd &>
+<%INIT>
+
+my $Templates = RT::Templates->new($session{'CurrentUser'});
+$Templates->LimitToGlobal();
+
+</%INIT>
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/UserRights.html b/rt/webrt/Admin/Global/UserRights.html
new file mode 100755
index 000000000..351f4b8c6
--- /dev/null
+++ b/rt/webrt/Admin/Global/UserRights.html
@@ -0,0 +1,42 @@
+<& /Admin/Elements/Header, Title => 'Modify System ACLS' &>
+<& /Admin/Elements/SystemTabs &>
+
+<& /Elements/ListActions, actions => \@results &>
+ <FORM METHOD=POST action="UserRights.html">
+
+
+<h2>Modify global rights for users</h2>
+<TABLE>
+% while (my $UserObj = $Users->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <A HREF="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$UserObj->id%>"><% $UserObj->Name %></A>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $UserObj,
+ PrincipalType => 'User',
+ Scope => 'System' &>
+
+ </TD>
+ </TR>
+
+% }
+ </TABLE>
+
+ <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &>
+ </FORM>
+
+<%INIT>
+
+ my @results = ProcessACLChanges(\@CheckACL, \%ARGS);
+
+ # Find out which users we want to display ACL selects for
+ my $Users = new RT::Users($session{'CurrentUser'});
+
+ $Users->LimitToPrivileged();
+
+</%INIT>
+
+<%ARGS>
+@CheckACL => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Global/index.html b/rt/webrt/Admin/Global/index.html
new file mode 100755
index 000000000..5907ed1e8
--- /dev/null
+++ b/rt/webrt/Admin/Global/index.html
@@ -0,0 +1,2 @@
+<& /Admin/Elements/Header, Title => 'Admin/Global configuration' &>
+<& /Admin/Elements/SystemTabs &>
diff --git a/rt/webrt/Admin/Groups/Members.html b/rt/webrt/Admin/Groups/Members.html
new file mode 100644
index 000000000..4b0e0d04f
--- /dev/null
+++ b/rt/webrt/Admin/Groups/Members.html
@@ -0,0 +1,76 @@
+<& /Admin/Elements/Header, Title => "RT/Admin/Edit the group ". $Group->Name &>
+<& /Admin/Elements/GroupTabs, GroupObj => $Group &>
+<& /Elements/ListActions, actions => \@results &>
+
+
+<& /Elements/TitleBoxStart, title => 'Editing membership for group '.$Group->Name &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Members.html" METHOD=POST>
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>">
+<TABLE WIDTH="100%">
+<TR>
+<TD>
+Add members
+</TD>
+<TD>
+Current members
+</TD>
+</TR>
+
+<TR>
+<TD VALIGN=TOP>
+<& /Admin/Elements/SelectUsers, Name => "AddMembers" &>
+</TD>
+<TD VALIGN=TOP>
+% if ($Group->MembersObj->Count == 0 ) {
+<i>(No members)</i>
+% } else {
+(Check box to delete group member)
+<UL>
+% while (my $member = $Group->MembersObj->Next()) {
+<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->UserObj->id%>">
+<%$member->UserObj->Name%> (<%$member->UserObj->RealName%>)
+% }
+% }
+</UL>
+</TD>
+</TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+</form>
+
+
+<%INIT>
+
+my $Group = new RT::Group($session{'CurrentUser'});
+$Group->Load($id) || Abort('Could not load group');
+
+my (@results);
+
+my $key;
+foreach $key (keys %ARGS) {
+
+if ($key =~ /^DeleteMember-(\d+)$/) {
+ my $id = $1;
+ my ($val,$msg) = $Group->DeleteMember($id);
+ push (@results, $msg);
+}
+}
+
+# Make sure AddMembers is always an array
+my @AddMembers = (ref $AddMembers eq 'ARRAY') ? @{$AddMembers} : ($AddMembers);
+
+foreach my $member (@AddMembers) {
+ next unless ($member);
+ my ($val, $msg) = $Group->AddMember($member);
+ push (@results, $msg);
+}
+
+
+</%INIT>
+
+<%ARGS>
+$AddMembers => undef
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Groups/Modify.html b/rt/webrt/Admin/Groups/Modify.html
new file mode 100644
index 000000000..7104a6937
--- /dev/null
+++ b/rt/webrt/Admin/Groups/Modify.html
@@ -0,0 +1,83 @@
+<& /Admin/Elements/Header, Title => $title &>
+
+<& /Admin/Elements/GroupTabs, GroupObj => $Group &>
+<& /Elements/ListActions, actions => \@results &>
+
+
+<& /Elements/TitleBoxStart, title => $title &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST>
+
+%unless ($Group->Id) {
+<INPUT TYPE=HIDDEN NAME=id VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>">
+% }
+<TABLE>
+<TR><TD ALIGN=RIGHT>
+Name:
+</TD>
+<TD><INPUT name="Name" value="<%$Group->Name%>"></TD>
+</TR><TR>
+<TD ALIGN=RIGHT>
+Description:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD></TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+<& /Elements/Submit &>
+</form>
+<%INIT>
+
+my ($title);
+my (@results);
+
+my $Group = new RT::Group($session{'CurrentUser'});
+
+if ($Create) {
+ $title = "Create a new group";
+}
+
+else {
+
+ if ($id eq 'new' ) {
+
+ $Group->Create(Name => "$Name") || Abort ("Group could not be created.");
+ $id = $Group->Id;
+ }
+ else {
+ $Group->Load($id) || Abort('Could not load group');
+ }
+
+
+ if ($id) {
+ $title = "Modify the group ". $Group->Name;
+
+ }
+
+ # If the create failed
+ else {
+ $title = "Create a new group";
+ $Create = 1;
+ }
+
+}
+
+if ($id) {
+
+ my @fields = qw(Description Name );
+ my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
+ Object => $Group,
+ ARGSRef => \%ARGS );
+ push (@results,@fieldresults);
+}
+
+
+</%INIT>
+
+
+<%ARGS>
+$Create => undef
+$Name => undef
+$Description => undef
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Groups/Rights.html b/rt/webrt/Admin/Groups/Rights.html
new file mode 100644
index 000000000..5c842a301
--- /dev/null
+++ b/rt/webrt/Admin/Groups/Rights.html
@@ -0,0 +1 @@
+Not yet implemented....
diff --git a/rt/webrt/Admin/Groups/index.html b/rt/webrt/Admin/Groups/index.html
new file mode 100644
index 000000000..d419e7f73
--- /dev/null
+++ b/rt/webrt/Admin/Groups/index.html
@@ -0,0 +1,33 @@
+
+<& /Admin/Elements/Header, Title => 'Admin/Groups' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/Groups/' &>
+
+<& /Elements/TitleBoxStart, title => 'Select a group' &>
+
+Pseudogroups:<BR>
+<UL>
+%while ( $Group = $PseudoGroups->Next) {
+<LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name%></a><BR>
+%}
+
+</UL>
+
+Groups:<BR>
+<UL>
+<LI><A HREF="Modify.html?Create=1">Create a new group</A><BR><BR></LI>
+%while ( $Group = $Groups->Next) {
+<LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name%></a><BR>
+%}
+</UL>
+
+<& /Elements/TitleBoxEnd &>
+<%INIT>
+my ($Group);
+my $PseudoGroups = new RT::Groups($session{'CurrentUser'});
+$PseudoGroups->LimitToPseudo;
+my $Groups = new RT::Groups($session{'CurrentUser'});
+$Groups->LimitToReal;
+
+</%INIT>
+<%ARGS>
+</%ARGS>
diff --git a/rt/webrt/Admin/KeywordSelects/Modify.html b/rt/webrt/Admin/KeywordSelects/Modify.html
new file mode 100644
index 000000000..e753c6622
--- /dev/null
+++ b/rt/webrt/Admin/KeywordSelects/Modify.html
@@ -0,0 +1,17 @@
+<& /Admin/Elements/Header, Title => 'Admin KeywordSelects' &>
+<& /Admin/Elements/Tabs &>
+
+<& /Admin/Elements/ModifyKeywordSelect, Create=>$Create, id=>$id, Parent=>$Parent, ObjectType=>$ObjectType, ObjectField=>$ObjectField, ObjectValue=>$ObjectValue, Single=>$Single, SingleMagic=>$SingleMagic, Generations=>$Generations &>
+
+<%ARGS>
+$Create => undef
+$id => undef
+$Parent => undef
+$ObjectType => undef
+$ObjectField => undef
+$ObjectValue => undef
+$Single => undef
+$SingleMagic => undef
+$Generations => undef
+</%ARGS>
+
diff --git a/rt/webrt/Admin/KeywordSelects/index.html b/rt/webrt/Admin/KeywordSelects/index.html
new file mode 100644
index 000000000..ba3da9f0c
--- /dev/null
+++ b/rt/webrt/Admin/KeywordSelects/index.html
@@ -0,0 +1,137 @@
+<& /Admin/Elements/Header, Title => 'Admin KeywordSelects' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/KeywordSelects/' &>
+
+A <B>KeywordSelect</B> is a link between a <B>Keyword</B> and a object
+(currently just <B>Tickets</B>), titled by the <I>Name</I> field of the Keyword such that:
+<ul>
+<li>Object display will contain a field, titled with the <I>Name</I> field of
+the <B>Keyword</B> and showing any descendent keywords.
+<li>Object creation for this field will contain a field, titled with the
+<I>Name</I> field of the <B>Keyword</B> and containing the descendents of
+the <B>Keyword</B> as choices.
+<li>Searches for this object type will contain a selection field titled with
+the <I>Name</I> field of the <B>Keyword</B> and containing the descendents
+of the <B>Keyword</B> as choices.
+<TABLE WIDTH=100%>
+
+
+
+ <TD VALIGN=TOP>
+ <h2>Create KeywordSelect</h2>
+ <FORM NAME="ModifyKeywordSelect" METHOD="POST" ACTION="<%$RT::WebPath%>/Admin/KeywordSelects/Modify.html">
+ [<%$title |n %>]
+ <BR>
+
+ <INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
+ Keyword
+ <SELECT NAME="Parent">
+
+%while ( $parent = $parents->Next ) {
+
+ <OPTION VALUE="<% $parent->id %>" <% defined($KeywordSelect->Parent) && $parent->id == $KeywordSelect->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
+
+% }
+
+ </SELECT>
+ <BR>
+ Object
+ <SELECT NAME="ObjectType">
+ <OPTION SELECTED>Ticket</OPTION>
+ </SELECT>
+ <BR>
+
+%foreach $queue ( keys %queues ) {
+ addOption("<% $queues{$queue} %>", "<% $queue %>", false, <% $queue == $KeywordSelect->ObjectValue ? 'true' : 'false' %> )
+%}
+ }
+}
+</SCRIPT>
+
+ Limit to <SELECT NAME="ObjectField" onChange="ChangeObjectValue(this)">
+ <OPTION VALUE="" <% $KeywordSelect->ObjectField ? '' : ' SELECTED' %>>(none)</OPTION>
+ <OPTION VALUE="Queue" <% $KeywordSelect->ObjectField eq 'Queue' ? ' SELECTED' : '' %>>Queue</OPTION>
+ </SELECT>
+ <SELECT NAME="ObjectValue">
+ <OPTION VALUE="<% $KeywordSelect->ObjectValue %>">
+ <% $KeywordSelect->ObjectField ? $queues{$KeywordSelect->ObjectValue} : "(n/a)" %></OPTION>
+ </SELECT><BR>
+ <INPUT TYPE="hidden" NAME="SingleMagic" VALUE="1">
+ <INPUT TYPE="checkbox" NAME="Single" VALUE="1" <% $KeywordSelect->Single ? ' CHECKED' : '' %>>Allow single selection only<BR>
+ Limit to <INPUT TYPE="text" NAME="Generations" SIZE="2" VALUE="<% $KeywordSelect->Generations %>"> generations (0 = no limit)<BR>
+ <& /Elements/Submit, Label => $submit &>
+
+</FORM>
+
+<%INIT>
+
+
+my $KeywordSelect = new RT::KeywordSelect($session{CurrentUser});
+
+my($title, $submit);
+
+if ( $Create ) {
+ $title = "Create a new KeywordSelect";
+ $submit = "Create";
+ $id = "new";
+} else {
+ if ( $id eq 'new' ) {
+ $id = $KeywordSelect->Create (
+ Parent => $Parent,
+ ObjectType => $ObjectType,
+ ObjectField => $ObjectField,
+ ObjectValue => $ObjectValue,
+ Single => $Single,
+ Generations => $Generations,
+ ) or Abort "can't create KeywordSelect";
+ } else {
+ $KeywordSelect->Load($id) || Abort("Can't load keyword id $id");
+ #false laziness
+ $KeywordSelect->SetParent($Parent) if defined($Parent);
+ $KeywordSelect->SetObjectType($ObjectType) if defined($ObjectType);
+ $KeywordSelect->SetObjectField($ObjectField) if defined($ObjectField);
+ $KeywordSelect->SetObjectValue($ObjectValue) if defined($ObjectValue);
+ $KeywordSelect->SetSingle($Single) if defined($SingleMagic);
+ $KeywordSelect->SetGenerations($Generations) if defined($Generations);
+ }
+ $title = "Modify the KeywordSelect <B>". $KeywordSelect->KeywordObj->Name. "</B>";
+ $submit = "Modify";
+
+}
+
+ my $parents = new RT::Keywords($session{CurrentUser});
+ $parents->UnLimit;
+ my $parent;
+
+my $queues = new RT::Queues($session{CurrentUser});
+$queues->UnLimit;
+
+my %queues;
+my $queue;
+$queues{$queue->id} = $queue->Name while $queue = $queues->Next;
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Create => undef
+$Parent => undef
+$ObjectType => undef
+$ObjectField => undef
+$ObjectValue => undef
+$Single => undef
+$SingleMagic => undef
+$Generations => undef
+</%ARGS>
+
+
+ <& /Admin/Elements/ModifyKeywordSelect, 'Create'=>'1' &>
+ </TD>
+
+ <TD VALIGN=TOP>
+ <H2>Modify KeywordSelect</H2>
+
+ <& /Admin/Elements/SelectModifyKeywordSelect &>
+ </TD>
+</TR>
+
+</TABLE>
diff --git a/rt/webrt/Admin/Keywords/Modify.html b/rt/webrt/Admin/Keywords/Modify.html
new file mode 100644
index 000000000..bb7e2db8c
--- /dev/null
+++ b/rt/webrt/Admin/Keywords/Modify.html
@@ -0,0 +1,96 @@
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/Tabs &>
+
+
+<& /Elements/TitleBoxStart, title => %$title &>
+<FORM METHOD="POST" ACTION="<%$RT::WebPath%>/Admin/Keywords/Modify.html">
+<INPUT TYPE="hidden" NAME="id" VALUE="<% $id %>">
+Keyword <INPUT NAME="Name" VALUE="<% $Keyword->Name %>"><BR>
+
+Parent <SELECT NAME="Parent">
+ <OPTION VALUE=""<% defined($Keyword->Parent) ? '' : ' SELECTED' %>>-</OPTION>
+%while ( $parent = $parents->Next ) {
+ <OPTION VALUE="<% $parent->id %>"<% defined($Keyword->Parent) && $parent->id == $Keyword->Parent ? ' SELECTED' : '' %>><% $parent->Name %></OPTION>
+%}
+</SELECT>
+
+
+New children of this keyword. one per line.
+<TEXTAREA NAME="Kids" ROWS=4><% $kidstring %></TEXTAREA>
+<BR>
+
+<& /Elements/Submit, Label => $submit &>
+</FORM>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+
+my $Keyword = new RT::Keyword($session{CurrentUser});
+my ($title, $submit, %kids, $kid);
+
+if ( $Create ) {
+ $title = "Create a new Keyword";
+ $submit = "Create";
+ $id = "new";
+ %kids = ();
+ $Parent = ''; #silence
+}
+else {
+ if ( $id eq 'new' ) {
+ $id = $Keyword->Create( Name => $Name, Parent => $Parent )
+ or Abort("can't create keyword Name=>$Name, Parent=>$Parent");
+ } else {
+ $Keyword->Load($id) || Abort("Can't load keyword id $id");
+
+ #foreach my $field ( grep eval "defined(\$$_)", qw( Name Parent )) {
+ # eval "\$Keyword->Set(\$field=>\$$field); #sigh
+ #}
+
+ $Keyword->SetName($Name) if defined($Name);
+ $Keyword->SetParent($Parent) if defined($Parent);
+ }
+
+ $title = "Modify the Keyword <B>". $Keyword->Name. "</B>";
+ $submit = "Modify";
+}
+
+
+my $kids = $Keyword->Children(new RT::Keywords($session{CurrentUser}));
+
+$kids{$kid->Name} = $kid while $kid = $kids->Next;
+
+if ( defined($Kids) ) {
+ my %newkids;
+
+ %newkids = map { $_=>1 } split(/\r/, $Kids);
+
+ }
+ foreach ( grep { ! defined($newkids{$_}) } keys %kids ) {
+ $kids{$_}->Delete;
+ delete $kids{$_};
+ }
+ foreach ( grep { ! defined($kids{$_}) } keys %newkids ) {
+ $kids{$_} = new RT::Keyword($session{CurrentUser});
+ $kids{$_}->Create( Name => $_, Parent => $id )
+ or Abort("can't create keyword Name=>$_, Parent=>$id");
+ }
+
+}
+
+
+my $parent;
+my $parents = new RT::Keywords($session{CurrentUser});
+$parents->UnLimit;
+
+my $kidstring = join("\r", keys %kids);
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Create => undef
+$Name => undef
+$Parent => undef
+$Kids => undef
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Keywords/index.html b/rt/webrt/Admin/Keywords/index.html
new file mode 100644
index 000000000..12814ec03
--- /dev/null
+++ b/rt/webrt/Admin/Keywords/index.html
@@ -0,0 +1,110 @@
+<& /Elements/Header, Title => 'Admin/Keywords' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/Keywords/' &>
+
+<& /Elements/ListActions, actions => \@Actions &>
+
+<& /Elements/TitleBoxStart, title => 'Keywords' &>
+<a href="<%$RT::WebPath%>/Admin/Keywords/?RootId=<%$Root->Parent%>"><%$Root->Path%></a>
+<UL>
+<FORM METHOD=POST ACTION="index.html">
+<input type=hidden name=RootId value="<%$RootId%>">
+
+
+% while (my $key = $Keywords->Next) {
+ <LI>
+% if ($Edit == $key->id) {
+ <input name="KeyName-<%$key->id%>" value="<%$key->Name%>">
+ <input type=submit value="Update">
+ <input type=submit name="Disable-<%$key->id%>" value="Disable">
+% } else {
+ <A HREF="?RootId=<%$key->id%>"><%$key->Name%></A>
+% if ($key->Disabled) {
+ <input type=submit name="Enable-<%$key->id%>" value="Enable">
+% } else {
+ [<a href="?Edit=<%$key->id%>&RootId=<%$Root->Id%>">edit</a>]
+% }
+% }
+
+
+ </LI>
+% }
+ <LI>
+ <input name="KeyName-New"> <input type=submit value="Add">
+</UL>
+<BR>
+ <input type="checkbox" name="ShowDisabled"> Include disabled items in listing.
+ <input type=submit value="Go!">
+
+</FORM>
+
+<& /Elements/TitleBoxEnd &>
+<%INIT>
+my (@Actions);
+
+if ($ARGS{'KeyName-New'}) {
+ my $NewKey = new RT::Keyword($session{'CurrentUser'});
+ my ($val, $msg) = $NewKey->Create( Parent => $RootId, Name => $ARGS{'KeyName-New'});
+ push (@Actions, $msg);
+}
+
+my $arg;
+foreach $arg (keys %ARGS) {
+ if ($arg =~ /^Disable-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword($session{'CurrentUser'});
+ $keyword->Load($id);
+ my ($val, $msg) = $keyword->SetDisabled(1);
+ push (@Actions, $msg);
+
+
+ }
+ elsif ($arg =~ /^Enable-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword($session{'CurrentUser'});
+ $keyword->Load($id);
+ my ($val, $msg) = $keyword->SetDisabled(0);
+ push (@Actions, $msg);
+ }
+ elsif ($arg =~ /^KeyName-(\d*)$/) {
+ my $id = $1;
+ my $keyword = new RT::Keyword ($session{'CurrentUser'});
+ $keyword->Load($id);
+ if ($keyword->Name() ne $ARGS{"$arg"}) {
+ my ($val, $msg) = $keyword->SetName($ARGS{"$arg"});
+ push (@Actions, $msg);
+ }
+ if (($ARGS{"KeyParent-$id"}) &&
+ ($keyword->Parent ne $ARGS{"KeyParent-$id"})) {
+ my ($val, $msg) = $keyword->SetParent($ARGS{"KeyParent-$id"});
+ push (@Actions, $msg);
+ }
+ }
+}
+
+
+my $Root = new RT::Keyword($session{'CurrentUser'});
+my $Keywords;
+#If we have a root load it.
+if ($RootId != 0) {
+ $Root->Load($RootId);
+ $Keywords = $Root->Children();
+
+}
+else {
+ $Keywords = new RT::Keywords($session{'CurrentUser'});
+ $Keywords->LimitToParent(0);
+}
+
+if ($ShowDisabled) {
+ $Keywords->{'find_disabled_rows'} = 1;
+}
+
+
+
+
+</%INIT>
+<%ARGS>
+$RootId => 0
+$Edit => undef
+$ShowDisabled => 0
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/Create.html b/rt/webrt/Admin/Queues/Create.html
new file mode 100755
index 000000000..b39d6590c
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Create.html
@@ -0,0 +1,13 @@
+<& /Admin/Elements/Header, Title => 'Create a queue' &>
+ <h1>Create a queue</h1>
+
+<& /Admin/Elements/ModifyQueue, QueueObj => $QueueObj &>
+
+<%INIT>
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Create(Name => "$Name");
+</%INIT>
+
+<%ARGS>
+$Name => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/GroupRights.html b/rt/webrt/Admin/Queues/GroupRights.html
new file mode 100755
index 000000000..a2c669083
--- /dev/null
+++ b/rt/webrt/Admin/Queues/GroupRights.html
@@ -0,0 +1,103 @@
+<& /Admin/Elements/Header, Title => 'Modify group rights for queue '. $QueueObj->Name &>
+<& /Admin/Elements/QueueTabs, id => $id &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="GroupRights.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>">
+
+
+
+<& /Elements/TitleBoxStart, title => 'Modify group rights for queue '.$QueueObj->Name &>
+
+<TABLE>
+<TR><TD>Pseudogroups</TD></TR>
+% while (my $GroupObj = $PseudoGroups->Next()) {
+
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $GroupObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj,
+ PrincipalType => 'Group',
+ QueueObj => $QueueObj,
+ Scope => 'Queue' &>
+
+ </TD>
+ </TR>
+
+% }
+
+<TR><TD>Groups</TD></TR>
+
+% while (my $GroupObj = $Groups->Next()) {
+
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $GroupObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $GroupObj,
+ PrincipalType => 'Group',
+ QueueObj => $QueueObj,
+ Scope => 'Queue' &>
+
+ </TD>
+ </TR>
+
+% }
+
+ </TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &>
+ </FORM>
+
+<%INIT>
+
+#Update the acls.
+my @results = ProcessACLChanges(\@CheckACL, \%ARGS);
+
+# {{{ Deal with setting up the display of current rights.
+
+# {{{ do basic initialization.
+
+#Define vars used in html above
+my ($GroupObj);
+
+my ($right);
+
+
+if (!defined $id) {
+ Abort("No Queue defined");
+}
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($id) ||
+ Abort("Couldn't load queue $id");
+
+ # Find out which groups we want to display ACL selects for.
+ my $Groups = new RT::Groups($session{'CurrentUser'});
+ #TODO: limit this to non-pseudogroups
+ $Groups->LimitToReal();
+
+
+ my $PseudoGroups = new RT::Groups($session{'CurrentUser'});
+ #TODO: limit this to non-pseudogroups
+ $PseudoGroups->LimitToPseudo;
+
+
+# }}}
+
+
+ # }}}
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$UserString => undef
+$UserOp => undef
+$UserField => undef
+@CheckACL => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/Keywords.html b/rt/webrt/Admin/Queues/Keywords.html
new file mode 100644
index 000000000..7809805c5
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Keywords.html
@@ -0,0 +1,114 @@
+<& /Admin/Elements/Header, Title => 'Edit keywords' &>
+<& /Admin/Elements/QueueTabs, id => $QueueObj->Id &>
+
+<& /Elements/ListActions, actions => \@actions &>
+
+<& /Elements/TitleBoxStart, title => $description &>
+
+<h2>Global Keyword Selections</h2>
+<& /Admin/Elements/ListGlobalKeywordSelects &>
+<BR>
+
+ <FORM METHOD=POST ACTION="Keywords.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<%$id%>">
+
+% if ($KeywordSelects->Count > 0 ) {
+
+
+<h2>Queue Keyword Selections</h2>
+<TABLE>
+<TR><TD>Delete</TD></TR>
+% while (my $keywordselect = $KeywordSelects->Next ) {
+<TR>
+ <TD><INPUT TYPE="CHECKBOX" NAME="KeywordSelect-<%$keywordselect->Id%>-Delete"></TD>
+ <TD><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $keywordselect &></TD>
+</TR>
+% }
+</TABLE>
+% }
+
+Add a keyword selection to this queue:
+%my $ks = new RT::KeywordSelect($session{'CurrentUser'});
+<ul>
+<li><& /Admin/Elements/SelectKeywordSelect, KeywordSelect => $ks, NamePrefix => 'new' &></li>
+</ul>
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+
+</FORM>
+<%init>
+my (@actions);
+
+
+
+my $KeywordSelects = new RT::KeywordSelects ($session{'CurrentUser'});
+unless ($id =~ /^\d+$/) {
+ Abort("$id isn't a valid Queue id.");
+}
+
+unless ($KeywordSelects->LimitToQueue($id)) {
+ Abort("Couldn't load KeywordSelects.");
+}
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($id);
+
+my $description = "Modify Keyword selections for queue '". $QueueObj->Name ."'";
+
+
+
+# {{{ if we're trying to create a new keyword select
+
+if ($ARGS{'KeywordSelect-new-Name'}) {
+ my $NewKeywordSelect = new RT::KeywordSelect($session{'CurrentUser'});
+
+ my ($retval, $msg) = $NewKeywordSelect->Create ( Keyword => $ARGS{'KeywordSelect-new-Keyword'},
+ ObjectField => 'Queue',
+ ObjectType => 'Ticket',
+ ObjectValue => $QueueObj->Id,
+ Name => $ARGS{'KeywordSelect-new-Name'},
+ Single => $ARGS{'KeywordSelect-new-Single'},
+ Depth => $ARGS{'KeywordSelect-new-Depth'}
+ );
+ push (@actions, $msg);
+}
+# }}}
+# {{{ if we're trying to delete the keywordselect
+foreach my $key (keys %ARGS) {
+ if ($key =~ /^KeywordSelect-(\d+)-Delete$/) {
+ my $id = $1;
+ my $keywordselect = new RT::KeywordSelect($session{'CurrentUser'});
+ $keywordselect->Load($id) || push @actions, "Couldn't load keywordSelect";
+ my ($val, $msg) = $keywordselect->SetDisabled(1);
+ if ($val) {
+ push @actions, 'KeywordSelect disabled.';
+ }
+ else {
+ push @actions, $msg;
+ }
+ }
+}
+# }}}
+# {{{ if we're modifying keyword selects
+my @fields = qw(Name Keyword Single Depth);
+
+while (my $ks = $KeywordSelects->Next) {
+ foreach my $field (@fields) {
+ if (defined ($ARGS{"KeywordSelect-".$ks->Id."-".$field}) &&
+ ($ARGS{"KeywordSelect-".$ks->Id."-".$field} ne $ks->$field())) {
+
+ my $method = "Set$field";
+ my ($val, $msg) = $ks->$method($ARGS{"KeywordSelect-".$ks->Id."-".$field});
+ push @actions, "Keyword Select ". $ks->Name."/$field:".$msg;
+ }
+ }
+}
+# }}}
+
+</%init>
+
+<%ARGS>
+$id => undef #some identifier that a Queue could
+
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/Modify.html b/rt/webrt/Admin/Queues/Modify.html
new file mode 100755
index 000000000..7a200df92
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Modify.html
@@ -0,0 +1,137 @@
+<& /Admin/Elements/Header, Title => 'Admin/Queue/Basics' &>
+<& /Admin/Elements/QueueTabs, id => $QueueObj->id &>
+<& /Elements/ListActions, actions => \@results &>
+
+
+
+<& /Elements/TitleBoxStart, title => $title &>
+
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST>
+%if ($Create ) {
+<INPUT TYPE=HIDDEN NAME=id VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>">
+% }
+
+<TABLE>
+<TR><TD ALIGN=RIGHT>
+Queue Name:
+</TD>
+<TD><INPUT name="Name" value="<%$QueueObj->Name%>"></TD>
+</TR><TR>
+<TD ALIGN=RIGHT>
+Description:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$QueueObj->Description%>" size=60></TD></TR>
+<TR>
+<TD ALIGN=RIGHT>
+Correspondence Address:
+</TD><TD>
+<INPUT name="CorrespondAddress" value="<%$QueueObj->CorrespondAddress%>">
+<BR><font size="-1"><i>(If left blank, will default to <%$RT::CorrespondAddress%></i></font>
+</TD>
+<TD ALIGN=RIGHT>
+
+Comment Address: </TD><TD>
+<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>">
+<BR><font size="-1"><i>(If left blank, will default to <%$RT::CommentAddress%></i></font>
+</TD>
+</TR><TR>
+
+<TD ALIGN=RIGHT>
+Priority starts at:
+</TD><TD><INPUT NAME="InitialPriority" value="<%$QueueObj->InitialPriority %>">
+</TD>
+<TD ALIGN=RIGHT>
+Over time, priority moves toward:
+</TD><TD><INPUT NAME="FinalPriority" value="<%$QueueObj->FinalPriority %>">
+</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT>
+Requests should be due in:
+</TD><TD>
+<INPUT NAME="DefaultDueIn" VALUE="<%$QueueObj->DefaultDueIn%>"> days.
+</TD>
+</TR>
+<TR>
+<TD>
+</TD>
+<TD COLSPAN=4><INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1">
+<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> Enabled (Unchecking this box disables this queue)<BR>
+</TD>
+</TR>
+
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+</form>
+
+
+
+<%INIT>
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+my ($title, @results, $Disabled, $EnabledChecked);
+
+if ($Create) {
+ $title = "Create a queue";
+}
+
+else {
+ if ($id eq 'new') {
+ my ($val, $msg) = $QueueObj->Create(Name => $Name);
+ if ($val == 0 ) {
+ Abort("Could not create queue: $msg");
+ }
+ else {
+ push @results, $msg;
+ }
+ }
+ else {
+ $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort("Couldn't load queue '$Name'");
+ }
+ $title = 'Editing Configuration for queue '.$QueueObj->Name;
+
+}
+if ($QueueObj->Id()) {
+my @attribs= qw(Description CorrespondAddress CommentAddress Name
+ InitialPriority FinalPriority DefaultDueIn);
+
+ @results = UpdateRecordObject( AttributesRef => \@attribs,
+ Object => $QueueObj,
+ ARGSRef => \%ARGS);
+
+}
+
+#we're asking about enabled on the web page but really care about disabled.
+if ($Enabled == 1) {
+ $Disabled = 0;
+}
+else {
+ $Disabled = 1;
+}
+if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) {
+ my ($code, $msg) = $QueueObj->SetDisabled($Disabled);
+ push @results, 'Enabled status '. $msg;
+}
+
+unless ($QueueObj->Disabled()) {
+ $EnabledChecked ="CHECKED";
+}
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$result => undef
+$Name => undef
+$Create => undef
+$Description => undef
+$CorrespondAddress => undef
+$CommentAddress => undef
+$InitialPriority => undef
+$FinalPriority => undef
+$DefaultDueIn => undef
+$SetEnabled => undef
+$Enabled => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/People.html b/rt/webrt/Admin/Queues/People.html
new file mode 100755
index 000000000..b495400ed
--- /dev/null
+++ b/rt/webrt/Admin/Queues/People.html
@@ -0,0 +1,161 @@
+<& /Elements/Header, Title => 'Modify people related to queue ' . $QueueObj->Name &>
+<& /Admin/Elements/QueueTabs, id => $id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+
+<FORM METHOD=POST ACTION="People.html">
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>">
+<& /Elements/TitleBoxStart, title => 'Modify watchers for queue \''.$QueueObj->Name ."'", width => "100%" &>
+
+<TABLE WIDTH=100%>
+<TR>
+<TD VALIGN=TOP >
+
+<h3>Current watchers</h3>
+<i>(Check box to delete)</i><br><BR>
+
+
+Cc:
+
+<ul>
+
+%# Print out a placeholder if there are none.
+%if ($cc->Count == 0 ) {
+<li><i>none</i>
+% }
+
+%while (my $watcher=$cc->Next) {
+<li>
+<INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED>
+%# account
+%if ($watcher->IsUser) {
+<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->OwnerObj->id%>">
+<%$watcher->OwnerObj->RealName%></a>:
+%} else {
+Email address:
+%}
+<i><%$watcher->Email%></i>
+%}
+</ul>
+
+
+Administrative Cc:
+<UL>
+%# Print out a placeholder if there are none.
+%if ($admincc->Count == 0 ) {
+<li><i>none</i>
+% }
+
+%while (my $watcher=$admincc->Next) {
+<li><INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED>
+%# account
+%if ($watcher->IsUser) {
+<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->OwnerObj->id%>">
+<%$watcher->OwnerObj->RealName%></a>:
+%} else {
+Email address:
+%}
+<i><%$watcher->Email%></i>
+%}
+</UL>
+</TD>
+
+<TD VALIGN=TOP>
+<h3>New watchers</h3>
+Find people whose<BR>
+<& /Elements/SelectUsers &>
+
+<BR>
+Add new watchers:<br>
+
+% if ($msg) {
+<i><%$msg%></i>
+% } elsif ($Users) {
+<ul>
+% while (my $u = $Users->Next ) {
+<li><&/Elements/SelectWatcherType, Scope=>'queue', Name => "WatcherTypeUser".$u->Id &> <%$u->Name%>
+(<%$u->RealName%>)
+% }
+</ul>
+% }
+
+</TD>
+</TR>
+</TABLE>
+
+
+
+
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to" &>
+</form>
+
+<%INIT>
+
+my ($field, @results, $User, $Users, $watcher, $key, $msg);
+# {{{ Load the queue
+#If we get handed two ids, mason will make them an array. bleck.
+# We want teh first one. Just because there's no other sensible way
+# to deal
+
+
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($id) || Abort("Couldn't load queue '$id'");
+# }}}
+
+# {{{ Delete deletable watchers
+
+foreach $key (keys %ARGS) {
+ if (($key =~ /^DelWatcher(\d*)$/) and
+ ($ARGS{$key})) {
+ $RT::Logger->debug("Deleting watcher $1\n");
+ my ($code, $msg) = $QueueObj->DeleteWatcher($1);
+
+ push @results, $msg;
+ }
+}
+# }}}
+
+# {{{ Add new watchers
+foreach $key (keys %ARGS) {
+ #They're in this order because otherwise $1 gets clobbered :/
+ if ( ($ARGS{$key} =~ /^(AdminCc|Cc)$/) and
+ ($key =~ /^WatcherTypeUser(\d*)$/) ) {
+ $RT::Logger->debug("Adding a watcher $1 to ".$ARGS{$key}."\n");
+ my ($code, $msg) =
+ $QueueObj->AddWatcher(Type => $ARGS{$key},
+ Owner => $1);
+ push @results, $msg;
+ }
+}
+
+# }}}
+
+
+
+my $admincc = $QueueObj->AdminCc;
+my $cc = $QueueObj->Cc;
+
+
+if (!$ARGS{'UserString'}) {
+$msg = "No users selected.";
+ }
+else {
+ $Users = new RT::Users($session{'CurrentUser'});
+ $Users->Limit(FIELD => $ARGS{'UserField'},
+ VALUE => $ARGS{'UserString'},
+ OPERATOR => $ARGS{'UserOp'});
+ }
+</%INIT>
+
+<%ARGS>
+$UserField => 'Name'
+$UserOp => '='
+$UserString => undef
+$Type => undef
+$id => undef
+</%ARGS>
+
diff --git a/rt/webrt/Admin/Queues/Scrips.html b/rt/webrt/Admin/Queues/Scrips.html
new file mode 100755
index 000000000..95b8c4378
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Scrips.html
@@ -0,0 +1,111 @@
+<& /Admin/Elements/Header, Title => 'Edit scrips' &>
+<& /Admin/Elements/QueueTabs, id => $QueueObj->Id &>
+
+<& /Elements/ListActions, actions => \@actions &>
+
+<& /Elements/TitleBoxStart, title => $description &>
+
+<h2>Global Scrips</h2>
+<& /Admin/Elements/ListGlobalScrips &>
+<BR>
+ <FORM METHOD=POST ACTION="Scrips.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE=<%$id%>>
+<h2>Queue Scrips</h2>
+% if ($Scrips->Count > 0 ) {
+<TABLE>
+<TR>
+<TD>Delete
+</TD>
+<TD>
+</TR>
+% while (my $scrip = $Scrips->Next ) {
+<TR>
+<TD>
+<INPUT TYPE="CHECKBOX" NAME="DeleteScrip-<%$scrip->Id%>">
+</TD>
+<TD>
+<% $scrip->ConditionObj->Name %>
+<% $scrip->ActionObj->Name %> with template
+<% $scrip->TemplateObj->Name %>
+</TD>
+</TR>
+% }
+</TABLE>
+% }
+<BR>
+<h2>Add a scrip to this queue</h2>
+Condition: <& /Admin/Elements/SelectScripCondition, Name => 'NewScripCondition' &>
+ Action: <& /Admin/Elements/SelectScripAction, Name => 'NewScripAction' &>
+ Template: <& /Admin/Elements/SelectTemplate, Name => 'NewScripTemplate', DefaultQueue => $id &>
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+</FORM>
+<%init>
+my (@actions, $description);
+
+my $Scrips = new RT::Scrips ($session{'CurrentUser'});
+unless ($id =~ /^\d+$/) {
+ Abort("$id isn't a valid Queue id.");
+}
+
+unless ($Scrips->LimitToQueue($id)) {
+ Abort("Couldn't load Scrips.");
+ }
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($id);
+
+if ($QueueObj->id) {
+ $description = "Modify scrips for queue '". $QueueObj->Name ."'";
+}
+else {
+ $description = "Modify global scrips";
+}
+
+
+if ($NewScripAction and $NewScripCondition) {
+ my $NewScrip = new RT::Scrip($session{'CurrentUser'});
+
+ my ($retval, $msg) = $NewScrip->Create ( ScripAction => $NewScripAction,
+ ScripCondition => $NewScripCondition,
+ Stage => 'TransactionCreate',
+ Queue => $id,
+ Template => $NewScripTemplate);
+ if (defined $retval) {
+ push @actions, $msg;
+ }
+ else {
+ push @actions, $msg;
+ }
+}
+
+# {{{ deal with modifying and deleting existing scrips
+my ($key );
+foreach $key (keys %ARGS) {
+ # {{{ if we're trying to delete the scrip
+ if ($key =~ /^DeleteScrip-(\d+)/) {
+ my $id = $1;
+ my $scrip = new RT::Scrip($session{'CurrentUser'});
+ $scrip->Load($id);
+ my ($retval, $msg) = $scrip->Delete;
+ if ($retval) {
+ push @actions, 'Scrip deleted';
+ }
+ else {
+ push @actions, $msg;
+ }
+ }
+ # }}}
+
+
+}
+# }}}
+</%init>
+
+<%ARGS>
+$NewScripCondition => undef
+$NewScripAction => undef
+$NewScripTemplate => undef
+$id => undef #some identifier that a Queue could
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/Template.html b/rt/webrt/Admin/Queues/Template.html
new file mode 100755
index 000000000..61ee418a6
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Template.html
@@ -0,0 +1,68 @@
+<& /Admin/Elements/Header, title => "Modify template ".$TemplateObj->id&>
+<& /Admin/Elements/QueueTabs, id => $Queue &>
+<& /Elements/ListActions, actions => \@results &>
+
+<& /Elements/TitleBoxStart, title => $title &>
+
+<FORM METHOD=POST ACTION="Template.html">
+%if ($create ) {
+<INPUT TYPE=HIDDEN NAME=template VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=template VALUE="<%$TemplateObj->Id%>">
+% }
+
+%# hang onto the queue id
+<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>">
+
+
+Name: <input name="Name" VALUE="<%$TemplateObj->Name%>" SIZE=20><BR>
+Description: <input name="Description" VALUE="<%$TemplateObj->Description%>" SIZE=80><BR>
+
+<TEXTAREA NAME=Content ROWS=25 COLS=80 WRAP=SOFT>
+<%$TemplateObj->Content%></TEXTAREA>
+
+<& /Elements/TitleBoxEnd&>
+<&/Elements/Submit&>
+</FORM>
+
+
+
+<%INIT>
+
+my $TemplateObj = new RT::Template($session{'CurrentUser'});
+my ($title, @results);
+
+if ($create) {
+ $title = "Create a template";
+}
+
+else {
+ if ($template eq 'new') {
+ my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name);
+ Abort("Could not create template: $msg") unless ($val);
+ push @results, $msg;
+ $title = 'Created template ' . $TemplateObj->Name();
+ }
+ else {
+ $TemplateObj->Load($template) || Abort('No Template');
+ $title = 'Editing template ' . $TemplateObj->Name();
+ }
+
+
+}
+if ($TemplateObj->Id()) {
+ $Queue = $TemplateObj->Queue;
+
+ my @attribs = qw( Description Content Queue Name);
+ my @aresults = UpdateRecordObject( AttributesRef => \@attribs,
+ Object => $TemplateObj,
+ ARGSRef => \%ARGS);
+ push @results, @aresults;
+}
+</%INIT>
+<%ARGS>
+$Queue => undef
+$template => undef
+$create => undef
+$Name => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/Templates.html b/rt/webrt/Admin/Queues/Templates.html
new file mode 100755
index 000000000..218d41dc9
--- /dev/null
+++ b/rt/webrt/Admin/Queues/Templates.html
@@ -0,0 +1,24 @@
+<& /Admin/Elements/Header, Title => 'Edit templates for '.$Queue->Name &>
+<& /Admin/Elements/QueueTabs, id => $Queue->id &>
+
+<& /Elements/TitleBoxStart, title => 'Edit templates for '.$Queue->Name &>
+<UL>
+<LI><A href="Template.html?create=1&Queue=<%$Queue->id%>">Create a new template</A><BR><BR>
+
+%while (my $TemplateObj = $Templates->Next) {
+
+<LI><A HREF="Template.html?Queue=<%$id%>&template=<%$TemplateObj->id()%>"><%$TemplateObj->id()%>/<%$TemplateObj->Name%>: <%$TemplateObj->Description%></a><BR>
+
+%}
+
+<& /Elements/TitleBoxEnd &>
+<%INIT>
+
+my $Queue = new RT::Queue($session{'CurrentUser'});
+$Queue->Load($id);
+my $Templates = $Queue->Templates;
+
+</%INIT>
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/UserRights.html b/rt/webrt/Admin/Queues/UserRights.html
new file mode 100755
index 000000000..75d9cb282
--- /dev/null
+++ b/rt/webrt/Admin/Queues/UserRights.html
@@ -0,0 +1,72 @@
+<& /Admin/Elements/Header, Title => 'Modify user rights for queue '. $QueueObj->Name &>
+<& /Admin/Elements/QueueTabs, id => $id &>
+<& /Elements/ListActions, actions => \@results &>
+
+ <FORM METHOD=POST ACTION="UserRights.html">
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>">
+
+<& /Elements/TitleBoxStart, title => 'Modify user rights for queue '.$QueueObj->Name &>
+
+<TABLE>
+
+% while (my $UserObj = $Users->Next()) {
+ <TR ALIGN=RIGHT>
+ <TD VALIGN=TOP>
+ <% $UserObj->Name %>
+ </TD>
+ <TD>
+ <& /Admin/Elements/SelectRights, PrincipalObj => $UserObj,
+ PrincipalType => 'User',
+ Scope => 'Queue',
+ QueueObj => $QueueObj &>
+ </TD>
+ </TR>
+% }
+ </TABLE>
+
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/Submit, Caption => "Be sure to save your changes", Reset => 1 &>
+
+ </FORM>
+
+<%INIT>
+
+ #Update the acls.
+ my @results = ProcessACLChanges(\@CheckACL, \%ARGS);
+
+# {{{ Deal with setting up the display of current rights.
+
+# {{{ do basic initialization.
+
+#Define vars used in html above
+my ($GroupObj);
+
+my ($right);
+
+
+if (!defined $id) {
+ Abort("No Queue defined");
+}
+
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($id) ||
+ Abort("Couldn't load queue $id");
+
+# Find out which users we want to display ACL selects for
+my $Users = new RT::Users($session{'CurrentUser'});
+$Users->LimitToPrivileged();
+
+# }}}
+
+
+# }}}
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$UserString => undef
+$UserOp => undef
+$UserField => undef
+@CheckACL => undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Queues/index.html b/rt/webrt/Admin/Queues/index.html
new file mode 100755
index 000000000..52dfb73c8
--- /dev/null
+++ b/rt/webrt/Admin/Queues/index.html
@@ -0,0 +1,52 @@
+<& /Admin/Elements/Header, Title => 'Admin queues' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/Queues/' &>
+
+
+<& /Elements/TitleBoxStart, title => 'Select a queue' &>
+
+<TABLE>
+<TR>
+<TD VALIGN=TOP>
+
+<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Queues/">
+
+<input type="checkbox" name="FindDisabledQueues"> Include disabled queues in listing.
+<BR>
+<div align=right><input type=submit value="Go!"></div>
+</FORM>
+</TD>
+<TD VALIGN=TOP>
+<UL>
+% if ($session{'CurrentUser'}->HasSystemRight('AdminQueue')) {
+<LI><A HREF="<%$RT::WebPath%>/Admin/Queues/Modify.html?Create=1">Create a new queue</A><BR><BR></LI>
+</UL>
+% }
+
+<%$caption%><BR>
+<UL>
+%if ($queues->Count == 0) {
+<LI> <i>No queues matching search criteria found.</i>
+% }
+%while ( $queue = $queues->Next) {
+<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI>
+%}
+
+</UL>
+</TD>
+</TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+my ($queue, $caption);
+my $queues = new RT::Queues($session{'CurrentUser'});
+$queues->UnLimit();
+
+if ($FindDisabledQueues) {
+ $queues->{'find_disabled_rows'} = 1;
+}
+
+</%INIT>
+<%ARGS>
+$FindDisabledQueues => 0
+</%ARGS>
diff --git a/rt/webrt/Admin/Users/Modify.html b/rt/webrt/Admin/Users/Modify.html
new file mode 100755
index 000000000..b6daed49b
--- /dev/null
+++ b/rt/webrt/Admin/Users/Modify.html
@@ -0,0 +1,259 @@
+<& /Admin/Elements/Header, Title => $title &>
+<& /Admin/Elements/UserTabs, id => $id, current_subtab => '/Admin/Elements/Modify.html?id='.$id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST>
+%if ($Create) {
+<INPUT TYPE=HIDDEN NAME=id VALUE="new">
+% } else {
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>">
+% }
+
+<TABLE WIDTH=100% BORDER=0>
+<TR>
+
+<TD VALIGN=TOP ROWSPAN=2>
+<& /Elements/TitleBoxStart, title => 'Identity' &>
+
+Username: <input name="Name" value="<%$UserObj->Name%>"> <b>(required)</b> <BR>
+Email: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>"><BR>
+Real Name: <input name="RealName" value="<%$UserObj->RealName%>"> <BR>
+Nickname: <input name="NickName" value="<%$UserObj->NickName%>">
+<BR>
+Unix login: <input name="Gecos" value="<%$UserObj->Gecos%>">
+<BR>
+Extra info: <textarea name="FreeformContactInfo" cols=20 rows=5><%$UserObj->FreeformContactInfo%></TEXTAREA>
+<& /Elements/TitleBoxEnd &>
+</TD>
+<TD VALIGN=TOP>
+<& /Elements/TitleBoxStart, title => 'Access control' &>
+<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1">
+<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>>
+Let this user access RT<BR>
+
+
+<INPUT TYPE=HIDDEN NAME="SetPrivileged" VALUE="1">
+<INPUT TYPE=CHECKBOX NAME="Privileged" VALUE="1" <%$PrivilegedChecked%>> Let this user be granted rights<BR>
+
+% unless ($RT::WebExternalAuth) {
+<TABLE>
+<TR>
+<TD ALIGN=RIGHT>
+New Password:
+</TD>
+<TD ALIGN=LEFT>
+<input type=password name="Pass1">
+</TD>
+</TR>
+<TR><TD ALIGN=RIGHT>
+Retype Password:
+</TD>
+<TD>
+<input type=password name="Pass2">
+</TD>
+</TR>
+</TABLE>
+% }
+<& /Elements/TitleBoxEnd &>
+</TD>
+<TR>
+
+<TD VALIGN=TOP>
+<& /Elements/TitleBoxStart, title => 'Location' &>
+Organization: <input name="Organization" value="<%$UserObj->Organization%>">
+<BR>
+Address1: <input name="Address1" value="<%$UserObj->Address1%>">
+<BR>
+Address2: <input name="Address2" value="<%$UserObj->Address2%>">
+<BR>
+City: <input name="City" value="<%$UserObj->City%>" size=14>
+
+State: <input name="State" value="<%$UserObj->State%>" size=3>
+
+Zip: <input name="Zip" value="<%$UserObj->Zip%>" size=9>
+<BR>
+Country: <input name="Country" value="<%$UserObj->Country%>">
+<BR>
+
+
+<& /Elements/TitleBoxEnd &>
+</TD>
+</TR>
+<TR>
+<TD COLSPAN=2 VALIGN=TOP>
+
+
+<& /Elements/TitleBoxStart, title => 'Phone numbers' &>
+Home: <input name="HomePhone" value="<%$UserObj->HomePhone%>" size=13>
+
+Work: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>" size=13>
+
+Mobile: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>" size=13>
+
+Pager: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>" size=13>
+<& /Elements/TitleBoxEnd &>
+<BR>
+<& /Elements/TitleBoxStart, title => 'Comments about this user' &>
+<TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%></TEXTAREA>
+<& /Elements/TitleBoxEnd &>
+
+
+%if ($UserObj->Privileged) {
+<BR>
+<& /Elements/TitleBoxStart, title => 'Signature' &>
+<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD>
+<%$UserObj->Signature%></TEXTAREA>
+<& /Elements/TitleBoxEnd &>
+% }
+
+</TD>
+
+</TR>
+</TABLE>
+
+
+<& /Elements/Submit &>
+</form>
+
+
+<%INIT>
+
+my $UserObj = new RT::User($session{'CurrentUser'});
+my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results);
+
+my ($val, $msg);
+
+if ($Create) {
+ $title = "Create a new user";
+}
+else {
+
+ if ($id eq 'new') {
+ ($val, $msg) = $UserObj->Create( Name => $Name,
+ EmailAddress => $ARGS{'EmailAddress'}
+ );
+ if ($val) {
+ push @results, $msg;
+ } else {
+ push @results, 'User could not be created: '. $msg;
+ }
+
+ }
+ else {
+ $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'");
+ $val = $UserObj->Id();
+ }
+
+ if ($val) {
+ $title = "Modify the user ". $UserObj->Name;
+ }
+
+ # If the create failed
+ else {
+ $title = "Create a new user";
+ $Create = 1;
+ }
+
+
+
+}
+
+
+
+
+# If we have a user to modify, lets try.
+if ($UserObj->Id) {
+
+ my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo
+ Organization RealName NickName Lang EmailEncoding WebEncoding
+ ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId
+ AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1
+ Address2 City State Zip Country
+ );
+
+ my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields,
+ Object => $UserObj,
+ ARGSRef => \%ARGS );
+ push (@results,@fieldresults);
+
+
+# {{{ Deal with special fields: Privileged, Enabled and Password
+if ( ($SetPrivileged) and ( $Privileged != $UserObj->Privileged) ) {
+my ($code, $msg) = $UserObj->SetPrivileged($Privileged);
+ push @results, 'Privileged status: '. $msg;
+}
+
+#we're asking about enabled on the web page but really care about disabled.
+if ($Enabled == 1) {
+ $Disabled = 0;
+}
+else {
+ $Disabled = 1;
+}
+if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) {
+ my ($code, $msg) = $UserObj->SetDisabled($Disabled);
+ push @results, 'Enabled status '. $msg;
+}
+
+
+#TODO: make this report errors properly
+if ((defined $Pass1) and ($Pass1 ne '') and ($Pass1 eq $Pass2) and (!$UserObj->IsPassword($Pass1))) {
+ my ($code, $msg);
+ ($code, $msg) = $UserObj->SetPassword($Pass1);
+ push @results, 'Password: '. $msg;
+}
+
+# }}}
+}
+
+
+# {{{ Do some setup for the ui
+unless ($UserObj->Disabled()) {
+ $EnabledChecked ="CHECKED";
+}
+
+if ($UserObj->Privileged()) {
+ $PrivilegedChecked = "CHECKED";
+}
+
+# }}}
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+$Name => undef
+$Comments => undef
+$Signature => undef
+$EmailAddress => undef
+$FreeformContactInfo => undef
+$Organization => undef
+$RealName => undef
+$NickName => undef
+$Privileged => undef
+$SetPrivileged => undef
+$Enabled => undef
+$SetEnabled => undef
+$Lang => undef
+$EmailEncoding => undef
+$WebEncoding => undef
+$ExternalContactInfoId => undef
+$ContactInfoSystem => undef
+$Gecos => undef
+$ExternalAuthId => undef
+$AuthSystem => undef
+$HomePhone => undef
+$WorkPhone => undef
+$MobilePhone => undef
+$PagerPhone => undef
+$Address1 => undef
+$Address2 => undef
+$City => undef
+$State => undef
+$Zip => undef
+$Country => undef
+$Pass1 => undef
+$Pass2=> undef
+$Create=> undef
+</%ARGS>
diff --git a/rt/webrt/Admin/Users/Prefs.html b/rt/webrt/Admin/Users/Prefs.html
new file mode 100755
index 000000000..4a9fc5cdf
--- /dev/null
+++ b/rt/webrt/Admin/Users/Prefs.html
@@ -0,0 +1,97 @@
+<& /Elements/Header, Title=>"User view" &>
+
+<& /Elements/ViewUser, User=>$u &>
+
+%if ($session{CurrentUser} && ($session{CurrentUser}->Id == $id)) {
+ <& /Elements/TitleBoxStart, title => 'Signature' &>
+<form method=post>
+<input type="hidden" name="id" value=<%$id%>>
+<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $u->Signature %></TEXTAREA><br><br>
+<input type="submit" value="Update signature">
+</form>
+ <& /Elements/TitleBoxEnd &>
+ <form method=post>
+ Open tickets (from listing) in another window: <input type="checkbox" name="NewWindowOption" <%exists $session{NewWindowOption} && "CHECKED"%>><br>
+ Open tickets (from listing) in a new window: <input type="checkbox" name="AlwaysNewWindowOption" <%exists $session{AlwaysNewWindowOption} && "CHECKED"%>><br>
+ <input type="submit" name="NewWindowSetting" value="New window setting">
+ </form>
+%}
+
+ <& /Elements/TitleBoxStart, title => 'Email' &>
+<form method=post>
+<input type="hidden" name="id" value="<%$id%>">
+<input name="Email" value="<% $u->EmailAddress %>"><input type="submit" value="Update email">
+</form>
+ <& /Elements/TitleBoxEnd &>
+ <& /Elements/TitleBoxStart, title => 'Real Name' &>
+<form method=post>
+<input type="hidden" name="id" value="<%$id%>">
+<input name="RealName" value="<% $u->RealName %>"><input type="submit" value="Update name">
+</form>
+ <& /Elements/TitleBoxEnd &>
+
+ <& /Elements/TitleBoxStart, title => 'User ID' &>
+<form method=post>
+<input type="hidden" name="id" value="<%$id%>">
+<input name="Name" value="<% $u->Name %>"><input type="submit" value="Update ID">
+</form>
+ <& /Elements/TitleBoxEnd &>
+
+%# TODO: alternative email addresses + merging users
+
+<%ARGS>
+$id => $session{CurrentUser} ? $session{CurrentUser}->Id : 0
+$Signature => undef
+$Email => undef
+$RealName => undef
+$Name => undef
+</%ARGS>
+
+<%INIT>
+require RT::User;
+my $u=RT::User->new($session{CurrentUser});
+$u->Load($id) || die "Couldn't load that user ($id)";
+if ($Signature) {
+my ($val, $msg)=$u->SetSignature($Signature);
+$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
+}
+
+if ($Email) {
+my ($val, $msg)=$u->SetEmailAddress($Email);
+$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
+}
+
+if ($RealName) {
+my ($val, $msg)=$u->SetRealName($RealName);
+$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
+}
+
+if ($Name) {
+my ($val, $msg)=$u->SetName($Name);
+$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg);
+}
+
+if ($ARGS{NewWindowSetting}) {
+if ($ARGS{NewWindowOption}) {
+$session{NewWindowOption}=1;
+} else {
+delete $session{NewWindowOption};
+}
+if ($ARGS{AlwaysNewWindowOption}) {
+$session{NewWindowOption}=1;
+$session{AlwaysNewWindowOption}=1;
+} else {
+delete $session{AlwaysNewWindowOption};
+}
+}
+
+</%INIT>
+
+
+
+
+
+
+
+
+
diff --git a/rt/webrt/Admin/Users/Rights.html b/rt/webrt/Admin/Users/Rights.html
new file mode 100644
index 000000000..3b94f9157
--- /dev/null
+++ b/rt/webrt/Admin/Users/Rights.html
@@ -0,0 +1 @@
+Placeholder
diff --git a/rt/webrt/Admin/Users/index.html b/rt/webrt/Admin/Users/index.html
new file mode 100755
index 000000000..383513710
--- /dev/null
+++ b/rt/webrt/Admin/Users/index.html
@@ -0,0 +1,71 @@
+<& /Admin/Elements/Header, Title => 'Admin users' &>
+<& /Admin/Elements/Tabs, current_tab => 'Admin/Users/' &>
+
+
+<& /Elements/TitleBoxStart, title => 'Select a user' &>
+
+<TABLE>
+<TR>
+<TD VALIGN=TOP>
+
+<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Users/">
+
+Find people whose <& /Elements/SelectUsers &><BR>
+<input type="checkbox" name="FindDisabledUsers"> Include disabled users in search.
+<BR>
+<div align=right><input type=submit value="Go!"></div>
+</FORM>
+</TD>
+<TD VALIGN=TOP>
+<UL>
+% if ($session{'CurrentUser'}->HasSystemRight('AdminUsers')) {
+<LI><A HREF="<%$RT::WebPath%>/Admin/Users/Modify.html?Create=1">Create a new user</A><BR><BR></LI>
+</UL>
+% }
+
+<%$caption%><BR>
+<UL>
+%if ($users->Count == 0) {
+<LI> <i>No users matching search criteria found.</i>
+% }
+%while ( $user = $users->Next) {
+<LI><A HREF="Modify.html?id=<%$user->id%>"><%$user->Name || '(no name listed)'%></a></LI>
+%}
+
+</UL>
+</TD>
+</TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+my ($user, $caption);
+my $users = new RT::Users($session{'CurrentUser'});
+
+if ($FindDisabledUsers) {
+ $users->{'find_disabled_rows'} = 1;
+}
+
+unless (defined $UserString) {
+ $users->LimitToPrivileged();
+ $caption = "Privileged users";
+}
+else {
+ $caption = "Users matching search criteria";
+
+ if ($UserString) {
+ $users->Limit( FIELD => $UserField,
+ OPERATOR => $UserOp,
+ VALUE => $UserString);
+
+}
+}
+</%INIT>
+<%ARGS>
+$UserString => undef
+$UserOp => '='
+$UserField => 'Name'
+$IdLike => undef
+$EmailLike => undef
+$FindDisabledUsers => 0
+</%ARGS>
diff --git a/rt/webrt/Admin/index.html b/rt/webrt/Admin/index.html
new file mode 100755
index 000000000..1ed973f7e
--- /dev/null
+++ b/rt/webrt/Admin/index.html
@@ -0,0 +1,4 @@
+ <& /Admin/Elements/Header, Title => 'RT Administration' &>
+<& /Admin/Elements/Tabs &>
+
+
diff --git a/rt/webrt/Elements/Checkbox b/rt/webrt/Elements/Checkbox
new file mode 100755
index 000000000..964c482ba
--- /dev/null
+++ b/rt/webrt/Elements/Checkbox
@@ -0,0 +1,17 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/Checkbox,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<INPUT TYPE="Checkbox" NAME ="<%$Name%>" <%$IsChecked%>>
+
+<%ARGS>
+$Name => undef
+$Default => undef
+$True => undef
+$False => undef
+$IsChecked => undef
+</%ARGS>
+
+<%INIT>
+$IsChecked =
+ ($Default && $Default =~ /checked/i)
+ ? " CHECKED " : "";
+1;
+</%INIT>
diff --git a/rt/webrt/Elements/CreateTicket b/rt/webrt/Elements/CreateTicket
new file mode 100644
index 000000000..1270f6ebe
--- /dev/null
+++ b/rt/webrt/Elements/CreateTicket
@@ -0,0 +1 @@
+<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html"><input type=submit value="New ticket in">&nbsp;<& /Elements/SelectNewTicketQueue &></FORM>
diff --git a/rt/webrt/Elements/CustomHomepageHeader b/rt/webrt/Elements/CustomHomepageHeader
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/rt/webrt/Elements/CustomHomepageHeader
diff --git a/rt/webrt/Elements/Error b/rt/webrt/Elements/Error
new file mode 100755
index 000000000..ec2cf511f
--- /dev/null
+++ b/rt/webrt/Elements/Error
@@ -0,0 +1,23 @@
+<& /Elements/Header, Code => $Code, Why => $Why &>
+<& /Elements/Tabs &>
+<& /Elements/TitleBoxStart, title => $Title &>
+<%$Why%>
+<br>
+<font size=-1>
+<%$Details%>
+</font>
+<& /Elements/TitleBoxEnd &>
+</body>
+</HTML>
+
+
+<%args>
+$Code => undef
+$Details => undef
+$Title => "RT Error"
+$Why => "the calling component did not specify why"
+</%args>
+
+<%INIT>
+$RT::Logger->error("WebRT: $Why ($Details)");
+</%INIT>
diff --git a/rt/webrt/Elements/Footer b/rt/webrt/Elements/Footer
new file mode 100755
index 000000000..776c219bb
--- /dev/null
+++ b/rt/webrt/Elements/Footer
@@ -0,0 +1,10 @@
+% if ($Debug) {
+<HR>
+<b>Time to display: <%time - $m->{'rt_base_time'} %></b>
+% }
+</BODY>
+</HTML>
+
+<%ARGS>
+$Debug => 0
+</%ARGS>
diff --git a/rt/webrt/Elements/GotoTicket b/rt/webrt/Elements/GotoTicket
new file mode 100644
index 000000000..21d2bcdf8
--- /dev/null
+++ b/rt/webrt/Elements/GotoTicket
@@ -0,0 +1 @@
+<FORM ACTION="<%$RT::WebPath%>/Ticket/Display.html"><input type=submit value="Goto ticket">&nbsp;<input size=5 name=id></FORM>
diff --git a/rt/webrt/Elements/Header b/rt/webrt/Elements/Header
new file mode 100755
index 000000000..471331be2
--- /dev/null
+++ b/rt/webrt/Elements/Header
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE><%$Title%></TITLE>
+<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
+
+%# TODO this gets called from error. but I have no idea what it might
+%# be used for. can we whack it? -jesse
+% if ($Code) {
+<META HTTP-EQUIV VALUE="<%$Code%> <%$Why%>">
+% }
+% if ($Refresh > 0) {
+<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>">
+% }
+
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
+</HEAD>
+<BODY BGCOLOR="<%$BgColor%>">
+% if ($ShowBar) {
+<TABLE BORDER=0 WIDTH=100% CELLSPACING=0 BGCOLOR="#993333">
+<TR VALIGN=TOP>
+<TD><IMG SRC="<%$RT::LogoURL%>" alt="RT"></TD>
+<TD VALIGN=CENTER ALIGN=LEFT>
+<font size=+2 color="#ffffff">
+<B>
+<%$Title%>
+</B>
+</font>
+</TD>
+<TD ALIGN=RIGHT>
+<font color="#ffffff">
+% if ($session{'CurrentUser'}) {
+Signed in as <b><%$session{'CurrentUser'}->Name%></b>.<BR>
+% if ($session{'CurrentUser'}->HasSystemRight('ModifySelf')) {
+[<A class='inverse' HREF="<%$RT::WebPath%>/User/Prefs.html" >Preferences</A>]
+% }
+% unless ($RT::WebExternalAuth) {
+[<A class='inverse' HREF="<%$RT::WebPath%>/NoAuth/Logout.html">Logout</a>]
+% }
+% } else {
+Not logged in.
+% }
+</font>
+</TD>
+</TR>
+</TABLE>
+
+<BR>
+% }
+<%ARGS>
+$Title => 'WebRT'
+$Code => undef
+$Refresh => undef
+$Why => undef
+$BgColor => '#ffffff'
+$ShowBar => 1
+</%ARGS>
+<%INIT>
+$Title = "RT/$RT::rtname: ".$Title;
+</%INIT>
+
diff --git a/rt/webrt/Elements/ListActions b/rt/webrt/Elements/ListActions
new file mode 100755
index 000000000..3fc9b0ba5
--- /dev/null
+++ b/rt/webrt/Elements/ListActions
@@ -0,0 +1,14 @@
+% if (@actions ) {
+<& /Elements/TitleBoxStart, title => 'Results' &>
+<UL>
+% foreach my $action (@actions) {
+% next unless ($action);
+<LI><%$action%></LI>
+% }
+</UL>
+<& /Elements/TitleBoxEnd &>
+<BR>
+% }
+<%ARGS>
+@actions => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/Login b/rt/webrt/Elements/Login
new file mode 100755
index 000000000..27ec98281
--- /dev/null
+++ b/rt/webrt/Elements/Login
@@ -0,0 +1,69 @@
+<& /Elements/Header, Title=>"Login" , &>
+
+<DIV ALIGN=CENTER>
+% if ($Error) {
+<& /Elements/TitleBoxStart, title => 'Error' &>
+<% $Error %>
+<& /Elements/TitleBoxEnd &>
+% }
+<BR>
+<& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for $RT::rtname", title => 'Login' ,
+contentbg=>"#cccccc" &>
+
+
+% unless ($RT::WebExternalAuth) {
+<FORM METHOD=POST >
+<TABLE BORDER=0 WIDTH=100%>
+<TR ALIGN=RIGHT>
+<TD ALIGN=RIGHT>Username:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR>
+<TR><TD ALIGN=RIGHT>Password:</TD><TD ALIGN=LEFT><input type=password name=pass></TD></TR>
+<TR><TD colspan=2 align=right>
+<input type=submit Value="Login">
+</TD></TR>
+</TABLE>
+<&/Elements/TitleBoxEnd&>
+% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things.
+% if (0) {
+% # The code below iterates through everything in the passed in arguments
+% # Preserving all the old parameters
+% # This would be easier, except mason is 'smart' and calls multiple values
+% # arrays rather than multiple hash keys
+% my $key; my $val;
+% foreach $key (keys %ARGS) {
+% if (($key ne 'user') and ($key ne 'pass')) {
+% if (ref($ARGS{$key}) =~ /ARRAY/) {
+% foreach $val (@{$ARGS{$key}}) {
+<input type=hidden name="<%$key %>" value="<% $val %>">
+% }
+% }
+% else {
+<input type="hidden" name="<% $key %>" value="<% $ARGS{$key} %>">
+% }
+% }
+%}
+% }
+</FORM>
+% }
+</DIV>
+
+<BR>
+<!-- TODO: not yet implemented
+If you've forgotten your username or password, RT can <A
+href="/NoAuth/Reminder.html">send you a reminder</a>.
+-->
+<BR>
+<HR>
+RT is &copy; Copyright 1996-2002 Jesse Vincent &lt;jesse@bestpractical.com&gt;. It is
+distributed under <a href="http://www.gnu.org/copyleft/gpl.html">Version 2 of the GNU General Public License.</a>
+
+
+<%ARGS>
+$user => ""
+$pass => undef
+$goto => undef
+$Error => undef
+</%ARGS>
+
+<%INIT>
+SetContentType('text/html');
+</%INIT>
diff --git a/rt/webrt/Elements/MessageBox b/rt/webrt/Elements/MessageBox
new file mode 100644
index 000000000..aa081a380
--- /dev/null
+++ b/rt/webrt/Elements/MessageBox
@@ -0,0 +1,30 @@
+<TEXTAREA COLS=<%$Width%> ROWS=15 WRAP=HARD NAME="<%$Name%>"><% $Default %><%$message%><%$signature%></TEXTAREA>
+<%INIT>
+
+my ($message);
+
+if ($MessageURI) {
+ my $code;
+ ($code, $Default)=RT::Link->GetContent($MessageURI);
+}
+if ($QuoteTransaction) {
+ my $transaction=RT::Transaction->new($session{'CurrentUser'});
+ $transaction->Load($QuoteTransaction);
+ $message=$transaction->Content(Quote => 1);
+}
+
+my $signature = '';
+if ($session{'CurrentUser'}->UserObj->Signature) {
+ $signature = "-- \n".$session{'CurrentUser'}->UserObj->Signature;
+}
+
+</%INIT>
+<%ARGS>
+$QuoteTransaction => undef
+$Name => 'Content'
+$Default => ''
+$DefaultURI => undef
+$Width => 72
+$MessageURI => undef
+</%ARGS>
+
diff --git a/rt/webrt/Elements/MyRequests b/rt/webrt/Elements/MyRequests
new file mode 100644
index 000000000..67817296c
--- /dev/null
+++ b/rt/webrt/Elements/MyRequests
@@ -0,0 +1,45 @@
+<& /Elements/TitleBoxStart, title => "25 highest priority tickets I requested..." &>
+<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
+<TR>
+<TH align=right>#</TH>
+<TH align=left>Subject</TH>
+<TH align=left>Queue</TH>
+<TH align=left>Status</TH>
+<TH align=left>Owner</TH>
+<TH>&nbsp;</TH>
+</TR>
+% while (my $Ticket = $MyTickets->Next) {
+<TR>
+<TD ALIGN=RIGHT>
+<%$Ticket->Id%>
+</TD>
+<TD>
+<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">
+<%$Ticket->Subject || '[no subject]'%>
+</A>
+</TD>
+<TD>
+<%$Ticket->QueueObj->Name%>
+</TD><TD>
+<%$Ticket->Status%>
+</TD><TD>
+<%$Ticket->OwnerObj->Name%>
+</TD><TD ALIGN=RIGHT>
+[<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">Display</A>]
+</TD>
+</TR>
+% }
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+
+<%INIT>
+my $MyTickets;
+$MyTickets = new RT::Tickets ($session{'CurrentUser'});
+$MyTickets->LimitRequestor(VALUE => $session{'CurrentUser'}->EmailAddress);
+$MyTickets->LimitStatus(VALUE => "open");
+$MyTickets->LimitStatus(VALUE => "new");
+$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
+$MyTickets->RowsPerPage(25);
+
+</%INIT>
diff --git a/rt/webrt/Elements/MyTickets b/rt/webrt/Elements/MyTickets
new file mode 100644
index 000000000..64a2ba7cc
--- /dev/null
+++ b/rt/webrt/Elements/MyTickets
@@ -0,0 +1,43 @@
+<& /Elements/TitleBoxStart, title => "25 highest priority tickets I own..." &>
+<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
+<TR>
+<TH ALIGN=RIGHT>#</TH>
+<TH ALIGN=LEFT>Subject</TH>
+<TH ALIGN=LEFT>Queue</TH>
+<TH ALIGN=LEFT>Status</TH>
+<TH ALIGN=LEFT>&nbsp;</TH>
+</TR>
+% while (my $Ticket = $MyTickets->Next) {
+<TR>
+<TD ALIGN=RIGHT>
+<%$Ticket->Id%>
+</TD>
+<TD>
+<A HREF="<% $RT::WebPath %>/Ticket/Display.html?id=<%$Ticket->Id%>">
+<%$Ticket->Subject || '[no subject]'%>
+</A>
+</TD>
+<TD>
+<%$Ticket->QueueObj->Name%>
+</TD><TD>
+<%$Ticket->Status%>
+</TD>
+<TD ALIGN=RIGHT>
+[<A HREF="<% $RT::WebPath %>/Ticket/Update.html?id=<%$Ticket->Id%>">Update</A>]
+</TD>
+</TR>
+% }
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+
+<%INIT>
+my $MyTickets;
+$MyTickets = new RT::Tickets ($session{'CurrentUser'});
+$MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id);
+$MyTickets->LimitStatus(VALUE => "open");
+$MyTickets->LimitStatus(VALUE => "new");
+$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC');
+$MyTickets->RowsPerPage(25);
+
+</%INIT>
diff --git a/rt/webrt/Elements/Quicksearch b/rt/webrt/Elements/Quicksearch
new file mode 100644
index 000000000..d44c996fa
--- /dev/null
+++ b/rt/webrt/Elements/Quicksearch
@@ -0,0 +1,41 @@
+<& /Elements/TitleBoxStart, title => "Find new/open tickets", titleright => "<A class='inverse' href=\"$RT::WebPath/Search/Listing.html?NewSearch=1\">Advanced Search</A>" &>
+
+<TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%>
+<tr>
+ <th align=left>Queue</th>
+ <th align=left><font size=-1>New</font></th>
+ <th align=left><font size=-1>Open</font></th>
+ <th align=left><font size=-1>Stalled</font></th>
+</tr>
+
+<%PERL>
+while (my $queue = $Queues->Next) {
+ $Tickets->ClearRestrictions;
+ $Tickets->LimitStatus(VALUE => "open");
+ $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '=');
+ my $open = $Tickets->Count();
+
+ $Tickets->ClearRestrictions;
+ $Tickets->LimitStatus(VALUE => "new");
+ $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '=');
+ my $new = $Tickets->Count();
+
+ $Tickets->ClearRestrictions;
+ $Tickets->LimitStatus(VALUE => "stalled");
+ $Tickets->LimitQueue(VALUE => $queue->id, OPERATOR => '=');
+ my $stalled = $Tickets->Count();
+</%PERL>
+<TR><TD><A HREF="<% $RT::WebPath%>/Search/Listing.html?ValueOfStatus=open&ValueOfStatus=new&StatusOp=%3D&QueueOp=%3D&ValueOfQueue=<%$queue->Id%>&RowsPerPage=50&NewSearch=1"><%$queue->Name%></a></TD>
+<TD><%$new%></TD>
+<TD><%$open%></TD>
+<TD><%$stalled%></TD>
+</TR>
+% }
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+<%INIT>
+my $Queues = new RT::Queues($session{'CurrentUser'});
+$Queues->UnLimit();
+my $Tickets = new RT::Tickets ($session{'CurrentUser'});
+</%INIT>
diff --git a/rt/webrt/Elements/Refresh b/rt/webrt/Elements/Refresh
new file mode 100644
index 000000000..6949d8c24
--- /dev/null
+++ b/rt/webrt/Elements/Refresh
@@ -0,0 +1,22 @@
+<SELECT NAME="<%$Name%>">
+<OPTION VALUE="-1"
+%unless ($Default) {
+ SELECTED
+%}
+>Don't refresh this page.</OPTION>
+%foreach my $value (@refreshevery) {
+<OPTION VALUE="<%$value%>"
+% if ($value == $Default) {
+SELECTED
+% }
+>Refresh this page every <%$value/60%> minutes.
+%}
+</SELECT>
+
+<%INIT>
+my @refreshevery = qw(120 300 600 1200 3600 7200);
+</%INIT>
+<%ARGS>
+$Name => undef
+$Default => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/Section b/rt/webrt/Elements/Section
new file mode 100755
index 000000000..067311d9e
--- /dev/null
+++ b/rt/webrt/Elements/Section
@@ -0,0 +1,11 @@
+<TABLE WIDTH=100%>
+<TR>
+<TD>
+<font size=+4><%$title%></font>
+</TD>
+</TR>
+</TABLE>
+
+<%ARGS>
+$title => undef
+</%ARGS> \ No newline at end of file
diff --git a/rt/webrt/Elements/SelectBoolean b/rt/webrt/Elements/SelectBoolean
new file mode 100755
index 000000000..93b78ce76
--- /dev/null
+++ b/rt/webrt/Elements/SelectBoolean
@@ -0,0 +1,24 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectBoolean,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="<%$TrueVal%>" <%$TrueDefault%>><%$True%></OPTION>
+<OPTION VALUE="<%$FalseVal%>" <%$FalseDefault%>><%$False%></OPTION>
+</SELECT>
+
+<%ARGS>
+$Name => undef
+$True => "is"
+$Default => 'true'
+$TrueVal => 1
+$FalseVal => 0
+$False => "isn't"
+</%ARGS>
+
+<%INIT>
+my ($TrueDefault, $FalseDefault);
+if ($Default && $Default !~ /true/i) {
+ $FalseDefault = "SELECTED";
+}
+else {
+ $TrueDefault = "SELECTED";
+}
+</%INIT>
diff --git a/rt/webrt/Elements/SelectDate b/rt/webrt/Elements/SelectDate
new file mode 100755
index 000000000..6fafbf170
--- /dev/null
+++ b/rt/webrt/Elements/SelectDate
@@ -0,0 +1,25 @@
+<INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=16>
+
+<%init>
+unless ((defined $Default) or
+ ($current <= 0)) {
+ my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+ localtime($current);
+ $Default = sprintf("%04d-%02d-%02d %02d:%02d",
+ $year+1900,$mon+1,$mday,
+ $hour,$min);
+}
+
+unless ($Name) {
+ $Name = $menu_prefix. "_Date";
+}
+</%init>
+
+<%args>
+
+$ShowTime => undef
+$menu_prefix=>''
+$current=>time
+$Default => undef
+$Name => undef
+</%args>
diff --git a/rt/webrt/Elements/SelectDateRelation b/rt/webrt/Elements/SelectDateRelation
new file mode 100755
index 000000000..c5849c8e2
--- /dev/null
+++ b/rt/webrt/Elements/SelectDateRelation
@@ -0,0 +1,14 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectDateRelation,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="&lt;"><%$Before%></OPTION>
+<OPTION VALUE="="><%$On%></OPTION>
+<OPTION VALUE="&gt;"><%$After%></OPTION>
+</SELECT>
+
+<%ARGS>
+$Name => undef
+$Default => undef
+$Before => 'Before'
+$On => 'On'
+$After => 'After'
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectDateType b/rt/webrt/Elements/SelectDateType
new file mode 100755
index 000000000..65c0e9b4b
--- /dev/null
+++ b/rt/webrt/Elements/SelectDateType
@@ -0,0 +1,12 @@
+<SELECT NAME="<%$Name%>">
+<OPTION VALUE="Created">Created</OPTION>
+<OPTION VALUE="Started">Started</OPTION>
+<OPTION VALUE="Resolved">Resolved</OPTION>
+<OPTION VALUE="Told">Last Contacted</OPTION>
+<OPTION VALUE="LastUpdated">Last Updated</OPTION>
+<OPTION VALUE="StartsBy">Starts By</OPTION>
+<OPTION VALUE="Due">Due</OPTION>
+</SELECT>
+<%ARGS>
+$Name => 'DateType'
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectEqualityOperator b/rt/webrt/Elements/SelectEqualityOperator
new file mode 100755
index 000000000..f93dc1af2
--- /dev/null
+++ b/rt/webrt/Elements/SelectEqualityOperator
@@ -0,0 +1,18 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectEqualityOperator,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<SELECT NAME ="<%$Name%>">
+% while (my $option = shift @Options) {
+% my $value = shift @Values;
+<OPTION VALUE="<%$value%>"
+% if ($Default eq '$value') {
+SELECTED
+% }
+><%$option%></OPTION>
+% }
+</SELECT>
+
+<%ARGS>
+$Name => undef
+@Options => ('less than', 'equal to', 'greater than', 'not equal to')
+@Values => qw(< = > !=)
+$Default => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectKeyword b/rt/webrt/Elements/SelectKeyword
new file mode 100644
index 000000000..c4bd9e1aa
--- /dev/null
+++ b/rt/webrt/Elements/SelectKeyword
@@ -0,0 +1,38 @@
+<SELECT NAME=<%$Name%> <%$Size%> <%$Multiple%>>
+<OPTION VALUE="">-</OPTION>
+<OPTION VALUE="NULL">(empty)</OPTION>
+% foreach my $kid ( keys %{$Descendents} ) {
+<OPTION VALUE="<% $kid %>"
+%if ($kid == $Default) {
+SELECTED
+%}
+><% $Descendents->{$kid} %></OPTION>
+% }
+</SELECT>
+
+
+<%INIT>
+
+unless (defined $KeywordObj) {
+ $KeywordObj = new RT::Keyword($session{'CurrentUser'});
+ $KeywordObj->Load($Root);
+}
+my $Descendents = $KeywordObj->Descendents();
+
+if ($Multiple) {
+ $Multiple = "MULTIPLE";
+}
+if ($Size) {
+ $Size="SIZE=$Size";
+}
+
+
+</%INIT>
+<%ARGS>
+$Multiple => undef
+$Size => undef
+$Name => 'Keyword'
+$KeywordObj => undef
+$Root => 0
+$Default => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectKeywordOptions b/rt/webrt/Elements/SelectKeywordOptions
new file mode 100644
index 000000000..f56dfe52c
--- /dev/null
+++ b/rt/webrt/Elements/SelectKeywordOptions
@@ -0,0 +1,18 @@
+<PERL>
+while (my $keyword = $keywords->Next()) {
+ my ($selected);
+ if $keyword->Id == $default
+</PERL>
+<OPTION VALUE="<%$keyword->id%>"><% '-' x $depth %><%$keyword->Name%></OPTION>
+<& SelectKeywordOptions, depth => ($depth+1), root => $keyword->id &>
+%}
+<%INIT>
+
+my $keywords = new RT::Keywords($session{'CurrentUser'});
+$keywords->LimitToParent($root);
+
+</%INIT>
+<%ARGS>
+$root => undef
+$depth => 0
+</%ARGS> \ No newline at end of file
diff --git a/rt/webrt/Elements/SelectLinkType b/rt/webrt/Elements/SelectLinkType
new file mode 100644
index 000000000..22cde3dff
--- /dev/null
+++ b/rt/webrt/Elements/SelectLinkType
@@ -0,0 +1,16 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectLinkType,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+<SELECT NAME ="<%$Name%>">
+% foreach ('MemberOf', 'DependsOn', 'RefersTo') { # TODO: Merging!
+<OPTION VALUE="<%$_%>"><%$_%></OPTION>
+% }
+</SELECT>
+
+<%ARGS>
+$Name => "LinkType"
+$Default => undef
+</%ARGS>
+
+<%INIT>
+# TODO handle Default
+</%INIT>
diff --git a/rt/webrt/Elements/SelectMatch b/rt/webrt/Elements/SelectMatch
new file mode 100644
index 000000000..7f3a94fae
--- /dev/null
+++ b/rt/webrt/Elements/SelectMatch
@@ -0,0 +1,31 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectMatch,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="LIKE" <%$LikeDefault%>><%$Like%></OPTION>
+<OPTION VALUE="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></OPTION>
+<OPTION VALUE="=" <%$TrueDefault%>><%$True%></OPTION>
+<OPTION VALUE="!=" <%$FalseDefault%>><%$False%></OPTION>
+</SELECT>
+
+<%ARGS>
+$Name => undef
+$Like => 'contains'
+$NotLike => "doesn't contain"
+$True => 'is'
+$False => "isn't"
+$Default => undef
+</%ARGS>
+<%INIT>
+my ($TrueDefault, $FalseDefault, $LikeDefault, $NotLikeDefault);
+if ($Default && $Default !~ /true/i) {
+ $FalseDefault = "SELECTED";
+}
+elsif ($Default && $Default !~ /false/i) {
+ $TrueDefault = "SELECTED";
+}
+elsif ($Default && $Default !~ /notlike/i) {
+ $NotLikeDefault = "SELECTED";
+}
+else {
+ $LikeDefault = "SELECTED";
+}
+</%INIT>
diff --git a/rt/webrt/Elements/SelectNewTicketQueue b/rt/webrt/Elements/SelectNewTicketQueue
new file mode 100755
index 000000000..9f5cd2871
--- /dev/null
+++ b/rt/webrt/Elements/SelectNewTicketQueue
@@ -0,0 +1,9 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectNewTicketQueue,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<& SelectQueue, Name => $Name, Verbose => $Verbose, Default => $Default,
+ ShowAllQueues => 0, ShowNullOption => 0 &>
+
+<%ARGS>
+$Name => 'Queue'
+$Verbose => undef
+$Default => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectOwner b/rt/webrt/Elements/SelectOwner
new file mode 100755
index 000000000..59ebf3631
--- /dev/null
+++ b/rt/webrt/Elements/SelectOwner
@@ -0,0 +1,22 @@
+<SELECT NAME="<%$Name%>">
+<OPTION VALUE="">-</OPTION>
+<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION>
+%while ( my $User = $Users->Next()) {
+% if ((!defined $QueueObj) || ($User->HasQueueRight(Right => 'OwnTicket', QueueObj => $QueueObj, TicketObj => $TicketObj))){
+<OPTION VALUE="<%$User->Id()%>" <% ($User->Id() == $Default) && "SELECTED" %>><%$User->Name()%></OPTION>
+% }
+%}
+</SELECT>
+
+<%INIT>
+my $Users = RT::Users->new($session{CurrentUser});
+$Users->LimitToPrivileged;
+</%INIT>
+
+<%ARGS>
+$QueueObj => undef
+$Name => undef
+$Default => undef
+$User => undef
+$TicketObj => undef
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectQueue b/rt/webrt/Elements/SelectQueue
new file mode 100755
index 000000000..d63b17b4e
--- /dev/null
+++ b/rt/webrt/Elements/SelectQueue
@@ -0,0 +1,38 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectQueue,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+% if ($Lite) {
+<INPUT NAME="<%$Name%>" size=25 DEFAULT="<%$d->Name%>">
+% } else {
+<SELECT NAME ="<%$Name%>">
+% if ($ShowNullOption) {
+<OPTION VALUE="">-</OPTION>
+% }
+% while (my $queue=$q->Next) {
+% if ($ShowAllQueues || $queue->CurrentUserHasRight('CreateTicket')) {
+<OPTION VALUE="<%$queue->Id%>" <%($queue->Id == $Default) && 'SELECTED'%>><%$queue->Name%>
+% if (($Verbose) and ($queue->Description) ){
+(<%$queue->Description%>)
+% }
+</OPTION>
+% }
+% }
+</SELECT>
+% }
+<%ARGS>
+$ShowNullOption => 1
+$ShowAllQueues => 1
+$Name => undef
+$Verbose => undef
+$Default => undef
+$Lite => 0
+</%ARGS>
+
+<%INIT>
+
+my $q=new RT::Queues($session{'CurrentUser'});
+$q->UnLimit;
+
+my $d = new RT::Queue($session{'CurrentUser'});
+$d->Load($Default);
+
+</%INIT>
diff --git a/rt/webrt/Elements/SelectResultsPerPage b/rt/webrt/Elements/SelectResultsPerPage
new file mode 100644
index 000000000..0699c6868
--- /dev/null
+++ b/rt/webrt/Elements/SelectResultsPerPage
@@ -0,0 +1,22 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectResultsPerPage,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+%# TODO: Better default handling
+
+<SELECT NAME ="<%$Name%>">
+% foreach my $value (@values) {
+<OPTION VALUE="<%$value%>" <% $value == $Default && 'SELECTED' %>>
+<% shift @labels %>
+</OPTION>
+% }
+</SELECT>
+
+<%INIT>
+my @values = qw(0 10 25 50 100);
+my @labels = qw(Unlimited 10 25 50 100);
+</%INIT>
+<%ARGS>
+
+$Name => undef
+$Default => 50
+
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectSortOrder b/rt/webrt/Elements/SelectSortOrder
new file mode 100644
index 000000000..6dc900631
--- /dev/null
+++ b/rt/webrt/Elements/SelectSortOrder
@@ -0,0 +1,18 @@
+<SELECT NAME="<%$Name%>">
+%foreach my $order (@orders) {
+<OPTION VALUE="<%$order%>" <%$order eq $Default && 'SELECTED' %>>
+<% shift @order_names %>
+</OPTION>
+% }
+</SELECT>
+
+<%INIT>
+my @orders = qw (ASC DESC);
+my @order_names = qw (Ascending Descending);
+
+</%INIT>
+
+<%ARGS>
+$Name => 'SortOrder'
+$Default => 'ASC'
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectStatus b/rt/webrt/Elements/SelectStatus
new file mode 100755
index 000000000..92df7c619
--- /dev/null
+++ b/rt/webrt/Elements/SelectStatus
@@ -0,0 +1,17 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectStatus,v 1.1 2002-08-12 06:17:08 ivan Exp $
+
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="">-</OPTION>
+%foreach my $status (@status) {
+<OPTION VALUE="<%$status%>" <%($Default eq $status) && 'SELECTED'%>><%$status%></OPTION>
+% }
+</SELECT>
+<%ONCE>
+my $queue = new RT::Queue($session{'CurrentUser'});
+my @status = $queue->StatusArray();
+</%ONCE>
+<%ARGS>
+$Name => undef
+$Default => undef
+
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectTicketSortBy b/rt/webrt/Elements/SelectTicketSortBy
new file mode 100644
index 000000000..02021decc
--- /dev/null
+++ b/rt/webrt/Elements/SelectTicketSortBy
@@ -0,0 +1,15 @@
+<SELECT NAME="<%$Name%>">
+% foreach my $field (@sortfields) {
+<OPTION VALUE="<%$field%>" <%$field eq $Default && 'SELECTED'%>><%$field%></OPTION>
+% }
+</SELECT>
+
+<%INIT>
+my $tickets = new RT::Tickets($session{'CurrentUser'});
+my @sortfields = $tickets->SortFields();
+
+</%INIT>
+<%ARGS>
+$Name => 'SortTicketsBy'
+$Default => 'id'
+</%ARGS>
diff --git a/rt/webrt/Elements/SelectUsers b/rt/webrt/Elements/SelectUsers
new file mode 100755
index 000000000..f517d3510
--- /dev/null
+++ b/rt/webrt/Elements/SelectUsers
@@ -0,0 +1,8 @@
+<select name="UserField">
+<option value="Name">User Id
+<option value="EmailAddress">Email
+<option value="RealName">Name
+<option value="Organization">Organization
+</select>
+<& /Elements/SelectMatch, Name=> 'UserOp' &>
+<input size=8 name="UserString">
diff --git a/rt/webrt/Elements/SelectWatcherType b/rt/webrt/Elements/SelectWatcherType
new file mode 100644
index 000000000..5a855192c
--- /dev/null
+++ b/rt/webrt/Elements/SelectWatcherType
@@ -0,0 +1,26 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Elements/Attic/SelectWatcherType,v 1.1 2002-08-12 06:17:08 ivan Exp $
+%# portions Copyright 2000 Tobias Brox <tobix@fsck.com>
+%# Request Tracker is Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<SELECT NAME ="<%$Name%>">
+<OPTION VALUE="none">-</OPTION>
+%# Make nice options:
+%for my $option (@types) {
+<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><%$option%></OPTION>
+%}
+</SELECT>
+
+<%INIT>
+my @types;
+if ($Scope =~ 'queue') {
+ @types = qw(Cc AdminCc);
+}
+else {
+ @types = qw(Requestor Cc AdminCc);
+}
+</%INIT>
+<%ARGS>
+$Default=>undef
+$Scope => 'ticket'
+$Name => 'WatcherType'
+</%ARGS>
diff --git a/rt/webrt/Elements/ShadedBox b/rt/webrt/Elements/ShadedBox
new file mode 100755
index 000000000..334b57975
--- /dev/null
+++ b/rt/webrt/Elements/ShadedBox
@@ -0,0 +1,5 @@
+<div align="left"><span class=label><%$title |n %></span><br><b><%$content |n %></b></div>
+<%ARGS>
+$title => undef
+$content => "&nbsp;"
+</%ARGS>
diff --git a/rt/webrt/Elements/Submit b/rt/webrt/Elements/Submit
new file mode 100755
index 000000000..7b75e9e98
--- /dev/null
+++ b/rt/webrt/Elements/Submit
@@ -0,0 +1,44 @@
+<TABLE WIDTH=100% BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 >
+<TR>
+% if ($Reset) {
+<TD>
+<FONT COLOR=#ffd800 >
+<INPUT TYPE=RESET VALUE="<%$ResetLabel%>">
+</FONT>
+</TD>
+%}
+<TD>
+&nbsp;
+</TD>
+<TD ALIGN=RIGHT VALIGN=CENTER>
+
+<FONT COLOR=#ffd800>
+
+% if ($AlternateLabel) {
+<B><%$AlternateCaption%>
+<INPUT TYPE=SUBMIT
+%if ($Name) {
+NAME="<%$Name%>"
+%}
+VALUE='<%$AlternateLabel%>'></B>
+% }
+
+<B><%$Caption%>
+<INPUT TYPE=SUBMIT
+%if ($Name) {
+NAME="<%$Name%>"
+% }
+ VALUE='<%$Label%>'></B></FONT>
+</TD>
+</TR>
+</TABLE>
+<%ARGS>
+$color => "#336699"
+$Caption => undef
+$AlternateCaption => undef
+$AlternateLabel => undef
+$Label => 'Submit'
+$Name => undef
+$Reset => undef
+$ResetLabel => 'Reset'
+</%ARGS>
diff --git a/rt/webrt/Elements/Tabs b/rt/webrt/Elements/Tabs
new file mode 100755
index 000000000..6eacf391a
--- /dev/null
+++ b/rt/webrt/Elements/Tabs
@@ -0,0 +1,133 @@
+<TABLE WIDTH=100%>
+ <TR>
+ <TD VALIGN=TOP>
+ <TABLE cellspacing=1>
+ <TR>
+% foreach $tab (sort keys %{$toptabs}) {
+ <TD ALIGN=CENTER>
+ <font size=+1>
+ [<A
+% if ($current_toptab eq $toptabs->{$tab}->{'path'}) {
+class='currenttab'
+% }
+ HREF="<%$RT::WebPath%>/<% $toptabs->{$tab}->{'path'}%>"><% $toptabs->{$tab}->{'title'}%></A>]
+
+
+ </font>
+ </TD>
+% }
+ </TR>
+ </TABLE>
+<BR>
+% if ($tabs_scalar) {
+<% $tabs_scalar |n%>
+% }
+% if ($tabs) {
+
+ <TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>
+ <TR>
+% foreach $tab (sort keys %{$tabs}) {
+ <TD ALIGN=CENTER VALIGN=TOP>
+[<A
+% if ($current_tab eq $tabs->{$tab}->{'path'}) {
+class='currenttab'
+% }
+HREF="<%$RT::WebPath%>/<% $tabs->{$tab}->{'path'}%>"><% $tabs->{$tab}->{'title'}%></A>]</TD>
+%}
+ </TR>
+ </TABLE>
+%}
+
+<BR>
+% if ($subtabs_scalar) {
+<% $subtabs_scalar |n%>
+% }
+% if ($subtabs) {
+ <TABLE>
+ <TR>
+% foreach $tab (sort keys %{$subtabs}) {
+ <TD ALIGN=CENTER>
+ [<A HREF="<%$RT::WebPath%>/<% $subtabs->{$tab}->{'path'}%>"><% $subtabs->{$tab}->{'title'}%></A>]
+ </TD>
+%}
+ </TR>
+ </TABLE>
+%}
+ </TD>
+ <TD VALIGN=TOP ALIGN=RIGHT>
+<TABLE>
+<TR>
+
+% foreach $action (sort keys %{$topactions}) {
+<TD><font size=-1><%$topactions->{"$action"}->{'html'} |n %></font></TD>
+% }
+</TR>
+</TABLE>
+
+
+
+% if ($actions) {
+<TABLE><TR>
+% foreach $action (sort keys %{$actions}) {
+<TD>
+<FONT SIZE=-1>
+% if ($actions->{"$action"}->{'html'}) {
+<%$actions->{"$action"}->{'html'} |n%>
+% } else {
+<A HREF="<%$RT::WebPath%>/<% $actions->{$action}->{'path'}%>"><% $actions->{$action}->{'title'}%></A>
+% }
+</FONT>
+</TD>
+% }
+</TR></TABLE>
+% }
+
+% if ($subactions_scalar) {
+<% $subactions_scalar |n%>
+% }
+% if ($subactions) {
+<BR>|&nbsp;
+% foreach $action (sort keys %{$subactions}) {
+<%$subactions->{"$action"}->{'html'} |n%>&nbsp;|
+% }
+% }
+ </TD>
+ </TR>
+ </TABLE>
+
+
+<%INIT>
+my ($tab, $action);
+my $toptabs = { A => { title => 'Home',
+ path => '',
+ },
+ B => { title => 'Search',
+ path => 'Search/Listing.html'
+ },
+
+ D => { title => 'Configuration',
+ path => 'Admin/'
+ }
+ };
+
+
+my $topactions = {
+ A => { html => $m->scomp('/Elements/CreateTicket')
+ },
+ B => { html => $m->scomp('/Elements/GotoTicket')
+ }
+ };
+</%INIT>
+<%ARGS>
+$current_toptab => "none"
+$current_tab => "none"
+$current_subtab => "none"
+$tabs => undef
+$tabs_scalar => undef
+$subtabs => undef
+$actions => undef
+$subactions => undef
+$subtabs_scalar => undef
+$subactions_scalar => undef
+</%ARGS>
+
diff --git a/rt/webrt/Elements/TitleBoxEnd b/rt/webrt/Elements/TitleBoxEnd
new file mode 100755
index 000000000..bdd41065a
--- /dev/null
+++ b/rt/webrt/Elements/TitleBoxEnd
@@ -0,0 +1,10 @@
+</TD></TR></TABLE>
+</TD>
+</TR>
+<TR><TD COLSPAN=4><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" height=1 ALT="&nbsp;"width=1></TD>
+</TABLE>
+<%ARGS>
+$title => undef
+$content => undef
+</%ARGS>
+
diff --git a/rt/webrt/Elements/TitleBoxStart b/rt/webrt/Elements/TitleBoxStart
new file mode 100755
index 000000000..6d0f1f91a
--- /dev/null
+++ b/rt/webrt/Elements/TitleBoxStart
@@ -0,0 +1,20 @@
+<TABLE CLASS="<%$class%>" BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 WIDTH="<%$width%>">
+<TR><TD ROWSPAN=2><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" width=1 height=1 ALT=""></TD>
+<TD valign=middle align=left bgcolor="<%$color%>">&nbsp;<font size=-1 color="#ffffff"><b><% $title_href && "<A CLASS=\"$title_class\" HREF=\"$title_href\">"|n%><%$title |n %><% $title_href && "</A>" |n%></b></font></TD>
+<TD ALIGN="right" valign=middle bgcolor="<%$color%>"><FONT color="#ffffff" SIZE=-1><%$titleright |n %></FONT>&nbsp;</TD>
+<TD ROWSPAN=2><IMG SRC="<%$RT::WebImagesURL%>spacer.gif" width=1 height=1 ALT=""></TD></TR>
+<TR><TD COLSPAN=2 bgcolor="<%$contentbg%>" valign=top align=left WIDTH=100%>
+<TABLE CELLPADDING=2 WIDTH=100%><TR><TD>
+<%ARGS>
+$width => "100%"
+$class => undef
+
+$title_href => undef
+$title => undef
+$title_class => undef
+
+$titleright_href => undef
+$titleright => undef
+$contentbg => "#dddddd"
+$color => "#336699"
+</%ARGS>
diff --git a/rt/webrt/Elements/ViewUser b/rt/webrt/Elements/ViewUser
new file mode 100644
index 000000000..92446e6ef
--- /dev/null
+++ b/rt/webrt/Elements/ViewUser
@@ -0,0 +1,29 @@
+
+<& /Elements/TitleBoxStart,
+ title => "<a class='inverse' href=\"$RT::WebPath/Search/Listing.html?LimitRequestorById=1&IdOfRequestor=".$User->id."\">Tickets from $name</a>",
+ titleright=> "<a class='inverse' href=\"$RT::WebPath/EditUserComments.html?id=".$User->id."\">Comments about $name</a>" &>
+<TABLE WIDTH="100%">
+<tr>
+<td halign=left valign=top>
+%while (my $w=$tickets->Next) {
+<%$w->Id%>: <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$w->id%>"><%$w->Subject%></a> (<%$w->Status%>)<BR>
+%}
+</td>
+<td align=right valign=top>
+ <% ($User->Comments || "No comment entered about this user") %>
+</tr>
+</table>
+<& /Elements/TitleBoxEnd &>
+
+<%ARGS>
+$User=>undef
+</%ARGS>
+
+<%INIT>
+my $name=$User->RealName || $User->EmailAddress;
+
+my $tickets = new RT::Tickets($session{'CurrentUser'});
+$tickets->LimitRequestor(VALUE => $User->EmailAddress);
+
+
+</%INIT>
diff --git a/rt/webrt/Elements/dayMenu b/rt/webrt/Elements/dayMenu
new file mode 100755
index 000000000..6591b05d2
--- /dev/null
+++ b/rt/webrt/Elements/dayMenu
@@ -0,0 +1,19 @@
+<%doc>-------------------------------------------------------------------
+dayMenu: Display a pulldown menu of days of the month (1 to 31)
+
+Optional arguments:
+$menu_name - Name of menu, defaults to 'day'
+$current - Selected day value (1 to 31)
+-------------------------------------------------------------------</%doc>
+
+<select name="<% $menu_name %>">
+<option value="-1">-
+% foreach my $day (1..31) {
+<option value="<% $day %>" <% $day==$current ? "selected" : "" %>><% sprintf("%02d",$day) %>
+% }
+</select>
+
+<%args>
+$menu_name=>'day'
+$current=>undef
+</%args>
diff --git a/rt/webrt/Elements/monthMenu b/rt/webrt/Elements/monthMenu
new file mode 100755
index 000000000..b9a71d3f9
--- /dev/null
+++ b/rt/webrt/Elements/monthMenu
@@ -0,0 +1,37 @@
+<%doc>-------------------------------------------------------------------
+monthMenu: Display a pulldown menu of months
+
+Optional arguments:
+$menu_name - Name of menu, defaults to 'month'
+$current - Selected month value (1 to 12)
+$format - Choice of month labels:
+ 'full' (January, February, ...)
+ 'short' (Jan, Feb, ...)
+ 'numeric' (1, 2, ...)
+ Defaults to 'full'. The format only affects appearance; the menu
+ values are always numeric.
+-------------------------------------------------------------------</%doc>
+
+<select name="<% $menu_name %>">
+<option value="-1">-
+% foreach my $month (1..12) {
+<option value="<% $month %>" <% $month==$current ? "selected" : "" %>>
+% if ($format eq 'full') {
+<% $month_names[$month-1] %>
+% } elsif ($format eq 'short') {
+<% substr($month_names[$month-1],0,3) %>
+% } elsif ($format eq 'numeric') {
+<% sprintf("%02d",$month) %>
+% }
+% }
+</select>
+
+<%init>
+my @month_names = qw(January February March April May June July August September October November December);
+</%init>
+
+<%args>
+$menu_name=>'month'
+$current=>undef
+$format=>'full'
+</%args>
diff --git a/rt/webrt/Elements/yearMenu b/rt/webrt/Elements/yearMenu
new file mode 100755
index 000000000..4a0e7a772
--- /dev/null
+++ b/rt/webrt/Elements/yearMenu
@@ -0,0 +1,24 @@
+<%doc>-------------------------------------------------------------------
+yearMenu: Display a pulldown menu of years.
+
+Optional arguments:
+$menu_name - Name of menu, defaults to 'year'
+$current - Selected year value
+$min - Minimum year appearing in menu; defaults to current year
+$max - Maximum year appearing in menus; defaults to $min plus 10.
+-------------------------------------------------------------------</%doc>
+
+<select name="<% $menu_name %>">
+<option value="-1">-
+% foreach my $year ($min..$max) {
+<option value="<% $year %>" <% $year==$current ? "selected" : "" %>>
+<% $year %>
+% }
+</select>
+
+<%args>
+$menu_name=>'year'
+$current=>(localtime)[5]+1900
+$min=>(localtime)[5]+1900-1
+$max=>$min+10
+</%args>
diff --git a/rt/webrt/NoAuth/Logout.html b/rt/webrt/NoAuth/Logout.html
new file mode 100755
index 000000000..a00ae9675
--- /dev/null
+++ b/rt/webrt/NoAuth/Logout.html
@@ -0,0 +1,22 @@
+<HTML>
+<HEAD>
+<TITLE>RT: Logout</TITLE>
+ <META HTTP-EQUIV="Refresh" CONTENT="0;URL=<%$RT::WebPath%>/">
+</HEAD>
+<BODY>
+<p>You have been logged out of RT.
+
+
+<br>
+<br>
+<A HREF="<%$RT::WebPath%>/">You're welcome to login again</a>
+
+
+<%PERL>
+if (defined %session) {
+ %session = undef;
+}
+$m->abort();
+</%PERL>
+
+
diff --git a/rt/webrt/NoAuth/Reminder.html b/rt/webrt/NoAuth/Reminder.html
new file mode 100755
index 000000000..a814a912f
--- /dev/null
+++ b/rt/webrt/NoAuth/Reminder.html
@@ -0,0 +1,3 @@
+<& /Elements/Header, title => 'Password Reminder' &>
+
+Not yet implemented.
diff --git a/rt/webrt/NoAuth/images/rt.jpg b/rt/webrt/NoAuth/images/rt.jpg
new file mode 100644
index 000000000..a137a932b
--- /dev/null
+++ b/rt/webrt/NoAuth/images/rt.jpg
Binary files differ
diff --git a/rt/webrt/NoAuth/images/spacer.gif b/rt/webrt/NoAuth/images/spacer.gif
new file mode 100644
index 000000000..5bfd67a2d
--- /dev/null
+++ b/rt/webrt/NoAuth/images/spacer.gif
Binary files differ
diff --git a/rt/webrt/NoAuth/webrt.css b/rt/webrt/NoAuth/webrt.css
new file mode 100755
index 000000000..a71d05720
--- /dev/null
+++ b/rt/webrt/NoAuth/webrt.css
@@ -0,0 +1,102 @@
+BODY, TD {font-family: Helvetica, Arial, sans-serif}
+TD {border-color: #cccccc }
+
+BLOCKQUOTE.message {
+ font-size: 80%;
+ font-family: "Helvetica", sans-serif;
+}
+
+
+BODY {
+ color: #000;
+ background: #FFFFFF;
+ font-family: "Helvetica", sans-serif;
+
+
+}
+
+TD, TH { /* ns workaround */
+ font-family: "Helvetica", sans-serif;
+}
+
+TR.oddline {
+ background-color : #eeeeee;
+}
+
+H1, H2, H3 {
+ margin-top: 0.2em;
+ color: #336699;
+ font-family: "Helvetica", sans-serif;
+
+ clear: both;
+}
+
+
+DIV.endmatter { margin-left: -7% }
+
+
+
+A { font-weight: bold;
+ color: #000000;
+ /* border: none -- breaks NS 4.x */ }
+
+.currenttab { background-color: #cccccc; }
+
+.inverse { color: #ffffff; }
+
+
+
+A:link IMG, A:visited IMG { border-style: none }
+
+A IMG { color: white } /* The only way to hide the border in NS 4.x */
+
+.hide {
+ display: none;
+ color: white;
+}
+
+SPAN.date { font-size: 0.8em }
+
+SPAN.attribution {
+ font-weight: bold
+}
+
+SPAN.label { font-size: 0.8em;
+}
+
+BLOCKQUOTE {
+ font-style: italic;
+ /* color: #990; */
+}
+
+ADDRESS {
+ text-align: right;
+ font-weight: bold;
+ font-style: italic
+}
+
+BLOCKQUOTE P { /* Try to avoid space above the attribution */
+ margin-bottom: 0;
+}
+BLOCKQUOTE ADDRESS {
+ margin: 0;
+}
+
+.motto, .motto A {font: italic 120%/1.3 Georgia, serif; color: #990}
+
+.emphasized {
+ font-weight: bold
+}
+
+/* Why o why does this break Netscape 4.x?
+IMG {
+ border: none
+}
+*/
+
+P.map-also { font-style: italic; margin-left: 15%; text-align: right }
+
+.oddline {
+background-color : #eeeeee;
+
+}
diff --git a/rt/webrt/Search/Bulk.html b/rt/webrt/Search/Bulk.html
new file mode 100755
index 000000000..ac688d7cd
--- /dev/null
+++ b/rt/webrt/Search/Bulk.html
@@ -0,0 +1,186 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Search/Attic/Bulk.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+<& /Elements/Header, Title => "Bulk ticket update" &>
+<& /Elements/Tabs &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM METHOD=POST>
+<TABLE WIDTH=100% border=0 cellpadding=3 CELLSPACING=0>
+<TR>
+<TH>Update</TH>
+%foreach my $col (@cols) {
+% my $colalias = $col;
+% $colalias =~ s/(Obj\-\>|)(Name|AsString)//;
+
+<TH ><% $colalias %>&nbsp;</TH>
+%}
+</TR>
+
+<%PERL>
+
+my $i;
+
+
+
+$session{'tickets'}->RedoSearch();
+while (my $Ticket = $session{'tickets'}->Next) {
+ $i++;
+ if ($i % 2) {
+ $bgcolor = "#dddddd";
+ }
+ else {
+ $bgcolor = "#ffffff";
+ }
+ </%PERL>
+<TR bgcolor="<%$bgcolor%>">
+<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>" CHECKED></TD>
+%# The ticket view is controlled by config.pm, WebOptions
+%foreach my $col (@cols) {
+<TD>
+% if ($col eq 'id') {
+<A HREF="<% $RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id()%></A>
+% }
+%else {
+<% eval "\$Ticket->$col()" %>&nbsp;
+%}
+</TD>
+%}
+</TR>
+%}
+
+
+
+</TABLE>
+
+<HR>
+
+
+<& /Elements/TitleBoxStart, title => 'Update selected tickets' &>
+<TABLE>
+<TR>
+<TD VALIGN=TOP>
+<UL>
+<li> Make Owner <& /Elements/SelectOwner, Name => "Owner" &>
+(<input type=checkbox name="ForceOwnerChange"> Force change)
+<li> Add Requestor <INPUT Name="AddRequestor" SIZE=20>
+<li> Remove Requestor <INPUT Name="DeleteRequestor" SIZE=20>
+<li> Add Cc <INPUT Name="AddCc" SIZE=20>
+<li> Remove Cc <INPUT Name="DeleteCc" SIZE=20>
+<li> Add AdminCc <INPUT Name="AddAdminCc" SIZE=20>
+<li> Remove AdminCc <INPUT Name="DeleteAdminCc" SIZE=20>
+</UL>
+</TD>
+<TD VALIGN=TOP>
+<UL>
+<li> Make subject <INPUT Name="Subject" SIZE=20>
+<li> Make priority <INPUT Name="Priority" SIZE=4>
+<li> Make queue <& /Elements/SelectQueue, Name => "Queue" &>
+
+<li>Make Status <& /Elements/SelectStatus, Name => "Status" &>
+
+
+
+<li> Make date Starts <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &>
+<li> Make date Started <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &>
+<li> Make date Told <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &>
+<li> Make date Due <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &>
+<li> Make date Resolved <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &>
+
+
+% while ( my $KeywordSelect = $KeywordSelects->Next ) {
+
+<li> Add <% $KeywordSelect->Name %> <& /Elements/SelectKeyword, Name => "AddToKeywordSelect".$KeywordSelect->id, KeywordObj => $KeywordSelect->KeywordObj &>
+<li> Remove <% $KeywordSelect->Name %> <& /Elements/SelectKeyword, Name => "DeleteFromKeywordSelect".$KeywordSelect->id, KeywordObj => $KeywordSelect->KeywordObj &>
+% }
+
+</UL>
+
+
+</TD>
+</TR>
+</table>
+<& /Elements/TitleBoxEnd&>
+<& /Elements/TitleBoxStart, title => 'Add comments or replies to selected tickets' &>
+<table>
+<tr><td align=right>Update Type:</td>
+<td><select name="UpdateType">
+ <option value="private" >Comments (not sent to requestors)</option>
+<option value="response" >Response to requestors</option>
+</select>
+</td></tr>
+<tr><td align=right>Subject:</td><td> <input name="UpdateSubject" size=60 value=""></td></tr>
+ <tr><td align=right>Attach:</td><td><input name="UpdateAttachment" type="file"></td></tr>
+ <tr><td colspan="2">
+ <& /Elements/MessageBox, Name=>"UpdateContent"&>
+ </td></tr>
+ </table>
+<& /Elements/TitleBoxEnd &>
+
+
+
+
+<& /Elements/Submit &>
+
+
+</FORM>
+<%INIT>
+
+# Iterate through the ARGS hash and remove anything with a null value.
+map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS);
+
+my ($bgcolor, @results);
+my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorsAsString DueAsString );
+
+Abort("No search to operate on.") unless ($session{'tickets'});
+
+
+my $do_comment_reply=0;
+# Prepare for ticket updates
+$ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
+chomp ($ARGS{'UpdateContent'}) ;
+
+if ($ARGS{'UpdateContent'} &&
+ $ARGS{'UpdateContent'} ne '' &&
+ $ARGS{'UpdateContent'} ne "-- \n" .
+ $session{'CurrentUser'}->UserObj->Signature) {
+ $do_comment_reply=1;
+}
+
+my $KeywordSelects = new RT::KeywordSelects $session{'CurrentUser'};
+foreach ( $session{'tickets'}->RestrictionValues('Queue') ) {
+ $KeywordSelects->LimitToQueue($_);
+}
+
+$KeywordSelects->IncludeGlobals;
+
+
+#Iterate through each ticket we've been handed
+
+while (my $Ticket = $session{'tickets'}->Next) {
+ $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n");
+ next unless ($ARGS{"UpdateTicket".$Ticket->Id});
+ $RT::Logger->debug ("Matched\n");
+ #Update the basics.
+ my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS);
+ my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS);
+ my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS);
+ my @selectresults = ProcessTicketObjectKeywords(TicketObj => $Ticket, ARGSRef => \%ARGS);
+
+
+ my @updateresults;
+ if ($do_comment_reply) {
+ ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \
+@updateresults);
+ }
+ my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults);
+ @tempresults = map { "Ticket ".$Ticket->Id. ": ".$_ } @tempresults;
+
+
+ #Update the keyword selects
+ #Update the watchers
+ $RT::Logger->debug(join("\n",@tempresults));
+ @results = (@results, @tempresults);
+}
+
+</%INIT>
diff --git a/rt/webrt/Search/Listing.html b/rt/webrt/Search/Listing.html
new file mode 100755
index 000000000..da927fec7
--- /dev/null
+++ b/rt/webrt/Search/Listing.html
@@ -0,0 +1,134 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Search/Attic/Listing.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+<& /Elements/Header, Title => "Search", Refresh => $session{'tickets_refresh_interval'} &>
+<& /Elements/Tabs, current_toptab => 'Search/Listing.html' &>
+
+
+% unless ($ARGS{'Action'} eq 'Refine') {
+<TABLE WIDTH=100% border=0 cellpadding=3 CELLSPACING=1>
+<TR>
+%foreach my $col (@{Config(\%ARGS, 'QueueListingCols')}) {
+<TH>
+
+<%PERL>
+my ($order);
+ my $attr = $col->{'TicketAttribute'};
+ $attr =~ s/Obj->(Name|AsString|AgeAsString)//g;
+ if ($session{'tickets_sort_order'} =~ /^asc$/i) {
+ $order = 'DESC';
+ } else {
+ $order = 'ASC';
+ }
+</%PERL>
+
+% if (grep (/^$attr$/i, $session{'tickets'}->SortFields)) {
+<A
+% if ($attr eq $session{'tickets_sort_by'}) {
+class="currenttab"
+% }
+HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$attr%>&TicketsSortOrder=<%$order%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>">
+<%$col->{Header}%>
+</A>
+% } else {
+<% $col->{Header} %>
+% }
+</TH>
+%}
+</TR>
+
+<%PERL>
+
+my $i;
+
+$session{'tickets'}->RedoSearch();
+while (my $Ticket = $session{'tickets'}->Next) {
+ $i++;
+ if ($i % 2) {
+ $bgcolor = "#dddddd";
+ }
+ else {
+ $bgcolor = "#ffffff";
+ }
+ </%PERL>
+<TR bgcolor="<%$bgcolor%>" >
+%# The ticket view is controlled by config.pm, WebOptions
+%foreach my $col (@{Config(\%ARGS,'QueueListingCols')}) {
+<TD><& TicketCell , Ticket=>$Ticket, Column=>$col &></TD>
+%}
+</TR>
+%}
+
+
+
+</TABLE>
+
+<div align=center>
+<font size=2>
+<a href="Listing.html?GotoPage=1">First page</a>
+&nbsp;&nbsp;
+<a href="Listing.html?GotoPage=Prev">&lt;Previous page</a>
+&nbsp;&nbsp;
+<a href="Listing.html?GotoPage=Next">Next page&gt;</a>
+%#&nbsp;&nbsp;<form method=get action="Listing.html">Goto page <input name=GotoPage size=2></form>
+</font>
+</div>
+% if ($session{'tickets'}->Count()) {
+<div align=right>
+<a href="Bulk.html">Update all these tickets at once</a>
+</div>
+% }
+<HR>
+
+% } #endif {$ARGS{'Action'} eq 'Refine')
+<TABLE WIDTH="100%">
+<TR>
+<TD VALIGN="TOP">
+<& /Elements/TitleBoxStart, title => 'Search Criteria'&>
+
+<A HREF="<% $RT::WebPath%>/Search/Listing.html?ClearRestrictions=1">New search</a><br>
+<A HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$session{'tickets_sort_by'}%>&TicketsSortOrder=<%$session{'tickets_sort_order'}%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>">Bookmarkable URL for this search</a>
+<BR>
+<BR>
+% my %restrictions=$session{'tickets'}->DescribeRestrictions();
+% my %seen_restrictions=();
+% foreach $row (keys %restrictions){
+% my $tmp=$restrictions{"$row"};
+% if( ! defined( $seen_restrictions{"$tmp"} ) ){
+<%$restrictions{"$row"}%> <A HREF="<% $RT::WebPath%>/Search/Listing.html?DeleteRestriction=<%$row%>">[delete]</a><br>
+% } else {
+% $session{'tickets'}->DeleteRestriction($row);
+<b>Deleted Duplicate Restriction <i><%$tmp%></i></b><br>
+% }
+% $seen_restrictions{"$tmp"}++;
+%}
+<& /Elements/TitleBoxEnd&>
+</TD>
+<TD>
+
+<& PickRestriction &>
+
+</TD>
+</TR>
+</TABLE>
+
+<%INIT>
+
+my $bgcolor;
+require RT::Interface::Web;
+
+$session{'i'}++;
+if ($session{'tickets'}) {
+ if ( ($ARGS{'ClearRestrictions'}) ||
+ ($ARGS{'NewSearch'}) ) {
+ $session{'tickets'}->ClearRestrictions;
+ }
+
+ if ($ARGS{'DeleteRestriction'}) {
+ $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'});
+ }
+}
+&ProcessSearchQuery(ARGS=>\%ARGS);
+
+my $row;
+
+</%INIT>
diff --git a/rt/webrt/Search/PickRestriction b/rt/webrt/Search/PickRestriction
new file mode 100755
index 000000000..82f576c1f
--- /dev/null
+++ b/rt/webrt/Search/PickRestriction
@@ -0,0 +1,112 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Search/Attic/PickRestriction,v 1.1 2002-08-12 06:17:09 ivan Exp $
+<FORM ACTION="Listing.html" METHOD="GET">
+<INPUT TYPE=HIDDEN NAME="Bookmark" VALUE="<% $session{'tickets'}->FreezeLimits()|u %>">
+<& /Elements/TitleBoxStart, title => 'Refine Search'&>
+<INPUT TYPE=HIDDEN NAME="CompileRestriction" VALUE=1>
+
+<ul>
+<li>Owner is <& /Elements/SelectBoolean, Name => "OwnerOp",
+ TrueVal=> '=',
+ FalseVal => '!='
+&>
+<& /Elements/SelectOwner, Name => "ValueOfOwner" &>
+
+<li>
+Requestor email address
+<& /Elements/SelectMatch, Name => "RequestorOp" &>
+<INPUT Name="ValueOfRequestor" SIZE=20>
+
+<li>
+Subject <& /Elements/SelectMatch, Name => "SubjectOp" &>
+<INPUT Name="ValueOfSubject" SIZE=20>
+
+<li>Queue <& /Elements/SelectBoolean, Name => "QueueOp" ,
+ True => "is",
+ False => "isn't",
+ TrueVal=> '=',
+ FalseVal => '!=' &>
+<& /Elements/SelectQueue, Name => "ValueOfQueue" &>
+
+
+<li>Priority <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
+
+<INPUT Name="ValueOfPriority" SIZE=5>
+
+
+<li>
+<& /Elements/SelectDateType, Name => 'DateType' &>
+<& /Elements/SelectDateRelation, Name=>"DateOp" &>
+<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
+
+<li>Ticket content
+<& /Elements/SelectBoolean, Name => "ContentOp",
+ True => "matches",
+ False => "does not match",
+ TrueVal => 'LIKE',
+ FalseVal => 'NOT LIKE'
+&>
+<Input Name="ValueOfContent" Size=20>
+
+<li>Status
+<& /Elements/SelectBoolean, Name => "StatusOp",
+ True => "is",
+ False => "isn't",
+ TrueVal=> '=',
+ FalseVal => '!='
+&>
+<& /Elements/SelectStatus, Name => "ValueOfStatus" &>
+
+% while ( my $KeywordSelect = $KeywordSelects->Next ) {
+
+<li><% $KeywordSelect->Name %>
+ <& /Elements/SelectBoolean, Name => "KeywordSelectOp". $KeywordSelect->id,
+ True => "is", False => "isn't",
+ TrueVal=> '=', FalseVal => '!=' &>
+
+<& /Elements/SelectKeyword, Name => "KeywordSelect".$KeywordSelect->id,
+ KeywordObj => $KeywordSelect->KeywordObj
+ &>
+% }
+
+</UL>
+
+<& /Elements/TitleBoxEnd &>
+
+<& /Elements/TitleBoxStart, title => 'Ordering and sorting'&>
+
+<UL>
+
+<li>Results per page <& /Elements/SelectResultsPerPage, Name => "RowsPerPage",
+ Default => $session{'tickets_rows_per_page'} || '50'
+&>
+
+<li>Sort results by <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy",
+ Default => $session{'tickets_sort_by'}
+&>
+<& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &>
+
+<li> <& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &>
+
+
+</UL>
+
+
+</DIV>
+
+
+
+<& /Elements/TitleBoxEnd &>
+
+<& /Elements/Submit, Label => 'Show Results', AlternateLabel => 'Refine', Name => 'Action'&>
+
+</FORM>
+
+
+ <%INIT>
+ my $KeywordSelects = new RT::KeywordSelects $session{'CurrentUser'};
+ foreach ( $session{'tickets'}->RestrictionValues('Queue') ) {
+ $KeywordSelects->LimitToQueue($_);
+ }
+
+ $KeywordSelects->IncludeGlobals;
+</%INIT>
diff --git a/rt/webrt/Search/RestrictSearch.html b/rt/webrt/Search/RestrictSearch.html
new file mode 100755
index 000000000..977308e3b
--- /dev/null
+++ b/rt/webrt/Search/RestrictSearch.html
@@ -0,0 +1,3 @@
+<& /Elements/Header, Title=>"Compile Restrictions" &>
+<& /Elements/Tabs &>
+<& PickRestriction &>
diff --git a/rt/webrt/Search/TicketCell b/rt/webrt/Search/TicketCell
new file mode 100644
index 000000000..aaded88e9
--- /dev/null
+++ b/rt/webrt/Search/TicketCell
@@ -0,0 +1,28 @@
+%#$Header: /home/cvs/cvsroot/freeside/rt/webrt/Search/Attic/TicketCell,v 1.1 2002-08-12 06:17:09 ivan Exp $
+<% $link |n%><%$Column->{Constant} || eval("\$Ticket->$Column->{TicketAttribute}") || "-" %><% $endlink|n %>
+<%INIT>
+
+my $link = "";
+my $endlink = "";
+if ($Column->{TicketLink}) {
+ $link = "<A HREF=\"";
+ if ($Column->{TicketLink} == 1 ) {
+ $link .= "../Ticket/Display.html?";
+ }
+ else {
+ $link .= $Column->{TicketLink};
+ }
+
+ $link .= "id=".$Ticket->Id . $Column->{ExtraLinks};
+
+ if ($session{NewWindowOption}) {
+ $link .= "TARGET=\"TicketDisplay".$session{AlwaysNewWindowOption} && (time() . rand(1024))."\" ";
+ }
+ $link .= "\">";
+ $endlink = "</a>";
+}
+</%INIT>
+<%ARGS>
+$Ticket => undef
+$Column => undef
+</%ARGS>
diff --git a/rt/webrt/SelfService/Attachment/dhandler b/rt/webrt/SelfService/Attachment/dhandler
new file mode 100644
index 000000000..0d646cc0b
--- /dev/null
+++ b/rt/webrt/SelfService/Attachment/dhandler
@@ -0,0 +1,27 @@
+<%perl>
+ my ($ticket, $trans,$attach, $filename);
+ my $arg = $m->dhandler_arg; # get rest of path
+ if ($arg =~ '^(\d+)/(\d+)') {
+ $trans = $1;
+ $attach = $2;
+ }
+ else {
+ Abort("Corrupted attachment URL.");
+ }
+ my $AttachmentObj = new RT::Attachment($session{'CurrentUser'});
+ $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could not be loaded");
+
+
+ unless ($AttachmentObj->id) {
+ Abort("Bad attachment id. Couldn't find attachment '$attach'\n");
+ }
+ unless ($AttachmentObj->TransactionId() == $trans ) {
+ Abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->TransactionId() ."\n");
+
+ }
+ my $content_type = $AttachmentObj->ContentType || 'text/plain';
+ SetContentType($content_type);
+ $m->out($AttachmentObj->Content);
+ $m->abort;
+</%perl>
+
diff --git a/rt/webrt/SelfService/Closed.html b/rt/webrt/SelfService/Closed.html
new file mode 100644
index 000000000..a35936092
--- /dev/null
+++ b/rt/webrt/SelfService/Closed.html
@@ -0,0 +1,4 @@
+<& /SelfService/Elements/Header, title => 'RT Self Service / Closed Tickets' &>
+
+<& /SelfService/Elements/MyRequests, status => ['resolved'], friendly_status =>
+'closed' &>
diff --git a/rt/webrt/SelfService/Create.html b/rt/webrt/SelfService/Create.html
new file mode 100755
index 000000000..60110cb5a
--- /dev/null
+++ b/rt/webrt/SelfService/Create.html
@@ -0,0 +1,63 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/SelfService/Attic/Create.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+
+<& Elements/Header, Title => "Create a request" &>
+
+
+<FORM ACTION="Display.html" METHOD="POST" ENCTYPE="multipart/form-data">
+<INPUT TYPE=HIDDEN Name="id" VALUE="new">
+<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => "Create a new ticket" &>
+
+<TABLE>
+<TR>
+<TD>
+Queue:
+</TD>
+<TD>
+<& /Elements/SelectNewTicketQueue, Verbose => 'True' &>
+</TD>
+</TR>
+<TR>
+<TD>
+Requestors:
+</TD>
+<TD>
+<INPUT Name="Requestors" Value="<%$session{CurrentUser}->EmailAddress%>" SIZE=20>
+</TD>
+</TR>
+<TR>
+<TD>
+Cc:
+</TD>
+<TD>
+ <INPUT NAME="Cc" SIZE=20>
+</TD>
+</TR>
+<TR>
+<TD>
+Subject:
+</TD>
+<TD>
+<INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="">
+</TD>
+</TR>
+<TR>
+<TD>
+Attach file:
+</TD>
+<TD>
+<INPUT Name="Attach" type=file>
+</TD>
+</TR>
+<TR>
+<TD COLSPAN=2>
+Describe the issue below:<br>
+<& /Elements/MessageBox &>
+</TD>
+</TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, Label => "Create ticket"&>
+
+
+</FORM>
diff --git a/rt/webrt/SelfService/Display.html b/rt/webrt/SelfService/Display.html
new file mode 100755
index 000000000..2d44f148e
--- /dev/null
+++ b/rt/webrt/SelfService/Display.html
@@ -0,0 +1,190 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/SelfService/Attic/Display.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2001 Jesse Vincent <jesse@fsck.com>
+
+<& /SelfService/Elements/Header, Title => 'Display ticket #'.$Ticket->id &>
+
+
+<& /Elements/ListActions, actions => \@results &>
+
+<TABLE>
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Ticket Id
+ </TD>
+ <TD>
+ <%$Ticket->Id%>
+ </TD>
+ </TR>
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Requestors
+ </TD>
+ <TD>
+ <%$Ticket->RequestorsAsString%>
+ </TD>
+ </TR>
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Cc
+ </TD>
+ <TD>
+ <%$Ticket->CcAsString%>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Status
+ </TD>
+ <TD>
+ <%$Ticket->Status%>
+ </TD>
+ </TR>
+
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Queue
+ </TD>
+ <TD>
+ <%$Ticket->QueueObj->Name%> (<%$Ticket->QueueObj->Description%>)
+ </TD>
+ </TR>
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Priority
+ </TD>
+ <TD>
+ <%$Ticket->Priority %>
+ </TD>
+ </TR>
+
+% if ($Ticket->TimeWorked) {
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ Worked
+ </TD>
+ <TD>
+ <%$Ticket->TimeWorked %> minutes
+ </TD>
+ </TR>
+% }
+
+% my $selects = $Ticket->QueueObj->KeywordSelects;
+% while (my $select = $selects->Next) {
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%" ALIGN=RIGHT>
+ <%$select->Name%>
+ </TD>
+ <TD>
+% my $object_keywords = $Ticket->KeywordsObj($select->id);
+% while (my $keyword = $object_keywords->Next) {
+ <%$keyword->KeywordObj->RelativePath($select->KeywordObj)%>
+% }
+%}
+ </TD>
+ </TR>
+
+
+
+
+ </TABLE>
+<TABLE BORDER=0 CELLSPACING=0>
+% my ($i);
+%while (my $Transaction = $Transactions->Next) {
+% $i++;
+% if ($Transactions->IsLast) {
+ <a name="lasttrans"></a>
+% }
+ <& /Ticket/Elements/ShowTransaction, Transaction => $Transaction,
+ RowNum => $i,
+ Ticket => $Ticket &>
+
+%}
+</TABLE>
+
+
+<%INIT>
+
+my ($field, @results);
+
+# {{{ Load the ticket
+#If we get handed two ids, mason will make them an array. bleck.
+# We want teh first one. Just because there's no other sensible way
+# to deal
+my @id = (ref $id eq 'ARRAY') ? @{$id} : ($id);
+
+
+my $Ticket = new RT::Ticket($session{'CurrentUser'});
+if ($id[0] eq 'new') {
+ # {{{ Create a new ticket
+
+ my $Queue = new RT::Queue($session{'CurrentUser'});
+ unless ($Queue->Load($ARGS{'Queue'})) {
+ $m->comp('Error.html', Why => 'Queue not found');
+ $m->abort;
+ }
+
+ unless ($Queue->CurrentUserHasRight('CreateTicket')) {
+ $m->comp('Error.html', Why => 'You have no permission to create tickets in that queue.');
+ $m->abort;
+ }
+
+ my @Requestors = split(/,/,$ARGS{'Requestors'});
+ my @Cc = split(/,/,$ARGS{'Cc'});
+
+
+ my $MIMEObj = MakeMIMEEntity ( Subject => $ARGS{'Subject'},
+ From => $ARGS{'From'},
+ Cc => $ARGS{'Cc'},
+ Body => $ARGS{'Content'},
+ AttachmentFieldName => 'Attach');
+
+ #TODO in Create_Details.html: priorities and due-date
+ my ($id, $Trans, $ErrMsg)= $Ticket->Create(Queue=>$ARGS{Queue},
+ Requestor=> \@Requestors,
+ Cc => \@Cc,
+ Subject=>$ARGS{Subject},
+ MIMEObj => $MIMEObj
+ );
+ unless ($id && $Trans) {
+ $m->comp('Error.html', Why => $ErrMsg);
+ $m->abort();
+ }
+
+ push(@results, $ErrMsg);
+
+ # }}}
+}
+else {
+ unless ($Ticket->Load($id[0])) {
+ $m->comp('Error.html', Why =>"Couldn't load ticket '$id'");
+ $m->abort();
+ }
+}
+# }}}
+
+unless ($session{'CurrentUser'}->HasQueueRight ( TicketObj => $Ticket,
+ Right => 'ShowTicket')) {
+ $m->comp('Error.html', Why => "No permission to display that ticket");
+ $m->abort();
+}
+
+my ($code, $msg);
+
+#Update the status
+if ((defined $ARGS{'Status'}) and
+ ($ARGS{'Status'} ne $Ticket->Status)) {
+ ($code, $msg) = $Ticket->SetStatus($ARGS{'Status'});
+ push @results, "$msg";
+}
+
+ProcessUpdateMessage(ARGSRef=>\%ARGS, Actions=>\@results, TicketObj=>$Ticket);
+
+my $Transactions = $Ticket->Transactions;
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/SelfService/Elements/GotoTicket b/rt/webrt/SelfService/Elements/GotoTicket
new file mode 100755
index 000000000..0c0c8b67a
--- /dev/null
+++ b/rt/webrt/SelfService/Elements/GotoTicket
@@ -0,0 +1 @@
+<FORM ACTION="<%$RT::WebPath%>/SelfService/Display.html"><input type=submit value="Goto ticket">&nbsp;<input size=4 name=id></FORM>
diff --git a/rt/webrt/SelfService/Elements/Header b/rt/webrt/SelfService/Elements/Header
new file mode 100755
index 000000000..ecf58f461
--- /dev/null
+++ b/rt/webrt/SelfService/Elements/Header
@@ -0,0 +1,55 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+ "http://www.w3.org/TR/REC-html40/loose.dtd">
+<HTML>
+<HEAD>
+<TITLE><%$Title%></TITLE>
+% if ($Code) {
+<META NAME="HTTP-EQUIV" VALUE="<%$Code%> <%$Why%>">
+% }
+
+<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
+</HEAD>
+<BODY BGCOLOR="<%$BgColor%>">
+<TABLE BORDER=0 WIDTH=100% CELLSPACING=0 BGCOLOR="#993333">
+<TR VALIGN=TOP>
+<TD WIDTH=32>
+ <IMG SRC="<%$RT::LogoURL%>" alt="RT">
+</TD>
+<TD VALIGN=CENTER ALIGN=LEFT>
+<font size=+2 color=#ffffff>
+<B>
+<%$Title%>
+</B>
+</font>
+</TD>
+<TD ALIGN=RIGHT>
+<font color="#ffffff">
+% if ($session{'CurrentUser'} ) {
+Signed in as <b><%$session{'CurrentUser'}->Name%></b>.<BR>
+% if ($session{'CurrentUser'}->HasSystemRight('ModifySelf')) {
+[<A class='inverse' HREF="<%$RT::WebPath%>/SelfService/Prefs.html" >Preferences</A>]
+% }
+% unless ($RT::WebExternalAuth) {
+ [<A class='inverse' HREF="<%$RT::WebPath%>/NoAuth/Logout.html">Logout</a>]
+% }
+% } else {
+Not logged in.
+% }
+</font>
+</TD>
+</TR>
+</TABLE>
+
+<BR>
+<& /SelfService/Elements/Tabs &>
+
+<%ARGS>
+$Title => ''
+$Code => undef
+$Why => undef
+$BgColor => '#ffffff'
+</%ARGS>
+<%INIT>
+$Title = "RT/$RT::rtname: ".$Title;
+</%INIT>
+
diff --git a/rt/webrt/SelfService/Elements/MyRequests b/rt/webrt/SelfService/Elements/MyRequests
new file mode 100644
index 000000000..ce268d58d
--- /dev/null
+++ b/rt/webrt/SelfService/Elements/MyRequests
@@ -0,0 +1,41 @@
+<& /Elements/TitleBoxStart, title => "Your $friendly_status requests" &>
+<TABLE BORDER=0 cellspacing=1 cellpadding=1 BGCOLOR="#eeeeee" WIDTH=100%>
+<TR>
+<TH>Subject</TH>
+<TH>Status</TH>
+<TH>Owner</TH>
+<TH>&nbsp;</TH>
+</TR>
+<TR>
+% while (my $Ticket = $MyTickets->Next) {
+<TR>
+<TD>
+<%$Ticket->Id%>: <%$Ticket->Subject%>
+</TD>
+<TD>
+<%$Ticket->Status%>
+</TD><TD>
+<%$Ticket->OwnerObj->Name%>
+</TD><TD ALIGN=RIGHT>
+[<A HREF="<% $RT::WebPath %>/SelfService/Display.html?id=<%$Ticket->Id%>">Details</A>]
+</TD>
+</TR>
+% }
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+
+<%INIT>
+my $MyTickets;
+$MyTickets = new RT::Tickets ($session{'CurrentUser'});
+$MyTickets->LimitRequestor(VALUE => $session{'CurrentUser'}->EmailAddress);
+
+foreach my $status (@status) {
+
+ $MyTickets->LimitStatus(VALUE => $status);
+}
+</%INIT>
+<%ARGS>
+$friendly_status => 'open'
+@status => ('open', 'new', 'stalled')
+</%ARGS>
diff --git a/rt/webrt/SelfService/Elements/Tabs b/rt/webrt/SelfService/Elements/Tabs
new file mode 100644
index 000000000..d689d8a72
--- /dev/null
+++ b/rt/webrt/SelfService/Elements/Tabs
@@ -0,0 +1,49 @@
+<TABLE WIDTH=100%>
+<TR>
+% foreach $tab (sort keys %{$tabs}) {
+<TD ALIGN=CENTER>
+[<A HREF="<%$RT::WebPath%>/<% $tabs->{"$tab"}->{'path'}%>"><% $tabs->{"$tab"}->{'title'}%></A>]
+</TD>
+%}
+
+% if ($actions) {
+
+<TD ALIGN=RIGHT>
+<TABLE><TR>
+% foreach my $action (sort keys %{$actions}) {
+<TD>
+<FONT SIZE=-1>
+% if ($actions->{"$action"}->{'html'}) {
+<%$actions->{"$action"}->{'html'} |n%>
+% } else {
+<A HREF="<%$RT::WebPath%>/<% $actions->{$action}->{'path'}%>"><% $actions->{$action}->{'title'}%></A>
+% }
+</FONT>
+</TD>
+% }
+</TR>
+</TABLE>
+</TD>
+%}
+</TR>
+</TABLE>
+<hr>
+<%INIT>
+my ($tab);
+my $tabs = { A => { title => 'Open requests',
+ path => 'SelfService/',
+ },
+ B => { title => 'Closed requests',
+ path => 'SelfService/Closed.html',
+ },
+ C => { title => 'New request',
+ path => 'SelfService/Create.html'
+ }
+ };
+my $actions = {
+ B => { html => $m->scomp('GotoTicket')
+ }
+ };
+</%INIT>
+
+
diff --git a/rt/webrt/SelfService/Error.html b/rt/webrt/SelfService/Error.html
new file mode 100755
index 000000000..19b79e68b
--- /dev/null
+++ b/rt/webrt/SelfService/Error.html
@@ -0,0 +1,22 @@
+<& /SelfService/Elements/Header, Title => 'Error' &>
+<& /Elements/TitleBoxStart, title => $Title &>
+<%$Why%>
+<br>
+<font size=-1>
+<%$Details%>
+</font>
+<& /Elements/TitleBoxEnd &>
+</body>
+</HTML>
+
+
+<%args>
+$Code => undef
+$Details => undef
+$Title => "RT Error"
+$Why => "the calling component did not specify why"
+</%args>
+
+<%INIT>
+$RT::Logger->error("WebRT: $Why ($Details)");
+</%INIT>
diff --git a/rt/webrt/SelfService/Prefs.html b/rt/webrt/SelfService/Prefs.html
new file mode 100755
index 000000000..9c614e9fd
--- /dev/null
+++ b/rt/webrt/SelfService/Prefs.html
@@ -0,0 +1,51 @@
+<& /SelfService/Elements/Header, title => 'Preferences' &>
+
+<& /Elements/ListActions, actions => \@results &>
+<form method=post>
+
+% unless ($RT::WebExternalAuth) {
+<& /Elements/TitleBoxStart, title => 'Change password' &>
+New password: <input type=password name="NewPass1" size=16>
+Confirm: <input type=password name="NewPass2" size=16>
+<& /Elements/TitleBoxEnd &>
+<BR>
+% }
+<& /Elements/TitleBoxStart, title => 'Signature' &>
+
+<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $session{'CurrentUser'}->UserObj->Signature %></TEXTAREA>
+<br>
+<BR>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+ </form>
+
+
+<%INIT>
+my @results;
+
+if ($NewPass1) {
+ if ($NewPass1 ne $NewPass2) {
+ push (@results, "Passwords did not match.");
+ }
+ else {
+ my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1);
+ push (@results, "Password: ".$msg);
+ }
+}
+if ($Signature) {
+ $Signature =~ s/(\r\n|\r)/\n/g;
+ if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
+ my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature);
+ push (@results, "Signature: ".$msg);
+ }
+}
+#A hack to make sure that session gets rewritten.
+
+$session{'i'}++;
+</%INIT>
+
+<%ARGS>
+$Signature => undef
+$NewPass1 => undef
+$NewPass2 => undef
+</%ARGS>
diff --git a/rt/webrt/SelfService/Update.html b/rt/webrt/SelfService/Update.html
new file mode 100755
index 000000000..17f1618a3
--- /dev/null
+++ b/rt/webrt/SelfService/Update.html
@@ -0,0 +1,40 @@
+<& /SelfService/Elements/Header, Title => 'Update ticket #'.$Ticket->id &>
+
+
+<FORM ACTION="Display.html" METHOD=POST ENCTYPE="multipart/form-data">
+
+Status:
+<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+<input type=hidden name="UpdateType" value="response">
+
+Subject: <input name="UpdateSubject" size=60 value="Re: <% $Ticket->Subject %>"> <br>
+Attach: <input name="UpdateAttachment" type=file><br>
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>
+
+
+<& /Elements/Submit &>
+ </FORM>
+
+
+
+<%INIT>
+
+my $Ticket = LoadTicket($id);
+
+my $title = "Update ticket #" . $Ticket->id;
+
+$DefaultStatus = $Ticket->Status() unless ($DefaultStatus);
+
+
+Abort("No permission to view update ticket")
+ unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
+ $Ticket->CurrentUserHasRight('ModifyTicket') );
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Action => undef
+$DefaultStatus => undef
+</%ARGS>
diff --git a/rt/webrt/SelfService/index.html b/rt/webrt/SelfService/index.html
new file mode 100644
index 000000000..a377d8cff
--- /dev/null
+++ b/rt/webrt/SelfService/index.html
@@ -0,0 +1,3 @@
+<& /SelfService/Elements/Header, title => 'Self Service' &>
+
+<& /SelfService/Elements/MyRequests &>
diff --git a/rt/webrt/Ticket/Attachment/dhandler b/rt/webrt/Ticket/Attachment/dhandler
new file mode 100644
index 000000000..0d646cc0b
--- /dev/null
+++ b/rt/webrt/Ticket/Attachment/dhandler
@@ -0,0 +1,27 @@
+<%perl>
+ my ($ticket, $trans,$attach, $filename);
+ my $arg = $m->dhandler_arg; # get rest of path
+ if ($arg =~ '^(\d+)/(\d+)') {
+ $trans = $1;
+ $attach = $2;
+ }
+ else {
+ Abort("Corrupted attachment URL.");
+ }
+ my $AttachmentObj = new RT::Attachment($session{'CurrentUser'});
+ $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could not be loaded");
+
+
+ unless ($AttachmentObj->id) {
+ Abort("Bad attachment id. Couldn't find attachment '$attach'\n");
+ }
+ unless ($AttachmentObj->TransactionId() == $trans ) {
+ Abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->TransactionId() ."\n");
+
+ }
+ my $content_type = $AttachmentObj->ContentType || 'text/plain';
+ SetContentType($content_type);
+ $m->out($AttachmentObj->Content);
+ $m->abort;
+</%perl>
+
diff --git a/rt/webrt/Ticket/Create.html b/rt/webrt/Ticket/Create.html
new file mode 100755
index 000000000..2c61de03a
--- /dev/null
+++ b/rt/webrt/Ticket/Create.html
@@ -0,0 +1,199 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/Create.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<& /Elements/Header, Title => "Create a new ticket" &>
+<& /Elements/Tabs, current_toptab => "Ticket/Create.html" &>
+<FORM ACTION="Display.html" METHOD="POST" ENCTYPE="multipart/form-data">
+<INPUT TYPE=HIDDEN Name="id" VALUE="new">
+<A NAME="top">
+
+
+[<a class="currenttab">Show basics</a>] [<A HREF="#detail">Show details</a>]
+<BR>
+<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => "Create a new ticket"&>
+<div align=right><input type=submit value="Create"></div>
+<TABLE border=0 cellpadding=0 cellspacing=0>
+<TR><TD>Queue</TD>
+<TD><% $QueueObj->Name %>
+<INPUT TYPE=HIDDEN NAME=Queue Value="<%$QueueObj->Name%>">
+</TD>
+<TD>Status:
+</TD>
+<TD>
+<& /Elements/SelectStatus, Name => "Status", Default=> 'new' &>
+</TD>
+<TD>
+Owner:
+</TD>
+<TD>
+<& /Elements/SelectOwner, Name => "ValueOfOwner", QueueObj => $QueueObj &>
+</TD>
+</TR>
+<TR>
+<TD>
+Requestors:
+</TD>
+<TD COLSPAN=5>
+<INPUT Name="Requestors" Value="<%$session{CurrentUser}->EmailAddress%>" SIZE=40>
+</TD>
+</TR>
+<TR>
+<TD>
+Cc:
+</TD>
+<TD COLSPAN=5>
+ <INPUT NAME="Cc" SIZE=40>
+</TD>
+</TR>
+<TR>
+<TD>
+Admin Cc:
+</TD>
+<TD COLSPAN=5>
+ <INPUT NAME="AdminCc" SIZE=40>
+</TD>
+</TR>
+<TR>
+<TD>
+Subject:
+</TD>
+<TD COLSPAN=5>
+<INPUT Name="Subject" SIZE=60 MAXSIZE=100 value="">
+</TD>
+</TR>
+<TR>
+<TD>
+Attach file:
+</TD>
+<TD COLSPAN=5>
+<INPUT TYPE=FILE NAME="Attach">
+</TD>
+</TR>
+<TR>
+<TD COLSPAN=6>
+Describe the issue below:<br>
+<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &>
+
+<BR>
+</TD>
+</TR>
+<TR>
+<TD ALIGN=RIGHT COLSPAN=2>
+</TD>
+</TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, Label => "Create"&>
+
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+
+<A NAME="detail">
+ [<A HREF="#top">Show basics</a>] [<a class="currenttab">Show details</a>]
+<BR>
+<TABLE WIDTH="100%" BORDER=0>
+<TR>
+<TD WIDTH="50%" VALIGN=TOP>
+
+ <& /Elements/TitleBoxStart, title => 'The Basics',
+ title_class=> 'inverse',
+ color => "#993333" &>
+<TABLE BORDER=0>
+<TR><TD ALIGN=RIGHT>Priority:</TD><TD><input size=3 name="InitialPriority" value="<%$QueueObj->InitialPriority%>"></TD></TR>
+<TR><TD ALIGN=RIGHT>Final Priority:</TD><TD><input size=3 name="FinalPriority" value="<%$QueueObj->FinalPriority%>"></TD></TR>
+<TR><TD ALIGN=RIGHT>Time Worked:</TD><TD><input size=3 name="TimeWorked"></TD></TR>
+<TR><TD ALIGN=RIGHT>Time Left:</TD><TD><input size=3 name="TimeLeft"></TD></TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<BR>
+<BR>
+
+
+ <& /Elements/TitleBoxStart,
+ title_class=> 'inverse',
+ title => "Keyword Selections", color => "#993300"
+ &>
+<TABLE BORDER=0>
+% while ( my $KeywordSelect = $KeywordSelects->Next ) {
+% my $Descendents = $KeywordSelect->KeywordObj->Descendents;
+ <TR><TD ALIGN=RIGHT>
+ <% $KeywordSelect->Name %></TD><TD>
+ <INPUT TYPE="hidden" NAME="KeywordSelectMagic<% $KeywordSelect->id %>" VALUE="1">
+ <SELECT NAME="KeywordSelect-<% $KeywordSelect->id %>"
+ <% $KeywordSelect->Single ? "" : " MULTIPLE " %> SIZE=5>
+%#
+%# All of this cruft is so we have a 'no keyword' selector for single
+%# keywords that's only selected when there's no value.
+%
+% foreach my $kid ( keys %{$Descendents} ) {
+ <OPTION VALUE="<% $kid %>"><% $Descendents->{$kid} %></OPTION>
+% }
+% if ( $KeywordSelect->Single) {
+<OPTION VALUE="" SELECTED>(empty)</OPTION>
+% }
+ </SELECT>
+ </TD></TR>
+% }
+
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+
+</TD>
+
+<TD VALIGN="TOP">
+<& /Elements/TitleBoxStart, title => "Dates",
+ title_class=> 'inverse',
+ color => "#663366" &>
+
+<TABLE BORDER=0>
+<TR><TD ALIGN=RIGHT>Starts:</TD><TD><input size=10 name="Starts"></TD></TR>
+<TR><TD ALIGN=RIGHT>Due:</TD><TD><input size=10 name="Due"></TD></TR>
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<BR>
+<& /Elements/TitleBoxStart, title => 'Relationships',
+ title_class=> 'inverse',
+ titleright => '', color=> "#336633" &>
+
+<i>(Enter ticket ids or URLs, seperated with spaces)</i>
+<TABLE BORDER=0>
+<TR><TD ALIGN=RIGHT>Depends on</TD><TD><input size=10 name="new-DependsOn"></TD></TR>
+<TR><TD ALIGN=RIGHT>Depended on by</TD><TD><input size=10 name="DependsOn-new"></TD></TR>
+<TR><TD ALIGN=RIGHT>Parents</TD><TD><input size=10 name="new-MemberOf"></TD></TR>
+<TR><TD ALIGN=RIGHT>Children</TD><TD><input size=10 name="MemberOf-new"></TD></TR>
+<TR><TD ALIGN=RIGHT>Refers to</TD><TD><input size=10 name="new-RefersTo"></TD></TR>
+<TR><TD ALIGN=RIGHT>Referred to by</TD><TD><input size=10 name="RefersTo-new"></TD></TR>
+
+
+</TABLE>
+<& /Elements/TitleBoxEnd &>
+<BR>
+
+</TD>
+</TR>
+</TABLE>
+<& /Elements/Submit, Label => "Create"&>
+</FORM>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR><BR>
+
+<%INIT>
+my $QueueObj = new RT::Queue($session{'CurrentUser'});
+$QueueObj->Load($Queue) || Abort("Queue could not be loaded.");
+my $KeywordSelects = $QueueObj->KeywordSelects;
+
+</%INIT>
+
+<%ARGS>
+$DependsOn => undef
+$DependedOnBy => undef
+$MemberOf => undef
+$QuoteTransaction => undef
+$Queue => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Display.html b/rt/webrt/Ticket/Display.html
new file mode 100755
index 000000000..cb0dc2501
--- /dev/null
+++ b/rt/webrt/Ticket/Display.html
@@ -0,0 +1,152 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/Display.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<& /Elements/Header, Title => "Ticket #".$Ticket->Id ." ".$Ticket->Subject &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/Display.html?id='.$Ticket->id &>
+
+<& /Elements/ListActions, actions => \@Actions &>
+
+<& /Ticket/Elements/ShowSummary, Ticket => $Ticket &>
+
+
+<BR>
+<& /Ticket/Elements/ShowHistory ,
+ Ticket => $Ticket,
+ Collapsed => $ARGS{'Collapsed'},
+ ShowHeaders => $ARGS{'ShowHeaders'} &>
+
+
+<%ARGS>
+$id => undef
+$Create => undef
+$ShowHeaders => undef
+$Collapsed => undef
+</%ARGS>
+
+<%INIT>
+
+
+ my ($linkid, $message, $tid, $Ticket, @Actions);
+
+$Ticket = new RT::Ticket($session{'CurrentUser'});
+
+unless ($id) {
+ Abort('No ticket specified');
+}
+
+if ($ARGS{'id'} eq 'new') {
+ # {{{ Create a new ticket
+
+ my $Queue = new RT::Queue($session{'CurrentUser'});
+ unless ($Queue->Load($ARGS{'Queue'})) {
+ Abort('Queue not found');
+ }
+
+ unless ($Queue->CurrentUserHasRight('CreateTicket')) {
+ Abort('You have no permission to create tickets in that queue.');
+ }
+
+ my $due = new RT::Date($session{'CurrentUser'});
+ $due->Set(Format => 'unknown', Value => $ARGS{'Due'});
+ my $starts = new RT::Date($session{'CurrentUser'});
+ $starts->Set(Format => 'unknown', Value => $ARGS{'Starts'});
+
+
+ my @Requestors = split(/,/,$ARGS{'Requestors'});
+ my @Cc = split(/,/,$ARGS{'Cc'});
+ my @AdminCc = split(/,/,$ARGS{'AdminCc'});
+
+ my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'},
+ From => $ARGS{'From'},
+ Cc => $ARGS{'Cc'},
+ Body => $ARGS{'Content'},
+ AttachmentFieldName => 'Attach');
+
+
+ my %create_args = (
+ Queue=>$ARGS{Queue},
+ Owner=>$ARGS{ValueOfOwner},
+ InitialPriority=> $ARGS{InitialPriority},
+ FinalPriority=> $ARGS{FinalPriority},
+ TimeLeft => $ARGS{TimeLeft},
+ TimeWorked => $ARGS{TimeWorked},
+ Requestor=> \@Requestors,
+ Cc => \@Cc,
+ AdminCc => \@AdminCc,
+ Subject=>$ARGS{Subject},
+ Status=>$ARGS{Status},
+ Due => $due->ISO,
+ Starts => $starts->ISO,
+ MIMEObj => $MIMEObj
+ );
+
+
+ # we need to get any KeywordSelect-<integer> fields into %create_args..
+ grep { $_ =~ /^KeywordSelect-/ && {$create_args{$_} = $ARGS{$_}}} %ARGS;
+
+ my ($id, $Trans, $ErrMsg)= $Ticket->Create(%create_args);
+ unless ($id && $Trans) {
+ Abort($ErrMsg);
+ }
+ my @linktypes = qw( DependsOn MemberOf RefersTo );
+
+ foreach my $linktype (@linktypes) {
+ foreach my $luri (split (/ /,$ARGS{"new-$linktype"})) {
+ $luri =~ s/\s*$//; # Strip trailing whitespace
+ my ($val, $msg) = $Ticket->AddLink( Target => $luri,
+ Type => $linktype);
+ push @Actions, $msg;
+ }
+
+ foreach my $luri (split (/ /,$ARGS{"$linktype-new"})) {
+ my ($val, $msg) = $Ticket->AddLink( Base => $luri,
+ Type => $linktype);
+
+ push @Actions, $msg;
+ }
+ }
+ # don't try to change queue to the current queue
+ delete $ARGS{'Queue'};
+
+ push(@Actions, $ErrMsg);
+ unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
+ Abort("No permission to view newly created ticket #".$Ticket->id.".");
+ }
+ # }}}
+}
+
+else {
+ $Ticket = LoadTicket($ARGS{'id'});
+ unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
+ Abort("No permission to view ticket");
+ }
+
+
+if (defined $ARGS{'Action'}) {
+ if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) {
+ my $action = $1;
+ my ($res, $msg)=$Ticket->$action();
+ push(@Actions, $msg);
+ }
+}
+ $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
+
+ if ($ARGS{'UpdateContent'} &&
+ $ARGS{'UpdateContent'} ne '' &&
+ $ARGS{'UpdateContent'} ne "-- \n" .
+ $session{'CurrentUser'}->UserObj->Signature
+ ) {
+ ProcessUpdateMessage(ARGSRef=>\%ARGS,
+ Actions=>\@Actions,
+ TicketObj=>$Ticket);
+ }
+#Process status updates
+my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket);
+
+push (@Actions, @BasicActions);
+}
+</%INIT>
+
+
+
+
diff --git a/rt/webrt/Ticket/Elements/AddWatchers b/rt/webrt/Ticket/Elements/AddWatchers
new file mode 100755
index 000000000..053cff122
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/AddWatchers
@@ -0,0 +1,54 @@
+<BR>
+<%$msg%><br>
+
+Add new watchers:<br>
+
+<table>
+% if ($Users) {
+<tr><td>
+Type
+</td><td>
+Username
+</td></tr>
+% while (my $u = $Users->Next ) {
+<tr><td><&/Elements/SelectWatcherType, Name => "WatcherTypeUser".$u->Id &></td><td><%$u->Name%> (<%$u->RealName%>)</td></tr>
+% }
+% }
+
+<tr><td>
+Type
+</td><td>
+Email
+</td></tr>
+<tr><td>
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &>
+</td><td>
+<input name="WatcherAddressEmail1" size=15>
+</td></tr>
+<tr><td>
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &>
+</td><td>
+<input name="WatcherAddressEmail2" size=15>
+</td></tr>
+<tr><td>
+<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &>
+</td><td>
+<input name="WatcherAddressEmail3" size=15>
+</td></tr>
+</table>
+
+<%INIT>
+my ($msg, $Users);
+if ($UserString) {
+ $Users = new RT::Users($session{'CurrentUser'});
+ $Users->Limit(FIELD => $UserField,
+ VALUE => $UserString,
+ OPERATOR => $UserOp);
+ }
+</%INIT>
+
+<%ARGS>
+$UserField => 'Name'
+$UserOp => '='
+$UserString => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/EditBasics b/rt/webrt/Ticket/Elements/EditBasics
new file mode 100755
index 000000000..12142879e
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditBasics
@@ -0,0 +1,62 @@
+<TABLE>
+<TR>
+<TD COLSPAN=6>
+ Subject<BR>
+ <input name=Subject value="<%$TicketObj->Subject|h%>" SIZE=50>
+</TD>
+</TR>
+<TR>
+<TD>
+<& /Elements/ShadedBox,
+ title => 'Status',
+ content => $SelectStatus
+&>
+</TD>
+<TD>
+
+<& /Elements/ShadedBox,
+ title => 'Time Worked',
+ content => "<input name=TimeWorked value=\"".$TicketObj->TimeWorked."\" SIZE=5>"
+&>
+
+</TD>
+<TD>
+<& /Elements/ShadedBox,
+ title => 'Time Left',
+ content => "<input name=TimeLeft value=\"".$TicketObj->TimeLeft."\" SIZE=5>"
+&>
+</TD>
+<TD>
+<& /Elements/ShadedBox,
+ title => 'Priority',
+ content => "<input name=Priority value=\"".$TicketObj->Priority."\" SIZE=3>"
+&>
+
+</TD>
+<TD>
+<& /Elements/ShadedBox,
+ title => 'Final Priority',
+ content => "<input name=FinalPriority value=\"".$TicketObj->FinalPriority."\" SIZE=3>"
+&>
+
+
+</TD>
+<TD>
+<& /Elements/ShadedBox,
+ title => 'Queue',
+ content => "$SelectQueue"
+ &>
+</TD>
+</TR>
+</TABLE>
+
+<%INIT>
+#It's hard to do this inline, so we'll preload the html of the selectstatus in here.
+my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', Default=> $TicketObj->Status);
+my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id);
+
+</%INIT>
+<%ARGS>
+
+$TicketObj => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/EditDates b/rt/webrt/Ticket/Elements/EditDates
new file mode 100755
index 000000000..f04130bde
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditDates
@@ -0,0 +1,46 @@
+<TABLE>
+<TR>
+<TD>
+Starts:
+</TD>
+<TD>
+<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &>
+ (<% $TicketObj->StartsObj->AsString %>)
+</TD>
+</TR>
+<TR>
+<TD>
+Started:
+</TD>
+<TD>
+<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)
+
+
+
+</TD>
+</TR>
+
+<TR>
+<TD>
+Last Contact:
+</TD>
+<TD>
+<& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>)
+
+</TD>
+</TR>
+<TR>
+<TD>
+Due:
+</TD>
+<TD>
+
+<& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>)
+</TD>
+</TR>
+
+</TABLE>
+<%ARGS>
+$TicketObj => undef
+</%ARGS>
+
diff --git a/rt/webrt/Ticket/Elements/EditKeywordSelects b/rt/webrt/Ticket/Elements/EditKeywordSelects
new file mode 100644
index 000000000..34ade9f25
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditKeywordSelects
@@ -0,0 +1,45 @@
+
+<TABLE>
+ <TR>
+% while ( my $KeywordSelect = $KeywordSelects->Next ) {
+% my $CurrentKeywords = $TicketObj->KeywordsObj($KeywordSelect->id);
+% my $Descendents = $KeywordSelect->KeywordObj->Descendents;
+ <TD VALIGN=TOP>
+ <% $KeywordSelect->Name %>
+ <BR>
+ <INPUT TYPE="hidden" NAME="KeywordSelectMagic<% $KeywordSelect->id %>" VALUE="1">
+ <SELECT NAME="KeywordSelect<% $KeywordSelect->id %>"
+ <% $KeywordSelect->Single ? "" : " MULTIPLE " %> SIZE=5>
+%#
+%#
+%# All of this cruft is so we have a 'no keyword' selector for single
+%# keywords that's only selected when there's no value.
+%
+% my $selected_keywords = 0;
+% foreach my $kid ( keys %{$Descendents} ) {
+% my $selected = 0;
+% if ($CurrentKeywords->HasEntry($kid)) { $selected_keywords++; $selected=1;}
+ <OPTION VALUE="<% $kid %>"
+ <% $selected && 'SELECTED'%>>
+ <% $Descendents->{$kid} %>
+ </OPTION>
+% }
+% if ( $KeywordSelect->Single) {
+<OPTION VALUE="" <% ($selected_keywords == 0) && 'SELECTED' %> >(empty)</OPTION>
+% }
+ </SELECT>
+ </TD>
+% }
+ </TR>
+
+</TABLE>
+
+
+<%INIT>
+my $KeywordSelects = $TicketObj->QueueObj->KeywordSelects;
+</%INIT>
+
+<%ARGS>
+$TicketObj => undef
+</%ARGS>
+
diff --git a/rt/webrt/Ticket/Elements/EditLinks b/rt/webrt/Ticket/Elements/EditLinks
new file mode 100755
index 000000000..b0296fce1
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditLinks
@@ -0,0 +1,109 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Elements/Attic/EditLinks,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+
+<TABLE>
+<TR>
+<TD VALIGN=TOP>
+<h3>New Relationships</h3>
+<i>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.</i><br>
+<TABLE>
+<TR><TD>Merge into:</TD><TD><input name="<%$Ticket->Id%>-MergeInto"> <i>(only one ticket)</i></TD></TR>
+<TR><TD>Depends on:</TD><TD><input name="<%$Ticket->Id%>-DependsOn"></TD></TR>
+<TR><TD>Depended on by:</TD><TD><input name="DependsOn-<%$Ticket->Id%>"></TD></TR>
+<TR><TD>Parents:</TD><TD><input name="<%$Ticket->Id%>-MemberOf"></TD></TR>
+<TR><TD>Children:</TD><TD> <input name="MemberOf-<%$Ticket->Id%>"></TD></TR>
+<TR><TD>Refers to:</TD><TD><input name="<%$Ticket->Id%>-RefersTo"></TD></TR>
+<TR><TD>Referred to by:</TD><TD> <input name="RefersTo-<%$Ticket->Id%>"></TD></TR>
+</TABLE>
+</TD>
+<TD VALIGN=TOP WIDTH=50%>
+<h3>Current Relationships</h3>
+<i>(Check boxes to delete)</i><br>
+
+Depends on:<BR>
+<UL>
+% while (my $link = $Ticket->DependsOn->Next) {
+% my $member = $link->TargetObj;
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+
+% }
+</UL>
+
+Depended on by:<BR>
+<UL>
+% while (my $link = $Ticket->DependedOnBy->Next) {
+% my $member = $link->BaseObj;
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+% }
+</UL>
+
+Parents:<BR>
+<UL>
+% while (my $link = $Ticket->MemberOf->Next) {
+% my $member = $link->TargetObj;
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+
+% }
+</UL>
+
+Children:<BR>
+<UL>
+% while (my $link = $Ticket->Members->Next) {
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
+% my $member = $link->BaseObj;
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+% }
+</UL>
+
+
+Refers to:<BR>
+<UL>
+% while (my $link = $Ticket->RefersTo->Next) {
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
+% if ($link->TargetIsLocal) {
+% my $member = $link->TargetObj;
+
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$link->TargetAsHREF%>"><%$link->Target%></A>
+% }
+%}
+</UL>
+
+Referred to by:<BR>
+<UL>
+% while (my $link = $Ticket->ReferredToBy->Next) {
+<LI>
+<INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
+% if ($link->BaseIsLocal) {
+% my $member = $link->BaseObj;
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$link->BaseAsHREF%>"><%$link->Base%></A>
+%}
+% }
+</UL>
+
+
+</TD>
+</TR>
+</TABLE>
+
+
+
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/EditPeople b/rt/webrt/Ticket/Elements/EditPeople
new file mode 100755
index 000000000..4f69af970
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditPeople
@@ -0,0 +1,37 @@
+
+<TABLE>
+<TR>
+<TD VALIGN=TOP>
+
+<h3>New watchers</h3>
+Find people whose<BR>
+<& /Elements/SelectUsers &>
+<input type=submit name="OnlySearchForPeople" value="Go!">
+
+<& AddWatchers, Ticket => $Ticket, UserString => $UserString,
+ UserOp => $UserOp, UserField => $UserField &>
+</TD><TD VALIGN=TOP>
+<h3>Owner</h3>
+Owner: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id &>
+<h3>Current watchers</h3>
+(Check box to delete)<br>
+
+Requestors:
+<& EditWatchers, TicketObj => $Ticket, Type => 'requestors' &>
+
+Cc:
+<& EditWatchers, TicketObj => $Ticket, Type => 'cc' &>
+
+Administrative Cc:
+<& EditWatchers, TicketObj => $Ticket, Type => 'admincc' &>
+
+</TD>
+</TR>
+</TABLE>
+
+<%ARGS>
+$UserField => undef
+$UserOp => undef
+$UserString => undef
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/EditWatchers b/rt/webrt/Ticket/Elements/EditWatchers
new file mode 100755
index 000000000..00185e8f9
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/EditWatchers
@@ -0,0 +1,46 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Elements/Attic/EditWatchers,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<ul>
+
+%# Print out a placeholder if there are none.
+%if ($watchers->Count == 0 ) {
+<li><i>none</i>
+% }
+
+
+%while (my $watcher=$watchers->Next) {
+<li>
+<INPUT TYPE=CHECKBOX NAME="DelWatcher<%$watcher->id%>" UNCHECKED>
+%#If there's a principal backing this user, lets give a link to their
+%# account
+%if ($watcher->IsUser) {
+<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->OwnerObj->id%>">
+<%$watcher->OwnerObj->RealName%></a>:
+%} else {
+Email address:
+%}
+<i><%$watcher->Email%></i>
+%}
+</ul>
+<%INIT>
+my ($watchers, $watcher, $set);
+if ($Type =~ /^request/i) {
+ $watchers = $TicketObj->Requestors;
+ }
+elsif ($Type =~ /^admin/i) {
+ $watchers = $TicketObj->AdminCc;
+ }
+elsif ($Type =~ /^cc/i) {
+ $watchers = $TicketObj->Cc;
+ }
+else { $watchers = $TicketObj->Watchers;
+ }
+</%INIT>
+<%ARGS>
+$TicketObj => undef
+$Type => undef
+</%ARGS>
+
+
+
diff --git a/rt/webrt/Ticket/Elements/ShowBasics b/rt/webrt/Ticket/Elements/ShowBasics
new file mode 100755
index 000000000..97c84c9d0
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowBasics
@@ -0,0 +1,29 @@
+ <TABLE WIDTH="100%">
+ <TR>
+ <TD VALIGN=TOP WIDTH="20%">
+ <& /Elements/ShadedBox, title => 'Id' , content => $Ticket->Id &>
+ </TD>
+ <TD VALIGN=TOP WIDTH="20%"> <& /Elements/ShadedBox, title => 'Status' , content => $Ticket->Status &>
+ </TD>
+ <TD VALIGN=TOP WIDTH="20%">
+ <& /Elements/ShadedBox, title => 'Worked' , content => $TimeWorked ." min" &>
+ </TD>
+ <TD VALIGN=TOP WIDTH="20%">
+ <& /Elements/ShadedBox, title => 'Priority', content=> $Ticket->Priority."/".$Ticket->FinalPriority &>
+ </TD>
+ <TD VALIGN=TOP WIDTH="20%">
+ <& /Elements/ShadedBox, title => 'Queue', content=> $Ticket->QueueObj->Name &>
+ </TD>
+
+
+ </TR>
+ </TABLE>
+<%INIT>
+my $TimeWorked = $Ticket->TimeWorked;
+if ($Ticket->TimeLeft > 0 ) {
+ $TimeWorked = $Ticket->TimeWorked."/".$Ticket->TimeLeft;
+}
+</%INIT>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowDates b/rt/webrt/Ticket/Elements/ShowDates
new file mode 100755
index 000000000..e17e31355
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowDates
@@ -0,0 +1,54 @@
+<TABLE>
+<TR>
+<TD>
+Created:
+</TD>
+<TD>
+<% $Ticket->CreatedObj->AsString %>
+</TD>
+</TR>
+<TR>
+<TD>
+Starts:
+</TD>
+<TD>
+<% $Ticket->StartsObj->AsString %> <BR>
+</TD>
+</TR>
+<TR>
+<TD>
+Started:
+</TD>
+<TD>
+<% $Ticket->StartedObj->AsString %>
+</TD>
+</TR>
+
+<TR>
+<TD>
+<a href="Display.html?id=<%$Ticket->id%>&Action=SetTold">Last Contact</a>:
+</TD>
+<TD>
+<% $Ticket->ToldObj->AsString %>
+</TD>
+</TR>
+<TR>
+<TD>
+Due:
+</TD>
+<TD><% $Ticket->DueObj->AsString %>
+</TD>
+</TR>
+<TR>
+<TD>
+Updated:
+</TD>
+<TD>
+<A HREF="#lasttrans">
+<% $Ticket->LastUpdated ? ($Ticket->LastUpdatedAsString ." by ".$Ticket->LastUpdatedByObj->Name) : "Never" | h %></a>
+</TD>
+</TR>
+</TABLE>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowDependencies b/rt/webrt/Ticket/Elements/ShowDependencies
new file mode 100755
index 000000000..488652f83
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowDependencies
@@ -0,0 +1,18 @@
+Depends on:<BR>
+% while (my $Link = $Ticket->DependsOn->Next) {
+% my $member = $Link->TargetObj;
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+ <br>
+% }
+Depended on by:<BR>
+% while (my $Link = $Ticket->DependedOnBy->Next) {
+% my $member = $Link->TargetObj;
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+ <br>
+% }
+
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowHistory b/rt/webrt/Ticket/Elements/ShowHistory
new file mode 100755
index 000000000..155eaaabd
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowHistory
@@ -0,0 +1,43 @@
+<TABLE BORDER=0 width="100%">
+<TR>
+<TD ALIGN=LEFT>
+% if ($ShowTitle) {
+<font size=+3>History</font>
+% }
+&nbsp;</TD>
+<TD align=right><font size=-1>Display mode:
+% if ($ShowHeaders == $Ticket->Id) {
+[<A HREF="<%$URIFile%>?id=<%$Ticket->id%>">Brief headers</a>]
+<b>[Full headers]</b>
+% } else {
+<b>[Brief headers]</b>
+[<A HREF="<%$URIFile%>?ShowHeaders=<%$Ticket->Id%>&id=<%$Ticket->id%>">Full headers</a>]
+% }
+</font>
+</TD>
+</TR>
+</TABLE>
+
+<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>
+% while (my $Transaction = $Transactions->Next) {
+% $i++;
+% if ($Transactions->IsLast) {
+ <a name="lasttrans"></a>
+% }
+ <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i &>
+% }
+</TABLE>
+<%INIT>
+
+my $Transactions = $Ticket->Transactions;
+my $i;
+
+
+</%INIT>
+<%ARGS>
+$URIFile => 'Display.html'
+$Ticket => undef
+$ShowHeaders => undef
+$Collapsed => undef
+$ShowTitle => 1
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowKeywordSelects b/rt/webrt/Ticket/Elements/ShowKeywordSelects
new file mode 100644
index 000000000..4f8a1786b
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowKeywordSelects
@@ -0,0 +1,26 @@
+<TABLE>
+% while ( my $KeywordSelect = $KeywordSelects->Next ) {
+ <TR>
+ <TD VALIGN=TOP>
+ <% $KeywordSelect->Name %><BR>
+ </TD>
+ <TD VALIGN=TOP>
+ <UL>
+% my $Keywords = $Ticket->KeywordsObj($KeywordSelect->Id);
+% while (my $Keyword = $Keywords->Next) {
+ <li><% $Keyword->KeywordObj->RelativePath($KeywordSelect->KeywordObj) |n %></li>
+
+% }
+ </ul>
+ </TD>
+ </TR>
+% }
+</TABLE>
+
+<%INIT>
+my $KeywordSelects = $Ticket->QueueObj->KeywordSelects;
+</%INIT>
+
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowLinks b/rt/webrt/Ticket/Elements/ShowLinks
new file mode 100755
index 000000000..49795959e
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowLinks
@@ -0,0 +1,61 @@
+Depends on:<BR>
+<UL>
+% while (my $Link = $Ticket->DependsOn->Next) {
+% my $member = $Link->TargetObj;
+<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+
+% }
+</UL>
+
+Depended on by:<BR>
+<UL>
+% while (my $Link = $Ticket->DependedOnBy->Next) {
+% my $member = $Link->BaseObj;
+<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+% }
+</UL>
+Parents:<BR>
+<UL>
+% while (my $Link = $Ticket->MemberOf->Next) {
+% my $member = $Link->TargetObj;
+<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%>
+[<%$member->Status%>]
+
+% }
+</UL>
+
+Children:<BR>
+<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
+<BR>
+Refers to:<BR>
+<UL>
+% while (my $Link = $Ticket->RefersTo->Next) {
+<LI>
+% if ($Link->TargetIsLocal) {
+% my $member = $Link->TargetObj;
+
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$Link->TargetAsHREF%>"><%$Link->Target%></A>
+% }
+%}
+</UL>
+
+Referred to by:<BR>
+<UL>
+% while (my $Link = $Ticket->ReferredToBy->Next) {
+<LI>
+% if ($Link->BaseIsLocal) {
+% my $member = $Link->BaseObj;
+<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$Link->BaseAsHREF%>"><%$Link->Base%></A>
+%}
+% }
+</UL>
+
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowMemberOf b/rt/webrt/Ticket/Elements/ShowMemberOf
new file mode 100755
index 000000000..df5dc92b0
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowMemberOf
@@ -0,0 +1,12 @@
+<UL>
+% my $memberof = $Ticket->MemberOf;
+% while (my $member_of = $memberof->Next) {
+<LI><a href="/Ticket/Display.html?id=<%$member_of->Id%>"><%$member_of->Id%></a>: <%$member_of->Subject%> [<%$member_of->Status%>]
+% }
+</UL>
+
+<%INIT>
+</%INIT>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowMembers b/rt/webrt/Ticket/Elements/ShowMembers
new file mode 100755
index 000000000..0a6f12377
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowMembers
@@ -0,0 +1,22 @@
+% if ($members->Count) {
+<UL>
+% while (my $link = $members->Next) {
+% my $member= $link->BaseObj;
+<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: <%$member->Subject%> [<%$member->Status%>]<br>
+% if ($depth < 8) {
+<&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &>
+% }
+% }
+</UL>
+% }
+
+<%INIT>
+
+my $members = $Ticket->Members;
+
+</%INIT>
+
+<%ARGS>
+$Ticket => undef
+$depth => 1
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowPeople b/rt/webrt/Ticket/Elements/ShowPeople
new file mode 100755
index 000000000..ff35f484d
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowPeople
@@ -0,0 +1,12 @@
+Owner<BR>
+&nbsp;<B><%$Ticket->OwnerObj->Name%></B><BR>
+Requestors<BR>
+&nbsp;<B><%$Ticket->RequestorsAsString%></B><BR>
+Cc<BR>
+&nbsp;<B><%$Ticket->CcAsString%></B><BR>
+AdminCc<BR>
+&nbsp;<B><%$Ticket->AdminCcAsString%></B>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
+
diff --git a/rt/webrt/Ticket/Elements/ShowReferences b/rt/webrt/Ticket/Elements/ShowReferences
new file mode 100755
index 000000000..37e2fdece
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowReferences
@@ -0,0 +1,27 @@
+<UL>
+% while (my $Link = $Ticket->RefersTo->Next) {
+<LI>
+% if ($Link->TargetIsLocal) {
+% my $member = $Link->TargetObj;
+
+<a href="/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$Link->TargetAsHREF%>"><%$Link->Target%></A>
+% }
+%}
+
+
+
+% while (my $Link = $Ticket->ReferredToBy->Next) {
+<LI>
+% if ($Link->BaseIsLocal) {
+% my $member = $Link->BaseObj;
+<a href="/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br>
+% } else {
+<A HREF="<%$Link->BaseAsHREF%>"><%$Link->Base%></A>
+%}
+% }
+</UL>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowRequestor b/rt/webrt/Ticket/Elements/ShowRequestor
new file mode 100644
index 000000000..fcbe71df1
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowRequestor
@@ -0,0 +1,35 @@
+<%PERL>
+my $people = $Ticket->Requestors;
+while (my $requestor=$people->Next) {
+if (($requestor->Owner ) && (my $user=$requestor->OwnerObj)) {
+my $name=$user->RealName || $user->EmailAddress;
+my $tickets = new RT::Tickets($session{'CurrentUser'});
+$tickets->LimitRequestor(VALUE => $user->EmailAddress);
+$tickets->LimitStatus( VALUE => 'open');
+$tickets->LimitStatus( VALUE => 'new');
+$tickets->RowsPerPage(25);
+$tickets->OrderBy(FIELD => 'Priority',
+ ORDER => 'DESC');
+</%PERL>
+
+% unless ($user->Privileged) {
+<& /Elements/TitleBoxStart,
+ title => "<a class='inverse' href=\"$RT::WebPath/Admin/Users/Modify.html?id=".$user->id."\">More about $name</a>" &>
+
+Comments about this user:<BR>
+<B><% ($user->Comments || "No comment entered about this user") %></B><BR>
+
+This user's 25 highest priority tickets:<BR>
+<UL>
+%while (my $w=$tickets->Next) {
+<LI><%$w->Id%>: <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$w->id%>"><%$w->Subject%></a> (<%$w->Status%>)
+%}
+</UL>
+<& /Elements/TitleBoxEnd &>
+
+% }
+% }
+%}
+<%ARGS>
+$Ticket=>undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ShowSummary b/rt/webrt/Ticket/Elements/ShowSummary
new file mode 100755
index 000000000..b80ceb4fd
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowSummary
@@ -0,0 +1,61 @@
+ <TABLE WIDTH="100%" >
+ <TR>
+ <TD VALIGN=TOP >
+ <& /Elements/TitleBoxStart, title => 'The Basics',
+ title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ color => "#993333" &>
+ <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+
+ <BR>
+
+ <& /Elements/TitleBoxStart,
+ title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ title => "Keyword Selections", color => "#993300"
+ &>
+ <& /Ticket/Elements/ShowKeywordSelects, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+
+
+
+ <BR>
+ <& /Elements/TitleBoxStart, title => 'Relationships',
+ title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ titleright => '', color=> "#336633" &>
+ <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+ </TD>
+ <BR>
+ <TD VALIGN=TOP >
+
+ <& /Elements/TitleBoxStart, title => "Dates",
+ title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ color => "#663366" &>
+ <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+ <BR>
+ <& /Elements/TitleBoxStart, title => 'People',
+ title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id,
+ title_class=> 'inverse',
+ color => "#333399" &>
+ <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
+ <& /Elements/TitleBoxEnd &>
+ <BR>
+
+ <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &>
+
+
+ </TD>
+ </TR>
+ </TABLE>
+<%ARGS>
+$Ticket => undef
+</%ARGS>
+
+
+
+
diff --git a/rt/webrt/Ticket/Elements/ShowTransaction b/rt/webrt/Ticket/Elements/ShowTransaction
new file mode 100755
index 000000000..a0da008b3
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ShowTransaction
@@ -0,0 +1,162 @@
+<TR bgcolor="<%$rowbgcolor%>">
+<TD bgcolor="<%$bgcolor%>"><A NAME="#<%$Transaction->Id%>"></A>&nbsp&nbsp;</TD>
+<TD>&nbsp&nbsp;</TD>
+<TD><font size=-2><% $transdate|n %></font>&nbsp;</TD>
+<TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$Transaction->BriefDescription%>
+
+</b></TD>
+<TD><%$TimeTaken%>&nbsp;</TD>
+<TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
+</TR>
+<%PERL>
+
+unless ($Collapsed) {
+ $attachments->GotoFirstItem;
+ while (my $message=$attachments->Next) {
+ #we don't want to show any empty transactions, unless they have kids
+ next unless (length $message->Content || $message->Children->Count);
+ my ($headers, $content);
+
+ </%PERL>
+
+
+<%PERL>
+ if ($message->Parent == 0) {
+ if ($ShowHeaders == $Ticket->Id) {
+ $headers = $message->Headers;
+ } else {
+ $headers = $message->NiceHeaders;
+ }
+ chomp $headers;
+ $headers .= "\n\n" if ($headers);
+ }
+ # 13456 is a random # of about the biggest size we want to see inline text
+ my $MAX_INLINE_BODY = 13456;
+ if ($message->ContentType =~ m{^(text/plain|message|text$)}i &&
+ length($message->Content)< $MAX_INLINE_BODY ) {
+
+ $content = $message->Content;
+
+ my $wrapper = new Text::Wrapper (columns=>85);
+ $content = $wrapper->wrap($content);
+ $content =~ s/&/&amp;/g;
+ $content =~ s/</&lt;/g;
+ $content =~ s/>/&gt;/g;
+ $content =~ s!((?:http|https|ftp|mailto):\S*?)([\s"']|&gt;|\.[\n])!<A HREF=\"$1\" TARGET=new>$1</A>$2!g;
+
+
+ }
+ else {
+ $content = "&nbsp;";
+ }
+
+</%PERL>
+<TR BGCOLOR="<%$rowbgcolor%>">
+ <TD BGCOLOR="<%$bgcolor%>">&nbsp;&nbsp;</TD>
+ <TD>&nbsp&nbsp;</TD>
+ <TD COLSPAN=3 VALIGN=TOP>
+ <PRE>
+<%$headers%><%$content|n%>
+</PRE>
+ </TD>
+ <TD VALIGN=TOP ALIGN=RIGHT>
+
+% if ($message->Parent == 0 ) {
+<BR>
+% }
+<%PERL>
+my $size = length($message->Content());
+
+if ($size) {
+ if ($size > 1024) {
+ $size = int($size/102.4)/10 . "k";
+ }
+ else {
+ $size = $size ."b";
+ }
+</%PERL>
+<font size=-1><A HREF="Attachment/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename%>">Download <%$message->Filename|| '(untitled)'%></a> <% $size %></font>
+% }
+</TD>
+</TR>
+% }
+% }
+
+
+
+<%ARGS>
+$Ticket => undef
+$Transaction => undef
+$ShowHeaders => undef
+$Collapsed => undef
+$ShowTitleBarCommands => 1
+$RowNum => 1
+</%ARGS>
+
+<%INIT>
+
+
+my ($TimeTaken, $TicketString, $bgcolor, $rowbgcolor);
+
+my $transdate = $Transaction->CreatedAsString();
+$transdate =~ s/\s/&nbsp;/g;
+
+if ($RowNum % 2) {
+ $rowbgcolor="#cccccc";
+} else {
+ $rowbgcolor="#ffffff";
+}
+
+if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) {
+ if ($Transaction->IsInbound) {
+ $bgcolor="#336699";
+ }
+ else {
+ $bgcolor="#339999";
+ }
+} elsif (($Transaction->Field =~ /^Owner$/) or
+ ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) {
+ $bgcolor="#333399";
+
+} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) {
+ $bgcolor="#336633";
+} elsif ($Transaction->Type =~ /^(Status|Set|Keyword|Told)$/) {
+ if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) {
+ $bgcolor="#663366";
+ }
+ else {
+ $bgcolor="#993333";
+ }
+}
+else {
+ $bgcolor="#cccccc";
+}
+
+if ($Ticket->Id != $Transaction->Ticket) {
+ $TicketString = "Ticket ".$Transaction->Ticket .": ";
+}
+
+if ($Transaction->TimeTaken > 0) {
+ $TimeTaken = $Transaction->TimeTaken." min"
+}
+my $attachments = $Transaction->Attachments;
+
+my $titlebar_commands='&nbsp;';
+
+# If the transaction has anything attached to it at all
+if ($Transaction->Message->First && $ShowTitleBarCommands) {
+ if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) {
+ $titlebar_commands .=
+ "[<a href=\"Update.html?id=".
+ $Transaction->Ticket . "&QuoteTransaction=".$Transaction->Id.
+ "&Action=Respond\">Reply</a>]&nbsp;";
+ }
+ if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) {
+ $titlebar_commands .=
+ "[<a href=\"Update.html?id=".$Transaction->Ticket.
+ "&QuoteTransaction=".$Transaction->Id.
+ "&Action=Comment\">Comment</a>]";
+ }
+}
+
+</%INIT>
diff --git a/rt/webrt/Ticket/Elements/Tabs b/rt/webrt/Ticket/Elements/Tabs
new file mode 100755
index 000000000..8cce197de
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/Tabs
@@ -0,0 +1,126 @@
+<& /Elements/Tabs, tabs => $tabs, actions => $actions, current_tab => $current_tab, tabs_scalar => $tabs_scalar &>
+<%INIT>
+
+ my $id = $Ticket->id();
+ my $tabs_scalar = '';
+ my $tabs = {
+ A => { title => 'Display',
+ path => "Ticket/Display.html?id=".$id,
+ },
+
+ Ab => { title => 'History',
+ path => "Ticket/History.html?id=".$id,
+ },
+ B => { title => 'Basics',
+ path => "Ticket/Modify.html?id=".$id,
+ },
+
+ C => { title => 'Dates',
+ path => "Ticket/ModifyDates.html?id=".$id,
+ },
+
+ D => { title => 'People',
+ path => "Ticket/ModifyPeople.html?id=".$id,
+ },
+ E => { title => 'Links',
+ path => "Ticket/ModifyLinks.html?id=".$id,
+ },
+ F => { title => 'Jumbo',
+ path => "Ticket/ModifyAll.html?id=".$id,
+ },
+
+ };
+
+my $actions;
+if ($Ticket->CurrentUserHasRight('ModifyTicket') or
+ $Ticket->CurrentUserHasRight('CommentOnTicket')) {
+ $actions->{'Comment'} =
+ {
+ title => 'Comment',
+ path => "Ticket/Update.html?Action=Comment&id=".$id,
+ }
+ };
+
+if ($Ticket->CurrentUserHasRight('ModifyTicket') or
+ $Ticket->CurrentUserHasRight('ReplyToTicket')) {
+ $actions->{'Reply'} =
+ {
+ title => 'Reply',
+ path => "Ticket/Update.html?Action=Respond&id=".$id,
+ }
+ };
+
+if ($Ticket->CurrentUserHasRight('OwnTicket')) {
+ if ($Ticket->OwnerObj->id == $RT::Nobody->id) {
+ $actions->{'Take'} =
+ {
+ path => "Ticket/Display.html?Action=Take&id=".$id,
+ title => 'Take'
+ };
+ }
+ elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id) {
+ $actions->{'Steal'} =
+ {
+ path => "Ticket/Display.html?Action=Steal&id=".$id,
+ title => 'Steal'
+ };
+ }
+}
+
+if ($Ticket->CurrentUserHasRight('ModifyTicket')) {
+ if ($Ticket->Status ne 'resolved') {
+ $actions->{'Resolve'} =
+ {
+
+ path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=".$id,
+ title => 'Resolve'
+ };
+ }
+ if ($Ticket->Status ne 'open') {
+ $actions->{'Open'} =
+ {
+ path => "Ticket/Display.html?Status=open&id=". $id,
+ title => 'Open'
+ };
+ }
+}
+
+
+
+
+if (defined $session{'tickets'}) {
+ my $items = $session{'tickets'}->ItemsArrayRef();
+ my @indexs = grep(($items->[$_]->id == $Ticket->Id), 0 .. $#{$items});
+
+ if ($items->[0]) {
+
+ if ($items->[$indexs[0]]->id == $Ticket->Id) {
+ # Don't display prev links if we're on the first ticket
+ if ( $items->[0]->id != $Ticket->id ) {
+ $tabs_scalar .= '[<A HREF="Display.html?id='.
+ $items->[0]->id.
+ '">&lt;&lt; First</a>] ';
+ $tabs_scalar .= '[<A HREF="Display.html?id='.
+ $items->[$indexs[0]-1]->id.
+ '">&lt; Prev</a>] ';
+ }
+ # Don't display next links if we're on the last ticket
+ if ( $Ticket->id != $items->[-1]->id ) {
+ $tabs_scalar .= '[<A HREF="Display.html?id='.
+ $items->[$indexs[0]+1]->id.
+ '">Next &gt;</a>] ';
+ $tabs_scalar .= '[<A HREF="Display.html?id='.
+ $items->[-1]->id.
+ '">Last &gt;&gt</a>]';
+ }
+ $tabs_scalar .= "<BR><BR>";
+ }
+ }
+}
+</%INIT>
+
+
+<%ARGS>
+$Ticket => undef
+$current_tab => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/Elements/ToolBar b/rt/webrt/Ticket/Elements/ToolBar
new file mode 100755
index 000000000..108e2f784
--- /dev/null
+++ b/rt/webrt/Ticket/Elements/ToolBar
@@ -0,0 +1,3 @@
+<%ARGS>
+$Ticket => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/History.html b/rt/webrt/Ticket/History.html
new file mode 100755
index 000000000..e0a5fe15a
--- /dev/null
+++ b/rt/webrt/Ticket/History.html
@@ -0,0 +1,30 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/History.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<& /Elements/Header, Title => "Ticket History #".$Ticket->Id ." ".$Ticket->Subject &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/History.html?id='.$Ticket->id &>
+
+<BR>
+
+<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
+
+<%INIT>
+
+
+
+my $Ticket = LoadTicket ($id);
+
+unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
+ Abort("No permission to view ticket");
+}
+
+</%INIT>
+
+
+
+
diff --git a/rt/webrt/Ticket/Modify.html b/rt/webrt/Ticket/Modify.html
new file mode 100755
index 000000000..7a8a79216
--- /dev/null
+++ b/rt/webrt/Ticket/Modify.html
@@ -0,0 +1,39 @@
+<& /Elements/Header, Title => 'Modify ticket #'.$TicketObj->Id &>
+<& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_tab => "Ticket/Modify.html?id=".$TicketObj->Id &>
+
+<& /Elements/ListActions, actions => \@results &>
+<FORM METHOD=POST ACTION="Modify.html">
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>">
+
+<& /Elements/TitleBoxStart, title => 'Modify ticket #'.$TicketObj->Id,
+ color=> "#993333", width => "100%" &>
+<& Elements/EditBasics, TicketObj => $TicketObj &>
+<& /Elements/TitleBoxEnd &>
+
+<& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&>
+<& Elements/EditKeywordSelects, TicketObj=>$TicketObj &>
+<& /Elements/TitleBoxEnd &>
+
+<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#993333" &>
+</form>
+<%INIT>
+
+my $TicketObj = LoadTicket($id);
+
+my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS);
+my @okresults = ProcessTicketObjectKeywords(TicketObj => $TicketObj, ARGSRef => \%ARGS);
+
+push (@results, @okresults);
+
+# TODO: display the results, even if we can't display the ticket
+
+unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {
+ Abort("No permission to view ticket");
+}
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/ModifyAll.html b/rt/webrt/Ticket/ModifyAll.html
new file mode 100755
index 000000000..ad913739d
--- /dev/null
+++ b/rt/webrt/Ticket/ModifyAll.html
@@ -0,0 +1,124 @@
+<& /Elements/Header, Title => "Ticket #".$Ticket->Id ." Jumbo update: ".$Ticket->Subject &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM METHOD=POST ACTION="ModifyAll.html" ENCTYPE="multipart/form-data">
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">
+
+
+<& /Elements/TitleBoxStart, title => 'Modify ticket #'.$Ticket->Id, color=> "#993333", width => "100%" &>
+<& Elements/EditBasics, TicketObj => $Ticket &>
+<& /Elements/TitleBoxEnd &>
+
+<BR>
+
+<& /Elements/TitleBoxStart, title => 'Dates', width => "100%", color => "#663366" &>
+<& Elements/EditDates, TicketObj => $Ticket &>
+<& /Elements/TitleBoxEnd &>
+
+<BR>
+
+<& /Elements/TitleBoxStart, title => 'Keywords', color =>"#993333"&>
+<& Elements/EditKeywordSelects, TicketObj=>$Ticket &>
+<& /Elements/TitleBoxEnd &>
+
+<BR>
+
+<& /Elements/TitleBoxStart, title => 'People',width => "100%", color=> "#333399" &>
+<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
+<& /Elements/TitleBoxEnd &>
+
+<BR>
+
+<& /Elements/TitleBoxStart, title => 'Relationships', color => "#336633"&>
+<& Elements/EditLinks, Ticket => $Ticket &>
+<& /Elements/TitleBoxEnd &>
+
+<BR>
+
+<& /Elements/TitleBoxStart, title => 'Update ticket' &>
+<hr>
+Update Type: <select name="UpdateType">
+% if ($CanComment) {
+ <option value="private" >Comments (Not sent to requestors)</option>
+% }
+% if ($CanRespond) {
+ <option value="response">Response to requestors</option>
+% }
+</select>
+<br>
+
+Subject: <input name="UpdateSubject" size=60 value=""> <br>
+Attach: <input name="UpdateAttachment" type=file> <br>
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
+<& /Elements/TitleBoxEnd &>
+
+
+<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &>
+</form>
+
+<%INIT>
+
+
+
+my $Ticket = LoadTicket($id);
+
+my $CanRespond = 0;
+my $CanComment = 0;
+
+
+$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
+ $Ticket->CurrentUserHasRight('ModifyTicket') );
+
+$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
+ $Ticket->CurrentUserHasRight('ModifyTicket') );
+
+
+my (@wresults, @results, @okresults, @dresults, @lresults);
+
+unless ($OnlySearchForPeople) {
+ @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
+ @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
+ @okresults = ProcessTicketObjectKeywords(TicketObj => $Ticket, ARGSRef => \%ARGS);
+
+ @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS);
+ @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
+
+ $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
+
+ if ($ARGS{'UpdateContent'} &&
+ $ARGS{'UpdateContent'} ne '' &&
+ $ARGS{'UpdateContent'} ne "-- \n" .
+ $session{'CurrentUser'}->UserObj->Signature
+ ) {
+ ProcessUpdateMessage(TicketObj => $Ticket,
+ ARGSRef=>\%ARGS,
+ Actions=>\@results);
+ }
+}
+push @results, @wresults;
+push @results, @dresults;
+push @results, @lresults;
+push @results, @okresults;
+
+# If they've gone and moved the ticket to somewhere they can't see, etc...
+# TODO: display the results, even if we can't display the ticket.
+
+unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
+ Abort("No permission to view ticket");
+}
+
+
+</%INIT>
+
+
+
+<%ARGS>
+$OnlySearchForPeople => undef
+$UserField => undef
+$UserOp => undef
+$UserString => undef
+$id => undef
+</%ARGS>
+
diff --git a/rt/webrt/Ticket/ModifyDates.html b/rt/webrt/Ticket/ModifyDates.html
new file mode 100755
index 000000000..b2ecb68fb
--- /dev/null
+++ b/rt/webrt/Ticket/ModifyDates.html
@@ -0,0 +1,26 @@
+<& /Elements/Header, Title => 'Modify dates for #'. $TicketObj->Id &>
+<& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_tab => "Ticket/ModifyDates.html?id=".$TicketObj->Id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM METHOD=POST ACTION="ModifyDates.html">
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>">
+<& /Elements/TitleBoxStart, title => 'Modify dates for ticket #'.$TicketObj->Id, width => "100%", color => "#663366" &>
+
+<& Elements/EditDates, TicketObj => $TicketObj &>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, color => "#663366" &>
+</form>
+
+
+<%INIT>
+
+my $TicketObj = LoadTicket($id);
+my @results = ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS);
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/ModifyLinks.html b/rt/webrt/Ticket/ModifyLinks.html
new file mode 100755
index 000000000..14c939d43
--- /dev/null
+++ b/rt/webrt/Ticket/ModifyLinks.html
@@ -0,0 +1,31 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Ticket/Attic/ModifyLinks.html,v 1.1 2002-08-12 06:17:09 ivan Exp $
+%# Copyright 1996-2000 Jesse Vincent <jesse@fsck.com>
+
+<& /Elements/Header, Title => "Link ticket ".$Ticket->Id &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => "Ticket/ModifyLinks.html?id=".$Ticket->Id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<form action="ModifyLinks.html" method="post">
+<input type="hidden" name="id" value="<%$Ticket->id%>">
+
+<& /Elements/TitleBoxStart, title => 'Edit Relationships', color => "#336633"&>
+<& Elements/EditLinks, Ticket => $Ticket &>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, color => "#336633", Caption=> 'Save changes' &>
+</form>
+
+
+
+
+<%INIT>
+
+my $Ticket = LoadTicket($id);
+my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
+
+</%INIT>
+
+
+<%ARGS>
+$id => undef
+</%ARGS>
diff --git a/rt/webrt/Ticket/ModifyPeople.html b/rt/webrt/Ticket/ModifyPeople.html
new file mode 100755
index 000000000..fecf09192
--- /dev/null
+++ b/rt/webrt/Ticket/ModifyPeople.html
@@ -0,0 +1,38 @@
+<& /Elements/Header, Title => 'Modify people related to ticket # ' . $Ticket->id &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket , current_tab => "Ticket/ModifyPeople.html?id=".$Ticket->Id &>
+
+<& /Elements/ListActions, actions => \@results &>
+
+<FORM METHOD=POST ACTION="ModifyPeople.html">
+<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>">
+<& /Elements/TitleBoxStart, title => 'Modify people related to ticket #'.$Ticket->Id, width => "100%", color=> "#333399" &>
+<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit, Label => 'Save Changes', Caption => "If you've updated anything above, be sure to", color => "#333399" &>
+</form>
+
+<%INIT>
+
+my (@results, @wresults);
+
+my $Ticket = LoadTicket($id);
+
+# if we're trying to search for watchers and nothing else
+unless ($OnlySearchForPeople) {
+ @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
+ @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
+}
+
+push @results, @wresults;
+</%INIT>
+
+
+
+<%ARGS>
+$OnlySearchForPeople => undef
+$UserField => undef
+$UserOp => undef
+$UserString => undef
+$id => undef
+</%ARGS>
+
diff --git a/rt/webrt/Ticket/Update.html b/rt/webrt/Ticket/Update.html
new file mode 100755
index 000000000..be2266663
--- /dev/null
+++ b/rt/webrt/Ticket/Update.html
@@ -0,0 +1,110 @@
+<& /Elements/Header, Title=> $title &>
+<& /Ticket/Elements/Tabs, Ticket => $Ticket &>
+<& /Elements/TitleBoxStart, title => "Update ticket" &>
+
+<FORM ACTION="Display.html" NAME="TicketUpdate"
+ METHOD=POST enctype="multipart/form-data">
+
+<TABLE>
+<TR><TD>
+<a href="ModifyPeople.html?id=<%$Ticket->Id%>">Ticket watchers</A></TD><TD align=right>
+Requestor:
+</TD><TD>
+<b><% $Ticket->RequestorsAsString %></b>
+</TD></TR>
+<TR><TD>&nbsp;</TD><TD align=right>
+Cc:
+</TD><TD>
+<b><% $Ticket->CcAsString %></b>
+</TD></TR>
+<TR><TD>&nbsp;</TD><TD align=right>
+AdminCc:
+</TD><TD>
+<b><% $Ticket->AdminCcAsString %></b>
+</TD></TR>
+</TR>
+</TABLE>
+<hr>
+
+<TABLE BORDER=0>
+
+<tr><td align=right>Status:</td>
+<td>
+<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+Owner:
+<& /Elements/SelectOwner, Name=>"Owner", Default => $Ticket->OwnerObj->Id(), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &>
+Worked: <input size=4 name="UpdateTimeWorked"> minutes</td></tr>
+<tr><td align=right>Update Type:</td>
+<td><select name="UpdateType">
+% if ($CanComment) {
+ <option value="private" <%$CommentDefault%>>Comments (Not sent to requestors)</option>
+% }
+% if ($CanRespond) {
+ <option value="response" <%$ResponseDefault%>>Response to requestors</option>
+% }
+</select>
+</td></tr>
+<tr><td align=right>Subject:</td><td> <input name="UpdateSubject" size=60 value="<%$Ticket->Subject()%>"></td></tr>
+<tr><td align=right>Cc:</td><td> <input name="UpdateCc" size=60><BR>
+<i><font size=-2>(Sends a carbon-copy of this update to a comma-delimited list
+of email addresses. Does <b>not</b> change who will receive future updates.)</font></i>
+</td></tr>
+<tr><td align=right>Bcc:</td><td> <input name="UpdateBcc" size=60><BR>
+<i><font size=-2>(Sends a blind carbon-copy of this update to a comma-delimited list
+of email addresses. Does <b>not</b> change who will receive future updates.)</font></i>
+</td></tr>
+<tr><td align=right>Attach:</td><td><input name="UpdateAttachment" type="file"></td></tr>
+</table>
+<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
+ <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br>
+
+
+
+
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+ </FORM>
+
+
+
+<%INIT>
+
+my $CanRespond = 0;
+my $CanComment = 0;
+my $title;
+
+my $Ticket = LoadTicket($id);
+
+
+if ($DefaultStatus eq 'resolved') {
+ $title = "Resolve";
+} else {
+ $title = "Update";
+}
+
+$title .= " ticket #" . $Ticket->id . " (" .$Ticket->Subject.")";
+
+# Things needed in the template - we'll do the processing here, just
+# for the convinience:
+my $CommentDefault=$Action eq "Comment" ? "SELECTED" : "";
+my $ResponseDefault=$Action eq "Respond" ? "SELECTED" : "";
+
+$DefaultStatus = $Ticket->Status() unless ($DefaultStatus);
+
+$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or
+ $Ticket->CurrentUserHasRight('ModifyTicket') );
+
+$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or
+ $Ticket->CurrentUserHasRight('ModifyTicket') );
+
+
+
+
+
+</%INIT>
+
+<%ARGS>
+$id => undef
+$Action => undef
+$DefaultStatus => undef
+</%ARGS>
diff --git a/rt/webrt/User/Prefs.html b/rt/webrt/User/Prefs.html
new file mode 100755
index 000000000..d769977f9
--- /dev/null
+++ b/rt/webrt/User/Prefs.html
@@ -0,0 +1,53 @@
+<& /Elements/Header, Title=>"Preferences" &>
+<& /Elements/Tabs &>
+
+<& /Elements/ListActions, actions => \@results &>
+<form method=post>
+
+% unless ($RT::WebExternalAuth) {
+<& /Elements/TitleBoxStart, title => 'Change password' &>
+New password: <input type=password name="NewPass1" size=16>
+Confirm: <input type=password name="NewPass2" size=16>
+<& /Elements/TitleBoxEnd &>
+<BR>
+% }
+<& /Elements/TitleBoxStart, title => 'Signature' &>
+<INPUT TYPE=HIDDEN NAME="SignatureMagic" VALUE=1>
+<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $session{'CurrentUser'}->UserObj->Signature %></TEXTAREA>
+<br>
+<BR>
+<& /Elements/TitleBoxEnd &>
+<& /Elements/Submit &>
+ </form>
+
+
+<%INIT>
+my @results;
+
+if ($NewPass1) {
+ if ($NewPass1 ne $NewPass2) {
+ push (@results, "Passwords did not match.");
+ }
+ else {
+ my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1);
+ push (@results, "Password: ".$msg);
+ }
+}
+if ($Signature || $SignatureMagic) {
+ $Signature =~ s/(\r\n|\r)/\n/g;
+ if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) {
+ my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature);
+ push (@results, "Signature: ".$msg);
+ }
+}
+#A hack to make sure that session gets rewritten.
+
+$session{'i'}++;
+</%INIT>
+
+<%ARGS>
+$Signature => undef
+$SignatureMagic => undef
+$NewPass1 => undef
+$NewPass2 => undef
+</%ARGS>
diff --git a/rt/webrt/autohandler b/rt/webrt/autohandler
new file mode 100755
index 000000000..16cdbc79b
--- /dev/null
+++ b/rt/webrt/autohandler
@@ -0,0 +1,73 @@
+%# $Header: /home/cvs/cvsroot/freeside/rt/webrt/Attic/autohandler,v 1.1 2002-08-12 06:17:08 ivan Exp $
+<& /Elements/Footer, %ARGS &>
+
+<%INIT>
+
+$m->{'rt_base_time'} = time;
+
+#if it's a noauth file, don't ask for auth.
+if ($m->base_comp->path =~ '^/+NoAuth/') {
+ $m->call_next();
+ $m->abort();
+}
+
+# If RT is configured for external auth, let's get REMOTE_USER
+# We intentionally don't test for REMOTE_USER to meet our policy
+elsif ($RT::WebExternalAuth){
+
+ $user = $ENV{'REMOTE_USER'};
+ $session{'CurrentUser'} = RT::CurrentUser->new();
+ $session{'CurrentUser'}->Load($user);
+ unless ($session{'CurrentUser'}->id() ) {
+ delete $session{'CurrentUser'};
+ $m->comp('/Elements/Login', %ARGS, Error=> 'You are not an authorized user');
+ $m->abort();
+ }
+}
+
+# If the user is loging in, let's authenticate
+elsif (defined ($user) && defined ($pass)){
+
+ $session{'CurrentUser'} = RT::CurrentUser->new();
+ $session{'CurrentUser'}->Load($user);
+ unless ($session{'CurrentUser'}->id() ) {
+ delete $session{'CurrentUser'};
+ $m->comp('/Elements/Login', %ARGS, Error=> 'Your username or password is incorrect');
+ $m->abort();
+ };
+ unless ($session{'CurrentUser'}->IsPassword($pass)) {
+ delete $session{'CurrentUser'};
+
+ $m->comp('/Elements/Login', Error => 'Your username or password is incorrect', %ARGS);
+ $m->abort();
+ }
+}
+
+
+#If we've got credentials, lets serve the file up.
+if ( (defined $session{'CurrentUser'}) and
+ ( $session{'CurrentUser'}->Id) ) {
+
+ # If the user isn\'t privileged, they can only see SelfService
+ if ((! $session{'CurrentUser'}->Privileged) and
+ ($m->base_comp->path !~ '^/+SelfService/') ) {
+ $m->comp('/SelfService/index.html');
+ $m->abort();
+ }
+ else {
+ $m->call_next;
+ }
+}
+
+#If we have no credentials
+else {
+ $m->comp('/Elements/Login', %ARGS);
+ $m->abort();
+}
+
+</%INIT>
+
+<%ARGS>
+$user => undef
+$pass => undef
+</%ARGS>
diff --git a/rt/webrt/index.html b/rt/webrt/index.html
new file mode 100644
index 000000000..0c1091abb
--- /dev/null
+++ b/rt/webrt/index.html
@@ -0,0 +1,25 @@
+<& /Elements/Header, Title=>"Start page", Refresh => $session{'home_refresh_interval'} &>
+<& /Elements/Tabs, current_toptab => '' &>
+<TABLE BORDER=0 WIDTH=100%>
+<TR VALIGN=TOP>
+<TD WIDTH=70%>
+<& /Elements/CustomHomepageHeader, %ARGS &>
+<& /Elements/MyTickets &>
+<BR>
+<& /Elements/MyRequests &>
+</TD>
+<TD>
+<& /Elements/Quicksearch &>
+<BR>
+<form method=get action="index.html">
+<& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session {'home_refresh_interval'} &>
+<div align=right><input type=submit value="Go!"></div>
+</form>
+</TD>
+</TR>
+</TABLE>
+<%init>
+if ($ARGS{'HomeRefreshInterval'}) {
+ $session{'home_refresh_interval'} = $ARGS{'HomeRefreshInterval'};
+}
+</%init>
diff --git a/sql-ledger/SL/AM.pm b/sql-ledger/SL/AM.pm
new file mode 100644
index 000000000..d691b3ce6
--- /dev/null
+++ b/sql-ledger/SL/AM.pm
@@ -0,0 +1,694 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Administration module
+# Chart of Accounts
+# template routines
+# preferences
+#
+#======================================================================
+
+package AM;
+
+
+sub get_account {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description, charttype, gifi_accno,
+ category, link
+ FROM chart
+ WHERE id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ foreach my $key (keys %$ref) {
+ $form->{"$key"} = $ref->{"$key"};
+ }
+
+ $sth->finish;
+
+
+ # get default accounts
+ $query = qq|SELECT inventory_accno_id, income_accno_id, expense_accno_id
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %ref;
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub save_account {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off AutoCommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # sanity check, can't have AR with AR_...
+ if ($form->{AR} || $form->{AP} || $form->{IC}) {
+ map { delete $form->{$_} } qw(AR_amount AR_tax AR_paid AP_amount AP_tax AP_paid IC_sale IC_cogs IC_taxpart IC_income IC_expense IC_taxservice);
+ }
+
+ $form->{link} = "";
+ foreach my $item ($form->{AR},
+ $form->{AR_amount},
+ $form->{AR_tax},
+ $form->{AR_paid},
+ $form->{AP},
+ $form->{AP_amount},
+ $form->{AP_tax},
+ $form->{AP_paid},
+ $form->{IC},
+ $form->{IC_sale},
+ $form->{IC_cogs},
+ $form->{IC_taxpart},
+ $form->{IC_income},
+ $form->{IC_expense},
+ $form->{IC_taxservice},
+ $form->{CT_tax}
+ ) {
+ $form->{link} .= "${item}:" if ($item);
+ }
+ chop $form->{link};
+
+ # if we have an id then replace the old record
+ $form->{description} =~ s/'/''/g;
+
+ # strip blanks from accno
+ map { $form->{$_} =~ s/ //g; } qw(accno gifi_accno);
+
+ my ($query, $sth);
+
+ if ($form->{id}) {
+ $query = qq|UPDATE chart SET
+ accno = '$form->{accno}',
+ description = '$form->{description}',
+ charttype = '$form->{charttype}',
+ gifi_accno = '$form->{gifi_accno}',
+ category = '$form->{category}',
+ link = '$form->{link}'
+ WHERE id = $form->{id}|;
+ } else {
+ $query = qq|INSERT INTO chart
+ (accno, description, charttype, gifi_accno, category, link)
+ VALUES ('$form->{accno}', '$form->{description}',
+ '$form->{charttype}', '$form->{gifi_accno}',
+ '$form->{category}', '$form->{link}')|;
+ }
+ $dbh->do($query) || $form->dberror($query);
+
+
+ if ($form->{IC_taxpart} || $form->{IC_taxservice} || $form->{CT_tax}) {
+
+ my $chart_id = $form->{id};
+
+ unless ($form->{id}) {
+ # get id from chart
+ $query = qq|SELECT id
+ FROM chart
+ WHERE accno = '$form->{accno}'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($chart_id) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+ # add account if it doesn't exist in tax
+ $query = qq|SELECT chart_id
+ FROM tax
+ WHERE chart_id = $chart_id|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($tax_id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # add tax if it doesn't exist
+ unless ($tax_id) {
+ $query = qq|INSERT INTO tax (chart_id, rate)
+ VALUES ($chart_id, 0)|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ } else {
+ # remove tax
+ if ($form->{id}) {
+ $query = qq|DELETE FROM tax
+ WHERE chart_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+
+ # commit
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub delete_account {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off AutoCommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # delete chart of account record
+ $query = qq|DELETE FROM chart
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # set inventory_accno_id, income_accno_id, expense_accno_id to defaults
+ $query = qq|UPDATE parts
+ SET inventory_accno_id =
+ (SELECT inventory_accno_id FROM defaults)
+ WHERE inventory_accno_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|UPDATE parts
+ SET income_accno_id =
+ (SELECT income_accno_id FROM defaults)
+ WHERE income_accno_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|UPDATE parts
+ SET expense_accno_id =
+ (SELECT expense_accno_id FROM defaults)
+ WHERE expense_accno_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ foreach my $table (qw(partstax customertax vendortax tax)) {
+ $query = qq|DELETE FROM $table
+ WHERE chart_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # commit and redirect
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub gifi_accounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description
+ FROM gifi
+ ORDER BY accno|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{ALL} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+
+sub get_gifi {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description
+ FROM gifi
+ WHERE accno = '$form->{accno}'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub save_gifi {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ $form->{description} =~ s/'/''/g;
+ $form->{accno} =~ s/ //g;
+
+ # id is the old account number!
+ if ($form->{id}) {
+ $query = qq|UPDATE gifi SET
+ accno = '$form->{accno}',
+ description = '$form->{description}'
+ WHERE accno = '$form->{id}'|;
+ } else {
+ $query = qq|INSERT INTO gifi
+ (accno, description)
+ VALUES ('$form->{accno}', '$form->{description}')|;
+ }
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+sub delete_gifi {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # id is the old account number!
+ $query = qq|DELETE FROM gifi
+ WHERE accno = '$form->{id}'|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+sub load_template {
+ my ($self, $form) = @_;
+
+ open(TEMPLATE, "$form->{file}") or $form->error("$form->{file} : $!");
+
+ while (<TEMPLATE>) {
+ $form->{body} .= $_;
+ }
+
+ close(TEMPLATE);
+
+}
+
+
+sub save_template {
+ my ($self, $form) = @_;
+
+ open(TEMPLATE, ">$form->{file}") or $form->error("$form->{file} : $!");
+
+ # strip
+ $form->{body} =~ s/\r\n/\n/g;
+ print TEMPLATE $form->{body};
+
+ close(TEMPLATE);
+
+}
+
+
+
+sub save_preferences {
+ my ($self, $myconfig, $form, $memberfile, $userspath) = @_;
+
+ map { ($form->{$_}) = split /--/, $form->{$_} } qw(inventory_accno income_accno expense_accno fxgain_accno fxloss_accno);
+
+ my @a;
+ $form->{curr} =~ s/ //g;
+ map { push(@a, uc pack "A3", $_) if $_ } split /:/, $form->{curr};
+ $form->{curr} = join ':', @a;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # these defaults are database wide
+ # user specific variables are in myconfig
+ # save defaults
+ my $query = qq|UPDATE defaults SET
+ inventory_accno_id =
+ (SELECT id FROM chart
+ WHERE accno = '$form->{inventory_accno}'),
+ income_accno_id =
+ (SELECT id FROM chart
+ WHERE accno = '$form->{income_accno}'),
+ expense_accno_id =
+ (SELECT id FROM chart
+ WHERE accno = '$form->{expense_accno}'),
+ fxgain_accno_id =
+ (SELECT id FROM chart
+ WHERE accno = '$form->{fxgain_accno}'),
+ fxloss_accno_id =
+ (SELECT id FROM chart
+ WHERE accno = '$form->{fxloss_accno}'),
+ invnumber = '$form->{invnumber}',
+ sonumber = '$form->{sonumber}',
+ ponumber = '$form->{ponumber}',
+ yearend = '$form->{yearend}',
+ curr = '$form->{curr}',
+ weightunit = '$form->{weightunit}',
+ businessnumber = '$form->{businessnumber}'
+ |;
+ $dbh->do($query) || $form->dberror($query);
+
+ # update name
+ my $name = $form->{name};
+ $name =~ s/'/''/g;
+ $query = qq|UPDATE employee
+ SET name = '$name'
+ WHERE login = '$form->{login}'|;
+ $dbh->do($query) || $form->dberror($query);
+
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $query = qq|UPDATE tax
+ SET rate = |.($form->{$item} / 100).qq|,
+ taxnumber = '$form->{"taxnumber_$item"}'
+ WHERE chart_id = $item|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ # save first currency in myconfig
+ $form->{currency} = substr($form->{curr},0,3);
+
+ my $myconfig = new User "$memberfile", "$form->{login}";
+
+ foreach my $item (keys %$form) {
+ $myconfig->{$item} = $form->{$item};
+ }
+
+ $myconfig->save_member($memberfile, $userspath);
+
+ $rc;
+
+}
+
+
+sub defaultaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get defaults from defaults table
+ my $query = qq|SELECT * FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $form->{defaults} = $sth->fetchrow_hashref(NAME_lc);
+ $form->{defaults}{IC} = $form->{defaults}{inventory_accno_id};
+ $form->{defaults}{IC_income} = $form->{defaults}{income_accno_id};
+ $form->{defaults}{IC_expense} = $form->{defaults}{expense_accno_id};
+ $form->{defaults}{FX_gain} = $form->{defaults}{fxgain_accno_id};
+ $form->{defaults}{FX_loss} = $form->{defaults}{fxloss_accno_id};
+
+
+ $sth->finish;
+
+
+ $query = qq|SELECT id, accno, description, link
+ FROM chart
+ WHERE link LIKE '%IC%'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ foreach my $key (split(/:/, $ref->{link})) {
+ if ($key =~ /IC/) {
+ $nkey = $key;
+ if ($key =~ /cogs/) {
+ $nkey = "IC_expense";
+ }
+ if ($key =~ /sale/) {
+ $nkey = "IC_income";
+ }
+ %{ $form->{IC}{$nkey}{$ref->{accno}} } = ( id => $ref->{id},
+ description => $ref->{description} );
+ }
+ }
+ }
+ $sth->finish;
+
+
+ $query = qq|SELECT id, accno, description
+ FROM chart
+ WHERE category = 'I'
+ AND charttype = 'A'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ %{ $form->{IC}{FX_gain}{$ref->{accno}} } = ( id => $ref->{id},
+ description => $ref->{description} );
+ }
+ $sth->finish;
+
+ $query = qq|SELECT id, accno, description
+ FROM chart
+ WHERE category = 'E'
+ AND charttype = 'A'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ %{ $form->{IC}{FX_loss}{$ref->{accno}} } = ( id => $ref->{id},
+ description => $ref->{description} );
+ }
+ $sth->finish;
+
+
+ # now get the tax rates and numbers
+ $query = qq|SELECT chart.id, chart.accno, chart.description,
+ tax.rate * 100 AS rate, tax.taxnumber
+ FROM chart, tax
+ WHERE chart.id = tax.chart_id|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $form->{taxrates}{$ref->{accno}}{id} = $ref->{id};
+ $form->{taxrates}{$ref->{accno}}{description} = $ref->{description};
+ $form->{taxrates}{$ref->{accno}}{taxnumber} = $ref->{taxnumber} if $ref->{taxnumber};
+ $form->{taxrates}{$ref->{accno}}{rate} = $ref->{rate} if $ref->{rate};
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub backup {
+ my ($self, $myconfig, $form, $userspath) = @_;
+
+ my ($tmpfile, $out, $mail);
+
+ if ($form->{media} eq 'email') {
+
+ my $boundary = time;
+ $tmpfile = "$userspath/$boundary.$myconfig->{dbname}-$form->{dbversion}.sql";
+ $out = $form->{OUT};
+ $form->{OUT} = ">$tmpfile";
+
+ use SL::Mailer;
+ $mail = new Mailer;
+
+ $mail->{to} = qq|"$myconfig->{name}" <$myconfig->{email}>|;
+ $mail->{from} = qq|"$myconfig->{name}" <$myconfig->{email}>|;
+ $mail->{subject} = "SQL-Ledger Backup / $myconfig->{dbname}-$form->{dbversion}.sql";
+ @{ $mail->{attachments} } = ($tmpfile);
+ $mail->{version} = $form->{version};
+ $mail->{fileid} = "$boundary.";
+
+ $myconfig->{signature} =~ s/\\n/\r\n/g;
+ $mail->{message} = "--\n$myconfig->{signature}";
+
+ }
+
+ if ($form->{OUT}) {
+ open(OUT, "$form->{OUT}") or $form->error("$form->{OUT} : $!");
+ } else {
+ open(OUT, ">-") or $form->error("STDOUT : $!");
+ }
+
+ if ($form->{media} eq 'file') {
+ print OUT qq|Content-Type: Application/File;
+Content-Disposition: filename="$myconfig->{dbname}-$form->{dbversion}.sql"\n\n|;
+ }
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get all the tables
+ my @tables = $dbh->tables;
+
+ my $today = scalar localtime;
+
+
+ $myconfig->{dbhost} = 'localhost' unless $myconfig->{dbhost};
+
+ print OUT qq|-- SQL-Ledger Backup
+-- Dataset: $myconfig->{dbname}
+-- Version: $form->{dbversion}
+-- Host: $myconfig->{dbhost}
+-- Login: $form->{login}
+-- User: $myconfig->{name}
+-- Date: $today
+--
+-- set options
+$myconfig->{dboptions};
+--
+|;
+
+ foreach $table (@tables) {
+ my $query = qq|SELECT * FROM $table|;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $query = qq|INSERT INTO $table (|;
+ map { $query .= qq|$sth->{NAME}->[$_],| } (0 .. $sth->{NUM_OF_FIELDS} - 1);
+ chop $query;
+
+ $query .= qq|) VALUES|;
+
+ print OUT qq|--
+DELETE FROM $table;
+|;
+ while (my @arr = $sth->fetchrow_array) {
+
+ $fields = "(";
+ foreach my $item (@arr) {
+ if (defined $item) {
+ $item =~ s/'/''/g;
+ $fields .= qq|'$item',|;
+ } else {
+ $fields .= 'NULL,';
+ }
+ }
+
+ chop $fields;
+ $fields .= ")";
+
+ print OUT qq|$query $fields;\n|;
+ }
+
+ $sth->finish;
+ }
+
+ $query = qq|SELECT last_value FROM id|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ print OUT qq|--
+DROP SEQUENCE id;
+CREATE SEQUENCE id START $id;
+|;
+
+ close(OUT);
+
+ $dbh->disconnect;
+
+ if ($form->{media} eq 'email') {
+ my $err = $mail->send($out);
+ $_ = $tmpfile;
+ unlink;
+ }
+
+}
+
+
+sub closedto {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT closedto, revtrans FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array;
+
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+sub closebooks {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+
+ if ($form->{revtrans}) {
+
+ $query = qq|UPDATE defaults SET closedto = NULL,
+ revtrans = '1'|;
+ } else {
+ if ($form->{closedto}) {
+
+ $query = qq|UPDATE defaults SET closedto = '$form->{closedto}',
+ revtrans = '0'|;
+ } else {
+
+ $query = qq|UPDATE defaults SET closedto = NULL,
+ revtrans = '0'|;
+ }
+ }
+
+ # set close in defaults
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/AP.pm b/sql-ledger/SL/AP.pm
new file mode 100644
index 000000000..e1870f872
--- /dev/null
+++ b/sql-ledger/SL/AP.pm
@@ -0,0 +1,381 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Accounts Payables database backend routines
+#
+#======================================================================
+
+
+package AP;
+
+
+sub post_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($null, $taxrate, $amount);
+ my $exchangerate = 0;
+
+ # split and store id numbers in link accounts
+ ($form->{AP}{payables}) = split(/--/, $form->{AP});
+ map { ($form->{AP}{"amount_$_"}) = split(/--/, $form->{"AP_amount_$_"}) } (1 .. $form->{rowcount});
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{exchangerate} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'sell');
+
+ $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+ }
+
+ # reverse and parse amounts
+ for my $i (1 .. $form->{rowcount}) {
+ $form->{"amount_$i"} = $form->round_amount($form->parse_amount($myconfig, $form->{"amount_$i"}) * $form->{exchangerate} * -1, 2);
+ $amount += ($form->{"amount_$i"} * -1);
+ }
+
+ # this is for ap
+ $form->{amount} = $amount;
+
+ # taxincluded doesn't make sense if there is no amount
+ $form->{taxincluded} = 0 if ($form->{amount} == 0);
+
+ for my $item (split / /, $form->{taxaccounts}) {
+ $form->{AP}{"tax_$item"} = $item;
+
+ $amount = $form->round_amount($form->parse_amount($myconfig, $form->{"tax_$item"}), 2);
+
+ $form->{"tax_$item"} = $form->round_amount($amount * $form->{exchangerate}, 2) * -1;
+ $form->{total_tax} += ($form->{"tax_$item"} * -1);
+ }
+
+
+ # adjust paidaccounts if there is no date in the last row
+ $form->{paidaccounts}-- unless ($form->{"datepaid_$form->{paidaccounts}"});
+
+ $form->{invpaid} = 0;
+ # add payments
+ for my $i (1 .. $form->{paidaccounts}) {
+ $form->{"paid_$i"} = $form->round_amount($form->parse_amount($myconfig, $form->{"paid_$i"}), 2);
+
+ $form->{invpaid} += $form->{"paid_$i"};
+ $form->{datepaid} = $form->{"datepaid_$i"};
+
+ }
+
+ $form->{invpaid} = $form->round_amount($form->{invpaid} * $form->{exchangerate}, 2);
+
+ if ($form->{taxincluded} *= 1) {
+ for $i (1 .. $form->{rowcount}) {
+ $tax = $form->{total_tax} * $form->{"amount_$i"} / $form->{amount};
+ $amount = $form->{"amount_$i"} - $tax;
+ $form->{"amount_$i"} = $form->round_amount($amount, 2);
+ $diff += $amount - $form->{"amount_$i"};
+ }
+
+ # deduct taxes from amount
+ $form->{amount} -= $form->{total_tax};
+ # deduct difference from amount_1
+ $form->{amount_1} += $form->round_amount($diff, 2);
+ }
+
+ $form->{netamount} = $form->{amount};
+
+ # store invoice total, this goes into ap table
+ $form->{invtotal} = $form->{amount} + $form->{total_tax};
+
+ # amount for total AP
+ $form->{payables} = $form->{invtotal};
+
+
+ my ($query, $sth);
+
+ # if we have an id delete old records
+ if ($form->{id}) {
+
+ # delete detail records
+ $query = qq|DELETE FROM acc_trans WHERE trans_id = $form->{id}|;
+
+ $dbh->do($query) || $form->dberror($query);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO ap (invnumber, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}') )|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM ap
+ WHERE invnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ }
+
+ # escape '
+ $form->{notes} =~ s/'/''/g;
+
+ $form->{datepaid} = $form->{transdate} unless ($form->{datepaid});
+ my $datepaid = ($form->{invpaid} != 0) ? qq|'$form->{datepaid}'| : 'NULL';
+
+ $query = qq|UPDATE ap SET
+ invnumber = '$form->{invnumber}',
+ transdate = '$form->{transdate}',
+ ordnumber = '$form->{ordnumber}',
+ vendor_id = $form->{vendor_id},
+ taxincluded = '$form->{taxincluded}',
+ amount = $form->{invtotal},
+ duedate = '$form->{duedate}',
+ paid = $form->{invpaid},
+ datepaid = $datepaid,
+ netamount = $form->{netamount},
+ curr = '$form->{currency}',
+ notes = '$form->{notes}'
+ WHERE id = $form->{id}
+ |;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # update exchangerate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, 0, $form->{exchangerate});
+ }
+
+ # add individual transactions
+ foreach my $item (keys %{ $form->{AP} }) {
+ if ($form->{$item} != 0) {
+ $project_id = 'NULL';
+ if ($item =~ /amount_/) {
+ if ($form->{"project_id_$'"} && $form->{"projectnumber_$'"}) {
+ $project_id = $form->{"project_id_$'"};
+ }
+ }
+
+ # insert detail records in acc_trans
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
+ project_id)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$form->{AP}{$item}'),
+ $form->{$item}, '$form->{transdate}', $project_id)|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # if there is no amount but a payment record a payable
+ if ($form->{amount} == 0 && $form->{invtotal} == 0) {
+ $form->{payables} = $form->{invpaid};
+ }
+
+ # add paid transactions
+ for my $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"} != 0) {
+
+ $exchangerate = 0;
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+
+ $form->{"exchangerate_$i"} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ }
+
+
+ # get paid account
+ ($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"});
+ $form->{"datepaid_$i"} = $form->{transdate} unless ($form->{"datepaid_$i"});
+
+ # if there is no amount and invtotal is zero there is no exchangerate
+ if ($form->{amount} == 0 && $form->{invtotal} == 0) {
+ $form->{exchangerate} = $form->{"exchangerate_$i"};
+ }
+
+ $amount = $form->round_amount($form->{"paid_$i"} * $form->{exchangerate} * -1, 2);
+ if ($form->{payables}) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AP}{payables}'),
+ $amount, '$form->{"datepaid_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ $form->{payables} = $amount;
+
+ # add payment
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, source)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AP}{"paid_$i"}'),
+ $form->{"paid_$i"}, '$form->{"datepaid_$i"}',
+ '$form->{"source_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add exchange rate difference
+ $amount = $form->round_amount($form->{"paid_$i"} * ($form->{"exchangerate_$i"} - 1), 2);
+ if ($amount != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, fx_transaction, cleared)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AP}{"paid_$i"}'),
+ $amount, '$form->{"datepaid_$i"}', '1', '0')|;
+
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # exchangerate gain/loss
+ $amount = $form->round_amount($form->{"paid_$i"} * ($form->{exchangerate} - $form->{"exchangerate_$i"}), 2);
+
+ if ($amount != 0) {
+ $accno = ($amount > 0) ? $form->{fxgain_accno} : $form->{fxloss_accno};
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, fx_transaction, cleared)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $amount, '$form->{"datepaid_$i"}', '1', '0')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # update exchange rate record
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, 0, $form->{"exchangerate_$i"});
+ }
+ }
+ }
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+
+sub delete_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # check for other foreign currency transactions
+ $form->delete_exchangerate($dbh) if ($form->{currency} ne $form->{defaultcurrency});
+
+ my $query = qq|DELETE FROM ap WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM acc_trans WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # commit and redirect
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+
+sub ap_transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $incemp = qq|, (SELECT e.name FROM employee e
+ WHERE a.employee_id = e.id) AS employee
+ | if ($form->{l_employee});
+
+ my $query = qq|SELECT a.id, a.invnumber, a.transdate, a.duedate,
+ a.amount, a.paid, a.ordnumber, v.name, a.invoice,
+ a.netamount, a.datepaid, a.notes
+
+ $incemp
+
+ FROM ap a, vendor v
+ WHERE a.vendor_id = v.id|;
+
+ if ($form->{vendor_id}) {
+ $query .= " AND a.vendor_id = $form->{vendor_id}";
+ } else {
+ if ($form->{vendor}) {
+ my $vendor = $form->like(lc $form->{vendor});
+ $query .= " AND lower(v.name) LIKE '$vendor'";
+ }
+ }
+ if ($form->{invnumber}) {
+ my $invnumber = $form->like(lc $form->{invnumber});
+ $query .= " AND lower(a.invnumber) LIKE '$invnumber'";
+ }
+ if ($form->{ordnumber}) {
+ my $ordnumber = $form->like(lc $form->{ordnumber});
+ $query .= " AND lower(a.ordnumber) LIKE '$ordnumber'";
+ }
+ if ($form->{notes}) {
+ my $notes = $form->like(lc $form->{notes});
+ $query .= " AND lower(a.notes) LIKE '$notes'";
+ }
+
+ $query .= " AND a.transdate >= '$form->{transdatefrom}'" if $form->{transdatefrom};
+ $query .= " AND a.transdate <= '$form->{transdateto}'" if $form->{transdateto};
+ if ($form->{open} || $form->{closed}) {
+ unless ($form->{open} && $form->{closed}) {
+ $query .= " AND a.amount <> a.paid" if ($form->{open});
+ $query .= " AND a.amount = a.paid" if ($form->{closed});
+ }
+ }
+
+ my @a = (transdate, invnumber, name);
+ push @a, "employee" if $self->{l_employee};
+ my $sortorder = join ', ', $form->sort_columns(@a);
+ $sortorder = $form->{sort} unless $sortorder;
+
+ $query .= " ORDER by $sortorder";
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ap = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{AP} }, $ap;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/AR.pm b/sql-ledger/SL/AR.pm
new file mode 100644
index 000000000..4ea3d82c3
--- /dev/null
+++ b/sql-ledger/SL/AR.pm
@@ -0,0 +1,381 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Accounts Receivable module backend routines
+#
+#======================================================================
+
+package AR;
+
+
+sub post_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ my ($null, $taxrate, $amount, $tax, $diff);
+ my $exchangerate = 0;
+ my $i;
+
+ # split and store id numbers in link accounts
+ map { ($form->{AR}{"amount_$_"}) = split(/--/, $form->{"AR_amount_$_"}) } (1 .. $form->{rowcount});
+ ($form->{AR}{receivables}) = split(/--/, $form->{AR});
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{exchangerate} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy');
+ }
+
+ $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+
+ for $i (1 .. $form->{rowcount}) {
+ $form->{"amount_$i"} = $form->round_amount($form->parse_amount($myconfig, $form->{"amount_$i"}) * $form->{exchangerate}, 2);
+ $amount += $form->{"amount_$i"};
+ }
+
+ # this is for ar
+ $form->{amount} = $amount;
+
+ # taxincluded doesn't make sense if there is no amount
+ $form->{taxincluded} = 0 if ($form->{amount} == 0);
+
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $form->{AR}{"tax_$item"} = $item;
+
+ $amount = $form->round_amount($form->parse_amount($myconfig, $form->{"tax_$item"}), 2);
+
+ $form->{"tax_$item"} = $form->round_amount($amount * $form->{exchangerate}, 2);
+ $form->{total_tax} += $form->{"tax_$item"};
+
+ }
+
+ # adjust paidaccounts if there is no date in the last row
+ $form->{paidaccounts}-- unless ($form->{"datepaid_$form->{paidaccounts}"});
+
+ $form->{invpaid} = 0;
+ # add payments
+ for $i (1 .. $form->{paidaccounts}) {
+ $form->{"paid_$i"} = $form->round_amount($form->parse_amount($myconfig, $form->{"paid_$i"}), 2);
+
+ $form->{invpaid} += $form->{"paid_$i"};
+ $form->{datepaid} = $form->{"datepaid_$i"};
+
+ # reverse payment
+ $form->{"paid_$i"} *= -1;
+
+ }
+
+ $form->{invpaid} = $form->round_amount($form->{invpaid} * $form->{exchangerate}, 2);
+
+ if ($form->{taxincluded} *= 1) {
+ for $i (1 .. $form->{rowcount}) {
+ $tax = $form->{total_tax} * $form->{"amount_$i"} / $form->{amount};
+ $amount = $form->{"amount_$i"} - $tax;
+ $form->{"amount_$i"} = $form->round_amount($amount, 2);
+ $diff += $amount - $form->{"amount_$i"};
+ }
+
+ $form->{amount} -= $form->{total_tax};
+ # deduct difference from amount_1
+ $form->{amount_1} += $form->round_amount($diff, 2);
+ }
+
+ # store invoice total, this goes into ar table
+ $form->{invtotal} = $form->{amount} + $form->{total_tax};
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($query, $sth);
+
+ # if we have an id delete old records
+ if ($form->{id}) {
+
+ # delete detail records
+ $query = qq|DELETE FROM acc_trans WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO ar (invnumber, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}') )|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM ar
+ WHERE invnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ }
+
+ # escape '
+ $form->{notes} =~ s/'/''/g;
+
+ # record last payment date in ar table
+ $form->{datepaid} = $form->{transdate} unless $form->{datepaid};
+ my $datepaid = ($form->{invpaid} != 0) ? qq|'$form->{datepaid}'| : 'NULL';
+
+ $query = qq|UPDATE ar set
+ invnumber = '$form->{invnumber}',
+ ordnumber = '$form->{ordnumber}',
+ transdate = '$form->{transdate}',
+ customer_id = $form->{customer_id},
+ taxincluded = '$form->{taxincluded}',
+ amount = $form->{invtotal},
+ duedate = '$form->{duedate}',
+ paid = $form->{invpaid},
+ datepaid = $datepaid,
+ netamount = $form->{amount},
+ curr = '$form->{currency}',
+ notes = '$form->{notes}'
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # amount for AR account
+ $form->{receivables} = $form->round_amount($form->{invtotal} * -1, 2);
+
+
+ # update exchangerate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{transdate}, $form->{exchangerate}, 0);
+ }
+
+ # add individual transactions for AR, amount and taxes
+ foreach my $item (keys %{ $form->{AR} }) {
+ if ($form->{$item} != 0) {
+ $project_id = 'NULL';
+ if ($item =~ /amount_/) {
+ if ($form->{"project_id_$'"} && $form->{"projectnumber_$'"}) {
+ $project_id = $form->{"project_id_$'"};
+ }
+ }
+
+ # insert detail records in acc_trans
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
+ project_id)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$form->{AR}{$item}'),
+ $form->{$item}, '$form->{transdate}', $project_id)|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # if there is no amount but a payment record a receivables
+ if ($form->{amount} == 0 && $form->{invtotal} == 0) {
+ $form->{receivables} = $form->{invpaid} * -1;
+ }
+
+ # add paid transactions
+ for my $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"} != 0) {
+
+ ($form->{AR}{"paid_$i"}) = split(/--/, $form->{"AR_paid_$i"});
+ $form->{"datepaid_$i"} = $form->{transdate} unless ($form->{"datepaid_$i"});
+
+ $exchangerate = 0;
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+
+ $form->{"exchangerate_$i"} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ }
+
+
+ # if there is no amount and invtotal is zero there is no exchangerate
+ if ($form->{amount} == 0 && $form->{invtotal} == 0) {
+ $form->{exchangerate} = $form->{"exchangerate_$i"};
+ }
+
+ # receivables amount
+ $amount = $form->round_amount($form->{"paid_$i"} * $form->{exchangerate} * -1, 2);
+
+ if ($form->{receivables} != 0) {
+ # add receivable
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AR}{receivables}'),
+ $amount, '$form->{"datepaid_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ $form->{receivables} = $amount;
+
+ # add payment
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, source)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AR}{"paid_$i"}'),
+ $form->{"paid_$i"}, '$form->{"datepaid_$i"}',
+ '$form->{"source_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # exchangerate difference for payment
+ $amount = $form->round_amount($form->{"paid_$i"} * ($form->{"exchangerate_$i"} - 1), 2);
+
+ if ($amount != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, fx_transaction, cleared)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$form->{AR}{"paid_$i"}'),
+ $amount, '$form->{"datepaid_$i"}', '1', '0')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # exchangerate gain/loss
+ $amount = $form->round_amount($form->{"paid_$i"} * ($form->{exchangerate} - $form->{"exchangerate_$i"}), 2);
+
+ if ($amount != 0) {
+ $accno = ($amount > 0) ? $form->{fxgain_accno} : $form->{fxloss_accno};
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, fx_transaction, cleared)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $amount, '$form->{"datepaid_$i"}', '1', '0')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # update exchangerate record
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, $form->{"exchangerate_$i"}, 0);
+ }
+ }
+ }
+
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub delete_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # check for other foreign currency transactions
+ $form->delete_exchangerate($dbh) if ($form->{currency} ne $form->{defaultcurrency});
+
+ my $query = qq|DELETE FROM ar WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM acc_trans WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # commit
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub ar_transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $incemp = qq|, (SELECT e.name FROM employee e
+ WHERE a.employee_id = e.id) AS employee
+ | if ($form->{l_employee});
+
+ my $query = qq|SELECT a.id, a.invnumber, a.ordnumber, a.transdate,
+ a.duedate, a.netamount, a.amount, a.paid, c.name,
+ a.invoice, a.datepaid, a.terms, a.notes, a.shippingpoint
+
+ $incemp
+
+ FROM ar a, customer c
+ WHERE a.customer_id = c.id|;
+
+ if ($form->{customer_id}) {
+ $query .= " AND a.customer_id = $form->{customer_id}";
+ } else {
+ if ($form->{customer}) {
+ my $customer = $form->like(lc $form->{customer});
+ $query .= " AND lower(c.name) LIKE '$customer'";
+ }
+ }
+ if ($form->{invnumber}) {
+ my $invnumber = $form->like(lc $form->{invnumber});
+ $query .= " AND lower(a.invnumber) LIKE '$invnumber'";
+ }
+ if ($form->{ordnumber}) {
+ my $ordnumber = $form->like(lc $form->{ordnumber});
+ $query .= " AND lower(a.ordnumber) LIKE '$ordnumber'";
+ }
+ if ($form->{notes}) {
+ my $notes = $form->like(lc $form->{notes});
+ $query .= " AND lower(a.notes) LIKE '$notes'";
+ }
+
+ $query .= " AND a.transdate >= '$form->{transdatefrom}'" if $form->{transdatefrom};
+ $query .= " AND a.transdate <= '$form->{transdateto}'" if $form->{transdateto};
+ if ($form->{open} || $form->{closed}) {
+ unless ($form->{open} && $form->{closed}) {
+ $query .= " AND a.amount <> a.paid" if ($form->{open});
+ $query .= " AND a.amount = a.paid" if ($form->{closed});
+ }
+ }
+
+ my @a = (transdate, invnumber, name);
+ push @a, "employee" if $form->{l_employee};
+ my $sortorder = join ', ', $form->sort_columns(@a);
+ $sortorder = $form->{sort} unless $sortorder;
+
+ $query .= " ORDER by $sortorder";
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ar = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{AR} }, $ar;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/CA.pm b/sql-ledger/SL/CA.pm
new file mode 100644
index 000000000..b71749d7c
--- /dev/null
+++ b/sql-ledger/SL/CA.pm
@@ -0,0 +1,262 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+# chart of accounts
+#
+# CHANGE LOG:
+# DS. 2000-07-04 Created
+#
+#======================================================================
+
+
+package CA;
+
+
+sub all_accounts {
+ my ($self, $myconfig, $form) = @_;
+
+ my $amount = ();
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno,
+ SUM(acc_trans.amount) AS amount
+ FROM chart, acc_trans
+ WHERE chart.id = acc_trans.chart_id
+ GROUP BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $amount{$ref->{accno}} = $ref->{amount}
+ }
+ $sth->finish;
+
+ $query = qq|SELECT accno, description
+ FROM gifi|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $gifi = ();
+ while (my ($accno, $description) = $sth->fetchrow_array) {
+ $gifi{$accno} = $description;
+ }
+ $sth->finish;
+
+ $query = qq|SELECT c.id, c.accno, c.description, c.charttype, c.gifi_accno,
+ c.category, c.link
+ FROM chart c
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ca = $sth->fetchrow_hashref(NAME_lc)) {
+ $ca->{amount} = $amount{$ca->{accno}};
+ $ca->{gifi_description} = $gifi{$ca->{gifi_accno}};
+ if ($ca->{amount} < 0) {
+ $ca->{debit} = $ca->{amount} * -1;
+ } else {
+ $ca->{credit} = $ca->{amount};
+ }
+ push @{ $form->{CA} }, $ca;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub all_transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get chart_id
+ my $query = qq|SELECT id FROM chart
+ WHERE accno = '$form->{accno}'|;
+ if ($form->{accounttype} eq 'gifi') {
+ $query = qq|SELECT id FROM chart
+ WHERE gifi_accno = '$form->{gifi_accno}'|;
+ }
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my @id = ();
+ while (my ($id) = $sth->fetchrow_array) {
+ push @id, $id;
+ }
+
+ $sth->finish;
+
+ my $where = '1 = 1';
+ # build WHERE clause from dates if any
+ if ($form->{fromdate}) {
+ $where .= " AND ac.transdate >= '$form->{fromdate}'";
+ }
+ if ($form->{todate}) {
+ $where .= " AND ac.transdate <= '$form->{todate}'";
+ }
+
+ my $sortorder = join ', ', $form->sort_columns(qw(transdate reference description));
+ my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE : q|'0'|;
+
+ # Oracle workaround, use ordinal positions
+ my %ordinal = ( transdate => 4,
+ reference => 2,
+ description => 3 );
+ map { $sortorder =~ s/$_/$ordinal{$_}/ } keys %ordinal;
+
+
+ if ($form->{accno}) {
+ # get category for account
+ $query = qq|SELECT category
+ FROM chart
+ WHERE accno = '$form->{accno}'|;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{category}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($form->{fromdate}) {
+ # get beginning balance
+ $query = qq|SELECT SUM(ac.amount)
+ FROM acc_trans ac, chart c
+ WHERE ac.chart_id = c.id
+ AND c.accno = '$form->{accno}'
+ AND ac.transdate < date '$form->{fromdate}'
+ |;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{balance}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ }
+
+ if ($form->{accounttype} eq 'gifi' && $form->{gifi_accno}) {
+ # get category for account
+ $query = qq|SELECT category
+ FROM chart
+ WHERE gifi_accno = '$form->{gifi_accno}'|;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{category}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($form->{fromdate}) {
+ # get beginning balance
+ $query = qq|SELECT SUM(ac.amount)
+ FROM acc_trans ac, chart c
+ WHERE ac.chart_id = c.id
+ AND c.gifi_accno = '$form->{gifi_accno}'
+ AND ac.transdate < date '$form->{fromdate}'
+ |;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{balance}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ }
+
+ $query = "";
+
+ foreach my $id (@id) {
+
+ # get all transactions
+ $query .= qq|
+ SELECT g.id, g.reference, g.description, ac.transdate,
+ $false AS invoice,
+ ac.amount, 'gl' as charttype
+ FROM gl g, acc_trans ac
+ WHERE $where
+ AND ac.chart_id = $id
+ AND ac.trans_id = g.id
+ UNION ALL
+ SELECT a.id, a.invnumber, c.name, ac.transdate,
+ a.invoice,
+ ac.amount, 'ar' as charttype
+ FROM ar a, acc_trans ac, customer c
+ WHERE $where
+ AND ac.chart_id = $id
+ AND ac.trans_id = a.id
+ AND a.customer_id = c.id
+ UNION ALL
+ SELECT a.id, a.invnumber, v.name, ac.transdate,
+ a.invoice,
+ ac.amount, 'ap' as charttype
+ FROM ap a, acc_trans ac, vendor v
+ WHERE $where
+ AND ac.chart_id = $id
+ AND ac.trans_id = a.id
+ AND a.vendor_id = v.id
+ UNION ALL|;
+ }
+
+ $query =~ s/UNION ALL$//;
+ $query .= qq|
+ ORDER BY $sortorder|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ca = $sth->fetchrow_hashref(NAME_lc)) {
+
+ # gl
+ if ($ca->{charttype} eq "gl") {
+ $ca->{module} = "gl";
+ }
+
+ # ap
+ if ($ca->{charttype} eq "ap") {
+ $ca->{module} = ($ca->{invoice}) ? 'ir' : 'ap';
+ }
+
+ # ar
+ if ($ca->{charttype} eq "ar") {
+ $ca->{module} = ($ca->{invoice}) ? 'is' : 'ar';
+ }
+
+ if ($ca->{amount} < 0) {
+ $ca->{debit} = $ca->{amount} * -1;
+ $ca->{credit} = 0;
+ } else {
+ $ca->{credit} = $ca->{amount};
+ $ca->{debit} = 0;
+ }
+
+ push @{ $form->{CA} }, $ca;
+
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+1;
+
diff --git a/sql-ledger/SL/CP.pm b/sql-ledger/SL/CP.pm
new file mode 100644
index 000000000..f84bd1594
--- /dev/null
+++ b/sql-ledger/SL/CP.pm
@@ -0,0 +1,308 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Check and receipt printing payment module backend routines
+# Number to text conversion routines are in
+# locale/{countrycode}/Num2text
+#
+#======================================================================
+
+package CP;
+
+
+sub new {
+ my ($type, $countrycode) = @_;
+
+ $self = {};
+
+ if ($countrycode) {
+ if (-f "locale/$countrycode/Num2text") {
+ require "locale/$countrycode/Num2text";
+ } else {
+ use SL::Num2text;
+ }
+ } else {
+ use SL::Num2text;
+ }
+
+ bless $self, $type;
+
+}
+
+
+sub paymentaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description
+ FROM chart
+ WHERE link LIKE '%$form->{arap}_paid%'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{PR} }, $ref;
+ }
+ $sth->finish;
+
+ # get currencies and closedto
+ $query = qq|SELECT curr, closedto
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{currencies}, $form->{closedto}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+sub get_openvc {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $arap = ($form->{vc} eq 'customer') ? 'ar' : 'ap';
+
+ my $query = qq|SELECT count(*)
+ FROM $form->{vc} ct, $arap a
+ WHERE a.$form->{vc}_id = ct.id
+ AND a.amount != a.paid|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+ my ($count) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # build selection list
+ if ($count < $myconfig->{vclimit}) {
+ $query = qq|SELECT DISTINCT ct.id, ct.name
+ FROM $form->{vc} ct, $arap a
+ WHERE a.$form->{vc}_id = ct.id
+ AND a.amount != a.paid
+ ORDER BY name|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{"all_$form->{vc}"} }, $ref;
+ }
+
+ $sth->finish;
+
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub get_openinvoices {
+ my ($self, $myconfig, $form) = @_;
+
+ return unless $form->{"$form->{vc}_id"};
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $where = qq|WHERE $form->{vc}_id = $form->{"$form->{vc}_id"}
+ AND curr = '$form->{currency}'
+ AND NOT amount = paid|;
+
+ if ($form->{transdatefrom}) {
+ $where .= " AND transdate >= '$form->{transdatefrom}'";
+ }
+ if ($form->{transdateto}) {
+ $where .= " AND transdate <= '$form->{transdateto}'";
+ }
+
+ my ($arap, $buysell);
+ if ($form->{vc} eq 'customer') {
+ $arap = "ar";
+ $buysell = "buy";
+ } else {
+ $arap = "ap";
+ $buysell = "sell";
+ }
+
+ my $query = qq|SELECT id, invnumber, transdate, amount, paid, curr
+ FROM $arap
+ $where
+ ORDER BY id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ # if this is a foreign currency transaction get exchangerate
+ $ref->{exchangerate} = $form->get_exchangerate($dbh, $ref->{curr}, $ref->{transdate}, $buysell) if ($form->{currency} ne $form->{defaultcurrency});
+ push @{ $form->{PR} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+
+sub process_payment {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($paymentaccno) = split /--/, $form->{account};
+
+ # if currency ne defaultcurrency update exchangerate
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{exchangerate} = $form->parse_amount($myconfig, $form->{exchangerate});
+
+ if ($form->{vc} eq 'customer') {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{datepaid}, $form->{exchangerate}, 0);
+ } else {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{datepaid}, 0, $form->{exchangerate});
+ }
+ } else {
+ $form->{exchangerate} = 1;
+ }
+
+ my $query = qq|SELECT fxgain_accno_id, fxloss_accno_id
+ FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($fxgain_accno_id, $fxloss_accno_id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ my ($ARAP, $arap, $buysell);
+
+ if ($form->{vc} eq 'customer') {
+ $ARAP = "AR";
+ $arap = "ar";
+ $buysell = "buy";
+ } else {
+ $ARAP = "AP";
+ $arap = "ap";
+ $buysell = "sell";
+ }
+
+ # go through line by line
+ for my $i (1 .. $form->{rowcount}) {
+
+ if ($form->{"paid_$i"}) {
+
+ $form->{"paid_$i"} = $form->parse_amount($myconfig, $form->{"paid_$i"});
+
+ # get exchangerate for original
+ $query = qq|SELECT $buysell FROM exchangerate e, $arap a
+ WHERE e.curr = '$form->{currency}'
+ AND a.transdate = e.transdate
+ AND a.id = $form->{"id_$i"}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($exchangerate) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $exchangerate = 1 unless $exchangerate;
+
+ $query = qq|SELECT c.id FROM chart c, acc_trans a
+ WHERE a.chart_id = c.id
+ AND c.link = '$ARAP'
+ AND a.trans_id = $form->{"id_$i"}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ my $amount = $form->round_amount($form->{"paid_$i"} * $exchangerate * -1, 2);
+ $ml = ($ARAP eq 'AR') ? -1 : 1;
+ # add AR/AP
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, transdate, amount)
+ VALUES ($form->{"id_$i"}, $id,
+ '$form->{datepaid}', $amount * $ml)|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add payment
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, transdate, amount,
+ source)
+ VALUES ($form->{"id_$i"},
+ (SELECT id FROM chart
+ WHERE accno = '$paymentaccno'),
+ '$form->{datepaid}', $form->{"paid_$i"} * $ml,
+ '$form->{source}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add exchangerate difference if currency ne defaultcurrency
+ $amount = $form->round_amount($form->{"paid_$i"} * ($form->{exchangerate} - 1), 2);
+
+ if ($amount != 0) {
+ # exchangerate difference
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, transdate,
+ amount, cleared, fx_transaction)
+ VALUES ($form->{"id_$i"},
+ (SELECT id FROM chart
+ WHERE accno = '$paymentaccno'),
+ '$form->{datepaid}', $amount * $ml, '0', '1')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # gain/loss
+
+ $amount = $form->round_amount($form->{"paid_$i"} * ($exchangerate - $form->{exchangerate}) * $ml, 2);
+ if ($amount != 0) {
+ my $accno_id = ($amount > 0) ? $fxgain_accno_id : $fxloss_accno_id;
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, transdate,
+ amount, cleared, fx_transaction)
+ VALUES ($form->{"id_$i"}, $accno_id,
+ '$form->{datepaid}', $amount, '0', '1')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ $form->{"paid_$i"} = $form->round_amount($form->{"paid_$i"} * $exchangerate, 2);
+
+ # update AR/AP transaction
+ $query = qq|UPDATE $arap set
+ paid = paid + $form->{"paid_$i"},
+ datepaid = '$form->{datepaid}'
+ WHERE id = $form->{"id_$i"}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/CT.pm b/sql-ledger/SL/CT.pm
new file mode 100644
index 000000000..7c42cb843
--- /dev/null
+++ b/sql-ledger/SL/CT.pm
@@ -0,0 +1,447 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# backend code for customers and vendors
+#
+# CHANGE LOG:
+# DS. 2000-07-04 Created
+#
+#======================================================================
+
+package CT;
+
+
+sub get_tuple {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+ my $query = qq|SELECT *
+ FROM $form->{db}
+ WHERE id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+
+
+ # get ship to
+ $query = qq|SELECT *
+ FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+
+
+ # get tax labels
+ $query = qq|SELECT accno, description
+ FROM chart, tax
+ WHERE link LIKE '%CT_tax%'
+ AND chart.id = tax.chart_id
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $form->{taxaccounts} .= "$ref->{accno} ";
+ $form->{tax}{$ref->{accno}}{description} = $ref->{description};
+ }
+ $sth->finish;
+ chop $form->{taxaccounts};
+
+ # get taxes for customer/vendor
+ $query = qq|SELECT chart_id, accno
+ FROM $form->{db}tax, chart
+ WHERE chart_id = chart.id
+ AND $form->{db}_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $form->{tax}{$ref->{accno}}{taxable} = 1;
+ }
+ $sth->finish;
+
+
+ $dbh->disconnect;
+
+}
+
+
+sub taxaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get tax labels
+ my $query = qq|SELECT accno, description
+ FROM chart, tax
+ WHERE link LIKE '%CT_tax%'
+ AND chart.id = tax.chart_id
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $taxref = $sth->fetchrow_hashref(NAME_lc)) {
+ $form->{taxaccounts} .= "$taxref->{accno} ";
+ $form->{tax}{$taxref->{accno}}{description} = $taxref->{description};
+ }
+ $sth->finish;
+ chop $form->{taxaccounts};
+
+ $dbh->disconnect;
+
+}
+
+
+sub delete_customer {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query = qq|SELECT id FROM ar
+ WHERE customer_id = $form->{id}
+ UNION
+ SELECT id FROM oe
+ WHERE customer_id = $form->{id}|;
+ my $sth = $dbh->prepare($query) || $form->dberror($query);
+ $sth->execute;
+
+ my ($rc) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($rc) {
+ $dbh->disconnect;
+ $rc = -1;
+ } else {
+
+ # delete customer
+ $query = qq|DELETE FROM customer
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM customertax
+ WHERE customer_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # commit and redirect
+ $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ }
+
+ $rc;
+
+}
+
+
+sub save_customer {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # escape '
+ map { $form->{$_} =~ s/'/''/g } qw(customernumber name addr1 addr2 addr3 addr4 contact notes);
+
+ # assign value discount, terms, creditlimit
+ $form->{discount} /= 100;
+ $form->{terms} *= 1;
+ $form->{taxincluded} *= 1;
+ $form->{creditlimit} = $form->parse_amount($myconfig, $form->{creditlimit});
+
+ my ($query, $sth);
+
+ if ($form->{id}) {
+ $query = qq|DELETE FROM customertax
+ WHERE customer_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO customer (name)
+ VALUES ('$uid')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM customer
+ WHERE name = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ }
+
+ $query = qq|UPDATE customer SET
+ customernumber = '$form->{customernumber}',
+ name = '$form->{name}',
+ addr1 = '$form->{addr1}',
+ addr2 = '$form->{addr2}',
+ addr3 = '$form->{addr3}',
+ addr4 = '$form->{addr4}',
+ contact = '$form->{contact}',
+ phone = '$form->{phone}',
+ fax = '$form->{fax}',
+ email = '$form->{email}',
+ cc = '$form->{cc}',
+ bcc = '$form->{bcc}',
+ notes = '$form->{notes}',
+ discount = $form->{discount},
+ creditlimit = $form->{creditlimit},
+ terms = $form->{terms},
+ taxincluded = '$form->{taxincluded}'
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # save taxes
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"tax_$item"}) {
+ $query = qq|INSERT INTO customertax (customer_id, chart_id)
+ VALUES ($form->{id}, (SELECT id
+ FROM chart
+ WHERE accno = '$item'))|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # add shipto
+ $form->add_shipto($dbh, $form->{id});
+
+ $dbh->disconnect;
+
+}
+
+
+sub save_vendor {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # escape '
+ map { $form->{$_} =~ s/'/''/g } qw(vendornumber name addr1 addr2 addr3 addr4 contact notes);
+
+ $form->{terms} *= 1;
+ $form->{taxincluded} *= 1;
+
+ my $query;
+
+ if ($form->{id}) {
+ $query = qq|DELETE FROM vendortax
+ WHERE vendor_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO vendor (name)
+ VALUES ('$uid')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM vendor
+ WHERE name = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ }
+
+
+ $query = qq|UPDATE vendor SET
+ vendornumber = '$form->{vendornumber}',
+ name = '$form->{name}',
+ addr1 = '$form->{addr1}',
+ addr2 = '$form->{addr2}',
+ addr3 = '$form->{addr3}',
+ addr4 = '$form->{addr4}',
+ contact = '$form->{contact}',
+ phone = '$form->{phone}',
+ fax = '$form->{fax}',
+ email = '$form->{email}',
+ cc = '$form->{cc}',
+ bcc = '$form->{bcc}',
+ notes = '$form->{notes}',
+ terms = $form->{terms},
+ taxincluded = '$form->{taxincluded}'
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # save taxes
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"tax_$item"}) {
+ $query = qq|INSERT INTO vendortax (vendor_id, chart_id)
+ VALUES ($form->{id}, (SELECT id
+ FROM chart
+ WHERE accno = '$item'))|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # add shipto
+ $form->add_shipto($dbh, $form->{id});
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub delete_vendor {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # check if there are any transactions on file
+ my $query = qq|SELECT id FROM ap
+ WHERE vendor_id = $form->{id}
+ UNION
+ SELECT id FROM oe
+ WHERE vendor_id = $form->{id}|;
+ my $sth = $dbh->prepare($query) || $form->dberror($query);
+ $sth->execute;
+
+ my ($rc) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($rc) {
+ $dbh->disconnect;
+ $rc = -1;
+ } else {
+
+ # delete vendor
+ $query = qq|DELETE FROM vendor
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM vendortax
+ WHERE vendor_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # commit and redirect
+ $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ }
+
+ $rc;
+
+}
+
+
+sub search {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $where = "1 = 1";
+ $form->{sort} = "name" unless ($form->{sort});
+
+ if ($form->{"$form->{db}number"}) {
+ my $companynumber = $form->like(lc $form->{"$form->{db}number"});
+ $where .= " AND lower($form->{db}number) LIKE '$companynumber'";
+ }
+ if ($form->{name}) {
+ my $name = $form->like(lc $form->{name});
+ $where .= " AND lower(name) LIKE '$name'";
+ }
+ if ($form->{contact}) {
+ my $contact = $form->like(lc $form->{contact});
+ $where .= " AND lower(contact) LIKE '$contact'";
+ }
+ if ($form->{email}) {
+ my $email = $form->like(lc $form->{email});
+ $where .= " AND lower(email) LIKE '$email'";
+ }
+
+ if ($form->{status} eq 'orphaned') {
+ $where .= qq| AND id NOT IN (SELECT o.$form->{db}_id
+ FROM oe o, $form->{db} ct
+ WHERE ct.id = o.$form->{db}_id)|;
+ if ($form->{db} eq 'customer') {
+ $where .= qq| AND id NOT IN (SELECT a.customer_id
+ FROM ar a, customer ct
+ WHERE ct.id = a.customer_id)|;
+ }
+ if ($form->{db} eq 'vendor') {
+ $where .= qq| AND id NOT IN (SELECT a.vendor_id
+ FROM ap a, vendor ct
+ WHERE ct.id = a.vendor_id)|;
+ }
+ }
+
+ my $query = qq~SELECT id, name, $form->{db}number,
+ addr1 || ' ' || addr2 || ' ' || addr3 || ' ' || addr4 AS address,
+ contact, phone, fax, email, cc, terms
+ FROM $form->{db}
+ WHERE $where
+ ORDER BY $form->{sort}~;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{CT} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/Form.pm b/sql-ledger/SL/Form.pm
new file mode 100644
index 000000000..ef5f2ca81
--- /dev/null
+++ b/sql-ledger/SL/Form.pm
@@ -0,0 +1,1397 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 1998-2003
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Thomas Bayen <bayen@gmx.de>
+# Antti Kaihola <akaihola@siba.fi>
+# Moritz Bunkus (tex code)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+# Utilities for parsing forms
+# and supporting routines for linking account numbers
+# used in AR, AP and IS, IR modules
+#
+#======================================================================
+
+package Form;
+
+
+sub new {
+ my $type = shift;
+
+ my $self = {};
+
+ read(STDIN, $_, $ENV{CONTENT_LENGTH});
+
+ if ($ENV{QUERY_STRING}) {
+ $_ = $ENV{QUERY_STRING};
+ }
+
+ if ($ARGV[0]) {
+ $_ = $ARGV[0];
+ }
+
+ foreach $item (split(/&/)) {
+ ($key, $value) = split(/=/, $item);
+ $self->{$key} = &unescape("",$value);
+ }
+
+ $self->{action} = lc $self->{action};
+ $self->{action} =~ s/( |-|,)/_/g;
+
+ $self->{version} = "2.0.8";
+ $self->{dbversion} = "2.0.8";
+
+ bless $self, $type;
+
+}
+
+
+sub debug {
+ my ($self) = @_;
+
+ print "\n";
+
+ map { print "$_ = $self->{$_}\n" } (sort keys %{$self});
+
+}
+
+
+sub escape {
+ my ($self, $str, $beenthere) = @_;
+
+ # for Apache 2 we escape strings twice
+ if (($ENV{SERVER_SOFTWARE} =~ /Apache\/2/) && !$beenthere) {
+ $str = $self->escape($str, 1);
+ }
+
+ $str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
+ $str;
+
+}
+
+
+sub unescape {
+ my ($self, $str) = @_;
+
+ $str =~ tr/+/ /;
+ $str =~ s/\\$//;
+
+ $str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
+
+ $str;
+
+}
+
+
+sub error {
+ my ($self, $msg) = @_;
+
+ if ($ENV{HTTP_USER_AGENT}) {
+ $msg =~ s/\n/<br>/g;
+
+ print qq|Content-Type: text/html
+
+ <body bgcolor=ffffff>
+
+ <h2><font color=red>Error!</font></h2>
+
+ <p><b>$msg</b>
+
+ </body>
+ </html>
+ |;
+
+ die "Error: $msg\n";
+
+ } else {
+
+ if ($self->{error_function}) {
+ &{ $self->{error_function} }($msg);
+ } else {
+ die "Error: $msg\n";
+ }
+ }
+
+}
+
+
+
+sub info {
+ my ($self, $msg) = @_;
+
+ if ($ENV{HTTP_USER_AGENT}) {
+ $msg =~ s/\n/<br>/g;
+
+ if (!$self->{header}) {
+ $self->header;
+ print qq|
+ <body>|;
+ }
+
+ print qq|
+
+ <p><b>$msg</b>
+ |;
+
+ } else {
+
+ if ($self->{info_function}) {
+ &{ $self->{info_function} }($msg);
+ } else {
+ print "$msg\n";
+ }
+ }
+
+}
+
+
+sub numtextrows {
+ my ($self, $str, $cols, $maxrows) = @_;
+
+ my $rows;
+
+ map { $rows += int ((length $_)/$cols) + 1 } (split /\r/, $str);
+
+ $rows = $maxrows if (defined $maxrows && ($rows > $maxrows));
+
+ $rows;
+
+}
+
+
+sub dberror {
+ my ($self, $msg) = @_;
+
+ $self->error("$msg\n".$DBI::errstr);
+
+}
+
+
+sub isblank {
+ my ($self, $name, $msg) = @_;
+
+ if ($self->{$name} =~ /^\s*$/) {
+ $self->error($msg);
+ }
+}
+
+
+sub header {
+ my ($self) = @_;
+
+ my ($nocache, $stylesheet, $charset);
+
+ # use expire tag to prevent caching
+# $nocache = qq|<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
+# <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
+#|;
+
+ if ($self->{stylesheet} && (-f "css/$self->{stylesheet}")) {
+ $stylesheet = qq|<LINK REL="stylesheet" HREF="css/$self->{stylesheet}" TYPE="text/css" TITLE="SQL-Ledger style sheet">
+|;
+ }
+
+ if ($self->{charset}) {
+ $charset = qq|<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=$self->{charset}">
+|;
+ }
+
+ $self->{titlebar} = ($self->{title}) ? "$self->{title} - $self->{titlebar}" : $self->{titlebar};
+
+ print qq|Content-Type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<head>
+ <title>$self->{titlebar}</title>
+ $nocache
+ $stylesheet
+ $charset
+</head>
+
+|;
+
+}
+
+
+sub redirect {
+ my ($self, $msg) = @_;
+
+ if ($self->{callback}) {
+
+ ($script, $argv) = split(/\?/, $self->{callback});
+
+ exec ("perl", "$script", $argv);
+
+ } else {
+
+ if ($ENV{HTTP_USER_AGENT}) {
+ $msg =~ s/\n/<br>/g;
+
+ print qq|Content-Type: text/html
+
+<body bgcolor=ffffff>
+
+<h2>$msg</h2>
+
+</body>
+</html>
+|;
+
+ } else {
+ print "$msg\n";
+ }
+
+ exit;
+
+ }
+
+}
+
+
+sub sort_columns {
+ my ($self, @columns) = @_;
+
+ @columns = grep !/^$self->{sort}$/, @columns;
+ splice @columns, 0, 0, $self->{sort};
+
+ @columns;
+
+}
+
+
+sub format_amount {
+ my ($self, $myconfig, $amount, $places, $dash) = @_;
+
+ if ($places =~ /\d/) {
+ $amount = $self->round_amount($amount, $places);
+ }
+
+ # is the amount negative
+ my $negative = ($amount < 0);
+
+ if ($amount != 0) {
+ if ($myconfig->{numberformat} && ($myconfig->{numberformat} ne '1000.00')) {
+ my ($whole, $dec) = split /\./, "$amount";
+ $whole =~ s/-//;
+ $amount = join '', reverse split //, $whole;
+
+ if ($myconfig->{numberformat} eq '1,000.00') {
+ $amount =~ s/\d{3,}?/$&,/g;
+ $amount =~ s/,$//;
+ $amount = join '', reverse split //, $amount;
+ $amount .= "\.$dec" if ($dec ne "");
+ }
+
+ if ($myconfig->{numberformat} eq '1.000,00') {
+ $amount =~ s/\d{3,}?/$&./g;
+ $amount =~ s/\.$//;
+ $amount = join '', reverse split //, $amount;
+ $amount .= ",$dec" if ($dec ne "");
+ }
+
+ if ($myconfig->{numberformat} eq '1000,00') {
+ $amount = "$whole";
+ $amount .= ",$dec" if ($dec ne "");
+ }
+
+ if ($dash =~ /-/) {
+ $amount = ($negative) ? "($amount)" : "$amount";
+ } elsif ($dash =~ /DRCR/) {
+ $amount = ($negative) ? "$amount DR" : "$amount CR";
+ } else {
+ $amount = ($negative) ? "-$amount" : "$amount";
+ }
+ }
+ } else {
+ if ($dash eq "0" && $places) {
+ if ($myconfig->{numberformat} eq '1.000,00') {
+ $amount = "0".","."0" x $places;
+ } else {
+ $amount = "0"."."."0" x $places;
+ }
+ } else {
+ $amount = ($dash ne "") ? "$dash" : "";
+ }
+ }
+
+ $amount;
+
+}
+
+
+sub parse_amount {
+ my ($self, $myconfig, $amount) = @_;
+
+ if (($myconfig->{numberformat} eq '1.000,00') ||
+ ($myconfig->{numberformat} eq '1000,00')) {
+ $amount =~ s/\.//g;
+ $amount =~ s/,/\./;
+ }
+
+ $amount =~ s/,//g;
+
+ return ($amount * 1);
+
+}
+
+
+sub round_amount {
+ my ($self, $amount, $places) = @_;
+
+# $places = 3 if $places == 2;
+
+ if (($places * 1) >= 0) {
+ # compensate for perl behaviour, add 1/10^$places+3
+ sprintf("%.${places}f", $amount + (1 / (10 ** ($places + 3))) * (($amount > 0) ? 1 : -1));
+ } else {
+ $places *= -1;
+ sprintf("%.f", $amount / (10 ** $places) + (($amount > 0) ? 0.1 : -0.1)) * (10 ** $places);
+ }
+
+}
+
+
+sub parse_template {
+ my ($self, $myconfig, $userspath) = @_;
+
+ # { Moritz Bunkus
+ # Some variables used for page breaks
+ my ($chars_per_line, $lines_on_first_page, $lines_on_second_page) = (0, 0, 0);
+ my ($current_page, $current_line) = (1, 1);
+ my $pagebreak = "";
+ my $sum = 0;
+ # } Moritz Bunkus
+
+ open(IN, "$self->{templates}/$self->{IN}") or $self->error("$self->{IN} : $!");
+
+ @_ = <IN>;
+ close(IN);
+
+ $self->{copies} = 1 if (($self->{copies} *= 1) <= 0);
+
+ # OUT is used for the media, screen, printer, email
+ # for postscript we store a copy in a temporary file
+ my $fileid = time;
+ $self->{tmpfile} = "$userspath/${fileid}.$self->{IN}";
+ if ($self->{format} =~ /(postscript|pdf)/ || $self->{media} eq 'email') {
+ $out = $self->{OUT};
+ $self->{OUT} = ">$self->{tmpfile}";
+ }
+
+
+ if ($self->{OUT}) {
+ open(OUT, "$self->{OUT}") or $self->error("$self->{OUT} : $!");
+ } else {
+ open(OUT, ">-") or $self->error("STDOUT : $!");
+ $self->header;
+ }
+
+
+ # first we generate a tmpfile
+ # read file and replace <%variable%>
+ while ($_ = shift) {
+
+ $par = "";
+ $var = $_;
+
+
+ # { Moritz Bunkus
+ # detect pagebreak block and its parameters
+ if (/<%pagebreak ([0-9]+) ([0-9]+) ([0-9]+)%>/) {
+ $chars_per_line = $1;
+ $lines_on_first_page = $2;
+ $lines_on_second_page = $3;
+
+ while ($_ = shift) {
+ last if (/<\%end pagebreak%>/);
+ $pagebreak .= $_;
+ }
+ }
+ # } Moritz Bunkus
+
+
+ if (/<%foreach /) {
+
+ # this one we need for the count
+ chomp $var;
+ $var =~ s/<%foreach (.+?)%>/$1/;
+ while ($_ = shift) {
+ last if (/<%end /);
+
+ # store line in $par
+ $par .= $_;
+ }
+
+ # display contents of $self->{number}[] array
+ for $i (0 .. $#{ $self->{$var} }) {
+
+ # { Moritz Bunkus
+ # Try to detect whether a manual page break is necessary
+ # but only if there was a <%pagebreak ...%> block before
+
+ if ($chars_per_line) {
+ my $lines = int(length($self->{"description"}[$i]) / $chars_per_line + 0.95);
+ my $lpp;
+
+ if ($current_page == 1) {
+ $lpp = $lines_on_first_page;
+ } else {
+ $lpp = $lines_on_second_page;
+ }
+
+ # Yes we need a manual page break
+ if (($current_line + $lines) > $lpp) {
+ my $pb = $pagebreak;
+
+ # replace the special variables <%sumcarriedforward%>
+ # and <%lastpage%>
+
+ my $psum = $self->format_amount($myconfig, $sum, 2);
+ $pb =~ s/<%sumcarriedforward%>/$psum/g;
+ $pb =~ s/<%lastpage%>/$current_page/g;
+
+ # only "normal" variables are supported here
+ # (no <%if, no <%foreach, no <%include)
+
+ $pb =~ s/<%(.+?)%>/$self->{$1}/g;
+
+ # page break block is ready to rock
+ print(OUT $pb);
+ $current_page++;
+ $current_line = 1;
+ }
+ $current_line += $lines;
+ }
+ $sum += $self->parse_amount($myconfig, $self->{"linetotal"}[$i]);
+ # } Moritz Bunkus
+
+
+ # don't parse par, we need it for each line
+ $_ = $par;
+ s/<%(.+?)%>/$self->{$1}[$i]/mg;
+ print OUT;
+ }
+ next;
+ }
+
+ # if not comes before if!
+ if (/<%if not /) {
+ # check if it is not set and display
+ chop;
+ s/<%if not (.+?)%>/$1/;
+
+ unless ($self->{$_}) {
+ while ($_ = shift) {
+ last if (/<%end /);
+
+ # store line in $par
+ $par .= $_;
+ }
+
+ $_ = $par;
+
+ } else {
+ while ($_ = shift) {
+ last if (/<%end /);
+ }
+ next;
+ }
+ }
+
+ if (/<%if /) {
+ # check if it is set and display
+ chop;
+ s/<%if (.+?)%>/$1/;
+
+ if ($self->{$_}) {
+ while ($_ = shift) {
+ last if (/<%end /);
+
+ # store line in $par
+ $par .= $_;
+ }
+
+ $_ = $par;
+
+ } else {
+ while ($_ = shift) {
+ last if (/<%end /);
+ }
+ next;
+ }
+ }
+
+ # check for <%include filename%>
+ if (/<%include /) {
+
+ # get the filename
+ chomp $var;
+ $var =~ s/<%include (.+?)%>/$1/;
+
+ # mangle filename if someone tries to be cute
+ $var =~ s/\///g;
+
+ # prevent the infinite loop!
+ next if ($self->{"$var"});
+
+ open(INC, "$self->{templates}/$var") or $self->error($self->cleanup."$self->{templates}/$var : $!");
+ unshift(@_, <INC>);
+ close(INC);
+
+ $self->{"$var"} = 1;
+
+ next;
+ }
+
+ s/<%(.+?)%>/$self->{$1}/g;
+ print OUT;
+ }
+
+ close(OUT);
+
+
+ # { Moritz Bunkus
+ # Convert the tex file to postscript
+ if ($self->{format} =~ /(postscript|pdf)/) {
+
+ use Cwd;
+ $self->{cwd} = cwd();
+ chdir("$userspath") or $self->error($self->cleanup."chdir : $!");
+
+ $self->{tmpfile} =~ s/$userspath\///g;
+
+ # DS. added screen and email option in addition to printer
+ # screen
+ if ($self->{format} eq 'postscript') {
+ system("latex --interaction=nonstopmode $self->{tmpfile} > $self->{tmpfile}.err");
+ $self->error($self->cleanup) if ($?);
+
+ $self->{tmpfile} =~ s/tex$/dvi/;
+
+ system("dvips $self->{tmpfile} -o -q > /dev/null");
+ $self->error($self->cleanup."dvips : $!") if ($?);
+ $self->{tmpfile} =~ s/dvi$/ps/;
+ }
+ if ($self->{format} eq 'pdf') {
+ system("pdflatex --interaction=nonstopmode $self->{tmpfile} > $self->{tmpfile}.err");
+ $self->error($self->cleanup) if ($?);
+ $self->{tmpfile} =~ s/tex$/pdf/;
+ }
+
+ }
+
+ if ($self->{format} =~ /(postscript|pdf)/ || $self->{media} eq 'email') {
+
+ if ($self->{media} eq 'email') {
+
+ use SL::Mailer;
+
+ my $mail = new Mailer;
+
+ $self->{email} =~ s/,/>,</g;
+
+ map { $mail->{$_} = $self->{$_} } qw(cc bcc subject message version format charset);
+ $mail->{to} = qq|"$self->{name}" <$self->{email}>|;
+ $mail->{from} = qq|"$myconfig->{name}" <$myconfig->{email}>|;
+ $mail->{fileid} = "$fileid.";
+
+ # if we send html or plain text inline
+ if (($self->{format} eq 'html') && ($self->{sendmode} eq 'inline')) {
+ $mail->{contenttype} = "text/html";
+
+ $mail->{message} =~ s/\r\n/<br>\n/g;
+ $myconfig->{signature} =~ s/\\n/<br>\n/g;
+ $mail->{message} .= "<br>\n--<br>\n$myconfig->{signature}\n<br>";
+
+ open(IN, $self->{tmpfile}) or $self->error($self->cleanup."$self->{tmpfile} : $!");
+ while (<IN>) {
+ $mail->{message} .= $_;
+ }
+
+ close(IN);
+
+ } else {
+
+ @{ $mail->{attachments} } = ($self->{tmpfile});
+
+ $myconfig->{signature} =~ s/\\n/\r\n/g;
+ $mail->{message} .= "\r\n--\r\n$myconfig->{signature}";
+
+ }
+
+ my $err = $mail->send($out);
+ $self->error($self->cleanup."$err") if ($err);
+
+ } else {
+
+ $self->{OUT} = $out;
+ open(IN, $self->{tmpfile}) or $self->error($self->cleanup."$self->{tmpfile} : $!");
+
+ $self->{copies} = 1 unless $self->{media} eq 'printer';
+
+ for my $i (1 .. $self->{copies}) {
+
+ if ($self->{OUT}) {
+ open(OUT, $self->{OUT}) or $self->error($self->cleanup."$self->{OUT} : $!");
+ } else {
+ open(OUT, ">-") or $self->error($self->cleanup."$!: STDOUT");
+
+ # launch application
+ print qq|Content-Type: application/$self->{format}; name="$self->{tmpfile}"
+ Content-Disposition: filename="$self->{tmpfile}"
+
+ |;
+ }
+
+ while (<IN>) {
+ print OUT $_;
+ }
+ close(OUT);
+ seek IN, 0, 0;
+ }
+
+ close(IN);
+ }
+
+ $self->cleanup;
+
+ }
+ # } Moritz Bunkus
+
+}
+
+
+sub cleanup {
+ my $self = shift;
+
+ my @err = ();
+ if (-f "$self->{tmpfile}.err") {
+ open(FH, "$self->{tmpfile}.err");
+ @err = <FH>;
+ close(FH);
+ }
+
+ if ($self->{tmpfile}) {
+ # strip extension
+ $self->{tmpfile} =~ s/\.\w+$//g;
+ my $tmpfile = $self->{tmpfile};
+ unlink(<$tmpfile.*>);
+ }
+
+
+ chdir("$self->{cwd}");
+
+ "@err";
+
+}
+
+
+sub format_string {
+ my ($self, @fields) = @_;
+
+ my $format = $self->{format};
+ if ($self->{format} =~ /(postscript|pdf)/) {
+ $format = 'tex';
+ }
+
+ my %replace = ( 'order' => { 'html' => [ quotemeta('\n'), ' ' ],
+ 'tex' => [ '&', quotemeta('\n'), ' ',
+ '\$', '%', '_', '#', quotemeta('^'),
+ '{', '}', '<', '>', '£' ] },
+ 'html' => {
+ quotemeta('\n') => '<br>', ' ' => '<br>'
+ },
+ 'tex' => {
+ '&' => '\&', '\$' => '\$', '%' => '\%', '_' => '\_',
+ '#' => '\#', quotemeta('^') => '\^\\', '{' => '\{', '}' => '\}',
+ '<' => '$<$', '>' => '$>$',
+ quotemeta('\n') => '\newline ', ' ' => '\newline ',
+ '£' => '\pounds ',
+ }
+ );
+
+ foreach my $key (@{ $replace{order}{$format} }) {
+ map { $self->{$_} =~ s/$key/$replace{$format}{$key}/g; } @fields;
+ }
+
+}
+
+
+sub datetonum {
+ my ($self, $date, $myconfig) = @_;
+
+ if ($date) {
+ # get separator
+ my $spc = $myconfig->{dateformat};
+ $spc =~ s/\w//g;
+ $spc = substr($spc, 1, 1);
+
+ if ($spc eq '.') {
+ $spc = '\.';
+ }
+ if ($spc eq '/') {
+ $spc = '\/';
+ }
+
+ if ($myconfig->{dateformat} =~ /^yy/) {
+ ($yy, $mm, $dd) = split /$spc/, $date;
+ }
+ if ($myconfig->{dateformat} =~ /^mm/) {
+ ($mm, $dd, $yy) = split /$spc/, $date;
+ }
+ if ($myconfig->{dateformat} =~ /^dd/) {
+ ($dd, $mm, $yy) = split /$spc/, $date;
+ }
+
+ $dd *= 1;
+ $mm *= 1;
+ $yy = ($yy < 70) ? $yy + 2000 : $yy;
+ $yy = ($yy >= 70 && $yy <= 99) ? $yy + 1900 : $yy;
+
+ $dd = "0$dd" if ($dd < 10);
+ $mm = "0$mm" if ($mm < 10);
+
+ $date = "$yy$mm$dd";
+ }
+
+ $date;
+
+}
+
+
+
+# Database routines used throughout
+
+sub dbconnect {
+ my ($self, $myconfig) = @_;
+
+ # connect to database
+ my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}) or $self->dberror;
+
+ # set db options
+ if ($myconfig->{dboptions}) {
+ $dbh->do($myconfig->{dboptions}) || $self->dberror($myconfig->{dboptions});
+ }
+
+ $dbh;
+
+}
+
+
+sub dbconnect_noauto {
+ my ($self, $myconfig) = @_;
+
+ # connect to database
+ $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, {AutoCommit => 0}) or $self->dberror;
+
+ # set db options
+ if ($myconfig->{dboptions}) {
+ $dbh->do($myconfig->{dboptions}) || $self->dberror($myconfig->{dboptions});
+ }
+
+ $dbh;
+
+}
+
+
+sub update_balance {
+ my ($self, $dbh, $table, $field, $where, $value) = @_;
+
+ # if we have a value, go do it
+ if ($value != 0) {
+ # retrieve balance from table
+ my $query = "SELECT $field FROM $table WHERE $where";
+ my $sth = $dbh->prepare($query);
+
+ $sth->execute || $self->dberror($query);
+ my ($balance) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $balance += $value;
+ # update balance
+ $query = "UPDATE $table SET $field = $balance WHERE $where";
+ $dbh->do($query) || $self->dberror($query);
+ }
+}
+
+
+
+sub update_exchangerate {
+ my ($self, $dbh, $curr, $transdate, $buy, $sell) = @_;
+
+ # some sanity check for currency
+ return if ($curr eq '');
+
+ my $query = qq|SELECT curr FROM exchangerate
+ WHERE curr = '$curr'
+ AND transdate = '$transdate'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ my $set;
+ if ($buy != 0 && $sell != 0) {
+ $set = "buy = $buy, sell = $sell";
+ } elsif ($buy != 0) {
+ $set = "buy = $buy";
+ } elsif ($sell != 0) {
+ $set = "sell = $sell";
+ }
+
+ if ($sth->fetchrow_array) {
+ $query = qq|UPDATE exchangerate
+ SET $set
+ WHERE curr = '$curr'
+ AND transdate = '$transdate'|;
+ } else {
+ $query = qq|INSERT INTO exchangerate (curr, buy, sell, transdate)
+ VALUES ('$curr', $buy, $sell, '$transdate')|;
+ }
+ $sth->finish;
+ $dbh->do($query) || $self->dberror($query);
+
+}
+
+
+sub get_exchangerate {
+ my ($self, $dbh, $curr, $transdate, $fld) = @_;
+
+ my $query = qq|SELECT $fld FROM exchangerate
+ WHERE curr = '$curr'
+ AND transdate = '$transdate'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ my ($exchangerate) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $exchangerate;
+
+}
+
+
+sub delete_exchangerate {
+ my ($self, $dbh) = @_;
+
+ my @transdate = ();
+ my $transdate;
+
+ my $query = qq|SELECT DISTINCT transdate
+ FROM acc_trans
+ WHERE trans_id = $self->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while ($transdate = $sth->fetchrow_array) {
+ push @transdate, $transdate;
+ }
+ $sth->finish;
+
+ $query = qq|SELECT transdate FROM acc_trans
+ WHERE ar.id = trans_id
+ AND ar.curr = '$self->{currency}'
+ AND transdate IN
+ (SELECT transdate FROM acc_trans
+ WHERE trans_id = $self->{id})
+ AND trans_id != $self->{id}
+ UNION SELECT transdate FROM acc_trans
+ WHERE ap.id = trans_id
+ AND ap.curr = '$self->{currency}'
+ AND transdate IN
+ (SELECT transdate FROM acc_trans
+ WHERE trans_id = $self->{id})
+ AND trans_id != $self->{id}
+ UNION SELECT transdate FROM oe
+ WHERE oe.curr = '$self->{currency}'
+ AND transdate IN
+ (SELECT transdate FROM acc_trans
+ WHERE trans_id = $self->{id})|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while ($transdate = $sth->fetchrow_array) {
+ @transdate = grep !/^$transdate$/, @transdate;
+ }
+ $sth->finish;
+
+ foreach $transdate (@transdate) {
+ $query = qq|DELETE FROM exchangerate
+ WHERE curr = '$self->{currency}'
+ AND transdate = '$transdate'|;
+ $dbh->do($query) || $self->dberror($query);
+ }
+
+}
+
+
+sub check_exchangerate {
+ my ($self, $myconfig, $currency, $transdate, $fld) = @_;
+
+ return "" unless $transdate;
+
+ my $dbh = $self->dbconnect($myconfig);
+
+ my $query = qq|SELECT $fld FROM exchangerate
+ WHERE curr = '$currency'
+ AND transdate = '$transdate'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ my ($exchangerate) = $sth->fetchrow_array;
+ $sth->finish;
+ $dbh->disconnect;
+
+ $exchangerate;
+
+}
+
+
+sub add_shipto {
+ my ($self, $dbh, $id) = @_;
+
+ my $shipto;
+ foreach my $item (qw(name addr1 addr2 addr3 addr4 contact phone fax email)) {
+ if ($self->{"shipto$item"}) {
+ $shipto = 1 if ($self->{$item} ne $self->{"shipto$item"});
+ }
+ $self->{"shipto$item"} =~ s/'/''/g;
+ }
+
+ if ($shipto) {
+ my $query = qq|INSERT INTO shipto (trans_id, shiptoname, shiptoaddr1,
+ shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact,
+ shiptophone, shiptofax, shiptoemail) VALUES ($id,
+ '$self->{shiptoname}', '$self->{shiptoaddr1}',
+ '$self->{shiptoaddr2}', '$self->{shiptoaddr3}',
+ '$self->{shiptoaddr4}', '$self->{shiptocontact}',
+ '$self->{shiptophone}', '$self->{shiptofax}',
+ '$self->{shiptoemail}')|;
+ $dbh->do($query) || $self->dberror($query);
+ }
+
+}
+
+
+sub get_employee {
+ my ($self, $dbh) = @_;
+
+ my $query = qq|SELECT name FROM employee
+ WHERE login = '$self->{login}'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ ($self->{employee}) = $sth->fetchrow_array;
+ $sth->finish;
+
+}
+
+
+# this sub gets the id and name from $table
+sub get_name {
+ my ($self, $myconfig, $table) = @_;
+
+ # connect to database
+ my $dbh = $self->dbconnect($myconfig);
+
+ my $name = $self->like(lc $self->{$table});
+ my $query = qq~SELECT id, name,
+ addr1 || ' ' || addr2 || ' ' || addr3 || ' ' || addr4 AS address
+ FROM $table
+ WHERE lower(name) LIKE '$name'
+ ORDER BY name~;
+ my $sth = $dbh->prepare($query);
+
+ $sth->execute || $self->dberror($query);
+
+ my $i = 0;
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push(@{ $self->{name_list} }, $ref);
+ $i++;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+
+ $i;
+
+}
+
+
+# the selection sub is used in the AR, AP, IS, IR and OE module
+#
+sub all_vc {
+ my ($self, $myconfig, $table) = @_;
+
+ my $dbh = $self->dbconnect($myconfig);
+
+ my $query = qq|SELECT count(*) FROM $table|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+ my ($count) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # build selection list
+ if ($count < $myconfig->{vclimit}) {
+ $query = qq|SELECT id, name
+ FROM $table
+ ORDER BY name|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $self->{"all_$table"} }, $ref;
+ }
+
+ $sth->finish;
+
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub create_links {
+ my ($self, $module, $myconfig, $table) = @_;
+
+ $self->all_vc($myconfig, $table);
+
+ # get last customers or vendors
+ my ($query, $sth);
+
+ my $dbh = $self->dbconnect($myconfig);
+
+ my %xkeyref = ();
+
+
+ # now get the account numbers
+ $query = qq|SELECT accno, description, link
+ FROM chart
+ WHERE link LIKE '%$module%'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $self->{accounts} = "";
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ foreach my $key (split(/:/, $ref->{link})) {
+ if ($key =~ /$module/) {
+ # cross reference for keys
+ $xkeyref{$ref->{accno}} = $key;
+
+ push @{ $self->{"${module}_links"}{$key} }, { accno => $ref->{accno},
+ description => $ref->{description} };
+
+ $self->{accounts} .= "$ref->{accno} " unless $key =~ /tax/;
+ }
+ }
+ }
+ $sth->finish;
+
+
+ if ($self->{id}) {
+ my $arap = ($table eq 'customer') ? 'ar' : 'ap';
+
+ $query = qq|SELECT a.invnumber, a.transdate,
+ a.${table}_id, a.datepaid, a.duedate, a.ordnumber,
+ a.taxincluded, a.curr AS currency, a.notes, c.name AS $table,
+ a.amount AS oldinvtotal, a.paid AS oldtotalpaid
+ FROM $arap a, $table c
+ WHERE a.${table}_id = c.id
+ AND a.id = $self->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ foreach $key (keys %$ref) {
+ $self->{$key} = $ref->{$key};
+ }
+ $sth->finish;
+
+ # get amounts from individual entries
+ $query = qq|SELECT c.accno, c.description, a.source, a.amount,
+ a.transdate, a.cleared, a.project_id, p.projectnumber
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ LEFT JOIN project p ON (a.project_id = p.id)
+ WHERE a.trans_id = $self->{id}
+ AND a.fx_transaction = '0'
+ ORDER BY transdate|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ my $fld = ($table eq 'customer') ? 'buy' : 'sell';
+ # get exchangerate for currency
+ $self->{exchangerate} = $self->get_exchangerate($dbh, $self->{currency}, $self->{transdate}, $fld);
+
+ # store amounts in {acc_trans}{$key} for multiple accounts
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{exchangerate} = $self->get_exchangerate($dbh, $self->{currency}, $ref->{transdate}, $fld);
+
+ push @{ $self->{acc_trans}{$xkeyref{$ref->{accno}}} }, $ref;
+ }
+
+ $sth->finish;
+
+ $query = qq|SELECT d.curr AS currencies, d.closedto, d.revtrans,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno
+ FROM defaults d|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $self->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ } else {
+
+ # get date
+ $query = qq|SELECT current_date AS transdate,
+ d.curr AS currencies, d.closedto, d.revtrans,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno
+ FROM defaults d|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $self->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ if ($self->{"$self->{vc}_id"}) {
+ # only setup currency
+ ($self->{currency}) = split /:/, $self->{currencies};
+
+ } else {
+
+ $self->lastname_used($dbh, $myconfig, $table, $module);
+
+ my $fld = ($table eq 'customer') ? 'buy' : 'sell';
+ # get exchangerate for currency
+ $self->{exchangerate} = $self->get_exchangerate($dbh, $self->{currency}, $self->{transdate}, $fld);
+
+ }
+
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub lastname_used {
+ my ($self, $dbh, $myconfig, $table, $module) = @_;
+
+ my $arap = ($table eq 'customer') ? "ar" : "ap";
+ $arap = 'oe' if ($self->{type} =~ /_order/);
+
+ my $query = qq|SELECT id FROM $arap
+ WHERE id IN (SELECT MAX(id) FROM $arap
+ WHERE ${table}_id > 0)|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ my ($trans_id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $trans_id *= 1;
+ $query = qq|SELECT ct.name, a.curr, a.${table}_id,
+ current_date + ct.terms AS duedate
+ FROM $arap a
+ JOIN $table ct ON (a.${table}_id = ct.id)
+ WHERE a.id = $trans_id|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+
+ ($self->{$table}, $self->{currency}, $self->{"${table}_id"}, $self->{duedate}) = $sth->fetchrow_array;
+ $sth->finish;
+
+}
+
+
+
+sub current_date {
+ my ($self, $myconfig, $thisdate, $days) = @_;
+
+ my $dbh = $self->dbconnect($myconfig);
+ my ($sth, $query);
+
+ $days *= 1;
+ if ($thisdate) {
+ my $dateformat = $myconfig->{dateformat};
+ $dateformat .= "yy" if $myconfig->{dateformat} !~ /^y/;
+
+ $query = qq|SELECT to_date('$thisdate', '$dateformat') + $days AS thisdate
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+ } else {
+ $query = qq|SELECT current_date AS thisdate
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $self->dberror($query);
+ }
+
+ ($thisdate) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $dbh->disconnect;
+
+ $thisdate;
+
+}
+
+
+sub like {
+ my ($self, $string) = @_;
+
+ unless ($string =~ /%/) {
+ $string = "%$string%";
+ }
+
+ $string =~ s/'/''/g;
+ $string;
+
+}
+
+
+sub redo_rows {
+ my ($self, $flds, $new, $count, $numrows) = @_;
+
+ my @ndx = ();
+
+ map { push @ndx, { num => $new->[$_-1]->{runningnumber}, ndx => $_ } } (1 .. $count);
+
+ my $i = 0;
+ # fill rows
+ foreach my $item (sort { $a->{num} <=> $b->{num} } @ndx) {
+ $i++;
+ $j = $item->{ndx} - 1;
+ map { $self->{"${_}_$i"} = $new->[$j]->{$_} } @{$flds};
+ }
+
+ # delete empty rows
+ for $i ($count + 1 .. $numrows) {
+ map { delete $self->{"${_}_$i"} } @{$flds};
+ }
+
+}
+
+
+package Locale;
+
+
+sub new {
+ my ($type, $country, $NLS_file) = @_;
+ my $self = {};
+
+ %self = ();
+ if ($country && -d "locale/$country") {
+ $self->{countrycode} = $country;
+ eval { require "locale/$country/$NLS_file"; };
+ }
+
+ $self->{NLS_file} = $NLS_file;
+
+ push @{ $self->{LONG_MONTH} }, ("January", "February", "March", "April", "May ", "June", "July", "August", "September", "October", "November", "December");
+ push @{ $self->{SHORT_MONTH} }, (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec));
+
+ bless $self, $type;
+
+}
+
+
+sub text {
+ my ($self, $text) = @_;
+
+ return (exists $self{texts}{$text}) ? $self{texts}{$text} : $text;
+
+}
+
+
+sub findsub {
+ my ($self, $text) = @_;
+
+ if (exists $self{subs}{$text}) {
+ $text = $self{subs}{$text};
+ } else {
+ if ($self->{countrycode} && $self->{NLS_file}) {
+ Form->error("$text not defined in locale/$self->{countrycode}/$self->{NLS_file}");
+ }
+ }
+
+ $text;
+
+}
+
+
+sub date {
+ my ($self, $myconfig, $date, $longformat) = @_;
+
+ my $longdate = "";
+ my $longmonth = ($longformat) ? 'LONG_MONTH' : 'SHORT_MONTH';
+
+ if ($date) {
+ # get separator
+ $spc = $myconfig->{dateformat};
+ $spc =~ s/\w//g;
+ $spc = substr($spc, 1, 1);
+
+ if ($spc eq '.') {
+ $spc = '\.';
+ }
+ if ($spc eq '/') {
+ $spc = '\/';
+ }
+
+ if ($myconfig->{dateformat} =~ /^yy/) {
+ ($yy, $mm, $dd) = split /$spc/, $date;
+ }
+ if ($myconfig->{dateformat} =~ /^mm/) {
+ ($mm, $dd, $yy) = split /$spc/, $date;
+ }
+ if ($myconfig->{dateformat} =~ /^dd/) {
+ ($dd, $mm, $yy) = split /$spc/, $date;
+ }
+
+ $dd *= 1;
+ $mm--;
+ $yy = ($yy < 70) ? $yy + 2000 : $yy;
+ $yy = ($yy >= 70 && $yy <= 99) ? $yy + 1900 : $yy;
+
+ if ($myconfig->{dateformat} =~ /^dd/) {
+ $longdate = "$dd. ".&text($self, $self->{$longmonth}[$mm])." $yy";
+ } else {
+ $longdate = &text($self, $self->{$longmonth}[$mm])." $dd, $yy";
+ }
+
+ }
+
+ $longdate;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/GL.pm b/sql-ledger/SL/GL.pm
new file mode 100644
index 000000000..5bceb078a
--- /dev/null
+++ b/sql-ledger/SL/GL.pm
@@ -0,0 +1,462 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# General ledger backend code
+#
+# CHANGE LOG:
+# DS. 2000-07-04 Created
+# DS. 2001-06-12 Changed relations from accno to chart_id
+#
+#======================================================================
+
+package GL;
+
+
+sub delete_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query = qq|DELETE FROM gl WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM acc_trans WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # commit and redirect
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub post_transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ my ($debit, $credit) = (0, 0);
+ my $project_id;
+
+ my $i;
+ # check if debit and credit balances
+ for $i (1 .. $form->{rowcount}) {
+ if ($form->{"debit_$i"} && $form->{"credit_$i"}) {
+ return -1;
+ }
+
+ $form->{"debit_$i"} = $form->parse_amount($myconfig, $form->{"debit_$i"});
+ $form->{"credit_$i"} = $form->parse_amount($myconfig, $form->{"credit_$i"});
+
+ $debit += $form->{"debit_$i"};
+ $credit += $form->{"credit_$i"};
+ }
+
+ $debit = $form->round_amount($debit, 2);
+ $credit = $form->round_amount($credit, 2);
+
+ if ($debit != $credit) {
+ return -2;
+ }
+
+ if (($debit + $credit) == 0) {
+ return -3;
+ }
+
+ # connect to database, turn off AutoCommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # post the transaction
+ # make up a unique handle and store in reference field
+ # then retrieve the record based on the unique handle to get the id
+ # replace the reference field with the actual variable
+ # add records to acc_trans
+
+ # if there is a $form->{id} replace the old transaction
+ # delete all acc_trans entries and add the new ones
+
+ # escape '
+ map { $form->{$_} =~ s/'/''/g } qw(reference description);
+
+
+ my ($query, $sth);
+
+ if ($form->{id}) {
+ # delete individual transactions
+ $query = qq|DELETE FROM acc_trans
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO gl (reference, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}'))|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM gl
+ WHERE reference = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ }
+
+ $query = qq|UPDATE gl SET
+ reference = '$form->{reference}',
+ description = '$form->{description}',
+ notes = '$form->{notes}',
+ transdate = '$form->{transdate}'
+ WHERE id = $form->{id}|;
+
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # insert acc_trans transactions
+ for $i (1 .. $form->{rowcount}) {
+ # extract accno
+ ($accno) = split(/--/, $form->{"accno_$i"});
+ my $amount = 0;
+
+ if ($form->{"credit_$i"} != 0) {
+ $amount = $form->{"credit_$i"};
+ }
+ if ($form->{"debit_$i"} != 0) {
+ $amount = $form->{"debit_$i"} * -1;
+ }
+
+
+ # if there is an amount, add the record
+ if ($amount != 0) {
+ $project_id = ($form->{"project_id_$i"}) ? $form->{"project_id_$i"} : 'NULL';
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
+ source, project_id)
+ VALUES
+ ($form->{id}, (SELECT id
+ FROM chart
+ WHERE accno = '$accno'),
+ $amount, '$form->{transdate}', '$form->{reference}',
+ $project_id)|;
+
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # commit and redirect
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub all_transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+ my $query;
+ my $sth;
+
+ my ($glwhere, $arwhere, $apwhere) = ("1 = 1", "1 = 1", "1 = 1");
+
+ if ($form->{reference}) {
+ my $source = $form->like(lc $form->{reference});
+ $glwhere .= " AND lower(g.reference) LIKE '$source'";
+ $arwhere .= " AND lower(a.invnumber) LIKE '$source'";
+ $apwhere .= " AND lower(a.invnumber) LIKE '$source'";
+ }
+ if ($form->{source}) {
+ my $source = $form->like(lc $form->{source});
+ $glwhere .= " AND lower(ac.source) LIKE '$source'";
+ $arwhere .= " AND lower(ac.source) LIKE '$source'";
+ $apwhere .= " AND lower(ac.source) LIKE '$source'";
+ }
+ if ($form->{datefrom}) {
+ $glwhere .= " AND ac.transdate >= '$form->{datefrom}'";
+ $arwhere .= " AND ac.transdate >= '$form->{datefrom}'";
+ $apwhere .= " AND ac.transdate >= '$form->{datefrom}'";
+ }
+ if ($form->{dateto}) {
+ $glwhere .= " AND ac.transdate <= '$form->{dateto}'";
+ $arwhere .= " AND ac.transdate <= '$form->{dateto}'";
+ $apwhere .= " AND ac.transdate <= '$form->{dateto}'";
+ }
+ if ($form->{description}) {
+ my $description = $form->like(lc $form->{description});
+ $glwhere .= " AND lower(g.description) LIKE '$description'";
+ $arwhere .= " AND lower(ct.name) LIKE '$description'";
+ $apwhere .= " AND lower(ct.name) LIKE '$description'";
+ }
+ if ($form->{notes}) {
+ my $notes = $form->like(lc $form->{notes});
+ $glwhere .= " AND lower(g.notes) LIKE '$notes'";
+ $arwhere .= " AND lower(a.notes) LIKE '$notes'";
+ $apwhere .= " AND lower(a.notes) LIKE '$notes'";
+ }
+ if ($form->{accno}) {
+ $glwhere .= " AND c.accno = '$form->{accno}'";
+ $arwhere .= " AND c.accno = '$form->{accno}'";
+ $apwhere .= " AND c.accno = '$form->{accno}'";
+ }
+ if ($form->{gifi_accno}) {
+ $glwhere .= " AND c.gifi_accno = '$form->{gifi_accno}'";
+ $arwhere .= " AND c.gifi_accno = '$form->{gifi_accno}'";
+ $apwhere .= " AND c.gifi_accno = '$form->{gifi_accno}'";
+ }
+ if ($form->{category} ne 'X') {
+ $glwhere .= " AND c.category = '$form->{category}'";
+ $arwhere .= " AND c.category = '$form->{category}'";
+ $apwhere .= " AND c.category = '$form->{category}'";
+ }
+
+ if ($form->{accno}) {
+ # get category for account
+ $query = qq|SELECT category
+ FROM chart
+ WHERE accno = '$form->{accno}'|;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{ml}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($form->{datefrom}) {
+ $query = qq|SELECT SUM(ac.amount)
+ FROM acc_trans ac, chart c
+ WHERE ac.chart_id = c.id
+ AND c.accno = '$form->{accno}'
+ AND ac.transdate < date '$form->{datefrom}'
+ |;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{balance}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ }
+
+ if ($form->{gifi_accno}) {
+ # get category for account
+ $query = qq|SELECT category
+ FROM chart
+ WHERE gifi_accno = '$form->{gifi_accno}'|;
+ $sth = $dbh->prepare($query);
+
+ $sth->execute || $form->dberror($query);
+ ($form->{ml}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if ($form->{datefrom}) {
+ $query = qq|SELECT SUM(ac.amount)
+ FROM acc_trans ac, chart c
+ WHERE ac.chart_id = c.id
+ AND c.gifi_accno = '$form->{gifi_accno}'
+ AND ac.transdate < date '$form->{datefrom}'
+ |;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{balance}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ }
+
+ my $false = ($myconfig->{dbdriver} eq 'Pg') ? FALSE : q|'0'|;
+
+ my $sortorder = join ', ', $form->sort_columns(qw(transdate reference source description accno));
+ my %ordinal = ( transdate => 6,
+ reference => 4,
+ source => 7,
+ description => 5 );
+ map { $sortorder =~ s/$_/$ordinal{$_}/ } keys %ordinal;
+
+ my $query = qq|SELECT g.id, 'gl' AS type, $false AS invoice, g.reference,
+ g.description, ac.transdate, ac.source,
+ ac.amount, c.accno, c.gifi_accno, g.notes
+ FROM gl g, acc_trans ac, chart c
+ WHERE $glwhere
+ AND ac.chart_id = c.id
+ AND g.id = ac.trans_id
+ UNION ALL
+ SELECT a.id, 'ar' AS type, a.invoice, a.invnumber,
+ ct.name, ac.transdate, ac.source,
+ ac.amount, c.accno, c.gifi_accno, a.notes
+ FROM ar a, acc_trans ac, chart c, customer ct
+ WHERE $arwhere
+ AND ac.chart_id = c.id
+ AND a.customer_id = ct.id
+ AND a.id = ac.trans_id
+ UNION ALL
+ SELECT a.id, 'ap' AS type, a.invoice, a.invnumber,
+ ct.name, ac.transdate, ac.source,
+ ac.amount, c.accno, c.gifi_accno, a.notes
+ FROM ap a, acc_trans ac, chart c, vendor ct
+ WHERE $apwhere
+ AND ac.chart_id = c.id
+ AND a.vendor_id = ct.id
+ AND a.id = ac.trans_id
+ ORDER BY $sortorder|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ # gl
+ if ($ref->{type} eq "gl") {
+ $ref->{module} = "gl";
+ }
+
+ # ap
+ if ($ref->{type} eq "ap") {
+ if ($ref->{invoice}) {
+ $ref->{module} = "ir";
+ } else {
+ $ref->{module} = "ap";
+ }
+ }
+
+ # ar
+ if ($ref->{type} eq "ar") {
+ if ($ref->{invoice}) {
+ $ref->{module} = "is";
+ } else {
+ $ref->{module} = "ar";
+ }
+ }
+
+ if ($ref->{amount} < 0) {
+ $ref->{debit} = $ref->{amount} * -1;
+ $ref->{credit} = 0;
+ } else {
+ $ref->{credit} = $ref->{amount};
+ $ref->{debit} = 0;
+ }
+
+ push @{ $form->{GL} }, $ref;
+
+ }
+
+ $sth->finish;
+
+ if ($form->{accno}) {
+ $query = qq|SELECT description FROM chart WHERE accno = '$form->{accno}'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{account_description}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ if ($form->{gifi_accno}) {
+ $query = qq|SELECT description FROM gifi WHERE accno = '$form->{gifi_accno}'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{gifi_account_description}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub transaction {
+ my ($self, $myconfig, $form) = @_;
+
+ my ($query, $sth);
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ if ($form->{id}) {
+ $query = "SELECT closedto, revtrans
+ FROM defaults";
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $query = "SELECT reference, description, notes, transdate
+ FROM gl
+ WHERE id = $form->{id}";
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{reference}, $form->{description}, $form->{notes}, $form->{transdate}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # retrieve individual rows
+ $query = "SELECT c.accno, a.amount, project_id,
+ (SELECT p.projectnumber FROM project p
+ WHERE a.project_id = p.id) AS projectnumber
+ FROM acc_trans a, chart c
+ WHERE a.chart_id = c.id
+ AND a.trans_id = $form->{id}
+ ORDER BY accno";
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{GL} }, $ref;
+ }
+ } else {
+ $query = "SELECT current_date AS transdate, closedto, revtrans
+ FROM defaults";
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{transdate}, $form->{closedto}, $form->{revtrans}) = $sth->fetchrow_array;
+ }
+
+ $sth->finish;
+
+ # get chart of accounts
+ $query = qq|SELECT accno,description
+ FROM chart
+ WHERE charttype = 'A'
+ ORDER by accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+ $form->{chart} = "";
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{chart} }, $ref;
+ }
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/IC.pm b/sql-ledger/SL/IC.pm
new file mode 100644
index 000000000..f4a2f75ff
--- /dev/null
+++ b/sql-ledger/SL/IC.pm
@@ -0,0 +1,936 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory Control backend
+#
+#======================================================================
+
+package IC;
+
+
+sub get_part {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to db
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT p.*,
+ c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ pg.partsgroup
+ FROM parts p
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE p.id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ # copy to $form variables
+ map { $form->{$_} = $ref->{$_} } ( keys %{ $ref } );
+
+ $sth->finish;
+
+ my %oid = ('Pg' => 'a.oid',
+ 'Oracle' => 'a.rowid'
+ );
+
+
+ # part or service item
+ $form->{item} = ($form->{inventory_accno}) ? 'part' : 'service';
+ if ($form->{assembly}) {
+ $form->{item} = 'assembly';
+
+ # retrieve assembly items
+ $query = qq|SELECT p.id, p.partnumber, p.description,
+ p.sellprice, p.weight, a.qty, a.bom, p.unit,
+ pg.partsgroup
+ FROM parts p
+ JOIN assembly a ON (a.parts_id = p.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE a.id = $form->{id}
+ ORDER BY $oid{$myconfig->{dbdriver}}|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $form->{assembly_rows} = 0;
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $form->{assembly_rows}++;
+ foreach my $key ( keys %{ $ref } ) {
+ $form->{"${key}_$form->{assembly_rows}"} = $ref->{$key};
+ }
+ }
+ $sth->finish;
+
+ }
+
+ # setup accno hash for <option checked> {amount} is used in create_links
+ $form->{amount}{IC} = $form->{inventory_accno};
+ $form->{amount}{IC_income} = $form->{income_accno};
+ $form->{amount}{IC_sale} = $form->{income_accno};
+ $form->{amount}{IC_expense} = $form->{expense_accno};
+ $form->{amount}{IC_cogs} = $form->{expense_accno};
+
+
+ if ($form->{item} ne 'service') {
+ # get makes
+ if ($form->{makemodel}) {
+ $query = qq|SELECT name FROM makemodel
+ WHERE parts_id = $form->{id}|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $i = 1;
+ while (($form->{"make_$i"}, $form->{"model_$i"}) = split(/:/, $sth->fetchrow_array)) {
+ $i++;
+ }
+ $sth->finish;
+ $form->{makemodel_rows} = $i - 1;
+
+ }
+ }
+
+ # now get accno for taxes
+ $query = qq|SELECT c.accno
+ FROM chart c, partstax pt
+ WHERE pt.chart_id = c.id
+ AND pt.parts_id = $form->{id}|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (($key) = $sth->fetchrow_array) {
+ $form->{amount}{$key} = $key;
+ }
+
+ $sth->finish;
+
+ # is it an orphan
+ $query = qq|SELECT parts_id
+ FROM invoice
+ WHERE parts_id = $form->{id}
+ UNION
+ SELECT parts_id
+ FROM orderitems
+ WHERE parts_id = $form->{id}
+ UNION
+ SELECT parts_id
+ FROM assembly
+ WHERE parts_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{orphaned}) = $sth->fetchrow_array;
+ $form->{orphaned} = !$form->{orphaned};
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub save {
+ my ($self, $myconfig, $form) = @_;
+
+ ($form->{inventory_accno}) = split(/--/, $form->{IC});
+ ($form->{expense_accno}) = split(/--/, $form->{IC_expense});
+ ($form->{income_accno}) = split(/--/, $form->{IC_income});
+
+ # connect to database, turn off AutoCommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # save the part
+ # make up a unique handle and store in partnumber field
+ # then retrieve the record based on the unique handle to get the id
+ # replace the partnumber field with the actual variable
+ # add records for makemodel
+
+ # if there is a $form->{id} then replace the old entry
+ # delete all makemodel entries and add the new ones
+
+ # escape '
+ map { $form->{$_} =~ s/'/''/g } qw(partnumber description notes unit bin);
+
+ # undo amount formatting
+ map { $form->{$_} = $form->parse_amount($myconfig, $form->{$_}) } qw(rop weight listprice sellprice lastcost stock);
+
+ # set date to NULL if nothing entered
+ $form->{priceupdate} = ($form->{priceupdate}) ? qq|'$form->{priceupdate}'| : "NULL";
+
+ $form->{makemodel} = (($form->{make_1}) || ($form->{model_1})) ? 1 : 0;
+
+ $form->{alternate} = 0;
+ $form->{assembly} = ($form->{item} eq 'assembly') ? 1 : 0;
+ $form->{obsolete} *= 1;
+ $form->{onhand} *= 1;
+
+ my ($query, $sth);
+
+ if ($form->{id}) {
+
+ # get old price
+ $query = qq|SELECT sellprice, weight
+ FROM parts
+ WHERE id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($sellprice, $weight) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # if item is part of an assembly adjust all assemblies
+ $query = qq|SELECT id, qty
+ FROM assembly
+ WHERE parts_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($id, $qty) = $sth->fetchrow_array) {
+ &update_assembly($dbh, $form, $id, $qty * 1, $sellprice * 1, $weight * 1);
+ }
+ $sth->finish;
+
+
+ if ($form->{item} ne 'service') {
+ # delete makemodel records
+ $query = qq|DELETE FROM makemodel
+ WHERE parts_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ if ($form->{item} eq 'assembly') {
+ if ($form->{onhand} != 0) {
+ &adjust_inventory($dbh, $form, $form->{id}, $form->{onhand} * -1);
+ }
+
+ if ($form->{orphaned}) {
+ # delete assembly records
+ $query = qq|DELETE FROM assembly
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ } else {
+ # update BOM only
+ $query = qq|UPDATE assembly
+ SET bom = ?
+ WHERE id = ?
+ AND parts_id = ?|;
+ $sth = $dbh->prepare($query);
+
+ for $i (1 .. $form->{assembly_rows} - 1) {
+ $sth->execute(($form->{"bom_$i"}) ? '1' : '0', $form->{id}, $form->{"id_$i"}) || $form->dberror($query);
+ }
+ $sth->finish;
+ }
+
+ $form->{onhand} += $form->{stock};
+ }
+
+ # delete tax records
+ $query = qq|DELETE FROM partstax
+ WHERE parts_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO parts (partnumber)
+ VALUES ('$uid')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM parts
+ WHERE partnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ $form->{orphaned} = 1;
+ $form->{onhand} = ($form->{stock} * 1) if $form->{item} eq 'assembly';
+
+ }
+
+ my $partsgroup_id = 0;
+ if ($form->{partsgroup}) {
+ my $partsgroup = lc $form->{partsgroup};
+ $query = qq|SELECT DISTINCT id FROM partsgroup
+ WHERE lower(partsgroup) = '$partsgroup'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($partsgroup_id) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if (!$partsgroup_id) {
+ $query = qq|INSERT INTO partsgroup (partsgroup)
+ VALUES ('$form->{partsgroup}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM partsgroup
+ WHERE partsgroup = '$form->{partsgroup}'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($partsgroup_id) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+ }
+
+
+ $query = qq|UPDATE parts SET
+ partnumber = '$form->{partnumber}',
+ description = '$form->{description}',
+ makemodel = '$form->{makemodel}',
+ alternate = '$form->{alternate}',
+ assembly = '$form->{assembly}',
+ listprice = $form->{listprice},
+ sellprice = $form->{sellprice},
+ lastcost = $form->{lastcost},
+ weight = $form->{weight},
+ priceupdate = $form->{priceupdate},
+ unit = '$form->{unit}',
+ notes = '$form->{notes}',
+ rop = $form->{rop},
+ bin = '$form->{bin}',
+ inventory_accno_id = (SELECT id FROM chart
+ WHERE accno = '$form->{inventory_accno}'),
+ income_accno_id = (SELECT id FROM chart
+ WHERE accno = '$form->{income_accno}'),
+ expense_accno_id = (SELECT id FROM chart
+ WHERE accno = '$form->{expense_accno}'),
+ obsolete = '$form->{obsolete}',
+ image = '$form->{image}',
+ drawing = '$form->{drawing}',
+ microfiche = '$form->{microfiche}',
+ partsgroup_id = $partsgroup_id
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # insert makemodel records
+ unless ($form->{item} eq 'service') {
+ for my $i (1 .. $form->{makemodel_rows}) {
+ # put make and model together
+ if (($form->{"make_$i"}) || ($form->{"model_$i"})) {
+ map { $form->{"${_}_$i"} =~ s/'/''/g } qw(make model);
+
+ $query = qq|INSERT INTO makemodel (parts_id, name)
+ VALUES ($form->{id},
+ '$form->{"make_$i"}:$form->{"model_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+
+ # insert taxes
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"IC_tax_$item"}) {
+ $query = qq|INSERT INTO partstax (parts_id, chart_id)
+ VALUES ($form->{id},
+ (SELECT id
+ FROM chart
+ WHERE accno = '$item'))|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # add assembly records
+ if ($form->{item} eq 'assembly') {
+
+ if ($form->{orphaned}) {
+ for my $i (1 .. $form->{assembly_rows}) {
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+ $form->{"bom_$i"} *= 1;
+ $query = qq|INSERT INTO assembly (id, parts_id, qty, bom)
+ VALUES ($form->{id}, $form->{"id_$i"},
+ $form->{"qty_$i"}, '$form->{"bom_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+ # adjust onhand for the assembly
+ if ($form->{onhand} != 0) {
+ &adjust_inventory($dbh, $form, $form->{id}, $form->{onhand});
+ }
+
+ }
+
+
+ # commit
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub update_assembly {
+ my ($dbh, $form, $id, $qty, $sellprice, $weight) = @_;
+
+ my $query = qq|SELECT id, qty
+ FROM assembly
+ WHERE parts_id = $id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($pid, $aqty) = $sth->fetchrow_array) {
+ &update_assembly($dbh, $form, $pid, $aqty * $qty, $sellprice, $weight);
+ }
+ $sth->finish;
+
+ $query = qq|UPDATE parts
+ SET sellprice = sellprice +
+ $qty * ($form->{sellprice} - $sellprice),
+ weight = weight +
+ $qty * ($form->{weight} - $weight)
+ WHERE id = $id|;
+ $dbh->do($query) || $form->dberror($query);
+
+}
+
+
+
+sub retrieve_assemblies {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $where = '1 = 1';
+
+ if ($form->{partnumber}) {
+ my $partnumber = $form->like(lc $form->{partnumber});
+ $where .= " AND lower(p.partnumber) LIKE '$partnumber'";
+ }
+
+ if ($form->{description}) {
+ my $description = $form->like(lc $form->{description});
+ $where .= " AND lower(p.description) LIKE '$description'";
+ }
+ $where .= " AND NOT p.obsolete = '1'";
+
+ # retrieve assembly items
+ my $query = qq|SELECT p.id, p.partnumber, p.description,
+ p.bin, p.onhand, p.rop,
+ (SELECT sum(p2.inventory_accno_id)
+ FROM parts p2, assembly a
+ WHERE p2.id = a.parts_id
+ AND a.id = p.id) AS inventory
+ FROM parts p
+ WHERE $where
+ AND assembly = '1'|;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{assembly_items} }, $ref if $ref->{inventory};
+ }
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+sub restock_assemblies {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ for my $i (1 .. $form->{rowcount}) {
+
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+ &adjust_inventory($dbh, $form, $form->{"id_$i"}, $form->{"qty_$i"});
+ }
+
+ }
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub adjust_inventory {
+ my ($dbh, $form, $id, $qty) = @_;
+
+ my $query = qq|SELECT p.id, p.inventory_accno_id, p.assembly, a.qty
+ FROM parts p
+ JOIN assembly a ON (a.parts_id = p.id)
+ WHERE a.id = $id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ my $allocate = $qty * $ref->{qty};
+
+ # is it a service item, then loop
+ $ref->{inventory_accno_id} *= 1;
+ next if (($ref->{inventory_accno_id} == 0) && !$ref->{assembly});
+
+ # adjust parts onhand
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $ref->{id}|,
+ $allocate * -1);
+ }
+
+ $sth->finish;
+
+ # update assembly
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $id|,
+ $qty);
+
+}
+
+
+sub delete {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off AutoCommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ if ($form->{item} eq 'assembly' && $form->{onhand} != 0) {
+ # adjust onhand for the assembly
+ &adjust_inventory($dbh, $form, $form->{id}, $form->{onhand} * -1);
+ }
+
+ my $query = qq|DELETE FROM parts
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM partstax
+ WHERE parts_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # check if it is a part, assembly or service
+ if ($form->{item} eq 'part') {
+ $query = qq|DELETE FROM makemodel
+ WHERE parts_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ if ($form->{item} eq 'assembly') {
+ $query = qq|DELETE FROM assembly
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ if ($form->{item} eq 'alternate') {
+ $query = qq|DELETE FROM alternate
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # commit
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub assembly_item {
+ my ($self, $myconfig, $form) = @_;
+
+ my $i = $form->{assembly_rows};
+ my $var;
+ my $where = "1 = 1";
+
+ if ($form->{"partnumber_$i"}) {
+ $var = $form->like(lc $form->{"partnumber_$i"});
+ $where .= " AND lower(p.partnumber) LIKE '$var'";
+ }
+ if ($form->{"description_$i"}) {
+ $var = $form->like(lc $form->{"description_$i"});
+ $where .= " AND lower(p.description) LIKE '$var'";
+ }
+ if ($form->{"partsgroup_$i"}) {
+ $var = $form->like(lc $form->{"partsgroup_$i"});
+ $where .= " AND lower(pg.partsgroup) LIKE '$var'";
+ }
+
+ if ($form->{id}) {
+ $where .= " AND NOT p.id = $form->{id}";
+ }
+
+ if ($partnumber) {
+ $where .= " ORDER BY p.partnumber";
+ } else {
+ $where .= " ORDER BY p.description";
+ }
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
+ p.weight, p.onhand, p.unit,
+ pg.partsgroup
+ FROM parts p
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $where|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{item_list} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub all_parts {
+ my ($self, $myconfig, $form) = @_;
+
+ my $where = '1 = 1';
+ my $var;
+
+ foreach my $item (qw(partnumber drawing microfiche)) {
+ if ($form->{$item}) {
+ $var = $form->like(lc $form->{$item});
+ $where .= " AND lower(p.$item) LIKE '$var'";
+ }
+ }
+ # special case for description
+ if ($form->{description}) {
+ unless ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
+ $var = $form->like(lc $form->{description});
+ $where .= " AND lower(p.description) LIKE '$var'";
+ }
+ }
+
+ if ($form->{searchitems} eq 'part') {
+ $where .= " AND p.inventory_accno_id > 0";
+ }
+ if ($form->{searchitems} eq 'assembly') {
+ $form->{bought} = "";
+ $where .= " AND p.assembly = '1'";
+ }
+ if ($form->{searchitems} eq 'service') {
+ $where .= " AND p.inventory_accno_id IS NULL AND NOT p.assembly = '1'";
+ # irrelevant for services
+ $form->{make} = $form->{model} = "";
+ }
+
+ # items which were never bought, sold or on an order
+ if ($form->{itemstatus} eq 'orphaned') {
+ $form->{onhand} = $form->{short} = 0;
+ $form->{bought} = $form->{sold} = 0;
+ $form->{onorder} = $form->{ordered} = 0;
+ $form->{transdatefrom} = $form->{transdateto} = "";
+
+ $where .= " AND p.onhand = 0
+ AND p.id NOT IN (SELECT p.id FROM parts p, invoice i
+ WHERE p.id = i.parts_id)
+ AND p.id NOT IN (SELECT p.id FROM parts p, assembly a
+ WHERE p.id = a.parts_id)
+ AND p.id NOT IN (SELECT p.id FROM parts p, orderitems o
+ WHERE p.id = o.parts_id)";
+ }
+
+ if ($form->{itemstatus} eq 'active') {
+ $where .= " AND p.obsolete = '0'";
+ }
+ if ($form->{itemstatus} eq 'obsolete') {
+ $where .= " AND p.obsolete = '1'";
+ $form->{onhand} = $form->{short} = 0;
+ }
+ if ($form->{itemstatus} eq 'onhand') {
+ $where .= " AND p.onhand > 0";
+ }
+ if ($form->{itemstatus} eq 'short') {
+ $where .= " AND p.onhand < 0";
+ }
+
+ if ($form->{make}) {
+ $var = $form->like(lc $form->{make}).":%";
+ $where .= " AND p.id IN (SELECT DISTINCT ON (m.parts_id) m.parts_id
+ FROM makemodel m WHERE lower(m.name) LIKE '$var')";
+ }
+ if ($form->{model}) {
+ $var = "%:".$form->like($form->{model});
+ $where .= " AND p.id IN (SELECT DISTINCT ON (m.parts_id) m.parts_id
+ FROM makemodel m WHERE lower(m.name) LIKE '$var')";
+ }
+ if ($form->{partsgroup}) {
+ $var = $form->like(lc $form->{partsgroup});
+ $where .= " AND lower(pg.partsgroup) LIKE '$var'";
+
+ }
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+
+ my $sortorder = join ', ', $form->sort_columns(qw(partnumber description bin priceupdate partsgroup));
+ $sortorder = $form->{sort} unless $sortorder;
+
+ my $query = qq|SELECT p.id, p.partnumber, p.description, p.onhand, p.unit,
+ p.bin, p.sellprice, p.listprice, p.lastcost, p.rop, p.weight,
+ p.priceupdate, p.image, p.drawing, p.microfiche,
+ pg.partsgroup
+ FROM parts p
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $where
+ ORDER BY $sortorder|;
+
+ # rebuild query for bought and sold items
+ if ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
+
+ my $union = "";
+ $query = "";
+
+ if ($form->{bought} || $form->{sold}) {
+
+ my $invwhere = "$where";
+ $invwhere .= " AND i.assemblyitem = '0'";
+ $invwhere .= " AND a.transdate >= '$form->{transdatefrom}'" if $form->{transdatefrom};
+ $invwhere .= " AND a.transdate <= '$form->{transdateto}'" if $form->{transdateto};
+
+ if ($form->{description}) {
+ $var = $form->like(lc $form->{description});
+ $invwhere .= " AND lower(i.description) LIKE '$var'";
+ }
+
+ my $flds = qq|p.id, p.partnumber, i.description,
+ i.qty AS onhand, i.unit, p.bin, i.sellprice,
+ p.listprice, p.lastcost, p.rop, p.weight,
+ p.priceupdate, p.image, p.drawing, p.microfiche,
+ pg.partsgroup,
+ a.invnumber, a.ordnumber, i.trans_id|;
+
+ if ($form->{bought}) {
+ $query = qq|
+ SELECT $flds, 'ir' AS module, '' AS type,
+ 1 AS exchangerate
+ FROM parts p
+ JOIN invoice i ON (i.parts_id = p.id)
+ JOIN ap a ON (i.trans_id = a.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $invwhere|;
+ $union = "
+ UNION";
+ }
+
+ if ($form->{sold}) {
+ $query .= qq|$union
+ SELECT $flds, 'is' AS module, '' AS type,
+ 1 As exchangerate
+ FROM parts p
+ JOIN invoice i ON (i.parts_id = p.id)
+ JOIN ar a ON (i.trans_id = a.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $invwhere|;
+ $union = "
+ UNION";
+ }
+ }
+
+ if ($form->{onorder} || $form->{ordered}) {
+ my $ordwhere = "$where";
+ $ordwhere .= " AND o.closed = '0'" unless $form->{closed};
+
+ $ordwhere .= " AND o.transdate >= '$form->{transdatefrom}'" if $form->{transdatefrom};
+ $ordwhere .= " AND o.transdate <= '$form->{transdateto}'" if $form->{transdateto};
+
+ if ($form->{description}) {
+ $var = $form->like(lc $form->{description});
+ $ordwhere .= " AND lower(oi.description) LIKE '$var'";
+ }
+
+ $flds = qq|p.id, p.partnumber, oi.description,
+ oi.qty AS onhand, oi.unit, p.bin, oi.sellprice,
+ p.listprice, p.lastcost, p.rop, p.weight,
+ p.priceupdate, p.image, p.drawing, p.microfiche,
+ pg.partsgroup,
+ '' AS invnumber, o.ordnumber, oi.trans_id|;
+
+ if ($form->{ordered}) {
+ $query .= qq|$union
+ SELECT $flds, 'oe' AS module, 'sales_order' AS type,
+ (SELECT buy FROM exchangerate ex
+ WHERE ex.curr = o.curr
+ AND ex.transdate = o.transdate) AS exchangerate
+ FROM parts p
+ JOIN orderitems oi ON (oi.parts_id = p.id)
+ JOIN oe o ON (oi.trans_id = o.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $ordwhere
+ AND o.customer_id > 0|;
+ $union = "
+ UNION";
+ }
+
+ if ($form->{onorder}) {
+ $flds = qq|p.id, p.partnumber, oi.description,
+ oi.qty * -1 AS onhand, oi.unit, p.bin, oi.sellprice,
+ p.listprice, p.lastcost, p.rop, p.weight,
+ p.priceupdate, p.image, p.drawing, p.microfiche,
+ pg.partsgroup,
+ '' AS invnumber, o.ordnumber, oi.trans_id|;
+
+ $query .= qq|$union
+ SELECT $flds, 'oe' AS module, 'purchase_order' AS type,
+ (SELECT sell FROM exchangerate ex
+ WHERE ex.curr = o.curr
+ AND ex.transdate = o.transdate) AS exchangerate
+ FROM parts p
+ JOIN orderitems oi ON (oi.parts_id = p.id)
+ JOIN oe o ON (oi.trans_id = o.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE $ordwhere
+ AND o.vendor_id > 0|;
+ }
+
+ }
+
+ $query .= qq|
+ ORDER BY $sortorder|;
+
+ }
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{parts} }, $ref;
+ }
+
+ $sth->finish;
+
+
+ # include individual items for assemblies
+ if ($form->{searchitems} eq 'assembly' && $form->{bom}) {
+ foreach $item (@{ $form->{parts} }) {
+ push @assemblies, $item;
+ $query = qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand,
+ p.unit, p.bin,
+ p.sellprice, p.listprice, p.lastcost,
+ p.rop, p.weight, p.priceupdate,
+ p.image, p.drawing, p.microfiche
+ FROM parts p
+ JOIN assembly a ON (p.id = a.parts_id)
+ WHERE a.id = $item->{id}|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{assemblyitem} = 1;
+ push @assemblies, $ref;
+ }
+ $sth->finish;
+
+ push @assemblies, {id => $item->{id}};
+
+ }
+
+ # copy assemblies to $form->{parts}
+ @{ $form->{parts} } = @assemblies;
+
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub create_links {
+ my ($self, $module, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description, link
+ FROM chart
+ WHERE link LIKE '%$module%'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ foreach my $key (split(/:/, $ref->{link})) {
+ if ($key =~ /$module/) {
+ push @{ $form->{"${module}_links"}{$key} }, { accno => $ref->{accno},
+ description => $ref->{description} };
+ }
+ }
+ }
+
+ $sth->finish;
+
+ if ($form->{id}) {
+ $query = qq|SELECT weightunit
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{weightunit}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ } else {
+ $query = qq|SELECT weightunit, current_date
+ FROM defaults|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{weightunit}, $form->{priceupdate}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/IR.pm b/sql-ledger/SL/IR.pm
new file mode 100644
index 000000000..357533e17
--- /dev/null
+++ b/sql-ledger/SL/IR.pm
@@ -0,0 +1,995 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory received module
+#
+#======================================================================
+
+package IR;
+
+
+sub post_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off autocommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($query, $sth, $null, $project_id);
+ my $exchangerate = 0;
+
+ if ($form->{id}) {
+
+ &reverse_invoice($dbh, $form);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO ap (invnumber, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}'))|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM ap
+ WHERE invnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+ map { $form->{$_} =~ s/'/''/g } qw(invnumber ordnumber);
+
+ my ($amount, $linetotal, $lastinventoryaccno, $lastexpenseaccno);
+ my ($netamount, $invoicediff, $expensediff) = (0, 0, 0);
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{exchangerate} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'sell');
+ }
+
+ $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+
+
+ for my $i (1 .. $form->{rowcount}) {
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+
+ map { $form->{"${_}_$i"} =~ s/'/''/g } qw(partnumber description unit);
+
+ my ($allocated, $taxrate) = (0, 0);
+ my $taxamount;
+
+ $form->{"sellprice_$i"} = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+ my $fxsellprice = $form->{"sellprice_$i"};
+
+ my ($dec) = ($fxsellprice =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{"taxaccounts_$i"};
+
+ if ($form->{"inventory_accno_$i"}) {
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+
+ if ($form->{taxincluded}) {
+ $taxamount = $linetotal * ($taxrate / (1 + $taxrate));
+ $form->{"sellprice_$i"} = $form->{"sellprice_$i"} * (1 / (1 + $taxrate));
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ }
+
+ $netamount += $linetotal;
+
+ if ($taxamount != 0) {
+ map { $form->{amount}{$form->{id}}{$_} -= $taxamount * $form->{"${_}_rate"} / $taxrate } split / /, $form->{"taxaccounts_$i"};
+ }
+
+ # add purchase to inventory, this one is without the tax!
+ $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * $form->{exchangerate};
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2) * $form->{exchangerate};
+ $linetotal = $form->round_amount($linetotal, 2);
+
+ # this is the difference for the inventory
+ $invoicediff += ($amount - $linetotal);
+
+ $form->{amount}{$form->{id}}{$form->{"inventory_accno_$i"}} -= $linetotal;
+
+ # adjust and round sellprice
+ $form->{"sellprice_$i"} = $form->round_amount($form->{"sellprice_$i"} * $form->{exchangerate}, $decimalplaces);
+
+
+ # update parts table
+ $query = qq|UPDATE parts SET
+ lastcost = $form->{"sellprice_$i"},
+ onhand = onhand + $form->{"qty_$i"}
+ WHERE id = $form->{"id_$i"}|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ # check if we sold the item already and
+ # make an entry for the expense and inventory
+ $query = qq|SELECT i.id, i.qty, i.allocated, i.trans_id,
+ p.inventory_accno_id, p.expense_accno_id, a.transdate
+ FROM invoice i, ar a, parts p
+ WHERE i.parts_id = p.id
+ AND i.parts_id = $form->{"id_$i"}
+ AND (i.qty + i.allocated) > 0
+ AND i.trans_id = a.id
+ ORDER BY transdate|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+
+ my $totalqty = $form->{"qty_$i"};
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ my $qty = $ref->{qty} + $ref->{allocated};
+
+ if (($qty - $totalqty) > 0) {
+ $qty = $totalqty;
+ }
+
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $qty, 2);
+
+ if ($ref->{allocated} < 0) {
+ # we have an entry for it already, adjust amount
+ $form->update_balance($dbh,
+ "acc_trans",
+ "amount",
+ qq|trans_id = $ref->{trans_id} AND chart_id = $ref->{inventory_accno_id} AND transdate = '$ref->{transdate}'|,
+ $linetotal);
+
+ $form->update_balance($dbh,
+ "acc_trans",
+ "amount",
+ qq|trans_id = $ref->{trans_id} AND chart_id = $ref->{expense_accno_id} AND transdate = '$ref->{transdate}'|,
+ $linetotal * -1);
+
+ } else {
+ # add entry for inventory, this one is for the sold item
+ if ($linetotal != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($ref->{trans_id}, $ref->{inventory_accno_id},
+ $linetotal, '$ref->{transdate}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add expense
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($ref->{trans_id}, $ref->{expense_accno_id},
+ |. ($linetotal * -1) .qq|, '$ref->{transdate}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+
+ # update allocated for sold item
+ $form->update_balance($dbh,
+ "invoice",
+ "allocated",
+ qq|id = $ref->{id}|,
+ $qty * -1);
+
+ $allocated += $qty;
+
+ last if (($totalqty -= $qty) <= 0);
+ }
+
+ $sth->finish;
+
+ $lastinventoryaccno = $form->{"inventory_accno_$i"};
+
+ } else {
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+
+ if ($form->{taxincluded}) {
+ $taxamount = $linetotal * ($taxrate / (1 + $taxrate));
+
+ $form->{"sellprice_$i"} = $form->{"sellprice_$i"} * (1 / (1 + $taxrate));
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ }
+
+ $netamount += $linetotal;
+
+ if ($taxamount != 0) {
+ map { $form->{amount}{$form->{id}}{$_} -= $taxamount * $form->{"${_}_rate"} / $taxrate } split / /, $form->{"taxaccounts_$i"};
+ }
+
+ $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * $form->{exchangerate};
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2) * $form->{exchangerate};
+ $linetotal = $form->round_amount($linetotal, 2);
+
+ # this is the difference for expense
+ $expensediff += ($amount - $linetotal);
+
+ # add amount to expense
+ $form->{amount}{$form->{id}}{$form->{"expense_accno_$i"}} -= $linetotal;
+
+ $lastexpenseaccno = $form->{"expense_accno_$i"};
+
+ # adjust and round sellprice
+ $form->{"sellprice_$i"} = $form->round_amount($form->{"sellprice_$i"} * $form->{exchangerate}, $decimalplaces);
+
+ # update lastcost
+ $query = qq|UPDATE parts SET
+ lastcost = $form->{"sellprice_$i"}
+ WHERE id = $form->{"id_$i"}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ }
+
+ $project_id = 'NULL';
+ if ($form->{"project_id_$i"}) {
+ $project_id = $form->{"project_id_$i"};
+ }
+ $deliverydate = ($form->{"deliverydate_$i"}) ? qq|'$form->{"deliverydate_$i"}'| : "NULL";
+
+ # save detail record in invoice table
+ $query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty,
+ sellprice, fxsellprice, allocated, unit, deliverydate)
+ VALUES ($form->{id}, $form->{"id_$i"},
+ '$form->{"description_$i"}', |. ($form->{"qty_$i"} * -1) .qq|,
+ $form->{"sellprice_$i"}, $fxsellprice, $allocated,
+ '$form->{"unit_$i"}', $deliverydate)|;
+ $dbh->do($query) || $form->dberror($query);
+
+ }
+ }
+
+
+ $form->{datepaid} = $form->{invdate};
+
+ # all amounts are in natural state, netamount includes the taxes
+ # if tax is included, netamount is rounded to 2 decimal places,
+ # taxes are not
+
+ # total payments
+ for my $i (1 .. $form->{paidaccounts}) {
+ $form->{"paid_$i"} = $form->parse_amount($myconfig, $form->{"paid_$i"});
+ $form->{paid} += $form->{"paid_$i"};
+ $form->{datepaid} = $form->{"datepaid_$i"} if ($form->{"datepaid_$i"});
+ }
+
+ my ($tax, $paiddiff) = (0, 0);
+
+ $netamount = $form->round_amount($netamount, 2);
+
+ # figure out rounding errors for amount paid and total amount
+ if ($form->{taxincluded}) {
+
+ $amount = $form->round_amount($netamount * $form->{exchangerate}, 2);
+ $paiddiff = $amount - $netamount * $form->{exchangerate};
+ $netamount = $amount;
+
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $amount = $form->{amount}{$form->{id}}{$item} * $form->{exchangerate};
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($amount, 2);
+ $amount = $form->{amount}{$form->{id}}{$item} * -1;
+ $tax += $amount;
+ $netamount -= $amount;
+ }
+
+ $invoicediff += $paiddiff;
+ $expensediff += $paiddiff;
+
+ ######## this only applies to tax included
+ if ($lastinventoryaccno) {
+ $form->{amount}{$form->{id}}{$lastinventoryaccno} -= $invoicediff;
+ }
+ if ($lastexpenseaccno) {
+ $form->{amount}{$form->{id}}{$lastexpenseaccno} -= $expensediff;
+ }
+
+ } else {
+ $amount = $form->round_amount($netamount * $form->{exchangerate}, 2);
+ $paiddiff = $amount - $netamount * $form->{exchangerate};
+ $netamount = $amount;
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($form->{amount}{$form->{id}}{$item}, 2);
+ $amount = $form->round_amount($form->{amount}{$form->{id}}{$item} * $form->{exchangerate} * -1, 2);
+ $paiddiff += $amount - $form->{amount}{$form->{id}}{$item} * $form->{exchangerate} * -1;
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($amount * -1, 2);
+ $amount = $form->{amount}{$form->{id}}{$item} * -1;
+ $tax += $amount;
+ }
+ }
+
+
+ $form->{amount}{$form->{id}}{$form->{AP}} = $netamount + $tax;
+
+ if ($form->{paid} != 0) {
+ $form->{paid} = $form->round_amount($form->{paid} * $form->{exchangerate} + $paiddiff, 2);
+ }
+
+
+ # update exchangerate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, 0, $form->{exchangerate});
+ }
+
+ # record acc_trans transactions
+ foreach my $trans_id (keys %{$form->{amount}}) {
+ foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
+ if (($form->{amount}{$trans_id}{$accno} = $form->round_amount($form->{amount}{$trans_id}{$accno}, 2)) != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($trans_id, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{amount}{$trans_id}{$accno}, '$form->{invdate}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+ # deduct payment differences from paiddiff
+ for my $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"} != 0) {
+ $amount = $form->round_amount($form->{"paid_$i"} * $form->{exchangerate}, 2);
+ $paiddiff -= $amount - $form->{"paid_$i"} * $form->{exchangerate};
+ }
+ }
+
+ # force AP entry if 0
+ $form->{amount}{$form->{id}}{$form->{AP}} = $form->{paid} if ($form->{amount}{$form->{id}}{$form->{AP}} == 0);
+
+ # record payments and offsetting AP
+ for my $i (1 .. $form->{paidaccounts}) {
+
+ if ($form->{"paid_$i"} != 0) {
+ my ($accno) = split /--/, $form->{"AP_paid_$i"};
+ $form->{"datepaid_$i"} = $form->{invdate} unless ($form->{"datepaid_$i"});
+ $form->{datepaid} = $form->{"datepaid_$i"};
+
+ $amount = ($form->round_amount($form->{"paid_$i"} * $form->{exchangerate} + $paiddiff, 2)) * -1;
+
+ # record AP
+
+ if ($form->{amount}{$form->{id}}{$form->{AP}} != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$form->{AP}'),
+ $amount, '$form->{"datepaid_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # record payment
+
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
+ source)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{"paid_$i"}, '$form->{"datepaid_$i"}',
+ '$form->{"source_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ $exchangerate = 0;
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
+
+ $form->{"exchangerate_$i"} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ }
+
+
+ # exchangerate difference
+ $form->{fx}{$accno}{$form->{"datepaid_$i"}} += $form->{"paid_$i"} * ($form->{"exchangerate_$i"} - 1) + $paiddiff;
+
+
+ # gain/loss
+ $amount = ($form->{"paid_$i"} * $form->{exchangerate}) - ($form->{"paid_$i"} * $form->{"exchangerate_$i"});
+ if ($amount > 0) {
+ $form->{fx}{$form->{fxgain_accno}}{$form->{"datepaid_$i"}} += $amount;
+ } else {
+ $form->{fx}{$form->{fxloss_accno}}{$form->{"datepaid_$i"}} += $amount;
+ }
+
+ $paiddiff = 0;
+
+ # update exchange rate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, 0, $form->{"exchangerate_$i"});
+ }
+ }
+ }
+
+ # record exchange rate differences and gains/losses
+ foreach my $accno (keys %{$form->{fx}}) {
+ foreach my $transdate (keys %{ $form->{fx}{$accno} }) {
+ if (($form->{fx}{$accno}{$transdate} = $form->round_amount($form->{fx}{$accno}{$transdate}, 2)) != 0) {
+
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, cleared, fx_transaction)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{fx}{$accno}{$transdate}, '$transdate', '0', '1')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+
+ $amount = $netamount + $tax;
+
+ # set values which could be empty
+ $form->{taxincluded} *= 1;
+ my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL";
+ my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL";
+
+ # save AP record
+ $query = qq|UPDATE ap set
+ invnumber = '$form->{invnumber}',
+ ordnumber = '$form->{ordnumber}',
+ transdate = '$form->{invdate}',
+ vendor_id = $form->{vendor_id},
+ amount = $amount,
+ netamount = $netamount,
+ paid = $form->{paid},
+ datepaid = $datepaid,
+ duedate = $duedate,
+ invoice = '1',
+ taxincluded = '$form->{taxincluded}',
+ notes = '$form->{notes}',
+ curr = '$form->{currency}'
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add shipto
+ $form->{name} = $form->{vendor};
+ $form->{name} =~ s/--$form->{vendor_id}//;
+ $form->add_shipto($dbh, $form->{id});
+
+ # delete zero entries
+ $query = qq|DELETE FROM acc_trans
+ WHERE amount = 0|;
+ $dbh->do($query) || $form->dberror($query);
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+ $rc;
+
+}
+
+
+
+sub reverse_invoice {
+ my ($dbh, $form) = @_;
+
+ # reverse inventory items
+ my $query = qq|SELECT i.parts_id, p.inventory_accno_id, p.expense_accno_id,
+ i.qty, i.allocated, i.sellprice
+ FROM invoice i, parts p
+ WHERE i.parts_id = p.id
+ AND i.trans_id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $netamount = 0;
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $netamount += $form->round_amount($ref->{sellprice} * $ref->{qty} * -1, 2);
+
+ if ($ref->{inventory_accno_id}) {
+ # update onhand
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $ref->{parts_id}|,
+ $ref->{qty});
+
+ # if $ref->{allocated} > 0 than we sold that many items
+ if ($ref->{allocated} > 0) {
+
+ # get references for sold items
+ $query = qq|SELECT i.id, i.trans_id, i.allocated, a.transdate
+ FROM invoice i, ar a
+ WHERE i.parts_id = $ref->{parts_id}
+ AND i.allocated < 0
+ AND i.trans_id = a.id
+ ORDER BY transdate DESC|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $pthref = $sth->fetchrow_hashref(NAME_lc)) {
+ my $qty = $ref->{allocated};
+ if (($ref->{allocated} + $pthref->{allocated}) > 0) {
+ $qty = $pthref->{allocated} * -1;
+ }
+
+ my $amount = $form->round_amount($ref->{sellprice} * $qty, 2);
+
+ #adjust allocated
+ $form->update_balance($dbh,
+ "invoice",
+ "allocated",
+ qq|id = $pthref->{id}|,
+ $qty);
+
+ $form->update_balance($dbh,
+ "acc_trans",
+ "amount",
+ qq|trans_id = $pthref->{trans_id} AND chart_id = $ref->{expense_accno_id} AND transdate = '$pthref->{transdate}'|,
+ $amount);
+
+ $form->update_balance($dbh,
+ "acc_trans",
+ "amount",
+ qq|trans_id = $pthref->{trans_id} AND chart_id = $ref->{inventory_accno_id} AND transdate = '$pthref->{transdate}'|,
+ $amount * -1);
+
+ last if (($ref->{allocated} -= $qty) <= 0);
+ }
+ $sth->finish;
+ }
+ }
+ }
+ $sth->finish;
+
+ # delete acc_trans
+ $query = qq|DELETE FROM acc_trans
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # delete invoice entries
+ $query = qq|DELETE FROM invoice
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+}
+
+
+
+sub delete_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # check for other foreign currency transactions
+ $form->delete_exchangerate($dbh) if ($form->{currency} ne $form->{defaultcurrency});
+
+ &reverse_invoice($dbh, $form);
+
+ # delete zero entries
+ my $query = qq|DELETE FROM acc_trans
+ WHERE amount = 0|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # delete AP record
+ my $query = qq|DELETE FROM ap
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub retrieve_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query;
+
+ if ($form->{id}) {
+ # get default accounts and last invoice number
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ d.curr AS currencies
+ FROM defaults d|;
+ } else {
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ d.ponumber AS invnumber, d.curr AS currencies,
+ current_date AS invdate
+ FROM defaults d|;
+ }
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+
+ if ($form->{id}) {
+
+ # retrieve invoice
+ $query = qq|SELECT a.invnumber, a.transdate AS invdate, a.duedate,
+ a.ordnumber, a.paid, a.taxincluded, a.notes, a.curr AS currency
+ FROM ap a
+ WHERE id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "sell");
+
+ # get shipto
+ $query = qq|SELECT * FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ # retrieve individual items
+ $query = qq|SELECT c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ p.partnumber, i.description, i.qty, i.fxsellprice AS sellprice,
+ i.parts_id AS id, i.unit, p.bin, i.deliverydate,
+ pr.projectnumber,
+ i.project_id,
+ pg.partsgroup
+ FROM invoice i
+ JOIN parts p ON (i.parts_id = p.id)
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN project pr ON (i.project_id = pr.id)
+ LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id)
+ WHERE trans_id = $form->{id}
+ ORDER BY i.id|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ # get tax rates for part
+ $query = qq|SELECT c.accno
+ FROM chart c, partstax pt
+ WHERE pt.chart_id = c.id
+ AND pt.parts_id = $ref->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref->{taxaccounts} = "";
+ my $taxrate = 0;
+
+ while (my $ptref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{taxaccounts} .= "$ptref->{accno} ";
+ $taxrate += $form->{"$ptref->{accno}_rate"};
+ }
+
+ $sth->finish;
+ chop $ref->{taxaccounts};
+
+ $ref->{qty} *= -1;
+
+ push @{ $form->{invoice_details} }, $ref;
+
+ }
+
+ $sth->finish;
+
+ } else {
+
+ # up invoice number by 1
+ $form->{invnumber}++;
+
+ # save the new number
+ $query = qq|UPDATE defaults
+ SET ponumber = '$form->{invnumber}'|;
+ $dbh->do($query) || $form->dberror($query);
+
+ }
+
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub get_vendor {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $dateformat = $myconfig->{dateformat};
+ $dateformat .= "yy" if $myconfig->{dateformat} !~ /^y/;
+
+ my $duedate = ($form->{invdate}) ? "to_date('$form->{invdate}', '$dateformat')" : "current_date";
+
+ $form->{vendor_id} *= 1;
+ # get vendor
+ my $query = qq|SELECT taxincluded, terms, email, cc, bcc,
+ addr1, addr2, addr3, addr4,
+ $duedate + terms AS duedate
+ FROM vendor
+ WHERE id = $form->{vendor_id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ # get shipto if we do not convert an order or invoice
+ if (!$form->{shipto}) {
+ map { delete $form->{$_} } qw(shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoaddr4 shiptocontact shiptophone shiptofax shiptoemail);
+
+ $query = qq|SELECT * FROM shipto
+ WHERE trans_id = $form->{vendor_id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+ }
+
+ # get taxes for vendor
+ $query = qq|SELECT c.accno
+ FROM chart c, vendortax v
+ WHERE v.chart_id = c.id
+ AND v.vendor_id = $form->{vendor_id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $vendortax = ();
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $vendortax{$ref->{accno}} = 1;
+ }
+ $sth->finish;
+
+
+ # get tax rates and description
+ $query = qq|SELECT c.accno, c.description, c.link, t.rate
+ FROM chart c, tax t
+ WHERE c.id = t.chart_id
+ AND c.link LIKE '%CT_tax%'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $form->{taxaccounts} = "";
+ $form->{taxpart} = "";
+ $form->{taxservice} = "";
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($vendortax{$ref->{accno}}) {
+ $form->{"$ref->{accno}_rate"} = $ref->{rate};
+ $form->{"$ref->{accno}_description"} = $ref->{description};
+ $form->{taxaccounts} .= "$ref->{accno} ";
+ }
+
+ foreach my $item (split /:/, $ref->{link}) {
+ if ($item =~ /IC_taxpart/) {
+ $form->{taxpart} .= "$ref->{accno} ";
+ }
+
+ if ($item =~ /IC_taxservice/) {
+ $form->{taxservice} .= "$ref->{accno} ";
+ }
+ }
+ }
+ $sth->finish;
+ chop $form->{taxaccounts};
+ chop $form->{taxpart};
+ chop $form->{taxservice};
+
+ if (!$form->{id} && $form->{type} !~ /_order/) {
+ # setup last accounts used
+ $query = qq|SELECT c.accno, c.description, c.link, c.category
+ FROM chart c
+ JOIN acc_trans ac ON (ac.chart_id = c.id)
+ JOIN ap a ON (a.id = ac.trans_id)
+ WHERE a.vendor_id = $form->{vendor_id}
+ AND NOT (c.link LIKE '%_tax%' OR c.link LIKE '%_paid%')
+ AND a.id IN (SELECT max(id) FROM ap
+ WHERE vendor_id = $form->{vendor_id})|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $i = 0;
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($ref->{category} eq 'E') {
+ $i++;
+ $form->{"AP_amount_$i"} = "$ref->{accno}--$ref->{description}";
+ }
+ if ($ref->{category} eq 'L') {
+ $form->{AP} = $form->{AP_1} = "$ref->{accno}--$ref->{description}";
+ }
+ }
+ $sth->finish;
+ $form->{rowcount} = $i if ($i && !$form->{type});
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+sub retrieve_item {
+ my ($self, $myconfig, $form) = @_;
+
+ my $i = $form->{rowcount};
+ my $var;
+
+ # don't include assemblies or obsolete parts
+ my $where = "NOT p.assembly = '1' AND NOT p.obsolete = '1'";
+
+ if ($form->{"partnumber_$i"}) {
+ $var = $form->like(lc $form->{"partnumber_$i"});
+ $where .= " AND lower(p.partnumber) LIKE '$var'";
+ }
+
+ if ($form->{"description_$i"}) {
+ $var = $form->like(lc $form->{"description_$i"});
+ $where .= " AND lower(p.description) LIKE '$var'";
+ }
+
+ if ($form->{"partsgroup_$i"}) {
+ $var = $form->like(lc $form->{"partsgroup_$i"});
+ $where .= " AND lower(pg.partsgroup) LIKE '$var'";
+ }
+
+ if ($form->{"description_$i"}) {
+ $where .= " ORDER BY description";
+ } else {
+ $where .= " ORDER BY partnumber";
+ }
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT p.id, p.partnumber, p.description,
+ c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ pg.partsgroup
+ FROM parts p
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id)
+ WHERE $where|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ # get tax rates for part
+ $query = qq|SELECT c.accno
+ FROM chart c
+ JOIN partstax pt ON (pt.chart_id = c.id)
+ WHERE pt.parts_id = $ref->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref->{taxaccounts} = "";
+ while (my $ptref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{taxaccounts} .= "$ptref->{accno} ";
+ }
+ $sth->finish;
+ chop $ref->{taxaccounts};
+
+ push @{ $form->{item_list} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+
+sub vendor_details {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get rest for the vendor
+ my $query = qq|SELECT vendornumber, name, addr1, addr2, addr3, addr4,
+ contact, phone as vendorphone, fax as vendorfax, vendornumber
+ FROM vendor
+ WHERE id = $form->{vendor_id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub item_links {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description, link
+ FROM chart
+ WHERE link LIKE '%IC%'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ foreach my $key (split(/:/, $ref->{link})) {
+ if ($key =~ /IC/) {
+ push @{ $form->{IC_links}{$key} }, { accno => $ref->{accno},
+ description => $ref->{description} };
+ }
+ }
+ }
+
+ $sth->finish;
+}
+
+1;
+
diff --git a/sql-ledger/SL/IS.pm b/sql-ledger/SL/IS.pm
new file mode 100644
index 000000000..dc11e3677
--- /dev/null
+++ b/sql-ledger/SL/IS.pm
@@ -0,0 +1,1231 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory invoicing module
+#
+#======================================================================
+
+package IS;
+
+
+sub invoice_details {
+ my ($self, $myconfig, $form) = @_;
+
+ $form->{duedate} = $form->{invdate} unless ($form->{duedate});
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT date '$form->{duedate}' - date '$form->{invdate}'
+ AS terms
+ FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{terms}) = $sth->fetchrow_array;
+ $sth->finish;
+
+ my $tax = 0;
+ my $item;
+ my $i;
+ my @partsgroup = ();
+ my $partsgroup;
+ my %oid = ( 'Pg' => 'oid',
+ 'Oracle' => 'rowid' );
+
+ # sort items by partsgroup
+ for $i (1 .. $form->{rowcount}) {
+ $partsgroup = "";
+ if ($form->{"partsgroup_$i"} && $form->{groupitems}) {
+ $form->format_string("partsgroup_$i");
+ $partsgroup = $form->{"partsgroup_$i"};
+ }
+ push @partsgroup, [ $i, $partsgroup ];
+ }
+
+ my $sameitem = "";
+ foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
+ $i = $item->[0];
+
+ if ($item->[1] ne $sameitem) {
+ push(@{ $form->{description} }, qq|$item->[1]|);
+ $sameitem = $item->[1];
+
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber number bin qty unit deliverydate sellprice listprice netprice discount linetotal);
+ }
+
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+
+ # add number, description and qty to $form->{number}, ....
+ push(@{ $form->{runningnumber} }, $i);
+ push(@{ $form->{number} }, qq|$form->{"partnumber_$i"}|);
+ push(@{ $form->{bin} }, qq|$form->{"bin_$i"}|);
+ push(@{ $form->{description} }, qq|$form->{"description_$i"}|);
+ push(@{ $form->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"}));
+ push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|);
+ push(@{ $form->{deliverydate} }, qq|$form->{"deliverydate_$i"}|);
+
+ push(@{ $form->{sellprice} }, $form->{"sellprice_$i"});
+
+ # listprice
+ push(@{ $form->{listprice} }, $form->{"listprice_$i"});
+
+ my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+ my ($dec) = ($sellprice =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ my $discount = $form->round_amount($sellprice * $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces);
+
+ # keep a netprice as well, (sellprice - discount)
+ $form->{"netprice_$i"} = $sellprice - $discount;
+ push(@{ $form->{netprice} }, ($form->{"netprice_$i"} != 0) ? $form->format_amount($myconfig, $form->{"netprice_$i"}, $decimalplaces) : " ");
+
+
+ my $linetotal = $form->round_amount($form->{"qty_$i"} * $form->{"netprice_$i"}, 2);
+
+ $discount = ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, $decimalplaces) : " ";
+ $linetotal = ($linetotal != 0) ? $linetotal : " ";
+
+ push(@{ $form->{discount} }, $discount);
+
+ $form->{total} += $linetotal;
+
+ push(@{ $form->{linetotal} }, $form->format_amount($myconfig, $linetotal, 2));
+
+ my $taxrate = 0;
+ my ($taxamount, $taxbase);
+
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{"taxaccounts_$i"};
+
+ if ($form->{taxincluded}) {
+ # calculate tax
+ $taxamount = $linetotal * ($taxrate / (1 + $taxrate));
+ $taxbase = $linetotal - $taxamount;
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ $taxbase = $linetotal;
+ }
+
+ if ($taxamount != 0) {
+ foreach my $item (split / /, $form->{"taxaccounts_$i"}) {
+ $taxaccounts{$item} += $taxamount * $form->{"${item}_rate"} / $taxrate;
+ $taxbase{$item} += $taxbase;
+ }
+ }
+
+ if ($form->{"assembly_$i"}) {
+ $sameitem = "";
+
+ # get parts and push them onto the stack
+ my $sortorder = "";
+ if ($form->{groupitems}) {
+ $sortorder = qq|ORDER BY pg.partsgroup, a.$oid{$myconfig->{dbdriver}}|;
+ } else {
+ $sortorder = qq|ORDER BY a.$oid{$myconfig->{dbdriver}}|;
+ }
+
+ $query = qq|SELECT p.partnumber, p.description, p.unit, a.qty,
+ pg.partsgroup
+ FROM assembly a
+ JOIN parts p ON (a.parts_id = p.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE a.bom = '1'
+ AND a.id = '$form->{"id_$i"}'
+ $sortorder|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($form->{groupitems} && $ref->{partsgroup} ne $sameitem) {
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber number unit qty bin sellprice listprice netprice discount linetotal);
+ $sameitem = ($ref->{partsgroup}) ? $ref->{partsgroup} : "--";
+ push(@{ $form->{description} }, $sameitem);
+ }
+
+ push(@{ $form->{number} }, qq|$ref->{partnumber}|);
+ push(@{ $form->{description} }, qq|$ref->{description}|);
+ push(@{ $form->{unit} }, qq|$ref->{unit}|);
+ push(@{ $form->{qty} }, $form->format_amount($myconfig, $ref->{qty} * $form->{"qty_$i"}));
+
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber bin sellprice listprice netprice discount linetotal);
+
+ }
+ $sth->finish;
+ }
+
+ }
+ }
+
+
+ foreach my $item (sort keys %taxaccounts) {
+ if ($form->round_amount($taxaccounts{$item}, 2) != 0) {
+ push(@{ $form->{taxbase} }, $form->format_amount($myconfig, $taxbase{$item}, 2));
+
+ $tax += $taxamount = $form->round_amount($taxaccounts{$item}, 2);
+
+ push(@{ $form->{tax} }, $form->format_amount($myconfig, $taxamount));
+ push(@{ $form->{taxdescription} }, $form->{"${item}_description"});
+ push(@{ $form->{taxrate} }, $form->format_amount($myconfig, $form->{"${item}_rate"} * 100));
+ push(@{ $form->{taxnumber} }, $form->{"${item}_taxnumber"});
+ }
+ }
+
+
+ for my $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ push(@{ $form->{payment} }, $form->{"paid_$i"});
+ my ($accno, $description) = split /--/, $form->{"AR_paid_$i"};
+ push(@{ $form->{paymentaccount} }, $description);
+ push(@{ $form->{paymentdate} }, $form->{"datepaid_$i"});
+ push(@{ $form->{paymentsource} }, $form->{"source_$i"});
+
+ $form->{paid} += $form->parse_amount($myconfig, $form->{"paid_$i"});
+ }
+ }
+
+ $form->{subtotal} = $form->format_amount($myconfig, $form->{total}, 2);
+ $form->{invtotal} = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax;
+ $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2);
+ $form->{invtotal} = $form->format_amount($myconfig, $form->{invtotal}, 2);
+
+ $form->{paid} = $form->format_amount($myconfig, $form->{paid}, 2);
+
+ # myconfig variables
+ map { $form->{$_} = $myconfig->{$_} } (qw(company address tel fax signature businessnumber));
+ $form->{username} = $myconfig->{name};
+
+ $dbh->disconnect;
+
+}
+
+
+sub project_description {
+ my ($self, $dbh, $id) = @_;
+
+ my $query = qq|SELECT description
+ FROM project
+ WHERE id = $id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($_) = $sth->fetchrow_array;
+
+ $sth->finish;
+
+ $_;
+
+}
+
+
+sub customer_details {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get rest for the customer
+ my $query = qq|SELECT customernumber, name, addr1, addr2, addr3, addr4,
+ phone as customerphone, fax as customerfax, contact
+ FROM customer
+ WHERE id = $form->{customer_id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub post_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off autocommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($query, $sth, $null, $project_id, $deliverydate);
+ my $exchangerate = 0;
+
+ if ($form->{id}) {
+
+ &reverse_invoice($dbh, $form);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO ar (invnumber, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}') )|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM ar
+ WHERE invnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+
+ map { $form->{$_} =~ s/'/''/g } (qw(invnumber shippingpoint notes message));
+
+ my ($netamount, $invoicediff) = (0, 0);
+ my ($amount, $linetotal, $lastincomeaccno);
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{exchangerate} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy');
+ }
+
+ $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+
+
+ foreach my $i (1 .. $form->{rowcount}) {
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+
+ map { $form->{"${_}_$i"} =~ s/'/''/g } (qw(partnumber description unit));
+
+ # undo discount formatting
+ $form->{"discount_$i"} = $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100;
+
+ my ($allocated, $taxrate) = (0, 0);
+ my $taxamount;
+
+ # keep entered selling price
+ my $fxsellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+
+ my ($dec) = ($fxsellprice =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ # deduct discount
+ my $discount = $form->round_amount($fxsellprice * $form->{"discount_$i"}, $decimalplaces);
+ $form->{"sellprice_$i"} = $fxsellprice - $discount;
+
+ # add tax rates
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{"taxaccounts_$i"};
+
+ # round linetotal to 2 decimal places
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+
+ if ($form->{taxincluded}) {
+ $taxamount = $linetotal * ($taxrate / (1 + $taxrate));
+ $form->{"sellprice_$i"} = $form->{"sellprice_$i"} * (1 / (1 + $taxrate));
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ }
+
+ $netamount += $linetotal;
+
+ if ($taxamount != 0) {
+ map { $form->{amount}{$form->{id}}{$_} += $taxamount * $form->{"${_}_rate"} / $taxrate } split / /, $form->{"taxaccounts_$i"};
+ }
+
+
+ # add amount to income, $form->{amount}{trans_id}{accno}
+ $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * $form->{exchangerate};
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2) * $form->{exchangerate};
+ $linetotal = $form->round_amount($linetotal, 2);
+
+ # this is the difference from the inventory
+ $invoicediff += ($amount - $linetotal);
+
+ $form->{amount}{$form->{id}}{$form->{"income_accno_$i"}} += $linetotal;
+
+ $lastincomeaccno = $form->{"income_accno_$i"};
+
+
+ # adjust and round sellprice
+ $form->{"sellprice_$i"} = $form->round_amount($form->{"sellprice_$i"} * $form->{exchangerate}, $decimalplaces);
+
+ if ($form->{"inventory_accno_$i"} || $form->{"assembly_$i"}) {
+ # adjust parts onhand quantity
+
+ if ($form->{"assembly_$i"}) {
+ # do not update if assembly consists of all services
+ $query = qq|SELECT sum(p.inventory_accno_id)
+ FROM parts p, assembly a
+ WHERE a.parts_id = p.id
+ AND a.id = $form->{"id_$i"}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ if ($sth->fetchrow_array) {
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $form->{"id_$i"}|,
+ $form->{"qty_$i"} * -1);
+ }
+ $sth->finish;
+
+ # record assembly item as allocated
+ &process_assembly($dbh, $form, $form->{"id_$i"}, $form->{"qty_$i"});
+ } else {
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $form->{"id_$i"}|,
+ $form->{"qty_$i"} * -1);
+
+ $allocated = &cogs($dbh, $form, $form->{"id_$i"}, $form->{"qty_$i"});
+ }
+ }
+
+ $project_id = 'NULL';
+ if ($form->{"project_id_$i"}) {
+ $project_id = $form->{"project_id_$i"};
+ }
+ $deliverydate = ($form->{"deliverydate_$i"}) ? qq|'$form->{"deliverydate_$i"}'| : "NULL";
+
+ # save detail record in invoice table
+ $query = qq|INSERT INTO invoice (trans_id, parts_id, description, qty,
+ sellprice, fxsellprice, discount, allocated, assemblyitem,
+ unit, deliverydate, project_id)
+ VALUES ($form->{id}, $form->{"id_$i"},
+ '$form->{"description_$i"}', $form->{"qty_$i"},
+ $form->{"sellprice_$i"}, $fxsellprice,
+ $form->{"discount_$i"}, $allocated, 'f',
+ '$form->{"unit_$i"}', $deliverydate, $project_id)|;
+ $dbh->do($query) || $form->dberror($query);
+
+ }
+ }
+
+
+ $form->{datepaid} = $form->{invdate};
+
+ # total payments, don't move we need it here
+ for my $i (1 .. $form->{paidaccounts}) {
+ $form->{"paid_$i"} = $form->parse_amount($myconfig, $form->{"paid_$i"});
+ $form->{paid} += $form->{"paid_$i"};
+ $form->{datepaid} = $form->{"datepaid_$i"} if ($form->{"datepaid_$i"});
+ }
+
+ my ($tax, $diff) = (0, 0);
+
+ $netamount = $form->round_amount($netamount, 2);
+
+ # figure out rounding errors for total amount vs netamount + taxes
+ if ($form->{taxincluded}) {
+
+ $amount = $form->round_amount($netamount * $form->{exchangerate}, 2);
+ $diff += $amount - $netamount * $form->{exchangerate};
+ $netamount = $amount;
+
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $amount = $form->{amount}{$form->{id}}{$item} * $form->{exchangerate};
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($amount, 2);
+ $tax += $form->{amount}{$form->{id}}{$item};
+ $netamount -= $form->{amount}{$form->{id}}{$item};
+ }
+
+ $invoicediff += $diff;
+ ######## this only applies to tax included
+ if ($lastincomeaccno) {
+ $form->{amount}{$form->{id}}{$lastincomeaccno} += $invoicediff;
+ }
+
+ } else {
+ $amount = $form->round_amount($netamount * $form->{exchangerate}, 2);
+ $diff = $amount - $netamount * $form->{exchangerate};
+ $netamount = $amount;
+ foreach my $item (split / /, $form->{taxaccounts}) {
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($form->{amount}{$form->{id}}{$item}, 2);
+ $amount = $form->round_amount($form->{amount}{$form->{id}}{$item} * $form->{exchangerate}, 2);
+ $diff += $amount - $form->{amount}{$form->{id}}{$item} * $form->{exchangerate};
+ $form->{amount}{$form->{id}}{$item} = $form->round_amount($amount, 2);
+ $tax += $form->{amount}{$form->{id}}{$item};
+ }
+ }
+
+
+ $form->{amount}{$form->{id}}{$form->{AR}} = $netamount + $tax;
+
+ if ($form->{paid} != 0) {
+ $form->{paid} = $form->round_amount($form->{paid} * $form->{exchangerate} + $diff, 2);
+ }
+
+ # reverse AR
+ $form->{amount}{$form->{id}}{$form->{AR}} *= -1;
+
+
+ # update exchangerate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{invdate}, $form->{exchangerate}, 0);
+ }
+
+ foreach my $trans_id (keys %{$form->{amount}}) {
+ foreach my $accno (keys %{ $form->{amount}{$trans_id} }) {
+ if (($form->{amount}{$trans_id}{$accno} = $form->round_amount($form->{amount}{$trans_id}{$accno}, 2)) != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($trans_id, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{amount}{$trans_id}{$accno}, '$form->{invdate}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+ # deduct payment differences from diff
+ for my $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"} != 0) {
+ $amount = $form->round_amount($form->{"paid_$i"} * $form->{exchangerate}, 2);
+ $diff -= $amount - $form->{"paid_$i"} * $form->{exchangerate};
+ }
+ }
+
+ # force AR entry if 0
+ $form->{amount}{$form->{id}}{$form->{AR}} = 1 if ($form->{amount}{$form->{id}}{$form->{AR}} == 0);
+
+ # record payments and offsetting AR
+ for my $i (1 .. $form->{paidaccounts}) {
+
+ if ($form->{"paid_$i"} != 0) {
+ my ($accno) = split /--/, $form->{"AR_paid_$i"};
+ $form->{"datepaid_$i"} = $form->{invdate} unless ($form->{"datepaid_$i"});
+ $form->{datepaid} = $form->{"datepaid_$i"};
+
+ # record AR
+ $amount = $form->round_amount($form->{"paid_$i"} * $form->{exchangerate} + $diff, 2);
+
+ if ($form->{amount}{$form->{id}}{$form->{AR}} != 0) {
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$form->{AR}'),
+ $amount, '$form->{"datepaid_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+
+ # record payment
+ $form->{"paid_$i"} *= -1;
+
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
+ source)
+ VALUES ($form->{id}, (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{"paid_$i"}, '$form->{"datepaid_$i"}',
+ '$form->{"source_$i"}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+
+ $exchangerate = 0;
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
+
+ $form->{"exchangerate_$i"} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
+ }
+
+
+ # exchangerate difference
+ $form->{fx}{$accno}{$form->{"datepaid_$i"}} += $form->{"paid_$i"} * ($form->{"exchangerate_$i"} - 1) + $diff;
+
+
+ # gain/loss
+ $amount = $form->{"paid_$i"} * $form->{exchangerate} - $form->{"paid_$i"} * $form->{"exchangerate_$i"};
+ if ($amount > 0) {
+ $form->{fx}{$form->{fxgain_accno}}{$form->{"datepaid_$i"}} += $amount;
+ } else {
+ $form->{fx}{$form->{fxloss_accno}}{$form->{"datepaid_$i"}} += $amount;
+ }
+
+ $diff = 0;
+
+ # update exchange rate
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, $form->{"exchangerate_$i"}, 0);
+ }
+ }
+ }
+
+
+ # record exchange rate differences and gains/losses
+ foreach my $accno (keys %{$form->{fx}}) {
+ foreach my $transdate (keys %{ $form->{fx}{$accno} }) {
+ if (($form->{fx}{$accno}{$transdate} = $form->round_amount($form->{fx}{$accno}{$transdate}, 2)) != 0) {
+
+ $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount,
+ transdate, cleared, fx_transaction)
+ VALUES ($form->{id},
+ (SELECT id FROM chart
+ WHERE accno = '$accno'),
+ $form->{fx}{$accno}{$transdate}, '$transdate', '0', '1')|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+
+ $amount = $netamount + $tax;
+
+ # set values which could be empty to 0
+ $form->{terms} *= 1;
+ $form->{taxincluded} *= 1;
+ my $datepaid = ($form->{paid}) ? qq|'$form->{datepaid}'| : "NULL";
+ my $duedate = ($form->{duedate}) ? qq|'$form->{duedate}'| : "NULL";
+
+ # fill in subject if there is none
+ $form->{subject} = qq|$form->{label} $form->{invnumber}| unless $form->{subject};
+ # if there is a message stuff it into the notes
+ my $cc = "Cc: $form->{cc}\\r\n" if $form->{cc};
+ my $bcc = "Bcc: $form->{bcc}\\r\n" if $form->{bcc};
+ $form->{notes} .= qq|\r
+\r
+[email]\r
+To: $form->{email}\r
+$cc${bcc}Subject: $form->{subject}\r
+\r
+Message: $form->{message}\r| if $form->{message};
+
+ # save AR record
+ $query = qq|UPDATE ar set
+ invnumber = '$form->{invnumber}',
+ ordnumber = '$form->{ordnumber}',
+ transdate = '$form->{invdate}',
+ customer_id = $form->{customer_id},
+ amount = $amount,
+ netamount = $netamount,
+ paid = $form->{paid},
+ datepaid = $datepaid,
+ duedate = $duedate,
+ invoice = '1',
+ shippingpoint = '$form->{shippingpoint}',
+ terms = $form->{terms},
+ notes = '$form->{notes}',
+ taxincluded = '$form->{taxincluded}',
+ curr = '$form->{currency}'
+ WHERE id = $form->{id}
+ |;
+ $dbh->do($query) || $form->dberror($query);
+
+ # add shipto
+ $form->{name} = $form->{customer};
+ $form->{name} =~ s/--$form->{customer_id}//;
+ $form->add_shipto($dbh, $form->{id});
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub process_assembly {
+ my ($dbh, $form, $id, $totalqty) = @_;
+
+ my $query = qq|SELECT a.parts_id, a.qty, p.assembly,
+ p.partnumber, p.description, p.unit,
+ p.inventory_accno_id, p.income_accno_id,
+ p.expense_accno_id
+ FROM assembly a, parts p
+ WHERE a.parts_id = p.id
+ AND a.id = $id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ my $allocated = 0;
+
+ $ref->{inventory_accno_id} *= 1;
+ $ref->{expense_accno_id} *= 1;
+
+ map { $ref->{$_} =~ s/'/''/g } (qw(partnumber description unit));
+
+ # multiply by number of assemblies
+ $ref->{qty} *= $totalqty;
+
+ if ($ref->{assembly}) {
+ &process_assembly($dbh, $form, $ref->{parts_id}, $ref->{qty});
+ next;
+ } else {
+ if ($ref->{inventory_accno_id}) {
+ $allocated = &cogs($dbh, $form, $ref->{parts_id}, $ref->{qty});
+ }
+ }
+
+ # save detail record for individual assembly item in invoice table
+ $query = qq|INSERT INTO invoice (trans_id, description, parts_id, qty,
+ sellprice, fxsellprice, allocated, assemblyitem, unit)
+ VALUES
+ ($form->{id}, '$ref->{description}',
+ $ref->{parts_id}, $ref->{qty}, 0, 0, $allocated, 't',
+ '$ref->{unit}')|;
+ $dbh->do($query) || $form->dberror($query);
+
+ }
+
+ $sth->finish;
+
+}
+
+
+sub cogs {
+ my ($dbh, $form, $id, $totalqty) = @_;
+
+ my $query = qq|SELECT i.id, i.trans_id, i.qty, i.allocated, i.sellprice,
+ (SELECT c.accno FROM chart c
+ WHERE p.inventory_accno_id = c.id)
+ AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE p.expense_accno_id = c.id)
+ AS expense_accno
+ FROM invoice i, parts p
+ WHERE i.parts_id = p.id
+ AND i.parts_id = $id
+ AND (i.qty + i.allocated) < 0
+ ORDER BY trans_id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $allocated = 0;
+ my $qty;
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if (($qty = (($ref->{qty} * -1) - $ref->{allocated})) > $totalqty) {
+ $qty = $totalqty;
+ }
+
+ $form->update_balance($dbh,
+ "invoice",
+ "allocated",
+ qq|id = $ref->{id}|,
+ $qty);
+
+ # total expenses and inventory
+ # sellprice is the cost of the item
+ $linetotal = $form->round_amount($ref->{sellprice} * $qty, 2);
+
+ # add to expense
+ $form->{amount}{$form->{id}}{$ref->{expense_accno}} += -$linetotal;
+
+ # deduct inventory
+ $form->{amount}{$form->{id}}{$ref->{inventory_accno}} -= -$linetotal;
+
+ # add allocated
+ $allocated += -$qty;
+
+ last if (($totalqty -= $qty) <= 0);
+ }
+
+ $sth->finish;
+
+ $allocated;
+
+}
+
+
+
+sub reverse_invoice {
+ my ($dbh, $form) = @_;
+
+ # reverse inventory items
+ my $query = qq|SELECT i.id, i.parts_id, i.qty, i.assemblyitem, p.assembly,
+ p.inventory_accno_id
+ FROM invoice i, parts p
+ WHERE i.parts_id = p.id
+ AND i.trans_id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ if ($ref->{inventory_accno_id} || $ref->{assembly}) {
+
+ # if the invoice item is not an assemblyitem adjust parts onhand
+ unless ($ref->{assemblyitem}) {
+ # adjust onhand in parts table
+ $form->update_balance($dbh,
+ "parts",
+ "onhand",
+ qq|id = $ref->{parts_id}|,
+ $ref->{qty});
+ }
+
+ # loop if it is an assembly
+ next if ($ref->{assembly});
+
+ # de-allocated purchases
+ $query = qq|SELECT id, trans_id, allocated
+ FROM invoice
+ WHERE parts_id = $ref->{parts_id}
+ AND allocated > 0
+ ORDER BY trans_id DESC|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $inhref = $sth->fetchrow_hashref(NAME_lc)) {
+ $qty = $ref->{qty};
+ if (($ref->{qty} - $inhref->{allocated}) > 0) {
+ $qty = $inhref->{allocated};
+ }
+
+ # update invoice
+ $form->update_balance($dbh,
+ "invoice",
+ "allocated",
+ qq|id = $inhref->{id}|,
+ $qty * -1);
+
+ last if (($ref->{qty} -= $qty) <= 0);
+ }
+ $sth->finish;
+ }
+ }
+
+ $sth->finish;
+
+ # delete acc_trans
+ $query = qq|DELETE FROM acc_trans
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # delete invoice entries
+ $query = qq|DELETE FROM invoice
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+}
+
+
+
+sub delete_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ # check for other foreign currency transactions
+ $form->delete_exchangerate($dbh) if ($form->{currency} ne $form->{defaultcurrency});
+
+ &reverse_invoice($dbh, $form);
+
+ # delete AR record
+ my $query = qq|DELETE FROM ar
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub retrieve_invoice {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query;
+
+ if ($form->{id}) {
+ # get default accounts and last invoice number
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ d.curr AS currencies
+ FROM defaults d|;
+ } else {
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ d.invnumber, d.curr AS currencies, current_date AS invdate
+ FROM defaults d|;
+ }
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+
+ if ($form->{id}) {
+
+ # retrieve invoice
+ $query = qq|SELECT a.invnumber, a.ordnumber, a.transdate AS invdate, a.paid,
+ a.shippingpoint, a.terms, a.notes, a.duedate, a.taxincluded,
+ a.curr AS currency, (SELECT e.name FROM employee e
+ WHERE e.id = a.employee_id) AS employee
+ FROM ar a
+ WHERE a.id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{invdate}, "buy");
+
+ # get shipto
+ $query = qq|SELECT * FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ # retrieve individual items
+ $query = qq|SELECT c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ i.description, i.qty, i.fxsellprice AS sellprice,
+ i.discount, i.parts_id AS id, i.unit, i.deliverydate,
+ pr.projectnumber,
+ i.project_id,
+ p.partnumber, p.assembly, p.bin,
+ pg.partsgroup
+ FROM invoice i
+ JOIN parts p ON (i.parts_id = p.id)
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN project pr ON (i.project_id = pr.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE i.trans_id = $form->{id}
+ AND NOT i.assemblyitem = '1'
+ ORDER BY i.id|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ # get taxes
+ $query = qq|SELECT c.accno
+ FROM chart c, partstax pt
+ WHERE pt.chart_id = c.id
+ AND pt.parts_id = $ref->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref->{taxaccounts} = "";
+ my $taxrate = 0;
+
+ while (my $ptref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{taxaccounts} .= "$ptref->{accno} ";
+ $taxrate += $form->{"$ptref->{accno}_rate"};
+ }
+ $sth->finish;
+ chop $ref->{taxaccounts};
+
+ push @{ $form->{invoice_details} }, $ref;
+ }
+ $sth->finish;
+
+ } else {
+
+ $form->{shippingpoint} = $myconfig->{shippingpoint} unless $form->{shippingpoint};
+
+ # up invoice number by 1
+ $form->{invnumber}++;
+
+ # save the new number
+ $query = qq|UPDATE defaults
+ SET invnumber = '$form->{invnumber}'|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $form->get_employee($dbh);
+
+ }
+
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+sub get_customer {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $dateformat = $myconfig->{dateformat};
+ $dateformat .= "yy" if $myconfig->{dateformat} !~ /^y/;
+
+ my $duedate = ($form->{invdate}) ? "to_date('$form->{invdate}', '$dateformat')" : "current_date";
+
+ $form->{customer_id} *= 1;
+ # get customer
+ my $query = qq|SELECT c.name AS customer, c.discount, c.creditlimit, c.terms,
+ c.email, c.cc, c.bcc, c.taxincluded,
+ c.addr1, c.addr2, c.addr3, c.addr4,
+ $duedate + c.terms AS duedate
+ FROM customer c
+ WHERE c.id = $form->{customer_id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ $form->{creditremaining} = $form->{creditlimit};
+ $query = qq|SELECT SUM(amount - paid)
+ FROM ar
+ WHERE customer_id = $form->{customer_id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{creditremaining}) -= $sth->fetchrow_array;
+
+ $sth->finish;
+
+ $query = qq|SELECT o.amount,
+ (SELECT e.buy FROM exchangerate e
+ WHERE e.curr = o.curr
+ AND e.transdate = o.transdate)
+ FROM oe o
+ WHERE o.customer_id = $form->{customer_id}
+ AND o.closed = '0'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($amount, $exch) = $sth->fetchrow_array) {
+ $exch = 1 unless $exch;
+ $form->{creditremaining} -= $amount * $exch;
+ }
+ $sth->finish;
+
+
+ # get shipto if we did not converted an order or invoice
+ if (!$form->{shipto}) {
+ map { delete $form->{$_} } qw(shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoaddr4 shiptocontact shiptophone shiptofax shiptoemail);
+
+ $query = qq|SELECT * FROM shipto
+ WHERE trans_id = $form->{customer_id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+ }
+
+ # get taxes we charge for this customer
+ $query = qq|SELECT c.accno
+ FROM chart c, customertax ct
+ WHERE ct.chart_id = c.id
+ AND ct.customer_id = $form->{customer_id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $customertax = ();
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $customertax{$ref->{accno}} = 1;
+ }
+ $sth->finish;
+
+ # get tax rates and description
+ $query = qq|SELECT c.accno, c.description, t.rate, t.taxnumber
+ FROM chart c, tax t
+ WHERE c.id = t.chart_id
+ AND c.link LIKE '%CT_tax%'
+ ORDER BY accno|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $form->{taxaccounts} = "";
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($customertax{$ref->{accno}}) {
+ $form->{"$ref->{accno}_rate"} = $ref->{rate};
+ $form->{"$ref->{accno}_description"} = $ref->{description};
+ $form->{"$ref->{accno}_taxnumber"} = $ref->{taxnumber};
+ $form->{taxaccounts} .= "$ref->{accno} ";
+ }
+ }
+ $sth->finish;
+ chop $form->{taxaccounts};
+
+ # setup last accounts used for this customer
+ if (!$form->{id} && $form->{type} !~ /_order/) {
+ $query = qq|SELECT c.accno, c.description, c.link, c.category
+ FROM chart c
+ JOIN acc_trans ac ON (ac.chart_id = c.id)
+ JOIN ar a ON (a.id = ac.trans_id)
+ WHERE a.customer_id = $form->{customer_id}
+ AND NOT (c.link LIKE '%_tax%' OR c.link LIKE '%_paid%')
+ AND a.id IN (SELECT max(id) FROM ar
+ WHERE customer_id = $form->{customer_id})|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $i = 0;
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($ref->{category} eq 'I') {
+ $i++;
+ $form->{"AR_amount_$i"} = "$ref->{accno}--$ref->{description}";
+ }
+ if ($ref->{category} eq 'A') {
+ $form->{AR} = $form->{AR_1} = "$ref->{accno}--$ref->{description}";
+ }
+ }
+ $sth->finish;
+ $form->{rowcount} = $i if ($i && !$form->{type});
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub retrieve_item {
+ my ($self, $myconfig, $form) = @_;
+
+ my $i = $form->{rowcount};
+ my $var;
+ my $where = "NOT obsolete = '1'";
+
+ if ($form->{"partnumber_$i"}) {
+ $var = $form->like(lc $form->{"partnumber_$i"});
+ $where .= " AND lower(p.partnumber) LIKE '$var'";
+ }
+ if ($form->{"description_$i"}) {
+ $var = $form->like(lc $form->{"description_$i"});
+ $where .= " AND lower(p.description) LIKE '$var'";
+ }
+
+ if ($form->{"partsgroup_$i"}) {
+ $var = $form->like(lc $form->{"partsgroup_$i"});
+ $where .= " AND lower(pg.partsgroup) LIKE '$var'";
+ }
+
+ if ($form->{"description_$i"}) {
+ $where .= " ORDER BY description";
+ } else {
+ $where .= " ORDER BY partnumber";
+ }
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
+ p.listprice,
+ c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ p.unit, p.assembly, p.bin, p.onhand, p.makemodel,
+ pg.partsgroup
+ FROM parts p
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN partsgroup pg ON (pg.id = p.partsgroup_id)
+ WHERE $where|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ # get taxes for part
+ $query = qq|SELECT c.accno
+ FROM chart c
+ JOIN partstax pt ON (c.id = pt.chart_id)
+ WHERE pt.parts_id = $ref->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref->{taxaccounts} = "";
+ while (my $ptref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{taxaccounts} .= "$ptref->{accno} ";
+ }
+ $sth->finish;
+ chop $ref->{taxaccounts};
+
+ # get makemodel
+ if ($ref->{makemodel}) {
+ $query = qq|SELECT name
+ FROM makemodel
+ WHERE parts_id = $ref->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref->{makemodel} = "";
+ while (my $ptref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{makemodel} .= "$ptref->{name}:";
+ }
+ $sth->finish;
+ chop $ref->{makemodel};
+ }
+
+ push @{ $form->{item_list} }, $ref;
+
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/Inifile.pm b/sql-ledger/SL/Inifile.pm
new file mode 100644
index 000000000..e9de47a8f
--- /dev/null
+++ b/sql-ledger/SL/Inifile.pm
@@ -0,0 +1,87 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#=====================================================================
+#
+# routines to retrieve / manipulate win ini style files
+# ORDER is used to keep the elements in the order they appear in .ini
+#
+#=====================================================================
+
+package Inifile;
+
+
+sub new {
+ my ($type, $file, $level) = @_;
+
+ my $id = "";
+ my $skip;
+
+ $type = ref($self) || $self;
+
+ open FH, "$file" or Form->error("$file : $!");
+
+ while (<FH>) {
+ next if /^(#|;|\s)/;
+ last if /^\./;
+
+ chop;
+
+ # strip comments
+ s/\s*(#|;).*//g;
+
+ # remove any trailing whitespace
+ s/^\s*(.*?)\s*$/$1/;
+
+ if (/^\[/) {
+ s/(\[|\])//g;
+
+ $id = $_;
+
+ # if there is a level skip
+ if ($skip = ($id !~ /^$level/)) {
+ next;
+ }
+
+ push @{$self->{ORDER}}, $_;
+
+ next;
+
+ }
+
+ if (!$skip) {
+ # add key=value to $id
+ my ($key, $value) = split /=/, $_, 2;
+
+ $self->{$id}{$key} = $value;
+ }
+
+ }
+ close FH;
+
+ bless $self, $type;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/Mailer.pm b/sql-ledger/SL/Mailer.pm
new file mode 100644
index 000000000..934ad3690
--- /dev/null
+++ b/sql-ledger/SL/Mailer.pm
@@ -0,0 +1,147 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+
+package Mailer;
+
+sub new {
+ my ($type) = @_;
+ my $self = {};
+
+ bless $self, $type;
+}
+
+
+sub send {
+ my ($self, $out) = @_;
+
+ my $boundary = time;
+ $boundary = "SL-$self->{version}-$boundary";
+ my $domain = $self->{from};
+ $domain =~ s/(.*?\@|>)//g;
+ my $msgid = "$boundary\@$domain";
+
+ $self->{charset} = "ISO-8859-1" unless $self->{charset};
+
+ if ($out) {
+ open(OUT, $out) or return "$out : $!";
+ } else {
+ open(OUT, ">-") or return "STDOUT : $!";
+ }
+
+ $self->{contenttype} = "text/plain" unless $self->{contenttype};
+
+ my ($cc, $bcc);
+ $cc = "Cc: $self->{cc}\n" if $self->{cc};
+ $bcc = "Bcc: $self->{bcc}\n" if $self->{bcc};
+
+ print OUT qq|From: $self->{from}
+To: $self->{to}
+${cc}${bcc}Subject: $self->{subject}
+Message-ID: <$msgid>
+X-Mailer: SQL-Ledger $self->{version}
+MIME-Version: 1.0
+|;
+
+
+ if ($self->{attachments}) {
+ print OUT qq|Content-Type: multipart/mixed; boundary="$boundary"
+
+--${boundary}
+Content-Type: $self->{contenttype}; charset="$self->{charset}"
+
+$self->{message}
+
+|;
+
+ foreach my $attachment (@{ $self->{attachments} }) {
+
+ my $application = ($attachment =~ /(^\w+$)|\.(html|text|txt|sql)$/) ? "text" : "application";
+
+ open(IN, $attachment);
+ if ($?) {
+ close(OUT);
+ return "$attachment : $!";
+ }
+
+ my $filename = $attachment;
+ # strip path
+ $filename =~ s/(.*\/|$self->{fileid})//g;
+
+ print OUT qq|--${boundary}
+Content-Type: $application/$self->{format}; name="$filename"; charset="$self->{charset}"
+Content-Transfer-Encoding: BASE64
+Content-Disposition: attachment; filename="$filename"\n\n|;
+
+ my $msg = "";
+ while (<IN>) {;
+ $msg .= $_;
+ }
+ print OUT &encode_base64($msg);
+
+ close(IN);
+
+ }
+ print OUT qq|--${boundary}--\n|;
+
+ } else {
+ print OUT qq|Content-Type: $self->{contenttype}; charset="$self->{charset}"
+
+$self->{message}
+|;
+ }
+
+ close(OUT);
+
+ return "";
+
+}
+
+
+sub encode_base64 ($;$) {
+
+ # this code is from the MIME-Base64-2.12 package
+ # Copyright 1995-1999,2001 Gisle Aas <gisle@ActiveState.com>
+
+ my $res = "";
+ my $eol = $_[1];
+ $eol = "\n" unless defined $eol;
+ pos($_[0]) = 0; # ensure start at the beginning
+
+ $res = join '', map( pack('u',$_)=~ /^.(\S*)/, ($_[0]=~/(.{1,45})/gs));
+
+ $res =~ tr|` -_|AA-Za-z0-9+/|; # `# help emacs
+ # fix padding at the end
+ my $padding = (3 - length($_[0]) % 3) % 3;
+ $res =~ s/.{$padding}$/'=' x $padding/e if $padding;
+ # break encoded string into lines of no more than 60 characters each
+ if (length $eol) {
+ $res =~ s/(.{1,60})/$1$eol/g;
+ }
+ return $res;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/Menu.pm b/sql-ledger/SL/Menu.pm
new file mode 100644
index 000000000..661d35408
--- /dev/null
+++ b/sql-ledger/SL/Menu.pm
@@ -0,0 +1,117 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#=====================================================================
+#
+# routines for menu items
+#
+#=====================================================================
+
+package Menu;
+
+
+sub new {
+ my ($type, $menufile, $level) = @_;
+
+ use SL::Inifile;
+ my $self = Inifile->new($menufile, $level);
+
+ bless $self, $type;
+
+}
+
+
+sub menuitem {
+ my ($self, $myconfig, $form, $item) = @_;
+
+ my $module = $form->{script};
+ my $action = "section_menu";
+ my $target = "";
+
+ if ($self->{$item}{module}) {
+ $module = $self->{$item}{module};
+ }
+ if ($self->{$item}{action}) {
+ $action = $self->{$item}{action};
+ }
+ if ($self->{$item}{target}) {
+ $target = $self->{$item}{target};
+ }
+
+ my $level = $form->escape($item);
+ my $str = qq|<a href=$module?path=$form->{path}&action=$action&level=$level&login=$form->{login}&password=$form->{password}|;
+ my @vars = qw(module action target href);
+
+ if ($self->{$item}{href}) {
+ $str = qq|<a href=$self->{$item}{href}|;
+ @vars = qw(module target href);
+ }
+
+ map { delete $self->{$item}{$_} } @vars;
+
+
+ # add other params
+ foreach my $key (keys %{ $self->{$item} }) {
+ $str .= "&".$form->escape($key,1)."=";
+ ($value, $conf) = split /=/, $self->{$item}{$key}, 2;
+ $value = $myconfig->{$value}."/$conf" if ($conf);
+ $str .= $form->escape($value, 1);
+ }
+
+ if ($target) {
+ $str .= qq| target=$target|;
+ }
+
+ $str .= ">";
+
+}
+
+
+sub access_control {
+ my ($self, $myconfig, $menulevel) = @_;
+
+ my @menu = ();
+
+ if ($menulevel eq "") {
+ @menu = grep { !/--/ } @{ $self->{ORDER} };
+ } else {
+ @menu = grep { /^${menulevel}--/ } @{ $self->{ORDER} };
+ }
+
+ my @a = split /;/, $myconfig->{acs};
+ my $excl = ();
+
+ # remove --AR, --AP from array
+ grep { ($a, $b) = split /--/; s/--$a$//; } @a;
+
+ map { $excl{$_} = 1 } @a;
+
+ @a = ();
+ map { push @a, $_ unless $excl{$_} } (@menu);
+
+ @a;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/Num2text.pm b/sql-ledger/SL/Num2text.pm
new file mode 100644
index 000000000..f09121c23
--- /dev/null
+++ b/sql-ledger/SL/Num2text.pm
@@ -0,0 +1,162 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#=====================================================================
+#
+# this is the default code for the Check package
+#
+#=====================================================================
+
+
+sub init {
+ my $self = shift;
+
+ %{ $self->{numbername} } =
+ (0 => 'Zero',
+ 1 => 'One',
+ 2 => 'Two',
+ 3 => 'Three',
+ 4 => 'Four',
+ 5 => 'Five',
+ 6 => 'Six',
+ 7 => 'Seven',
+ 8 => 'Eight',
+ 9 => 'Nine',
+ 10 => 'Ten',
+ 11 => 'Eleven',
+ 12 => 'Twelve',
+ 13 => 'Thirteen',
+ 14 => 'Fourteen',
+ 15 => 'Fifteen',
+ 16 => 'Sixteen',
+ 17 => 'Seventeen',
+ 18 => 'Eighteen',
+ 19 => 'Nineteen',
+ 20 => 'Twenty',
+ 30 => 'Thirty',
+ 40 => 'Forty',
+ 50 => 'Fifty',
+ 60 => 'Sixty',
+ 70 => 'Seventy',
+ 80 => 'Eighty',
+ 90 => 'Ninety',
+ 10**2 => 'Hundred',
+ 10**3 => 'Thousand',
+ 10**6 => 'Million',
+ 10**9 => 'Billion',
+ 10**12 => 'Trillion',
+ );
+
+}
+
+
+sub num2text {
+ my ($self, $amount) = @_;
+
+ return $self->{numbername}{0} unless $amount;
+
+ my @textnumber = ();
+
+ # split amount into chunks of 3
+ my @num = reverse split //, $amount;
+ my @numblock = ();
+ my @a;
+ my $i;
+
+ while (@num) {
+ @a = ();
+ for (1 .. 3) {
+ push @a, shift @num;
+ }
+ push @numblock, join / /, reverse @a;
+ }
+
+ while (@numblock) {
+
+ $i = $#numblock;
+ @num = split //, $numblock[$i];
+
+ if ($numblock[$i] == 0) {
+ pop @numblock;
+ next;
+ }
+
+ if ($numblock[$i] > 99) {
+ # the one from hundreds
+ push @textnumber, $self->{numbername}{$num[0]};
+
+ # add hundred designation
+ push @textnumber, $self->{numbername}{10**2};
+
+ # reduce numblock
+ $numblock[$i] -= $num[0] * 100;
+
+ }
+
+ $numblock[$i] *= 1;
+
+ if ($numblock[$i] > 9) {
+ # tens
+ push @textnumber, $self->format_ten($numblock[$i]);
+ } elsif ($numblock[$i] > 0) {
+ # ones
+ push @textnumber, $self->{numbername}{$numblock[$i]};
+ }
+
+ # add thousand, million
+ if ($i) {
+ $num = 10**($i * 3);
+ push @textnumber, $self->{numbername}{$num};
+ }
+
+ pop @numblock;
+
+ }
+
+ join ' ', @textnumber;
+
+}
+
+
+sub format_ten {
+ my ($self, $amount) = @_;
+
+ my $textnumber = "";
+ my @num = split //, $amount;
+
+ if ($amount > 20) {
+ $textnumber = $self->{numbername}{$num[0]*10};
+ $amount = $num[1];
+ } else {
+ $textnumber = $self->{numbername}{$amount};
+ $amount = 0;
+ }
+
+ $textnumber .= " ".$self->{numbername}{$amount} if $amount;
+
+ $textnumber;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/OE.pm b/sql-ledger/SL/OE.pm
new file mode 100644
index 000000000..a742ca7a2
--- /dev/null
+++ b/sql-ledger/SL/OE.pm
@@ -0,0 +1,674 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Order entry module
+#
+#======================================================================
+
+package OE;
+
+
+sub transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query;
+
+ my $rate = ($form->{vc} eq 'customer') ? 'buy' : 'sell';
+
+ my $query = qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate,
+ o.amount, ct.name, o.netamount, o.$form->{vc}_id,
+ (SELECT $rate FROM exchangerate ex
+ WHERE ex.curr = o.curr
+ AND ex.transdate = o.transdate) AS exchangerate,
+ o.closed
+ FROM oe o, $form->{vc} ct
+ WHERE o.$form->{vc}_id = ct.id|;
+
+ my $ordnumber = $form->like(lc $form->{ordnumber});
+
+ if ($form->{"$form->{vc}_id"}) {
+ $query .= qq| AND o.$form->{vc}_id = $form->{"$form->{vc}_id"}|;
+ } else {
+ if ($form->{$form->{vc}}) {
+ my $name = $form->like(lc $form->{$form->{vc}});
+ $query .= " AND lower(name) LIKE '$name'";
+ }
+ }
+ unless ($form->{open} && $form->{closed}) {
+ $query .= ($form->{open}) ? " AND o.closed = '0'" : " AND o.closed = '1'";
+ }
+
+ my $sortorder = join ', ', $form->sort_columns(qw(transdate ordnumber name));
+ $sortorder = $form->{sort} unless $sortorder;
+
+ $query .= " AND lower(ordnumber) LIKE '$ordnumber'" if $form->{ordnumber};
+ $query .= " AND transdate >= '$form->{transdatefrom}'" if $form->{transdatefrom};
+ $query .= " AND transdate <= '$form->{transdateto}'" if $form->{transdateto};
+ $query .= " ORDER by $sortorder";
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $oe = $sth->fetchrow_hashref(NAME_lc)) {
+ $oe->{exchangerate} = 1 unless $oe->{exchangerate};
+ push @{ $form->{OE} }, $oe;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub save_order {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn off autocommit
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($query, $sth);
+ my $exchangerate = 0;
+
+ if ($form->{id}) {
+
+ $query = qq|DELETE FROM orderitems
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ } else {
+ my $uid = time;
+ $uid .= $form->{login};
+
+ $query = qq|INSERT INTO oe (ordnumber, employee_id)
+ VALUES ('$uid', (SELECT id FROM employee
+ WHERE login = '$form->{login}') )|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|SELECT id FROM oe
+ WHERE ordnumber = '$uid'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{id}) = $sth->fetchrow_array;
+ $sth->finish;
+ }
+
+ map { $form->{$_} =~ s/'/''/g } qw(ordnumber shippingpoint notes message);
+
+ my ($amount, $linetotal, $discount, $project_id, $reqdate);
+ my ($taxrate, $taxamount, $fxsellprice);
+ my %taxbase = ();
+ my %taxaccounts = ();
+ my ($netamount, $tax) = (0, 0);
+
+ for my $i (1 .. $form->{rowcount}) {
+
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+
+ map { $form->{"${_}_$i"} =~ s/'/''/g } qw(partnumber description unit);
+
+ # set values to 0 if nothing entered
+ $form->{"discount_$i"} = $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100;
+
+ $form->{"sellprice_$i"} = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+ $fxsellprice = $form->{"sellprice_$i"};
+
+ my ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $discount = $form->round_amount($form->{"sellprice_$i"} * $form->{"discount_$i"}, $decimalplaces);
+ $form->{"sellprice_$i"} = $form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces);
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+ $taxrate = 0;
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{"taxaccounts_$i"};
+
+ if ($form->{taxincluded}) {
+ $taxamount = $linetotal * $taxrate / (1 + $taxrate);
+ $taxbase = $linetotal - $taxamount;
+ # we are not keeping a natural price, do not round
+ $form->{"sellprice_$i"} = $form->{"sellprice_$i"} * (1 / (1 + $taxrate));
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ $taxbase = $linetotal;
+ }
+
+ if ($taxamount != 0) {
+ foreach my $item (split / /, $form->{"taxaccounts_$i"}) {
+ $taxaccounts{$item} += $taxamount * $form->{"${item}_rate"} / $taxrate;
+ $taxbase{$item} += $taxbase;
+ }
+ }
+
+ $netamount += $form->{"sellprice_$i"} * $form->{"qty_$i"};
+
+ $project_id = 'NULL';
+ if ($form->{"project_id_$i"}) {
+ $project_id = $form->{"project_id_$i"};
+ }
+ $reqdate = ($form->{"reqdate_$i"}) ? qq|'$form->{"reqdate_$i"}'| : "NULL";
+
+ # save detail record in orderitems table
+ $query = qq|INSERT INTO orderitems
+ (trans_id, parts_id, description, qty, sellprice, discount,
+ unit, reqdate, project_id) VALUES (
+ $form->{id}, $form->{"id_$i"}, '$form->{"description_$i"}',
+ $form->{"qty_$i"}, $fxsellprice, $form->{"discount_$i"},
+ '$form->{"unit_$i"}', $reqdate, $project_id)|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $form->{"sellprice_$i"} = $fxsellprice;
+ $form->{"discount_$i"} *= 100;
+ }
+ }
+
+
+ # set values which could be empty
+ map { $form->{$_} *= 1 } qw(vendor_id customer_id taxincluded closed);
+
+ $reqdate = ($form->{reqdate}) ? qq|'$form->{reqdate}'| : "NULL";
+
+ # add up the tax
+ foreach my $item (sort keys %taxaccounts) {
+ $taxamount = $form->round_amount($taxaccounts{$item}, 2);
+ $tax += $taxamount;
+ }
+
+ $amount = $form->round_amount($netamount + $tax, 2);
+ $netamount = $form->round_amount($netamount, 2);
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ $form->{exchangerate} = 1;
+ } else {
+ $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? 'buy' : 'sell');
+ }
+
+ $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
+
+ # fill in subject if there is none
+ $form->{subject} = qq|$form->{label} $form->{ordnumber}| unless $form->{subject};
+ # if there is a message stuff it into the notes
+ my $cc = "Cc: $form->{cc}\\r\n" if $form->{cc};
+ my $bcc = "Bcc: $form->{bcc}\\r\n" if $form->{bcc};
+ $form->{notes} .= qq|\r
+\r
+[email]\r
+To: $form->{email}\r
+$cc${bcc}Subject: $form->{subject}\r
+\r
+Message: $form->{message}\r| if $form->{message};
+
+ # save OE record
+ $query = qq|UPDATE oe set
+ ordnumber = '$form->{ordnumber}',
+ transdate = '$form->{orddate}',
+ vendor_id = $form->{vendor_id},
+ customer_id = $form->{customer_id},
+ amount = $amount,
+ netamount = $netamount,
+ reqdate = $reqdate,
+ taxincluded = '$form->{taxincluded}',
+ shippingpoint = '$form->{shippingpoint}',
+ notes = '$form->{notes}',
+ curr = '$form->{currency}',
+ closed = '$form->{closed}'
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $form->{ordtotal} = $amount;
+
+ # add shipto
+ $form->{name} = $form->{$form->{vc}};
+ $form->{name} =~ s/--$form->{"$form->{vc}_id"}//;
+ $form->add_shipto($dbh, $form->{id});
+
+ if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
+ if ($form->{vc} eq 'customer') {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{orddate}, $form->{exchangerate}, 0);
+ }
+ if ($form->{vc} eq 'vendor') {
+ $form->update_exchangerate($dbh, $form->{currency}, $form->{orddate}, 0, $form->{exchangerate});
+ }
+ }
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub delete_order {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query;
+
+ # can't use $form->delete_exchangerate
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $query = qq|SELECT transdate FROM acc_trans
+ WHERE ar.id = trans_id
+ AND ar.curr = '$form->{currency}'
+ AND transdate = '$form->{orddate}'
+ UNION SELECT transdate FROM acc_trans
+ WHERE ap.id = trans_id
+ AND ap.curr = '$form->{currency}'
+ AND transdate = '$form->{orddate}'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($transdate) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if (!$transdate) {
+ $query = qq|DELETE FROM exchangerate
+ WHERE curr = '$form->{currency}'
+ AND transdate = '$form->{orddate}'|;
+ $dbh->do($query) || $self->dberror($query);
+ }
+ }
+
+
+ # delete OE record
+ $query = qq|DELETE FROM oe
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # delete individual entries
+ $query = qq|DELETE FROM orderitems
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $query = qq|DELETE FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub retrieve_order {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $query;
+
+ if ($form->{id}) {
+ # get default accounts and last order number
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ d.curr AS currencies
+ FROM defaults d|;
+ } else {
+ my $ordnumber = ($form->{vc} eq 'customer') ? 'sonumber' : 'ponumber';
+ $query = qq|SELECT (SELECT c.accno FROM chart c
+ WHERE d.inventory_accno_id = c.id) AS inventory_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.income_accno_id = c.id) AS income_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.expense_accno_id = c.id) AS expense_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxgain_accno_id = c.id) AS fxgain_accno,
+ (SELECT c.accno FROM chart c
+ WHERE d.fxloss_accno_id = c.id) AS fxloss_accno,
+ $ordnumber AS ordnumber, d.curr AS currencies,
+ current_date AS orddate, current_date AS reqdate
+ FROM defaults d|;
+ }
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ ($form->{currency}) = split /:/, $form->{currencies};
+
+ if ($form->{id}) {
+
+ # retrieve order
+ $query = qq|SELECT o.ordnumber, o.transdate AS orddate, o.reqdate,
+ o.taxincluded, o.shippingpoint, o.notes, o.curr AS currency,
+ (SELECT name FROM employee e
+ WHERE e.id = o.employee_id) AS employee,
+ o.$form->{vc}_id, cv.name AS $form->{vc}, o.amount AS invtotal,
+ o.closed, o.reqdate
+ FROM oe o, $form->{vc} cv
+ WHERE o.$form->{vc}_id = cv.id
+ AND o.id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+
+ $query = qq|SELECT * FROM shipto
+ WHERE trans_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ $ref = $sth->fetchrow_hashref(NAME_lc);
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+ $sth->finish;
+
+ my %oid = ( 'Pg' => 'oid',
+ 'Oracle' => 'rowid',
+ 'DB2' => '' );
+
+ # retrieve individual items
+ $query = qq|SELECT c1.accno AS inventory_accno,
+ c2.accno AS income_accno,
+ c3.accno AS expense_accno,
+ p.partnumber, p.assembly, o.description, o.qty,
+ o.sellprice, o.parts_id AS id, o.unit, o.discount, p.bin,
+ o.reqdate, o.project_id,
+ pr.projectnumber,
+ pg.partsgroup
+ FROM orderitems o
+ JOIN parts p ON (o.parts_id = p.id)
+ LEFT JOIN chart c1 ON (p.inventory_accno_id = c1.id)
+ LEFT JOIN chart c2 ON (p.income_accno_id = c2.id)
+ LEFT JOIN chart c3 ON (p.expense_accno_id = c3.id)
+ LEFT JOIN project pr ON (o.project_id = pr.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE trans_id = $form->{id}
+ ORDER BY o.$oid{$myconfig->{dbdriver}}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+
+ # get tax rates for part
+ $query = qq|SELECT c.accno
+ FROM chart c, partstax pt
+ WHERE pt.chart_id = c.id
+ AND pt.parts_id = $ref->{id}|;
+ my $pth = $dbh->prepare($query);
+ $pth->execute || $form->dberror($query);
+
+ $ref->{taxaccounts} = "";
+ my $taxrate = 0;
+
+ while (my $ptref = $pth->fetchrow_hashref(NAME_lc)) {
+ $ref->{taxaccounts} .= "$ptref->{accno} ";
+ $taxrate += $form->{"$ptref->{accno}_rate"};
+ }
+ $pth->finish;
+ chop $ref->{taxaccounts};
+
+ push @{ $form->{order_details} }, $ref;
+
+ }
+ $sth->finish;
+
+ } else {
+
+ my $ordnumber = ($form->{vc} eq 'customer') ? 'sonumber' : 'ponumber';
+ # up order number by 1
+ $form->{ordnumber}++;
+
+ # save the new number
+ $query = qq|UPDATE defaults
+ SET $ordnumber = '$form->{ordnumber}'|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $form->get_employee($dbh);
+
+ # get last name used
+ $form->lastname_used($dbh, $myconfig, $form->{vc}) unless $form->{"$form->{vc}_id"};
+
+ }
+
+ $form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{orddate}, ($form->{vc} eq 'customer') ? "buy" : "sell");
+
+ my $rc = $dbh->commit;
+ $dbh->disconnect;
+
+ $rc;
+
+}
+
+
+
+sub order_details {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $tax = 0;
+ my $item;
+ my $i;
+ my @partsgroup = ();
+ my $partsgroup;
+ my %oid = ( 'Pg' => 'oid',
+ 'Oracle' => 'rowid' );
+
+ # sort items by partsgroup
+ for $i (1 .. $form->{rowcount}) {
+ $partsgroup = "";
+ if ($form->{"partsgroup_$i"} && $form->{groupitems}) {
+ $form->format_string("partsgroup_$i");
+ $partsgroup = $form->{"partsgroup_$i"};
+ }
+ push @partsgroup, [ $i, $partsgroup ];
+ }
+
+ my $sameitem = "";
+ foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
+ $i = $item->[0];
+
+ if ($item->[1] ne $sameitem) {
+ push(@{ $form->{description} }, qq|$item->[1]|);
+ $sameitem = $item->[1];
+
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber number bin qty unit reqdate sellprice listprice netprice discount linetotal);
+ }
+
+ $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
+
+ if ($form->{"qty_$i"} != 0) {
+
+ # add number, description and qty to $form->{number}, ....
+ push(@{ $form->{runningnumber} }, $i);
+ push(@{ $form->{number} }, qq|$form->{"partnumber_$i"}|);
+ push(@{ $form->{description} }, qq|$form->{"description_$i"}|);
+ push(@{ $form->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"}));
+ push(@{ $form->{unit} }, qq|$form->{"unit_$i"}|);
+ push(@{ $form->{reqdate} }, qq|$form->{"reqdate_$i"}|);
+
+ push(@{ $form->{sellprice} }, $form->{"sellprice_$i"});
+
+ push(@{ $form->{listprice} }, $form->{"listprice_$i"});
+
+ my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+ my ($dec) = ($sellprice =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ my $discount = $form->round_amount($sellprice * $form->parse_amount($myconfig, $form->{"discount_$i"}) / 100, $decimalplaces);
+
+ # keep a netprice as well, (sellprice - discount)
+ $form->{"netprice_$i"} = $sellprice - $discount;
+
+ my $linetotal = $form->round_amount($form->{"qty_$i"} * $form->{"netprice_$i"}, 2);
+
+ push(@{ $form->{netprice} }, ($form->{"netprice_$i"} != 0) ? $form->format_amount($myconfig, $form->{"netprice_$i"}, $decimalplaces) : " ");
+
+ $discount = ($discount != 0) ? $form->format_amount($myconfig, $discount * -1, $decimalplaces) : " ";
+ $linetotal = ($linetotal != 0) ? $linetotal : " ";
+
+ push(@{ $form->{discount} }, $discount);
+
+ $form->{ordtotal} += $linetotal;
+
+ push(@{ $form->{linetotal} }, $form->format_amount($myconfig, $linetotal, 2));
+
+ my ($taxamount, $taxbase);
+ my $taxrate = 0;
+
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{"taxaccounts_$i"};
+
+ if ($form->{taxincluded}) {
+ # calculate tax
+ $taxamount = $linetotal * $taxrate / (1 + $taxrate);
+ $taxbase = $linetotal / (1 + $taxrate);
+ } else {
+ $taxamount = $linetotal * $taxrate;
+ $taxbase = $linetotal;
+ }
+
+
+ if ($taxamount != 0) {
+ foreach my $item (split / /, $form->{"taxaccounts_$i"}) {
+ $taxaccounts{$item} += $taxamount * $form->{"${item}_rate"} / $taxrate;
+ $taxbase{$item} += $taxbase;
+ }
+ }
+
+ if ($form->{"assembly_$i"}) {
+ $sameitem = "";
+
+ # get parts and push them onto the stack
+ my $sortorder = "";
+ if ($form->{groupitems}) {
+ $sortorder = qq|ORDER BY pg.partsgroup, a.$oid{$myconfig->{dbdriver}}|;
+ } else {
+ $sortorder = qq|ORDER BY a.$oid{$myconfig->{dbdriver}}|;
+ }
+
+ $query = qq|SELECT p.partnumber, p.description, p.unit, a.qty,
+ pg.partsgroup
+ FROM assembly a
+ JOIN parts p ON (a.parts_id = p.id)
+ LEFT JOIN partsgroup pg ON (p.partsgroup_id = pg.id)
+ WHERE a.bom = '1'
+ AND a.id = '$form->{"id_$i"}'
+ $sortorder|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ if ($form->{groupitems} && $ref->{partsgroup} ne $sameitem) {
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber number unit bin qty sellprice listprice netprice discount linetotal);
+ $sameitem = ($ref->{partsgroup}) ? $ref->{partsgroup} : "--";
+ push(@{ $form->{description} }, $sameitem);
+ }
+
+ push(@{ $form->{number} }, qq|$ref->{partnumber}|);
+ push(@{ $form->{description} }, qq|$ref->{description}|);
+ push(@{ $form->{unit} }, qq|$ref->{unit}|);
+ push(@{ $form->{qty} }, $form->format_amount($myconfig, $ref->{qty} * $form->{"qty_$i"}));
+
+ map { push(@{ $form->{$_} }, "") } qw(runningnumber bin sellprice listprice netprice discount linetotal);
+
+ }
+ $sth->finish;
+ }
+
+ }
+ }
+
+
+ foreach $item (sort keys %taxaccounts) {
+ if ($form->round_amount($taxaccounts{$item}, 2) != 0) {
+ push(@{ $form->{taxbase} }, $form->format_amount($myconfig, $taxbase{$item}, 2));
+
+ $taxamount = $form->round_amount($taxaccounts{$item}, 2);
+ $tax += $taxamount;
+
+ push(@{ $form->{tax} }, $form->format_amount($myconfig, $taxamount, 2));
+ push(@{ $form->{taxdescription} }, $form->{"${item}_description"});
+ push(@{ $form->{taxrate} }, $form->format_amount($myconfig, $form->{"${item}_rate"} * 100));
+ push(@{ $form->{taxnumber} }, $form->{"${item}_taxnumber"});
+ }
+ }
+
+
+ $form->{subtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2);
+ $form->{ordtotal} = ($form->{taxincluded}) ? $form->{ordtotal} : $form->{ordtotal} + $tax;
+
+ # format amounts
+ $form->{ordtotal} = $form->format_amount($myconfig, $form->{ordtotal}, 2);
+
+ # myconfig variables
+ map { $form->{$_} = $myconfig->{$_} } (qw(company address tel fax signature businessnumber));
+ $form->{username} = $myconfig->{name};
+
+ $dbh->disconnect;
+
+}
+
+
+sub project_description {
+ my ($self, $dbh, $id) = @_;
+
+ my $query = qq|SELECT description
+ FROM project
+ WHERE id = $id|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($_) = $sth->fetchrow_array;
+
+ $sth->finish;
+
+ $_;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/SL/PE.pm b/sql-ledger/SL/PE.pm
new file mode 100644
index 000000000..dec04bb4f
--- /dev/null
+++ b/sql-ledger/SL/PE.pm
@@ -0,0 +1,276 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Project module
+# also used for partsgroups
+#
+#======================================================================
+
+package PE;
+
+
+sub projects {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $sortorder = ($form->{sort}) ? $form->{sort} : "projectnumber";
+
+ my $query = qq|SELECT id, projectnumber, description
+ FROM project
+ WHERE 1 = 1|;
+
+ if ($form->{projectnumber}) {
+ my $projectnumber = $form->like(lc $form->{projectnumber});
+ $query .= " AND lower(projectnumber) LIKE '$projectnumber'";
+ }
+ if ($form->{projectdescription}) {
+ my $description = $form->like(lc $form->{projectdescription});
+ $query .= " AND lower(description) LIKE '$description'";
+ }
+ if ($form->{status} eq 'orphaned') {
+ $query .= " AND id NOT IN (SELECT p.id
+ FROM project p, acc_trans a
+ WHERE p.id = a.project_id)
+ AND id NOT IN (SELECT p.id
+ FROM project p, invoice i
+ WHERE p.id = i.project_id)
+ AND id NOT IN (SELECT p.id
+ FROM project p, orderitems o
+ WHERE p.id = o.project_id)";
+ }
+
+ $query .= qq|
+ ORDER BY $sortorder|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $i = 0;
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{project_list} }, $ref;
+ $i++;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+ $i;
+
+}
+
+
+sub get_project {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT *
+ FROM project
+ WHERE id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+
+ # check if it is orphaned
+ $query = qq|SELECT count(*)
+ FROM acc_trans
+ WHERE project_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{orphaned}) = $sth->fetchrow_array;
+ $form->{orphaned} = !$form->{orphaned};
+
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+sub save_project {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ map { $form->{$_} =~ s/'/''/g } (projectnumber, description);
+
+ if ($form->{id}) {
+ $query = qq|UPDATE project SET
+ projectnumber = '$form->{projectnumber}',
+ description = '$form->{description}'
+ WHERE id = $form->{id}|;
+ } else {
+ $query = qq|INSERT INTO project
+ (projectnumber, description)
+ VALUES ('$form->{projectnumber}', '$form->{description}')|;
+ }
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+sub partsgroups {
+ my ($self, $myconfig, $form) = @_;
+
+ my $var;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $sortorder = ($form->{sort}) ? $form->{sort} : "partsgroup";
+
+ my $query = qq|SELECT g.*
+ FROM partsgroup g|;
+
+ my $where = "1 = 1";
+
+ if ($form->{partsgroup}) {
+ $var = $form->like(lc $form->{partsgroup});
+ $where .= " AND lower(partsgroup) LIKE '$var'";
+ }
+ $query .= qq|
+ WHERE $where
+ ORDER BY $sortorder|;
+
+ if ($form->{status} eq 'orphaned') {
+ $query = qq|SELECT g.*
+ FROM partsgroup g
+ LEFT JOIN parts p ON (p.partsgroup_id = g.id)
+ WHERE $where
+ EXCEPT
+ SELECT g.*
+ FROM partsgroup g
+ JOIN parts p ON (p.partsgroup_id = g.id)
+ WHERE $where
+ ORDER BY $sortorder|;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $i = 0;
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{item_list} }, $ref;
+ $i++;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+ $i;
+
+}
+
+
+sub save_partsgroup {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ map { $form->{$_} =~ s/'/''/g } (partsgroup);
+
+
+ if ($form->{id}) {
+ $query = qq|UPDATE partsgroup SET
+ partsgroup = '$form->{partsgroup}'
+ WHERE id = $form->{id}|;
+ } else {
+ $query = qq|INSERT INTO partsgroup
+ (partsgroup)
+ VALUES ('$form->{partsgroup}')|;
+ }
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+sub get_partsgroup {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT *
+ FROM partsgroup
+ WHERE id = $form->{id}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+
+ map { $form->{$_} = $ref->{$_} } keys %$ref;
+
+ $sth->finish;
+
+ # check if it is orphaned
+ $query = qq|SELECT count(*)
+ FROM parts
+ WHERE partsgroup_id = $form->{id}|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{orphaned}) = $sth->fetchrow_array;
+ $form->{orphaned} = !$form->{orphaned};
+
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub delete_tuple {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ $query = qq|DELETE FROM $form->{type}
+ WHERE id = $form->{id}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+
+1;
+
diff --git a/sql-ledger/SL/RC.pm b/sql-ledger/SL/RC.pm
new file mode 100644
index 000000000..9957d7349
--- /dev/null
+++ b/sql-ledger/SL/RC.pm
@@ -0,0 +1,186 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Account reconciliation routines
+#
+#======================================================================
+
+package RC;
+
+
+sub paymentaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT accno, description
+ FROM chart
+ WHERE link LIKE '%_paid%'
+ AND category = 'A'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{PR} }, $ref;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub payment_transactions {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my ($query, $sth);
+
+ # get cleared balance
+ if ($form->{fromdate}) {
+ $query = qq|SELECT sum(a.amount)
+ FROM acc_trans a, chart c
+ WHERE a.transdate < date '$form->{fromdate}'
+ AND a.cleared = '1'
+ AND c.id = a.chart_id
+ AND c.accno = '$form->{accno}'
+ |;
+ } else {
+ $query = qq|SELECT sum(a.amount)
+ FROM acc_trans a, chart c
+ WHERE a.cleared = '1'
+ AND c.id = a.chart_id
+ AND c.accno = '$form->{accno}'
+ |;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ ($form->{beginningbalance}) = $sth->fetchrow_array;
+
+ $sth->finish;
+
+ my %oid = ( 'Pg' => 'ac.oid',
+ 'Oracle' => 'ac.rowid');
+
+ $query = qq|SELECT c.name, ac.source, ac.transdate, ac.cleared,
+ ac.fx_transaction, ac.amount, a.id,
+ $oid{$myconfig->{dbdriver}} AS oid
+ FROM customer c, acc_trans ac, ar a, chart ch
+ WHERE c.id = a.customer_id
+ AND ac.cleared = '0'
+ AND ac.trans_id = a.id
+ AND ac.chart_id = ch.id
+ AND ch.accno = '$form->{accno}'
+ |;
+
+ $query .= " AND ac.transdate >= '$form->{fromdate}'" if $form->{fromdate};
+ $query .= " AND ac.transdate <= '$form->{todate}'" if $form->{todate};
+
+
+ $query .= qq|
+
+ UNION
+ SELECT v.name, ac.source, ac.transdate, ac.cleared,
+ ac.fx_transaction, ac.amount, a.id,
+ $oid{$myconfig->{dbdriver}} AS oid
+ FROM vendor v, acc_trans ac, ap a, chart ch
+ WHERE v.id = a.vendor_id
+ AND ac.cleared = '0'
+ AND ac.trans_id = a.id
+ AND ac.chart_id = ch.id
+ AND ch.accno = '$form->{accno}'
+ |;
+
+ $query .= " AND ac.transdate >= '$form->{fromdate}'" if $form->{fromdate};
+ $query .= " AND ac.transdate <= '$form->{todate}'" if $form->{todate};
+
+ $query .= qq|
+
+ UNION
+ SELECT g.description, ac.source, ac.transdate, ac.cleared,
+ ac.fx_transaction, ac.amount, g.id,
+ $oid{$myconfig->{dbdriver}} AS oid
+ FROM gl g, acc_trans ac, chart ch
+ WHERE g.id = ac.trans_id
+ AND ac.cleared = '0'
+ AND ac.trans_id = g.id
+ AND ac.chart_id = ch.id
+ AND ch.accno = '$form->{accno}'
+ |;
+
+ $query .= " AND ac.transdate >= '$form->{fromdate}'" if $form->{fromdate};
+ $query .= " AND ac.transdate <= '$form->{todate}'" if $form->{todate};
+
+ $query .= " ORDER BY 3,7,8";
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $pr = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{PR} }, $pr;
+ }
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+sub reconcile {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my ($query, $i);
+ my %oid = ( 'Pg' => 'oid',
+ 'Oracle' => 'rowid');
+
+ # clear flags
+ for $i (1 .. $form->{rowcount}) {
+ if ($form->{"cleared_$i"}) {
+ $query = qq|UPDATE acc_trans SET cleared = '1'
+ WHERE $oid{$myconfig->{dbdriver}} = $form->{"oid_$i"}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ # clear fx_transaction
+ if ($form->{"fxoid_$i"}) {
+ $query = qq|UPDATE acc_trans SET cleared = '1'
+ WHERE $oid{$myconfig->{dbdriver}} = $form->{"fxoid_$i"}|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ }
+ }
+
+ $dbh->disconnect;
+
+}
+
+1;
+
diff --git a/sql-ledger/SL/RP.pm b/sql-ledger/SL/RP.pm
new file mode 100644
index 000000000..3f07bb525
--- /dev/null
+++ b/sql-ledger/SL/RP.pm
@@ -0,0 +1,1310 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Benjamin Lee <benjaminlee@consultant.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# backend code for reports
+#
+#======================================================================
+
+package RP;
+
+
+sub income_statement {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $last_period = 0;
+ my @categories = qw(I E);
+ my $category;
+
+ $form->{decimalplaces} *= 1;
+
+ &get_accounts($dbh, $last_period, $form->{fromdate}, $form->{todate}, $form, \@categories);
+
+ # if there are any compare dates
+ if ($form->{comparefromdate} || $form->{comparetodate}) {
+ $last_period = 1;
+
+ &get_accounts($dbh, $last_period, $form->{comparefromdate}, $form->{comparetodate}, $form, \@categories);
+ }
+
+
+ # disconnect
+ $dbh->disconnect;
+
+
+ # now we got $form->{I}{accno}{ }
+ # and $form->{E}{accno}{ }
+
+ my %account = ( 'I' => { 'label' => 'income',
+ 'labels' => 'income',
+ 'ml' => 1 },
+ 'E' => { 'label' => 'expense',
+ 'labels' => 'expenses',
+ 'ml' => -1 }
+ );
+
+ my $str;
+
+ foreach $category (@categories) {
+
+ foreach $key (sort keys %{ $form->{$category} }) {
+ # push description onto array
+
+ $str = ($form->{l_heading}) ? $form->{padding} : "";
+
+ if ($form->{$category}{$key}{charttype} eq "A") {
+ $str .= ($form->{l_accno}) ? "$form->{$category}{$key}{accno} - $form->{$category}{$key}{description}" : "$form->{$category}{$key}{description}";
+ }
+ if ($form->{$category}{$key}{charttype} eq "H") {
+ if ($account{$category}{subtotal} && $form->{l_subtotal}) {
+ $dash = "- ";
+ push(@{$form->{"$account{$category}{label}_account"}}, "$str$form->{bold}$account{$category}{subdescription}$form->{endbold}");
+ push(@{$form->{"$account{$category}{labels}_this_period"}}, $form->format_amount($myconfig, $account{$category}{subthis} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ if ($last_period) {
+ push(@{$form->{"$account{$category}{labels}_last_period"}}, $form->format_amount($myconfig, $account{$category}{sublast} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+
+ }
+
+ $str = "$form->{br}$form->{bold}$form->{$category}{$key}{description}$form->{endbold}";
+
+ $account{$category}{subthis} = $form->{$category}{$key}{this};
+ $account{$category}{sublast} = $form->{$category}{$key}{last};
+ $account{$category}{subdescription} = $form->{$category}{$key}{description};
+ $account{$category}{subtotal} = 1;
+
+ $form->{$category}{$key}{this} = 0;
+ $form->{$category}{$key}{last} = 0;
+
+ next unless $form->{l_heading};
+
+ $dash = " ";
+ }
+
+ push(@{$form->{"$account{$category}{label}_account"}}, $str);
+
+ if ($form->{$category}{$key}{charttype} eq 'A') {
+ $form->{"total_$account{$category}{labels}_this_period"} += $form->{$category}{$key}{this} * $account{$category}{ml};
+ $dash = "- ";
+ }
+
+ push(@{$form->{"$account{$category}{labels}_this_period"}}, $form->format_amount($myconfig, $form->{$category}{$key}{this} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ # add amount or - for last period
+ if ($last_period) {
+ $form->{"total_$account{$category}{labels}_last_period"} += $form->{$category}{$key}{last} * $account{$category}{ml};
+
+ push(@{$form->{"$account{$category}{labels}_last_period"}}, $form->format_amount($myconfig,$form->{$category}{$key}{last} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+ }
+
+ $str = ($form->{l_heading}) ? $form->{padding} : "";
+ if ($account{$category}{subtotal} && $form->{l_subtotal}) {
+ push(@{$form->{"$account{$category}{label}_account"}}, "$str$form->{bold}$account{$category}{subdescription}$form->{endbold}");
+ push(@{$form->{"$account{$category}{labels}_this_period"}}, $form->format_amount($myconfig, $account{$category}{subthis} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ if ($last_period) {
+ push(@{$form->{"$account{$category}{labels}_last_period"}}, $form->format_amount($myconfig, $account{$category}{sublast} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+ }
+
+ }
+
+
+ # totals for income and expenses
+ $form->{total_income_this_period} = $form->round_amount($form->{total_income_this_period}, $form->{decimalplaces});
+ $form->{total_expenses_this_period} = $form->round_amount($form->{total_expenses_this_period}, $form->{decimalplaces});
+
+ # total for income/loss
+ $form->{total_this_period} = $form->{total_income_this_period} - $form->{total_expenses_this_period};
+
+ if ($last_period) {
+ # total for income/loss
+ $form->{total_last_period} = $form->format_amount($myconfig, $form->{total_income_last_period} - $form->{total_expenses_last_period}, $form->{decimalplaces}, "- ");
+
+ # totals for income and expenses for last_period
+ $form->{total_income_last_period} = $form->format_amount($myconfig, $form->{total_income_last_period}, $form->{decimalplaces}, "- ");
+ $form->{total_expenses_last_period} = $form->format_amount($myconfig, $form->{total_expenses_last_period}, $form->{decimalplaces}, "- ");
+
+ }
+
+
+ $form->{total_income_this_period} = $form->format_amount($myconfig,$form->{total_income_this_period}, $form->{decimalplaces}, "- ");
+ $form->{total_expenses_this_period} = $form->format_amount($myconfig,$form->{total_expenses_this_period}, $form->{decimalplaces}, "- ");
+ $form->{total_this_period} = $form->format_amount($myconfig,$form->{total_this_period}, $form->{decimalplaces}, "- ");
+
+}
+
+
+
+sub balance_sheet {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $last_period = 0;
+ my @categories = qw(A L Q);
+
+ # if there are any dates construct a where
+ if ($form->{asofdate}) {
+
+ $form->{this_period} = "$form->{asofdate}";
+ $form->{period} = "$form->{asofdate}";
+
+ }
+
+ $form->{decimalplaces} *= 1;
+
+ &get_accounts($dbh, $last_period, "", $form->{asofdate}, $form, \@categories);
+
+ # if there are any compare dates
+ if ($form->{compareasofdate}) {
+
+ $last_period = 1;
+ &get_accounts($dbh, $last_period, "", $form->{compareasofdate}, $form, \@categories);
+
+ $form->{last_period} = "$form->{compareasofdate}";
+
+ }
+
+
+ # disconnect
+ $dbh->disconnect;
+
+
+ # now we got $form->{A}{accno}{ } assets
+ # and $form->{L}{accno}{ } liabilities
+ # and $form->{Q}{accno}{ } equity
+ # build asset accounts
+
+ my $str;
+ my $key;
+
+ my %account = ( 'A' => { 'label' => 'asset',
+ 'labels' => 'assets',
+ 'ml' => -1 },
+ 'L' => { 'label' => 'liability',
+ 'labels' => 'liabilities',
+ 'ml' => 1 },
+ 'Q' => { 'label' => 'equity',
+ 'labels' => 'equities',
+ 'ml' => 1 }
+ );
+
+ foreach $category (@categories) {
+
+ foreach $key (sort keys %{ $form->{$category} }) {
+
+ $str = ($form->{l_heading}) ? $form->{padding} : "";
+
+ if ($form->{$category}{$key}{charttype} eq "A") {
+ $str .= ($form->{l_accno}) ? "$form->{$category}{$key}{accno} - $form->{$category}{$key}{description}" : "$form->{$category}{$key}{description}";
+ }
+ if ($form->{$category}{$key}{charttype} eq "H") {
+ if ($account{$category}{subtotal} && $form->{l_subtotal}) {
+ $dash = "- ";
+ push(@{$form->{"$account{$category}{label}_account"}}, "$str$form->{bold}$account{$category}{subdescription}$form->{endbold}");
+ push(@{$form->{"$account{$category}{label}_this_period"}}, $form->format_amount($myconfig, $account{$category}{subthis} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ if ($last_period) {
+ push(@{$form->{"$account{$category}{label}_last_period"}}, $form->format_amount($myconfig, $account{$category}{sublast} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+ }
+
+ $str = "$form->{bold}$form->{$category}{$key}{description}$form->{endbold}";
+
+ $account{$category}{subthis} = $form->{$category}{$key}{this};
+ $account{$category}{sublast} = $form->{$category}{$key}{last};
+ $account{$category}{subdescription} = $form->{$category}{$key}{description};
+ $account{$category}{subtotal} = 1;
+
+ $form->{$category}{$key}{this} = 0;
+ $form->{$category}{$key}{last} = 0;
+
+ next unless $form->{l_heading};
+
+ $dash = " ";
+ }
+
+ # push description onto array
+ push(@{$form->{"$account{$category}{label}_account"}}, $str);
+
+ if ($form->{$category}{$key}{charttype} eq 'A') {
+ $form->{"total_$account{$category}{labels}_this_period"} += $form->{$category}{$key}{this} * $account{$category}{ml};
+ $dash = "- ";
+ }
+
+ push(@{$form->{"$account{$category}{label}_this_period"}}, $form->format_amount($myconfig, $form->{$category}{$key}{this} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ if ($last_period) {
+ $form->{"total_$account{$category}{labels}_last_period"} += $form->{$category}{$key}{last} * $account{$category}{ml};
+
+ push(@{$form->{"$account{$category}{label}_last_period"}}, $form->format_amount($myconfig, $form->{$category}{$key}{last} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+ }
+
+ $str = ($form->{l_heading}) ? $form->{padding} : "";
+ if ($account{$category}{subtotal} && $form->{l_subtotal}) {
+ push(@{$form->{"$account{$category}{label}_account"}}, "$str$form->{bold}$account{$category}{subdescription}$form->{endbold}");
+ push(@{$form->{"$account{$category}{label}_this_period"}}, $form->format_amount($myconfig, $account{$category}{subthis} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+
+ if ($last_period) {
+ push(@{$form->{"$account{$category}{label}_last_period"}}, $form->format_amount($myconfig, $account{$category}{sublast} * $account{$category}{ml}, $form->{decimalplaces}, $dash));
+ }
+ }
+
+ }
+
+
+ # totals for assets, liabilities
+ $form->{total_assets_this_period} = $form->round_amount($form->{total_assets_this_period}, $form->{decimalplaces});
+ $form->{total_liabilities_this_period} = $form->round_amount($form->{total_liabilities_this_period}, $form->{decimalplaces});
+
+
+ # calculate retained earnings
+ $form->{earnings_this_period} = $form->{total_assets_this_period} - $form->{total_liabilities_this_period} - $form->{total_equity_this_period};
+
+ push(@{$form->{equity_this_period}}, $form->format_amount($myconfig, $form->{earnings_this_period}, $form->{decimalplaces}, "- "));
+
+ $form->{total_equity_this_period} = $form->round_amount($form->{total_equity_this_period} + $form->{earnings_this_period}, $form->{decimalplaces});
+
+ # add liability + equity
+ $form->{total_this_period} = $form->format_amount($myconfig, $form->{total_liabilities_this_period} + $form->{total_equity_this_period}, $form->{decimalplaces}, "- ");
+
+
+ if ($last_period) {
+ # totals for assets, liabilities
+ $form->{total_assets_last_period} = $form->round_amount($form->{total_assets_last_period}, $form->{decimalplaces});
+ $form->{total_liabilities_last_period} = $form->round_amount($form->{total_liabilities_last_period}, $form->{decimalplaces});
+
+
+ # calculate retained earnings
+ $form->{earnings_last_period} = $form->{total_assets_last_period} - $form->{total_liabilities_last_period} - $form->{total_equity_last_period};
+
+ push(@{$form->{equity_last_period}}, $form->format_amount($myconfig,$form->{earnings_last_period}, $form->{decimalplaces}, "- "));
+
+ $form->{total_equity_last_period} = $form->round_amount($form->{total_equity_last_period} + $form->{earnings_last_period}, $form->{decimalplaces});
+
+ # add liability + equity
+ $form->{total_last_period} = $form->format_amount($myconfig, $form->{total_liabilities_last_period} + $form->{total_equity_last_period}, $form->{decimalplaces}, "- ");
+
+ }
+
+
+ $form->{total_liabilities_last_period} = $form->format_amount($myconfig, $form->{total_liabilities_last_period}, $form->{decimalplaces}, "- ") if ($form->{total_liabilities_last_period} != 0);
+
+ $form->{total_equity_last_period} = $form->format_amount($myconfig, $form->{total_equity_last_period}, $form->{decimalplaces}, "- ") if ($form->{total_equity_last_period} != 0);
+
+ $form->{total_assets_last_period} = $form->format_amount($myconfig, $form->{total_assets_last_period}, $form->{decimalplaces}, "- ") if ($form->{total_assets_last_period} != 0);
+
+ $form->{total_assets_this_period} = $form->format_amount($myconfig, $form->{total_assets_this_period}, $form->{decimalplaces}, "- ");
+
+ $form->{total_liabilities_this_period} = $form->format_amount($myconfig, $form->{total_liabilities_this_period}, $form->{decimalplaces}, "- ");
+
+ $form->{total_equity_this_period} = $form->format_amount($myconfig, $form->{total_equity_this_period}, $form->{decimalplaces}, "- ");
+
+}
+
+
+
+sub get_accounts {
+ my ($dbh, $last_period, $fromdate, $todate, $form, $categories) = @_;
+
+ my $query;
+ my $where = "WHERE 1 = 1";
+ my $subwhere;
+ my $item;
+
+ my $category = "AND (";
+ foreach $item (@{ $categories }) {
+ $category .= qq|c.category = '$item' OR |;
+ }
+ $category =~ s/OR $/\)/;
+
+
+ # get headings
+ $query = qq|SELECT accno, description, category
+ FROM chart c
+ WHERE c.charttype = 'H'
+ $category
+ ORDER by c.accno|;
+
+ if ($form->{accounttype} eq 'gifi')
+ {
+ $query = qq|SELECT g.accno, g.description, c.category
+ FROM gifi g
+ JOIN chart c ON (c.gifi_accno = g.accno)
+ WHERE c.charttype = 'H'
+ $category
+ ORDER BY g.accno|;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my @headingaccounts = ();
+ while ($ref = $sth->fetchrow_hashref(NAME_lc))
+ {
+ $form->{$ref->{category}}{$ref->{accno}}{description} = "$ref->{description}";
+ $form->{$ref->{category}}{$ref->{accno}}{charttype} = "H";
+ $form->{$ref->{category}}{$ref->{accno}}{accno} = $ref->{accno};
+
+ push @headingaccounts, $ref->{accno};
+ }
+
+ $sth->finish;
+
+
+ $where .= " AND ac.transdate >= '$fromdate'" if $fromdate;
+
+ if ($todate) {
+ $where .= " AND ac.transdate <= '$todate'";
+ $subwhere = " AND transdate <= '$todate'";
+ }
+
+
+ if ($form->{project_id})
+ {
+ $project = qq|
+ AND ac.project_id = $form->{project_id}
+ |;
+ }
+
+
+ if ($form->{accounttype} eq 'gifi')
+ {
+
+ if ($form->{method} eq 'cash')
+ {
+
+ $query = qq|
+
+ SELECT g.accno, sum(ac.amount) AS amount,
+ g.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ar a ON (a.id = ac.trans_id)
+ JOIN gifi g ON (g.accno = c.gifi_accno)
+ $where
+ $category
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AR_paid%'
+ $subwhere
+ )
+ $project
+ GROUP BY g.accno, g.description, c.category
+
+ UNION
+
+ SELECT '' AS accno, SUM(ac.amount) AS amount,
+ '' AS description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ar a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND c.gifi_accno = ''
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AR_paid%'
+ $subwhere
+ )
+ $project
+ GROUP BY c.category
+
+ UNION
+
+ SELECT g.accno, sum(ac.amount) AS amount,
+ g.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ap a ON (a.id = ac.trans_id)
+ JOIN gifi g ON (g.accno = c.gifi_accno)
+ $where
+ $category
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AP_paid%'
+ $subwhere
+ )
+ $project
+ GROUP BY g.accno, g.description, c.category
+
+ UNION
+
+ SELECT '' AS accno, SUM(ac.amount) AS amount,
+ '' AS description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ap a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND c.gifi_accno = ''
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AP_paid%'
+ $subwhere
+ )
+ $project
+ GROUP BY c.category
+
+ UNION
+
+-- add gl
+
+ SELECT g.accno, sum(ac.amount) AS amount,
+ g.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN gifi g ON (g.accno = c.gifi_accno)
+ JOIN gl a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND NOT (c.link = 'AR' OR c.link = 'AP')
+ $project
+ GROUP BY g.accno, g.description, c.category
+
+ UNION
+
+ SELECT '' AS accno, SUM(ac.amount) AS amount,
+ '' AS description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN gl a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND c.gifi_accno = ''
+ AND NOT (c.link = 'AR' OR c.link = 'AP')
+ $project
+ GROUP BY c.category
+ |;
+
+ } else {
+
+ $query = qq|
+
+ SELECT g.accno, SUM(ac.amount) AS amount,
+ g.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN gifi g ON (c.gifi_accno = g.accno)
+ $where
+ $category
+ $project
+ GROUP BY g.accno, g.description, c.category
+
+ UNION
+
+ SELECT '' AS accno, SUM(ac.amount) AS amount,
+ '' AS description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ $where
+ $category
+ AND c.gifi_accno = ''
+ $project
+ GROUP by c.category
+ |;
+
+ }
+
+ } else {
+
+ if ($form->{method} eq 'cash')
+ {
+
+
+ $query = qq|
+
+ SELECT c.accno, sum(ac.amount) AS amount,
+ c.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ar a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AR_paid%'
+ $subwhere
+ )
+
+ $project
+ GROUP BY c.accno, c.description, c.category
+
+ UNION
+
+ SELECT c.accno, sum(ac.amount) AS amount,
+ c.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN ap a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND ac.trans_id IN
+ (
+ SELECT trans_id
+ FROM acc_trans
+ JOIN chart ON (chart_id = id)
+ WHERE link LIKE '%AP_paid%'
+ $subwhere
+ )
+
+ $project
+ GROUP BY c.accno, c.description, c.category
+
+ UNION
+
+ SELECT c.accno, sum(ac.amount) AS amount,
+ c.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ JOIN gl a ON (a.id = ac.trans_id)
+ $where
+ $category
+ AND NOT (c.link = 'AR' OR c.link = 'AP')
+ $project
+ GROUP BY c.accno, c.description, c.category
+ |;
+
+ } else {
+
+ $query = qq|
+
+ SELECT c.accno, sum(ac.amount) AS amount,
+ c.description, c.category
+ FROM acc_trans ac
+ JOIN chart c ON (c.id = ac.chart_id)
+ $where
+ $category
+ $project
+ GROUP BY c.accno, c.description, c.category
+ |;
+
+ }
+
+ }
+
+
+ my @accno;
+ my $accno;
+ my $ref;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ($ref = $sth->fetchrow_hashref(NAME_lc))
+ {
+
+ if ($ref->{category} eq 'C') {
+ $ref->{category} = 'A';
+ }
+
+ # get last heading account
+ @accno = grep { $_ le "$ref->{accno}" } @headingaccounts;
+ $accno = pop @accno;
+ if ($accno) {
+ if ($last_period)
+ {
+ $form->{$ref->{category}}{$accno}{last} += $ref->{amount};
+ } else {
+ $form->{$ref->{category}}{$accno}{this} += $ref->{amount};
+ }
+ }
+
+ $form->{$ref->{category}}{$ref->{accno}}{accno} = $ref->{accno};
+ $form->{$ref->{category}}{$ref->{accno}}{description} = $ref->{description};
+ $form->{$ref->{category}}{$ref->{accno}}{charttype} = "A";
+
+ if ($last_period)
+ {
+ $form->{$ref->{category}}{$ref->{accno}}{last} += $ref->{amount};
+ } else {
+ $form->{$ref->{category}}{$ref->{accno}}{this} += $ref->{amount};
+ }
+ }
+ $sth->finish;
+
+
+ # remove accounts with zero balance
+ foreach $category (@{ $categories }) {
+ foreach $accno (keys %{ $form->{$category} }) {
+ $form->{$category}{$accno}{last} = $form->round_amount($form->{$category}{$accno}{last}, $form->{decimalplaces});
+ $form->{$category}{$accno}{this} = $form->round_amount($form->{$category}{$accno}{this}, $form->{decimalplaces});
+
+ delete $form->{$category}{$accno} if ($form->{$category}{$accno}{this} == 0 && $form->{$category}{$accno}{last} == 0);
+ }
+ }
+
+}
+
+
+
+sub trial_balance_details {
+ my ($self, $myconfig, $form) = @_;
+
+ my $dbh = $form->dbconnect($myconfig);
+
+ my ($query, $sth, $ref);
+ my %balance = ();
+ my %trb = ();
+
+ my $where = "WHERE 1 = 1";
+
+ if ($form->{project_id}) {
+ $where .= qq|
+ AND a.project_id = $form->{project_id}
+ |;
+ }
+
+ # get beginning balances
+ if ($form->{fromdate}) {
+
+ if ($form->{accounttype} eq 'gifi') {
+
+ $query = qq|SELECT g.accno, c.category, SUM(a.amount) AS amount,
+ g.description
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
+ JOIN gifi g ON (c.gifi_accno = g.accno)
+ $where
+ AND a.transdate < '$form->{fromdate}'
+ GROUP BY g.accno, c.category, g.description
+ |;
+
+ } else {
+
+ $query = qq|SELECT c.accno, c.category, SUM(a.amount) AS amount,
+ c.description
+ FROM acc_trans a
+ JOIN chart c ON (a.chart_id = c.id)
+ $where
+ AND a.transdate < '$form->{fromdate}'
+ GROUP BY c.accno, c.category, c.description
+ |;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $balance{$ref->{accno}} = $ref->{amount};
+
+ if ($ref->{amount} != 0 && $form->{all_accounts}) {
+ $trb{$ref->{accno}}{description} = $ref->{description};
+ $trb{$ref->{accno}}{charttype} = 'A';
+ $trb{$ref->{accno}}{category} = $ref->{category};
+ }
+
+ }
+ $sth->finish;
+
+ }
+
+
+ # get headings
+ $query = qq|SELECT c.accno, c.description, c.category
+ FROM chart c
+ WHERE c.charttype = 'H'
+ ORDER by c.accno|;
+
+ if ($form->{accounttype} eq 'gifi')
+ {
+ $query = qq|SELECT g.accno, g.description, c.category
+ FROM gifi g
+ JOIN chart c ON (c.gifi_accno = g.accno)
+ WHERE c.charttype = 'H'
+ ORDER BY g.accno|;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my @headingaccounts = ();
+ while ($ref = $sth->fetchrow_hashref(NAME_lc))
+ {
+ $trb{$ref->{accno}}{description} = $ref->{description};
+ $trb{$ref->{accno}}{charttype} = 'H';
+ $trb{$ref->{accno}}{category} = $ref->{category};
+
+ push @headingaccounts, $ref->{accno};
+ }
+
+ $sth->finish;
+
+
+ if ($form->{fromdate} || $form->{todate}) {
+ if ($form->{fromdate}) {
+ $where .= " AND a.transdate >= '$form->{fromdate}'";
+ }
+ if ($form->{todate}) {
+ $where .= " AND a.transdate <= '$form->{todate}'";
+ }
+ }
+
+
+ if ($form->{accounttype} eq 'gifi') {
+
+ $query = qq|SELECT g.accno, g.description, c.category,
+ SUM(a.amount) AS amount
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ JOIN gifi g ON (c.gifi_accno = g.accno)
+ $where
+ GROUP BY g.accno, g.description, c.category
+
+ UNION
+
+ SELECT '' AS accno, '' AS description, c.category,
+ SUM(a.amount) AS amount
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ AND c.gifi_accno = ''
+ GROUP BY c.category
+ ORDER BY accno|;
+
+ } else {
+
+ $query = qq|SELECT c.accno, c.description, c.category,
+ SUM(a.amount) AS amount
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ GROUP BY c.accno, c.description, c.category
+ ORDER BY accno|;
+
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+
+ # prepare query for each account
+
+ $query = qq|SELECT (SELECT SUM(a.amount) * -1
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ AND a.amount < 0
+ AND c.accno = ?) AS debit,
+ (SELECT SUM(a.amount)
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ AND a.amount > 0
+ AND c.accno = ?) AS credit
+ |;
+
+ if ($form->{accounttype} eq 'gifi') {
+
+ $query = qq|SELECT (SELECT SUM(a.amount) * -1
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ AND a.amount < 0
+ AND c.gifi_accno = ?) AS debit,
+ (SELECT SUM(a.amount)
+ FROM acc_trans a
+ JOIN chart c ON (c.id = a.chart_id)
+ $where
+ AND a.amount > 0
+ AND c.gifi_accno = ?) AS credit|;
+
+ }
+
+ $drcr = $dbh->prepare($query);
+
+ # calculate the debit and credit in the period
+ while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $trb{$ref->{accno}}{description} = $ref->{description};
+ $trb{$ref->{accno}}{charttype} = 'A';
+ $trb{$ref->{accno}}{category} = $ref->{category};
+ $trb{$ref->{accno}}{amount} += $ref->{amount};
+
+ }
+ $sth->finish;
+
+ my ($debit, $credit);
+
+ foreach my $accno (sort keys %trb) {
+ $ref = ();
+
+ $ref->{accno} = $accno;
+ map { $ref->{$_} = $trb{$accno}{$_} } qw(description category charttype amount);
+
+ $ref->{balance} = $form->round_amount($balance{$ref->{accno}}, 2);
+
+ if ($trb{$accno}{charttype} eq 'A') {
+ # get DR/CR
+ $drcr->execute($ref->{accno}, $ref->{accno}) || $form->dberror($query);
+
+ ($debit, $credit) = (0,0);
+ while (($debit, $credit) = $drcr->fetchrow_array) {
+ $ref->{debit} += $debit;
+ $ref->{credit} += $credit;
+ }
+ $drcr->finish;
+
+ $ref->{debit} = $form->round_amount($ref->{debit}, 2);
+ $ref->{credit} = $form->round_amount($ref->{credit}, 2);
+
+ }
+
+
+ # add subtotal
+ @accno = grep { $_ le "$ref->{accno}" } @headingaccounts;
+ $accno = pop @accno;
+ if ($accno) {
+ $trb{$accno}{debit} += $ref->{debit};
+ $trb{$accno}{credit} += $ref->{credit};
+ }
+
+ push @{ $form->{TB} }, $ref;
+
+ }
+
+ $dbh->disconnect;
+
+ # debits and credits for headings
+ foreach $accno (@headingaccounts) {
+ foreach $ref (@{ $form->{TB} }) {
+ if ($accno eq $ref->{accno}) {
+ $ref->{debit} = $trb{$accno}{debit};
+ $ref->{credit} = $trb{$accno}{credit};
+ }
+ }
+ }
+
+}
+
+
+
+sub aging {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+ my $invoice = ($form->{arap} eq 'ar') ? 'is' : 'ir';
+
+ $form->{todate} = $form->current_date($myconfig) unless ($form->{todate});
+
+ my $where = "1 = 1";
+ my $name;
+
+ if ($form->{"$form->{ct}_id"}) {
+ $where .= qq| AND ct.id = $form->{"$form->{ct}_id"}|;
+ } else {
+ if ($form->{$form->{ct}}) {
+ $name = $form->like(lc $form->{$form->{ct}});
+ $where .= qq| AND lower(ct.name) LIKE '$name'| if $form->{$form->{ct}};
+ }
+ }
+
+ # select outstanding vendors or customers, depends on $ct
+ my $query = qq|SELECT DISTINCT ct.id, ct.name
+ FROM $form->{ct} ct, $form->{arap} a
+ WHERE $where
+ AND a.$form->{ct}_id = ct.id
+ AND a.paid != a.amount
+ AND (a.transdate <= '$form->{todate}')
+ ORDER BY ct.name|;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror;
+
+ my $buysell = ($form->{arap} eq 'ar') ? 'buy' : 'sell';
+
+ # for each company that has some stuff outstanding
+ while ( my ($id) = $sth->fetchrow_array ) {
+
+ $query = qq|
+
+-- between 0-30 days
+
+ SELECT $form->{ct}.id AS ctid, $form->{ct}.name,
+ addr1, addr2, addr3, addr4, contact,
+ phone as customerphone, fax as customerfax, $form->{ct}number,
+ "invnumber", "transdate",
+ (amount - paid) as "c0", 0.00 as "c30", 0.00 as "c60", 0.00 as "c90",
+ "duedate", invoice, $form->{arap}.id,
+ (SELECT $buysell FROM exchangerate
+ WHERE $form->{arap}.curr = exchangerate.curr
+ AND exchangerate.transdate = $form->{arap}.transdate) AS exchangerate
+ FROM $form->{arap}, $form->{ct}
+ WHERE paid != amount
+ AND $form->{arap}.$form->{ct}_id = $form->{ct}.id
+ AND $form->{ct}.id = $id
+ AND (
+ transdate <= (date '$form->{todate}' - interval '0 days')
+ AND transdate >= (date '$form->{todate}' - interval '30 days')
+ )
+
+ UNION
+
+-- between 31-60 days
+
+ SELECT $form->{ct}.id AS ctid, $form->{ct}.name,
+ addr1, addr2, addr3, addr4, contact,
+ phone as customerphone, fax as customerfax, $form->{ct}number,
+ "invnumber", "transdate",
+ 0.00 as "c0", (amount - paid) as "c30", 0.00 as "c60", 0.00 as "c90",
+ "duedate", invoice, $form->{arap}.id,
+ (SELECT $buysell FROM exchangerate
+ WHERE $form->{arap}.curr = exchangerate.curr
+ AND exchangerate.transdate = $form->{arap}.transdate) AS exchangerate
+ FROM $form->{arap}, $form->{ct}
+ WHERE paid != amount
+ AND $form->{arap}.$form->{ct}_id = $form->{ct}.id
+ AND $form->{ct}.id = $id
+ AND (
+ transdate < (date '$form->{todate}' - interval '30 days')
+ AND transdate >= (date '$form->{todate}' - interval '60 days')
+ )
+
+ UNION
+
+-- between 61-90 days
+
+ SELECT $form->{ct}.id AS ctid, $form->{ct}.name,
+ addr1, addr2, addr3, addr4, contact,
+ phone as customerphone, fax as customerfax, $form->{ct}number,
+ "invnumber", "transdate",
+ 0.00 as "c0", 0.00 as "c30", (amount - paid) as "c60", 0.00 as "c90",
+ "duedate", invoice, $form->{arap}.id,
+ (SELECT $buysell FROM exchangerate
+ WHERE $form->{arap}.curr = exchangerate.curr
+ AND exchangerate.transdate = $form->{arap}.transdate) AS exchangerate
+ FROM $form->{arap}, $form->{ct}
+ WHERE paid != amount
+ AND $form->{arap}.$form->{ct}_id = $form->{ct}.id
+ AND $form->{ct}.id = $id
+ AND (
+ transdate < (date '$form->{todate}' - interval '60 days')
+ AND transdate >= (date '$form->{todate}' - interval '90 days')
+ )
+
+ UNION
+
+-- over 90 days
+
+ SELECT $form->{ct}.id AS ctid, $form->{ct}.name,
+ addr1, addr2, addr3, addr4, contact,
+ phone as customerphone, fax as customerfax, $form->{ct}number,
+ "invnumber", "transdate",
+ 0.00 as "c0", 0.00 as "c30", 0.00 as "c60", (amount - paid) as "c90",
+ "duedate", invoice, $form->{arap}.id,
+ (SELECT $buysell FROM exchangerate
+ WHERE $form->{arap}.curr = exchangerate.curr
+ AND exchangerate.transdate = $form->{arap}.transdate) AS exchangerate
+ FROM $form->{arap}, $form->{ct}
+ WHERE paid != amount
+ AND $form->{arap}.$form->{ct}_id = $form->{ct}.id
+ AND $form->{ct}.id = $id
+ AND transdate < (date '$form->{todate}' - interval '90 days')
+
+ ORDER BY
+
+ ctid, invnumber, transdate
+
+ |;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror;
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ $ref->{module} = ($ref->{invoice}) ? $invoice : $form->{arap};
+ $ref->{exchangerate} = 1 unless $ref->{exchangerate};
+ push @{ $form->{AG} }, $ref;
+ }
+
+ $sth->finish;
+
+ }
+
+ $sth->finish;
+ # disconnect
+ $dbh->disconnect;
+
+}
+
+
+sub get_customer {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ my $query = qq|SELECT name, email, cc, bcc
+ FROM $form->{ct} ct
+ WHERE ct.id = $form->{"$form->{ct}_id"}|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror;
+
+ ($form->{$form->{ct}}, $form->{email}, $form->{cc}, $form->{bcc}) = $sth->fetchrow_array;
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub get_taxaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # get tax accounts
+ my $query = qq|SELECT accno, description
+ FROM chart
+ WHERE link LIKE '%CT_tax%'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror;
+
+ while ( my ($accno, $description) = $sth->fetchrow_array ) {
+ push @{ $form->{taxaccounts} }, "$accno--$description";
+ }
+ $sth->finish;
+
+ # get gifi tax accounts
+ my $query = qq|SELECT DISTINCT ON (g.accno) g.accno, g.description
+ FROM gifi g, chart c
+ WHERE g.accno = c.gifi_accno
+ AND c.link LIKE '%CT_tax%'
+ ORDER BY accno|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror;
+
+ while ( my ($accno, $description) = $sth->fetchrow_array ) {
+ push @{ $form->{gifi_taxaccounts} }, "$accno--$description";
+ }
+ $sth->finish;
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub tax_report {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database
+ my $dbh = $form->dbconnect($myconfig);
+
+ # build WHERE
+ my $where = qq|WHERE ac.trans_id = a.id
+ AND ac.chart_id = ch.id|;
+
+
+ if ($form->{accno} =~ /^gifi_/) {
+ my ($null, $accno) = split /_/, $form->{accno};
+ $where .= qq| AND ch.gifi_accno = '$accno'|;
+ } else {
+ $where .= qq| AND ch.accno = '$form->{accno}'|;
+ }
+
+ my $table;
+
+ if ($form->{db} eq 'ar') {
+ $where .= " AND n.id = a.customer_id";
+ $table = "customer";
+ }
+ if ($form->{db} eq 'ap') {
+ $where .= " AND n.id = a.vendor_id";
+ $table = "vendor";
+ }
+
+ my $transdate = ($form->{cashbased}) ? "a.datepaid" : "ac.transdate";
+ if ($form->{cashbased}) {
+ $where .= " AND a.amount = a.paid";
+ }
+
+ # if there are any dates construct a where
+ if ($form->{fromdate} || $form->{todate}) {
+ if ($form->{fromdate}) {
+ $where .= " AND $transdate >= '$form->{fromdate}'";
+ }
+ if ($form->{todate}) {
+ $where .= " AND $transdate <= '$form->{todate}'";
+ }
+ }
+
+ my $query = qq|SELECT a.id, a.invoice, $transdate AS transdate, a.invnumber,
+ n.name, a.netamount,|;
+ my $sortorder = join ', ', $form->sort_columns(qw(transdate invnumber name));
+ $sortorder = $form->{sort} unless $sortorder;
+
+ if ($form->{db} eq 'ar') {
+ $query .= " ac.amount AS tax";
+ }
+ if ($form->{db} eq 'ap') {
+ $query .= " ac.amount * -1 AS tax";
+ }
+
+ $query .= qq|
+ FROM acc_trans ac, "$form->{db}" a, "$table" n, chart ch
+ $where
+ ORDER by $sortorder|;
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while ( my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{TR} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub paymentaccounts {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $arap = uc $form->{db};
+ $arap .= "_paid";
+
+ # get A(R|P)_paid accounts
+ my $query = qq|SELECT accno, description
+ FROM chart
+ WHERE link LIKE '%$arap%'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{PR} }, $ref;
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+}
+
+
+sub payments {
+ my ($self, $myconfig, $form) = @_;
+
+ # connect to database, turn AutoCommit off
+ my $dbh = $form->dbconnect_noauto($myconfig);
+
+ my $ml = 1;
+ if ($form->{db} eq 'ar') {
+ $table = 'customer';
+ $ml = -1;
+ }
+ if ($form->{db} eq 'ap') {
+ $table = 'vendor';
+ }
+
+ my ($query, $sth);
+
+ # cycle through each id
+ foreach my $accno (split(/ /, $form->{paymentaccounts})) {
+
+ $query = qq|SELECT id, accno, description
+ FROM chart
+ WHERE accno = '$accno'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my $ref = $sth->fetchrow_hashref(NAME_lc);
+ push @{ $form->{PR} }, $ref;
+ $sth->finish;
+
+ $query = qq|SELECT c.name, a.invnumber, a.ordnumber,
+ ac.transdate,
+ ac.amount * $ml AS paid, ac.source, a.invoice, a.id,
+ '$form->{db}' AS module
+ FROM $table c, acc_trans ac, $form->{db} a
+ WHERE c.id = a.${table}_id
+ AND ac.trans_id = a.id
+ AND ac.chart_id = $ref->{id}|;
+
+ $query .= " AND ac.transdate >= '$form->{fromdate}'" if $form->{fromdate};
+ $query .= " AND ac.transdate <= '$form->{todate}'" if $form->{todate};
+
+ $query .= qq|
+ UNION
+ SELECT g.description, g.reference, NULL AS ordnumber,
+ ac.transdate,
+ ac.amount * $ml AS paid, ac.source, '0' as invoice, g.id,
+ 'gl' AS module
+ FROM gl g, acc_trans ac
+ WHERE g.id = ac.trans_id
+ AND ac.chart_id = $ref->{id}
+ AND (ac.amount * $ml) > 0
+ |;
+
+ $query .= " AND ac.transdate >= '$form->{fromdate}'" if $form->{fromdate};
+ $query .= " AND ac.transdate <= '$form->{todate}'" if $form->{todate};
+
+
+ my $sortorder = join ', ', $form->sort_columns(qw(name invnumber ordnumber transdate source));
+
+ $query .= " ORDER BY $sortorder";
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my $pr = $sth->fetchrow_hashref(NAME_lc)) {
+ push @{ $form->{$ref->{id}} }, $pr;
+ }
+ $sth->finish;
+
+ }
+
+ $dbh->disconnect;
+
+}
+
+
+1;
+
+
diff --git a/sql-ledger/SL/User.pm b/sql-ledger/SL/User.pm
new file mode 100644
index 000000000..d9b463d6b
--- /dev/null
+++ b/sql-ledger/SL/User.pm
@@ -0,0 +1,692 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#=====================================================================
+#
+# user related functions
+#
+#=====================================================================
+
+package User;
+
+
+sub new {
+ my ($type, $memfile, $login) = @_;
+ my $self = {};
+
+ if ($login ne "") {
+ # check if the file is locked
+ &error("", "$memfile locked!") if (-f "${memfile}.LCK");
+
+ open(MEMBER, "$memfile") or &error("", "$memfile : $!");
+
+ while (<MEMBER>) {
+ if (/^\[$login\]/) {
+ while (<MEMBER>) {
+ last if /^\[/;
+ next if /^(#|\s)/;
+
+ # remove comments
+ s/\s#.*//g;
+
+ # remove any trailing whitespace
+ s/^\s*(.*?)\s*$/$1/;
+
+ ($key, $value) = split /=/, $_, 2;
+
+ $self->{$key} = $value;
+ }
+
+ $self->{login} = $login;
+
+ last;
+ }
+ }
+ close MEMBER;
+ }
+
+ bless $self, $type;
+}
+
+
+sub country_codes {
+
+ my %cc = ();
+ my @language = ();
+
+ # scan the locale directory and read in the LANGUAGE files
+ opendir DIR, "locale";
+
+ my @dir = grep !/(^\.\.?$|\..*)/, readdir DIR;
+
+ foreach my $dir (@dir) {
+ next unless open(FH, "locale/$dir/LANGUAGE");
+ @language = <FH>;
+ close FH;
+
+ $cc{$dir} = "@language";
+ }
+
+ closedir(DIR);
+
+ %cc;
+
+}
+
+
+sub login {
+ my ($self, $form, $userspath) = @_;
+
+
+ if ($self->{login}) {
+
+ if ($self->{password}) {
+ $form->{password} = crypt $form->{password}, substr($self->{login}, 0, 2);
+ if ($self->{password} ne $form->{password}) {
+ return -1;
+ }
+ }
+
+ unless (-e "$userspath/$self->{login}.conf") {
+ $self->create_config("$userspath/$self->{login}.conf");
+ }
+
+ do "$userspath/$self->{login}.conf";
+ $myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
+
+ # check if database is down
+ my $dbh = DBI->connect($myconfig{dbconnect}, $myconfig{dbuser}, $myconfig{dbpasswd}) or $self->error(DBI::errstr);
+
+ # we got a connection, check the version
+ my $query = qq|SELECT version FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ my ($dbversion) = $sth->fetchrow_array;
+ $sth->finish;
+
+ # add login to employee table if it does not exist
+ # no error check for employee table, ignore if it does not exist
+ $query = qq|SELECT id FROM employee WHERE login = '$self->{login}'|;
+ $sth = $dbh->prepare($query);
+ $sth->execute;
+
+ my ($login) = $sth->fetchrow_array;
+ $sth->finish;
+
+ if (!$login) {
+ $query = qq|INSERT INTO employee (login, name, workphone)
+ VALUES ('$self->{login}', '$myconfig{name}', '$myconfig{tel}')|;
+ $dbh->do($query);
+ }
+ $dbh->disconnect;
+
+ if ($form->{dbversion} ne $dbversion) {
+ return -2;
+ }
+
+ } else {
+ return -3;
+ }
+
+}
+
+
+
+sub dbconnect_vars {
+ my ($form, $db) = @_;
+
+ my %dboptions = (
+ 'Pg' => {
+ 'yy-mm-dd' => 'set DateStyle to \'ISO\'',
+ 'mm/dd/yy' => 'set DateStyle to \'SQL, US\'',
+ 'mm-dd-yy' => 'set DateStyle to \'POSTGRES, US\'',
+ 'dd/mm/yy' => 'set DateStyle to \'SQL, EUROPEAN\'',
+ 'dd-mm-yy' => 'set DateStyle to \'POSTGRES, EUROPEAN\'',
+ 'dd.mm.yy' => 'set DateStyle to \'GERMAN\''
+ },
+ 'Oracle' => {
+ 'yy-mm-dd' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'YY-MM-DD\'',
+ 'mm/dd/yy' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'MM/DD/YY\'',
+ 'mm-dd-yy' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'MM-DD-YY\'',
+ 'dd/mm/yy' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'DD/MM/YY\'',
+ 'dd-mm-yy' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'DD-MM-YY\'',
+ 'dd.mm.yy' => 'ALTER SESSION SET NLS_DATE_FORMAT = \'DD.MM.YY\'',
+ }
+ );
+
+ $form->{dboptions} = $dboptions{$form->{dbdriver}}{$form->{dateformat}};
+
+ if ($form->{dbdriver} eq 'Pg') {
+ $form->{dbconnect} = "dbi:Pg:dbname=$db";
+ }
+
+ if ($form->{dbdriver} eq 'Oracle') {
+ $form->{dbconnect} = "dbi:Oracle:sid=$form->{sid}";
+ }
+
+ if ($form->{dbhost}) {
+ $form->{dbconnect} .= ";host=$form->{dbhost}";
+ }
+ if ($form->{dbport}) {
+ $form->{dbconnect} .= ";port=$form->{dbport}";
+ }
+
+}
+
+
+sub dbdrivers {
+
+ my @drivers = DBI->available_drivers();
+
+ return (grep { /(Pg|Oracle)$/ } @drivers);
+
+}
+
+
+sub dbsources {
+ my ($self, $form) = @_;
+
+ my @dbsources = ();
+ my ($sth, $query);
+
+ $form->{dbdefault} = $form->{dbuser} unless $form->{dbdefault};
+ $form->{sid} = $form->{dbdefault};
+ &dbconnect_vars($form, $form->{dbdefault});
+
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+
+ if ($form->{dbdriver} eq 'Pg') {
+
+ $query = qq|SELECT datname FROM pg_database|;
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($db) = $sth->fetchrow_array) {
+
+ if ($form->{only_acc_db}) {
+
+ next if ($db =~ /^template/);
+
+ &dbconnect_vars($form, $db);
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ $query = qq|SELECT tablename FROM pg_tables
+ WHERE tablename = 'defaults'
+ AND tableowner = '$form->{dbuser}'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ if ($sth->fetchrow_array) {
+ push @dbsources, $db;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ next;
+ }
+ push @dbsources, $db;
+ }
+ }
+
+ if ($form->{dbdriver} eq 'Oracle') {
+ if ($form->{only_acc_db}) {
+ $query = qq|SELECT owner FROM dba_objects
+ WHERE object_name = 'DEFAULTS'
+ AND object_type = 'TABLE'|;
+ } else {
+ $query = qq|SELECT username FROM dba_users|;
+ }
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($db) = $sth->fetchrow_array) {
+ push @dbsources, $db;
+ }
+ }
+
+ $sth->finish;
+ $dbh->disconnect;
+
+ return @dbsources;
+
+}
+
+
+sub dbcreate {
+ my ($self, $form) = @_;
+
+ my %dbcreate = ( 'Pg' => qq|CREATE DATABASE "$form->{db}"|,
+ 'Oracle' => qq|CREATE USER "$form->{db}" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP IDENTIFIED BY "$form->{db}"|);
+
+ $dbcreate{Pg} .= " WITH ENCODING = '$form->{encoding}'" if $form->{encoding};
+
+ $form->{sid} = $form->{dbdefault};
+ &dbconnect_vars($form, $form->{dbdefault});
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+ my $query = qq|$dbcreate{$form->{dbdriver}}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ if ($form->{dbdriver} eq 'Oracle') {
+ $query = qq|GRANT CONNECT,RESOURCE TO "$form->{db}"|;
+ $dbh->do($query) || $form->dberror($query);
+ }
+ $dbh->disconnect;
+
+
+ # setup variables for the new database
+ if ($form->{dbdriver} eq 'Oracle') {
+ $form->{dbuser} = $form->{db};
+ $form->{dbpasswd} = $form->{db};
+ }
+
+
+ &dbconnect_vars($form, $form->{db});
+
+ $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ # create the tables
+ my $filename = qq|sql/$form->{dbdriver}-tables.sql|;
+ $self->processquery($form, $dbh, $filename);
+
+ # load gifi
+ ($filename) = split /_/, $form->{chart};
+ $filename =~ s/_//;
+ $self->processquery($form, $dbh, "sql/${filename}-gifi.sql");
+
+ # load chart of accounts
+ $filename = qq|sql/$form->{chart}-chart.sql|;
+ $self->processquery($form, $dbh, $filename);
+
+ # create indices
+ $filename = qq|sql/$form->{dbdriver}-indices.sql|;
+ $self->processquery($form, $dbh, $filename);
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub processquery {
+ my ($self, $form, $dbh, $filename) = @_;
+
+ return unless (-f $filename);
+
+ open(FH, "$filename") or $form->error("$filename : $!\n");
+ my $query = "";
+
+ while (<FH>) {
+ $query .= $_;
+
+ if (/;\s*$/) {
+ # strip ;... Oracle doesn't like it
+ $query =~ s/;\s*$//;
+ $dbh->do($query) || $form->dberror($query);
+ $query = "";
+ }
+ }
+ close FH;
+
+}
+
+
+
+sub dbdelete {
+ my ($self, $form) = @_;
+
+ my %dbdelete = ( 'Pg' => qq|DROP DATABASE "$form->{db}"|,
+ 'Oracle' => qq|DROP USER $form->{db} CASCADE|
+ );
+
+ $form->{sid} = $form->{dbdefault};
+ &dbconnect_vars($form, $form->{dbdefault});
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+ my $query = qq|$dbdelete{$form->{dbdriver}}|;
+ $dbh->do($query) || $form->dberror($query);
+
+ $dbh->disconnect;
+
+}
+
+
+
+sub dbsources_unused {
+ my ($self, $form, $memfile) = @_;
+
+ my @dbexcl = ();
+ my @dbsources = ();
+
+ $form->error('File locked!') if (-f "${memfile}.LCK");
+
+ # open members file
+ open(FH, "$memfile") or $form->error("$memfile : $!");
+
+ while (<FH>) {
+ if (/^dbname=/) {
+ my ($null,$item) = split /=/;
+ push @dbexcl, $item;
+ }
+ }
+
+ close FH;
+
+ $form->{only_acc_db} = 1;
+ my @db = &dbsources("", $form);
+
+ push @dbexcl, $form->{dbdefault};
+
+ foreach $item (@db) {
+ unless (grep /$item$/, @dbexcl) {
+ push @dbsources, $item;
+ }
+ }
+
+ return @dbsources;
+
+}
+
+
+sub dbneedsupdate {
+ my ($self, $form) = @_;
+
+ my %dbsources = ();
+ my $query;
+
+ $form->{sid} = $form->{dbdefault};
+ &dbconnect_vars($form, $form->{dbdefault});
+
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ if ($form->{dbdriver} eq 'Pg') {
+
+ $query = qq|SELECT d.datname FROM pg_database d, pg_user u
+ WHERE d.datdba = u.usesysid
+ AND u.usename = '$form->{dbuser}'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($db) = $sth->fetchrow_array) {
+
+ next if ($db =~ /^template/);
+
+ &dbconnect_vars($form, $db);
+
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ $query = qq|SELECT tablename FROM pg_tables
+ WHERE tablename = 'defaults'|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ if ($sth->fetchrow_array) {
+ $query = qq|SELECT version FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute;
+
+ if (my ($version) = $sth->fetchrow_array) {
+ $dbsources{$db} = $version;
+ }
+ $sth->finish;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ }
+ $sth->finish;
+ }
+
+
+ if ($form->{dbdriver} eq 'Oracle') {
+ $query = qq|SELECT owner FROM dba_objects
+ WHERE object_name = 'DEFAULTS'
+ AND object_type = 'TABLE'|;
+
+ $sth = $dbh->prepare($query);
+ $sth->execute || $form->dberror($query);
+
+ while (my ($db) = $sth->fetchrow_array) {
+
+ $form->{dbuser} = $db;
+ &dbconnect_vars($form, $db);
+
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ $query = qq|SELECT version FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ $sth->execute;
+
+ if (my ($version) = $sth->fetchrow_array) {
+ $dbsources{$db} = $version;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ }
+ $sth->finish;
+ }
+
+ $dbh->disconnect;
+
+ %dbsources;
+
+}
+
+
+sub dbupdate {
+ my ($self, $form) = @_;
+
+ $form->{sid} = $form->{dbdefault};
+
+ my @upgradescripts = ();
+ my $query;
+
+ if ($form->{dbupdate}) {
+ # read update scripts into memory
+ opendir SQLDIR, "sql/." or $form-error($!);
+ @upgradescripts = sort grep /$form->{dbdriver}-upgrade-.*?\.sql/, readdir SQLDIR;
+ closedir SQLDIR;
+ }
+
+
+ foreach my $db (split / /, $form->{dbupdate}) {
+
+ next unless $form->{$db};
+
+ # strip db from dataset
+ $db =~ s/^db//;
+ &dbconnect_vars($form, $db);
+
+ my $dbh = DBI->connect($form->{dbconnect}, $form->{dbuser}, $form->{dbpasswd}) or $form->dberror;
+
+ # check version
+ $query = qq|SELECT version FROM defaults|;
+ my $sth = $dbh->prepare($query);
+ # no error check, let it fall through
+ $sth->execute;
+
+ my $version = $sth->fetchrow_array;
+ $sth->finish;
+
+ next unless $version;
+
+ foreach my $upgradescript (@upgradescripts) {
+ my $a = $upgradescript;
+ $a =~ s/(^$form->{dbdriver}-upgrade-|\.sql$)//g;
+
+ my ($mindb, $maxdb) = split /-/, $a;
+
+ next if ($version ge $maxdb);
+
+ # if there is no upgrade script exit
+ last if ($version lt $mindb);
+
+ # apply upgrade
+ $self->processquery($form, $dbh, "sql/$upgradescript");
+
+ $version = $maxdb;
+
+ }
+
+ $dbh->disconnect;
+
+ }
+}
+
+
+
+sub create_config {
+ my ($self, $filename) = @_;
+
+
+ @config = &config_vars;
+
+ open(CONF, ">$filename") or $self->error("$filename : $!");
+
+ # create the config file
+ print CONF qq|# configuration file for $self->{login}
+
+\%myconfig = (
+|;
+
+ foreach $key (sort @config) {
+ $self->{$key} =~ s/'/\\'/g;
+ print CONF qq| $key => '$self->{$key}',\n|;
+ }
+
+
+ print CONF qq|);\n\n|;
+
+ close CONF;
+
+}
+
+
+sub save_member {
+ my ($self, $memberfile, $userspath) = @_;
+
+ my $newmember = 1;
+
+ # format dbconnect and dboptions string
+ map { $self->{$_} = lc $self->{$_} } qw(dbname host);
+ &dbconnect_vars($self, $self->{dbname});
+
+ $self->error('File locked!') if (-f "${memberfile}.LCK");
+ open(FH, ">${memberfile}.LCK") or $self->error("${memberfile}.LCK : $!");
+ close(FH);
+
+ open(CONF, "+<$memberfile") or $self->error("$memberfile : $!");
+
+ @config = <CONF>;
+
+ seek(CONF, 0, 0);
+ truncate(CONF, 0);
+
+ while ($line = shift @config) {
+ if ($line =~ /^\[$self->{login}\]/) {
+ $newmember = 0;
+ last;
+ }
+ print CONF $line;
+ }
+
+ # remove everything up to next login or EOF
+ while ($line = shift @config) {
+ last if ($line =~ /^\[/);
+ }
+
+ # this one is either the next login or EOF
+ print CONF $line;
+
+ while ($line = shift @config) {
+ print CONF $line;
+ }
+
+ print CONF qq|[$self->{login}]\n|;
+
+ if ((($self->{dbpasswd} ne $self->{old_dbpasswd}) || $newmember) && $self->{root}) {
+ $self->{dbpasswd} = pack 'u', $self->{dbpasswd};
+ chop $self->{dbpasswd};
+ }
+
+ if ($self->{password} ne $self->{old_password}) {
+ $self->{password} = crypt $self->{password}, substr($self->{login}, 0, 2) if $self->{password};
+ }
+
+ if ($self->{'root login'}) {
+ @config = ("password");
+ } else {
+ @config = &config_vars;
+ }
+
+ # replace \r\n with \n
+ $self->{address} =~ s/\r\n/\\n/g if $self->{address};
+ $self->{signature} =~ s/\r\n/\\n/g if $self->{signature};
+
+ foreach $key (sort @config) {
+ print CONF qq|$key=$self->{$key}\n|;
+ }
+
+ print CONF "\n";
+ close CONF;
+ unlink "${memberfile}.LCK";
+
+ # create conf file
+ $self->create_config("$userspath/$self->{login}.conf") unless $self->{'root login'};
+
+}
+
+
+sub config_vars {
+
+ my @conf = qw(acs address admin businessnumber charset company countrycode
+ currency dateformat dbconnect dbdriver dbhost dbport dboptions
+ dbname dbuser dbpasswd email fax name numberformat password
+ printer sid shippingpoint signature stylesheet tel templates
+ vclimit);
+
+ @conf;
+
+}
+
+
+sub error {
+ my ($self, $msg) = @_;
+
+ if ($ENV{HTTP_USER_AGENT}) {
+ print qq|Content-Type: text/html
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+
+<body bgcolor=ffffff>
+
+<h2><font color=red>Error!</font></h2>
+<p><b>$msg</b>|;
+
+ }
+
+ die "Error: $msg\n";
+
+}
+
+
+1;
+
diff --git a/sql-ledger/VERSION b/sql-ledger/VERSION
new file mode 100644
index 000000000..815e68dd2
--- /dev/null
+++ b/sql-ledger/VERSION
@@ -0,0 +1 @@
+2.0.8
diff --git a/sql-ledger/am.pl b/sql-ledger/am.pl
new file mode 100755
index 000000000..f69a15a65
--- /dev/null
+++ b/sql-ledger/am.pl
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+#
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#######################################################################
+#
+# this script is the frontend called from bin/$terminal/$script
+# all the accounting modules are linked to this script which in
+# turn execute the same script in bin/$terminal/
+#
+#######################################################################
+
+# setup defaults, these are overidden by sql-ledger.conf
+# DO NOT CHANGE
+$userspath = "users";
+$templates = "templates";
+$memberfile = "users/members";
+$sendmail = "| /usr/sbin/sendmail -t";
+########## end ###########################################
+
+
+$| = 1;
+
+use SL::Form;
+
+eval { require "sql-ledger.conf"; };
+
+
+$form = new Form;
+
+
+# name of this script
+$0 =~ tr/\\/\//;
+$pos = rindex $0, '/';
+$script = substr($0, $pos + 1);
+
+# we use $script for the language module
+$form->{script} = $script;
+# strip .pl for translation files
+$script =~ s/\.pl//;
+
+# pull in DBI
+use DBI;
+
+# check for user config file, could be missing or ???
+eval { require("$userspath/$form->{login}.conf"); };
+if ($@) {
+ $locale = new Locale "$language", "$script";
+
+ $form->{callback} = "";
+ $msg1 = $locale->text('You are logged out!');
+ $msg2 = $locale->text('Login');
+ $form->redirect("$msg1 <p><a href=login.pl target=_top>$msg2</a>");
+}
+
+
+$myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
+map { $form->{$_} = $myconfig{$_} } qw(stylesheet charset) unless (($form->{action} eq "save") && ($form->{type} eq 'preferences'));
+
+
+# locale messages
+$locale = new Locale "$myconfig{countrycode}", "$script";
+
+
+# check password
+$form->error($locale->text('Incorrect Password!')) if ($form->{password} ne $myconfig{password});
+
+
+$form->{path} =~ s/\.\.\///g;
+if ($form->{path} !~ /^bin\//) {
+ $form->error($locale->text('Invalid path!')."\n");
+}
+
+# did sysadmin lock us out
+if (-e "$userspath/nologin") {
+ $form->error($locale->text('System currently down for maintenance!'));
+}
+
+
+# pull in the main code
+require "$form->{path}/$form->{script}";
+
+# customized scripts
+if (-f "$form->{path}/custom_$form->{script}") {
+ eval { require "$form->{path}/custom_$form->{script}"; };
+ $form->error($@) if ($@);
+}
+
+# customized scripts for login
+if (-f "$form->{path}/$form->{login}_$form->{script}") {
+ eval { require "$form->{path}/$form->{login}_$form->{script}"; };
+ $form->error($@) if ($@);
+}
+
+if ($form->{action}) {
+ # window title bar, user info
+ $form->{titlebar} = "SQL-Ledger ".$locale->text('Version'). " $form->{version} - $myconfig{name} - $myconfig{dbname}";
+
+ &{ $locale->findsub($form->{action}) };
+} else {
+ $form->error($locale->text('action= not defined!'));
+}
+
+
+# end
+
diff --git a/sql-ledger/bin/lynx/menu.pl b/sql-ledger/bin/lynx/menu.pl
new file mode 100644
index 000000000..559971685
--- /dev/null
+++ b/sql-ledger/bin/lynx/menu.pl
@@ -0,0 +1,128 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Christopher Browne
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#######################################################################
+#
+# menu for text based browsers (lynx)
+#
+# CHANGE LOG:
+# DS. 2000-07-04 Created
+# DS. 2001-08-07 access control
+# CBB 2002-02-09 Refactored HTML out to subroutines
+#######################################################################
+
+$menufile = "menu.ini";
+use SL::Menu;
+
+
+1;
+# end of main
+
+
+
+sub display {
+
+ $menu = new Menu "$menufile";
+
+ @menuorder = $menu->access_control(\%myconfig);
+
+ $form->{title} = "SQL-Ledger $form->{version}";
+
+ $form->header;
+
+ $offset = int (21 - $#menuorder)/2;
+
+ print "<pre>";
+ print "\n" x $offset;
+ print "</pre>";
+
+ print qq|<center><table>|;
+
+ map { print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $_).$locale->text($_).qq|</a></td></tr>|; } @menuorder;
+
+ print qq'
+</table>
+
+</body>
+</html>
+';
+
+ # display the company logo
+# $argv = "login=$form->{login}&password=$form->{password}&path=$form->{path}&action=company_logo&noheader=1";
+# exec "./login.pl", $argv;
+
+}
+
+
+sub section_menu {
+
+ $menu = new Menu "$menufile", $form->{level};
+
+ # build tiered menus
+ @menuorder = $menu->access_control(\%myconfig, $form->{level});
+
+ foreach $item (@menuorder) {
+ $a = $item;
+ $item =~ s/^$form->{level}--//;
+ push @neworder, $a unless ($item =~ /--/);
+ }
+ @menuorder = @neworder;
+
+ $level = $form->{level};
+ $level =~ s/--/ /g;
+
+ $form->{title} = $locale->text($level);
+
+ $form->header;
+
+ $offset = int (21 - $#menuorder)/2;
+ print "<pre>";
+ print "\n" x $offset;
+ print "</pre>";
+
+ print qq|<center><table>|;
+
+ foreach $item (@menuorder) {
+ $label = $item;
+ $label =~ s/$form->{level}--//g;
+
+ # remove target
+ $menu->{$item}{target} = "";
+
+ print "<tr><td>".$menu->menuitem(\%myconfig, \%$form, $item, $form->{level}).$locale->text($label)."</a></td></tr>";
+ }
+
+ print qq'</table>
+
+</body>
+</html>
+';
+
+}
+
+
+sub acc_menu {
+
+ &section_menu;
+
+}
+
diff --git a/sql-ledger/bin/mozilla/admin.pl b/sql-ledger/bin/mozilla/admin.pl
new file mode 100644
index 000000000..39247b541
--- /dev/null
+++ b/sql-ledger/bin/mozilla/admin.pl
@@ -0,0 +1,1504 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# setup module
+# add/edit/delete users
+#
+#======================================================================
+
+$menufile = "menu.ini";
+
+use SL::Form;
+use SL::User;
+
+
+$form = new Form;
+
+$locale = new Locale $language, "admin";
+
+eval { require DBI; };
+$form->error($locale->text('DBI not installed!')) if ($@);
+
+
+# customization
+if (-f "$form->{path}/custom_$form->{script}") {
+ eval { require "$form->{path}/custom_$form->{script}"; };
+ $form->error($@) if ($@);
+}
+
+
+if (-f "css/sql-ledger.css") {
+ $form->{stylesheet} = "sql-ledger.css";
+}
+
+
+if ($form->{action}) {
+
+ $subroutine = $locale->findsub($form->{action});
+
+ if ($subroutine eq 'login') {
+ if ($form->{rpw}) {
+ $form->{rpw} = crypt $form->{rpw}, "ro";
+ }
+ }
+
+ &check_password;
+
+ &$subroutine;
+
+} else {
+
+ # if there are no drivers bail out
+ $form->error($locale->text('No Database Drivers available!')) unless (User->dbdrivers);
+
+ # create memberfile
+ if (! -f $memberfile) {
+ open(FH, ">$memberfile") or $form->error("$memberfile : $!");
+ print FH qq|# SQL-Ledger Accounting members
+
+[root login]
+password=
+
+|;
+ close(FH);
+ }
+
+ &adminlogin;
+
+}
+
+1;
+# end
+
+
+sub adminlogin {
+
+ $form->{title} = qq|SQL-Ledger $form->{version} |.$locale->text('Administration');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<div align=center>
+
+<a href="http://www.sql-ledger.org"><img src=sql-ledger.png border=0></a>
+<h1 class=login>|.$locale->text('Version').qq| $form->{version}<p>|.$locale->text('Administration').qq|</h1>
+
+<form method=post action="$form->{script}">
+
+<table>
+ <tr>
+ <th>|.$locale->text('Password').qq|</th>
+ <td><input type=password name=rpw></td>
+ <td><input type=submit class=submit name=action value="|.$locale->text('Login').qq|"></td>
+ </tr>
+<input type=hidden name=action value=login>
+<input type=hidden name=root value="root login">
+<input type=hidden name=path value=$form->{path}>
+</table>
+
+
+</form>
+
+<a href=http://www.sql-ledger.org>SQL-Ledger |.$locale->text('website').qq|</a>
+
+</div>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+
+sub login {
+
+ &list_users;
+
+}
+
+
+
+sub add_user {
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Administration')." / ".$locale->text('Add User');
+
+ $form->{Oracle_sid} = $sid;
+ $form->{Oracle_dbport} = '1521';
+ $form->{Oracle_dbhost} = `hostname`;
+
+ if (-f "css/sql-ledger.css") {
+ $myconfig->{stylesheet} = "sql-ledger.css";
+ }
+ $myconfig->{vclimit} = 200;
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+
+sub edit {
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Administration')." / ".$locale->text('Edit User');
+ $form->{edit} = 1;
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub form_footer {
+
+ if ($form->{edit}) {
+ $delete = qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">
+<input type=hidden name=edit value=1>|;
+ }
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+
+<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+$delete
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub list_users {
+
+ $form->error("$memberfile : ".$locale->text('locked!')) if (-f "${memberfile}.LCK");
+
+ open(FH, "$memberfile") or $form->error("$memberfile : $!");
+
+ while (<FH>) {
+ chop;
+
+ if (/^\[.*\]/) {
+ $login = $_;
+ $login =~ s/(\[|\])//g;
+ }
+
+ if (/^(name=|company=|templates=|dbuser=|dbdriver=|dbname=|dbhost=)/) {
+ chop ($var = $&);
+ ($null, $member{$login}{$var}) = split /=/, $_, 2;
+ }
+ }
+
+ close(FH);
+
+# type=submit $locale->text('Pg Database Administration')
+# type=submit $locale->text('Oracle Database Administration')
+
+ foreach $item (User->dbdrivers) {
+ $dbdrivers .= qq|<input name=action type=submit class=submit value="|.$locale->text("$item Database Administration").qq|">|;
+ }
+
+
+ $column_header{login} = qq|<th>|.$locale->text('Login').qq|</th>|;
+ $column_header{name} = qq|<th>|.$locale->text('Name').qq|</th>|;
+ $column_header{company} = qq|<th>|.$locale->text('Company').qq|</th>|;
+ $column_header{dbdriver} = qq|<th>|.$locale->text('Driver').qq|</th>|;
+ $column_header{dbhost} = qq|<th>|.$locale->text('Host').qq|</th>|;
+ $column_header{dataset} = qq|<th>|.$locale->text('Dataset').qq|</th>|;
+ $column_header{templates} = qq|<th>|.$locale->text('Templates').qq|</th>|;
+
+ @column_index = qw(login name company dbdriver dbhost dataset templates);
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Administration');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <tr class=listheading>
+ <th>$form->{title}</th>
+ </tr>
+ <tr size=5></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+foreach $key (sort keys %member) {
+ $href = "$script?action=edit&login=$key&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}";
+ $href =~ s/ /%20/g;
+
+ $member{$key}{templates} =~ s/^$templates\///;
+ $member{$key}{dbhost} = $locale->text('localhost') unless $member{$key}{dbhost};
+ $member{$key}{dbname} = $member{$key}{dbuser} if ($member{$key}{dbdriver} eq 'Oracle');
+
+ $column_data{login} = qq|<td><a href=$href>$key</a></td>|;
+ $column_data{name} = qq|<td>$member{$key}{name}</td>|;
+ $column_data{company} = qq|<td>$member{$key}{company}</td>|;
+ $column_data{dbdriver} = qq|<td>$member{$key}{dbdriver}</td>|;
+ $column_data{dbhost} = qq|<td>$member{$key}{dbhost}</td>|;
+ $column_data{dataset} = qq|<td>$member{$key}{dbname}</td>|;
+ $column_data{templates} = qq|<td>$member{$key}{templates}</td>|;
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>|;
+}
+
+
+print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+<input type=hidden name=root value="$form->{root}">
+
+<br><input type=submit class=submit name=action value="|.$locale->text('Add User').qq|">
+<input type=submit class=submit name=action value="|.$locale->text('Change Admin Password').qq|">
+
+$dbdrivers
+
+</form>
+
+|.$locale->text('Click on login name to edit!').qq|
+<br>
+|.$locale->text('To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.').qq|
+
+<p>
+
+<form method=post action=login.pl>
+
+<table border=0 width=100%>
+ <tr class=listheading>
+ <th>SQL-Ledger |.$locale->text('Accounting')." ".$locale->text('Login').qq|</th>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Name').qq|</th>
+ <td><input class=login name=login></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input class=login type=password name=password></td>
+ <td><input type=submit name=action value="|.$locale->text('Login').qq|"></td>
+ </tr>
+<input type=hidden name=path value=$form->{path}>
+ </table>
+ </td>
+ </tr>
+</table>
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+
+sub form_header {
+
+ # if there is a login, get user
+ if ($form->{login}) {
+ # get user
+ $myconfig = new User "$memberfile", "$form->{login}";
+
+ $myconfig->{signature} =~ s/\\n/\r\n/g;
+ $myconfig->{address} =~ s/\\n/\r\n/g;
+
+ # strip basedir from templates directory
+ $myconfig->{templates} =~ s/^$templates\///;
+
+ $myconfig->{dbpasswd} = unpack 'u', $myconfig->{dbpasswd};
+ }
+
+
+ foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
+ $dateformat .= ($item eq $myconfig->{dateformat}) ? "<option selected>$item\n" : "<option>$item\n";
+ }
+
+ foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
+ $numberformat .= ($item eq $myconfig->{numberformat}) ? "<option selected>$item\n" : "<option>$item\n";
+ }
+
+
+ %countrycodes = User->country_codes;
+ $countrycodes = "";
+ foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } keys %countrycodes) {
+ $countrycodes .= ($myconfig->{countrycode} eq $key) ? "<option selected value=$key>$countrycodes{$key}" : "<option value=$key>$countrycodes{$key}";
+ }
+ $countrycodes = qq|<option value="">American English\n$countrycodes|;
+
+ # is there a templates basedir
+ if (! -d "$templates") {
+ $form->error($locale->text('Directory').": $templates ".$locale->text('does not exist'));
+ }
+
+ opendir TEMPLATEDIR, "$templates/." or $form->error("$templates : $!");
+ @all = grep !/^\.\.?$/, readdir TEMPLATEDIR;
+ closedir TEMPLATEDIR;
+
+ @allhtml = sort grep /\.html/, @all;
+ @alldir = grep !/\.(html|tex)$/, @all;
+
+ @allhtml = reverse grep !/Default/, @allhtml;
+ push @allhtml, 'Default';
+ @allhtml = reverse @allhtml;
+
+ foreach $item (@alldir) {
+ if ($item eq $myconfig->{templates}) {
+ $usetemplates .= qq|<option selected>$item\n|;
+ } else {
+ $usetemplates .= qq|<option>$item\n|;
+ }
+ }
+
+ $lastitem = $allhtml[0];
+ $lastitem =~ s/-.*//g;
+ $mastertemplates = qq|<option>$lastitem\n|;
+ foreach $item (@allhtml) {
+ $item =~ s/-.*//g;
+
+ if ($item ne $lastitem) {
+ $mastertemplates .= qq|<option>$item\n|;
+ $lastitem = $item;
+ }
+ }
+
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr class=listheading><th colspan=2>$form->{title}</th></tr>
+ <tr size=5></tr>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Login').qq|</th>
+ <td><input name=login value="$myconfig->{login}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input type=password name=password size=8 value=$myconfig->{password}></td>
+ <input type=hidden name=old_password value=$myconfig->{password}>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Name').qq|</th>
+ <td><input name=name size=15 value="$myconfig->{name}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('E-mail').qq|</th>
+ <td><input name=email size=30 value="$myconfig->{email}"></td>
+ </tr>
+ <tr valign=top>
+ <th align=right>|.$locale->text('Signature').qq|</th>
+ <td><textarea name=signature rows=3 cols=35>$myconfig->{signature}</textarea></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Phone').qq|</th>
+ <td><input name=tel size=14 value="$myconfig->{tel}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Fax').qq|</th>
+ <td><input name=fax size=14 value="$myconfig->{fax}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Company').qq|</th>
+ <td><input name=company size=35 value="$myconfig->{company}"></td>
+ </tr>
+ <tr valign=top>
+ <th align=right>|.$locale->text('Address').qq|</th>
+ <td><textarea name=address rows=4 cols=35>$myconfig->{address}</textarea></td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Date Format').qq|</th>
+ <td><select name=dateformat>$dateformat</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Number Format').qq|</th>
+ <td><select name=numberformat>$numberformat</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Dropdown Limit').qq|</th>
+ <td><input name=vclimit value="$myconfig->{vclimit}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Language').qq|</th>
+ <td><select name=countrycode>$countrycodes</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Character Set').qq|</th>
+ <td><input name=charset value="$myconfig->{charset}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Stylesheet').qq|</th>
+ <td><input name=userstylesheet value="$myconfig->{stylesheet}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Printer').qq|</th>
+ <td><input name=printer size=20 value="$myconfig->{printer}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Ship via').qq|</th>
+ <td><input name=shippingpoint size=15 value="$myconfig->{shippingpoint}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Use Templates').qq|</th>
+ <td><select name=usetemplates>$usetemplates</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('New Templates').qq|</th>
+ <td><input name=newtemplates></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Setup Templates').qq|</th>
+ <td><select name=mastertemplates>$mastertemplates</select></td>
+ </tr>
+ <input type=hidden name=templates value=$myconfig->{templates}>
+ </table>
+ </td>
+ </tr>
+ <tr class=listheading>
+ <th colspan=2>|.$locale->text('Database').qq|</th>
+ </tr>|;
+
+ # list section for database drivers
+ foreach $item (User->dbdrivers) {
+
+ print qq|
+ <tr>
+ <td colspan=2>
+ <table>
+ <tr>|;
+
+ $checked = "";
+ if ($myconfig->{dbdriver} eq $item) {
+ map { $form->{"${item}_$_"} = $myconfig->{$_} } qw(dbhost dbport dbuser dbpasswd dbname sid);
+ $checked = "checked";
+ }
+
+ print qq|
+ <th align=right>|.$locale->text('Driver').qq|</th>
+ <td><input name=dbdriver type=radio class=radio value=$item $checked>&nbsp;$item</td>
+ <th align=right>|.$locale->text('Host').qq|</th>
+ <td><input name="${item}_dbhost" value=$form->{"${item}_dbhost"}></td>
+ </tr>
+ <tr>|;
+
+ if ($item eq 'Pg') {
+ print qq|
+ <th align=right>|.$locale->text('Dataset').qq|</th>
+ <td><input name=Pg_dbname size=10 value=$form->{Pg_dbname}></td>
+ <th align=right>|.$locale->text('Port').qq|</th>
+ <td><input name=Pg_dbport size=4 value=$form->{Pg_dbport}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('User').qq|</th>
+ <td><input name="${item}_dbuser" size=10 value=$form->{"${item}_dbuser"}></td>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input name="${item}_dbpasswd" type=password size=10 value=$form->{"${item}_dbpasswd"}></td>
+ </tr>|;
+
+ }
+
+ if ($item eq 'Oracle') {
+ print qq|
+ <th align=right>SID</th>
+ <td><input name=Oracle_sid value=$form->{Oracle_sid}></td>
+ <th align=right>|.$locale->text('Port').qq|</th>
+ <td><input name=Oracle_dbport size=4 value=$form->{Oracle_dbport}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Dataset').qq|</th>
+ <td><input name="${item}_dbuser" size=10 value=$form->{"${item}_dbuser"}></td>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input name="${item}_dbpasswd" type=password size=10 value=$form->{"${item}_dbpasswd"}></td>
+
+ </tr>|;
+ }
+
+
+ print qq|
+ <input type=hidden name=old_dbpasswd value=$myconfig->{dbpasswd}>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=2 noshade></td>
+ </tr>
+|;
+
+ }
+
+
+ # access control
+ open(FH, $menufile) or $form->error("$menufile : $!");
+ # scan for first menu level
+ @a = <FH>;
+ close(FH);
+
+ if (open(FH, "custom_$menufile")) {
+ push @a, <FH>;
+ }
+ close(FH);
+
+ foreach $item (@a) {
+ next unless $item =~ /\[/;
+ next if $item =~ /\#/;
+
+ $item =~ s/(\[|\])//g;
+ chop $item;
+
+ if ($item =~ /--/) {
+ ($level, $menuitem) = split /--/, $item, 2;
+ } else {
+ $level = $item;
+ $menuitem = $item;
+ push @acsorder, $item;
+ }
+
+ push @{ $acs{$level} }, $menuitem;
+
+ }
+
+ $admincheck = "checked" if $myconfig->{admin};
+
+ print qq|
+ <tr class=listheading>
+ <th colspan=2>|.$locale->text('Access Control').qq|</th>
+ </tr>
+ <tr>
+ <td><input name=admin type=checkbox class=checkbox value=1 $admincheck>&nbsp;<b>|.$locale->text('Administrator').qq|</b></td>
+ </tr>
+|;
+
+ foreach $item (split /;/, $myconfig->{acs}) {
+ ($key, $value) = split /--/, $item, 2;
+ $excl{$key}{$value} = 1;
+ }
+
+ foreach $key (@acsorder) {
+
+ $checked = "checked";
+ if ($form->{login}) {
+ $checked = ($excl{$key}{$key}) ? "" : "checked";
+ }
+
+ # can't have variable names with spaces
+ # the 1 is for apache 2
+ $item = $form->escape("${key}--$key", 1);
+
+ $acsheading = $key;
+ $acsheading =~ s/ /&nbsp;/g;
+
+ $acsheading = qq|
+ <th align=left><input name="$item" class=checkbox type=checkbox value=1 $checked>&nbsp;$acsheading</th>\n|;
+ $menuitems .= "$item;";
+ $acsdata = "
+ <td>";
+
+ foreach $item (@{ $acs{$key} }) {
+ next if ($key eq $item);
+
+ $checked = "checked";
+ if ($form->{login}) {
+ $checked = ($excl{$key}{$item}) ? "" : "checked";
+ }
+
+ $acsitem = $form->escape("${key}--$item", 1);
+
+ $acsdata .= qq|
+ <br><input name="$acsitem" class=checkbox type=checkbox value=1 $checked>&nbsp;$item|;
+ $menuitems .= "$acsitem;";
+ }
+
+ $acsdata .= "
+ </td>";
+
+ print qq|
+ <tr valign=top>$acsheading $acsdata
+ </tr>
+|;
+ }
+
+ print qq|<input type=hidden name=acs value="$menuitems">
+
+ <tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub save {
+
+ # no driver checked
+ $form->error($locale->text('Database Driver not checked!')) unless $form->{dbdriver};
+
+ # no spaces allowed in login name
+ ($form->{login}) = split / /, $form->{login};
+
+ # check for duplicates
+ if (!$form->{edit}) {
+ $temp = new User "$memberfile", "$form->{login}";
+
+ if ($temp->{login}) {
+ $form->error("$form->{login} ".$locale->text('is already a member!'));
+ }
+ }
+
+ # does stylesheet exist
+ if ($form->{userstylesheet}) {
+ $form->error($locale->text('Stylesheet').": css/$form->{userstylesheet} ".$locale->text('does not exist')) unless (-f "css/$form->{userstylesheet}");
+ }
+
+ # no spaces allowed in directories
+ ($form->{newtemplates}) = split / /, $form->{newtemplates};
+
+ if ($form->{newtemplates}) {
+ $form->{templates} = $form->{newtemplates};
+ } else {
+ $form->{templates} = ($form->{usetemplates}) ? $form->{usetemplates} : $form->{login};
+ }
+
+
+ # is there a basedir
+ if (! -d "$templates") {
+ $form->error($locale->text('Directory').": $templates ".$locale->text('does not exist'));
+ }
+
+ # add base directory to $form->{templates}
+ $form->{templates} = "$templates/$form->{templates}";
+
+
+ $myconfig = new User "$memberfile", "$form->{login}";
+
+ # redo acs variable and delete all the acs codes
+ @acs = split /;/, $form->{acs};
+
+ $form->{acs} = "";
+ foreach $item (@acs) {
+ $item = $form->escape($item, 1);
+
+ if (!$form->{$item}) {
+ $form->{acs} .= $form->unescape($form->unescape($item)).";";
+ }
+ delete $form->{$item};
+ }
+
+ # check which database was filled in
+ if ($form->{dbdriver} eq 'Oracle') {
+ $form->{sid} = $form->{Oracle_sid}, ;
+ $form->{dbhost} = $form->{Oracle_dbhost}, ;
+ $form->{dbport} = $form->{Oracle_dbport};
+ $form->{dbpasswd} = $form->{Oracle_dbpasswd};
+ $form->{dbuser} = $form->{Oracle_dbuser};
+ $form->{dbname} = $form->{Oracle_dbuser};
+
+ $form->isblank("dbhost", $locale->text('Hostname missing!'));
+ $form->isblank("dbport", $locale->text('Port missing!'));
+ $form->isblank("dbuser", $locale->text('Dataset missing!'));
+ }
+ if ($form->{dbdriver} eq 'Pg') {
+ $form->{dbhost} = $form->{Pg_dbhost};
+ $form->{dbport} = $form->{Pg_dbport};
+ $form->{dbpasswd} = $form->{Pg_dbpasswd};
+ $form->{dbuser} = $form->{Pg_dbuser};
+ $form->{dbname} = $form->{Pg_dbname};
+
+ $form->isblank("dbname", $locale->text('Dataset missing!'));
+ $form->isblank("dbuser", $locale->text('Database User missing!'));
+ }
+
+ # set admin
+ $form->{admin} = "" unless $form->{admin};
+
+ foreach $item (keys %{$form}) {
+ $myconfig->{$item} = $form->{$item};
+ }
+
+ delete $myconfig->{stylesheet};
+ if ($form->{userstylesheet}) {
+ $myconfig->{stylesheet} = $form->{userstylesheet};
+ }
+
+ $myconfig->save_member($memberfile, $userspath);
+
+ # create user template directory and copy master files
+ if (! -d "$form->{templates}") {
+ umask(002);
+
+ if (mkdir "$form->{templates}", oct("771")) {
+
+ umask(007);
+
+ # copy templates to the directory
+ opendir TEMPLATEDIR, "$templates/." or $form-error("$templates : $!");
+ @templates = grep /$form->{mastertemplates}.*?\.(html|tex)$/, readdir TEMPLATEDIR;
+ closedir TEMPLATEDIR;
+
+ foreach $file (@templates) {
+ open(TEMP, "$templates/$file") or $form->error("$templates/$file : $!");
+
+ $file =~ s/$form->{mastertemplates}-//;
+ open(NEW, ">$form->{templates}/$file") or $form->error("$form->{templates}/$file : $!");
+
+ while ($line = <TEMP>) {
+ print NEW $line;
+ }
+ close(TEMP);
+ close(NEW);
+ }
+ } else {
+ $form->error("$!: $form->{templates}");
+ }
+ }
+
+ $form->redirect($locale->text('User saved!'));
+
+}
+
+
+sub delete {
+
+ $form->{templates} = ($form->{templates}) ? "$templates/$form->{templates}" : "$templates/$form->{login}";
+
+ $form->error("$memberfile : ".$locale->text('locked!')) if (-f ${memberfile}.LCK);
+ open(FH, ">${memberfile}.LCK") or $form->error("${memberfile}.LCK : $!");
+ close(FH);
+
+ open(CONF, "+<$memberfile") or $form->error("$memberfile : $!");
+
+ @config = <CONF>;
+
+ seek(CONF, 0, 0);
+ truncate(CONF, 0);
+
+ while ($line = shift @config) {
+
+ if ($line =~ /^\[/) {
+ last if ($line =~ /\[$form->{login}\]/);
+ $login = &login_name($line);
+ }
+
+ if ($line =~ /^templates=/) {
+ $user{$login} = &get_value($line);
+ }
+
+ print CONF $line;
+ }
+
+ # remove everything up to next login or EOF
+ # and save template variable
+ while ($line = shift @config) {
+ if ($line =~ /^templates=/) {
+ $templatedir = &get_value($line);
+ }
+ last if ($line =~ /^\[/);
+ }
+
+ # this one is either the next login or EOF
+ print CONF $line;
+
+ $login = &login_name($line);
+
+
+ while ($line = shift @config) {
+ if ($line =~ /^\[/) {
+ $login = &login_name($line);
+ }
+
+ if ($line =~ /^templates=/) {
+ $user{$login} = &get_value($line);
+ }
+
+ print CONF $line;
+ }
+
+ close(CONF);
+ unlink "${memberfile}.LCK";
+
+ # scan %user for $templatedir
+ foreach $login (keys %user) {
+ last if ($found = ($templatedir eq $user{$login}));
+ }
+
+ # if found keep directory otherwise delete
+ if (!$found) {
+ # delete it if there is a template directory
+ $dir = "$form->{templates}";
+ if (-d "$dir") {
+ unlink <$dir/*.html>;
+ unlink <$dir/*.tex>;
+ rmdir "$dir";
+ }
+ }
+
+ # delete config file for user
+ unlink "$userspath/$form->{login}.conf";
+
+ $form->redirect($locale->text('User deleted!'));
+
+}
+
+
+sub login_name {
+ my $login = shift;
+
+ $login =~ s/\[\]//g;
+ return ($login) ? $login : undef;
+
+}
+
+
+
+sub get_value {
+ my $line = shift;
+
+ my ($null, $value) = split(/=/, $line, 2);
+
+ # remove comments
+ $value =~ s/\s#.*//g;
+
+ # remove any trailing whitespace
+ $value =~ s/^\s*(.*?)\s*$/$1/;
+
+ $value;
+}
+
+
+
+sub change_admin_password {
+
+ $form->{title} = qq|SQL-Ledger |.$locale->text('Accounting')." ".$locale->text('Administration')." / ".$locale->text('Change Admin Password');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<h2>|.$locale->text('Change Admin Password').qq|</h2>
+
+<form method=post action=$form->{script}>
+
+<b>|.$locale->text('Password').qq|</b> <input type=password name=password size=8>
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+
+<p>
+<input type=submit class=submit name=action value="|.$locale->text('Change Password').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub change_password {
+
+ $root->{password} = $form->{password};
+
+ $root->{'root login'} = 1;
+ $root->save_member($memberfile);
+
+ $form->{callback} = "$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$root->{password}";
+
+ $form->redirect($locale->text('Password changed!'));
+
+}
+
+
+sub check_password {
+
+ $root = new User "$memberfile", $form->{root};
+
+ if ($root->{password}) {
+ if ($root->{password} ne $form->{rpw}) {
+ $form->error($locale->text('Incorrect Password!'));
+ }
+ }
+
+}
+
+
+sub pg_database_administration {
+
+ $form->{dbdriver} = 'Pg';
+ &dbselect_source;
+
+}
+
+
+sub oracle_database_administration {
+
+ $form->{dbdriver} = 'Oracle';
+ &dbselect_source;
+
+}
+
+
+sub dbdriver_defaults {
+
+ # load some defaults for the selected driver
+ %driverdefaults = ( 'Pg' => { dbport => '',
+ dbuser => 'sql-ledger',
+ dbdefault => 'template1',
+ dbhost => '',
+ connectstring => $locale->text('Connect to')
+ },
+ 'Oracle' => { dbport => '1521',
+ dbuser => 'oralin',
+ dbdefault => $sid,
+ dbhost => `hostname`,
+ connectstring => 'SID'
+ }
+ );
+
+ map { $form->{$_} = $driverdefaults{$form->{dbdriver}}{$_} } keys %{ $driverdefaults{Pg} };
+
+}
+
+
+sub dbselect_source {
+
+ &dbdriver_defaults;
+
+ $msg{Pg} = $locale->text('Leave host and port field empty unless you want to make a remote connection.');
+ $msg{Oracle} = $locale->text('You must enter a host and port for local and remote connections!');
+
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." / ".$locale->text('Database Administration');
+
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+
+<form method=post action=$form->{script}>
+
+<table>
+<tr><td>
+
+<table>
+
+ <tr class=listheading>
+ <th colspan=4>|.$locale->text('Database').qq|</th>
+ </tr>
+
+<input type=hidden name=dbdriver value=$form->{dbdriver}>
+
+ <tr><td>
+ <table>
+
+ <tr>
+
+ <th align=right>|.$locale->text('Host').qq|</th>
+ <td><input name=dbhost size=25 value=$form->{dbhost}></td>
+ <th align=right>|.$locale->text('Port').qq|</th>
+ <td><input name=dbport size=5 value=$form->{dbport}></td>
+
+ </tr>
+
+ <tr>
+
+ <th align=right>|.$locale->text('User').qq|</th>
+ <td><input name=dbuser size=10 value=$form->{dbuser}></td>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input type=password name=dbpasswd size=10></td>
+
+ </tr>
+
+ <tr>
+
+ <th align=right>$form->{connectstring}</th>
+ <td colspan=3><input name=dbdefault size=10 value=$form->{dbdefault}></td>
+
+ </tr>
+
+</table>
+
+</td></tr>
+</table>
+
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+
+<hr size=3 noshade>
+<br>
+
+<input type=submit class=submit name=action value="|.$locale->text('Create Dataset').qq|">
+<input type=submit class=submit name=action value="|.$locale->text('Update Dataset').qq|">
+<input type=submit class=submit name=action value="|.$locale->text('Delete Dataset').qq|">
+
+</form>
+
+</td></tr>
+</table>
+
+<p>|.$locale->text('This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!')
+
+.qq|
+<br>$msg{$form->{dbdriver}}
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub continue {
+
+ &{ $form->{nextsub} };
+
+}
+
+
+sub update_dataset {
+
+ %needsupdate = User->dbneedsupdate(\%$form);
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Database Administration')." / ".$locale->text('Update Dataset');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+|;
+
+
+ foreach $key (sort keys %needsupdate) {
+ if ($needsupdate{$key} lt $form->{dbversion}) {
+ $upd .= qq|<br><input name="db$key" type=checkbox value=1 checked> $key\n|;
+ $form->{dbupdate} .= "db$key ";
+ }
+ }
+
+ chop $form->{dbupdate};
+
+
+ if ($form->{dbupdate}) {
+
+ print qq|
+<table>
+<form method=post action=$form->{script}>
+
+<input type=hidden name=dbdriver value=$form->{dbdriver}>
+<input type=hidden name=dbhost value=$form->{dbhost}>
+<input type=hidden name=dbport value=$form->{dbport}>
+<input type=hidden name=dbuser value=$form->{dbuser}>
+<input type=hidden name=dbpasswd value=$form->{dbpasswd}>
+<input type=hidden name=dbdefault value=$form->{dbdefault}>
+
+<tr class=listheading>
+ <th>|.$locale->text('The following Datasets need to be updated').qq|</th>
+</tr>
+<tr>
+<td>
+
+$upd
+
+</td></tr>
+<tr><td>
+
+<input name=dbupdate type=hidden value="$form->{dbupdate}">
+
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+
+<input type=hidden name=nextsub value=dbupdate>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+</td></tr>
+</table>
+</form>
+|;
+
+ } else {
+
+ print $locale->text('All Datasets up to date!');
+
+ }
+
+ print qq|
+
+</body>
+</html>
+|;
+
+}
+
+
+sub dbupdate {
+
+ User->dbupdate(\%$form);
+
+ $form->redirect($locale->text('Dataset updated!'));
+
+}
+
+
+sub create_dataset {
+
+ foreach $item (sort User->dbsources(\%$form)) {
+ $dbsources .= "[$item] ";
+ }
+
+ opendir SQLDIR, "sql/." or $form-error($!);
+ foreach $item (sort grep /-chart\.sql/, readdir SQLDIR) {
+ next if ($item eq 'Default-chart.sql');
+ $item =~ s/-chart\.sql//;
+ push @charts, qq| <input name=chart class=radio type=radio value="$item">&nbsp;$item|;
+ }
+ closedir SQLDIR;
+
+ # add Default at beginning
+ @charts = (qq|<input name=chart class=radio type=radio value="Default" checked>&nbsp;Default|, @charts);
+
+ $selectencoding = qq|<option>
+ <option value=SQL_ASCII>ASCII
+ <option value=EUC_JP>Japanese Extended UNIX Code
+ <option value=EUC_CN>Chinese Extended UNIX Code
+ <option value=EUC_KR>Korean Extended UNIX Code
+ <option value=EUC_TW>Taiwan Extended UNIX Code
+ <option value=UNICODE>UTF-8 Unicode
+ <option value=MULE_INTERNAL>Mule internal type
+ <option value=LATIN1>ISO 8859-1
+ <option value=LATIN2>ISO 8859-2
+ <option value=LATIN3>ISO 8859-3
+ <option value=LATIN4>ISO 8859-4
+ <option value=LATIN5>ISO 8859-5
+ <option value=KOI8>KOI8-R
+ <option value=WIN>Windows CP1251
+ <option value=ALT>Windows CP866
+ |;
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Database Administration')." / ".$locale->text('Create Dataset');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+
+<form method=post action=$form->{script}>
+
+<table>
+ <tr class=listheading>
+ <th colspan=2>&nbsp;</th>
+ </tr>
+
+ <tr>
+
+ <th align=right nowrap>|.$locale->text('Existing Datasets').qq|</th>
+ <td>$dbsources</td>
+
+ </tr>
+
+ <tr>
+
+ <th align=right nowrap>|.$locale->text('Create Dataset').qq|</th>
+ <td><input name=db></td>
+
+ </tr>
+
+ <tr>
+
+ <th align=right nowrap>|.$locale->text('Multibyte Encoding').qq|</th>
+ <td><select name=encoding>$selectencoding</select></td>
+
+ </tr>
+
+ <tr>
+
+ <th align=right>|.$locale->text('Create Chart of Accounts').qq|</th>
+ <td>@charts</td>
+
+ </tr>
+
+ <tr><td colspan=2>
+<hr size=3 noshade>
+<br>
+<input type=hidden name=dbdriver value=$form->{dbdriver}>
+<input type=hidden name=dbuser value=$form->{dbuser}>
+<input type=hidden name=dbhost value=$form->{dbhost}>
+<input type=hidden name=dbport value=$form->{dbport}>
+<input type=hidden name=dbpasswd value=$form->{dbpasswd}>
+<input type=hidden name=dbdefault value=$form->{dbdefault}>
+
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=rpw value=$form->{rpw}>
+
+<input type=hidden name=nextsub value=dbcreate>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+ </td></tr>
+</table>
+
+</form>
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub dbcreate {
+
+ $form->isblank("db", $locale->text('Dataset missing!'));
+
+ User->dbcreate(\%$form);
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Database Administration')." / ".$locale->text('Create Dataset');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+
+<form method=post action=$form->{script}>|
+
+.$locale->text('Dataset')." $form->{db} ".$locale->text('successfully created!')
+
+.qq|
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value="$form->{path}">
+<input type=hidden name=rpw value="$form->{rpw}">
+
+<input type=hidden name=nextsub value=list_users>
+
+<p><input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub delete_dataset {
+
+ if (@dbsources = User->dbsources_unused(\%$form, $memberfile)) {
+ foreach $item (sort @dbsources) {
+ $dbsources .= qq|<input name=db class=radio type=radio value=$item>&nbsp;$item\n<br>|;
+ }
+ } else {
+ $form->error($locale->text('Nothing to delete!'));
+ }
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Database Administration')." / ".$locale->text('Delete Dataset');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+
+<form method=post action=$form->{script}>
+
+<table>
+ <tr class=listheading>
+ <th>|.$locale->text('The following Datasets are not in use and can be deleted').qq|</th>
+ </tr>
+
+ <tr>
+ <td>
+ $dbsources
+ </td>
+ </tr>
+
+ <tr><td>
+
+<hr size=3 noshade>
+<br>
+<input type=hidden name=dbdriver value=$form->{dbdriver}>
+<input type=hidden name=dbuser value=$form->{dbuser}>
+<input type=hidden name=dbhost value=$form->{dbhost}>
+<input type=hidden name=dbport value=$form->{dbport}>
+<input type=hidden name=dbpasswd value=$form->{dbpasswd}>
+<input type=hidden name=dbdefault value=$form->{dbdefault}>
+
+<input name=callback type=hidden value="$form->{script}?action=list_users&path=$form->{path}&root=$form->{root}&rpw=$form->{rpw}">
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value="$form->{path}">
+<input type=hidden name=rpw value="$form->{rpw}">
+
+<input type=hidden name=nextsub value=dbdelete>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+ </td></tr>
+</table>
+
+</form>
+
+<p>|.$locale->text('Select a Dataset to delete and press "Continue"')
+
+.qq|
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub dbdelete {
+
+ if (!$form->{db}) {
+ $form->error($locale->text('No Dataset selected!'));
+ }
+
+ User->dbdelete(\%$form);
+
+ $form->{title} = "SQL-Ledger ".$locale->text('Accounting')." ".$locale->text('Database Administration')." / ".$locale->text('Delete Dataset');
+
+ $form->header;
+
+ print qq|
+<body class=admin>
+
+
+<center>
+<h2>$form->{title}</h2>
+
+<form method=post action=$form->{script}>
+
+$form->{db} |.$locale->text('successfully deleted!')
+
+.qq|
+
+<input type=hidden name=root value="$form->{root}">
+<input type=hidden name=path value="$form->{path}">
+<input type=hidden name=rpw value="$form->{rpw}">
+
+<input type=hidden name=nextsub value=list_users>
+
+<p><input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+
+</body>
+</html>
+|;
+
+}
+
diff --git a/sql-ledger/bin/mozilla/am.pl b/sql-ledger/bin/mozilla/am.pl
new file mode 100644
index 000000000..7e36cfdc9
--- /dev/null
+++ b/sql-ledger/bin/mozilla/am.pl
@@ -0,0 +1,1051 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# administration
+#
+#======================================================================
+
+
+use SL::AM;
+use SL::CA;
+use SL::Form;
+use SL::User;
+
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = "Add";
+ $form->{charttype} = "A";
+
+ $form->{callback} = "$form->{script}?action=list&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub edit {
+ $form->{title} = "Edit";
+
+ # if it is a template
+ if ($form->{file}) {
+ $form->{type} = "template";
+ &edit_template;
+ exit;
+ }
+
+ AM->get_account(\%myconfig, \%$form);
+
+ foreach my $item (split(/:/, $form->{link})) {
+ $form->{$item} = "checked";
+ }
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub form_header {
+
+ $form->{title} = $locale->text("$form->{title} Account");
+
+ $checked{$form->{charttype}} = "checked";
+ $checked{"$form->{category}_"} = "checked";
+ $checked{CT_tax} = ($form->{CT_tax}) ? "" : "checked";
+
+ $form->{description} =~ s/"/&quot;/g;
+
+# this is for our parser only!
+# type=submit $locale->text('Add Account')
+# type=submit $locale->text('Edit Account')
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=type value=account>
+
+<input type=hidden name=inventory_accno_id value=$form->{inventory_accno_id}>
+<input type=hidden name=income_accno_id value=$form->{income_accno_id}>
+<input type=hidden name=expense_accno_id value=$form->{expense_accno_id}>
+<input type=hidden name=fxgain_accno_id values=$form->{fxgain_accno_id}>
+<input type=hidden name=fxloss_accno_id values=$form->{fxloss_accno_id}>
+
+<input type=hidden name=amount value=$form->{amount}>
+
+<table border=0 width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Account Number').qq|</th>
+ <td><input name=accno size=20 value=$form->{accno}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td><input name=description size=40 value="$form->{description}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Account Type').qq|</th>
+ <td>
+ <table>
+ <tr valign=top>
+ <td><input name=category type=radio class=radio value=A $checked{A_}>&nbsp;|.$locale->text('Asset').qq|\n<br>
+ <input name=category type=radio class=radio value=L $checked{L_}>&nbsp;|.$locale->text('Liability').qq|\n<br>
+ <input name=category type=radio class=radio value=Q $checked{Q_}>&nbsp;|.$locale->text('Equity').qq|\n<br>
+ <input name=category type=radio class=radio value=I $checked{I_}>&nbsp;|.$locale->text('Income').qq|\n<br>
+ <input name=category type=radio class=radio value=E $checked{E_}>&nbsp;|.$locale->text('Expense')
+ .qq|</td>
+ <td>
+ <input name=charttype type=radio class=radio value="H" $checked{H}>&nbsp;|.$locale->text('Heading').qq|<br>
+ <input name=charttype type=radio class=radio value="A" $checked{A}>&nbsp;|.$locale->text('Account')
+ .qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+
+if ($form->{charttype} eq "A") {
+ print qq|
+ <tr>
+ <td colspan=2>
+ <table>
+ <tr>
+ <th align=left>|.$locale->text('Is this a summary account to record').qq|</th>
+ <td>
+ <input name=AR type=checkbox class=checkbox value=AR $form->{AR}>&nbsp;|.$locale->text('AR')
+ .qq|&nbsp;<input name=AP type=checkbox class=checkbox value=AP $form->{AP}>&nbsp;|.$locale->text('AP')
+ .qq|&nbsp;<input name=IC type=checkbox class=checkbox value=IC $form->{IC}>&nbsp;|.$locale->text('Inventory')
+ .qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=2>|.$locale->text('Include in drop-down menus').qq|</th>
+ </tr>
+ <tr valign=top>
+ <td colspan=2>
+ <table width=100%>
+ <tr>
+ <th align=left>|.$locale->text('Receivables').qq|</th>
+ <th align=left>|.$locale->text('Payables').qq|</th>
+ <th align=left>|.$locale->text('Parts Inventory').qq|</th>
+ <th align=left>|.$locale->text('Service Items').qq|</th>
+ </tr>
+ <tr>
+ <td>
+ <input name=AR_amount type=checkbox class=checkbox value=AR_amount $form->{AR_amount}>&nbsp;|.$locale->text('Income').qq|\n<br>
+ <input name=AR_paid type=checkbox class=checkbox value=AR_paid $form->{AR_paid}>&nbsp;|.$locale->text('Payment').qq|\n<br>
+ <input name=AR_tax type=checkbox class=checkbox value=AR_tax $form->{AR_tax}>&nbsp;|.$locale->text('Tax')
+ .qq|
+ </td>
+ <td>
+ <input name=AP_amount type=checkbox class=checkbox value=AP_amount $form->{AP_amount}>&nbsp;|.$locale->text('Expense/Asset').qq|\n<br>
+ <input name=AP_paid type=checkbox class=checkbox value=AP_paid $form->{AP_paid}>&nbsp;|.$locale->text('Payment').qq|\n<br>
+ <input name=AP_tax type=checkbox class=checkbox value=AP_tax $form->{AP_tax}>&nbsp;|.$locale->text('Tax')
+ .qq|
+ </td>
+ <td>
+ <input name=IC_sale type=checkbox class=checkbox value=IC_sale $form->{IC_sale}>&nbsp;|.$locale->text('Sales').qq|\n<br>
+ <input name=IC_cogs type=checkbox class=checkbox value=IC_cogs $form->{IC_cogs}>&nbsp;|.$locale->text('COGS').qq|\n<br>
+ <input name=IC_taxpart type=checkbox class=checkbox value=IC_taxpart $form->{IC_taxpart}>&nbsp;|.$locale->text('Tax')
+ .qq|
+ </td>
+ <td>
+ <input name=IC_income type=checkbox class=checkbox value=IC_income $form->{IC_income}>&nbsp;|.$locale->text('Income').qq|\n<br>
+ <input name=IC_expense type=checkbox class=checkbox value=IC_expense $form->{IC_expense}>&nbsp;|.$locale->text('Expense').qq|\n<br>
+ <input name=IC_taxservice type=checkbox class=checkbox value=IC_taxservice $form->{IC_taxservice}>&nbsp;|.$locale->text('Tax')
+ .qq|
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <table>
+ <tr>
+ <th align=left>|.$locale->text('Include this account on the customer/vendor forms to flag customer/vendor as taxable?').qq|</th>
+ <td>
+ <input name=CT_tax type=radio class=radio value=CT_tax $form->{CT_tax}>&nbsp;|.$locale->text('Yes').qq|&nbsp;
+ <input name=CT_tax type=radio class=radio value="" $checked{CT_tax}>&nbsp;|.$locale->text('No')
+ .qq|
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+}
+
+print qq|
+ <tr>
+ <th align=right>|.$locale->text('GIFI').qq|</th>
+ <td><input name=gifi_accno size=9 value=$form->{gifi_accno}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub form_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+|;
+
+ if ($form->{id}) {
+ print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub save { &{ "save_$form->{type}" } };
+
+sub save_account {
+
+ $form->isblank("accno", $locale->text('Account Number missing!'));
+ $form->isblank("category", $locale->text('Account Type missing!'));
+
+ $form->redirect($locale->text('Account saved!')) if (AM->save_account(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot save account!'));
+
+}
+
+
+sub list {
+
+ CA->all_accounts(\%myconfig, \%$form);
+
+ $form->{title} = $locale->text('Chart of Accounts');
+
+ # construct callback
+ $callback = "$form->{script}?action=list&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ @column_index = qw(accno gifi_accno description debit credit link);
+
+ $column_header{accno} = qq|<th class=listheading>|.$locale->text('Account').qq|</a></th>|;
+ $column_header{gifi_accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</a></th>|;
+ $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</a></th>|;
+ $column_header{debit} = qq|<th class=listheading>|.$locale->text('Debit').qq|</a></th>|;
+ $column_header{credit} = qq|<th class=listheading>|.$locale->text('Credit').qq|</a></th>|;
+ $column_header{link} = qq|<th class=listheading>|.$locale->text('Link').qq|</a></th>|;
+
+
+ $form->header;
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<table border=0 width=100%>
+ <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
+ <tr height=5></tr>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+</tr>
+|;
+
+ # escape callback
+ $callback = $form->escape($callback);
+
+ foreach $ca (@{ $form->{CA} }) {
+
+ $ca->{debit} = "&nbsp;";
+ $ca->{credit} = "&nbsp;";
+
+ # needed if we can delete an account
+ $amount = 0;
+
+ if ($ca->{amount} > 0) {
+ $amount = $ca->{amount};
+ $ca->{credit} = $form->format_amount(\%myconfig, $ca->{amount}, 2, "&nbsp;");
+ }
+ if ($ca->{amount} < 0) {
+ $amount = -$ca->{amount};
+ $ca->{debit} = $form->format_amount(\%myconfig, -$ca->{amount}, 2, "&nbsp;");
+ }
+
+ $ca->{link} =~ s/:/<br>/og;
+
+ if ($ca->{charttype} eq "H") {
+ print qq|<tr class=listheading>|;
+
+ $column_data{accno} = qq|<th><a class=listheading href=$form->{script}?action=edit&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</a></th>|;
+ $column_data{gifi_accno} = qq|<th><a class=listheading href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{gifi_accno}</a>&nbsp;</th>|;
+ $column_data{description} = qq|<th class=listheading>$ca->{description}&nbsp;</th>|;
+ $column_data{debit} = qq|<th>&nbsp;</th>|;
+ $column_data{credit} = qq| <th>&nbsp;</th>|;
+ $column_data{link} = qq|<th>&nbsp;</th>|;
+
+ } else {
+ $i++; $i %= 2;
+ print qq|
+<tr valign=top class=listrow$i>|;
+ $column_data{accno} = qq|<td><a href=$form->{script}?action=edit&id=$ca->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback&amount=$amount>$ca->{accno}</a></td>|;
+ $column_data{gifi_accno} = qq|<td><a href=$form->{script}?action=edit_gifi&accno=$ca->{gifi_accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback&amount=$amount>$ca->{gifi_accno}</a>&nbsp;</td>|;
+ $column_data{description} = qq|<td>$ca->{description}&nbsp;</td>|;
+ $column_data{debit} = qq|<td align=right>$ca->{debit}</td>|;
+ $column_data{credit} = qq|<td align=right>$ca->{credit}</td>|;
+ $column_data{link} = qq|<td>$ca->{link}&nbsp;</td>|;
+
+ }
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print "</tr>\n";
+ }
+
+ print qq|
+ <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub delete { &{ "delete_$form->{type}" } };
+
+sub delete_account {
+
+ $form->{title} = $locale->text('Delete Account');
+
+ if ($form->{amount} != 0) {
+ $form->error($locale->text('Transactions exist; cannot delete account!'));
+ }
+
+ foreach $id (qw(inventory_accno_id income_accno_id expense_accno_id fxgain_accno_id fxloss_accno_id)) {
+ if ($form->{id} == $form->{$id}) {
+ $form->error($locale->text('Cannot delete default account!'));
+ }
+ }
+
+ $form->redirect($locale->text('Account deleted!')) if (AM->delete_account(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete account!'));
+
+}
+
+
+sub list_gifi {
+
+ @{ $form->{fields} } = (accno, description);
+ $form->{table} = "gifi";
+ $form->{sortorder} = "accno";
+
+ AM->gifi_accounts(\%myconfig, \%$form);
+
+ $form->{title} = $locale->text('GIFI');
+
+ # construct callback
+ $callback = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ @column_index = qw(accno description);
+
+ $column_header{accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</a></th>|;
+ $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</a></th>|;
+
+
+ $form->header;
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<table border=0 width=100%>
+ <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+</tr>
+|;
+
+ # escape callback
+ $callback = $form->escape($callback);
+
+ foreach $ca (@{ $form->{ALL} }) {
+
+ $i++; $i %= 2;
+
+ print qq|
+<tr valign=top class=listrow$i>|;
+
+ $column_data{accno} = qq|<td><a href=$form->{script}?action=edit_gifi&coa=1&accno=$ca->{accno}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{accno}</td>|;
+ $column_data{description} = qq|<td>$ca->{description}&nbsp;</td>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print "</tr>\n";
+ }
+
+ print qq|
+ <tr>
+ <td colspan=$colspan><hr size=3 noshade></td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub add_gifi {
+ $form->{title} = "Add";
+
+ # construct callback
+ $form->{callback} = "$form->{script}?action=list_gifi&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ $form->{coa} = 1;
+
+ &gifi_header;
+ &gifi_footer;
+
+}
+
+
+sub edit_gifi {
+
+ $form->{title} = "Edit";
+
+ AM->get_gifi(\%myconfig, \%$form);
+
+ &gifi_header;
+ &gifi_footer;
+
+}
+
+
+sub gifi_header {
+
+ $form->{title} = $locale->text("$form->{title} GIFI");
+
+# $locale->text('Add GIFI')
+# $locale->text('Edit GIFI')
+
+ $form->{description} =~ s/"/&quot;/g;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{accno}>
+<input type=hidden name=type value=gifi>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('GIFI').qq|</th>
+ <td><input name=accno size=20 value=$form->{accno}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td><input name=description size=60 value="$form->{description}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub gifi_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+|;
+
+ if ($form->{coa}) {
+ print qq|
+<input type=submit class=submit name=action value="|.$locale->text('Copy to COA').qq|">
+|;
+
+ if ($form->{accno}) {
+ print qq|<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
+ }
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub save_gifi {
+
+ $form->isblank("accno", $locale->text('GIFI missing!'));
+ AM->save_gifi(\%myconfig, \%$form);
+ $form->redirect($locale->text('GIFI saved!'));
+
+}
+
+
+sub copy_to_coa {
+
+ $form->isblank("accno", $locale->text('GIFI missing!'));
+
+ AM->save_gifi(\%myconfig, \%$form);
+
+ delete $form->{id};
+ $form->{gifi_accno} = $form->{accno};
+ $form->{title} = "Add";
+ $form->{charttype} = "A";
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub delete_gifi {
+
+ AM->delete_gifi(\%myconfig, \%$form);
+ $form->redirect($locale->text('GIFI deleted!'));
+
+}
+
+
+sub display_stylesheet {
+
+ $form->{file} = "css/$myconfig{stylesheet}";
+ &display_form;
+
+}
+
+
+sub display_form {
+
+ $form->{file} =~ s/^(.:)*?\/|\.\.\///g;
+ $form->{file} =~ s/^\/*//g;
+ $form->{file} =~ s/$userspath//;
+
+ $form->error("$!: $form->{file}") unless -f $form->{file};
+
+ AM->load_template(\%$form);
+
+ $form->{title} = $form->{file};
+
+ # if it is anything but html
+ if ($form->{file} !~ /\.html$/) {
+ $form->{body} = "<pre>\n$form->{body}\n</pre>";
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+$form->{body}
+
+<form method=post action=$form->{script}>
+
+<input name=file type=hidden value=$form->{file}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input name=action type=submit class=submit value="|.$locale->text('Edit').qq|">
+</form>
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub edit_template {
+
+ AM->load_template(\%$form);
+
+ $form->{title} = $locale->text('Edit Template');
+ # convert &nbsp to &amp;nbsp;
+ $form->{body} =~ s/&nbsp;/&amp;nbsp;/gi;
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input name=file type=hidden value=$form->{file}>
+<input name=type type=hidden value=template>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input name=callback type=hidden value="$form->{script}?action=display_form&file=$form->{file}&path=$form->{path}&login=$form->{login}&password=$form->{password}">
+
+<textarea name=body rows=25 cols=70>
+$form->{body}
+</textarea>
+
+<br>
+<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+
+</form>
+
+
+</body>
+</html>
+|;
+
+}
+
+
+sub save_template {
+
+ AM->save_template(\%$form);
+ $form->redirect($locale->text('Template saved!'));
+
+}
+
+
+sub config {
+
+ # get defaults for account numbers and last numbers
+ AM->defaultaccounts(\%myconfig, \%$form);
+
+ foreach $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
+ $dateformat .= ($item eq $myconfig{dateformat}) ? "<option selected>$item\n" : "<option>$item\n";
+ }
+
+ foreach $item (qw(1,000.00 1000.00 1.000,00 1000,00)) {
+ $numberformat .= ($item eq $myconfig{numberformat}) ? "<option selected>$item\n" : "<option>$item\n";
+ }
+
+ foreach $item (qw(name company address signature shippingpoint)) {
+ $myconfig{$item} =~ s/"/&quot;/g;
+ }
+
+ foreach $item (qw(address signature)) {
+ $myconfig{$item} =~ s/\\n/\r\n/g;
+ }
+
+ %countrycodes = User->country_codes;
+ $countrycodes = '';
+ foreach $key (sort { $countrycodes{$a} cmp $countrycodes{$b} } keys %countrycodes) {
+ $countrycodes .= ($myconfig{countrycode} eq $key) ? "<option selected value=$key>$countrycodes{$key}\n" : "<option value=$key>$countrycodes{$key}\n";
+ }
+ $countrycodes = "<option>American English\n$countrycodes";
+
+ foreach $key (keys %{ $form->{IC} }) {
+ foreach $accno (sort keys %{ $form->{IC}{$key} }) {
+ $myconfig{$key} .= ($form->{IC}{$key}{$accno}{id} == $form->{defaults}{$key}) ? "<option selected>$accno--$form->{IC}{$key}{$accno}{description}\n" : "<option>$accno--$form->{IC}{$key}{$accno}{description}\n";
+ }
+ }
+
+ $form->{title} = $locale->text('Edit Preferences for').qq| $form->{login}|;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=old_password value=$myconfig{password}>
+<input type=hidden name=type value=preferences>
+
+<table width=100%>
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Name').qq|</th>
+ <td><input name=name size=15 value="$myconfig{name}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input type=password name=password size=10 value=$myconfig{password}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('E-mail').qq|</th>
+ <td><input name=email size=30 value="$myconfig{email}"></td>
+ </tr>
+ <tr valign=top>
+ <th align=right>|.$locale->text('Signature').qq|</th>
+ <td><textarea name=signature rows=3 cols=50>$myconfig{signature}</textarea></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Phone').qq|</th>
+ <td><input name=tel size=14 value="$myconfig{tel}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Fax').qq|</th>
+ <td><input name=fax size=14 value="$myconfig{fax}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Company').qq|</th>
+ <td><input name=company size=30 value="$myconfig{company}"></td>
+ </tr>
+ <tr valign=top>
+ <th align=right>|.$locale->text('Address').qq|</th>
+ <td><textarea name=address rows=4 cols=50>$myconfig{address}</textarea></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Date Format').qq|</th>
+ <td><select name=dateformat>$dateformat</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Number Format').qq|</th>
+ <td><select name=numberformat>$numberformat</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Dropdown Limit').qq|</th>
+ <td><input name=vclimit size=10 value="$myconfig{vclimit}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Language').qq|</th>
+ <td><select name=countrycode>$countrycodes</select></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Character Set').qq|</th>
+ <td><input name=charset size=20 value="$myconfig{charset}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Stylesheet').qq|</th>
+ <td><input name=stylesheet size=20 value="$myconfig{stylesheet}"></td>
+ </tr>
+ <input name=printer type=hidden value="$myconfig{printer}">
+ <tr>
+ <th align=right>|.$locale->text('Ship via').qq|</th>
+ <td><input name=shippingpoint size=25 value="$myconfig{shippingpoint}"></td>
+ </tr>
+ <tr class=listheading>
+ <th colspan=2>&nbsp;</th>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Business Number').qq|</th>
+ <td><input name=businessnumber size=25 value="$myconfig{businessnumber}"></td>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <table width=100%>
+ <tr>
+ <th align=right>|.$locale->text('Year End').qq| (mm/dd)</th>
+ <td><input name=yearend size=5 maxsize=5 value=$form->{defaults}{yearend}></td>
+ <th align=right>|.$locale->text('Weight Unit').qq|</th>
+ <td><input name=weightunit size=5 value="$form->{defaults}{weightunit}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr class=listheading>
+ <th class=listheading colspan=2>|.$locale->text('Last Numbers & Default Accounts').qq|</th>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <table width=100%>
+ <tr>
+ <th width=1% align=right nowrap>|.$locale->text('Inventory Account').qq|</th>
+ <td><select name=inventory_accno>$myconfig{IC}</select></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Income Account').qq|</th>
+ <td><select name=income_accno>$myconfig{IC_income}</select></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Expense Account').qq|</th>
+ <td><select name=expense_accno>$myconfig{IC_expense}</select></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Foreign Exchange Gain').qq|</th>
+ <td><select name=fxgain_accno>$myconfig{FX_gain}</select></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Foreign Exchange Loss').qq|</th>
+ <td><select name=fxloss_accno>$myconfig{FX_loss}</select></td>
+ </tr>
+ <tr>
+ <td colspan=2>|.$locale->text('Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies').qq|<br><input name=curr size=40 value="$form->{defaults}{curr}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Last Invoice Number').qq|</th>
+ <td><input name=invnumber size=10 value=$form->{defaults}{invnumber}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Last Sales Order Number').qq|</th>
+ <td><input name=sonumber size=10 value=$form->{defaults}{sonumber}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Last Purchase Order Number').qq|</th>
+ <td><input name=ponumber size=10 value=$form->{defaults}{ponumber}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr class=listheading>
+ <th class=listheading colspan=2>|.$locale->text('Tax Accounts').qq|</th>
+ </tr>
+ <tr>
+ <td colspan=2>
+ <table>
+ <tr>
+ <th>&nbsp;</th>
+ <th>|.$locale->text('Rate').qq| (%)</th>
+ <th>|.$locale->text('Number').qq|</th>
+ </tr>
+|;
+
+ foreach $accno (sort keys %{ $form->{taxrates} }) {
+ print qq|
+ <tr>
+ <th align=right>$form->{taxrates}{$accno}{description}</th>
+ <td><input name=$form->{taxrates}{$accno}{id} size=6 value=$form->{taxrates}{$accno}{rate}></td>
+ <td><input name="taxnumber_$form->{taxrates}{$accno}{id}" value="$form->{taxrates}{$accno}{taxnumber}"></td>
+ </tr>
+|;
+ $form->{taxaccounts} .= "$form->{taxrates}{$accno}{id} ";
+ }
+
+ chop $form->{taxaccounts};
+
+ print qq|
+<input name=taxaccounts type=hidden value="$form->{taxaccounts}">
+
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub save_preferences {
+
+ # does stylesheet exist
+ if ($form->{stylesheet}) {
+ $form->error($locale->text('Stylesheet').": css/$form->{stylesheet} ".$locale->text('does not exist')) unless (-f "css/$form->{stylesheet}");
+ }
+
+ $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, $memberfile, $userspath));
+ $form->error($locale->text('Cannot save preferences!'));
+
+}
+
+
+sub backup {
+
+ if ($form->{media} eq 'email') {
+ $form->error($locale->text('No email address for')." $myconfig{name}") unless ($myconfig{email});
+
+ $form->{OUT} = "$sendmail";
+
+ }
+
+ AM->backup(\%myconfig, \%$form, $userspath);
+
+ if ($form->{media} eq 'email') {
+ $form->redirect($locale->text('Backup sent to').qq| $myconfig{email}|);
+ }
+
+}
+
+
+
+sub audit_control {
+
+ $form->{title} = $locale->text('Audit Control');
+
+ AM->closedto(\%myconfig, \%$form);
+
+ if ($form->{revtrans}) {
+ $checked{Y} = "checked";
+ } else {
+ $checked{N} = "checked";
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<table width=100%>
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <td>|.$locale->text('Enforce transaction reversal for all dates').qq|</th>
+ <td><input name=revtrans class=radio type=radio value="1" $checked{Y}> |.$locale->text('Yes').qq| <input name=revtrans class=radio type=radio value="0" $checked{N}> |.$locale->text('No').qq|</td>
+ </tr>
+ <tr>
+ <td>|.$locale->text('Close Books up to').qq|</th>
+ <td><input name=closedto size=11 title="$myconfig{dateformat}" value=$form->{closedto}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<hr size=3 noshade>
+
+<br>
+<input type=hidden name=nextsub value=doclose>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub doclose {
+
+ AM->closebooks(\%myconfig, \%$form);
+
+ if ($form->{revtrans}) {
+ $form->redirect($locale->text('Transaction reversal enforced for all dates'));
+ } else {
+ if ($form->{closedto}) {
+ $form->redirect($locale->text('Transaction reversal enforced up to')
+ ." ".$locale->date(\%myconfig, $form->{closedto}, 1));
+ } else {
+ $form->redirect($locale->text('Books are open'));
+ }
+ }
+
+}
+
+
+
+sub continue {
+
+ &{ $form->{nextsub} };
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/ap.pl b/sql-ledger/bin/mozilla/ap.pl
new file mode 100644
index 000000000..269f7cf39
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ap.pl
@@ -0,0 +1,1103 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Accounts Payables
+#
+#======================================================================
+
+
+use SL::AP;
+use SL::IR;
+use SL::PE;
+
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+
+sub add {
+
+ $form->{title} = "Add";
+
+ $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ &create_links;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ $form->{title} = "Edit";
+
+ &create_links;
+ &display_form;
+
+}
+
+
+sub display_form {
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub create_links {
+
+ $form->create_links("AP", \%myconfig, "vendor");
+
+ $taxincluded = $form->{taxincluded};
+ $duedate = $form->{duedate};
+
+ IR->get_vendor(\%myconfig, \%$form);
+
+ $form->{duedate} = $duedate;
+ $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
+
+ # build the popup menus
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ # vendors
+ if (@{ $form->{all_vendor} }) {
+ $form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|;
+ map { $form->{selectvendor} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{all_vendor} });
+ }
+
+
+ # forex
+ $form->{forex} = $form->{exchangerate};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ foreach $key (keys %{ $form->{AP_links} }) {
+
+ foreach $ref (@{ $form->{AP_links}{$key} }) {
+ if ($key eq "AP_tax") {
+ $form->{"selectAP_tax_$ref->{accno}"} = "<option>$ref->{accno}--$ref->{description}\n";
+ next;
+ }
+ $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
+ }
+
+ # if there is a value we have an old entry
+ for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
+
+ if ($key eq "AP_paid") {
+ $form->{"AP_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount};
+ $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
+ $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
+
+ $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
+
+ $form->{paidaccounts}++;
+ } else {
+
+ $akey = $key;
+ $akey =~ s/AP_//;
+
+ if ($key eq "AP_tax") {
+ $form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = $form->round_amount($form->{acc_trans}{$key}->[$i-1]->{amount} / $exchangerate * -1, 2);
+ $totaltax += $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
+ } else {
+ $form->{"${akey}_$i"} = $form->round_amount($form->{acc_trans}{$key}->[$i-1]->{amount} / $exchangerate, 2);
+ if ($akey eq 'amount') {
+ $form->{"${akey}_$i"} *= -1;
+ $totalamount += $form->{"${akey}_$i"};
+ $form->{rowcount}++;
+
+ $form->{"oldprojectnumber_$i"} = $form->{"projectnumber_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{projectnumber}";
+ $form->{"project_id_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{project_id}";
+ }
+ $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ }
+ }
+ }
+ }
+
+ $form->{taxincluded} = $taxincluded if ($form->{id});
+ $form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
+
+ if ($form->{taxincluded} && $totalamount) {
+ # add tax to amounts and invtotal
+ for $i (1 .. $form->{rowcount}) {
+ $taxamount = $totaltax * $form->{"amount_$i"} / $totalamount;
+ $tax = $form->round_amount($taxamount, 2);
+ $diff += ($taxamount - $tax);
+ $form->{"amount_$i"} += $tax;
+ }
+ $form->{amount_1} += $form->round_amount($diff, 2);
+ }
+
+ $form->{invtotal} = $totalamount + $totaltax;
+ $form->{rowcount}++ if $form->{id};
+
+ $form->{AP} = $form->{AP_1};
+
+ $form->{locked} = ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
+
+}
+
+
+sub form_header {
+
+ $title = $form->{title};
+ $form->{title} = $locale->text("$title Accounts Payables Transaction");
+
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+
+# type=submit $locale->text('Add Accounts Payables Transaction')
+# type=submit $locale->text('Edit Accounts Payables Transaction')
+
+ # set option selected
+ foreach $item (qw(AP vendor currency)) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+
+ # format amounts
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+
+ $exchangerate = qq|
+<input type=hidden name=forex value=$form->{forex}>
+|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{forex}) {
+ $exchangerate .= qq|
+ <th align=right>|.$locale->text('Exchangerate').qq|</th>
+ <td><input type=hidden name=exchangerate value=$form->{exchangerate}>$form->{exchangerate}</td>
+|;
+ } else {
+ $exchangerate .= qq|
+ <th align=right>|.$locale->text('Exchangerate').qq|</th>
+ <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
+|;
+ }
+ }
+
+ $taxincluded = "";
+ if ($form->{taxaccounts}) {
+ $taxincluded = qq|
+ <tr>
+ <td align=right><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
+ <th align=left nowrap>|.$locale->text('Tax Included').qq|</th>
+ </tr>
+|;
+ }
+
+
+ if (($rows = $form->numtextrows($form->{notes}, 50)) < 2) {
+ $rows = 2;
+ }
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+
+
+ $form->header;
+
+ $vendor = ($form->{selectvendor}) ? qq|<select name=vendor>$form->{selectvendor}</select>| : qq|<input name=vendor value="$form->{vendor}" size=35>|;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=sort value=$form->{sort}>
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=locked value=$form->{locked}>
+<input type=hidden name=title value="$title">
+
+<table width=100%>
+ <tr class=listtop>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Vendor').qq|</th>
+ <td colspan=3>$vendor</td>
+ <input type=hidden name=selectvendor value="$form->{selectvendor}">
+ <input type=hidden name=oldvendor value="$form->{oldvendor}">
+ <input type=hidden name=vendor_id value="$form->{vendor_id}">
+ <input type=hidden name=terms value=$form->{terms}>
+ </tr>
+ $taxincluded
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+ <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+ <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
+ <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
+ $exchangerate
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Date').qq|</th>
+ <td><input name=transdate size=11 title="$myconfig{'dateformat'}" value=$form->{transdate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Due Date').qq|</th>
+ <td><input name=duedate size=11 title="$myconfig{'dateformat'}" value=$form->{duedate}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <input type=hidden name=selectAP_amount value="$form->{selectAP_amount}">
+ <input type=hidden name=rowcount value=$form->{rowcount}>
+ <tr>
+ <td>
+ <table width=100%>
+|;
+
+ $amount = $locale->text('Amount');
+ $project = $locale->text('Project');
+
+ for $i (1 .. $form->{rowcount}) {
+
+ $form->{"selectAP_amount"} =~ s/ selected//;
+ $form->{"selectAP_amount"} =~ s/option>\Q$form->{"AP_amount_$i"}\E/option selected>$form->{"AP_amount_$i"}/;
+
+ # format amounts
+ $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
+
+ print qq|
+ <tr>
+ <th align=right nowrap>$amount</th>
+ <td><input name="amount_$i" size=10 value=$form->{"amount_$i"}></td>
+ <th>$project</th>
+ <td><input name="projectnumber_$i" size=20 value="$form->{"projectnumber_$i"}">
+ <input type=hidden name="project_id_$i" value=$form->{"project_id_$i"}>
+ <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}"></td>
+ <td width=50%><select name="AP_amount_$i">$form->{selectAP_amount}</select></td>
+ </tr>
+|;
+ $amount = "";
+ $project = "";
+ }
+
+ $taxlabel = ($form->{taxincluded}) ? $locale->text('Tax Included') : $locale->text('Tax');
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+
+ # format and reverse tax
+ $form->{"tax_$item"} = $form->format_amount(\%myconfig, $form->{"tax_$item"}, 2);
+
+ print qq|
+ <tr>
+ <th align=right nowrap>${taxlabel}</th>
+ <td><input name="tax_$item" size=10 value=$form->{"tax_$item"}></td>
+ <td colspan=2></td>
+ <td><select name=AP_tax_$item>$form->{"selectAP_tax_$item"}</select></td>
+ </tr>
+ <input type=hidden name="${item}_rate" value="$form->{"${item}_rate"}">
+ <input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
+ <input type=hidden name="selectAP_tax_$item" value="$form->{"selectAP_tax_$item"}">
+|;
+ }
+
+ $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
+
+ print qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Total').qq|</th>
+ <td>$form->{invtotal}</td>
+ <td colspan=2></td>
+ <td><select name=AP>$form->{selectAP}</select></td>
+ <input type=hidden name=selectAP value="$form->{selectAP}">
+ <input type=hidden name=taxaccounts value="$form->{taxaccounts}">
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Notes').qq|</th>
+ <td colspan=5>$notes</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+ <th class=listheading colspan=5>|.$locale->text('Payments').qq|</th>
+ </tr>
+|;
+
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ @column_index = qw(datepaid source paid AP_paid);
+ } else {
+ @column_index = qw(datepaid source paid exchangerate AP_paid);
+ }
+
+ $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
+ $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
+ $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
+ $column_data{AP_paid} = "<th>".$locale->text('Account')."</th>";
+ $column_data{source} = "<th>".$locale->text('Source')."</th>";
+
+ print "
+ <tr>
+";
+ map { print "$column_data{$_}\n" } @column_index;
+ print "
+ </tr>
+";
+
+ $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
+ for $i (1 .. $form->{paidaccounts}) {
+ print "
+ <tr>
+";
+
+ $form->{"selectAP_paid_$i"} = $form->{selectAP_paid};
+ $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
+
+ # format amounts
+ $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
+
+ $exchangerate = qq|&nbsp;|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{"forex_$i"}) {
+ $exchangerate = qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
+ } else {
+ $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
+ }
+ }
+
+ $exchangerate .= qq|
+<input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
+|;
+
+ $column_data{"paid_$i"} = qq|<td align=center><input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
+ $column_data{"AP_paid_$i"} = qq|<td align=center><select name="AP_paid_$i">$form->{"selectAP_paid_$i"}</select></td>|;
+ $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
+ $column_data{"datepaid_$i"} = qq|<td align=center><input name="datepaid_$i" size=11 title="($myconfig{'dateformat'})" value=$form->{"datepaid_$i"}></td>|;
+ $column_data{"source_$i"} = qq|<td align=center><input name="source_$i" size=10 value="$form->{"source_$i"}"></td>|;
+
+ map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
+
+ print "
+ </tr>
+";
+ }
+
+ print qq|
+ <input type=hidden name=paidaccounts value=$form->{paidaccounts}>
+ <input type=hidden name=selectAP_paid value="$form->{selectAP_paid}">
+
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub form_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+|;
+
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ if ($form->{id}) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+|;
+
+ if (!$form->{revtrans}) {
+ if (!$form->{locked}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+|;
+ }
+ }
+
+ if ($transdate > $closedto) {
+ print qq|
+<input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
+|;
+ }
+
+ } else {
+ if ($transdate > $closedto) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+ }
+ }
+
+ print "
+</form>
+
+</body>
+</html>
+";
+
+}
+
+
+sub update {
+ my $display = shift;
+
+ if ($display) {
+ goto TAXCALC;
+ }
+
+ $form->{invtotal} = 0;
+
+ $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate});
+
+ @flds = qw(amount AP_amount projectnumber oldprojectnumber project_id);
+ $count = 0;
+ for $i (1 .. $form->{rowcount}) {
+ $form->{"amount_$i"} = $form->parse_amount(\%myconfig, $form->{"amount_$i"});
+ if ($form->{"amount_$i"}) {
+ push @a, {};
+ my $j = $#a;
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+ $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
+ $form->{rowcount} = $count + 1;
+
+ map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
+
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, 'sell')));
+
+ $form->{invdate} = $form->{transdate};
+ &check_name(vendor);
+
+ &check_project;
+
+
+TAXCALC:
+ # recalculate taxes
+ if ($form->{taxincluded}) {
+ $taxrate = 0;
+
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{taxaccounts};
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $amount = ($form->{invtotal} * (1 - 1 / (1 + $taxrate)) * $form->{"${item}_rate"} / $taxrate) if $taxrate;
+ $form->{"tax_$item"} = $form->round_amount($amount, 2);
+ $taxdiff += ($amount - $form->{"tax_$item"});
+ if (abs $taxdiff >= 0.005) {
+ $form->{"tax_$item"} += $form->round_amount($taxdiff, 2);
+ $taxdiff = 0;
+ }
+ $form->{"selectAP_tax_$item"} = qq|<option>$item--$form->{"${item}_description"}|;
+ $totaltax += $form->{"tax_$item"};
+ }
+ } else {
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $form->{"tax_$item"} = $form->round_amount($form->{invtotal} * $form->{"${item}_rate"}, 2);
+ $form->{"selectAP_tax_$item"} = qq|<option>$item--$form->{"${item}_description"}|;
+ $totaltax += $form->{"tax_$item"};
+ }
+ }
+
+ $form->{invtotal} = ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax;
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
+
+ $form->{"exchangerate_$i"} = $exchangerate if ($form->{"forex_$i"} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell')));
+ }
+ }
+
+ &display_form;
+
+}
+
+
+sub post {
+
+ # check if there is an invoice number, invoice and due date
+ $form->isblank("invnumber", $locale->text("Invoice Number missing!"));
+ $form->isblank("transdate", $locale->text("Invoice Date missing!"));
+ $form->isblank("duedate", $locale->text("Due Date missing!"));
+ $form->isblank("vendor", $locale->text('Vendor missing!'));
+
+
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+
+ $form->error($locale->text('Cannot post transaction for a closed period!')) if ($transdate <= $closedto);
+
+ $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
+
+ $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
+
+ $form->error($locale->text('Cannot post payment for a closed period!')) if ($datepaid <= $closedto);
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = $form->{exchangerate} if ($transdate == $datepaid);
+ $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
+ }
+
+ }
+ }
+
+
+ # if old vendor ne vendor redo form
+ ($vendor) = split /--/, $form->{vendor};
+ if ($form->{oldvendor} ne "$vendor--$form->{vendor_id}") {
+ &update;
+ exit;
+ }
+
+ $form->{id} = 0 if $form->{postasnew};
+
+ $form->redirect($locale->text('Transaction posted!')) if (AP->post_transaction(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot post transaction!'));
+
+}
+
+
+sub post_as_new {
+
+ $form->{postasnew} = 1;
+ &post;
+
+}
+
+
+sub delete {
+
+ $form->{title} = $locale->text('Confirm!');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ foreach $key (keys %$form) {
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>$form->{title}</h2>
+
+<h4>|.$locale->text('Are you sure you want to delete Transaction').qq| $form->{invnumber}</h4>
+
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub yes {
+
+ $form->redirect($locale->text('Transaction deleted!')) if (AP->delete_transaction(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete transaction!'));
+
+}
+
+
+sub search {
+
+ # setup vendor selection
+ $form->all_vc(\%myconfig, "vendor");
+
+ if (@{ $form->{all_vendor} }) {
+ map { $vendor .= "<option>$_->{name}--$_->{id}\n" } @{ $form->{all_vendor} };
+ $vendor = qq|<select name=vendor><option>\n$vendor\n</select>|;
+ } else {
+ $vendor = qq|<input name=vendor size=35>|;
+ }
+
+ $form->{title} = $locale->text('AP Transactions');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Vendor').qq|</th>
+ <td colspan=3>$vendor</td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td colspan=3><input name=invnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td colspan=3><input name=ordnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Notes').qq|</th>
+ <td colspan=3><input name=notes size=40></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <input type=hidden name=sort value=transdate>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td>
+ <table width=100%>
+ <tr>
+ <td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Open').qq|</td>
+ <td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Closed').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('ID').qq|</td>
+ <td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Invoice Number').qq|</td>
+ <td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Order Number').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Vendor').qq|</td>
+ <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Invoice Date').qq|</td>
+ <td align=right><input name="l_netamount" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Amount').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_tax" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Tax').qq|</td>
+ <td align=right><input name="l_amount" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Total').qq|</td>
+ <td align=right><input name="l_datepaid" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Date Paid').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_paid" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Paid').qq|</td>
+ <td align=right><input name="l_duedate" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Due Date').qq|</td>
+ <td align=right><input name="l_due" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Amount Due').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Notes').qq|</td>
+ <td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Employee').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<input type=hidden name=nextsub value=$form->{nextsub}>
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub ap_transactions {
+
+ $form->{vendor} = $form->unescape($form->{vendor});
+ ($form->{vendor}, $form->{vendor_id}) = split(/--/, $form->{vendor});
+
+ AP->ap_transactions(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=ap_transactions&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ $href = $callback;
+
+
+ if ($form->{vendor}) {
+ $callback .= "&vendor=".$form->escape($form->{vendor});
+ $href .= "&vendor=".$form->escape($form->{vendor});
+ $option .= $locale->text('Vendor')." : $form->{vendor}";
+ }
+ if ($form->{invnumber}) {
+ $callback .= "&invnumber=$form->{invnumber}";
+ $href .= "&invnumber=".$form->escape($form->{invnumber});
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Invoice Number')." : $form->{invnumber}";
+ }
+ if ($form->{ordnumber}) {
+ $callback .= "&ordnumber=$form->{ordnumber}";
+ $href .= "&ordnumber=".$form->escape($form->{ordnumber});
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Order Number')." : $form->{ordnumber}";
+ }
+ if ($form->{notes}) {
+ $callback .= "&notes=$form->{notes}";
+ $href .= "&notes=".$form->escape($form->{notes});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Notes')." : $form->{notes}";
+ }
+
+ if ($form->{transdatefrom}) {
+ $callback .= "&transdatefrom=$form->{transdatefrom}";
+ $href .= "&transdatefrom=$form->{transdatefrom}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('From')." ".$locale->date(\%myconfig, $form->{transdatefrom}, 1);
+ }
+ if ($form->{transdateto}) {
+ $callback .= "&transdateto=$form->{transdateto}";
+ $href .= "&transdateto=$form->{transdateto}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('to')." ".$locale->date(\%myconfig, $form->{transdateto}, 1);
+ }
+ if ($form->{open}) {
+ $callback .= "&open=$form->{open}";
+ $href .= "&open=$form->{open}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Open');
+ }
+ if ($form->{closed}) {
+ $callback .= "&closed=$form->{closed}";
+ $href .= "&closed=$form->{closed}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Closed');
+ }
+
+ @columns = $form->sort_columns(qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee));
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ $href .= "&l_subtotal=Y";
+ }
+
+
+ $column_header{id} = qq|<th><a class=listheading href=$href&sort=id>|.$locale->text('ID').qq|</a></th>|;
+ $column_header{transdate} = qq|<th><a class=listheading href=$href&sort=transdate>|.$locale->text('Date').qq|</a></th>|;
+ $column_header{duedate} = qq|<th><a class=listheading href=$href&sort=duedate>|.$locale->text('Due Date').qq|</a></th>|;
+ $column_header{due} = qq|<th class=listheading>|.$locale->text('Amount Due').qq|</th>|;
+ $column_header{invnumber} = qq|<th><a class=listheading href=$href&sort=invnumber>|.$locale->text('Invoice').qq|</a></th>|;
+ $column_header{ordnumber} = qq|<th><a class=listheading href=$href&sort=ordnumber>|.$locale->text('Order').qq|</a></th>|;
+ $column_header{name} = qq|<th><a class=listheading href=$href&sort=name>|.$locale->text('Vendor').qq|</a></th>|;
+ $column_header{netamount} = qq|<th class=listheading>|.$locale->text('Amount').qq|</th>|;
+ $column_header{tax} = qq|<th class=listheading>|.$locale->text('Tax').qq|</th>|;
+ $column_header{amount} = qq|<th class=listheading>|.$locale->text('Total').qq|</th>|;
+ $column_header{paid} = qq|<th class=listheading>|.$locale->text('Paid').qq|</th>|;
+ $column_header{datepaid} = qq|<th><a class=listheading href=$href&sort=datepaid>|.$locale->text('Date Paid').qq|</a></th>|;
+ $column_header{notes} = qq|<th><a class=listheading>|.$locale->text('Notes').qq|</th>|;
+ $column_header{employee} = "<th><a class=listheading href=$href&sort=employee>".$locale->text('Employee')."</th>";
+
+
+ $form->{title} = $locale->text('AP Transactions');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ # add sort and escape callback
+ $form->{callback} = "$callback&sort=$form->{sort}";
+ $callback = $form->escape($form->{callback});
+
+ if (@{ $form->{AP} }) {
+ $sameitem = $form->{AP}->[0]->{$form->{sort}};
+ }
+
+ # sums and tax on reports by Antonio Gallardo
+ #
+ foreach $ap (@{ $form->{AP} }) {
+
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $ap->{$form->{sort}}) {
+ &ap_subtotal;
+ $sameitem = $ap->{$form->{sort}};
+ }
+ }
+
+ $column_data{netamount} = "<td align=right>".$form->format_amount(\%myconfig, $ap->{netamount}, 2, "&nbsp;")."</td>";
+ $column_data{tax} = "<td align=right>".$form->format_amount(\%myconfig, $ap->{amount} - $ap->{netamount}, 2, "&nbsp;") . "</td>";
+ $column_data{amount} = "<td align=right>".$form->format_amount(\%myconfig, $ap->{amount}, 2, "&nbsp;") . "</td>";
+ $column_data{paid} = "<td align=right>".$form->format_amount(\%myconfig, $ap->{paid}, 2, "&nbsp;")."</td>";
+ $column_data{due} = "<td align=right>".$form->format_amount(\%myconfig, $ap->{amount} - $ap->{paid}, 2, "&nbsp;")."</td>";
+
+ $totalnetamount += $ap->{netamount};
+ $totalamount += $ap->{amount};
+ $totalpaid += $ap->{paid};
+ $totaldue += ($ap->{amount} - $ap->{paid});
+
+ $subtotalnetamount += $ap->{netamount};
+ $subtotalamount += $ap->{amount};
+ $subtotalpaid += $ap->{paid};
+ $subtotaldue += ($ap->{amount} - $ap->{paid});
+
+ $column_data{transdate} = "<td>$ap->{transdate}&nbsp;</td>";
+ $column_data{duedate} = "<td>$ap->{duedate}&nbsp;</td>";
+ $column_data{datepaid} = "<td>$ap->{datepaid}&nbsp;</td>";
+
+ $module = ($ap->{invoice}) ? "ir.pl" : $form->{script};
+
+ $column_data{invnumber} = qq|<td><a href="$module?action=edit&path=$form->{path}&id=$ap->{id}&login=$form->{login}&password=$form->{password}&callback=$callback">$ap->{invnumber}</a></td>|;
+ $column_data{id} = "<td>$ap->{id}</td>";
+ $column_data{ordnumber} = "<td>$ap->{ordnumber}&nbsp;</td>";
+ $column_data{name} = "<td>$ap->{name}</td>";
+ $ap->{notes} =~ s/\r\n/<br>/g;
+ $column_data{notes} = "<td>$ap->{notes}&nbsp;</td>";
+ $column_data{employee} = "<td>$ap->{employee}&nbsp;</td>";
+
+ $i++;
+ $i %= 2;
+ print "
+ <tr class=listrow$i >
+";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &ap_subtotal;
+ }
+
+ # print totals
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{netamount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{tax} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount - $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount, 2, "&nbsp;")."</th>";
+ $column_data{paid} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalpaid, 2, "&nbsp;")."</th>";
+ $column_data{due} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totaldue, 2, "&nbsp;")."</th>";
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('AP Transaction').qq|">
+
+<input class=submit type=submit name=action value="|.$locale->text('Vendor Invoice').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub ap_subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{netamount} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{tax} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount - $subtotalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount, 2, "&nbsp;")."</th>";
+ $column_data{paid} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalpaid, 2, "&nbsp;")."</th>";
+ $column_data{due} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotaldue, 2, "&nbsp;")."</th>";
+
+ $subtotalnetamount = 0;
+ $subtotalamount = 0;
+ $subtotalpaid = 0;
+ $subtotaldue = 0;
+
+ print "<tr class=listsubtotal>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+}
+
+
+
diff --git a/sql-ledger/bin/mozilla/ar.pl b/sql-ledger/bin/mozilla/ar.pl
new file mode 100644
index 000000000..341c0380c
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ar.pl
@@ -0,0 +1,1135 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Accounts Receivables
+#
+#======================================================================
+
+
+use SL::AR;
+use SL::IS;
+use SL::PE;
+
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+
+sub add {
+
+ $form->{title} = "Add";
+ $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ &create_links;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ $form->{title} = "Edit";
+
+ &create_links;
+ &display_form;
+
+}
+
+
+sub display_form {
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub create_links {
+
+ $form->create_links("AR", \%myconfig, "customer");
+ $duedate = $form->{duedate};
+
+ $taxincluded = $form->{taxincluded};
+
+ IS->get_customer(\%myconfig, \%$form);
+
+ $form->{duedate} = $duedate;
+ $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ # customers
+ if (@{ $form->{all_customer} }) {
+ $form->{customer} = "$form->{customer}--$form->{customer_id}";
+ map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{all_customer} });
+ }
+
+ # forex
+ $form->{forex} = $form->{exchangerate};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ foreach $key (keys %{ $form->{AR_links} }) {
+
+ foreach $ref (@{ $form->{AR_links}{$key} }) {
+ if ($key eq 'AR_tax') {
+ $form->{"selectAR_tax_$ref->{accno}"} = "<option>$ref->{accno}--$ref->{description}\n";
+ next;
+ }
+ $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
+ }
+
+ # if there is a value we have an old entry
+ for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
+ if ($key eq "AR_paid") {
+ $form->{"AR_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ # reverse paid
+ $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount} * -1;
+ $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
+ $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
+
+ $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
+
+ $form->{paidaccounts}++;
+ } else {
+
+ $akey = $key;
+ $akey =~ s/AR_//;
+
+ if ($key eq "AR_tax") {
+
+ $form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = $form->round_amount($form->{acc_trans}{$key}->[$i-1]->{amount} / $exchangerate, 2);
+ $totaltax += $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
+ } else {
+ $form->{"${akey}_$i"} = $form->round_amount($form->{acc_trans}{$key}->[$i-1]->{amount} / $exchangerate, 2);
+ if ($akey eq 'amount') {
+ $form->{rowcount}++;
+ $totalamount += $form->{"${akey}_$i"};
+
+ $form->{"oldprojectnumber_$i"} = $form->{"projectnumber_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{projectnumber}";
+ $form->{"project_id_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{project_id}";
+ }
+ $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ }
+ }
+ }
+ }
+
+ $form->{taxincluded} = $taxincluded if ($form->{id});
+ $form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
+
+ if ($form->{taxincluded} && $totalamount) {
+ # add tax to amounts and invtotal
+ for $i (1 .. $form->{rowcount}) {
+ $taxamount = $totaltax * $form->{"amount_$i"} / $totalamount;
+ $tax = $form->round_amount($taxamount, 2);
+ $diff += ($taxamount - $tax);
+ $form->{"amount_$i"} += $tax;
+ }
+ $form->{amount_1} += $form->round_amount($diff, 2);
+ }
+
+ $form->{invtotal} = $totalamount + $totaltax;
+ $form->{rowcount}++ if $form->{id};
+
+ $form->{AR} = $form->{AR_1};
+
+ $form->{locked} = ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
+
+}
+
+
+sub form_header {
+
+ $title = $form->{title};
+ $form->{title} = $locale->text("$title Accounts Receivables Transaction");
+
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+
+# $locale->text('Add Accounts Receivables Transaction')
+# $locale->text('Edit Accounts Receivables Transaction')
+
+ # set option selected
+ foreach $item (qw(AR customer currency)) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+ # format amounts
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+
+ $exchangerate = qq|
+<input type=hidden name=forex value=$form->{forex}>
+|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{forex}) {
+ $exchangerate .= qq|
+ <th align=right>|.$locale->text('Exchangerate').qq|</th>
+ <td><input type=hidden name=exchangerate value=$form->{exchangerate}>$form->{exchangerate}</td>
+|;
+ } else {
+ $exchangerate .= qq|
+ <th align=right>|.$locale->text('Exchangerate').qq|</th>
+ <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
+|;
+ }
+ }
+
+ $taxincluded = "";
+ if ($form->{taxaccounts}) {
+ $taxincluded = qq|
+ <tr>
+ <td align=right><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
+ <th align=left nowrap>|.$locale->text('Tax Included').qq|</th>
+ </tr>
+|;
+ }
+
+
+ if (($rows = $form->numtextrows($form->{notes}, 50)) < 2) {
+ $rows = 2;
+ }
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+
+
+ $form->header;
+
+ $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
+
+ $customer = ($form->{selectcustomer}) ? qq|<select name=customer>$form->{selectcustomer}</select>| : qq|<input name=customer value="$form->{customer}" size=35>|;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=sort value=$form->{sort}>
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=locked value=$form->{locked}>
+<input type=hidden name=title value="$title">
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align="right" nowrap>|.$locale->text('Customer').qq|</th>
+ <td colspan=3>$customer</td>
+ <input type=hidden name=selectcustomer value="$form->{selectcustomer}">
+ <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
+ <input type=hidden name=customer_id value="$form->{customer_id}">
+ <input type=hidden name=terms value=$form->{terms}>
+ </tr>
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <table width=100%>
+ <tr>
+ <th align=left nowrap>|.$locale->text('Credit Limit').qq|</th>
+ <td>$form->{creditlimit}</td>
+ <th align=left nowrap>|.$locale->text('Remaining').qq|</th>
+ <td class="plus$n">$form->{creditremaining}</td>
+ <input type=hidden name=creditlimit value=$form->{creditlimit}>
+ <input type=hidden name=creditremaining value=$form->{creditremaining}>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ $taxincluded
+ <tr>
+ <th align=right>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+ <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+ <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
+ <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
+ $exchangerate
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Date').qq|</th>
+ <td><input name=transdate size=11 title="($myconfig{'dateformat'})" value=$form->{transdate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Due Date').qq|</th>
+ <td><input name=duedate size=11 title="$myconfig{'dateformat'}" value=$form->{duedate}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+
+<input type=hidden name=selectAR_amount value="$form->{selectAR_amount}">
+<input type=hidden name=rowcount value=$form->{rowcount}>
+|;
+
+ $amount = $locale->text('Amount');
+ $project = $locale->text('Project');
+
+ for $i (1 .. $form->{rowcount}) {
+
+ $form->{"selectAR_amount"} =~ s/ selected//;
+ $form->{"selectAR_amount"} =~ s/option>\Q$form->{"AR_amount_$i"}\E/option selected>$form->{"AR_amount_$i"}/;
+
+ # format amounts
+ $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
+
+ print qq|
+ <tr>
+ <th align=right>$amount</th>
+ <td><input name="amount_$i" size=10 value=$form->{"amount_$i"}></td>
+ <th>$project</th>
+ <td><input name="projectnumber_$i" size=20 value="$form->{"projectnumber_$i"}">
+ <input type=hidden name="project_id_$i" value=$form->{"project_id_$i"}>
+ <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}"></td>
+ <td width=50%><select name="AR_amount_$i">$form->{"selectAR_amount"}</select></td>
+ </tr>
+|;
+ $amount = "";
+ $project = "";
+ }
+
+ $taxlabel = ($form->{taxincluded}) ? $locale->text('Tax Included') : $locale->text('Tax');
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+
+ $form->{"tax_$item"} = $form->format_amount(\%myconfig, $form->{"tax_$item"}, 2);
+ print qq|
+ <tr>
+ <th align=right nowrap>$taxlabel</th>
+ <td><input name="tax_$item" size=10 value=$form->{"tax_$item"}></td>
+ <td colspan=2></td>
+ <td><select name="AR_tax_$item">$form->{"selectAR_tax_$item"}</select></td>
+ </tr>
+ <input type=hidden name="${item}_rate" value="$form->{"${item}_rate"}">
+ <input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
+ <input type=hidden name="selectAR_tax_$item" value="$form->{"selectAR_tax_$item"}">
+|;
+
+ }
+
+ $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
+
+ print qq|
+ <tr>
+
+ <th align=right>|.$locale->text('Total').qq|</th>
+ <th align=left>$form->{invtotal}</th>
+
+ <input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
+ <input type=hidden name=oldtotalpaid value=$form->{oldtotalpaid}>
+
+ <input type=hidden name=taxaccounts value="$form->{taxaccounts}">
+
+ <td colspan=2></td>
+ <td><select name=AR>$form->{selectAR}</select></td>
+ <input type=hidden name=selectAR value="$form->{selectAR}">
+
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Notes').qq|</th>
+ <td colspan=4>$notes</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th class=listheading colspan=5>|.$locale->text('Payments').qq|</th>
+ </tr>
+|;
+
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ @column_index = qw(datepaid source paid AR_paid);
+ } else {
+ @column_index = qw(datepaid source paid exchangerate AR_paid);
+ }
+
+ $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
+ $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
+ $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
+ $column_data{AR_paid} = "<th>".$locale->text('Account')."</th>";
+ $column_data{source} = "<th>".$locale->text('Source')."</th>";
+
+ print "
+ <tr>
+";
+ map { print "$column_data{$_}\n" } @column_index;
+ print "
+ </tr>
+";
+
+ $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
+ for $i (1 .. $form->{paidaccounts}) {
+ print "
+ <tr>
+";
+
+ $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
+ $form->{"selectAR_paid_$i"} =~ s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/;
+
+ # format amounts
+ $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
+
+ $exchangerate = qq|&nbsp;|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{"forex_$i"}) {
+ $exchangerate = qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
+ } else {
+ $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
+ }
+ }
+
+ $exchangerate .= qq|
+<input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
+|;
+
+ $column_data{"paid_$i"} = qq|<td align=center><input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
+ $column_data{"AR_paid_$i"} = qq|<td align=center><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
+ $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
+ $column_data{"datepaid_$i"} = qq|<td align=center><input name="datepaid_$i" size=11 value=$form->{"datepaid_$i"}></td>|;
+ $column_data{"source_$i"} = qq|<td align=center><input name="source_$i" size=10 value="$form->{"source_$i"}"></td>|;
+
+ map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
+
+ print "
+ </tr>
+";
+ }
+
+ print qq|
+<input type=hidden name=paidaccounts value=$form->{paidaccounts}>
+<input type=hidden name=selectAR_paid value="$form->{selectAR_paid}">
+
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub form_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+|;
+
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ if ($form->{id}) {
+
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+|;
+
+ if (!$form->{revtrans}) {
+ if (!$form->{locked}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+|;
+ }
+ }
+
+ if ($transdate > $closedto) {
+ print qq|
+<input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
+|;
+ }
+
+ } else {
+ if ($transdate > $closedto) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+ }
+ }
+
+ print "
+</form>
+
+</body>
+</html>
+";
+
+}
+
+
+sub update {
+ my $display = shift;
+
+ if ($display) {
+ goto TAXCALC;
+ }
+
+ $form->{invtotal} = 0;
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
+
+ @flds = qw(amount AR_amount projectnumber oldprojectnumber project_id);
+ $count = 0;
+ @a = ();
+ for $i (1 .. $form->{rowcount}) {
+ $form->{"amount_$i"} = $form->parse_amount(\%myconfig, $form->{"amount_$i"});
+ if ($form->{"amount_$i"}) {
+ push @a, {};
+ $j = $#a;
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
+ $form->{rowcount} = $count + 1;
+
+ map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
+
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, 'buy')));
+
+
+ $form->{invdate} = $form->{transdate};
+ &check_name(customer);
+
+ &check_project;
+
+
+TAXCALC:
+ # recalculate taxes
+ if ($form->{taxincluded}) {
+ $taxrate = 0;
+
+ map { $taxrate += $form->{"${_}_rate"} } split / /, $form->{taxaccounts};
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $amount = ($form->{invtotal} * (1 - 1 / (1 + $taxrate)) * $form->{"${item}_rate"} / $taxrate) if $taxrate;
+ $form->{"tax_$item"} = $form->round_amount($amount, 2);
+ $taxdiff += ($amount - $form->{"tax_$item"});
+ if (abs $taxdiff >= 0.005) {
+ $form->{"tax_$item"} += $form->round_amount($taxdiff, 2);
+ $taxdiff = 0;
+ }
+ $form->{"selectAR_tax_$item"} = qq|<option>$item--$form->{"${item}_description"}|;
+ $totaltax += $form->{"tax_$item"};
+ }
+ } else {
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $form->{"tax_$item"} = $form->round_amount($form->{invtotal} * $form->{"${item}_rate"}, 2);
+ $form->{"selectAR_tax_$item"} = qq|<option>$item--$form->{"${item}_description"}|;
+ $totaltax += $form->{"tax_$item"};
+ }
+ }
+
+ $form->{invtotal} = ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax;
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
+
+ $totalpaid += $form->{"paid_$i"};
+
+ $form->{"exchangerate_$i"} = $exchangerate if ($form->{"forex_$i"} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy')));
+ }
+ }
+
+ $form->{creditremaining} -= ($form->{invtotal} - $totalpaid + $form->{oldtotalpaid} - $form->{oldinvtotal});
+ $form->{oldinvtotal} = $form->{invtotal};
+ $form->{oldtotalpaid} = $totalpaid;
+
+ &display_form;
+
+}
+
+
+sub post {
+
+ # check if there is an invoice number, invoice and due date
+ $form->isblank("invnumber", $locale->text('Invoice Number missing!'));
+ $form->isblank("transdate", $locale->text('Invoice Date missing!'));
+ $form->isblank("duedate", $locale->text('Due Date missing!'));
+ $form->isblank("customer", $locale->text('Customer missing!'));
+
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+
+ $form->error($locale->text('Cannot post transaction for a closed period!')) if ($transdate <= $closedto);
+
+ $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
+
+ $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
+
+ $form->error($locale->text('Cannot post payment for a closed period!')) if ($datepaid <= $closedto);
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = $form->{exchangerate} if ($transdate == $datepaid);
+ $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
+ }
+ }
+ }
+
+ # if oldcustomer ne customer redo form
+ ($customer) = split /--/, $form->{customer};
+ if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") {
+ &update;
+ exit;
+ }
+
+ $form->{id} = 0 if $form->{postasnew};
+
+ $form->redirect($locale->text('Transaction posted!')) if (AR->post_transaction(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot post transaction!'));
+
+}
+
+
+sub post_as_new {
+
+ $form->{postasnew} = 1;
+ &post;
+
+}
+
+
+sub delete {
+
+ $form->{title} = $locale->text('Confirm!');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ foreach $key (keys %$form) {
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>$form->{title}</h2>
+
+<h4>|.$locale->text('Are you sure you want to delete Transaction').qq| $form->{invnumber}</h4>
+
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub yes {
+
+ $form->redirect($locale->text('Transaction deleted!')) if (AR->delete_transaction(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete transaction!'));
+
+}
+
+
+sub search {
+
+ # setup customer selection
+ $form->all_vc(\%myconfig, "customer");
+
+ if (@{ $form->{all_customer} }) {
+ map { $customer .= "<option>$_->{name}--$_->{id}\n" } @{ $form->{all_customer} };
+ $customer = qq|<select name=customer><option>\n$customer</select>|;
+ } else {
+ $customer = qq|<input name=customer size=35>|;
+ }
+
+ $form->{title} = $locale->text('AR Transactions');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Customer').qq|</th>
+ <td colspan=3>$customer</td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td colspan=3><input name=invnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td colspan=3><input name=ordnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Notes').qq|</th>
+ <td colspan=3><input name=notes size=40></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <input type=hidden name=sort value=transdate>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td>
+ <table width=100%>
+ <tr>
+ <td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Open').qq|</td>
+ <td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Closed').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('ID').qq|</td>
+ <td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Invoice Number').qq|</td>
+ <td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Order Number').qq|</td>
+ <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Invoice Date').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Customer').qq|</td>
+ <td align=right><input name="l_netamount" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Amount').qq|</td>
+ <td align=right><input name="l_tax" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Tax').qq|</td>
+ <td align=right><input name="l_amount" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Total').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_datepaid" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Date Paid').qq|</td>
+ <td align=right><input name="l_paid" class=checkbox type=checkbox value=Y checked></td>
+ <td nowrap>|.$locale->text('Paid').qq|</td>
+ <td align=right><input name="l_duedate" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Due Date').qq|</td>
+ <td align=right><input name="l_due" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Amount Due').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Notes').qq|</td>
+ <td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Salesperson').qq|</td>
+ <td align=right><input name="l_shippingpoint" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Ship via').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
+ <td nowrap>|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=$form->{nextsub}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub ar_transactions {
+
+ $form->{customer} = $form->unescape($form->{customer});
+ ($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer});
+
+ AR->ar_transactions(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=ar_transactions&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ $href = $callback;
+
+ if ($form->{customer}) {
+ $callback .= "&customer=".$form->escape($form->{customer});
+ $href .= "&customer=".$form->escape($form->{customer});
+ $option = $locale->text('Customer')." : $form->{customer}";
+ }
+ if ($form->{invnumber}) {
+ $callback .= "&invnumber=$form->{invnumber}";
+ $href .= "&invnumber=".$form->escape($form->{invnumber});
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Invoice Number')." : $form->{invnumber}";
+ }
+ if ($form->{ordnumber}) {
+ $callback .= "&ordnumber=$form->{ordnumber}";
+ $href .= "&ordnumber=".$form->escape($form->{ordnumber});
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Order Number')." : $form->{ordnumber}";
+ }
+ if ($form->{notes}) {
+ $callback .= "&notes=$form->{notes}";
+ $href .= "&notes=".$form->escape($form->{notes});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Notes')." : $form->{notes}";
+ }
+
+ if ($form->{transdatefrom}) {
+ $callback .= "&transdatefrom=$form->{transdatefrom}";
+ $href .= "&transdatefrom=$form->{transdatefrom}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('From')."&nbsp;".$locale->date(\%myconfig, $form->{transdatefrom}, 1);
+ }
+ if ($form->{transdateto}) {
+ $callback .= "&transdateto=$form->{transdateto}";
+ $href .= "&transdateto=$form->{transdateto}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('to')."&nbsp;".$locale->date(\%myconfig, $form->{transdateto}, 1);
+ }
+ if ($form->{open}) {
+ $callback .= "&open=$form->{open}";
+ $href .= "&open=$form->{open}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Open');
+ }
+ if ($form->{closed}) {
+ $callback .= "&closed=$form->{closed}";
+ $href .= "&closed=$form->{closed}";
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('Closed');
+ }
+
+ @columns = $form->sort_columns(qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee shippingpoint));
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ $href .= "&l_subtotal=Y";
+ }
+
+
+ $column_header{id} = "<th><a class=listheading href=$href&sort=id>".$locale->text('ID')."</a></th>";
+ $column_header{transdate} = "<th><a class=listheading href=$href&sort=transdate>".$locale->text('Date')."</a></th>";
+ $column_header{duedate} = "<th><a class=listheading href=$href&sort=duedate>".$locale->text('Due Date')."</a></th>";
+ $column_header{invnumber} = "<th><a class=listheading href=$href&sort=invnumber>".$locale->text('Invoice')."</a></th>";
+ $column_header{ordnumber} = "<th><a class=listheading href=$href&sort=ordnumber>".$locale->text('Order')."</a></th>";
+ $column_header{name} = "<th><a class=listheading href=$href&sort=name>".$locale->text('Customer')."</a></th>";
+ $column_header{netamount} = "<th class=listheading>" . $locale->text('Amount') . "</th>";
+ $column_header{tax} = "<th class=listheading>" . $locale->text('Tax') . "</th>";
+ $column_header{amount} = "<th class=listheading>" . $locale->text('Total') . "</th>";
+ $column_header{paid} = "<th class=listheading>" . $locale->text('Paid') . "</th>";
+ $column_header{datepaid} = "<th><a class=listheading href=$href&sort=datepaid>" . $locale->text('Date Paid') . "</a></th>";
+ $column_header{due} = "<th class=listheading>" . $locale->text('Amount Due') . "</th>";
+ $column_header{notes} = "<th class=listheading>".$locale->text('Notes')."</th>";
+ $column_header{employee} = "<th class=listheading><a class=listheading href=$href&sort=employee>".$locale->text('Salesperson')."</th>";
+
+ $column_header{shippingpoint} = "<th class=listheading><a class=listheading href=$href&sort=shippingpoint>" . $locale->text('Ship via') . "</a></th>";
+
+
+ $form->{title} = $locale->text('AR Transactions');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ # add sort and escape callback, this one we use for the add sub
+ $form->{callback} = $callback .= "&sort=$form->{sort}";
+
+ # escape callback for href
+ $callback = $form->escape($callback);
+
+ if (@{ $form->{AR} }) {
+ $sameitem = $form->{AR}->[0]->{$form->{sort}};
+ }
+
+ # sums and tax on reports by Antonio Gallardo
+ #
+ foreach $ar (@{ $form->{AR} }) {
+
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $ar->{$form->{sort}}) {
+ &ar_subtotal;
+ }
+ }
+
+ $column_data{netamount} = "<td align=right>".$form->format_amount(\%myconfig, $ar->{netamount}, 2, "&nbsp;")."</td>";
+ $column_data{tax} = "<td align=right>".$form->format_amount(\%myconfig, $ar->{amount} - $ar->{netamount}, 2, "&nbsp;")."</td>";
+ $column_data{amount} = "<td align=right>".$form->format_amount(\%myconfig, $ar->{amount}, 2, "&nbsp;")."</td>";
+ $column_data{paid} = "<td align=right>".$form->format_amount(\%myconfig, $ar->{paid}, 2, "&nbsp;")."</td>";
+ $column_data{due} = "<td align=right>".$form->format_amount(\%myconfig, $ar->{amount} - $ar->{paid}, 2, "&nbsp;")."</td>";
+
+ $subtotalnetamount += $ar->{netamount};
+ $subtotalamount += $ar->{amount};
+ $subtotalpaid += $ar->{paid};
+ $subtotaldue += $ar->{amount} - $ar->{paid};
+
+ $totalnetamount += $ar->{netamount};
+ $totalamount += $ar->{amount};
+ $totalpaid += $ar->{paid};
+ $totaldue += ($ar->{amount} - $ar->{paid});
+
+ $column_data{transdate} = "<td>$ar->{transdate}&nbsp;</td>";
+ $column_data{id} = "<td>$ar->{id}</td>";
+ $column_data{datepaid} = "<td>$ar->{datepaid}&nbsp;</td>";
+ $column_data{duedate} = "<td>$ar->{duedate}&nbsp;</td>";
+
+ $module = ($ar->{invoice}) ? "is.pl" : $form->{script};
+
+ $column_data{invnumber} = "<td><a href=$module?action=edit&id=$ar->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}</a></td>";
+ $column_data{ordnumber} = "<td>$ar->{ordnumber}&nbsp;</td>";
+ $column_data{name} = "<td>$ar->{name}</td>";
+ $ar->{notes} =~ s/\r\n/<br>/g;
+ $column_data{notes} = "<td>$ar->{notes}&nbsp;</td>";
+ $column_data{shippingpoint} = "<td>$ar->{shippingpoint}&nbsp;</td>";
+ $column_data{employee} = "<td>$ar->{employee}&nbsp;</td>";
+
+ $i++; $i %= 2;
+ print "
+ <tr class=listrow$i>
+";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &ar_subtotal;
+ }
+
+ # print totals
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{netamount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{tax} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount - $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount, 2, "&nbsp;")."</th>";
+ $column_data{paid} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalpaid, 2, "&nbsp;")."</th>";
+ $column_data{due} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totaldue, 2, "&nbsp;")."</th>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('AR Transaction').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Sales Invoice').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub ar_subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{tax} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount - $subtotalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount, 2, "&nbsp;")."</th>";
+ $column_data{paid} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalpaid, 2, "&nbsp;")."</th>";
+ $column_data{due} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotaldue, 2, "&nbsp;")."</th>";
+
+ $subtotalnetamount = 0;
+ $subtotalamount = 0;
+ $subtotalpaid = 0;
+ $subtotaldue = 0;
+
+ $sameitem = $ar->{$form->{sort}};
+
+ print "<tr class=listsubtotal>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+print "
+</tr>
+";
+
+}
+
+
+
diff --git a/sql-ledger/bin/mozilla/arap.pl b/sql-ledger/bin/mozilla/arap.pl
new file mode 100644
index 000000000..fecd9260f
--- /dev/null
+++ b/sql-ledger/bin/mozilla/arap.pl
@@ -0,0 +1,406 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# common routines for gl, ar, ap, is, ir, oe
+#
+
+# any custom scripts for this one
+if (-f "$form->{path}/custom_arap.pl") {
+ eval { require "$form->{path}/custom_arap.pl"; };
+}
+if (-f "$form->{path}/$form->{login}_arap.pl") {
+ eval { require "$form->{path}/$form->{login}_arap.pl"; };
+}
+
+
+1;
+# end of main
+
+
+sub check_name {
+ my ($name) = @_;
+
+ my ($new_name, $new_id) = split /--/, $form->{$name};
+ my $i = 0;
+
+ # if we use a selection
+ if ($form->{"select$name"}) {
+ if ($form->{"old$name"} ne $form->{$name}) {
+ # this is needed for is, ir and oe
+ map { delete $form->{"${_}_rate"} } (split / /, $form->{taxaccounts});
+
+ # for credit calculations
+ $form->{oldinvtotal} = 0;
+ $form->{oldtotalpaid} = 0;
+
+ $form->{"${name}_id"} = $new_id;
+ $form->{"old$name"} = "$new_name--$new_id";
+
+ IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
+ IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
+
+ $i = 1;
+ }
+ } else {
+
+ # check name, combine name and id
+ if ($form->{"old$name"} ne qq|$form->{$name}--$form->{"${name}_id"}|) {
+ # this is needed for is, ir and oe
+ map { delete $form->{"${_}_rate"} } (split / /, $form->{taxaccounts});
+
+ # for credit calculations
+ $form->{oldinvtotal} = 0;
+ $form->{oldtotalpaid} = 0;
+
+ # return one name or a list of names in $form->{name_list}
+ if (($i = $form->get_name(\%myconfig, $name)) > 1) {
+ &select_name($name);
+ exit;
+ }
+
+ if ($i == 1) {
+ # we got one name
+ $form->{"${name}_id"} = $form->{name_list}[0]->{id};
+ $form->{$name} = $form->{name_list}[0]->{name};
+ $form->{"old$name"} = qq|$form->{$name}--$form->{"${name}_id"}|;
+
+ IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
+ IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
+
+ } else {
+ # name is not on file
+ $msg = ucfirst $name . " not on file!";
+ $form->error($locale->text($msg));
+ }
+ }
+ }
+
+ $i;
+
+}
+
+# $locale->text('Customer not on file!')
+# $locale->text('Vendor not on file!')
+
+
+
+sub select_name {
+ my ($table) = @_;
+
+ @column_index = qw(ndx name address);
+
+ $label = ucfirst $table;
+ $column_data{ndx} = qq|<th>&nbsp;</th>|;
+ $column_data{name} = qq|<th>|.$locale->text($label).qq|</th>|;
+ $column_data{address} = qq|<th>|.$locale->text('Address').qq|</th>|;
+
+ # list items with radio button on a form
+ $form->header;
+
+ $title = $locale->text('Select from one of the names below');
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$title</th>
+ </tr>
+ <tr space=5></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ my $i = 0;
+ foreach $ref (@{ $form->{name_list} }) {
+ $checked = ($i++) ? "" : "checked";
+
+ $ref->{name} =~ s/"/&quot;/g;
+
+ $column_data{ndx} = qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
+ $column_data{name} = qq|<td><input name="new_name_$i" type=hidden value="$ref->{name}">$ref->{name}</td>|;
+ $column_data{address} = qq|<td>$ref->{address}</td>|;
+
+ $j++; $j %= 2;
+ print qq|
+ <tr class=listrow$j>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+
+<input name="new_id_$i" type=hidden value=$ref->{id}>
+
+|;
+
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input name=lastndx type=hidden value=$i>
+
+|;
+
+ # delete action variable
+ delete $form->{action};
+ delete $form->{name_list};
+
+ # save all other form variables
+ foreach $key (keys %${form}) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input name=$key type=hidden value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<input type=hidden name=nextsub value=name_selected>
+
+<input type=hidden name=vc value=$table>
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub name_selected {
+
+ # replace the variable with the one checked
+
+ # index for new item
+ $i = $form->{ndx};
+
+ $form->{$form->{vc}} = $form->{"new_name_$i"};
+ $form->{"$form->{vc}_id"} = $form->{"new_id_$i"};
+ $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
+
+ # delete all the new_ variables
+ for $i (1 .. $form->{lastndx}) {
+ map { delete $form->{"new_${_}_$i"} } (id, name);
+ }
+
+ map { delete $form->{$_} } qw(ndx lastndx nextsub);
+
+ IS->get_customer(\%myconfig, \%$form) if ($form->{vc} eq 'customer');
+ IR->get_vendor(\%myconfig, \%$form) if ($form->{vc} eq 'vendor');
+
+ &update(1);
+
+}
+
+
+sub add_transaction {
+ my ($module) = @_;
+
+ delete $form->{script};
+ $form->{action} = "add";
+ $form->{type} = "invoice" if $module =~ /(is|ir)/;
+
+ $form->{callback} = $form->escape($form->{callback},1);
+ map { $argv .= "$_=$form->{$_}&" } keys %$form;
+
+ exec ("perl", "$module.pl", $argv);
+
+}
+
+
+
+sub check_project {
+
+ for $i (1 .. $form->{rowcount}) {
+ $form->{"project_id_$i"} = "" unless $form->{"projectnumber_$i"};
+ if ($form->{"projectnumber_$i"} ne $form->{"oldprojectnumber_$i"}) {
+ if ($form->{"projectnumber_$i"}) {
+ # get new project
+ $form->{projectnumber} = $form->{"projectnumber_$i"};
+ if (($rows = PE->projects(\%myconfig, $form)) > 1) {
+ # check form->{project_list} how many there are
+ $form->{rownumber} = $i;
+ &select_project;
+ exit;
+ }
+
+ if ($rows == 1) {
+ $form->{"project_id_$i"} = $form->{project_list}->[0]->{id};
+ $form->{"projectnumber_$i"} = $form->{project_list}->[0]->{projectnumber};
+ $form->{"oldprojectnumber_$i"} = $form->{project_list}->[0]->{projectnumber};
+ } else {
+ # not on file
+ $form->error($locale->text('Project not on file!'));
+ }
+ }
+ }
+ }
+
+}
+
+
+sub select_project {
+
+ @column_index = qw(ndx projectnumber description);
+
+ $column_data{ndx} = qq|<th>&nbsp;</th>|;
+ $column_data{projectnumber} = qq|<th>|.$locale->text('Number').qq|</th>|;
+ $column_data{description} = qq|<th>|.$locale->text('Description').qq|</th>|;
+
+ # list items with radio button on a form
+ $form->header;
+
+ $title = $locale->text('Select from one of the projects below');
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=rownumber value=$form->{rownumber}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$title</th>
+ </tr>
+ <tr space=5></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ my $i = 0;
+ foreach $ref (@{ $form->{project_list} }) {
+ $checked = ($i++) ? "" : "checked";
+
+ $ref->{name} =~ s/"/&quot;/g;
+
+ $column_data{ndx} = qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
+ $column_data{projectnumber} = qq|<td><input name="new_projectnumber_$i" type=hidden value="$ref->{projectnumber}">$ref->{projectnumber}</td>|;
+ $column_data{description} = qq|<td>$ref->{description}</td>|;
+
+ $j++; $j %= 2;
+ print qq|
+ <tr class=listrow$j>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+
+<input name="new_id_$i" type=hidden value=$ref->{id}>
+
+|;
+
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input name=lastndx type=hidden value=$i>
+
+|;
+
+ # delete action variable
+ delete $form->{action};
+ delete $form->{project_list};
+
+ # save all other form variables
+ foreach $key (keys %${form}) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input name=$key type=hidden value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<input type=hidden name=nextsub value=project_selected>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub project_selected {
+
+ # replace the variable with the one checked
+
+ # index for new item
+ $i = $form->{ndx};
+
+ $form->{"projectnumber_$form->{rownumber}"} = $form->{"new_projectnumber_$i"};
+ $form->{"oldprojectnumber_$form->{rownumber}"} = $form->{"new_projectnumber_$i"};
+ $form->{"project_id_$form->{rownumber}"} = $form->{"new_id_$i"};
+
+ # delete all the new_ variables
+ for $i (1 .. $form->{lastndx}) {
+ map { delete $form->{"new_${_}_$i"} } qw(id projectnumber description);
+ }
+
+ map { delete $form->{$_} } qw(ndx lastndx nextsub);
+
+ &update;
+
+}
+
+
+sub continue { &{ $form->{nextsub} } };
+sub gl_transaction { &add };
+sub ar_transaction { &add_transaction(ar) };
+sub ap_transaction { &add_transaction(ap) };
+sub sales_invoice { &add_transaction(is) };
+sub vendor_invoice { &add_transaction(ir) };
+
diff --git a/sql-ledger/bin/mozilla/ca.pl b/sql-ledger/bin/mozilla/ca.pl
new file mode 100644
index 000000000..ed3100573
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ca.pl
@@ -0,0 +1,413 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# module for Chart of Accounts, Income Statement and Balance Sheet
+# search and edit transactions posted by the GL, AR and AP
+#
+#======================================================================
+
+
+use SL::CA;
+
+1;
+# end of main
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+
+sub chart_of_accounts {
+
+ CA->all_accounts(\%myconfig, \%$form);
+
+ @column_index = qw(accno gifi_accno description debit credit);
+
+ $column_header{accno} = qq|<th class=listheading>|.$locale->text('Account').qq|</th>\n|;
+ $column_header{gifi_accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</th>\n|;
+ $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>\n|;
+ $column_header{debit} = qq|<th class=listheading>|.$locale->text('Debit').qq|</th>\n|;
+ $column_header{credit} = qq|<th class=listheading>|.$locale->text('Credit').qq|</th>\n|;
+
+
+ $form->{title} = $locale->text('Chart of Accounts');
+
+ $colspan = $#column_index + 1;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr><th class=listtop colspan=$colspan>$form->{title}</font></th></tr>
+ <tr height="5"></tr>
+ <tr class=listheading>|;
+
+ map { print $column_header{$_} } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ foreach $ca (@{ $form->{CA} }) {
+
+ $description = $form->escape($ca->{description});
+ $gifi_description = $form->escape($ca->{gifi_description});
+
+ $href = qq|$form->{script}?path=$form->{path}&action=list&accno=$ca->{accno}&login=$form->{login}&password=$form->{password}&description=$description&gifi_accno=$ca->{gifi_accno}&gifi_description=$gifi_description|;
+
+ if ($ca->{charttype} eq "H") {
+ print qq|<tr class=listheading>|;
+ map { $column_data{$_} = "<th class=listheading>$ca->{$_}</th>"; } qw(accno description);
+ $column_data{gifi_accno} = "<th class=listheading>$ca->{gifi_accno}&nbsp;</font></th>";
+ } else {
+ $i++; $i %= 2;
+ print qq|<tr class=listrow$i>|;
+ $column_data{accno} = "<td><a href=$href>$ca->{accno}</a></td>";
+ $column_data{gifi_accno} = "<td><a href=$href&accounttype=gifi>$ca->{gifi_accno}</a>&nbsp;</td>";
+ $column_data{description} = "<td>$ca->{description}</td>";
+ }
+
+ $column_data{debit} = "<td align=right>".$form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;")."</td>\n";
+ $column_data{credit} = "<td align=right>".$form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;")."</td>\n";
+
+ $totaldebit += $ca->{debit};
+ $totalcredit += $ca->{credit};
+
+ map { print $column_data{$_} } @column_index;
+
+ print qq|
+</tr>
+|;
+ }
+
+ map { $column_data{$_} = "<td>&nbsp;</td>"; } qw(accno gifi_accno description);
+
+ $column_data{debit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totaldebit, 2, 0)."</font></th>";
+ $column_data{credit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalcredit, 2, 0)."</font></th>";
+
+ print "<tr class=listtotal>";
+
+ map { print $column_data{$_} } @column_index;
+
+ print qq|
+</tr>
+<tr>
+ <td colspan=$colspan><hr size=3 noshade></td>
+</tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub list {
+
+ $form->{title} = $locale->text('List Transactions');
+ if ($form->{accounttype} eq 'gifi') {
+ $form->{title} .= " - ".$locale->text('GIFI')." $form->{gifi_accno}";
+ } else {
+ $form->{title} .= " - ".$locale->text('Account')." $form->{accno}";
+ }
+
+ $form->header;
+
+ map { $form->{$_} =~ s/"/&quot;/g; } qw(description gifi_description);
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=accno value=$form->{accno}>
+<input type=hidden name=description value="$form->{description}">
+<input type=hidden name=sort value=transdate>
+
+<input type=hidden name=accounttype value=$form->{accounttype}>
+<input type=hidden name=gifi_accno value=$form->{gifi_accno}>
+<input type=hidden name=gifi_description value="$form->{gifi_description}">
+
+<table border=0 width=100%>
+ <tr><th class=listtop>$form->{title}</font></th></tr>
+ <tr height="5"></tr
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Include in Report').qq|</th>
+ <td colspan=3>
+ <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td><hr size=3 noshade></td></tr>
+</table>
+
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input class=submit type=submit name=action value="|.$locale->text('List Transactions').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub list_transactions {
+
+ CA->all_transactions(\%myconfig, \%$form);
+
+ $description = $form->escape($form->{description});
+ $gifi_description = $form->escape($form->{gifi_description});
+
+ # construct href
+ $href = "$form->{script}?path=$form->{path}&action=list_transactions&accno=$form->{accno}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&description=$description&accounttype=$form->{accounttype}&gifi_accno=$form->{gifi_accno}&gifi_description=$gifi_description&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}";
+
+ # construct callback
+ $callback = "rp.pl?path=$form->{path}&action=generate_trial_balance&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&accounttype=$form->{accounttype}";
+
+ # figure out which column comes first
+ $column_header{transdate} = qq|<th><a class=listheading href=$href&sort=transdate>|.$locale->text('Date').qq|</a></th>|;
+ $column_header{reference} = qq|<th><a class=listheading href=$href&sort=reference>|.$locale->text('Reference').qq|</a></th>|;
+ $column_header{description} = qq|<th><a class=listheading href=$href&sort=description>|.$locale->text('Description').qq|</a></th>|;
+ $column_header{debit} = qq|<th class=listheading>|.$locale->text('Debit').qq|</th>|;
+ $column_header{credit} = qq|<th class=listheading>|.$locale->text('Credit').qq|</th>|;
+ $column_header{balance} = qq|<th class=listheading>|.$locale->text('Balance').qq|</th>|;
+
+ @column_index = $form->sort_columns(qw(transdate reference description debit credit));
+
+ if ($form->{accounttype} eq 'gifi') {
+ map { $form->{$_} = $form->{"gifi_$_"} } qw(accno description);
+ }
+ if ($form->{accno}) {
+ push @column_index, "balance";
+ }
+
+ $form->{title} = ($form->{accounttype} eq 'gifi') ? $locale->text('GIFI') : $locale->text('Account');
+
+ $form->{title} .= " $form->{accno} - $form->{description}";
+
+
+ if ($form->{fromdate} || $form->{todate}) {
+ if ($form->{fromdate}) {
+ $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
+ }
+ if ($form->{todate}) {
+ $todate = $locale->date(\%myconfig, $form->{todate}, 1);
+ }
+
+ $form->{period} = "$fromdate - $todate";
+ } else {
+ $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig),1);
+ }
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</font></th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$form->{period}</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+map { print "$column_header{$_}\n" } @column_index;
+
+print qq|
+ </tr>
+|;
+
+ # add sort to callback
+ $callback = $form->escape($callback . "&sort=$form->{sort}");
+
+ if (@{ $form->{CA} }) {
+ $sameitem = $form->{CA}->[0]->{$form->{sort}};
+ }
+
+ $ml = ($form->{category} =~ /(A|E)/) ? -1 : 1;
+ if ($form->{accno} && $form->{balance}) {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>";
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+ map { print $column_data{$_} } @column_index;
+ print qq|
+ </tr>
+|;
+ }
+
+ foreach $ca (@{ $form->{CA} }) {
+
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $ca->{$form->{sort}}) {
+ &ca_subtotal;
+ }
+ }
+
+ # construct link to source
+ $href = "<a href=$ca->{module}.pl?path=$form->{path}&action=edit&id=$ca->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ca->{reference}</a>";
+
+
+ $column_data{debit} = "<td align=right>".$form->format_amount(\%myconfig, $ca->{debit}, 2, "&nbsp;")."</td>";
+ $column_data{credit} = "<td align=right>".$form->format_amount(\%myconfig, $ca->{credit}, 2, "&nbsp;")."</td>";
+
+ $form->{balance} += $ca->{amount};
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>";
+
+ $subtotaldebit += $ca->{debit};
+ $subtotalcredit += $ca->{credit};
+
+ $totaldebit += $ca->{debit};
+ $totalcredit += $ca->{credit};
+
+ $column_data{transdate} = qq|<td>$ca->{transdate}</td>|;
+ $column_data{reference} = qq|<td>$href</td>|;
+ $column_data{description} = qq|<td>$ca->{description}</td>|;
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+
+ map { print $column_data{$_} } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &ca_subtotal;
+ }
+
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{debit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totaldebit, 2, "&nbsp;")."</font></th>";
+ $column_data{credit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalcredit, 2, "&nbsp;")."</font></th>";
+ $column_data{balance} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</font></th>";
+
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { print $column_data{$_} } @column_index;
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub ca_subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{debit} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotaldebit, 2, "&nbsp;") . "</font></th>";
+ $column_data{credit} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalcredit, 2, "&nbsp;") . "</font></th>";
+
+ $subtotaldebit = 0;
+ $subtotalcredit = 0;
+
+ $sameitem = $ca->{$form->{sort}};
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+}
+
diff --git a/sql-ledger/bin/mozilla/cp.pl b/sql-ledger/bin/mozilla/cp.pl
new file mode 100644
index 000000000..911b70105
--- /dev/null
+++ b/sql-ledger/bin/mozilla/cp.pl
@@ -0,0 +1,528 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Payment module
+#
+#======================================================================
+
+
+use SL::CP;
+use SL::IS;
+use SL::IR;
+
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+
+sub payment {
+
+ # setup customer/vendor selection for open invoices
+ CP->get_openvc(\%myconfig, \%$form);
+
+ if ($form->{"all_$form->{vc}"}) {
+ map { $form->{"select$form->{vc}"} .= "<option>$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} };
+ }
+
+ $form->{arap} = ($form->{vc} eq 'customer') ? "AR" : "AP";
+
+ CP->paymentaccounts(\%myconfig, \%$form);
+
+ map { $form->{selectaccount} .= "<option>$_->{accno}--$_->{description}\n" } @{ $form->{PR} };
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ $form->{media} = "screen";
+
+ &form_header;
+ &list_invoices;
+ &form_footer;
+
+}
+
+
+
+sub form_header {
+
+ $vclabel = ucfirst $form->{vc};
+ $vclabel = $locale->text($vclabel);
+
+ if ($form->{vc} eq 'customer') {
+ $form->{title} = $locale->text('Receipt');
+ $rclabel = $locale->text('Reference');
+ $form->{type} = 'receipt';
+ } else {
+ $form->{title} = $locale->text('Payment');
+ $rclabel = $locale->text('Check');
+ $form->{type} = 'check';
+ }
+
+# $locale->text('Customer')
+# $locale->text('Vendor')
+
+ if ($form->{$form->{vc}} eq "") {
+ map { $form->{"addr$_"} = "" } (1 .. 4);
+ }
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+ if ($form->{forex}) {
+ $exchangerate = qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
+ <td colspan=3><input type=hidden name=exchangerate size=10 value=$form->{exchangerate}>$form->{exchangerate}</td>
+ </tr>
+|;
+ } else {
+ $exchangerate = qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
+ <td colspan=3><input name=exchangerate size=10 value=$form->{exchangerate}></td>
+ </tr>
+|;
+ }
+ }
+
+ foreach $item ($form->{vc}, account, currency) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+ $vc = ($form->{"select$form->{vc}"}) ? qq|<select name=$form->{vc}>$form->{"select$form->{vc}"}\n</select>| : qq|<input name=$form->{vc} size=35 value="$form->{$form->{vc}}">|;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=vc value=$form->{vc}>
+<input type=hidden name=type value=$form->{type}>
+
+<table border=0 width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>$vclabel</th>
+ <td>$vc</td>
+ <input type=hidden name="select$form->{vc}" value="$form->{"select$form->{vc}"}">
+ <input type=hidden name="$form->{vc}_id" value=$form->{"$form->{vc}_id"}>
+ <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
+ </tr>
+ <tr valign=top>
+ <th align=right nowrap>|.$locale->text('Address').qq|</th>
+ <td>
+ <table>
+ <tr>
+ <td>$form->{addr1}</td>
+ </tr>
+ <tr>
+ <td>$form->{addr2}</td>
+ </tr>
+ <tr>
+ <td>$form->{addr3}</td>
+ </tr>
+ <tr>
+ <td>$form->{addr4}</td>
+ </tr>
+ </table>
+ </td>
+ <input type=hidden name=addr1 value="$form->{addr1}">
+ <input type=hidden name=addr2 value="$form->{addr2}">
+ <input type=hidden name=addr3 value="$form->{addr3}">
+ <input type=hidden name=addr4 value="$form->{addr4}">
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Account').qq|</th>
+ <td colspan=3><select name=account>$form->{selectaccount}</select>
+ <input type=hidden name=selectaccount value="$form->{selectaccount}">
+ </td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Date').qq|</th>
+ <td><input name=datepaid value="$form->{datepaid}" title="$myconfig{dateformat}" size=11></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+ <input type=hidden name=oldcurrency value=$form->{oldcurrency}>
+ </tr>
+ $exchangerate
+ <tr>
+ <th align=right nowrap>$rclabel</th>
+ <td colspan=3><input name=source value="$form->{source}" size=10></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Amount').qq|</th>
+ <td colspan=3><input name=amount size=10 value=|.$form->format_amount(\%myconfig, $form->{amount}, 2).qq|></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}" value=$form->{transdatefrom}></td>
+ <th align=right nowrap>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}" value=$form->{transdateto}></td>
+ <input type=hidden name=oldtransdatefrom value=$form->{oldtransdatefrom}>
+ <input type=hidden name=oldtransdateto value=$form->{oldtransdateto}>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+}
+
+
+sub list_invoices {
+
+ @column_index = qw(invnumber transdate amount due paid selectpaid);
+
+ $colspan = $#column_index + 1;
+
+ print qq|
+ <input type=hidden name=column_index value="id @column_index">
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th class=listheading colspan=$colspan>|.$locale->text('Invoices').qq|</th>
+ </tr>
+|;
+
+ $column_data{invnumber} = qq|<th nowrap>|.$locale->text('Invoice')."</th>";
+ $column_data{transdate} = qq|<th nowrap>|.$locale->text('Date')."</th>";
+ $column_data{amount} = qq|<th nowrap>|.$locale->text('Amount')."</th>";
+ $column_data{due} = qq|<th nowrap>|.$locale->text('Due')."</th>";
+ $column_data{paid} = qq|<th nowrap>|.$locale->text('Applied')."</th>";
+ $column_data{selectpaid} = qq|<th nowrap>|.$locale->text('Paid in full')."</th>";
+
+ print qq|
+ <tr>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+ print qq|
+ </tr>
+|;
+
+ for $i (1 .. $form->{rowcount}) {
+
+ $form->{"selectpaid_$i"} = "checked" if $form->{"selectpaid_$i"};
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(amount due paid);
+
+ $totalamount += $form->{"amount_$i"};
+ $totaldue += $form->{"due_$i"};
+ $totalpaid += $form->{"paid_$i"};
+
+ map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(amount due paid);
+
+ $column_data{invnumber} = qq|<td>$form->{"invnumber_$i"}</td>
+ <input type=hidden name="invnumber_$i" value="$form->{"invnumber_$i"}">
+ <input type=hidden name="id_$i" value=$form->{"id_$i"}>|;
+ $column_data{transdate} = qq|<td width=15%>$form->{"transdate_$i"}</td>
+ <input type=hidden name="transdate_$i" value=$form->{"transdate_$i"}>|;
+ $column_data{amount} = qq|<td align=right width=15%>$form->{"amount_$i"}</td>
+ <input type=hidden name="amount_$i" value=$form->{"amount_$i"}>|;
+ $column_data{due} = qq|<td align=right width=15%>$form->{"due_$i"}</td>
+ <input type=hidden name="due_$i" value=$form->{"due_$i"}>|;
+
+ $column_data{paid} = qq|<td align=right width=15%>|;
+ if ($form->{"selectpaid_$i"}) {
+ $column_data{paid} .= qq|<input type=hidden name="paid_$i" value=$form->{"paid_$i"}>$form->{"paid_$i"}</td>|;
+ } else {
+ $column_data{paid} .= qq|<input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
+ }
+ $column_data{selectpaid} = qq|<td align=center width=10%><input name="selectpaid_$i" type=checkbox class=checkbox $form->{"selectpaid_$i"}></td>|;
+
+ $j++; $j %= 2;
+ print qq|
+ <tr class=listrow$j>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+ print qq|
+ </tr>
+|;
+ }
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{amount} = qq|<th align=right>|.$form->format_amount(\%myconfig, $totalamount, 2, "&nbsp;").qq|</th>|;
+ $column_data{due} = qq|<th align=right>|.$form->format_amount(\%myconfig, $totaldue, 2, "&nbsp;").qq|</th>|;
+ $column_data{paid} = qq|<th align=right>|.$form->format_amount(\%myconfig, $totalpaid, 2, "&nbsp;").qq|</th>|;
+
+ print qq|
+ <tr class=listtotal>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+}
+
+
+sub form_footer {
+
+ $form->{OP}{$form->{media}} = "checked";
+
+ print qq|
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+<input type=hidden name=rowcount value=$form->{rowcount}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+
+ if ($latex) {
+ print qq|
+<input class=submit type=submit name=action value="|.$locale->text('Print').qq|">
+<input class=radio type=radio name=media value=screen $form->{OP}{screen}> |.$locale->text('Screen');
+
+ if ($myconfig{printer}) {
+ print qq|
+<input class=radio type=radio name=media value=printer $form->{OP}{printer}> |.$locale->text('Printer');
+ }
+ }
+
+ print qq|
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub update {
+ my ($new_name_selected) = @_;
+
+ # get customer and invoices
+ $updated = &check_name($form->{vc});
+
+ $updated = 1 if (($form->{oldtransdatefrom} ne $form->{transdatefrom}) || ($form->{oldtransdateto} ne $form->{transdateto}));
+ $form->{oldtransdatefrom} = $form->{transdatefrom};
+ $form->{oldtransdateto} = $form->{transdateto};
+
+ if ($new_name_selected || $updated) {
+ CP->get_openinvoices(\%myconfig, \%$form);
+ $updated = 1;
+ }
+
+ if ($form->{currency} ne $form->{oldcurrency}) {
+ $form->{oldcurrency} = $form->{currency};
+ if (!$updated) {
+ CP->get_openinvoices(\%myconfig, \%$form);
+ $updated = 1;
+ }
+ }
+
+ # check currency
+ $buysell = ($form->{vc} eq 'customer') ? "buy" : "sell";
+
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{datepaid}, $buysell)));
+
+ $amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
+
+ if ($updated) {
+ $form->{rowcount} = 0;
+
+ $i = 0;
+ foreach $ref (@{ $form->{PR} }) {
+ $i++;
+ $form->{"id_$i"} = $ref->{id};
+ $form->{"invnumber_$i"} = $ref->{invnumber};
+ $form->{"transdate_$i"} = $ref->{transdate};
+ $ref->{exchangerate} = 1 unless $ref->{exchangerate};
+ $form->{"amount_$i"} = $ref->{amount} / $ref->{exchangerate};
+ $form->{"due_$i"} = $form->round_amount(($ref->{amount} - $ref->{paid}) / $ref->{exchangerate}, 2);
+ $amount = $form->round_amount($amount - $form->{"due_$i"}, 2);
+ $form->{"selectpaid_$i"} = 1 if $amount > 0;
+
+ map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(amount due paid);
+
+ }
+ $form->{rowcount} = $i;
+ }
+
+ # recalculate
+ $amount = $form->{amount};
+ for $i (1 .. $form->{rowcount}) {
+
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(amount due paid);
+
+ if ($form->{"selectpaid_$i"}) {
+ $amount -= $form->{"due_$i"};
+
+ if ($amount < 0) {
+ $form->{"selectpaid_$i"} = 0;
+ } else {
+ $form->{"paid_$i"} = $form->{"due_$i"};
+ }
+ }
+
+ map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(amount due paid);
+
+ }
+
+ &form_header;
+ &list_invoices;
+ &form_footer;
+
+}
+
+
+sub post {
+
+ &check_form;
+
+ $form->redirect($locale->text('Payment posted!')) if (CP->process_payment(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot post payment!'));
+
+}
+
+
+sub print {
+
+ &check_form;
+
+ ($whole, $form->{decimal}) = split /\./, $form->{amount};
+
+ $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
+ $m = "*" x (24 - length $form->{amount});
+ $form->{amount} = $locale->text($form->{currency})."$m$form->{amount}";
+
+ $form->{decimal} .= "00";
+ $form->{decimal} = substr($form->{decimal}, 0, 2);
+
+ $check = new CP $myconfig{countrycode};
+ $check->init;
+ $form->{text_amount} = $check->num2text($whole);
+
+ &{ "$form->{vc}_details" };
+
+ $form->{format} = ($form->{media} eq 'screen') ? "pdf" : "postscript";
+ $form->{templates} = "$myconfig{templates}";
+ $form->{IN} = "$form->{type}.tex";
+ $form->{OUT} = "| $myconfig{printer}" if ($form->{media} eq 'printer');
+
+ $form->{company} = $myconfig{company};
+ $form->{address} = $myconfig{address};
+
+ @a = qw(name invnumber company address text_amount addr1 addr2 addr3 addr4);
+ $form->format_string(@a);
+
+ $form->parse_template(\%myconfig, $userspath);
+
+ $form->{callback} = "";
+
+ $label = uc $form->{type};
+
+# $locale->text('Check printed!')
+# $locale->text('Check printing failed!')
+# $locale->text('Receipt printed!')
+# $locale->text('Receipt printing failed!')
+
+ $form->redirect($locale->text("$label printed!"));
+ $form->error($locale->text("$label printing failed!"));
+
+}
+
+
+sub customer_details { IS->customer_details(\%myconfig, \%$form) };
+sub vendor_details { IR->vendor_details(\%myconfig, \%$form) };
+
+
+sub check_form {
+
+ # construct callback
+ $form->{callback} = "$form->{script}?action=payment&vc=$form->{vc}&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ $form->redirect unless $form->{rowcount};
+
+ if ($form->{currency} ne $form->{oldcurrency}) {
+ &update;
+ exit;
+ }
+
+ $form->error($locale->text('Date missing!')) unless $form->{datepaid};
+ $form->error($locale->text('Amount missing!')) unless $form->{amount};
+
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $datepaid = $form->datetonum($form->{datepaid}, \%myconfig);
+
+ $form->error($locale->text('Cannot process payment for a closed period!')) if ($datepaid <= $closedto);
+
+ $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
+ for $i (1 .. $form->{rowcount}) {
+ $totalpaid += $form->parse_amount(\%myconfig, $form->{"paid_$i"});
+ if ($form->{"paid_$i"}) {
+ push(@{ $form->{paid} }, $form->{"paid_$i"});
+ push(@{ $form->{due} }, $form->{"due_$i"});
+ push(@{ $form->{invnumber} }, $form->{"invnumber_$i"});
+ push(@{ $form->{invdate} }, $form->{"transdate_$i"});
+ }
+ }
+
+ $totalpaid = $form->round_amount($totalpaid, 2);
+
+ $form->error($locale->text('Nothing applied!')) unless $totalpaid;
+ $form->error($locale->text('Amount does not equal applied!')) if ($form->{amount} != $totalpaid);
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/ct.pl b/sql-ledger/bin/mozilla/ct.pl
new file mode 100644
index 000000000..3dbb5656a
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ct.pl
@@ -0,0 +1,631 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Reed White <alta@alta-research.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# customer/vendor module
+#
+#======================================================================
+
+# $locale->text('Customers')
+# $locale->text('Vendors')
+
+use SL::CT;
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = "Add";
+
+ $form->{callback} = "$form->{script}?action=add&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ CT->taxaccounts(\%myconfig, \%$form);
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub search {
+
+ $label = ucfirst $form->{db};
+ $form->{title} = $locale->text($label."s");
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=db value=$form->{db}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Number').qq|</th>
+ <td><input name=$form->{db}number size=35></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Name').qq|</th>
+ <td><input name=name size=35></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Contact').qq|</th>
+ <td><input name=contact size=35></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('E-mail').qq|</th>
+ <td><input name=email size=35></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td><input name=status class=radio type=radio value=all checked>&nbsp;|.$locale->text('All').qq|
+ <input name=status class=radio type=radio value=orphaned>&nbsp;|.$locale->text('Orphaned').qq|</td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td>
+ <input name="l_$form->{db}number" type=checkbox class=checkbox value=Y>&nbsp;|.$locale->text('Number').qq|
+ <input name="l_name" type=checkbox class=checkbox value=Y checked>&nbsp;|.$locale->text('Name').qq|
+ <input name="l_address" type=checkbox class=checkbox value=Y>&nbsp;|.$locale->text('Address').qq|<br>
+ <input name="l_contact" type=checkbox class=checkbox value=Y checked>&nbsp;|.$locale->text('Contact').qq|
+ <input name="l_phone" type=checkbox class=checkbox value=Y checked>&nbsp;|.$locale->text('Phone').qq|
+ <input name="l_fax" type=checkbox class=checkbox value=Y>&nbsp;|.$locale->text('Fax').qq|
+ <input name="l_email" type=checkbox class=checkbox value=Y checked>&nbsp;|.$locale->text('E-mail').qq|
+ <input name="l_cc" type=checkbox class=checkbox value=Y>&nbsp;|.$locale->text('Cc').qq|
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=list_names>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+}
+
+
+sub list_names {
+
+ CT->search(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=list_names&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+ $href = $callback;
+
+ @columns = $form->sort_columns(name, "$form->{db}number", address, contact, phone, fax, email, cc);
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{status} eq 'all') {
+ $option = $locale->text('All');
+ }
+ if ($form->{status} eq 'orphaned') {
+ $option .= $locale->text('Orphaned');
+ }
+ if ($form->{name}) {
+ $callback .= "&name=$form->{name}";
+ $href .= "&name=".$form->escape($form->{name});
+ $option .= "\n<br>".$locale->text('Name')." : $form->{name}";
+ }
+ if ($form->{contact}) {
+ $callback .= "&contact=$form->{contact}";
+ $href .= "&contact=".$form->escape($form->{contact});
+ $option .= "\n<br>".$locale->text('Contact')." : $form->{contact}";
+ }
+ if ($form->{"$form->{db}number"}) {
+ $callback .= qq|&$form->{db}number=$form->{"$form->{db}number"}|;
+ $href .= "&$form->{db}number=".$form->escape($form->{"$form->{db}number"});
+ $option .= "\n<br>".$locale->text('Number').qq| : $form->{"$form->{db}number"}|;
+ }
+ if ($form->{email}) {
+ $callback .= "&email=$form->{email}";
+ $href .= "&email=".$form->escape($form->{email});
+ $option .= "\n<br>".$locale->text('E-mail')." : $form->{email}";
+ }
+
+ $form->{callback} = "$callback&sort=$form->{sort}";
+ $callback = $form->escape($form->{callback});
+
+ $column_header{"$form->{db}number"} = qq|<th><a class=listheading href=$href&sort=$form->{db}number>|.$locale->text('Number').qq|</a></th>|;
+ $column_header{name} = qq|<th><a class=listheading href=$href&sort=name>|.$locale->text('Name').qq|</a></th>|;
+ $column_header{address} = qq|<th><a class=listheading href=$href&sort=address>|.$locale->text('Address').qq|</a></th>|;
+ $column_header{contact} = qq|<th><a class=listheading href=$href&sort=contact>|.$locale->text('Contact').qq|</a></th>|;
+ $column_header{phone} = qq|<th><a class=listheading href=$href&sort=phone>|.$locale->text('Phone').qq|</a></th>|;
+ $column_header{fax} = qq|<th><a class=listheading href=$href&sort=fax>|.$locale->text('Fax').qq|</a></th>|;
+ $column_header{email} = qq|<th><a class=listheading href=$href&sort=email>|.$locale->text('E-mail').qq|</a></th>|;
+ $column_header{cc} = qq|<th><a class=listheading href=$href&sort=cc>|.$locale->text('Cc').qq|</a></th>|;
+
+ $label = ucfirst $form->{db}."s";
+ $form->{title} = $locale->text($label);
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ foreach $ref (@{ $form->{CT} }) {
+
+ map { $column_data{$_} = "<td>$ref->{$_}&nbsp;</td>" } ("$form->{db}number", address, contact, phone, fax);
+
+ $column_data{name} = "<td><a href=$form->{script}?action=edit&id=$ref->{id}&db=$form->{db}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}&callback=$callback>$ref->{name}&nbsp;</td>";
+
+ $column_data{email} = ($ref->{email}) ? qq|<td><a href="mailto:$ref->{email}">$ref->{email}</a></td>| : "<td>&nbsp;</td>";
+ $column_data{cc} = ($ref->{cc}) ? qq|<td><a href="mailto:$ref->{cc}">$ref->{cc}</a></td>| : "<td>&nbsp;</td>";
+
+ $i++; $i %= 2;
+ print "
+ <tr class=listrow$i>
+";
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+<input name=db type=hidden value=$form->{db}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Add').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub edit {
+
+# $locale->text('Edit Customer')
+# $locale->text('Edit Vendor')
+
+ CT->get_tuple(\%myconfig, \%$form);
+
+ # format " into &quot;
+ map { $form->{$_} =~ s/"/&quot;/g } keys %$form;
+
+ $form->{title} = "Edit";
+
+ # format discount
+ $form->{discount} *= 100;
+
+ &form_header;
+ &form_footer;
+
+}
+
+
+sub form_header {
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if (($form->{tax}{$item}{taxable}) || !($form->{id})) {
+ $taxable .= qq| <input name="tax_$item" value=1 class=checkbox type=checkbox checked>&nbsp;<b>$form->{tax}{$item}{description}</b>|;
+ } else {
+ $taxable .= qq| <input name="tax_$item" value=1 class=checkbox type=checkbox>&nbsp;<b>$form->{tax}{$item}{description}</b>|;
+ }
+ }
+
+ $tax = qq|
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Taxable').qq|</th>
+ <td>$taxable</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0);
+
+ if ($myconfig{admin}) {
+ $bcc = qq|
+ <tr>
+ <th align=right nowrap>|.$locale->text('Bcc').qq|</th>
+ <td><input name=bcc size=35 value="$form->{bcc}"></td>
+ </tr>
+|;
+ }
+
+
+ $label = ucfirst $form->{db};
+ $form->{title} = $locale->text("$form->{title} $label");
+
+ if ($form->{db} eq 'customer') {
+ $creditlimit = qq|
+ <th align=right>|.$locale->text('Credit Limit').qq|</th>
+ <td><input name=creditlimit size=9 value="$form->{creditlimit}"></td>
+ <th align=right>|.$locale->text('Discount').qq|</th>
+ <td><input name=discount size=4 value="$form->{discount}"></td>
+ <th>%</th>
+|;
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+ <th class=listheading colspan=2 width=50%">&nbsp;</th>
+ <th class=listheading width=50%">|.$locale->text('Ship to').qq|</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Number').qq|</th>
+ <td><input name="$form->{db}number" size=35 maxsize=35 value="$form->{"$form->{db}number"}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Name').qq|</th>
+ <td><input name=name size=35 maxsize=35 value="$form->{name}"></td>
+ <td><input name=shiptoname size=35 maxsize=35 value="$form->{shiptoname}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Address').qq|</th>
+ <td><input name=addr1 size=35 maxsize=35 value="$form->{addr1}"></td>
+ <td><input name=shiptoaddr1 size=35 maxsize=35 value="$form->{shiptoaddr1}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td><input name=addr2 size=35 maxsize=35 value="$form->{addr2}"></td>
+ <td><input name=shiptoaddr2 size=35 maxsize=35 value="$form->{shiptoaddr2}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td><input name=addr3 size=35 maxsize=35 value="$form->{addr3}"></td>
+ <td><input name=shiptoaddr3 size=35 maxsize=35 value="$form->{shiptoaddr3}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td><input name=addr4 size=35 maxsize=35 value="$form->{addr4}"></td>
+ <td><input name=shiptoaddr4 size=35 maxsize=35 value="$form->{shiptoaddr4}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Contact').qq|</th>
+ <td><input name=contact size=35 maxsize=35 value="$form->{contact}"></td>
+ <td><input name=shiptocontact size=35 maxsize=35 value="$form->{shiptocontact}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Phone').qq|</th>
+ <td><input name=phone size=20 maxsize=20 value="$form->{phone}"></td>
+ <td><input name=shiptophone size=20 maxsize=20 value="$form->{shiptophone}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Fax').qq|</th>
+ <td><input name=fax size=20 maxsize=20 value="$form->{fax}"></td>
+ <td><input name=shiptofax size=20 maxsize=20 value="$form->{shiptofax}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('E-mail').qq|</th>
+ <td><input name=email size=35 value="$form->{email}"></td>
+ <td><input name=shiptoemail size=35 value="$form->{shiptoemail}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Cc').qq|</th>
+ <td><input name=cc size=35 value="$form->{cc}"></td>
+ </tr>
+ $bcc
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right>|.$locale->text('Terms: Net').qq|</th>
+ <td><input name=terms size=2 value="$form->{terms}"></td>
+ <th>|.$locale->text('days').qq|</th>
+ $creditlimit
+ <td><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
+ <th align=left>|.$locale->text('Tax Included').qq|</th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ $tax
+ <tr>
+ <th align=left nowrap>|.$locale->text('Notes').qq|</th>
+ </tr>
+ <tr>
+ <td><textarea name=notes rows=3 cols=60 wrap=soft>$form->{notes}</textarea></td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+
+sub form_footer {
+
+ $label = ucfirst $form->{db};
+
+ print qq|
+<input name=id type=hidden value=$form->{id}>
+<input name=taxaccounts type=hidden value="$form->{taxaccounts}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input type=hidden name=callback value="$form->{callback}">
+<input type=hidden name=db value=$form->{db}>
+
+<br>
+
+<input class=submit type=submit name=action value="|.$locale->text("Save").qq|">
+<input class=submit type=submit name=action value="|.$locale->text("Invoice").qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Order').qq|">
+|;
+
+ if ($form->{id} && $form->{status} eq 'orphaned') {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">\n|;
+ }
+
+ print qq|
+
+ </form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub invoice { &{ "$form->{db}_invoice" } };
+
+sub customer_invoice {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_customer(\%myconfig, \%$form);
+
+ delete $form->{script};
+
+ $form->{action} = "add";
+ $form->{callback} = $form->escape($form->{callback},1);
+
+ $form->{customer} = $form->{name};
+ $form->{customer_id} = $form->{id};
+ $form->{vc} = 'customer';
+
+ delete $form->{id};
+
+ map { $argv .= "$_=$form->{$_}&" } keys %$form;
+
+ exec ("perl", "is.pl", $argv);
+
+}
+
+
+sub vendor_invoice {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_vendor(\%myconfig, \%$form);
+
+ delete $form->{script};
+
+ $form->{action} = "add";
+ $form->{callback} = $form->escape($form->{callback},1);
+
+ $form->{vendor} = $form->{name};
+ $form->{vendor_id} = $form->{id};
+ $form->{vc} = 'vendor';
+
+ delete $form->{id};
+
+ map { $argv .= "$_=$form->{$_}&" } keys %$form;
+
+ exec ("perl", "ir.pl", $argv);
+
+}
+
+
+sub order { &{ "$form->{db}_order" } };
+
+sub customer_order {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_customer(\%myconfig, \%$form);
+
+ delete $form->{script};
+
+ $form->{action} = "add";
+ $form->{callback} = $form->escape($form->{callback},1);
+
+ $form->{customer} = $form->{name};
+ $form->{customer_id} = $form->{id};
+ $form->{vc} = 'customer';
+
+ $form->{type} = 'sales_order';
+
+ delete $form->{id};
+
+ map { $argv .= "$_=$form->{$_}&" } keys %$form;
+
+ exec ("perl", "oe.pl", $argv);
+
+}
+
+
+sub vendor_order {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_vendor(\%myconfig, \%$form);
+
+ delete $form->{script};
+
+ $form->{action} = "add";
+ $form->{callback} = $form->escape($form->{callback},1);
+
+ $form->{vendor} = $form->{name};
+ $form->{vendor_id} = $form->{id};
+ $form->{vc} = 'vendor';
+
+ $form->{type} = 'purchase_order';
+
+ delete $form->{id};
+
+ map { $argv .= "$_=$form->{$_}&" } keys %$form;
+
+ exec ("perl", "oe.pl", $argv);
+
+}
+
+
+sub save { &{ "save_$form->{db}" } };
+
+sub save_customer {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_customer(\%myconfig, \%$form);
+ $form->redirect($locale->text('Customer saved!'));
+
+}
+
+
+sub save_vendor {
+
+ $form->isblank("name", $locale->text("Name missing!"));
+ CT->save_vendor(\%myconfig, \%$form);
+ $form->redirect($locale->text('Vendor saved!'));
+
+}
+
+
+sub delete { &{ "delete_$form->{db}" } };
+
+sub delete_customer {
+
+ $rc = CT->delete_customer(\%myconfig, \%$form);
+
+ $form->error($locale->text('Transactions exist, cannot delete customer!')) if ($rc == -1);
+ $form->redirect($locale->text('Customer deleted!')) if $rc;
+ $form->error($locale->text('Cannot delete customer!'));
+
+}
+
+
+sub delete_vendor {
+
+ $rc = CT->delete_vendor(\%myconfig, \%$form);
+
+ $form->error($locale->text('Transactions exist, cannot delete vendor!')) if ($rc == -1);
+ $form->redirect($locale->text('Vendor deleted!')) if $rc;
+ $form->error($locale->text('Cannot delete vendor!'));
+
+}
+
+
+sub continue { &{ $form->{nextsub} } };
+
+
diff --git a/sql-ledger/bin/mozilla/gl.pl b/sql-ledger/bin/mozilla/gl.pl
new file mode 100644
index 000000000..0d2dd4628
--- /dev/null
+++ b/sql-ledger/bin/mozilla/gl.pl
@@ -0,0 +1,806 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Genereal Ledger
+#
+#======================================================================
+
+
+use SL::GL;
+use SL::PE;
+
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+
+sub add {
+
+ $form->{title} = "Add";
+
+ $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ # we use this only to set a default date
+ GL->transaction(\%myconfig, \%$form);
+
+ map { $chart .= "<option>$_->{accno}--$_->{description}" } @{ $form->{chart} };
+ $form->{chart} = $chart;
+
+ $form->{rowcount} = 4;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ GL->transaction(\%myconfig, \%$form);
+
+ map { $chart .= "<option>$_->{accno}--$_->{description}" } @{ $form->{chart} };
+ $form->{chart} = $chart;
+
+ $form->{locked} = ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
+
+ $form->{title} = "Edit";
+
+ &form_header;
+
+ $i = 1;
+ foreach $ref (@{ $form->{GL} }) {
+ $form->{"accno_$i"} = $ref->{accno};
+ $form->{"oldprojectnumber_$i"} = $form->{"projectnumber_$i"} = $ref->{projectnumber};
+ $form->{"project_id_$i"} = $ref->{project_id};
+
+ if ($ref->{amount} < 0) {
+ $form->{totaldebit} -= $ref->{amount};
+ $form->{"debit_$i"} = $form->format_amount(\%myconfig, $ref->{amount} * -1, 2);
+ } else {
+ $form->{totalcredit} += $ref->{amount};
+ $form->{"credit_$i"} = ($ref->{amount} > 0) ? $form->format_amount(\%myconfig, $ref->{amount}, 2) : "";
+ }
+
+ &form_row($i++);
+ }
+
+ &form_row($i);
+
+ &form_footer;
+
+}
+
+
+
+sub search {
+
+ $form->{title} = $locale->text('General Ledger')." ".$locale->text('Reports');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=sort value=transdate>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Reference').qq|</th>
+ <td><input name=reference size=20></td>
+ <th align=right>|.$locale->text('Source').qq|</th>
+ <td><input name=source size=20></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td colspan=3><input name=description size=40></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Notes').qq|</th>
+ <td colspan=3><input name=notes size=40></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=datefrom size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=dateto size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Include in Report').qq|</th>
+ <td colspan=3>
+ <table>
+ <tr>
+ <td>
+ <input name="category" class=radio type=radio value=X checked>&nbsp;|.$locale->text('All').qq|
+ <input name="category" class=radio type=radio value=A>&nbsp;|.$locale->text('Asset').qq|
+ <input name="category" class=radio type=radio value=L>&nbsp;|.$locale->text('Liability').qq|
+ <input name="category" class=radio type=radio value=Q>&nbsp;|.$locale->text('Equity').qq|
+ <input name="category" class=radio type=radio value=I>&nbsp;|.$locale->text('Income').qq|
+ <input name="category" class=radio type=radio value=E>&nbsp;|.$locale->text('Expense').qq|
+ </td>
+ </tr>
+ <tr>
+ <table>
+ <tr>
+ <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('ID').qq|</td>
+ <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Date').qq|</td>
+ <td align=right><input name="l_reference" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Reference').qq|</td>
+ <td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Description').qq|</td>
+ <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('Notes').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_debit" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Debit').qq|</td>
+ <td align=right><input name="l_credit" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Credit').qq|</td>
+ <td align=right><input name="l_source" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Source').qq|</td>
+ <td align=right><input name="l_accno" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Account').qq|</td>
+ <td align=right><input name="l_gifi_accno" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('GIFI').qq|</td>
+ </tr>
+ <tr>
+ <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </tr>
+ </table>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=generate_report>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+}
+
+
+sub generate_report {
+
+ GL->all_transactions(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ %acctype = ( 'A' => $locale->text('Asset'),
+ 'L' => $locale->text('Liability'),
+ 'Q' => $locale->text('Equity'),
+ 'I' => $locale->text('Income'),
+ 'E' => $locale->text('Expense'),
+ );
+
+ $form->{title} = $locale->text('General Ledger');
+
+ $ml = ($form->{ml} =~ /(A|E)/) ? -1 : 1;
+
+ unless ($form->{category} eq 'X') {
+ $form->{title} .= " : ".$locale->text($acctype{$form->{category}});
+ }
+ if ($form->{accno}) {
+ $callback .= "&accno=$form->{accno}";
+ $option = $locale->text('Account')." : $form->{accno} $form->{account_description}";
+ }
+ if ($form->{gifi_accno}) {
+ $callback .= "&gifi_accno=$form->{gifi_accno}";
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('GIFI')." : $form->{gifi_accno} $form->{gifi_account_description}";
+ }
+ if ($form->{source}) {
+ $callback .= "&source=".$form->escape($form->{source});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Source')." : $form->{source}";
+ }
+ if ($form->{reference}) {
+ $callback .= "&reference=".$form->escape($form->{reference});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Reference')." : $form->{reference}";
+ }
+ if ($form->{description}) {
+ $callback .= "&description=".$form->escape($form->{description});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Description')." : $form->{description}";
+ }
+ if ($form->{notes}) {
+ $callback .= "&notes=".$form->escape($form->{notes});
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('Notes')." : $form->{notes}";
+ }
+
+ if ($form->{datefrom}) {
+ $callback .= "&datefrom=$form->{datefrom}";
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('From')." ".$locale->date(\%myconfig, $form->{datefrom}, 1);
+ }
+ if ($form->{dateto}) {
+ $callback .= "&dateto=$form->{dateto}";
+ if ($form->{datefrom}) {
+ $option .= " ";
+ } else {
+ $option .= "\n<br>" if $option;
+ }
+ $option .= $locale->text('to')." ".$locale->date(\%myconfig, $form->{dateto}, 1);
+ }
+
+
+ @columns = $form->sort_columns(qw(transdate id reference description notes source debit credit accno gifi_accno));
+
+ if ($form->{accno} || $form->{gifi_accno}) {
+ @columns = grep !/(accno|gifi_accno)/, @columns;
+ push @columns, "balance";
+ $form->{l_balance} = "Y";
+ }
+
+ $href = "$callback&sort=$form->{sort}"; # needed for accno
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ $href .= "&l_subtotal=Y";
+ }
+
+ $callback .= "&category=$form->{category}";
+ $href .= "&category=$form->{category}";
+
+ $column_header{id} = "<th><a class=listheading href=$callback&sort=id>".$locale->text('ID')."</a></th>";
+ $column_header{transdate} = "<th><a class=listheading href=$callback&sort=transdate>".$locale->text('Date')."</a></th>";
+ $column_header{reference} = "<th><a class=listheading href=$callback&sort=reference>".$locale->text('Reference')."</a></th>";
+ $column_header{source} = "<th><a class=listheading href=$callback&sort=source>".$locale->text('Source')."</a></th>";
+ $column_header{description} = "<th><a class=listheading href=$callback&sort=description>".$locale->text('Description')."</a></th>";
+ $column_header{notes} = "<th class=listheading>".$locale->text('Notes')."</th>";
+ $column_header{debit} = "<th class=listheading>".$locale->text('Debit')."</th>";
+ $column_header{credit} = "<th class=listheading>".$locale->text('Credit')."</th>";
+ $column_header{accno} = "<th><a class=listheading href=$callback&sort=accno>".$locale->text('Account')."</a></th>";
+ $column_header{gifi_accno} = "<th><a class=listheading href=$callback&sort=gifi_accno>".$locale->text('GIFI')."</a></th>";
+ $column_header{balance} = "<th class=listheading>".$locale->text('Balance')."</th>";
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+map { print "$column_header{$_}\n" } @column_index;
+
+print "
+ </tr>
+";
+
+ # add sort to callback
+ $form->{callback} = "$callback&sort=$form->{sort}";
+ $callback = $form->escape($form->{callback});
+
+ # initial item for subtotals
+ if (@{ $form->{GL} }) {
+ $sameitem = $form->{GL}->[0]->{$form->{sort}};
+ }
+
+ if (($form->{accno} || $form->{gifi_accno}) && $form->{balance}) {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>";
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+ }
+
+ foreach $ref (@{ $form->{GL} }) {
+
+ # if item ne sort print subtotal
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $ref->{$form->{sort}}) {
+ &gl_subtotal;
+ }
+ }
+
+ $form->{balance} += $ref->{amount};
+
+ $subtotaldebit += $ref->{debit};
+ $subtotalcredit += $ref->{credit};
+
+ $totaldebit += $ref->{debit};
+ $totalcredit += $ref->{credit};
+
+ $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, "&nbsp;");
+ $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, "&nbsp;");
+
+ $column_data{id} = "<td>$ref->{id}</td>";
+ $column_data{transdate} = "<td>$ref->{transdate}</td>";
+ $column_data{reference} = "<td><a href=$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}</td>";
+ $column_data{description} = "<td>$ref->{description}&nbsp;</td>";
+ $column_data{source} = "<td>$ref->{source}&nbsp;</td>";
+ $column_data{notes} = "<td>$ref->{notes}&nbsp;</td>";
+ $column_data{debit} = "<td align=right>$ref->{debit}</td>";
+ $column_data{credit} = "<td align=right>$ref->{credit}</td>";
+ $column_data{accno} = "<td><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{accno}</a></td>";
+ $column_data{gifi_accno} = "<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a>&nbsp;</td>";
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>";
+
+ $i++; $i %= 2;
+ print "
+ <tr class=listrow$i>";
+ map { print "$column_data{$_}\n" } @column_index;
+ print "</tr>";
+
+ }
+
+
+ &gl_subtotal if ($form->{l_subtotal} eq 'Y');
+
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{debit} = "<th align=right>".$form->format_amount(\%myconfig, $totaldebit, 2, "&nbsp;")."</th>";
+ $column_data{credit} = "<th align=right>".$form->format_amount(\%myconfig, $totalcredit, 2, "&nbsp;")."</th>";
+ $column_data{balance} = "<th align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</th>";
+
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('GL Transaction').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('AR Transaction').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('AP Transaction').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Sales Invoice').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Vendor Invoice').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub gl_subtotal {
+
+ $subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, 2, "&nbsp;");
+ $subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, 2, "&nbsp;");
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } qw(transdate id reference source description accno);
+ $column_data{debit} = "<th class=listsubtotal align=right>$subtotaldebit</td>";
+ $column_data{credit} = "<th class=listsubtotal align=right>$subtotalcredit</td>";
+
+
+ print "<tr class=listsubtotal>";
+ map { print "$column_data{$_}\n" } @column_index;
+ print "</tr>";
+
+ $subtotaldebit = 0;
+ $subtotalcredit = 0;
+
+ $sameitem = $ref->{$form->{sort}};
+
+}
+
+
+sub update {
+
+ @a = ();
+ $count = 0;
+ @flds = (qw(accno debit credit projectnumber project_id));
+
+ for $i (1 .. $form->{rowcount}) {
+ unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) {
+ # take accno apart
+ ($form->{"accno_$i"}) = split(/--/, $form->{"accno_$i"});
+
+ push @a, {};
+ $j = $#a;
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ for $i (1 .. $count) {
+ $j = $i - 1;
+ map { $form->{"${_}_$i"} = $a[$j]->{$_} } @flds;
+ }
+
+ for $i ($count + 1 .. $form->{rowcount}) {
+ map { delete $form->{"${_}_$i"} } @flds;
+ }
+
+ $form->{rowcount} = $count;
+
+ &check_project;
+
+ &display_form;
+
+}
+
+
+sub display_form {
+
+ &form_header;
+
+ $form->{rowcount}++;
+ $form->{totaldebit} = 0;
+ $form->{totalcredit} = 0;
+
+ for $i (1 .. $form->{rowcount}) {
+ $form->{totaldebit} += $form->parse_amount(\%myconfig, $form->{"debit_$i"});
+ $form->{totalcredit} += $form->parse_amount(\%myconfig, $form->{"credit_$i"});
+
+ &form_row($i);
+ }
+
+ &form_footer;
+
+}
+
+
+sub form_row {
+ my $i = shift;
+
+ my $chart = $form->{chart};
+ $chart =~ s/<option>$form->{"accno_$i"}/<option selected>$form->{"accno_$i"}/;
+
+ print qq|<tr>
+ <td><select name="accno_$i">$chart</select></td>
+ <td><input name="debit_$i" size=12 value=$form->{"debit_$i"}></td>
+ <td><input name="credit_$i" size=12 value=$form->{"credit_$i"}></td>
+ <td><input name="projectnumber_$i" size=12 value="$form->{"projectnumber_$i"}">
+ <input type=hidden name="project_id_$i" value=$form->{"project_id_$i"}>
+ <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}"></td>
+</tr>
+<input type=hidden name=rowcount value=$i>
+
+|;
+
+}
+
+
+sub form_header {
+
+ $title = $form->{title};
+ $form->{title} = $locale->text("$title General Ledger Transaction");
+
+# $locale->text('Add General Ledger Transaction')
+# $locale->text('Edit General Ledger Transaction')
+
+ map { $form->{$_} =~ s/"/&quot;/g } qw(reference description chart);
+
+ if (($rows = $form->numtextrows($form->{description}, 50)) > 1) {
+ $description = qq|<textarea name=description rows=$rows cols=50 wrap=soft>$form->{description}</textarea>|;
+ } else {
+ $description = qq|<input name=description size=50 value="$form->{description}">|;
+ }
+
+ if (($rows = $form->numtextrows($form->{notes}, 50)) > 1) {
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+ } else {
+ $notes = qq|<input name=notes size=50 value="$form->{notes}">|;
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input name=id type=hidden value=$form->{id}>
+
+<input name=chart type=hidden value="$form->{chart}">
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=locked value=$form->{locked}>
+<input type=hidden name=title value="$title">
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right>|.$locale->text('Reference').qq|</th>
+ <td><input name=reference size=20 value="$form->{reference}"></td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Date').qq|</th>
+ <td><input name=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td colspan=2>$description</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Notes').qq|</th>
+ <td colspan=2>$notes</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+ <th class=listheading>|.$locale->text('Account').qq|</th>
+ <th class=listheading>|.$locale->text('Debit').qq|</th>
+ <th class=listheading>|.$locale->text('Credit').qq|</th>
+ <th class=listheading>|.$locale->text('Project').qq|</th>
+ </tr>
+|;
+
+}
+
+
+sub form_footer {
+
+ ($dec) = ($form->{totaldebit} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces, "&nbsp;") } qw(totaldebit totalcredit);
+
+ print qq|
+ <tr class=listtotal>
+ <th>&nbsp;</th>
+ <th class=listtotal align=right>$form->{totaldebit}</th>
+ <th class=listtotal align=right>$form->{totalcredit}</th>
+ <th>&nbsp;</th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<br>
+|;
+
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ if ($form->{id}) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+|;
+
+ if (!$form->{revtrans}) {
+ if (!$form->{locked}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+|;
+ }
+ }
+
+ if ($transdate > $closedto) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
+|;
+ }
+
+ } else {
+ if ($transdate > $closedto) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+ }
+ }
+
+ print "</form>
+
+</body>
+</html>
+";
+
+}
+
+
+sub delete {
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ map { $form->{$_} =~ s/"/&quot;/g } qw(reference description chart);
+
+ foreach $key (keys %$form) {
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>|.$locale->text('Confirm!').qq|</h2>
+
+<h4>|.$locale->text('Are you sure you want to delete Transaction').qq| $form->{reference}</h4>
+
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+|;
+
+}
+
+
+sub yes {
+
+ $form->redirect($locale->text('Transaction deleted!')) if (GL->delete_transaction(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete transaction!'));
+
+}
+
+
+sub post {
+
+ # check if there is something in reference and date
+ $form->isblank("reference", $locale->text('Reference missing!'));
+ $form->isblank("transdate", $locale->text('Transaction Date missing!'));
+
+ $transdate = $form->datetonum($form->{transdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ # check project
+ &check_project;
+
+ # this is just for the wise guys
+ $form->error($locale->text('Cannot post transaction for a closed period!')) if ($transdate <= $closedto);
+
+ if (($errno = GL->post_transaction(\%myconfig, \%$form)) <= -1) {
+ $errno *= -1;
+ $err[1] = $locale->text('Cannot have a value in both Debit and Credit!');
+ $err[2] = $locale->text('Debit and credit out of balance!');
+ $err[3] = $locale->text('Cannot post a transaction without a value!');
+
+ $form->error($err[$errno]);
+ }
+
+ $form->redirect($locale->text('Transaction posted!'));
+
+}
+
+
+sub post_as_new {
+
+ $form->{id} = 0;
+ &post;
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/ic.pl b/sql-ledger/bin/mozilla/ic.pl
new file mode 100644
index 000000000..797daee01
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ic.pl
@@ -0,0 +1,1638 @@
+#=====================================================================
+# SQL-Ledger, Accounting
+# Copyright (c) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory Control module
+#
+#======================================================================
+
+
+use SL::IC;
+
+require "$form->{path}/io.pl";
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
+
+ $form->{callback} = "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ $form->{unit} = ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
+
+ &link_part;
+
+ &display_form;
+
+}
+
+
+sub search {
+
+ $form->{title} = (ucfirst $form->{searchitems})."s";
+ $form->{title} = $locale->text($form->{title});
+
+# $locale->text('Parts')
+# $locale->text('Services')
+
+ unless ($form->{searchitems} eq 'service') {
+
+ $onhand = qq|
+ <input name=itemstatus class=radio type=radio value=onhand>&nbsp;|.$locale->text('On Hand').qq|
+ <input name=itemstatus class=radio type=radio value=short>&nbsp;|.$locale->text('Short').qq|
+|;
+
+ $makemodel = qq|
+ <tr>
+ <th width="1%" align=right nowrap>|.$locale->text('Make').qq|</th>
+ <td><input name=make size=20></td>
+ <th width="1%" align=right nowrap>|.$locale->text('Model').qq|</th>
+ <td><input name=model size=20></td>
+ </tr>
+|;
+ }
+
+ if ($form->{searchitems} eq 'assembly') {
+
+ $form->{title} = $locale->text('Assemblies');
+
+ $toplevel = qq|
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <input name=none class=radio type=radio value=1 checked>&nbsp;|.$locale->text('Top Level').qq|
+ <input name=bom class=checkbox type=checkbox value=1>&nbsp;|.$locale->text('Individual Items').qq|
+ </td>
+ </tr>
+|;
+
+ $bought = qq|
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <table>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <td><input name=sold class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('Sold').qq|</td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=1 noshade></td>
+ </tr>
+ <tr>
+ <td><input name=ordered class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('Ordered').qq|</td>
+ </tr>
+ </table>
+ </td>
+ <td width=5%>&nbsp;</td>
+ <th>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
+ <th>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
+
+ <td><input name=closed class=checkbox type=checkbox value=1>&nbsp;|.$locale->text('Closed').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+ } else {
+
+ $bought = qq|
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <table>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <td><input name=bought class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('Bought').qq|</td>
+ <td><input name=sold class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('Sold').qq|</td>
+ </tr>
+ <tr>
+ <td colspan=4><hr size=1 noshade></td>
+ </tr>
+ <tr>
+ <td><input name=onorder class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('On Order').qq|</td>
+ <td><input name=ordered class=checkbox type=checkbox value=1></td>
+ <td nowrap>|.$locale->text('Ordered').qq|</td>
+ </tr>
+ </table>
+ </td>
+ <td width=5%>&nbsp;</td>
+ <td>
+ <table>
+ <tr>
+ <th>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
+ <th>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
+
+ <td><input name=closed class=checkbox type=checkbox value=1>&nbsp;|.$locale->text('Closed').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+ }
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=searchitems value=$form->{searchitems}>
+<input type=hidden name=title value="$form->{title}">
+
+<table width="100%">
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th width=1% align=right nowrap>|.$locale->text('Number').qq|</th>
+ <td><input name=partnumber size=20></td>
+ <th align=right nowrap>|.$locale->text('Description').qq|</th>
+ <td><input name=description size=40></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Group').qq|</th>
+ <td><input name=partsgroup size=20></td>
+ </tr>
+ $makemodel
+ <tr>
+ <th align=right nowrap>|.$locale->text('Drawing').qq|</th>
+ <td><input name=drawing size=20></td>
+ <th align=right nowrap>|.$locale->text('Microfiche').qq|</th>
+ <td><input name=microfiche size=20></td>
+ </tr>
+ $toplevel
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <input name=itemstatus class=radio type=radio value=active checked>&nbsp;|.$locale->text('Active').qq|
+ $onhand
+ <input name=itemstatus class=radio type=radio value=obsolete>&nbsp;|.$locale->text('Obsolete').qq|
+ <input name=itemstatus class=radio type=radio value=orphaned>&nbsp;|.$locale->text('Orphaned').qq|
+ </td>
+ </tr>
+ $bought
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <hr size=1 noshade>
+ </td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td colspan=3>
+ <table>
+ <tr>
+ <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked>&nbsp;|.$locale->text('Number').qq|</td>
+ <td><input name=l_description class=checkbox type=checkbox value=Y checked>&nbsp;|.$locale->text('Description').qq|</td>
+ <td><input name=l_unit class=checkbox type=checkbox value=Y checked>&nbsp;|.$locale->text('Unit of measure').qq|</td>
+ </tr>
+ <tr>
+ <td><input name=l_listprice class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('List Price').qq|</td>
+ <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked>&nbsp;|.$locale->text('Sell Price').qq|</td>
+ <td><input name=l_lastcost class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Last Cost').qq|</td>
+ <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked>&nbsp;|.$locale->text('Line Total').qq|</td>
+ </tr>
+ <tr>
+ <td><input name=l_priceupdate class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Updated').qq|</td>
+ <td><input name=l_bin class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Bin').qq|</td>
+ <td><input name=l_rop class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('ROP').qq|</td>
+ <td><input name=l_weight class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Weight').qq|</td>
+ </tr>
+ <tr>
+ <td><input name=l_image class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Image').qq|</td>
+ <td><input name=l_drawing class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Drawing').qq|</td>
+ <td><input name=l_microfiche class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Microfiche').qq|</td>
+ <td><input name=l_partsgroup class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Group').qq|</td>
+ </tr>
+ <tr>
+ <td><input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td colspan=4><hr size=3 noshade></td></tr>
+</table>
+
+<input type=hidden name=nextsub value=generate_report>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub generate_report {
+
+ # setup $form->{sort}
+ unless ($form->{sort}) {
+ if ($form->{description} && !($form->{partnumber})) {
+ $form->{sort} = "description";
+ } else {
+ $form->{sort} = "partnumber";
+ }
+ }
+
+ $callback = "$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}&searchitems=$form->{searchitems}&itemstatus=$form->{itemstatus}&bom=$form->{bom}&l_linetotal=$form->{l_linetotal}&title=".$form->escape($form->{title},1);
+
+ IC->all_parts(\%myconfig, \%$form);
+
+
+ if ($form->{itemstatus} eq 'active') {
+ $option .= $locale->text('Active')." : ";
+ }
+ if ($form->{itemstatus} eq 'obsolete') {
+ $option .= $locale->text('Obsolete')." : ";
+ }
+ if ($form->{itemstatus} eq 'orphaned') {
+ $option .= $locale->text('Orphaned')." : ";
+ }
+ if ($form->{itemstatus} eq 'onhand') {
+ $option .= $locale->text('On Hand')." : ";
+ $form->{l_onhand} = "Y";
+ }
+ if ($form->{itemstatus} eq 'short') {
+ $option .= $locale->text('Short')." : ";
+ $form->{l_onhand} = "Y";
+ }
+ if ($form->{onorder}) {
+ $form->{l_ordnumber} = "Y";
+ $callback .= "&onorder=$form->{onorder}";
+ $option .= $locale->text('On Order')." : ";
+ }
+ if ($form->{ordered}) {
+ $form->{l_ordnumber} = "Y";
+ $callback .= "&ordered=$form->{ordered}";
+ $option .= $locale->text('Ordered')." : ";
+ }
+ if ($form->{closed}) {
+ $callback .= "&closed=$form->{closed}";
+ $option .= $locale->text('Closed')." : ";
+ }
+ if ($form->{bought}) {
+ $form->{l_invnumber} = "Y";
+ $callback .= "&bought=$form->{bought}";
+ $option .= $locale->text('Bought')." : ";
+ }
+ if ($form->{sold}) {
+ $form->{l_invnumber} = "Y";
+ $callback .= "&sold=$form->{sold}";
+ $option .= $locale->text('Sold')." : ";
+ }
+ if ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
+
+ $form->{l_lastcost} = "";
+ if ($form->{transdatefrom}) {
+ $callback .= "&transdatefrom=$form->{transdatefrom}";
+ $option .= "\n<br>".$locale->text('From')."&nbsp;".$locale->date(\%myconfig, $form->{transdatefrom}, 1);
+ }
+ if ($form->{transdateto}) {
+ $callback .= "&transdateto=$form->{transdateto}";
+ $option .= "\n<br>".$locale->text('to')."&nbsp;".$locale->date(\%myconfig, $form->{transdateto}, 1);
+ }
+ }
+
+ $option .= "<br>";
+
+ if ($form->{partnumber}) {
+ $callback .= "&partnumber=$form->{partnumber}";
+ $option .= $locale->text('Number').qq| : $form->{partnumber}<br>|;
+ }
+ if ($form->{description}) {
+ $callback .= "&description=$form->{description}";
+ $option .= $locale->text('Description').qq| : $form->{description}<br>|;
+ }
+ if ($form->{make}) {
+ $callback .= "&make=$form->{make}";
+ $option .= $locale->text('Make').qq| : $form->{make}<br>|;
+ }
+ if ($form->{model}) {
+ $callback .= "&model=$form->{model}";
+ $option .= $locale->text('Model').qq| : $form->{model}<br>|;
+ }
+ if ($form->{drawing}) {
+ $callback .= "&drawing=$form->{drawing}";
+ $option .= $locale->text('Drawing').qq| : $form->{drawing}<br>|;
+ }
+ if ($form->{microfiche}) {
+ $callback .= "&microfiche=$form->{microfiche}";
+ $option .= $locale->text('Microfiche').qq| : $form->{microfiche}<br>|;
+ }
+ if ($form->{partsgroup}) {
+ $callback .= "&partsgroup=$form->{partsgroup}";
+ $option .= $locale->text('Group').qq| : $form->{partsgroup}<br>|;
+ }
+
+
+ @columns = $form->sort_columns(qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber));
+
+ if ($form->{l_linetotal}) {
+ $form->{l_onhand} = "Y";
+ $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
+ if ($form->{l_lastcost}) {
+ $form->{l_linetotallastcost} = "Y";
+ if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
+ $form->{l_linetotallastcost} = "";
+ }
+ }
+ $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
+ }
+
+ if ($form->{searchitems} eq 'service') {
+ # remove bin, weight and rop from list
+ map { $form->{"l_$_"} = "" } qw(bin weight rop);
+
+ $form->{l_onhand} = "";
+ # qty is irrelevant unless bought or sold
+ if ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
+ $form->{l_onhand} = "Y";
+ } else {
+ $form->{l_linetotalsellprice} = "";
+ $form->{l_linetotallastcost} = "";
+ }
+ }
+
+ $form->{l_lastcost} = "" if ($form->{searchitems} eq 'assembly' && !$form->{bom});
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to callback
+ $callback .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ }
+
+ $column_header{partnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=partnumber>|.$locale->text('Number').qq|</a></th>|;
+ $column_header{description} = qq|<th nowrap><a class=listheading href=$callback&sort=description>|.$locale->text('Description').qq|</a></th>|;
+ $column_header{partsgroup} = qq|<th nowrap><a class=listheading href=$callback&sort=partsgroup>|.$locale->text('Group').qq|</a></th>|;
+ $column_header{bin} = qq|<th><a class=listheading href=$callback&sort=bin>|.$locale->text('Bin').qq|</a></th>|;
+ $column_header{priceupdate} = qq|<th nowrap><a class=listheading href=$callback&sort=priceupdate>|.$locale->text('Updated').qq|</a></th>|;
+ $column_header{onhand} = qq|<th class=listheading nowrap>|.$locale->text('Qty').qq|</th>|;
+ $column_header{unit} = qq|<th class=listheading nowrap>|.$locale->text('Unit').qq|</th>|;
+ $column_header{listprice} = qq|<th class=listheading nowrap>|.$locale->text('List Price').qq|</th>|;
+ $column_header{lastcost} = qq|<th class=listheading nowrap>|.$locale->text('Last Cost').qq|</th>|;
+ $column_header{rop} = qq|<th class=listheading nowrap>|.$locale->text('ROP').qq|</th>|;
+ $column_header{weight} = qq|<th class=listheading nowrap>|.$locale->text('Weight').qq|</th>|;
+
+ $column_header{invnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=invnumber>|.$locale->text('Invoice Number').qq|</a></th>|;
+ $column_header{ordnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=ordnumber>|.$locale->text('Order Number').qq|</a></th>|;
+
+ $column_header{sellprice} = qq|<th class=listheading nowrap>|.$locale->text('Sell Price').qq|</th>|;
+ $column_header{linetotalsellprice} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
+ $column_header{linetotallastcost} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
+ $column_header{linetotallistprice} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
+
+ $column_header{image} = qq|<th class=listheading nowrap>|.$locale->text('Image').qq|</a></th>|;
+ $column_header{drawing} = qq|<th nowrap><a class=listheading href=$callback&sort=drawing>|.$locale->text('Drawing').qq|</a></th>|;
+ $column_header{microfiche} = qq|<th nowrap><a class=listheading href=$callback&sort=microfiche>|.$locale->text('Microfiche').qq|</a></th>|;
+
+ $form->header;
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<table width=100%>
+<tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
+<tr height="5"></tr>
+
+<tr><td colspan=$colspan>$option</td></tr>
+
+ <tr class=listheading>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+ |;
+
+
+ # add order to callback
+ $form->{callback} = $callback .= "&sort=$form->{sort}";
+
+ # escape callback for href
+ $callback = $form->escape($callback);
+
+ if (@{ $form->{parts} }) {
+ $sameitem = $form->{parts}->[0]->{$form->{sort}};
+ }
+
+ foreach $ref (@{ $form->{parts} }) {
+
+ if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
+ if ($sameitem ne $ref->{$form->{sort}}) {
+ &parts_subtotal;
+ $sameitem = $ref->{$form->{sort}};
+ }
+ }
+
+ $ref->{exchangerate} = 1 unless $ref->{exchangerate};
+ $ref->{sellprice} *= $ref->{exchangerate};
+ $ref->{listprice} *= $ref->{exchangerate};
+ $ref->{lastcost} *= $ref->{exchangerate};
+
+ $align = "left";
+ $onhand = $ref->{onhand};
+
+ if ($ref->{assemblyitem}) {
+ $align = "right";
+ $onhand = 0 if ($form->{sold});
+ }
+
+ $column_data{partnumber} = "<td align=$align><a href=$form->{script}?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partnumber}&nbsp;</a></td>";
+ $column_data{description} = "<td>$ref->{description}&nbsp;</td>";
+ $column_data{partsgroup} = "<td>$ref->{partsgroup}&nbsp;</td>";
+
+ $column_data{onhand} = "<td align=right>".$form->format_amount(\%myconfig, $onhand, '', "&nbsp;")."</td>";
+ $column_data{sellprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{sellprice}, 2, "&nbsp;") . "</td>";
+ $column_data{listprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{listprice}, 2, "&nbsp;") . "</td>";
+ $column_data{lastcost} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{lastcost}, 2, "&nbsp;") . "</td>";
+
+ $column_data{linetotalsellprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2, "&nbsp;")."</td>";
+ $column_data{linetotallastcost} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2, "&nbsp;")."</td>";
+ $column_data{linetotallistprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2, "&nbsp;")."</td>";
+
+ if (!$ref->{assemblyitem}) {
+ $totalsellprice += $onhand * $ref->{sellprice};
+ $totallastcost += $onhand * $ref->{lastcost};
+ $totallistprice += $onhand * $ref->{listprice};
+
+ $subtotalonhand += $onhand;
+ $subtotalsellprice += $onhand * $ref->{sellprice};
+ $subtotallastcost += $onhand * $ref->{lastcost};
+ $subtotallistprice += $onhand * $ref->{listprice};
+ }
+
+ $column_data{rop} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;")."</td>";
+ $column_data{weight} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{weight}, '', "&nbsp;")."</td>";
+ $column_data{unit} = "<td>$ref->{unit}&nbsp;</td>";
+ $column_data{bin} = "<td>$ref->{bin}&nbsp;</td>";
+ $column_data{priceupdate} = "<td>$ref->{priceupdate}&nbsp;</td>";
+
+ $column_data{invnumber} = ($ref->{module} ne 'oe') ? "<td><a href=$ref->{module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}&nbsp;</a></td>" : "<td>$ref->{invnumber}&nbsp;</td>";
+ $column_data{ordnumber} = ($ref->{module} eq 'oe') ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber}&nbsp;</a></td>" : "<td>$ref->{ordnumber}&nbsp;</td>";
+
+ $column_data{image} = ($ref->{image}) ? "<td><a href=$ref->{image}><img src=$ref->{image} height=32 border=0></a></td>" : "<td>&nbsp;</td>";
+ $column_data{drawing} = ($ref->{drawing}) ? "<td><a href=$ref->{drawing}>$ref->{drawing}</a></td>" : "<td>&nbsp;</td>";
+ $column_data{microfiche} = ($ref->{microfiche}) ? "<td><a href=$ref->{microfiche}>$ref->{microfiche}</a></td>" : "<td>&nbsp;</td>";
+
+ $i++; $i %= 2;
+ print "<tr class=listrow$i>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &parts_subtotal;
+ }
+
+ if ($form->{"l_linetotal"}) {
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+ $column_data{linetotalsellprice} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalsellprice, 2, "&nbsp;")."</th>";
+ $column_data{linetotallastcost} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totallastcost, 2, "&nbsp;")."</th>";
+ $column_data{linetotallistprice} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totallistprice, 2, "&nbsp;")."</th>";
+
+ print "<tr class=listtotal>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|</tr>
+ |;
+ }
+
+ print qq|
+ <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
+</table>
+
+|;
+
+
+ print qq|
+
+<br>
+
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=item value=$form->{searchitems}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Add').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub parts_subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+ $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
+
+ $column_data{onhand} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalonhand, '', "&nbsp;")."</th>";
+ $column_data{sellprice} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalsellprice, 2, "&nbsp;")."</th>";
+ $column_data{listprice} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotallistprice, 2, "&nbsp;")."</th>";
+ $column_data{lastcost} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotallastcost, 2, "&nbsp;")."</th>";
+
+ $subtotalonhand = 0;
+ $subtotalsellprice = 0;
+ $subtotallistprice = 0;
+ $subtotallastcost = 0;
+
+ print "<tr class=listsubtotal>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+}
+
+
+
+sub edit {
+
+ IC->get_part(\%myconfig, \%$form);
+
+ $form->{title} = $locale->text('Edit '.ucfirst $form->{item});
+
+ &link_part;
+ &display_form;
+
+}
+
+
+
+sub link_part {
+
+ IC->create_links("IC", \%myconfig, \%$form);
+
+ # parts and assemblies have the same links
+ $item = $form->{item};
+ if ($form->{item} eq 'assembly') {
+ $item = 'part';
+ }
+
+ # build the popup menus
+ $form->{taxaccounts} = "";
+ foreach $key (keys %{ $form->{IC_links} }) {
+ foreach $ref (@{ $form->{IC_links}{$key} }) {
+ # if this is a tax field
+ if ($key =~ /IC_tax/) {
+ if ($key =~ /$item/) {
+ $form->{taxaccounts} .= "$ref->{accno} ";
+ $form->{"IC_tax_$ref->{accno}_description"} = "$ref->{accno}--$ref->{description}";
+
+ if ($form->{id}) {
+ if ($form->{amount}{$ref->{accno}}) {
+ $form->{"IC_tax_$ref->{accno}"} = "checked";
+ }
+ } else {
+ $form->{"IC_tax_$ref->{accno}"} = "checked";
+ }
+ }
+ } else {
+
+ $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
+ if ($form->{amount}{$key} eq $ref->{accno}) {
+ $form->{$key} = "$ref->{accno}--$ref->{description}";
+ }
+
+ }
+ }
+ }
+ chop $form->{taxaccounts};
+
+ if (($form->{item} eq "part") || ($form->{item} eq "assembly")) {
+ $form->{selectIC_income} = $form->{selectIC_sale};
+ $form->{selectIC_expense} = $form->{selectIC_cogs};
+ $form->{IC_income} = $form->{IC_sale};
+ $form->{IC_expense} = $form->{IC_cogs};
+ }
+
+ delete $form->{IC_links};
+ delete $form->{amount};
+
+}
+
+
+
+sub form_header {
+
+ ($dec) = ($form->{sellprice} =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces)} qw(listprice sellprice);
+
+ ($dec) = ($form->{lastcost} =~ /\.(\d+)/);
+ $dec = length $dec;
+ my $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $form->{lastcost} = $form->format_amount(\%myconfig, $form->{lastcost}, $decimalplaces);
+
+ map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) } qw(weight rop stock);
+
+ foreach $item (qw(partnumber description unit notes)) {
+ $form->{$item} =~ s/"/&quot;/g;
+ }
+
+
+ if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
+ $rows = 2;
+ }
+
+ $notes = qq|<textarea name=notes rows=$rows cols=40 wrap=soft>$form->{notes}</textarea>|;
+
+ if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
+ $description = qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
+ } else {
+ $description = qq|<input name=description size=40 value="$form->{description}">|;
+ }
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
+ }
+
+
+ # set option
+ foreach $item (qw(IC IC_income IC_expense)) {
+ if ($form->{$item}) {
+ if ($form->{id} && $form->{orphaned}) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+
+ } else {
+ $form->{"select$item"} = qq|<option selected>$form->{$item}|;
+ }
+ }
+ }
+
+ # tax fields
+ foreach $item (split / /, $form->{taxaccounts}) {
+ $tax .= qq|
+ <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}>&nbsp;<b>$form->{"IC_tax_${item}_description"}</b>
+ <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
+|;
+ }
+
+ $form->{obsolete} = "checked" if $form->{obsolete};
+
+ $lastcost = qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Last Cost').qq|</th>
+ <td><input name=lastcost size=11 value=$form->{lastcost}></td>
+ </tr>
+|;
+
+ if ($form->{item} eq "part") {
+
+ $linkaccounts = qq|
+ <tr>
+ <th width="1%" align=right>|.$locale->text('Inventory').qq|</th>
+ <td><select name=IC>$form->{selectIC}</select></td>
+ <input name=selectIC type=hidden value="$form->{selectIC}">
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Sales').qq|</th>
+ <td><select name=IC_income>$form->{selectIC_income}</select></td>
+ <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('COGS').qq|</th>
+ <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
+ <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
+ </tr>
+|;
+
+ if ($tax) {
+ $linkaccounts .= qq|
+ <tr>
+ <th align=right>|.$locale->text('Tax').qq|</th>
+ <td>$tax</td>
+ </tr>
+|;
+ }
+
+ $weight = qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
+ <td>
+ <table>
+ <tr>
+ <td>
+ <input name=weight size=10 value=$form->{weight}>
+ </td>
+ <th>
+ &nbsp;
+ $form->{weightunit}
+ <input type=hidden name=weightunit value=$form->{weightunit}>
+ </th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+ }
+
+
+ if ($form->{item} eq "assembly") {
+
+ $lastcost = "";
+
+ $linkaccounts = qq|
+ <tr>
+ <th width="1%" align=right>|.$locale->text('Sales').qq|</th>
+ <td><select name=IC_income>$form->{selectIC_income}</select></td>
+ <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
+ </tr>
+|;
+
+ if ($tax) {
+ $linkaccounts .= qq|
+ <tr>
+ <th align=right>|.$locale->text('Tax').qq|</th>
+ <td>$tax</td>
+ </tr>
+|;
+ }
+
+ $weight = qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
+ <td>
+ <table>
+ <tr>
+ <td>
+ &nbsp;$form->{weight}
+ <input type=hidden name=weight value=$form->{weight}>
+ </td>
+ <th>
+ &nbsp;
+ $form->{weightunit}
+ <input type=hidden name=weightunit value=$form->{weightunit}>
+ </th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+
+ }
+
+
+ if ($form->{item} eq "service") {
+
+ $linkaccounts = qq|
+ <tr>
+ <th width="1%" align=right>|.$locale->text('Income').qq|</th>
+ <td><select name=IC_income>$form->{selectIC_income}</select></td>
+ <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Expense').qq|</th>
+ <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
+ <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
+ </tr>
+|;
+
+ if ($tax) {
+ $linkaccounts .= qq|
+ <tr>
+ <th align=right>|.$locale->text('Tax').qq|</th>
+ <td>$tax</td>
+ </tr>
+|;
+ }
+
+ }
+
+
+ if ($form->{item} ne 'service') {
+ $color = ($form->{onhand} > 0) ? "green" : "red";
+ $rop = qq|
+ <tr>
+ <th align="right" nowrap>|.$locale->text('On Hand').qq|</th>
+ <th align=left nowrap>&nbsp;|.$form->format_amount(\%myconfig, $form->{onhand}).qq|</th>
+ </tr>
+|;
+
+ if ($form->{item} eq 'assembly') {
+ $rop .= qq|
+ <tr>
+ <th align="right" nowrap>|.$locale->text('Stock').qq|</th>
+ <td><input name=stock size=10 value=$form->{stock}></td>
+ </tr>
+|;
+ }
+
+ $rop .= qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('ROP').qq|</th>
+ <td><input name=rop size=10 value=$form->{rop}></td>
+ </tr>
+|;
+
+ $bin = qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Bin').qq|</th>
+ <td><input name=bin size=10 value=$form->{bin}></td>
+ </tr>
+|;
+
+ $imagelinks = qq|
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th width=1% align=right nowrap>|.$locale->text('Image').qq|</th>
+ <td width=70%><input name=image size=40 value="$form->{image}"></td>
+
+ </tr>
+ <tr>
+ <th width=1% align=right nowrap>|.$locale->text('Drawing').qq|</th>
+ <td width=70%><input name=drawing size=40 value="$form->{drawing}"></td>
+ <th width=1% align=right nowrap>|.$locale->text('Microfiche').qq|</th>
+ <td width=30%><input name=microfiche size=20 value="$form->{microfiche}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+ }
+
+ if ($form->{id}) {
+ $obsolete = qq|
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Obsolete').qq|</th>
+ <td><input name=obsolete type=checkbox class=checkbox value=1 $form->{obsolete}></td>
+ </tr>
+|;
+ }
+
+
+
+# type=submit $locale->text('Add Part')
+# type=submit $locale->text('Add Service')
+# type=submit $locale->text('Add Assembly')
+
+# type=submit $locale->text('Edit Part')
+# type=submit $locale->text('Edit Service')
+# type=submit $locale->text('Edit Assembly')
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input name=id type=hidden value=$form->{id}>
+<input name=item type=hidden value=$form->{item}>
+<input name=title type=hidden value="$form->{title}">
+<input name=makemodel type=hidden value="$form->{makemodel}">
+<input name=alternate type=hidden value="$form->{alternate}">
+<input name=onhand type=hidden value=$form->{onhand}>
+<input name=orphaned type=hidden value=$form->{orphaned}>
+<input name=taxaccounts type=hidden value="$form->{taxaccounts}">
+<input name=rowcount type=hidden value=$form->{rowcount}>
+
+<table width="100%">
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+ <th align=left>|.$locale->text('Number').qq|</th>
+ <th align=left>|.$locale->text('Description').qq|</th>
+ <th align=left>|.$locale->text('Group').qq|</th>
+ </tr>
+ <tr valign=top>
+ <td><input name=partnumber value="$form->{partnumber}" size=20></td>
+ <td>$description</td>
+ <td><input name=partsgroup size=20 value="$form->{partsgroup}"></td>
+ <input type=hidden name=oldpartsgroup value="$form->{oldpartsgroup}">
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width="100%" height="100%">
+ <tr valign=top>
+ <td width=70%>
+ <table width="100%" height="100%">
+ <tr class="listheading">
+ <th class="listheading" align="center" colspan=2>|.$locale->text('Link Accounts').qq|</th>
+ </tr>
+ $linkaccounts
+ <tr>
+ <th align="left">|.$locale->text('Notes').qq|</th>
+ </tr>
+ <tr>
+ <td colspan=2>
+ $notes
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td width="30%">
+ <table width="100%">
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Updated').qq|</th>
+ <td><input name=priceupdate size=11 title="$myconfig{dateformat}" value=$form->{priceupdate}></td>
+ </tr>
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('List Price').qq|</th>
+ <td><input name=listprice size=11 value=$form->{listprice}></td>
+ </tr>
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Sell Price').qq|</th>
+ <td><input name=sellprice size=11 value=$form->{sellprice}></td>
+ </tr>
+ $lastcost
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Unit').qq|</th>
+ <td><input name=unit size=5 maxsize=5 value="$form->{unit}"></td>
+ </tr>
+ $weight
+ $rop
+ $bin
+ $obsolete
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ $imagelinks
+|;
+}
+
+
+sub form_footer {
+
+ if ($form->{item} eq "assembly") {
+
+ print qq|
+ <tr>
+ <td>
+ <table width="100%">
+ <tr>
+ <th colspan=2 align=right>|.$locale->text('Total').qq|&nbsp;</th>
+ <th width="1%" align=right>|.$form->format_amount(\%myconfig, $form->{assemblytotal}, 2).qq|</th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <input type=hidden name=assembly_rows value=$form->{assembly_rows}>
+|;
+ }
+
+ print qq|
+ <input type=hidden name=path value=$form->{path}>
+ <input type=hidden name=login value=$form->{login}>
+ <input type=hidden name=password value=$form->{password}>
+ <input type=hidden name=callback value="$form->{callback}">
+ <input type=hidden name=previous_form value="$form->{previous_form}">
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+|;
+
+ if ($form->{item} ne "service") {
+ print qq|
+ <input type=hidden name=makemodel_rows value=$form->{makemodel_rows}>
+ |;
+ }
+
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Save').qq|">|;
+
+ if ($form->{id}) {
+
+ if (! $form->{previous_form}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Save as new').qq|">|;
+ }
+
+ if ($form->{orphaned}) {
+ if (! $form->{previous_form}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">|;
+ }
+ }
+
+ }
+
+ print qq|
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub makemodel_row {
+ my ($numrows) = @_;
+
+ $form->{"make_$i"} =~ s/"/&quot;/g;
+ $form->{"model_$i"} =~ s/"/&quot;/g;
+
+ print qq|
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th class="listheading">|.$locale->text('Make').qq|</th>
+ <th class="listheading">|.$locale->text('Model').qq|</th>
+ </tr>
+|;
+
+ for $i (1 .. $numrows) {
+ print qq|
+ <tr>
+ <td width=50%><input name="make_$i" size=30 value="$form->{"make_$i"}"></td>
+ <td width=50%><input name="model_$i" size=30 value="$form->{"model_$i"}"></td>
+ </tr>
+|;
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+|;
+
+}
+
+
+sub assembly_row {
+ my ($numrows) = @_;
+
+ @column_index = qw(runningnumber qty unit bom partnumber description partsgroup total);
+
+ if ($form->{previous_form}) {
+ $nochange = 1;
+ @column_index = qw(qty unit bom partnumber description partsgroup total);
+ } else {
+ # change callback
+ $form->{old_callback} = $form->{callback};
+ $callback = $form->{callback};
+ $form->{callback} = "$form->{script}?action=display_form";
+
+ # delete action
+ delete $form->{action};
+
+ $previous_form = "";
+ # save form variables in a previous_form variable
+ foreach $key (sort keys %$form) {
+ # escape ampersands
+ $form->{$key} =~ s/&/%26/g;
+ $previous_form .= qq|$key=$form->{$key}&|;
+ }
+ chop $previous_form;
+ $previous_form = $form->escape($form->escape($previous_form, 1));
+ $form->{callback} = $callback;
+
+ $form->{assemblytotal} = 0;
+ $form->{weight} = 0;
+
+ }
+
+ $column_header{runningnumber} = qq|<th nowrap width=5%>|.$locale->text('No.').qq|</th>|;
+ $column_header{qty} = qq|<th align=left nowrap width=10%>|.$locale->text('Qty').qq|</th>|;
+ $column_header{unit} = qq|<th align=left nowrap width=5%>|.$locale->text('Unit').qq|</th>|;
+ $column_header{partnumber} = qq|<th align=left nowrap width=20%>|.$locale->text('Number').qq|</th>|;
+ $column_header{description} = qq|<th nowrap width=50%>|.$locale->text('Description').qq|</th>|;
+ $column_header{total} = qq|<th align=right nowrap>|.$locale->text('Extended').qq|</th>|;
+ $column_header{bom} = qq|<th>|.$locale->text('BOM').qq|</th>|;
+ $column_header{partsgroup} = qq|<th>|.$locale->text('Group').qq|</th>|;
+
+ print qq|
+ <tr class=listheading>
+ <th class=listheading>|.$locale->text('Individual Items').qq|</th>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ for $i (1 .. $numrows) {
+ $form->{"partnumber_$i"} =~ s/"/&quot;/g;
+
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+ $form->{assemblytotal} += $linetotal;
+
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ $linetotal = $form->format_amount(\%myconfig, $linetotal, 2);
+
+ if (($i >= 1) && ($i == $numrows)) {
+
+ if ($nochange) {
+ map { $column_data{$_} = qq|<td></td>| } qw(qty unit partnumber description bom partsgroup);
+ } else {
+
+ map { $column_data{$_} = qq|<td></td>| } qw(runningnumber unit bom);
+
+ $column_data{qty} = qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
+ $column_data{partnumber} = qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}"></td>|;
+ $column_data{description} = qq|<td><input name="description_$i" size=40 value="$form->{"description_$i"}"></td>|;
+ $column_data{partsgroup} = qq|<td><input name="partsgroup_$i" size=10 value="$form->{"partsgroup_$i"}"></td>|;
+
+ }
+
+ } else {
+
+ if ($form->{previous_form}) {
+ $column_data{partnumber} = qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}">$form->{"partnumber_$i"}</td>|;
+ $column_data{qty} = qq|<td align=right><input type=hidden name="qty_$i" value="$form->{"qty_$i"}">$form->{"qty_$i"}</td>|;
+
+ $column_data{bom} = qq|<td align=center><input type=hidden name="bom_$i" value=$form->{"bom_$i"}>|;
+ $column_data{bom} .= ($form->{"bom_$i"}) ? "x" : "&nbsp;";
+ $column_data{bom} .= qq|</td>|;
+
+ $column_data{partsgroup} = qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
+
+ } else {
+ $href = qq|$form->{script}?action=edit&id=$form->{"id_$i"}&path=$form->{path}&login=$form->{login}&password=$form->{password}&rowcount=$i&previous_form=$previous_form|;
+ $column_data{partnumber} = qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}"><a href=$href>$form->{"partnumber_$i"}</a></td>|;
+ $column_data{runningnumber} = qq|<td><input name="runningnumber_$i" size=3 value="$i"}"></td>|;
+ $column_data{qty} = qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
+
+ $form->{"bom_$i"} = ($form->{"bom_$i"}) ? "checked" : "";
+ $column_data{bom} = qq|<td align=center><input name="bom_$i" type=checkbox class=checkbox value=1 $form->{"bom_$i"}></td>|;
+
+ $column_data{partsgroup} = qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
+
+ }
+
+ $column_data{unit} = qq|<td><input type=hidden name="unit_$i" value="$form->{"unit_$i"}">$form->{"unit_$i"}</td>|;
+ $column_data{description} = qq|<td><input type=hidden name="description_$i" value="$form->{"description_$i"}">$form->{"description_$i"}</td>|;
+ }
+
+ $column_data{total} = qq|<td align=right>$linetotal</td>|;
+
+ print qq|
+ <tr>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+ <input type=hidden name="id_$i" value=$form->{"id_$i"}>
+ <input type=hidden name="sellprice_$i" value=$form->{"sellprice_$i"}>
+ <input type=hidden name="weight_$i" value=$form->{"weight_$i"}>
+|;
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+|;
+
+}
+
+
+sub update {
+
+
+ if ($form->{item} eq "assembly") {
+
+ $i = $form->{assembly_rows};
+
+ # if last row is empty check the form otherwise retrieve item
+ if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
+
+ &check_form;
+
+ } else {
+
+ IC->assembly_item(\%myconfig, \%$form);
+
+ $rows = scalar @{ $form->{item_list} };
+
+ if ($rows) {
+ $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+
+ if ($rows > 1) {
+ $form->{makemodel_rows}--;
+ &select_item;
+ exit;
+ } else {
+ map { $form->{item_list}[$i]{$_} =~ s/"/&quot;/g } qw(partnumber description unit partsgroup);
+ map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
+ $form->{"runningnumber_$i"} = $form->{assembly_rows};
+ $form->{assembly_rows}++;
+
+ &check_form;
+
+ }
+
+ } else {
+
+ $form->{rowcount} = $i;
+ $form->{assembly_rows}++;
+
+ &new_item;
+
+ }
+ }
+ }
+
+ if ($form->{item} eq "part") {
+ &check_form;
+ }
+
+ if ($form->{item} eq 'service') {
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(sellprice listprice);
+
+ &form_header;
+ &form_footer;
+ }
+
+}
+
+
+sub save {
+
+ # check if there is a part number
+ $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Number missing!"));
+
+ if ($form->{obsolete}) {
+ $form->error($locale->text("Inventory quantity must be zero before you can set this $form->{item} obsolete!")) if ($form->{onhand});
+ }
+
+# expand dynamic strings
+# $locale->text('Inventory quantity must be zero before you can set this part obsolete!')
+# $locale->text('Inventory quantity must be zero before you can set this assembly obsolete!')
+# $locale->text('Part Number missing!')
+# $locale->text('Service Number missing!')
+# $locale->text('Assembly Number missing!')
+
+ # save part
+ $rc = IC->save(\%myconfig, \%$form);
+
+ $parts_id = $form->{id};
+
+ # load previous variables
+ if ($form->{previous_form}) {
+ # save the new form variables before splitting previous_form
+ map { $newform{$_} = $form->{$_} } keys %$form;
+
+ $previous_form = $form->unescape($form->{previous_form});
+
+ # don't trample on previous variables
+ map { delete $form->{$_} } keys %newform;
+
+ # now take it apart and restore original values
+ foreach $item (split /&/, $previous_form) {
+ ($key, $value) = split /=/, $item, 2;
+ $value =~ s/%26/&/g;
+ $form->{$key} = $value;
+ }
+
+ if ($form->{item} eq 'assembly') {
+ # undo formatting
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice weight);
+
+ $form->{assembly_rows}--;
+ $i = $newform{rowcount};
+ $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+
+ $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
+ $form->{weight} -= $form->{"weight_$i"} * $form->{"qty_$i"};
+
+ # change/add values for assembly item
+ map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit weight listprice sellprice inventory_accno income_accno expense_accno partsgroup);
+
+ # undo string formatting
+ map { $form->{"${_}_$i"} =~ s/''/'/g } qw(partnumber description unit bin);
+
+ $form->{sellprice} += $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
+ $form->{weight} += $form->{"weight_$i"} * $form->{"qty_$i"};
+
+ } else {
+ # set values for last invoice/order item
+ $i = $form->{rowcount};
+ $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+
+ map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice);
+ $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id});
+
+ if ($form->{exchangerate} != 0) {
+ $form->{"sellprice_$i"} /= $form->{exchangerate};
+ }
+
+ map { $form->{"taxaccounts_$i"} .= "$_ " if ($newform{"IC_tax_$_"}) } split / /, $newform{taxaccounts};
+ chop $form->{"taxaccounts_$i"};
+
+ # credit remaining calculation
+ $amount = $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) * $form->{"qty_$i"};
+ map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
+ map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{"taxaccounts_$i"} if !$form->{taxincluded};
+
+ $form->{creditremaining} -= $amount;
+
+ }
+
+ $form->{"id_$i"} = $parts_id;
+ delete $form->{action};
+
+ # restore original callback
+ $callback = $form->unescape($form->{callback});
+ $form->{callback} = $form->unescape($form->{old_callback});
+ delete $form->{old_callback};
+
+ $form->{makemodel_rows}--;
+
+ # put callback together
+ foreach $key (keys %$form) {
+ # do single escape for Apache 2.0
+ $value = $form->escape($form->{$key}, 1);
+ $callback .= qq|&$key=$value|;
+ }
+ $form->{callback} = $callback;
+ }
+
+ # redirect
+ $form->redirect;
+
+}
+
+
+sub save_as_new {
+
+ $form->{id} = 0;
+ &save;
+
+}
+
+
+sub delete {
+
+ $rc = IC->delete(\%myconfig, \%$form);
+
+ # redirect
+ $form->redirect($locale->text('Item deleted!')) if ($rc > 0);
+ $form->error($locale->text('Cannot delete item!'));
+
+}
+
+
+
+sub stock_assembly {
+
+ $form->{title} = $locale->text('Stock Assembly');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width="100%">
+ <tr><th class=listtop>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr valign=top>
+ <td>
+ <table width="100%">
+ <tr>
+ <th width="1%" align="right" nowrap="true">|.$locale->text('Number').qq|</th>
+ <td width="40%"><input name=partnumber size=20></td>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <th align="right" nowrap="true">|.$locale->text('Description').qq|</th>
+ <td colspan="2"><input name=description size=40></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td><hr size=3 noshade></td></tr>
+</table>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input type=hidden name=nextsub value=list_assemblies>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+
+sub list_assemblies {
+
+ IC->retrieve_assemblies(\%myconfig, \%$form);
+
+ $column_header{partnumber} = qq|<th class=listheading>|.$locale->text('Number').qq|</th>|;
+ $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|;
+ $column_header{bin} = qq|<th class=listheading>|.$locale->text('Bin').qq|</th>|;
+ $column_header{onhand} = qq|<th class=listheading>|.$locale->text('Qty').qq|</th>|;
+ $column_header{rop} = qq|<th class=listheading>|.$locale->text('ROP').qq|</th>|;
+ $column_header{stock} = qq|<th class=listheading>|.$locale->text('Add').qq|</th>|;
+
+ @column_index = (qw(partnumber description bin onhand rop stock));
+
+ $form->{title} = $locale->text('Stock Assembly');
+
+ $form->{callback} = "$form->{script}?action=stock_assembly&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+
+ $form->header;
+
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
+ <tr size=5></tr>
+ <tr class=listheading>|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ $i = 1;
+ foreach $ref (@{ $form->{assembly_items} }) {
+
+ map { $ref->{$_} =~ s/"/&quot;/g } qw(partnumber description);
+
+ # figure out how many to stock
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $ref->{rop} - $ref->{onhand});
+
+ $column_data{partnumber} = qq|<td width=20%>$ref->{partnumber}</td>|;
+ $column_data{description} = qq|<td width=50%>$ref->{description}&nbsp;</td>|;
+ $column_data{bin} = qq|<td>$ref->{bin}&nbsp;</td>|;
+ $column_data{onhand} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;").qq|</td>|;
+ $column_data{rop} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{rop}, '', "&nbsp;").qq|</td>|;
+ $column_data{stock} = qq|<td width=10%><input name="qty_$i" size=10 value=$form->{"qty_$i"}></td>|;
+
+ $j++; $j %= 2;
+ print qq|<tr class=listrow$j><input name="id_$i" type=hidden value=$ref->{id}>\n|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ $i++;
+
+ }
+
+ $i--;
+ print qq|
+ <tr>
+ <td colspan=6><hr size=3 noshade>
+ </tr>
+</table>
+<input name=rowcount type=hidden value="$i">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=nextsub value=restock_assemblies>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub restock_assemblies {
+
+ $form->redirect($locale->text('Assemblies restocked!')) if (IC->restock_assemblies(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot stock assemblies!'));
+
+}
+
+
+sub continue { &{ $form->{nextsub} } };
+
+
diff --git a/sql-ledger/bin/mozilla/io.pl b/sql-ledger/bin/mozilla/io.pl
new file mode 100644
index 000000000..751d9a2ed
--- /dev/null
+++ b/sql-ledger/bin/mozilla/io.pl
@@ -0,0 +1,1149 @@
+######################################################################
+# SQL-Ledger, Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+#
+# common routines used in is, ir, oe
+#
+#######################################################################
+
+# any custom scripts for this one
+if (-f "$form->{path}/custom_io.pl") {
+ eval { require "$form->{path}/custom_io.pl"; };
+}
+if (-f "$form->{path}/$form->{login}_io.pl") {
+ eval { require "$form->{path}/$form->{login}_io.pl"; };
+}
+
+
+1;
+# end of main
+
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+
+sub display_row {
+ my $numrows = shift;
+
+ @column_index = (partnumber, description, qty);
+
+ if ($form->{type} eq "sales_order") {
+ if ($form->{id}) {
+ push @column_index, "ship";
+ $column_data{ship} = qq|<th class=listheading align=left width="auto">|.$locale->text('Ship').qq|</th>|;
+ }
+ }
+ if ($form->{type} eq "purchase_order") {
+ if ($form->{id}) {
+ push @column_index, "ship";
+ $column_data{ship} = qq|<th class=listheading align=left width="auto">|.$locale->text('Recd').qq|</th>|;
+ }
+ }
+
+ push @column_index, qw(unit sellprice);
+
+ if ($form->{script} eq 'is.pl' || $form->{type} eq 'sales_order') {
+ push @column_index, qw(discount);
+ }
+
+ push @column_index, "linetotal";
+
+ my $colspan = $#column_index + 1;
+
+
+ $form->{invsubtotal} = 0;
+ map { $form->{"${_}_base"} = 0 } (split / /, $form->{taxaccounts});
+
+ $column_data{partnumber} = qq|<th class=listheading nowrap>|.$locale->text('Number').qq|</th>|;
+ $column_data{description} = qq|<th class=listheading nowrap>|.$locale->text('Description').qq|</th>|;
+ $column_data{qty} = qq|<th class=listheading nowrap>|.$locale->text('Qty').qq|</th>|;
+ $column_data{unit} = qq|<th class=listheading nowrap>|.$locale->text('Unit').qq|</th>|;
+ $column_data{sellprice} = qq|<th class=listheading nowrap>|.$locale->text('Price').qq|</th>|;
+ $column_data{discount} = qq|<th class=listheading>%</th>|;
+ $column_data{linetotal} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
+ $column_data{bin} = qq|<th class=listheading nowrap>|.$locale->text('Bin').qq|</th>|;
+
+ print qq|
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ $projectnumber = $locale->text('Project');
+ $runningnumber = $locale->text('No.');
+ $partsgroup = $locale->text('Group');
+
+ if ($form->{type} =~ /_order/) {
+ $reqdate = $locale->text('Required by');
+ $delvar = "reqdate";
+ } else {
+ $deliverydate = $locale->text('Delivery Date');
+ $delvar = "deliverydate";
+ }
+
+
+ for $i (1 .. $numrows) {
+ # undo formatting
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(qty ship discount sellprice);
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $discount = $form->round_amount($form->{"sellprice_$i"} * $form->{"discount_$i"}/100, $decimalplaces);
+ $linetotal = $form->round_amount($form->{"sellprice_$i"} - $discount, $decimalplaces);
+ $linetotal = $form->round_amount($linetotal * $form->{"qty_$i"}, 2);
+
+ # convert " to &quot;
+ map { $form->{"${_}_$i"} =~ s/"/&quot;/g } qw(partnumber description unit);
+
+ $column_data{partnumber} = qq|<td><input name="partnumber_$i" size=20 value="$form->{"partnumber_$i"}"></td>|;
+
+ if (($rows = $form->numtextrows($form->{"description_$i"}, 30, 6)) > 1) {
+ $column_data{description} = qq|<td><textarea name="description_$i" rows=$rows cols=30 wrap=soft>$form->{"description_$i"}</textarea></td>|;
+ } else {
+ $column_data{description} = qq|<td><input name="description_$i" size=30 value="$form->{"description_$i"}"></td>|;
+ }
+
+ $column_data{qty} = qq|<td align=right><input name="qty_$i" size=5 value=|.$form->format_amount(\%myconfig, $form->{"qty_$i"}).qq|></td>|;
+ $column_data{ship} = qq|<td align=right><input name="ship_$i" size=5 value=|.$form->format_amount(\%myconfig, $form->{"ship_$i"}).qq|></td>|;
+ $column_data{unit} = qq|<td><input name="unit_$i" size=5 maxsize=5 value="$form->{"unit_$i"}"></td>|;
+ $column_data{sellprice} = qq|<td align=right><input name="sellprice_$i" size=9 value=|.$form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces).qq|></td>|;
+ $column_data{discount} = qq|<td align=right><input name="discount_$i" size=3 value=|.$form->format_amount(\%myconfig, $form->{"discount_$i"}).qq|></td>|;
+ $column_data{linetotal} = qq|<td align=right>|.$form->format_amount(\%myconfig, $linetotal, 2).qq|</td>|;
+ $column_data{bin} = qq|<td>$form->{"bin_$i"}</td>|;
+
+ print qq|
+ <tr valign=top>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+
+<input type=hidden name="id_$i" value=$form->{"id_$i"}>
+<input type=hidden name="inventory_accno_$i" value=$form->{"inventory_accno_$i"}>
+<input type=hidden name="bin_$i" value="$form->{"bin_$i"}">
+<input type=hidden name="income_accno_$i" value=$form->{"income_accno_$i"}>
+<input type=hidden name="expense_accno_$i" value=$form->{"expense_accno_$i"}>
+<input type=hidden name="listprice_$i" value="$form->{"listprice_$i"}">
+<input type=hidden name="assembly_$i" value="$form->{"assembly_$i"}">
+<input type=hidden name="taxaccounts_$i" value="$form->{"taxaccounts_$i"}">
+
+|;
+
+ # print second row
+ print qq|
+ <tr>
+ <td colspan=$colspan>
+ <table>
+ <tr>
+ <th>$runningnumber</th>
+ <td><input name="runningnumber_$i" size=3 value=$i></td>
+ <td width=20></td>
+ <th>$partsgroup</th>
+ <td><input name="partsgroup_$i" size=10 value="$form->{"partsgroup_$i"}">
+ <th>${$delvar}</th>
+ <td><input name="${delvar}_$i" size=11 title="$myconfig{dateformat}" value="$form->{"${delvar}_$i"}"></td>
+ <th>$projectnumber</th>
+ <td><input name="projectnumber_$i" size=10 value="$form->{"projectnumber_$i"}">
+ <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}">
+ <input type=hidden name="project_id_$i" value="$form->{"project_id_$i"}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=$colspan><hr size=1 noshade></td>
+ </tr>
+|;
+
+
+ map { $form->{"${_}_base"} += $linetotal } (split / /, $form->{"taxaccounts_$i"});
+
+ $form->{invsubtotal} += $linetotal;
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+|;
+
+}
+
+
+sub select_item {
+
+ @column_index = qw(ndx partnumber description onhand sellprice);
+
+ $column_data{ndx} = qq|<th>&nbsp;</th>|;
+ $column_data{partnumber} = qq|<th class=listheading>|.$locale->text('Number').qq|</th>|;
+ $column_data{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|;
+ $column_data{sellprice} = qq|<th class=listheading>|.$locale->text('Price').qq|</th>|;
+ $column_data{onhand} = qq|<th class=listheading>|.$locale->text('Qty').qq|</th>|;
+
+
+ # list items with radio button on a form
+ $form->header;
+
+ $title = $locale->text('Select from one of the items below');
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop colspan=$colspan>$title</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr class=listheading>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|</tr>|;
+
+ my $i = 0;
+ foreach $ref (@{ $form->{item_list} }) {
+ $checked = ($i++) ? "" : "checked";
+
+ map { $ref->{$_} =~ s/"/&quot;/g } qw(partnumber description unit);
+
+ $column_data{ndx} = qq|<td><input name=ndx class=radio type=radio value=$i $checked></td>|;
+ $column_data{partnumber} = qq|<td><input name="new_partnumber_$i" type=hidden value="$ref->{partnumber}">$ref->{partnumber}</td>|;
+ $column_data{description} = qq|<td><input name="new_description_$i" type=hidden value="$ref->{description}">$ref->{description}</td>|;
+ $column_data{sellprice} = qq|<td align=right><input name="new_sellprice_$i" type=hidden value=$ref->{sellprice}>|.$form->format_amount(\%myconfig, $ref->{sellprice}, 2, "&nbsp;").qq|</td>|;
+ $column_data{onhand} = qq|<td align=right><input name="new_onhand_$i" type=hidden value=$ref->{onhand}>|.$form->format_amount(\%myconfig, $ref->{onhand}, '', "&nbsp;").qq|</td>|;
+
+ $j++; $j %= 2;
+ print qq|
+<tr class=listrow$j>|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+</tr>
+
+<input name="new_bin_$i" type=hidden value="$ref->{bin}">
+<input name="new_listprice_$i" type=hidden value=$ref->{listprice}>
+<input name="new_inventory_accno_$i" type=hidden value=$ref->{inventory_accno}>
+<input name="new_income_accno_$i" type=hidden value=$ref->{income_accno}>
+<input name="new_expense_accno_$i" type=hidden value=$ref->{expense_accno}>
+<input name="new_unit_$i" type=hidden value="$ref->{unit}">
+<input name="new_weight_$i" type=hidden value="$ref->{weight}">
+<input name="new_assembly_$i" type=hidden value="$ref->{assembly}">
+<input name="new_taxaccounts_$i" type=hidden value="$ref->{taxaccounts}">
+<input name="new_partsgroup_$i" type=hidden value="$ref->{partsgroup}">
+
+<input name="new_id_$i" type=hidden value=$ref->{id}>
+
+|;
+
+ }
+
+ print qq|
+<tr><td colspan=8><hr size=3 noshade></td></tr>
+</table>
+
+<input name=lastndx type=hidden value=$i>
+
+|;
+
+ # delete action variable
+ delete $form->{action};
+ delete $form->{item_list};
+
+ # save all other form variables
+ foreach $key (keys %${form}) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input name=$key type=hidden value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<input type=hidden name=nextsub value=item_selected>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub item_selected {
+
+ # replace the last row with the checked row
+ $i = $form->{rowcount};
+ $i = $form->{assembly_rows} if ($form->{item} eq 'assembly');
+
+ # index for new item
+ $j = $form->{ndx};
+
+ # if there was a price entered, override it
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
+
+ map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } qw(id partnumber description sellprice listprice inventory_accno income_accno expense_accno bin unit weight assembly taxaccounts partsgroup);
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ if ($sellprice) {
+ $form->{"sellprice_$i"} = $sellprice;
+ } else {
+ # if there is an exchange rate adjust sellprice
+ if (($form->{exchangerate} * 1) != 0) {
+ $form->{"sellprice_$i"} /= $form->{exchangerate};
+ $form->{"sellprice_$i"} = $form->round_amount($form->{"sellprice_$i"}, $decimalplaces);
+ }
+ }
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(sellprice weight);
+
+ $form->{sellprice} += ($form->{"sellprice_$i"} * $form->{"qty_$i"});
+ $form->{weight} += ($form->{"weight_$i"} * $form->{"qty_$i"});
+
+ $amount = $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) * $form->{"qty_$i"};
+ map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
+ map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{"taxaccounts_$i"} if !$form->{taxincluded};
+
+ $form->{creditremaining} -= $amount;
+
+ $form->{"runningnumber_$i"} = $i;
+
+ # delete all the new_ variables
+ for $i (1 .. $form->{lastndx}) {
+ map { delete $form->{"new_${_}_$i"} } qw(partnumber description sellprice bin listprice inventory_accno income_accno expense_accno unit assembly taxaccounts id);
+ }
+
+ map { delete $form->{$_} } qw(ndx lastndx nextsub);
+
+ if ($form->{item} eq 'assembly') {
+ map { $form->{"qty_$_"} = $form->parse_amount(\%myconfig, $form->{"qty_$_"}) } (1 .. $i);
+ } else {
+ # format amounts for invoice / order
+ map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice listprice);
+ }
+
+ &display_form;
+
+}
+
+
+sub new_item {
+
+ # change callback
+ $form->{old_callback} = $form->escape($form->{callback},1);
+ $form->{callback} = $form->escape("$form->{script}?action=display_form",1);
+
+ # delete action
+ delete $form->{action};
+
+ # save all other form variables in a previous_form variable
+ foreach $key (keys %$form) {
+ # escape ampersands
+ $form->{$key} =~ s/&/%26/g;
+ $previous_form .= qq|$key=$form->{$key}&|;
+ }
+ chop $previous_form;
+ $previous_form = $form->escape($previous_form, 1);
+
+ $i = $form->{rowcount};
+ map { $form->{"${_}_$i"} =~ s/"/&quot;/g } qw(partnumber description);
+
+ $form->header;
+
+ print qq|
+<body>
+
+<h4 class=error>|.$locale->text('Item not on file!').qq|
+
+<p>
+|.$locale->text('What type of item is this?').qq|</h4>
+
+<form method=post action=ic.pl>
+
+<p>
+
+ <input class=radio type=radio name=item value=part checked>&nbsp;|.$locale->text('Part')
+.qq|<br>
+ <input class=radio type=radio name=item value=service>&nbsp;|.$locale->text('Service')
+
+.qq|
+<input type=hidden name=previous_form value="$previous_form">
+<input type=hidden name=partnumber value="$form->{"partnumber_$i"}">
+<input type=hidden name=description value="$form->{"description_$i"}">
+<input type=hidden name=rowcount value=$form->{rowcount}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input type=hidden name=nextsub value=add>
+
+<p>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub display_form {
+
+ &form_header;
+
+ $numrows = ++$form->{rowcount};
+ $subroutine = "display_row";
+
+ if ($form->{item} eq 'part') {
+ $numrows = ++$form->{makemodel_rows};
+ $subroutine = "makemodel_row";
+ }
+ if ($form->{item} eq 'assembly') {
+ $numrows = ++$form->{makemodel_rows};
+ $subroutine = "makemodel_row";
+
+ # create makemodel rows
+ &{ $subroutine }($numrows);
+
+ $numrows = ++$form->{assembly_rows};
+ $subroutine = "assembly_row";
+ }
+ if ($form->{item} eq 'service') {
+ $numrows = 0;
+ }
+
+ # create rows
+ &{ $subroutine }($numrows) if $numrows;
+
+ &form_footer;
+
+}
+
+
+
+sub check_form {
+
+ my @a = ();
+ my $count = 0;
+ my @flds = (qw(id partnumber description qty sellprice unit discount inventory_accno income_accno expense_accno listprice taxaccounts bin assembly weight projectnumber project_id oldprojectnumber runningnumber partsgroup));
+
+ # remove any makes or model rows
+ if ($form->{item} eq 'part') {
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice lastcost weight rop);
+
+ @flds = (make, model);
+ for my $i (1 .. ($form->{makemodel_rows})) {
+ if (($form->{"make_$i"} ne "") || ($form->{"model_$i"} ne "")) {
+ push @a, {};
+ my $j = $#a;
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{makemodel_rows});
+ $form->{makemodel_rows} = $count;
+
+ } elsif ($form->{item} eq 'assembly') {
+
+ $form->{sellprice} = 0;
+ $form->{weight} = 0;
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice rop);
+
+ @flds = qw(id qty unit bom partnumber description sellprice weight runningnumber partsgroup);
+
+ for my $i (1 .. ($form->{assembly_rows} - 1)) {
+ if ($form->{"qty_$i"}) {
+ push @a, {};
+ my $j = $#a;
+
+ $form->{"qty_$i"} = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+
+ $form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"});
+ $form->{weight} += ($form->{"qty_$i"} * $form->{"weight_$i"});
+ $count++;
+ }
+ }
+
+ $form->{sellprice} = $form->round_amount($form->{sellprice}, 2);
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{assembly_rows});
+ $form->{assembly_rows} = $count;
+
+ $count = 0;
+ @flds = qw(make model);
+ @a = ();
+
+ for my $i (1 .. ($form->{makemodel_rows})) {
+ if (($form->{"make_$i"} ne "") || ($form->{"model_$i"} ne "")) {
+ push @a, {};
+ my $j = $#a;
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{makemodel_rows});
+ $form->{makemodel_rows} = $count;
+
+ } else {
+
+ # this section applies to invoices and orders
+ # remove any empty numbers
+
+ if ($form->{rowcount}) {
+ for my $i (1 .. $form->{rowcount} - 1) {
+ if ($form->{"partnumber_$i"}) {
+ push @a, {};
+ my $j = $#a;
+
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
+ $form->{rowcount} = $count;
+
+ $form->{creditremaining} -= &invoicetotal;
+
+ }
+ }
+
+ &display_form;
+
+}
+
+
+sub invoicetotal {
+
+ $form->{oldinvtotal} = 0;
+ # add all parts and deduct paid
+ map { $form->{"${_}_base"} = 0 } split / /, $form->{taxaccounts};
+
+ my ($amount, $sellprice, $discount, $qty);
+
+ for my $i (1 .. $form->{rowcount}) {
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
+ $discount = $form->parse_amount(\%myconfig, $form->{"discount_$i"});
+ $qty = $form->parse_amount(\%myconfig, $form->{"qty_$i"});
+
+ $amount = $sellprice * (1 - $discount / 100) * $qty;
+ map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
+ $form->{oldinvtotal} += $amount;
+ }
+
+ map { $form->{oldinvtotal} += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{taxaccounts} if !$form->{taxincluded};
+
+ $form->{oldtotalpaid} = 0;
+ for $i (1 .. $form->{paidaccounts}) {
+ $form->{oldtotalpaid} += $form->{"paid_$i"};
+ }
+
+ # return total
+ ($form->{oldinvtotal} - $form->{oldtotalpaid});
+
+}
+
+
+sub validate_items {
+
+ # check if items are valid
+ if ($form->{rowcount} == 1) {
+ &update;
+ exit;
+ }
+
+ for $i (1 .. $form->{rowcount} - 1) {
+ $form->isblank("partnumber_$i", $locale->text('Number missing in Row') . " $i");
+ }
+
+}
+
+
+sub order {
+
+ $form->{ordnumber} = $form->{invnumber};
+
+ $form->{id} = '';
+
+ if ($form->{script} eq 'ir.pl') {
+ $form->{title} = $locale->text('Add Purchase Order');
+ $form->{vc} = 'vendor';
+ $form->{type} = 'purchase_order';
+ $buysell = 'sell';
+ }
+ if ($form->{script} eq 'is.pl') {
+ $form->{title} = $locale->text('Add Sales Order');
+ $form->{vc} = 'customer';
+ $form->{type} = 'sales_order';
+ $buysell = 'buy';
+ }
+ $form->{script} = 'oe.pl';
+
+ $form->{shipto} = 1;
+
+ $form->{rowcount}--;
+
+ require "$form->{path}/$form->{script}";
+
+ map { $form->{"select$_"} = "" } ($form->{vc}, currency);
+
+ $currency = $form->{currency};
+
+ &order_links;
+
+ $form->{currency} = $currency;
+ $form->{exchangerate} = "";
+ $form->{forex} = "";
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{orddate}, $buysell)));
+
+ &prepare_order;
+ &display_form;
+
+}
+
+
+sub e_mail {
+
+
+ if ($myconfig{admin}) {
+ $bcc = qq|
+ <th align=right nowrap=true>|.$locale->text('Bcc').qq|</th>
+ <td><input name=bcc size=30 value="$form->{bcc}"></td>
+|;
+ }
+
+ if ($form->{type} eq 'packing_list') {
+ $form->{email} = $form->{shiptoemail} if $form->{shiptoemail};
+ }
+
+ $name = $form->{$form->{vc}};
+ $name =~ s/--.*//g;
+ $title = $locale->text('E-mail')." $name";
+
+ $form->{oldmedia} = $form->{media};
+ $form->{media} = "email";
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr class=listtop>
+ <th class=listtop>$title</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right nowrap>|.$locale->text('To').qq|</th>
+ <td><input name=email size=30 value="$form->{email}"></td>
+ <th align=right nowrap>|.$locale->text('Cc').qq|</th>
+ <td><input name=cc size=30 value="$form->{cc}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Subject').qq|</th>
+ <td><input name=subject size=30 value="$form->{subject}"></td>
+ $bcc
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left nowrap>|.$locale->text('Message').qq|</th>
+ </tr>
+ <tr>
+ <td><textarea name=message rows=15 cols=60 wrap=soft>$form->{message}</textarea></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+|;
+
+ &print_options;
+
+ map { delete $form->{$_} } qw(action email cc bcc subject message type sendmode format);
+
+ # save all other variables
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=send_email>
+
+<br>
+<input name=action class=submit type=submit value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub send_email {
+
+ $old_form = new Form;
+ map { $old_form->{$_} = $form->{$_} } keys %$form;
+ $old_form->{media} = $form->{oldmedia};
+ &print_form($old_form);
+
+}
+
+
+
+sub print_options {
+
+ $form->{sendmode} = "attachment";
+ $form->{copies} = 3 unless $form->{copies};
+
+ $form->{PD}{$form->{type}} = "checked";
+ $form->{DF}{$form->{format}} = "checked";
+ $form->{OP}{$form->{media}} = "checked";
+ $form->{SM}{$form->{sendmode}} = "checked";
+
+ if ($form->{type} =~ /_order/) {
+ $order = qq|
+ <td align=right><input class=radio type=radio name=type value="$`_order" $form->{PD}{"$`_order"}></td><td>|.$locale->text('Order').qq|</td>
+|;
+ } else {
+ $invoice = qq|
+ <td align=right><input class=radio type=radio name=type value=invoice $form->{PD}{invoice}></td><td>|.$locale->text('Invoice').qq|</td>
+ <td align=right><input class=radio type=radio name=type value=packing_list $form->{PD}{packing_list}></td><td>|.$locale->text('Packing List').qq|</td>
+|;
+ }
+
+ if ($form->{media} eq 'email') {
+ $email = qq|
+ <td align=center><input class=radio type=radio name=sendmode value=attachment $form->{SM}{attachment}> |.$locale->text('Attachment')
+ .qq| <input class=radio type=radio name=sendmode value=inline $form->{SM}{inline}> |.$locale->text('In-line').qq|</td>
+|;
+ } else {
+ $screen = qq|
+ <td align=right><input class=radio type=radio name=media value=screen $form->{OP}{screen}></td>
+ <td>|.$locale->text('Screen').qq|</td>
+|;
+ }
+
+ print qq|
+<table width=100%>
+ <tr valign=top>
+ $invoice
+ $order
+ <td align=right><input class=radio type=radio name=format value=html $form->{DF}{html}></td>
+ <td>html</td>
+|;
+
+ if ($latex) {
+ print qq|
+ <td align=right><input class=radio type=radio name=format value=postscript $form->{DF}{postscript}></td>
+ <td>|.$locale->text('Postscript').qq|</td>
+ <td align=right><input class=radio type=radio name=format value=pdf $form->{DF}{pdf}></td>
+ <td>|.$locale->text('PDF').qq|</td>
+|;
+ }
+
+ print qq|
+ $screen
+|;
+
+ if ($screen) {
+ if ($myconfig{printer} && $latex) {
+ print qq|
+ <td align=right><input class=radio type=radio name=media value=printer $form->{OP}{printer}></td>
+ <td>|.$locale->text('Printer')
+ .qq| (|.$locale->text('Copies')
+ .qq| <input name=copies size=2 value=$form->{copies}>)</td>
+|;
+ }
+ }
+
+
+ $form->{groupitems} = "checked" if $form->{groupitems};
+
+ print qq|
+ $email
+ <td align=right><input name=groupitems type=checkbox class=checkbox $form->{groupitems}></td>
+ <td>|.$locale->text('Group Items').qq|</td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub print {
+
+ # if this goes to the printer pass through
+ if ($form->{media} eq 'printer') {
+ $form->error($locale->text('Select postscript or PDF!')) if ($form->{format} !~ /(postscript|pdf)/);
+
+ $old_form = new Form;
+ map { $old_form->{$_} = $form->{$_} } keys %$form;
+ }
+
+ &print_form($old_form);
+
+}
+
+
+sub print_form {
+ my $old_form = shift;
+
+ $inv = "inv";
+ $due = "due";
+
+ if ($form->{type} eq "invoice") {
+ $form->{label} = $locale->text('Invoice');
+ }
+ if ($form->{type} eq "packing_list") {
+ $form->{label} = $locale->text('Packing List');
+ }
+ if ($form->{type} eq 'sales_order') {
+ $inv = "ord";
+ $due = "req";
+ $form->{label} = $locale->text('Sales Order');
+ }
+ if ($form->{type} eq 'purchase_order') {
+ $inv = "ord";
+ $due = "req";
+ $form->{label} = $locale->text('Purchase Order');
+ }
+
+ $form->isblank("email", $locale->text('E-mail address missing!')) if ($form->{media} eq 'email');
+ $form->isblank("${inv}number", $locale->text($form->{label} .' Number missing!'));
+ $form->isblank("${inv}date", $locale->text($form->{label} .' Date missing!'));
+
+# $locale->text('Invoice Number missing!')
+# $locale->text('Invoice Date missing!')
+# $locale->text('Packing List Number missing!')
+# $locale->text('Packing List Date missing!')
+# $locale->text('Order Number missing!')
+# $locale->text('Order Date missing!')
+
+ &validate_items;
+
+ &{ "$form->{vc}_details" };
+
+ @a = ();
+ map { push @a, ("partnumber_$_", "description_$_") } (1 .. $form->{rowcount});
+ map { push @a, "${_}_description" } split / /, $form->{taxaccounts};
+ $form->format_string(@a);
+
+ # format payment dates
+ map { $form->{"datepaid_$_"} = $locale->date(\%myconfig, $form->{"datepaid_$_"}) } (1 .. $form->{paidaccounts});
+
+ # create the form variables for the invoice, packing list or order
+ if ($form->{type} =~ /order$/) {
+ OE->order_details(\%myconfig, \%$form);
+ } else {
+ IS->invoice_details(\%myconfig, \%$form);
+ }
+
+ $form->{"${inv}date"} = $locale->date(\%myconfig, $form->{"${inv}date"}, 1);
+ $form->{"${due}date"} = $locale->date(\%myconfig, $form->{"${due}date"}, 1);
+
+
+ @a = qw(name addr1 addr2 addr3 addr4);
+
+ $fillshipto = 1;
+ # if there is no shipto fill it in from billto
+ foreach $item (@a) {
+ if ($form->{"shipto$item"}) {
+ $fillshipto = 0;
+ last;
+ }
+ }
+
+ if ($fillshipto) {
+ if ($form->{type} eq 'purchase_order') {
+ $form->{shiptoname} = $myconfig{company};
+ $form->{shiptoaddr1} = $myconfig{address};
+ } else {
+ map { $form->{"shipto$_"} = $form->{$_} } @a;
+ }
+ }
+
+ $form->{notes} =~ s/^\s+//g;
+
+ # some of the stuff could have umlauts so we translate them
+ push @a, qw(shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoaddr4 shippingpoint company address signature notes);
+
+ push @a, ("${inv}date", "${due}date");
+
+ $form->format_string(@a);
+
+
+ $form->{templates} = "$myconfig{templates}";
+ $form->{IN} = "$form->{type}.html";
+
+ if ($form->{format} eq 'postscript') {
+ $form->{postscript} = 1;
+ $form->{IN} =~ s/html$/tex/;
+ }
+ if ($form->{format} eq 'pdf') {
+ $form->{pdf} = 1;
+ $form->{IN} =~ s/html$/tex/;
+ }
+
+ $form->format_string(email, shiptoemail, cc, bcc) if $form->{format} =~ /(pdf|postscript)/;
+
+ if ($form->{media} eq 'printer') {
+ $form->{OUT} = "| $myconfig{printer}";
+ }
+
+ if ($form->{media} eq 'email') {
+ $form->{subject} = qq|$form->{label} $form->{"${inv}number"}| unless $form->{subject};
+
+ $form->{OUT} = "$sendmail";
+ }
+
+
+ $form->parse_template(\%myconfig, $userspath);
+
+ $form->{callback} = "";
+
+ # if we got back here restore the previous form
+ if ($form->{media} =~ /(printer|email)/) {
+ if ($old_form) {
+ # restore and display form
+ map { $form->{$_} = $old_form->{$_} } keys %$old_form;
+ $form->{rowcount}--;
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
+
+ for $i (1 .. $form->{paidaccounts}) {
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
+ }
+
+ &display_form;
+ exit;
+ }
+
+ $msg = ($form->{media} eq 'printer') ? $locale->text('sent to printer') : $locale->text('emailed to')." $form->{email}";
+ $form->redirect(qq|$form->{label} $form->{"${inv}number"} $msg|);
+ }
+
+}
+
+
+sub customer_details {
+
+ IS->customer_details(\%myconfig, \%$form);
+
+}
+
+
+sub vendor_details {
+
+ IR->vendor_details(\%myconfig, \%$form);
+
+}
+
+
+sub post_as_new {
+
+ $form->{postasnew} = 1;
+ &post;
+
+}
+
+
+sub ship_to {
+
+ $title = $form->{title};
+ $form->{title} = $locale->text('Ship to');
+
+ $form->{rowcount}--;
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
+
+ # get details for name
+ &{ "$form->{vc}_details" };
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <td>
+ <table>
+ <tr class=listheading>
+ <th class=listheading colspan=2 width=50%>|.$locale->text('To').qq|</th>
+ <th class=listheading width=50%>|.$locale->text('Ship to').qq|</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Number').qq|</th>
+ <td>$form->{"$form->{vc}number"}</td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Name').qq|</th>
+ <td>$form->{name}</td>
+ <td><input name=shiptoname size=35 maxsize=35 value="$form->{shiptoname}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Address').qq|</th>
+ <td>$form->{addr1}</td>
+ <td><input name=shiptoaddr1 size=35 maxsize=35 value="$form->{shiptoaddr1}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>$form->{addr2}</td>
+ <td><input name=shiptoaddr2 size=35 maxsize=35 value="$form->{shiptoaddr2}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>$form->{addr3}</td>
+ <td><input name=shiptoaddr3 size=35 maxsize=35 value="$form->{shiptoaddr3}"></td>
+ </tr>
+ <tr>
+ <th></th>
+ <td>$form->{addr4}</td>
+ <td><input name=shiptoaddr4 size=35 maxsize=35 value="$form->{shiptoaddr4}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Contact').qq|</th>
+ <td>$form->{contact}</td>
+ <td><input name=shiptocontact size=35 maxsize=35 value="$form->{shiptocontact}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Phone').qq|</th>
+ <td>$form->{"$form->{vc}phone"}</td>
+ <td><input name=shiptophone size=20 maxsize=20 value="$form->{shiptophone}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Fax').qq|</th>
+ <td>$form->{"$form->{vc}fax"}</td>
+ <td><input name=shiptofax size=20 maxsize=20 value="$form->{shiptofax}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('E-mail').qq|</th>
+ <td>$form->{email}</td>
+ <td><input name=shiptoemail size=35 value="$form->{shiptoemail}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+|;
+
+ # delete shipto
+ map { delete $form->{$_} } qw(shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoaddr4 shiptocontact shiptophone shiptofax shiptoemail);
+ $form->{title} = $title;
+
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+
+<input type=hidden name=nextsub value=display_form>
+
+<hr size=3 noshade>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/ir.pl b/sql-ledger/bin/mozilla/ir.pl
new file mode 100644
index 000000000..ec7d18cf0
--- /dev/null
+++ b/sql-ledger/bin/mozilla/ir.pl
@@ -0,0 +1,653 @@
+#=====================================================================
+# SQL-Ledger, Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory received module
+#
+#======================================================================
+
+
+use SL::IR;
+use SL::PE;
+
+require "$form->{path}/io.pl";
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = $locale->text('Add Vendor Invoice');
+
+ &invoice_links;
+ &prepare_invoice;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ $form->{title} = $locale->text('Edit Vendor Invoice');
+
+ &invoice_links;
+ &prepare_invoice;
+ &display_form;
+
+}
+
+
+sub invoice_links {
+
+ # create links
+ $form->create_links("AP", \%myconfig, "vendor");
+
+ IR->get_vendor(\%myconfig, \%$form);
+ IR->retrieve_invoice(\%myconfig, \%$form);
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
+
+ # vendors
+ if (@{ $form->{all_vendor} }) {
+ $form->{vendor} = "$form->{vendor}--$form->{vendor_id}";
+ map { $form->{selectvendor} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{all_vendor} });
+ }
+
+
+ # forex
+ $form->{forex} = $form->{exchangerate};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ foreach $key (keys %{ $form->{AP_links} }) {
+
+ foreach $ref (@{ $form->{AP_links}{$key} }) {
+ $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
+ }
+
+ if ($key eq "AP_paid") {
+ for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
+ $form->{"AP_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ # reverse paid
+ $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount};
+ $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
+ $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
+ $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
+ $form->{paidaccounts} = $i;
+ }
+ } else {
+ $form->{$key} = "$form->{acc_trans}{$key}->[0]->{accno}--$form->{acc_trans}{$key}->[0]->{description}";
+ }
+ }
+
+ $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
+
+ $form->{AP} = $form->{AP_1} unless $form->{id};
+
+ $form->{locked} = ($form->datetonum($form->{invdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
+
+}
+
+
+
+sub prepare_invoice {
+
+ if ($form->{id}) {
+
+ map { $form->{$_} =~ s/"/&quot;/g } qw(invnumber ordnumber);
+
+ foreach $ref (@{ $form->{invoice_details} }) {
+ $i++;
+ map { $form->{"${_}_$i"} = $ref->{$_} } keys %{ $ref };
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ $form->{rowcount} = $i;
+ }
+ }
+
+}
+
+
+
+sub form_header {
+
+ # set option selected
+ foreach $item (qw(AP vendor currency)) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+
+ $exchangerate = "";
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{forex}) {
+ $exchangerate .= qq|
+ <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
+ <td>$form->{exchangerate}<input type=hidden name=exchangerate value=$form->{exchangerate}></td>
+|;
+ } else {
+ $exchangerate .= qq|
+ <th align=right nowrap>|.$locale->text('Exchangerate').qq|</th>
+ <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
+|;
+ }
+ }
+ $exchangerate .= qq|
+<input type=hidden name=forex value=$form->{forex}>
+|;
+
+ $vendor = ($form->{selectvendor}) ? qq|<select name=vendor>$form->{selectvendor}</select>\n<input type=hidden name="selectvendor" value="$form->{selectvendor}">| : qq|<input name=vendor value="$form->{vendor}" size=35>|;
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=title value="$form->{title}">
+<input type=hidden name=vc value="vendor">
+
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=locked value=$form->{locked}>
+
+
+<table width=100%>
+ <tr class=listtop>
+ <th>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Record in').qq|</th>
+ <td colspan=3><select name=AP>$form->{selectAP}</select></td>
+ <input type=hidden name=selectAP value="$form->{selectAP}">
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Vendor').qq|</th>
+ <td colspan=3>$vendor</td>
+
+ <input type=hidden name=vendor_id value=$form->{vendor_id}>
+ <input type=hidden name=oldvendor value="$form->{oldvendor}">
+
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ $exchangerate
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Date').qq|</th>
+ <td><input name=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Due Date').qq|</th>
+ <td><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+<input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+<input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
+<input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
+
+<input type=hidden name=taxpart value="$form->{taxpart}">
+<input type=hidden name=taxservice value="$form->{taxservice}">
+
+<input type=hidden name=taxaccounts value="$form->{taxaccounts}">
+|;
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ print qq|
+<input type=hidden name="${item}_rate" value=$form->{"${item}_rate"}>
+<input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
+|;
+ }
+
+}
+
+
+
+sub form_footer {
+
+ $form->{invtotal} = $form->{invsubtotal};
+
+ if (($rows = $form->numtextrows($form->{notes}, 50, 8)) < 2) {
+ $rows = 2;
+ }
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+
+
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+ if ($form->{taxaccounts}) {
+ $taxincluded = qq|
+ <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|.$locale->text('Tax Included').qq|</b><br><br>
+|;
+ }
+
+ if (!$form->{taxincluded}) {
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"${item}_base"}) {
+ $form->{invtotal} += $form->{"${item}_total"} = $form->round_amount($form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
+ $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
+
+ $tax .= qq|
+ <tr>
+ <th align=right>$form->{"${item}_description"}</th>
+ <td align=right>$form->{"${item}_total"}</td>
+ </tr>
+|;
+ }
+ }
+
+ $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
+
+ $subtotal = qq|
+ <tr>
+ <th align=right>|.$locale->text('Subtotal').qq|</th>
+ <td align=right>$form->{invsubtotal}</td>
+ </tr>
+|;
+
+ }
+
+
+ $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
+
+ print qq|
+ <tr>
+ <td colspan=$colspan>
+ <table cellspacing="0">
+ <tr valign=bottom>
+ <td>
+ <table>
+ <tr>
+ <th align=left>|.$locale->text('Notes').qq|</th>
+ </tr>
+ <tr>
+ <td>$notes</td>
+ </tr>
+ </table>
+ </td>
+ <td colspan=2 align=right width=100%>
+ $taxincluded
+ <table width=100%>
+ $subtotal
+ $tax
+ <tr>
+ <th align=right>|.$locale->text('Total').qq|</th>
+ <td align=right>$form->{invtotal}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=$colspan>
+ <table width=100%>
+ <tr>
+ <th colspan=5 class=listheading>|.$locale->text('Payments').qq|</th>
+ </tr>
+|;
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ @column_index = qw(datepaid source paid AP_paid);
+ } else {
+ @column_index = qw(datepaid source paid exchangerate AP_paid);
+ }
+
+ $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
+ $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
+ $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
+ $column_data{AP_paid} = "<th>".$locale->text('Account')."</th>";
+ $column_data{source} = "<th>".$locale->text('Source')."</th>";
+
+ print qq|
+ <tr>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+ print qq|
+ </tr>
+|;
+
+ $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
+ for $i (1 .. $form->{paidaccounts}) {
+
+ print qq|
+ <tr>
+|;
+
+ $form->{"selectAP_paid_$i"} = $form->{selectAP_paid};
+ $form->{"selectAP_paid_$i"} =~ s/option>\Q$form->{"AP_paid_$i"}\E/option selected>$form->{"AP_paid_$i"}/;
+
+ # format amounts
+ $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
+
+ $exchangerate = qq|&nbsp;|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{"forex_$i"}) {
+ $exchangerate = qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
+ } else {
+ $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
+ }
+ }
+ $exchangerate .= qq|
+<input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
+|;
+
+ $column_data{"paid_$i"} = qq|<td align=center><input name="paid_$i" size=11 value=$form->{"paid_$i"}></td>|;
+ $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
+ $column_data{"AP_paid_$i"} = qq|<td align=center><select name="AP_paid_$i">$form->{"selectAP_paid_$i"}</select></td>|;
+ $column_data{"datepaid_$i"} = qq|<td align=center><input name="datepaid_$i" size=11 title="$myconfig{dateformat}" value=$form->{"datepaid_$i"}></td>|;
+ $column_data{"source_$i"} = qq|<td align=center><input name="source_$i" size=11 value=$form->{"source_$i"}></td>|;
+
+ map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
+
+ print qq|
+ </tr>
+|;
+ }
+
+ print qq|
+ <input type=hidden name=paidaccounts value=$form->{paidaccounts}>
+ <input type=hidden name=selectAP_paid value="$form->{selectAP_paid}">
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+<br>
+|;
+
+ $invdate = $form->datetonum($form->{invdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ if ($form->{id}) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+|;
+
+ if (!$form->{revtrans}) {
+ if (!$form->{locked}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+|;
+ }
+ }
+
+ if ($invdate > $closedto) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Order').qq|">
+|;
+ }
+
+ } else {
+ if ($invdate > $closedto) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+ }
+ }
+
+print qq|
+
+<input type=hidden name=rowcount value=$form->{rowcount}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub update {
+
+ $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate});
+
+ &check_name(vendor);
+
+ &check_project;
+
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell')));
+
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
+
+ $form->{"exchangerate_$i"} = $exchangerate if ($form->{"forex_$i"} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell')));
+ }
+ }
+
+ $i = $form->{rowcount};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
+
+ &check_form;
+
+ } else {
+
+ IR->retrieve_item(\%myconfig, \%$form);
+
+ my $rows = scalar @{ $form->{item_list} };
+
+ if ($rows) {
+ $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+
+ if ($rows > 1) {
+
+ &select_item;
+ exit;
+
+ } else {
+ # override sellprice if there is one entered
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
+
+ map { $form->{item_list}[$i]{$_} =~ s/"/&quot;/g } qw(partnumber description unit);
+
+ map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
+
+ $s = ($sellprice) ? $sellprice : $form->{"sellprice_$i"};
+
+ ($dec) = ($s =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ if ($sellprice) {
+ $form->{"sellprice_$i"} = $sellprice;
+ } else {
+ # if there is an exchange rate adjust sellprice
+ $form->{"sellprice_$i"} /= $exchangerate;
+ }
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+ }
+
+ &display_form;
+
+ } else {
+ # ok, so this is a new part
+ # ask if it is a part or service item
+
+ if ($form->{"partsgroup_$i"} && ($form->{"partsnumber_$i"} eq "") && ($form->{"description_$i"} eq "")) {
+ $form->{rowcount}--;
+ $form->{"discount_$i"} = "";
+ &display_form;
+ } else {
+
+ $form->{"id_$i"} = 0;
+ $form->{"unit_$i"} = $locale->text('ea');
+
+ &new_item;
+
+ }
+ }
+ }
+}
+
+
+
+sub post {
+
+ $form->isblank("invnumber", $locale->text('Invoice Number missing!'));
+ $form->isblank("invdate", $locale->text('Invoice Date missing!'));
+ $form->isblank("vendor", $locale->text('Vendor missing!'));
+
+ # if the vendor changed get new values
+ if (&check_name(vendor)) {
+ &update;
+ exit;
+ }
+
+ &validate_items;
+
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $invdate = $form->datetonum($form->{invdate}, \%myconfig);
+
+ $form->error($locale->text('Cannot post invoice for a closed period!')) if ($invdate <= $closedto);
+
+ $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
+
+ $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
+
+ $form->error($locale->text('Cannot post payment for a closed period!')) if ($datepaid <= $closedto);
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = $form->{exchangerate} if ($invdate == $datepaid);
+ $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
+ }
+ }
+ }
+
+
+ ($form->{AP}) = split /--/, $form->{AP};
+ ($form->{AP_paid}) = split /--/, $form->{AP_paid};
+
+ $form->{id} = 0 if $form->{postasnew};
+
+ $form->redirect($locale->text('Invoice posted!')) if (IR->post_invoice(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot post invoice!'));
+
+}
+
+
+
+sub delete {
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ # delete action variable
+ delete $form->{action};
+
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>|.$locale->text('Confirm!').qq|</h2>
+
+<h4>|.$locale->text('Are you sure you want to delete Invoice Number').qq| $form->{invnumber}</h4>
+<p>
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+|;
+
+
+}
+
+
+
+sub yes {
+
+ $form->redirect($locale->text('Invoice deleted!')) if (IR->delete_invoice(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete invoice!'));
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/is.pl b/sql-ledger/bin/mozilla/is.pl
new file mode 100644
index 000000000..cca5813e8
--- /dev/null
+++ b/sql-ledger/bin/mozilla/is.pl
@@ -0,0 +1,739 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Inventory invoicing module
+#
+#======================================================================
+
+
+use SL::IS;
+use SL::PE;
+
+require "$form->{path}/io.pl";
+require "$form->{path}/arap.pl";
+
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = $locale->text('Add Sales Invoice');
+
+ &invoice_links;
+ &prepare_invoice;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ $form->{title} = $locale->text('Edit Sales Invoice');
+
+ &invoice_links;
+ &prepare_invoice;
+ &display_form;
+
+}
+
+
+sub invoice_links {
+
+ # create links
+ $form->create_links("AR", \%myconfig, "customer");
+
+ IS->get_customer(\%myconfig, \%$form);
+ IS->retrieve_invoice(\%myconfig, \%$form);
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
+
+ if (@{ $form->{all_customer} }) {
+ $form->{customer} = qq|$form->{customer}--$form->{customer_id}|;
+ map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{all_customer} });
+ }
+
+ # forex
+ $form->{forex} = $form->{exchangerate};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ foreach $key (keys %{ $form->{AR_links} }) {
+
+ foreach $ref (@{ $form->{AR_links}{$key} }) {
+ $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
+ }
+
+ if ($key eq "AR_paid") {
+ for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
+ $form->{"AR_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
+ # reverse paid
+ $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount} * -1;
+ $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
+ $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
+ $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
+ $form->{paidaccounts} = $i;
+ }
+ } else {
+ $form->{$key} = "$form->{acc_trans}{$key}->[0]->{accno}--$form->{acc_trans}{$key}->[0]->{description}";
+ }
+ }
+
+ $form->{paidaccounts} = 1 unless (exists $form->{paidaccounts});
+
+ $form->{AR} = $form->{AR_1} unless $form->{id};
+
+ $form->{locked} = ($form->datetonum($form->{invdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig));
+
+}
+
+
+sub prepare_invoice {
+
+ $form->{type} = "invoice";
+ $form->{format} = "html";
+ $form->{media} = "screen";
+
+ if ($form->{id}) {
+
+ map { $form->{$_} =~ s/"/&quot;/g } qw(invnumber ordnumber shippingpoint notes);
+
+ foreach $ref (@{ $form->{invoice_details} } ) {
+ $i++;
+ map { $form->{"${_}_$i"} = $ref->{$_} } keys %{ $ref };
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ map { $form->{"${_}_$i"} =~ s/"/&quot;/g } qw(partnumber description unit);
+ $form->{rowcount} = $i;
+ }
+ }
+
+}
+
+
+
+sub form_header {
+
+
+ # set option selected
+ foreach $item (qw(AR customer currency)) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+
+
+ $exchangerate = "";
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{forex}) {
+ $exchangerate .= qq|<th align=right>|.$locale->text('Exchangerate').qq|</th><td>$form->{exchangerate}<input type=hidden name=exchangerate value=$form->{exchangerate}></td>|;
+ } else {
+ $exchangerate .= qq|<th align=right>|.$locale->text('Exchangerate').qq|</th><td><input name=exchangerate size=10 value=$form->{exchangerate}></td>|;
+ }
+ }
+ $exchangerate .= qq|
+<input type=hidden name=forex value=$form->{forex}>
+|;
+
+ $customer = ($form->{selectcustomer}) ? qq|<select name=customer>$form->{selectcustomer}</select>\n<input type=hidden name="selectcustomer" value="$form->{selectcustomer}">| : qq|<input name=customer value="$form->{customer}" size=35>|;
+
+ $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+
+<input type=hidden name=type value=$form->{type}>
+<input type=hidden name=media value=$form->{media}>
+<input type=hidden name=format value=$form->{format}>
+
+<input type=hidden name=title value="$form->{title}">
+<input type=hidden name=vc value="customer">
+<input type=hidden name=employee value="$form->{employee}">
+
+<input type=hidden name=discount value=$form->{discount}>
+<input type=hidden name=creditlimit value=$form->{creditlimit}>
+<input type=hidden name=creditremaining value=$form->{creditremaining}>
+
+<input type=hidden name=closedto value=$form->{closedto}>
+<input type=hidden name=locked value=$form->{locked}>
+
+<table width=100%>
+ <tr class=listtop>
+ <th class=listtop>$form->{title}</font></th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Record in').qq|</th>
+ <td colspan=3><select name=AR>$form->{selectAR}</select></td>
+ <input type=hidden name=selectAR value="$form->{selectAR}">
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Customer').qq|</th>
+ <td colspan=3>$customer</td>
+ <input type=hidden name=customer_id value=$form->{customer_id}>
+ <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
+ </tr>
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <table width=100%>
+ <tr>
+ <th align=left nowrap>|.$locale->text('Credit Limit').qq|</th>
+ <td>$form->{creditlimit}</td>
+ <th align=left nowrap>|.$locale->text('Remaining').qq|</th>
+ <td class="plus$n">$form->{creditremaining}</font></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+ <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+ <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
+ <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
+ $exchangerate
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Ship via').qq|</th>
+ <td colspan=3><input name=shippingpoint size=35 value="$form->{shippingpoint}"></td>
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
+ <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Invoice Date').qq|</th>
+ <td><input name=invdate size=11 title="$myconfig{dateformat}" value=$form->{invdate}></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Due Date').qq|</th>
+ <td><input name=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ </td>
+ </tr>
+<!-- shipto are in hidden variables -->
+
+<input type=hidden name=shiptoname value="$form->{shiptoname}">
+<input type=hidden name=shiptoaddr1 value="$form->{shiptoaddr1}">
+<input type=hidden name=shiptoaddr2 value="$form->{shiptoaddr2}">
+<input type=hidden name=shiptoaddr3 value="$form->{shiptoaddr3}">
+<input type=hidden name=shiptoaddr4 value="$form->{shiptoaddr4}">
+<input type=hidden name=shiptocontact value="$form->{shiptocontact}">
+<input type=hidden name=shiptophone value="$form->{shiptophone}">
+<input type=hidden name=shiptofax value="$form->{shiptofax}">
+<input type=hidden name=shiptoemail value="$form->{shiptoemail}">
+
+<!-- email variables -->
+<input type=hidden name=message value="$form->{message}">
+<input type=hidden name=email value="$form->{email}">
+<input type=hidden name=subject value="$form->{subject}">
+<input type=hidden name=cc value="$form->{cc}">
+<input type=hidden name=bcc value="$form->{bcc}">
+
+<input type=hidden name=taxaccounts value="$form->{taxaccounts}">
+|;
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ print qq|
+<input type=hidden name="${item}_rate" value="$form->{"${item}_rate"}">
+<input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
+<input type=hidden name="${item}_taxnumber" value="$form->{"${item}_taxnumber"}">
+|;
+ }
+
+}
+
+
+
+sub form_footer {
+
+ $form->{invtotal} = $form->{invsubtotal};
+
+ if (($rows = $form->numtextrows($form->{notes}, 50, 8)) < 2) {
+ $rows = 2;
+ }
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+
+
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+
+ if ($form->{taxaccounts}) {
+ $taxincluded = qq|
+ <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|.$locale->text('Tax Included').qq|</b><br><br>
+|;
+ }
+
+ if (!$form->{taxincluded}) {
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"${item}_base"}) {
+ $form->{"${item}_total"} = $form->round_amount($form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
+ $form->{invtotal} += $form->{"${item}_total"};
+ $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
+
+ $tax .= qq|
+ <tr>
+ <th align=right>$form->{"${item}_description"}</th>
+ <td align=right>$form->{"${item}_total"}</td>
+ </tr>
+|;
+ }
+ }
+
+ $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
+
+ $subtotal = qq|
+ <tr>
+ <th align=right>|.$locale->text('Subtotal').qq|</th>
+ <td align=right>$form->{invsubtotal}</td>
+ </tr>
+|;
+
+ }
+
+ $form->{oldinvtotal} = $form->{invtotal};
+ $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
+
+ print qq|
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=bottom>
+ <td>
+ <table>
+ <tr>
+ <th align=left>|.$locale->text('Notes').qq|</th>
+ </tr>
+ <tr>
+ <td>$notes</td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=100%>
+ $taxincluded
+ <table width=100%>
+ $subtotal
+ $tax
+ <tr>
+ <th align=right>|.$locale->text('Total').qq|</th>
+ <td align=right>$form->{invtotal}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+ <th class=listheading colspan=5>|.$locale->text('Payments')
+ .qq|</font></th>
+ </tr>
+|;
+
+ if ($form->{currency} eq $form->{defaultcurrency}) {
+ @column_index = qw(datepaid source paid AR_paid);
+ } else {
+ @column_index = qw(datepaid source paid exchangerate AR_paid);
+ }
+
+ $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
+ $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
+ $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
+ $column_data{AR_paid} = "<th>".$locale->text('Account')."</th>";
+ $column_data{source} = "<th>".$locale->text('Source')."</th>";
+
+ print "
+ <tr>
+";
+ map { print "$column_data{$_}\n" } @column_index;
+ print "
+ </tr>
+";
+
+ $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
+ for $i (1 .. $form->{paidaccounts}) {
+
+ print "
+ <tr>\n";
+
+ $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
+ $form->{"selectAR_paid_$i"} =~ s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/;
+
+ # format amounts
+ $totalpaid += $form->{"paid_$i"};
+ $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
+ $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
+
+ $exchangerate = qq|&nbsp;|;
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{"forex_$i"}) {
+ $exchangerate = qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
+ } else {
+ $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
+ }
+ }
+
+ $exchangerate .= qq|
+<input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
+|;
+
+ $column_data{"paid_$i"} = qq|<td align=center><input name="paid_$i" size=11 value=$form->{"paid_$i"}></td>|;
+ $column_data{"exchangerate_$i"} = qq|<td align=center>$exchangerate</td>|;
+ $column_data{"AR_paid_$i"} = qq|<td align=center><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
+ $column_data{"datepaid_$i"} = qq|<td align=center><input name="datepaid_$i" size=11 title="$myconfig{dateformat}" value=$form->{"datepaid_$i"}></td>|;
+ $column_data{"source_$i"} = qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
+
+ map { print qq|$column_data{"${_}_$i"}\n| } @column_index;
+ print "
+ </tr>\n";
+ }
+
+ print qq|
+<input type=hidden name=paidaccounts value=$form->{paidaccounts}>
+<input type=hidden name=selectAR_paid value="$form->{selectAR_paid}">
+<input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
+<input type=hidden name=oldtotalpaid value=$totalpaid>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+|;
+
+ &print_options;
+
+ print qq|
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+
+ $invdate = $form->datetonum($form->{invdate}, \%myconfig);
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+
+ if ($form->{id}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Ship to').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Print').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('E-mail').qq|">
+|;
+
+ if (!$form->{revtrans}) {
+ if (!$form->{locked}) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+|;
+ }
+ }
+
+ if ($invdate > $closedto) {
+ print qq|
+ <input class=submit type=submit name=action value="|.$locale->text('Post as new').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Order').qq|">
+|;
+ }
+
+ } else {
+ if ($invdate > $closedto) {
+ print qq|<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Ship to').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Print').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('E-mail').qq|">
+ <input class=submit type=submit name=action value="|.$locale->text('Post').qq|">|;
+ }
+ }
+
+ print qq|
+
+<input type=hidden name=rowcount value=$form->{rowcount}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub update {
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
+
+ &check_name(customer);
+
+ &check_project;
+
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy')));
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
+
+ $form->{"exchangerate_$i"} = $exchangerate if ($form->{"forex_$i"} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy')));
+ }
+ }
+
+ $i = $form->{rowcount};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ # if last row empty, check the form otherwise retrieve new item
+ if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
+
+ $form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid});
+ &check_form;
+
+ } else {
+
+ IS->retrieve_item(\%myconfig, \%$form);
+
+ $rows = scalar @{ $form->{item_list} };
+
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100);
+
+ if ($rows) {
+ $form->{"qty_$i"} = ($form->{"qty_$i"} * 1) ? $form->{"qty_$i"} : 1;
+
+ if ($rows > 1) {
+
+ &select_item;
+ exit;
+
+ } else {
+
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
+
+ map { $form->{item_list}[$i]{$_} =~ s/"/&quot;/g } qw(partnumber description unit);
+ map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
+
+ $s = ($sellprice) ? $sellprice : $form->{"sellprice_$i"};
+ ($dec) = ($s =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ if ($sellprice) {
+ $form->{"sellprice_$i"} = $sellprice;
+ } else {
+ # if there is an exchange rate adjust sellprice
+ $form->{"sellprice_$i"} /= $exchangerate;
+ }
+
+ $form->{"listprice_$i"} /= $exchangerate;
+
+ $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * (1 - $form->{"discount_$i"} / 100);
+ map { $form->{"${_}_base"} = 0 } (split / /, $form->{taxaccounts});
+ map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
+ map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{"taxaccounts_$i"} if !$form->{taxincluded};
+
+ $form->{creditremaining} -= $amount;
+
+
+ map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice listprice);
+
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ }
+
+ &display_form;
+
+ } else {
+ # ok, so this is a new part
+ # ask if it is a part or service item
+
+ if ($form->{"partsgroup_$i"} && ($form->{"partsnumber_$i"} eq "") && ($form->{"description_$i"} eq "")) {
+ $form->{rowcount}--;
+ $form->{"discount_$i"} = "";
+ &display_form;
+ } else {
+
+ $form->{"id_$i"} = 0;
+ $form->{"unit_$i"} = $locale->text('ea');
+
+ &new_item;
+
+ }
+ }
+ }
+}
+
+
+
+sub post {
+
+ $form->isblank("invnumber", $locale->text('Invoice Number missing!'));
+ $form->isblank("invdate", $locale->text('Invoice Date missing!'));
+ $form->isblank("customer", $locale->text('Customer missing!'));
+
+ # if oldcustomer ne customer redo form
+ if (&check_name(customer)) {
+ &update;
+ exit;
+ }
+
+ &validate_items;
+
+ $closedto = $form->datetonum($form->{closedto}, \%myconfig);
+ $invdate = $form->datetonum($form->{invdate}, \%myconfig);
+
+ $form->error($locale->text('Cannot post invoice for a closed period!')) if ($invdate <= $closedto);
+
+ $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
+
+ for $i (1 .. $form->{paidaccounts}) {
+ if ($form->{"paid_$i"}) {
+ $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
+
+ $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
+
+ $form->error($locale->text('Cannot post payment for a closed period!')) if ($datepaid <= $closedto);
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ $form->{"exchangerate_$i"} = $form->{exchangerate} if ($invdate == $datepaid);
+ $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
+ }
+ }
+ }
+
+
+ ($form->{AR}) = split /--/, $form->{AR};
+ ($form->{AR_paid}) = split /--/, $form->{AR_paid};
+
+ $form->{label} = $locale->text('Invoice');
+
+ $form->{id} = 0 if $form->{postasnew};
+
+ $form->redirect($locale->text('Invoice posted!')) if (IS->post_invoice(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot post invoice!'));
+
+}
+
+
+
+
+sub delete {
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ # delete action variable
+ delete $form->{action};
+
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>|.$locale->text('Confirm!').qq|</font></h2>
+
+<h4>|.$locale->text('Are you sure you want to delete Invoice Number').qq| $form->{invnumber}
+</h4>
+
+<p>
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+|;
+
+
+}
+
+
+
+sub yes {
+
+ $form->redirect($locale->text('Invoice deleted!')) if (IS->delete_invoice(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete invoice!'));
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/login.pl b/sql-ledger/bin/mozilla/login.pl
new file mode 100644
index 000000000..3c36564fd
--- /dev/null
+++ b/sql-ledger/bin/mozilla/login.pl
@@ -0,0 +1,217 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#######################################################################
+
+
+use DBI;
+use SL::User;
+use SL::Form;
+
+
+$form = new Form;
+
+$locale = new Locale $language, "login";
+
+# customization
+if (-f "$form->{path}/custom_$form->{script}") {
+ eval { require "$form->{path}/custom_$form->{script}"; };
+ $form->error($@) if ($@);
+}
+
+# per login customization
+if (-f "$form->{path}/$form->{login}_$form->{script}") {
+ eval { require "$form->{path}/$form->{login}_$form->{script}"; };
+ $form->error($@) if ($@);
+}
+
+# window title bar, user info
+$form->{titlebar} = "SQL-Ledger ".$locale->text('Version'). " $form->{version}";
+
+if ($form->{action}) {
+ $form->{titlebar} .= " - $myconfig{name} - $myconfig{dbname}";
+ &{ $locale->findsub($form->{action}) };
+} else {
+ &login_screen;
+}
+
+
+1;
+
+
+sub login_screen {
+
+ if (-f "css/sql-ledger.css") {
+ $form->{stylesheet} = "sql-ledger.css";
+ }
+
+ $form->header;
+
+ print qq|
+<body class=login>
+
+<pre>
+
+</pre>
+
+<center>
+<table class=login border=3 cellpadding=20>
+ <tr>
+ <td class=login align=center><a href="http://www.sql-ledger.org" target=_top><img src=sql-ledger.png border=0></a>
+<h1 class=login align=center>|.$locale->text('Version').qq| $form->{version}
+</h1>
+
+<p>
+
+<form method=post action=$form->{script}>
+
+ <table width=100%>
+ <tr>
+ <td align=center>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Name').qq|</th>
+ <td><input class=login name=login size=30></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Password').qq|</th>
+ <td><input class=login type=password name=password size=30></td>
+ </tr>
+ <input type=hidden name=path value=$form->{path}>
+ </table>
+
+ <br>
+ <input type=submit name=action value="|.$locale->text('Login').qq|">
+
+ </td>
+ </tr>
+ </table>
+
+</form>
+
+ </td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub login {
+
+ $form->error($locale->text('You did not enter a name!')) unless ($form->{login});
+
+ $user = new User $memberfile, $form->{login};
+
+ # if we get an error back, bale out
+ if (($errno = $user->login(\%$form, $userspath)) <= -1) {
+ $errno *= -1;
+ $err[1] = $locale->text('Incorrect Password!');
+ $err[2] = $locale->text('Incorrect Dataset version!');
+ $err[3] = qq|$form->{login} |.$locale->text('is not a member!');
+
+ $form->error($err[$errno]);
+ }
+
+ # made it this far, execute the menu
+ $argv = "login=$form->{login}&password=$form->{password}&path=$form->{path}&action=display";
+
+ exec ("perl", "menu.pl", $argv);
+
+}
+
+
+
+sub logout {
+
+ unlink "$userspath/$form->{login}.conf";
+
+ # remove the callback to display the message
+ $form->{callback} = "login.pl?path=$form->{path}&action=&login=";
+ $form->redirect($locale->text('You are logged out!'));
+
+}
+
+
+
+sub company_logo {
+
+ require "$userspath/$form->{login}.conf";
+ $locale = new Locale $myconfig{countrycode}, "login" unless ($language eq $myconfig{countrycode});
+
+ $myconfig{address} =~ s/\\n/<br>/g;
+ $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
+
+ map { $form->{$_} = $myconfig{$_} } qw(charset stylesheet);
+
+ $form->{title} = $locale->text('About');
+
+
+ # create the logo screen
+ $form->header unless $form->{noheader};
+
+ print qq|
+<body>
+
+<pre>
+
+</pre>
+<center>
+<a href="http://www.sql-ledger.org" target=_top><img src=sql-ledger.png border=0></a>
+<h1 class=login>|.$locale->text('Version').qq| $form->{version}</h1>
+
+<p>
+|.$locale->text('Licensed to').qq|
+<p>
+<b>
+$myconfig{company}
+<br>$myconfig{address}
+</b>
+
+<p>
+<table>
+ <tr>
+ <th align=right>|.$locale->text('User').qq|</th>
+ <td>$myconfig{name}</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Dataset').qq|</th>
+ <td>$myconfig{dbname}</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Database Host').qq|</th>
+ <td>$myconfig{dbhost}</td>
+ </tr>
+</table>
+
+</center>
+
+</body>
+</html>
+|;
+
+}
+
+
+
diff --git a/sql-ledger/bin/mozilla/menu.pl b/sql-ledger/bin/mozilla/menu.pl
new file mode 100644
index 000000000..67c18bd54
--- /dev/null
+++ b/sql-ledger/bin/mozilla/menu.pl
@@ -0,0 +1,160 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Christopher Browne
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#######################################################################
+#
+# two frame layout with refractured menu
+#
+# CHANGE LOG:
+# DS. 2002-03-25 Created
+#######################################################################
+
+$menufile = "menu.ini";
+use SL::Menu;
+
+
+1;
+# end of main
+
+
+sub display {
+
+ $framesize = ($ENV{HTTP_USER_AGENT} =~ /links/i) ? "240" : "135";
+
+ $form->header;
+
+ print qq|
+
+<FRAMESET COLS="$framesize,*" BORDER="1">
+
+ <FRAME NAME="acc_menu" SRC="$form->{script}?login=$form->{login}&password=$form->{password}&action=acc_menu&path=$form->{path}">
+ <FRAME NAME="main_window" SRC="login.pl?login=$form->{login}&password=$form->{password}&action=company_logo&path=$form->{path}">
+
+</FRAMESET>
+
+</BODY>
+</HTML>
+|;
+
+}
+
+
+
+sub acc_menu {
+
+ my $menu = new Menu "$menufile";
+ $menu = new Menu "custom_$menufile" if (-f "custom_$menufile");
+ $menu = new Menu "$form->{login}_$menufile" if (-f "$form->{login}_$menufile");
+
+ $form->{title} = $locale->text('Accounting Menu');
+
+ $form->header;
+
+ print qq|
+<body class=menu>
+
+|;
+
+ &section_menu($menu);
+
+ print qq|
+</body>
+</html>
+|;
+
+}
+
+
+sub section_menu {
+ my ($menu, $level) = @_;
+
+ # build tiered menus
+ my @menuorder = $menu->access_control(\%myconfig, $level);
+
+ while (@menuorder) {
+ $item = shift @menuorder;
+ $label = $item;
+ $label =~ s/$level--//g;
+
+ my $spacer = "&nbsp;" x (($item =~ s/--/--/g) * 2);
+
+ $label =~ s/.*--//g;
+ $label = $locale->text($label);
+ $label =~ s/ /&nbsp;/g;
+
+ $menu->{$item}{target} = "main_window" unless $menu->{$item}{target};
+
+ if ($menu->{$item}{submenu}) {
+ $menu->{$item}{$item} = !$form->{$item};
+
+ if ($form->{level} && $item =~ /^$form->{level}/) {
+
+ # expand menu
+ print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ &section_menu($menu, $item);
+
+ print qq|<br>\n|;
+
+ } else {
+
+ print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label&nbsp;...</a>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ }
+
+
+ } else {
+
+ if ($menu->{$item}{module}) {
+ if ($form->{$item} && $form->{level} eq $item) {
+ $menu->{$item}{$item} = !$form->{$item};
+ print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
+
+ # remove same level items
+ map { shift @menuorder } grep /^$item/, @menuorder;
+
+ &section_menu($menu, $item);
+
+ } else {
+ print qq|<br>\n$spacer|.$menu->menuitem(\%myconfig, \%$form, $item, $level).qq|$label</a>|;
+ }
+
+ } else {
+
+ print qq|<br><b>$label</b>|;
+
+ &section_menu($menu, $item);
+
+ print qq|<br>\n|;
+
+ }
+ }
+ }
+}
+
+
diff --git a/sql-ledger/bin/mozilla/oe.pl b/sql-ledger/bin/mozilla/oe.pl
new file mode 100644
index 000000000..6a8326ff2
--- /dev/null
+++ b/sql-ledger/bin/mozilla/oe.pl
@@ -0,0 +1,1111 @@
+#=====================================================================
+# SQL-Ledger, Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Order entry module
+#
+#======================================================================
+
+
+use SL::OE;
+use SL::IR;
+use SL::IS;
+use SL::PE;
+
+require "$form->{path}/io.pl";
+require "$form->{path}/arap.pl";
+
+1;
+# end of main
+
+
+sub add {
+
+ if ($form->{type} eq 'purchase_order') {
+ $form->{title} = $locale->text('Add Purchase Order');
+ $form->{vc} = 'vendor';
+ }
+ if ($form->{type} eq 'sales_order') {
+ $form->{title} = $locale->text('Add Sales Order');
+ $form->{vc} = 'customer';
+ }
+
+ &order_links;
+ &prepare_order;
+ &display_form;
+
+}
+
+
+sub edit {
+
+ if ($form->{type} eq 'purchase_order') {
+ $form->{title} = $locale->text('Edit Purchase Order');
+ $form->{vc} = 'vendor';
+ }
+ if ($form->{type} eq 'sales_order') {
+ $form->{title} = $locale->text('Edit Sales Order');
+ $form->{vc} = 'customer';
+ }
+
+ &order_links;
+ &prepare_order;
+
+ &display_form;
+
+}
+
+
+sub order_links {
+
+ # get vendors / customers
+ $form->all_vc(\%myconfig, $form->{vc});
+
+ # retrieve order
+ OE->retrieve_order(\%myconfig, \%$form);
+
+ $taxincluded = $form->{taxincluded};
+ $form->{shipto} = 1 if $form->{id};
+
+ # get customer / vendor
+ if ($form->{type} eq 'purchase_order') {
+ IR->get_vendor(\%myconfig, \%$form);
+ }
+ if ($form->{type} eq 'sales_order') {
+ IS->get_customer(\%myconfig, \%$form);
+ }
+
+ ($form->{$form->{vc}}) = split /--/, $form->{$form->{vc}};
+ $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
+
+ # build the popup menus
+ if (@{ $form->{"all_$form->{vc}"} }) {
+ $form->{$form->{vc}} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
+ map { $form->{"select$form->{vc}"} .= "<option>$_->{name}--$_->{id}\n" } (@{ $form->{"all_$form->{vc}"} });
+ }
+
+ # currencies
+ @curr = split /:/, $form->{currencies};
+ chomp $curr[0];
+ $form->{defaultcurrency} = $curr[0];
+
+ map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
+
+ $form->{taxincluded} = $taxincluded if ($form->{id});
+
+ # forex
+ $form->{forex} = $form->{exchangerate};
+
+}
+
+
+sub prepare_order {
+
+ $form->{format} = "html";
+ $form->{media} = "screen";
+
+ if ($form->{id}) {
+
+ map { $form->{$_} =~ s/"/&quot;/g } qw(invnumber shippingpoint notes shiptoname shiptoaddr1 shiptoaddr2 shiptoaddr3 shiptoaddr4 shiptocontact);
+
+ foreach $ref (@{ $form->{order_details} } ) {
+ $i++;
+ map { $form->{"${_}_$i"} = $ref->{$_} } keys %{ $ref };
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ map { $form->{"${_}_$i"} =~ s/"/&quot;/g } qw(partnumber description unit);
+ $form->{rowcount} = $i;
+ }
+ }
+
+}
+
+
+sub form_header {
+
+ $checkedopen = ($form->{closed}) ? "" : "checked";
+ $checkedclosed = ($form->{closed}) ? "checked" : "";
+
+ if ($form->{id}) {
+ $openclosed = qq|
+ <tr>
+ <td colspan=2 align=center>
+ <table>
+ <tr>
+ <th nowrap><input name=closed type=radio class=radio value=0 $checkedopen> |.$locale->text('Open').qq|</th>
+ <th nowrap><input name=closed type=radio class=radio value=1 $checkedclosed> |.$locale->text('Closed').qq|</th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+ }
+
+ # set option selected
+ foreach $item ($form->{vc}, currency) {
+ $form->{"select$item"} =~ s/ selected//;
+ $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ }
+
+ $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
+
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+
+ $exchangerate = qq|
+<input type=hidden name=forex value=$form->{forex}>
+|;
+
+ if ($form->{currency} ne $form->{defaultcurrency}) {
+ if ($form->{forex}) {
+ $exchangerate .= qq|<th align=right>|.$locale->text('Exchangerate').qq|</th><td>$form->{exchangerate}</td>
+ <input type=hidden name=exchangerate value=$form->{exchangerate}>
+|;
+ } else {
+ $exchangerate .= qq|<th align=right>|.$locale->text('Exchangerate').qq|</th><td><input name=exchangerate size=10 value=$form->{exchangerate}></td>|;
+ }
+ }
+
+
+ $vclabel = ucfirst $form->{vc};
+ $vclabel = $locale->text($vclabel);
+
+ if ($form->{type} eq 'sales_order') {
+
+ $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
+
+ $creditremaining = qq|
+ <tr>
+ <td></td>
+ <td colspan=3>
+ <table width=100%>
+ <tr>
+ <th align=left nowrap>|.$locale->text('Credit Limit').qq|</th>
+ <td>$form->{creditlimit}</td>
+ <th align=left nowrap>|.$locale->text('Remaining').qq|</th>
+ <td class="plus$n">$form->{creditremaining}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+ }
+
+ $vc = ($form->{"select$form->{vc}"}) ? qq|<select name=$form->{vc}>$form->{"select$form->{vc}"}</select>\n<input type=hidden name="select$form->{vc}" value="$form->{"select$form->{vc}"}">| : qq|<input name=$form->{vc} value="$form->{$form->{vc}}" size=35>|;
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+
+<input type=hidden name=type value=$form->{type}>
+<input type=hidden name=media value=$form->{media}>
+<input type=hidden name=format value=$form->{format}>
+
+<input type=hidden name=vc value=$form->{vc}>
+<input type=hidden name=employee value="$form->{employee}">
+
+<input type=hidden name=title value="$form->{title}">
+
+<input type=hidden name=discount value=$form->{discount}>
+<input type=hidden name=creditlimit value=$form->{creditlimit}>
+<input type=hidden name=creditremaining value=$form->{creditremaining}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right>$vclabel</th>
+ <td colspan=3>$vc</td>
+ <input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
+ <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
+ </tr>
+ $creditremaining
+ <tr>
+ <th align=right>|.$locale->text('Currency').qq|</th>
+ <td><select name=currency>$form->{selectcurrency}</select></td>
+ <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
+ <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
+ $exchangerate
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Ship via').qq|</th>
+ <td colspan=3><input name=shippingpoint size=35 value="$form->{shippingpoint}"></td>
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table width=100%>
+ $openclosed
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
+ <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Order Date').qq|</th>
+ <td><input name=orddate size=11 title="$myconfig{dateformat}" value=$form->{orddate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap=true>|.$locale->text('Required by').qq|</th>
+ <td><input name=reqdate size=11 title="$myconfig{dateformat}" value=$form->{reqdate}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Terms: Net').qq|</th>
+ <td nowrap=true><input name=terms size="3" maxlength="3" value=$form->{terms}> |.$locale->text('days').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+<!-- shipto are in hidden variables -->
+
+<input type=hidden name=shiptoname value="$form->{shiptoname}">
+<input type=hidden name=shiptoaddr1 value="$form->{shiptoaddr1}">
+<input type=hidden name=shiptoaddr2 value="$form->{shiptoaddr2}">
+<input type=hidden name=shiptoaddr3 value="$form->{shiptoaddr3}">
+<input type=hidden name=shiptoaddr4 value="$form->{shiptoaddr4}">
+<input type=hidden name=shiptocontact value="$form->{shiptocontact}">
+<input type=hidden name=shiptophone value="$form->{shiptophone}">
+<input type=hidden name=shiptofax value="$form->{shiptofax}">
+<input type=hidden name=shiptoemail value="$form->{shiptoemail}">
+
+<!-- email variables -->
+<input type=hidden name=message value="$form->{message}">
+<input type=hidden name=email value="$form->{email}">
+<input type=hidden name=subject value="$form->{subject}">
+<input type=hidden name=cc value="$form->{cc}">
+<input type=hidden name=bcc value="$form->{bcc}">
+
+<input type=hidden name=taxpart value="$form->{taxpart}">
+<input type=hidden name=taxservice value="$form->{taxservice}">
+
+<input type=hidden name=taxaccounts value="$form->{taxaccounts}">
+|;
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ print qq|
+<input type=hidden name="${item}_rate" value=$form->{"${item}_rate"}>
+<input type=hidden name="${item}_description" value="$form->{"${item}_description"}">
+|;
+ }
+
+}
+
+
+sub form_footer {
+
+ $form->{invtotal} = $form->{invsubtotal};
+
+ if (($rows = $form->numtextrows($form->{notes}, 50, 8)) < 2) {
+ $rows = 2;
+ }
+ $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
+
+ $taxincluded = "";
+ $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
+ if ($form->{taxaccounts}) {
+ $taxincluded = qq|
+ <input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}> <b>|.$locale->text('Tax Included').qq|</b><br><br>
+|;
+ }
+
+ if (!$form->{taxincluded}) {
+
+ foreach $item (split / /, $form->{taxaccounts}) {
+ if ($form->{"${item}_base"}) {
+ $form->{invtotal} += $form->{"${item}_total"} = $form->round_amount($form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
+ $form->{"${item}_total"} = $form->format_amount(\%myconfig, $form->{"${item}_total"}, 2);
+
+ $tax .= qq|
+ <tr>
+ <th align=right>$form->{"${item}_description"}</th>
+ <td align=right>$form->{"${item}_total"}</td>
+ </tr>
+|;
+ }
+ }
+
+ $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0);
+
+ $subtotal = qq|
+ <tr>
+ <th align=right>|.$locale->text('Subtotal').qq|</th>
+ <td align=right>$form->{invsubtotal}</td>
+ </tr>
+|;
+
+ }
+
+ $form->{oldinvtotal} = $form->{invtotal};
+ $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2, 0);
+
+ print qq|
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=bottom>
+ <td>
+ <table>
+ <tr>
+ <th align=left>|.$locale->text('Notes').qq|</th>
+ </tr>
+ <tr>
+ <td>$notes</td>
+ </tr>
+ </table>
+ </td>
+ <td align=right width=100%>
+ $taxincluded
+ <table width=100%>
+ $subtotal
+ $tax
+ <tr>
+ <th align=right>|.$locale->text('Total').qq|</th>
+ <td align=right>$form->{invtotal}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+<input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
+<input type=hidden name=oldtotalpaid value=$totalpaid>
+ <tr>
+ <td>
+|;
+
+ &print_options;
+
+ print qq|
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Ship to').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Print').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('E-mail').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Save').qq|">
+|;
+
+ if ($form->{id}) {
+ print qq|
+<input class=submit type=submit name=action value="|.$locale->text('Save as new').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Invoice').qq|">
+|;
+ }
+
+ print qq|
+
+<input type=hidden name=rowcount value=$form->{rowcount}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub update {
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining);
+
+ &check_name($form->{vc});
+
+ &check_project;
+
+ $buysell = 'buy';
+ $buysell = 'sell' if ($form->{vc} eq 'vendor');
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{orddate}, $buysell)));
+
+
+ my $i = $form->{rowcount};
+ $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
+
+ if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
+
+ $form->{creditremaining} += ($form->{oldinvtotal} - $form->{oldtotalpaid});
+ &check_form;
+
+ } else {
+
+ if ($form->{type} eq 'purchase_order') {
+ IR->retrieve_item(\%myconfig, \%$form);
+ }
+ if ($form->{type} eq 'sales_order') {
+ IS->retrieve_item(\%myconfig, \%$form);
+ }
+
+ my $rows = scalar @{ $form->{item_list} };
+
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{discount} * 100);
+
+ if ($rows) {
+ $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
+
+ if ($rows > 1) {
+
+ &select_item;
+ exit;
+
+ } else {
+
+ $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
+
+ map { $form->{item_list}[$i]{$_} =~ s/"/&quot;/g } qw(partnumber description unit);
+ map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
+
+ $s = ($sellprice) ? $sellprice : $form->{"sellprice_$i"};
+
+ ($dec) = ($s =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ if ($sellprice) {
+ $form->{"sellprice_$i"} = $sellprice;
+ } else {
+ # if there is an exchange rate adjust sellprice
+ $form->{"sellprice_$i"} /= $exchangerate;
+ }
+
+ $amount = $form->{"sellprice_$i"} * $form->{"qty_$i"} * (1 - $form->{"discount_$i"} / 100);
+ map { $form->{"${_}_base"} = 0 } (split / /, $form->{taxaccounts});
+ map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
+ map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{taxaccounts} if !$form->{taxincluded};
+
+ $form->{creditremaining} -= $amount;
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+ }
+
+ &display_form;
+
+ } else {
+ # ok, so this is a new part
+ # ask if it is a part or service item
+
+ if ($form->{"partsgroup_$i"} && ($form->{"partsnumber_$i"} eq "") && ($form->{"description_$i"} eq "")) {
+ $form->{rowcount}--;
+ $form->{"discount_$i"} = "";
+ &display_form;
+ } else {
+
+ $form->{"id_$i"} = 0;
+ $form->{"unit_$i"} = $locale->text('ea');
+
+ &new_item;
+
+ }
+ }
+ }
+}
+
+
+
+sub search {
+
+ if ($form->{type} eq 'purchase_order') {
+ $form->{title} = $locale->text('Purchase Orders');
+ $form->{vc} = 'vendor';
+ }
+ if ($form->{type} eq 'sales_order') {
+ $form->{title} = $locale->text('Sales Orders');
+ $form->{vc} = 'customer';
+ }
+
+ # setup vendor / customer selection
+ $form->all_vc(\%myconfig, "$form->{vc}");
+
+ map { $vc .= "<option>$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} };
+
+ $vclabel = ucfirst $form->{vc};
+ $vclabel = $locale->text($vclabel);
+
+# $locale->text('Vendor')
+# $locale->text('Customer')
+
+ $vc = ($vc) ? qq|<select name=$form->{vc}><option>\n$vc</select>| : qq|<input name=$form->{vc} size=35>|;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>$vclabel</th>
+ <td colspan=3>$vc</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Order Number').qq|</th>
+ <td colspan=3><input name=ordnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <input type=hidden name=sort value=transdate>
+ <tr>
+ <th align=right>|.$locale->text('Include in Report').qq|</th>
+ <td colspan=3>
+ <table>
+ <tr>
+ <td><input name="open" class=checkbox type=checkbox value=1 checked> |.$locale->text('Open').qq|</td>
+ <td><input name="closed" class=checkbox type=checkbox value=1 $form->{closed}> |.$locale->text('Closed').qq|</td>
+ </tr>
+ <tr>
+ <td><input name="l_id" class=checkbox type=checkbox value=Y> |.$locale->text('ID').qq|</td>
+ <td><input name="l_ordnumber" class=checkbox type=checkbox value=Y checked> |.$locale->text('Order Number').qq|</td>
+ <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked> |.$locale->text('Order Date').qq|</td>
+ <td><input name="l_reqdate" class=checkbox type=checkbox value=Y checked> |.$locale->text('Required by').qq|</td>
+ </tr>
+ <tr>
+ <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel</td>
+ <td><input name="l_netamount" class=checkbox type=checkbox value=Y> |.$locale->text('Amount').qq|</td>
+ <td><input name="l_tax" class=checkbox type=checkbox value=Y> |.$locale->text('Tax').qq|</td>
+ <td><input name="l_amount" class=checkbox type=checkbox value=Y checked> |.$locale->text('Total').qq|</td>
+ </tr>
+ <tr>
+ <td><input name="l_subtotal" class=checkbox type=checkbox value=Y> |.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr><td colspan=4><hr size=3 noshade></td></tr>
+</table>
+
+<br>
+<input type=hidden name=nextsub value=orders>
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+<input type=hidden name=vc value=$form->{vc}>
+<input type=hidden name=type value=$form->{type}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub orders {
+
+ $name = $form->{$form->{vc}};
+
+ # split vendor / customer
+ ($form->{$form->{vc}}, $form->{"$form->{vc}_id"}) = split(/--/, $form->{$form->{vc}});
+
+ OE->transactions(\%myconfig, \%$form);
+
+ # construct href
+ $href = "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}&ordnumber=" . $form->escape($form->{ordnumber}) . "&$form->{vc}=" . $form->escape($form->{$form->{vc}});
+
+ # construct callback
+ $name =~ s/&/_/g;
+ $callback = "$form->{script}?path=$form->{path}&action=orders&type=$form->{type}&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&transdatefrom=$form->{transdatefrom}&transdateto=$form->{transdateto}&open=$form->{open}&closed=$form->{closed}&ordnumber=$form->{ordnumber}&$form->{vc}=$name";
+
+ @columns = $form->sort_columns(qw(transdate reqdate id ordnumber name netamount tax amount curr open closed));
+
+ $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}) ;
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ $href .= "&l_subtotal=Y";
+ }
+
+
+ if ($form->{vc} eq 'vendor') {
+ $form->{title} = $locale->text('Purchase Orders');
+ $name = $locale->text('Vendor');
+ }
+ if ($form->{vc} eq 'customer') {
+ $form->{title} = $locale->text('Sales Orders');
+ $name = $locale->text('Customer');
+ }
+
+ $column_header{id} = qq|<th><a class=listheading href=$href&sort=id>|.$locale->text('ID').qq|</a></th>|;
+ $column_header{transdate} = qq|<th><a class=listheading href=$href&sort=transdate>|.$locale->text('Date').qq|</a></th>|;
+ $column_header{reqdate} = qq|<th><a class=listheading href=$href&sort=reqdate>|.$locale->text('Required by').qq|</a></th>|;
+ $column_header{ordnumber} = qq|<th><a class=listheading href=$href&sort=ordnumber>|.$locale->text('Order').qq|</a></th>|;
+ $column_header{name} = qq|<th><a class=listheading href=$href&sort=name>$name</a></th>|;
+ $column_header{netamount} = qq|<th class=listheading>|.$locale->text('Amount').qq|</th>|;
+ $column_header{tax} = qq|<th class=listheading>|.$locale->text('Tax').qq|</th>|;
+ $column_header{amount} = qq|<th class=listheading>|.$locale->text('Total').qq|</th>|;
+ $column_header{curr} = qq|<th class=listheading>|.$locale->text('Curr').qq|</th>|;
+ $column_header{open} = qq|<th class=listheading>|.$locale->text('O').qq|</th>|;
+ $column_header{closed} = qq|<th class=listheading>|.$locale->text('C').qq|</th>|;
+
+ if ($form->{open}) {
+ $option = $locale->text('Open');
+ }
+ if ($form->{closed}) {
+ $option .= " : " if $form->{open};
+ $option .= $locale->text('Closed');
+ }
+ if ($form->{$form->{vc}}) {
+ $option .= "\n<br>";
+ $option .= ucfirst $form->{vc};
+ $option .= " : $form->{$form->{vc}}";
+ }
+ if ($form->{transdatefrom}) {
+ $option .= "\n<br>".$locale->text('From')." ".$locale->date(\%myconfig, $form->{transdatefrom}, 1);
+ }
+ if ($form->{transdateto}) {
+ $option .= "\n<br>".$locale->text('to')." ".$locale->date(\%myconfig, $form->{transdateto}, 1);
+ }
+
+ $form->header;
+
+ $colspan = $#column_index + 1;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
+ <tr height="5"></tr>
+ <tr>
+ <td colspan=$colspan>$option</td>
+ </tr>
+ <tr class=listheading>|;
+
+map { print "\n$column_header{$_}" } @column_index;
+
+print qq|
+ </tr>
+|;
+
+ # add sort and escape callback
+ $callback = $form->escape($callback . "&sort=$form->{sort}");
+
+ if (@{ $form->{OE} }) {
+ $sameitem = $form->{OE}->[0]->{$form->{sort}};
+ }
+
+ foreach $oe (@{ $form->{OE} }) {
+
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $oe->{$form->{sort}}) {
+ &subtotal;
+ $sameitem = $oe->{$form->{sort}};
+ }
+ }
+
+ map { $oe->{$_} *= $oe->{exchangerate} } (qw(netamount amount));
+
+ $column_data{netamount} = "<td align=right>".$form->format_amount(\%myconfig, $oe->{netamount}, 2, "&nbsp;")."</td>";
+ $column_data{tax} = "<td align=right>".$form->format_amount(\%myconfig, $oe->{amount} - $oe->{netamount}, 2, "&nbsp;")."</td>";
+ $column_data{amount} = "<td align=right>".$form->format_amount(\%myconfig, $oe->{amount}, 2, "&nbsp;")."</td>";
+
+ $totalnetamount += $oe->{netamount};
+ $totalamount += $oe->{amount};
+
+ $subtotalnetamount += $oe->{netamount};
+ $subtotalamount += $oe->{amount};
+
+ $column_data{id} = "<td>$oe->{id}</td>";
+ $column_data{transdate} = "<td>$oe->{transdate}&nbsp;</td>";
+ $column_data{reqdate} = "<td>$oe->{reqdate}&nbsp;</td>";
+
+ $column_data{ordnumber} = "<td><a href=oe.pl?path=$form->{path}&action=edit&type=$form->{type}&id=$oe->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$oe->{ordnumber}</a></td>";
+ $column_data{name} = "<td>$oe->{name}</td>";
+
+ if ($oe->{closed}) {
+ $column_data{closed} = "<td align=center>X</td>";
+ $column_data{open} = "<td>&nbsp;</td>";
+ } else {
+ $column_data{closed} = "<td>&nbsp;</td>";
+ $column_data{open} = "<td align=center>X</td>";
+ }
+
+ $i++; $i %= 2;
+ print "<tr class=listrow$i>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &subtotal;
+ }
+
+ # print totals
+ print qq|<tr class=listtotal>|;
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{netamount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{tax} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount - $totalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalamount, 2, "&nbsp;")."</th>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+ <tr><td colspan=8><hr size=3 noshade></td></tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=type value=$form->{type}>
+<input type=hidden name=vc value=$form->{vc}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value=|.$locale->text('Add').qq|
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{netamount} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{tax} = "<td class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount - $subtotalnetamount, 2, "&nbsp;")."</th>";
+ $column_data{amount} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalamount, 2, "&nbsp;")."</th>";
+
+ $subtotalnetamount = 0;
+ $subtotalamount = 0;
+
+ print "<tr class=listsubtotal>";
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+}
+
+
+sub save {
+
+ $form->isblank("ordnumber", $locale->text('Order Number missing!'));
+ $form->isblank("orddate", $locale->text('Order Date missing!'));
+
+ $msg = ucfirst $form->{vc};
+ $form->isblank($form->{vc}, $locale->text($msg . " missing!"));
+
+# $locale->text('Customer missing!');
+# $locale->text('Vendor missing!');
+
+ $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency});
+
+ &validate_items;
+
+ # if the name changed get new values
+ if (&check_name($form->{vc})) {
+ &update;
+ exit;
+ }
+
+
+ # this is for the notes section for the [email] Subject
+ $form->{label} = ($form->{type} eq 'sales_order') ? $locale->text('Sales Order') : $locale->text('Purchase Order');
+
+ $form->{id} = 0 if $form->{saveasnew};
+
+ $form->redirect($locale->text('Order saved!')) if (OE->save_order(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot save order!'));
+
+}
+
+
+
+sub delete {
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+|;
+
+ # delete action variable
+ delete $form->{action};
+
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+<h2 class=confirm>|.$locale->text('Confirm!').qq|</h2>
+
+<h4>|
+ .$locale->text('Are you sure you want to delete Order Number').qq| $form->{ordnumber}
+</h4>
+<p>
+<input name=action class=submit type=submit value="|.$locale->text('Yes').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+
+}
+
+
+
+sub yes {
+
+ $form->redirect($locale->text('Order deleted!')) if (OE->delete_order(\%myconfig, \%$form));
+ $form->error($locale->text('Cannot delete order!'));
+
+}
+
+
+sub invoice {
+
+ $form->isblank("ordnumber", $locale->text('Order Number missing!'));
+ $form->isblank("orddate", $locale->text('Order Date missing!'));
+
+
+ # if the name changed get new values
+ if (&check_name($form->{vc})) {
+ &update;
+ exit;
+ }
+
+ $form->{closed} = 1;
+ OE->save_order(\%myconfig, \%$form);
+
+ $form->{orddate} = $form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig);
+ $form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1);
+
+ $form->{id} = '';
+ $form->{closed} = 0;
+ $form->{rowcount}--;
+ $form->{shipto} = 1;
+
+ &create_backorder;
+
+ if ($form->{type} eq 'purchase_order') {
+ $form->{title} = $locale->text('Add Vendor Invoice');
+ $form->{script} = 'ir.pl';
+ $script = "ir";
+ $buysell = 'sell';
+ }
+ if ($form->{type} eq 'sales_order') {
+ $form->{title} = $locale->text('Add Sales Invoice');
+ $form->{script} = 'is.pl';
+ $script = "is";
+ $buysell = 'buy';
+ }
+
+
+ # bo creates the id, reset it
+ map { $form->{$_} = "" } qw(id subject message cc bcc);
+ $form->{$form->{vc}} =~ s/--.*//g;
+ $form->{type} = "invoice";
+
+ # locale messages
+ $locale = new Locale "$myconfig{countrycode}", "$script";
+
+ require "$form->{path}/$form->{script}";
+
+ map { $form->{"select$_"} = "" } ($form->{vc}, currency);
+
+ map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(creditlimit creditremaining);
+
+ $currency = $form->{currency};
+ &invoice_links;
+
+ $form->{currency} = $currency;
+ $form->{exchangerate} = "";
+ $form->{forex} = "";
+ $form->{exchangerate} = $exchangerate if ($form->{forex} = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell)));
+
+ $form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
+
+ &prepare_invoice;
+
+ # format amounts
+ for $i (1 .. $form->{rowcount}) {
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"});
+
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ map { $form->{"${_}_$i"} =~ s/"/&quot;/g } qw(partnumber description unit);
+ }
+
+ &display_form;
+
+}
+
+
+sub create_backorder {
+
+ # figure out if we need to create a backorder
+ # items aren't saved if qty != 0
+
+ for $i (1 .. $form->{rowcount}) {
+ $totalqty += $qty = $form->parse_amount($myconfig, $form->{"qty_$i"});
+ $totalship += $ship = $form->parse_amount($myconfig, $form->{"ship_$i"});
+
+ $form->{"qty_$i"} = $qty - $ship;
+ }
+
+ if ($totalship == 0) {
+ map { $form->{"ship_$_"} = $form->{"qty_$_"} } (1 .. $form->{rowcount});
+ $form->{ordtotal} = 0;
+ return;
+ }
+
+ if ($totalqty == $totalship) {
+ map { $form->{"qty_$_"} = $form->{"ship_$_"} } (1 .. $form->{rowcount});
+ $form->{ordtotal} = 0;
+ return;
+ }
+
+ @flds = (qw(partnumber description qty ship unit sellprice discount id inventory_accno bin income_accno expense_accno listprice assembly taxaccounts));
+
+ OE->save_order(\%myconfig, \%$form);
+
+ # rebuild rows for invoice
+ @a = ();
+ $count = 0;
+
+ for $i (1 .. $form->{rowcount}) {
+
+ # reformat values if there was a backorder quantity
+ if ($form->{"qty_$i"}) {
+ $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"});
+ $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
+ }
+
+ $form->{"qty_$i"} = $form->{"ship_$i"};
+
+ if ($form->{"qty_$i"}) {
+ push @a, {};
+ $j = $#a;
+ map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
+ $count++;
+ }
+ }
+
+ $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
+ $form->{rowcount} = $count;
+
+}
+
+
+
+sub save_as_new {
+
+ $form->{saveasnew} = 1;
+ $form->{closed} = 0;
+ &save;
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/pe.pl b/sql-ledger/bin/mozilla/pe.pl
new file mode 100644
index 000000000..d8706d413
--- /dev/null
+++ b/sql-ledger/bin/mozilla/pe.pl
@@ -0,0 +1,549 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# project administration
+# partsgroup administration
+#
+#======================================================================
+
+
+use SL::PE;
+
+1;
+# end of main
+
+
+
+sub add {
+
+ $form->{title} = "Add";
+
+ # construct callback
+ $form->{callback} = "$form->{script}?action=add&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+
+ &{ "form_$form->{type}_header" };
+ &{ "form_$form->{type}_footer" };
+
+}
+
+
+sub edit {
+
+ $form->{title} = "Edit";
+
+ if ($form->{type} eq 'project') {
+ PE->get_project(\%myconfig, \%$form);
+ }
+ if ($form->{type} eq 'partsgroup') {
+ PE->get_partsgroup(\%myconfig, \%$form);
+ }
+
+ &{ "form_$form->{type}_header" };
+ &{ "form_$form->{type}_footer" };
+
+}
+
+
+sub search {
+
+ if ($form->{type} eq 'project') {
+ $report = "project_report";
+ $sort = 'projectnumber';
+ $form->{title} = $locale->text('Projects');
+
+ $number = qq|
+ <tr>
+ <th align=right width=1%>|.$locale->text('Number').qq|</th>
+ <td><input name=projectnumber size=20></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td><input name=description size=60></td>
+ </tr>
+|;
+
+ }
+ if ($form->{type} eq 'partsgroup') {
+ $report = "partsgroup_report";
+ $sort = 'partsgroup';
+ $form->{title} = $locale->text('Groups');
+
+ $number = qq|
+ <tr>
+ <th align=right width=1%>|.$locale->text('Group').qq|</th>
+ <td><input name=partsgroup size=20></td>
+ </tr>
+|;
+
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=sort value=$sort>
+<input type=hidden name=type value=$form->{type}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ $number
+ <tr>
+ <td></td>
+ <td><input name=status class=radio type=radio value=all checked>&nbsp;|.$locale->text('All').qq|
+ <input name=status class=radio type=radio value=orphaned>&nbsp;|.$locale->text('Orphaned').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=$report>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub project_report {
+
+ map { $form->{$_} = $form->unescape($form->{$_}) } (projectnumber, description);
+ PE->projects(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=project_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+ $href = $callback;
+
+ if ($form->{status} eq 'all') {
+ $option = $locale->text('All');
+ }
+ if ($form->{status} eq 'orphaned') {
+ $option .= $locale->text('Orphaned');
+ }
+ if ($form->{projectnumber}) {
+ $href .= "&projectnumber=".$form->escape($form->{projectnumber});
+ $callback .= "&projectnumber=$form->{projectnumber}";
+ $option .= "\n<br>".$locale->text('Project')." : $form->{projectnumber}";
+ }
+ if ($form->{description}) {
+ $href .= "&description=".$form->escape($form->{description});
+ $callback .= "&description=$form->{description}";
+ $option .= "\n<br>".$locale->text('Description')." : $form->{description}";
+ }
+
+
+ @column_index = $form->sort_columns(qw(projectnumber description));
+
+ $column_header{projectnumber} = qq|<th><a class=listheading href=$href&sort=projectnumber>|.$locale->text('Number').qq|</a></th>|;
+ $column_header{description} = qq|<th><a class=listheading href=$href&sort=description>|.$locale->text('Description').qq|</a></th>|;
+
+ $form->{title} = $locale->text('Projects');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ # escape callback
+ $form->{callback} = $callback .= "&sort=$form->{sort}";
+
+ # escape callback for href
+ $callback = $form->escape($callback);
+
+ foreach $ref (@{ $form->{project_list} }) {
+
+ $i++; $i %= 2;
+
+ print qq|
+ <tr valign=top class=listrow$i>
+|;
+
+ $column_data{projectnumber} = qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{projectnumber}</td>|;
+ $column_data{description} = qq|<td>$ref->{description}&nbsp;</td>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print "
+ </tr>
+";
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=type value=$form->{type}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Add').qq|">
+
+</body>
+</html>
+|;
+
+}
+
+
+sub form_project_header {
+
+ $form->{title} = $locale->text("$form->{title} Project");
+
+# $locale->text('Add Project')
+# $locale->text('Edit Project')
+
+ $form->{description} =~ s/"/&quot;/g;
+
+ if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
+ $description = qq|<textarea name="description" rows=$rows cols=60 style="width: 100%" wrap=soft>$form->{description}</textarea>|;
+ } else {
+ $description = qq|<input name=description size=60 value="$form->{description}">|;
+ }
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=type value=project>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Number').qq|</th>
+ <td><input name=projectnumber size=20 value="$form->{projectnumber}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Description').qq|</th>
+ <td>$description</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub form_project_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+|;
+
+ if ($form->{id} && $form->{orphaned}) {
+ print qq|
+<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub save {
+
+ if ($form->{type} eq 'project') {
+ $form->isblank("projectnumber", $locale->text('Project Number missing!'));
+ PE->save_project(\%myconfig, \%$form);
+ $form->redirect($locale->text('Project saved!'));
+ }
+ if ($form->{type} eq 'partsgroup') {
+ $form->isblank("partsgroup", $locale->text('Group missing!'));
+ PE->save_partsgroup(\%myconfig, \%$form);
+ $form->redirect($locale->text('Group saved!'));
+ }
+
+}
+
+
+sub delete {
+
+ PE->delete_tuple(\%myconfig, \%$form);
+
+ if ($form->{type} eq 'project') {
+ $form->redirect($locale->text('Project deleted!'));
+ }
+ if ($form->{type} eq 'partsgroup') {
+ $form->redirect($locale->text('Group deleted!'));
+ }
+
+}
+
+
+sub continue { &{ $form->{nextsub} } };
+
+
+sub partsgroup_report {
+
+ map { $form->{$_} = $form->unescape($form->{$_}) } (partsgroup);
+ PE->partsgroups(\%myconfig, \%$form);
+
+ $callback = "$form->{script}?action=partsgroup_report&type=$form->{type}&path=$form->{path}&login=$form->{login}&password=$form->{password}&status=$form->{status}";
+
+ if ($form->{status} eq 'all') {
+ $option = $locale->text('All');
+ }
+ if ($form->{status} eq 'orphaned') {
+ $option .= $locale->text('Orphaned');
+ }
+ if ($form->{partsgroup}) {
+ $callback .= "&partsgroup=$form->{partsgroup}";
+ $option .= "\n<br>".$locale->text('Group')." : $form->{partsgroup}";
+ }
+
+
+ @column_index = (partsgroup);
+
+ $column_header{partsgroup} = qq|<th class=listheading width=90%>|.$locale->text('Group').qq|</th>|;
+
+ $form->{title} = $locale->text('Groups');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ # escape callback
+ $form->{callback} = $callback;
+
+ # escape callback for href
+ $callback = $form->escape($callback);
+
+ foreach $ref (@{ $form->{item_list} }) {
+
+ $i++; $i %= 2;
+
+ print qq|
+ <tr valign=top class=listrow$i>
+|;
+
+
+ $column_data{partsgroup} = qq|<td><a href=$form->{script}?action=edit&type=$form->{type}&status=$form->{status}&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partsgroup}</td>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print "
+ </tr>
+";
+ }
+
+ print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=$form->{script}>
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=type value=$form->{type}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input class=submit type=submit name=action value="|.$locale->text('Add').qq|">
+
+</body>
+</html>
+|;
+
+}
+
+
+sub form_partsgroup_header {
+
+ $form->{title} = $locale->text("$form->{title} Group");
+
+# $locale->text('Add Group')
+# $locale->text('Edit Group')
+
+ $form->{partsgroup} =~ s/"/&quot;/g;
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=id value=$form->{id}>
+<input type=hidden name=type value=$form->{type}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right>|.$locale->text('Group').qq|</th>
+ <td><input name=partsgroup size=30 value="$form->{partsgroup}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=2><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+}
+
+
+sub form_partsgroup_footer {
+
+ print qq|
+
+<input name=callback type=hidden value="$form->{callback}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br><input type=submit class=submit name=action value="|.$locale->text('Save').qq|">
+|;
+
+ if ($form->{id} && $form->{orphaned}) {
+ print qq|
+<input type=submit class=submit name=action value="|.$locale->text('Delete').qq|">|;
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/rc.pl b/sql-ledger/bin/mozilla/rc.pl
new file mode 100644
index 000000000..cf2bc235b
--- /dev/null
+++ b/sql-ledger/bin/mozilla/rc.pl
@@ -0,0 +1,371 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# Account reconciliation module
+#
+#======================================================================
+
+
+use SL::RC;
+
+
+1;
+# end of main
+
+
+sub reconciliation {
+
+ RC->paymentaccounts(\%myconfig, \%$form);
+
+ $selection = "";
+ map { $selection .= "<option>$_->{accno}--$_->{description}\n" } @{ $form->{PR} };
+
+ $form->{title} = $locale->text('Reconciliation');
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Account').qq|</th>
+ <td colspan=3><select name=accno>$selection</select>
+ </td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<input type=hidden name=nextsub value=get_payments>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub continue { &{ $form->{nextsub} } };
+
+
+sub get_payments {
+
+ ($form->{accno}, $form->{account}) = split /--/, $form->{accno};
+
+ RC->payment_transactions(\%myconfig, \%$form);
+
+ &display_form;
+
+}
+
+
+sub display_form {
+
+ @column_index = qw(cleared transdate source name credit debit balance);
+
+ $column_header{cleared} = "<th class=listheading>&nbsp;</th>";
+ $column_header{source} = "<th class=listheading>".$locale->text('Source')."</a></th>";
+ $column_header{name} = "<th class=listheading>".$locale->text('Description')."</a></th>";
+ $column_header{transdate} = "<th class=listheading>".$locale->text('Date')."</a></th>";
+
+ $column_header{debit} = "<th class=listheading>".$locale->text('Deposit')."</a></th>";
+ $column_header{credit} = "<th class=listheading>".$locale->text('Payment')."</a></th>";
+
+ $column_header{balance} = "<th class=listheading>".$locale->text('Balance')."</a></th>";
+
+ if ($form->{fromdate}) {
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('From')."&nbsp;".$locale->date(\%myconfig, $form->{fromdate}, 1);
+ }
+ if ($form->{todate}) {
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('to')."&nbsp;".$locale->date(\%myconfig, $form->{todate}, 1);
+ }
+
+ $form->{title} = "$form->{accno}--$form->{account}";
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ $form->{beginningbalance} *= -1;
+ $clearedbalance = $balance = $form->{beginningbalance};
+ $i = 0;
+ $id = 0;
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } qw(cleared transdate source name debit credit);
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $balance, 2, 0)."</td>";
+ $j = 0;
+ print qq|
+ <tr class=listrow$j>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ foreach $ref (@{ $form->{PR} }) {
+
+ $balance += $ref->{amount} * -1;
+ $cleared += $ref->{amount} * -1 if $ref->{cleared};
+
+ $column_data{name} = "<td>$ref->{name}&nbsp;</td>";
+ $column_data{source} = qq|<td>$ref->{source}&nbsp;</a>
+ </td>|;
+ $column_data{transdate} = "<td>$ref->{transdate}&nbsp;</td>";
+
+ $column_data{debit} = "<td>&nbsp;</td>";
+ $column_data{credit} = "<td>&nbsp;</td>";
+
+ if ($ref->{amount} < 0) {
+ $totaldebits += $ref->{amount} * -1;
+ $column_data{debit} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{amount} * -1, 2, "&nbsp;")."</td>";
+ } else {
+ $totalcredits += $ref->{amount};
+ $column_data{credit} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{amount}, 2, "&nbsp;")."</td>";
+ }
+
+ $column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $balance, 2, 0)."</td>";
+
+ if ($ref->{fx_transaction}) {
+ $i++ unless $id == $ref->{id};
+ $fx_transaction = 1;
+ $fx += $ref->{amount} * -1;
+ $column_data{cleared} = qq|<td align=center>&nbsp;
+ <input type=hidden name="fxoid_$i" value=$ref->{oid}>
+ </td>|;
+ } else {
+ $i++ unless ($fx_transaction && $id == $ref->{id});
+ $fx_transaction = 0;
+ $column_data{cleared} = qq|<td>
+ <input name="cleared_$i" type=checkbox class=checkbox value=1 $ref->{cleared}>
+ <input type=hidden name="oid_$i" value=$ref->{oid}>
+ </td>|;
+ }
+ $id = $ref->{id};
+
+ $j++; $j %= 2;
+ print qq|
+ <tr class=listrow$j>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ # print totals
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{debit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totaldebits, 2, "&nbsp;")."</th>";
+ $column_data{credit} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalcredits, 2, "&nbsp;")."</th>";
+
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ $form->{statementbalance} = $form->parse_amount(\%myconfig, $form->{statementbalance});
+ $difference = $form->format_amount(\%myconfig, $form->{statementbalance} - $clearedbalance - $cleared, 2, 0);
+
+ $form->{statementbalance} = $form->format_amount(\%myconfig, $form->{statementbalance}, 2, 0);
+
+ $clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
+
+ if ($fx) {
+ $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
+ $exchdiff = qq|
+ <th align=right nowrap>|.$locale->text('Exchangerate Difference').qq|</th>
+ <td width=10%></td>
+ <td align=right>$fx</td>
+|;
+ }
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Cleared Balance').qq|</th>
+ <td width=10%></td>
+ <td align=right>$clearedbalance</td>
+ </tr>
+ <tr>
+ $exchdiff
+ </tr>
+ </table>
+ </td>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Statement Balance').qq|</th>
+ <td width=10%></td>
+ <td align=right><input name=statementbalance size=11 value=$form->{statementbalance}></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Difference').qq|</th>
+ <td width=10%></td>
+ <td align=right><input name=none size=11 value=$difference></td>
+ <input type=hidden name=difference value=$difference>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=rowcount value=$i>
+<input type=hidden name=accno value=$form->{accno}>
+<input type=hidden name=account value="$form->{account}">
+
+<input type=hidden name=fromdate value=$form->{fromdate}>
+<input type=hidden name=todate value=$form->{todate}>
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input type=submit class=submit name=action value="|.$locale->text('Update').qq|">
+<input type=submit class=submit name=action value="|.$locale->text('Select all').qq|">
+<input type=submit class=submit name=action value="|.$locale->text('Done').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub update {
+
+ RC->payment_transactions(\%myconfig, \%$form);
+
+ foreach $ref (@{ $form->{PR} }) {
+ if (!$ref->{fx_transaction}) {
+ $i++;
+ $ref->{cleared} = "checked" if $form->{"cleared_$i"};
+ }
+ }
+
+ &display_form;
+
+}
+
+
+sub select_all {
+
+ RC->payment_transactions(\%myconfig, \%$form);
+
+ map { $_->{cleared} = "checked" unless $_->{fx_transaction} } @{ $form->{PR} };
+
+ &display_form;
+
+}
+
+
+sub done {
+
+ $form->{callback} = "$form->{script}?path=$form->{path}&action=reconciliation&login=$form->{login}&password=$form->{password}";
+
+ $form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1);
+
+ RC->reconcile(\%myconfig, \%$form);
+ $form->redirect;
+
+}
+
+
diff --git a/sql-ledger/bin/mozilla/rp.pl b/sql-ledger/bin/mozilla/rp.pl
new file mode 100644
index 000000000..41cff8cf0
--- /dev/null
+++ b/sql-ledger/bin/mozilla/rp.pl
@@ -0,0 +1,1730 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (c) 1998-2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Antonio Gallardo <agssa@ibw.com.ni>
+# Benjamin Lee <benjaminlee@consultant.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# module for preparing Income Statement and Balance Sheet
+#
+#======================================================================
+
+
+use SL::RP;
+
+1;
+# end of main
+
+# this is for our long dates
+# $locale->text('January')
+# $locale->text('February')
+# $locale->text('March')
+# $locale->text('April')
+# $locale->text('May ')
+# $locale->text('June')
+# $locale->text('July')
+# $locale->text('August')
+# $locale->text('September')
+# $locale->text('October')
+# $locale->text('November')
+# $locale->text('December')
+
+# this is for our short month
+# $locale->text('Jan')
+# $locale->text('Feb')
+# $locale->text('Mar')
+# $locale->text('Apr')
+# $locale->text('May')
+# $locale->text('Jun')
+# $locale->text('Jul')
+# $locale->text('Aug')
+# $locale->text('Sep')
+# $locale->text('Oct')
+# $locale->text('Nov')
+# $locale->text('Dec')
+
+# $locale->text('Balance Sheet')
+# $locale->text('Income Statement')
+# $locale->text('Trial Balance')
+# $locale->text('AR Aging')
+# $locale->text('AP Aging')
+# $locale->text('Tax collected')
+# $locale->text('Tax paid')
+# $locale->text('Receipts')
+# $locale->text('Payments')
+
+
+sub report {
+
+ %title = ( 'balance_sheet' => 'Balance Sheet',
+ 'income_statement' => 'Income Statement',
+ 'trial_balance' => 'Trial Balance',
+ 'ar_aging' => 'AR Aging',
+ 'ap_aging' => 'AP Aging',
+ 'tax_collected' => 'Tax collected',
+ 'tax_paid' => 'Tax paid',
+ 'receipts' => 'Receipts',
+ 'payments' => 'Payments',
+ );
+
+ $form->{title} = $locale->text($title{$form->{report}});
+
+ $form->header;
+
+ $gifi = qq|
+<tr>
+ <th align=right>|.$locale->text('Accounts').qq|</th>
+ <td><input name=accounttype class=radio type=radio value=standard checked> |.$locale->text('Standard').qq|
+
+ <input name=accounttype class=radio type=radio value=gifi> |.$locale->text('GIFI').qq|
+ </td>
+</tr>
+|;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<input type=hidden name=title value="$form->{title}">
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table>
+|;
+
+ if ($form->{report} eq "income_statement") {
+ print qq|
+ <input type=hidden name=nextsub value=generate_income_statement>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th colspan=4>|.$locale->text('Compare to').qq|</th>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=comparefromdate size=11 title="$myconfig{dateformat}"></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=comparetodate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Decimalplaces').qq|</th>
+ <td><input name=decimalplaces size=3 maxsize=1></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td colspan=3><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|</td>
+ <td><input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
+ </tr>
+|;
+ }
+
+
+ if ($form->{report} eq "balance_sheet") {
+ print qq|
+ <input type=hidden name=nextsub value=generate_balance_sheet>
+ <tr>
+ <th align=right>|.$locale->text('as at').qq|</th>
+ <td><input name=asofdate size=11 title="$myconfig{dateformat}" value=$form->{asofdate}></td>
+ <th align=right nowrap>|.$locale->text('Compare to').qq|</th>
+ <td><input name=compareasofdate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Decimalplaces').qq|</th>
+ <td><input name=decimalplaces size=3 maxsize=1></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|</td>
+ <td><input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
+ </tr>
+|;
+ }
+
+
+ if ($form->{report} eq "trial_balance") {
+ print qq|
+ <input type=hidden name=nextsub value=generate_trial_balance>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
+ <td><input name=l_heading class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Heading').qq|
+ <input name=l_subtotal class=checkbox type=checkbox value=Y>&nbsp;|.$locale->text('Subtotal').qq|</td>
+ </tr>
+|;
+ }
+
+
+ if (($form->{report} eq "tax_paid") || ($form->{report} eq "tax_collected")) {
+ $gifi = "";
+
+ $form->{db} = ($form->{report} eq "tax_collected") ? "ar" : "ap";
+
+ RP->get_taxaccounts(\%myconfig, \%$form);
+
+ print qq|
+ <input type=hidden name=nextsub value=generate_tax_report>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Cash based').qq|</th>
+ <td><input name=cashbased class=checkbox type=checkbox value=Y></td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('Report for').qq|</th>
+ <td>
+|;
+
+ $checked = "checked";
+ foreach $item (@{ $form->{taxaccounts} }) {
+ ($accno, $description) = split /--/, $item;
+
+ print qq|<input name=accno class=radio type=radio value=$accno $checked>&nbsp;$description
+
+ <input name="${accno}_description" type=hidden value="$description">|;
+
+ $checked = "";
+ }
+
+ print qq|
+ <input type=hidden name=db value=$form->{db}>
+ <input type=hidden name=sort value=transdate>
+
+ </td>
+ </tr>
+|;
+
+
+ if (@{ $form->{gifi_taxaccounts} }) {
+ print qq|
+ <tr>
+ <th align=right>|.$locale->text('GIFI').qq|</th>
+ <td>
+|;
+
+ foreach $item (@{ $form->{gifi_taxaccounts} }) {
+ ($accno, $description) = split /--/, $item;
+
+ print qq|<input name=accno class=radio type=radio value="gifi_$accno" $checked>&nbsp;$description
+
+ <input name="gifi_${accno}_description" type=hidden value="$description">|;
+
+ }
+
+ print qq|
+ </td>
+ </tr>
+|;
+ }
+
+
+print qq|
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table>
+ <tr>
+ <th align=right>|.$locale->text('Include in Report').qq|</th>
+ <td>
+ <table>
+ <tr>
+ <td><input name="l_id" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('ID').qq|</td>
+ <td><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Invoice').qq|</td>
+ <td><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Date').qq|</td>
+ </tr>
+ <tr>
+ <td><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
+ <td>|;
+
+ if ($form->{db} eq 'ar') {
+ print $locale->text('Customer');
+ }
+ if ($form->{db} eq 'ap') {
+ print $locale->text('Vendor');
+ }
+
+ print qq|</td>
+ <td><input name="l_netamount" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Amount').qq|</td>
+ <td><input name="l_tax" class=checkbox type=checkbox value=Y checked></td>
+ <td>|.$locale->text('Tax').qq|</td>
+ <td><input name="l_amount" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('Total').qq|</td>
+ </tr>
+ <tr>
+ <td><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
+ <td>|.$locale->text('Subtotal').qq|</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+|;
+
+ }
+
+
+ if (($form->{report} eq "ar_aging") || ($form->{report} eq "ap_aging")) {
+ $gifi = "";
+
+ if ($form->{report} eq 'ar_aging') {
+ $label = $locale->text('Customer');
+ $form->{vc} = 'customer';
+ } else {
+ $label = $locale->text('Vendor');
+ $form->{vc} = 'vendor';
+ }
+
+ $nextsub = "generate_$form->{report}";
+
+ # setup vc selection
+ $form->all_vc(\%myconfig, $form->{vc});
+
+ map { $vc .= "<option>$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} };
+
+ $vc = ($vc) ? qq|<select name=$form->{vc}><option>\n$vc</select>| : qq|<input name=$form->{vc} size=35>|;
+
+ print qq|
+ <tr>
+ <th align=right>|.$locale->text($label).qq|</th>
+ <td>$vc</td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <input type=hidden name=type value=statement>
+ <input type=hidden name=format value=html>
+ <input type=hidden name=media value=screen>
+
+ <input type=hidden name=nextsub value=$nextsub>
+ <input type=hidden name=action value=$nextsub>
+|;
+ }
+
+# above action can be removed if there is more than one input field
+
+
+ if (($form->{report} eq "receipts") || ($form->{report} eq "payments")) {
+ $gifi = "";
+
+ $form->{db} = ($form->{report} eq "receipts") ? "ar" : "ap";
+
+ RP->paymentaccounts(\%myconfig, \%$form);
+
+ $selection = "<option>\n";
+ foreach $ref (@{ $form->{PR} }) {
+ $paymentaccounts .= "$ref->{accno} ";
+ $selection .= "<option>$ref->{accno}--$ref->{description}\n";
+ }
+
+ chop $paymentaccounts;
+
+ print qq|
+ <input type=hidden name=nextsub value=list_payments>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Account').qq|</th>
+ <td colspan=3><select name=account>$selection</select>
+ <input type=hidden name=paymentaccounts value="$paymentaccounts">
+ </td>
+ </tr>
+ <tr>
+ <th align=right>|.$locale->text('From').qq|</th>
+ <td><input name=fromdate size=11 title="$myconfig{dateformat}" value=$form->{fromdate}></td>
+ <th align=right>|.$locale->text('to').qq|</th>
+ <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ </tr>
+ <input type=hidden name=db value=$form->{db}>
+ <input type=hidden name=sort value=transdate>
+|;
+
+ }
+
+
+ print qq|
+
+$gifi
+
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<input type=submit class=submit name=action value="|.$locale->text('Continue').qq|">
+
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub continue { &{$form->{nextsub}} };
+
+
+sub generate_income_statement {
+
+ $form->{padding} = "&nbsp;&nbsp;";
+ $form->{bold} = "<b>";
+ $form->{endbold} = "</b>";
+ $form->{br} = "<br>";
+
+ RP->income_statement(\%myconfig, \%$form);
+
+
+ $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+ $form->{todate} = $form->current_date(\%myconfig) unless $form->{todate};
+
+ # if there are any dates construct a where
+ if ($form->{fromdate} || $form->{todate}) {
+
+ unless ($form->{todate}) {
+ $form->{todate} = $form->current_date(\%myconfig);
+ }
+
+ $longtodate = $locale->date(\%myconfig, $form->{todate}, 1);
+ $shorttodate = $locale->date(\%myconfig, $form->{todate});
+
+ $longfromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
+ $shortfromdate = $locale->date(\%myconfig, $form->{fromdate});
+
+ $form->{this_period} = "$shortfromdate<br>\n$shorttodate";
+ $form->{period} = $locale->text('for Period').qq|<br>\n$longfromdate |.$locale->text('to').qq| $longtodate|;
+ }
+
+ if ($form->{comparefromdate} || $form->{comparetodate}) {
+ $longcomparefromdate = $locale->date(\%myconfig, $form->{comparefromdate}, 1);
+ $shortcomparefromdate = $locale->date(\%myconfig, $form->{comparefromdate});
+
+ $longcomparetodate = $locale->date(\%myconfig, $form->{comparetodate}, 1);
+ $shortcomparetodate = $locale->date(\%myconfig, $form->{comparetodate});
+
+ $form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
+ $form->{period} .= "<br>\n$longcomparefromdate ".$locale->text('to').qq| $longcomparetodate|;
+ }
+
+
+ # setup variables for the form
+ @a = qw(company address businessnumber);
+ map { $form->{$_} = $myconfig{$_} } @a;
+ $form->{address} =~ s/\\n/<br>/g;
+
+ $form->{templates} = $myconfig{templates};
+
+ $form->{IN} = "income_statement.html";
+
+ $form->parse_template;
+
+}
+
+
+sub generate_balance_sheet {
+
+ $form->{padding} = "&nbsp;&nbsp;";
+ $form->{bold} = "<b>";
+ $form->{endbold} = "</b>";
+ $form->{br} = "<br>";
+
+ RP->balance_sheet(\%myconfig, \%$form);
+
+ $form->{asofdate} = $form->current_date(\%myconfig) unless $form->{asofdate};
+ $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+
+ # define Retained Earnings account
+ $padding = ($form->{l_heading}) ? $form->{padding} : "";
+ push(@{$form->{equity_account}}, $padding.$locale->text('Retained Earnings'));
+
+ $form->{this_period} = $locale->date(\%myconfig, $form->{asofdate});
+ $form->{last_period} = $locale->date(\%myconfig, $form->{compareasofdate});
+
+ $form->{IN} = "balance_sheet.html";
+
+ # setup company variables for the form
+ map { $form->{$_} = $myconfig{$_} } (qw(company address businessnumber nativecurr));
+ $form->{address} =~ s/\\n/<br>/g;
+
+ $form->{templates} = $myconfig{templates};
+
+ $form->parse_template;
+
+}
+
+
+# Antonio Gallardo
+#
+# D.S. Feb 16, 2001
+# included links to display transactions for period entered
+# added headers and subtotals
+#
+sub generate_trial_balance {
+
+ # get for each account initial balance, debits and credits
+ RP->trial_balance_details(\%myconfig, \%$form);
+
+ $form->{nextsub} = "generate_trial_balance";
+ $form->{title} = $locale->text('Trial Balance');
+ &list_accounts;
+
+}
+
+
+sub list_accounts {
+
+ $title = $form->escape($form->{title});
+
+ if ($form->{projectnumber}) {
+ $options .= $locale->text('Project Number')." : $form->{projectnumber}<br>";
+ $projectnumber = $form->escape($form->{projectnumber});
+ }
+
+ # if there are any dates
+ if ($form->{fromdate} || $form->{todate}) {
+ if ($form->{fromdate}) {
+ $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
+ }
+ if ($form->{todate}) {
+ $todate = $locale->date(\%myconfig, $form->{todate}, 1);
+ }
+
+ $form->{period} = "$fromdate - $todate";
+ } else {
+ $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+ }
+
+ $options .= $form->{period};
+
+ @column_index = qw(accno description begbalance debit credit endbalance);
+
+ $column_header{accno} = qq|<th class=listheading>|.$locale->text('Account').qq|</th>|;
+ $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|;
+ $column_header{debit} = qq|<th class=listheading>|.$locale->text('Debit').qq|</th>|;
+ $column_header{credit} = qq|<th class=listheading>|.$locale->text('Credit').qq|</th>|;
+ $column_header{begbalance} = qq|<th class=listheading>|.$locale->text('Balance').qq|</th>|;
+ $column_header{endbalance} = qq|<th class=listheading>|.$locale->text('Balance').qq|</th>|;
+
+
+ if ($form->{accounttype} eq 'gifi') {
+ $column_header{accno} = qq|<th class=listheading>|.$locale->text('GIFI').qq|</th>|;
+ }
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$options</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+
+ # sort the whole thing by account numbers and display
+ foreach $ref (sort { $a->{accno} cmp $b->{accno} } @{ $form->{TB} }) {
+
+ $description = $form->escape($ref->{description});
+
+ $href = qq|ca.pl?path=$form->{path}&action=list_transactions&accounttype=$form->{accounttype}&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&sort=transdate&l_heading=$form->{l_heading}&l_subtotal=$form->{l_subtotal}&projectnumber=$projectnumber&project_id=$form->{project_id}&title=$title&nextsub=$form->{nextsub}|;
+
+ if ($form->{accounttype} eq 'gifi') {
+ $href .= "&gifi_accno=$ref->{accno}&gifi_description=$description";
+ $na = $locale->text('N/A');
+ map { $ref->{$_} = $na } qw(accno description) unless $ref->{accno};
+ } else {
+ $href .= "&accno=$ref->{accno}&description=$description";
+ }
+
+ $ml = ($ref->{category} =~ /(A|E)/) ? -1 : 1;
+
+ $debit = $form->format_amount(\%myconfig, $ref->{debit}, 2, "&nbsp;");
+ $credit = $form->format_amount(\%myconfig, $ref->{credit}, 2, "&nbsp;");
+ $begbalance = $form->format_amount(\%myconfig, $ref->{balance} * $ml, 2, "&nbsp;");
+ $endbalance = $form->format_amount(\%myconfig, ($ref->{balance} + $ref->{amount}) * $ml, 2, "&nbsp;");
+
+ next if ($ref->{debit} == 0 && $ref->{credit} == 0);
+
+ if ($ref->{charttype} eq "H" && $subtotal && $form->{l_subtotal}) {
+ map { $column_data{$_} = "<th>&nbsp;</th>" } qw(accno begbalance endbalance);
+
+ $subtotalbegbalance = $form->format_amount(\%myconfig, $subtotalbegbalance, 2, "&nbsp;");
+ $subtotalendbalance = $form->format_amount(\%myconfig, $subtotalendbalance, 2, "&nbsp;");
+ $subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, 2, "&nbsp;");
+ $subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, 2, "&nbsp;");
+ $column_data{description} = "<th>$subtotaldescription</th>";
+ $column_data{begbalance} = "<th align=right>$subtotalbegbalance</th>";
+ $column_data{endbalance} = "<th align=right>$subtotalendbalance</th>";
+ $column_data{debit} = "<th align=right>$subtotaldebit</th>";
+ $column_data{credit} = "<th align=right>$subtotalcredit</th>";
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+ }
+
+ if ($ref->{charttype} eq "H") {
+ $subtotal = 1;
+ $subtotaldescription = $ref->{description};
+ $subtotaldebit = $ref->{debit};
+ $subtotalcredit = $ref->{credit};
+ $subtotalbegbalance = 0;
+ $subtotalendbalance = 0;
+
+ next unless $form->{l_heading};
+
+ map { $column_data{$_} = "<th>&nbsp;</th>" } qw(accno debit credit begbalance endbalance);
+ $column_data{description} = "<th class=listheading>$ref->{description}</th>";
+ }
+
+ if ($ref->{charttype} eq "A") {
+ $column_data{accno} = "<td><a href=$href>$ref->{accno}</a></td>";
+ $column_data{description} = "<td>$ref->{description}</td>";
+ $column_data{debit} = "<td align=right>$debit</td>";
+ $column_data{credit} = "<td align=right>$credit</td>";
+ $column_data{begbalance} = "<td align=right>$begbalance</td>";
+ $column_data{endbalance} = "<td align=right>$endbalance</td>";
+
+ $totaldebit += $ref->{debit};
+ $totalcredit += $ref->{credit};
+
+ $subtotalbegbalance += $ref->{balance} * $ml;
+ $subtotalendbalance += ($ref->{balance} + $ref->{amount}) * $ml;
+
+ }
+
+ if ($ref->{charttype} eq "H") {
+ print qq|
+ <tr class=listheading>
+|;
+ }
+ if ($ref->{charttype} eq "A") {
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+ }
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+ }
+
+
+ # print last subtotal
+ if ($subtotal && $form->{l_subtotal}) {
+ map { $column_data{$_} = "<th>&nbsp;</th>" } qw(accno begbalance endbalance);
+ $subtotalbegbalance = $form->format_amount(\%myconfig, $subtotalbegbalance, 2, "&nbsp;");
+ $subtotalendbalance = $form->format_amount(\%myconfig, $subtotalendbalance, 2, "&nbsp;");
+ $subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, 2, "&nbsp;");
+ $subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, 2, "&nbsp;");
+ $column_data{description} = "<th>$subdescription</th>";
+ $column_data{begbalance} = "<th align=right>$subtotalbegbalance</th>";
+ $column_data{endbalance} = "<th align=right>$subtotalendbalance</th>";
+ $column_data{debit} = "<th align=right>$subtotaldebit</th>";
+ $column_data{credit} = "<th align=right>$subtotalcredit</th>";
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+ }
+
+ $totaldebit = $form->format_amount(\%myconfig, $totaldebit, 2, "&nbsp;");
+ $totalcredit = $form->format_amount(\%myconfig, $totalcredit, 2, "&nbsp;");
+
+ map { $column_data{$_} = "<th>&nbsp;</th>" } qw(accno description begbalance endbalance);
+
+ $column_data{debit} = qq|<th align=right class=listtotal>$totaldebit</th>|;
+ $column_data{credit} = qq|<th align=right class=listtotal>$totalcredit</th>|;
+
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+
+sub generate_ar_aging {
+
+ # split customer
+ ($form->{customer}) = split(/--/, $form->{customer});
+
+ $form->{ct} = "customer";
+ $form->{arap} = "ar";
+
+ $form->{callback} = qq|$form->{script}?path=$form->{path}&action=generate_ar_aging&login=$form->{login}&password=$form->{password}&todate=$form->{todate}&customer=|.$form->escape($form->{customer});
+
+ RP->aging(\%myconfig, \%$form);
+ &aging;
+
+}
+
+
+sub generate_ap_aging {
+
+ # split vendor
+ ($form->{vendor}) = split(/--/, $form->{vendor});
+
+ $form->{ct} = "vendor";
+ $form->{arap} = "ap";
+
+ $form->{callback} = qq|$form->{script}?path=$form->{path}&action=generate_ap_aging&login=$form->{login}&password=$form->{password}&todate=$form->{todate}&vendor=|.$form->escape($form->{vendor});
+
+ RP->aging(\%myconfig, \%$form);
+ &aging;
+
+}
+
+
+sub aging {
+
+
+ $form->header;
+
+ $column_header{statement} = qq|<th class=listheading>&nbsp;</th>|;
+ $column_header{ct} = qq|<th class=listheading>|.$locale->text(ucfirst $form->{ct}).qq|</th>|;
+ $column_header{invnumber} = qq|<th class=listheading>|.$locale->text('Invoice').qq|</th>|;
+ $column_header{transdate} = qq|<th class=listheading>|.$locale->text('Date').qq|</th>|;
+ $column_header{duedate} = qq|<th class=listheading>|.$locale->text('Due').qq|</th>|;
+ $column_header{c0} = qq|<th class=listheading>|.$locale->text('Current').qq|</th>|;
+ $column_header{c30} = qq|<th class=listheading>30</th>|;
+ $column_header{c60} = qq|<th class=listheading>60</th>|;
+ $column_header{c90} = qq|<th class=listheading>90</th>|;
+
+ @column_index = (qw(statement ct invnumber transdate duedate c0 c30 c60 c90));
+
+
+ if ($form->{arap} eq 'ar') {
+ if ($form->{customer}) {
+ $option .= "\n<br>" if $option;
+ $option .= $form->{customer};
+ }
+ }
+ if ($form->{arap} eq 'ap') {
+ shift @column_index;
+ if ($form->{vendor}) {
+ $option .= "\n<br>" if $option;
+ $option .= $form->{vendor};
+ }
+ }
+
+ $todate = $locale->date(\%myconfig, $form->{todate}, 1);
+ $option .= "\n<br>" if $option;
+ $option .= $locale->text('for Period')." ".$locale->text('to')." $todate";
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ $ctid = 0;
+ $subtotal = 0;
+ $i = 0;
+
+ foreach $ref (@{ $form->{AG} }) {
+
+ if ($ctid != $ref->{ctid}) {
+
+ $i++;
+
+ if ($subtotal) {
+ $c0subtotal = $form->format_amount(\%myconfig, $c0subtotal, 2, "&nbsp");
+ $c30subtotal = $form->format_amount(\%myconfig, $c30subtotal, 2, "&nbsp");
+ $c60subtotal = $form->format_amount(\%myconfig, $c60subtotal, 2, "&nbsp");
+ $c90subtotal = $form->format_amount(\%myconfig, $c90subtotal, 2, "&nbsp");
+ }
+
+ $column_data{ct} = qq|<th>&nbsp;</th>|;
+ $column_data{invnumber} = qq|<th>&nbsp;</th>|;
+ $column_data{transdate} = qq|<th>&nbsp;</th>|;
+ $column_data{duedate} = qq|<th>&nbsp;</th>|;
+ $column_data{c0} = qq|<th class=listsubtotal align=right>$c0subtotal</th>|;
+ $column_data{c30} = qq|<th class=listsubtotal align=right>$c30subtotal</th>|;
+ $column_data{c60} = qq|<th class=listsubtotal align=right>$c60subtotal</th>|;
+ $column_data{c90} = qq|<th class=listsubtotal align=right>$c90subtotal</th>|;
+
+ if ($subtotal) {
+ # print subtotals
+ print qq|
+ <tr class=listsubtotal>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ $column_data{statement} = qq|<td>&nbsp;</td>|;
+
+ print qq|
+ </tr>
+|;
+ }
+
+ $subtotal = 1;
+
+ $c0subtotal = 0;
+ $c30subtotal = 0;
+ $c60subtotal = 0;
+ $c90subtotal = 0;
+
+ $column_data{ct} = qq|<td>$ref->{name}</td>|;
+ $column_data{statement} = qq|<td><input name="statement_$i" type=checkbox class=checkbox value=1 $ref->{checked}>
+ <input type=hidden name="$form->{ct}_id_$i" value=$ref->{ctid}>
+ </td>|;
+ }
+
+ $c0subtotal += $ref->{c0};
+ $c30subtotal += $ref->{c30};
+ $c60subtotal += $ref->{c60};
+ $c90subtotal += $ref->{c90};
+
+ $c0total += $ref->{c0};
+ $c30total += $ref->{c30};
+ $c60total += $ref->{c60};
+ $c90total += $ref->{c90};
+
+ $ref->{c0} = $form->format_amount(\%myconfig, $ref->{c0}, 2, "&nbsp;");
+ $ref->{c30} = $form->format_amount(\%myconfig, $ref->{c30}, 2, "&nbsp;");
+ $ref->{c60} = $form->format_amount(\%myconfig, $ref->{c60}, 2, "&nbsp;");
+ $ref->{c90} = $form->format_amount(\%myconfig, $ref->{c90}, 2, "&nbsp;");
+
+ $href = qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=|.$form->escape($form->{callback});
+
+ $column_data{invnumber} = qq|<td><a href=$href>$ref->{invnumber}</a></td>|;
+ $column_data{transdate} = qq|<td>$ref->{transdate}</td>|;
+ $column_data{duedate} = qq|<td>$ref->{duedate}&nbsp;</td>|;
+ $column_data{c0} = qq|<td align=right>$ref->{c0}</td>|;
+ $column_data{c30} = qq|<td align=right>$ref->{c30}</td>|;
+ $column_data{c60} = qq|<td align=right>$ref->{c60}</td>|;
+ $column_data{c90} = qq|<td align=right>$ref->{c90}</td>|;
+
+ $j++; $j %= 2;
+ print qq|
+ <tr class=listrow$j>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ $column_data{ct} = qq|<td>&nbsp;</td>|;
+ $column_data{statement} = qq|<td>&nbsp;</td>|;
+
+ $ctid = $ref->{ctid};
+
+ }
+
+ # print subtotals
+ $c0subtotal = $form->format_amount(\%myconfig, $c0subtotal, 2, "&nbsp;");
+ $c30subtotal = $form->format_amount(\%myconfig, $c30subtotal, 2, "&nbsp;");
+ $c60subtotal = $form->format_amount(\%myconfig, $c60subtotal, 2, "&nbsp;");
+ $c90subtotal = $form->format_amount(\%myconfig, $c90subtotal, 2, "&nbsp;");
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+
+ map { $column_data{$_} = qq|<th>&nbsp;</th>| } @column_index;
+
+ $column_data{c0} = qq|<th class=listsubtotal align=right>$c0subtotal</th>|;
+ $column_data{c30} = qq|<th class=listsubtotal align=right>$c30subtotal</th>|;
+ $column_data{c60} = qq|<th class=listsubtotal align=right>$c60subtotal</th>|;
+ $column_data{c90} = qq|<th class=listsubtotal align=right>$c90subtotal</th>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+
+ print qq|
+ </tr>
+ <tr class=listtotal>
+|;
+
+ $c0total = $form->format_amount(\%myconfig, $c0total, 2, "&nbsp;");
+ $c30total = $form->format_amount(\%myconfig, $c30total, 2, "&nbsp;");
+ $c60total = $form->format_amount(\%myconfig, $c60total, 2, "&nbsp;");
+ $c90total = $form->format_amount(\%myconfig, $c90total, 2, "&nbsp;");
+
+ $column_data{c0} = qq|<th class=listtotal align=right>$c0total</th>|;
+ $column_data{c30} = qq|<th class=listtotal align=right>$c30total</th>|;
+ $column_data{c60} = qq|<th class=listtotal align=right>$c60total</th>|;
+ $column_data{c90} = qq|<th class=listtotal align=right>$c90total</th>|;
+
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+
+ print qq|
+ <input type=hidden name=rowcount value=$i>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+|;
+
+ &print_options if ($form->{arap} eq 'ar');
+
+ print qq|
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+|;
+
+ if ($form->{arap} eq 'ar') {
+ print qq|
+<input type=hidden name=todate value=$form->{todate}>
+
+<input type=hidden name=title value="$form->{title}">
+
+<input type=hidden name=arap value=$form->{arap}>
+<input type=hidden name=ct value=$form->{ct}>
+<input type=hidden name=$form->{ct} value="$form->{$form->{ct}}">
+
+<input type=hidden name=path value=$form->{path}>
+<input type=hidden name=login value=$form->{login}>
+<input type=hidden name=password value=$form->{password}>
+
+<br>
+<input class=submit type=submit name=action value="|.$locale->text('Select all').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('Print').qq|">
+<input class=submit type=submit name=action value="|.$locale->text('E-mail').qq|">
+|;
+ }
+
+ print qq|
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub select_all {
+
+ RP->aging(\%myconfig, \%$form);
+
+ map { $_->{checked} = "checked" } @{ $form->{AG} };
+
+ &aging;
+
+}
+
+
+sub print_options {
+
+ $form->{sendmode} = "attachment";
+ $form->{copies} = 2 unless $form->{copies};
+
+ $form->{PD}{$form->{type}} = "checked";
+ $form->{DF}{$form->{format}} = "checked";
+ $form->{OP}{$form->{media}} = "checked";
+ $form->{SM}{$form->{sendmode}} = "checked";
+
+
+ if ($form->{media} eq 'email') {
+ $email = qq|
+ <td><input class=radio type=radio name=sendmode value=attachment $form->{SM}{attachment}> |.$locale->text('Attachment')
+ .qq| <input class=radio type=radio name=sendmode value=inline $form->{SM}{inline}> |.$locale->text('In-line').qq|</td>
+|;
+ } else {
+ $screen = qq|
+ <td><input class=radio type=radio name=media value=screen $form->{OP}{screen}></td>
+ <td>|.$locale->text('Screen').qq|</td>
+|;
+ }
+
+ print qq|
+<table width=100%>
+ <tr valign=top>
+ <td><input class=radio type=radio name=type value=statement $form->{PD}{statement}></td><td>|.$locale->text('Statement').qq|</td>
+ <td><input class=radio type=radio name=format value=html $form->{DF}{html}></td>
+ <td>html</td>
+|;
+
+ if ($latex) {
+ print qq|
+ <td><input class=radio type=radio name=format value=postscript $form->{DF}{postscript}></td>
+ <td>|.$locale->text('Postscript').qq|</td>
+ <td><input class=radio type=radio name=format value=pdf $form->{DF}{pdf}></td>
+ <td>|.$locale->text('PDF').qq|</td>
+|;
+ }
+
+ print qq|
+ $screen
+|;
+
+ if ($screen) {
+ if ($myconfig{printer} && $latex) {
+ print qq|
+ <td><input class=radio type=radio name=media value=printer $form->{OP}{printer}></td>
+ <td>|.$locale->text('Printer')
+ .qq| (|.$locale->text('Copies')
+ .qq| <input name=copies size=2 value=$form->{copies}>)</td>
+|;
+ }
+ }
+
+ print qq|
+ $email
+ </tr>
+</table>
+|;
+
+}
+
+
+sub e_mail {
+
+ # get name and email addresses
+ for $i (1 .. $form->{rowcount}) {
+ if ($form->{"statement_$i"}) {
+ $form->{"$form->{ct}_id"} = $form->{"$form->{ct}_id_$i"};
+ RP->get_customer(\%myconfig, \%$form);
+ $selected = 1;
+ last;
+ }
+ }
+
+ $form->error($locale->text('Nothing selected!')) unless $selected;
+
+ if ($myconfig{admin}) {
+ $bcc = qq|
+ <th align=right nowrap=true>|.$locale->text('Bcc').qq|</th>
+ <td><input name=bcc size=30 value="$form->{bcc}"></td>
+|;
+ }
+
+ $title = $locale->text('E-mail Statement to')." $form->{$form->{ct}}";
+
+ $form->{media} = "email";
+
+ $form->header;
+
+ print qq|
+<body>
+
+<form method=post action=$form->{script}>
+
+<table width=100%>
+ <tr class=listtop>
+ <th class=listtop>$title</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=right nowrap>|.$locale->text('E-mail').qq|</th>
+ <td><input name=email size=30 value="$form->{email}"></td>
+ <th align=right nowrap>|.$locale->text('Cc').qq|</th>
+ <td><input name=cc size=30 value="$form->{cc}"></td>
+ </tr>
+ <tr>
+ <th align=right nowrap>|.$locale->text('Subject').qq|</th>
+ <td><input name=subject size=30 value="$form->{subject}"></td>
+ $bcc
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left nowrap>|.$locale->text('Message').qq|</th>
+ </tr>
+ <tr>
+ <td><textarea name=message rows=15 cols=60 wrap=soft>$form->{message}</textarea></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>
+|;
+
+ &print_options;
+
+ map { delete $form->{$_} } qw(action email cc bcc subject message type sendmode format);
+
+ # save all other variables
+ foreach $key (keys %$form) {
+ $form->{$key} =~ s/"/&quot;/g;
+ print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
+ }
+
+ print qq|
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<input type=hidden name=nextsub value=send_email>
+
+<br>
+<input name=action class=submit type=submit value="|.$locale->text('Continue').qq|">
+</form>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub send_email {
+
+ $form->{OUT} = "$sendmail";
+
+ $form->{subject} = $locale->text('Statement').qq| - $form->{todate}| unless $form->{subject};
+
+ RP->aging(\%myconfig, \%$form);
+
+ $form->{"statement_1"} = 1;
+
+ &print_form;
+
+ $form->redirect($locale->text('Statement sent to')." $form->{$form->{ct}}");
+
+}
+
+
+
+sub print {
+
+ if ($form->{media} eq 'printer') {
+ $form->error($locale->text('Select postscript or PDF!')) if ($form->{format} !~ /(postscript|pdf)/);
+ }
+
+ for $i (1 .. $form->{rowcount}) {
+ if ($form->{"statement_$i"}) {
+ $form->{"$form->{ct}_id"} = $form->{"$form->{ct}_id_$i"};
+ $selected = 1;
+ last;
+ }
+ }
+
+ $form->error($locale->text('Nothing selected!')) unless $selected;
+
+
+ if ($form->{media} eq 'printer') {
+ $form->{OUT} = "| $myconfig{printer}";
+ $form->{"$form->{ct}_id"} = "";
+ } else {
+ $form->{"statement_1"} = 1;
+ }
+
+ RP->aging(\%myconfig, \%$form);
+
+ &print_form;
+
+ $form->redirect($locale->text('Statements sent to printer!')) if ($form->{media} eq 'printer');
+
+}
+
+
+sub print_form {
+
+ $form->{statementdate} = $locale->date(\%myconfig, $form->{todate}, 1);
+
+ $form->{templates} = "$myconfig{templates}";
+
+ # setup variables for the form
+ @a = qw(company address businessnumber tel fax);
+ map { $form->{$_} = $myconfig{$_} } @a;
+ $form->format_string(@a);
+
+ $form->{IN} = "$form->{type}.html";
+
+ if ($form->{format} eq 'postscript') {
+ $form->{postscript} = 1;
+ $form->{IN} =~ s/html$/tex/;
+ }
+ if ($form->{format} eq 'pdf') {
+ $form->{pdf} = 1;
+ $form->{IN} =~ s/html$/tex/;
+ }
+
+ $i = 0;
+ while (@{ $form->{AG} }) {
+
+ $ref = shift @{ $form->{AG} };
+
+ if ($ctid != $ref->{ctid}) {
+
+ $ctid = $ref->{ctid};
+ $i++;
+
+ if ($form->{"statement_$i"}) {
+
+ @a = (name, addr1, addr2, addr3, addr4, contact, "$form->{ct}phone", "$form->{ct}fax");
+ map { $form->{$_} = $ref->{$_} } @a;
+ $form->format_string(@a);
+
+ $form->{$form->{ct}} = $form->{name};
+ $form->{"$form->{ct}_id"} = $ref->{ctid};
+
+ map { $form->{$_} = () } qw(invnumber invdate duedate);
+ $form->{total} = 0;
+ foreach $item (qw(c0 c30 c60 c90)) {
+ $form->{$item} = ();
+ $form->{"${item}total"} = 0;
+ }
+
+ &statement_details($ref);
+
+ while ($ref) {
+
+ if (scalar (@{ $form->{AG} }) > 0) {
+ # one or more left to go
+ if ($ctid == $form->{AG}->[0]->{ctid}) {
+ $ref = shift @{ $form->{AG} };
+ &statement_details($ref);
+ # any more?
+ $ref = scalar (@{ $form->{AG} });
+ } else {
+ $ref = 0;
+ }
+ } else {
+ # set initial ref to 0
+ $ref = 0;
+ }
+
+ }
+
+ map { $form->{"${_}total"} = $form->format_amount(\%myconfig, $form->{"${_}total"}, 2) } (c0, c30, c60, c90, "");
+
+ $form->parse_template(\%myconfig, $userspath);
+
+ }
+ }
+ }
+
+}
+
+
+sub statement_details {
+ my ($ref) = @_;
+
+ push @{ $form->{invnumber} }, $ref->{invnumber};
+ push @{ $form->{invdate} }, $ref->{transdate};
+ push @{ $form->{duedate} }, $ref->{duedate};
+
+ foreach $item (qw(c0 c30 c60 c90)) {
+ $ref->{$item} = $form->round_amount($ref->{$item} / $ref->{exchangerate}, 2);
+ $form->{"${item}total"} += $ref->{$item};
+ $form->{total} += $ref->{$item};
+ push @{ $form->{$item} }, $form->format_amount(\%myconfig, $ref->{$item}, 2);
+ }
+
+}
+
+
+sub generate_tax_report {
+
+ RP->tax_report(\%myconfig, \%$form);
+
+ $descvar = "$form->{accno}_description";
+ $description = $form->escape($form->{$descvar});
+
+ # construct href
+ $href = "$form->{script}?path=$form->{path}&action=generate_tax_report&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&accno=$form->{accno}&$descvar=$description";
+
+ # construct callback
+ $callback = $href;
+
+
+ @columns = $form->sort_columns(qw(id transdate invnumber name netamount tax amount));
+
+ foreach $item (@columns) {
+ if ($form->{"l_$item"} eq "Y") {
+ push @column_index, $item;
+
+ # add column to href and callback
+ $callback .= "&l_$item=Y";
+ $href .= "&l_$item=Y";
+ }
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ $callback .= "&l_subtotal=Y";
+ $href .= "&l_subtotal=Y";
+ }
+
+
+ # if there are any dates
+ if ($form->{fromdate} || $form->{todate}) {
+ if ($form->{fromdate}) {
+ $fromdate = $locale->date(\%myconfig, $form->{fromdate}, 1);
+ }
+ if ($form->{todate}) {
+ $todate = $locale->date(\%myconfig, $form->{todate}, 1);
+ }
+
+ $form->{period} = "$fromdate - $todate";
+ } else {
+ $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1);
+ }
+
+ $form->{title} = $locale->text('GIFI')." - " if ($form->{accno} =~ /^gifi_/);
+ $form->{title} = qq|$form->{"$form->{accno}_description"} |;
+ if ($form->{db} eq 'ar') {
+ $form->{title} .= $locale->text('collected on sales');
+ $name = $locale->text('Customer');
+ $invoice = 'is.pl';
+ $arap = 'ar.pl';
+ }
+ if ($form->{db} eq 'ap') {
+ $form->{title} .= $locale->text('paid on purchases');
+ $name = $locale->text('Vendor');
+ $invoice = 'ir.pl';
+ $arap = 'ap.pl';
+ }
+
+
+ $column_header{id} = qq|<th><a class=listheading href=$href&sort=id>|.$locale->text('ID').qq|</th>|;
+ $column_header{invnumber} = qq|<th><a class=listheading href=$href&sort=invnumber>|.$locale->text('Invoice').qq|</th>|;
+ $column_header{transdate} = qq|<th><a class=listheading href=$href&sort=transdate>|.$locale->text('Date').qq|</th>|;
+ $column_header{netamount} = qq|<th class=listheading>|.$locale->text('Amount').qq|</th>|;
+ $column_header{tax} = qq|<th class=listheading>|.$locale->text('Tax').qq|</th>|;
+ $column_header{amount} = qq|<th class=listheading>|.$locale->text('Total').qq|</th>|;
+
+ $column_header{name} = qq|<th><a class=listheading href=$href&sort=name>$name</th>|;
+
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop colspan=$colspan>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$form->{period}</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "$column_header{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ # add sort and escape callback
+ $callback = $form->escape($callback . "&sort=$form->{sort}");
+
+ if (@{ $form->{TR} }) {
+ $sameitem = $form->{TR}->[0]->{$form->{sort}};
+ }
+
+ foreach $ref (@{ $form->{TR} }) {
+
+ $module = ($ref->{invoice}) ? $invoice : $arap;
+
+ if ($form->{l_subtotal} eq 'Y') {
+ if ($sameitem ne $ref->{$form->{sort}}) {
+ &tax_subtotal;
+ $sameitem = $ref->{$form->{sort}};
+ }
+ }
+
+ $totalnetamount += $ref->{netamount};
+ $totaltax += $ref->{tax};
+ $ref->{amount} = $ref->{netamount} + $ref->{tax};
+
+ $subtotalnetamount += $ref->{netamount};
+ $subtotaltax += $ref->{tax};
+
+ map { $ref->{$_} = $form->format_amount(\%myconfig, $ref->{$_}, 2, "&nbsp;"); } qw(netamount tax amount);
+
+ $column_data{id} = qq|<td>$ref->{id}</td>|;
+ $column_data{invnumber} = qq|<td><a href=$module?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}</a></td>|;
+ $column_data{transdate} = qq|<td>$ref->{transdate}</td>|;
+ $column_data{name} = qq|<td>$ref->{name}&nbsp;</td>|;
+
+ map { $column_data{$_} = qq|<td align=right>$ref->{$_}</td>| } qw(netamount tax amount);
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ if ($form->{l_subtotal} eq 'Y') {
+ &tax_subtotal;
+ }
+
+
+ map { $column_data{$_} = qq|<th>&nbsp;</th>| } @column_index;
+
+ print qq|
+ </tr>
+ <tr class=listtotal>
+|;
+
+ $total = $form->format_amount(\%myconfig, $totalnetamount + $totaltax, 2, "&nbsp;");
+ $totalnetamount = $form->format_amount(\%myconfig, $totalnetamount, 2, "&nbsp;");
+ $totaltax = $form->format_amount(\%myconfig, $totaltax, 2, "&nbsp;");
+
+ $column_data{netamount} = qq|<th class=listtotal align=right>$totalnetamount</th>|;
+ $column_data{tax} = qq|<th class=listtotal align=right>$totaltax</th>|;
+ $column_data{amount} = qq|<th class=listtotal align=right>$total</th>|;
+
+ map { print "$column_data{$_}\n" } @column_index;
+
+
+ print qq|
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+sub tax_subtotal {
+
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $subtotalnetamount = $form->format_amount(\%myconfig, $subtotalnetamount, 2, "&nbsp;");
+ $subtotaltax = $form->format_amount(\%myconfig, $subtotaltax, 2, "&nbsp;");
+ $subtotal = $form->format_amount(\%myconfig, $subtotalnetamount + $subtotaltax, 2, "&nbsp;");
+
+ $column_data{netamount} = "<th class=listsubtotal align=right>$subtotalnetamount</th>";
+ $column_data{tax} = "<th class=listsubtotal align=right>$subtotaltax</th>";
+ $column_data{amount} = "<th class=listsubtotal align=right>$subtotal</th>";
+
+ $subtotalnetamount = 0;
+ $subtotaltax = 0;
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+}
+
+
+
+sub list_payments {
+
+ if ($form->{account}) {
+ ($form->{paymentaccounts}) = split /--/, $form->{account};
+ }
+
+ RP->payments(\%myconfig, \%$form);
+
+ @columns = $form->sort_columns(qw(transdate invnumber name paid source));
+
+ # construct href
+ $href = "$form->{script}?path=$form->{path}&action=list_payments&login=$form->{login}&password=$form->{password}&fromdate=$form->{fromdate}&todate=$form->{todate}&db=$form->{db}&title=".$form->escape($form->{title})."&account=".$form->escape($form->{account});
+
+ $form->{paymentaccounts} =~ s/ /%20/g;
+ $href .= "&paymentaccounts=$form->{paymentaccounts}";
+
+
+ # construct callback
+ $form->{callback} = "$href&sort=$form->{sort}";
+ $callback = $form->escape($form->{callback});
+
+
+ $column_header{name} = "<th><a class=listheading href=$href&sort=name>".$locale->text('Description')."</a></th>";
+ $column_header{invnumber} = "<th><a class=listheading href=$href&sort=invnumber>".$locale->text('Invoice')."</a></th>";
+ $column_header{transdate} = "<th><a class=listheading href=$href&sort=transdate>".$locale->text('Date')."</a></th>";
+ $column_header{paid} = "<th class=listheading>".$locale->text('Amount')."</a></th>";
+ $column_header{source} = "<th><a class=listheading href=$href&sort=source>".$locale->text('Source')."</a></th>";
+
+
+ if ($form->{fromdate}) {
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('From')."&nbsp;".$locale->date(\%myconfig, $form->{fromdate}, 1);
+ }
+ if ($form->{todate}) {
+ $option .= "\n<br>" if ($option);
+ $option .= $locale->text('to')."&nbsp;".$locale->date(\%myconfig, $form->{todate}, 1);
+ }
+
+ @column_index = @columns;
+ $colspan = $#column_index + 1;
+
+ $form->header;
+
+ print qq|
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>$form->{title}</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr>
+ <td>$option</td>
+ </tr>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr class=listheading>
+|;
+
+ map { print "\n$column_header{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+
+ foreach $ref (sort { $a->{accno} cmp $b->{accno} } @{ $form->{PR} }) {
+
+ print qq|
+ <tr>
+ <th colspan=$colspan align=left>$ref->{accno}--$ref->{description}</th>
+ </tr>
+|;
+
+ foreach $payment (@{ $form->{$ref->{id}} }) {
+
+ $module = $payment->{module};
+ $module = 'is' if ($payment->{invoice} && $payment->{module} eq 'ar');
+ $module = 'ir' if ($payment->{invoice} && $payment->{module} eq 'ap');
+
+ $href = qq|${module}.pl?path=$form->{path}&action=edit&id=$payment->{id}&login=$form->{login}&password=$form->{password}&callback=$callback|;
+
+
+ $column_data{name} = "<td>$payment->{name}&nbsp;</td>";
+ $column_data{invnumber} = qq|<td><a href=$href>$payment->{invnumber}</a></td>|;
+ $column_data{transdate} = "<td>$payment->{transdate}&nbsp;</td>";
+ $column_data{paid} = "<td align=right>".$form->format_amount(\%myconfig, $payment->{paid}, 2, "&nbsp;")."</td>";
+ $column_data{source} = "<td>$payment->{source}&nbsp;</td>";
+
+ $subtotalpaid += $payment->{paid};
+ $totalpaid += $payment->{paid};
+
+ $i++; $i %= 2;
+ print qq|
+ <tr class=listrow$i>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ }
+
+ # print subtotals
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{paid} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalpaid, 2, "&nbsp;")."</th>";
+
+ print qq|
+ <tr class=listsubtotal>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+|;
+
+ $subtotalpaid = 0;
+
+ }
+
+
+ # print total
+ map { $column_data{$_} = "<td>&nbsp;</td>" } @column_index;
+
+ $column_data{paid} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalpaid, 2, "&nbsp;")."</th>";
+
+ print qq|
+ <tr class=listtotal>
+|;
+
+ map { print "\n$column_data{$_}" } @column_index;
+
+ print qq|
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+</body>
+</html>
+|;
+
+}
+
+
+
diff --git a/sql-ledger/css/sql-ledger.css b/sql-ledger/css/sql-ledger.css
new file mode 100644
index 000000000..20a59cfa1
--- /dev/null
+++ b/sql-ledger/css/sql-ledger.css
@@ -0,0 +1,113 @@
+/* stylesheet for sql-ledger */
+
+/* general stuff */
+A:link { color: #a0522d; text-decoration: none; }
+A:visited { color: #a0522d; text-decoration: none; }
+A:active { color: #a0522d; text-decoration: underline; }
+A:hover { color: white;
+ background-color: rgb(187,187,187);
+ text-decoration: none;
+}
+
+body {
+ font-family: Verdana, Arial, Helvetica;
+ font-size: 10pt;
+ background-color: white;
+ color: black
+}
+
+td {
+ font-family: Verdana, Arial, Helvetica;
+ font-size: 10pt;
+}
+
+/* login and admin */
+.login {
+ font-family: Verdana, Arial, Helvetica;
+}
+body.login {
+ background: #5a7d9b;
+ color: black;
+}
+h1.login {
+ font-size: 18pt;
+}
+table.login {
+ background-color: #FBFFE7;
+ padding: 20px;
+}
+td.login {
+ text-align: center;
+}
+th.login {
+ text-align: right;
+}
+
+body.admin {
+ background-color: #FBFFE7;
+ color: black;
+}
+
+body.menu {
+ background-color: #FBFFE7;
+ font-family: Verdana, Arial, Helvetica;
+ font-size: 10pt;
+ color: black;
+}
+
+
+.listtop { font-size: 10pt; background-color: black; color: white; }
+.listheading { font-size: 10pt; background-color: #336666; color: white; }
+A.listheading:link, A.listheading:active, A.listheading:visited {
+ color: white;
+ text-decoration: none; }
+.listrow1 { background-color: #e6e6fa; color: black; vertical-align: top; }
+.listrow0 { background-color: #ffe4e1; color: black; vertical-align: top; }
+.listsubtotal { font-size: 10pt; background-color: #5a7d9b; color: white; }
+.listtotal { font-size: 10pt; background-color: black; color: white; }
+
+.submit {
+ font-size: 12pt
+ font-family: Verdana, Arial, Helvetica;
+ color: #000080;
+}
+.checkbox, .radio {
+ font-family: Verdana, Arial, Helvetica;
+ color: #778899;
+}
+
+.plus0 { /* font color for negative numbers */
+ color: red;
+}
+
+.plus1 {
+ color: green;
+}
+
+h2.confirm {
+ color: blue;
+ font-size: 14pt;
+}
+
+h2.error {
+ color: red;
+ font-size: 14pt;
+}
+
+
+/* media stuff */
+
+@media screen {
+ .noscreen { /* items with this class won't display */
+ display: none;
+ }
+}
+
+@media print {
+ .noprint { /* items with this class won't print */
+ display: none;
+ }
+}
+
+
+
diff --git a/sql-ledger/doc/COPYING b/sql-ledger/doc/COPYING
new file mode 100644
index 000000000..083bb4150
--- /dev/null
+++ b/sql-ledger/doc/COPYING
@@ -0,0 +1,355 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+<HEAD>
+<TITLE>GNU General Public License</TITLE>
+</HEAD>
+
+<BODY BGCOLOR=ffffff>
+
+
+<pre>
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ &lt;one line to give the program's name and a brief idea of what it does.&gt;
+ Copyright (C) 19yy &lt;name of author&gt;
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ &lt;signature of Ty Coon&gt;, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+</BODY>
+</HTML>
+
diff --git a/sql-ledger/doc/README b/sql-ledger/doc/README
new file mode 100644
index 000000000..7585f5357
--- /dev/null
+++ b/sql-ledger/doc/README
@@ -0,0 +1,287 @@
+ SQL-Ledger Accounting
+ Version 2.0
+
+
+DESCRIPTION:
+------------
+SQL-Ledger is a double-entry accounting program written
+in perl. It has been tested with PostgreSQL, Oracle,
+Apache, Netscape, Mozilla, Galeon, Explorer, Links, Lynx,
+Konqueror, Voyager, W3M and Opera clients on Linux, FreeBSD,
+Solaris, Windows and Mac computers.
+
+Data is stored in a SQL server, either locally or remote,
+the display is through a text or GUI web browser. The system
+is linked by a chart of accounts. All transactions for AR,
+AP and GL are stored in a transaction table. Hyper-links
+from the chart of accounts let you view transactions posted
+through AR, AP and GL.
+
+Configuration files let you specify to which SQL server
+to connect to, personal preferences such as company name,
+language, number and date format, etc.
+
+The admin script can be used to create, edit or delete users
+and to create and delete datasets and to setup the Chart
+of Accounts and templates needed for the system.
+It can be used for PostgreSQL and Oracle. If you want to
+use another SQL server the tables and chart of accounts
+must be created by hand.
+
+You can have a group of users using the same dataset and
+templates for generating Invoices, Income Statements and
+Balance Sheets or a different set altogether.
+
+Templates are supplied in html and tex format to generate
+most of the forms. Forms can be printed to screen, sent
+to a printer or to a mailer agent. To use the tex forms
+latex must be installed. Most systems have a latex binary
+installed by default. Latex is also available for Windows
+and the Mac so we stay compatible across all major platforms.
+
+
+COPYRIGHT:
+----------
+You may distribute under the terms of the GNU License.
+
+
+LATEST VERSION:
+---------------
+available from http://www.sql-ledger.org
+
+
+PLATFORMS:
+----------
+Non specific, see requirements.
+
+
+REQUIREMENTS:
+-------------
+1 - Perl, 5+
+2 - http server (Apache, NCSA, httpi, ...)
+3 - SQL Server with transaction support (PostgreSQL 7.0+, Oracle)
+4 - DBD (DBD-Pg, DBD-Oracle)
+5 - DBI
+6 - LaTeX (optional)
+
+
+FOREIGN LANGUAGE SUPPORT:
+-------------------------
+All the required files are in locale/country_code
+The main files are 'all' and 'missing'. You can enter
+translated strings in either file. When you are done
+run locales.pl from the command line to rebuild the
+required files.
+
+Some of the translation files are not 100% complete.
+If strings are missing, English is used instead.
+
+
+INSTALLATION:
+-------------
+unpack the tar.gz file in /usr/local
+
+ tar xzvf sql-ledger-x.x.x.tar.gz
+
+you should now have everything in /usr/local/sql-ledger
+
+copy sql-ledger.conf.default to sql-ledger.conf
+
+edit sql-ledger.conf
+
+create a file sql-ledger-httpd.conf in the same location
+where your httpd.conf is and copy the next section into the file
+
+ Alias /sql-ledger/ /usr/local/sql-ledger/
+ <Directory /usr/local/sql-ledger>
+ AddHandler cgi-script .pl
+ Options ExecCGI Includes FollowSymlinks
+ </Directory>
+
+ <Directory /usr/local/sql-ledger/users>
+ Order Deny,Allow
+ Deny from All
+ </Directory>
+
+edit httpd.conf and add
+
+ # SQL-Ledger
+ Include <ServerRoot>/sql-ledger-httpd.conf
+
+Note: Replace <ServerRoot> with the server's root directory!
+
+restart your web server.
+
+
+Note: /usr/local/sql-ledger is only a suggested
+path, you can install in any directory.
+
+
+INSTALLATION WITH setup.pl:
+---------------------------
+Make a directory
+
+ mkdir /usr/local/sql-ledger
+
+Copy setup.pl to /usr/local/sql-ledger
+
+run setup.pl as root and follow the prompts.
+
+Go to the next step, "PREPARE YOUR SQL SERVER".
+
+
+SET PERMISSION:
+---------------
+change directory to /usr/local/sql-ledger
+
+# chown nobody:nobody users templates
+
+replace nobody:nobody with the web server
+user of your system. Some systems use
+apache:apache, www, www-data, ...
+
+
+PREPARE YOUR SQL SERVER:
+------------------------
+
+ PostgreSQL:
+ -----------
+ add one database user with create database privileges
+ to manage the datasets and tables for SQL-Ledger
+
+ # su postgres
+ $ createuser -d sql-ledger
+
+ if you use passwords to access postgres set the user up with a password
+ $ createuser -d -P sql-ledger
+
+ Answer no to the following question.
+ Shall the new user be allowed to create more new users? (y/n) n
+
+ You can add more database users to keep datasets
+ separated. Each dataset belongs to one company.
+
+
+ ORACLE:
+ -------
+ add one user and one tablespace
+ all datasets share the same tablespace
+
+
+SETUP A DATABASE AND THE TABLES:
+--------------------------------
+Load your web browser and connect to
+http://localhost/sql-ledger/admin.pl
+
+Tables are created with the "Database
+Administration" function.
+
+Select the "Database Administration" link,
+enter a host, port and user you created in the
+previous step.
+
+The "Create Dataset" link queries the server
+for existing datasets and displays them in a
+column. Then you enter a name for the new
+dataset and select one of the Chart of Accounts
+and click on Continue.
+Your new dataset and the tables will be created
+and the selected Chart of Accounts loaded. The
+owner of the tables is the user you entered in
+the previous screen.
+
+NOTE: Be patient, some of the charts are really
+big and take some time to create.
+
+The "Delete Dataset" link queries the server
+for datasets which are in use by SQL-Ledger
+and are not used by any members. This may
+take a while to figure out. "Be patient".
+If there are any datasets not in use, you get
+a screen with the datasets listed where you
+can select the one you want to delete.
+
+NOTE: you cannot manage any other datasets
+from this interface, only the datasets used
+by SQL-Ledger.
+
+
+SETUP A USER:
+-------------
+Load your web browser and connect to
+http://localhost/sql-ledger/admin.pl
+
+Click on "Add User". In the Database
+section select the driver and enter
+the user you used to create the dataset.
+
+
+LOAD THE ACCOUNTING PROGRAM:
+----------------------------
+Load your web browser and connect to
+http://localhost/sql-ledger/login.pl
+
+
+UPGRADING TO A NEWER VERSION:
+-----------------------------
+1. unpack the new version over top
+2. check the doc directory for specific notes
+3. load admin.pl
+ click on "Database Administration"
+ enter the dba in the "Connect to" field
+ click on "Update Dataset"
+ select the datasets and click "Continue"
+
+
+UPGRADING WITH setup.pl:
+------------------------
+run setup.pl from the command line and follow
+the prompts.
+
+
+INSTALLATION CHECKLIST:
+-----------------------
+1. untar SL somewhere
+2. change permissions for the users and templates directory
+3. edit httpd.conf
+4. edit sql-ledger.conf
+5. a) add the database user sql-ledger in PostgreSQL
+ b) add a tablespace and the database user sql-ledger in Oracle
+6. load admin.pl
+7. create datasets for the companies
+8. add users
+
+ In the Database section enter
+
+ a) PostgreSQL
+
+ Host: for local connections leave empty
+ Dataset: the dataset created in step 7
+ Port: for local connections leave empty
+ User: sql-ledger
+ Password: password for sql-ledger
+
+ b) Oracle
+
+ SID: system ID
+ Port: the port Oracle is listening on
+ Dataset: the dataset created in step 7
+ Password: password for connection
+
+
+IF SOMETHING DOESN'T WORK:
+--------------------------
+There is a FAQ online which addresses various questions.
+see http://www.sql-ledger.org/misc/faq.html
+
+There are also several mailing lists at
+http://www.sql-ledger.org/misc/mailinglist.html
+where you can go for help.
+
+If you require support you can order online at
+http://www.sql-ledger.com/misc/support.html
+
+
+=====================================================================
+December 4, 2002
+
diff --git a/sql-ledger/doc/UPGRADE-1.6-1.8 b/sql-ledger/doc/UPGRADE-1.6-1.8
new file mode 100644
index 000000000..b5631b283
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.6-1.8
@@ -0,0 +1,61 @@
+Upgrading from version 1.6 to 1.8
+
+1. make a backup copy of your databases and SQL-Ledger, just in case!
+ $ cd /usr/local/www/sql-ledger
+ $ pg_dump database > db.out
+ $ tar cvf ~/sql-ledger.tar .
+
+2. install SQL-Ledger over top of your old installation
+ $ cd /usr/local/www
+ $ tar zxvf sql-ledger-1.8.0.tar.gz
+
+3. change the tables to the new layout
+ $ cd sql-ledger/sql
+ $ psql database < upgrade-1.6-1.8.sql
+
+4. copy the new master templates to your template directory
+ $ cd ../templates
+
+ $ cp Default-email_purchase_order.html your_template_dir/email_purchase_order.html
+ $ cp Default-purchase_order.html your_template_dir/purchase_order.html
+ $ cp Default-email_sales_order.html your_template_dir/email_sales_order.html
+ $ cp Default-sales_order.html your_template_dir/sales_order.html
+
+5. Two new accounts were hopefully added to your chart of accounts
+ One account for Foreign Exchange Gains and one for
+ Foreign Exchange Losses
+ edit and change to suit your COA. You can safely change
+ the account number too.
+
+6. Edit your preferences
+
+ In field 'Stylesheet' enter -> sql-ledger.css
+ Stylesheet is in the css directory
+
+ Add your foreign currencies in the Currencies field
+ The first currency in the list is your default
+ i.e CDN:USD:EUR:YEN
+ If you used a nativecurr than it should be listed in the
+ new currencies field.
+
+7. <%nativecurr%> has changed to <%currency%>
+ edit all your templates and change nativecurr to currency
+
+8. I also added four more variables which can be used in your templates.
+ <%contact%>, <%shiptocontact%>, <%shiptophone%>, <%shiptofax%>
+
+9. Nameing convention for templates has changed from an
+ underscore to a minus sign. If you designed your own
+ master templates rename the templates from
+ industry_invoice.html to industry-invoice.html,
+ industry_packing_list.html to industry-packing_list.html, etc.
+ The minus sign is used to separate the name and list them in
+ the setup screen.
+
+ This change only applies to the master templates in the
+ templates root directory NOT the individual templates which
+ are used by users.
+
+It looks more than it really is. Steps 1 to 4 are important,
+the rest is for fine tuning and info.
+
diff --git a/sql-ledger/doc/UPGRADE-1.8-1.8.3 b/sql-ledger/doc/UPGRADE-1.8-1.8.3
new file mode 100644
index 000000000..babed3793
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.8-1.8.3
@@ -0,0 +1,23 @@
+Upgrading from version 1.8.(0-2) to 1.8.3
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-1.8.3.tar.gz
+
+2. copy sql-ledger.conf.default to sql-ledger.conf
+ $ cp sql-ledger.conf.default sql-ledger.conf
+
+ if you modified sql-ledger.conf merge the changes from the
+ .default file rather than copying over top.
+
+3. copy the new master templates to your template directory
+ $ cd ../templates
+
+ $ cp Default-invoice.tex your_template_dir/invoice.tex
+ $ cp Default-packing_list.tex your_template_dir/packing_list.tex
+ $ cp Default-purchase_order.tex your_template_dir/purchase_order.tex
+ $ cp Default-sales_order.tex your_template_dir/sales_order.tex
+
+4. edit sql-ledger.conf
+ instructions are in the file
+
diff --git a/sql-ledger/doc/UPGRADE-1.8.3-1.8.4 b/sql-ledger/doc/UPGRADE-1.8.3-1.8.4
new file mode 100644
index 000000000..c3ecdf5af
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.8.3-1.8.4
@@ -0,0 +1,10 @@
+Upgrading from version 1.8.3 to 1.8.4
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-1.8.4.tar.gz
+
+2. update the tables with the admin script
+
+ You will not be able to log in until you upgraded the tables.
+
diff --git a/sql-ledger/doc/UPGRADE-1.8.4-1.8.5 b/sql-ledger/doc/UPGRADE-1.8.4-1.8.5
new file mode 100644
index 000000000..e8c32e1bf
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.8.4-1.8.5
@@ -0,0 +1,18 @@
+Upgrading from version 1.8.4 to 1.8.5
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-1.8.5.tar.gz
+
+2. update the tables with the admin script
+
+ You will not be able to log in until you upgraded the tables.
+
+
+There are two new variables (<%customernumber%> and <%vendornumber%>)
+which can be used in the forms. These may be used instead of the
+internally generated customer_id and vendor_id.
+
+Typically these numbers are used to retrieve a customer, vendor
+by some ID. In most counter operations the phone number is used.
+
diff --git a/sql-ledger/doc/UPGRADE-1.8.5-1.8.7 b/sql-ledger/doc/UPGRADE-1.8.5-1.8.7
new file mode 100644
index 000000000..992238c3a
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.8.5-1.8.7
@@ -0,0 +1,6 @@
+Upgrading from version 1.8.5 to 1.8.7
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-1.8.7.tar.gz
+
diff --git a/sql-ledger/doc/UPGRADE-1.8.7-2.0.0 b/sql-ledger/doc/UPGRADE-1.8.7-2.0.0
new file mode 100644
index 000000000..e16ba7556
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-1.8.7-2.0.0
@@ -0,0 +1,20 @@
+Upgrading to Version 2.0.0
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-2.0.0.tar.gz
+
+2. load admin.pl and update the tables
+
+ You will not be able to log in until the tables are up to date.
+
+3. copy the new templates to your personal template directory
+
+ $ cd templates
+ $ cp Default-check.tex dir/check.tex
+ $ cp Default-receipt.tex dir/receipt.tex
+ $ cp Default-statement.html dir/statement.html
+ $ cp Default-statement.tex dir/statement.tex
+
+ replace 'dir' with your directory name
+
diff --git a/sql-ledger/doc/UPGRADE-2.0-2.0.8 b/sql-ledger/doc/UPGRADE-2.0-2.0.8
new file mode 100644
index 000000000..6ddff62ac
--- /dev/null
+++ b/sql-ledger/doc/UPGRADE-2.0-2.0.8
@@ -0,0 +1,8 @@
+Upgrading from version 2.0.[0-7] to 2.0.8
+
+1. install SQL-Ledger over top of your old installation
+ $ cd /usr/local
+ $ tar zxvf sql-ledger-2.0.8.tar.gz
+
+2. update your datasets with the admin script
+
diff --git a/sql-ledger/doc/copyright b/sql-ledger/doc/copyright
new file mode 100644
index 000000000..d493a3d21
--- /dev/null
+++ b/sql-ledger/doc/copyright
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003, Dieter Simader
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/doc/faq.html b/sql-ledger/doc/faq.html
new file mode 100644
index 000000000..0f6f237ca
--- /dev/null
+++ b/sql-ledger/doc/faq.html
@@ -0,0 +1,747 @@
+<ul>
+<p><li><h4>Sub-menus and Apache 2.0</h4>
+Some versions of Apache 2.0 (2.0.44+) don't expand sub-menus and generate
+a 500 error at various points. This stems from workaround developed for
+earlier versions of Apache 2.0. It looks like this workaround must now be
+disabled. If you get an error or the sub-menus don't expand edit
+SL/Form.pm and comment lines 80-82.
+<pre>
+ # for Apache 2 we escape strings twice
+# if (($ENV{SERVER_SOFTWARE} =~ /Apache\/2/) && !$beenthere) {
+# $str = $self->escape($str, 1);
+# }
+</pre>
+
+
+<p><li><h4>About installation</h4>
+The easiest is to use the setup.pl script as root.
+You don't need to know very much about your system, just login as root,
+run 'perl setup.pl' and follow the prompts.
+<p>setup.pl does not check for missing software packages and it is your
+responsibility to make sure you have the required pieces
+installed either from source or from a package supplied with your distro.
+
+<p>Requirements are clearly indicated in the README file and on the
+download page.
+
+
+<p><li><h4>IDENT Authentication failed for user "postgres"</h4>
+
+This error has everything to do with the way the distros set up
+access rights for postgres. They are way too restrictive and leave you
+wondering what to do next.
+
+<p>Do yourself a favour and change authentication in pg_hba.conf to
+
+<pre>
+local all trust</pre>
+
+<p>until you have figured what all this stuff in pg_hba.conf does.
+
+<p><b>NOBODY</b>, I repeat, <b>NOBODY</b>, from the Internet will be able to
+connect to postgres. You can't even connect from the inside LAN, the only
+one who is allowed to connect are clients originating from localhost.
+
+<p>Read a bit about the different authentication settings and change
+them as you see fit.
+It is all described in detail in pg_hba.conf
+
+<p>If you can't find the file, there is a wonderful utility called find.
+Use it.
+<pre>
+# find /usr/local -type f -name 'pg_hba.conf'
+</pre>
+
+
+<p><li><h4>DBD-Pg for Mandrake 9.0</h4>
+Mandrake did not package a compiled DBD-Pg package again, so install DBD-Pg
+from the source package.
+Install perl-DBD-Pg-1.01-4mdk.i586.rpm from the 'contrib' area.
+(Mandrake / 9.0 / contrib / RPMS)
+
+<p><li><h4>LaTeX error</h4>
+If for some reason LaTeX produces an error message check for strange
+characters in your account description and parts description
+and use \usepackage[latin1]{inputenc} in the preamble.
+
+
+<p><li><h4>LaTeX templates</h4>
+If you don't want to edit tex code by hand,
+you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting
+latex code.
+To do that you must change the tokens for parameters <% and %> to something
+like << and >>. % is the comment character in tex. There is also a
+pagebreak block which must be commented out.
+When you are done with the changes
+replace << and >> with <% and %> and uncomment the pagebreak block.
+
+<p>LaTeX is difficult but it also offers a much superior interface to produce
+professionally looking forms in postscript and PDF format.
+Unfortunately with power comes some pain too.
+
+
+<p><li><h4>W3M</h4>
+pass terminal=mozilla when you start w3m
+<pre>$ w3m -F http://localhost/sql-ledger/login.pl?terminal=mozilla</pre>
+
+To use without frames
+<pre>$ w3m http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
+
+<p><li><h4>PDF option disappeared</h4>
+Edit sql-ledger.conf and set $latex = 1;
+<br>sql-ledger.conf is perl code, check if it compiles, if it does not
+the internal defaults are used which set $latex to 0, hence no PDF option.
+
+<p><li><h4>SQL-Ledger on Mac Os X 10.1.5</h4>
+Jaume Teixi put together
+<a href=http://www.rocacorbit.com/techdocs/sql_ledger_os_x.html>
+installation instructions</a> to run SL on a Mac.
+<br>The instructions are for 1.8.5 however they still apply to any of the
+newer versions.
+
+<p><li><h4>Installation on Windows (WIN32)</h4>
+<ul>
+<li>install Apache, perl,
+<a href=http://techdocs.postgresql.org/guides/InstallingOnWindows>Postgres</a>
+or Oracle, DBI and the appropriate DBD
+module
+<br>if you can't compile DBD-Pg here is a precompiled
+<a href=http://www.edmund-mergl.de/export/>DBD-Pg module</a>
+<li>download the latest version of <a href=/cgi-bin/nav.pl?page=source/index.html&title=Download>SQL-Ledger</a>
+<li>extract the files to c:\apache\sql-ledger
+<li>download
+<a href=../source/sql-ledger-windows.tar.gz>sql-ledger-windows.tar.gz</a>
+and extract the files to c:\apache\sql-ledger
+ <br>the shebang line is changed to c:\perl\bin\perl and the symlinks
+ are regular files
+<br>answer with 'Yes' to overwrite existing files.
+<li>edit c:\apache\conf\httpd.conf and add
+<pre>
+Alias /sql-ledger/ "C:/apache/sql-ledger/"
+&lt;Directory "c:/apache/sql-ledger"&gt;
+ AllowOverride All
+ AddHandler cgi-script .pl
+ Options +ExecCGI
+ Order Allow,Deny
+ Allow from All
+&lt;/Directory&gt;
+
+&lt;Directory "c:/apache/sql-ledger/users"&gt;
+ Order Deny,Allow
+ Deny from All
+&lt;/Directory&gt;
+</pre>
+
+<li>start Apache
+<li>start Postgres|Oracle
+<li>connect to http://localhost/sql-ledger/admin.pl and setup users
+and datasets
+<li>connect to http://localhost/sql-ledger/login.pl and login
+
+</ul>
+
+<p><li><h4>Installation on Windows /w cygwin</h4>
+<ul>
+<li>install <a href=http://sources.redhat.com/cygwin/>cygwin</a>
+Apache, perl, postgres, gcc and lynx
+<li>install <a href=http://search.cpan.org/search?module=DBI>DBI</a>
+<li>tar zxvf DBI-1.30.tar.gz
+<li>cd DBI-1.30
+<li>perl Makefile.PL
+<li>make install
+<li>install <a href=http://search.cpan.org/search?dist=DBD-Pg>DBD-Pg</a>
+<li>tar -zxvf DBD-Pg-1.13.tar.gz
+<li>export POSTGRES_INCLUDE=/usr/include/postgresql
+<li>export POSTGRES_LIB=/usr/lib/postgresql
+<li>cd DBD-Pg-1.13
+<li>perl Makefile.PL
+<li>make install
+<li>edit /etc/apache/httpd.conf and add
+<pre>
+AddHandler cgi-script .pl
+Alias /sql-ledger/ /var/www/sql-ledger/
+&lt;Directory /var/www/sql-ledger&gt;
+ Options +ExecCGI
+&lt;/Directory&gt;
+
+&lt;Directory /var/www/sql-ledger/users&gt;
+ Order Deny,Allow
+ Deny from All
+&lt/Directory&gt;
+</pre>
+<li>install SQL-Ledger
+<li>cd /var/www
+<li>mkdir sql-ledger
+<li>download <a href=/cgi-bin/download.pl?setup.pl>setup.pl</a> and save the file
+in /var/www/sql-ledger
+<li>cd /var/www/sql-ledger
+<li>perl setup.pl
+</ul>
+
+<p><li><h4>What do I enter for the language</h4>
+If you use English, nothing, if you want to use a foreign language for
+the login screen and admin stuff enter the language code. All the
+language specific files are in the locale directory. The long form for
+the language is in the LANGUAGE file.
+
+<p><li><h4>Mandrake 9.0 permission denied error</h4>
+Mandrake says to add this to your commonhttpd.conf
+<pre>
+&lt;Directory /usr/local/sql-ledger&gt;
+ AllowOverride All
+ Options -MultiViews -Indexes -FollowSymLinks
+ Order allow,deny
+ Allow from all
+&lt;/Directory&gt;
+
+The way apache starts is it:
+Blocks all access to the physical file system /
+Opens access to the physical file system /var/www/html
+Opens access to the physical file system /var/www/perl
+Opens access to the physical file system /var/www/cgi-bin
+Opens access to the physical file system /var/www/protected-cgi-bin
+Opens access to the physical file system /home/*/public_html
+Opens access to the physical file system /home/*/public_html/cgi-bin
+Opens access to the physical file system /var/www/icons
+Opens access to the physical file system /usr/share/doc
+
+Since you're trying to access files outside of those allowed paths, you
+have to specifically allow it. It's done this way because of some past
+exploits with the pathnames. Rather than trust that there will never be
+another bug within apache that will let you get somewhere you don't
+want, you set it up securely out of the box so that apache won't let
+itself go somewhere that you don't want it to.
+</pre>
+
+
+<p><li><h4>Incorrect Dataset version</h4>
+The dataset you are trying to use is not compatible with the version.
+When you upgrade datasets use the same database user in the "User"
+field as the one listed in the Database section for the user.
+
+
+<p><li><h4>Mandrake 8.2</h4>
+Mandrake did not include the package "perl-DBD-Pg-1.01-1mdk.i586.rpm"
+You can install the package from Mandrake 8.1
+
+
+<p><li><h4>printing to a printer</h4>
+Setup a printer in the "Printer" field in the users preferences.
+i.e lpr -Plaser
+and set $latex = 1 in sql-ledger.conf
+LaTeX must be installed for this to work.
+
+<p>To send the document to the printer check the "Postscript" or "PDF" format,
+enter the number of copies and click on the "Print" button.
+
+<p>The printer field is available only when you edit the user's
+preferences with admin.pl.
+
+<p>Note: html format is for screen preview. Use your browser's
+print function.
+
+
+<p><li><h4>beginning balances</h4>
+Add a GL Journal entry and enter the beginning balance for your accounts.
+Use your balance sheet. If you also want to add open invoices, add the invoices
+and make the appropriate adjustments. Your balance sheet includes these
+amounts!
+
+
+<p><li><h4>cost for parts and service</h4>
+the cost will be updated when you purchase goods and services. You can
+enter the cost manually. This is so you can have a cost on file without
+making a purchase.
+
+
+<p><li><h4>establish a beginning inventory</h4>
+add the parts with a purchase invoice. Use the <b>real cost</b> for the items
+not zero. If you use zero cost then the cost of goods will be zero when you
+sell the item.
+
+
+<p><li><h4>Assemblies</h4>
+Assemblies are manufactured goods assembled from parts, services and
+assemblies. Because you do not buy assemblies you 'stock assemblies' by
+adding assembled units to your inventory. The quantity for individual parts
+is reduced and the quantity for the assembly increased. To disassemble an
+assembly you simply return the parts to inventory by entering a negative
+quantity for the number of assemblies to stock.
+
+
+<p><li><h4>customizing SQL-Ledger</h4>
+The <a href=/cgi-bin/nav.pl?page=feature/api.html&title=Application%20Interface>application interface</a>
+consists of a global and private interface.
+
+
+<p><li><h4>DBD-Pg not installed</h4>
+
+Most modern distributions now package DBD-Pg. If it is
+not packaged follow this recipe to get it working.
+
+<ul>
+ <li>check if you have the header files for PostgreSQL
+ <br>$ find / -name 'libpq-fe.h'
+ <br>if nothing shows up install the development package for PostgreSQL
+ <li>download and untar DBD-Pg
+ <li>set the environment variables POSTGRES_LIB and POSTGRES_INCLUDE
+ <li>cd to DBD-Pg directory
+ <br>as ordinary user
+ <br>$ perl Makefile.PL
+ <br>$ make
+ <br>$ make test
+ <br>if all went well su to root
+ <br># make install
+ <li>remove DBD-Pg
+</ul>
+
+
+<p><li><h4>SuSE 8.1 installation</h4>
+<ol>
+<li>Install the following using YaST2:
+
+<p>- perl-DBD-Pg
+<br>- postgresql
+<br>- postgresql-contrib
+<br>- postgresql-devl
+<br>- postgresql-docs
+<br>- postgresql-libs
+<br>- postgresql-perl
+<br>- postgresql-server
+<br>- postgresql-test
+
+<p><li>Setup directories and paths for PostgreSQL:
+
+<p>> sux - (change to root)
+
+<p>- If not done by the installation, setup disk directory for your db:
+<br># mkdir /var/lib/pgsql/data
+<br># chown postgres /var/lib/pgsql/data
+
+<p><li>Initialize the database, and start it, as below:
+<p>Note that there are man pages for initdb and pg_ctl.
+
+<p># touch /var/log/pgsql
+<br># chown postgres:postgres /var/log/pgsql
+<br># sux postgres
+
+<p>- Initialize postgres:
+<br>> /usr/bin/initdb -D /var/lib/pgsql/data
+<br>(creating ... Success...)
+
+<p>- Start the postgres daemon:
+<br>> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l /var/log/pgsql start (start db)
+<br>(postmaster successfully started)
+
+<p><li>Quick-test the server (still as user postgres):
+
+<p>- > psql -d template1
+<br>(Welcome ... \q to exit psql)
+<br>\q
+
+<p>- Try setting up another db user:
+
+<p>> createuser &lt;db-user&gt; (&lt;db-user&gt; should match an existing Linux user)
+<br>Shall the new user be allowed to create databases? (y/n) y
+<br>Shall the new user be allowed to create more new users? (y/n) n
+
+<p>Unless a problem with DBD::Pg (perl interface), postgres is ready to go.
+
+<p><li>If a previous sql-ledger database needs to be installed,
+<br>do the following as postgres user. Steps for dumping the old db,
+ and building the new follow:
+
+<p>> sux postgres
+<br>> psql template1
+<br>=# CREATE DATABASE my_database; (create your database)
+<br>=# \q
+<br>> cd /var/lib/pgsql/backups (assuming your backups are here)
+<br>The next command should have been performed earlier from the
+ previous installed version of postgres and your database:
+<br>> pg_dump -d my_database.sql.bak (from previous ver postgres)
+<br>> cp my_database.sql.bak my_database.sql
+<br>- Use vi to change all occurrances of 'current_date' to current_date
+ in file my_database.sql .
+<br>The vi command for this is :g/'current_date'/s//current_date/g
+<br>> psql my_database < my_database.sql > my_database.log
+<br>- Check my_database.log for errors.
+
+<p><li>Download setup.pl and run it as root while on line to the internet:
+
+<p># mkdir /usr/local/sql-ledger
+<br># cd /usr/local/sql-ledger
+<br># ./setup.pl
+<br>- Enter i
+<br>- Enter httpd owner and group if different than displayed default.
+<br>(Download occurs and status is displayed...)
+
+<p><li>Setup the new sql-ledger with database.
+
+<p>- Surf to http://my_computer/sql-ledger/admin.pl
+<br>- Click enter (no password needed).
+<br>->Database Administration
+<br>- Leave fields Host and Port enpty for local installations.
+<br> - Enter your database name in the "Connect to" field.
+<br> - Enter the database user you setup (postgres, sql-ledger, etc.)
+<br> - Enter a password, only if a password is assigned to the database.
+<br> - To update an existing sql-ledger database: ->Update Database
+<br> Should see: The following Datasets need to be updated.
+<br> ->Continue
+<br> Do more admin. You will need to setup at least one login.
+<br> To exit: ->Database Admin
+
+<p><li>See if it works:
+
+<p> - Surf to http://my_computer/sql-ledger/login.pl
+<br> - Enter the login name you just created. Main menu screen should appear.
+</ol>
+
+
+
+<p><li><h4>Redhat Installation</h4>
+
+<ul>
+<li>Install apache1.3.12-25.i386.rpm
+<li>Install perl5.6.0-9.i386.rpm
+<li>Install postgresql-7.0.2-17.i386.rpm
+<li>Install postgresql-server-7.0.2-17.i386.rpm
+<li>Install postgresql-devel-7.0.2-17.i386.rpm (POSTGRES_INCLUDE)
+<li>tar xvzf DBI-1.14.tar.gz
+<li>cd DBI-1.14
+<li>perl Makefile.PL
+<li>make
+<li>make install
+<li>cd ..
+<li>tar xvzf DBD-Pg-0.95
+<li>cd DBD-Pg-0.95
+<li>export POSTGRES_LIB=/usr/lib/pgsql
+<li>export POSTGRES_INCLUDE=/usr/include/pgsql
+<li>perl Makefile.PL
+<li>make
+<li>make install
+<li>install SQL-Ledger
+</ul>
+
+<p>Some of the applications have newer versions however the installation
+instructions remain the same. Just substitute the old version with a newer
+version.
+
+
+<p><li><h4>Debian Installation</h4>
+
+<ul>
+<li>unpack into /usr/local/www/sql-ledger
+<li>install postgresql (Dselect)
+<li>install apache (Dselect)
+<li>install libdbi-perl (Dselect)
+<li>install libdbd-pg-perl (Dselect)
+<li>install libpgperl (Dselect)
+<li>modify /etc/postgresql/postgresql.conf
+ <br>TCPIP_SOCKET = 1
+<li>create a user for managing SQL-Ledger databases
+<br>from root
+<br>su postgres
+<br>$ createuser -d sql-ledger
+<br>if you use passwords to access postgres set the user up with a password
+<br>$ createuser -d -P sql-ledger
+<li>change /etc/apache/httpd.conf and add
+<pre>
+AddHandler cgi-script .pl
+Alias /sql-ledger/ /usr/local/www/sql-ledger/
+&lt;Directory /usr/local/www/sql-ledger&gt;
+ Options +ExecCGI
+&lt;/Directory&gt;
+
+&lt;Directory /usr/local/www/sql-ledger/users&gt;
+ Order Deny,Allow
+ Deny from All
+&lt;/Directory&gt;
+</pre>
+<li>restart apache
+<li>change fileownership of users and templates to www-data
+ <br>chown www-data: users templates
+<li>From browser enter http://localhost/sql-ledger/admin.pl
+<li>Login as the postgres user (account manager) you have created (above)
+<br>Create a DB
+<br>Create users
+
+<li>then enter http://localhost/sql-ledger/login.pl
+<br>Login as one of the users you have just created
+
+</ul>
+
+<p>
+The long version was provided by Gordon Haverland.
+<p>
+<ul>
+<li>You need to unpack the SQL-Ledger package (compressed tar archive)
+ someplace. Unpacking it in<pre>
+ /usr/local/www/sql-ledger.</pre>
+ Remember where you have unpacked it.
+<li>SQL-Ledger requires that the PostgreSQL database be installed.
+This is a very full-featured database, and has many associated
+packages. SQL-Ledger requires version 7.0 or better. The name
+of the basic package on Debian is postgresql. To find if you
+already have postgresql installed, and if so what version, the
+following command should work:<pre>
+ dpkg -l | grep -i 'ii postgresql '</pre>
+ A typical response would be:<pre>
+ ii postgresql 7.1.3-5 Object....[stuff deleted]</pre>
+ Indicating, that version 7.1.3 is installed (the -5 is a
+ Debian patch level). You can use dselect or apt-get to install
+ postgresql if you need to. You can visit the Debian maintainer's
+ page for much more information on related packages at<pre>
+ http://people.debian.org/~elphick/postgresql/</pre>
+ Older versions of Debian's PostgreSQL installation use a file
+ called postmaster.init, while newer versions use a file called
+ postmaster.conf, either residing in /etc/postgresql.
+<li>SQL-Ledger requires a HTTP server (or daemon) which is capable of
+ handling CGI scripts. Apache is the one which is recommended,
+ version 1.3 or better. Debian calls the base package apache.
+ Debian has two alternative versions of Apache, one with mod-perl
+ (apache-perl) support compiled in, and the other with SSL
+ (secure sockets layer - apache-ssl) support. SQL-Ledger doesn't
+ require mod-perl or SSL support, but works with either if
+ you need it installed for other functions you have. Older versions
+ of Debian Apache installations, spread the configuration of the
+ server across 3 files (srm.conf, access.conf and httpd.conf).
+ Newer versions have consolidated all of this to httpd.conf.
+<li>SQL-Ledger uses the Data Base Interface perl module for communication
+ with PostgreSQL. The CPAN (Comprehensive Perl Archive Network)
+ name for this module is DBI. Debian calls this module
+ libdbi-perl. You should probably deselect (or apt-get) the
+ Debian version of this module to minimize upgrading headaches in
+ the future.
+<li>DBI requires the use of an implementation specific Data Base
+ Driver. In our case, we need the PostgreSQL specific one.
+ CPAN calls this module DBD::PG, Debian calls it libdbd-pg-perl.
+ You should use dselect (or apt-get) to install it.
+<li>One more layer of Perl - PostgreSQL support is needed. Debian
+ calls this last package libpgperl. Use dselect or apt-get to
+ install it. (You should be able to install all 5 packages at
+ one time.)
+<li>We need to allow your PostgreSQL database to accept queries
+ in a network manner. To do this, we need to change the value
+ of the TCPIP_SOCKET to 1. In newer
+ PostgreSQL installs, this variable will be someplace in
+ /etc/postgresql/postgreslq.conf (older installs will be
+ postmaster.init, same directory. Note: you shouldn't have
+ both files there.) Start up your favorite text editor, find
+ the line with that variable on it, change the "no" to a "yes",
+ and make sure the line isn't commented out (a "#" in front
+ of it on the same line).
+<li>PostgreSQL has a set of users and passwords independent of
+ normal user logins. We need to set up a PostgreSQL user
+ to "own" the SQL-Ledger data (choose a name that makes sense
+ to you, it shouldn't be "root" or "postgres"). The (PostgreSQL)
+ program for doing this is called "createuser". To make this
+ SQL-Ledger owner user, we first need to "become" the PostgreSQL
+ superuser (on Debian, this is "postgres"), and then we will
+ run the createuser program. So, once we are logged in as root:
+<pre>
+ # su postgres
+ $ createuser -d sql-ledger
+ ...
+ $ exit
+ #
+</pre>
+ As shown above, we then typed "exit" after createuser was done,
+ to stop being the "postgres" user. The "-d" switch (you called
+ also use "--createdb") specifies that this user can create
+ databases.
+<li>We need to adjust the configuration of the HTTP server Apache
+ next. Older Apache installations (srm.conf, access.conf and
+ httpd.conf) need changes in srm.conf and httpd.conf. Newer
+ installations just need to edit /etc/apache/httpd.conf. First,
+ we need to instruct the server that files that end in ".pl"
+ are to be treated as "cgi-script"s (srm.conf if separate).<pre>
+ AddHandler cgi-script .pl</pre>
+ Second, we need to map our SQL-Ledger installation to be easy
+ for users to find it (in srm.conf if separate).<pre>
+ Alias /sql-ledger/ /usr/local/www/sql-ledger/</pre>
+ The "/" at the end of sql-ledger in both strings is important!
+ Next, we need to allow the server to execute files from those
+ directories, include things and follow links. This information
+ is in httpd.conf (old or new installations).<pre>
+ &lt;Directory /usr/local/www/sql-ledger&gt;
+ Options ExecCGI Includes FollowSymLinks
+ &lt;/Directory&gt;</pre>
+ If we decided to put SQL-Ledger somewhere other than
+ /usr/local/www/sql-ledger, we would use different paths above.
+<li>All the files in the "users" and "templates" subdirectories
+ of /usr/local/www/sql-ledger need to be owned by "www-data".<pre>
+ # cd /usr/local/www/sql-ledger
+ # chown www-data:www-data users templates users/members</pre>
+ You may get an "error" about users/members not existing. It
+ is safe to ignore this error.
+<li>Restart the apache server.<pre>
+ /etc/init.d/apache restart</pre>
+<li>From a browser, visit the URL<pre>
+ http://localhost/sql-ledger/admin.pl</pre>
+<li>Login as the PostgreSQL user responsible for the SQL-Ledger
+ database you set up. Create a database and create
+ at least one user. (It's not a good idea to access your
+ SQL-Ledger data as the "owner" of the data on a regular basis.)
+<li>Visit<pre>
+ http://localhost/sql-ledger/login.pl</pre>
+ and login as the user you created</pre>
+
+</ul>
+
+
+<p><li><h4>login.pl has compilation error</h4>
+
+This could be because of a missing configuration file in the users directory
+
+<p>check the permission for the users directory. The directory must be
+set writeable for the webserver. If your webserver runs under nobody.nogroup
+set it to
+<pre>
+drwxrwx--x 2 johndoe nogroup 1024 May 26 16:49 users
+
+or
+
+drwx--x--x 2 nobody nogroup 1024 May 26 16:49 users
+</pre>
+
+
+<p><li><h4>script not executing, shows in browser instead</h4>
+
+Add
+
+<pre>
+ AddHandler cgi-script .pl
+</pre>
+
+in your httpd.conf file.
+
+
+<p><li><h4>unknown terminal!</h4>
+the frontend script couldn't figure out which browser you are using
+<p>include the terminal variable on the URL
+<pre>
+ http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
+<p>Valid terminal variables are lynx and mozilla
+
+
+<p><li><h4>permission denied at filesystem level</h4>
+
+Check if your web server has write permission to write to the following
+files and directories:
+<pre>
+ users/
+ templates/
+ users/members
+
+ # chown nobody:nogroup users templates users/members
+</pre>
+
+
+<p><li><h4>permission denied to access tables</h4>
+The user you entered in the "Database section" must be a valid
+database user who has the rights to access the tables.
+
+<p>If the tables are owned by 'john' and you enter 'mary' as the dba
+you might run into this problem if mary doesn't have the rights to
+access tables owned by john.
+
+
+<p><li><h4>html and graphics files don't show up on screen</h4>
+
+Enable Includes and FollowSymlinks Options in your httpd.conf file
+<pre> &lt;Directory /usr/local/sql-ledger&gt;
+ Options ExecCGI Includes FollowSymlinks
+ &lt;/Directory&gt;
+</pre>
+
+
+<p><li><h4>Can I use mySQL</h4>
+
+No. mySQL lacks certain features required by SQL-Ledger.
+
+
+<p><li><h4>switch display to a foreign language</h4>
+
+Load your preferences and select the language.
+<br>Language selection is in accordance to
+<a href=http://www.unece.org/cefact/locode/service/main.htm>
+ISO 3166-1</a> standards.
+
+
+<p><li><h4>Text shows in English when I use a foreign language</h4>
+
+This is because the corresponding hash entry is missing.
+Add the missing text in the locale/cc/all or locale/cc/missing
+file and run 'perl locales.pl' to rebuild the individual files.
+
+<br>cc refers to the country code.
+
+
+<p><li><h4>switch to a foreign language for the login and admin screen</h4>
+
+Edit sql-ledger.conf and enter the code for the variable
+$language. If your language specific files are in 'locales/cc', enter 'cc'
+
+
+</ul>
+
+<p>
+<hr>
+<a name=security>
+<h1>SQL-Ledger security</h1>
+</a>
+
+<ul>
+<li>The security features built into SQL-Ledger provide encrypted passwords
+and access control which makes it fairly safe out of the box to run even in
+front of a firewall.
+Some precautions which are out of our control must be taken though.
+It matters where you install SL and how you configure your web and SQL server.
+
+<pre>
+ Typical setups:
+
+ /usr/local/vh/www <- DocumentRoot for virtual host
+ /usr/local/vh/sql-ledger <- Alias for sql-ledger
+ /usr/local/vh/users <- users directory out of reach
+
+<hr width=60% align=left>
+ /usr/local/vh/www <- DocumentRoot for virtual host
+ /usr/local/vh/www/sql-ledger <- Alias for sql-ledger
+ /usr/local/vh/www/sql-ledger/users <- users configuration files and tmp space
+
+ &lt;Directory /usr/local/vh/www/sql-ledger/users&gt; <- disable webserver access
+ Order Deny,Allow for users directory
+ Deny from All
+ &lt;/Directory&gt;
+
+</pre>
+
+The location for the users directory can be specified in sql-ledger.conf
+
+<p><li>Set permission for the users and templates directory to 711
+(most restrictive)
+
+<p><li>If you do not want anyone to change the templates with the built-in
+editor set the files in templates/directory/ to read only or disable
+the menu item to edit the templates.
+
+<p><li>For PostgreSQL you can set who has access to the server in the file
+pg_hba.conf
+<br>Authentication crypt does not work because not all SQL servers
+accept encrypted passwords.
+
+<p><li>in addition you can secure the tables from unauthorized access by
+setting up a different database user and GRANT rights. For instance,
+users without DELETE rights will still be able to use the program, change
+customers or vendors but will not be able to delete transactions.
+To lock all the tables GRANT SELECT rights only.
+
+<p><li>Other security options include a secure shell, your webserver's
+authentication system, SSL, encrypted tunnels, ...
+
+</ul>
+
+</BODY>
+</HTML>
+
diff --git a/sql-ledger/favicon.ico b/sql-ledger/favicon.ico
new file mode 100644
index 000000000..43578f478
--- /dev/null
+++ b/sql-ledger/favicon.ico
Binary files differ
diff --git a/sql-ledger/locale/br/COPYING b/sql-ledger/locale/br/COPYING
new file mode 100644
index 000000000..133af7d81
--- /dev/null
+++ b/sql-ledger/locale/br/COPYING
@@ -0,0 +1,24 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Brazilian texts:
+#
+# Author: Andre Felipe Machado <andremachado@techforce.com.br>
+# Miguel Koren O'Brien de Lacy <miguelk@konsultex.com.br>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/br/LANGUAGE b/sql-ledger/locale/br/LANGUAGE
new file mode 100644
index 000000000..d45d52d89
--- /dev/null
+++ b/sql-ledger/locale/br/LANGUAGE
@@ -0,0 +1 @@
+Brazilian Portuguese
diff --git a/sql-ledger/locale/br/admin b/sql-ledger/locale/br/admin
new file mode 100644
index 000000000..c5cd2e177
--- /dev/null
+++ b/sql-ledger/locale/br/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Controle de Acesso',
+ 'Accounting' => 'Contabilidade',
+ 'Add User' => 'Adicionar Usuário',
+ 'Address' => 'Endereço',
+ 'Administration' => 'Administração',
+ 'Administrator' => 'Administrador',
+ 'All Datasets up to date!' => 'Todos grupos de dados atualizados!',
+ 'Change Admin Password' => 'Trocar senha de administração',
+ 'Change Password' => 'Trocar senha',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Click on login name to edit!' => 'Clique no nome de acesso para editar',
+ 'Company' => 'Companhia',
+ 'Connect to' => 'Conectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Criar Carta de Contas',
+ 'Create Dataset' => 'Criar conjunto de dados',
+ 'DBI not installed!' => 'Driver de Interface de Banco de dados NÃO INSTALADO!',
+ 'Database' => 'Banco de Dados',
+ 'Database Administration' => 'Administração da Base de Dados',
+ 'Database Driver not checked!' => 'Driver do banco de dados não selecionado!',
+ 'Database User missing!' => 'Usuário da base de dados faltando!',
+ 'Dataset' => 'Conjunto de dados',
+ 'Dataset missing!' => 'Conjunto de dados faltando!',
+ 'Dataset updated!' => 'Conjunto de dados atualizado',
+ 'Date Format' => 'Formato de Data',
+ 'Delete' => 'Apagar',
+ 'Delete Dataset' => 'Apagar conjunto de dados',
+ 'Directory' => 'Diretório',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Limite de dropdown',
+ 'E-mail' => 'E-Mail',
+ 'Edit User' => 'Editar Usuário',
+ 'Existing Datasets' => 'Conjunto de dados existentes',
+ 'Fax' => 'Fax',
+ 'Host' => 'Servidor',
+ 'Hostname missing!' => 'Nome do servidor faltando!',
+ 'Incorrect Password!' => 'Senha incorreta!',
+ 'Language' => 'Idioma',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deixe os campos de servidor e porta vazios a menos que você queira fazer uma conexão remota',
+ 'Login' => 'Acessar/login',
+ 'Name' => 'Nome',
+ 'New Templates' => 'Novos Modelos',
+ 'No Database Drivers available!' => 'Nenhum driver de banco de dados disponível!',
+ 'No Dataset selected!' => 'Nenhum conjunto de dados selecionado!',
+ 'Nothing to delete!' => 'Nada para apagar!',
+ 'Number Format' => 'Formato de números',
+ 'Oracle Database Administration' => 'Administração da Base de Dados Oracle',
+ 'Password' => 'Senha',
+ 'Password changed!' => 'Senha trocada!',
+ 'Pg Database Administration' => 'Administração da Base de Dados PostgreSQL',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Porta',
+ 'Port missing!' => 'Porta faltando!',
+ 'Printer' => 'Impressora',
+ 'Save' => 'Salvar',
+ 'Select a Dataset to delete and press "Continue"' => 'Selecione um conjunto de dados para APAGAR e pressione Continue',
+ 'Setup Templates' => 'Modelos de Configuração',
+ 'Ship via' => 'Transportar via',
+ 'Signature' => 'Assinatura',
+ 'Stylesheet' => 'Folha de estilos',
+ 'Templates' => 'Modelos',
+ 'The following Datasets are not in use and can be deleted' => 'Os seguintes conjuntos de dados NÃO estão em uso e PODEM ser apagados',
+ 'The following Datasets need to be updated' => 'Os seguintes grupos de dados precisam ser atualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta é uma verificação preliminar por fontes existentes. Nada será criado ou apagado neste estágio!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para adicionar um usuário a um grupo edite um nome, troque o nome de acesso/login e salve. Um novo usuário com as mesmas variáveis será então salvo sob o novo nome de acesso/login.',
+ 'Update Dataset' => 'Atualizar grupo de dados',
+ 'Use Templates' => 'Use Modelos',
+ 'User' => 'Usuário',
+ 'User deleted!' => 'Usuário apagado!',
+ 'User saved!' => 'Usuário salvo',
+ 'Version' => 'Versão',
+ 'You must enter a host and port for local and remote connections!' => 'Você precisa entrar um servidor e uma porta para conexões locais e remotas!',
+ 'does not exist' => 'Não existe',
+ 'is already a member!' => 'já é um membro!',
+ 'localhost' => 'localhost /servidor local',
+ 'successfully created!' => 'Criado com sucesso!',
+ 'successfully deleted!' => 'Apagado com sucesso!',
+ 'website' => 'website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'adicionar_usuário' => 'add_user',
+ 'trocar_senha_de_administração' => 'change_admin_password',
+ 'trocar_senha' => 'change_password',
+ 'continuar' => 'continue',
+ 'criar_conjunto_de_dados' => 'create_dataset',
+ 'apagar' => 'delete',
+ 'apagar_conjunto_de_dados' => 'delete_dataset',
+ 'acessar/login' => 'login',
+ 'administração_da_base_de_dados_oracle' => 'oracle_database_administration',
+ 'administração_da_base_de_dados_postgresql' => 'pg_database_administration',
+ 'salvar' => 'save',
+ 'atualizar_grupo_de_dados' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/br/all b/sql-ledger/locale/br/all
new file mode 100644
index 000000000..b656204a6
--- /dev/null
+++ b/sql-ledger/locale/br/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Contas a Pagar',
+ 'AP Aging' => 'Contas a Pagar Vencidas',
+ 'AP Transaction' => 'Transação - Contas a Pagar',
+ 'AP Transactions' => 'Transações - Contas a Pagar',
+ 'AR' => 'Contas a Receber',
+ 'AR Aging' => 'Contas a Receber Vencidas',
+ 'AR Transaction' => 'Transação - Contas a Receber',
+ 'AR Transactions' => 'Transações - Contas a Receber',
+ 'About' => 'Sobre',
+ 'Access Control' => 'Controle de Acesso',
+ 'Account' => 'Conta',
+ 'Account Number' => 'Número da Conta',
+ 'Account Number missing!' => 'Número da Conta não encontrado!',
+ 'Account Type' => 'Tipo de Conta',
+ 'Account Type missing!' => 'Tipo de Conta não encontrado!',
+ 'Account deleted!' => 'Conta apagada!',
+ 'Account saved!' => 'Conta salva!',
+ 'Accounting' => 'Contabilidade',
+ 'Accounting Menu' => 'Menu de Contabilidade',
+ 'Accounts' => 'Contas',
+ 'Active' => 'Ativa',
+ 'Add' => 'Adicionar',
+ 'Add Account' => 'Adicionar Conta',
+ 'Add Accounts Payables Transaction' => 'Adicionar Transação de contas pagáveis',
+ 'Add Accounts Receivables Transaction' => 'Adicionar Transação de contas recebíveis',
+ 'Add Assembly' => 'Adicionar Conjunto',
+ 'Add Customer' => 'Adicionar Cliente',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Add General Ledger Transaction' => 'Adicionar Transação Livro Razão',
+ 'Add Part' => 'Adicionar Parte',
+ 'Add Project' => 'Adicionar projeto',
+ 'Add Purchase Invoice' => 'Adicionar Fatura de Compra',
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Invoice' => 'Adicionar Fatura de Venda',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Add Service' => 'Adicionar Serviço',
+ 'Add Transaction' => 'Adicionar Transação',
+ 'Add User' => 'Adicionar Usuário',
+ 'Add Vendor' => 'Adicionar Distribuidor',
+ 'Address' => 'Endereço',
+ 'Administration' => 'Administração',
+ 'Administrator' => 'Administrador',
+ 'All' => 'Todas',
+ 'All Datasets up to date!' => 'Todos grupos de dados atualizados!',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total Devido',
+ 'Amount does not equal applied!' => 'Total não é igual ao aplicado!',
+ 'Amount missing!' => 'Total faltando!',
+ 'Applied' => 'Aplicado',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem certeza que quer APAGAR a Fatura Número',
+ 'Are you sure you want to delete Order Number' => 'Tem certeza que quer APAGAR tal número de Pedido?',
+ 'Are you sure you want to delete Transaction' => 'Tem certeza que quer APAGAR a Transação',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => 'Conjuntos re estocados',
+ 'Assembly Number missing!' => 'Número de conjunto faltando!',
+ 'Asset' => 'Ativo',
+ 'Attachment' => 'Anexo',
+ 'Audit Control' => 'Controle de Auditoria',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'Lista de Material',
+ 'Backup' => 'Cópia de reserva',
+ 'Backup sent to' => 'Cópia reserva enviada para',
+ 'Balance' => 'Balanço',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'Books are open' => 'Livros estão abertos',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'Número de negócio',
+ 'C' => 'F',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete account!' => 'Não pode apagar conta!',
+ 'Cannot delete customer!' => 'Não pode apagar cliente!',
+ 'Cannot delete default account!' => 'Não pode apagar conta padrão!',
+ 'Cannot delete invoice!' => 'Não pode apagar fatura!',
+ 'Cannot delete item already invoiced!' => 'Não posso apagar item já faturado!',
+ 'Cannot delete item on order!' => 'Não pode apagar item no pedido',
+ 'Cannot delete item which is part of an assembly!' => 'Não posso apagar item que é parte de um conjunto',
+ 'Cannot delete item!' => 'Não pode apagar item!',
+ 'Cannot delete order!' => 'Não pode apagar pedido!',
+ 'Cannot delete transaction!' => 'Não pode apagar transação!',
+ 'Cannot delete vendor!' => 'Não pode apagar fornecedor!',
+ 'Cannot have a value in both Debit and Credit!' => 'Não pode ter um valor em ambos Débito e Crédito!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar fatura em período fechado!',
+ 'Cannot post invoice!' => 'Não pode lançar fatura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post payment!' => 'Não pode lançar pagamento!',
+ 'Cannot post transaction for a closed period!' => 'Não pode lançar transação para um período já encerrado!',
+ 'Cannot post transaction!' => 'Não pode lançar transação',
+ 'Cannot process payment for a closed period!' => 'Não pode processar pagamento para um pedíodo já encerrado!',
+ 'Cannot save account!' => 'Não pode salvar conta!',
+ 'Cannot save order!' => 'Não pode salvar pedido!',
+ 'Cannot save preferences!' => 'Não pode salvar preferências!',
+ 'Cannot stock assemblies!' => 'Não pode estocar conjuntos!',
+ 'Cash' => 'Caixa',
+ 'Cash based' => 'Baseado no Caixa',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Trocar senha de administração',
+ 'Change Password' => 'Trocar senha',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Chart of Accounts' => 'Código de Contas',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impresso',
+ 'Check printing failed!' => 'Impressão de cheque falhou!',
+ 'Cleared Balance' => 'Balanço limpo',
+ 'Click on login name to edit!' => 'Clique no nome de acesso para editar',
+ 'Close Books up to' => 'Encerrar livros até',
+ 'Closed' => 'Fechado',
+ 'Company' => 'Companhia',
+ 'Compare to' => 'Comparar a',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Conectar a',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Copy to COA' => 'Copiar para Plano de Contas',
+ 'Create Chart of Accounts' => 'Criar Carta de Contas',
+ 'Create Dataset' => 'Criar conjunto de dados',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Curr' => 'Moeda',
+ 'Currency' => 'Moeda',
+ 'Current' => '',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => 'Cliente apagado!',
+ 'Customer missing!' => 'Cliente faltando!',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Customer saved!' => 'Cliente salvo',
+ 'Customers' => 'Clientes',
+ 'DBI not installed!' => 'Driver de Interface de Banco de dados NÃO INSTALADO!',
+ 'Database' => 'Banco de Dados',
+ 'Database Administration' => 'Administração da Base de Dados',
+ 'Database Driver not checked!' => 'Driver do banco de dados não selecionado!',
+ 'Database Host' => 'Servidor de Base de Dados',
+ 'Database User missing!' => 'Usuário da base de dados faltando!',
+ 'Dataset' => 'Conjunto de dados',
+ 'Dataset missing!' => 'Conjunto de dados faltando!',
+ 'Dataset updated!' => 'Conjunto de dados atualizado',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Date Format' => 'Formato de Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Date missing!' => 'Data faltando!',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito e crédito fora de balanço!',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Decimalplaces' => 'Casas decimais',
+ 'Delete' => 'Apagar',
+ 'Delete Account' => 'Apagar Conta',
+ 'Delete Dataset' => 'Apagar conjunto de dados',
+ 'Delivery Date' => 'Data de entrega',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descrição',
+ 'Difference' => 'Diferença',
+ 'Directory' => 'Diretório',
+ 'Discount' => 'Desconto',
+ 'Done' => 'Feito',
+ 'Drawing' => 'Desenho',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Limite de dropdown',
+ 'Due' => 'Saldo',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Data de Vencimento faltando!',
+ 'E-mail' => 'E-Mail',
+ 'E-mail Statement to' => 'Declaração enviada por email para',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Conta',
+ 'Edit Accounts Payables Transaction' => 'Editar Transação - Contas a Pagar',
+ 'Edit Accounts Receivables Transaction' => 'Editar Transação - Contas a Receber',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit GIFI' => 'Editar CFOP',
+ 'Edit General Ledger Transaction' => 'Editar Transação Livro Razão',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Preferences for' => 'Editar Preferências para',
+ 'Edit Project' => 'Editar Projeto',
+ 'Edit Purchase Invoice' => 'Editar Fatura de Compra',
+ 'Edit Purchase Order' => 'Editar Pedido de Compra',
+ 'Edit Sales Invoice' => 'Editar Fatura de Venda',
+ 'Edit Sales Order' => 'Editar Pedido de Venda',
+ 'Edit Service' => 'Editar Serviço',
+ 'Edit Template' => 'Editar Modelo',
+ 'Edit User' => 'Editar Usuário',
+ 'Employee' => 'Empregado',
+ 'Enforce transaction reversal for all dates' => 'Forçar execução de reversão de transação para todas as datas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entre com até 3 letras separadas por dois pontos (i.e CAD:USD:EUR) para sua moeda local e estrangeira',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate Difference' => 'Diferença da Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Existing Datasets' => 'Conjunto de dados existentes',
+ 'Expense' => 'Despesa',
+ 'Expense Account' => 'Conta de Despesas',
+ 'Expense/Asset' => 'Despesa/Ativo',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'Foreign Exchange Gain' => 'Ganho com câmbio estrangeiro',
+ 'Foreign Exchange Loss' => 'Perda com câmbio estrangeiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GIFI deleted!' => 'CFOP apagado!',
+ 'GIFI missing!' => 'CFOP faltando!',
+ 'GIFI saved!' => 'CFOP salvo!',
+ 'GL Transaction' => 'Transação do Livro Razão',
+ 'General Ledger' => 'Livro Razão',
+ 'Goods & Services' => 'Produtos e Serviços',
+ 'HTML Templates' => 'Modelos HTML',
+ 'Heading' => 'Cabeçalho',
+ 'Host' => 'Servidor',
+ 'Hostname missing!' => 'Nome do servidor faltando!',
+ 'ID' => 'ID',
+ 'Image' => 'Imagem',
+ 'In-line' => 'em linha',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Include in drop-down menus' => 'Incluir nos menus drop-down (tipo cortina)',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir esta conta nos formulários de cliente/fornecedor para marcar cliente/fornecedor como sujeito a impostos.',
+ 'Income' => 'Receita',
+ 'Income Account' => 'Conta de Receitas',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Incorrect Dataset version!' => 'Versão incorreta de grupos de dados!',
+ 'Incorrect Password!' => 'Senha incorreta!',
+ 'Individual Items' => 'Ítens individuais',
+ 'Inventory' => 'Estoque',
+ 'Inventory Account' => 'Conta de Estoque',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Quantidade em estoque TEM de ser zero ANTES que você possa tornar este conjunto obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Quantidade em estoque TEM de ser zero ANTES que você possa tornar esta parte/peça obsoleta!',
+ 'Inventory quantity must be zero!' => 'Quantidade em estoque TEM de ser zero!',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Data de Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Invoice deleted!' => 'Fatura apagada!',
+ 'Invoice posted!' => 'Fatura lançada!',
+ 'Invoices' => 'Faturas',
+ 'Is this a summary account to record' => 'Esta é uma conta sumária a registrar?',
+ 'Item deleted!' => 'Item apagado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'LaTeX Templates' => 'Modelos LaTeX',
+ 'Language' => 'Idioma',
+ 'Last Cost' => 'Último Custo',
+ 'Last Invoice Number' => 'Último Número de Fatura',
+ 'Last Numbers & Default Accounts' => 'Últimos números e Contas Padrão',
+ 'Last Purchase Order Number' => 'Último Número de Pedido de Compra',
+ 'Last Sales Order Number' => 'Último número de pedido de vendas',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deixe os campos de servidor e porta vazios a menos que você queira fazer uma conexão remota',
+ 'Liability' => 'Passivo',
+ 'Licensed to' => 'Licenciado a',
+ 'Line Total' => 'Total da linha',
+ 'Link' => 'Ligar',
+ 'Link Accounts' => 'Ligar Contas',
+ 'List Accounts' => 'Listar Contas',
+ 'List GIFI' => 'Listar CFOP',
+ 'List Price' => 'Preço de lista',
+ 'List Transactions' => 'Listar Transações',
+ 'Login' => 'Acessar/login',
+ 'Logout' => 'Logout (sair)',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'N/A' => 'N/D',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Nome faltando!',
+ 'New Templates' => 'Novos Modelos',
+ 'No' => 'Não',
+ 'No Database Drivers available!' => 'Nenhum driver de banco de dados disponível!',
+ 'No Dataset selected!' => 'Nenhum conjunto de dados selecionado!',
+ 'No email address for' => 'Sem endereço de email para',
+ 'No.' => '',
+ 'Notes' => 'Notas',
+ 'Nothing applied!' => 'Nada foi aplicado!',
+ 'Nothing selected!' => 'Nada foi selecionado!',
+ 'Nothing to delete!' => 'Nada para apagar!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de números',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'O' => 'A',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'On Hand' => 'Em Mãos',
+ 'On Order' => 'Em pedido',
+ 'Open' => 'Abrir',
+ 'Oracle Database Administration' => 'Administração da Base de Dados Oracle',
+ 'Order' => 'Pedido',
+ 'Order Date' => 'Data de Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Entry' => 'Entrada de Pedido',
+ 'Order Number' => 'Pedido Número',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'Order deleted!' => 'Pedido apagado!',
+ 'Order saved!' => 'Pedido salvo!',
+ 'Ordered' => 'Pedido feito',
+ 'Orphaned' => 'Ficaram órfãs',
+ 'Out of balance!' => 'Fora de balanço!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Paid' => 'Total Efetuado',
+ 'Paid in full' => '',
+ 'Part' => 'Parte',
+ 'Part Number missing!' => 'Número da parte não encontrado!',
+ 'Parts' => 'Partes',
+ 'Parts Inventory' => 'Estoque de Partes',
+ 'Password' => 'Senha',
+ 'Password changed!' => 'Senha trocada!',
+ 'Payables' => 'A Pagar',
+ 'Payment' => 'Pagamento',
+ 'Payment date missing!' => 'Data de pagamento faltando!',
+ 'Payment posted!' => 'Pagamento Lançado',
+ 'Payments' => 'Pagamentos',
+ 'Pg Database Administration' => 'Administração da Base de Dados PostgreSQL',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Porta',
+ 'Port missing!' => 'Porta faltando!',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Preferências',
+ 'Preferences saved!' => 'Preferências Salvas!',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Project Number missing!' => 'Número do Projeto faltando!',
+ 'Project deleted!' => 'Projeto apagado!',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Project saved!' => 'Projeto salvo!',
+ 'Projects' => 'Projetos',
+ 'Purchase Invoice' => 'Fatura de compra',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Qty' => 'Qtde',
+ 'ROP' => 'Nível mínimo de estoque',
+ 'Rate' => 'Taxa',
+ 'Recd' => 'Recebidos',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Receivables' => 'A Receber',
+ 'Reconciliation' => 'Reconciliação',
+ 'Record in' => 'Registrar em',
+ 'Reference' => 'Referência',
+ 'Reference missing!' => 'Referência faltando!',
+ 'Remaining' => 'Restante',
+ 'Report for' => 'Relatório para',
+ 'Reports' => 'Relatórios',
+ 'Required by' => 'Requerido por',
+ 'Retained Earnings' => 'Lucros Retidos',
+ 'Sales' => 'Vendas',
+ 'Sales Invoice' => 'Fatura de Venda',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Sales Orders' => 'Pedidos de Venda',
+ 'Save' => 'Salvar',
+ 'Save as new' => 'Salvar como novo',
+ 'Save to File' => 'Salvar para Arquivo',
+ 'Screen' => 'Tela',
+ 'Select a Dataset to delete and press "Continue"' => 'Selecione um conjunto de dados para APAGAR e pressione Continue',
+ 'Select all' => 'Selecionar todos',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sell Price' => 'Preço de Venda',
+ 'Send by E-Mail' => 'Enviar por E-mail',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Service Items' => 'Ítens de Serviço',
+ 'Service Number missing!' => 'Número do serviço não encontrado!',
+ 'Services' => 'Serviços',
+ 'Setup Templates' => 'Modelos de Configuração',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Ship via' => 'Transportar via',
+ 'Short' => 'Curto',
+ 'Signature' => 'Assinatura',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Fonte',
+ 'Standard' => 'Padrão',
+ 'Statement' => 'Declaração',
+ 'Statement Balance' => 'Declaração de Balanço',
+ 'Statement sent to' => 'Declaração enviada para',
+ 'Statements sent to printer!' => 'Declaração enviada para impressora!',
+ 'Stock Assembly' => 'Conjunto normal de estoque',
+ 'Stylesheet' => 'Folha de estilos',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'System' => 'Sistema',
+ 'Tax' => 'Imposto',
+ 'Tax Accounts' => 'Contas de Impostos',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'Taxable' => 'Sujeito a impostos',
+ 'Template saved!' => 'Modelo salvo!',
+ 'Templates' => 'Modelos',
+ 'Terms: Net' => 'Crédito Líquido',
+ 'The following Datasets are not in use and can be deleted' => 'Os seguintes conjuntos de dados NÃO estão em uso e PODEM ser apagados',
+ 'The following Datasets need to be updated' => 'Os seguintes grupos de dados precisam ser atualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta é uma verificação preliminar por fontes existentes. Nada será criado ou apagado neste estágio!',
+ 'To' => 'Até',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para adicionar um usuário a um grupo edite um nome, troque o nome de acesso/login e salve. Um novo usuário com as mesmas variáveis será então salvo sob o novo nome de acesso/login.',
+ 'Top Level' => 'Nível superior',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Data de transação faltando!',
+ 'Transaction deleted!' => 'Transação apagada!',
+ 'Transaction posted!' => 'Transação lançada',
+ 'Transaction reversal enforced for all dates' => 'Reversão de transação forçada para todas as datas.',
+ 'Transaction reversal enforced up to' => 'Reversão de transação forçada até ',
+ 'Transactions' => 'Tansações',
+ 'Transactions exist, cannot delete customer!' => 'Existem transações, não pode apagar o cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Existem transações, não pode apagar fornecedor!',
+ 'Transactions exist; cannot delete account!' => 'Existem transações, não pode apagar conta!',
+ 'Trial Balance' => 'Balanço Preliminar',
+ 'Unit' => 'Unidade',
+ 'Unit of measure' => 'Unidade de medida',
+ 'Update' => 'Atualizar',
+ 'Update Dataset' => 'Atualizar grupo de dados',
+ 'Updated' => 'Atualizado',
+ 'Use Templates' => 'Use Modelos',
+ 'User' => 'Usuário',
+ 'User deleted!' => 'Usuário apagado!',
+ 'User saved!' => 'Usuário salvo',
+ 'Vendor' => 'Distribuidor',
+ 'Vendor deleted!' => 'Distribuidor apagado!',
+ 'Vendor missing!' => 'Distribuidor faltando!',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'Vendor saved!' => 'Distribuidor salvo!',
+ 'Vendors' => 'Distribuidores',
+ 'Version' => 'Versão',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidade de Peso',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Year End' => 'Fim de ano',
+ 'Yes' => 'Sim',
+ 'You are logged out!' => 'Você saiu do sistema!',
+ 'You did not enter a name!' => 'Você não entrou com um nome',
+ 'You must enter a host and port for local and remote connections!' => 'Você precisa entrar um servidor e uma porta para conexões locais e remotas!',
+ 'as at' => 'como em',
+ 'collected on sales' => 'recolhido sobre vendas',
+ 'days' => 'Dias',
+ 'does not exist' => 'Não existe',
+ 'ea' => 'cada',
+ 'emailed to' => 'enviado por email para',
+ 'for Period' => 'pelo período',
+ 'hr' => 'h',
+ 'is already a member!' => 'já é um membro!',
+ 'is not a member!' => 'não é um membro!',
+ 'localhost' => 'localhost /servidor local',
+ 'paid on purchases' => 'pago em aquisições',
+ 'sent to printer' => 'enviado para impressora',
+ 'successfully created!' => 'Criado com sucesso!',
+ 'successfully deleted!' => 'Apagado com sucesso!',
+ 'to' => 'para',
+ 'website' => 'website',
+};
+
+1;
diff --git a/sql-ledger/locale/br/am b/sql-ledger/locale/br/am
new file mode 100644
index 000000000..eafe19d7d
--- /dev/null
+++ b/sql-ledger/locale/br/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Contas a Pagar',
+ 'AR' => 'Contas a Receber',
+ 'Account' => 'Conta',
+ 'Account Number' => 'Número da Conta',
+ 'Account Number missing!' => 'Número da Conta não encontrado!',
+ 'Account Type' => 'Tipo de Conta',
+ 'Account Type missing!' => 'Tipo de Conta não encontrado!',
+ 'Account deleted!' => 'Conta apagada!',
+ 'Account saved!' => 'Conta salva!',
+ 'Add Account' => 'Adicionar Conta',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Address' => 'Endereço',
+ 'Asset' => 'Ativo',
+ 'Audit Control' => 'Controle de Auditoria',
+ 'Backup sent to' => 'Cópia reserva enviada para',
+ 'Books are open' => 'Livros estão abertos',
+ 'Business Number' => 'Número de negócio',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete account!' => 'Não pode apagar conta!',
+ 'Cannot delete default account!' => 'Não pode apagar conta padrão!',
+ 'Cannot save account!' => 'Não pode salvar conta!',
+ 'Cannot save preferences!' => 'Não pode salvar preferências!',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Chart of Accounts' => 'Código de Contas',
+ 'Close Books up to' => 'Encerrar livros até',
+ 'Company' => 'Companhia',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar para Plano de Contas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato de Data',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Apagar',
+ 'Delete Account' => 'Apagar Conta',
+ 'Description' => 'Descrição',
+ 'Dropdown Limit' => 'Limite de dropdown',
+ 'E-mail' => 'E-Mail',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Conta',
+ 'Edit GIFI' => 'Editar CFOP',
+ 'Edit Preferences for' => 'Editar Preferências para',
+ 'Edit Template' => 'Editar Modelo',
+ 'Enforce transaction reversal for all dates' => 'Forçar execução de reversão de transação para todas as datas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entre com até 3 letras separadas por dois pontos (i.e CAD:USD:EUR) para sua moeda local e estrangeira',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Despesa',
+ 'Expense Account' => 'Conta de Despesas',
+ 'Expense/Asset' => 'Despesa/Ativo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Ganho com câmbio estrangeiro',
+ 'Foreign Exchange Loss' => 'Perda com câmbio estrangeiro',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GIFI deleted!' => 'CFOP apagado!',
+ 'GIFI missing!' => 'CFOP faltando!',
+ 'GIFI saved!' => 'CFOP salvo!',
+ 'Heading' => 'Cabeçalho',
+ 'Include in drop-down menus' => 'Incluir nos menus drop-down (tipo cortina)',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir esta conta nos formulários de cliente/fornecedor para marcar cliente/fornecedor como sujeito a impostos.',
+ 'Income' => 'Receita',
+ 'Income Account' => 'Conta de Receitas',
+ 'Inventory' => 'Estoque',
+ 'Inventory Account' => 'Conta de Estoque',
+ 'Is this a summary account to record' => 'Esta é uma conta sumária a registrar?',
+ 'Language' => 'Idioma',
+ 'Last Invoice Number' => 'Último Número de Fatura',
+ 'Last Numbers & Default Accounts' => 'Últimos números e Contas Padrão',
+ 'Last Purchase Order Number' => 'Último Número de Pedido de Compra',
+ 'Last Sales Order Number' => 'Último número de pedido de vendas',
+ 'Liability' => 'Passivo',
+ 'Link' => 'Ligar',
+ 'Name' => 'Nome',
+ 'No' => 'Não',
+ 'No email address for' => 'Sem endereço de email para',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de números',
+ 'Parts Inventory' => 'Estoque de Partes',
+ 'Password' => 'Senha',
+ 'Payables' => 'A Pagar',
+ 'Payment' => 'Pagamento',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Preferências Salvas!',
+ 'Rate' => 'Taxa',
+ 'Receivables' => 'A Receber',
+ 'Sales' => 'Vendas',
+ 'Save' => 'Salvar',
+ 'Service Items' => 'Ítens de Serviço',
+ 'Ship via' => 'Transportar via',
+ 'Signature' => 'Assinatura',
+ 'Stylesheet' => 'Folha de estilos',
+ 'Tax' => 'Imposto',
+ 'Tax Accounts' => 'Contas de Impostos',
+ 'Template saved!' => 'Modelo salvo!',
+ 'Transaction reversal enforced for all dates' => 'Reversão de transação forçada para todas as datas.',
+ 'Transaction reversal enforced up to' => 'Reversão de transação forçada até ',
+ 'Transactions exist; cannot delete account!' => 'Existem transações, não pode apagar conta!',
+ 'Weight Unit' => 'Unidade de Peso',
+ 'Year End' => 'Fim de ano',
+ 'Yes' => 'Sim',
+ 'does not exist' => 'Não existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'adicionar_conta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_para_plano_de_contas' => 'copy_to_coa',
+ 'apagar' => 'delete',
+ 'editar' => 'edit',
+ 'editar_conta' => 'edit_account',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ap b/sql-ledger/locale/br/ap
new file mode 100644
index 000000000..dce6c51b9
--- /dev/null
+++ b/sql-ledger/locale/br/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transação - Contas a Pagar',
+ 'AP Transactions' => 'Transações - Contas a Pagar',
+ 'Account' => 'Conta',
+ 'Add Accounts Payables Transaction' => 'Adicionar Transação de contas pagáveis',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total Devido',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem certeza que quer APAGAR a Transação',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Não pode apagar transação!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post transaction for a closed period!' => 'Não pode lançar transação para um período já encerrado!',
+ 'Cannot post transaction!' => 'Não pode lançar transação',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moeda',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Description' => 'Descrição',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Data de Vencimento faltando!',
+ 'Edit Accounts Payables Transaction' => 'Editar Transação - Contas a Pagar',
+ 'Employee' => 'Empregado',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Data de Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Pedido',
+ 'Order Number' => 'Pedido Número',
+ 'Paid' => 'Total Efetuado',
+ 'Payment date missing!' => 'Data de pagamento faltando!',
+ 'Payments' => 'Pagamentos',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Purchase Invoice' => 'Fatura de compra',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Fonte',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transação apagada!',
+ 'Transaction posted!' => 'Transação lançada',
+ 'Update' => 'Atualizar',
+ 'Vendor' => 'Distribuidor',
+ 'Vendor missing!' => 'Distribuidor faltando!',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transação___contas_a_pagar' => 'ap_transaction',
+ 'adicionar_transação_de_contas_pagáveis' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'editar_transação___contas_a_pagar' => 'edit_accounts_payables_transaction',
+ 'lançar' => 'post',
+ 'lançar_como_novo' => 'post_as_new',
+ 'fatura_de_compra' => 'purchase_invoice',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ar b/sql-ledger/locale/br/ar
new file mode 100644
index 000000000..95efd9299
--- /dev/null
+++ b/sql-ledger/locale/br/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Transação - Contas a Receber',
+ 'AR Transactions' => 'Transações - Contas a Receber',
+ 'Account' => 'Conta',
+ 'Add Accounts Receivables Transaction' => 'Adicionar Transação de contas recebíveis',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total Devido',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem certeza que quer APAGAR a Transação',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Não pode apagar transação!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post transaction for a closed period!' => 'Não pode lançar transação para um período já encerrado!',
+ 'Cannot post transaction!' => 'Não pode lançar transação',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente faltando!',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Description' => 'Descrição',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Data de Vencimento faltando!',
+ 'Edit Accounts Receivables Transaction' => 'Editar Transação - Contas a Receber',
+ 'Employee' => 'Empregado',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Data de Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Pedido',
+ 'Order Number' => 'Pedido Número',
+ 'Paid' => 'Total Efetuado',
+ 'Payment date missing!' => 'Data de pagamento faltando!',
+ 'Payments' => 'Pagamentos',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Remaining' => 'Restante',
+ 'Sales Invoice' => 'Fatura de Venda',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Fonte',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transação apagada!',
+ 'Transaction posted!' => 'Transação lançada',
+ 'Update' => 'Atualizar',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transação___contas_a_receber' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'lançar' => 'post',
+ 'lançar_como_novo' => 'post_as_new',
+ 'fatura_de_venda' => 'sales_invoice',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/arap b/sql-ledger/locale/br/arap
new file mode 100644
index 000000000..4565db65e
--- /dev/null
+++ b/sql-ledger/locale/br/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Endereço',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Description' => 'Descrição',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ca b/sql-ledger/locale/br/ca
new file mode 100644
index 000000000..1f7cbc4ee
--- /dev/null
+++ b/sql-ledger/locale/br/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balanço',
+ 'Chart of Accounts' => 'Código de Contas',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Description' => 'Descrição',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'List Transactions' => 'Listar Transações',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Reference' => 'Referência',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Subtotal' => 'Sub-total',
+ 'To' => 'Até',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transações' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/br/cp b/sql-ledger/locale/br/cp
new file mode 100644
index 000000000..471654b58
--- /dev/null
+++ b/sql-ledger/locale/br/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Total não é igual ao aplicado!',
+ 'Amount missing!' => 'Total faltando!',
+ 'Applied' => 'Aplicado',
+ 'Cannot post payment!' => 'Não pode lançar pagamento!',
+ 'Cannot process payment for a closed period!' => 'Não pode processar pagamento para um pedíodo já encerrado!',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impresso',
+ 'Check printing failed!' => 'Impressão de cheque falhou!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Data faltando!',
+ 'Description' => 'Descrição',
+ 'Due' => 'Saldo',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'From' => 'De',
+ 'Invoice' => 'Fatura',
+ 'Invoices' => 'Faturas',
+ 'Nothing applied!' => 'Nada foi aplicado!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Pagamento',
+ 'Payment posted!' => 'Pagamento Lançado',
+ 'Post' => 'Lançar',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Receipt' => 'Recibo',
+ 'Reference' => 'Referência',
+ 'Screen' => 'Tela',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'To' => 'Até',
+ 'Update' => 'Atualizar',
+ 'Vendor' => 'Distribuidor',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'lançar' => 'post',
+ 'imprimir' => 'print',
+ 'atualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ct b/sql-ledger/locale/br/ct
new file mode 100644
index 000000000..bfc96e5b5
--- /dev/null
+++ b/sql-ledger/locale/br/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Adicionar',
+ 'Address' => 'Endereço',
+ 'All' => 'Todas',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Não pode apagar cliente!',
+ 'Cannot delete vendor!' => 'Não pode apagar fornecedor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Customer deleted!' => 'Cliente apagado!',
+ 'Customer saved!' => 'Cliente salvo',
+ 'Customers' => 'Clientes',
+ 'Delete' => 'Apagar',
+ 'Discount' => 'Desconto',
+ 'E-mail' => 'E-Mail',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Fatura',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Nome faltando!',
+ 'Notes' => 'Notas',
+ 'Number' => 'Número',
+ 'Order' => 'Pedido',
+ 'Orphaned' => 'Ficaram órfãs',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Salvar',
+ 'Ship to' => 'Transportar para',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Taxable' => 'Sujeito a impostos',
+ 'Terms: Net' => 'Crédito Líquido',
+ 'Transactions exist, cannot delete customer!' => 'Existem transações, não pode apagar o cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Existem transações, não pode apagar fornecedor!',
+ 'Vendor deleted!' => 'Distribuidor apagado!',
+ 'Vendor saved!' => 'Distribuidor salvo!',
+ 'Vendors' => 'Distribuidores',
+ 'days' => 'Dias',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'adicionar' => 'add',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'fatura' => 'invoice',
+ 'pedido' => 'order',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/br/gl b/sql-ledger/locale/br/gl
new file mode 100644
index 000000000..928761c66
--- /dev/null
+++ b/sql-ledger/locale/br/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transação - Contas a Pagar',
+ 'AR Transaction' => 'Transação - Contas a Receber',
+ 'Account' => 'Conta',
+ 'Add General Ledger Transaction' => 'Adicionar Transação Livro Razão',
+ 'Address' => 'Endereço',
+ 'All' => 'Todas',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem certeza que quer APAGAR a Transação',
+ 'Asset' => 'Ativo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balanço',
+ 'Cannot delete transaction!' => 'Não pode apagar transação!',
+ 'Cannot have a value in both Debit and Credit!' => 'Não pode ter um valor em ambos Débito e Crédito!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Não pode lançar transação para um período já encerrado!',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito e crédito fora de balanço!',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Description' => 'Descrição',
+ 'Edit General Ledger Transaction' => 'Editar Transação Livro Razão',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Despesa',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GL Transaction' => 'Transação do Livro Razão',
+ 'General Ledger' => 'Livro Razão',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income' => 'Receita',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Liability' => 'Passivo',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Purchase Invoice' => 'Fatura de compra',
+ 'Reference' => 'Referência',
+ 'Reference missing!' => 'Referência faltando!',
+ 'Reports' => 'Relatórios',
+ 'Sales Invoice' => 'Fatura de Venda',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Fonte',
+ 'Subtotal' => 'Sub-total',
+ 'To' => 'Até',
+ 'Transaction Date missing!' => 'Data de transação faltando!',
+ 'Transaction deleted!' => 'Transação apagada!',
+ 'Transaction posted!' => 'Transação lançada',
+ 'Update' => 'Atualizar',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transação___contas_a_pagar' => 'ap_transaction',
+ 'transação___contas_a_receber' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'transação_do_livro_razão' => 'gl_transaction',
+ 'lançar' => 'post',
+ 'lançar_como_novo' => 'post_as_new',
+ 'fatura_de_compra' => 'purchase_invoice',
+ 'fatura_de_venda' => 'sales_invoice',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ic b/sql-ledger/locale/br/ic
new file mode 100644
index 000000000..c28c265f3
--- /dev/null
+++ b/sql-ledger/locale/br/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Ativa',
+ 'Add' => 'Adicionar',
+ 'Add Assembly' => 'Adicionar Conjunto',
+ 'Add Part' => 'Adicionar Parte',
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Add Service' => 'Adicionar Serviço',
+ 'Address' => 'Endereço',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => 'Conjuntos re estocados',
+ 'Assembly Number missing!' => 'Número de conjunto faltando!',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'Lista de Material',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete item already invoiced!' => 'Não posso apagar item já faturado!',
+ 'Cannot delete item on order!' => 'Não pode apagar item no pedido',
+ 'Cannot delete item which is part of an assembly!' => 'Não posso apagar item que é parte de um conjunto',
+ 'Cannot delete item!' => 'Não pode apagar item!',
+ 'Cannot stock assemblies!' => 'Não pode estocar conjuntos!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'Drawing' => 'Desenho',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Service' => 'Editar Serviço',
+ 'Expense' => 'Despesa',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'Image' => 'Imagem',
+ 'In-line' => 'em linha',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income' => 'Receita',
+ 'Individual Items' => 'Ítens individuais',
+ 'Inventory' => 'Estoque',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Quantidade em estoque TEM de ser zero ANTES que você possa tornar este conjunto obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Quantidade em estoque TEM de ser zero ANTES que você possa tornar esta parte/peça obsoleta!',
+ 'Inventory quantity must be zero!' => 'Quantidade em estoque TEM de ser zero!',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Item deleted!' => 'Item apagado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Last Cost' => 'Último Custo',
+ 'Line Total' => 'Total da linha',
+ 'Link Accounts' => 'Ligar Contas',
+ 'List Price' => 'Preço de lista',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'On Hand' => 'Em Mãos',
+ 'On Order' => 'Em pedido',
+ 'Order' => 'Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Number' => 'Pedido Número',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'Ordered' => 'Pedido feito',
+ 'Orphaned' => 'Ficaram órfãs',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Part' => 'Parte',
+ 'Part Number missing!' => 'Número da parte não encontrado!',
+ 'Parts' => 'Partes',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtde',
+ 'ROP' => 'Nível mínimo de estoque',
+ 'Recd' => 'Recebidos',
+ 'Required by' => 'Requerido por',
+ 'Sales' => 'Vendas',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Save' => 'Salvar',
+ 'Screen' => 'Tela',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sell Price' => 'Preço de Venda',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Service Number missing!' => 'Número do serviço não encontrado!',
+ 'Services' => 'Serviços',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Short' => 'Curto',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Conjunto normal de estoque',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'To' => 'Até',
+ 'Top Level' => 'Nível superior',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Unit of measure' => 'Unidade de medida',
+ 'Update' => 'Atualizar',
+ 'Updated' => 'Atualizado',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'ea' => 'cada',
+ 'emailed to' => 'enviado por email para',
+ 'hr' => 'h',
+ 'sent to printer' => 'enviado para impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'adicionar' => 'add',
+ 'adicionar_conjunto' => 'add_assembly',
+ 'adicionar_parte' => 'add_part',
+ 'adicionar_serviço' => 'add_service',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'editar_conjunto' => 'edit_assembly',
+ 'editar_parte' => 'edit_part',
+ 'editar_serviço' => 'edit_service',
+ 'salvar' => 'save',
+ 'atualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/br/io b/sql-ledger/locale/br/io
new file mode 100644
index 000000000..8d07ecf8e
--- /dev/null
+++ b/sql-ledger/locale/br/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Address' => 'Endereço',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'em linha',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Part' => 'Parte',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtde',
+ 'Recd' => 'Recebidos',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Screen' => 'Tela',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Subject' => 'Assunto',
+ 'To' => 'Até',
+ 'Unit' => 'Unidade',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para impressora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/br/ir b/sql-ledger/locale/br/ir
new file mode 100644
index 000000000..67bc4d41e
--- /dev/null
+++ b/sql-ledger/locale/br/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Add Purchase Invoice' => 'Adicionar Fatura de Compra',
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem certeza que quer APAGAR a Fatura Número',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'Cannot delete invoice!' => 'Não pode apagar fatura!',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar fatura em período fechado!',
+ 'Cannot post invoice!' => 'Não pode lançar fatura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Currency' => 'Moeda',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Edit Purchase Invoice' => 'Editar Fatura de Compra',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'em linha',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Data de Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Invoice deleted!' => 'Fatura apagada!',
+ 'Invoice posted!' => 'Fatura lançada!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Number' => 'Pedido Número',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Part' => 'Parte',
+ 'Payment date missing!' => 'Data de pagamento faltando!',
+ 'Payments' => 'Pagamentos',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtde',
+ 'Recd' => 'Recebidos',
+ 'Record in' => 'Registrar em',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Screen' => 'Tela',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Source' => 'Fonte',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Atualizar',
+ 'Vendor' => 'Distribuidor',
+ 'Vendor missing!' => 'Distribuidor faltando!',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'ea' => 'cada',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'pedido' => 'order',
+ 'lançar' => 'post',
+ 'lançar_como_novo' => 'post_as_new',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/is b/sql-ledger/locale/br/is
new file mode 100644
index 000000000..7d1136530
--- /dev/null
+++ b/sql-ledger/locale/br/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Invoice' => 'Adicionar Fatura de Venda',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem certeza que quer APAGAR a Fatura Número',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'Cannot delete invoice!' => 'Não pode apagar fatura!',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar fatura em período fechado!',
+ 'Cannot post invoice!' => 'Não pode lançar fatura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente faltando!',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Edit Sales Invoice' => 'Editar Fatura de Venda',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'em linha',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Data de Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Fatura',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Invoice deleted!' => 'Fatura apagada!',
+ 'Invoice posted!' => 'Fatura lançada!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Number' => 'Pedido Número',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Part' => 'Parte',
+ 'Payment date missing!' => 'Data de pagamento faltando!',
+ 'Payments' => 'Pagamentos',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Lançar',
+ 'Post as new' => 'Lançar como novo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtde',
+ 'Recd' => 'Recebidos',
+ 'Record in' => 'Registrar em',
+ 'Remaining' => 'Restante',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Screen' => 'Tela',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Ship via' => 'Transportar via',
+ 'Source' => 'Fonte',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Atualizar',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'ea' => 'cada',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'pedido' => 'order',
+ 'lançar' => 'post',
+ 'lançar_como_novo' => 'post_as_new',
+ 'imprimir' => 'print',
+ 'transportar_para' => 'ship_to',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/login b/sql-ledger/locale/br/login
new file mode 100644
index 000000000..ff7494cbf
--- /dev/null
+++ b/sql-ledger/locale/br/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Sobre',
+ 'Accounting' => 'Contabilidade',
+ 'Database Host' => 'Servidor de Base de Dados',
+ 'Dataset' => 'Conjunto de dados',
+ 'Incorrect Dataset version!' => 'Versão incorreta de grupos de dados!',
+ 'Incorrect Password!' => 'Senha incorreta!',
+ 'Licensed to' => 'Licenciado a',
+ 'Login' => 'Acessar/login',
+ 'Name' => 'Nome',
+ 'Password' => 'Senha',
+ 'User' => 'Usuário',
+ 'Version' => 'Versão',
+ 'You are logged out!' => 'Você saiu do sistema!',
+ 'You did not enter a name!' => 'Você não entrou com um nome',
+ 'is not a member!' => 'não é um membro!',
+ 'localhost' => 'localhost /servidor local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'acessar/login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/br/menu b/sql-ledger/locale/br/menu
new file mode 100644
index 000000000..1ad51b6bc
--- /dev/null
+++ b/sql-ledger/locale/br/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Contas a Pagar',
+ 'AP Aging' => 'Contas a Pagar Vencidas',
+ 'AR' => 'Contas a Receber',
+ 'AR Aging' => 'Contas a Receber Vencidas',
+ 'Accounting Menu' => 'Menu de Contabilidade',
+ 'Add Account' => 'Adicionar Conta',
+ 'Add Assembly' => 'Adicionar Conjunto',
+ 'Add Customer' => 'Adicionar Cliente',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Add Part' => 'Adicionar Parte',
+ 'Add Project' => 'Adicionar projeto',
+ 'Add Service' => 'Adicionar Serviço',
+ 'Add Transaction' => 'Adicionar Transação',
+ 'Add Vendor' => 'Adicionar Distribuidor',
+ 'Assemblies' => 'Conjuntos',
+ 'Audit Control' => 'Controle de Auditoria',
+ 'Backup' => 'Cópia de reserva',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Cash' => 'Caixa',
+ 'Chart of Accounts' => 'Código de Contas',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Clientes',
+ 'General Ledger' => 'Livro Razão',
+ 'Goods & Services' => 'Produtos e Serviços',
+ 'HTML Templates' => 'Modelos HTML',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Invoice' => 'Fatura',
+ 'LaTeX Templates' => 'Modelos LaTeX',
+ 'List Accounts' => 'Listar Contas',
+ 'List GIFI' => 'Listar CFOP',
+ 'Logout' => 'Logout (sair)',
+ 'Order Entry' => 'Entrada de Pedido',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Parts' => 'Partes',
+ 'Payment' => 'Pagamento',
+ 'Payments' => 'Pagamentos',
+ 'Preferences' => 'Preferências',
+ 'Projects' => 'Projetos',
+ 'Purchase Invoice' => 'Fatura de compra',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Reconciliation' => 'Reconciliação',
+ 'Reports' => 'Relatórios',
+ 'Sales Invoice' => 'Fatura de Venda',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Sales Orders' => 'Pedidos de Venda',
+ 'Save to File' => 'Salvar para Arquivo',
+ 'Send by E-Mail' => 'Enviar por E-mail',
+ 'Services' => 'Serviços',
+ 'Statement' => 'Declaração',
+ 'Stock Assembly' => 'Conjunto normal de estoque',
+ 'Stylesheet' => 'Folha de estilos',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'Transactions' => 'Tansações',
+ 'Trial Balance' => 'Balanço Preliminar',
+ 'Vendors' => 'Distribuidores',
+ 'Version' => 'Versão',
+ 'localhost' => 'localhost /servidor local',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/br/oe b/sql-ledger/locale/br/oe
new file mode 100644
index 000000000..d9842707a
--- /dev/null
+++ b/sql-ledger/locale/br/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Adicionar',
+ 'Add Purchase Invoice' => 'Adicionar Fatura de Compra',
+ 'Add Purchase Order' => 'Adicionar Pedido de Compra',
+ 'Add Sales Invoice' => 'Adicionar Fatura de Venda',
+ 'Add Sales Order' => 'Adicionar Pedido de Venda',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => 'Tem certeza que quer APAGAR tal número de Pedido?',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Caixa/bandeja',
+ 'C' => 'F',
+ 'Cannot delete order!' => 'Não pode apagar pedido!',
+ 'Cannot save order!' => 'Não pode salvar pedido!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contato',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Curr' => 'Moeda',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente faltando!',
+ 'Customer not on file!' => 'Cliente não está no arquivo!',
+ 'Date' => 'Data',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Apagar',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Endereço de E-mail faltando!',
+ 'Edit Purchase Order' => 'Editar Pedido de Compra',
+ 'Edit Sales Order' => 'Editar Pedido de Venda',
+ 'Exchangerate' => 'Taxa de câmbio',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extendida',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'In-line' => 'em linha',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number missing!' => 'Número de Fatura não encontrado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Número faltando na linha',
+ 'O' => 'A',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Pedido',
+ 'Order Date' => 'Data de Pedido',
+ 'Order Date missing!' => 'Data de Pedido Faltando',
+ 'Order Number' => 'Pedido Número',
+ 'Order Number missing!' => 'Número de pedido faltando!',
+ 'Order deleted!' => 'Pedido apagado!',
+ 'Order saved!' => 'Pedido salvo!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empacotamento',
+ 'Packing List Date missing!' => 'Data da lista de empacotamento faltando!',
+ 'Packing List Number missing!' => 'Número da lista de empacotamento faltando!',
+ 'Part' => 'Parte',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projeto',
+ 'Project not on file!' => 'Projeto não está no arquivo!',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Qty' => 'Qtde',
+ 'Recd' => 'Recebidos',
+ 'Remaining' => 'Restante',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Pedido de Venda',
+ 'Sales Orders' => 'Pedidos de Venda',
+ 'Save' => 'Salvar',
+ 'Save as new' => 'Salvar como novo',
+ 'Screen' => 'Tela',
+ 'Select from one of the items below' => 'Selecione um dos ítens abaixo',
+ 'Select from one of the names below' => 'Selecione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Selecione um dos projetos abaixo',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Transportar',
+ 'Ship to' => 'Transportar para',
+ 'Ship via' => 'Transportar via',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Terms: Net' => 'Crédito Líquido',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Atualizar',
+ 'Vendor' => 'Distribuidor',
+ 'Vendor missing!' => 'Distribuidor faltando!',
+ 'Vendor not on file!' => 'Distribuidor não está no arquivo!',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'days' => 'Dias',
+ 'ea' => 'cada',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'adicionar' => 'add',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'fatura' => 'invoice',
+ 'imprimir' => 'print',
+ 'salvar' => 'save',
+ 'salvar_como_novo' => 'save_as_new',
+ 'transportar_para' => 'ship_to',
+ 'atualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/br/pe b/sql-ledger/locale/br/pe
new file mode 100644
index 000000000..1441b362f
--- /dev/null
+++ b/sql-ledger/locale/br/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Adicionar',
+ 'Add Project' => 'Adicionar projeto',
+ 'All' => 'Todas',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Apagar',
+ 'Description' => 'Descrição',
+ 'Edit Project' => 'Editar Projeto',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Ficaram órfãs',
+ 'Project' => 'Projeto',
+ 'Project Number missing!' => 'Número do Projeto faltando!',
+ 'Project deleted!' => 'Projeto apagado!',
+ 'Project saved!' => 'Projeto salvo!',
+ 'Projects' => 'Projetos',
+ 'Save' => 'Salvar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'adicionar' => 'add',
+ 'continuar' => 'continue',
+ 'apagar' => 'delete',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/br/rc b/sql-ledger/locale/br/rc
new file mode 100644
index 000000000..7fd872ba6
--- /dev/null
+++ b/sql-ledger/locale/br/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Balance' => 'Balanço',
+ 'Cleared Balance' => 'Balanço limpo',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Data',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descrição',
+ 'Difference' => 'Diferença',
+ 'Done' => 'Feito',
+ 'Exchangerate Difference' => 'Diferença da Taxa de Câmbio',
+ 'From' => 'De',
+ 'Out of balance!' => 'Fora de balanço!',
+ 'Payment' => 'Pagamento',
+ 'Reconciliation' => 'Reconciliação',
+ 'Select all' => 'Selecionar todos',
+ 'Source' => 'Fonte',
+ 'Statement Balance' => 'Declaração de Balanço',
+ 'To' => 'Até',
+ 'Update' => 'Atualizar',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'feito' => 'done',
+ 'selecionar_todos' => 'select_all',
+ 'atualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/br/rp b/sql-ledger/locale/br/rp
new file mode 100644
index 000000000..f441153d5
--- /dev/null
+++ b/sql-ledger/locale/br/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Contas a Pagar Vencidas',
+ 'AR Aging' => 'Contas a Receber Vencidas',
+ 'Account' => 'Conta',
+ 'Accounts' => 'Contas',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Baseado no Caixa',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar a',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Current',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Decimalplaces' => 'Casas decimais',
+ 'Description' => 'Descrição',
+ 'Due' => 'Saldo',
+ 'E-mail' => 'E-Mail',
+ 'E-mail Statement to' => 'Declaração enviada por email para',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'Heading' => 'Cabeçalho',
+ 'ID' => 'ID',
+ 'In-line' => 'em linha',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Invoice' => 'Fatura',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'N/A' => 'N/D',
+ 'Nothing selected!' => 'Nada foi selecionado!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagamentos',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Receipts' => 'Recibos',
+ 'Report for' => 'Relatório para',
+ 'Retained Earnings' => 'Lucros Retidos',
+ 'Screen' => 'Tela',
+ 'Select all' => 'Selecionar todos',
+ 'Select postscript or PDF!' => 'Selecionar Postscript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Fonte',
+ 'Standard' => 'Padrão',
+ 'Statement' => 'Declaração',
+ 'Statement sent to' => 'Declaração enviada para',
+ 'Statements sent to printer!' => 'Declaração enviada para impressora!',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balanço Preliminar',
+ 'Vendor' => 'Distribuidor',
+ 'as at' => 'como em',
+ 'collected on sales' => 'recolhido sobre vendas',
+ 'for Period' => 'pelo período',
+ 'paid on purchases' => 'pago em aquisições',
+ 'to' => 'para',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'imprimir' => 'print',
+ 'selecionar_todos' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/COPYING b/sql-ledger/locale/cn/COPYING
new file mode 100644
index 000000000..784c015ff
--- /dev/null
+++ b/sql-ledger/locale/cn/COPYING
@@ -0,0 +1,24 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Simplified Chinese texts:
+#
+# Author: Chien Hsin Chang <werther@elixus.org>
+# Autrijus Tang <autrijus@autrijus.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/cn/LANGUAGE b/sql-ledger/locale/cn/LANGUAGE
new file mode 100644
index 000000000..42c370886
--- /dev/null
+++ b/sql-ledger/locale/cn/LANGUAGE
@@ -0,0 +1 @@
+Simplified Chinese
diff --git a/sql-ledger/locale/cn/admin b/sql-ledger/locale/cn/admin
new file mode 100644
index 000000000..c8677871c
--- /dev/null
+++ b/sql-ledger/locale/cn/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => '?¨ÏÞ¿ØÖ?',
+ 'Accounting' => '»á¼Æ',
+ 'Add User' => 'ÐÂÔöʹÓÃÕß',
+ 'Address' => 'µØÖ·',
+ 'Administration' => 'ϵͳ¹ÜÀí',
+ 'Administrator' => 'ϵͳ¹ÜÀíÔ±',
+ 'All Datasets up to date!' => 'ËùÓÐ×ÊÁϽÔÒѸüÐÂ!',
+ 'Change Admin Password' => '¸ü¸Ä¹ÜÀíÔ±ÃÜÂë',
+ 'Change Password' => '¸ü¸ÄÃÜÂë',
+ 'Character Set' => '×ÖÔª¼¯',
+ 'Click on login name to edit!' => 'Çë°´µÇ?ëÃ?³ÆÒÔ½øÐÐÐÞ¸Ä!',
+ 'Company' => '¹«Ë¾Ãû³Æ',
+ 'Connect to' => 'Á¬½áµ½',
+ 'Continue' => '¼ÌÐø',
+ 'Create Chart of Accounts' => '½¨Á¢ÕÊ»§Í¼±í',
+ 'Create Dataset' => '½¨Á¢×ÊÁϼ¯',
+ 'DBI not installed!' => 'δ°²×° DBI Ä£×é!',
+ 'Database' => '×ÊÁÏ¿â',
+ 'Database Administration' => '×ÊÁÏ¿â¹ÜÀí',
+ 'Database Driver not checked!' => 'δѡ¶¨×ÊÁÏ¿â??¶¯³Ìʽ!',
+ 'Database User missing!' => 'δָÃ÷×ÊÁÏ¿âʹÓÃÕß!',
+ 'Dataset' => '×ÊÁϼ¯',
+ 'Dataset missing!' => 'δָÃ÷×ÊÁϼ¯!',
+ 'Dataset updated!' => '²¹³ä×îÐÂ×ÊÁϼ¯!',
+ 'Date Format' => 'ÈÕÆÚ¸ñʽ',
+ 'Delete' => 'ɾ³ý',
+ 'Delete Dataset' => 'ɾ³ý×ÊÁϼ¯',
+ 'Directory' => 'Ŀ¼',
+ 'Driver' => '??¶¯³Ìʽ',
+ 'Dropdown Limit' => 'ÏÞÖÆ×ÊÁÏÏÔʾ¹¦ÄÜ',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'Edit User' => '±à¼­Ê¹ÓÃÕß',
+ 'Existing Datasets' => '¼ÈÓеÄ×ÊÁϼ¯',
+ 'Fax' => '´«Õæ',
+ 'Host' => 'Ö÷»ú',
+ 'Hostname missing!' => 'δָÃ÷Ö÷»úÃû³Æ!',
+ 'Incorrect Password!' => 'ÃÜÂë´íÎó!',
+ 'Language' => 'Óïϵ',
+ 'Leave host and port field empty unless you want to make a remote connection.' => '³ý·ÇÄúÏëÒª½øÐÐÔ¶¶ËÁ¬Ïß, ·ñÔòÇ뽫Ö÷»ú¼°²ººÅÁô°×.',
+ 'Login' => 'µÇ??',
+ 'Multibyte Encoding' => 'Multibyte Encoding',
+ 'Name' => 'Ãû³Æ',
+ 'New Templates' => 'ÐÂÔöÄ£°æ',
+ 'No Database Drivers available!' => 'ûÓпÉÓõÄ??¶¯³Ìʽ!',
+ 'No Dataset selected!' => 'δѡ¶¨×ÊÁϼ¯!',
+ 'Nothing to delete!' => 'ûÓпÉɾ³ýµÄÏîÄ¿',
+ 'Number Format' => 'Êý×Ö¸ñʽ',
+ 'Oracle Database Administration' => 'Oracle ×ÊÁÏ¿â¹ÜÀí',
+ 'Password' => 'ÃÜÂë',
+ 'Password changed!' => 'ÃÜÂëÒѾ­¸ü¸Ä',
+ 'Pg Database Administration' => 'Pg ×ÊÁÏ¿â¹ÜÀí',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Port' => '²ººÅ',
+ 'Port missing!' => 'δָÃ÷²ººÅ!',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Save' => '´¢´æ',
+ 'Select a Dataset to delete and press "Continue"' => 'ÇëÑ¡ÔñÓûɾ³ýµÄ×ÊÁϼ¯, ÔÙ°´ "¼ÌÐø"',
+ 'Setup Templates' => 'É趨ģ°æ',
+ 'Ship via' => 'º½ÔË·½·¨',
+ 'Signature' => 'Ç©Ãû',
+ 'Stylesheet' => 'Ñùʽ±í',
+ 'Templates' => 'Ä£°æ',
+ 'The following Datasets are not in use and can be deleted' => 'ÏÂÁÐ×ÊÁϼ¯²¢Î´Ê¹ÓÃ, ¿ÉÒÔɾ³ý',
+ 'The following Datasets need to be updated' => 'ÏÂÁÐ×ÊÁϼ¯ÐèÒª¸üÐÂ',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'ÕâÊǶԼȴæ×ÊÁÏÀ´Ô´µÄ³õ²½¼ì²é. Ôڴ˽׶Î, ²»»áɾ³ý»òÐÂÔö?κÎ×ÊÁ?!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '?ôÒªÐÂÔöȺ×éÄÚµÄʹÓÃÕ?, Çë±à¼­Ãû³Æ, ¸ü¸ÄµÇ?ëÃ?, ?»ºó´¢´?. ÕâÑùÒ»À´, ÐÂʹÓÃÕ߻ᱣÁôÏàͬµÄ±äÊý, ²¢ÒÔеĵÇ?ëÃ?´æ??.',
+ 'Update Dataset' => '¸üÐÂ×ÊÁϼ¯',
+ 'Use Templates' => 'ʹÓÃÄ£°æ',
+ 'User' => 'ʹÓÃÕß',
+ 'User deleted!' => 'ʹÓÃÕßÒÔ±»É¾³ý!',
+ 'User saved!' => 'ʹÓÃÕßÒÔ±»´¢´æ!',
+ 'Version' => '°æ±¾',
+ 'You must enter a host and port for local and remote connections!' => 'Äú±ØÐè¼ü?ëÖ÷»?¼°²ººÅ, ÒÔ½øÐб¾»ú»òÔ¶¶ËÁ¬Ïß!',
+ 'does not exist' => '²»´æÔÚ',
+ 'is already a member!' => 'ÒѾ­ÊdzÉÔ±ÁË!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'locked!',
+ 'successfully created!' => '³É¹¦½¨Á¢!',
+ 'successfully deleted!' => '³É¹¦É¾³ý!',
+ 'website' => 'ÍøÕ¾',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'ÐÂÔöʹÓÃÕß' => 'add_user',
+ '¸ü¸Ä¹ÜÀíÔ±ÃÜÂë' => 'change_admin_password',
+ '¸ü¸ÄÃÜÂë' => 'change_password',
+ '¼ÌÐø' => 'continue',
+ '½¨Á¢×ÊÁϼ¯' => 'create_dataset',
+ 'ɾ³ý' => 'delete',
+ 'ɾ³ý×ÊÁϼ¯' => 'delete_dataset',
+ 'µÇ??' => 'login',
+ 'oracle_×ÊÁÏ¿â¹ÜÀí' => 'oracle_database_administration',
+ 'pg_×ÊÁÏ¿â¹ÜÀí' => 'pg_database_administration',
+ '´¢´æ' => 'save',
+ '¸üÐÂ×ÊÁϼ¯' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/all b/sql-ledger/locale/cn/all
new file mode 100644
index 000000000..6b01f1510
--- /dev/null
+++ b/sql-ledger/locale/cn/all
@@ -0,0 +1,495 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Ó¦¸¶ÕÊ¿î',
+ 'AP Aging' => 'Ó¦¸¶ÕÊÁä·ÖÎö',
+ 'AP Transaction' => 'Ó¦¸¶ÕÊÄ¿',
+ 'AP Transactions' => 'Ó¦¸¶ÕÊÄ¿',
+ 'AR' => 'Ó¦ÊÕÕÊ¿î',
+ 'AR Aging' => 'Ó¦ÊÕÕÊÁä·ÖÎö',
+ 'AR Transaction' => 'Ó¦ÊÕÕÊÄ¿',
+ 'AR Transactions' => 'Ó¦ÊÕÕÊÄ¿',
+ 'About' => '¹Øì¶',
+ 'Access Control' => '?¨ÏÞ¿ØÖ?',
+ 'Account' => '¿ÆÄ¿',
+ 'Account Number' => '¿ÆÄ¿±àºÅ',
+ 'Account Number missing!' => '©Ìî¿ÆÄ¿±àºÅ!',
+ 'Account Type' => '¿ÆÄ¿Àà±ð',
+ 'Account Type missing!' => '©Ìî¿ÆÄ¿Àà±ð!',
+ 'Account deleted!' => '¿ÆÄ¿ÒÔ±»É¾³ý!',
+ 'Account saved!' => '¿ÆÄ¿ÒÔ±»´¢´æ!',
+ 'Accounting' => '»á¼Æ',
+ 'Accounting Menu' => '»á¼ÆÑ¡µ¥',
+ 'Accounts' => 'ÕÊ»§',
+ 'Active' => '»îÔ¾',
+ 'Add' => 'ÐÂÔö',
+ 'Add Account' => 'ÐÂÔö¿ÆÄ¿',
+ 'Add Accounts Payables Transaction' => 'ÐÂÔöÓ¦¸¶ÕÊÄ¿',
+ 'Add Accounts Receivables Transaction' => 'ÐÂÔöÓ¦ÊÕÕÊÄ¿',
+ 'Add Assembly' => 'ÐÂÔöÉÌÆ·',
+ 'Add Customer' => 'ÐÂÔö¿Í»§',
+ 'Add GIFI' => 'ÐÂÔö GIFI',
+ 'Add General Ledger Transaction' => 'ÐÂÔö×ÜÕÊ',
+ 'Add Part' => 'ÐÂÔöÔ­ÁÏ',
+ 'Add Project' => 'ÐÂÔö¹¤³Ì',
+ 'Add Purchase Invoice' => 'ÐÂÔö²É¹º·¢Æ±',
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Invoice' => 'ÐÂÔöÏú»õ·¢Æ±',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Add Service' => 'ÐÂÔö·þÎñ',
+ 'Add Transaction' => 'ÐÂÔöÕÊÄ¿',
+ 'Add User' => 'ÐÂÔöʹÓÃÕß',
+ 'Add Vendor' => 'ÐÂÔö³§ÉÌ',
+ 'Address' => 'µØÖ·',
+ 'Administration' => 'ϵͳ¹ÜÀí',
+ 'Administrator' => 'ϵͳ¹ÜÀíÔ±',
+ 'All' => 'È«²¿',
+ 'All Datasets up to date!' => 'ËùÓÐ×ÊÁϽÔÒѸüÐÂ!',
+ 'Amount' => '×ܼÆ',
+ 'Amount Due' => 'µ½ÆÚµÄ×ܼÆ',
+ 'Amount does not equal applied!' => '×ܶÏàµÈ!',
+ 'Amount missing!' => 'δָÃ÷×ܶî!',
+ 'Applied' => 'Ö§¸¶',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Invoice Number' => 'ÄúÈ·¶¨ÒªÉ¾³ý·¢Æ±±àºÅ',
+ 'Are you sure you want to delete Order Number' => 'ÄúÊÇ·ñ?·¶¨ÒªÉ¾³?¶©µ¥',
+ 'Are you sure you want to delete Transaction' => 'ÄúÈ·¶¨ÒªÉ¾³ýÕÊÄ¿',
+ 'Assemblies' => 'ÉÌÆ·',
+ 'Assemblies restocked!' => '×°ÅäÖØÐ½ø»õ!',
+ 'Assembly Number missing!' => '²éÎÞ´ËÉÌÆ·!',
+ 'Asset' => '×ʲú',
+ 'Attachment' => '¸½µµ',
+ 'Audit Control' => '»üºË¿ØÖÆ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'BOM' => '²ÄÁÏÕʵ¥',
+ 'Backup' => '±¸·Ý',
+ 'Backup sent to' => '±¸·Ý¼ÄË͵½',
+ 'Balance' => '²î¶î',
+ 'Balance Sheet' => '×ʲú¸ºÕ®±í',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'Books are open' => 'Õʲ¾ÒÑ¿ªÆô',
+ 'Bought' => 'ÒѹºÂò',
+ 'Business Number' => 'ͳһ±àºÅ',
+ 'C' => 'C',
+ 'COGS' => '»õÏú³É±¾',
+ 'Cannot delete account!' => 'ÎÞ·¨É¾³ý¿ÆÄ¿!',
+ 'Cannot delete customer!' => '²»ÄÜɾ³ý¿Í»§!',
+ 'Cannot delete default account!' => 'ÎÞ·¨É¾³ýÔ¤ÉèÕʺÅ',
+ 'Cannot delete invoice!' => 'ÎÞ·¨É¾³ý·¢Æ±!',
+ 'Cannot delete item already invoiced!' => 'ÎÞ·¨É¾³ý±¾Ïî',
+ 'Cannot delete item on order!' => 'ÎÞ·¨É¾³ýµ¥ÉϵÄÏîÄ¿!',
+ 'Cannot delete item which is part of an assembly!' => 'ÎÞ·¨É¾³ýÓÃì¶ÉÌÆ·ÖеÄÔ­ÁÏ',
+ 'Cannot delete item!' => 'ÎÞ·¨É¾³ýÏîÄ¿!',
+ 'Cannot delete order!' => 'ÎÞ·¨É¾³ý¶©µ¥!',
+ 'Cannot delete transaction!' => 'ÎÞ·¨É¾³ýÕÊÄ¿!',
+ 'Cannot delete vendor!' => '²»ÄÜɾ³ý³§ÉÌ!',
+ 'Cannot have a value in both Debit and Credit!' => '²»µÃͬʱÌîÈëÊýֵ춽跽Óë´û·½À¸Î»',
+ 'Cannot post a transaction without a value!' => 'ÎÞ·¨È·ÈÏû¼Û¸ñÕÊÄ¿!',
+ 'Cannot post invoice for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚÈ·ÈÏ·¢Æ±?ë½»Ò!',
+ 'Cannot post invoice!' => 'ÎÞ·¨È·ÈÏ·¢Æ±!',
+ 'Cannot post payment for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post payment!' => 'ÎÞ·¨´¦Àí¸¶¿î!',
+ 'Cannot post transaction for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post transaction!' => 'ÎÞ·¨È·ÈÏÕÊÄ¿!',
+ 'Cannot process payment for a closed period!' => 'ÒѹرյÄʱ¶ÎÄÚ´¦Àí¸¶¿î!',
+ 'Cannot save account!' => 'ÎÞ·¨´¢´æ¿ÆÄ¿!',
+ 'Cannot save order!' => 'ÎÞ·¨´¢´æÇåµ¥!',
+ 'Cannot save preferences!' => 'ÎÞ·¨´¢´æÉ趨!',
+ 'Cannot stock assemblies!' => 'ÎÞ·¨É¾³ý×°ÅäÉÌÆ·!',
+ 'Cash' => 'ÏÖ½ð',
+ 'Cash based' => 'ÏÖ½ð½»Ò×',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => '¸ü¸Ä¹ÜÀíÔ±ÃÜÂë',
+ 'Change Password' => '¸ü¸ÄÃÜÂë',
+ 'Character Set' => '×ÖÔª¼¯',
+ 'Chart of Accounts' => '»á¼Æ¿ÆÄ¿±í',
+ 'Check' => '֧Ʊ',
+ 'Check printed!' => 'ӡˢ֧Ʊ!',
+ 'Check printing failed!' => 'ÎÞ·¨Ó¡Ë¢Ö§Æ±!',
+ 'Cleared Balance' => 'Ö§¸¶²î¶î×ÜÊý',
+ 'Click on login name to edit!' => 'Çë°´µÇ?ëÃ?³ÆÒÔ½øÐÐÐÞ¸Ä!',
+ 'Close Books up to' => '¹Ø±Õµ½´ËΪֹµÄÕʲ¾',
+ 'Closed' => 'ÒѹرÕ',
+ 'Company' => '¹«Ë¾Ãû³Æ',
+ 'Compare to' => '¶ÔÕÕ',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Connect to' => 'Á¬½áµ½',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Copy to COA' => '¸´ÖƵ½ COA',
+ 'Create Chart of Accounts' => '½¨Á¢ÕÊ»§Í¼±í',
+ 'Create Dataset' => '½¨Á¢×ÊÁϼ¯',
+ 'Credit' => '´û·½',
+ 'Credit Limit' => 'ÐÅÓöî¶È',
+ 'Curr' => 'Ŀǰ',
+ 'Currency' => '±Ò±ð',
+ 'Current' => 'ÏÖÔÚ',
+ 'Customer' => '¿Í»§',
+ 'Customer deleted!' => '¿Í»§¼Ç¼ɾ³ý!',
+ 'Customer missing!' => 'δָÃ÷¿Í»§!',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Customer saved!' => '¿Í»§¼Ç¼±£´æ!',
+ 'Customers' => '¿Í»§',
+ 'DBI not installed!' => 'δ°²×° DBI Ä£×é!',
+ 'Database' => '×ÊÁÏ¿â',
+ 'Database Administration' => '×ÊÁÏ¿â¹ÜÀí',
+ 'Database Driver not checked!' => 'δѡ¶¨×ÊÁÏ¿â??¶¯³Ìʽ!',
+ 'Database Host' => '×ÊÁÏ¿âÖ÷»ú',
+ 'Database User missing!' => 'δָÃ÷×ÊÁÏ¿âʹÓÃÕß!',
+ 'Dataset' => '×ÊÁϼ¯',
+ 'Dataset missing!' => 'δָÃ÷×ÊÁϼ¯!',
+ 'Dataset updated!' => '²¹³ä×îÐÂ×ÊÁϼ¯!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date Due' => 'Ó¦¸¶ÈÕÆÚ',
+ 'Date Format' => 'ÈÕÆÚ¸ñʽ',
+ 'Date Paid' => '¸¶¿îÈÕÆÚ',
+ 'Date missing!' => 'δָÃ÷ÈÕÆÚ',
+ 'Debit' => '½è·½',
+ 'Debit and credit out of balance!' => '½è´û²»Æ½ºâ!',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Decimalplaces' => 'СÊýµÄÊýÄ¿',
+ 'Delete' => 'ɾ³ý',
+ 'Delete Account' => 'ɾ³ý¿ÆÄ¿',
+ 'Delete Dataset' => 'ɾ³ý×ÊÁϼ¯',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Department' => '',
+ 'Deposit' => '´¢´æ',
+ 'Description' => '˵Ã÷',
+ 'Difference' => '²îÒì',
+ 'Directory' => 'Ŀ¼',
+ 'Discount' => 'ÕÛ¿Û',
+ 'Done' => 'Íê³É',
+ 'Drawing' => 'ͼ',
+ 'Driver' => '??¶¯³Ìʽ',
+ 'Dropdown Limit' => 'ÏÞÖÆ×ÊÁÏÏÔʾ¹¦ÄÜ',
+ 'Due' => 'µ½ÆÚ',
+ 'Due Date' => 'µ½ÆÚÈÕ',
+ 'Due Date missing!' => '©Ìîµ½ÆÚÈÕ!',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail Statement to' => 'µç×ÓÓʼþÕÊÄ¿³ÂÊöµ½',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Edit' => '±à¼­',
+ 'Edit Account' => '±à¼­¿ÆÄ¿',
+ 'Edit Accounts Payables Transaction' => '¸ü»»Ó¦¸¶ÕÊ¿îÕÊÄ¿',
+ 'Edit Accounts Receivables Transaction' => '¸ü»»Ó¦ÊÕÕÊ¿îÕÊÄ¿',
+ 'Edit Assembly' => '±à¼­ÉÌÆ·',
+ 'Edit Customer' => '±à¼­¿Í»§',
+ 'Edit GIFI' => '±à¼­ GIFI',
+ 'Edit General Ledger Transaction' => '±à¼­×ÜÕÊ',
+ 'Edit Part' => '±à¼­Ô­ÁÏ',
+ 'Edit Preferences for' => 'É趨ʹÓÃÕß',
+ 'Edit Project' => '¸ü¸Ä¹¤³Ì',
+ 'Edit Purchase Invoice' => '±à¼­²É¹º·¢Æ±',
+ 'Edit Purchase Order' => '±à¼­²É¹ºµ¥',
+ 'Edit Sales Invoice' => '±à¼­Ïú»õ·¢Æ±',
+ 'Edit Sales Order' => '±à¼­Ïú»õµ¥',
+ 'Edit Service' => '±à¼­·þÎñ',
+ 'Edit Template' => '±à¼­Ä£°æ',
+ 'Edit User' => '±à¼­Ê¹ÓÃÕß',
+ 'Edit Vendor' => '±à¼­³§ÉÌ',
+ 'Employee' => 'Ö°Ô±',
+ 'Enforce transaction reversal for all dates' => 'Ç¿ÖÆËùÓÐ?ÕÆÚµÄ½»Ò׻ظ?',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Çë¼ü?ëÒÔðºÅ·Ö¸ôµÄÓ?ÎÄ×Öĸ, ÿÏî²»³¬¹ý??¸ö×Ö (?? CAD:USD:EUR), ×÷ΪÄúµÄ±¾¹ú¼°Íâ¹ú»õ±Ò',
+ 'Equity' => '¹ÉȨ',
+ 'Exch' => '»ãÂÊ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate Difference' => '»ãÂʲîÒì',
+ 'Exchangerate for payment missing!' => 'δָÃ÷¸¶¿î»ãÂÊ!',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Existing Datasets' => '¼ÈÓеÄ×ÊÁϼ¯',
+ 'Expense' => '·ÑÓÃ',
+ 'Expense Account' => '·ÑÓÿÆÄ¿',
+ 'Expense/Asset' => '·ÑÓÃ/×ʲú',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'Foreign Exchange Gain' => 'Íâ»ãÊÕÒæ',
+ 'Foreign Exchange Loss' => 'Íâ»ãËðʧ',
+ 'From' => '´Ó',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI ¼Ç¼ɾ³ý',
+ 'GIFI missing!' => 'δָÃ÷ GIFI!',
+ 'GIFI saved!' => 'GIFI ¼Ç¼±£´æ',
+ 'GL Transaction' => '×ÜÕÊ',
+ 'General Ledger' => '×ÜÕÊ',
+ 'Goods & Services' => '',
+ 'HTML Templates' => 'HTML ±íµ¥',
+ 'Heading' => '±íÍ·',
+ 'Host' => 'Ö÷»ú',
+ 'Hostname missing!' => 'δָÃ÷Ö÷»úÃû³Æ!',
+ 'ID' => '񅧏',
+ 'Image' => 'ͼÏó',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Include in drop-down menus' => '°üº¬ÔÚÏÂÀ­Ê½Ñ¡µ¥ÖÐ',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Òª½«Õâ¸ö¿Í»§/³§É̼ÓÈëÓ¦¼Ó˰Çåµ¥?',
+ 'Income' => 'ÊÕÒæ',
+ 'Income Account' => 'ËðÒæ¿ÆÄ¿',
+ 'Income Statement' => 'ËðÒæ±í',
+ 'Incorrect Dataset version!' => '×ÊÁϼ¯°æ±¾´íÎó!',
+ 'Incorrect Password!' => 'ÃÜÂë´íÎó!',
+ 'Individual Items' => '×é³ÉÏîÄ¿',
+ 'Inventory' => '¿â´æ',
+ 'Inventory Account' => '´æ»õ¿ÆÄ¿',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'ÔÚÍ£ÓôËÏî×éºÏƷ֮ǰ, ´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Í£ÓôËÏîÁã¼þ֮ǰ, ´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Inventory quantity must be zero!' => '´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date' => '·¢Æ±ÈÕÆÚ',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Invoice deleted!' => '·¢Æ±É¾³ý!',
+ 'Invoice posted!' => '·¢Æ±È·ÈÏ!',
+ 'Invoices' => '·¢Æ±',
+ 'Is this a summary account to record' => '´ËΪ×Ü½á¿ÆÄ¿Âð?',
+ 'Item deleted!' => 'ÏîĿɾ³ý!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'LaTeX Templates' => 'LaTex Ä£°æ',
+ 'Language' => 'Óïϵ',
+ 'Last Cost' => 'ÉÏÒ»±Ê³É±¾',
+ 'Last Invoice Number' => 'ÉÏÒ»±Ê·¢Æ±±àºÅ',
+ 'Last Numbers & Default Accounts' => 'ÉÏÒ»±Ê±àºÅ¼°Ô¤Éè¿ÆÄ¿',
+ 'Last Purchase Order Number' => 'ǰ´Î²É¹ºµ¥ºÅ',
+ 'Last Sales Order Number' => 'ǰ´ÎÏú',
+ 'Leave host and port field empty unless you want to make a remote connection.' => '³ý·ÇÄúÏëÒª½øÐÐÔ¶¶ËÁ¬Ïß, ·ñÔòÇ뽫Ö÷»ú¼°²ººÅÁô°×.',
+ 'Liability' => '¸ºÕ®',
+ 'Licensed to' => 'ÊÚȨÓè',
+ 'Line Total' => '×ÜÁÐÊý',
+ 'Link' => 'Á¬½á',
+ 'Link Accounts' => 'Á¬½á¿ÆÄ¿',
+ 'List Accounts' => 'ÁгöÕʺÅ',
+ 'List GIFI' => 'Áгö GIFI',
+ 'List Price' => '',
+ 'List Transactions' => 'ÁгöÕÊÄ¿',
+ 'Login' => 'µÇ??',
+ 'Logout' => 'µÇ³ö',
+ 'Make' => 'ÖÆÔì',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Microfiche' => 'Ëõ΢½ºÆ¬',
+ 'Model' => 'ÐͺÅ',
+ 'Multibyte Encoding' => '',
+ 'N/A' => '²»ÊÊÓÃ',
+ 'Name' => 'Ãû³Æ',
+ 'Name missing!' => 'ȱÉÙÃû³Æ!',
+ 'New Templates' => 'ÐÂÔöÄ£°æ',
+ 'No' => '·ñ',
+ 'No Database Drivers available!' => 'ûÓпÉÓõÄ??¶¯³Ìʽ!',
+ 'No Dataset selected!' => 'δѡ¶¨×ÊÁϼ¯!',
+ 'No email address for' => 'δָÃ÷µç×ÓÓʼþλÖÃ',
+ 'No.' => '񅧏',
+ 'Notes' => '±¸×¢',
+ 'Nothing applied!' => 'δָÃ÷Ö§¸¶×ܶî!',
+ 'Nothing selected!' => 'δѡ¶¨×Ê!',
+ 'Nothing to delete!' => 'ûÓпÉɾ³ýµÄÏîÄ¿',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number Format' => 'Êý×Ö¸ñʽ',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'O' => 'O',
+ 'Obsolete' => 'Í£ÓÃ',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'On Hand' => '´æÁ¿',
+ 'On Order' => 'ÒÑϵ¥¶©¹º',
+ 'Open' => '¿ªÆô',
+ 'Oracle Database Administration' => 'Oracle ×ÊÁÏ¿â¹ÜÀí',
+ 'Order' => '¶©µ¥',
+ 'Order Date' => '쵴?ͮ?',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Entry' => 'ϵ¥ÏîÄ¿',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'Order deleted!' => 'ɾ³ý¶©µ¥!',
+ 'Order saved!' => '´¢´æ¶©µ¥!',
+ 'Ordered' => 'ÒÑ϶©¹º',
+ 'Orphaned' => 'ÎÞÖ÷',
+ 'Out of balance!' => '³öÓÚ²î¶î!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Paid' => 'ÒѸ¶',
+ 'Paid in full' => 'Ö§¸¶È«²¿×ܶî',
+ 'Part' => 'Ô­ÁÏ',
+ 'Part Number missing!' => '©ÌîÔ­ÁϱàºÅ!',
+ 'Parts' => 'Ô­ÁÏ',
+ 'Parts Inventory' => '¿â´æÔ­ÁÏ',
+ 'Password' => 'ÃÜÂë',
+ 'Password changed!' => 'ÃÜÂëÒѾ­¸ü¸Ä',
+ 'Payables' => 'Ó¦¸¶¿ÆÄ¿',
+ 'Payment' => '¸¶¿î·½Ê½',
+ 'Payment date missing!' => 'δָÃ÷¸¶¿î?ÕÆ?!',
+ 'Payment posted!' => '',
+ 'Payments' => '¸¶¿î',
+ 'Pg Database Administration' => 'Pg ×ÊÁÏ¿â¹ÜÀí',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Port' => '²ººÅ',
+ 'Port missing!' => 'δָÃ÷²ººÅ!',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => '¸öÈËÉ趨',
+ 'Preferences saved!' => '¸öÈËÉ趨ÒÑ´¢´æ!',
+ 'Price' => '¼Û¸ñ',
+ 'Print' => 'Ó¡Ë¢',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'δָÃ÷¹¤³ÌºÅÂë!',
+ 'Project deleted!' => '¹¤³ÌÒÔ±»É¾³ý!',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Project saved!' => '¹¤³ÌÒÔ±»´¢´æ!',
+ 'Projects' => '¹¤³Ì',
+ 'Purchase Invoice' => '²É¹º·¢Æ±',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Purchase Orders' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'ROP' => 'ÔÙ¶©µã',
+ 'Rate' => '˰ÂÊ',
+ 'Recd' => 'Recd',
+ 'Receipt' => 'ÊÕ¾Ý',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'ÊÕ¾Ý',
+ 'Receivables' => 'Ó¦ÊÕ¿ÆÄ¿',
+ 'Reconciliation' => 'µ÷Í£',
+ 'Record in' => '¼Ç¼ì¶',
+ 'Reference' => '²Î¿¼ºÅÂë',
+ 'Reference missing!' => 'δָÃ÷²Î¿¼ºÅÂë!',
+ 'Remaining' => 'ÉÐâÅ',
+ 'Report for' => '±¨±íÀ´Ô´',
+ 'Reports' => '±¨±í',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Retained Earnings' => '±£ÁôÓ¯âÅ',
+ 'Sales' => 'ÒµÎñ',
+ 'Sales Invoice' => 'Ïú»õ·¢Æ±',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Sales Orders' => 'Ïú»õµ¥',
+ 'Save' => '´¢´æ',
+ 'Save as new' => '´¢´æ',
+ 'Save to File' => '´¢´æÖÁµµ°¸',
+ 'Screen' => 'Ó©Ä»',
+ 'Select a Dataset to delete and press "Continue"' => 'ÇëÑ¡ÔñÓûɾ³ýµÄ×ÊÁϼ¯, ÔÙ°´ "¼ÌÐø"',
+ 'Select all' => 'Ñ¡ÔñÈ«²¿',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sell Price' => 'ÊÛ¼Û',
+ 'Send by E-Mail' => 'ÒÔµç×ÓÓʼþ¼ÄËÍ',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Service Items' => '·þÎñÏîÄ¿',
+ 'Service Number missing!' => '©Ìî·þÎñ±àºÅ!',
+ 'Services' => '·þÎñ',
+ 'Setup Templates' => 'É趨ģ°æ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Ship via' => 'º½ÔË·½·¨',
+ 'Short' => '¶Ì',
+ 'Signature' => 'Ç©Ãû',
+ 'Sold' => 'ÒÑÂô³ö',
+ 'Source' => 'À´Ô´',
+ 'Standard' => '±ê×¼',
+ 'Statement' => 'ÕÊÄ¿³ÂÊö',
+ 'Statement Balance' => 'ÕÊÄ¿³ÂÊö²î¶î',
+ 'Statement sent to' => 'ÕÊÄ¿³ÂÊöË͵½',
+ 'Statements sent to printer!' => 'ÕÊÄ¿³ÂÊöË͵½Ó¡±í»ú!',
+ 'Stock Assembly' => 'Å̵ã',
+ 'Stylesheet' => 'Ñùʽ±í',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'System' => 'ϵͳ',
+ 'Tax' => '˰½ð',
+ 'Tax Accounts' => '˰½ð¿ÆÄ¿',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'Tax collected' => 'ÊÕµ½µÄ˰',
+ 'Tax paid' => 'Ö§¸¶µÄ˰',
+ 'Taxable' => 'Ӧ˰',
+ 'Template saved!' => 'Ä£°æÒÑ´¢´æ',
+ 'Templates' => 'Ä£°æ',
+ 'Terms: Net' => 'ƱÆÚ¾»¼Æ',
+ 'The following Datasets are not in use and can be deleted' => 'ÏÂÁÐ×ÊÁϼ¯²¢Î´Ê¹ÓÃ, ¿ÉÒÔɾ³ý',
+ 'The following Datasets need to be updated' => 'ÏÂÁÐ×ÊÁϼ¯ÐèÒª¸üÐÂ',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'ÕâÊǶԼȴæ×ÊÁÏÀ´Ô´µÄ³õ²½¼ì²é. Ôڴ˽׶Î, ²»»áɾ³ý»òÐÂÔö?κÎ×ÊÁ?!',
+ 'To' => 'ÖÁ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '?ôÒªÐÂÔöȺ×éÄÚµÄʹÓÃÕ?, Çë±à¼­Ãû³Æ, ¸ü¸ÄµÇ?ëÃ?, ?»ºó´¢´?. ÕâÑùÒ»À´, ÐÂʹÓÃÕ߻ᱣÁôÏàͬµÄ±äÊý, ²¢ÒÔеĵÇ?ëÃ?´æ??.',
+ 'Top Level' => '×î¸ßµÈ¼¶',
+ 'Total' => '×ܼÆ',
+ 'Transaction Date missing!' => '©ÌîÕÊÄ¿ÈÕÆÚ!',
+ 'Transaction deleted!' => 'ÕÊĿɾ³ý!',
+ 'Transaction posted!' => 'ÕÊĿȷÈÏ!',
+ 'Transaction reversal enforced for all dates' => 'Ç¿ÖÆ»Ø¸´ËùÓÐ?ÕÆÚµÄ½»Ò?',
+ 'Transaction reversal enforced up to' => 'Ç¿ÖÆ»Ø¸´½»Ò×Ö±µ½',
+ 'Transactions' => 'ÕÊÄ¿',
+ 'Transactions exist, cannot delete customer!' => '´Ë¿Í»§ÒÑÓÐÕÊÄ¿, ²»ÄÜɾ³ý!',
+ 'Transactions exist, cannot delete vendor!' => '´Ë³§ÉÌÒÑÓÐÕÊÄ¿, ²»ÄÜɾ³ý!',
+ 'Transactions exist; cannot delete account!' => 'ÉÐÓн»Ò×´æÔÚ; ÎÞ·¨É¾³ýÕÊ»§!',
+ 'Trial Balance' => 'ÊÔËã±í',
+ 'Unit' => 'µ¥Î»',
+ 'Unit of measure' => '¶ÈÁ¿µ¥Î»',
+ 'Update' => '¸üÐÂ',
+ 'Update Dataset' => '¸üÐÂ×ÊÁϼ¯',
+ 'Updated' => 'ÒѸüÐÂ',
+ 'Use Templates' => 'ʹÓÃÄ£°æ',
+ 'User' => 'ʹÓÃÕß',
+ 'User deleted!' => 'ʹÓÃÕßÒÔ±»É¾³ý!',
+ 'User saved!' => 'ʹÓÃÕßÒÔ±»´¢´æ!',
+ 'Vendor' => '³§ÉÌ',
+ 'Vendor deleted!' => '³§ÉÌɾ³ý!',
+ 'Vendor missing!' => 'δָÃ÷³§ÉÌ!',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'Vendor saved!' => '³§É̱£´æ!',
+ 'Vendors' => '³§ÉÌ',
+ 'Version' => '°æ±¾',
+ 'Weight' => 'ÖØÁ¿',
+ 'Weight Unit' => 'ÖØÁ¿µ¥Î»',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'Year End' => '»á¼ÆÄê¶È',
+ 'Yes' => 'ÊÇ',
+ 'You are logged out!' => 'ÄãÒԵdzö!',
+ 'You did not enter a name!' => 'Äú²¢Î´¼ü?ëÃ?³Æ!',
+ 'You must enter a host and port for local and remote connections!' => 'Äú±ØÐè¼ü?ëÖ÷»?¼°²ººÅ, ÒÔ½øÐб¾»ú»òÔ¶¶ËÁ¬Ïß!',
+ 'as at' => '¸ù¾Ý',
+ 'collected on sales' => 'ÔÚÏú»õʱ½áÇå',
+ 'days' => 'ÈÕ',
+ 'does not exist' => '²»´æÔÚ',
+ 'ea' => '',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'for Period' => 'ÆÚ¼ä',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ÒѾ­ÊdzÉÔ±ÁË!',
+ 'is not a member!' => '²¢²»ÊdzÉÔ±!',
+ 'localhost' => 'localhost',
+ 'locked!' => '',
+ 'paid on purchases' => 'ÔڲɹºÊ±½áÇå',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+ 'successfully created!' => '³É¹¦½¨Á¢!',
+ 'successfully deleted!' => '³É¹¦É¾³ý!',
+ 'to' => 'ÖÁ',
+ 'website' => 'ÍøÕ¾',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/am b/sql-ledger/locale/cn/am
new file mode 100644
index 000000000..610d7dd0a
--- /dev/null
+++ b/sql-ledger/locale/cn/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Ó¦¸¶ÕÊ¿î',
+ 'AR' => 'Ó¦ÊÕÕÊ¿î',
+ 'Account' => '¿ÆÄ¿',
+ 'Account Number' => '¿ÆÄ¿±àºÅ',
+ 'Account Number missing!' => '©Ìî¿ÆÄ¿±àºÅ!',
+ 'Account Type' => '¿ÆÄ¿Àà±ð',
+ 'Account Type missing!' => '©Ìî¿ÆÄ¿Àà±ð!',
+ 'Account deleted!' => '¿ÆÄ¿ÒÔ±»É¾³ý!',
+ 'Account saved!' => '¿ÆÄ¿ÒÔ±»´¢´æ!',
+ 'Add Account' => 'ÐÂÔö¿ÆÄ¿',
+ 'Add GIFI' => 'ÐÂÔö GIFI',
+ 'Address' => 'µØÖ·',
+ 'Asset' => '×ʲú',
+ 'Audit Control' => '»üºË¿ØÖÆ',
+ 'Backup sent to' => '±¸·Ý¼ÄË͵½',
+ 'Books are open' => 'Õʲ¾ÒÑ¿ªÆô',
+ 'Business Number' => 'ͳһ±àºÅ',
+ 'COGS' => '»õÏú³É±¾',
+ 'Cannot delete account!' => 'ÎÞ·¨É¾³ý¿ÆÄ¿!',
+ 'Cannot delete default account!' => 'ÎÞ·¨É¾³ýÔ¤ÉèÕʺÅ',
+ 'Cannot save account!' => 'ÎÞ·¨´¢´æ¿ÆÄ¿!',
+ 'Cannot save preferences!' => 'ÎÞ·¨´¢´æÉ趨!',
+ 'Character Set' => '×ÖÔª¼¯',
+ 'Chart of Accounts' => '»á¼Æ¿ÆÄ¿±í',
+ 'Close Books up to' => '¹Ø±Õµ½´ËΪֹµÄÕʲ¾',
+ 'Company' => '¹«Ë¾Ãû³Æ',
+ 'Continue' => '¼ÌÐø',
+ 'Copy to COA' => '¸´ÖƵ½ COA',
+ 'Credit' => '´û·½',
+ 'Date Format' => 'ÈÕÆÚ¸ñʽ',
+ 'Debit' => '½è·½',
+ 'Delete' => 'ɾ³ý',
+ 'Delete Account' => 'ɾ³ý¿ÆÄ¿',
+ 'Description' => '˵Ã÷',
+ 'Dropdown Limit' => 'ÏÞÖÆ×ÊÁÏÏÔʾ¹¦ÄÜ',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'Edit' => '±à¼­',
+ 'Edit Account' => '±à¼­¿ÆÄ¿',
+ 'Edit GIFI' => '±à¼­ GIFI',
+ 'Edit Preferences for' => 'É趨ʹÓÃÕß',
+ 'Edit Template' => '±à¼­Ä£°æ',
+ 'Enforce transaction reversal for all dates' => 'Ç¿ÖÆËùÓÐ?ÕÆÚµÄ½»Ò׻ظ?',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Çë¼ü?ëÒÔðºÅ·Ö¸ôµÄÓ?ÎÄ×Öĸ, ÿÏî²»³¬¹ý??¸ö×Ö (?? CAD:USD:EUR), ×÷ΪÄúµÄ±¾¹ú¼°Íâ¹ú»õ±Ò',
+ 'Equity' => '¹ÉȨ',
+ 'Expense' => '·ÑÓÃ',
+ 'Expense Account' => '·ÑÓÿÆÄ¿',
+ 'Expense/Asset' => '·ÑÓÃ/×ʲú',
+ 'Fax' => '´«Õæ',
+ 'Foreign Exchange Gain' => 'Íâ»ãÊÕÒæ',
+ 'Foreign Exchange Loss' => 'Íâ»ãËðʧ',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI ¼Ç¼ɾ³ý',
+ 'GIFI missing!' => 'δָÃ÷ GIFI!',
+ 'GIFI saved!' => 'GIFI ¼Ç¼±£´æ',
+ 'Heading' => '±íÍ·',
+ 'Include in drop-down menus' => '°üº¬ÔÚÏÂÀ­Ê½Ñ¡µ¥ÖÐ',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Òª½«Õâ¸ö¿Í»§/³§É̼ÓÈëÓ¦¼Ó˰Çåµ¥?',
+ 'Income' => 'ÊÕÒæ',
+ 'Income Account' => 'ËðÒæ¿ÆÄ¿',
+ 'Inventory' => '¿â´æ',
+ 'Inventory Account' => '´æ»õ¿ÆÄ¿',
+ 'Is this a summary account to record' => '´ËΪ×Ü½á¿ÆÄ¿Âð?',
+ 'Language' => 'Óïϵ',
+ 'Last Invoice Number' => 'ÉÏÒ»±Ê·¢Æ±±àºÅ',
+ 'Last Numbers & Default Accounts' => 'ÉÏÒ»±Ê±àºÅ¼°Ô¤Éè¿ÆÄ¿',
+ 'Last Purchase Order Number' => 'ǰ´Î²É¹ºµ¥ºÅ',
+ 'Last Sales Order Number' => 'ǰ´ÎÏú',
+ 'Liability' => '¸ºÕ®',
+ 'Link' => 'Á¬½á',
+ 'Name' => 'Ãû³Æ',
+ 'No' => '·ñ',
+ 'No email address for' => 'δָÃ÷µç×ÓÓʼþλÖÃ',
+ 'Number' => '񅧏',
+ 'Number Format' => 'Êý×Ö¸ñʽ',
+ 'Parts Inventory' => '¿â´æÔ­ÁÏ',
+ 'Password' => 'ÃÜÂë',
+ 'Payables' => 'Ó¦¸¶¿ÆÄ¿',
+ 'Payment' => '¸¶¿î·½Ê½',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Preferences saved!' => '¸öÈËÉ趨ÒÑ´¢´æ!',
+ 'Rate' => '˰ÂÊ',
+ 'Receivables' => 'Ó¦ÊÕ¿ÆÄ¿',
+ 'Sales' => 'ÒµÎñ',
+ 'Save' => '´¢´æ',
+ 'Service Items' => '·þÎñÏîÄ¿',
+ 'Ship via' => 'º½ÔË·½·¨',
+ 'Signature' => 'Ç©Ãû',
+ 'Stylesheet' => 'Ñùʽ±í',
+ 'Tax' => '˰½ð',
+ 'Tax Accounts' => '˰½ð¿ÆÄ¿',
+ 'Template saved!' => 'Ä£°æÒÑ´¢´æ',
+ 'Transaction reversal enforced for all dates' => 'Ç¿ÖÆ»Ø¸´ËùÓÐ?ÕÆÚµÄ½»Ò?',
+ 'Transaction reversal enforced up to' => 'Ç¿ÖÆ»Ø¸´½»Ò×Ö±µ½',
+ 'Transactions exist; cannot delete account!' => 'ÉÐÓн»Ò×´æÔÚ; ÎÞ·¨É¾³ýÕÊ»§!',
+ 'Weight Unit' => 'ÖØÁ¿µ¥Î»',
+ 'Year End' => '»á¼ÆÄê¶È',
+ 'Yes' => 'ÊÇ',
+ 'does not exist' => '²»´æÔÚ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'ÐÂÔö¿ÆÄ¿' => 'add_account',
+ '¼ÌÐø' => 'continue',
+ '¸´ÖƵ½_coa' => 'copy_to_coa',
+ 'ɾ³ý' => 'delete',
+ '±à¼­' => 'edit',
+ '±à¼­¿ÆÄ¿' => 'edit_account',
+ '´¢´æ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ap b/sql-ledger/locale/cn/ap
new file mode 100644
index 000000000..03dc72cdc
--- /dev/null
+++ b/sql-ledger/locale/cn/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ó¦¸¶ÕÊÄ¿',
+ 'AP Transactions' => 'Ó¦¸¶ÕÊÄ¿',
+ 'Account' => '¿ÆÄ¿',
+ 'Add Accounts Payables Transaction' => 'ÐÂÔöÓ¦¸¶ÕÊÄ¿',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Amount Due' => 'µ½ÆÚµÄ×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Transaction' => 'ÄúÈ·¶¨ÒªÉ¾³ýÕÊÄ¿',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Cannot delete transaction!' => 'ÎÞ·¨É¾³ýÕÊÄ¿!',
+ 'Cannot post payment for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post transaction for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post transaction!' => 'ÎÞ·¨È·ÈÏÕÊÄ¿!',
+ 'Closed' => 'ÒѹرÕ',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Continue' => '¼ÌÐø',
+ 'Currency' => '±Ò±ð',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date Paid' => '¸¶¿îÈÕÆÚ',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Description' => '˵Ã÷',
+ 'Due Date' => 'µ½ÆÚÈÕ',
+ 'Due Date missing!' => '©Ìîµ½ÆÚÈÕ!',
+ 'Edit Accounts Payables Transaction' => '¸ü»»Ó¦¸¶ÕÊ¿îÕÊÄ¿',
+ 'Employee' => 'Ö°Ô±',
+ 'Exch' => '»ãÂÊ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate for payment missing!' => 'δָÃ÷¸¶¿î»ãÂÊ!',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'ID' => '񅧏',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date' => '·¢Æ±ÈÕÆÚ',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Open' => '¿ªÆô',
+ 'Order' => '¶©µ¥',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Paid' => 'ÒѸ¶',
+ 'Payment date missing!' => 'δָÃ÷¸¶¿î?ÕÆ?!',
+ 'Payments' => '¸¶¿î',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Purchase Invoice' => '²É¹º·¢Æ±',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Source' => 'À´Ô´',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax' => '˰½ð',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'Total' => '×ܼÆ',
+ 'Transaction deleted!' => 'ÕÊĿɾ³ý!',
+ 'Transaction posted!' => 'ÕÊĿȷÈÏ!',
+ 'Update' => '¸üÐÂ',
+ 'Vendor' => '³§ÉÌ',
+ 'Vendor missing!' => 'δָÃ÷³§ÉÌ!',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'Yes' => 'ÊÇ',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'Ó¦¸¶ÕÊÄ¿' => 'ap_transaction',
+ 'ÐÂÔöÓ¦¸¶ÕÊÄ¿' => 'add_accounts_payables_transaction',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '¸ü»»Ó¦¸¶ÕÊ¿îÕÊÄ¿' => 'edit_accounts_payables_transaction',
+ 'È·ÈÏ' => 'post',
+ 'È·ÈϳÉΪÐÂÕÊÄ¿' => 'post_as_new',
+ '²É¹º·¢Æ±' => 'purchase_invoice',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ar b/sql-ledger/locale/cn/ar
new file mode 100644
index 000000000..f6fb3ffcf
--- /dev/null
+++ b/sql-ledger/locale/cn/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Ó¦ÊÕÕÊÄ¿',
+ 'AR Transactions' => 'Ó¦ÊÕÕÊÄ¿',
+ 'Account' => '¿ÆÄ¿',
+ 'Add Accounts Receivables Transaction' => 'ÐÂÔöÓ¦ÊÕÕÊÄ¿',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Amount Due' => 'µ½ÆÚµÄ×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Transaction' => 'ÄúÈ·¶¨ÒªÉ¾³ýÕÊÄ¿',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Cannot delete transaction!' => 'ÎÞ·¨É¾³ýÕÊÄ¿!',
+ 'Cannot post payment for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post transaction for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cannot post transaction!' => 'ÎÞ·¨È·ÈÏÕÊÄ¿!',
+ 'Closed' => 'ÒѹرÕ',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Continue' => '¼ÌÐø',
+ 'Credit Limit' => 'ÐÅÓöî¶È',
+ 'Currency' => '±Ò±ð',
+ 'Customer' => '¿Í»§',
+ 'Customer missing!' => 'δָÃ÷¿Í»§!',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date Paid' => '¸¶¿îÈÕÆÚ',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Description' => '˵Ã÷',
+ 'Due Date' => 'µ½ÆÚÈÕ',
+ 'Due Date missing!' => '©Ìîµ½ÆÚÈÕ!',
+ 'Edit Accounts Receivables Transaction' => '¸ü»»Ó¦ÊÕÕÊ¿îÕÊÄ¿',
+ 'Employee' => 'Ö°Ô±',
+ 'Exch' => '»ãÂÊ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate for payment missing!' => 'δָÃ÷¸¶¿î»ãÂÊ!',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'ID' => '񅧏',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date' => '·¢Æ±ÈÕÆÚ',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Open' => '¿ªÆô',
+ 'Order' => '¶©µ¥',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Paid' => 'ÒѸ¶',
+ 'Payment date missing!' => 'δָÃ÷¸¶¿î?ÕÆ?!',
+ 'Payments' => '¸¶¿î',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Remaining' => 'ÉÐâÅ',
+ 'Sales Invoice' => 'Ïú»õ·¢Æ±',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Source' => 'À´Ô´',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax' => '˰½ð',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'Total' => '×ܼÆ',
+ 'Transaction deleted!' => 'ÕÊĿɾ³ý!',
+ 'Transaction posted!' => 'ÕÊĿȷÈÏ!',
+ 'Update' => '¸üÐÂ',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'Yes' => 'ÊÇ',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'Ó¦ÊÕÕÊÄ¿' => 'ar_transaction',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ 'È·ÈÏ' => 'post',
+ 'È·ÈϳÉΪÐÂÕÊÄ¿' => 'post_as_new',
+ 'Ïú»õ·¢Æ±' => 'sales_invoice',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/arap b/sql-ledger/locale/cn/arap
new file mode 100644
index 000000000..a6a39750e
--- /dev/null
+++ b/sql-ledger/locale/cn/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'µØÖ·',
+ 'Continue' => '¼ÌÐø',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Description' => '˵Ã÷',
+ 'Number' => '񅧏',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ '¼ÌÐø' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ca b/sql-ledger/locale/cn/ca
new file mode 100644
index 000000000..91587fbc9
--- /dev/null
+++ b/sql-ledger/locale/cn/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => '¿ÆÄ¿',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Balance' => '²î¶î',
+ 'Chart of Accounts' => '»á¼Æ¿ÆÄ¿±í',
+ 'Credit' => '´û·½',
+ 'Date' => 'ÈÕÆÚ',
+ 'Debit' => '½è·½',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Description' => '˵Ã÷',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'List Transactions' => 'ÁгöÕÊÄ¿',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Reference' => '²Î¿¼ºÅÂë',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Subtotal' => 'С¼Æ',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'ÁгöÕÊÄ¿' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/cp b/sql-ledger/locale/cn/cp
new file mode 100644
index 000000000..fb357dc70
--- /dev/null
+++ b/sql-ledger/locale/cn/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => '¿ÆÄ¿',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Amount does not equal applied!' => '×ܶÏàµÈ!',
+ 'Amount missing!' => 'δָÃ÷×ܶî!',
+ 'Applied' => 'Ö§¸¶',
+ 'Cannot post payment!' => 'ÎÞ·¨´¦Àí¸¶¿î!',
+ 'Cannot process payment for a closed period!' => 'ÒѹرյÄʱ¶ÎÄÚ´¦Àí¸¶¿î!',
+ 'Check' => '֧Ʊ',
+ 'Check printed!' => 'ӡˢ֧Ʊ!',
+ 'Check printing failed!' => 'ÎÞ·¨Ó¡Ë¢Ö§Æ±!',
+ 'Continue' => '¼ÌÐø',
+ 'Currency' => '±Ò±ð',
+ 'Customer' => '¿Í»§',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date missing!' => 'δָÃ÷ÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'Due' => 'µ½ÆÚ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'From' => '´Ó',
+ 'Invoice' => '·¢Æ±',
+ 'Invoices' => '·¢Æ±',
+ 'Nothing applied!' => 'δָÃ÷Ö§¸¶×ܶî!',
+ 'Number' => '񅧏',
+ 'Paid in full' => 'Ö§¸¶È«²¿×ܶî',
+ 'Payment' => '¸¶¿î·½Ê½',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'È·ÈÏ',
+ 'Print' => 'Ó¡Ë¢',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Receipt' => 'ÊÕ¾Ý',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => '²Î¿¼ºÅÂë',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Update' => '¸üÐÂ',
+ 'Vendor' => '³§ÉÌ',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ '¼ÌÐø' => 'continue',
+ 'È·ÈÏ' => 'post',
+ 'Ó¡Ë¢' => 'print',
+ '¸üÐÂ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ct b/sql-ledger/locale/cn/ct
new file mode 100644
index 000000000..7793fea4c
--- /dev/null
+++ b/sql-ledger/locale/cn/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'ÐÂÔö',
+ 'Address' => 'µØÖ·',
+ 'All' => 'È«²¿',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => '²»ÄÜɾ³ý¿Í»§!',
+ 'Cannot delete vendor!' => '²»ÄÜɾ³ý³§ÉÌ!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Credit Limit' => 'ÐÅÓöî¶È',
+ 'Customer deleted!' => '¿Í»§¼Ç¼ɾ³ý!',
+ 'Customer saved!' => '¿Í»§¼Ç¼±£´æ!',
+ 'Customers' => '¿Í»§',
+ 'Delete' => 'ɾ³ý',
+ 'Discount' => 'ÕÛ¿Û',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'Edit Customer' => '±à¼­¿Í»§',
+ 'Edit Vendor' => '±à¼­³§ÉÌ',
+ 'Fax' => '´«Õæ',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Invoice' => '·¢Æ±',
+ 'Name' => 'Ãû³Æ',
+ 'Name missing!' => 'ȱÉÙÃû³Æ!',
+ 'Notes' => '±¸×¢',
+ 'Number' => '񅧏',
+ 'Order' => '¶©µ¥',
+ 'Orphaned' => 'ÎÞÖ÷',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Save' => '´¢´æ',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'Taxable' => 'Ӧ˰',
+ 'Terms: Net' => 'ƱÆÚ¾»¼Æ',
+ 'Transactions exist, cannot delete customer!' => '´Ë¿Í»§ÒÑÓÐÕÊÄ¿, ²»ÄÜɾ³ý!',
+ 'Transactions exist, cannot delete vendor!' => '´Ë³§ÉÌÒÑÓÐÕÊÄ¿, ²»ÄÜɾ³ý!',
+ 'Vendor deleted!' => '³§ÉÌɾ³ý!',
+ 'Vendor saved!' => '³§É̱£´æ!',
+ 'Vendors' => '³§ÉÌ',
+ 'days' => 'ÈÕ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'ÐÂÔö' => 'add',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '·¢Æ±' => 'invoice',
+ '¶©µ¥' => 'order',
+ '´¢´æ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/gl b/sql-ledger/locale/cn/gl
new file mode 100644
index 000000000..df813706b
--- /dev/null
+++ b/sql-ledger/locale/cn/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ó¦¸¶ÕÊÄ¿',
+ 'AR Transaction' => 'Ó¦ÊÕÕÊÄ¿',
+ 'Account' => '¿ÆÄ¿',
+ 'Add General Ledger Transaction' => 'ÐÂÔö×ÜÕÊ',
+ 'Address' => 'µØÖ·',
+ 'All' => 'È«²¿',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Transaction' => 'ÄúÈ·¶¨ÒªÉ¾³ýÕÊÄ¿',
+ 'Asset' => '×ʲú',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Balance' => '²î¶î',
+ 'Cannot delete transaction!' => 'ÎÞ·¨É¾³ýÕÊÄ¿!',
+ 'Cannot have a value in both Debit and Credit!' => '²»µÃͬʱÌîÈëÊýֵ춽跽Óë´û·½À¸Î»',
+ 'Cannot post a transaction without a value!' => 'ÎÞ·¨È·ÈÏû¼Û¸ñÕÊÄ¿!',
+ 'Cannot post transaction for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Continue' => '¼ÌÐø',
+ 'Credit' => '´û·½',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Debit' => '½è·½',
+ 'Debit and credit out of balance!' => '½è´û²»Æ½ºâ!',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Description' => '˵Ã÷',
+ 'Edit General Ledger Transaction' => '±à¼­×ÜÕÊ',
+ 'Equity' => '¹ÉȨ',
+ 'Expense' => '·ÑÓÃ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => '×ÜÕÊ',
+ 'General Ledger' => '×ÜÕÊ',
+ 'ID' => '񅧏',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Income' => 'ÊÕÒæ',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Liability' => '¸ºÕ®',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Purchase Invoice' => '²É¹º·¢Æ±',
+ 'Reference' => '²Î¿¼ºÅÂë',
+ 'Reference missing!' => 'δָÃ÷²Î¿¼ºÅÂë!',
+ 'Reports' => '±¨±í',
+ 'Sales Invoice' => 'Ïú»õ·¢Æ±',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Source' => 'À´Ô´',
+ 'Subtotal' => 'С¼Æ',
+ 'Transaction Date missing!' => '©ÌîÕÊÄ¿ÈÕÆÚ!',
+ 'Transaction deleted!' => 'ÕÊĿɾ³ý!',
+ 'Transaction posted!' => 'ÕÊĿȷÈÏ!',
+ 'Update' => '¸üÐÂ',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'Yes' => 'ÊÇ',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'Ó¦¸¶ÕÊÄ¿' => 'ap_transaction',
+ 'Ó¦ÊÕÕÊÄ¿' => 'ar_transaction',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '×ÜÕÊ' => 'gl_transaction',
+ 'È·ÈÏ' => 'post',
+ 'È·ÈϳÉΪÐÂÕÊÄ¿' => 'post_as_new',
+ '²É¹º·¢Æ±' => 'purchase_invoice',
+ 'Ïú»õ·¢Æ±' => 'sales_invoice',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ic b/sql-ledger/locale/cn/ic
new file mode 100644
index 000000000..e9bc87068
--- /dev/null
+++ b/sql-ledger/locale/cn/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => '»îÔ¾',
+ 'Add' => 'ÐÂÔö',
+ 'Add Assembly' => 'ÐÂÔöÉÌÆ·',
+ 'Add Part' => 'ÐÂÔöÔ­ÁÏ',
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Add Service' => 'ÐÂÔö·þÎñ',
+ 'Address' => 'µØÖ·',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Assemblies' => 'ÉÌÆ·',
+ 'Assemblies restocked!' => '×°ÅäÖØÐ½ø»õ!',
+ 'Assembly Number missing!' => '²éÎÞ´ËÉÌÆ·!',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'BOM' => '²ÄÁÏÕʵ¥',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'Bought' => 'ÒѹºÂò',
+ 'COGS' => '»õÏú³É±¾',
+ 'Cannot delete item already invoiced!' => 'ÎÞ·¨É¾³ý±¾Ïî',
+ 'Cannot delete item on order!' => 'ÎÞ·¨É¾³ýµ¥ÉϵÄÏîÄ¿!',
+ 'Cannot delete item which is part of an assembly!' => 'ÎÞ·¨É¾³ýÓÃì¶ÉÌÆ·ÖеÄÔ­ÁÏ',
+ 'Cannot delete item!' => 'ÎÞ·¨É¾³ýÏîÄ¿!',
+ 'Cannot stock assemblies!' => 'ÎÞ·¨É¾³ý×°ÅäÉÌÆ·!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'Drawing' => 'ͼ',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Edit Assembly' => '±à¼­ÉÌÆ·',
+ 'Edit Part' => '±à¼­Ô­ÁÏ',
+ 'Edit Service' => '±à¼­·þÎñ',
+ 'Expense' => '·ÑÓÃ',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'Image' => 'ͼÏó',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Income' => 'ÊÕÒæ',
+ 'Individual Items' => '×é³ÉÏîÄ¿',
+ 'Inventory' => '¿â´æ',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'ÔÚÍ£ÓôËÏî×éºÏƷ֮ǰ, ´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Í£ÓôËÏîÁã¼þ֮ǰ, ´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Inventory quantity must be zero!' => '´æ»õÊýÁ¿±ØÐèΪÁã!',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Item deleted!' => 'ÏîĿɾ³ý!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Last Cost' => 'ÉÏÒ»±Ê³É±¾',
+ 'Line Total' => '×ÜÁÐÊý',
+ 'Link Accounts' => 'Á¬½á¿ÆÄ¿',
+ 'List Price' => 'List Price',
+ 'Make' => 'ÖÆÔì',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Microfiche' => 'Ëõ΢½ºÆ¬',
+ 'Model' => 'ÐͺÅ',
+ 'Name' => 'Ãû³Æ',
+ 'No.' => '񅧏',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'Obsolete' => 'Í£ÓÃ',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'On Hand' => '´æÁ¿',
+ 'On Order' => 'ÒÑϵ¥¶©¹º',
+ 'Order' => '¶©µ¥',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'Ordered' => 'ÒÑ϶©¹º',
+ 'Orphaned' => 'ÎÞÖ÷',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Part' => 'Ô­ÁÏ',
+ 'Part Number missing!' => '©ÌîÔ­ÁϱàºÅ!',
+ 'Parts' => 'Ô­ÁÏ',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Postscript' => 'Postscript',
+ 'Price' => '¼Û¸ñ',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'ROP' => 'ÔÙ¶©µã',
+ 'Recd' => 'Recd',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Sales' => 'ÒµÎñ',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Save' => '´¢´æ',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sell Price' => 'ÊÛ¼Û',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Service Number missing!' => '©Ìî·þÎñ±àºÅ!',
+ 'Services' => '·þÎñ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Short' => '¶Ì',
+ 'Sold' => 'ÒÑÂô³ö',
+ 'Stock Assembly' => 'Å̵ã',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax' => '˰½ð',
+ 'To' => 'ÖÁ',
+ 'Top Level' => '×î¸ßµÈ¼¶',
+ 'Total' => '×ܼÆ',
+ 'Unit' => 'µ¥Î»',
+ 'Unit of measure' => '¶ÈÁ¿µ¥Î»',
+ 'Update' => '¸üÐÂ',
+ 'Updated' => 'ÒѸüÐÂ',
+ 'Weight' => 'ÖØÁ¿',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'ea' => 'ea',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'hr' => 'hr',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'ÐÂÔö' => 'add',
+ 'ÐÂÔöÉÌÆ·' => 'add_assembly',
+ 'ÐÂÔöÔ­ÁÏ' => 'add_part',
+ 'ÐÂÔö·þÎñ' => 'add_service',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '±à¼­ÉÌÆ·' => 'edit_assembly',
+ '±à¼­Ô­ÁÏ' => 'edit_part',
+ '±à¼­·þÎñ' => 'edit_service',
+ '´¢´æ' => 'save',
+ '¸üÐÂ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/io b/sql-ledger/locale/cn/io
new file mode 100644
index 000000000..fb68738dd
--- /dev/null
+++ b/sql-ledger/locale/cn/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Address' => 'µØÖ·',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Name' => 'Ãû³Æ',
+ 'No.' => '񅧏',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Order' => '¶©µ¥',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Part' => 'Ô­ÁÏ',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Postscript' => 'Postscript',
+ 'Price' => '¼Û¸ñ',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'Recd' => 'Recd',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Subject' => '±êÌâ',
+ 'To' => 'ÖÁ',
+ 'Unit' => 'µ¥Î»',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ '¼ÌÐø' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/ir b/sql-ledger/locale/cn/ir
new file mode 100644
index 000000000..321d81228
--- /dev/null
+++ b/sql-ledger/locale/cn/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => '¿ÆÄ¿',
+ 'Add Purchase Invoice' => 'ÐÂÔö²É¹º·¢Æ±',
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Invoice Number' => 'ÄúÈ·¶¨ÒªÉ¾³ý·¢Æ±±àºÅ',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'Cannot delete invoice!' => 'ÎÞ·¨É¾³ý·¢Æ±!',
+ 'Cannot post invoice for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚÈ·ÈÏ·¢Æ±?ë½»Ò!',
+ 'Cannot post invoice!' => 'ÎÞ·¨È·ÈÏ·¢Æ±!',
+ 'Cannot post payment for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Currency' => '±Ò±ð',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date Due' => 'Ó¦¸¶ÈÕÆÚ',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Edit Purchase Invoice' => '±à¼­²É¹º·¢Æ±',
+ 'Exch' => '»ãÂÊ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate for payment missing!' => 'δָÃ÷¸¶¿î»ãÂÊ!',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date' => '·¢Æ±ÈÕÆÚ',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Invoice deleted!' => '·¢Æ±É¾³ý!',
+ 'Invoice posted!' => '·¢Æ±È·ÈÏ!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Name' => 'Ãû³Æ',
+ 'No.' => '񅧏',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Order' => '¶©µ¥',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Part' => 'Ô­ÁÏ',
+ 'Payment date missing!' => 'δָÃ÷¸¶¿î?ÕÆ?!',
+ 'Payments' => '¸¶¿î',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Postscript' => 'Postscript',
+ 'Price' => '¼Û¸ñ',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'Recd' => 'Recd',
+ 'Record in' => '¼Ç¼ì¶',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Source' => 'À´Ô´',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'To' => 'ÖÁ',
+ 'Total' => '×ܼÆ',
+ 'Unit' => 'µ¥Î»',
+ 'Update' => '¸üÐÂ',
+ 'Vendor' => '³§ÉÌ',
+ 'Vendor missing!' => 'δָÃ÷³§ÉÌ!',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'Yes' => 'ÊÇ',
+ 'ea' => 'ea',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '¶©µ¥' => 'order',
+ 'È·ÈÏ' => 'post',
+ 'È·ÈϳÉΪÐÂÕÊÄ¿' => 'post_as_new',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/is b/sql-ledger/locale/cn/is
new file mode 100644
index 000000000..d55c467b1
--- /dev/null
+++ b/sql-ledger/locale/cn/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => '¿ÆÄ¿',
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Invoice' => 'ÐÂÔöÏú»õ·¢Æ±',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Invoice Number' => 'ÄúÈ·¶¨ÒªÉ¾³ý·¢Æ±±àºÅ',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'Cannot delete invoice!' => 'ÎÞ·¨É¾³ý·¢Æ±!',
+ 'Cannot post invoice for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚÈ·ÈÏ·¢Æ±?ë½»Ò!',
+ 'Cannot post invoice!' => 'ÎÞ·¨È·ÈÏ·¢Æ±!',
+ 'Cannot post payment for a closed period!' => 'ÎÞ·¨ÔÚÒѹرյÄʱ¶ÎÄÚ¼Ó?ë½»Ò?!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Credit Limit' => 'ÐÅÓöî¶È',
+ 'Currency' => '±Ò±ð',
+ 'Customer' => '¿Í»§',
+ 'Customer missing!' => 'δָÃ÷¿Í»§!',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Date Due' => 'Ó¦¸¶ÈÕÆÚ',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Edit Sales Invoice' => '±à¼­Ïú»õ·¢Æ±',
+ 'Exch' => '»ãÂÊ',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate for payment missing!' => 'δָÃ÷¸¶¿î»ãÂÊ!',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date' => '·¢Æ±ÈÕÆÚ',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number' => '·¢Æ±±àºÅ',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Invoice deleted!' => '·¢Æ±É¾³ý!',
+ 'Invoice posted!' => '·¢Æ±È·ÈÏ!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Name' => 'Ãû³Æ',
+ 'No.' => '񅧏',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Order' => '¶©µ¥',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Part' => 'Ô­ÁÏ',
+ 'Payment date missing!' => 'δָÃ÷¸¶¿î?ÕÆ?!',
+ 'Payments' => '¸¶¿î',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Post' => 'È·ÈÏ',
+ 'Post as new' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Postscript' => 'Postscript',
+ 'Price' => '¼Û¸ñ',
+ 'Print' => 'Ó¡Ë¢',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'Recd' => 'Recd',
+ 'Record in' => '¼Ç¼ì¶',
+ 'Remaining' => 'ÉÐâÅ',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Ship via' => 'º½ÔË·½·¨',
+ 'Source' => 'À´Ô´',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'To' => 'ÖÁ',
+ 'Total' => '×ܼÆ',
+ 'Unit' => 'µ¥Î»',
+ 'Update' => '¸üÐÂ',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'Yes' => 'ÊÇ',
+ 'ea' => 'ea',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ 'µç×ÓÓʼþ' => 'e_mail',
+ '¶©µ¥' => 'order',
+ 'È·ÈÏ' => 'post',
+ 'È·ÈϳÉΪÐÂÕÊÄ¿' => 'post_as_new',
+ 'Ó¡Ë¢' => 'print',
+ 'ÏúÊÛ´ú±í' => 'ship_to',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/login b/sql-ledger/locale/cn/login
new file mode 100644
index 000000000..e22cfe38d
--- /dev/null
+++ b/sql-ledger/locale/cn/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => '¹Øì¶',
+ 'Database Host' => '×ÊÁÏ¿âÖ÷»ú',
+ 'Dataset' => '×ÊÁϼ¯',
+ 'Incorrect Dataset version!' => '×ÊÁϼ¯°æ±¾´íÎó!',
+ 'Incorrect Password!' => 'ÃÜÂë´íÎó!',
+ 'Licensed to' => 'ÊÚȨÓè',
+ 'Login' => 'µÇ??',
+ 'Name' => 'Ãû³Æ',
+ 'Password' => 'ÃÜÂë',
+ 'User' => 'ʹÓÃÕß',
+ 'Version' => '°æ±¾',
+ 'You are logged out!' => 'ÄãÒԵdzö!',
+ 'You did not enter a name!' => 'Äú²¢Î´¼ü?ëÃ?³Æ!',
+ 'is not a member!' => '²¢²»ÊdzÉÔ±!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'µÇ??' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/menu b/sql-ledger/locale/cn/menu
new file mode 100644
index 000000000..c1d4657f7
--- /dev/null
+++ b/sql-ledger/locale/cn/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Ó¦¸¶ÕÊ¿î',
+ 'AP Aging' => 'Ó¦¸¶ÕÊÁä·ÖÎö',
+ 'AR' => 'Ó¦ÊÕÕÊ¿î',
+ 'AR Aging' => 'Ó¦ÊÕÕÊÁä·ÖÎö',
+ 'Accounting Menu' => '»á¼ÆÑ¡µ¥',
+ 'Add Account' => 'ÐÂÔö¿ÆÄ¿',
+ 'Add Assembly' => 'ÐÂÔöÉÌÆ·',
+ 'Add Customer' => 'ÐÂÔö¿Í»§',
+ 'Add GIFI' => 'ÐÂÔö GIFI',
+ 'Add Part' => 'ÐÂÔöÔ­ÁÏ',
+ 'Add Project' => 'ÐÂÔö¹¤³Ì',
+ 'Add Service' => 'ÐÂÔö·þÎñ',
+ 'Add Transaction' => 'ÐÂÔöÕÊÄ¿',
+ 'Add Vendor' => 'ÐÂÔö³§ÉÌ',
+ 'Assemblies' => 'ÉÌÆ·',
+ 'Audit Control' => '»üºË¿ØÖÆ',
+ 'Backup' => '±¸·Ý',
+ 'Balance Sheet' => '×ʲú¸ºÕ®±í',
+ 'Cash' => 'ÏÖ½ð',
+ 'Chart of Accounts' => '»á¼Æ¿ÆÄ¿±í',
+ 'Check' => '֧Ʊ',
+ 'Customers' => '¿Í»§',
+ 'General Ledger' => '×ÜÕÊ',
+ 'Goods & Services' => 'Goods & Services',
+ 'HTML Templates' => 'HTML ±íµ¥',
+ 'Income Statement' => 'ËðÒæ±í',
+ 'Invoice' => '·¢Æ±',
+ 'LaTeX Templates' => 'LaTex Ä£°æ',
+ 'List Accounts' => 'ÁгöÕʺÅ',
+ 'List GIFI' => 'Áгö GIFI',
+ 'Logout' => 'µÇ³ö',
+ 'Order Entry' => 'ϵ¥ÏîÄ¿',
+ 'Packing List' => '³ö»õµ¥',
+ 'Parts' => 'Ô­ÁÏ',
+ 'Payment' => '¸¶¿î·½Ê½',
+ 'Payments' => '¸¶¿î',
+ 'Preferences' => '¸öÈËÉ趨',
+ 'Projects' => '¹¤³Ì',
+ 'Purchase Invoice' => '²É¹º·¢Æ±',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Purchase Orders' => '²É¹ºµ¥',
+ 'Receipt' => 'ÊÕ¾Ý',
+ 'Receipts' => 'ÊÕ¾Ý',
+ 'Reconciliation' => 'µ÷Í£',
+ 'Reports' => '±¨±í',
+ 'Sales Invoice' => 'Ïú»õ·¢Æ±',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Sales Orders' => 'Ïú»õµ¥',
+ 'Save to File' => '´¢´æÖÁµµ°¸',
+ 'Send by E-Mail' => 'ÒÔµç×ÓÓʼþ¼ÄËÍ',
+ 'Services' => '·þÎñ',
+ 'Statement' => 'ÕÊÄ¿³ÂÊö',
+ 'Stock Assembly' => 'Å̵ã',
+ 'Stylesheet' => 'Ñùʽ±í',
+ 'System' => 'ϵͳ',
+ 'Tax collected' => 'ÊÕµ½µÄ˰',
+ 'Tax paid' => 'Ö§¸¶µÄ˰',
+ 'Transactions' => 'ÕÊÄ¿',
+ 'Trial Balance' => 'ÊÔËã±í',
+ 'Vendors' => '³§ÉÌ',
+ 'Version' => '°æ±¾',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/oe b/sql-ledger/locale/cn/oe
new file mode 100644
index 000000000..5054b9b69
--- /dev/null
+++ b/sql-ledger/locale/cn/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'ÐÂÔö',
+ 'Add Purchase Invoice' => 'ÐÂÔö²É¹º·¢Æ±',
+ 'Add Purchase Order' => 'ÐÂÔö²É¹ºµ¥',
+ 'Add Sales Invoice' => 'ÐÂÔöÏú»õ·¢Æ±',
+ 'Add Sales Order' => 'ÐÂÔöÏú»õµ¥',
+ 'Address' => 'µØÖ·',
+ 'Amount' => '×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Are you sure you want to delete Order Number' => 'ÄúÊÇ·ñ?·¶¨ÒªÉ¾³?¶©µ¥',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ïä',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'ÎÞ·¨É¾³ý¶©µ¥!',
+ 'Cannot save order!' => 'ÎÞ·¨´¢´æÇåµ¥!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'ÒѹرÕ',
+ 'Confirm!' => 'ÈëÕʳɹ¦!',
+ 'Contact' => 'Á¬ÂçÈË',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Credit Limit' => 'ÐÅÓöî¶È',
+ 'Curr' => 'Ŀǰ',
+ 'Currency' => '±Ò±ð',
+ 'Customer' => '¿Í»§',
+ 'Customer missing!' => 'δָÃ÷¿Í»§!',
+ 'Customer not on file!' => '¿Í»§¼Ç¼ûÔÚµµ°¸!',
+ 'Date' => 'ÈÕÆÚ',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Delete' => 'ɾ³ý',
+ 'Delivery Date' => 'µÝËÍÈÕÆÚ',
+ 'Description' => '˵Ã÷',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail address missing!' => '©Ìîµç×ÓÓʼþλַ!',
+ 'Edit Purchase Order' => '±à¼­²É¹ºµ¥',
+ 'Edit Sales Order' => '±à¼­Ïú»õµ¥',
+ 'Exchangerate' => '»ãÂÊ',
+ 'Exchangerate missing!' => 'δָÃ÷»ãÂÊ!',
+ 'Extended' => '¼ÆËãÁÐ',
+ 'Fax' => '´«Õæ',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'ID' => '񅧏',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Invoice' => '·¢Æ±',
+ 'Invoice Date missing!' => '·¢Æ±ÈÕÆÚ´íÎó!',
+ 'Invoice Number missing!' => '·¢Æ±±àºÅ´íÎó!',
+ 'Item not on file!' => '²éÎÞ´ËÏîÄ¿',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'Name' => 'Ãû³Æ',
+ 'No.' => '񅧏',
+ 'Notes' => '±¸×¢',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Number' => '񅧏',
+ 'Number missing in Row' => 'δָÃ÷ºÅÂë',
+ 'O' => 'O',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'Open' => '¿ªÆô',
+ 'Order' => '¶©µ¥',
+ 'Order Date' => '쵴?ͮ?',
+ 'Order Date missing!' => 'δָÃ÷ϵ¥?ÕÆ?!',
+ 'Order Number' => '¶©µ¥±àºÅ',
+ 'Order Number missing!' => 'δָÃ÷¶©µ¥±àºÅ!',
+ 'Order deleted!' => 'ɾ³ý¶©µ¥!',
+ 'Order saved!' => '´¢´æ¶©µ¥!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '³ö»õµ¥',
+ 'Packing List Date missing!' => 'δָÃ÷°ü×°Çåµ¥?ÕÆ?!',
+ 'Packing List Number missing!' => 'δָÃ÷°ü×°Çåµ¥±àºÅ!',
+ 'Part' => 'Ô­ÁÏ',
+ 'Phone' => 'µç»°ºÅÂë',
+ 'Postscript' => 'Postscript',
+ 'Price' => '¼Û¸ñ',
+ 'Print' => 'Ó¡Ë¢',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project' => '¹¤³Ì',
+ 'Project not on file!' => 'È·ÈϳÉΪÐÂÕÊÄ¿',
+ 'Purchase Order' => '²É¹ºµ¥',
+ 'Purchase Orders' => '²É¹ºµ¥',
+ 'Qty' => 'ÊýÁ¿',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'ÉÐâÅ',
+ 'Required by' => '×ÓÏîÄ¿',
+ 'Sales Order' => 'Ïú»õµ¥',
+ 'Sales Orders' => 'Ïú»õµ¥',
+ 'Save' => '´¢´æ',
+ 'Save as new' => '´¢´æ',
+ 'Screen' => 'Ó©Ä»',
+ 'Select from one of the items below' => 'ì¶ÏÂÁÐÏîÄ¿ÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the names below' => 'ì¶ÏÂÁÐÃû×ÖÖÐÑ¡ÔñÒ»Ïî',
+ 'Select from one of the projects below' => 'ì¶ÏÂÁй¤³ÌÖÐÑ¡ÔñÒ»Ïî',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Service' => '·þÎñ',
+ 'Ship' => 'º½ÔË',
+ 'Ship to' => 'ÏúÊÛ´ú±í',
+ 'Ship via' => 'º½ÔË·½·¨',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax' => '˰½ð',
+ 'Tax Included' => '²»ÊÕ·þÎñ·Ñ',
+ 'Terms: Net' => 'ƱÆÚ¾»¼Æ',
+ 'To' => 'ÖÁ',
+ 'Total' => '×ܼÆ',
+ 'Unit' => 'µ¥Î»',
+ 'Update' => '¸üÐÂ',
+ 'Vendor' => '³§ÉÌ',
+ 'Vendor missing!' => 'δָÃ÷³§ÉÌ!',
+ 'Vendor not on file!' => '´Ë³§ÉÌδÔÚµµ°¸!',
+ 'What type of item is this?' => '´ËÏîÄ¿µÄÐÍ̬?',
+ 'Yes' => 'ÊÇ',
+ 'days' => 'ÈÕ',
+ 'ea' => 'ea',
+ 'emailed to' => 'ÒѼÄÖÁ',
+ 'sent to printer' => 'ËÍÖÁÓ¡±í»ú',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ÐÂÔö' => 'add',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ 'µç×ÓÓʼþ' => 'e_mail',
+ '·¢Æ±' => 'invoice',
+ 'Ó¡Ë¢' => 'print',
+ '´¢´æ' => 'save',
+ '´¢´æ' => 'save_as_new',
+ 'ÏúÊÛ´ú±í' => 'ship_to',
+ '¸üÐÂ' => 'update',
+ 'ÊÇ' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/pe b/sql-ledger/locale/cn/pe
new file mode 100644
index 000000000..35372d3d4
--- /dev/null
+++ b/sql-ledger/locale/cn/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'ÐÂÔö',
+ 'Add Project' => 'ÐÂÔö¹¤³Ì',
+ 'All' => 'È«²¿',
+ 'Continue' => '¼ÌÐø',
+ 'Delete' => 'ɾ³ý',
+ 'Description' => '˵Ã÷',
+ 'Edit Project' => '¸ü¸Ä¹¤³Ì',
+ 'Number' => '񅧏',
+ 'Orphaned' => 'ÎÞÖ÷',
+ 'Project' => '¹¤³Ì',
+ 'Project Number missing!' => 'δָÃ÷¹¤³ÌºÅÂë!',
+ 'Project deleted!' => '¹¤³ÌÒÔ±»É¾³ý!',
+ 'Project saved!' => '¹¤³ÌÒÔ±»´¢´æ!',
+ 'Projects' => '¹¤³Ì',
+ 'Save' => '´¢´æ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'ÐÂÔö' => 'add',
+ '¼ÌÐø' => 'continue',
+ 'ɾ³ý' => 'delete',
+ '´¢´æ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/rc b/sql-ledger/locale/cn/rc
new file mode 100644
index 000000000..31f35f2ce
--- /dev/null
+++ b/sql-ledger/locale/cn/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => '¿ÆÄ¿',
+ 'Balance' => '²î¶î',
+ 'Cleared Balance' => 'Ö§¸¶²î¶î×ÜÊý',
+ 'Continue' => '¼ÌÐø',
+ 'Date' => 'ÈÕÆÚ',
+ 'Deposit' => '´¢´æ',
+ 'Description' => '˵Ã÷',
+ 'Difference' => '²îÒì',
+ 'Done' => 'Íê³É',
+ 'Exchangerate Difference' => '»ãÂʲîÒì',
+ 'From' => '´Ó',
+ 'Out of balance!' => '³öÓÚ²î¶î!',
+ 'Payment' => '¸¶¿î·½Ê½',
+ 'Reconciliation' => 'µ÷Í£',
+ 'Select all' => 'Ñ¡ÔñÈ«²¿',
+ 'Source' => 'À´Ô´',
+ 'Statement Balance' => 'ÕÊÄ¿³ÂÊö²î¶î',
+ 'Update' => '¸üÐÂ',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ '¼ÌÐø' => 'continue',
+ 'Íê³É' => 'done',
+ 'Ñ¡ÔñÈ«²¿' => 'select_all',
+ '¸üÐÂ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cn/rp b/sql-ledger/locale/cn/rp
new file mode 100644
index 000000000..6d80cf815
--- /dev/null
+++ b/sql-ledger/locale/cn/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Ó¦¸¶ÕÊÁä·ÖÎö',
+ 'AR Aging' => 'Ó¦ÊÕÕÊÁä·ÖÎö',
+ 'Account' => '¿ÆÄ¿',
+ 'Accounts' => 'ÕÊ»§',
+ 'Amount' => '×ܼÆ',
+ 'Apr' => 'ËÄÔÂ',
+ 'April' => 'ËÄÔÂ',
+ 'Attachment' => '¸½µµ',
+ 'Aug' => '°ËÔÂ',
+ 'August' => '°ËÔÂ',
+ 'Balance' => '²î¶î',
+ 'Balance Sheet' => '×ʲú¸ºÕ®±í',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'ÏÖ½ð½»Ò×',
+ 'Cc' => 'Cc',
+ 'Compare to' => '¶ÔÕÕ',
+ 'Continue' => '¼ÌÐø',
+ 'Copies' => '¿½±´',
+ 'Credit' => '´û·½',
+ 'Current' => 'ÏÖÔÚ',
+ 'Customer' => '¿Í»§',
+ 'Date' => 'ÈÕÆÚ',
+ 'Debit' => '½è·½',
+ 'Dec' => 'Ê®¶þÔÂ',
+ 'December' => 'Ê®¶þÔÂ',
+ 'Decimalplaces' => 'СÊýµÄÊýÄ¿',
+ 'Department' => 'Department',
+ 'Description' => '˵Ã÷',
+ 'Due' => 'µ½ÆÚ',
+ 'E-mail' => 'µç×ÓÓʼþ',
+ 'E-mail Statement to' => 'µç×ÓÓʼþÕÊÄ¿³ÂÊöµ½',
+ 'Feb' => '¶þÔÂ',
+ 'February' => '¶þÔÂ',
+ 'From' => '´Ó',
+ 'GIFI' => 'GIFI',
+ 'Heading' => '±íÍ·',
+ 'ID' => '񅧏',
+ 'In-line' => 'ÐÐÄÚ',
+ 'Include in Report' => 'Ò»²¢ÏÔʾ',
+ 'Income Statement' => 'ËðÒæ±í',
+ 'Invoice' => '·¢Æ±',
+ 'Jan' => 'Ò»ÔÂ',
+ 'January' => 'Ò»ÔÂ',
+ 'Jul' => 'ÆßÔÂ',
+ 'July' => 'ÆßÔÂ',
+ 'Jun' => 'ÁùÔÂ',
+ 'June' => 'ÁùÔÂ',
+ 'Mar' => 'ÈýÔÂ',
+ 'March' => 'ÈýÔÂ',
+ 'May' => 'ÎåÔÂ',
+ 'May ' => 'ÎåÔÂ',
+ 'Message' => 'ѶϢ',
+ 'N/A' => '²»ÊÊÓÃ',
+ 'Nothing selected!' => 'δѡ¶¨×Ê!',
+ 'Nov' => 'ʮһÔÂ',
+ 'November' => 'ʮһÔÂ',
+ 'Oct' => 'Ê®ÔÂ',
+ 'October' => 'Ê®ÔÂ',
+ 'PDF' => 'PDF',
+ 'Payments' => '¸¶¿î',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Ó¡Ë¢',
+ 'Printer' => 'Ó¡±í»ú',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'ÊÕ¾Ý',
+ 'Report for' => '±¨±íÀ´Ô´',
+ 'Retained Earnings' => '±£ÁôÓ¯âÅ',
+ 'Screen' => 'Ó©Ä»',
+ 'Select all' => 'Ñ¡ÔñÈ«²¿',
+ 'Select postscript or PDF!' => 'Ñ¡Ôñ postscript »ò PDF!',
+ 'Sep' => '¾ÅÔÂ',
+ 'September' => '¾ÅÔÂ',
+ 'Source' => 'À´Ô´',
+ 'Standard' => '±ê×¼',
+ 'Statement' => 'ÕÊÄ¿³ÂÊö',
+ 'Statement sent to' => 'ÕÊÄ¿³ÂÊöË͵½',
+ 'Statements sent to printer!' => 'ÕÊÄ¿³ÂÊöË͵½Ó¡±í»ú!',
+ 'Subject' => '±êÌâ',
+ 'Subtotal' => 'С¼Æ',
+ 'Tax' => '˰½ð',
+ 'Tax collected' => 'ÊÕµ½µÄ˰',
+ 'Tax paid' => 'Ö§¸¶µÄ˰',
+ 'Total' => '×ܼÆ',
+ 'Trial Balance' => 'ÊÔËã±í',
+ 'Vendor' => '³§ÉÌ',
+ 'as at' => '¸ù¾Ý',
+ 'collected on sales' => 'ÔÚÏú»õʱ½áÇå',
+ 'for Period' => 'ÆÚ¼ä',
+ 'paid on purchases' => 'ÔڲɹºÊ±½áÇå',
+ 'to' => 'ÖÁ',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ '¼ÌÐø' => 'continue',
+ 'µç×ÓÓʼþ' => 'e_mail',
+ 'Ó¡Ë¢' => 'print',
+ 'Ñ¡ÔñÈ«²¿' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/COPYING b/sql-ledger/locale/ct/COPYING
new file mode 100644
index 000000000..fbb7b6136
--- /dev/null
+++ b/sql-ledger/locale/ct/COPYING
@@ -0,0 +1,21 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Catalan Translation:
+#
+# Author: Jaume Teixi <teixi@rocacorbit.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+######################################################################
diff --git a/sql-ledger/locale/ct/LANGUAGE b/sql-ledger/locale/ct/LANGUAGE
new file mode 100644
index 000000000..f37af43f2
--- /dev/null
+++ b/sql-ledger/locale/ct/LANGUAGE
@@ -0,0 +1 @@
+Catalan
diff --git a/sql-ledger/locale/ct/admin b/sql-ledger/locale/ct/admin
new file mode 100644
index 000000000..a394d28ac
--- /dev/null
+++ b/sql-ledger/locale/ct/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Control d\'Accés',
+ 'Accounting' => 'Comptabilitat',
+ 'Add User' => 'Afegir Usuari',
+ 'Address' => 'Adreça',
+ 'Administration' => 'Administració',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'Totes les Base de Dades Actualitzades!',
+ 'Change Admin Password' => 'Canviar la contrasenya de l\'administrador',
+ 'Change Password' => 'Canviar contrasenya',
+ 'Character Set' => 'Canviar Tipus Caràcters',
+ 'Click on login name to edit!' => 'Clicar en el nom d\'accés per editar',
+ 'Company' => 'Empresa',
+ 'Connect to' => 'Connectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Crear la Taula de Comptes',
+ 'Create Dataset' => 'Crear el Conjunt de Dades',
+ 'DBI not installed!' => 'DBI no instal.lat',
+ 'Database' => 'Base de Dades',
+ 'Database Administration' => 'Administrar Base de Dades',
+ 'Database Driver not checked!' => 'Mòdul de la Base de Dades no comprovat!',
+ 'Database User missing!' => 'Falta el usuari de la Base de Dades!',
+ 'Dataset' => 'Conjunt de Dades',
+ 'Dataset missing!' => 'Falta el Conjunt de Dades',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Format Data',
+ 'Delete' => 'Esborrar',
+ 'Delete Dataset' => 'Esborrar Conjunt de Dades',
+ 'Directory' => 'Directori',
+ 'Driver' => 'Mòdul',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Email',
+ 'Edit User' => 'Editar Usuari',
+ 'Existing Datasets' => 'Conjunt de Dades Existents',
+ 'Fax' => 'Fax',
+ 'Host' => 'Servidor',
+ 'Hostname missing!' => 'Falta el Nom del Servidor!',
+ 'Incorrect Password!' => 'Contrasenya no Vàlida!',
+ 'Language' => 'Idioma',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deixar en blanc el servidor i el port excepte per fer una connexió remota',
+ 'Login' => 'Entrar',
+ 'Name' => 'Nom',
+ 'New Templates' => 'Noves Plantilles',
+ 'No Database Drivers available!' => 'Cap Mòdul de Base de Dades disponible!',
+ 'No Dataset selected!' => 'No hi ha cap Conjunt de Dades seleccionat!',
+ 'Nothing to delete!' => 'No hi ha res per esborrar!',
+ 'Number Format' => 'Format Número',
+ 'Oracle Database Administration' => 'Administració Base de Dades Oracle',
+ 'Password' => 'Contrasenya',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Administració Base de Dades PostgreSQL',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Falta Port!',
+ 'Printer' => 'Impressora',
+ 'Save' => 'Guardar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccionar Conjunt de Dades a esborrar i prèmer "Continuar"',
+ 'Setup Templates' => 'Configurar Plantilles',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Signatura',
+ 'Stylesheet' => 'Fulla Estils',
+ 'Templates' => 'Plantilles',
+ 'The following Datasets are not in use and can be deleted' => 'Els següents conjunt de dades no s\'usen i poden esborrar-se',
+ 'The following Datasets need to be updated' => 'Cal actualitzar els següents conjunt de dades',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Comprovació preliminar de les fonts existents. No es crearà ni s\'esborrra res en aquest punt!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Per afegir un usuari a un grup, editar el nom, canviar el nom d\'accés i guardar. Un nou usuari amb les mateixes variables es guardarà amb el nou nom d\«accés',
+ 'Update Dataset' => 'Actualitzar Conjut de Dades',
+ 'Use Templates' => 'Emprar Plantilles',
+ 'User' => 'Usuari',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Versió',
+ 'You must enter a host and port for local and remote connections!' => 'Heu d\'entrar el servidor i el port per les connexions locals i remotes!',
+ 'does not exist' => 'no existeix',
+ 'is already a member!' => 'ja és membre!',
+ 'localhost' => 'màquina local',
+ 'successfully created!' => 'creat correctament!',
+ 'successfully deleted!' => 'esborrat correctament!',
+ 'website' => 'web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'afegir_usuari' => 'add_user',
+ 'canviar_la_contrasenya_de_l\'administrador' => 'change_admin_password',
+ 'canviar_contrasenya' => 'change_password',
+ 'continuar' => 'continue',
+ 'crear_el_conjunt_de_dades' => 'create_dataset',
+ 'esborrar' => 'delete',
+ 'esborrar_conjunt_de_dades' => 'delete_dataset',
+ 'entrar' => 'login',
+ 'administració_base_de_dades_oracle' => 'oracle_database_administration',
+ 'administració_base_de_dades_postgresql' => 'pg_database_administration',
+ 'guardar' => 'save',
+ 'actualitzar_conjut_de_dades' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/all b/sql-ledger/locale/ct/all
new file mode 100644
index 000000000..c2c93271c
--- /dev/null
+++ b/sql-ledger/locale/ct/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Despeses',
+ 'AP Aging' => 'Diari de Despeses',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'Transaccions de Despeses',
+ 'AR' => 'Ingressos',
+ 'AR Aging' => 'Diari d\'Ingressos',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'Transaccions d\'Ingressos',
+ 'About' => 'Referent',
+ 'Access Control' => 'Control d\'Accés',
+ 'Account' => 'Compta',
+ 'Account Number' => 'Num. Compta',
+ 'Account Number missing!' => 'Falta el Num. Compta!',
+ 'Account Type' => 'Tipus de Compta',
+ 'Account Type missing!' => 'Falta el Tipus de Compta!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Comptabilitat',
+ 'Accounting Menu' => 'Menú Comptable',
+ 'Accounts' => '',
+ 'Active' => '',
+ 'Add' => 'Afegir',
+ 'Add Account' => 'Afegir Compta',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'Afegir Compost',
+ 'Add Customer' => 'Afegir Client',
+ 'Add GIFI' => '',
+ 'Add General Ledger Transaction' => 'Afegir Transacció Llibre Major',
+ 'Add Part' => 'Afegir Article',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Add Service' => 'Afegir Servei',
+ 'Add Transaction' => 'Afegir Transacció',
+ 'Add User' => 'Afegir Usuari',
+ 'Add Vendor' => 'Afegir Proveïdor',
+ 'Address' => 'Adreça',
+ 'Administration' => 'Administració',
+ 'Administrator' => '',
+ 'All' => 'Tots',
+ 'All Datasets up to date!' => 'Totes les Base de Dades Actualitzades!',
+ 'Amount' => 'Total',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Segur que voleu esborrar la Fra. Num.',
+ 'Are you sure you want to delete Order Number' => 'Segur que voleu esborrar l\'Ordre',
+ 'Are you sure you want to delete Transaction' => 'Segur que voleu esborrar la Transacció',
+ 'Assemblies' => 'Compostos',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'Falta el Num. del Compost',
+ 'Asset' => 'Activat',
+ 'Attachment' => 'Adjunt',
+ 'Audit Control' => 'Control Auditoria',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'BOM' => '',
+ 'Backup' => 'Còpia de Seguretat',
+ 'Backup sent to' => 'Còpia de Seguretat enviada a',
+ 'Balance' => '',
+ 'Balance Sheet' => 'Fulla de Balanç',
+ 'Bcc' => '',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Els Llibres estan Oberts',
+ 'Bought' => 'Comprat',
+ 'Business Number' => 'Núm. Negoci',
+ 'C' => '',
+ 'COGS' => 'Cost de Preu',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'No es pot esborrar la compta per defecte!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'No es pot esborrar un element facturat!',
+ 'Cannot delete item on order!' => 'No es pot esborrar un element pressupostat!',
+ 'Cannot delete item which is part of an assembly!' => 'No es pot eliminar un element que és part d\'un compost',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'No es pot tenir un valor simultàniament a Dèbit i a Crèdit',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => '',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => '',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'No es pot registrar una transacció per un període tancat',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Canviar la contrasenya de l\'administrador',
+ 'Change Password' => 'Canviar contrasenya',
+ 'Character Set' => 'Canviar Tipus Caràcters',
+ 'Chart of Accounts' => 'Taula de Comptes',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Clicar en el nom d\'accés per editar',
+ 'Close Books up to' => 'Tancar els llibres fins',
+ 'Closed' => 'Tancat',
+ 'Company' => 'Empresa',
+ 'Compare to' => 'Comparar amb',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Connectar a',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Copy to COA' => '',
+ 'Create Chart of Accounts' => 'Crear la Taula de Comptes',
+ 'Create Dataset' => 'Crear el Conjunt de Dades',
+ 'Credit' => 'Crèdit',
+ 'Credit Limit' => 'Límit de Crèdit',
+ 'Curr' => '',
+ 'Currency' => 'Moneda',
+ 'Current' => '',
+ 'Customer' => 'Client',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'DBI no instal.lat',
+ 'Database' => 'Base de Dades',
+ 'Database Administration' => 'Administrar Base de Dades',
+ 'Database Driver not checked!' => 'Mòdul de la Base de Dades no comprovat!',
+ 'Database Host' => 'Servidor Base de Dades',
+ 'Database User missing!' => 'Falta el usuari de la Base de Dades!',
+ 'Dataset' => 'Conjunt de Dades',
+ 'Dataset missing!' => 'Falta el Conjunt de Dades',
+ 'Dataset updated!' => '',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data Venciment',
+ 'Date Format' => 'Format Data',
+ 'Date Paid' => 'Data Pagament',
+ 'Date missing!' => '',
+ 'Debit' => 'Dèbit',
+ 'Debit and credit out of balance!' => 'Dèbit i Crèdit fora de balanç!',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Decimalplaces' => '',
+ 'Delete' => 'Esborrar',
+ 'Delete Account' => 'Esborrar Compta',
+ 'Delete Dataset' => 'Esborrar Conjunt de Dades',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'Descripció',
+ 'Difference' => '',
+ 'Directory' => 'Directori',
+ 'Discount' => 'Descompte',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Mòdul',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Venciment',
+ 'Due Date' => 'Data Venciment',
+ 'Due Date missing!' => 'Falta la Data Venciment!',
+ 'E-mail' => 'Email',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Edit' => '',
+ 'Edit Account' => 'Editar Compta',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'Editar Compost',
+ 'Edit GIFI' => '',
+ 'Edit General Ledger Transaction' => 'Editar Transacció del LLibre Major',
+ 'Edit Part' => 'Editar Article',
+ 'Edit Preferences for' => 'Editar Preferències per',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Editar Ordre Compra',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Editar Pressupost',
+ 'Edit Service' => 'Editar Servei',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Edit User' => 'Editar Usuari',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => 'Forçar l\'anul.lació de transaccions per totes les dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entrar fins a 3 caràcters separats per dos punts (p.e. EUR:USD:CAD) per les monedes nacionals i estrangeres',
+ 'Equity' => 'Balanç',
+ 'Exch' => 'Canvi',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => '',
+ 'Exchangerate missing!' => '',
+ 'Existing Datasets' => 'Conjunt de Dades Existents',
+ 'Expense' => 'Despeses',
+ 'Expense Account' => 'Compta Despeses',
+ 'Expense/Asset' => 'Despesa/Activa',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'Foreign Exchange Gain' => 'Guany en Bescanvi Moneda',
+ 'Foreign Exchange Loss' => 'Pèrdua en Bescanvi Moneda',
+ 'From' => 'De',
+ 'GIFI' => '',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => '',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Llibre Major',
+ 'Goods & Services' => 'Bèns i Serveis',
+ 'HTML Templates' => 'Plantilles HTML',
+ 'Heading' => 'Capçalera',
+ 'Host' => 'Servidor',
+ 'Hostname missing!' => 'Falta el Nom del Servidor!',
+ 'ID' => 'ID',
+ 'Image' => '',
+ 'In-line' => 'Afegit',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Include in drop-down menus' => 'Incloure en Menús Desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incloure aquesta compta en els formularis client/proveïdor per marcar els impostos aplicables client/proveïdor?',
+ 'Income' => 'Ingressos',
+ 'Income Account' => 'Compta Ingressos',
+ 'Income Statement' => 'Balanç Situació',
+ 'Incorrect Dataset version!' => 'Versió Incorrecta del Conjunt de Dades!',
+ 'Incorrect Password!' => 'Contrasenya no Vàlida!',
+ 'Individual Items' => 'Elements Individuals',
+ 'Inventory' => 'Inventari',
+ 'Inventory Account' => 'Compta Inventari',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantitat en l\'inventari ha de ser zero abans de marcar-lo com obsolet',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantitat en l\'inventari ha de ser zero abans de marcar-lo com obsolet',
+ 'Inventory quantity must be zero!' => 'La quantitat en l\'inventari ha de ser zero',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data Fra.',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'És una compta resum a registrar?',
+ 'Item deleted!' => '',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'LaTeX Templates' => 'Plantilles LaTeX',
+ 'Language' => 'Idioma',
+ 'Last Cost' => 'Darrer Cost',
+ 'Last Invoice Number' => 'Darrer Núm Fra.',
+ 'Last Numbers & Default Accounts' => 'Darrers Núms & Comptes per Defecte',
+ 'Last Purchase Order Number' => 'Darrera Ordre de Compra',
+ 'Last Sales Order Number' => '',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deixar en blanc el servidor i el port excepte per fer una connexió remota',
+ 'Liability' => 'Passiu',
+ 'Licensed to' => 'Adaptat per',
+ 'Line Total' => 'Total Línia',
+ 'Link' => 'Enllaç',
+ 'Link Accounts' => 'Enllaçar Comptes',
+ 'List Accounts' => 'Llistar Comptes',
+ 'List GIFI' => '',
+ 'List Price' => 'Llistar Preu',
+ 'List Transactions' => 'Llistar Transaccions',
+ 'Login' => 'Entrar',
+ 'Logout' => 'Desconnectar',
+ 'Make' => 'Fer',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => '',
+ 'Microfiche' => '',
+ 'Model' => 'Model',
+ 'N/A' => '',
+ 'Name' => 'Nom',
+ 'Name missing!' => '',
+ 'New Templates' => 'Noves Plantilles',
+ 'No' => 'No',
+ 'No Database Drivers available!' => 'Cap Mòdul de Base de Dades disponible!',
+ 'No Dataset selected!' => 'No hi ha cap Conjunt de Dades seleccionat!',
+ 'No email address for' => 'Falta adreça email de',
+ 'No.' => '',
+ 'Notes' => 'Notes',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => 'No hi ha res per esborrar!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number Format' => 'Format Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'O' => '',
+ 'Obsolete' => 'Obsolet',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'Disponible',
+ 'On Order' => '',
+ 'Open' => 'Obert',
+ 'Oracle Database Administration' => 'Administració Base de Dades Oracle',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Data Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Entry' => 'Pressupostos i Comandes',
+ 'Order Number' => 'Número Ordre',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'Orfe',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Paid' => 'Pagat',
+ 'Paid in full' => '',
+ 'Part' => 'Article',
+ 'Part Number missing!' => 'Falta Número Article!',
+ 'Parts' => 'Articles',
+ 'Parts Inventory' => 'Inventari Articles',
+ 'Password' => 'Contrasenya',
+ 'Password changed!' => '',
+ 'Payables' => 'Pagables',
+ 'Payment' => 'Pagament',
+ 'Payment date missing!' => 'Falta Data Pagament!',
+ 'Payment posted!' => '',
+ 'Payments' => 'Pagaments',
+ 'Pg Database Administration' => 'Administració Base de Dades PostgreSQL',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Falta Port!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Preferències',
+ 'Preferences saved!' => 'Preferències Guardades!',
+ 'Price' => 'Preu',
+ 'Print' => '',
+ 'Printer' => 'Impressora',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Purchase Orders' => 'Ordres de Compra',
+ 'Qty' => 'Quantitat',
+ 'ROP' => 'ROP',
+ 'Rate' => 'Tarifa',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Cobraments',
+ 'Reconciliation' => '',
+ 'Record in' => 'Registar en',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => 'Remanent',
+ 'Report for' => 'Registrar per',
+ 'Reports' => 'Informes',
+ 'Required by' => 'Soliciat per',
+ 'Retained Earnings' => 'Guanys Retinguts',
+ 'Sales' => 'Vendes',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Pressupost',
+ 'Sales Orders' => 'Pressupostos',
+ 'Save' => 'Guardar',
+ 'Save as new' => '',
+ 'Save to File' => 'Guardar a Fitxer',
+ 'Screen' => 'Pantalla',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccionar Conjunt de Dades a esborrar i prèmer "Continuar"',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Preu Venta',
+ 'Send by E-Mail' => 'Enviar per Email',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Service Items' => 'Elements Servei',
+ 'Service Number missing!' => 'Falta Nombre Servei!',
+ 'Services' => 'Serveis',
+ 'Setup Templates' => 'Configurar Plantilles',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Curt',
+ 'Signature' => 'Signatura',
+ 'Sold' => 'Venut',
+ 'Source' => 'Font',
+ 'Standard' => '',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Inventari Compost',
+ 'Stylesheet' => 'Fulla Estils',
+ 'Subject' => '',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'Sistema',
+ 'Tax' => 'Impost',
+ 'Tax Accounts' => 'Comptes Impostos',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Imponible',
+ 'Template saved!' => '',
+ 'Templates' => 'Plantilles',
+ 'Terms: Net' => 'Terms:Net',
+ 'The following Datasets are not in use and can be deleted' => 'Els següents conjunt de dades no s\'usen i poden esborrar-se',
+ 'The following Datasets need to be updated' => 'Cal actualitzar els següents conjunt de dades',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Comprovació preliminar de les fonts existents. No es crearà ni s\'esborrra res en aquest punt!',
+ 'To' => 'Fins',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Per afegir un usuari a un grup, editar el nom, canviar el nom d\'accés i guardar. Un nou usuari amb les mateixes variables es guardarà amb el nou nom d\«accés',
+ 'Top Level' => '',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Falta Data Transacció!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => 'Anul.lació transaccions forçada per totes les dates',
+ 'Transaction reversal enforced up to' => 'Anul.lació transaccions forçada a',
+ 'Transactions' => 'Transaccions',
+ 'Transactions exist, cannot delete customer!' => 'Hi han transaccions, no esborrar el client!',
+ 'Transactions exist, cannot delete vendor!' => 'Hi han transaccions, no esborrar el proveïdor',
+ 'Transactions exist; cannot delete account!' => 'Hi han transaccions, no esborrar compta',
+ 'Trial Balance' => 'Balanç de Comprovació',
+ 'Unit' => 'Unitat',
+ 'Unit of measure' => 'Unitat de Mesura',
+ 'Update' => '',
+ 'Update Dataset' => 'Actualitzar Conjut de Dades',
+ 'Updated' => '',
+ 'Use Templates' => 'Emprar Plantilles',
+ 'User' => 'Usuari',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Proveïdor',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'Versió',
+ 'Weight' => 'Pes',
+ 'Weight Unit' => 'Unitat Pes',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'Year End' => 'Fí Any',
+ 'Yes' => 'Sí',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'No heu entrat cap nom!',
+ 'You must enter a host and port for local and remote connections!' => 'Heu d\'entrar el servidor i el port per les connexions locals i remotes!',
+ 'as at' => '',
+ 'collected on sales' => 'recollit en vendes',
+ 'days' => 'dies',
+ 'does not exist' => 'no existeix',
+ 'ea' => 'unit.',
+ 'emailed to' => 'emailejat a',
+ 'for Period' => 'pel període',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ja és membre!',
+ 'is not a member!' => 'no és membre!',
+ 'localhost' => 'màquina local',
+ 'paid on purchases' => 'pagat al comprat',
+ 'sent to printer' => 'enviat a impressora',
+ 'successfully created!' => 'creat correctament!',
+ 'successfully deleted!' => 'esborrat correctament!',
+ 'to' => '',
+ 'website' => 'web',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/am b/sql-ledger/locale/ct/am
new file mode 100644
index 000000000..6dc7a2cc3
--- /dev/null
+++ b/sql-ledger/locale/ct/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Despeses',
+ 'AR' => 'Ingressos',
+ 'Account' => 'Compta',
+ 'Account Number' => 'Num. Compta',
+ 'Account Number missing!' => 'Falta el Num. Compta!',
+ 'Account Type' => 'Tipus de Compta',
+ 'Account Type missing!' => 'Falta el Tipus de Compta!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Afegir Compta',
+ 'Add GIFI' => 'Add GIFI',
+ 'Address' => 'Adreça',
+ 'Asset' => 'Activat',
+ 'Audit Control' => 'Control Auditoria',
+ 'Backup sent to' => 'Còpia de Seguretat enviada a',
+ 'Books are open' => 'Els Llibres estan Oberts',
+ 'Business Number' => 'Núm. Negoci',
+ 'COGS' => 'Cost de Preu',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'No es pot esborrar la compta per defecte!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Canviar Tipus Caràcters',
+ 'Chart of Accounts' => 'Taula de Comptes',
+ 'Close Books up to' => 'Tancar els llibres fins',
+ 'Company' => 'Empresa',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copy to COA',
+ 'Credit' => 'Crèdit',
+ 'Date Format' => 'Format Data',
+ 'Debit' => 'Dèbit',
+ 'Delete' => 'Esborrar',
+ 'Delete Account' => 'Esborrar Compta',
+ 'Description' => 'Descripció',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Email',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Editar Compta',
+ 'Edit GIFI' => 'Edit GIFI',
+ 'Edit Preferences for' => 'Editar Preferències per',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Enforce transaction reversal for all dates' => 'Forçar l\'anul.lació de transaccions per totes les dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entrar fins a 3 caràcters separats per dos punts (p.e. EUR:USD:CAD) per les monedes nacionals i estrangeres',
+ 'Equity' => 'Balanç',
+ 'Expense' => 'Despeses',
+ 'Expense Account' => 'Compta Despeses',
+ 'Expense/Asset' => 'Despesa/Activa',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Guany en Bescanvi Moneda',
+ 'Foreign Exchange Loss' => 'Pèrdua en Bescanvi Moneda',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'GIFI missing!',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Capçalera',
+ 'Include in drop-down menus' => 'Incloure en Menús Desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incloure aquesta compta en els formularis client/proveïdor per marcar els impostos aplicables client/proveïdor?',
+ 'Income' => 'Ingressos',
+ 'Income Account' => 'Compta Ingressos',
+ 'Inventory' => 'Inventari',
+ 'Inventory Account' => 'Compta Inventari',
+ 'Is this a summary account to record' => 'És una compta resum a registrar?',
+ 'Language' => 'Idioma',
+ 'Last Invoice Number' => 'Darrer Núm Fra.',
+ 'Last Numbers & Default Accounts' => 'Darrers Núms & Comptes per Defecte',
+ 'Last Purchase Order Number' => 'Darrera Ordre de Compra',
+ 'Last Sales Order Number' => 'Last Sales Order Number',
+ 'Liability' => 'Passiu',
+ 'Link' => 'Enllaç',
+ 'Name' => 'Nom',
+ 'No' => 'No',
+ 'No email address for' => 'Falta adreça email de',
+ 'Number' => 'Número',
+ 'Number Format' => 'Format Número',
+ 'Parts Inventory' => 'Inventari Articles',
+ 'Password' => 'Contrasenya',
+ 'Payables' => 'Pagables',
+ 'Payment' => 'Pagament',
+ 'Phone' => 'Tel',
+ 'Preferences saved!' => 'Preferències Guardades!',
+ 'Rate' => 'Tarifa',
+ 'Receivables' => 'Cobraments',
+ 'Sales' => 'Vendes',
+ 'Save' => 'Guardar',
+ 'Service Items' => 'Elements Servei',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Signatura',
+ 'Stylesheet' => 'Fulla Estils',
+ 'Tax' => 'Impost',
+ 'Tax Accounts' => 'Comptes Impostos',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Anul.lació transaccions forçada per totes les dates',
+ 'Transaction reversal enforced up to' => 'Anul.lació transaccions forçada a',
+ 'Transactions exist; cannot delete account!' => 'Hi han transaccions, no esborrar compta',
+ 'Weight Unit' => 'Unitat Pes',
+ 'Year End' => 'Fí Any',
+ 'Yes' => 'Sí',
+ 'does not exist' => 'no existeix',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'afegir_compta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'esborrar' => 'delete',
+ 'edit' => 'edit',
+ 'editar_compta' => 'edit_account',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ap b/sql-ledger/locale/ct/ap
new file mode 100644
index 000000000..7520fd0eb
--- /dev/null
+++ b/sql-ledger/locale/ct/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'Transaccions de Despeses',
+ 'Account' => 'Compta',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Segur que voleu esborrar la Transacció',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'No es pot registrar una transacció per un període tancat',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Tancat',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data Pagament',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Description' => 'Descripció',
+ 'Due Date' => 'Data Venciment',
+ 'Due Date missing!' => 'Falta la Data Venciment!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Canvi',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data Fra.',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Obert',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Número Ordre',
+ 'Paid' => 'Pagat',
+ 'Payment date missing!' => 'Falta Data Pagament!',
+ 'Payments' => 'Pagaments',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Source' => 'Font',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impost',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveïdor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Sí',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ar b/sql-ledger/locale/ct/ar
new file mode 100644
index 000000000..90a111d79
--- /dev/null
+++ b/sql-ledger/locale/ct/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'Transaccions d\'Ingressos',
+ 'Account' => 'Compta',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Segur que voleu esborrar la Transacció',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'No es pot registrar una transacció per un període tancat',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Tancat',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Límit de Crèdit',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data Pagament',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Description' => 'Descripció',
+ 'Due Date' => 'Data Venciment',
+ 'Due Date missing!' => 'Falta la Data Venciment!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Canvi',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data Fra.',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Obert',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Número Ordre',
+ 'Paid' => 'Pagat',
+ 'Payment date missing!' => 'Falta Data Pagament!',
+ 'Payments' => 'Pagaments',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Remanent',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Source' => 'Font',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impost',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Sí',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/arap b/sql-ledger/locale/ct/arap
new file mode 100644
index 000000000..688a01983
--- /dev/null
+++ b/sql-ledger/locale/ct/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adreça',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Descripció',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ca b/sql-ledger/locale/ct/ca
new file mode 100644
index 000000000..89a4023e9
--- /dev/null
+++ b/sql-ledger/locale/ct/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Compta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Taula de Comptes',
+ 'Credit' => 'Crèdit',
+ 'Date' => 'Data',
+ 'Debit' => 'Dèbit',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Description' => 'Descripció',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'List Transactions' => 'Llistar Transaccions',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Fins',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'llistar_transaccions' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/cp b/sql-ledger/locale/ct/cp
new file mode 100644
index 000000000..4bb685f57
--- /dev/null
+++ b/sql-ledger/locale/ct/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Compta',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Client',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Descripció',
+ 'Due' => 'Venciment',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'From' => 'De',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Pagament',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Impressora',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'Fins',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveïdor',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ct b/sql-ledger/locale/ct/ct
new file mode 100644
index 000000000..d88db2a20
--- /dev/null
+++ b/sql-ledger/locale/ct/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Afegir',
+ 'Address' => 'Adreça',
+ 'All' => 'Tots',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Límit de Crèdit',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Esborrar',
+ 'Discount' => 'Descompte',
+ 'E-mail' => 'Email',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nom',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Notes',
+ 'Number' => 'Número',
+ 'Order' => 'Ordre',
+ 'Orphaned' => 'Orfe',
+ 'Phone' => 'Tel',
+ 'Save' => 'Guardar',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'Taxable' => 'Imponible',
+ 'Terms: Net' => 'Terms:Net',
+ 'Transactions exist, cannot delete customer!' => 'Hi han transaccions, no esborrar el client!',
+ 'Transactions exist, cannot delete vendor!' => 'Hi han transaccions, no esborrar el proveïdor',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'dies',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'afegir' => 'add',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'factura' => 'invoice',
+ 'ordre' => 'order',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/gl b/sql-ledger/locale/ct/gl
new file mode 100644
index 000000000..7e259788a
--- /dev/null
+++ b/sql-ledger/locale/ct/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'Compta',
+ 'Add General Ledger Transaction' => 'Afegir Transacció Llibre Major',
+ 'Address' => 'Adreça',
+ 'All' => 'Tots',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Segur que voleu esborrar la Transacció',
+ 'Asset' => 'Activat',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'No es pot tenir un valor simultàniament a Dèbit i a Crèdit',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'No es pot registrar una transacció per un període tancat',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crèdit',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Debit' => 'Dèbit',
+ 'Debit and credit out of balance!' => 'Dèbit i Crèdit fora de balanç!',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Description' => 'Descripció',
+ 'Edit General Ledger Transaction' => 'Editar Transacció del LLibre Major',
+ 'Equity' => 'Balanç',
+ 'Expense' => 'Despeses',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Llibre Major',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Income' => 'Ingressos',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Liability' => 'Passiu',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Informes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Source' => 'Font',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Fins',
+ 'Transaction Date missing!' => 'Falta Data Transacció!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Sí',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ic b/sql-ledger/locale/ct/ic
new file mode 100644
index 000000000..66c84d7c0
--- /dev/null
+++ b/sql-ledger/locale/ct/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Afegir',
+ 'Add Assembly' => 'Afegir Compost',
+ 'Add Part' => 'Afegir Article',
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Add Service' => 'Afegir Servei',
+ 'Address' => 'Adreça',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Compostos',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'Falta el Num. del Compost',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Comprat',
+ 'COGS' => 'Cost de Preu',
+ 'Cannot delete item already invoiced!' => 'No es pot esborrar un element facturat!',
+ 'Cannot delete item on order!' => 'No es pot esborrar un element pressupostat!',
+ 'Cannot delete item which is part of an assembly!' => 'No es pot eliminar un element que és part d\'un compost',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripció',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Edit Assembly' => 'Editar Compost',
+ 'Edit Part' => 'Editar Article',
+ 'Edit Service' => 'Editar Servei',
+ 'Expense' => 'Despeses',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'Image' => 'Image',
+ 'In-line' => 'Afegit',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Income' => 'Ingressos',
+ 'Individual Items' => 'Elements Individuals',
+ 'Inventory' => 'Inventari',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantitat en l\'inventari ha de ser zero abans de marcar-lo com obsolet',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantitat en l\'inventari ha de ser zero abans de marcar-lo com obsolet',
+ 'Inventory quantity must be zero!' => 'La quantitat en l\'inventari ha de ser zero',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Last Cost' => 'Darrer Cost',
+ 'Line Total' => 'Total Línia',
+ 'Link Accounts' => 'Enllaçar Comptes',
+ 'List Price' => 'Llistar Preu',
+ 'Make' => 'Fer',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Model',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'Obsolete' => 'Obsolet',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'Disponible',
+ 'On Order' => 'On Order',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Number' => 'Número Ordre',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Orfe',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Part' => 'Article',
+ 'Part Number missing!' => 'Falta Número Article!',
+ 'Parts' => 'Articles',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preu',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Qty' => 'Quantitat',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Soliciat per',
+ 'Sales' => 'Vendes',
+ 'Sales Order' => 'Pressupost',
+ 'Save' => 'Guardar',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Preu Venta',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Service Number missing!' => 'Falta Nombre Servei!',
+ 'Services' => 'Serveis',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Curt',
+ 'Sold' => 'Venut',
+ 'Stock Assembly' => 'Inventari Compost',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impost',
+ 'To' => 'Fins',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Total',
+ 'Unit' => 'Unitat',
+ 'Unit of measure' => 'Unitat de Mesura',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Pes',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'ea' => 'unit.',
+ 'emailed to' => 'emailejat a',
+ 'hr' => 'hr',
+ 'sent to printer' => 'enviat a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'afegir' => 'add',
+ 'afegir_compost' => 'add_assembly',
+ 'afegir_article' => 'add_part',
+ 'afegir_servei' => 'add_service',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'editar_compost' => 'edit_assembly',
+ 'editar_article' => 'edit_part',
+ 'editar_servei' => 'edit_service',
+ 'guardar' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/io b/sql-ledger/locale/ct/io
new file mode 100644
index 000000000..b48c79b1a
--- /dev/null
+++ b/sql-ledger/locale/ct/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Address' => 'Adreça',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripció',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'In-line' => 'Afegit',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Part' => 'Article',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preu',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Qty' => 'Quantitat',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Soliciat per',
+ 'Sales Order' => 'Pressupost',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Subject',
+ 'To' => 'Fins',
+ 'Unit' => 'Unitat',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'emailed to' => 'emailejat a',
+ 'sent to printer' => 'enviat a impressora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/ir b/sql-ledger/locale/ct/ir
new file mode 100644
index 000000000..c6a42bc97
--- /dev/null
+++ b/sql-ledger/locale/ct/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Compta',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Segur que voleu esborrar la Fra. Num.',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data Venciment',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripció',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'Canvi',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'In-line' => 'Afegit',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data Fra.',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Number' => 'Número Ordre',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Part' => 'Article',
+ 'Payment date missing!' => 'Falta Data Pagament!',
+ 'Payments' => 'Pagaments',
+ 'Phone' => 'Tel',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preu',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Qty' => 'Quantitat',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registar en',
+ 'Required by' => 'Soliciat per',
+ 'Sales Order' => 'Pressupost',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Font',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Unit' => 'Unitat',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveïdor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'Yes' => 'Sí',
+ 'ea' => 'unit.',
+ 'emailed to' => 'emailejat a',
+ 'sent to printer' => 'enviat a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'ordre' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/is b/sql-ledger/locale/ct/is
new file mode 100644
index 000000000..7afaebbd1
--- /dev/null
+++ b/sql-ledger/locale/ct/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Compta',
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Segur que voleu esborrar la Fra. Num.',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Credit Limit' => 'Límit de Crèdit',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data Venciment',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripció',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Canvi',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'In-line' => 'Afegit',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data Fra.',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number' => 'Núm Fra.',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Number' => 'Número Ordre',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Part' => 'Article',
+ 'Payment date missing!' => 'Falta Data Pagament!',
+ 'Payments' => 'Pagaments',
+ 'Phone' => 'Tel',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preu',
+ 'Print' => 'Print',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Qty' => 'Quantitat',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registar en',
+ 'Remaining' => 'Remanent',
+ 'Required by' => 'Soliciat per',
+ 'Sales Order' => 'Pressupost',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Font',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Unit' => 'Unitat',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'Yes' => 'Sí',
+ 'ea' => 'unit.',
+ 'emailed to' => 'emailejat a',
+ 'sent to printer' => 'enviat a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'email' => 'e_mail',
+ 'ordre' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/login b/sql-ledger/locale/ct/login
new file mode 100644
index 000000000..09baae0a8
--- /dev/null
+++ b/sql-ledger/locale/ct/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Referent',
+ 'Accounting' => 'Comptabilitat',
+ 'Database Host' => 'Servidor Base de Dades',
+ 'Dataset' => 'Conjunt de Dades',
+ 'Incorrect Dataset version!' => 'Versió Incorrecta del Conjunt de Dades!',
+ 'Incorrect Password!' => 'Contrasenya no Vàlida!',
+ 'Licensed to' => 'Adaptat per',
+ 'Login' => 'Entrar',
+ 'Name' => 'Nom',
+ 'Password' => 'Contrasenya',
+ 'User' => 'Usuari',
+ 'Version' => 'Versió',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'No heu entrat cap nom!',
+ 'is not a member!' => 'no és membre!',
+ 'localhost' => 'màquina local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'entrar' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/menu b/sql-ledger/locale/ct/menu
new file mode 100644
index 000000000..4defaf155
--- /dev/null
+++ b/sql-ledger/locale/ct/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Despeses',
+ 'AP Aging' => 'Diari de Despeses',
+ 'AR' => 'Ingressos',
+ 'AR Aging' => 'Diari d\'Ingressos',
+ 'Accounting Menu' => 'Menú Comptable',
+ 'Add Account' => 'Afegir Compta',
+ 'Add Assembly' => 'Afegir Compost',
+ 'Add Customer' => 'Afegir Client',
+ 'Add GIFI' => 'Add GIFI',
+ 'Add Part' => 'Afegir Article',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Afegir Servei',
+ 'Add Transaction' => 'Afegir Transacció',
+ 'Add Vendor' => 'Afegir Proveïdor',
+ 'Assemblies' => 'Compostos',
+ 'Audit Control' => 'Control Auditoria',
+ 'Backup' => 'Còpia de Seguretat',
+ 'Balance Sheet' => 'Fulla de Balanç',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Taula de Comptes',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Llibre Major',
+ 'Goods & Services' => 'Bèns i Serveis',
+ 'HTML Templates' => 'Plantilles HTML',
+ 'Income Statement' => 'Balanç Situació',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Plantilles LaTeX',
+ 'List Accounts' => 'Llistar Comptes',
+ 'List GIFI' => 'List GIFI',
+ 'Logout' => 'Desconnectar',
+ 'Order Entry' => 'Pressupostos i Comandes',
+ 'Packing List' => 'Albarà',
+ 'Parts' => 'Articles',
+ 'Payment' => 'Pagament',
+ 'Payments' => 'Pagaments',
+ 'Preferences' => 'Preferències',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Purchase Orders' => 'Ordres de Compra',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Informes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Pressupost',
+ 'Sales Orders' => 'Pressupostos',
+ 'Save to File' => 'Guardar a Fitxer',
+ 'Send by E-Mail' => 'Enviar per Email',
+ 'Services' => 'Serveis',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Inventari Compost',
+ 'Stylesheet' => 'Fulla Estils',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Transaccions',
+ 'Trial Balance' => 'Balanç de Comprovació',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Versió',
+ 'localhost' => 'màquina local',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/oe b/sql-ledger/locale/ct/oe
new file mode 100644
index 000000000..951fd1b8a
--- /dev/null
+++ b/sql-ledger/locale/ct/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Afegir',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Afegir Ordre Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Afegir Pressupost',
+ 'Address' => 'Adreça',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => 'Segur que voleu esborrar l\'Ordre',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Tancat',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacte',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Credit Limit' => 'Límit de Crèdit',
+ 'Curr' => 'Curr',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Data',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Delete' => 'Esborrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripció',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Falta Email!',
+ 'Edit Purchase Order' => 'Editar Ordre Compra',
+ 'Edit Sales Order' => 'Editar Pressupost',
+ 'Exchangerate' => 'Taxa de Canvi',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'In-line' => 'Afegit',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Data Fra.!',
+ 'Invoice Number missing!' => 'Falta Núm Fra.!',
+ 'Item not on file!' => 'No es troba cap arxiu amb aquest element!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta en número en la fila',
+ 'O' => 'O',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Obert',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Data Ordre',
+ 'Order Date missing!' => 'Falta Data Ordre!',
+ 'Order Number' => 'Número Ordre',
+ 'Order Number missing!' => 'Falta Número Ordre!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarà',
+ 'Packing List Date missing!' => 'Falta Data Albarà!',
+ 'Packing List Number missing!' => 'Falta Número Albarà!',
+ 'Part' => 'Article',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preu',
+ 'Print' => 'Print',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Ordre de Compra',
+ 'Purchase Orders' => 'Ordres de Compra',
+ 'Qty' => 'Quantitat',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Remanent',
+ 'Required by' => 'Soliciat per',
+ 'Sales Order' => 'Pressupost',
+ 'Sales Orders' => 'Pressupostos',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccionar d\'un dels elements de sota',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Service' => 'Servei',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impost',
+ 'Tax Included' => 'Impostos Inclosos',
+ 'Terms: Net' => 'Terms:Net',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Unit' => 'Unitat',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveïdor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Quin tipus d\'element és?',
+ 'Yes' => 'Sí',
+ 'days' => 'dies',
+ 'ea' => 'unit.',
+ 'emailed to' => 'emailejat a',
+ 'sent to printer' => 'enviat a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'afegir' => 'add',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'email' => 'e_mail',
+ 'factura' => 'invoice',
+ 'print' => 'print',
+ 'guardar' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'sí' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/pe b/sql-ledger/locale/ct/pe
new file mode 100644
index 000000000..01856d566
--- /dev/null
+++ b/sql-ledger/locale/ct/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Afegir',
+ 'Add Project' => 'Add Project',
+ 'All' => 'Tots',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Esborrar',
+ 'Description' => 'Descripció',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Orfe',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Guardar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'afegir' => 'add',
+ 'continuar' => 'continue',
+ 'esborrar' => 'delete',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/rc b/sql-ledger/locale/ct/rc
new file mode 100644
index 000000000..8b6112cd9
--- /dev/null
+++ b/sql-ledger/locale/ct/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Compta',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Data',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Descripció',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'De',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Pagament',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Font',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'Fins',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ct/rp b/sql-ledger/locale/ct/rp
new file mode 100644
index 000000000..75eff428b
--- /dev/null
+++ b/sql-ledger/locale/ct/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Diari de Despeses',
+ 'AR Aging' => 'Diari d\'Ingressos',
+ 'Account' => 'Compta',
+ 'Accounts' => 'Accounts',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunt',
+ 'Aug' => 'Ago',
+ 'August' => 'Agost',
+ 'Balance Sheet' => 'Fulla de Balanç',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar amb',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Còpies',
+ 'Credit' => 'Crèdit',
+ 'Current' => 'Current',
+ 'Customer' => 'Client',
+ 'Date' => 'Data',
+ 'Debit' => 'Dèbit',
+ 'Dec' => 'Des',
+ 'December' => 'Desembre',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Descripció',
+ 'Due' => 'Venciment',
+ 'E-mail' => 'Email',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrer',
+ 'From' => 'De',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Capçalera',
+ 'ID' => 'ID',
+ 'In-line' => 'Afegit',
+ 'Include in Report' => 'Incloure en l\'Informe',
+ 'Income Statement' => 'Balanç Situació',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'Gen',
+ 'January' => 'Gener',
+ 'Jul' => 'Jul',
+ 'July' => 'Juliol',
+ 'Jun' => 'Jun',
+ 'June' => 'Juny',
+ 'Mar' => 'Mar',
+ 'March' => 'Març',
+ 'May' => 'Mai',
+ 'May ' => 'Maig',
+ 'Message' => 'Message',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagaments',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Impressora',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Registrar per',
+ 'Retained Earnings' => 'Guanys Retinguts',
+ 'Screen' => 'Pantalla',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Setembre',
+ 'Source' => 'Font',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impost',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'Fins',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balanç de Comprovació',
+ 'Vendor' => 'Proveïdor',
+ 'as at' => 'as at',
+ 'collected on sales' => 'recollit en vendes',
+ 'for Period' => 'pel període',
+ 'paid on purchases' => 'pagat al comprat',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'email' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/COPYING b/sql-ledger/locale/cz/COPYING
new file mode 100644
index 000000000..64c58a220
--- /dev/null
+++ b/sql-ledger/locale/cz/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Czech texts:
+#
+# Author: Tomas Fencl <tomas.fencl@centrum.cz>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/cz/LANGUAGE b/sql-ledger/locale/cz/LANGUAGE
new file mode 100644
index 000000000..618b7f5c9
--- /dev/null
+++ b/sql-ledger/locale/cz/LANGUAGE
@@ -0,0 +1 @@
+Czech
diff --git a/sql-ledger/locale/cz/admin b/sql-ledger/locale/cz/admin
new file mode 100644
index 000000000..4a238b577
--- /dev/null
+++ b/sql-ledger/locale/cz/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Pøístupová práva',
+ 'Accounting' => 'Úèetnictví',
+ 'Add User' => 'Nový u¾ivatel',
+ 'Address' => 'Adresa',
+ 'Administration' => 'Administrace',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'V¹echna data jsou aktualizována',
+ 'Change Admin Password' => 'Zmìnit heslo administrátora',
+ 'Change Password' => 'Zmìnit heslo',
+ 'Character Set' => 'Znaková sada',
+ 'Click on login name to edit!' => 'Pro úpravy kliknìte na jméno u¾ivatele',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Pøipojit k serveru',
+ 'Continue' => 'Pokraèování',
+ 'Create Chart of Accounts' => 'Vytvoøit úètový rozvrh',
+ 'Create Dataset' => 'Vytvoøit dataset',
+ 'DBI not installed!' => 'DBI není nainstalováno',
+ 'Database' => 'Databáze',
+ 'Database Administration' => 'Správa databáze',
+ 'Database Driver not checked!' => 'Nepodaøilo se zkontrolovat ovladaè databáze',
+ 'Database User missing!' => 'Chybí jméno pro pøihlá¹ení k databázi!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Není zadán dataset',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Formát data',
+ 'Delete' => 'Vymazat',
+ 'Delete Dataset' => 'Zru¹it dataset',
+ 'Directory' => 'Adresáø',
+ 'Driver' => 'Øidiè',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Upravit u¾ivatele',
+ 'Existing Datasets' => 'Datasety',
+ 'Fax' => 'Fax',
+ 'Host' => 'Server',
+ 'Hostname missing!' => 'Chybí jméno serveru!',
+ 'Incorrect Password!' => 'Nesprávné heslo!',
+ 'Language' => 'Jazyk',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Pro lokální databázi, nezadávejte adresu serveru a port.',
+ 'Login' => 'U¾ivatelské jméno',
+ 'Name' => 'Jméno',
+ 'New Templates' => 'Nové ¹ablony',
+ 'No Database Drivers available!' => 'Není instalován ¾ádný ovladaè databáze!',
+ 'No Dataset selected!' => 'Není zvolen ¾ádný dataset!',
+ 'Nothing to delete!' => 'Nejsou polo¾ky k vymazání!',
+ 'Number Format' => 'Èíselný formát',
+ 'Oracle Database Administration' => 'Oracle Správa databáze',
+ 'Password' => 'Heslo',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Pg Správa databáze',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Chybí èíslo portu!',
+ 'Printer' => 'Tiskárna',
+ 'Save' => 'Ulo¾it',
+ 'Select a Dataset to delete and press "Continue"' => 'Zvolte dataset, který chcete vymazat a stisknìte "Pokraèovat"',
+ 'Setup Templates' => 'Nastavení ¹ablon',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Podpis',
+ 'Stylesheet' => 'Stylesheet',
+ 'Templates' => '©ablony',
+ 'The following Datasets are not in use and can be deleted' => 'Uvedené datasety nejsou vyu¾ívány a mohou být vymazány',
+ 'The following Datasets need to be updated' => 'Následující data musí být aktualizována',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Toto je pøedbì¾ná kontrola existence zdrojových dokumentù. V této fázi nebude databáze aktualizována.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Pro pøidání u¾ivatele do skupiny otevøete existujícího u¾ivatele a ulo¾te jej s jiným u¾ivatelským jménem. Nový u¾ivatel bude vytvoøen s toto¾ným nastavením v¹ech promìnných.',
+ 'Update Dataset' => 'Aktualizovat data',
+ 'Use Templates' => 'Vyu¾ít ¹ablony',
+ 'User' => 'U¾ivatel',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Verze',
+ 'You must enter a host and port for local and remote connections!' => 'Pro lokální i vzdálené pøipojení je nutné zadat adresu serveru a port!',
+ 'does not exist' => 'neexistuje',
+ 'is already a member!' => 'ji¾ existuje!',
+ 'localhost' => 'lokální server',
+ 'successfully created!' => 'úspì¹nì vytvoøen!',
+ 'successfully deleted!' => 'úspì¹nì smazán!',
+ 'website' => 'www adresa',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'nový_u¾ivatel' => 'add_user',
+ 'zmìnit_heslo_administrátora' => 'change_admin_password',
+ 'zmìnit_heslo' => 'change_password',
+ 'pokraèování' => 'continue',
+ 'vytvoøit_dataset' => 'create_dataset',
+ 'vymazat' => 'delete',
+ 'zru¹it_dataset' => 'delete_dataset',
+ 'u¾ivatelské_jméno' => 'login',
+ 'oracle_správa_databáze' => 'oracle_database_administration',
+ 'pg_správa_databáze' => 'pg_database_administration',
+ 'ulo¾it' => 'save',
+ 'aktualizovat_data' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/all b/sql-ledger/locale/cz/all
new file mode 100644
index 000000000..71704c1e5
--- /dev/null
+++ b/sql-ledger/locale/cz/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Závazky',
+ 'AP Aging' => 'Analýza splatnosti',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'Faktury pøijaté',
+ 'AR' => 'Pohledávky',
+ 'AR Aging' => 'Analýza splatnosti',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'Faktury vydané',
+ 'About' => 'O programu',
+ 'Access Control' => 'Pøístupová práva',
+ 'Account' => 'Úèet',
+ 'Account Number' => 'Èíslo úètu',
+ 'Account Number missing!' => 'Chybí èíslo úètu!',
+ 'Account Type' => 'Typ úètu',
+ 'Account Type missing!' => 'Chybí typ úètu!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Úèetnictví',
+ 'Accounting Menu' => 'Menu úèetnictví',
+ 'Accounts' => 'Úèty',
+ 'Active' => '',
+ 'Add' => 'Pøidat',
+ 'Add Account' => 'Zalo¾it úèet',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'Nový výrobek',
+ 'Add Customer' => 'Nový zákazník',
+ 'Add GIFI' => 'Doplnit úètovací øetìzec',
+ 'Add General Ledger Transaction' => 'Nový zápis do hlavní knihy',
+ 'Add Part' => 'Pøíjem zbo¾í',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Add Service' => 'Nový druh slu¾by',
+ 'Add Transaction' => 'Nová transakce',
+ 'Add User' => 'Nový u¾ivatel',
+ 'Add Vendor' => 'Nový dodavatel',
+ 'Address' => 'Adresa',
+ 'Administration' => 'Administrace',
+ 'Administrator' => '',
+ 'All' => 'V¹e',
+ 'All Datasets up to date!' => 'V¹echna data jsou aktualizována',
+ 'Amount' => 'Èástka',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Invoice Number' => 'Opravdu chcete vymazat fakturu èíslo',
+ 'Are you sure you want to delete Order Number' => 'Opravdu chcete vymazat objednávku èíslo',
+ 'Are you sure you want to delete Transaction' => 'Opravdu chcete vymazat transakci?',
+ 'Assemblies' => 'Výrobky',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'Chybí èíslo výrobku',
+ 'Asset' => 'Aktiva',
+ 'Attachment' => 'Pøílohy',
+ 'Audit Control' => 'Kontrola pøístupù',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'BOM' => '',
+ 'Backup' => 'Záloha',
+ 'Backup sent to' => 'Záloha odeslána na adresu',
+ 'Balance' => '',
+ 'Balance Sheet' => 'Rozvaha',
+ 'Bcc' => '',
+ 'Bin' => 'Paleta',
+ 'Books are open' => '¡Uèetní knihy jsou otevøeny',
+ 'Bought' => 'Nakoupeno',
+ 'Business Number' => 'IÈO',
+ 'C' => '',
+ 'COGS' => 'Náklady na prodané zbo¾í',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'Úèet je nastaven jako defaultní, nelze jej proto vymamazat!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'Ji¾ fakturované polo¾ky nelze vymazat!',
+ 'Cannot delete item on order!' => 'Polo¾ku objednávky nelze vymazat!',
+ 'Cannot delete item which is part of an assembly!' => 'Nelze vymazat polo¾ku, která je souèástí výrobku!',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'Nelze úètovat souèasnì Má dáti i Dal!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => '',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => '',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'Do uzavøeného období nelze úètovat!',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Zmìnit heslo administrátora',
+ 'Change Password' => 'Zmìnit heslo',
+ 'Character Set' => 'Znaková sada',
+ 'Chart of Accounts' => 'Úètový rozvrh',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Pro úpravy kliknìte na jméno u¾ivatele',
+ 'Close Books up to' => 'Uzavøít úèetní knihy do',
+ 'Closed' => 'Zaplaceno',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Porovnáno k',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Connect to' => 'Pøipojit k serveru',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Copy to COA' => 'Zkopírovat do úètového rozvrhu',
+ 'Create Chart of Accounts' => 'Vytvoøit úètový rozvrh',
+ 'Create Dataset' => 'Vytvoøit dataset',
+ 'Credit' => 'Dal',
+ 'Credit Limit' => 'Úvìrový limit',
+ 'Curr' => 'Mìna',
+ 'Currency' => 'Mìna',
+ 'Current' => '',
+ 'Customer' => 'Odbìratel',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'DBI není nainstalováno',
+ 'Database' => 'Databáze',
+ 'Database Administration' => 'Správa databáze',
+ 'Database Driver not checked!' => 'Nepodaøilo se zkontrolovat ovladaè databáze',
+ 'Database Host' => 'Databázový server',
+ 'Database User missing!' => 'Chybí jméno pro pøihlá¹ení k databázi!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Není zadán dataset',
+ 'Dataset updated!' => '',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Datum splatnosti',
+ 'Date Format' => 'Formát data',
+ 'Date Paid' => 'Zaplaceno',
+ 'Date missing!' => '',
+ 'Debit' => 'Má dáti',
+ 'Debit and credit out of balance!' => 'Má dáti a Dal se nerovnají.',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Decimalplaces' => '',
+ 'Delete' => 'Vymazat',
+ 'Delete Account' => 'Vymazat úèet',
+ 'Delete Dataset' => 'Zru¹it dataset',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'Popis',
+ 'Difference' => '',
+ 'Directory' => 'Adresáø',
+ 'Discount' => 'Sleva',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Øidiè',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Splatno',
+ 'Due Date' => 'Datum splatnosti',
+ 'Due Date missing!' => 'Chybí datum splatnosti!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Edit' => '',
+ 'Edit Account' => 'Upravit úèet',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'Upravit výrobek',
+ 'Edit GIFI' => 'Upravit úètovací øetìzec',
+ 'Edit General Ledger Transaction' => 'Opravit záznam v hlavní knize',
+ 'Edit Part' => 'Upravit zbo¾í',
+ 'Edit Preferences for' => 'Nastavení pro',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Upravit vystavenou objednávku',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Upravit pøijatou objednávku',
+ 'Edit Service' => 'Upravit slu¾bu',
+ 'Edit Template' => 'Upravit ¹ablonu',
+ 'Edit User' => 'Upravit u¾ivatele',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => 'Zakázat editaci v¹ech úèetních polo¾ek',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vlo¾te zkratky mìn (max. 3 znaky) oddìlené dvojteèkou pro domácí i cizí mìny (napø. CZK:USD:EUR)',
+ 'Equity' => 'Vlastní jmìní',
+ 'Exch' => 'Kurz',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => '',
+ 'Exchangerate missing!' => '',
+ 'Existing Datasets' => 'Datasety',
+ 'Expense' => 'Náklady',
+ 'Expense Account' => 'Nákladový úèet',
+ 'Expense/Asset' => 'Náklad',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'Foreign Exchange Gain' => 'Kurzový zisk',
+ 'Foreign Exchange Loss' => 'Kurzová ztráta',
+ 'From' => 'z',
+ 'GIFI' => 'Úètovací øetìzec',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => 'Chybí úètovací øetìzec!',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Hlavní kniha',
+ 'Goods & Services' => 'Zbo¾í a slu¾by',
+ 'HTML Templates' => 'HTML ¹ablony',
+ 'Heading' => 'Nadpis',
+ 'Host' => 'Server',
+ 'Hostname missing!' => 'Chybí jméno serveru!',
+ 'ID' => 'ID',
+ 'Image' => '',
+ 'In-line' => 'Vlo¾ené',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Include in drop-down menus' => 'Ukazovat v drop-down menu',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Zahrnovat tento úèet ve formuláøích odbìratelù/dodavatelù, aby bylo mo¾né oznaèit je za zdanitelné?',
+ 'Income' => 'Výnosy',
+ 'Income Account' => 'Výnosový úèet',
+ 'Income Statement' => 'Výsledovka',
+ 'Incorrect Dataset version!' => '©patná verze dat!',
+ 'Incorrect Password!' => 'Nesprávné heslo!',
+ 'Individual Items' => 'Komponenty výrobku',
+ 'Inventory' => 'Zásoby',
+ 'Inventory Account' => 'Úèet zásob',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Pøed vyøazením výrobu, musí být stav na skladì nulový!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Pøed vyøazením zbo¾í musí být mno¾ství na skladì nulové',
+ 'Inventory quantity must be zero!' => 'Stav skladu musí být nulový!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Datum vystavení',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'Øídící úèet pro',
+ 'Item deleted!' => '',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'LaTeX Templates' => 'LaTeX ¹ablony',
+ 'Language' => 'Jazyk',
+ 'Last Cost' => 'Poslední cena',
+ 'Last Invoice Number' => 'Èíslo poslední faktury',
+ 'Last Numbers & Default Accounts' => 'Poslední èísla a standardní èísla úètù',
+ 'Last Purchase Order Number' => 'Èíslo poslední objednávky',
+ 'Last Sales Order Number' => 'Èíslo poslední objednávky',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Pro lokální databázi, nezadávejte adresu serveru a port.',
+ 'Liability' => 'Závazek',
+ 'Licensed to' => 'Licencováno pro',
+ 'Line Total' => 'Øádek celkem',
+ 'Link' => 'Vazby',
+ 'Link Accounts' => 'Vazby mezi úèty',
+ 'List Accounts' => 'Seznam úètù',
+ 'List GIFI' => 'Vypsat úètovací øetìzce',
+ 'List Price' => 'Výrobní cena',
+ 'List Transactions' => 'Vypsat transakce',
+ 'Login' => 'U¾ivatelské jméno',
+ 'Logout' => 'Odhlásit',
+ 'Make' => 'Výrobce',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Microfiche' => '',
+ 'Model' => 'Model',
+ 'N/A' => '---',
+ 'Name' => 'Jméno',
+ 'Name missing!' => '',
+ 'New Templates' => 'Nové ¹ablony',
+ 'No' => 'Ne',
+ 'No Database Drivers available!' => 'Není instalován ¾ádný ovladaè databáze!',
+ 'No Dataset selected!' => 'Není zvolen ¾ádný dataset!',
+ 'No email address for' => 'Chybí emailová adresy pro',
+ 'No.' => '',
+ 'Notes' => 'Poznámky',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => 'Nejsou polo¾ky k vymazání!',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number Format' => 'Èíselný formát',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'O' => '',
+ 'Obsolete' => 'Vyøazené',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'On Hand' => 'K dispozici',
+ 'On Order' => '',
+ 'Open' => 'Otevøené',
+ 'Oracle Database Administration' => 'Oracle Správa databáze',
+ 'Order' => 'Objednávka',
+ 'Order Date' => 'Datum objednávky',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Entry' => 'Zadání objednávky',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'Neprodejné',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Paid' => 'Zaplaceno',
+ 'Paid in full' => '',
+ 'Part' => 'Zbo¾í',
+ 'Part Number missing!' => 'Chybí èíslo zbo¾í!',
+ 'Parts' => 'Díly',
+ 'Parts Inventory' => 'Zbo¾í',
+ 'Password' => 'Heslo',
+ 'Password changed!' => '',
+ 'Payables' => 'Závazky',
+ 'Payment' => 'Platba',
+ 'Payment date missing!' => 'Chybí datum platby!',
+ 'Payment posted!' => '',
+ 'Payments' => 'Platby',
+ 'Pg Database Administration' => 'Pg Správa databáze',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Chybí èíslo portu!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Nastavení',
+ 'Preferences saved!' => 'Nastavení bylo ulo¾eno!',
+ 'Price' => 'Cena',
+ 'Print' => '',
+ 'Printer' => 'Tiskárna',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Purchase Orders' => 'Vystavené objednávky',
+ 'Qty' => 'Mno¾ství',
+ 'ROP' => 'ROP',
+ 'Rate' => 'Sazba',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Pohledávky',
+ 'Reconciliation' => '',
+ 'Record in' => 'Zaúètovat do',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => 'Zbývá',
+ 'Report for' => 'Výkaz za',
+ 'Reports' => 'Sestavy',
+ 'Required by' => 'Po¾adováno do',
+ 'Retained Earnings' => 'Nerozdìlený zisk',
+ 'Sales' => 'Pøíjmy z prodeje',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Sales Orders' => 'Pøijaté objednávky',
+ 'Save' => 'Ulo¾it',
+ 'Save as new' => '',
+ 'Save to File' => 'Ulo¾it do souboru',
+ 'Screen' => 'Na obrazovku',
+ 'Select a Dataset to delete and press "Continue"' => 'Zvolte dataset, který chcete vymazat a stisknìte "Pokraèovat"',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Prodejní cena',
+ 'Send by E-Mail' => 'Poslat e-mailem',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Service Items' => 'Polo¾ky slu¾eb',
+ 'Service Number missing!' => 'Chybí èíslo slu¾by!',
+ 'Services' => 'Slu¾by',
+ 'Setup Templates' => 'Nastavení ¹ablon',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Krátký výpis',
+ 'Signature' => 'Podpis',
+ 'Sold' => 'Prodané',
+ 'Source' => 'Zdroj',
+ 'Standard' => 'Standardní',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Výrobky',
+ 'Stylesheet' => 'Stylesheet',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'System' => 'Systém',
+ 'Tax' => 'Daò',
+ 'Tax Accounts' => 'Daòové úèty',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Zdanitelné',
+ 'Template saved!' => '',
+ 'Templates' => '©ablony',
+ 'Terms: Net' => 'Netto',
+ 'The following Datasets are not in use and can be deleted' => 'Uvedené datasety nejsou vyu¾ívány a mohou být vymazány',
+ 'The following Datasets need to be updated' => 'Následující data musí být aktualizována',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Toto je pøedbì¾ná kontrola existence zdrojových dokumentù. V této fázi nebude databáze aktualizována.',
+ 'To' => 'do',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Pro pøidání u¾ivatele do skupiny otevøete existujícího u¾ivatele a ulo¾te jej s jiným u¾ivatelským jménem. Nový u¾ivatel bude vytvoøen s toto¾ným nastavením v¹ech promìnných.',
+ 'Top Level' => '',
+ 'Total' => 'Celkem',
+ 'Transaction Date missing!' => 'Chybí datum!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => 'Editace v¹ech polo¾ek zakázána (je nutné provést storno a nové zadání)',
+ 'Transaction reversal enforced up to' => 'Editace polo¾ek zakázána do',
+ 'Transactions' => 'Polo¾ky',
+ 'Transactions exist, cannot delete customer!' => 'Odbìratele nelze vymazat, proto¾e k nìmu existují transakce!',
+ 'Transactions exist, cannot delete vendor!' => 'Dodavatele nelze vymazat, proto¾e k nìmu existují transakce!',
+ 'Transactions exist; cannot delete account!' => 'Úèet nelze vymazat, proto¾e na nìm je úètováno!',
+ 'Trial Balance' => 'Obratová pøedvaha',
+ 'Unit' => 'Jednotka',
+ 'Unit of measure' => 'Mìrná jednotka',
+ 'Update' => '',
+ 'Update Dataset' => 'Aktualizovat data',
+ 'Updated' => '',
+ 'Use Templates' => 'Vyu¾ít ¹ablony',
+ 'User' => 'U¾ivatel',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Dodavatel',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'Verze',
+ 'Weight' => 'Váha',
+ 'Weight Unit' => 'Jednotka váhy',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'Year End' => 'Konec roku',
+ 'Yes' => 'Ano',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'Nezadal jste jméno!',
+ 'You must enter a host and port for local and remote connections!' => 'Pro lokální i vzdálené pøipojení je nutné zadat adresu serveru a port!',
+ 'as at' => '',
+ 'collected on sales' => 'vybráno na výstupu',
+ 'days' => 'dní',
+ 'does not exist' => 'neexistuje',
+ 'ea' => 'm.j.',
+ 'emailed to' => 'odesláno na adresu',
+ 'for Period' => 'za období',
+ 'hr' => 'hod',
+ 'is already a member!' => 'ji¾ existuje!',
+ 'is not a member!' => 'není platným u¾ivatelem',
+ 'localhost' => 'lokální server',
+ 'paid on purchases' => 'zaplaceno na vstupu',
+ 'sent to printer' => 'vyti¹tìno',
+ 'successfully created!' => 'úspì¹nì vytvoøen!',
+ 'successfully deleted!' => 'úspì¹nì smazán!',
+ 'to' => '',
+ 'website' => 'www adresa',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/am b/sql-ledger/locale/cz/am
new file mode 100644
index 000000000..caee54c27
--- /dev/null
+++ b/sql-ledger/locale/cz/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Závazky',
+ 'AR' => 'Pohledávky',
+ 'Account' => 'Úèet',
+ 'Account Number' => 'Èíslo úètu',
+ 'Account Number missing!' => 'Chybí èíslo úètu!',
+ 'Account Type' => 'Typ úètu',
+ 'Account Type missing!' => 'Chybí typ úètu!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Zalo¾it úèet',
+ 'Add GIFI' => 'Doplnit úètovací øetìzec',
+ 'Address' => 'Adresa',
+ 'Asset' => 'Aktiva',
+ 'Audit Control' => 'Kontrola pøístupù',
+ 'Backup sent to' => 'Záloha odeslána na adresu',
+ 'Books are open' => '¡Uèetní knihy jsou otevøeny',
+ 'Business Number' => 'IÈO',
+ 'COGS' => 'Náklady na prodané zbo¾í',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'Úèet je nastaven jako defaultní, nelze jej proto vymamazat!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Znaková sada',
+ 'Chart of Accounts' => 'Úètový rozvrh',
+ 'Close Books up to' => 'Uzavøít úèetní knihy do',
+ 'Company' => 'Firma',
+ 'Continue' => 'Pokraèování',
+ 'Copy to COA' => 'Zkopírovat do úètového rozvrhu',
+ 'Credit' => 'Dal',
+ 'Date Format' => 'Formát data',
+ 'Debit' => 'Má dáti',
+ 'Delete' => 'Vymazat',
+ 'Delete Account' => 'Vymazat úèet',
+ 'Description' => 'Popis',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Upravit úèet',
+ 'Edit GIFI' => 'Upravit úètovací øetìzec',
+ 'Edit Preferences for' => 'Nastavení pro',
+ 'Edit Template' => 'Upravit ¹ablonu',
+ 'Enforce transaction reversal for all dates' => 'Zakázat editaci v¹ech úèetních polo¾ek',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vlo¾te zkratky mìn (max. 3 znaky) oddìlené dvojteèkou pro domácí i cizí mìny (napø. CZK:USD:EUR)',
+ 'Equity' => 'Vlastní jmìní',
+ 'Expense' => 'Náklady',
+ 'Expense Account' => 'Nákladový úèet',
+ 'Expense/Asset' => 'Náklad',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Kurzový zisk',
+ 'Foreign Exchange Loss' => 'Kurzová ztráta',
+ 'GIFI' => 'Úètovací øetìzec',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'Chybí úètovací øetìzec!',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Nadpis',
+ 'Include in drop-down menus' => 'Ukazovat v drop-down menu',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Zahrnovat tento úèet ve formuláøích odbìratelù/dodavatelù, aby bylo mo¾né oznaèit je za zdanitelné?',
+ 'Income' => 'Výnosy',
+ 'Income Account' => 'Výnosový úèet',
+ 'Inventory' => 'Zásoby',
+ 'Inventory Account' => 'Úèet zásob',
+ 'Is this a summary account to record' => 'Øídící úèet pro',
+ 'Language' => 'Jazyk',
+ 'Last Invoice Number' => 'Èíslo poslední faktury',
+ 'Last Numbers & Default Accounts' => 'Poslední èísla a standardní èísla úètù',
+ 'Last Purchase Order Number' => 'Èíslo poslední objednávky',
+ 'Last Sales Order Number' => 'Èíslo poslední objednávky',
+ 'Liability' => 'Závazek',
+ 'Link' => 'Vazby',
+ 'Name' => 'Jméno',
+ 'No' => 'Ne',
+ 'No email address for' => 'Chybí emailová adresy pro',
+ 'Number' => 'Èíslo',
+ 'Number Format' => 'Èíselný formát',
+ 'Parts Inventory' => 'Zbo¾í',
+ 'Password' => 'Heslo',
+ 'Payables' => 'Závazky',
+ 'Payment' => 'Platba',
+ 'Phone' => 'Telefon',
+ 'Preferences saved!' => 'Nastavení bylo ulo¾eno!',
+ 'Rate' => 'Sazba',
+ 'Receivables' => 'Pohledávky',
+ 'Sales' => 'Pøíjmy z prodeje',
+ 'Save' => 'Ulo¾it',
+ 'Service Items' => 'Polo¾ky slu¾eb',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Podpis',
+ 'Stylesheet' => 'Stylesheet',
+ 'Tax' => 'Daò',
+ 'Tax Accounts' => 'Daòové úèty',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Editace v¹ech polo¾ek zakázána (je nutné provést storno a nové zadání)',
+ 'Transaction reversal enforced up to' => 'Editace polo¾ek zakázána do',
+ 'Transactions exist; cannot delete account!' => 'Úèet nelze vymazat, proto¾e na nìm je úètováno!',
+ 'Weight Unit' => 'Jednotka váhy',
+ 'Year End' => 'Konec roku',
+ 'Yes' => 'Ano',
+ 'does not exist' => 'neexistuje',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'zalo¾it_úèet' => 'add_account',
+ 'pokraèování' => 'continue',
+ 'zkopírovat_do_úètového_rozvrhu' => 'copy_to_coa',
+ 'vymazat' => 'delete',
+ 'edit' => 'edit',
+ 'upravit_úèet' => 'edit_account',
+ 'ulo¾it' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ap b/sql-ledger/locale/cz/ap
new file mode 100644
index 000000000..609bcbb7b
--- /dev/null
+++ b/sql-ledger/locale/cz/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'Faktury pøijaté',
+ 'Account' => 'Úèet',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Transaction' => 'Opravdu chcete vymazat transakci?',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Do uzavøeného období nelze úètovat!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Zaplaceno',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Continue' => 'Pokraèování',
+ 'Currency' => 'Mìna',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Zaplaceno',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Description' => 'Popis',
+ 'Due Date' => 'Datum splatnosti',
+ 'Due Date missing!' => 'Chybí datum splatnosti!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Kurz',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Datum vystavení',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Open' => 'Otevøené',
+ 'Order' => 'Objednávka',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Paid' => 'Zaplaceno',
+ 'Payment date missing!' => 'Chybí datum platby!',
+ 'Payments' => 'Platby',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Source' => 'Zdroj',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax' => 'Daò',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dodavatel',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Ano',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ar b/sql-ledger/locale/cz/ar
new file mode 100644
index 000000000..512634f8b
--- /dev/null
+++ b/sql-ledger/locale/cz/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'Faktury vydané',
+ 'Account' => 'Úèet',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Transaction' => 'Opravdu chcete vymazat transakci?',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Do uzavøeného období nelze úètovat!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Zaplaceno',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Continue' => 'Pokraèování',
+ 'Credit Limit' => 'Úvìrový limit',
+ 'Currency' => 'Mìna',
+ 'Customer' => 'Odbìratel',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Zaplaceno',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Description' => 'Popis',
+ 'Due Date' => 'Datum splatnosti',
+ 'Due Date missing!' => 'Chybí datum splatnosti!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Kurz',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Datum vystavení',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Open' => 'Otevøené',
+ 'Order' => 'Objednávka',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Paid' => 'Zaplaceno',
+ 'Payment date missing!' => 'Chybí datum platby!',
+ 'Payments' => 'Platby',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Zbývá',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Source' => 'Zdroj',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax' => 'Daò',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Ano',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/arap b/sql-ledger/locale/cz/arap
new file mode 100644
index 000000000..3db4284d5
--- /dev/null
+++ b/sql-ledger/locale/cz/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresa',
+ 'Continue' => 'Pokraèování',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Popis',
+ 'Number' => 'Èíslo',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'pokraèování' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ca b/sql-ledger/locale/cz/ca
new file mode 100644
index 000000000..cd48d2f7c
--- /dev/null
+++ b/sql-ledger/locale/cz/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Úèet',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Úètový rozvrh',
+ 'Credit' => 'Dal',
+ 'Date' => 'Datum',
+ 'Debit' => 'Má dáti',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Description' => 'Popis',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'GIFI' => 'Úètovací øetìzec',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'List Transactions' => 'Vypsat transakce',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Subtotal' => 'Mezisouèet',
+ 'To' => 'do',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'vypsat_transakce' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/cp b/sql-ledger/locale/cz/cp
new file mode 100644
index 000000000..f85ed50f0
--- /dev/null
+++ b/sql-ledger/locale/cz/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Úèet',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Pokraèování',
+ 'Currency' => 'Mìna',
+ 'Customer' => 'Odbìratel',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Popis',
+ 'Due' => 'Splatno',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'From' => 'z',
+ 'Invoice' => 'Faktura',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Èíslo',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Platba',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Tiskárna',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'do',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dodavatel',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'pokraèování' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ct b/sql-ledger/locale/cz/ct
new file mode 100644
index 000000000..7c2863d4a
--- /dev/null
+++ b/sql-ledger/locale/cz/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Pøidat',
+ 'Address' => 'Adresa',
+ 'All' => 'V¹e',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Credit Limit' => 'Úvìrový limit',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Vymazat',
+ 'Discount' => 'Sleva',
+ 'E-mail' => 'E-mail',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Invoice' => 'Faktura',
+ 'Name' => 'Jméno',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Poznámky',
+ 'Number' => 'Èíslo',
+ 'Order' => 'Objednávka',
+ 'Orphaned' => 'Neprodejné',
+ 'Phone' => 'Telefon',
+ 'Save' => 'Ulo¾it',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'Taxable' => 'Zdanitelné',
+ 'Terms: Net' => 'Netto',
+ 'Transactions exist, cannot delete customer!' => 'Odbìratele nelze vymazat, proto¾e k nìmu existují transakce!',
+ 'Transactions exist, cannot delete vendor!' => 'Dodavatele nelze vymazat, proto¾e k nìmu existují transakce!',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'dní',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'pøidat' => 'add',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'faktura' => 'invoice',
+ 'objednávka' => 'order',
+ 'ulo¾it' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/gl b/sql-ledger/locale/cz/gl
new file mode 100644
index 000000000..1928de8f2
--- /dev/null
+++ b/sql-ledger/locale/cz/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'Úèet',
+ 'Add General Ledger Transaction' => 'Nový zápis do hlavní knihy',
+ 'Address' => 'Adresa',
+ 'All' => 'V¹e',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Transaction' => 'Opravdu chcete vymazat transakci?',
+ 'Asset' => 'Aktiva',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'Nelze úètovat souèasnì Má dáti i Dal!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Do uzavøeného období nelze úètovat!',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Continue' => 'Pokraèování',
+ 'Credit' => 'Dal',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Debit' => 'Má dáti',
+ 'Debit and credit out of balance!' => 'Má dáti a Dal se nerovnají.',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Description' => 'Popis',
+ 'Edit General Ledger Transaction' => 'Opravit záznam v hlavní knize',
+ 'Equity' => 'Vlastní jmìní',
+ 'Expense' => 'Náklady',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'GIFI' => 'Úètovací øetìzec',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Hlavní kniha',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Income' => 'Výnosy',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Liability' => 'Závazek',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Sestavy',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Source' => 'Zdroj',
+ 'Subtotal' => 'Mezisouèet',
+ 'To' => 'do',
+ 'Transaction Date missing!' => 'Chybí datum!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Ano',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ic b/sql-ledger/locale/cz/ic
new file mode 100644
index 000000000..effb53472
--- /dev/null
+++ b/sql-ledger/locale/cz/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Pøidat',
+ 'Add Assembly' => 'Nový výrobek',
+ 'Add Part' => 'Pøíjem zbo¾í',
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Add Service' => 'Nový druh slu¾by',
+ 'Address' => 'Adresa',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Assemblies' => 'Výrobky',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'Chybí èíslo výrobku',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Paleta',
+ 'Bought' => 'Nakoupeno',
+ 'COGS' => 'Náklady na prodané zbo¾í',
+ 'Cannot delete item already invoiced!' => 'Ji¾ fakturované polo¾ky nelze vymazat!',
+ 'Cannot delete item on order!' => 'Polo¾ku objednávky nelze vymazat!',
+ 'Cannot delete item which is part of an assembly!' => 'Nelze vymazat polo¾ku, která je souèástí výrobku!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Popis',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Edit Assembly' => 'Upravit výrobek',
+ 'Edit Part' => 'Upravit zbo¾í',
+ 'Edit Service' => 'Upravit slu¾bu',
+ 'Expense' => 'Náklady',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'Image' => 'Image',
+ 'In-line' => 'Vlo¾ené',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Income' => 'Výnosy',
+ 'Individual Items' => 'Komponenty výrobku',
+ 'Inventory' => 'Zásoby',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Pøed vyøazením výrobu, musí být stav na skladì nulový!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Pøed vyøazením zbo¾í musí být mno¾ství na skladì nulové',
+ 'Inventory quantity must be zero!' => 'Stav skladu musí být nulový!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Last Cost' => 'Poslední cena',
+ 'Line Total' => 'Øádek celkem',
+ 'Link Accounts' => 'Vazby mezi úèty',
+ 'List Price' => 'Výrobní cena',
+ 'Make' => 'Výrobce',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Model',
+ 'Name' => 'Jméno',
+ 'No.' => 'No.',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'Obsolete' => 'Vyøazené',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'On Hand' => 'K dispozici',
+ 'On Order' => 'On Order',
+ 'Order' => 'Objednávka',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Neprodejné',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Part' => 'Zbo¾í',
+ 'Part Number missing!' => 'Chybí èíslo zbo¾í!',
+ 'Parts' => 'Díly',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena',
+ 'Printer' => 'Tiskárna',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Qty' => 'Mno¾ství',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Po¾adováno do',
+ 'Sales' => 'Pøíjmy z prodeje',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Save' => 'Ulo¾it',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Prodejní cena',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Service Number missing!' => 'Chybí èíslo slu¾by!',
+ 'Services' => 'Slu¾by',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Krátký výpis',
+ 'Sold' => 'Prodané',
+ 'Stock Assembly' => 'Výrobky',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax' => 'Daò',
+ 'To' => 'do',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Celkem',
+ 'Unit' => 'Jednotka',
+ 'Unit of measure' => 'Mìrná jednotka',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Váha',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'ea' => 'm.j.',
+ 'emailed to' => 'odesláno na adresu',
+ 'hr' => 'hod',
+ 'sent to printer' => 'vyti¹tìno',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'pøidat' => 'add',
+ 'nový_výrobek' => 'add_assembly',
+ 'pøíjem_zbo¾í' => 'add_part',
+ 'nový_druh_slu¾by' => 'add_service',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'upravit_výrobek' => 'edit_assembly',
+ 'upravit_zbo¾í' => 'edit_part',
+ 'upravit_slu¾bu' => 'edit_service',
+ 'ulo¾it' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/io b/sql-ledger/locale/cz/io
new file mode 100644
index 000000000..9fa6c63b7
--- /dev/null
+++ b/sql-ledger/locale/cz/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Address' => 'Adresa',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Paleta',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Popis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'In-line' => 'Vlo¾ené',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Name' => 'Jméno',
+ 'No.' => 'No.',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Order' => 'Objednávka',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Part' => 'Zbo¾í',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena',
+ 'Printer' => 'Tiskárna',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Qty' => 'Mno¾ství',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Po¾adováno do',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Pøedmìt',
+ 'To' => 'do',
+ 'Unit' => 'Jednotka',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'emailed to' => 'odesláno na adresu',
+ 'sent to printer' => 'vyti¹tìno',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'pokraèování' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/ir b/sql-ledger/locale/cz/ir
new file mode 100644
index 000000000..5e36073e5
--- /dev/null
+++ b/sql-ledger/locale/cz/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Úèet',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Invoice Number' => 'Opravdu chcete vymazat fakturu èíslo',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Paleta',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Currency' => 'Mìna',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Datum splatnosti',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Popis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'Kurz',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'In-line' => 'Vlo¾ené',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Datum vystavení',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Name' => 'Jméno',
+ 'No.' => 'No.',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Order' => 'Objednávka',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Part' => 'Zbo¾í',
+ 'Payment date missing!' => 'Chybí datum platby!',
+ 'Payments' => 'Platby',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena',
+ 'Printer' => 'Tiskárna',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Qty' => 'Mno¾ství',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Zaúètovat do',
+ 'Required by' => 'Po¾adováno do',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Zdroj',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Unit' => 'Jednotka',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dodavatel',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'Yes' => 'Ano',
+ 'ea' => 'm.j.',
+ 'emailed to' => 'odesláno na adresu',
+ 'sent to printer' => 'vyti¹tìno',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'objednávka' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/is b/sql-ledger/locale/cz/is
new file mode 100644
index 000000000..845b381cf
--- /dev/null
+++ b/sql-ledger/locale/cz/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Úèet',
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Invoice Number' => 'Opravdu chcete vymazat fakturu èíslo',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Paleta',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Credit Limit' => 'Úvìrový limit',
+ 'Currency' => 'Mìna',
+ 'Customer' => 'Odbìratel',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Datum splatnosti',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Popis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Kurz',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'In-line' => 'Vlo¾ené',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Datum vystavení',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number' => 'Èíslo faktury',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Name' => 'Jméno',
+ 'No.' => 'No.',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Order' => 'Objednávka',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Part' => 'Zbo¾í',
+ 'Payment date missing!' => 'Chybí datum platby!',
+ 'Payments' => 'Platby',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena',
+ 'Print' => 'Print',
+ 'Printer' => 'Tiskárna',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Qty' => 'Mno¾ství',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Zaúètovat do',
+ 'Remaining' => 'Zbývá',
+ 'Required by' => 'Po¾adováno do',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Zdroj',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Unit' => 'Jednotka',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'Yes' => 'Ano',
+ 'ea' => 'm.j.',
+ 'emailed to' => 'odesláno na adresu',
+ 'sent to printer' => 'vyti¹tìno',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'objednávka' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/login b/sql-ledger/locale/cz/login
new file mode 100644
index 000000000..c0d9264fe
--- /dev/null
+++ b/sql-ledger/locale/cz/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'O programu',
+ 'Accounting' => 'Úèetnictví',
+ 'Database Host' => 'Databázový server',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => '©patná verze dat!',
+ 'Incorrect Password!' => 'Nesprávné heslo!',
+ 'Licensed to' => 'Licencováno pro',
+ 'Login' => 'U¾ivatelské jméno',
+ 'Name' => 'Jméno',
+ 'Password' => 'Heslo',
+ 'User' => 'U¾ivatel',
+ 'Version' => 'Verze',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'Nezadal jste jméno!',
+ 'is not a member!' => 'není platným u¾ivatelem',
+ 'localhost' => 'lokální server',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'u¾ivatelské_jméno' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/menu b/sql-ledger/locale/cz/menu
new file mode 100644
index 000000000..bb77601ae
--- /dev/null
+++ b/sql-ledger/locale/cz/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Závazky',
+ 'AP Aging' => 'Analýza splatnosti',
+ 'AR' => 'Pohledávky',
+ 'AR Aging' => 'Analýza splatnosti',
+ 'Accounting Menu' => 'Menu úèetnictví',
+ 'Add Account' => 'Zalo¾it úèet',
+ 'Add Assembly' => 'Nový výrobek',
+ 'Add Customer' => 'Nový zákazník',
+ 'Add GIFI' => 'Doplnit úètovací øetìzec',
+ 'Add Part' => 'Pøíjem zbo¾í',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Nový druh slu¾by',
+ 'Add Transaction' => 'Nová transakce',
+ 'Add Vendor' => 'Nový dodavatel',
+ 'Assemblies' => 'Výrobky',
+ 'Audit Control' => 'Kontrola pøístupù',
+ 'Backup' => 'Záloha',
+ 'Balance Sheet' => 'Rozvaha',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Úètový rozvrh',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Hlavní kniha',
+ 'Goods & Services' => 'Zbo¾í a slu¾by',
+ 'HTML Templates' => 'HTML ¹ablony',
+ 'Income Statement' => 'Výsledovka',
+ 'Invoice' => 'Faktura',
+ 'LaTeX Templates' => 'LaTeX ¹ablony',
+ 'List Accounts' => 'Seznam úètù',
+ 'List GIFI' => 'Vypsat úètovací øetìzce',
+ 'Logout' => 'Odhlásit',
+ 'Order Entry' => 'Zadání objednávky',
+ 'Packing List' => 'Dodací list',
+ 'Parts' => 'Díly',
+ 'Payment' => 'Platba',
+ 'Payments' => 'Platby',
+ 'Preferences' => 'Nastavení',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Purchase Orders' => 'Vystavené objednávky',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Sestavy',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Sales Orders' => 'Pøijaté objednávky',
+ 'Save to File' => 'Ulo¾it do souboru',
+ 'Send by E-Mail' => 'Poslat e-mailem',
+ 'Services' => 'Slu¾by',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Výrobky',
+ 'Stylesheet' => 'Stylesheet',
+ 'System' => 'Systém',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Polo¾ky',
+ 'Trial Balance' => 'Obratová pøedvaha',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Verze',
+ 'localhost' => 'lokální server',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/oe b/sql-ledger/locale/cz/oe
new file mode 100644
index 000000000..609a9f146
--- /dev/null
+++ b/sql-ledger/locale/cz/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Pøidat',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Nová objednávka (nákup)',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Nová objednávka (pøíjem)',
+ 'Address' => 'Adresa',
+ 'Amount' => 'Èástka',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Are you sure you want to delete Order Number' => 'Opravdu chcete vymazat objednávku èíslo',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Paleta',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Zaplaceno',
+ 'Confirm!' => 'Podtvrïte!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Credit Limit' => 'Úvìrový limit',
+ 'Curr' => 'Mìna',
+ 'Currency' => 'Mìna',
+ 'Customer' => 'Odbìratel',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Datum',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Delete' => 'Vymazat',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Popis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Chybí E-mailová adresa!',
+ 'Edit Purchase Order' => 'Upravit vystavenou objednávku',
+ 'Edit Sales Order' => 'Upravit pøijatou objednávku',
+ 'Exchangerate' => 'Mìnový kurz',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'ID' => 'ID',
+ 'In-line' => 'Vlo¾ené',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Chybí datum vystavení!',
+ 'Invoice Number missing!' => 'Chybí èíslo faktury!',
+ 'Item not on file!' => 'Tato polo¾ka není v databázi!',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'Name' => 'Jméno',
+ 'No.' => 'No.',
+ 'Notes' => 'Poznámky',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Number' => 'Èíslo',
+ 'Number missing in Row' => 'Chybìjící èíslo na øádku',
+ 'O' => 'O',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'Open' => 'Otevøené',
+ 'Order' => 'Objednávka',
+ 'Order Date' => 'Datum objednávky',
+ 'Order Date missing!' => 'Chybí datum objednávky!',
+ 'Order Number' => 'Objednávka èíslo',
+ 'Order Number missing!' => 'Chybí èíslo objednávky!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Dodací list',
+ 'Packing List Date missing!' => 'Chybí datum dodacího listu',
+ 'Packing List Number missing!' => 'Chybí èíslo dodacího listu',
+ 'Part' => 'Zbo¾í',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena',
+ 'Print' => 'Print',
+ 'Printer' => 'Tiskárna',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Vystavená objednávka',
+ 'Purchase Orders' => 'Vystavené objednávky',
+ 'Qty' => 'Mno¾ství',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Zbývá',
+ 'Required by' => 'Po¾adováno do',
+ 'Sales Order' => 'Pøijatá objednávka',
+ 'Sales Orders' => 'Pøijaté objednávky',
+ 'Save' => 'Ulo¾it',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Na obrazovku',
+ 'Select from one of the items below' => 'Zvolte z ní¾e uvedených polo¾ek',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Service' => 'Slu¾ba',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax' => 'Daò',
+ 'Tax Included' => 'Cena vèetnì danì',
+ 'Terms: Net' => 'Netto',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Unit' => 'Jednotka',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dodavatel',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'O jaký typ polo¾ky se jedná?',
+ 'Yes' => 'Ano',
+ 'days' => 'dní',
+ 'ea' => 'm.j.',
+ 'emailed to' => 'odesláno na adresu',
+ 'sent to printer' => 'vyti¹tìno',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'pøidat' => 'add',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'faktura' => 'invoice',
+ 'print' => 'print',
+ 'ulo¾it' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'ano' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/pe b/sql-ledger/locale/cz/pe
new file mode 100644
index 000000000..de5aad33d
--- /dev/null
+++ b/sql-ledger/locale/cz/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Pøidat',
+ 'Add Project' => 'Add Project',
+ 'All' => 'V¹e',
+ 'Continue' => 'Pokraèování',
+ 'Delete' => 'Vymazat',
+ 'Description' => 'Popis',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Èíslo',
+ 'Orphaned' => 'Neprodejné',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Ulo¾it',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'pøidat' => 'add',
+ 'pokraèování' => 'continue',
+ 'vymazat' => 'delete',
+ 'ulo¾it' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/rc b/sql-ledger/locale/cz/rc
new file mode 100644
index 000000000..38999ec02
--- /dev/null
+++ b/sql-ledger/locale/cz/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Úèet',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Pokraèování',
+ 'Date' => 'Datum',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Popis',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'z',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Platba',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Zdroj',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'do',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'pokraèování' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/cz/rp b/sql-ledger/locale/cz/rp
new file mode 100644
index 000000000..0896ce450
--- /dev/null
+++ b/sql-ledger/locale/cz/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Analýza splatnosti',
+ 'AR Aging' => 'Analýza splatnosti',
+ 'Account' => 'Úèet',
+ 'Accounts' => 'Úèty',
+ 'Amount' => 'Èástka',
+ 'Apr' => 'Dub',
+ 'April' => 'Duben',
+ 'Attachment' => 'Pøílohy',
+ 'Aug' => 'Srp',
+ 'August' => 'Srpen',
+ 'Balance Sheet' => 'Rozvaha',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Porovnáno k',
+ 'Continue' => 'Pokraèování',
+ 'Copies' => 'Kopie',
+ 'Credit' => 'Dal',
+ 'Current' => 'Current',
+ 'Customer' => 'Odbìratel',
+ 'Date' => 'Datum',
+ 'Debit' => 'Má dáti',
+ 'Dec' => 'Pro',
+ 'December' => 'Prosinec',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Popis',
+ 'Due' => 'Splatno',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Úno',
+ 'February' => 'Únor',
+ 'From' => 'z',
+ 'GIFI' => 'Úètovací øetìzec',
+ 'Heading' => 'Nadpis',
+ 'ID' => 'ID',
+ 'In-line' => 'Vlo¾ené',
+ 'Include in Report' => 'Zahrnovat v sestavì',
+ 'Income Statement' => 'Výsledovka',
+ 'Invoice' => 'Faktura',
+ 'Jan' => 'Led',
+ 'January' => 'Leden',
+ 'Jul' => 'Èec',
+ 'July' => 'Èervenec',
+ 'Jun' => 'Èer',
+ 'June' => 'Èerven',
+ 'Mar' => 'Bøe',
+ 'March' => 'Bøezen',
+ 'May' => 'Kvìten',
+ 'May ' => 'Kvì',
+ 'Message' => 'Zpráva',
+ 'N/A' => '---',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Lis',
+ 'November' => 'Listopad',
+ 'Oct' => 'Øíj',
+ 'October' => 'Øíjen',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Platby',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Tiskárna',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Výkaz za',
+ 'Retained Earnings' => 'Nerozdìlený zisk',
+ 'Screen' => 'Na obrazovku',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Záø',
+ 'September' => 'Záøí',
+ 'Source' => 'Zdroj',
+ 'Standard' => 'Standardní',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Pøedmìt',
+ 'Subtotal' => 'Mezisouèet',
+ 'Tax' => 'Daò',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'do',
+ 'Total' => 'Celkem',
+ 'Trial Balance' => 'Obratová pøedvaha',
+ 'Vendor' => 'Dodavatel',
+ 'as at' => 'as at',
+ 'collected on sales' => 'vybráno na výstupu',
+ 'for Period' => 'za období',
+ 'paid on purchases' => 'zaplaceno na vstupu',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'pokraèování' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/de/COPYING b/sql-ledger/locale/de/COPYING
new file mode 100644
index 000000000..b12eb1b59
--- /dev/null
+++ b/sql-ledger/locale/de/COPYING
@@ -0,0 +1,22 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# German texts:
+#
+# Author: Thomas Bayen <tbayen@bayen.de>
+# Gunter Ohrner <G.Ohrner@post.rwth-aachen.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+######################################################################
diff --git a/sql-ledger/locale/de/LANGUAGE b/sql-ledger/locale/de/LANGUAGE
new file mode 100644
index 000000000..fc0b97796
--- /dev/null
+++ b/sql-ledger/locale/de/LANGUAGE
@@ -0,0 +1 @@
+German
diff --git a/sql-ledger/locale/de/Num2text b/sql-ledger/locale/de/Num2text
new file mode 100644
index 000000000..be84a3ca2
--- /dev/null
+++ b/sql-ledger/locale/de/Num2text
@@ -0,0 +1,185 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# this is a variation of the Lingua package
+# written for check and receipt printing
+# it returns a properly formatted text string
+# for a number up to 10**12
+
+sub init {
+ my $self = shift;
+
+ %{ $self->{numbername} } =
+ (0 => 'Null',
+ 1 => 'ein',
+ 2 => 'zwei',
+ 3 => 'drei',
+ 4 => 'vier',
+ 5 => 'fünf',
+ 6 => 'sechs',
+ 7 => 'sieben',
+ 8 => 'acht',
+ 9 => 'neun',
+ 10 => 'zehn',
+ 11 => 'elf',
+ 12 => 'zwölf',
+ 13 => 'dreizehn',
+ 14 => 'vierzehn',
+ 15 => 'fünfzehn',
+ 16 => 'sechzehn',
+ 17 => 'siebzehn',
+ 18 => 'achtzehn',
+ 19 => 'neunzehn',
+ 20 => 'zwanzig',
+ 30 => 'dreissig',
+ 40 => 'vierzig',
+ 50 => 'fünfzig',
+ 60 => 'sechzig',
+ 70 => 'siebzig',
+ 80 => 'achtzig',
+ 90 => 'neunzig',
+ 10**2 => 'hundert',
+ 10**3 => 'tausend',
+ 10**6 => 'million',
+ 10**9 => 'milliarde',
+ 10**12 => 'billion'
+ );
+
+}
+
+
+sub num2text {
+ my ($self, $amount) = @_;
+
+ return $self->{numbername}{0} unless $amount;
+
+ my @textnumber = ();
+
+ # split amount into chunks of 3
+ my @num = reverse split //, $amount;
+ my @numblock = ();
+ my ($i, $appendn);
+ my @a = ();
+
+ while (@num) {
+ @a = ();
+ for (1 .. 3) {
+ push @a, shift @num;
+ }
+ push @numblock, join / /, reverse @a;
+ }
+
+ my $belowhundred = !$#numblock;
+
+ while (@numblock) {
+
+ $i = $#numblock;
+ @num = split //, $numblock[$i];
+ $appendn = "";
+
+ $numblock[$i] *= 1;
+
+ if ($numblock[$i] == 0) {
+ pop @numblock;
+ next;
+ }
+
+ if ($numblock[$i] > 99) {
+ # the one from hundreds
+ push @textnumber, $self->{numbername}{$num[0]};
+
+ # add hundred designation
+ push @textnumber, $self->{numbername}{10**2};
+
+ # reduce numblock
+ $numblock[$i] -= $num[0] * 100;
+ }
+
+ $appendn = 'en' if ($i == 2);
+ $appendn = 'n' if ($i > 2);
+
+ if ($numblock[$i] > 9) {
+ # tens
+ push @textnumber, $self->format_ten($numblock[$i], $belowhundred);
+ } elsif ($numblock[$i] > 1) {
+ # ones
+ push @textnumber, $self->{numbername}{$numblock[$i]};
+ } elsif ($numblock[$i] == 1) {
+ if ($i == 0) {
+ push @textnumber, $self->{numbername}{$numblock[$i]}.'s';
+ } else {
+ if ($i >= 2) {
+ push @textnumber, $self->{numbername}{$numblock[$i]}.'e';
+ } else {
+ push @textnumber, $self->{numbername}{$numblock[$i]};
+ }
+ }
+ $appendn = "";
+ }
+
+ # add thousand, million
+ if ($i) {
+ $amount = 10**($i * 3);
+ push @textnumber, $self->{numbername}{$amount}.$appendn;
+ }
+
+ pop @numblock;
+
+ }
+
+ join '', @textnumber;
+
+}
+
+
+sub format_ten {
+ my ($self, $amount, $belowhundred) = @_;
+
+ my $textnumber = "";
+ my @num = split //, $amount;
+
+ if ($amount > 20) {
+ if ($num[1] == 0) {
+ $textnumber = $self->{numbername}{$amount};
+ } else {
+ if ($belowhundred) {
+ $amount = $num[0] * 10;
+ $textnumber = $self->{numbername}{$num[1]}.'und'.$self->{numbername}{$amount};
+ } else {
+ $amount = $num[0] * 10;
+ $textnumber = $self->{numbername}{$amount}.$self->{numbername}{$num[1]};
+ $textnumber .= 's' if ($num[1] == 1);
+ }
+ }
+ } else {
+ $textnumber = $self->{numbername}{$amount};
+ }
+
+ $textnumber;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/locale/de/admin b/sql-ledger/locale/de/admin
new file mode 100644
index 000000000..f41796d13
--- /dev/null
+++ b/sql-ledger/locale/de/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Zugriffkontrolle',
+ 'Accounting' => 'Buchhaltung',
+ 'Add User' => 'Benutzer anlegen',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Verwalter',
+ 'All Datasets up to date!' => 'Alle Datenbanken sind auf aktuellem Stand.',
+ 'Change Admin Password' => 'Administratorpasswort ändern',
+ 'Change Password' => 'Passwort ändern',
+ 'Character Set' => 'Zeichensatz',
+ 'Click on login name to edit!' => 'Zum Bearbeiten den Zugriffs-Namen anklicken!',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Als Vorlage verwenden',
+ 'Continue' => 'Weiter',
+ 'Create Chart of Accounts' => 'Kontenplan anlegen',
+ 'Create Dataset' => 'Datenbank anlegen',
+ 'DBI not installed!' => 'DBI ist nicht installiert!',
+ 'Database' => 'Datenbank',
+ 'Database Administration' => 'Datenbank Administration',
+ 'Database Driver not checked!' => 'Kein Datenbank-Treiber ausgewählt!',
+ 'Database User missing!' => 'Datenbank Benutzer fehlt!',
+ 'Dataset' => 'Datenbank',
+ 'Dataset missing!' => 'Datenbank fehlt!',
+ 'Dataset updated!' => 'Datenbank erneuert!',
+ 'Date Format' => 'Datumsformat',
+ 'Delete' => 'Löschen',
+ 'Delete Dataset' => 'Datenbank löschen',
+ 'Directory' => 'Verzeichnis',
+ 'Driver' => 'Treiber',
+ 'Dropdown Limit' => 'Auswahllistenbegrenzung',
+ 'E-mail' => 'eMail',
+ 'Edit User' => 'Benutzerdaten bearbeiten',
+ 'Existing Datasets' => 'Existierende Datenbanken',
+ 'Fax' => 'Fax',
+ 'Host' => 'Datenbank-Rechner',
+ 'Hostname missing!' => 'Rechnername fehlt!',
+ 'Incorrect Password!' => 'Ungültiges Passwort!',
+ 'Language' => 'Sprache',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.',
+ 'Login' => 'Anmelden',
+ 'Multibyte Encoding' => 'Muiltibyte Encoding',
+ 'Name' => 'Name',
+ 'New Templates' => 'Neue Vorlagen',
+ 'No Database Drivers available!' => 'Kein Datenbank-Treiber verfügbar!',
+ 'No Dataset selected!' => 'Keine Datenbank ausgewählt!',
+ 'Nothing to delete!' => 'Es konnte nichts gelöscht werden!',
+ 'Number Format' => 'Zahlenformat',
+ 'Oracle Database Administration' => 'Oracle Datenbank Administration',
+ 'Password' => 'Passwort',
+ 'Password changed!' => 'Passwort geändert!',
+ 'Pg Database Administration' => 'Pg Datenbank Administration',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Portangabe fehlt!',
+ 'Printer' => 'Drucker',
+ 'Save' => 'Speichern',
+ 'Select a Dataset to delete and press "Continue"' => 'Wählen Sie eine Datenbank und klicken Sie auf "Weiter"',
+ 'Setup Templates' => 'Vorlagen auswählen',
+ 'Ship via' => 'Transportmittel',
+ 'Signature' => 'Unterschrift',
+ 'Stylesheet' => 'Stilvorlage',
+ 'Templates' => 'Vorlagen',
+ 'The following Datasets are not in use and can be deleted' => 'Die folgenden Datenbanken sind nicht in Verwendung und können gelöscht werden',
+ 'The following Datasets need to be updated' => 'Folgende Datenbanken müssen aktualisiert werden',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'In diesem Schritt werden bestehende Datenbanken gesucht. Es werden noch keine Änderungen vorgenommen!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Um einer Gruppe einen neuen Benutzer hinzuzufügen, ändern und speichern Sie am einfachsten einen bestehenden Zugriffsnamen. Unter dem neuen Namen wird dann ein Benutzer mit denselben Einstellungen angelegt.',
+ 'Update Dataset' => 'Datenbank aktualisieren',
+ 'Use Templates' => 'Benutze Vorlagen',
+ 'User' => 'Benutzer',
+ 'User deleted!' => 'Benutzer gelöscht!',
+ 'User saved!' => 'Benutzer gespeichert!',
+ 'Version' => 'Version',
+ 'You must enter a host and port for local and remote connections!' => '"Rechner" und "Port" müssen für lokale und externe Verbindungen eingetragen werden!',
+ 'does not exist' => 'existiert nicht',
+ 'is already a member!' => 'ist bereits ein Mitglied!',
+ 'localhost' => 'lokaler Rechner',
+ 'locked!' => 'gesperrt!',
+ 'successfully created!' => 'wurde erfolgreich erstellt',
+ 'successfully deleted!' => 'wurde erfolgreich gelöscht',
+ 'website' => 'Website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'benutzer_anlegen' => 'add_user',
+ 'administratorpasswort_ändern' => 'change_admin_password',
+ 'passwort_ändern' => 'change_password',
+ 'weiter' => 'continue',
+ 'datenbank_anlegen' => 'create_dataset',
+ 'löschen' => 'delete',
+ 'datenbank_löschen' => 'delete_dataset',
+ 'anmelden' => 'login',
+ 'oracle_datenbank_administration' => 'oracle_database_administration',
+ 'pg_datenbank_administration' => 'pg_database_administration',
+ 'speichern' => 'save',
+ 'datenbank_aktualisieren' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/de/all b/sql-ledger/locale/de/all
new file mode 100644
index 000000000..7e1d9b499
--- /dev/null
+++ b/sql-ledger/locale/de/all
@@ -0,0 +1,499 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Verbindlichkeiten',
+ 'AP Aging' => 'Offene Verbindl.',
+ 'AP Transaction' => 'Eingangsbuchung',
+ 'AP Transactions' => 'Eingangsbuchungen',
+ 'AR' => 'Forderungen',
+ 'AR Aging' => 'Offene Forderungen',
+ 'AR Transaction' => 'Ausgangsbuchung',
+ 'AR Transactions' => 'Ausgangsbuchungen',
+ 'About' => 'Über',
+ 'Access Control' => 'Zugriffkontrolle',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer fehlt!',
+ 'Account Type' => 'Kontoart',
+ 'Account Type missing!' => 'Kontoart fehlt!',
+ 'Account deleted!' => 'Konto gelöscht!',
+ 'Account saved!' => 'Konto gespeichert!',
+ 'Accounting' => 'Buchhaltung',
+ 'Accounting Menu' => 'Kontoverwaltung',
+ 'Accounts' => 'Konten',
+ 'Active' => 'Aktiv',
+ 'Add' => 'Hinzufügen',
+ 'Add Account' => 'Konto anlegen',
+ 'Add Accounts Payables Transaction' => 'Eingangsbuchung anlegen',
+ 'Add Accounts Receivables Transaction' => 'Ausgangsbuchung anlegen',
+ 'Add Assembly' => 'Erzeugnis anlegen',
+ 'Add Customer' => 'Kunde anlegen',
+ 'Add GIFI' => 'GIFI anlegen',
+ 'Add General Ledger Transaction' => 'Hinzufügen einer Buchung zum Hauptbuch',
+ 'Add Group' => 'Gruppe anlegen',
+ 'Add Part' => 'Ware anlegen',
+ 'Add Project' => 'Projekt anlegen',
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Invoice' => 'Ausgangsrechnung anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Add Service' => 'Dienstleistung anlegen',
+ 'Add Transaction' => 'Buchung anlegen',
+ 'Add User' => 'Benutzer anlegen',
+ 'Add Vendor' => 'Lieferant anlegen',
+ 'Add Vendor Invoice' => 'Einkaufsrechnung anlegen',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Verwalter',
+ 'All' => 'Alle',
+ 'All Datasets up to date!' => 'Alle Datenbanken sind auf aktuellem Stand.',
+ 'Amount' => 'Betrag',
+ 'Amount Due' => 'Betrag fällig',
+ 'Amount does not equal applied!' => 'Betrag stimmt nicht überein!',
+ 'Amount missing!' => 'Betrag fehlt!',
+ 'Applied' => 'Ausgewählt',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
+ 'Are you sure you want to delete Order Number' => 'Soll die Bestellung mit folgender Nummer wirklich gelöscht werden:',
+ 'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
+ 'Assemblies' => 'Erzeugnisse',
+ 'Assemblies restocked!' => 'Erzeugnisse sind im Lager!',
+ 'Assembly Number missing!' => 'Erzeugnisnummer fehlt!',
+ 'Asset' => 'Aktiva/Mittelverwendung',
+ 'Attachment' => 'als Anhang',
+ 'Audit Control' => 'Bücherkontrolle',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'BOM' => 'Stückliste',
+ 'Backup' => 'Sicherung',
+ 'Backup sent to' => 'Eine Sicherungskopie wurde gesandt an',
+ 'Balance' => 'Bilanz',
+ 'Balance Sheet' => 'Bilanz',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'Books are open' => 'Die Bücher sind geöffnet.',
+ 'Bought' => 'Gekauft',
+ 'Business Number' => 'Firmennummer',
+ 'C' => 'G',
+ 'COGS' => 'Umsatzkosten',
+ 'Cannot delete account!' => 'Konto kann nicht gelöscht werden!',
+ 'Cannot delete customer!' => 'Kunde kann nicht gelöscht werden!',
+ 'Cannot delete default account!' => 'Das Standard-Konto kann nicht gelöscht werden!',
+ 'Cannot delete invoice!' => 'Rechnung kann nicht gelöscht werden!',
+ 'Cannot delete item!' => 'Artikel kann nicht gelöscht werden!',
+ 'Cannot delete order!' => 'Bestellung kann nicht gelöscht werden!',
+ 'Cannot delete transaction!' => 'Buchung kann nicht gelöscht werden!',
+ 'Cannot delete vendor!' => 'Lieferant kann nicht gelöscht werden!',
+ 'Cannot have a value in both Debit and Credit!' => 'Es kann nicht gleichzeitig Soll und Haben gebucht werden!',
+ 'Cannot post a transaction without a value!' => 'Eine Buchung ohne Betrag kann nicht verbucht werden!',
+ 'Cannot post invoice for a closed period!' => 'Das Rechnungsdatum fällt in einen abgeschlossen Zeitraum!',
+ 'Cannot post invoice!' => 'Rechnung kann nicht gebucht werden!',
+ 'Cannot post payment for a closed period!' => 'Es können keine Zahlungen für abgeschlossene Bücher gebucht werden!',
+ 'Cannot post payment!' => 'Zahlung kann nicht gebucht werden!',
+ 'Cannot post transaction for a closed period!' => 'Für einen bereits abgeschlossenen Zeitraum kann keine Buchung angelegt werden!',
+ 'Cannot post transaction!' => 'Rechnung kann nicht gebucht werden!',
+ 'Cannot process payment for a closed period!' => 'Es kann keine Zahlung in einem abgeschlossenen Zeitraum verbucht werden!',
+ 'Cannot save account!' => 'Konto kann nicht gespeichert werden!',
+ 'Cannot save order!' => 'Bestellung kann nicht gespeichert werden!',
+ 'Cannot save preferences!' => 'Benutzereinstellungen können nicht gespeichert werden!',
+ 'Cannot stock assemblies!' => 'Erzeugnisse können nicht ins Lager!',
+ 'Cash' => 'Kasse',
+ 'Cash based' => 'basierend auf Barzahlung',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Administratorpasswort ändern',
+ 'Change Password' => 'Passwort ändern',
+ 'Character Set' => 'Zeichensatz',
+ 'Chart of Accounts' => 'Kontenübersicht',
+ 'Check' => 'Scheck',
+ 'Check printed!' => 'Scheck ist gedruckt!',
+ 'Check printing failed!' => 'Scheck drucken ist fehlgeschlagen!',
+ 'Cleared Balance' => 'Abgeschlossen',
+ 'Click on login name to edit!' => 'Zum Bearbeiten den Zugriffs-Namen anklicken!',
+ 'Close Books up to' => 'Die Bücher abschließen bis zum',
+ 'Closed' => 'Geschlossen',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Gegenüberstellen zu',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Connect to' => 'Als Vorlage verwenden',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Copy to COA' => 'In Kontenplan kopieren',
+ 'Create Chart of Accounts' => 'Kontenplan anlegen',
+ 'Create Dataset' => 'Datenbank anlegen',
+ 'Credit' => 'Haben',
+ 'Credit Limit' => 'Kreditlimit',
+ 'Curr' => 'Währung',
+ 'Currency' => 'Währung',
+ 'Current' => 'Betrag',
+ 'Customer' => 'Kunde',
+ 'Customer deleted!' => 'Kunde gelöscht!',
+ 'Customer missing!' => 'Kundenname fehlt!',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Customer saved!' => 'Kunde gespeichert!',
+ 'Customers' => 'Kunden',
+ 'DBI not installed!' => 'DBI ist nicht installiert!',
+ 'Database' => 'Datenbank',
+ 'Database Administration' => 'Datenbank Administration',
+ 'Database Driver not checked!' => 'Kein Datenbank-Treiber ausgewählt!',
+ 'Database Host' => 'Datenbank-Rechner',
+ 'Database User missing!' => 'Datenbank Benutzer fehlt!',
+ 'Dataset' => 'Datenbank',
+ 'Dataset missing!' => 'Datenbank fehlt!',
+ 'Dataset updated!' => 'Datenbank erneuert!',
+ 'Date' => 'Datum',
+ 'Date Format' => 'Datumsformat',
+ 'Date Paid' => 'Zahlungsdatum',
+ 'Date missing!' => 'Datum fehlt!',
+ 'Debit' => 'Soll',
+ 'Debit and credit out of balance!' => 'Soll und Haben müssen gleich sein.',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Decimalplaces' => 'Dezimalstellen',
+ 'Delete' => 'Löschen',
+ 'Delete Account' => 'Konto löschen',
+ 'Delete Dataset' => 'Datenbank löschen',
+ 'Delivery Date' => 'Lieferung',
+ 'Deposit' => 'Gutschrift',
+ 'Description' => 'Beschreibung',
+ 'Difference' => 'Differenz',
+ 'Directory' => 'Verzeichnis',
+ 'Discount' => 'Rabatt',
+ 'Done' => 'Fertig',
+ 'Drawing' => 'Zeichnung',
+ 'Driver' => 'Treiber',
+ 'Dropdown Limit' => 'Auswahllistenbegrenzung',
+ 'Due' => 'Fällig',
+ 'Due Date' => 'Fälligkeitsdatum',
+ 'Due Date missing!' => 'Fälligkeitsdatum fehlt!',
+ 'E-mail' => 'eMail',
+ 'E-mail Statement to' => 'eMail Fälligkeitsabrechnung an',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Edit' => 'Bearbeiten',
+ 'Edit Account' => 'Kontodaten bearbeiten',
+ 'Edit Accounts Payables Transaction' => 'Einkaufsbuchung bearbeiten',
+ 'Edit Accounts Receivables Transaction' => 'Ausgangsbuchung bearbeiten',
+ 'Edit Assembly' => 'Erzeugnis bearbeiten',
+ 'Edit Customer' => 'Kunde editieren',
+ 'Edit GIFI' => 'GIFI editieren',
+ 'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten',
+ 'Edit Group' => 'Gruppe editieren',
+ 'Edit Part' => 'Ware bearbeiten',
+ 'Edit Preferences for' => 'Benutzereinstellungen für',
+ 'Edit Project' => 'Projekt bearbeiten',
+ 'Edit Purchase Order' => 'Einkaufsbeleg bearbeiten',
+ 'Edit Sales Invoice' => 'Ausgangsrechnung bearbeiten',
+ 'Edit Sales Order' => 'Verkaufsbeleg bearbeiten',
+ 'Edit Service' => 'Dienstleistung bearbeiten',
+ 'Edit Template' => 'Vorlage bearbeiten',
+ 'Edit User' => 'Benutzerdaten bearbeiten',
+ 'Edit Vendor' => 'Lieferant editieren',
+ 'Edit Vendor Invoice' => 'Einkaufsrechnung bearbeiten',
+ 'Employee' => 'Bearbeiter',
+ 'Enforce transaction reversal for all dates' => 'Kontraeintragungen für jeden Zeitraum aktualisieren',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Durch Doppelpunkte getrennte Währungskürzel mit maximal 3 Buchstaben aufführen; Ihre eigene Landeswährung zuerst (z.B. EUR:USD:CAD)',
+ 'Equity' => 'Passiva/Eigenkapital',
+ 'Exch' => 'Wkurs.',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate Difference' => 'Wechselkursunterschied',
+ 'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Existing Datasets' => 'Existierende Datenbanken',
+ 'Expense' => 'Aufwand',
+ 'Expense Account' => 'Aufwandskonto',
+ 'Expense/Asset' => 'Aufwand/Anlagen',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'Foreign Exchange Gain' => 'Wechselkurserträge',
+ 'Foreign Exchange Loss' => 'Wechselkursaufwendungen',
+ 'From' => 'Von',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI gelöscht!',
+ 'GIFI missing!' => 'GIFI fehlt!',
+ 'GIFI saved!' => 'GIFI gespeichert!',
+ 'GL Transaction' => 'Hauptbucheintragung',
+ 'General Ledger' => 'Hauptbuch',
+ 'Goods & Services' => 'Waren und Dienstleistungen',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'Group deleted!' => 'Gruppe gelöscht!',
+ 'Group missing!' => 'Gruppe fehlt!',
+ 'Group saved!' => 'Gruppe gespeichert!',
+ 'Groups' => 'Gruppen',
+ 'HTML Templates' => 'HTML Vorlagen',
+ 'Heading' => 'Überschrift',
+ 'Host' => 'Datenbank-Rechner',
+ 'Hostname missing!' => 'Rechnername fehlt!',
+ 'ID' => 'Nr.',
+ 'Image' => 'Grafik',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Include in drop-down menus' => 'In Aufklapp-Menü aufnehmen',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Soll dieses Konto auf dem Kunden- und Lieferantenformular angezeigt werden, um den Kunden/Lieferanten als steuerpflichtig zu markieren?',
+ 'Income' => 'Einkommen',
+ 'Income Account' => 'Einkommenkonto',
+ 'Income Statement' => 'G & V',
+ 'Incorrect Dataset version!' => 'Datenbankversion stimmt nicht überein!',
+ 'Incorrect Password!' => 'Ungültiges Passwort!',
+ 'Individual Items' => 'Einzelteile',
+ 'Inventory' => 'Inventar',
+ 'Inventory Account' => 'Warenbestand',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Bevor dieses Erzeugnis als ungültig markiert werden kann, muß das Inventar auf Null sein!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Bevor diese Ware als ungültig markiert werden kann, muß das Inventar Null sein!',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date' => 'Rechnungsdatum',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Invoice deleted!' => 'Rechnung gelöscht!',
+ 'Invoice posted!' => 'Rechnung verbucht!',
+ 'Invoices' => 'Rechnungen',
+ 'Is this a summary account to record' => 'Summenkonto für',
+ 'Item deleted!' => 'Artikel gelöscht!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'LaTeX Templates' => 'LaTeX Vorlagen',
+ 'Language' => 'Sprache',
+ 'Last Cost' => 'Letzte Kosten',
+ 'Last Invoice Number' => 'Letzte Rechnungsnummer',
+ 'Last Numbers & Default Accounts' => 'Laufende Zähler und Standardkonten',
+ 'Last Purchase Order Number' => 'Letzte Enkaufsbelegnummer',
+ 'Last Sales Order Number' => 'Letzte Verkaufsbelegnummer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.',
+ 'Liability' => 'Passiva/Mittelherkunft',
+ 'Licensed to' => 'Lizensiert für',
+ 'Line Total' => 'Zeilensumme',
+ 'Link' => 'Verknüpfungen',
+ 'Link Accounts' => 'Konten verknüpfen',
+ 'List Accounts' => 'Kontenliste',
+ 'List GIFI' => 'GIFI aufzeigen',
+ 'List Price' => 'Listenpreis',
+ 'List Transactions' => 'Buchungsliste',
+ 'Login' => 'Anmelden',
+ 'Logout' => 'Abmelden',
+ 'Make' => 'Hersteller',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Modell',
+ 'Multibyte Encoding' => 'Muiltibyte Encoding',
+ 'N/A' => 'N.Z.',
+ 'Name' => 'Name',
+ 'Name missing!' => 'Name fehlt!',
+ 'New Templates' => 'Neue Vorlagen',
+ 'No' => 'Nein',
+ 'No Database Drivers available!' => 'Kein Datenbank-Treiber verfügbar!',
+ 'No Dataset selected!' => 'Keine Datenbank ausgewählt!',
+ 'No email address for' => 'Keine eMail-Addresse für',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkungen',
+ 'Nothing applied!' => 'Sie haben nichts ausgewählt',
+ 'Nothing selected!' => 'Es wurde nichts ausgewählt!',
+ 'Nothing to delete!' => 'Es konnte nichts gelöscht werden!',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Zahlenformat',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'O' => 'O',
+ 'Obsolete' => 'Ungültig',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'auf Lager',
+ 'On Order' => 'auf Bestellung',
+ 'Open' => 'Offen',
+ 'Oracle Database Administration' => 'Oracle Datenbank Administration',
+ 'Order' => 'Auftrag',
+ 'Order Date' => 'Auftragsdatum',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Entry' => 'Aufträge',
+ 'Order Number' => 'Auftragsnummer',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'Order deleted!' => 'Auftrag gelöscht!',
+ 'Order saved!' => 'Auftrag gespeichert!',
+ 'Ordered' => 'Vom Kunde bestellt',
+ 'Orphaned' => 'nie benutzt',
+ 'Out of balance!' => 'Summen stimmen nicht überein!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Paid' => 'Bezahlt',
+ 'Paid in full' => 'Voll bezahlt',
+ 'Part' => 'Ware',
+ 'Part Number missing!' => 'Warennummer fehlt!',
+ 'Parts' => 'Waren',
+ 'Parts Inventory' => 'Warenliste',
+ 'Password' => 'Passwort',
+ 'Password changed!' => 'Passwort geändert!',
+ 'Payables' => 'Verbindlichkeiten',
+ 'Payment' => 'Zahlung',
+ 'Payment date missing!' => 'Tag der Zahlung fehlt!',
+ 'Payment posted!' => 'Zahlung gebucht!',
+ 'Payments' => 'Zahlungen',
+ 'Pg Database Administration' => 'Pg Datenbank Administration',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Portangabe fehlt!',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Benutzereinstellungen',
+ 'Preferences saved!' => 'Einstellungen gespeichert!',
+ 'Price' => 'Preis',
+ 'Print' => 'Drucken',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Project Number' => 'Projektnummer',
+ 'Project Number missing!' => 'Projektnummer fehlt!',
+ 'Project deleted!' => 'Projekt gelöscht!',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Project saved!' => 'Projekt gespeichert!',
+ 'Projects' => 'Projekte',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Purchase Orders' => 'Einkaufsbelege',
+ 'Qty' => 'Anz',
+ 'ROP' => 'UAB',
+ 'Rate' => 'Rate',
+ 'Recd' => 'Erh',
+ 'Receipt' => 'Quittung',
+ 'Receipt printed!' => 'Quittung gedruckt!',
+ 'Receipt printing failed!' => 'Quittung konnte nicht gedruckt werden!',
+ 'Receipts' => 'Quittungen',
+ 'Receivables' => 'Forderungen',
+ 'Reconciliation' => 'Abgleichung',
+ 'Record in' => 'Buchen auf',
+ 'Reference' => 'Referenz',
+ 'Reference missing!' => 'Referenz fehlt!',
+ 'Remaining' => 'Rest',
+ 'Report for' => 'Bericht für',
+ 'Reports' => 'Berichte',
+ 'Required by' => 'Erforderlich am',
+ 'Retained Earnings' => 'Verbliebenes Einkommen',
+ 'Sales' => 'Warenverkauf',
+ 'Sales Invoice' => 'Ausgangsrechnung',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Sales Orders' => 'Verkaufsbelege',
+ 'Salesperson' => 'Verkaufsperson',
+ 'Save' => 'Speichern',
+ 'Save as new' => 'als neu speichern',
+ 'Save to File' => 'Auf Festplatte speichern',
+ 'Screen' => 'Bildschirm',
+ 'Select a Dataset to delete and press "Continue"' => 'Wählen Sie eine Datenbank und klicken Sie auf "Weiter"',
+ 'Select all' => 'Alle auswählen',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sell Price' => 'Verkaufspreis',
+ 'Send by E-Mail' => 'Per eMail schicken',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Service Items' => 'Dienstleistungen',
+ 'Service Number missing!' => 'Dienstleistungsnummer fehlt!',
+ 'Services' => 'Leistungen',
+ 'Setup Templates' => 'Vorlagen auswählen',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Ship via' => 'Transportmittel',
+ 'Short' => 'Kurz',
+ 'Signature' => 'Unterschrift',
+ 'Sold' => 'Verkauft',
+ 'Source' => 'Beleg',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Sammelrechnung',
+ 'Statement Balance' => 'Sammelrechnungsbilanz',
+ 'Statement sent to' => 'Sammelrechnung verschickt an',
+ 'Statements sent to printer!' => 'Sammelrechnungen an Drucker geschickt!',
+ 'Stock' => 'einlagern',
+ 'Stock Assembly' => 'Erzeugnis einlagern',
+ 'Stylesheet' => 'Stilvorlage',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'System' => 'System',
+ 'Tax' => 'Steuer',
+ 'Tax Accounts' => 'Steuerkonto',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'Tax collected' => 'vereinnahmte Steuer',
+ 'Tax paid' => 'Vorsteuer',
+ 'Taxable' => 'Steuerpflichtig',
+ 'Template saved!' => 'Schablone gespeichert!',
+ 'Templates' => 'Vorlagen',
+ 'Terms: Net' => 'Zahlungsziel',
+ 'The following Datasets are not in use and can be deleted' => 'Die folgenden Datenbanken sind nicht in Verwendung und können gelöscht werden',
+ 'The following Datasets need to be updated' => 'Folgende Datenbanken müssen aktualisiert werden',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'In diesem Schritt werden bestehende Datenbanken gesucht. Es werden noch keine Änderungen vorgenommen!',
+ 'To' => 'An',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Um einer Gruppe einen neuen Benutzer hinzuzufügen, ändern und speichern Sie am einfachsten einen bestehenden Zugriffsnamen. Unter dem neuen Namen wird dann ein Benutzer mit denselben Einstellungen angelegt.',
+ 'Top Level' => 'Hauptbeschreibung',
+ 'Total' => 'Summe',
+ 'Transaction Date missing!' => 'Buchungsdatum fehlt!',
+ 'Transaction deleted!' => 'Buchung gelöscht!',
+ 'Transaction posted!' => 'Buchung verbucht!',
+ 'Transaction reversal enforced for all dates' => 'Fehleintragungen müssen für jeden Zeitraum mit einer Kontraeintragung ausgebessert werden',
+ 'Transaction reversal enforced up to' => 'Fehleintragungen können bis zu dem angenebenen Zeitraum nur mit einer Kontraeintragung ausgebessert werden',
+ 'Transactions' => 'Buchungen',
+ 'Transactions exist, cannot delete customer!' => 'Der Kunde kann nicht gelöscht werden, da Buchungen vorhanden sind!',
+ 'Transactions exist, cannot delete vendor!' => 'Der Lieferant kann nicht gelöscht werden, da Buchungen vorhanden sind!',
+ 'Transactions exist; cannot delete account!' => 'Das Konto kann nicht gelöscht werden, da es Buchungen enthält!',
+ 'Trial Balance' => 'Vergleichsbilanz',
+ 'Unit' => 'Einh',
+ 'Unit of measure' => 'Maßeinheit',
+ 'Update' => 'Erneuern',
+ 'Update Dataset' => 'Datenbank aktualisieren',
+ 'Updated' => 'Erneuert am',
+ 'Use Templates' => 'Benutze Vorlagen',
+ 'User' => 'Benutzer',
+ 'User deleted!' => 'Benutzer gelöscht!',
+ 'User saved!' => 'Benutzer gespeichert!',
+ 'Vendor' => 'Lieferant',
+ 'Vendor Invoice' => 'Einkaufsrechnung',
+ 'Vendor deleted!' => 'Lieferant gelöscht!',
+ 'Vendor missing!' => 'Lieferant fehlt!',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'Vendor saved!' => 'Lieferant gespeichert!',
+ 'Vendors' => 'Lieferanten',
+ 'Version' => 'Version',
+ 'Weight' => 'Gewicht',
+ 'Weight Unit' => 'Gewichtseinh.',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'Year End' => 'Jahresende',
+ 'Yes' => 'Ja',
+ 'You are logged out!' => 'Auf wiedersehen!',
+ 'You did not enter a name!' => 'Sie haben keinen Namen eingegeben!',
+ 'You must enter a host and port for local and remote connections!' => '"Rechner" und "Port" müssen für lokale und externe Verbindungen eingetragen werden!',
+ 'as at' => 'zum Stand',
+ 'collected on sales' => 'erhalten durch Verkäufe',
+ 'days' => 'Tage',
+ 'does not exist' => 'existiert nicht',
+ 'ea' => 'pro',
+ 'emailed to' => 'gemailt an',
+ 'for Period' => 'für den Zeitraum',
+ 'hr' => 'Std',
+ 'is already a member!' => 'ist bereits ein Mitglied!',
+ 'is not a member!' => 'ist kein Mitglied!',
+ 'localhost' => 'lokaler Rechner',
+ 'locked!' => 'gesperrt!',
+ 'paid on purchases' => 'gezahlt durch Einkäufe',
+ 'sent to printer' => 'an Drucker geschickt',
+ 'successfully created!' => 'wurde erfolgreich erstellt',
+ 'successfully deleted!' => 'wurde erfolgreich gelöscht',
+ 'to' => 'bis',
+ 'website' => 'Website',
+};
+
+1;
diff --git a/sql-ledger/locale/de/am b/sql-ledger/locale/de/am
new file mode 100644
index 000000000..9b9328774
--- /dev/null
+++ b/sql-ledger/locale/de/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Verbindlichkeiten',
+ 'AR' => 'Forderungen',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer fehlt!',
+ 'Account Type' => 'Kontoart',
+ 'Account Type missing!' => 'Kontoart fehlt!',
+ 'Account deleted!' => 'Konto gelöscht!',
+ 'Account saved!' => 'Konto gespeichert!',
+ 'Add Account' => 'Konto anlegen',
+ 'Add GIFI' => 'GIFI anlegen',
+ 'Address' => 'Adresse',
+ 'Asset' => 'Aktiva/Mittelverwendung',
+ 'Audit Control' => 'Bücherkontrolle',
+ 'Backup sent to' => 'Eine Sicherungskopie wurde gesandt an',
+ 'Books are open' => 'Die Bücher sind geöffnet.',
+ 'Business Number' => 'Firmennummer',
+ 'COGS' => 'Umsatzkosten',
+ 'Cannot delete account!' => 'Konto kann nicht gelöscht werden!',
+ 'Cannot delete default account!' => 'Das Standard-Konto kann nicht gelöscht werden!',
+ 'Cannot save account!' => 'Konto kann nicht gespeichert werden!',
+ 'Cannot save preferences!' => 'Benutzereinstellungen können nicht gespeichert werden!',
+ 'Character Set' => 'Zeichensatz',
+ 'Chart of Accounts' => 'Kontenübersicht',
+ 'Close Books up to' => 'Die Bücher abschließen bis zum',
+ 'Company' => 'Firma',
+ 'Continue' => 'Weiter',
+ 'Copy to COA' => 'In Kontenplan kopieren',
+ 'Credit' => 'Haben',
+ 'Date Format' => 'Datumsformat',
+ 'Debit' => 'Soll',
+ 'Delete' => 'Löschen',
+ 'Delete Account' => 'Konto löschen',
+ 'Description' => 'Beschreibung',
+ 'Dropdown Limit' => 'Auswahllistenbegrenzung',
+ 'E-mail' => 'eMail',
+ 'Edit' => 'Bearbeiten',
+ 'Edit Account' => 'Kontodaten bearbeiten',
+ 'Edit GIFI' => 'GIFI editieren',
+ 'Edit Preferences for' => 'Benutzereinstellungen für',
+ 'Edit Template' => 'Vorlage bearbeiten',
+ 'Enforce transaction reversal for all dates' => 'Kontraeintragungen für jeden Zeitraum aktualisieren',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Durch Doppelpunkte getrennte Währungskürzel mit maximal 3 Buchstaben aufführen; Ihre eigene Landeswährung zuerst (z.B. EUR:USD:CAD)',
+ 'Equity' => 'Passiva/Eigenkapital',
+ 'Expense' => 'Aufwand',
+ 'Expense Account' => 'Aufwandskonto',
+ 'Expense/Asset' => 'Aufwand/Anlagen',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Wechselkurserträge',
+ 'Foreign Exchange Loss' => 'Wechselkursaufwendungen',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI gelöscht!',
+ 'GIFI missing!' => 'GIFI fehlt!',
+ 'GIFI saved!' => 'GIFI gespeichert!',
+ 'Heading' => 'Überschrift',
+ 'Include in drop-down menus' => 'In Aufklapp-Menü aufnehmen',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Soll dieses Konto auf dem Kunden- und Lieferantenformular angezeigt werden, um den Kunden/Lieferanten als steuerpflichtig zu markieren?',
+ 'Income' => 'Einkommen',
+ 'Income Account' => 'Einkommenkonto',
+ 'Inventory' => 'Inventar',
+ 'Inventory Account' => 'Warenbestand',
+ 'Is this a summary account to record' => 'Summenkonto für',
+ 'Language' => 'Sprache',
+ 'Last Invoice Number' => 'Letzte Rechnungsnummer',
+ 'Last Numbers & Default Accounts' => 'Laufende Zähler und Standardkonten',
+ 'Last Purchase Order Number' => 'Letzte Enkaufsbelegnummer',
+ 'Last Sales Order Number' => 'Letzte Verkaufsbelegnummer',
+ 'Liability' => 'Passiva/Mittelherkunft',
+ 'Link' => 'Verknüpfungen',
+ 'Name' => 'Name',
+ 'No' => 'Nein',
+ 'No email address for' => 'Keine eMail-Addresse für',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Zahlenformat',
+ 'Parts Inventory' => 'Warenliste',
+ 'Password' => 'Passwort',
+ 'Payables' => 'Verbindlichkeiten',
+ 'Payment' => 'Zahlung',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Einstellungen gespeichert!',
+ 'Rate' => 'Rate',
+ 'Receivables' => 'Forderungen',
+ 'Sales' => 'Warenverkauf',
+ 'Save' => 'Speichern',
+ 'Service Items' => 'Dienstleistungen',
+ 'Ship via' => 'Transportmittel',
+ 'Signature' => 'Unterschrift',
+ 'Stylesheet' => 'Stilvorlage',
+ 'Tax' => 'Steuer',
+ 'Tax Accounts' => 'Steuerkonto',
+ 'Template saved!' => 'Schablone gespeichert!',
+ 'Transaction reversal enforced for all dates' => 'Fehleintragungen müssen für jeden Zeitraum mit einer Kontraeintragung ausgebessert werden',
+ 'Transaction reversal enforced up to' => 'Fehleintragungen können bis zu dem angenebenen Zeitraum nur mit einer Kontraeintragung ausgebessert werden',
+ 'Transactions exist; cannot delete account!' => 'Das Konto kann nicht gelöscht werden, da es Buchungen enthält!',
+ 'Weight Unit' => 'Gewichtseinh.',
+ 'Year End' => 'Jahresende',
+ 'Yes' => 'Ja',
+ 'does not exist' => 'existiert nicht',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'konto_anlegen' => 'add_account',
+ 'weiter' => 'continue',
+ 'in_kontenplan_kopieren' => 'copy_to_coa',
+ 'löschen' => 'delete',
+ 'bearbeiten' => 'edit',
+ 'kontodaten_bearbeiten' => 'edit_account',
+ 'speichern' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ap b/sql-ledger/locale/de/ap
new file mode 100644
index 000000000..59a6d47d7
--- /dev/null
+++ b/sql-ledger/locale/de/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Eingangsbuchung',
+ 'AP Transactions' => 'Eingangsbuchungen',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Eingangsbuchung anlegen',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Amount Due' => 'Betrag fällig',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Buchung kann nicht gelöscht werden!',
+ 'Cannot post payment for a closed period!' => 'Es können keine Zahlungen für abgeschlossene Bücher gebucht werden!',
+ 'Cannot post transaction for a closed period!' => 'Für einen bereits abgeschlossenen Zeitraum kann keine Buchung angelegt werden!',
+ 'Cannot post transaction!' => 'Rechnung kann nicht gebucht werden!',
+ 'Closed' => 'Geschlossen',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Continue' => 'Weiter',
+ 'Currency' => 'Währung',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Zahlungsdatum',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Description' => 'Beschreibung',
+ 'Due Date' => 'Fälligkeitsdatum',
+ 'Due Date missing!' => 'Fälligkeitsdatum fehlt!',
+ 'Edit Accounts Payables Transaction' => 'Einkaufsbuchung bearbeiten',
+ 'Employee' => 'Bearbeiter',
+ 'Exch' => 'Wkurs.',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'ID' => 'Nr.',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date' => 'Rechnungsdatum',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Offen',
+ 'Order' => 'Auftrag',
+ 'Order Number' => 'Auftragsnummer',
+ 'Paid' => 'Bezahlt',
+ 'Payment date missing!' => 'Tag der Zahlung fehlt!',
+ 'Payments' => 'Zahlungen',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Beleg',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax' => 'Steuer',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'Total' => 'Summe',
+ 'Transaction deleted!' => 'Buchung gelöscht!',
+ 'Transaction posted!' => 'Buchung verbucht!',
+ 'Update' => 'Erneuern',
+ 'Vendor' => 'Lieferant',
+ 'Vendor Invoice' => 'Einkaufsrechnung',
+ 'Vendor missing!' => 'Lieferant fehlt!',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'Yes' => 'Ja',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'eingangsbuchung' => 'ap_transaction',
+ 'eingangsbuchung_anlegen' => 'add_accounts_payables_transaction',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'einkaufsbuchung_bearbeiten' => 'edit_accounts_payables_transaction',
+ 'buchen' => 'post',
+ 'neu_buchen' => 'post_as_new',
+ 'erneuern' => 'update',
+ 'einkaufsrechnung' => 'vendor_invoice',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ar b/sql-ledger/locale/de/ar
new file mode 100644
index 000000000..741bc9244
--- /dev/null
+++ b/sql-ledger/locale/de/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Ausgangsbuchung',
+ 'AR Transactions' => 'Ausgangsbuchungen',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Ausgangsbuchung anlegen',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Amount Due' => 'Betrag fällig',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Buchung kann nicht gelöscht werden!',
+ 'Cannot post payment for a closed period!' => 'Es können keine Zahlungen für abgeschlossene Bücher gebucht werden!',
+ 'Cannot post transaction for a closed period!' => 'Für einen bereits abgeschlossenen Zeitraum kann keine Buchung angelegt werden!',
+ 'Cannot post transaction!' => 'Rechnung kann nicht gebucht werden!',
+ 'Closed' => 'Geschlossen',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Continue' => 'Weiter',
+ 'Credit Limit' => 'Kreditlimit',
+ 'Currency' => 'Währung',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kundenname fehlt!',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Zahlungsdatum',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Description' => 'Beschreibung',
+ 'Due Date' => 'Fälligkeitsdatum',
+ 'Due Date missing!' => 'Fälligkeitsdatum fehlt!',
+ 'Edit Accounts Receivables Transaction' => 'Ausgangsbuchung bearbeiten',
+ 'Exch' => 'Wkurs.',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'ID' => 'Nr.',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date' => 'Rechnungsdatum',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Offen',
+ 'Order' => 'Auftrag',
+ 'Order Number' => 'Auftragsnummer',
+ 'Paid' => 'Bezahlt',
+ 'Payment date missing!' => 'Tag der Zahlung fehlt!',
+ 'Payments' => 'Zahlungen',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Remaining' => 'Rest',
+ 'Sales Invoice' => 'Ausgangsrechnung',
+ 'Salesperson' => 'Verkaufsperson',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Ship via' => 'Transportmittel',
+ 'Source' => 'Beleg',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax' => 'Steuer',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'Total' => 'Summe',
+ 'Transaction deleted!' => 'Buchung gelöscht!',
+ 'Transaction posted!' => 'Buchung verbucht!',
+ 'Update' => 'Erneuern',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'Yes' => 'Ja',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'ausgangsbuchung' => 'ar_transaction',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'buchen' => 'post',
+ 'neu_buchen' => 'post_as_new',
+ 'ausgangsrechnung' => 'sales_invoice',
+ 'erneuern' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/arap b/sql-ledger/locale/de/arap
new file mode 100644
index 000000000..7070ce144
--- /dev/null
+++ b/sql-ledger/locale/de/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresse',
+ 'Continue' => 'Weiter',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Description' => 'Beschreibung',
+ 'Number' => 'Nummer',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'weiter' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ca b/sql-ledger/locale/de/ca
new file mode 100644
index 000000000..d14080146
--- /dev/null
+++ b/sql-ledger/locale/de/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanz',
+ 'Chart of Accounts' => 'Kontenübersicht',
+ 'Credit' => 'Haben',
+ 'Date' => 'Datum',
+ 'Debit' => 'Soll',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Description' => 'Beschreibung',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'List Transactions' => 'Buchungsliste',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Reference' => 'Referenz',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Subtotal' => 'Zwischensumme',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'buchungsliste' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/de/cp b/sql-ledger/locale/de/cp
new file mode 100644
index 000000000..125874e3a
--- /dev/null
+++ b/sql-ledger/locale/de/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Amount does not equal applied!' => 'Betrag stimmt nicht überein!',
+ 'Amount missing!' => 'Betrag fehlt!',
+ 'Applied' => 'Ausgewählt',
+ 'Cannot post payment!' => 'Zahlung kann nicht gebucht werden!',
+ 'Cannot process payment for a closed period!' => 'Es kann keine Zahlung in einem abgeschlossenen Zeitraum verbucht werden!',
+ 'Check' => 'Scheck',
+ 'Check printed!' => 'Scheck ist gedruckt!',
+ 'Check printing failed!' => 'Scheck drucken ist fehlgeschlagen!',
+ 'Continue' => 'Weiter',
+ 'Currency' => 'Währung',
+ 'Customer' => 'Kunde',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Date missing!' => 'Datum fehlt!',
+ 'Description' => 'Beschreibung',
+ 'Due' => 'Fällig',
+ 'Exchangerate' => 'Wechselkurs',
+ 'From' => 'Von',
+ 'Invoice' => 'Rechnung',
+ 'Invoices' => 'Rechnungen',
+ 'Nothing applied!' => 'Sie haben nichts ausgewählt',
+ 'Number' => 'Nummer',
+ 'Paid in full' => 'Voll bezahlt',
+ 'Payment' => 'Zahlung',
+ 'Payment posted!' => 'Zahlung gebucht!',
+ 'Post' => 'Buchen',
+ 'Print' => 'Drucken',
+ 'Printer' => 'Drucker',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Receipt' => 'Quittung',
+ 'Receipt printed!' => 'Quittung gedruckt!',
+ 'Receipt printing failed!' => 'Quittung konnte nicht gedruckt werden!',
+ 'Reference' => 'Referenz',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Update' => 'Erneuern',
+ 'Vendor' => 'Lieferant',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'weiter' => 'continue',
+ 'buchen' => 'post',
+ 'drucken' => 'print',
+ 'erneuern' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ct b/sql-ledger/locale/de/ct
new file mode 100644
index 000000000..07d260777
--- /dev/null
+++ b/sql-ledger/locale/de/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Hinzufügen',
+ 'Address' => 'Adresse',
+ 'All' => 'Alle',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Kunde kann nicht gelöscht werden!',
+ 'Cannot delete vendor!' => 'Lieferant kann nicht gelöscht werden!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Credit Limit' => 'Kreditlimit',
+ 'Customer deleted!' => 'Kunde gelöscht!',
+ 'Customer saved!' => 'Kunde gespeichert!',
+ 'Customers' => 'Kunden',
+ 'Delete' => 'Löschen',
+ 'Discount' => 'Rabatt',
+ 'E-mail' => 'eMail',
+ 'Edit Customer' => 'Kunde editieren',
+ 'Edit Vendor' => 'Lieferant editieren',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Invoice' => 'Rechnung',
+ 'Name' => 'Name',
+ 'Name missing!' => 'Name fehlt!',
+ 'Notes' => 'Bemerkungen',
+ 'Number' => 'Nummer',
+ 'Order' => 'Auftrag',
+ 'Orphaned' => 'nie benutzt',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Speichern',
+ 'Ship to' => 'Verschicken an',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'Taxable' => 'Steuerpflichtig',
+ 'Terms: Net' => 'Zahlungsziel',
+ 'Transactions exist, cannot delete customer!' => 'Der Kunde kann nicht gelöscht werden, da Buchungen vorhanden sind!',
+ 'Transactions exist, cannot delete vendor!' => 'Der Lieferant kann nicht gelöscht werden, da Buchungen vorhanden sind!',
+ 'Vendor deleted!' => 'Lieferant gelöscht!',
+ 'Vendor saved!' => 'Lieferant gespeichert!',
+ 'Vendors' => 'Lieferanten',
+ 'days' => 'Tage',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'hinzufügen' => 'add',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'rechnung' => 'invoice',
+ 'auftrag' => 'order',
+ 'speichern' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/de/gl b/sql-ledger/locale/de/gl
new file mode 100644
index 000000000..71634939a
--- /dev/null
+++ b/sql-ledger/locale/de/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Eingangsbuchung',
+ 'AR Transaction' => 'Ausgangsbuchung',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Hinzufügen einer Buchung zum Hauptbuch',
+ 'Address' => 'Adresse',
+ 'All' => 'Alle',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
+ 'Asset' => 'Aktiva/Mittelverwendung',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanz',
+ 'Cannot delete transaction!' => 'Buchung kann nicht gelöscht werden!',
+ 'Cannot have a value in both Debit and Credit!' => 'Es kann nicht gleichzeitig Soll und Haben gebucht werden!',
+ 'Cannot post a transaction without a value!' => 'Eine Buchung ohne Betrag kann nicht verbucht werden!',
+ 'Cannot post transaction for a closed period!' => 'Für einen bereits abgeschlossenen Zeitraum kann keine Buchung angelegt werden!',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Continue' => 'Weiter',
+ 'Credit' => 'Haben',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Debit' => 'Soll',
+ 'Debit and credit out of balance!' => 'Soll und Haben müssen gleich sein.',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Description' => 'Beschreibung',
+ 'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten',
+ 'Equity' => 'Passiva/Eigenkapital',
+ 'Expense' => 'Aufwand',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Hauptbucheintragung',
+ 'General Ledger' => 'Hauptbuch',
+ 'ID' => 'Nr.',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Income' => 'Einkommen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Liability' => 'Passiva/Mittelherkunft',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Reference' => 'Referenz',
+ 'Reference missing!' => 'Referenz fehlt!',
+ 'Reports' => 'Berichte',
+ 'Sales Invoice' => 'Ausgangsrechnung',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Beleg',
+ 'Subtotal' => 'Zwischensumme',
+ 'Transaction Date missing!' => 'Buchungsdatum fehlt!',
+ 'Transaction deleted!' => 'Buchung gelöscht!',
+ 'Transaction posted!' => 'Buchung verbucht!',
+ 'Update' => 'Erneuern',
+ 'Vendor Invoice' => 'Einkaufsrechnung',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'Yes' => 'Ja',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'eingangsbuchung' => 'ap_transaction',
+ 'ausgangsbuchung' => 'ar_transaction',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'hauptbucheintragung' => 'gl_transaction',
+ 'buchen' => 'post',
+ 'neu_buchen' => 'post_as_new',
+ 'ausgangsrechnung' => 'sales_invoice',
+ 'erneuern' => 'update',
+ 'einkaufsrechnung' => 'vendor_invoice',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ic b/sql-ledger/locale/de/ic
new file mode 100644
index 000000000..6fa30d1bb
--- /dev/null
+++ b/sql-ledger/locale/de/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Aktiv',
+ 'Add' => 'Hinzufügen',
+ 'Add Assembly' => 'Erzeugnis anlegen',
+ 'Add Part' => 'Ware anlegen',
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Add Service' => 'Dienstleistung anlegen',
+ 'Address' => 'Adresse',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Assemblies' => 'Erzeugnisse',
+ 'Assemblies restocked!' => 'Erzeugnisse sind im Lager!',
+ 'Assembly Number missing!' => 'Erzeugnisnummer fehlt!',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'BOM' => 'Stückliste',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'Bought' => 'Gekauft',
+ 'COGS' => 'Umsatzkosten',
+ 'Cannot delete item!' => 'Artikel kann nicht gelöscht werden!',
+ 'Cannot stock assemblies!' => 'Erzeugnisse können nicht ins Lager!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Geschlossen',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Delivery Date' => 'Lieferung',
+ 'Description' => 'Beschreibung',
+ 'Drawing' => 'Zeichnung',
+ 'E-mail' => 'eMail',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Edit Assembly' => 'Erzeugnis bearbeiten',
+ 'Edit Part' => 'Ware bearbeiten',
+ 'Edit Service' => 'Dienstleistung bearbeiten',
+ 'Expense' => 'Aufwand',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'Image' => 'Grafik',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Income' => 'Einkommen',
+ 'Individual Items' => 'Einzelteile',
+ 'Inventory' => 'Inventar',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Bevor dieses Erzeugnis als ungültig markiert werden kann, muß das Inventar auf Null sein!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Bevor diese Ware als ungültig markiert werden kann, muß das Inventar Null sein!',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Item deleted!' => 'Artikel gelöscht!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Last Cost' => 'Letzte Kosten',
+ 'Line Total' => 'Zeilensumme',
+ 'Link Accounts' => 'Konten verknüpfen',
+ 'List Price' => 'Listenpreis',
+ 'Make' => 'Hersteller',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Modell',
+ 'Name' => 'Name',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'Obsolete' => 'Ungültig',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'auf Lager',
+ 'On Order' => 'auf Bestellung',
+ 'Order' => 'Auftrag',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Number' => 'Auftragsnummer',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'Ordered' => 'Vom Kunde bestellt',
+ 'Orphaned' => 'nie benutzt',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Part' => 'Ware',
+ 'Part Number missing!' => 'Warennummer fehlt!',
+ 'Parts' => 'Waren',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preis',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Qty' => 'Anz',
+ 'ROP' => 'UAB',
+ 'Recd' => 'Erh',
+ 'Required by' => 'Erforderlich am',
+ 'Sales' => 'Warenverkauf',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Save' => 'Speichern',
+ 'Save as new' => 'als neu speichern',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sell Price' => 'Verkaufspreis',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Service Number missing!' => 'Dienstleistungsnummer fehlt!',
+ 'Services' => 'Leistungen',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Short' => 'Kurz',
+ 'Sold' => 'Verkauft',
+ 'Stock' => 'einlagern',
+ 'Stock Assembly' => 'Erzeugnis einlagern',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax' => 'Steuer',
+ 'To' => 'An',
+ 'Top Level' => 'Hauptbeschreibung',
+ 'Total' => 'Summe',
+ 'Unit' => 'Einh',
+ 'Unit of measure' => 'Maßeinheit',
+ 'Update' => 'Erneuern',
+ 'Updated' => 'Erneuert am',
+ 'Weight' => 'Gewicht',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'ea' => 'pro',
+ 'emailed to' => 'gemailt an',
+ 'hr' => 'Std',
+ 'sent to printer' => 'an Drucker geschickt',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'hinzufügen' => 'add',
+ 'erzeugnis_anlegen' => 'add_assembly',
+ 'ware_anlegen' => 'add_part',
+ 'dienstleistung_anlegen' => 'add_service',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'erzeugnis_bearbeiten' => 'edit_assembly',
+ 'ware_bearbeiten' => 'edit_part',
+ 'dienstleistung_bearbeiten' => 'edit_service',
+ 'speichern' => 'save',
+ 'als_neu_speichern' => 'save_as_new',
+ 'erneuern' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/de/io b/sql-ledger/locale/de/io
new file mode 100644
index 000000000..3e94eb8a7
--- /dev/null
+++ b/sql-ledger/locale/de/io
@@ -0,0 +1,108 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Address' => 'Adresse',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delivery Date' => 'Lieferung',
+ 'Description' => 'Beschreibung',
+ 'E-mail' => 'eMail',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Name' => 'Name',
+ 'No.' => 'Nr.',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Auftrag',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Part' => 'Ware',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preis',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Qty' => 'Anz',
+ 'Recd' => 'Erh',
+ 'Required by' => 'Erforderlich am',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Subject' => 'Betreff',
+ 'To' => 'An',
+ 'Unit' => 'Einh',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'emailed to' => 'gemailt an',
+ 'sent to printer' => 'an Drucker geschickt',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'weiter' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/de/ir b/sql-ledger/locale/de/ir
new file mode 100644
index 000000000..7b60e4738
--- /dev/null
+++ b/sql-ledger/locale/de/ir
@@ -0,0 +1,180 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Add Vendor Invoice' => 'Einkaufsrechnung anlegen',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'Cannot delete invoice!' => 'Rechnung kann nicht gelöscht werden!',
+ 'Cannot post invoice for a closed period!' => 'Das Rechnungsdatum fällt in einen abgeschlossen Zeitraum!',
+ 'Cannot post invoice!' => 'Rechnung kann nicht gebucht werden!',
+ 'Cannot post payment for a closed period!' => 'Es können keine Zahlungen für abgeschlossene Bücher gebucht werden!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Currency' => 'Währung',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Delivery Date' => 'Lieferung',
+ 'Description' => 'Beschreibung',
+ 'Due Date' => 'Fälligkeitsdatum',
+ 'E-mail' => 'eMail',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Edit Vendor Invoice' => 'Einkaufsrechnung bearbeiten',
+ 'Exch' => 'Wkurs.',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date' => 'Rechnungsdatum',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Invoice deleted!' => 'Rechnung gelöscht!',
+ 'Invoice posted!' => 'Rechnung verbucht!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Name' => 'Name',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Auftrag',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Number' => 'Auftragsnummer',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Part' => 'Ware',
+ 'Payment date missing!' => 'Tag der Zahlung fehlt!',
+ 'Payments' => 'Zahlungen',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preis',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Qty' => 'Anz',
+ 'Recd' => 'Erh',
+ 'Record in' => 'Buchen auf',
+ 'Required by' => 'Erforderlich am',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Source' => 'Beleg',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'To' => 'An',
+ 'Total' => 'Summe',
+ 'Unit' => 'Einh',
+ 'Update' => 'Erneuern',
+ 'Vendor' => 'Lieferant',
+ 'Vendor missing!' => 'Lieferant fehlt!',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'Yes' => 'Ja',
+ 'ea' => 'pro',
+ 'emailed to' => 'gemailt an',
+ 'sent to printer' => 'an Drucker geschickt',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'auftrag' => 'order',
+ 'buchen' => 'post',
+ 'neu_buchen' => 'post_as_new',
+ 'erneuern' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/is b/sql-ledger/locale/de/is
new file mode 100644
index 000000000..f5edab60a
--- /dev/null
+++ b/sql-ledger/locale/de/is
@@ -0,0 +1,187 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Invoice' => 'Ausgangsrechnung anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'Cannot delete invoice!' => 'Rechnung kann nicht gelöscht werden!',
+ 'Cannot post invoice for a closed period!' => 'Das Rechnungsdatum fällt in einen abgeschlossen Zeitraum!',
+ 'Cannot post invoice!' => 'Rechnung kann nicht gebucht werden!',
+ 'Cannot post payment for a closed period!' => 'Es können keine Zahlungen für abgeschlossene Bücher gebucht werden!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Credit Limit' => 'Kreditlimit',
+ 'Currency' => 'Währung',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kundenname fehlt!',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Delivery Date' => 'Lieferung',
+ 'Description' => 'Beschreibung',
+ 'Due Date' => 'Fälligkeitsdatum',
+ 'E-mail' => 'eMail',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Edit Sales Invoice' => 'Ausgangsrechnung bearbeiten',
+ 'Exch' => 'Wkurs.',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date' => 'Rechnungsdatum',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number' => 'Rechnungsnummer',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Invoice deleted!' => 'Rechnung gelöscht!',
+ 'Invoice posted!' => 'Rechnung verbucht!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Name' => 'Name',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Auftrag',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Number' => 'Auftragsnummer',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Part' => 'Ware',
+ 'Payment date missing!' => 'Tag der Zahlung fehlt!',
+ 'Payments' => 'Zahlungen',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Buchen',
+ 'Post as new' => 'Neu buchen',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preis',
+ 'Print' => 'Drucken',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Qty' => 'Anz',
+ 'Recd' => 'Erh',
+ 'Record in' => 'Buchen auf',
+ 'Remaining' => 'Rest',
+ 'Required by' => 'Erforderlich am',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Ship via' => 'Transportmittel',
+ 'Source' => 'Beleg',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'To' => 'An',
+ 'Total' => 'Summe',
+ 'Unit' => 'Einh',
+ 'Update' => 'Erneuern',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'Yes' => 'Ja',
+ 'ea' => 'pro',
+ 'emailed to' => 'gemailt an',
+ 'sent to printer' => 'an Drucker geschickt',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'email' => 'e_mail',
+ 'auftrag' => 'order',
+ 'buchen' => 'post',
+ 'neu_buchen' => 'post_as_new',
+ 'drucken' => 'print',
+ 'verschicken_an' => 'ship_to',
+ 'erneuern' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/locales.pl b/sql-ledger/locale/de/locales.pl
new file mode 100755
index 000000000..a358a905e
--- /dev/null
+++ b/sql-ledger/locale/de/locales.pl
@@ -0,0 +1,303 @@
+#!/usr/bin/perl
+
+# -n do not include custom_ scripts
+
+use FileHandle;
+
+
+$basedir = "../..";
+$bindir = "$basedir/bin/mozilla";
+$menufile = "menu.ini";
+
+foreach $item (@ARGV) {
+ $item =~ s/-//g;
+ $arg{$item} = 1;
+}
+
+opendir DIR, "$bindir" or die "$!";
+@progfiles = grep { /\.pl/; !/(_|^\.)/ } readdir DIR;
+seekdir DIR, 0;
+@customfiles = grep /_/, readdir DIR;
+closedir DIR;
+
+# put customized files into @customfiles
+@customfiles = () if ($arg{n});
+
+if ($arg{n}) {
+ @menufiles = ($menufile);
+} else {
+ opendir DIR, "$basedir" or die "$!";
+ @menufiles = grep { /.*?_$menufile$/ } readdir DIR;
+ closedir DIR;
+ unshift @menufiles, $menufile;
+}
+
+
+# slurp the translations in
+if (-f 'all') {
+ require "all";
+}
+
+
+foreach $file (@progfiles) {
+
+ %locale = ();
+ %submit = ();
+ %subrt = ();
+
+ &scanfile("$bindir/$file");
+
+ # scan custom_{module}.pl or {login}_{module}.pl files
+ foreach $customfile (@customfiles) {
+ if ($customfile =~ /_$file/) {
+ if (-f "$bindir/$customfile") {
+ &scanfile("$bindir/$customfile");
+ }
+ }
+ }
+
+ # if this is the menu.pl file
+ if ($file eq 'menu.pl') {
+ foreach $item (@menufiles) {
+ &scanmenu("$basedir/$item");
+ }
+ }
+
+ $file =~ s/\.pl//;
+
+
+ eval { require 'missing'; };
+ unlink 'missing';
+
+ foreach $text (keys %$missing) {
+ if ($locale{$text}) {
+ unless ($self{texts}{$text}) {
+ $self{texts}{$text} = $missing->{$text};
+ }
+ }
+ }
+
+
+ open FH, ">$file" or die "$! : $file";
+
+ print FH q|$self{texts} = {
+|;
+
+ foreach $key (sort keys %locale) {
+ if ($self{texts}{$key}) {
+ $text = $self{texts}{$key};
+ } else {
+ $text = $key;
+ }
+ $text =~ s/'/\\'/g;
+ $text =~ s/\\$/\\\\/;
+
+ $keytext = $key;
+ $keytext =~ s/'/\\'/g;
+ $keytext =~ s/\\$/\\\\/;
+
+ print FH qq| '$keytext'|.(' ' x (27-length($keytext))).qq| => '$text',\n|;
+ }
+
+ print FH q|};
+
+$self{subs} = {
+|;
+
+ foreach $key (sort keys %subrt) {
+ $text = $key;
+ $text =~ s/'/\\'/g;
+ $text =~ s/\\$/\\\\/;
+ print FH qq| '$text'|.(' ' x (27-length($text))).qq| => '$text',\n|;
+ }
+
+ foreach $key (sort keys %submit) {
+ $text = ($self{texts}{$key}) ? $self{texts}{$key} : $key;
+ $text =~ s/'/\\'/g;
+ $text =~ s/\\$/\\\\/;
+
+ $english_sub = $key;
+ $english_sub =~ s/'/\\'/g;
+ $english_sub =~ s/\\$/\\\\/;
+ $english_sub = lc $key;
+
+ $translated_sub = lc $text;
+ $english_sub =~ s/( |-|,)/_/g;
+ $translated_sub =~ s/( |-|,)/_/g;
+ print FH qq| '$translated_sub'|.(' ' x (27-length($translated_sub))).qq| => '$english_sub',\n|;
+ }
+
+ print FH q|};
+
+1;
+|;
+
+ close FH;
+}
+
+
+# now print out all
+
+open FH, ">all" or die "$! : all";
+
+print FH q|# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+|;
+
+
+foreach $key (sort keys %alllocales) {
+ $text = $self{texts}{$key};
+
+ $count++;
+
+ $text =~ s/'/\\'/g;
+ $text =~ s/\\$/\\\\/;
+ $key =~ s/'/\\'/g;
+ $key =~ s/\\$/\\\\/;
+
+ unless ($text) {
+ $notext++;
+ push @missing, $key;
+ }
+
+ print FH qq| '$key'|.(' ' x (27-length($key))).qq| => '$text',\n|;
+
+}
+
+print FH q|};
+
+1;
+|;
+
+close FH;
+
+
+if (@missing) {
+ open FH, ">missing" or die "$! : missing";
+
+ print FH q|# add the missing texts and run locales.pl to rebuild
+
+$missing = {
+|;
+
+ foreach $text (@missing) {
+ print FH qq| '$text'|.(' ' x (27-length($text))).qq| => '',\n|;
+ }
+
+ print FH q|};
+
+1;
+|;
+
+ close FH;
+
+}
+
+open(FH, "LANGUAGE");
+@language = <FH>;
+close(FH);
+$trlanguage = $language[0];
+chomp $trlanguage;
+
+$per = sprintf("%.1f", ($count - $notext) / $count * 100);
+print "\n$trlanguage - ${per}%\n";
+
+exit;
+# eom
+
+
+sub scanfile {
+ my $file = shift;
+
+ return unless (-f "$file");
+
+ my $fh = new FileHandle;
+ open $fh, "$file" or die "$! : $file";
+
+ while (<$fh>) {
+ # is this another file
+ if (/require\s+\W.*\.pl/) {
+ my $newfile = $&;
+ $newfile =~ s/require\s+\W//;
+ $newfile =~ s/\$form->{path}\///;
+ &scanfile("$bindir/$newfile");
+ }
+
+ # is this a sub ?
+ if (/^sub /) {
+ ($null, $subrt) = split / +/;
+ $subrt{$subrt} = 1;
+ next;
+ }
+
+ my $rc = 1;
+
+ while ($rc) {
+ if (/Locale/) {
+ unless (/^use /) {
+ my ($null, $country) = split /,/;
+ $country =~ s/^ +["']//;
+ $country =~ s/["'].*//;
+ }
+ }
+
+ if (/\$locale->text.*?\W\)/) {
+ my $string = $&;
+ $string =~ s/\$locale->text\(\s*['"(q|qq)]['\/\\\|~]*//;
+ $string =~ s/\W\)+.*$//;
+
+ # if there is no $ in the string record it
+ unless ($string =~ /\$\D.*/) {
+ # this guarantees one instance of string
+ $locale{$string} = 1;
+
+ # this one is for all the locales
+ $alllocales{$string} = 1;
+
+ # is it a submit button before $locale->
+ if (/type=submit/) {
+ $submit{$string} = 1;
+ }
+ }
+ }
+
+ # exit loop if there are no more locales on this line
+ ($rc) = ($' =~ /\$locale->text/);
+ # strip text
+ s/^.*?\$locale->text.*?\)//;
+ }
+ }
+
+ close($fh);
+
+}
+
+
+sub scanmenu {
+ my $file = shift;
+
+ my $fh = new FileHandle;
+ open $fh, "$file" or die "$! : $file";
+
+ my @a = grep /^\[/, <$fh>;
+ close($fh);
+
+ # strip []
+ grep { s/(\[|\])//g } @a;
+
+ foreach my $item (@a) {
+ @b = split /--/, $item;
+ foreach $string (@b) {
+ chomp $string;
+ $locale{$string} = 1;
+ $alllocales{$string} = 1;
+ }
+ }
+
+}
+
+
diff --git a/sql-ledger/locale/de/login b/sql-ledger/locale/de/login
new file mode 100644
index 000000000..c90df6f84
--- /dev/null
+++ b/sql-ledger/locale/de/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Über',
+ 'Database Host' => 'Datenbank-Rechner',
+ 'Dataset' => 'Datenbank',
+ 'Incorrect Dataset version!' => 'Datenbankversion stimmt nicht überein!',
+ 'Incorrect Password!' => 'Ungültiges Passwort!',
+ 'Licensed to' => 'Lizensiert für',
+ 'Login' => 'Anmelden',
+ 'Name' => 'Name',
+ 'Password' => 'Passwort',
+ 'User' => 'Benutzer',
+ 'Version' => 'Version',
+ 'You are logged out!' => 'Auf wiedersehen!',
+ 'You did not enter a name!' => 'Sie haben keinen Namen eingegeben!',
+ 'is not a member!' => 'ist kein Mitglied!',
+ 'localhost' => 'lokaler Rechner',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'anmelden' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/de/menu b/sql-ledger/locale/de/menu
new file mode 100644
index 000000000..c61e76057
--- /dev/null
+++ b/sql-ledger/locale/de/menu
@@ -0,0 +1,73 @@
+$self{texts} = {
+ 'AP' => 'Verbindlichkeiten',
+ 'AP Aging' => 'Offene Verbindl.',
+ 'AR' => 'Forderungen',
+ 'AR Aging' => 'Offene Forderungen',
+ 'Accounting Menu' => 'Kontoverwaltung',
+ 'Add Account' => 'Konto anlegen',
+ 'Add Assembly' => 'Erzeugnis anlegen',
+ 'Add Customer' => 'Kunde anlegen',
+ 'Add GIFI' => 'GIFI anlegen',
+ 'Add Group' => 'Gruppe anlegen',
+ 'Add Part' => 'Ware anlegen',
+ 'Add Project' => 'Projekt anlegen',
+ 'Add Service' => 'Dienstleistung anlegen',
+ 'Add Transaction' => 'Buchung anlegen',
+ 'Add Vendor' => 'Lieferant anlegen',
+ 'Assemblies' => 'Erzeugnisse',
+ 'Audit Control' => 'Bücherkontrolle',
+ 'Backup' => 'Sicherung',
+ 'Balance Sheet' => 'Bilanz',
+ 'Cash' => 'Kasse',
+ 'Chart of Accounts' => 'Kontenübersicht',
+ 'Check' => 'Scheck',
+ 'Customers' => 'Kunden',
+ 'General Ledger' => 'Hauptbuch',
+ 'Goods & Services' => 'Waren und Dienstleistungen',
+ 'Groups' => 'Gruppen',
+ 'HTML Templates' => 'HTML Vorlagen',
+ 'Income Statement' => 'G & V',
+ 'Invoice' => 'Rechnung',
+ 'LaTeX Templates' => 'LaTeX Vorlagen',
+ 'List Accounts' => 'Kontenliste',
+ 'List GIFI' => 'GIFI aufzeigen',
+ 'Logout' => 'Abmelden',
+ 'Order Entry' => 'Aufträge',
+ 'Packing List' => 'Verpackungsliste',
+ 'Parts' => 'Waren',
+ 'Payment' => 'Zahlung',
+ 'Payments' => 'Zahlungen',
+ 'Preferences' => 'Benutzereinstellungen',
+ 'Projects' => 'Projekte',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Purchase Orders' => 'Einkaufsbelege',
+ 'Receipt' => 'Quittung',
+ 'Receipts' => 'Quittungen',
+ 'Reconciliation' => 'Abgleichung',
+ 'Reports' => 'Berichte',
+ 'Sales Invoice' => 'Ausgangsrechnung',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Sales Orders' => 'Verkaufsbelege',
+ 'Save to File' => 'Auf Festplatte speichern',
+ 'Send by E-Mail' => 'Per eMail schicken',
+ 'Services' => 'Leistungen',
+ 'Statement' => 'Sammelrechnung',
+ 'Stock Assembly' => 'Erzeugnis einlagern',
+ 'Stylesheet' => 'Stilvorlage',
+ 'System' => 'System',
+ 'Tax collected' => 'vereinnahmte Steuer',
+ 'Tax paid' => 'Vorsteuer',
+ 'Transactions' => 'Buchungen',
+ 'Trial Balance' => 'Vergleichsbilanz',
+ 'Vendor Invoice' => 'Einkaufsrechnung',
+ 'Vendors' => 'Lieferanten',
+ 'Version' => 'Version',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/de/oe b/sql-ledger/locale/de/oe
new file mode 100644
index 000000000..abf31ba13
--- /dev/null
+++ b/sql-ledger/locale/de/oe
@@ -0,0 +1,202 @@
+$self{texts} = {
+ 'Add' => 'Hinzufügen',
+ 'Add Purchase Order' => 'Einkaufsbeleg anlegen',
+ 'Add Sales Invoice' => 'Ausgangsrechnung anlegen',
+ 'Add Sales Order' => 'Verkaufsbeleg anlegen',
+ 'Add Vendor Invoice' => 'Einkaufsrechnung anlegen',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Betrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Order Number' => 'Soll die Bestellung mit folgender Nummer wirklich gelöscht werden:',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Stellage',
+ 'C' => 'G',
+ 'Cannot delete order!' => 'Bestellung kann nicht gelöscht werden!',
+ 'Cannot save order!' => 'Bestellung kann nicht gespeichert werden!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Geschlossen',
+ 'Confirm!' => 'Bestätigen Sie!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Credit Limit' => 'Kreditlimit',
+ 'Curr' => 'Währung',
+ 'Currency' => 'Währung',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kundenname fehlt!',
+ 'Customer not on file!' => 'Kunde ist nicht in der Datenbank!',
+ 'Date' => 'Datum',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Delete' => 'Löschen',
+ 'Delivery Date' => 'Lieferung',
+ 'Description' => 'Beschreibung',
+ 'E-mail' => 'eMail',
+ 'E-mail address missing!' => 'eMail-Adresse fehlt!',
+ 'Edit Purchase Order' => 'Einkaufsbeleg bearbeiten',
+ 'Edit Sales Order' => 'Verkaufsbeleg bearbeiten',
+ 'Exchangerate' => 'Wechselkurs',
+ 'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
+ 'Extended' => 'Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'Group' => 'Gruppe',
+ 'Group Items' => 'Waren gruppieren',
+ 'ID' => 'Nr.',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Invoice' => 'Rechnung',
+ 'Invoice Date missing!' => 'Rechnungsdatum fehlt!',
+ 'Invoice Number missing!' => 'Rechnungsnummer fehlt!',
+ 'Item not on file!' => 'Dieser Artikel ist nicht in der Datenbank!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'Name' => 'Name',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkungen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer fehlt in Zeile',
+ 'O' => 'O',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Offen',
+ 'Order' => 'Auftrag',
+ 'Order Date' => 'Auftragsdatum',
+ 'Order Date missing!' => 'Auftragsdatum fehlt!',
+ 'Order Number' => 'Auftragsnummer',
+ 'Order Number missing!' => 'Auftragsnummer fehlt!',
+ 'Order deleted!' => 'Auftrag gelöscht!',
+ 'Order saved!' => 'Auftrag gespeichert!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Verpackungsliste',
+ 'Packing List Date missing!' => 'Datum für Verpackungsliste fehlt!',
+ 'Packing List Number missing!' => 'Verpackungslistennummer fehlt!',
+ 'Part' => 'Ware',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Preis',
+ 'Print' => 'Drucken',
+ 'Printer' => 'Drucker',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Dieses Projekt ist nicht in der Datenbank!',
+ 'Purchase Order' => 'Einkaufsbeleg',
+ 'Purchase Orders' => 'Einkaufsbelege',
+ 'Qty' => 'Anz',
+ 'Recd' => 'Erh',
+ 'Remaining' => 'Rest',
+ 'Required by' => 'Erforderlich am',
+ 'Sales Order' => 'Verkaufsbeleg',
+ 'Sales Orders' => 'Verkaufsbelege',
+ 'Save' => 'Speichern',
+ 'Save as new' => 'als neu speichern',
+ 'Screen' => 'Bildschirm',
+ 'Select from one of the items below' => 'Wählen Sie einen der untenstehenden Einträge',
+ 'Select from one of the names below' => 'Wählen Sie einen der untenstehenden Namen',
+ 'Select from one of the projects below' => 'Wählen Sie eines der untenstehenden Projekte',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienstleistung',
+ 'Ship' => 'Versand',
+ 'Ship to' => 'Verschicken an',
+ 'Ship via' => 'Transportmittel',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax' => 'Steuer',
+ 'Tax Included' => 'Steuer im Preis inbegriffen',
+ 'Terms: Net' => 'Zahlungsziel',
+ 'To' => 'An',
+ 'Total' => 'Summe',
+ 'Unit' => 'Einh',
+ 'Update' => 'Erneuern',
+ 'Vendor' => 'Lieferant',
+ 'Vendor missing!' => 'Lieferant fehlt!',
+ 'Vendor not on file!' => 'Lieferant ist nicht in der Datenbank!',
+ 'What type of item is this?' => 'Was ist dieser Artikel?',
+ 'Yes' => 'Ja',
+ 'days' => 'Tage',
+ 'ea' => 'pro',
+ 'emailed to' => 'gemailt an',
+ 'sent to printer' => 'an Drucker geschickt',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'hinzufügen' => 'add',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'email' => 'e_mail',
+ 'rechnung' => 'invoice',
+ 'drucken' => 'print',
+ 'speichern' => 'save',
+ 'als_neu_speichern' => 'save_as_new',
+ 'verschicken_an' => 'ship_to',
+ 'erneuern' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/de/pe b/sql-ledger/locale/de/pe
new file mode 100644
index 000000000..d3618cc57
--- /dev/null
+++ b/sql-ledger/locale/de/pe
@@ -0,0 +1,45 @@
+$self{texts} = {
+ 'Add' => 'Hinzufügen',
+ 'Add Group' => 'Gruppe anlegen',
+ 'Add Project' => 'Projekt anlegen',
+ 'All' => 'Alle',
+ 'Continue' => 'Weiter',
+ 'Delete' => 'Löschen',
+ 'Description' => 'Beschreibung',
+ 'Edit Group' => 'Gruppe editieren',
+ 'Edit Project' => 'Projekt bearbeiten',
+ 'Group' => 'Gruppe',
+ 'Group deleted!' => 'Gruppe gelöscht!',
+ 'Group missing!' => 'Gruppe fehlt!',
+ 'Group saved!' => 'Gruppe gespeichert!',
+ 'Groups' => 'Gruppen',
+ 'Number' => 'Nummer',
+ 'Orphaned' => 'nie benutzt',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projektnummer fehlt!',
+ 'Project deleted!' => 'Projekt gelöscht!',
+ 'Project saved!' => 'Projekt gespeichert!',
+ 'Projects' => 'Projekte',
+ 'Save' => 'Speichern',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_partsgroup_footer' => 'form_partsgroup_footer',
+ 'form_partsgroup_header' => 'form_partsgroup_header',
+ 'form_project_footer' => 'form_project_footer',
+ 'form_project_header' => 'form_project_header',
+ 'partsgroup_report' => 'partsgroup_report',
+ 'project_report' => 'project_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'hinzufügen' => 'add',
+ 'weiter' => 'continue',
+ 'löschen' => 'delete',
+ 'speichern' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/de/rc b/sql-ledger/locale/de/rc
new file mode 100644
index 000000000..47f5f6e4f
--- /dev/null
+++ b/sql-ledger/locale/de/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Bilanz',
+ 'Cleared Balance' => 'Abgeschlossen',
+ 'Continue' => 'Weiter',
+ 'Date' => 'Datum',
+ 'Deposit' => 'Gutschrift',
+ 'Description' => 'Beschreibung',
+ 'Difference' => 'Differenz',
+ 'Done' => 'Fertig',
+ 'Exchangerate Difference' => 'Wechselkursunterschied',
+ 'From' => 'Von',
+ 'Out of balance!' => 'Summen stimmen nicht überein!',
+ 'Payment' => 'Zahlung',
+ 'Reconciliation' => 'Abgleichung',
+ 'Select all' => 'Alle auswählen',
+ 'Source' => 'Beleg',
+ 'Statement Balance' => 'Sammelrechnungsbilanz',
+ 'Update' => 'Erneuern',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'weiter' => 'continue',
+ 'fertig' => 'done',
+ 'alle_auswählen' => 'select_all',
+ 'erneuern' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/de/rp b/sql-ledger/locale/de/rp
new file mode 100644
index 000000000..f1ffdf4f5
--- /dev/null
+++ b/sql-ledger/locale/de/rp
@@ -0,0 +1,119 @@
+$self{texts} = {
+ 'AP Aging' => 'Offene Verbindl.',
+ 'AR Aging' => 'Offene Forderungen',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Konten',
+ 'Amount' => 'Betrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'als Anhang',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanz',
+ 'Balance Sheet' => 'Bilanz',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'basierend auf Barzahlung',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Gegenüberstellen zu',
+ 'Continue' => 'Weiter',
+ 'Copies' => 'Kopien',
+ 'Credit' => 'Haben',
+ 'Current' => 'Betrag',
+ 'Customer' => 'Kunde',
+ 'Date' => 'Datum',
+ 'Debit' => 'Soll',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezember',
+ 'Decimalplaces' => 'Dezimalstellen',
+ 'Description' => 'Beschreibung',
+ 'Due' => 'Fällig',
+ 'E-mail' => 'eMail',
+ 'E-mail Statement to' => 'eMail Fälligkeitsabrechnung an',
+ 'Feb' => 'Feb',
+ 'February' => 'Februar',
+ 'From' => 'Von',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Überschrift',
+ 'ID' => 'Nr.',
+ 'In-line' => 'im Textkörper (Inline)',
+ 'Include in Report' => 'In Bericht aufnehmen',
+ 'Income Statement' => 'G & V',
+ 'Invoice' => 'Rechnung',
+ 'Jan' => 'Jan',
+ 'January' => 'Januar',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mär',
+ 'March' => 'März',
+ 'May' => 'Mai',
+ 'May ' => 'Mai',
+ 'Message' => 'Nachricht',
+ 'N/A' => 'N.Z.',
+ 'Nothing selected!' => 'Es wurde nichts ausgewählt!',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Zahlungen',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Drucken',
+ 'Printer' => 'Drucker',
+ 'Project Number' => 'Projektnummer',
+ 'Receipts' => 'Quittungen',
+ 'Report for' => 'Bericht für',
+ 'Retained Earnings' => 'Verbliebenes Einkommen',
+ 'Screen' => 'Bildschirm',
+ 'Select all' => 'Alle auswählen',
+ 'Select postscript or PDF!' => 'Postscript oder PDF auswählen!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Beleg',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Sammelrechnung',
+ 'Statement sent to' => 'Sammelrechnung verschickt an',
+ 'Statements sent to printer!' => 'Sammelrechnungen an Drucker geschickt!',
+ 'Subject' => 'Betreff',
+ 'Subtotal' => 'Zwischensumme',
+ 'Tax' => 'Steuer',
+ 'Tax collected' => 'vereinnahmte Steuer',
+ 'Tax paid' => 'Vorsteuer',
+ 'Total' => 'Summe',
+ 'Trial Balance' => 'Vergleichsbilanz',
+ 'Vendor' => 'Lieferant',
+ 'as at' => 'zum Stand',
+ 'collected on sales' => 'erhalten durch Verkäufe',
+ 'for Period' => 'für den Zeitraum',
+ 'paid on purchases' => 'gezahlt durch Einkäufe',
+ 'to' => 'bis',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'weiter' => 'continue',
+ 'email' => 'e_mail',
+ 'drucken' => 'print',
+ 'alle_auswählen' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/COPYING b/sql-ledger/locale/dk/COPYING
new file mode 100644
index 000000000..e01071008
--- /dev/null
+++ b/sql-ledger/locale/dk/COPYING
@@ -0,0 +1,24 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Danish texts:
+#
+# Author: Keld Jørn Simonsen <keld@dkuug.dk>
+# Jonas Smedegaard <jonas@jones.dk>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/dk/LANGUAGE b/sql-ledger/locale/dk/LANGUAGE
new file mode 100644
index 000000000..bd082a26d
--- /dev/null
+++ b/sql-ledger/locale/dk/LANGUAGE
@@ -0,0 +1 @@
+Danish
diff --git a/sql-ledger/locale/dk/admin b/sql-ledger/locale/dk/admin
new file mode 100644
index 000000000..e74af7d11
--- /dev/null
+++ b/sql-ledger/locale/dk/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Adgangskontrol',
+ 'Accounting' => 'Bogføring',
+ 'Add User' => 'Ny bruger',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'Alle datasæt opdaterede',
+ 'Change Admin Password' => 'Ændr adgangskode for administrator',
+ 'Change Password' => 'Ændr adgangskode',
+ 'Character Set' => 'Tegnsæt',
+ 'Click on login name to edit!' => 'Klik på brugernavn for at redigere',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Forbind til',
+ 'Continue' => 'Fortsæt',
+ 'Create Chart of Accounts' => 'Opret kontoplan',
+ 'Create Dataset' => 'Opret datasæt',
+ 'DBI not installed!' => 'DBI ikke installeret',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Administration af database',
+ 'Database Driver not checked!' => 'Databasedriver ikke kontrolleret',
+ 'Database User missing!' => 'Bruger af database mangler!',
+ 'Dataset' => 'Datasæt',
+ 'Dataset missing!' => 'Datasæt mangler!',
+ 'Dataset updated!' => 'Datasæt opdateret!',
+ 'Date Format' => 'Datoformat',
+ 'Delete' => 'Fjern',
+ 'Delete Dataset' => 'Fjern datasæt',
+ 'Directory' => 'Katalog',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Grænse for nedtræk',
+ 'E-mail' => 'E-post',
+ 'Edit User' => 'Redigér bruger',
+ 'Existing Datasets' => 'Eksisterende datasæt',
+ 'Fax' => 'Fax',
+ 'Host' => 'Vært',
+ 'Hostname missing!' => 'Værtsnavn mangler',
+ 'Incorrect Password!' => 'Forkert adgangskode',
+ 'Language' => 'Sprog',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lad felterne "vært" og "port" være tomme medmindre du vil etablere en ekstern forbindelse.',
+ 'Login' => 'Log på',
+ 'Name' => 'Navn',
+ 'New Templates' => 'Nye skabeloner',
+ 'No Database Drivers available!' => 'Ingen databasedrivere tilgængelige',
+ 'No Dataset selected!' => 'Intet datasæt valgt',
+ 'Nothing to delete!' => 'Intet at slette!',
+ 'Number Format' => 'Numerisk format',
+ 'Oracle Database Administration' => 'Oracle Administration af database',
+ 'Password' => 'Adgangskode',
+ 'Password changed!' => 'Adgangskode ændret',
+ 'Pg Database Administration' => 'Pg Administration af database',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port mangler',
+ 'Printer' => 'Printer',
+ 'Save' => 'Gem',
+ 'Select a Dataset to delete and press "Continue"' => 'Vælg et datasæt og tryk "Fortsæt"',
+ 'Setup Templates' => 'Skabeloner for opsætning',
+ 'Ship via' => 'Send via',
+ 'Signature' => 'Underskrift',
+ 'Stylesheet' => 'Stilark',
+ 'Templates' => 'Skabeloner',
+ 'The following Datasets are not in use and can be deleted' => 'De følgende datasæt er ikke i brug og kan slettes',
+ 'The following Datasets need to be updated' => 'De følgende datasæt skal opdateres',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dette er en indledende kontrol af eksisterende kilder. Ingenting vil blive oprettet eller slettet på dette trin',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Skift brugernavnet for en eksisterende bruger og gem for at tilføje en ny bruger til en gruppe. Den nye bruger vil så bive gemt med de samme indstillinger under det nye brugernavn.',
+ 'Update Dataset' => 'Opdatér datasæt',
+ 'Use Templates' => 'Brug skabeloner',
+ 'User' => 'Bruger',
+ 'User deleted!' => 'Bruger slettet!',
+ 'User saved!' => 'Bruger gemt!',
+ 'Version' => 'Version',
+ 'You must enter a host and port for local and remote connections!' => 'Du skal angive en vært og en port for lokale og eksterne forbindelser!',
+ 'does not exist' => 'eksisterer ikke',
+ 'is already a member!' => 'er allerede et medlem',
+ 'localhost' => 'lokalt',
+ 'successfully created!' => 'oprettet!',
+ 'successfully deleted!' => 'slettet!',
+ 'website' => 'på Internet',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'ny_bruger' => 'add_user',
+ 'Ændr_adgangskode_for_administrator' => 'change_admin_password',
+ 'Ændr_adgangskode' => 'change_password',
+ 'fortsæt' => 'continue',
+ 'opret_datasæt' => 'create_dataset',
+ 'fjern' => 'delete',
+ 'fjern_datasæt' => 'delete_dataset',
+ 'log_på' => 'login',
+ 'oracle_administration_af_database' => 'oracle_database_administration',
+ 'pg_administration_af_database' => 'pg_database_administration',
+ 'gem' => 'save',
+ 'opdatér_datasæt' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/all b/sql-ledger/locale/dk/all
new file mode 100644
index 000000000..e57ed1f61
--- /dev/null
+++ b/sql-ledger/locale/dk/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AP Aging' => 'Aldersfordeling',
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AP Transactions' => 'Leverandørfakturaer',
+ 'AR' => 'Debitorer',
+ 'AR Aging' => 'Aldersfordeling',
+ 'AR Transaction' => 'Debitorpostering',
+ 'AR Transactions' => 'Debitorposteringer',
+ 'About' => 'Om',
+ 'Access Control' => 'Adgangskontrol',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer mangler!',
+ 'Account Type' => 'Kontotype',
+ 'Account Type missing!' => 'Kontotype mangler!',
+ 'Account deleted!' => 'Konto slettet!',
+ 'Account saved!' => 'Konto gemt!',
+ 'Accounting' => 'Bogføring',
+ 'Accounting Menu' => 'Konto-menu',
+ 'Accounts' => 'Konti',
+ 'Active' => 'Aktiv',
+ 'Add' => 'Tilføj',
+ 'Add Account' => 'Ny konto',
+ 'Add Accounts Payables Transaction' => 'Ny leverandørpostering',
+ 'Add Accounts Receivables Transaction' => 'Ny debitorpostering',
+ 'Add Assembly' => 'Ny sammensætning',
+ 'Add Customer' => 'Ny kunde',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add General Ledger Transaction' => 'Ny postering i hovedbog',
+ 'Add Part' => 'Ny vare',
+ 'Add Project' => 'Nyt projekt',
+ 'Add Purchase Invoice' => 'Ny indkøbsfaktura',
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Add Service' => 'Ny tjeneste',
+ 'Add Transaction' => 'Ny postering',
+ 'Add User' => 'Ny bruger',
+ 'Add Vendor' => 'Ny leverandør',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administrator',
+ 'All' => 'Alt',
+ 'All Datasets up to date!' => 'Alle datasæt opdaterede',
+ 'Amount' => 'Beløb',
+ 'Amount Due' => 'Forfaldent',
+ 'Amount does not equal applied!' => 'Beløb er ikke det samme som brugt!',
+ 'Amount missing!' => 'Konto mangler!',
+ 'Applied' => 'Udført',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på du vil fjerne fakturanummer',
+ 'Are you sure you want to delete Order Number' => 'Er du sikker på at du vil fjerne ordrenummer',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på du vil fjerne postering',
+ 'Assemblies' => 'Sammensætninger',
+ 'Assemblies restocked!' => 'Sammensætninger genlagret',
+ 'Assembly Number missing!' => 'Sammensætningsnummer mangler',
+ 'Asset' => 'Aktiv',
+ 'Attachment' => 'Bilag',
+ 'Audit Control' => 'Revisionskontrol',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Sikkerheskopi',
+ 'Backup sent to' => 'Sikkerhedskopier sendt til',
+ 'Balance' => 'Balance',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'Books are open' => 'Bogføringen er åben for rettelser',
+ 'Bought' => 'Købt',
+ 'Business Number' => 'CVR-nummer',
+ 'C' => 'C',
+ 'COGS' => 'Indkøb',
+ 'Cannot delete account!' => 'Kan ikke slette konto!',
+ 'Cannot delete customer!' => 'Kan ikke slette kunde!',
+ 'Cannot delete default account!' => 'Kan ikke slette standardkonto!',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot delete item already invoiced!' => 'Kan ikke slette allerede faktureret enkeltdel!',
+ 'Cannot delete item on order!' => 'Kan ikke slette bestilt enkeltdel!',
+ 'Cannot delete item which is part of an assembly!' => 'kan ikke slette en enhed som er en del af en sammensætning!',
+ 'Cannot delete item!' => 'Kan ikke slette enhed!',
+ 'Cannot delete order!' => 'Kan ikke slette ordre!',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot delete vendor!' => 'Kan ikke slette leverandør!',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan ikke have en værdi i både debet og kredit!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bogføre faktura for en afsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bogføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bogføre betaling for en afsluttet periode',
+ 'Cannot post payment!' => 'Kan ikke bogføre betaling',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bogføre postering for en afsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bogføre postering!',
+ 'Cannot process payment for a closed period!' => 'Kan ikke behandle betaling for en afsluttet periode!',
+ 'Cannot save account!' => 'Kan ikke gemme konto!',
+ 'Cannot save order!' => 'Kan ikke gemme ordre!',
+ 'Cannot save preferences!' => 'Kan ikke gemme præferencer!',
+ 'Cannot stock assemblies!' => 'Kan ikke genbesætte sammensætninger',
+ 'Cash' => 'Kontanter',
+ 'Cash based' => 'Kontantbaseret',
+ 'Cc' => 'Kopi',
+ 'Change Admin Password' => 'Ændr adgangskode for administrator',
+ 'Change Password' => 'Ændr adgangskode',
+ 'Character Set' => 'Tegnsæt',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check udskrevet',
+ 'Check printing failed!' => 'Udskrivning af check mislykkedes',
+ 'Cleared Balance' => 'Udjævnede balance',
+ 'Click on login name to edit!' => 'Klik på brugernavn for at redigere',
+ 'Close Books up to' => 'Afslut bogføring op til',
+ 'Closed' => 'Afsluttet',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Sammenlign med',
+ 'Confirm!' => 'Bekræft!',
+ 'Connect to' => 'Forbind til',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Copy to COA' => 'Kopiér til COA',
+ 'Create Chart of Accounts' => 'Opret kontoplan',
+ 'Create Dataset' => 'Opret datasæt',
+ 'Credit' => 'Kredit',
+ 'Credit Limit' => 'Kreditgrænse',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Current' => '',
+ 'Customer' => 'Kunde',
+ 'Customer deleted!' => 'Kunde slettet!',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Customer saved!' => 'Kunde gemt!',
+ 'Customers' => 'Kunder',
+ 'DBI not installed!' => 'DBI ikke installeret',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Administration af database',
+ 'Database Driver not checked!' => 'Databasedriver ikke kontrolleret',
+ 'Database Host' => 'Database-vært',
+ 'Database User missing!' => 'Bruger af database mangler!',
+ 'Dataset' => 'Datasæt',
+ 'Dataset missing!' => 'Datasæt mangler!',
+ 'Dataset updated!' => 'Datasæt opdateret!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfaldsdato',
+ 'Date Format' => 'Datoformat',
+ 'Date Paid' => 'Betalingsdato',
+ 'Date missing!' => 'Dato mangler!',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet og kredit skal være det samme!',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Decimalplaces' => 'Decimalpladser',
+ 'Delete' => 'Fjern',
+ 'Delete Account' => 'Fjern konto',
+ 'Delete Dataset' => 'Fjern datasæt',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Deposit' => 'Depositum',
+ 'Description' => 'Beskrivelse',
+ 'Difference' => 'Difference',
+ 'Directory' => 'Katalog',
+ 'Discount' => 'Rabat',
+ 'Done' => 'Færdig',
+ 'Drawing' => 'Træk',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Grænse for nedtræk',
+ 'Due' => 'Forfald',
+ 'Due Date' => 'Forfaldsdato',
+ 'Due Date missing!' => 'Forfaldsdato mangler!',
+ 'E-mail' => 'E-post',
+ 'E-mail Statement to' => 'Send opgørelse til',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit' => 'Redigér',
+ 'Edit Account' => 'Redigér konto',
+ 'Edit Accounts Payables Transaction' => 'Redigér leverandørpostering',
+ 'Edit Accounts Receivables Transaction' => 'Redigér debitorpostering',
+ 'Edit Assembly' => 'Redigér sammensætning',
+ 'Edit GIFI' => 'Redigér GIFI',
+ 'Edit General Ledger Transaction' => 'Redigér en postering i hovedbog',
+ 'Edit Part' => 'Redigér vare',
+ 'Edit Preferences for' => 'Redigér opsætning for',
+ 'Edit Project' => 'Redigér præferencer for',
+ 'Edit Purchase Invoice' => 'Redigér projekt',
+ 'Edit Purchase Order' => 'Redigér indkøbsordre',
+ 'Edit Sales Invoice' => 'Redigér salgsfaktura',
+ 'Edit Sales Order' => 'Redigér salgsordre',
+ 'Edit Service' => 'Redigér tjeneste',
+ 'Edit Template' => 'Redigér skabelon',
+ 'Edit User' => 'Redigér bruger',
+ 'Employee' => 'Ansat',
+ 'Enforce transaction reversal for all dates' => 'Gennemtving explicitte rettelser af posteringer for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Angiv op til 3 bogstaver adskilt med kolon (fx DKK:EUR:USD) for dine indenlandske og udenlandske valutaer',
+ 'Equity' => 'Egenkapital',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate Difference' => 'Difference for vekselkurs',
+ 'Exchangerate for payment missing!' => 'Valutakurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Existing Datasets' => 'Eksisterende datasæt',
+ 'Expense' => 'Udgift',
+ 'Expense Account' => 'Udgiftskonto',
+ 'Expense/Asset' => 'Udgift/Aktiv',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'Foreign Exchange Gain' => 'Gevinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Tab på valutahandel',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI slettet!',
+ 'GIFI missing!' => 'GIFI mangler!',
+ 'GIFI saved!' => 'GIFI gemt!',
+ 'GL Transaction' => 'Postering i hovedbog',
+ 'General Ledger' => 'Hovedbog',
+ 'Goods & Services' => 'Varer og tjenester',
+ 'HTML Templates' => 'HTML-skabeloner',
+ 'Heading' => 'Overskrift',
+ 'Host' => 'Vært',
+ 'Hostname missing!' => 'Værtsnavn mangler',
+ 'ID' => 'ID',
+ 'Image' => 'Billede',
+ 'In-line' => 'Indlejret',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Include in drop-down menus' => 'Inkludér i rullegardin-menuer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Skal denne konto kunne vælges som afgifts- eller momskonto ved oprettelsen af kunder/leverandører?',
+ 'Income' => 'Indtægt',
+ 'Income Account' => 'Indtægtskonto',
+ 'Income Statement' => 'Driftsregnskab',
+ 'Incorrect Dataset version!' => 'Forkert version af datasæt!',
+ 'Incorrect Password!' => 'Forkert adgangskode',
+ 'Individual Items' => 'Individuelle enheder',
+ 'Inventory' => 'Artikler',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne sammensætning',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne enhed',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning skal være nul',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bogført!',
+ 'Invoices' => 'Fakturaer',
+ 'Is this a summary account to record' => 'Samlekonto for',
+ 'Item deleted!' => 'Enkeltdel slettet!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'LaTeX Templates' => 'LaTeX-skabeloner',
+ 'Language' => 'Sprog',
+ 'Last Cost' => 'Seneste pris',
+ 'Last Invoice Number' => 'Seneste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Løbenumre og standardkonti',
+ 'Last Purchase Order Number' => 'Seneste nummer på indkøbsordre',
+ 'Last Sales Order Number' => 'Seneste salgsordrenummer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lad felterne "vært" og "port" være tomme medmindre du vil etablere en ekstern forbindelse.',
+ 'Liability' => 'Passiv',
+ 'Licensed to' => 'Udført for',
+ 'Line Total' => 'Antal linjer',
+ 'Link' => 'Referencer',
+ 'Link Accounts' => 'Forbind konti',
+ 'List Accounts' => 'List konti',
+ 'List GIFI' => 'List GIFI',
+ 'List Price' => 'Listepris',
+ 'List Transactions' => 'Vis bogføringer',
+ 'Login' => 'Log på',
+ 'Logout' => 'Log af',
+ 'Make' => 'Fabrikat',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'N/A' => 'I/T',
+ 'Name' => 'Navn',
+ 'Name missing!' => 'Navn mangler!',
+ 'New Templates' => 'Nye skabeloner',
+ 'No' => 'Nej',
+ 'No Database Drivers available!' => 'Ingen databasedrivere tilgængelige',
+ 'No Dataset selected!' => 'Intet datasæt valgt',
+ 'No email address for' => 'Ingen epostadresse for',
+ 'No.' => '',
+ 'Notes' => 'Bemærkninger',
+ 'Nothing applied!' => 'Ingenting udført!',
+ 'Nothing selected!' => 'Ingenting valgt!',
+ 'Nothing to delete!' => 'Intet at slette!',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Numerisk format',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'O' => 'O',
+ 'Obsolete' => 'Forældet',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'On Hand' => 'På lager',
+ 'On Order' => 'I ordre',
+ 'Open' => 'Åbn',
+ 'Oracle Database Administration' => 'Oracle Administration af database',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Ordredato',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Entry' => 'Ordreindgang',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'Order deleted!' => 'Ordre slettet',
+ 'Order saved!' => 'Ordre gemt',
+ 'Ordered' => 'bestilt',
+ 'Orphaned' => 'Fritstående',
+ 'Out of balance!' => 'Ikke i balance!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Paid' => 'Betalt',
+ 'Paid in full' => '',
+ 'Part' => 'Vare',
+ 'Part Number missing!' => 'Varenummer mangler!',
+ 'Parts' => 'Dele',
+ 'Parts Inventory' => 'Vareliste',
+ 'Password' => 'Adgangskode',
+ 'Password changed!' => 'Adgangskode ændret',
+ 'Payables' => 'Udeståender',
+ 'Payment' => 'Betaling',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payment posted!' => 'Betaling bogført!',
+ 'Payments' => 'Betalinger',
+ 'Pg Database Administration' => 'Pg Administration af database',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port mangler',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Præferencer',
+ 'Preferences saved!' => 'Indstillinger gemt!',
+ 'Price' => 'Pris',
+ 'Print' => 'Udskriv',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projektnummer mangler!',
+ 'Project deleted!' => 'Projekt slettet!',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Project saved!' => 'Projekt gemt!',
+ 'Projects' => 'Projekter',
+ 'Purchase Invoice' => 'Indkøbsfaktura',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Purchase Orders' => 'Indkøbsordrer',
+ 'Qty' => 'Antal',
+ 'ROP' => 'Genbestil ved',
+ 'Rate' => 'Rate',
+ 'Recd' => 'Modtaget',
+ 'Receipt' => 'Kvittering',
+ 'Receipts' => 'Kvitteringer',
+ 'Receivables' => 'Indbetalinger',
+ 'Reconciliation' => 'Afstemning',
+ 'Record in' => 'Bogfør på',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference mangler',
+ 'Remaining' => 'Resterer',
+ 'Report for' => 'Rapport for',
+ 'Reports' => 'Rapporter',
+ 'Required by' => 'Bestilt af',
+ 'Retained Earnings' => 'Realiseret overskud',
+ 'Sales' => 'Salg',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Save' => 'Gem',
+ 'Save as new' => 'Gem som ny',
+ 'Save to File' => 'Gem i fil',
+ 'Screen' => 'Skærm',
+ 'Select a Dataset to delete and press "Continue"' => 'Vælg et datasæt og tryk "Fortsæt"',
+ 'Select all' => 'Vælg alt',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sell Price' => 'Salgspris',
+ 'Send by E-Mail' => 'Sendt med epost',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Service Items' => 'Tjenester',
+ 'Service Number missing!' => 'Tjenestenummer mangler!',
+ 'Services' => 'Tjenester',
+ 'Setup Templates' => 'Skabeloner for opsætning',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Ship via' => 'Send via',
+ 'Short' => 'Kort',
+ 'Signature' => 'Underskrift',
+ 'Sold' => 'Solgt',
+ 'Source' => 'Bilag',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Opgørelse',
+ 'Statement Balance' => 'Balanceopgørelse',
+ 'Statement sent to' => 'Opgørelse sendt til',
+ 'Statements sent to printer!' => 'Opgørelser sendt til printer',
+ 'Stock Assembly' => 'Lagr sammensætning',
+ 'Stylesheet' => 'Stilark',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'System',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax Accounts' => 'Afgift/Momskonti',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'Tax collected' => 'Skat opkrævet',
+ 'Tax paid' => 'Skat betalt',
+ 'Taxable' => 'Afgifts/momspligtig',
+ 'Template saved!' => 'Skabelon gemt!',
+ 'Templates' => 'Skabeloner',
+ 'Terms: Net' => 'Netto',
+ 'The following Datasets are not in use and can be deleted' => 'De følgende datasæt er ikke i brug og kan slettes',
+ 'The following Datasets need to be updated' => 'De følgende datasæt skal opdateres',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dette er en indledende kontrol af eksisterende kilder. Ingenting vil blive oprettet eller slettet på dette trin',
+ 'To' => 'til',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Skift brugernavnet for en eksisterende bruger og gem for at tilføje en ny bruger til en gruppe. Den nye bruger vil så bive gemt med de samme indstillinger under det nye brugernavn.',
+ 'Top Level' => 'Topniveau',
+ 'Total' => 'I alt',
+ 'Transaction Date missing!' => 'Dato mangler!',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bogført!',
+ 'Transaction reversal enforced for all dates' => 'Rettelser af posteringer skal altid bogføres explicit',
+ 'Transaction reversal enforced up to' => 'Rettelser af posteringer skal bogføres explicit indtil',
+ 'Transactions' => 'Posteringer',
+ 'Transactions exist, cannot delete customer!' => 'Kunde kan ikke fjernes da der er posteringer!',
+ 'Transactions exist, cannot delete vendor!' => 'Leverandør kan ikke fjernes da der er posteringer!',
+ 'Transactions exist; cannot delete account!' => 'Konto kan ikke fjernes da der er posteringer!',
+ 'Trial Balance' => 'Foreløbig status',
+ 'Unit' => 'Enhed',
+ 'Unit of measure' => 'Måleenhed',
+ 'Update' => 'Opdatér',
+ 'Update Dataset' => 'Opdatér datasæt',
+ 'Updated' => 'Opdateret',
+ 'Use Templates' => 'Brug skabeloner',
+ 'User' => 'Bruger',
+ 'User deleted!' => 'Bruger slettet!',
+ 'User saved!' => 'Bruger gemt!',
+ 'Vendor' => 'Leverandør',
+ 'Vendor deleted!' => 'Leverandør slettet!',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'Vendor saved!' => 'Leverandør gemt!',
+ 'Vendors' => 'Leverandører',
+ 'Version' => 'Version',
+ 'Weight' => 'Vægt',
+ 'Weight Unit' => 'Vægtenhed',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Year End' => 'Årsafslutning',
+ 'Yes' => 'Ja',
+ 'You are logged out!' => 'Du er logget ud',
+ 'You did not enter a name!' => 'Du angav ikke et navn',
+ 'You must enter a host and port for local and remote connections!' => 'Du skal angive en vært og en port for lokale og eksterne forbindelser!',
+ 'as at' => 'som ved',
+ 'collected on sales' => 'indsamlet ved salg',
+ 'days' => 'dage',
+ 'does not exist' => 'eksisterer ikke',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt via e-post til',
+ 'for Period' => 'for perioden',
+ 'hr' => 'time',
+ 'is already a member!' => 'er allerede et medlem',
+ 'is not a member!' => 'er ikke et medlem!',
+ 'localhost' => 'lokalt',
+ 'paid on purchases' => 'betalt ved indkøb',
+ 'sent to printer' => 'sendt til printer',
+ 'successfully created!' => 'oprettet!',
+ 'successfully deleted!' => 'slettet!',
+ 'to' => 'til',
+ 'website' => 'på Internet',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/am b/sql-ledger/locale/dk/am
new file mode 100644
index 000000000..7546a0dbe
--- /dev/null
+++ b/sql-ledger/locale/dk/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AR' => 'Debitorer',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer mangler!',
+ 'Account Type' => 'Kontotype',
+ 'Account Type missing!' => 'Kontotype mangler!',
+ 'Account deleted!' => 'Konto slettet!',
+ 'Account saved!' => 'Konto gemt!',
+ 'Add Account' => 'Ny konto',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Address' => 'Adresse',
+ 'Asset' => 'Aktiv',
+ 'Audit Control' => 'Revisionskontrol',
+ 'Backup sent to' => 'Sikkerhedskopier sendt til',
+ 'Books are open' => 'Bogføringen er åben for rettelser',
+ 'Business Number' => 'CVR-nummer',
+ 'COGS' => 'Indkøb',
+ 'Cannot delete account!' => 'Kan ikke slette konto!',
+ 'Cannot delete default account!' => 'Kan ikke slette standardkonto!',
+ 'Cannot save account!' => 'Kan ikke gemme konto!',
+ 'Cannot save preferences!' => 'Kan ikke gemme præferencer!',
+ 'Character Set' => 'Tegnsæt',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Close Books up to' => 'Afslut bogføring op til',
+ 'Company' => 'Firma',
+ 'Continue' => 'Fortsæt',
+ 'Copy to COA' => 'Kopiér til COA',
+ 'Credit' => 'Kredit',
+ 'Date Format' => 'Datoformat',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Fjern',
+ 'Delete Account' => 'Fjern konto',
+ 'Description' => 'Beskrivelse',
+ 'Dropdown Limit' => 'Grænse for nedtræk',
+ 'E-mail' => 'E-post',
+ 'Edit' => 'Redigér',
+ 'Edit Account' => 'Redigér konto',
+ 'Edit GIFI' => 'Redigér GIFI',
+ 'Edit Preferences for' => 'Redigér opsætning for',
+ 'Edit Template' => 'Redigér skabelon',
+ 'Enforce transaction reversal for all dates' => 'Gennemtving explicitte rettelser af posteringer for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Angiv op til 3 bogstaver adskilt med kolon (fx DKK:EUR:USD) for dine indenlandske og udenlandske valutaer',
+ 'Equity' => 'Egenkapital',
+ 'Expense' => 'Udgift',
+ 'Expense Account' => 'Udgiftskonto',
+ 'Expense/Asset' => 'Udgift/Aktiv',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Gevinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Tab på valutahandel',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI slettet!',
+ 'GIFI missing!' => 'GIFI mangler!',
+ 'GIFI saved!' => 'GIFI gemt!',
+ 'Heading' => 'Overskrift',
+ 'Include in drop-down menus' => 'Inkludér i rullegardin-menuer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Skal denne konto kunne vælges som afgifts- eller momskonto ved oprettelsen af kunder/leverandører?',
+ 'Income' => 'Indtægt',
+ 'Income Account' => 'Indtægtskonto',
+ 'Inventory' => 'Artikler',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Is this a summary account to record' => 'Samlekonto for',
+ 'Language' => 'Sprog',
+ 'Last Invoice Number' => 'Seneste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Løbenumre og standardkonti',
+ 'Last Purchase Order Number' => 'Seneste nummer på indkøbsordre',
+ 'Last Sales Order Number' => 'Seneste salgsordrenummer',
+ 'Liability' => 'Passiv',
+ 'Link' => 'Referencer',
+ 'Name' => 'Navn',
+ 'No' => 'Nej',
+ 'No email address for' => 'Ingen epostadresse for',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Numerisk format',
+ 'Parts Inventory' => 'Vareliste',
+ 'Password' => 'Adgangskode',
+ 'Payables' => 'Udeståender',
+ 'Payment' => 'Betaling',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Indstillinger gemt!',
+ 'Rate' => 'Rate',
+ 'Receivables' => 'Indbetalinger',
+ 'Sales' => 'Salg',
+ 'Save' => 'Gem',
+ 'Service Items' => 'Tjenester',
+ 'Ship via' => 'Send via',
+ 'Signature' => 'Underskrift',
+ 'Stylesheet' => 'Stilark',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax Accounts' => 'Afgift/Momskonti',
+ 'Template saved!' => 'Skabelon gemt!',
+ 'Transaction reversal enforced for all dates' => 'Rettelser af posteringer skal altid bogføres explicit',
+ 'Transaction reversal enforced up to' => 'Rettelser af posteringer skal bogføres explicit indtil',
+ 'Transactions exist; cannot delete account!' => 'Konto kan ikke fjernes da der er posteringer!',
+ 'Weight Unit' => 'Vægtenhed',
+ 'Year End' => 'Årsafslutning',
+ 'Yes' => 'Ja',
+ 'does not exist' => 'eksisterer ikke',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'ny_konto' => 'add_account',
+ 'fortsæt' => 'continue',
+ 'kopiér_til_coa' => 'copy_to_coa',
+ 'fjern' => 'delete',
+ 'redigér' => 'edit',
+ 'redigér_konto' => 'edit_account',
+ 'gem' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ap b/sql-ledger/locale/dk/ap
new file mode 100644
index 000000000..424926d5a
--- /dev/null
+++ b/sql-ledger/locale/dk/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AP Transactions' => 'Leverandørfakturaer',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Ny leverandørpostering',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Amount Due' => 'Forfaldent',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på du vil fjerne postering',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bogføre betaling for en afsluttet periode',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bogføre postering for en afsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bogføre postering!',
+ 'Closed' => 'Afsluttet',
+ 'Confirm!' => 'Bekræft!',
+ 'Continue' => 'Fortsæt',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Date Paid' => 'Betalingsdato',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Due Date' => 'Forfaldsdato',
+ 'Due Date missing!' => 'Forfaldsdato mangler!',
+ 'Edit Accounts Payables Transaction' => 'Redigér leverandørpostering',
+ 'Employee' => 'Ansat',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate for payment missing!' => 'Valutakurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åbn',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Ordrenummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Betalinger',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Purchase Invoice' => 'Indkøbsfaktura',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bogført!',
+ 'Update' => 'Opdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'leverandørfaktura' => 'ap_transaction',
+ 'ny_leverandørpostering' => 'add_accounts_payables_transaction',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'redigér_leverandørpostering' => 'edit_accounts_payables_transaction',
+ 'bogfør' => 'post',
+ 'bogfør_som_ny' => 'post_as_new',
+ 'indkøbsfaktura' => 'purchase_invoice',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ar b/sql-ledger/locale/dk/ar
new file mode 100644
index 000000000..9f778b00b
--- /dev/null
+++ b/sql-ledger/locale/dk/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Debitorpostering',
+ 'AR Transactions' => 'Debitorposteringer',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Ny debitorpostering',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Amount Due' => 'Forfaldent',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på du vil fjerne postering',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bogføre betaling for en afsluttet periode',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bogføre postering for en afsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bogføre postering!',
+ 'Closed' => 'Afsluttet',
+ 'Confirm!' => 'Bekræft!',
+ 'Continue' => 'Fortsæt',
+ 'Credit Limit' => 'Kreditgrænse',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Date Paid' => 'Betalingsdato',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Due Date' => 'Forfaldsdato',
+ 'Due Date missing!' => 'Forfaldsdato mangler!',
+ 'Edit Accounts Receivables Transaction' => 'Redigér debitorpostering',
+ 'Employee' => 'Ansat',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate for payment missing!' => 'Valutakurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åbn',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Ordrenummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Betalinger',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Remaining' => 'Resterer',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bogført!',
+ 'Update' => 'Opdatér',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'debitorpostering' => 'ar_transaction',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'bogfør' => 'post',
+ 'bogfør_som_ny' => 'post_as_new',
+ 'salgsfaktura' => 'sales_invoice',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/arap b/sql-ledger/locale/dk/arap
new file mode 100644
index 000000000..af2206106
--- /dev/null
+++ b/sql-ledger/locale/dk/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresse',
+ 'Continue' => 'Fortsæt',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Description' => 'Beskrivelse',
+ 'Number' => 'Nummer',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'fortsæt' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ca b/sql-ledger/locale/dk/ca
new file mode 100644
index 000000000..302aeea94
--- /dev/null
+++ b/sql-ledger/locale/dk/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Credit' => 'Kredit',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Description' => 'Beskrivelse',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'List Transactions' => 'Vis bogføringer',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Reference' => 'Reference',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'til',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'vis_bogføringer' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/cp b/sql-ledger/locale/dk/cp
new file mode 100644
index 000000000..79d057987
--- /dev/null
+++ b/sql-ledger/locale/dk/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Amount does not equal applied!' => 'Beløb er ikke det samme som brugt!',
+ 'Amount missing!' => 'Konto mangler!',
+ 'Applied' => 'Udført',
+ 'Cannot post payment!' => 'Kan ikke bogføre betaling',
+ 'Cannot process payment for a closed period!' => 'Kan ikke behandle betaling for en afsluttet periode!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check udskrevet',
+ 'Check printing failed!' => 'Udskrivning af check mislykkedes',
+ 'Continue' => 'Fortsæt',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Date missing!' => 'Dato mangler!',
+ 'Description' => 'Beskrivelse',
+ 'Due' => 'Forfald',
+ 'Exchangerate' => 'Vekselkurs',
+ 'From' => 'Fra',
+ 'Invoice' => 'Faktura',
+ 'Invoices' => 'Fakturaer',
+ 'Nothing applied!' => 'Ingenting udført!',
+ 'Number' => 'Nummer',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Betaling',
+ 'Payment posted!' => 'Betaling bogført!',
+ 'Post' => 'Bogfør',
+ 'Print' => 'Udskriv',
+ 'Printer' => 'Printer',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Receipt' => 'Kvittering',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Skærm',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'To' => 'til',
+ 'Update' => 'Opdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'fortsæt' => 'continue',
+ 'bogfør' => 'post',
+ 'udskriv' => 'print',
+ 'opdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ct b/sql-ledger/locale/dk/ct
new file mode 100644
index 000000000..2b8f91b3e
--- /dev/null
+++ b/sql-ledger/locale/dk/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Tilføj',
+ 'Address' => 'Adresse',
+ 'All' => 'Alt',
+ 'Bcc' => 'Blind kopi',
+ 'Cannot delete customer!' => 'Kan ikke slette kunde!',
+ 'Cannot delete vendor!' => 'Kan ikke slette leverandør!',
+ 'Cc' => 'Kopi',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Credit Limit' => 'Kreditgrænse',
+ 'Customer deleted!' => 'Kunde slettet!',
+ 'Customer saved!' => 'Kunde gemt!',
+ 'Customers' => 'Kunder',
+ 'Delete' => 'Fjern',
+ 'Discount' => 'Rabat',
+ 'E-mail' => 'E-post',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Name' => 'Navn',
+ 'Name missing!' => 'Navn mangler!',
+ 'Notes' => 'Bemærkninger',
+ 'Number' => 'Nummer',
+ 'Order' => 'Ordre',
+ 'Orphaned' => 'Fritstående',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Gem',
+ 'Ship to' => 'Send til',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'Taxable' => 'Afgifts/momspligtig',
+ 'Terms: Net' => 'Netto',
+ 'Transactions exist, cannot delete customer!' => 'Kunde kan ikke fjernes da der er posteringer!',
+ 'Transactions exist, cannot delete vendor!' => 'Leverandør kan ikke fjernes da der er posteringer!',
+ 'Vendor deleted!' => 'Leverandør slettet!',
+ 'Vendor saved!' => 'Leverandør gemt!',
+ 'Vendors' => 'Leverandører',
+ 'days' => 'dage',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'tilføj' => 'add',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'faktura' => 'invoice',
+ 'ordre' => 'order',
+ 'gem' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/gl b/sql-ledger/locale/dk/gl
new file mode 100644
index 000000000..3693fa2f7
--- /dev/null
+++ b/sql-ledger/locale/dk/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AR Transaction' => 'Debitorpostering',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Ny postering i hovedbog',
+ 'Address' => 'Adresse',
+ 'All' => 'Alt',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på du vil fjerne postering',
+ 'Asset' => 'Aktiv',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan ikke have en værdi i både debet og kredit!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bogføre postering for en afsluttet periode!',
+ 'Confirm!' => 'Bekræft!',
+ 'Continue' => 'Fortsæt',
+ 'Credit' => 'Kredit',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet og kredit skal være det samme!',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Edit General Ledger Transaction' => 'Redigér en postering i hovedbog',
+ 'Equity' => 'Egenkapital',
+ 'Expense' => 'Udgift',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Postering i hovedbog',
+ 'General Ledger' => 'Hovedbog',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income' => 'Indtægt',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Liability' => 'Passiv',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Purchase Invoice' => 'Indkøbsfaktura',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference mangler',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'til',
+ 'Transaction Date missing!' => 'Dato mangler!',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bogført!',
+ 'Update' => 'Opdatér',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'leverandørfaktura' => 'ap_transaction',
+ 'debitorpostering' => 'ar_transaction',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'postering_i_hovedbog' => 'gl_transaction',
+ 'bogfør' => 'post',
+ 'bogfør_som_ny' => 'post_as_new',
+ 'indkøbsfaktura' => 'purchase_invoice',
+ 'salgsfaktura' => 'sales_invoice',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ic b/sql-ledger/locale/dk/ic
new file mode 100644
index 000000000..38e0d70bf
--- /dev/null
+++ b/sql-ledger/locale/dk/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Aktiv',
+ 'Add' => 'Tilføj',
+ 'Add Assembly' => 'Ny sammensætning',
+ 'Add Part' => 'Ny vare',
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Add Service' => 'Ny tjeneste',
+ 'Address' => 'Adresse',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Assemblies' => 'Sammensætninger',
+ 'Assemblies restocked!' => 'Sammensætninger genlagret',
+ 'Assembly Number missing!' => 'Sammensætningsnummer mangler',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'Bought' => 'Købt',
+ 'COGS' => 'Indkøb',
+ 'Cannot delete item already invoiced!' => 'Kan ikke slette allerede faktureret enkeltdel!',
+ 'Cannot delete item on order!' => 'Kan ikke slette bestilt enkeltdel!',
+ 'Cannot delete item which is part of an assembly!' => 'kan ikke slette en enhed som er en del af en sammensætning!',
+ 'Cannot delete item!' => 'Kan ikke slette enhed!',
+ 'Cannot stock assemblies!' => 'Kan ikke genbesætte sammensætninger',
+ 'Cc' => 'Kopi',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'Drawing' => 'Træk',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Assembly' => 'Redigér sammensætning',
+ 'Edit Part' => 'Redigér vare',
+ 'Edit Service' => 'Redigér tjeneste',
+ 'Expense' => 'Udgift',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'Image' => 'Billede',
+ 'In-line' => 'Indlejret',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income' => 'Indtægt',
+ 'Individual Items' => 'Individuelle enheder',
+ 'Inventory' => 'Artikler',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne sammensætning',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne enhed',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning skal være nul',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item deleted!' => 'Enkeltdel slettet!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Last Cost' => 'Seneste pris',
+ 'Line Total' => 'Antal linjer',
+ 'Link Accounts' => 'Forbind konti',
+ 'List Price' => 'Listepris',
+ 'Make' => 'Fabrikat',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'Name' => 'Navn',
+ 'No.' => 'No.',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'Obsolete' => 'Forældet',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'On Hand' => 'På lager',
+ 'On Order' => 'I ordre',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'Ordered' => 'bestilt',
+ 'Orphaned' => 'Fritstående',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Part Number missing!' => 'Varenummer mangler!',
+ 'Parts' => 'Dele',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Qty' => 'Antal',
+ 'ROP' => 'Genbestil ved',
+ 'Recd' => 'Modtaget',
+ 'Required by' => 'Bestilt af',
+ 'Sales' => 'Salg',
+ 'Sales Order' => 'Salgsordre',
+ 'Save' => 'Gem',
+ 'Screen' => 'Skærm',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sell Price' => 'Salgspris',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Service Number missing!' => 'Tjenestenummer mangler!',
+ 'Services' => 'Tjenester',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Short' => 'Kort',
+ 'Sold' => 'Solgt',
+ 'Stock Assembly' => 'Lagr sammensætning',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Afgift/Moms',
+ 'To' => 'til',
+ 'Top Level' => 'Topniveau',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhed',
+ 'Unit of measure' => 'Måleenhed',
+ 'Update' => 'Opdatér',
+ 'Updated' => 'Opdateret',
+ 'Weight' => 'Vægt',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt via e-post til',
+ 'hr' => 'time',
+ 'sent to printer' => 'sendt til printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'tilføj' => 'add',
+ 'ny_sammensætning' => 'add_assembly',
+ 'ny_vare' => 'add_part',
+ 'ny_tjeneste' => 'add_service',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'redigér_sammensætning' => 'edit_assembly',
+ 'redigér_vare' => 'edit_part',
+ 'redigér_tjeneste' => 'edit_service',
+ 'gem' => 'save',
+ 'opdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/io b/sql-ledger/locale/dk/io
new file mode 100644
index 000000000..117e8d2e8
--- /dev/null
+++ b/sql-ledger/locale/dk/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'Cc' => 'Kopi',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Indlejret',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Name' => 'Navn',
+ 'No.' => 'No.',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Modtaget',
+ 'Required by' => 'Bestilt af',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skærm',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Subject' => 'Emne',
+ 'To' => 'til',
+ 'Unit' => 'Enhed',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'emailed to' => 'sendt via e-post til',
+ 'sent to printer' => 'sendt til printer',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'fortsæt' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/ir b/sql-ledger/locale/dk/ir
new file mode 100644
index 000000000..cf77f62e3
--- /dev/null
+++ b/sql-ledger/locale/dk/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Invoice' => 'Ny indkøbsfaktura',
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på du vil fjerne fakturanummer',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bogføre faktura for en afsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bogføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bogføre betaling for en afsluttet periode',
+ 'Cc' => 'Kopi',
+ 'Confirm!' => 'Bekræft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfaldsdato',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Purchase Invoice' => 'Redigér projekt',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate for payment missing!' => 'Valutakurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Indlejret',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bogført!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Name' => 'Navn',
+ 'No.' => 'No.',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Betalinger',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Modtaget',
+ 'Record in' => 'Bogfør på',
+ 'Required by' => 'Bestilt af',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skærm',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Source' => 'Bilag',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhed',
+ 'Update' => 'Opdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt via e-post til',
+ 'sent to printer' => 'sendt til printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'ordre' => 'order',
+ 'bogfør' => 'post',
+ 'bogfør_som_ny' => 'post_as_new',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/is b/sql-ledger/locale/dk/is
new file mode 100644
index 000000000..56971851e
--- /dev/null
+++ b/sql-ledger/locale/dk/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på du vil fjerne fakturanummer',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bogføre faktura for en afsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bogføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bogføre betaling for en afsluttet periode',
+ 'Cc' => 'Kopi',
+ 'Confirm!' => 'Bekræft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Credit Limit' => 'Kreditgrænse',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfaldsdato',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Sales Invoice' => 'Redigér salgsfaktura',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate for payment missing!' => 'Valutakurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Indlejret',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bogført!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Name' => 'Navn',
+ 'No.' => 'No.',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Betalinger',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Bogfør',
+ 'Post as new' => 'Bogfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Udskriv',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Modtaget',
+ 'Record in' => 'Bogfør på',
+ 'Remaining' => 'Resterer',
+ 'Required by' => 'Bestilt af',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skærm',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Ship via' => 'Send via',
+ 'Source' => 'Bilag',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhed',
+ 'Update' => 'Opdatér',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt via e-post til',
+ 'sent to printer' => 'sendt til printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'e_post' => 'e_mail',
+ 'ordre' => 'order',
+ 'bogfør' => 'post',
+ 'bogfør_som_ny' => 'post_as_new',
+ 'udskriv' => 'print',
+ 'send_til' => 'ship_to',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/login b/sql-ledger/locale/dk/login
new file mode 100644
index 000000000..19adf11bb
--- /dev/null
+++ b/sql-ledger/locale/dk/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Om',
+ 'Accounting' => 'Bogføring',
+ 'Database Host' => 'Database-vært',
+ 'Dataset' => 'Datasæt',
+ 'Incorrect Dataset version!' => 'Forkert version af datasæt!',
+ 'Incorrect Password!' => 'Forkert adgangskode',
+ 'Licensed to' => 'Udført for',
+ 'Login' => 'Log på',
+ 'Name' => 'Navn',
+ 'Password' => 'Adgangskode',
+ 'User' => 'Bruger',
+ 'Version' => 'Version',
+ 'You are logged out!' => 'Du er logget ud',
+ 'You did not enter a name!' => 'Du angav ikke et navn',
+ 'is not a member!' => 'er ikke et medlem!',
+ 'localhost' => 'lokalt',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'log_på' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/menu b/sql-ledger/locale/dk/menu
new file mode 100644
index 000000000..b4649c634
--- /dev/null
+++ b/sql-ledger/locale/dk/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AP Aging' => 'Aldersfordeling',
+ 'AR' => 'Debitorer',
+ 'AR Aging' => 'Aldersfordeling',
+ 'Accounting Menu' => 'Konto-menu',
+ 'Add Account' => 'Ny konto',
+ 'Add Assembly' => 'Ny sammensætning',
+ 'Add Customer' => 'Ny kunde',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add Part' => 'Ny vare',
+ 'Add Project' => 'Nyt projekt',
+ 'Add Service' => 'Ny tjeneste',
+ 'Add Transaction' => 'Ny postering',
+ 'Add Vendor' => 'Ny leverandør',
+ 'Assemblies' => 'Sammensætninger',
+ 'Audit Control' => 'Revisionskontrol',
+ 'Backup' => 'Sikkerheskopi',
+ 'Balance Sheet' => 'Status',
+ 'Cash' => 'Kontanter',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Check',
+ 'Customers' => 'Kunder',
+ 'General Ledger' => 'Hovedbog',
+ 'Goods & Services' => 'Varer og tjenester',
+ 'HTML Templates' => 'HTML-skabeloner',
+ 'Income Statement' => 'Driftsregnskab',
+ 'Invoice' => 'Faktura',
+ 'LaTeX Templates' => 'LaTeX-skabeloner',
+ 'List Accounts' => 'List konti',
+ 'List GIFI' => 'List GIFI',
+ 'Logout' => 'Log af',
+ 'Order Entry' => 'Ordreindgang',
+ 'Packing List' => 'Følgeseddel',
+ 'Parts' => 'Dele',
+ 'Payment' => 'Betaling',
+ 'Payments' => 'Betalinger',
+ 'Preferences' => 'Præferencer',
+ 'Projects' => 'Projekter',
+ 'Purchase Invoice' => 'Indkøbsfaktura',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Purchase Orders' => 'Indkøbsordrer',
+ 'Receipt' => 'Kvittering',
+ 'Receipts' => 'Kvitteringer',
+ 'Reconciliation' => 'Afstemning',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Save to File' => 'Gem i fil',
+ 'Send by E-Mail' => 'Sendt med epost',
+ 'Services' => 'Tjenester',
+ 'Statement' => 'Opgørelse',
+ 'Stock Assembly' => 'Lagr sammensætning',
+ 'Stylesheet' => 'Stilark',
+ 'System' => 'System',
+ 'Tax collected' => 'Skat opkrævet',
+ 'Tax paid' => 'Skat betalt',
+ 'Transactions' => 'Posteringer',
+ 'Trial Balance' => 'Foreløbig status',
+ 'Vendors' => 'Leverandører',
+ 'Version' => 'Version',
+ 'localhost' => 'lokalt',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/oe b/sql-ledger/locale/dk/oe
new file mode 100644
index 000000000..1b58c087f
--- /dev/null
+++ b/sql-ledger/locale/dk/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Tilføj',
+ 'Add Purchase Invoice' => 'Ny indkøbsfaktura',
+ 'Add Purchase Order' => 'Ny indkøbsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløb',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Order Number' => 'Er du sikker på at du vil fjerne ordrenummer',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Varelager',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Kan ikke slette ordre!',
+ 'Cannot save order!' => 'Kan ikke gemme ordre!',
+ 'Cc' => 'Kopi',
+ 'Closed' => 'Afsluttet',
+ 'Confirm!' => 'Bekræft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Credit Limit' => 'Kreditgrænse',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i databasen!',
+ 'Date' => 'Dato',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Purchase Order' => 'Redigér indkøbsordre',
+ 'Edit Sales Order' => 'Redigér salgsordre',
+ 'Exchangerate' => 'Vekselkurs',
+ 'Exchangerate missing!' => 'Vekselkurs mangler!',
+ 'Extended' => 'Udvidet',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'In-line' => 'Indlejret',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'Name' => 'Navn',
+ 'No.' => 'No.',
+ 'Notes' => 'Bemærkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tal mangler i række',
+ 'O' => 'O',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åbn',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Ordredato',
+ 'Order Date missing!' => 'Ordredato mangler',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler',
+ 'Order deleted!' => 'Ordre slettet',
+ 'Order saved!' => 'Ordre gemt',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Udskriv',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt ikke i databasen!',
+ 'Purchase Order' => 'Indkøbsordre',
+ 'Purchase Orders' => 'Indkøbsordrer',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Modtaget',
+ 'Remaining' => 'Resterer',
+ 'Required by' => 'Bestilt af',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Save' => 'Gem',
+ 'Save as new' => 'Gem som ny',
+ 'Screen' => 'Skærm',
+ 'Select from one of the items below' => 'Vælg fra en af tingene nedenfor, og tryk "Fortsæt"',
+ 'Select from one of the names below' => 'Vælg en af navnene nedenfor',
+ 'Select from one of the projects below' => 'Vælg et af projekterne nedenfor',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Send',
+ 'Ship to' => 'Send til',
+ 'Ship via' => 'Send via',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax Included' => 'Inkl. afgifter og moms',
+ 'Terms: Net' => 'Netto',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhed',
+ 'Update' => 'Opdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør ikke i databasen!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'days' => 'dage',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt via e-post til',
+ 'sent to printer' => 'sendt til printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'tilføj' => 'add',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'e_post' => 'e_mail',
+ 'faktura' => 'invoice',
+ 'udskriv' => 'print',
+ 'gem' => 'save',
+ 'gem_som_ny' => 'save_as_new',
+ 'send_til' => 'ship_to',
+ 'opdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/pe b/sql-ledger/locale/dk/pe
new file mode 100644
index 000000000..66c62ee2b
--- /dev/null
+++ b/sql-ledger/locale/dk/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Tilføj',
+ 'Add Project' => 'Nyt projekt',
+ 'All' => 'Alt',
+ 'Continue' => 'Fortsæt',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Edit Project' => 'Redigér præferencer for',
+ 'Number' => 'Nummer',
+ 'Orphaned' => 'Fritstående',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projektnummer mangler!',
+ 'Project deleted!' => 'Projekt slettet!',
+ 'Project saved!' => 'Projekt gemt!',
+ 'Projects' => 'Projekter',
+ 'Save' => 'Gem',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'tilføj' => 'add',
+ 'fortsæt' => 'continue',
+ 'fjern' => 'delete',
+ 'gem' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/rc b/sql-ledger/locale/dk/rc
new file mode 100644
index 000000000..ea645b939
--- /dev/null
+++ b/sql-ledger/locale/dk/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Udjævnede balance',
+ 'Continue' => 'Fortsæt',
+ 'Date' => 'Dato',
+ 'Deposit' => 'Depositum',
+ 'Description' => 'Beskrivelse',
+ 'Difference' => 'Difference',
+ 'Done' => 'Færdig',
+ 'Exchangerate Difference' => 'Difference for vekselkurs',
+ 'From' => 'Fra',
+ 'Out of balance!' => 'Ikke i balance!',
+ 'Payment' => 'Betaling',
+ 'Reconciliation' => 'Afstemning',
+ 'Select all' => 'Vælg alt',
+ 'Source' => 'Bilag',
+ 'Statement Balance' => 'Balanceopgørelse',
+ 'To' => 'til',
+ 'Update' => 'Opdatér',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'fortsæt' => 'continue',
+ 'færdig' => 'done',
+ 'vælg_alt' => 'select_all',
+ 'opdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/dk/rp b/sql-ledger/locale/dk/rp
new file mode 100644
index 000000000..607d80c6e
--- /dev/null
+++ b/sql-ledger/locale/dk/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Aldersfordeling',
+ 'AR Aging' => 'Aldersfordeling',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Konti',
+ 'Amount' => 'Beløb',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Bilag',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Blind kopi',
+ 'Cash based' => 'Kontantbaseret',
+ 'Cc' => 'Kopi',
+ 'Compare to' => 'Sammenlign med',
+ 'Continue' => 'Fortsæt',
+ 'Copies' => 'Kopier',
+ 'Credit' => 'Kredit',
+ 'Current' => 'Current',
+ 'Customer' => 'Kunde',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Decimalplaces' => 'Decimalpladser',
+ 'Description' => 'Beskrivelse',
+ 'Due' => 'Forfald',
+ 'E-mail' => 'E-post',
+ 'E-mail Statement to' => 'Send opgørelse til',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Overskrift',
+ 'ID' => 'ID',
+ 'In-line' => 'Indlejret',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income Statement' => 'Driftsregnskab',
+ 'Invoice' => 'Faktura',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'marts',
+ 'May' => 'maj',
+ 'May ' => 'maj ',
+ 'Message' => 'Besked',
+ 'N/A' => 'I/T',
+ 'Nothing selected!' => 'Ingenting valgt!',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Betalinger',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Udskriv',
+ 'Printer' => 'Printer',
+ 'Receipts' => 'Kvitteringer',
+ 'Report for' => 'Rapport for',
+ 'Retained Earnings' => 'Realiseret overskud',
+ 'Screen' => 'Skærm',
+ 'Select all' => 'Vælg alt',
+ 'Select postscript or PDF!' => 'Vælg postscript eller PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Opgørelse',
+ 'Statement sent to' => 'Opgørelse sendt til',
+ 'Statements sent to printer!' => 'Opgørelser sendt til printer',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Afgift/Moms',
+ 'Tax collected' => 'Skat opkrævet',
+ 'Tax paid' => 'Skat betalt',
+ 'To' => 'til',
+ 'Total' => 'I alt',
+ 'Trial Balance' => 'Foreløbig status',
+ 'Vendor' => 'Leverandør',
+ 'as at' => 'som ved',
+ 'collected on sales' => 'indsamlet ved salg',
+ 'for Period' => 'for perioden',
+ 'paid on purchases' => 'betalt ved indkøb',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'fortsæt' => 'continue',
+ 'e_post' => 'e_mail',
+ 'udskriv' => 'print',
+ 'vælg_alt' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/COPYING b/sql-ledger/locale/ee/COPYING
new file mode 100644
index 000000000..fe5ef7d85
--- /dev/null
+++ b/sql-ledger/locale/ee/COPYING
@@ -0,0 +1,25 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Estonian texts:
+#
+# Author: Martin Lillepuu <martin@lillepuu.com>
+# Lauri Jesmin <jesmin@ut.ee>
+# Tanel Kurvits <rauge@hot.ee>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/ee/LANGUAGE b/sql-ledger/locale/ee/LANGUAGE
new file mode 100644
index 000000000..5d88c2daa
--- /dev/null
+++ b/sql-ledger/locale/ee/LANGUAGE
@@ -0,0 +1 @@
+Estonian
diff --git a/sql-ledger/locale/ee/admin b/sql-ledger/locale/ee/admin
new file mode 100644
index 000000000..00c683ef3
--- /dev/null
+++ b/sql-ledger/locale/ee/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Ligipääsukontroll',
+ 'Accounting' => 'Raamatupidamine',
+ 'Add User' => 'Lisa kasutaja',
+ 'Address' => 'Aadress',
+ 'Administration' => 'Administreerimine',
+ 'Administrator' => 'Administraator',
+ 'All Datasets up to date!' => 'Kõik andmebaasid on uuendatud',
+ 'Change Admin Password' => 'Muuda admini parool',
+ 'Change Password' => 'Muuda parool',
+ 'Character Set' => 'Kooditabel',
+ 'Click on login name to edit!' => 'Redigeerimiseks kliki kasutajanimel',
+ 'Company' => 'Ettevõte',
+ 'Connect to' => 'Ühenda',
+ 'Continue' => 'Edasi',
+ 'Create Chart of Accounts' => 'Uus kontoplaan',
+ 'Create Dataset' => 'Uus andmebaas',
+ 'DBI not installed!' => 'DBI on installeerimata',
+ 'Database' => 'Andmebaas',
+ 'Database Administration' => 'Andmebaasi administreerimine',
+ 'Database Driver not checked!' => 'Andmebaasi draiver valimata!',
+ 'Database User missing!' => 'Andmebaasi kasutaja puudub',
+ 'Dataset' => 'Andmebaas',
+ 'Dataset missing!' => 'Andmebaas puudub!',
+ 'Dataset updated!' => 'Andmebaas uuendatud!',
+ 'Date Format' => 'Kuupäeva formaat',
+ 'Delete' => 'Kustuta',
+ 'Delete Dataset' => 'Kustuta andmebaas',
+ 'Directory' => 'Kataloog',
+ 'Driver' => 'Draiver',
+ 'Dropdown Limit' => 'Rippmenüü piirang',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Kasutajaandmete muutmine',
+ 'Existing Datasets' => 'Olemasolevad andmebaasid',
+ 'Fax' => 'Faks',
+ 'Host' => 'Server',
+ 'Hostname missing!' => 'Serveri nimi puudub!',
+ 'Incorrect Password!' => 'Vale parool!',
+ 'Language' => 'Keel',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Jäta serveri ja pordi väljad tühjaks kui sa ei soovi kaugühendust luua',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Mitmebaidine kodeering',
+ 'Name' => 'Nimi',
+ 'New Templates' => 'Uued dokumendipõhjad',
+ 'No Database Drivers available!' => 'Ühtegi andmebaasidraiverit ei leitud!',
+ 'No Dataset selected!' => 'Andmebaas valimata!',
+ 'Nothing to delete!' => 'Midagi ei ole kustutada',
+ 'Number Format' => 'Numbri formaat',
+ 'Oracle Database Administration' => 'Oracle andmebaasi administreerimine',
+ 'Password' => 'Parool',
+ 'Password changed!' => 'Parool muudetud',
+ 'Pg Database Administration' => 'Pg andmebaasi administreerimine',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port puudub',
+ 'Printer' => 'Printer',
+ 'Save' => 'Salvesta',
+ 'Select a Dataset to delete and press "Continue"' => 'Vali andmebaas ja vajuta "Jätka"',
+ 'Setup Templates' => 'Dokumendipõhjade seadistamine',
+ 'Ship via' => 'Tarneviis',
+ 'Signature' => 'Signatuur',
+ 'Stylesheet' => 'Laaditabel',
+ 'Templates' => 'Dokumendipõhjad',
+ 'The following Datasets are not in use and can be deleted' => 'Järgnevad andmebaasid ei ole kasutusel ning võib kustutada',
+ 'The following Datasets need to be updated' => 'Järgmised andmebaasid vajavad uuendamist',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Olemasolevate allikate eelkontroll. Praeguses staadiumis ei toimu andmete lisamist ega kustutamist.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Kasutaja gruppi lisamiseks redigeeri nime, muuda kasutajanimi ja salvesta. Luuakse samade parameetritega uus kasutaja',
+ 'Update Dataset' => 'Uuenda andmebaas',
+ 'Use Templates' => 'Kasuta dokumendipõhja',
+ 'User' => 'Kasutaja',
+ 'User deleted!' => 'Kasutaja kustutatud!',
+ 'User saved!' => 'Kasutaja salvestatud!',
+ 'Version' => 'Versioon',
+ 'You must enter a host and port for local and remote connections!' => 'Ühenduse loomiseks palun sisesta serveri nimi ja port',
+ 'does not exist' => 'ei eksisteeri',
+ 'is already a member!' => 'on juba kasutaja!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'lukustatud!',
+ 'successfully created!' => 'loodud!',
+ 'successfully deleted!' => 'kustutatud!',
+ 'website' => 'kodulehekülg',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'lisa_kasutaja' => 'add_user',
+ 'muuda_admini_parool' => 'change_admin_password',
+ 'muuda_parool' => 'change_password',
+ 'edasi' => 'continue',
+ 'uus_andmebaas' => 'create_dataset',
+ 'kustuta' => 'delete',
+ 'kustuta_andmebaas' => 'delete_dataset',
+ 'login' => 'login',
+ 'oracle_andmebaasi_administreerimine' => 'oracle_database_administration',
+ 'pg_andmebaasi_administreerimine' => 'pg_database_administration',
+ 'salvesta' => 'save',
+ 'uuenda_andmebaas' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/all b/sql-ledger/locale/ee/all
new file mode 100644
index 000000000..122f34aec
--- /dev/null
+++ b/sql-ledger/locale/ee/all
@@ -0,0 +1,497 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Kohustused',
+ 'AP Aging' => 'Võlad',
+ 'AP Transaction' => 'Kohustuste kanne',
+ 'AP Transactions' => 'Kohustuste kanded',
+ 'AR' => 'Nõuded',
+ 'AR Aging' => 'Võlglased',
+ 'AR Transaction' => 'Nõuete kanne',
+ 'AR Transactions' => 'Nõuete kanded',
+ 'About' => 'Programmi Info',
+ 'Access Control' => 'Ligipääsukontroll',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Konto number',
+ 'Account Number missing!' => 'Konto number puudub',
+ 'Account Type' => 'Konto tüüp',
+ 'Account Type missing!' => 'Konto tüüp puudub!',
+ 'Account deleted!' => 'Konto kustutatud!',
+ 'Account saved!' => 'Konto salvestatud',
+ 'Accounting' => 'Raamatupidamine',
+ 'Accounting Menu' => 'Raamatupidamise Menüü',
+ 'Accounts' => 'Kontod',
+ 'Active' => 'Aktiva',
+ 'Add' => 'Lisa',
+ 'Add Account' => 'Lisa konto',
+ 'Add Accounts Payables Transaction' => 'Lisa kohustuste kanne',
+ 'Add Accounts Receivables Transaction' => 'Lisa nõuete kanne',
+ 'Add Assembly' => 'Lisa komplekt',
+ 'Add Customer' => 'Lisa klient',
+ 'Add GIFI' => 'Lisa GIFI',
+ 'Add General Ledger Transaction' => 'Lisa pearaamatu kanne',
+ 'Add Part' => 'Lisa toode',
+ 'Add Project' => 'Lisa Projekt',
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Invoice' => 'Lisa Müügiarve',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Add Service' => 'Lisa teenus',
+ 'Add Transaction' => 'Lisa kanne',
+ 'Add User' => 'Lisa kasutaja',
+ 'Add Vendor' => 'Lisa hankija',
+ 'Add Vendor Invoice' => '',
+ 'Address' => 'Aadress',
+ 'Administration' => 'Administreerimine',
+ 'Administrator' => 'Administraator',
+ 'All' => 'Kõik',
+ 'All Datasets up to date!' => 'Kõik andmebaasid on uuendatud',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Tasumata',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Summa puudub!',
+ 'Applied' => 'Makstud',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Invoice Number' => 'Kas oled kindel, et soovid kustutada arve',
+ 'Are you sure you want to delete Order Number' => 'Kas oled kindel, et soovid kustutada tellimuse',
+ 'Are you sure you want to delete Transaction' => 'Kas oled kindel, et soovid kustutada kande',
+ 'Assemblies' => 'Komplektid',
+ 'Assemblies restocked!' => 'Komplektid lattu tagastatud!',
+ 'Assembly Number missing!' => 'Komplekti number puudub!',
+ 'Asset' => 'Vara',
+ 'Attachment' => 'Kaasatud fail',
+ 'Audit Control' => 'Audit',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'BOM' => 'Materjalide nimekiri',
+ 'Backup' => 'Varukoopia',
+ 'Backup sent to' => 'Varukoopia saadetakse',
+ 'Balance' => 'Bilanss',
+ 'Balance Sheet' => 'Bilansitabel',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'Books are open' => 'Kanded on avatud',
+ 'Bought' => 'Ostetud',
+ 'Business Number' => 'Ettevõtte kood',
+ 'C' => 'C',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'Kontot ei saa kustutada!',
+ 'Cannot delete customer!' => 'Kienti ei saa kustutada!',
+ 'Cannot delete default account!' => 'Vaikimisi kontot ei saa kustutada!',
+ 'Cannot delete invoice!' => 'Arvet ei saa kustutada',
+ 'Cannot delete item already invoiced!' => 'Esitatud arvega toodet ei saa kustutada!',
+ 'Cannot delete item on order!' => 'Tellimusega seotud artiklit ei saa kustutada!',
+ 'Cannot delete item which is part of an assembly!' => 'Komplekti kuuluvat toodet ei saa kustutada!',
+ 'Cannot delete item!' => 'Toodet ei saa kustutada!',
+ 'Cannot delete order!' => 'Tellimust ei saa kustutada!',
+ 'Cannot delete transaction!' => 'Kannet ei saa kustutada!',
+ 'Cannot delete vendor!' => 'Tarnijat ei saa kustutada!',
+ 'Cannot have a value in both Debit and Credit!' => 'Deebet ja Kreedit väljad ei tohi olla samaaegselt täidetud!',
+ 'Cannot post a transaction without a value!' => 'Tühja väärtusega kannet pole võimalik salvestada!',
+ 'Cannot post invoice for a closed period!' => 'Arvet ei saa salvestada suletud perioodile!',
+ 'Cannot post invoice!' => 'Arvet ei saa saata!',
+ 'Cannot post payment for a closed period!' => 'Makset ei saa salvestada suletud perioodile',
+ 'Cannot post payment!' => 'Makset ei saa salvestada!',
+ 'Cannot post transaction for a closed period!' => 'Kannet ei saa salvestada suletud perioodile',
+ 'Cannot post transaction!' => 'Kannet ei saa salvestada!',
+ 'Cannot process payment for a closed period!' => 'Suletud perioodi makset ei saa töödelda!',
+ 'Cannot save account!' => 'Kontot ei saa salvestada',
+ 'Cannot save order!' => 'Arvet ei saa salvestada',
+ 'Cannot save preferences!' => 'Maaranguid ei saa salvestada',
+ 'Cannot stock assemblies!' => 'Komplekte ei saa lattu võtta',
+ 'Cash' => 'Kassa',
+ 'Cash based' => 'Kassapõhine',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Muuda admini parool',
+ 'Change Password' => 'Muuda parool',
+ 'Character Set' => 'Kooditabel',
+ 'Chart of Accounts' => 'Kontoplaan',
+ 'Check' => 'T?ekk',
+ 'Check printed!' => 'T?ekk on türkitud',
+ 'Check printing failed!' => 'T?eki trükkimine ebaõnnestus',
+ 'Cleared Balance' => 'Puhastatud bilanss',
+ 'Click on login name to edit!' => 'Redigeerimiseks kliki kasutajanimel',
+ 'Close Books up to' => 'Sulge kanded kuni',
+ 'Closed' => 'Suletud',
+ 'Company' => 'Ettevõte',
+ 'Compare to' => 'Võrdlus perioodiga',
+ 'Confirm!' => 'Kinnita!',
+ 'Connect to' => 'Ühenda',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Copy to COA' => 'Kopeeri kontoplaani',
+ 'Create Chart of Accounts' => 'Uus kontoplaan',
+ 'Create Dataset' => 'Uus andmebaas',
+ 'Credit' => 'Kreedit',
+ 'Credit Limit' => 'Krediidilimiit',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valuuta',
+ 'Current' => 'Praegune',
+ 'Customer' => 'Klient',
+ 'Customer deleted!' => 'Klient on kustutatud!',
+ 'Customer missing!' => 'Klienti pole määratud!',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Customer saved!' => 'Klient salvestatud',
+ 'Customers' => 'Kliendid',
+ 'DBI not installed!' => 'DBI on installeerimata',
+ 'Database' => 'Andmebaas',
+ 'Database Administration' => 'Andmebaasi administreerimine',
+ 'Database Driver not checked!' => 'Andmebaasi draiver valimata!',
+ 'Database Host' => 'Andmebaasiserver',
+ 'Database User missing!' => 'Andmebaasi kasutaja puudub',
+ 'Dataset' => 'Andmebaas',
+ 'Dataset missing!' => 'Andmebaas puudub!',
+ 'Dataset updated!' => 'Andmebaas uuendatud!',
+ 'Date' => 'Kuupäev',
+ 'Date Format' => 'Kuupäeva formaat',
+ 'Date Paid' => 'Maksekuupäev',
+ 'Date missing!' => 'Kuupäev puudub!',
+ 'Debit' => 'Deebet',
+ 'Debit and credit out of balance!' => 'Deebet ja Kreedit tasakaalust väljas!',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Decimalplaces' => 'Komakohti',
+ 'Delete' => 'Kustuta',
+ 'Delete Account' => 'Kustuta konto',
+ 'Delete Dataset' => 'Kustuta andmebaas',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Department' => 'Osakond',
+ 'Deposit' => 'Tarnimata',
+ 'Description' => 'Selgitus',
+ 'Difference' => 'Vahe',
+ 'Directory' => 'Kataloog',
+ 'Discount' => 'Allahindlus',
+ 'Done' => 'Teostatud',
+ 'Drawing' => 'Pildid',
+ 'Driver' => 'Draiver',
+ 'Dropdown Limit' => 'Rippmenüü piirang',
+ 'Due' => 'Tasuda',
+ 'Due Date' => 'Maksetähtaeg',
+ 'Due Date missing!' => 'Maksetähtaeg puudub',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail teatis',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Edit' => 'Muudatused',
+ 'Edit Account' => 'Konto muudatused',
+ 'Edit Accounts Payables Transaction' => 'Muuda nõuete kannet',
+ 'Edit Accounts Receivables Transaction' => 'Muuda kohustuste kannet',
+ 'Edit Assembly' => 'Muuda Komplekti',
+ 'Edit Customer' => 'Muuda Kliendi andmeid',
+ 'Edit GIFI' => 'Muuda GIFI',
+ 'Edit General Ledger Transaction' => 'Pearaamatu kande redigeerimine',
+ 'Edit Part' => 'Toote redigeerimine',
+ 'Edit Preferences for' => 'Määrangute muutmine: ',
+ 'Edit Project' => 'Muuda Projekti',
+ 'Edit Purchase Order' => 'Ostutellimuse muutmine',
+ 'Edit Sales Invoice' => 'Müügiarve muutmine',
+ 'Edit Sales Order' => 'Müügitellimuse muutmine',
+ 'Edit Service' => 'Teenuse muutmine',
+ 'Edit Template' => 'Dokumendipõhja muutmine',
+ 'Edit User' => 'Kasutajaandmete muutmine',
+ 'Edit Vendor' => 'Muuda Tarnija andmeid',
+ 'Edit Vendor Invoice' => '',
+ 'Employee' => 'Töötaja',
+ 'Enforce transaction reversal for all dates' => 'Muuda kannete pööramine kõikide kuupäevade ulatuses kohustuslikuks',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Sisesta kohalikud- ja välisvaluutad (kuni 3 tähemärki, koolonitega eraltatud, nt. CAD:USD:EUR)',
+ 'Equity' => 'Omakapital',
+ 'Exch' => 'Kurss',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate Difference' => 'Valuutakursi muutus',
+ 'Exchangerate for payment missing!' => 'Maksel ei ole valuutakurssi!',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Existing Datasets' => 'Olemasolevad andmebaasid',
+ 'Expense' => 'Kulu',
+ 'Expense Account' => 'Kulukonto',
+ 'Expense/Asset' => 'Kulu/Vara',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'Foreign Exchange Gain' => 'Valuutakursside vahe kasum',
+ 'Foreign Exchange Loss' => 'Valuutakursside vahe kahjum',
+ 'From' => 'Alates',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI kustutatud',
+ 'GIFI missing!' => 'GIFI puudub',
+ 'GIFI saved!' => 'GIFI salvestatud',
+ 'GL Transaction' => 'Pearaamatu kanne',
+ 'General Ledger' => 'Pearaamat',
+ 'Goods & Services' => 'Tooted ja teenused',
+ 'Group' => '',
+ 'Group Items' => '',
+ 'HTML Templates' => 'HTML dokumendipõhjad',
+ 'Heading' => 'Päis',
+ 'Host' => 'Server',
+ 'Hostname missing!' => 'Serveri nimi puudub!',
+ 'ID' => 'ID',
+ 'Image' => 'Pilt',
+ 'In-line' => 'Dokumendisisene',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Include in drop-down menus' => 'Kaasa valikmenüüdes',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Kaasa antud konto klient/tarnija vormides, et märkida klient/tarnija maksustatavaks',
+ 'Income' => 'Tulu',
+ 'Income Account' => 'Tulukonto',
+ 'Income Statement' => 'Kasumiaruanne',
+ 'Incorrect Dataset version!' => 'Vale andmebaasi versioon',
+ 'Incorrect Password!' => 'Vale parool!',
+ 'Individual Items' => 'Komponendid',
+ 'Inventory' => 'Ladu',
+ 'Inventory Account' => 'Laokonto',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Enne komplekti aegunuks märkimist peab laoseis null olema!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Enne toote aegunuks märkimist peab laoseis null olema!',
+ 'Inventory quantity must be zero!' => 'Laoseis peab null olema!',
+ 'Invoice' => 'Arve',
+ 'Invoice Date' => 'Arve kuupäev',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Invoice deleted!' => 'Arve kustutatud!',
+ 'Invoice posted!' => 'Arve salvestatud!',
+ 'Invoices' => 'Arved',
+ 'Is this a summary account to record' => 'Kirje summaarne konto',
+ 'Item deleted!' => 'Toode kustutatud!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'LaTeX Templates' => 'LaTeX dokumendipõhjad',
+ 'Language' => 'Keel',
+ 'Last Cost' => 'Viimane ostuhind',
+ 'Last Invoice Number' => 'Viimane arve number',
+ 'Last Numbers & Default Accounts' => 'Viimased numbrid ja vaikimisi kontod',
+ 'Last Purchase Order Number' => 'Viimane ostutellimuse number',
+ 'Last Sales Order Number' => 'Viimane müügitellimuse number',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Jäta serveri ja pordi väljad tühjaks kui sa ei soovi kaugühendust luua',
+ 'Liability' => 'Kohustus',
+ 'Licensed to' => 'Kasutaja andmed:',
+ 'Line Total' => 'Rea summa',
+ 'Link' => 'Seosed',
+ 'Link Accounts' => 'Seosta kontod',
+ 'List Accounts' => 'Kontode nimekiri',
+ 'List GIFI' => 'GIFI nimekiri',
+ 'List Price' => 'Hinnakirja hind',
+ 'List Transactions' => 'Kannete sirvimine',
+ 'Login' => 'Login',
+ 'Logout' => 'Logi välja',
+ 'Make' => 'Tootja',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Mudel',
+ 'Multibyte Encoding' => 'Mitmebaidine kodeering',
+ 'N/A' => 'Puudub',
+ 'Name' => 'Nimi',
+ 'Name missing!' => 'Nimi puudub!',
+ 'New Templates' => 'Uued dokumendipõhjad',
+ 'No' => 'Ei',
+ 'No Database Drivers available!' => 'Ühtegi andmebaasidraiverit ei leitud!',
+ 'No Dataset selected!' => 'Andmebaas valimata!',
+ 'No email address for' => 'E-maili aadress puudub',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Märkused',
+ 'Nothing applied!' => 'Midagi ei muudetud',
+ 'Nothing selected!' => 'Midagi ei ole valitud',
+ 'Nothing to delete!' => 'Midagi ei ole kustutada',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number Format' => 'Numbri formaat',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'O' => 'O',
+ 'Obsolete' => 'Aegunud',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'On Hand' => 'Laos',
+ 'On Order' => 'Tellimisel',
+ 'Open' => 'Avatud',
+ 'Oracle Database Administration' => 'Oracle andmebaasi administreerimine',
+ 'Order' => 'Tellimus',
+ 'Order Date' => 'Tellimuse kuupäev',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Entry' => 'Tellimuse sisestamine',
+ 'Order Number' => 'Tellimuse number',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'Order deleted!' => 'Tellimus kustutatud',
+ 'Order saved!' => 'Tellimus salvestatud',
+ 'Ordered' => 'Tellitud',
+ 'Orphaned' => 'Seosteta',
+ 'Out of balance!' => 'Bilanss ei klapi!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Paid' => 'Makstud',
+ 'Paid in full' => 'Täielikult tasutud',
+ 'Part' => 'Toode',
+ 'Part Number missing!' => 'Toote kood puudub',
+ 'Parts' => 'Tooted',
+ 'Parts Inventory' => 'Tooted',
+ 'Password' => 'Parool',
+ 'Password changed!' => 'Parool muudetud',
+ 'Payables' => 'Kohustused',
+ 'Payment' => 'Maksed',
+ 'Payment date missing!' => 'Maksekuupäev puudub',
+ 'Payment posted!' => 'Makse salvestatud',
+ 'Payments' => 'Maksed',
+ 'Pg Database Administration' => 'Pg andmebaasi administreerimine',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port puudub',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Määrangud',
+ 'Preferences saved!' => 'Määrangud salvestatud',
+ 'Price' => 'Hind',
+ 'Print' => 'Trüki',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project Number' => 'Projekti number',
+ 'Project Number missing!' => 'Projekti number puudub',
+ 'Project deleted!' => 'Projekt kustutatud',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Project saved!' => 'Projekt salvestatud',
+ 'Projects' => 'Projektid',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Purchase Orders' => 'Ostutellimused',
+ 'Qty' => 'Kogus',
+ 'ROP' => 'TM',
+ 'Rate' => 'Määr',
+ 'Recd' => 'Saabunud',
+ 'Receipt' => 'Laekumised',
+ 'Receipt printed!' => 'Tshekk trükitud',
+ 'Receipt printing failed!' => 'Tsheki trükkkimine ebaõnnestus',
+ 'Receipts' => 'Laekumised',
+ 'Receivables' => 'Nõuded',
+ 'Reconciliation' => 'Tasaarveldused',
+ 'Record in' => 'Sihtkonto',
+ 'Reference' => 'Viide',
+ 'Reference missing!' => 'Viide puudub!',
+ 'Remaining' => 'Kasutamata',
+ 'Report for' => 'Aruanne',
+ 'Reports' => 'Aruanded',
+ 'Required by' => 'Tarneaeg',
+ 'Retained Earnings' => 'Jaotamata kasum',
+ 'Sales' => 'Müük',
+ 'Sales Invoice' => 'Müügiarve',
+ 'Sales Order' => 'Müügitellimus',
+ 'Sales Orders' => 'Müügitellimused',
+ 'Salesperson' => '',
+ 'Save' => 'Salvesta',
+ 'Save as new' => 'Salvesta uuena',
+ 'Save to File' => 'Salvesta faili',
+ 'Screen' => 'Ekraan',
+ 'Select a Dataset to delete and press "Continue"' => 'Vali andmebaas ja vajuta "Jätka"',
+ 'Select all' => 'Vali kõik',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sell Price' => 'Müügihind',
+ 'Send by E-Mail' => 'Saada e-postiga',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Service Items' => 'Teenused',
+ 'Service Number missing!' => 'teenuse kood puudub!',
+ 'Services' => 'Teenused',
+ 'Setup Templates' => 'Dokumendipõhjade seadistamine',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Ship via' => 'Tarneviis',
+ 'Short' => 'Lühike',
+ 'Signature' => 'Signatuur',
+ 'Sold' => 'Müüdud',
+ 'Source' => 'Allikas',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Aruanne',
+ 'Statement Balance' => 'Bilansiaruanne',
+ 'Statement sent to' => 'Saata aruanne aadressil',
+ 'Statements sent to printer!' => 'Saata aruanne printerile',
+ 'Stock Assembly' => 'Komplekti lattu võtmine',
+ 'Stylesheet' => 'Laaditabel',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'System' => 'Süsteem',
+ 'Tax' => 'Maks',
+ 'Tax Accounts' => 'Maksukontod',
+ 'Tax Included' => 'Koos maksuga',
+ 'Tax collected' => 'Kogutud maksud',
+ 'Tax paid' => 'Makstud makse',
+ 'Taxable' => 'Maksustatav',
+ 'Template saved!' => 'Dokumendipõhjad salvestatud!',
+ 'Templates' => 'Dokumendipõhjad',
+ 'Terms: Net' => 'Maksetingimus',
+ 'The following Datasets are not in use and can be deleted' => 'Järgnevad andmebaasid ei ole kasutusel ning võib kustutada',
+ 'The following Datasets need to be updated' => 'Järgmised andmebaasid vajavad uuendamist',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Olemasolevate allikate eelkontroll. Praeguses staadiumis ei toimu andmete lisamist ega kustutamist.',
+ 'To' => 'Kuhu',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Kasutaja gruppi lisamiseks redigeeri nime, muuda kasutajanimi ja salvesta. Luuakse samade parameetritega uus kasutaja',
+ 'Top Level' => 'Ülemine tase',
+ 'Total' => 'Kokku',
+ 'Transaction Date missing!' => 'Kande kuupäev puudub!',
+ 'Transaction deleted!' => 'Kanne kustutatud!',
+ 'Transaction posted!' => 'Kanne tud!',
+ 'Transaction reversal enforced for all dates' => 'Kannete pööramine on kohustuslik kõikide kuupäevade ulatuses',
+ 'Transaction reversal enforced up to' => 'Kannete pööramine on kohustuslik kuni',
+ 'Transactions' => 'Kanded',
+ 'Transactions exist, cannot delete customer!' => 'Kanded aktiivsed, klienti ei saa kustutada!',
+ 'Transactions exist, cannot delete vendor!' => 'Kanded aktiivsed, hankijat ei saa kustutada!',
+ 'Transactions exist; cannot delete account!' => 'Kanded aktiivsed; kontot ei saa kustutada!',
+ 'Trial Balance' => 'Proovibilanss',
+ 'Unit' => 'Ühik',
+ 'Unit of measure' => 'Mõõtühik',
+ 'Update' => 'Uuenda',
+ 'Update Dataset' => 'Uuenda andmebaas',
+ 'Updated' => 'Uuendatud',
+ 'Use Templates' => 'Kasuta dokumendipõhja',
+ 'User' => 'Kasutaja',
+ 'User deleted!' => 'Kasutaja kustutatud!',
+ 'User saved!' => 'Kasutaja salvestatud!',
+ 'Vendor' => 'Hankija',
+ 'Vendor Invoice' => '',
+ 'Vendor deleted!' => 'Hankija kustutatud!',
+ 'Vendor missing!' => 'Hankija puudub!',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'Vendor saved!' => 'Hankija salvestatud!',
+ 'Vendors' => 'Hankijad',
+ 'Version' => 'Versioon',
+ 'Weight' => 'Kaal',
+ 'Weight Unit' => 'Kaaluühik',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'Year End' => 'Aasta lõpp',
+ 'Yes' => 'Jah',
+ 'You are logged out!' => 'Oled välja loginud!',
+ 'You did not enter a name!' => 'Nimi sisestamata!',
+ 'You must enter a host and port for local and remote connections!' => 'Ühenduse loomiseks palun sisesta serveri nimi ja port',
+ 'as at' => 'Seisuga',
+ 'collected on sales' => 'kogutud müügilt',
+ 'days' => 'päeva',
+ 'does not exist' => 'ei eksisteeri',
+ 'ea' => 'tk',
+ 'emailed to' => 'salvestatud aadressile',
+ 'for Period' => 'Periood',
+ 'hr' => 't',
+ 'is already a member!' => 'on juba kasutaja!',
+ 'is not a member!' => 'ei ole kasutaja!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'lukustatud!',
+ 'paid on purchases' => 'makstud ostudelt',
+ 'sent to printer' => 'printerile saadetud',
+ 'successfully created!' => 'loodud!',
+ 'successfully deleted!' => 'kustutatud!',
+ 'to' => 'kuni',
+ 'website' => 'kodulehekülg',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/am b/sql-ledger/locale/ee/am
new file mode 100644
index 000000000..ebf0bf1ab
--- /dev/null
+++ b/sql-ledger/locale/ee/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Kohustused',
+ 'AR' => 'Nõuded',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Konto number',
+ 'Account Number missing!' => 'Konto number puudub',
+ 'Account Type' => 'Konto tüüp',
+ 'Account Type missing!' => 'Konto tüüp puudub!',
+ 'Account deleted!' => 'Konto kustutatud!',
+ 'Account saved!' => 'Konto salvestatud',
+ 'Add Account' => 'Lisa konto',
+ 'Add GIFI' => 'Lisa GIFI',
+ 'Address' => 'Aadress',
+ 'Asset' => 'Vara',
+ 'Audit Control' => 'Audit',
+ 'Backup sent to' => 'Varukoopia saadetakse',
+ 'Books are open' => 'Kanded on avatud',
+ 'Business Number' => 'Ettevõtte kood',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'Kontot ei saa kustutada!',
+ 'Cannot delete default account!' => 'Vaikimisi kontot ei saa kustutada!',
+ 'Cannot save account!' => 'Kontot ei saa salvestada',
+ 'Cannot save preferences!' => 'Maaranguid ei saa salvestada',
+ 'Character Set' => 'Kooditabel',
+ 'Chart of Accounts' => 'Kontoplaan',
+ 'Close Books up to' => 'Sulge kanded kuni',
+ 'Company' => 'Ettevõte',
+ 'Continue' => 'Edasi',
+ 'Copy to COA' => 'Kopeeri kontoplaani',
+ 'Credit' => 'Kreedit',
+ 'Date Format' => 'Kuupäeva formaat',
+ 'Debit' => 'Deebet',
+ 'Delete' => 'Kustuta',
+ 'Delete Account' => 'Kustuta konto',
+ 'Description' => 'Selgitus',
+ 'Dropdown Limit' => 'Rippmenüü piirang',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Muudatused',
+ 'Edit Account' => 'Konto muudatused',
+ 'Edit GIFI' => 'Muuda GIFI',
+ 'Edit Preferences for' => 'Määrangute muutmine: ',
+ 'Edit Template' => 'Dokumendipõhja muutmine',
+ 'Enforce transaction reversal for all dates' => 'Muuda kannete pööramine kõikide kuupäevade ulatuses kohustuslikuks',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Sisesta kohalikud- ja välisvaluutad (kuni 3 tähemärki, koolonitega eraltatud, nt. CAD:USD:EUR)',
+ 'Equity' => 'Omakapital',
+ 'Expense' => 'Kulu',
+ 'Expense Account' => 'Kulukonto',
+ 'Expense/Asset' => 'Kulu/Vara',
+ 'Fax' => 'Faks',
+ 'Foreign Exchange Gain' => 'Valuutakursside vahe kasum',
+ 'Foreign Exchange Loss' => 'Valuutakursside vahe kahjum',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI kustutatud',
+ 'GIFI missing!' => 'GIFI puudub',
+ 'GIFI saved!' => 'GIFI salvestatud',
+ 'Heading' => 'Päis',
+ 'Include in drop-down menus' => 'Kaasa valikmenüüdes',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Kaasa antud konto klient/tarnija vormides, et märkida klient/tarnija maksustatavaks',
+ 'Income' => 'Tulu',
+ 'Income Account' => 'Tulukonto',
+ 'Inventory' => 'Ladu',
+ 'Inventory Account' => 'Laokonto',
+ 'Is this a summary account to record' => 'Kirje summaarne konto',
+ 'Language' => 'Keel',
+ 'Last Invoice Number' => 'Viimane arve number',
+ 'Last Numbers & Default Accounts' => 'Viimased numbrid ja vaikimisi kontod',
+ 'Last Purchase Order Number' => 'Viimane ostutellimuse number',
+ 'Last Sales Order Number' => 'Viimane müügitellimuse number',
+ 'Liability' => 'Kohustus',
+ 'Link' => 'Seosed',
+ 'Name' => 'Nimi',
+ 'No' => 'Ei',
+ 'No email address for' => 'E-maili aadress puudub',
+ 'Number' => 'Kood',
+ 'Number Format' => 'Numbri formaat',
+ 'Parts Inventory' => 'Tooted',
+ 'Password' => 'Parool',
+ 'Payables' => 'Kohustused',
+ 'Payment' => 'Maksed',
+ 'Phone' => 'Telefon',
+ 'Preferences saved!' => 'Määrangud salvestatud',
+ 'Rate' => 'Määr',
+ 'Receivables' => 'Nõuded',
+ 'Sales' => 'Müük',
+ 'Save' => 'Salvesta',
+ 'Service Items' => 'Teenused',
+ 'Ship via' => 'Tarneviis',
+ 'Signature' => 'Signatuur',
+ 'Stylesheet' => 'Laaditabel',
+ 'Tax' => 'Maks',
+ 'Tax Accounts' => 'Maksukontod',
+ 'Template saved!' => 'Dokumendipõhjad salvestatud!',
+ 'Transaction reversal enforced for all dates' => 'Kannete pööramine on kohustuslik kõikide kuupäevade ulatuses',
+ 'Transaction reversal enforced up to' => 'Kannete pööramine on kohustuslik kuni',
+ 'Transactions exist; cannot delete account!' => 'Kanded aktiivsed; kontot ei saa kustutada!',
+ 'Weight Unit' => 'Kaaluühik',
+ 'Year End' => 'Aasta lõpp',
+ 'Yes' => 'Jah',
+ 'does not exist' => 'ei eksisteeri',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'lisa_konto' => 'add_account',
+ 'edasi' => 'continue',
+ 'kopeeri_kontoplaani' => 'copy_to_coa',
+ 'kustuta' => 'delete',
+ 'muudatused' => 'edit',
+ 'konto_muudatused' => 'edit_account',
+ 'salvesta' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ap b/sql-ledger/locale/ee/ap
new file mode 100644
index 000000000..f2b305259
--- /dev/null
+++ b/sql-ledger/locale/ee/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Kohustuste kanne',
+ 'AP Transactions' => 'Kohustuste kanded',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Lisa kohustuste kanne',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Tasumata',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Transaction' => 'Kas oled kindel, et soovid kustutada kande',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Kannet ei saa kustutada!',
+ 'Cannot post payment for a closed period!' => 'Makset ei saa salvestada suletud perioodile',
+ 'Cannot post transaction for a closed period!' => 'Kannet ei saa salvestada suletud perioodile',
+ 'Cannot post transaction!' => 'Kannet ei saa salvestada!',
+ 'Closed' => 'Suletud',
+ 'Confirm!' => 'Kinnita!',
+ 'Continue' => 'Edasi',
+ 'Currency' => 'Valuuta',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Date Paid' => 'Maksekuupäev',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Description' => 'Selgitus',
+ 'Due Date' => 'Maksetähtaeg',
+ 'Due Date missing!' => 'Maksetähtaeg puudub',
+ 'Edit Accounts Payables Transaction' => 'Muuda nõuete kannet',
+ 'Employee' => 'Töötaja',
+ 'Exch' => 'Kurss',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate for payment missing!' => 'Maksel ei ole valuutakurssi!',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Invoice' => 'Arve',
+ 'Invoice Date' => 'Arve kuupäev',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Open' => 'Avatud',
+ 'Order' => 'Tellimus',
+ 'Order Number' => 'Tellimuse number',
+ 'Paid' => 'Makstud',
+ 'Payment date missing!' => 'Maksekuupäev puudub',
+ 'Payments' => 'Maksed',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Source' => 'Allikas',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax' => 'Maks',
+ 'Tax Included' => 'Koos maksuga',
+ 'Total' => 'Kokku',
+ 'Transaction deleted!' => 'Kanne kustutatud!',
+ 'Transaction posted!' => 'Kanne tud!',
+ 'Update' => 'Uuenda',
+ 'Vendor' => 'Hankija',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor missing!' => 'Hankija puudub!',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'Yes' => 'Jah',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'kohustuste_kanne' => 'ap_transaction',
+ 'lisa_kohustuste_kanne' => 'add_accounts_payables_transaction',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'muuda_nõuete_kannet' => 'edit_accounts_payables_transaction',
+ 'salvesta' => 'post',
+ 'salvesta_uuena' => 'post_as_new',
+ 'uuenda' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ar b/sql-ledger/locale/ee/ar
new file mode 100644
index 000000000..e940d9499
--- /dev/null
+++ b/sql-ledger/locale/ee/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Nõuete kanne',
+ 'AR Transactions' => 'Nõuete kanded',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Lisa nõuete kanne',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Tasumata',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Transaction' => 'Kas oled kindel, et soovid kustutada kande',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Kannet ei saa kustutada!',
+ 'Cannot post payment for a closed period!' => 'Makset ei saa salvestada suletud perioodile',
+ 'Cannot post transaction for a closed period!' => 'Kannet ei saa salvestada suletud perioodile',
+ 'Cannot post transaction!' => 'Kannet ei saa salvestada!',
+ 'Closed' => 'Suletud',
+ 'Confirm!' => 'Kinnita!',
+ 'Continue' => 'Edasi',
+ 'Credit Limit' => 'Krediidilimiit',
+ 'Currency' => 'Valuuta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Klienti pole määratud!',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Date Paid' => 'Maksekuupäev',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Description' => 'Selgitus',
+ 'Due Date' => 'Maksetähtaeg',
+ 'Due Date missing!' => 'Maksetähtaeg puudub',
+ 'Edit Accounts Receivables Transaction' => 'Muuda kohustuste kannet',
+ 'Exch' => 'Kurss',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate for payment missing!' => 'Maksel ei ole valuutakurssi!',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Invoice' => 'Arve',
+ 'Invoice Date' => 'Arve kuupäev',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Open' => 'Avatud',
+ 'Order' => 'Tellimus',
+ 'Order Number' => 'Tellimuse number',
+ 'Paid' => 'Makstud',
+ 'Payment date missing!' => 'Maksekuupäev puudub',
+ 'Payments' => 'Maksed',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Remaining' => 'Kasutamata',
+ 'Sales Invoice' => 'Müügiarve',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Ship via' => 'Tarneviis',
+ 'Source' => 'Allikas',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax' => 'Maks',
+ 'Tax Included' => 'Koos maksuga',
+ 'Total' => 'Kokku',
+ 'Transaction deleted!' => 'Kanne kustutatud!',
+ 'Transaction posted!' => 'Kanne tud!',
+ 'Update' => 'Uuenda',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'Yes' => 'Jah',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'nõuete_kanne' => 'ar_transaction',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'salvesta' => 'post',
+ 'salvesta_uuena' => 'post_as_new',
+ 'müügiarve' => 'sales_invoice',
+ 'uuenda' => 'update',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/arap b/sql-ledger/locale/ee/arap
new file mode 100644
index 000000000..061f6d3ac
--- /dev/null
+++ b/sql-ledger/locale/ee/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Aadress',
+ 'Continue' => 'Edasi',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Description' => 'Selgitus',
+ 'Number' => 'Kood',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'edasi' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ca b/sql-ledger/locale/ee/ca
new file mode 100644
index 000000000..4695ea4ed
--- /dev/null
+++ b/sql-ledger/locale/ee/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanss',
+ 'Chart of Accounts' => 'Kontoplaan',
+ 'Credit' => 'Kreedit',
+ 'Date' => 'Kuupäev',
+ 'Debit' => 'Deebet',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Description' => 'Selgitus',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'List Transactions' => 'Kannete sirvimine',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Reference' => 'Viide',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Subtotal' => 'Vahesumma',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'kannete_sirvimine' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/cp b/sql-ledger/locale/ee/cp
new file mode 100644
index 000000000..c1353d576
--- /dev/null
+++ b/sql-ledger/locale/ee/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Summa puudub!',
+ 'Applied' => 'Makstud',
+ 'Cannot post payment!' => 'Makset ei saa salvestada!',
+ 'Cannot process payment for a closed period!' => 'Suletud perioodi makset ei saa töödelda!',
+ 'Check' => 'T?ekk',
+ 'Check printed!' => 'T?ekk on türkitud',
+ 'Check printing failed!' => 'T?eki trükkimine ebaõnnestus',
+ 'Continue' => 'Edasi',
+ 'Currency' => 'Valuuta',
+ 'Customer' => 'Klient',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Date missing!' => 'Kuupäev puudub!',
+ 'Description' => 'Selgitus',
+ 'Due' => 'Tasuda',
+ 'Exchangerate' => 'Valuutakurss',
+ 'From' => 'Alates',
+ 'Invoice' => 'Arve',
+ 'Invoices' => 'Arved',
+ 'Nothing applied!' => 'Midagi ei muudetud',
+ 'Number' => 'Kood',
+ 'Paid in full' => 'Täielikult tasutud',
+ 'Payment' => 'Maksed',
+ 'Payment posted!' => 'Makse salvestatud',
+ 'Post' => 'Salvesta',
+ 'Print' => 'Trüki',
+ 'Printer' => 'Printer',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Receipt' => 'Laekumised',
+ 'Receipt printed!' => 'Tshekk trükitud',
+ 'Receipt printing failed!' => 'Tsheki trükkkimine ebaõnnestus',
+ 'Reference' => 'Viide',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Update' => 'Uuenda',
+ 'Vendor' => 'Hankija',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'edasi' => 'continue',
+ 'salvesta' => 'post',
+ 'trüki' => 'print',
+ 'uuenda' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ct b/sql-ledger/locale/ee/ct
new file mode 100644
index 000000000..4d167b2c3
--- /dev/null
+++ b/sql-ledger/locale/ee/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Lisa',
+ 'Address' => 'Aadress',
+ 'All' => 'Kõik',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Kienti ei saa kustutada!',
+ 'Cannot delete vendor!' => 'Tarnijat ei saa kustutada!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Credit Limit' => 'Krediidilimiit',
+ 'Customer deleted!' => 'Klient on kustutatud!',
+ 'Customer saved!' => 'Klient salvestatud',
+ 'Customers' => 'Kliendid',
+ 'Delete' => 'Kustuta',
+ 'Discount' => 'Allahindlus',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Muuda Kliendi andmeid',
+ 'Edit Vendor' => 'Muuda Tarnija andmeid',
+ 'Fax' => 'Faks',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Invoice' => 'Arve',
+ 'Name' => 'Nimi',
+ 'Name missing!' => 'Nimi puudub!',
+ 'Notes' => 'Märkused',
+ 'Number' => 'Kood',
+ 'Order' => 'Tellimus',
+ 'Orphaned' => 'Seosteta',
+ 'Phone' => 'Telefon',
+ 'Save' => 'Salvesta',
+ 'Ship to' => 'Tarneaadress',
+ 'Tax Included' => 'Koos maksuga',
+ 'Taxable' => 'Maksustatav',
+ 'Terms: Net' => 'Maksetingimus',
+ 'Transactions exist, cannot delete customer!' => 'Kanded aktiivsed, klienti ei saa kustutada!',
+ 'Transactions exist, cannot delete vendor!' => 'Kanded aktiivsed, hankijat ei saa kustutada!',
+ 'Vendor deleted!' => 'Hankija kustutatud!',
+ 'Vendor saved!' => 'Hankija salvestatud!',
+ 'Vendors' => 'Hankijad',
+ 'days' => 'päeva',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'lisa' => 'add',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'arve' => 'invoice',
+ 'tellimus' => 'order',
+ 'salvesta' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/gl b/sql-ledger/locale/ee/gl
new file mode 100644
index 000000000..dd25e8fb1
--- /dev/null
+++ b/sql-ledger/locale/ee/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Kohustuste kanne',
+ 'AR Transaction' => 'Nõuete kanne',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Lisa pearaamatu kanne',
+ 'Address' => 'Aadress',
+ 'All' => 'Kõik',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Transaction' => 'Kas oled kindel, et soovid kustutada kande',
+ 'Asset' => 'Vara',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanss',
+ 'Cannot delete transaction!' => 'Kannet ei saa kustutada!',
+ 'Cannot have a value in both Debit and Credit!' => 'Deebet ja Kreedit väljad ei tohi olla samaaegselt täidetud!',
+ 'Cannot post a transaction without a value!' => 'Tühja väärtusega kannet pole võimalik salvestada!',
+ 'Cannot post transaction for a closed period!' => 'Kannet ei saa salvestada suletud perioodile',
+ 'Confirm!' => 'Kinnita!',
+ 'Continue' => 'Edasi',
+ 'Credit' => 'Kreedit',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Debit' => 'Deebet',
+ 'Debit and credit out of balance!' => 'Deebet ja Kreedit tasakaalust väljas!',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Description' => 'Selgitus',
+ 'Edit General Ledger Transaction' => 'Pearaamatu kande redigeerimine',
+ 'Equity' => 'Omakapital',
+ 'Expense' => 'Kulu',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Pearaamatu kanne',
+ 'General Ledger' => 'Pearaamat',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Income' => 'Tulu',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Liability' => 'Kohustus',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Reference' => 'Viide',
+ 'Reference missing!' => 'Viide puudub!',
+ 'Reports' => 'Aruanded',
+ 'Sales Invoice' => 'Müügiarve',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Source' => 'Allikas',
+ 'Subtotal' => 'Vahesumma',
+ 'Transaction Date missing!' => 'Kande kuupäev puudub!',
+ 'Transaction deleted!' => 'Kanne kustutatud!',
+ 'Transaction posted!' => 'Kanne tud!',
+ 'Update' => 'Uuenda',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'Yes' => 'Jah',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'kohustuste_kanne' => 'ap_transaction',
+ 'nõuete_kanne' => 'ar_transaction',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'pearaamatu_kanne' => 'gl_transaction',
+ 'salvesta' => 'post',
+ 'salvesta_uuena' => 'post_as_new',
+ 'müügiarve' => 'sales_invoice',
+ 'uuenda' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ic b/sql-ledger/locale/ee/ic
new file mode 100644
index 000000000..7e86e2973
--- /dev/null
+++ b/sql-ledger/locale/ee/ic
@@ -0,0 +1,208 @@
+$self{texts} = {
+ 'Active' => 'Aktiva',
+ 'Add' => 'Lisa',
+ 'Add Assembly' => 'Lisa komplekt',
+ 'Add Part' => 'Lisa toode',
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Add Service' => 'Lisa teenus',
+ 'Address' => 'Aadress',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Assemblies' => 'Komplektid',
+ 'Assemblies restocked!' => 'Komplektid lattu tagastatud!',
+ 'Assembly Number missing!' => 'Komplekti number puudub!',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'BOM' => 'Materjalide nimekiri',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'Bought' => 'Ostetud',
+ 'COGS' => 'COGS',
+ 'Cannot delete item already invoiced!' => 'Esitatud arvega toodet ei saa kustutada!',
+ 'Cannot delete item on order!' => 'Tellimusega seotud artiklit ei saa kustutada!',
+ 'Cannot delete item which is part of an assembly!' => 'Komplekti kuuluvat toodet ei saa kustutada!',
+ 'Cannot delete item!' => 'Toodet ei saa kustutada!',
+ 'Cannot stock assemblies!' => 'Komplekte ei saa lattu võtta',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Description' => 'Selgitus',
+ 'Drawing' => 'Pildid',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Edit Assembly' => 'Muuda Komplekti',
+ 'Edit Part' => 'Toote redigeerimine',
+ 'Edit Service' => 'Teenuse muutmine',
+ 'Expense' => 'Kulu',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'Image' => 'Pilt',
+ 'In-line' => 'Dokumendisisene',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Income' => 'Tulu',
+ 'Individual Items' => 'Komponendid',
+ 'Inventory' => 'Ladu',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Enne komplekti aegunuks märkimist peab laoseis null olema!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Enne toote aegunuks märkimist peab laoseis null olema!',
+ 'Inventory quantity must be zero!' => 'Laoseis peab null olema!',
+ 'Invoice' => 'Arve',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Item deleted!' => 'Toode kustutatud!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Last Cost' => 'Viimane ostuhind',
+ 'Line Total' => 'Rea summa',
+ 'Link Accounts' => 'Seosta kontod',
+ 'List Price' => 'Hinnakirja hind',
+ 'Make' => 'Tootja',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Mudel',
+ 'Name' => 'Nimi',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'Obsolete' => 'Aegunud',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'On Hand' => 'Laos',
+ 'On Order' => 'Tellimisel',
+ 'Order' => 'Tellimus',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Number' => 'Tellimuse number',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'Ordered' => 'Tellitud',
+ 'Orphaned' => 'Seosteta',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Part' => 'Toode',
+ 'Part Number missing!' => 'Toote kood puudub',
+ 'Parts' => 'Tooted',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hind',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Qty' => 'Kogus',
+ 'ROP' => 'TM',
+ 'Recd' => 'Saabunud',
+ 'Required by' => 'Tarneaeg',
+ 'Sales' => 'Müük',
+ 'Sales Order' => 'Müügitellimus',
+ 'Save' => 'Salvesta',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sell Price' => 'Müügihind',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Service Number missing!' => 'teenuse kood puudub!',
+ 'Services' => 'Teenused',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Short' => 'Lühike',
+ 'Sold' => 'Müüdud',
+ 'Stock Assembly' => 'Komplekti lattu võtmine',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax' => 'Maks',
+ 'To' => 'Kuhu',
+ 'Top Level' => 'Ülemine tase',
+ 'Total' => 'Kokku',
+ 'Unit' => 'Ühik',
+ 'Unit of measure' => 'Mõõtühik',
+ 'Update' => 'Uuenda',
+ 'Updated' => 'Uuendatud',
+ 'Weight' => 'Kaal',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'ea' => 'tk',
+ 'emailed to' => 'salvestatud aadressile',
+ 'hr' => 't',
+ 'sent to printer' => 'printerile saadetud',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'lisa' => 'add',
+ 'lisa_komplekt' => 'add_assembly',
+ 'lisa_toode' => 'add_part',
+ 'lisa_teenus' => 'add_service',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'muuda_komplekti' => 'edit_assembly',
+ 'toote_redigeerimine' => 'edit_part',
+ 'teenuse_muutmine' => 'edit_service',
+ 'salvesta' => 'save',
+ 'uuenda' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/io b/sql-ledger/locale/ee/io
new file mode 100644
index 000000000..ccf21af69
--- /dev/null
+++ b/sql-ledger/locale/ee/io
@@ -0,0 +1,108 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Address' => 'Aadress',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Description' => 'Selgitus',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Dokumendisisene',
+ 'Invoice' => 'Arve',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Name' => 'Nimi',
+ 'No.' => 'Nr.',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Order' => 'Tellimus',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Part' => 'Toode',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hind',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Qty' => 'Kogus',
+ 'Recd' => 'Saabunud',
+ 'Required by' => 'Tarneaeg',
+ 'Sales Order' => 'Müügitellimus',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Subject' => 'Pealkiri',
+ 'To' => 'Kuhu',
+ 'Unit' => 'Ühik',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'emailed to' => 'salvestatud aadressile',
+ 'sent to printer' => 'printerile saadetud',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'edasi' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/ir b/sql-ledger/locale/ee/ir
new file mode 100644
index 000000000..0606a4283
--- /dev/null
+++ b/sql-ledger/locale/ee/ir
@@ -0,0 +1,180 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Invoice Number' => 'Kas oled kindel, et soovid kustutada arve',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'Cannot delete invoice!' => 'Arvet ei saa kustutada',
+ 'Cannot post invoice for a closed period!' => 'Arvet ei saa salvestada suletud perioodile!',
+ 'Cannot post invoice!' => 'Arvet ei saa saata!',
+ 'Cannot post payment for a closed period!' => 'Makset ei saa salvestada suletud perioodile',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Kinnita!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Currency' => 'Valuuta',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Description' => 'Selgitus',
+ 'Due Date' => 'Maksetähtaeg',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Edit Vendor Invoice' => 'Edit Vendor Invoice',
+ 'Exch' => 'Kurss',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate for payment missing!' => 'Maksel ei ole valuutakurssi!',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Dokumendisisene',
+ 'Invoice' => 'Arve',
+ 'Invoice Date' => 'Arve kuupäev',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Invoice deleted!' => 'Arve kustutatud!',
+ 'Invoice posted!' => 'Arve salvestatud!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Name' => 'Nimi',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Order' => 'Tellimus',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Number' => 'Tellimuse number',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Part' => 'Toode',
+ 'Payment date missing!' => 'Maksekuupäev puudub',
+ 'Payments' => 'Maksed',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hind',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Qty' => 'Kogus',
+ 'Recd' => 'Saabunud',
+ 'Record in' => 'Sihtkonto',
+ 'Required by' => 'Tarneaeg',
+ 'Sales Order' => 'Müügitellimus',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Source' => 'Allikas',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax Included' => 'Koos maksuga',
+ 'To' => 'Kuhu',
+ 'Total' => 'Kokku',
+ 'Unit' => 'Ühik',
+ 'Update' => 'Uuenda',
+ 'Vendor' => 'Hankija',
+ 'Vendor missing!' => 'Hankija puudub!',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'Yes' => 'Jah',
+ 'ea' => 'tk',
+ 'emailed to' => 'salvestatud aadressile',
+ 'sent to printer' => 'printerile saadetud',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'tellimus' => 'order',
+ 'salvesta' => 'post',
+ 'salvesta_uuena' => 'post_as_new',
+ 'uuenda' => 'update',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/is b/sql-ledger/locale/ee/is
new file mode 100644
index 000000000..c380e762e
--- /dev/null
+++ b/sql-ledger/locale/ee/is
@@ -0,0 +1,187 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Invoice' => 'Lisa Müügiarve',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Invoice Number' => 'Kas oled kindel, et soovid kustutada arve',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'Cannot delete invoice!' => 'Arvet ei saa kustutada',
+ 'Cannot post invoice for a closed period!' => 'Arvet ei saa salvestada suletud perioodile!',
+ 'Cannot post invoice!' => 'Arvet ei saa saata!',
+ 'Cannot post payment for a closed period!' => 'Makset ei saa salvestada suletud perioodile',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Kinnita!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Credit Limit' => 'Krediidilimiit',
+ 'Currency' => 'Valuuta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Klienti pole määratud!',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Description' => 'Selgitus',
+ 'Due Date' => 'Maksetähtaeg',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Edit Sales Invoice' => 'Müügiarve muutmine',
+ 'Exch' => 'Kurss',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate for payment missing!' => 'Maksel ei ole valuutakurssi!',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Dokumendisisene',
+ 'Invoice' => 'Arve',
+ 'Invoice Date' => 'Arve kuupäev',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number' => 'Arve number',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Invoice deleted!' => 'Arve kustutatud!',
+ 'Invoice posted!' => 'Arve salvestatud!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Name' => 'Nimi',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Order' => 'Tellimus',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Number' => 'Tellimuse number',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Part' => 'Toode',
+ 'Payment date missing!' => 'Maksekuupäev puudub',
+ 'Payments' => 'Maksed',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Salvesta',
+ 'Post as new' => 'Salvesta uuena',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hind',
+ 'Print' => 'Trüki',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Qty' => 'Kogus',
+ 'Recd' => 'Saabunud',
+ 'Record in' => 'Sihtkonto',
+ 'Remaining' => 'Kasutamata',
+ 'Required by' => 'Tarneaeg',
+ 'Sales Order' => 'Müügitellimus',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Ship via' => 'Tarneviis',
+ 'Source' => 'Allikas',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax Included' => 'Koos maksuga',
+ 'To' => 'Kuhu',
+ 'Total' => 'Kokku',
+ 'Unit' => 'Ühik',
+ 'Update' => 'Uuenda',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'Yes' => 'Jah',
+ 'ea' => 'tk',
+ 'emailed to' => 'salvestatud aadressile',
+ 'sent to printer' => 'printerile saadetud',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'tellimus' => 'order',
+ 'salvesta' => 'post',
+ 'salvesta_uuena' => 'post_as_new',
+ 'trüki' => 'print',
+ 'tarneaadress' => 'ship_to',
+ 'uuenda' => 'update',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/login b/sql-ledger/locale/ee/login
new file mode 100644
index 000000000..18cb05be4
--- /dev/null
+++ b/sql-ledger/locale/ee/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Programmi Info',
+ 'Database Host' => 'Andmebaasiserver',
+ 'Dataset' => 'Andmebaas',
+ 'Incorrect Dataset version!' => 'Vale andmebaasi versioon',
+ 'Incorrect Password!' => 'Vale parool!',
+ 'Licensed to' => 'Kasutaja andmed:',
+ 'Login' => 'Login',
+ 'Name' => 'Nimi',
+ 'Password' => 'Parool',
+ 'User' => 'Kasutaja',
+ 'Version' => 'Versioon',
+ 'You are logged out!' => 'Oled välja loginud!',
+ 'You did not enter a name!' => 'Nimi sisestamata!',
+ 'is not a member!' => 'ei ole kasutaja!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/menu b/sql-ledger/locale/ee/menu
new file mode 100644
index 000000000..7d777370a
--- /dev/null
+++ b/sql-ledger/locale/ee/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Kohustused',
+ 'AP Aging' => 'Võlad',
+ 'AR' => 'Nõuded',
+ 'AR Aging' => 'Võlglased',
+ 'Accounting Menu' => 'Raamatupidamise Menüü',
+ 'Add Account' => 'Lisa konto',
+ 'Add Assembly' => 'Lisa komplekt',
+ 'Add Customer' => 'Lisa klient',
+ 'Add GIFI' => 'Lisa GIFI',
+ 'Add Part' => 'Lisa toode',
+ 'Add Project' => 'Lisa Projekt',
+ 'Add Service' => 'Lisa teenus',
+ 'Add Transaction' => 'Lisa kanne',
+ 'Add Vendor' => 'Lisa hankija',
+ 'Assemblies' => 'Komplektid',
+ 'Audit Control' => 'Audit',
+ 'Backup' => 'Varukoopia',
+ 'Balance Sheet' => 'Bilansitabel',
+ 'Cash' => 'Kassa',
+ 'Chart of Accounts' => 'Kontoplaan',
+ 'Check' => 'T?ekk',
+ 'Customers' => 'Kliendid',
+ 'General Ledger' => 'Pearaamat',
+ 'Goods & Services' => 'Tooted ja teenused',
+ 'HTML Templates' => 'HTML dokumendipõhjad',
+ 'Income Statement' => 'Kasumiaruanne',
+ 'Invoice' => 'Arve',
+ 'LaTeX Templates' => 'LaTeX dokumendipõhjad',
+ 'List Accounts' => 'Kontode nimekiri',
+ 'List GIFI' => 'GIFI nimekiri',
+ 'Logout' => 'Logi välja',
+ 'Order Entry' => 'Tellimuse sisestamine',
+ 'Packing List' => 'Saateleht',
+ 'Parts' => 'Tooted',
+ 'Payment' => 'Maksed',
+ 'Payments' => 'Maksed',
+ 'Preferences' => 'Määrangud',
+ 'Projects' => 'Projektid',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Purchase Orders' => 'Ostutellimused',
+ 'Receipt' => 'Laekumised',
+ 'Receipts' => 'Laekumised',
+ 'Reconciliation' => 'Tasaarveldused',
+ 'Reports' => 'Aruanded',
+ 'Sales Invoice' => 'Müügiarve',
+ 'Sales Order' => 'Müügitellimus',
+ 'Sales Orders' => 'Müügitellimused',
+ 'Save to File' => 'Salvesta faili',
+ 'Send by E-Mail' => 'Saada e-postiga',
+ 'Services' => 'Teenused',
+ 'Statement' => 'Aruanne',
+ 'Stock Assembly' => 'Komplekti lattu võtmine',
+ 'Stylesheet' => 'Laaditabel',
+ 'System' => 'Süsteem',
+ 'Tax collected' => 'Kogutud maksud',
+ 'Tax paid' => 'Makstud makse',
+ 'Transactions' => 'Kanded',
+ 'Trial Balance' => 'Proovibilanss',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendors' => 'Hankijad',
+ 'Version' => 'Versioon',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/oe b/sql-ledger/locale/ee/oe
new file mode 100644
index 000000000..dd5a09b39
--- /dev/null
+++ b/sql-ledger/locale/ee/oe
@@ -0,0 +1,202 @@
+$self{texts} = {
+ 'Add' => 'Lisa',
+ 'Add Purchase Order' => 'Lisa ostutellimus',
+ 'Add Sales Invoice' => 'Lisa Müügiarve',
+ 'Add Sales Order' => 'Lisa müügitellimus',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Aadress',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Are you sure you want to delete Order Number' => 'Kas oled kindel, et soovid kustutada tellimuse',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Kast',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Tellimust ei saa kustutada!',
+ 'Cannot save order!' => 'Arvet ei saa salvestada',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Suletud',
+ 'Confirm!' => 'Kinnita!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Credit Limit' => 'Krediidilimiit',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valuuta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Klienti pole määratud!',
+ 'Customer not on file!' => 'Klienti pole failis!',
+ 'Date' => 'Kuupäev',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Delete' => 'Kustuta',
+ 'Delivery Date' => 'Tarne kuupäev',
+ 'Description' => 'Selgitus',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-maili aadress puudub',
+ 'Edit Purchase Order' => 'Ostutellimuse muutmine',
+ 'Edit Sales Order' => 'Müügitellimuse muutmine',
+ 'Exchangerate' => 'Valuutakurss',
+ 'Exchangerate missing!' => 'Valuutakurssi ei ole',
+ 'Extended' => 'Summa',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'ID' => 'ID',
+ 'In-line' => 'Dokumendisisene',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Invoice' => 'Arve',
+ 'Invoice Date missing!' => 'Arve kuupäev puudub!',
+ 'Invoice Number missing!' => 'Arve number puudub!',
+ 'Item not on file!' => 'Toode puudub andmebaasist!',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'Name' => 'Nimi',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Märkused',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Kood',
+ 'Number missing in Row' => 'Antud real puudub kood',
+ 'O' => 'O',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'Open' => 'Avatud',
+ 'Order' => 'Tellimus',
+ 'Order Date' => 'Tellimuse kuupäev',
+ 'Order Date missing!' => 'Tellimuse kuupäev puudub',
+ 'Order Number' => 'Tellimuse number',
+ 'Order Number missing!' => 'Tellimuse number puudub',
+ 'Order deleted!' => 'Tellimus kustutatud',
+ 'Order saved!' => 'Tellimus salvestatud',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Saateleht',
+ 'Packing List Date missing!' => 'Saatelehe kuupäev puudub',
+ 'Packing List Number missing!' => 'Saatelehe number puudub',
+ 'Part' => 'Toode',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hind',
+ 'Print' => 'Trüki',
+ 'Printer' => 'Printer',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekti pole failis',
+ 'Purchase Order' => 'Ostutellimus',
+ 'Purchase Orders' => 'Ostutellimused',
+ 'Qty' => 'Kogus',
+ 'Recd' => 'Saabunud',
+ 'Remaining' => 'Kasutamata',
+ 'Required by' => 'Tarneaeg',
+ 'Sales Order' => 'Müügitellimus',
+ 'Sales Orders' => 'Müügitellimused',
+ 'Save' => 'Salvesta',
+ 'Save as new' => 'Salvesta uuena',
+ 'Screen' => 'Ekraan',
+ 'Select from one of the items below' => 'Vali üks alltoodud toodetest',
+ 'Select from one of the names below' => 'Vali üks alltoodud nimedest',
+ 'Select from one of the projects below' => 'Vali üks alltoodud projektidest',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Service' => 'Teenus',
+ 'Ship' => 'Tarnimine',
+ 'Ship to' => 'Tarneaadress',
+ 'Ship via' => 'Tarneviis',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax' => 'Maks',
+ 'Tax Included' => 'Koos maksuga',
+ 'Terms: Net' => 'Maksetingimus',
+ 'To' => 'Kuhu',
+ 'Total' => 'Kokku',
+ 'Unit' => 'Ühik',
+ 'Update' => 'Uuenda',
+ 'Vendor' => 'Hankija',
+ 'Vendor missing!' => 'Hankija puudub!',
+ 'Vendor not on file!' => 'Hankijat pole failis!',
+ 'What type of item is this?' => 'Mis tüüpi tootega on tegemist?',
+ 'Yes' => 'Jah',
+ 'days' => 'päeva',
+ 'ea' => 'tk',
+ 'emailed to' => 'salvestatud aadressile',
+ 'sent to printer' => 'printerile saadetud',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'lisa' => 'add',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'arve' => 'invoice',
+ 'trüki' => 'print',
+ 'salvesta' => 'save',
+ 'salvesta_uuena' => 'save_as_new',
+ 'tarneaadress' => 'ship_to',
+ 'uuenda' => 'update',
+ 'jah' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/pe b/sql-ledger/locale/ee/pe
new file mode 100644
index 000000000..7ce38153f
--- /dev/null
+++ b/sql-ledger/locale/ee/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Lisa',
+ 'Add Project' => 'Lisa Projekt',
+ 'All' => 'Kõik',
+ 'Continue' => 'Edasi',
+ 'Delete' => 'Kustuta',
+ 'Description' => 'Selgitus',
+ 'Edit Project' => 'Muuda Projekti',
+ 'Number' => 'Kood',
+ 'Orphaned' => 'Seosteta',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projekti number puudub',
+ 'Project deleted!' => 'Projekt kustutatud',
+ 'Project saved!' => 'Projekt salvestatud',
+ 'Projects' => 'Projektid',
+ 'Save' => 'Salvesta',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'lisa' => 'add',
+ 'edasi' => 'continue',
+ 'kustuta' => 'delete',
+ 'salvesta' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/rc b/sql-ledger/locale/ee/rc
new file mode 100644
index 000000000..af52fdeb4
--- /dev/null
+++ b/sql-ledger/locale/ee/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Bilanss',
+ 'Cleared Balance' => 'Puhastatud bilanss',
+ 'Continue' => 'Edasi',
+ 'Date' => 'Kuupäev',
+ 'Deposit' => 'Tarnimata',
+ 'Description' => 'Selgitus',
+ 'Difference' => 'Vahe',
+ 'Done' => 'Teostatud',
+ 'Exchangerate Difference' => 'Valuutakursi muutus',
+ 'From' => 'Alates',
+ 'Out of balance!' => 'Bilanss ei klapi!',
+ 'Payment' => 'Maksed',
+ 'Reconciliation' => 'Tasaarveldused',
+ 'Select all' => 'Vali kõik',
+ 'Source' => 'Allikas',
+ 'Statement Balance' => 'Bilansiaruanne',
+ 'Update' => 'Uuenda',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'edasi' => 'continue',
+ 'teostatud' => 'done',
+ 'vali_kõik' => 'select_all',
+ 'uuenda' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ee/rp b/sql-ledger/locale/ee/rp
new file mode 100644
index 000000000..9d0e6bc1e
--- /dev/null
+++ b/sql-ledger/locale/ee/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Võlad',
+ 'AR Aging' => 'Võlglased',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Kontod',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprill',
+ 'Attachment' => 'Kaasatud fail',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Bilanss',
+ 'Balance Sheet' => 'Bilansitabel',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Kassapõhine',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Võrdlus perioodiga',
+ 'Continue' => 'Edasi',
+ 'Copies' => 'koopiat',
+ 'Credit' => 'Kreedit',
+ 'Current' => 'Praegune',
+ 'Customer' => 'Klient',
+ 'Date' => 'Kuupäev',
+ 'Debit' => 'Deebet',
+ 'Dec' => 'Dets',
+ 'December' => 'Detsember',
+ 'Decimalplaces' => 'Komakohti',
+ 'Department' => 'Osakond',
+ 'Description' => 'Selgitus',
+ 'Due' => 'Tasuda',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail teatis',
+ 'Feb' => 'Veebr',
+ 'February' => 'Veebruar',
+ 'From' => 'Alates',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Päis',
+ 'ID' => 'ID',
+ 'In-line' => 'Dokumendisisene',
+ 'Include in Report' => 'Kaasa aruandesse',
+ 'Income Statement' => 'Kasumiaruanne',
+ 'Invoice' => 'Arve',
+ 'Jan' => 'Jaan',
+ 'January' => 'Jaanuar',
+ 'Jul' => 'Juul',
+ 'July' => 'Juuli',
+ 'Jun' => 'Juun',
+ 'June' => 'Juuni',
+ 'Mar' => 'Mär',
+ 'March' => 'Märts',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Teade',
+ 'N/A' => 'Puudub',
+ 'Nothing selected!' => 'Midagi ei ole valitud',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktoober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Maksed',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Trüki',
+ 'Printer' => 'Printer',
+ 'Project Number' => 'Projekti number',
+ 'Receipts' => 'Laekumised',
+ 'Report for' => 'Aruanne',
+ 'Retained Earnings' => 'Jaotamata kasum',
+ 'Screen' => 'Ekraan',
+ 'Select all' => 'Vali kõik',
+ 'Select postscript or PDF!' => 'Vali kas postscript või PDF',
+ 'Sep' => 'Sept',
+ 'September' => 'September',
+ 'Source' => 'Allikas',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Aruanne',
+ 'Statement sent to' => 'Saata aruanne aadressil',
+ 'Statements sent to printer!' => 'Saata aruanne printerile',
+ 'Subject' => 'Pealkiri',
+ 'Subtotal' => 'Vahesumma',
+ 'Tax' => 'Maks',
+ 'Tax collected' => 'Kogutud maksud',
+ 'Tax paid' => 'Makstud makse',
+ 'Total' => 'Kokku',
+ 'Trial Balance' => 'Proovibilanss',
+ 'Vendor' => 'Hankija',
+ 'as at' => 'Seisuga',
+ 'collected on sales' => 'kogutud müügilt',
+ 'for Period' => 'Periood',
+ 'paid on purchases' => 'makstud ostudelt',
+ 'to' => 'kuni',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'edasi' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'trüki' => 'print',
+ 'vali_kõik' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/COPYING b/sql-ledger/locale/en_GB/COPYING
new file mode 100644
index 000000000..ceaa769da
--- /dev/null
+++ b/sql-ledger/locale/en_GB/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# British English texts:
+#
+# Author:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/en_GB/LANGUAGE b/sql-ledger/locale/en_GB/LANGUAGE
new file mode 100644
index 000000000..bed69f729
--- /dev/null
+++ b/sql-ledger/locale/en_GB/LANGUAGE
@@ -0,0 +1 @@
+British English
diff --git a/sql-ledger/locale/en_GB/admin b/sql-ledger/locale/en_GB/admin
new file mode 100644
index 000000000..580d1c6a4
--- /dev/null
+++ b/sql-ledger/locale/en_GB/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Access Control',
+ 'Accounting' => 'Accounting',
+ 'Add User' => 'Add User',
+ 'Address' => 'Address',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Change Admin Password' => 'Change Admin Password',
+ 'Change Password' => 'Change Password',
+ 'Character Set' => 'Character Set',
+ 'Click on login name to edit!' => 'Click on login name to edit!',
+ 'Company' => 'Company',
+ 'Connect to' => 'Connect to',
+ 'Continue' => 'Continue',
+ 'Create Chart of Accounts' => 'Create Chart of Accounts',
+ 'Create Dataset' => 'Create Dataset',
+ 'DBI not installed!' => 'DBI not installed!',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Database Administration',
+ 'Database Driver not checked!' => 'Database Driver not checked!',
+ 'Database User missing!' => 'Database User missing!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset missing!',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Date Format',
+ 'Delete' => 'Delete',
+ 'Delete Dataset' => 'Delete Dataset',
+ 'Directory' => 'Directory',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Edit User',
+ 'Existing Datasets' => 'Existing Datasets',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Hostname missing!',
+ 'Incorrect Password!' => 'Incorrect Password!',
+ 'Language' => 'Language',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Leave host and port field empty unless you want to make a remote connection.',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Multibyte Encoding',
+ 'Name' => 'Name',
+ 'New Templates' => 'New Templates',
+ 'No Database Drivers available!' => 'No Database Drivers available!',
+ 'No Dataset selected!' => 'No Dataset selected!',
+ 'Nothing to delete!' => 'Nothing to delete!',
+ 'Number Format' => 'Number Format',
+ 'Oracle Database Administration' => 'Oracle Database Administration',
+ 'Password' => 'Password',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Pg Database Administration',
+ 'Phone' => 'Phone',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port missing!',
+ 'Printer' => 'Printer',
+ 'Save' => 'Save',
+ 'Select a Dataset to delete and press "Continue"' => 'Select a Dataset to delete and press "Continue"',
+ 'Setup Templates' => 'Setup Templates',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Signature',
+ 'Stylesheet' => 'Stylesheet',
+ 'Templates' => 'Templates',
+ 'The following Datasets are not in use and can be deleted' => 'The following Datasets are not in use and can be deleted',
+ 'The following Datasets need to be updated' => 'The following Datasets need to be updated',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.',
+ 'Update Dataset' => 'Update Dataset',
+ 'Use Templates' => 'Use Templates',
+ 'User' => 'User',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Version',
+ 'You must enter a host and port for local and remote connections!' => 'You must enter a host and port for local and remote connections!',
+ 'does not exist' => 'does not exist',
+ 'is already a member!' => 'is already a member!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'locked!',
+ 'successfully created!' => 'successfully created!',
+ 'successfully deleted!' => 'successfully deleted!',
+ 'website' => 'website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'add_user' => 'add_user',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'login' => 'login',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/all b/sql-ledger/locale/en_GB/all
new file mode 100644
index 000000000..e45542a0c
--- /dev/null
+++ b/sql-ledger/locale/en_GB/all
@@ -0,0 +1,499 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Purchases',
+ 'AP Aging' => 'Creditor Aging',
+ 'AP Transaction' => 'Purchase Transaction',
+ 'AP Transactions' => 'Purchase Transactions',
+ 'AR' => 'Sales',
+ 'AR Aging' => 'Debtor Aging',
+ 'AR Transaction' => 'Sales Transaction',
+ 'AR Transactions' => 'Sales Transactions',
+ 'About' => '',
+ 'Access Control' => '',
+ 'Account' => '',
+ 'Account Number' => '',
+ 'Account Number missing!' => '',
+ 'Account Type' => '',
+ 'Account Type missing!' => '',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => '',
+ 'Accounting Menu' => '',
+ 'Accounts' => '',
+ 'Active' => '',
+ 'Add' => '',
+ 'Add Account' => '',
+ 'Add Accounts Payables Transaction' => 'Add Purchase Transaction',
+ 'Add Accounts Receivables Transaction' => 'Add Sales Transaction',
+ 'Add Assembly' => '',
+ 'Add Customer' => '',
+ 'Add GIFI' => '',
+ 'Add General Ledger Transaction' => '',
+ 'Add Group' => '',
+ 'Add Part' => '',
+ 'Add Project' => '',
+ 'Add Purchase Order' => '',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => '',
+ 'Add Service' => '',
+ 'Add Transaction' => '',
+ 'Add User' => '',
+ 'Add Vendor' => '',
+ 'Add Vendor Invoice' => '',
+ 'Address' => '',
+ 'Administration' => '',
+ 'Administrator' => '',
+ 'All' => '',
+ 'All Datasets up to date!' => '',
+ 'Amount' => '',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => '',
+ 'April' => '',
+ 'Are you sure you want to delete Invoice Number' => '',
+ 'Are you sure you want to delete Order Number' => '',
+ 'Are you sure you want to delete Transaction' => '',
+ 'Assemblies' => '',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => '',
+ 'Asset' => '',
+ 'Attachment' => '',
+ 'Audit Control' => '',
+ 'Aug' => '',
+ 'August' => '',
+ 'BOM' => '',
+ 'Backup' => '',
+ 'Backup sent to' => '',
+ 'Balance' => '',
+ 'Balance Sheet' => '',
+ 'Bcc' => '',
+ 'Bin' => '',
+ 'Books are open' => '',
+ 'Bought' => '',
+ 'Business Number' => '',
+ 'C' => '',
+ 'COGS' => '',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => '',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => '',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => '',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => '',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => '',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => '',
+ 'Change Password' => '',
+ 'Character Set' => '',
+ 'Chart of Accounts' => '',
+ 'Check' => 'Cheque',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => '',
+ 'Close Books up to' => '',
+ 'Closed' => '',
+ 'Company' => '',
+ 'Compare to' => '',
+ 'Confirm!' => '',
+ 'Connect to' => '',
+ 'Contact' => '',
+ 'Continue' => '',
+ 'Copies' => '',
+ 'Copy to COA' => '',
+ 'Create Chart of Accounts' => '',
+ 'Create Dataset' => '',
+ 'Credit' => '',
+ 'Credit Limit' => '',
+ 'Curr' => '',
+ 'Currency' => '',
+ 'Current' => '',
+ 'Customer' => '',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => '',
+ 'Database' => '',
+ 'Database Administration' => '',
+ 'Database Driver not checked!' => '',
+ 'Database Host' => '',
+ 'Database User missing!' => '',
+ 'Dataset' => '',
+ 'Dataset missing!' => '',
+ 'Dataset updated!' => '',
+ 'Date' => '',
+ 'Date Format' => '',
+ 'Date Paid' => '',
+ 'Date missing!' => '',
+ 'Debit' => '',
+ 'Debit and credit out of balance!' => '',
+ 'Dec' => '',
+ 'December' => '',
+ 'Decimalplaces' => '',
+ 'Delete' => '',
+ 'Delete Account' => '',
+ 'Delete Dataset' => '',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => '',
+ 'Difference' => '',
+ 'Directory' => '',
+ 'Discount' => '',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => '',
+ 'Dropdown Limit' => '',
+ 'Due' => '',
+ 'Due Date' => '',
+ 'Due Date missing!' => '',
+ 'E-mail' => '',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => '',
+ 'Edit' => '',
+ 'Edit Account' => '',
+ 'Edit Accounts Payables Transaction' => 'Edit Creditor Transaction',
+ 'Edit Accounts Receivables Transaction' => 'Edit Debtor Transaction',
+ 'Edit Assembly' => '',
+ 'Edit Customer' => '',
+ 'Edit GIFI' => '',
+ 'Edit General Ledger Transaction' => '',
+ 'Edit Group' => '',
+ 'Edit Part' => '',
+ 'Edit Preferences for' => '',
+ 'Edit Project' => '',
+ 'Edit Purchase Order' => '',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => '',
+ 'Edit Service' => '',
+ 'Edit Template' => '',
+ 'Edit User' => '',
+ 'Edit Vendor' => '',
+ 'Edit Vendor Invoice' => '',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => '',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '',
+ 'Equity' => '',
+ 'Exch' => '',
+ 'Exchangerate' => '',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => '',
+ 'Exchangerate missing!' => '',
+ 'Existing Datasets' => '',
+ 'Expense' => '',
+ 'Expense Account' => '',
+ 'Expense/Asset' => '',
+ 'Extended' => '',
+ 'Fax' => '',
+ 'Feb' => '',
+ 'February' => '',
+ 'Foreign Exchange Gain' => '',
+ 'Foreign Exchange Loss' => '',
+ 'From' => '',
+ 'GIFI' => '',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => '',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => '',
+ 'Goods & Services' => '',
+ 'Group' => '',
+ 'Group Items' => '',
+ 'Group deleted!' => '',
+ 'Group missing!' => '',
+ 'Group saved!' => '',
+ 'Groups' => '',
+ 'HTML Templates' => '',
+ 'Heading' => '',
+ 'Host' => '',
+ 'Hostname missing!' => '',
+ 'ID' => '',
+ 'Image' => '',
+ 'In-line' => '',
+ 'Include in Report' => '',
+ 'Include in drop-down menus' => '',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Include this account on debtor/creditor forms to set debtor/creditor taxable?',
+ 'Income' => 'Revenue',
+ 'Income Account' => 'Revenue Account',
+ 'Income Statement' => '',
+ 'Incorrect Dataset version!' => '',
+ 'Incorrect Password!' => '',
+ 'Individual Items' => '',
+ 'Inventory' => '',
+ 'Inventory Account' => '',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => '',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => '',
+ 'Invoice' => '',
+ 'Invoice Date' => '',
+ 'Invoice Date missing!' => '',
+ 'Invoice Number' => '',
+ 'Invoice Number missing!' => '',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => '',
+ 'Item deleted!' => '',
+ 'Item not on file!' => '',
+ 'Jan' => '',
+ 'January' => '',
+ 'Jul' => '',
+ 'July' => '',
+ 'Jun' => '',
+ 'June' => '',
+ 'LaTeX Templates' => '',
+ 'Language' => '',
+ 'Last Cost' => '',
+ 'Last Invoice Number' => '',
+ 'Last Numbers & Default Accounts' => '',
+ 'Last Purchase Order Number' => '',
+ 'Last Sales Order Number' => '',
+ 'Leave host and port field empty unless you want to make a remote connection.' => '',
+ 'Liability' => '',
+ 'Licensed to' => '',
+ 'Line Total' => '',
+ 'Link' => '',
+ 'Link Accounts' => '',
+ 'List Accounts' => '',
+ 'List GIFI' => '',
+ 'List Price' => '',
+ 'List Transactions' => '',
+ 'Login' => '',
+ 'Logout' => '',
+ 'Make' => '',
+ 'Mar' => '',
+ 'March' => '',
+ 'May' => '',
+ 'May ' => '',
+ 'Message' => '',
+ 'Microfiche' => '',
+ 'Model' => '',
+ 'Multibyte Encoding' => '',
+ 'N/A' => '',
+ 'Name' => '',
+ 'Name missing!' => '',
+ 'New Templates' => '',
+ 'No' => '',
+ 'No Database Drivers available!' => '',
+ 'No Dataset selected!' => '',
+ 'No email address for' => '',
+ 'No.' => '',
+ 'Notes' => '',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => '',
+ 'Nov' => '',
+ 'November' => '',
+ 'Number' => '',
+ 'Number Format' => '',
+ 'Number missing in Row' => '',
+ 'O' => '',
+ 'Obsolete' => '',
+ 'Oct' => '',
+ 'October' => '',
+ 'On Hand' => '',
+ 'On Order' => '',
+ 'Open' => '',
+ 'Oracle Database Administration' => '',
+ 'Order' => '',
+ 'Order Date' => '',
+ 'Order Date missing!' => '',
+ 'Order Entry' => '',
+ 'Order Number' => '',
+ 'Order Number missing!' => '',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => '',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => '',
+ 'Packing List Date missing!' => '',
+ 'Packing List Number missing!' => '',
+ 'Paid' => '',
+ 'Paid in full' => '',
+ 'Part' => '',
+ 'Part Number missing!' => '',
+ 'Parts' => '',
+ 'Parts Inventory' => '',
+ 'Password' => '',
+ 'Password changed!' => '',
+ 'Payables' => '',
+ 'Payment' => '',
+ 'Payment date missing!' => '',
+ 'Payment posted!' => '',
+ 'Payments' => '',
+ 'Pg Database Administration' => '',
+ 'Phone' => '',
+ 'Port' => '',
+ 'Port missing!' => '',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => '',
+ 'Preferences saved!' => '',
+ 'Price' => '',
+ 'Print' => '',
+ 'Printer' => '',
+ 'Project' => '',
+ 'Project Number' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Order' => '',
+ 'Purchase Orders' => '',
+ 'Qty' => '',
+ 'ROP' => '',
+ 'Rate' => '',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => '',
+ 'Receivables' => '',
+ 'Reconciliation' => '',
+ 'Record in' => '',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => '',
+ 'Report for' => '',
+ 'Reports' => '',
+ 'Required by' => '',
+ 'Retained Earnings' => '',
+ 'Sales' => '',
+ 'Sales Invoice' => '',
+ 'Sales Order' => '',
+ 'Sales Orders' => '',
+ 'Salesperson' => '',
+ 'Save' => '',
+ 'Save as new' => '',
+ 'Save to File' => '',
+ 'Screen' => '',
+ 'Select a Dataset to delete and press "Continue"' => '',
+ 'Select all' => '',
+ 'Select from one of the items below' => '',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => '',
+ 'Send by E-Mail' => '',
+ 'Sep' => '',
+ 'September' => '',
+ 'Service' => '',
+ 'Service Items' => '',
+ 'Service Number missing!' => '',
+ 'Services' => '',
+ 'Setup Templates' => '',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => '',
+ 'Signature' => '',
+ 'Sold' => '',
+ 'Source' => '',
+ 'Standard' => '',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock' => '',
+ 'Stock Assembly' => '',
+ 'Stylesheet' => '',
+ 'Subject' => '',
+ 'Subtotal' => '',
+ 'System' => '',
+ 'Tax' => '',
+ 'Tax Accounts' => '',
+ 'Tax Included' => '',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => '',
+ 'Template saved!' => '',
+ 'Templates' => '',
+ 'Terms: Net' => '',
+ 'The following Datasets are not in use and can be deleted' => '',
+ 'The following Datasets need to be updated' => '',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => '',
+ 'To' => '',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '',
+ 'Top Level' => '',
+ 'Total' => '',
+ 'Transaction Date missing!' => '',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => '',
+ 'Transaction reversal enforced up to' => '',
+ 'Transactions' => '',
+ 'Transactions exist, cannot delete customer!' => '',
+ 'Transactions exist, cannot delete vendor!' => '',
+ 'Transactions exist; cannot delete account!' => '',
+ 'Trial Balance' => '',
+ 'Unit' => '',
+ 'Unit of measure' => '',
+ 'Update' => '',
+ 'Update Dataset' => '',
+ 'Updated' => '',
+ 'Use Templates' => '',
+ 'User' => '',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => '',
+ 'Vendor Invoice' => '',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => '',
+ 'Weight' => '',
+ 'Weight Unit' => '',
+ 'What type of item is this?' => '',
+ 'Year End' => '',
+ 'Yes' => '',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => '',
+ 'You must enter a host and port for local and remote connections!' => '',
+ 'as at' => '',
+ 'collected on sales' => '',
+ 'days' => '',
+ 'does not exist' => '',
+ 'ea' => '',
+ 'emailed to' => '',
+ 'for Period' => '',
+ 'hr' => '',
+ 'is already a member!' => '',
+ 'is not a member!' => '',
+ 'localhost' => '',
+ 'locked!' => '',
+ 'paid on purchases' => '',
+ 'sent to printer' => '',
+ 'successfully created!' => '',
+ 'successfully deleted!' => '',
+ 'to' => '',
+ 'website' => '',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/am b/sql-ledger/locale/en_GB/am
new file mode 100644
index 000000000..6e322ca2c
--- /dev/null
+++ b/sql-ledger/locale/en_GB/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Purchases',
+ 'AR' => 'Sales',
+ 'Account' => 'Account',
+ 'Account Number' => 'Account Number',
+ 'Account Number missing!' => 'Account Number missing!',
+ 'Account Type' => 'Account Type',
+ 'Account Type missing!' => 'Account Type missing!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Add Account',
+ 'Add GIFI' => 'Add GIFI',
+ 'Address' => 'Address',
+ 'Asset' => 'Asset',
+ 'Audit Control' => 'Audit Control',
+ 'Backup sent to' => 'Backup sent to',
+ 'Books are open' => 'Books are open',
+ 'Business Number' => 'Business Number',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'Cannot delete default account!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Character Set',
+ 'Chart of Accounts' => 'Chart of Accounts',
+ 'Close Books up to' => 'Close Books up to',
+ 'Company' => 'Company',
+ 'Continue' => 'Continue',
+ 'Copy to COA' => 'Copy to COA',
+ 'Credit' => 'Credit',
+ 'Date Format' => 'Date Format',
+ 'Debit' => 'Debit',
+ 'Delete' => 'Delete',
+ 'Delete Account' => 'Delete Account',
+ 'Description' => 'Description',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Edit Account',
+ 'Edit GIFI' => 'Edit GIFI',
+ 'Edit Preferences for' => 'Edit Preferences for',
+ 'Edit Template' => 'Edit Template',
+ 'Enforce transaction reversal for all dates' => 'Enforce transaction reversal for all dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies',
+ 'Equity' => 'Equity',
+ 'Expense' => 'Expense',
+ 'Expense Account' => 'Expense Account',
+ 'Expense/Asset' => 'Expense/Asset',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Foreign Exchange Gain',
+ 'Foreign Exchange Loss' => 'Foreign Exchange Loss',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'GIFI missing!',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Heading',
+ 'Include in drop-down menus' => 'Include in drop-down menus',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Include this account on debtor/creditor forms to set debtor/creditor taxable?',
+ 'Income' => 'Revenue',
+ 'Income Account' => 'Revenue Account',
+ 'Inventory' => 'Inventory',
+ 'Inventory Account' => 'Inventory Account',
+ 'Is this a summary account to record' => 'Is this a summary account to record',
+ 'Language' => 'Language',
+ 'Last Invoice Number' => 'Last Invoice Number',
+ 'Last Numbers & Default Accounts' => 'Last Numbers & Default Accounts',
+ 'Last Purchase Order Number' => 'Last Purchase Order Number',
+ 'Last Sales Order Number' => 'Last Sales Order Number',
+ 'Liability' => 'Liability',
+ 'Link' => 'Link',
+ 'Name' => 'Name',
+ 'No' => 'No',
+ 'No email address for' => 'No email address for',
+ 'Number' => 'Number',
+ 'Number Format' => 'Number Format',
+ 'Parts Inventory' => 'Parts Inventory',
+ 'Password' => 'Password',
+ 'Payables' => 'Payables',
+ 'Payment' => 'Payment',
+ 'Phone' => 'Phone',
+ 'Preferences saved!' => 'Preferences saved!',
+ 'Rate' => 'Rate',
+ 'Receivables' => 'Receivables',
+ 'Sales' => 'Sales',
+ 'Save' => 'Save',
+ 'Service Items' => 'Service Items',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Signature',
+ 'Stylesheet' => 'Stylesheet',
+ 'Tax' => 'Tax',
+ 'Tax Accounts' => 'Tax Accounts',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Transaction reversal enforced for all dates',
+ 'Transaction reversal enforced up to' => 'Transaction reversal enforced up to',
+ 'Transactions exist; cannot delete account!' => 'Transactions exist; cannot delete account!',
+ 'Weight Unit' => 'Weight Unit',
+ 'Year End' => 'Year End',
+ 'Yes' => 'Yes',
+ 'does not exist' => 'does not exist',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'add_account' => 'add_account',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'edit_account' => 'edit_account',
+ 'save' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ap b/sql-ledger/locale/en_GB/ap
new file mode 100644
index 000000000..4cad8780e
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Purchase Transaction',
+ 'AP Transactions' => 'Purchase Transactions',
+ 'Account' => 'Account',
+ 'Add Accounts Payables Transaction' => 'Add Purchase Transaction',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Are you sure you want to delete Transaction',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Confirm!',
+ 'Continue' => 'Continue',
+ 'Currency' => 'Currency',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Date Paid' => 'Date Paid',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Description' => 'Description',
+ 'Due Date' => 'Due Date',
+ 'Due Date missing!' => 'Due Date missing!',
+ 'Edit Accounts Payables Transaction' => 'Edit Creditor Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Exch',
+ 'Exchangerate' => 'Exchangerate',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Include in Report',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date' => 'Invoice Date',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number' => 'Invoice Number',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Open' => 'Open',
+ 'Order' => 'Order',
+ 'Order Number' => 'Order Number',
+ 'Paid' => 'Paid',
+ 'Payment date missing!' => 'Payment date missing!',
+ 'Payments' => 'Payments',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Tax',
+ 'Tax Included' => 'Tax Included',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Vendor',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Yes',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'purchase_transaction' => 'ap_transaction',
+ 'add_purchase_transaction' => 'add_accounts_payables_transaction',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit_creditor_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ar b/sql-ledger/locale/en_GB/ar
new file mode 100644
index 000000000..926d80adc
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Sales Transaction',
+ 'AR Transactions' => 'Sales Transactions',
+ 'Account' => 'Account',
+ 'Add Accounts Receivables Transaction' => 'Add Sales Transaction',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Are you sure you want to delete Transaction',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Confirm!',
+ 'Continue' => 'Continue',
+ 'Credit Limit' => 'Credit Limit',
+ 'Currency' => 'Currency',
+ 'Customer' => 'Customer',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Date Paid' => 'Date Paid',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Description' => 'Description',
+ 'Due Date' => 'Due Date',
+ 'Due Date missing!' => 'Due Date missing!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Debtor Transaction',
+ 'Exch' => 'Exch',
+ 'Exchangerate' => 'Exchangerate',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Include in Report',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date' => 'Invoice Date',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number' => 'Invoice Number',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Open' => 'Open',
+ 'Order' => 'Order',
+ 'Order Number' => 'Order Number',
+ 'Paid' => 'Paid',
+ 'Payment date missing!' => 'Payment date missing!',
+ 'Payments' => 'Payments',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Remaining',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Tax',
+ 'Tax Included' => 'Tax Included',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Yes',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'sales_transaction' => 'ar_transaction',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/arap b/sql-ledger/locale/en_GB/arap
new file mode 100644
index 000000000..fe711dd27
--- /dev/null
+++ b/sql-ledger/locale/en_GB/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Address',
+ 'Continue' => 'Continue',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Description',
+ 'Number' => 'Number',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'continue' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/bp b/sql-ledger/locale/en_GB/bp
new file mode 100644
index 000000000..fa9e3475a
--- /dev/null
+++ b/sql-ledger/locale/en_GB/bp
@@ -0,0 +1,54 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Are you sure you want to remove the marked entries from the queue?' => 'Are you sure you want to remove the marked entries from the queue?',
+ 'Cannot remove files!' => 'Cannot remove files!',
+ 'Checks' => 'Cheques',
+ 'Confirm!' => 'Confirm!',
+ 'Continue' => 'Continue',
+ 'Customer' => 'Debtor',
+ 'Date' => 'Date',
+ 'From' => 'From',
+ 'Invoice' => 'Invoice',
+ 'Invoice Number' => 'Invoice Number',
+ 'Marked entries printed!' => 'Marked entries printed!',
+ 'Order' => 'Order',
+ 'Order Number' => 'Order Number',
+ 'Packing Lists' => 'Packing Lists',
+ 'Print' => 'Print',
+ 'Printing ... ' => 'Printing ... ',
+ 'Purchase Orders' => 'Purchase Orders',
+ 'Quotation' => 'Quotation',
+ 'Quotation Number' => 'Quotation Number',
+ 'Quotations' => 'Quotations',
+ 'RFQs' => 'RFQs',
+ 'Receipts' => 'Receipts',
+ 'Reference' => 'Reference',
+ 'Remove' => 'Remove',
+ 'Removed spoolfiles!' => 'Removed spoolfiles!',
+ 'Removing marked entries from queue ...' => 'Removing marked entries from queue ...',
+ 'Sales Invoices' => 'Sales Invoices',
+ 'Sales Orders' => 'Sales Orders',
+ 'Select all' => 'Select all',
+ 'Spoolfile' => 'Spoolfile',
+ 'To' => 'To',
+ 'Vendor' => 'Creditor',
+ 'Yes' => 'Yes',
+ 'done' => 'done',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'list_spool' => 'list_spool',
+ 'print' => 'print',
+ 'remove' => 'remove',
+ 'search' => 'search',
+ 'select_all' => 'select_all',
+ 'yes' => 'yes',
+ 'continue' => 'continue',
+ 'print' => 'print',
+ 'remove' => 'remove',
+ 'select_all' => 'select_all',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ca b/sql-ledger/locale/en_GB/ca
new file mode 100644
index 000000000..ed5ddc227
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Chart of Accounts',
+ 'Credit' => 'Credit',
+ 'Date' => 'Date',
+ 'Debit' => 'Debit',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Description' => 'Description',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Include in Report',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'List Transactions' => 'List Transactions',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Subtotal' => 'Subtotal',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'list_transactions' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/cp b/sql-ledger/locale/en_GB/cp
new file mode 100644
index 000000000..fd0ade6c0
--- /dev/null
+++ b/sql-ledger/locale/en_GB/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Continue',
+ 'Currency' => 'Currency',
+ 'Customer' => 'Customer',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Description',
+ 'Due' => 'Due',
+ 'Exchangerate' => 'Exchangerate',
+ 'From' => 'From',
+ 'Invoice' => 'Invoice',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Number',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Payment',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Printer',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Screen',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Update' => 'Update',
+ 'Vendor' => 'Vendor',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'continue' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ct b/sql-ledger/locale/en_GB/ct
new file mode 100644
index 000000000..3daa8f4dc
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Add',
+ 'Address' => 'Address',
+ 'All' => 'All',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Credit Limit' => 'Credit Limit',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Delete',
+ 'Discount' => 'Discount',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Edit Customer',
+ 'Edit Vendor' => 'Edit Vendor',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Include in Report',
+ 'Invoice' => 'Invoice',
+ 'Name' => 'Name',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Notes',
+ 'Number' => 'Number',
+ 'Order' => 'Order',
+ 'Orphaned' => 'Orphaned',
+ 'Phone' => 'Phone',
+ 'Save' => 'Save',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Tax Included',
+ 'Taxable' => 'Taxable',
+ 'Terms: Net' => 'Terms: Net',
+ 'Transactions exist, cannot delete customer!' => 'Transactions exist, cannot delete customer!',
+ 'Transactions exist, cannot delete vendor!' => 'Transactions exist, cannot delete vendor!',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'days',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'invoice' => 'invoice',
+ 'order' => 'order',
+ 'save' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/gl b/sql-ledger/locale/en_GB/gl
new file mode 100644
index 000000000..dae8e86ca
--- /dev/null
+++ b/sql-ledger/locale/en_GB/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Purchase Transaction',
+ 'AR Transaction' => 'Sales Transaction',
+ 'Account' => 'Account',
+ 'Add General Ledger Transaction' => 'Add General Ledger Transaction',
+ 'Address' => 'Address',
+ 'All' => 'All',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Are you sure you want to delete Transaction',
+ 'Asset' => 'Asset',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'Cannot have a value in both Debit and Credit!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Confirm!' => 'Confirm!',
+ 'Continue' => 'Continue',
+ 'Credit' => 'Credit',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Debit' => 'Debit',
+ 'Debit and credit out of balance!' => 'Debit and credit out of balance!',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Description' => 'Description',
+ 'Edit General Ledger Transaction' => 'Edit General Ledger Transaction',
+ 'Equity' => 'Equity',
+ 'Expense' => 'Expense',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'General Ledger',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Include in Report',
+ 'Income' => 'Revenue',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Liability' => 'Liability',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Reports',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Subtotal',
+ 'Transaction Date missing!' => 'Transaction Date missing!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Yes',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'purchase_transaction' => 'ap_transaction',
+ 'sales_transaction' => 'ar_transaction',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ic b/sql-ledger/locale/en_GB/ic
new file mode 100644
index 000000000..2e61619ed
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Add',
+ 'Add Assembly' => 'Add Assembly',
+ 'Add Part' => 'Add Part',
+ 'Add Purchase Order' => 'Add Purchase Order',
+ 'Add Sales Order' => 'Add Sales Order',
+ 'Add Service' => 'Add Service',
+ 'Address' => 'Address',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Assemblies' => 'Assemblies',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'Assembly Number missing!',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Bought',
+ 'COGS' => 'COGS',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Closed',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Description',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail address missing!',
+ 'Edit Assembly' => 'Edit Assembly',
+ 'Edit Part' => 'Edit Part',
+ 'Edit Service' => 'Edit Service',
+ 'Expense' => 'Expense',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'Image' => 'Image',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Include in Report',
+ 'Income' => 'Revenue',
+ 'Individual Items' => 'Individual Items',
+ 'Inventory' => 'Inventory',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Inventory quantity must be zero before you can set this assembly obsolete!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Inventory quantity must be zero before you can set this part obsolete!',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number' => 'Invoice Number',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'Item not on file!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Last Cost' => 'Last Cost',
+ 'Line Total' => 'Line Total',
+ 'Link Accounts' => 'Link Accounts',
+ 'List Price' => 'List Price',
+ 'Make' => 'Make',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Model',
+ 'Name' => 'Name',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Number missing in Row' => 'Number missing in Row',
+ 'Obsolete' => 'Obsolete',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'On Hand' => 'On Hand',
+ 'On Order' => 'On Order',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Order Date missing!',
+ 'Order Number' => 'Order Number',
+ 'Order Number missing!' => 'Order Number missing!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Orphaned',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packing List',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Part',
+ 'Part Number missing!' => 'Part Number missing!',
+ 'Parts' => 'Parts',
+ 'Phone' => 'Phone',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Price',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Purchase Order',
+ 'Qty' => 'Qty',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Required by',
+ 'Sales' => 'Sales',
+ 'Sales Order' => 'Sales Order',
+ 'Save' => 'Save',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Select from one of the items below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Sell Price',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Service',
+ 'Service Number missing!' => 'Service Number missing!',
+ 'Services' => 'Services',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Short',
+ 'Sold' => 'Sold',
+ 'Stock' => 'Stock',
+ 'Stock Assembly' => 'Stock Assembly',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Tax',
+ 'To' => 'To',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Total',
+ 'Unit' => 'Unit',
+ 'Unit of measure' => 'Unit of measure',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Weight',
+ 'What type of item is this?' => 'What type of item is this?',
+ 'ea' => 'ea',
+ 'emailed to' => 'emailed to',
+ 'hr' => 'hr',
+ 'sent to printer' => 'sent to printer',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'add' => 'add',
+ 'add_assembly' => 'add_assembly',
+ 'add_part' => 'add_part',
+ 'add_service' => 'add_service',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit_assembly' => 'edit_assembly',
+ 'edit_part' => 'edit_part',
+ 'edit_service' => 'edit_service',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/io b/sql-ledger/locale/en_GB/io
new file mode 100644
index 000000000..1deb6dc2c
--- /dev/null
+++ b/sql-ledger/locale/en_GB/io
@@ -0,0 +1,108 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Add Purchase Order',
+ 'Add Sales Order' => 'Add Sales Order',
+ 'Address' => 'Address',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Description',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail address missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Item not on file!' => 'Item not on file!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'Name' => 'Name',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Number missing in Row' => 'Number missing in Row',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Order Date missing!',
+ 'Order Number missing!' => 'Order Number missing!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packing List',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Part',
+ 'Phone' => 'Phone',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Price',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Purchase Order',
+ 'Qty' => 'Qty',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Required by',
+ 'Sales Order' => 'Sales Order',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Select from one of the items below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Service',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Subject',
+ 'To' => 'To',
+ 'Unit' => 'Unit',
+ 'What type of item is this?' => 'What type of item is this?',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continue' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/ir b/sql-ledger/locale/en_GB/ir
new file mode 100644
index 000000000..a87c72a96
--- /dev/null
+++ b/sql-ledger/locale/en_GB/ir
@@ -0,0 +1,180 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Add Purchase Order' => 'Add Purchase Order',
+ 'Add Sales Order' => 'Add Sales Order',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Are you sure you want to delete Invoice Number',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirm!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Currency' => 'Currency',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Description',
+ 'Due Date' => 'Due Date',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail address missing!',
+ 'Edit Vendor Invoice' => 'Edit Vendor Invoice',
+ 'Exch' => 'Exch',
+ 'Exchangerate' => 'Exchangerate',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date' => 'Invoice Date',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number' => 'Invoice Number',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Item not on file!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'Name' => 'Name',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Number missing in Row' => 'Number missing in Row',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Order Date missing!',
+ 'Order Number' => 'Order Number',
+ 'Order Number missing!' => 'Order Number missing!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packing List',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Part',
+ 'Payment date missing!' => 'Payment date missing!',
+ 'Payments' => 'Payments',
+ 'Phone' => 'Phone',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Price',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Purchase Order',
+ 'Qty' => 'Qty',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Record in',
+ 'Required by' => 'Required by',
+ 'Sales Order' => 'Sales Order',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Select from one of the items below',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Service',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Source',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Tax Included',
+ 'To' => 'To',
+ 'Total' => 'Total',
+ 'Unit' => 'Unit',
+ 'Update' => 'Update',
+ 'Vendor' => 'Vendor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'What type of item is this?',
+ 'Yes' => 'Yes',
+ 'ea' => 'ea',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/is b/sql-ledger/locale/en_GB/is
new file mode 100644
index 000000000..bbfa3f0d3
--- /dev/null
+++ b/sql-ledger/locale/en_GB/is
@@ -0,0 +1,187 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Add Purchase Order' => 'Add Purchase Order',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Add Sales Order',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Are you sure you want to delete Invoice Number',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirm!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Credit Limit',
+ 'Currency' => 'Currency',
+ 'Customer' => 'Customer',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Description',
+ 'Due Date' => 'Due Date',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail address missing!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Exch',
+ 'Exchangerate' => 'Exchangerate',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date' => 'Invoice Date',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number' => 'Invoice Number',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Item not on file!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'Name' => 'Name',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Number missing in Row' => 'Number missing in Row',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Order Date missing!',
+ 'Order Number' => 'Order Number',
+ 'Order Number missing!' => 'Order Number missing!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packing List',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Part',
+ 'Payment date missing!' => 'Payment date missing!',
+ 'Payments' => 'Payments',
+ 'Phone' => 'Phone',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Price',
+ 'Print' => 'Print',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Purchase Order',
+ 'Qty' => 'Qty',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Record in',
+ 'Remaining' => 'Remaining',
+ 'Required by' => 'Required by',
+ 'Sales Order' => 'Sales Order',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Select from one of the items below',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Service',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Source',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Tax Included',
+ 'To' => 'To',
+ 'Total' => 'Total',
+ 'Unit' => 'Unit',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'What type of item is this?',
+ 'Yes' => 'Yes',
+ 'ea' => 'ea',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/login b/sql-ledger/locale/en_GB/login
new file mode 100644
index 000000000..262a18ceb
--- /dev/null
+++ b/sql-ledger/locale/en_GB/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'About',
+ 'Database Host' => 'Database Host',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => 'Incorrect Dataset version!',
+ 'Incorrect Password!' => 'Incorrect Password!',
+ 'Licensed to' => 'Licensed to',
+ 'Login' => 'Login',
+ 'Name' => 'Name',
+ 'Password' => 'Password',
+ 'User' => 'User',
+ 'Version' => 'Version',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'You did not enter a name!',
+ 'is not a member!' => 'is not a member!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/menu b/sql-ledger/locale/en_GB/menu
new file mode 100644
index 000000000..4e478154e
--- /dev/null
+++ b/sql-ledger/locale/en_GB/menu
@@ -0,0 +1,73 @@
+$self{texts} = {
+ 'AP' => 'Purchases',
+ 'AP Aging' => 'Creditor Aging',
+ 'AR' => 'Sales',
+ 'AR Aging' => 'Debtor Aging',
+ 'Accounting Menu' => 'Accounting Menu',
+ 'Add Account' => 'Add Account',
+ 'Add Assembly' => 'Add Assembly',
+ 'Add Customer' => 'Add Customer',
+ 'Add GIFI' => 'Add GIFI',
+ 'Add Group' => 'Add Group',
+ 'Add Part' => 'Add Part',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Add Service',
+ 'Add Transaction' => 'Add Transaction',
+ 'Add Vendor' => 'Add Vendor',
+ 'Assemblies' => 'Assemblies',
+ 'Audit Control' => 'Audit Control',
+ 'Backup' => 'Backup',
+ 'Balance Sheet' => 'Balance Sheet',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Chart of Accounts',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'General Ledger',
+ 'Goods & Services' => 'Goods & Services',
+ 'Groups' => 'Groups',
+ 'HTML Templates' => 'HTML Templates',
+ 'Income Statement' => 'Income Statement',
+ 'Invoice' => 'Invoice',
+ 'LaTeX Templates' => 'LaTeX Templates',
+ 'List Accounts' => 'List Accounts',
+ 'List GIFI' => 'List GIFI',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Order Entry',
+ 'Packing List' => 'Packing List',
+ 'Parts' => 'Parts',
+ 'Payment' => 'Payment',
+ 'Payments' => 'Payments',
+ 'Preferences' => 'Preferences',
+ 'Projects' => 'Projects',
+ 'Purchase Order' => 'Purchase Order',
+ 'Purchase Orders' => 'Purchase Orders',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Reports',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Sales Order',
+ 'Sales Orders' => 'Sales Orders',
+ 'Save to File' => 'Save to File',
+ 'Send by E-Mail' => 'Send by E-Mail',
+ 'Services' => 'Services',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Stock Assembly',
+ 'Stylesheet' => 'Stylesheet',
+ 'System' => 'System',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Transactions',
+ 'Trial Balance' => 'Trial Balance',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Version',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/oe b/sql-ledger/locale/en_GB/oe
new file mode 100644
index 000000000..2dfbb4736
--- /dev/null
+++ b/sql-ledger/locale/en_GB/oe
@@ -0,0 +1,202 @@
+$self{texts} = {
+ 'Add' => 'Add',
+ 'Add Purchase Order' => 'Add Purchase Order',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Add Sales Order',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Address',
+ 'Amount' => 'Amount',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Order Number' => 'Are you sure you want to delete Order Number',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Confirm!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Credit Limit',
+ 'Curr' => 'Curr',
+ 'Currency' => 'Currency',
+ 'Customer' => 'Customer',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Date',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Delete',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Description',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail address missing!',
+ 'Edit Purchase Order' => 'Edit Purchase Order',
+ 'Edit Sales Order' => 'Edit Sales Order',
+ 'Exchangerate' => 'Exchangerate',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Include in Report',
+ 'Invoice' => 'Invoice',
+ 'Invoice Date missing!' => 'Invoice Date missing!',
+ 'Invoice Number missing!' => 'Invoice Number missing!',
+ 'Item not on file!' => 'Item not on file!',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'Name' => 'Name',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Number',
+ 'Number missing in Row' => 'Number missing in Row',
+ 'O' => 'O',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'Open' => 'Open',
+ 'Order' => 'Order',
+ 'Order Date' => 'Order Date',
+ 'Order Date missing!' => 'Order Date missing!',
+ 'Order Number' => 'Order Number',
+ 'Order Number missing!' => 'Order Number missing!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packing List',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Part',
+ 'Phone' => 'Phone',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Price',
+ 'Print' => 'Print',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Purchase Order',
+ 'Purchase Orders' => 'Purchase Orders',
+ 'Qty' => 'Qty',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Remaining',
+ 'Required by' => 'Required by',
+ 'Sales Order' => 'Sales Order',
+ 'Sales Orders' => 'Sales Orders',
+ 'Save' => 'Save',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Select from one of the items below',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Service',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Tax',
+ 'Tax Included' => 'Tax Included',
+ 'Terms: Net' => 'Terms: Net',
+ 'To' => 'To',
+ 'Total' => 'Total',
+ 'Unit' => 'Unit',
+ 'Update' => 'Update',
+ 'Vendor' => 'Vendor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'What type of item is this?',
+ 'Yes' => 'Yes',
+ 'days' => 'days',
+ 'ea' => 'ea',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'invoice' => 'invoice',
+ 'print' => 'print',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'yes' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/pe b/sql-ledger/locale/en_GB/pe
new file mode 100644
index 000000000..58cd57a6f
--- /dev/null
+++ b/sql-ledger/locale/en_GB/pe
@@ -0,0 +1,45 @@
+$self{texts} = {
+ 'Add' => 'Add',
+ 'Add Group' => 'Add Group',
+ 'Add Project' => 'Add Project',
+ 'All' => 'All',
+ 'Continue' => 'Continue',
+ 'Delete' => 'Delete',
+ 'Description' => 'Description',
+ 'Edit Group' => 'Edit Group',
+ 'Edit Project' => 'Edit Project',
+ 'Group' => 'Group',
+ 'Group deleted!' => 'Group deleted!',
+ 'Group missing!' => 'Group missing!',
+ 'Group saved!' => 'Group saved!',
+ 'Groups' => 'Groups',
+ 'Number' => 'Number',
+ 'Orphaned' => 'Orphaned',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Save',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_partsgroup_footer' => 'form_partsgroup_footer',
+ 'form_partsgroup_header' => 'form_partsgroup_header',
+ 'form_project_footer' => 'form_project_footer',
+ 'form_project_header' => 'form_project_header',
+ 'partsgroup_report' => 'partsgroup_report',
+ 'project_report' => 'project_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'save' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/rc b/sql-ledger/locale/en_GB/rc
new file mode 100644
index 000000000..952c378ec
--- /dev/null
+++ b/sql-ledger/locale/en_GB/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Account',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continue',
+ 'Date' => 'Date',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Description',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'From',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Payment',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Source',
+ 'Statement Balance' => 'Statement Balance',
+ 'Update' => 'Update',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continue' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/en_GB/rp b/sql-ledger/locale/en_GB/rp
new file mode 100644
index 000000000..a66828e2f
--- /dev/null
+++ b/sql-ledger/locale/en_GB/rp
@@ -0,0 +1,119 @@
+$self{texts} = {
+ 'AP Aging' => 'Creditor Aging',
+ 'AR Aging' => 'Debtor Aging',
+ 'Account' => 'Account',
+ 'Accounts' => 'Accounts',
+ 'Amount' => 'Amount',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aug',
+ 'August' => 'August',
+ 'Balance' => 'Balance',
+ 'Balance Sheet' => 'Balance Sheet',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Compare to',
+ 'Continue' => 'Continue',
+ 'Copies' => 'Copies',
+ 'Credit' => 'Credit',
+ 'Current' => 'Current',
+ 'Customer' => 'Customer',
+ 'Date' => 'Date',
+ 'Debit' => 'Debit',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Description',
+ 'Due' => 'Due',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Feb',
+ 'February' => 'February',
+ 'From' => 'From',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Heading',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Include in Report',
+ 'Income Statement' => 'Income Statement',
+ 'Invoice' => 'Invoice',
+ 'Jan' => 'Jan',
+ 'January' => 'January',
+ 'Jul' => 'Jul',
+ 'July' => 'July',
+ 'Jun' => 'Jun',
+ 'June' => 'June',
+ 'Mar' => 'Mar',
+ 'March' => 'March',
+ 'May' => 'May',
+ 'May ' => 'May ',
+ 'Message' => 'Message',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Oct',
+ 'October' => 'October',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Payments',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Printer',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Report for',
+ 'Retained Earnings' => 'Retained Earnings',
+ 'Screen' => 'Screen',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Source',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Tax',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Trial Balance',
+ 'Vendor' => 'Vendor',
+ 'as at' => 'as at',
+ 'collected on sales' => 'collected on sales',
+ 'for Period' => 'for Period',
+ 'paid on purchases' => 'paid on purchases',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/es/COPYING b/sql-ledger/locale/es/COPYING
new file mode 100644
index 000000000..bf7ca4bc6
--- /dev/null
+++ b/sql-ledger/locale/es/COPYING
@@ -0,0 +1,26 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Spanish texts:
+#
+# Author: Maria Gabriela Fong <mgfong@maga.tzo.org>
+# John Stoddart <jstypo@imagencolor.com.ve>
+# Federico Montesino Pouzols <fedemp@arrok.com>
+# Tomás Pereira <topec@percar.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/es/LANGUAGE b/sql-ledger/locale/es/LANGUAGE
new file mode 100644
index 000000000..c1a0de222
--- /dev/null
+++ b/sql-ledger/locale/es/LANGUAGE
@@ -0,0 +1 @@
+Spanish
diff --git a/sql-ledger/locale/es/Num2text b/sql-ledger/locale/es/Num2text
new file mode 100644
index 000000000..a5424ff52
--- /dev/null
+++ b/sql-ledger/locale/es/Num2text
@@ -0,0 +1,195 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+
+
+sub init {
+ my $self = shift;
+
+ %{ $self->{numbername} } =
+ (0 => 'cero',
+ 1 => 'un',
+ '1o' => 'uno',
+ 2 => 'dos',
+ 3 => 'tres',
+ 4 => 'cuatro',
+ 5 => 'cinco',
+ 6 => 'seis',
+ 7 => 'siete',
+ 8 => 'ocho',
+ 9 => 'nueve',
+ 10 => 'diez',
+ 11 => 'once',
+ 12 => 'doce',
+ 13 => 'trece',
+ 14 => 'catorce',
+ 15 => 'quince',
+ 16 => 'dieciséis',
+ 17 => 'diecisiete',
+ 18 => 'dieciocho',
+ 19 => 'diecinueve',
+ 20 => 'veinte',
+ 21 => 'veintiún',
+ '21o' => 'veintiuno',
+ 22 => 'veintidós',
+ 23 => 'veintitrés',
+ 24 => 'veinticuatro',
+ 25 => 'veinticinco',
+ 26 => 'veintiséis',
+ 27 => 'veintisiete',
+ 28 => 'veintiocho',
+ 29 => 'veintinueve',
+ 30 => 'treinta',
+ 40 => 'cuarenta',
+ 50 => 'cincuenta',
+ 60 => 'sesenta',
+ 70 => 'setenta',
+ 80 => 'ochenta',
+ 90 => 'noventa',
+ 10**2 => 'ciento',
+ 10**3 => 'mil',
+ 10**6 => 'millón',
+ 10**9 => 'millardo',
+ 10**12 => 'billón',
+ );
+
+}
+
+
+sub num2text {
+ my ($self, $amount) = @_;
+
+ return $self->{numbername}{0} unless $amount;
+
+ my @textnumber = ();
+
+ # split amount into chunks of 3
+ my @num = reverse split //, $amount;
+ my @numblock = ();
+ my $stripun = 0;
+ my @a = ();
+ my $i;
+
+ while (@num) {
+ @a = ();
+ for (1 .. 3) {
+ push @a, shift @num;
+ }
+ push @numblock, join / /, reverse @a;
+ }
+
+ # special case for 1000
+ if ($numblock[1] eq '1' && $numblock[0] gt '000') {
+ # remove first array element from textnumber
+ $stripun = 1;
+ }
+
+ while (@numblock) {
+
+ $i = $#numblock;
+ @num = split //, $numblock[$i];
+
+ $numblock[$i] *= 1;
+
+ if ($numblock[$i] == 0) {
+ pop @numblock;
+ next;
+ }
+
+ if ($numblock[$i] > 99) {
+ if ($num[0] == 1) {
+ push @textnumber, $self->{numbername}{10**2};
+ } else {
+ # the one from hundreds, append cientos
+ push @textnumber, $self->{numbername}{$num[0]}.$self->{numbername}{10**2}.'s';
+ }
+
+ # reduce numblock
+ $numblock[$i] -= $num[0] * 100;
+ }
+
+ if ($numblock[$i] > 9) {
+ # tens
+ push @textnumber, $self->format_ten($numblock[$i], $i);
+ } elsif ($numblock[$i] > 0) {
+ # ones
+ $num = $numblock[$i];
+ $num .= 'o' if ($num == 1 && $i == 0);
+ push @textnumber, $self->{numbername}{$num};
+ }
+
+ # add thousand, million
+ if ($i) {
+ $num = 10**($i * 3);
+ if ($numblock[$i] > 1) {
+ if ($i == 2 || $i == 4) {
+ $a = $self->{numbername}{$num}."es";
+ $a =~ s/ó/o/;
+ push @textnumber, $a;
+ } else {
+ if ($i == 1) {
+ push @textnumber, $self->{numbername}{$num};
+ } else {
+ push @textnumber, $self->{numbername}{$num}.'s';
+ }
+ }
+ } else {
+ push @textnumber, $self->{numbername}{$num};
+ }
+ }
+
+ pop @numblock;
+
+ }
+
+ shift @textnumber if $stripun;
+
+ join ' ', @textnumber;
+
+}
+
+
+sub format_ten {
+ my ($self, $amount, $i) = @_;
+
+ my $textnumber = "";
+ my @num = split //, $amount;
+
+ if ($amount > 30) {
+ $textnumber = $self->{numbername}{$num[0]*10};
+ $amount = $num[1];
+ } else {
+ $amount .= 'o' if ($num[1] == 1 && $i == 0);
+ $textnumber = $self->{numbername}{$amount};
+ $amount = 0;
+ }
+
+ $textnumber .= " y ".$self->{numbername}{$amount} if $amount;
+
+ $textnumber;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/locale/es/admin b/sql-ledger/locale/es/admin
new file mode 100644
index 000000000..a78f75554
--- /dev/null
+++ b/sql-ledger/locale/es/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Control de Acceso',
+ 'Accounting' => 'Contabilidad',
+ 'Add User' => 'Añadir usuario',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrador',
+ 'All Datasets up to date!' => 'Todas las bases de datos están actualizadas',
+ 'Change Admin Password' => 'Cambiar la contraseña del administrador',
+ 'Change Password' => 'Cambiar contraseña',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de usuario por
+editar',
+ 'Company' => 'Compañía',
+ 'Connect to' => 'Conectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear base de datos',
+ 'DBI not installed!' => 'No se ha instalado DBI',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de las bases de datos',
+ 'Database Driver not checked!' => 'No se ha podido verificar el gestor de la base de datos',
+ 'Database User missing!' => 'No se ha definido el usuario de la base de datos',
+ 'Dataset' => 'Base de datos',
+ 'Dataset missing!' => 'No se ha definido la base de datos',
+ 'Dataset updated!' => 'Base de datos actualizada',
+ 'Date Format' => 'Formato de fecha',
+ 'Delete' => 'Borrar',
+ 'Delete Dataset' => 'Borrar base de datos',
+ 'Directory' => 'Directorio',
+ 'Driver' => 'Gestor',
+ 'Dropdown Limit' => 'Límite de efectivo',
+ 'E-mail' => 'Correo electrónico',
+ 'Edit User' => 'Editar usuario',
+ 'Existing Datasets' => 'Bases de datos existentes',
+ 'Fax' => 'Fax',
+ 'File locked!' => 'File locked!',
+ 'Host' => 'Máquina servidor de base de datos',
+ 'Hostname missing!' => 'No se ha definido la máquina servidor de base de datos',
+ 'Incorrect Password!' => 'Contraseña incorrecta',
+ 'Language' => 'Lenguaje',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de máquina servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Login' => 'Entrar',
+ 'Name' => 'Nombre',
+ 'New Templates' => 'Nuevas plantillas',
+ 'No Database Drivers available!' => 'No hay ningún gestor de base de datos disponible',
+ 'No Dataset selected!' => 'No se ha seleccionado ninguna base de datos',
+ 'Nothing to delete!' => '¡No hay nada para borrar!',
+ 'Number Format' => 'Formato de número',
+ 'Oracle Database Administration' => 'Administración de la base de datos Oracle',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => '¡Contraseña cambiada!',
+ 'Pg Database Administration' => 'Administración de la base de datos PostgreSQL',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se ha definido el puerto',
+ 'Printer' => 'Impresora',
+ 'Save' => 'Guardar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione una base de datos para borrar y presione "Continuar"',
+ 'Setup Templates' => 'Configurar plantillas',
+ 'Ship via' => 'Envio por',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Hoja de estilo',
+ 'Templates' => 'Plantillas',
+ 'The following Datasets are not in use and can be deleted' => 'Las siguientes bases de datos no están en uso y se pueden borrar',
+ 'The following Datasets need to be updated' => 'Es necesario actualizar las siguientes bases de datos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. No se creará ni borrará nada durante esta etapa',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para añadir un usuario a un grupo, edite un nombre, cambie el nombre de usuario (login) y guarde los cambios. Un nuevo usuario, con las mismas propiedades se guardará bajo el nuevo nombre de usuario (login).',
+ 'Update Dataset' => 'Actualizar base de datos',
+ 'Use Templates' => 'Plantillas de usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => '¡Usuario borrado!',
+ 'User saved!' => '¡Usuario guardado!',
+ 'Version' => 'Versión',
+ 'You must enter a host and port for local and remote connections!' => 'Debe introducir una máquina servidor de bases de datos y un puerto para conexiones locales y remotas',
+ 'does not exist' => 'no existe',
+ 'is already a member!' => 'ya es actualmente un miembro',
+ 'localhost' => 'máquina local',
+ 'successfully created!' => 'creado satisfactoriamente',
+ 'successfully deleted!' => 'borrado satisfactoriamente',
+ 'website' => 'sitio web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'añadir_usuario' => 'add_user',
+ 'cambiar_la_contraseña_del_administrador' => 'change_admin_password',
+ 'cambiar_contraseña' => 'change_password',
+ 'continuar' => 'continue',
+ 'crear_base_de_datos' => 'create_dataset',
+ 'borrar' => 'delete',
+ 'borrar_base_de_datos' => 'delete_dataset',
+ 'entrar' => 'login',
+ 'administración_de_la_base_de_datos_oracle' => 'oracle_database_administration',
+ 'administración_de_la_base_de_datos_postgresql' => 'pg_database_administration',
+ 'guardar' => 'save',
+ 'actualizar_base_de_datos' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/es/all b/sql-ledger/locale/es/all
new file mode 100644
index 000000000..5e33b01bb
--- /dev/null
+++ b/sql-ledger/locale/es/all
@@ -0,0 +1,490 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Cartera de pagos',
+ 'AP Aging' => 'Diario resumido de pagos',
+ 'AP Transaction' => 'Gestión se pago',
+ 'AP Transactions' => 'Gestiones de pagos',
+ 'AR' => 'Cartera de cobros',
+ 'AR Aging' => 'Diario resumido de cobros ',
+ 'AR Transaction' => 'Gestión de cobro',
+ 'AR Transactions' => 'Gestiones de cobros',
+ 'About' => 'Acerca de',
+ 'Access Control' => 'Control de Acceso',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de cuenta',
+ 'Account Number missing!' => 'No se ha definido el número de la cuenta',
+ 'Account Type' => 'Categoría de cuenta',
+ 'Account Type missing!' => 'No se ha definido el tipo de la cuenta',
+ 'Account deleted!' => '¡Cuenta borraba!',
+ 'Account saved!' => '¡Cuenta guardada!',
+ 'Accounting' => 'Contabilidad',
+ 'Accounting Menu' => 'Menú general',
+ 'Accounts' => 'Cuentas',
+ 'Active' => 'Activo',
+ 'Add' => 'Añadir',
+ 'Add Account' => 'Añadir cuenta',
+ 'Add Accounts Payables Transaction' => 'Añadir cuenta de transacciones a pagar',
+ 'Add Accounts Receivables Transaction' => 'Añadir cuenta de transacciones a cobrar',
+ 'Add Assembly' => 'Añadir compuesto',
+ 'Add Customer' => 'Añadir cliente',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Add General Ledger Transaction' => 'Añadir transacción al libro mayor general',
+ 'Add Part' => 'Añadir artículo',
+ 'Add Project' => 'Añadir proyecto',
+ 'Add Purchase Invoice' => 'Añadir factura de compra',
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Invoice' => 'Añadir factura',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Add Service' => 'Añadir servicio',
+ 'Add Transaction' => 'Añadir',
+ 'Add User' => 'Añadir usuario',
+ 'Add Vendor' => 'Añadir proveedor',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrador',
+ 'All' => 'Todos',
+ 'All Datasets up to date!' => 'Todas las bases de datos están actualizadas',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Cantidad adeudada',
+ 'Amount does not equal applied!' => '¡La cantidad no es igual a lo aplicado!',
+ 'Amount missing!' => '¡Falta la cantidad!',
+ 'Applied' => 'Aplicado',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la factura número',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la orden número?',
+ 'Are you sure you want to delete Transaction' => '¿Está seguro de que desea borrar la transacción?',
+ 'Assemblies' => 'Compuestos',
+ 'Assemblies restocked!' => '¡Compuestos actualizados en almacen!',
+ 'Assembly Number missing!' => 'No se ha definido el número de compuesto',
+ 'Asset' => 'Activo',
+ 'Attachment' => 'Adjunto',
+ 'Audit Control' => 'Control de auditoría',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'Listado de piezas',
+ 'Backup' => 'Copia de seguridad de los datos',
+ 'Backup sent to' => 'Copia de seguridad enviada a',
+ 'Balance' => 'Balance',
+ 'Balance Sheet' => 'Hoja de balance',
+ 'Bcc' => '',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Los libros están abiertos',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'Numero de negocio',
+ 'C' => '',
+ 'COGS' => 'Costo de los artículos',
+ 'Cannot delete account!' => '¡No se puede borrar la cuenta!',
+ 'Cannot delete customer!' => '¡No se puede borrar el cliente!',
+ 'Cannot delete default account!' => 'No se puede borrar la cuenta por omisión',
+ 'Cannot delete invoice!' => '¡No se puede borrar la factura!',
+ 'Cannot delete item already invoiced!' => 'No se puede borrar un artículo ya facturado',
+ 'Cannot delete item on order!' => 'No se puede eliminar un elemento presente en una orden',
+ 'Cannot delete item which is part of an assembly!' => 'No puede eliminar un artículo que es parte de un compuesto',
+ 'Cannot delete item!' => '¡No se puede borrar el artículo!',
+ 'Cannot delete order!' => '¡No se puede borrar el pedido!',
+ 'Cannot delete transaction!' => '¡No se puede borrar la transacción!',
+ 'Cannot delete vendor!' => '¡No se puede borrar el vendedor!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en débito y crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => '¡No se puede registrar una transacción sin valor!',
+ 'Cannot post invoice for a closed period!' => '¡No se puede registrar una factura en un periodo ya cerrado!',
+ 'Cannot post invoice!' => '¡No se puede registrar la factura!',
+ 'Cannot post payment for a closed period!' => '¡No se puede registrar un pago en un periodo ya cerrado!',
+ 'Cannot post payment!' => '¡No se puede registrar el pago!',
+ 'Cannot post transaction for a closed period!' => '¡No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => '¡No se puede registrar la transacción',
+ 'Cannot process payment for a closed period!' => '¡No se puede procesar un pago de un periodo ya cerrado!',
+ 'Cannot save account!' => '¡No se puede guardar la cuenta!',
+ 'Cannot save order!' => '¡No se puede guardar el pedido!',
+ 'Cannot save preferences!' => '¡No se puede guardar las preferencias!',
+ 'Cannot stock assemblies!' => '¡No se pueden almacenar los compuestos!',
+ 'Cash' => 'Efectivo',
+ 'Cash based' => 'Efectivo inicial',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Cambiar la contraseña del administrador',
+ 'Change Password' => 'Cambiar contraseña',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Chart of Accounts' => 'Cuadro de cuentas',
+ 'Check' => 'Cheque',
+ 'Check printed!' => '¡Cheque impreso!',
+ 'Check printing failed!' => '¡Fallo al imprimir el cheque!',
+ 'Cleared Balance' => 'Balance cerrado',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de usuario por
+editar',
+ 'Close Books up to' => 'Cerrar los libros hasta',
+ 'Closed' => 'Cerrado',
+ 'Company' => 'Compañía',
+ 'Compare to' => 'Comparar con',
+ 'Confirm!' => 'Confirmar',
+ 'Connect to' => 'Conectar a',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Copy to COA' => 'Copiar al catálogo de cuentas',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear base de datos',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Limite de credito',
+ 'Curr' => 'Mon.',
+ 'Currency' => 'Moneda',
+ 'Current' => 'Actual',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => '¡Cliente borrado!',
+ 'Customer missing!' => '¡Falta el cliente!',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Customer saved!' => '¡Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'DBI not installed!' => 'No se ha instalado DBI',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de las bases de datos',
+ 'Database Driver not checked!' => 'No se ha podido verificar el gestor de la base de datos',
+ 'Database Host' => 'Máquina servidor de base de datos',
+ 'Database User missing!' => 'No se ha definido el usuario de la base de datos',
+ 'Dataset' => 'Base de datos',
+ 'Dataset missing!' => 'No se ha definido la base de datos',
+ 'Dataset updated!' => 'Base de datos actualizada',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de vencimiento',
+ 'Date Format' => 'Formato de fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Date missing!' => '¡Falta la fecha!',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Los débitos y créditos están fuera de balance',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => 'Lugar de los decimales',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar cuenta',
+ 'Delete Dataset' => 'Borrar base de datos',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Diferencia',
+ 'Directory' => 'Directorio',
+ 'Discount' => 'Descuento',
+ 'Done' => 'Hecho',
+ 'Drawing' => 'Reintegro',
+ 'Driver' => 'Gestor',
+ 'Dropdown Limit' => 'Límite de efectivo',
+ 'Due' => 'Vence',
+ 'Due Date' => 'Fecha de vencimiento',
+ 'Due Date missing!' => 'Falta la fecha de vencimiento',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail Statement to' => 'Enviar comprobante por correo electrónico a',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar cuenta',
+ 'Edit Accounts Payables Transaction' => 'Editar las cuentas de las transacciones a pagar',
+ 'Edit Accounts Receivables Transaction' => 'Editar las cuentas de las transacciones a cobrar',
+ 'Edit Assembly' => 'Editar compuesto',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit General Ledger Transaction' => 'Editar transacción del libro mayor general',
+ 'Edit Part' => 'Editar compuesto',
+ 'Edit Preferences for' => 'Editar preferencias de',
+ 'Edit Project' => 'Editar proyecto',
+ 'Edit Purchase Invoice' => 'Editar factura de compra',
+ 'Edit Purchase Order' => 'Editar pedido',
+ 'Edit Sales Invoice' => 'Edirar factura de venta',
+ 'Edit Sales Order' => 'Editar presupuesto',
+ 'Edit Service' => 'Editar servicio',
+ 'Edit Template' => 'Editar plantilla',
+ 'Edit User' => 'Editar usuario',
+ 'Employee' => 'Colaborador/Empleado',
+ 'Enforce transaction reversal for all dates' => 'Forzar la anulación de las transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Introduzca hasta 3 letras separadas por dos puntos (p.e. CAD:USD:EUR) para las monedas locales y las extranjeras',
+ 'Equity' => 'Balance',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate Difference' => 'Diferencia en la tasa cambio a moneda extranjera',
+ 'Exchangerate for payment missing!' => '¡Falta la tasa de cambio para el pago!',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Existing Datasets' => 'Bases de datos existentes',
+ 'Expense' => 'Gastos',
+ 'Expense Account' => 'Cuenta de gastos',
+ 'Expense/Asset' => 'Gastos/Activo',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'File locked!' => '',
+ 'Foreign Exchange Gain' => 'Ganancia en moneda extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en moneda extranjera',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'GIFI deleted!' => '¡Borrado el código GIFI!',
+ 'GIFI missing!' => 'No se ha definido el código GIFI',
+ 'GIFI saved!' => '¡Guardado el código GIFI!',
+ 'GL Transaction' => 'Transacción en el libro mayor',
+ 'General Ledger' => 'Libro mayor general',
+ 'Goods & Services' => 'Bienes y servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Heading' => 'Encabezado',
+ 'Host' => 'Máquina servidor de base de datos',
+ 'Hostname missing!' => 'No se ha definido la máquina servidor de base de datos',
+ 'ID' => 'ID',
+ 'Image' => 'Imagen',
+ 'In-line' => 'Incrustado',
+ 'Include in Report' => 'Incluir en informe',
+ 'Include in drop-down menus' => 'Incluir en menúes desplegables:',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Mostrar esta cuenta en los formularios de cliente/proveedor para seleccionar si hay que aplicar impuestos al cliente/proveedor?',
+ 'Income' => 'Ingresos',
+ 'Income Account' => 'Cuenta de ingresos',
+ 'Income Statement' => 'Balance de situación',
+ 'Incorrect Dataset version!' => 'Versión de base de datos incorrecta',
+ 'Incorrect Password!' => 'Contraseña incorrecta',
+ 'Individual Items' => 'Artículos individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este compuesto a obsoleto',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este artículo a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser cero',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Invoice deleted!' => '¡Factura borrada!',
+ 'Invoice posted!' => '¡Factura registrada!',
+ 'Invoices' => 'Facturas',
+ 'Is this a summary account to record' => '¿Es esta una cuenta de resumen a registrar?',
+ 'Item deleted!' => '¡Concepto borrado!',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'Language' => 'Lenguaje',
+ 'Last Cost' => 'Ultimo costo',
+ 'Last Invoice Number' => 'Último número de factura',
+ 'Last Numbers & Default Accounts' => 'Últimos números y cuentas por omisión',
+ 'Last Purchase Order Number' => 'Último pedido',
+ 'Last Sales Order Number' => 'Número del último presupuesto',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de máquina servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Liability' => 'Pasivo',
+ 'Licensed to' => 'Adaptado para',
+ 'Line Total' => 'Total de la línea',
+ 'Link' => 'Enlaces',
+ 'Link Accounts' => 'Enlazar cuentas',
+ 'List Accounts' => 'Listar cuentas',
+ 'List GIFI' => 'Listar código GIFI',
+ 'List Price' => 'Precio de lista',
+ 'List Transactions' => 'Listar transacciones',
+ 'Login' => 'Entrar',
+ 'Logout' => 'Salir',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'N/A' => 'Sin respuesta',
+ 'Name' => 'Nombre',
+ 'Name missing!' => '¡Falta el nombre!',
+ 'New Templates' => 'Nuevas plantillas',
+ 'No' => 'No',
+ 'No Database Drivers available!' => 'No hay ningún gestor de base de datos disponible',
+ 'No Dataset selected!' => 'No se ha seleccionado ninguna base de datos',
+ 'No email address for' => 'Falta la dirección de correo electrónico de',
+ 'No.' => '',
+ 'Notes' => 'Notas',
+ 'Nothing applied!' => '¡No es aplicable a nada!',
+ 'Nothing selected!' => '¡No es seleccionado nada!',
+ 'Nothing to delete!' => '¡No hay nada para borrar!',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'O' => '',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'Disponible',
+ 'On Order' => 'En pedido',
+ 'Open' => 'Abierto',
+ 'Oracle Database Administration' => 'Administración de la base de datos Oracle',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de elaboración',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Entry' => 'Presupuestos y pedidos',
+ 'Order Number' => 'Número de orden',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'Order deleted!' => '¡Orden borrada!',
+ 'Order saved!' => '¡Orden guardada!',
+ 'Ordered' => 'Pedido realizado',
+ 'Orphaned' => 'Huérfano',
+ 'Out of balance!' => '¡Fuera de balance!',
+ 'PDF' => '',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Paid' => 'Pagado',
+ 'Paid in full' => 'Pago al completo',
+ 'Part' => 'Artículo',
+ 'Part Number missing!' => 'No se ha definido el número del artículo',
+ 'Parts' => 'Artículos',
+ 'Parts Inventory' => 'Inventario de artículos',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => '¡Contraseña cambiada!',
+ 'Payables' => 'Pagos',
+ 'Payment' => 'Pago',
+ 'Payment date missing!' => 'No se encuentra la fecha de pago',
+ 'Payment posted!' => '¡Pago registrado!',
+ 'Payments' => 'Vencimientos impagados',
+ 'Pg Database Administration' => 'Administración de la base de datos PostgreSQL',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se ha definido el puerto',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => '',
+ 'Preferences' => 'Preferencias',
+ 'Preferences saved!' => 'Preferencias guardadas',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project Number missing!' => '¡Falta el número de proyecto!',
+ 'Project deleted!' => '¡Proyecto borrado!',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Project saved!' => '¡Proyecto guardado ',
+ 'Projects' => 'Proyectos',
+ 'Purchase Invoice' => 'Factura de compras',
+ 'Purchase Order' => 'Pedido',
+ 'Purchase Orders' => 'Pedidos',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'Tope de envio',
+ 'Rate' => 'Tarifa',
+ 'Recd' => 'Cobrado',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Receivables' => 'Cobros',
+ 'Reconciliation' => 'Reconciliación',
+ 'Record in' => 'Registrar en',
+ 'Reference' => 'Referencia',
+ 'Reference missing!' => '¡Falta la referencia!',
+ 'Remaining' => 'Resto',
+ 'Report for' => 'Informe para',
+ 'Reports' => 'Informes',
+ 'Required by' => 'Aceptado el',
+ 'Retained Earnings' => 'Ganacias retenidas',
+ 'Sales' => 'Ventas',
+ 'Sales Invoice' => 'Facturas de ventas',
+ 'Sales Order' => 'Presupuesto',
+ 'Sales Orders' => 'Presupuestos',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como nuevo',
+ 'Save to File' => 'Guardar en un archivo',
+ 'Screen' => 'Pantalla',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione una base de datos para borrar y presione "Continuar"',
+ 'Select all' => 'Guardar todo',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sell Price' => 'Precio de venta',
+ 'Send by E-Mail' => 'Enviar por correo electrónico',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Items' => 'Servicios',
+ 'Service Number missing!' => 'No se ha definido el número de servicio',
+ 'Services' => 'Servicios',
+ 'Setup Templates' => 'Configurar plantillas',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Ship via' => 'Envio por',
+ 'Short' => 'Corto',
+ 'Signature' => 'Firma',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estándard',
+ 'Statement' => 'Estado de cuenta',
+ 'Statement Balance' => 'Balance de cuenta',
+ 'Statement sent to' => 'Estado de cuenta enviado a',
+ 'Statements sent to printer!' => '¡Estado de cuenta enviado a la impresora!',
+ 'Stock Assembly' => 'Inventariar compuesto',
+ 'Stylesheet' => 'Hoja de estilo',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'Sistema',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas de impuestos',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'Tax collected' => 'Impuestos cobrados',
+ 'Tax paid' => 'Impuestos pagados',
+ 'Taxable' => 'Impuestos gravables',
+ 'Template saved!' => '¡Plantilla guardada!',
+ 'Templates' => 'Plantillas',
+ 'Terms: Net' => 'Crédito',
+ 'The following Datasets are not in use and can be deleted' => 'Las siguientes bases de datos no están en uso y se pueden borrar',
+ 'The following Datasets need to be updated' => 'Es necesario actualizar las siguientes bases de datos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. No se creará ni borrará nada durante esta etapa',
+ 'To' => 'Hasta ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para añadir un usuario a un grupo, edite un nombre, cambie el nombre de usuario (login) y guarde los cambios. Un nuevo usuario, con las mismas propiedades se guardará bajo el nuevo nombre de usuario (login).',
+ 'Top Level' => '',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'No se ha definido la fecha de la transacción',
+ 'Transaction deleted!' => '¡Transacción borrada!',
+ 'Transaction posted!' => '¡Transacción registrada!',
+ 'Transaction reversal enforced for all dates' => 'Se ha forzado la anulación de las transacciones para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Se ha forzado la anulación de las transacciones hasta',
+ 'Transactions' => 'Impagados',
+ 'Transactions exist, cannot delete customer!' => 'Existen transacciones para este cliente, por tanto, no puede borrarlo',
+ 'Transactions exist, cannot delete vendor!' => 'Existen transacciones para este proveedor, por tanto, no puede borrarlo',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen, no puede suprimir la cuenta!',
+ 'Trial Balance' => 'Balance de comprobación',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Actualizar',
+ 'Update Dataset' => 'Actualizar base de datos',
+ 'Updated' => '¡Actualizado!',
+ 'Use Templates' => 'Plantillas de usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => '¡Usuario borrado!',
+ 'User saved!' => '¡Usuario guardado!',
+ 'Vendor' => 'Proveedor',
+ 'Vendor deleted!' => '¡Proveedor borrado!',
+ 'Vendor missing!' => '¡Falta el proveedor!',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'Vendor saved!' => '¡Proveedor guardado!',
+ 'Vendors' => 'Proveedores',
+ 'Version' => 'Versión',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidad de peso',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'Year End' => 'Fin del año fiscal',
+ 'Yes' => 'Si',
+ 'You are logged out!' => '¡Ya está desconectado del sistema!',
+ 'You did not enter a name!' => 'No ha introducido el nombre',
+ 'You must enter a host and port for local and remote connections!' => 'Debe introducir una máquina servidor de bases de datos y un puerto para conexiones locales y remotas',
+ 'as at' => 'al',
+ 'collected on sales' => 'ingresado en ventas',
+ 'days' => 'días',
+ 'does not exist' => 'no existe',
+ 'ea' => 'unid.',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'for Period' => 'para el periodo',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ya es actualmente un miembro',
+ 'is not a member!' => 'no es miembro',
+ 'localhost' => 'máquina local',
+ 'paid on purchases' => 'pagado en compras',
+ 'sent to printer' => 'enviado a la impresora',
+ 'successfully created!' => 'creado satisfactoriamente',
+ 'successfully deleted!' => 'borrado satisfactoriamente',
+ 'to' => 'a',
+ 'website' => 'sitio web',
+};
+
+1;
diff --git a/sql-ledger/locale/es/am b/sql-ledger/locale/es/am
new file mode 100644
index 000000000..a19042d27
--- /dev/null
+++ b/sql-ledger/locale/es/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Cartera de pagos',
+ 'AR' => 'Cartera de cobros',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de cuenta',
+ 'Account Number missing!' => 'No se ha definido el número de la cuenta',
+ 'Account Type' => 'Categoría de cuenta',
+ 'Account Type missing!' => 'No se ha definido el tipo de la cuenta',
+ 'Account deleted!' => '¡Cuenta borraba!',
+ 'Account saved!' => '¡Cuenta guardada!',
+ 'Add Account' => 'Añadir cuenta',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Address' => 'Dirección',
+ 'Asset' => 'Activo',
+ 'Audit Control' => 'Control de auditoría',
+ 'Backup sent to' => 'Copia de seguridad enviada a',
+ 'Books are open' => 'Los libros están abiertos',
+ 'Business Number' => 'Numero de negocio',
+ 'COGS' => 'Costo de los artículos',
+ 'Cannot delete account!' => '¡No se puede borrar la cuenta!',
+ 'Cannot delete default account!' => 'No se puede borrar la cuenta por omisión',
+ 'Cannot save account!' => '¡No se puede guardar la cuenta!',
+ 'Cannot save preferences!' => '¡No se puede guardar las preferencias!',
+ 'Character Set' => 'Conjunto de caracteres',
+ 'Chart of Accounts' => 'Cuadro de cuentas',
+ 'Close Books up to' => 'Cerrar los libros hasta',
+ 'Company' => 'Compañía',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar al catálogo de cuentas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato de fecha',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar cuenta',
+ 'Description' => 'Descripción',
+ 'Dropdown Limit' => 'Límite de efectivo',
+ 'E-mail' => 'Correo electrónico',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar cuenta',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit Preferences for' => 'Editar preferencias de',
+ 'Edit Template' => 'Editar plantilla',
+ 'Enforce transaction reversal for all dates' => 'Forzar la anulación de las transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Introduzca hasta 3 letras separadas por dos puntos (p.e. CAD:USD:EUR) para las monedas locales y las extranjeras',
+ 'Equity' => 'Balance',
+ 'Expense' => 'Gastos',
+ 'Expense Account' => 'Cuenta de gastos',
+ 'Expense/Asset' => 'Gastos/Activo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Ganancia en moneda extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en moneda extranjera',
+ 'GIFI' => 'Código GIFI',
+ 'GIFI deleted!' => '¡Borrado el código GIFI!',
+ 'GIFI missing!' => 'No se ha definido el código GIFI',
+ 'GIFI saved!' => '¡Guardado el código GIFI!',
+ 'Heading' => 'Encabezado',
+ 'Include in drop-down menus' => 'Incluir en menúes desplegables:',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Mostrar esta cuenta en los formularios de cliente/proveedor para seleccionar si hay que aplicar impuestos al cliente/proveedor?',
+ 'Income' => 'Ingresos',
+ 'Income Account' => 'Cuenta de ingresos',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de inventario',
+ 'Is this a summary account to record' => '¿Es esta una cuenta de resumen a registrar?',
+ 'Language' => 'Lenguaje',
+ 'Last Invoice Number' => 'Último número de factura',
+ 'Last Numbers & Default Accounts' => 'Últimos números y cuentas por omisión',
+ 'Last Purchase Order Number' => 'Último pedido',
+ 'Last Sales Order Number' => 'Número del último presupuesto',
+ 'Liability' => 'Pasivo',
+ 'Link' => 'Enlaces',
+ 'Name' => 'Nombre',
+ 'No' => 'No',
+ 'No email address for' => 'Falta la dirección de correo electrónico de',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de número',
+ 'Parts Inventory' => 'Inventario de artículos',
+ 'Password' => 'Contraseña',
+ 'Payables' => 'Pagos',
+ 'Payment' => 'Pago',
+ 'Phone' => 'Teléfono',
+ 'Preferences saved!' => 'Preferencias guardadas',
+ 'Rate' => 'Tarifa',
+ 'Receivables' => 'Cobros',
+ 'Sales' => 'Ventas',
+ 'Save' => 'Guardar',
+ 'Service Items' => 'Servicios',
+ 'Ship via' => 'Envio por',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Hoja de estilo',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas de impuestos',
+ 'Template saved!' => '¡Plantilla guardada!',
+ 'Transaction reversal enforced for all dates' => 'Se ha forzado la anulación de las transacciones para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Se ha forzado la anulación de las transacciones hasta',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen, no puede suprimir la cuenta!',
+ 'Weight Unit' => 'Unidad de peso',
+ 'Year End' => 'Fin del año fiscal',
+ 'Yes' => 'Si',
+ 'does not exist' => 'no existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'añadir_cuenta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_al_catálogo_de_cuentas' => 'copy_to_coa',
+ 'borrar' => 'delete',
+ 'editar' => 'edit',
+ 'editar_cuenta' => 'edit_account',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ap b/sql-ledger/locale/es/ap
new file mode 100644
index 000000000..1a8f37ce1
--- /dev/null
+++ b/sql-ledger/locale/es/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Gestión se pago',
+ 'AP Transactions' => 'Gestiones de pagos',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Payables Transaction' => 'Añadir cuenta de transacciones a pagar',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Cantidad adeudada',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está seguro de que desea borrar la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => '¡No se puede borrar la transacción!',
+ 'Cannot post payment for a closed period!' => '¡No se puede registrar un pago en un periodo ya cerrado!',
+ 'Cannot post transaction for a closed period!' => '¡No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => '¡No se puede registrar la transacción',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de vencimiento',
+ 'Due Date missing!' => 'Falta la fecha de vencimiento',
+ 'Edit Accounts Payables Transaction' => 'Editar las cuentas de las transacciones a pagar',
+ 'Employee' => 'Colaborador/Empleado',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate for payment missing!' => '¡Falta la tasa de cambio para el pago!',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Número de orden',
+ 'Paid' => 'Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de pago',
+ 'Payments' => 'Vencimientos impagados',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Purchase Invoice' => 'Factura de compras',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => '¡Transacción borrada!',
+ 'Transaction posted!' => '¡Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => '¡Falta el proveedor!',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'gestión_se_pago' => 'ap_transaction',
+ 'añadir_cuenta_de_transacciones_a_pagar' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_las_cuentas_de_las_transacciones_a_pagar' => 'edit_accounts_payables_transaction',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'factura_de_compras' => 'purchase_invoice',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ar b/sql-ledger/locale/es/ar
new file mode 100644
index 000000000..e24b004f3
--- /dev/null
+++ b/sql-ledger/locale/es/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Gestión de cobro',
+ 'AR Transactions' => 'Gestiones de cobros',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Receivables Transaction' => 'Añadir cuenta de transacciones a cobrar',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Cantidad adeudada',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está seguro de que desea borrar la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => '¡No se puede borrar la transacción!',
+ 'Cannot post payment for a closed period!' => '¡No se puede registrar un pago en un periodo ya cerrado!',
+ 'Cannot post transaction for a closed period!' => '¡No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => '¡No se puede registrar la transacción',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => '¡Falta el cliente!',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de vencimiento',
+ 'Due Date missing!' => 'Falta la fecha de vencimiento',
+ 'Edit Accounts Receivables Transaction' => 'Editar las cuentas de las transacciones a cobrar',
+ 'Employee' => 'Colaborador/Empleado',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate for payment missing!' => '¡Falta la tasa de cambio para el pago!',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Número de orden',
+ 'Paid' => 'Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de pago',
+ 'Payments' => 'Vencimientos impagados',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Remaining' => 'Resto',
+ 'Sales Invoice' => 'Facturas de ventas',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => '¡Transacción borrada!',
+ 'Transaction posted!' => '¡Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'gestión_de_cobro' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'facturas_de_ventas' => 'sales_invoice',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/arap b/sql-ledger/locale/es/arap
new file mode 100644
index 000000000..be33676bf
--- /dev/null
+++ b/sql-ledger/locale/es/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Dirección',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Description' => 'Descripción',
+ 'Number' => 'Número',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ca b/sql-ledger/locale/es/ca
new file mode 100644
index 000000000..536d00ac4
--- /dev/null
+++ b/sql-ledger/locale/es/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Cuadro de cuentas',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Description' => 'Descripción',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'Include in Report' => 'Incluir en informe',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'List Transactions' => 'Listar transacciones',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Reference' => 'Referencia',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transacciones' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/es/cp b/sql-ledger/locale/es/cp
new file mode 100644
index 000000000..aa93a34eb
--- /dev/null
+++ b/sql-ledger/locale/es/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => '¡La cantidad no es igual a lo aplicado!',
+ 'Amount missing!' => '¡Falta la cantidad!',
+ 'Applied' => 'Aplicado',
+ 'Cannot post payment!' => '¡No se puede registrar el pago!',
+ 'Cannot process payment for a closed period!' => '¡No se puede procesar un pago de un periodo ya cerrado!',
+ 'Check' => 'Cheque',
+ 'Check printed!' => '¡Cheque impreso!',
+ 'Check printing failed!' => '¡Fallo al imprimir el cheque!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Date missing!' => '¡Falta la fecha!',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'From' => 'Desde',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Facturas',
+ 'Nothing applied!' => '¡No es aplicable a nada!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Pago al completo',
+ 'Payment' => 'Pago',
+ 'Payment posted!' => '¡Pago registrado!',
+ 'Post' => 'Registrar',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Receipt' => 'Recibo',
+ 'Reference' => 'Referencia',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'To' => 'Hasta ',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'registrar' => 'post',
+ 'imprimir' => 'print',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ct b/sql-ledger/locale/es/ct
new file mode 100644
index 000000000..e37ddd88e
--- /dev/null
+++ b/sql-ledger/locale/es/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Añadir',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => '¡No se puede borrar el cliente!',
+ 'Cannot delete vendor!' => '¡No se puede borrar el vendedor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de credito',
+ 'Customer deleted!' => '¡Cliente borrado!',
+ 'Customer saved!' => '¡Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'Delete' => 'Borrar',
+ 'Discount' => 'Descuento',
+ 'E-mail' => 'Correo electrónico',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluir en informe',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nombre',
+ 'Name missing!' => '¡Falta el nombre!',
+ 'Notes' => 'Notas',
+ 'Number' => 'Número',
+ 'Order' => 'Orden',
+ 'Orphaned' => 'Huérfano',
+ 'Phone' => 'Teléfono',
+ 'Save' => 'Guardar',
+ 'Ship to' => 'Destino',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'Taxable' => 'Impuestos gravables',
+ 'Terms: Net' => 'Crédito',
+ 'Transactions exist, cannot delete customer!' => 'Existen transacciones para este cliente, por tanto, no puede borrarlo',
+ 'Transactions exist, cannot delete vendor!' => 'Existen transacciones para este proveedor, por tanto, no puede borrarlo',
+ 'Vendor deleted!' => '¡Proveedor borrado!',
+ 'Vendor saved!' => '¡Proveedor guardado!',
+ 'Vendors' => 'Proveedores',
+ 'days' => 'días',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'añadir' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'factura' => 'invoice',
+ 'orden' => 'order',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/es/gl b/sql-ledger/locale/es/gl
new file mode 100644
index 000000000..10978f9b6
--- /dev/null
+++ b/sql-ledger/locale/es/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Gestión se pago',
+ 'AR Transaction' => 'Gestión de cobro',
+ 'Account' => 'Cuenta',
+ 'Add General Ledger Transaction' => 'Añadir transacción al libro mayor general',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está seguro de que desea borrar la transacción?',
+ 'Asset' => 'Activo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => '¡No se puede borrar la transacción!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en débito y crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => '¡No se puede registrar una transacción sin valor!',
+ 'Cannot post transaction for a closed period!' => '¡No se puede registrar una transacción para un periodo cerrado',
+ 'Confirm!' => 'Confirmar',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Los débitos y créditos están fuera de balance',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit General Ledger Transaction' => 'Editar transacción del libro mayor general',
+ 'Equity' => 'Balance',
+ 'Expense' => 'Gastos',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'GL Transaction' => 'Transacción en el libro mayor',
+ 'General Ledger' => 'Libro mayor general',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir en informe',
+ 'Income' => 'Ingresos',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Liability' => 'Pasivo',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Purchase Invoice' => 'Factura de compras',
+ 'Reference' => 'Referencia',
+ 'Reference missing!' => '¡Falta la referencia!',
+ 'Reports' => 'Informes',
+ 'Sales Invoice' => 'Facturas de ventas',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+ 'Transaction Date missing!' => 'No se ha definido la fecha de la transacción',
+ 'Transaction deleted!' => '¡Transacción borrada!',
+ 'Transaction posted!' => '¡Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'gestión_se_pago' => 'ap_transaction',
+ 'gestión_de_cobro' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'transacción_en_el_libro_mayor' => 'gl_transaction',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'factura_de_compras' => 'purchase_invoice',
+ 'facturas_de_ventas' => 'sales_invoice',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ic b/sql-ledger/locale/es/ic
new file mode 100644
index 000000000..9db330b3f
--- /dev/null
+++ b/sql-ledger/locale/es/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Activo',
+ 'Add' => 'Añadir',
+ 'Add Assembly' => 'Añadir compuesto',
+ 'Add Part' => 'Añadir artículo',
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Add Service' => 'Añadir servicio',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Compuestos',
+ 'Assemblies restocked!' => '¡Compuestos actualizados en almacen!',
+ 'Assembly Number missing!' => 'No se ha definido el número de compuesto',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'Listado de piezas',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Costo de los artículos',
+ 'Cannot delete item already invoiced!' => 'No se puede borrar un artículo ya facturado',
+ 'Cannot delete item on order!' => 'No se puede eliminar un elemento presente en una orden',
+ 'Cannot delete item which is part of an assembly!' => 'No puede eliminar un artículo que es parte de un compuesto',
+ 'Cannot delete item!' => '¡No se puede borrar el artículo!',
+ 'Cannot stock assemblies!' => '¡No se pueden almacenar los compuestos!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Description' => 'Descripción',
+ 'Drawing' => 'Reintegro',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Edit Assembly' => 'Editar compuesto',
+ 'Edit Part' => 'Editar compuesto',
+ 'Edit Service' => 'Editar servicio',
+ 'Expense' => 'Gastos',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'Image' => 'Imagen',
+ 'In-line' => 'Incrustado',
+ 'Include in Report' => 'Incluir en informe',
+ 'Income' => 'Ingresos',
+ 'Individual Items' => 'Artículos individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este compuesto a obsoleto',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este artículo a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser cero',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Item deleted!' => '¡Concepto borrado!',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Last Cost' => 'Ultimo costo',
+ 'Line Total' => 'Total de la línea',
+ 'Link Accounts' => 'Enlazar cuentas',
+ 'List Price' => 'Precio de lista',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'Disponible',
+ 'On Order' => 'En pedido',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Number' => 'Número de orden',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'Ordered' => 'Pedido realizado',
+ 'Orphaned' => 'Huérfano',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Part' => 'Artículo',
+ 'Part Number missing!' => 'No se ha definido el número del artículo',
+ 'Parts' => 'Artículos',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Purchase Order' => 'Pedido',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'Tope de envio',
+ 'Recd' => 'Cobrado',
+ 'Required by' => 'Aceptado el',
+ 'Sales' => 'Ventas',
+ 'Sales Order' => 'Presupuesto',
+ 'Save' => 'Guardar',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sell Price' => 'Precio de venta',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Number missing!' => 'No se ha definido el número de servicio',
+ 'Services' => 'Servicios',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Short' => 'Corto',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Inventariar compuesto',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'To' => 'Hasta ',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Actualizar',
+ 'Updated' => '¡Actualizado!',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'ea' => 'unid.',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'hr' => 'hr',
+ 'sent to printer' => 'enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'añadir' => 'add',
+ 'añadir_compuesto' => 'add_assembly',
+ 'añadir_artículo' => 'add_part',
+ 'añadir_servicio' => 'add_service',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_compuesto' => 'edit_assembly',
+ 'editar_compuesto' => 'edit_part',
+ 'editar_servicio' => 'edit_service',
+ 'guardar' => 'save',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/es/io b/sql-ledger/locale/es/io
new file mode 100644
index 000000000..0f12d08bd
--- /dev/null
+++ b/sql-ledger/locale/es/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'Incrustado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Part' => 'Artículo',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Purchase Order' => 'Pedido',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Cobrado',
+ 'Required by' => 'Aceptado el',
+ 'Sales Order' => 'Presupuesto',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Subject' => 'Asunto',
+ 'To' => 'Hasta ',
+ 'Unit' => 'Unidad',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'sent to printer' => 'enviado a la impresora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/es/ir b/sql-ledger/locale/es/ir
new file mode 100644
index 000000000..0e0aa7bdd
--- /dev/null
+++ b/sql-ledger/locale/es/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Invoice' => 'Añadir factura de compra',
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la factura número',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => '¡No se puede borrar la factura!',
+ 'Cannot post invoice for a closed period!' => '¡No se puede registrar una factura en un periodo ya cerrado!',
+ 'Cannot post invoice!' => '¡No se puede registrar la factura!',
+ 'Cannot post payment for a closed period!' => '¡No se puede registrar un pago en un periodo ya cerrado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Edit Purchase Invoice' => 'Editar factura de compra',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate for payment missing!' => '¡Falta la tasa de cambio para el pago!',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'Incrustado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Invoice deleted!' => '¡Factura borrada!',
+ 'Invoice posted!' => '¡Factura registrada!',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Number' => 'Número de orden',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Part' => 'Artículo',
+ 'Payment date missing!' => 'No se encuentra la fecha de pago',
+ 'Payments' => 'Vencimientos impagados',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Purchase Order' => 'Pedido',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Cobrado',
+ 'Record in' => 'Registrar en',
+ 'Required by' => 'Aceptado el',
+ 'Sales Order' => 'Presupuesto',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => '¡Falta el proveedor!',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'Yes' => 'Si',
+ 'ea' => 'unid.',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'sent to printer' => 'enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'orden' => 'order',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/is b/sql-ledger/locale/es/is
new file mode 100644
index 000000000..c1fa75ab0
--- /dev/null
+++ b/sql-ledger/locale/es/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Invoice' => 'Añadir factura',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la factura número',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => '¡No se puede borrar la factura!',
+ 'Cannot post invoice for a closed period!' => '¡No se puede registrar una factura en un periodo ya cerrado!',
+ 'Cannot post invoice!' => '¡No se puede registrar la factura!',
+ 'Cannot post payment for a closed period!' => '¡No se puede registrar un pago en un periodo ya cerrado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => '¡Falta el cliente!',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Edit Sales Invoice' => 'Edirar factura de venta',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate for payment missing!' => '¡Falta la tasa de cambio para el pago!',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'Incrustado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number' => 'Número de factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Invoice deleted!' => '¡Factura borrada!',
+ 'Invoice posted!' => '¡Factura registrada!',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Number' => 'Número de orden',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Part' => 'Artículo',
+ 'Payment date missing!' => 'No se encuentra la fecha de pago',
+ 'Payments' => 'Vencimientos impagados',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Purchase Order' => 'Pedido',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Cobrado',
+ 'Record in' => 'Registrar en',
+ 'Remaining' => 'Resto',
+ 'Required by' => 'Aceptado el',
+ 'Sales Order' => 'Presupuesto',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Ship via' => 'Envio por',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'Yes' => 'Si',
+ 'ea' => 'unid.',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'sent to printer' => 'enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'orden' => 'order',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'imprimir' => 'print',
+ 'destino' => 'ship_to',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/login b/sql-ledger/locale/es/login
new file mode 100644
index 000000000..f7a7cf017
--- /dev/null
+++ b/sql-ledger/locale/es/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Acerca de',
+ 'Database Host' => 'Máquina servidor de base de datos',
+ 'Dataset' => 'Base de datos',
+ 'Incorrect Dataset version!' => 'Versión de base de datos incorrecta',
+ 'Incorrect Password!' => 'Contraseña incorrecta',
+ 'Licensed to' => 'Adaptado para',
+ 'Login' => 'Entrar',
+ 'Name' => 'Nombre',
+ 'Password' => 'Contraseña',
+ 'User' => 'Usuario',
+ 'Version' => 'Versión',
+ 'You are logged out!' => '¡Ya está desconectado del sistema!',
+ 'You did not enter a name!' => 'No ha introducido el nombre',
+ 'is not a member!' => 'no es miembro',
+ 'localhost' => 'máquina local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'entrar' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/es/menu b/sql-ledger/locale/es/menu
new file mode 100644
index 000000000..d9aa9e0df
--- /dev/null
+++ b/sql-ledger/locale/es/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Cartera de pagos',
+ 'AP Aging' => 'Diario resumido de pagos',
+ 'AR' => 'Cartera de cobros',
+ 'AR Aging' => 'Diario resumido de cobros ',
+ 'Accounting Menu' => 'Menú general',
+ 'Add Account' => 'Añadir cuenta',
+ 'Add Assembly' => 'Añadir compuesto',
+ 'Add Customer' => 'Añadir cliente',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Add Part' => 'Añadir artículo',
+ 'Add Project' => 'Añadir proyecto',
+ 'Add Service' => 'Añadir servicio',
+ 'Add Transaction' => 'Añadir',
+ 'Add Vendor' => 'Añadir proveedor',
+ 'Assemblies' => 'Compuestos',
+ 'Audit Control' => 'Control de auditoría',
+ 'Backup' => 'Copia de seguridad de los datos',
+ 'Balance Sheet' => 'Hoja de balance',
+ 'Cash' => 'Efectivo',
+ 'Chart of Accounts' => 'Cuadro de cuentas',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Clientes',
+ 'General Ledger' => 'Libro mayor general',
+ 'Goods & Services' => 'Bienes y servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Income Statement' => 'Balance de situación',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'List Accounts' => 'Listar cuentas',
+ 'List GIFI' => 'Listar código GIFI',
+ 'Logout' => 'Salir',
+ 'Order Entry' => 'Presupuestos y pedidos',
+ 'Packing List' => 'Albarán',
+ 'Parts' => 'Artículos',
+ 'Payment' => 'Pago',
+ 'Payments' => 'Vencimientos impagados',
+ 'Preferences' => 'Preferencias',
+ 'Projects' => 'Proyectos',
+ 'Purchase Invoice' => 'Factura de compras',
+ 'Purchase Order' => 'Pedido',
+ 'Purchase Orders' => 'Pedidos',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Reconciliation' => 'Reconciliación',
+ 'Reports' => 'Informes',
+ 'Sales Invoice' => 'Facturas de ventas',
+ 'Sales Order' => 'Presupuesto',
+ 'Sales Orders' => 'Presupuestos',
+ 'Save to File' => 'Guardar en un archivo',
+ 'Send by E-Mail' => 'Enviar por correo electrónico',
+ 'Services' => 'Servicios',
+ 'Statement' => 'Estado de cuenta',
+ 'Stock Assembly' => 'Inventariar compuesto',
+ 'Stylesheet' => 'Hoja de estilo',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Impuestos cobrados',
+ 'Tax paid' => 'Impuestos pagados',
+ 'Transactions' => 'Impagados',
+ 'Trial Balance' => 'Balance de comprobación',
+ 'Vendors' => 'Proveedores',
+ 'Version' => 'Versión',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/es/oe b/sql-ledger/locale/es/oe
new file mode 100644
index 000000000..3eb55b9bc
--- /dev/null
+++ b/sql-ledger/locale/es/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Añadir',
+ 'Add Purchase Invoice' => 'Añadir factura de compra',
+ 'Add Purchase Order' => 'Añadir pedido',
+ 'Add Sales Invoice' => 'Añadir factura',
+ 'Add Sales Order' => 'Añadir presupuesto',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la orden número?',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => '¡No se puede borrar el pedido!',
+ 'Cannot save order!' => '¡No se puede guardar el pedido!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de credito',
+ 'Curr' => 'Mon.',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => '¡Falta el cliente!',
+ 'Customer not on file!' => '¡El cliente no existe!',
+ 'Date' => 'Fecha',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail address missing!' => 'No se ha definido el correo electrónico',
+ 'Edit Purchase Order' => 'Editar pedido',
+ 'Edit Sales Order' => 'Editar presupuesto',
+ 'Exchangerate' => 'Tasa de cambio',
+ 'Exchangerate missing!' => '¡Falta la tasa de cambio!',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'In-line' => 'Incrustado',
+ 'Include in Report' => 'Incluir en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'No se ha definido la fecha de la factura',
+ 'Invoice Number missing!' => 'No se ha definido el número de la factura',
+ 'Item not on file!' => 'El concepto no se encuentra en ningún archivo',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se ha definido el número en la fila',
+ 'O' => 'O',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de elaboración',
+ 'Order Date missing!' => 'No se ha definido la fecha de la elaboración',
+ 'Order Number' => 'Número de orden',
+ 'Order Number missing!' => 'No se ha definido el número de la orden',
+ 'Order deleted!' => '¡Orden borrada!',
+ 'Order saved!' => '¡Orden guardada!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Albarán',
+ 'Packing List Date missing!' => 'No se ha definido la fecha del albarán',
+ 'Packing List Number missing!' => 'No se ha definido el número del albarán',
+ 'Part' => 'Artículo',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => '¡No se encuentra el proyecto en la base de datos!',
+ 'Purchase Order' => 'Pedido',
+ 'Purchase Orders' => 'Pedidos',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Cobrado',
+ 'Remaining' => 'Resto',
+ 'Required by' => 'Aceptado el',
+ 'Sales Order' => 'Presupuesto',
+ 'Sales Orders' => 'Presupuestos',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como nuevo',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los artículos siguientes',
+ 'Select from one of the names below' => 'Seleccione uno de los nombres de la lista',
+ 'Select from one of the projects below' => 'Seleccione uno de los proyectos de la lista',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envio',
+ 'Ship to' => 'Destino',
+ 'Ship via' => 'Envio por',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuestos incluidos en el precio',
+ 'Terms: Net' => 'Crédito',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => '¡Falta el proveedor!',
+ 'Vendor not on file!' => '¡No se encuentra el proveedor en la base de datos!',
+ 'What type of item is this?' => '¿De qué tipo es este concepto?',
+ 'Yes' => 'Si',
+ 'days' => 'días',
+ 'ea' => 'unid.',
+ 'emailed to' => 'enviado por correo electrónico a',
+ 'sent to printer' => 'enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'añadir' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'factura' => 'invoice',
+ 'imprimir' => 'print',
+ 'guardar' => 'save',
+ 'guardar_como_nuevo' => 'save_as_new',
+ 'destino' => 'ship_to',
+ 'actualizar' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/es/pe b/sql-ledger/locale/es/pe
new file mode 100644
index 000000000..3599b7eba
--- /dev/null
+++ b/sql-ledger/locale/es/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Añadir',
+ 'Add Project' => 'Añadir proyecto',
+ 'All' => 'Todos',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit Project' => 'Editar proyecto',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Huérfano',
+ 'Project' => 'Proyecto',
+ 'Project Number missing!' => '¡Falta el número de proyecto!',
+ 'Project deleted!' => '¡Proyecto borrado!',
+ 'Project saved!' => '¡Proyecto guardado ',
+ 'Projects' => 'Proyectos',
+ 'Save' => 'Guardar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'añadir' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/es/rc b/sql-ledger/locale/es/rc
new file mode 100644
index 000000000..20183f18f
--- /dev/null
+++ b/sql-ledger/locale/es/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Balance cerrado',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Fecha',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Diferencia',
+ 'Done' => 'Hecho',
+ 'Exchangerate Difference' => 'Diferencia en la tasa cambio a moneda extranjera',
+ 'From' => 'Desde',
+ 'Out of balance!' => '¡Fuera de balance!',
+ 'Payment' => 'Pago',
+ 'Reconciliation' => 'Reconciliación',
+ 'Select all' => 'Guardar todo',
+ 'Source' => 'Fuente',
+ 'Statement Balance' => 'Balance de cuenta',
+ 'To' => 'Hasta ',
+ 'Update' => 'Actualizar',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'hecho' => 'done',
+ 'guardar_todo' => 'select_all',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/es/rp b/sql-ledger/locale/es/rp
new file mode 100644
index 000000000..bce27f7a1
--- /dev/null
+++ b/sql-ledger/locale/es/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Diario resumido de pagos',
+ 'AR Aging' => 'Diario resumido de cobros ',
+ 'Account' => 'Cuenta',
+ 'Accounts' => 'Cuentas',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance Sheet' => 'Hoja de balance',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Efectivo inicial',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar con',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Actual',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => 'Lugar de los decimales',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'E-mail' => 'Correo electrónico',
+ 'E-mail Statement to' => 'Enviar comprobante por correo electrónico a',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'Heading' => 'Encabezado',
+ 'ID' => 'ID',
+ 'In-line' => 'Incrustado',
+ 'Include in Report' => 'Incluir en informe',
+ 'Income Statement' => 'Balance de situación',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'N/A' => 'Sin respuesta',
+ 'Nothing selected!' => '¡No es seleccionado nada!',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Vencimientos impagados',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Receipts' => 'Recibos',
+ 'Report for' => 'Informe para',
+ 'Retained Earnings' => 'Ganacias retenidas',
+ 'Screen' => 'Pantalla',
+ 'Select all' => 'Guardar todo',
+ 'Select postscript or PDF!' => '¡Seleccione postscript o PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estándard',
+ 'Statement' => 'Estado de cuenta',
+ 'Statement sent to' => 'Estado de cuenta enviado a',
+ 'Statements sent to printer!' => '¡Estado de cuenta enviado a la impresora!',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax collected' => 'Impuestos cobrados',
+ 'Tax paid' => 'Impuestos pagados',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balance de comprobación',
+ 'Vendor' => 'Proveedor',
+ 'as at' => 'al',
+ 'collected on sales' => 'ingresado en ventas',
+ 'for Period' => 'para el periodo',
+ 'paid on purchases' => 'pagado en compras',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'correo_electrónico' => 'e_mail',
+ 'imprimir' => 'print',
+ 'guardar_todo' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/COPYING b/sql-ledger/locale/fi/COPYING
new file mode 100644
index 000000000..823094cd2
--- /dev/null
+++ b/sql-ledger/locale/fi/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Finish texts:
+#
+# Author: Petri Leppänen <mpj@mail.htk.fi>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/fi/LANGUAGE b/sql-ledger/locale/fi/LANGUAGE
new file mode 100644
index 000000000..343501411
--- /dev/null
+++ b/sql-ledger/locale/fi/LANGUAGE
@@ -0,0 +1 @@
+Finnish
diff --git a/sql-ledger/locale/fi/admin b/sql-ledger/locale/fi/admin
new file mode 100644
index 000000000..b59d03ba8
--- /dev/null
+++ b/sql-ledger/locale/fi/admin
@@ -0,0 +1,126 @@
+$self{texts} = {
+ 'Access Control' => 'Kulunvalvonta',
+ 'Accounting' => 'Kirjanpito',
+ 'Add User' => 'Lisää käyttäjä',
+ 'Address' => 'Osoite',
+ 'Administration' => 'Ylläpito',
+ 'Administrator' => 'Pääkäyttäjä',
+ 'All Datasets up to date!' => 'Kaikki tietolähteet ajan tasalla',
+ 'Change Admin Password' => 'Muuta pääkäyttäjän salasana',
+ 'Change Password' => 'Muuta salasana',
+ 'Character Set' => 'Näppäimistökartta ',
+ 'Click on login name to edit!' => 'Klikkaa kirjautumisnimeä muokataksesi sitä!',
+ 'Company' => 'Yritys',
+ 'Connect to' => 'Yhdistä',
+ 'Continue' => 'Jatka',
+ 'Create Chart of Accounts' => 'Luo tilikartta',
+ 'Create Dataset' => 'Luo tietolähteet',
+ 'DBI not installed!' => 'DBI ei ole asennettu!',
+ 'Database' => 'Tietokanta',
+ 'Database Administration' => 'Tietokannan ylläpito',
+ 'Database Driver not checked!' => 'Tietokanta-ajuria ei ole tarkastettu',
+ 'Database User missing!' => 'Tietokannan käyttäjä puuttuu',
+ 'Dataset' => 'Tietolähde',
+ 'Dataset missing!' => 'Tietolähde puuttuu',
+ 'Dataset updated!' => 'Tietolähde päivitetty',
+ 'Date Format' => 'Päiväyksen muoto',
+ 'Delete' => 'Poista',
+ 'Delete Dataset' => 'Poista tietolähde',
+ 'Directory' => 'Hakemisto',
+ 'Driver' => 'Ajuri',
+ 'Dropdown Limit' => 'Pudotusvalikkon rivimäärä',
+ 'E-mail' => 'Sähköposti',
+ 'Edit User' => 'Muokkaa käyttäjää',
+ 'Existing Datasets' => 'Nykyiset tietolähteet',
+ 'Fax' => 'Faksi',
+ 'File locked!' => 'Tiedosto lukittu',
+ 'Host' => 'Isäntätietokone',
+ 'Hostname missing!' => 'Isäntätietokoneen nimi puuttuu',
+ 'Incorrect Password!' => 'Väärä salasana!',
+ 'Language' => 'Kieli',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Jätä isäntä- ja porttikentät tyhjiksi mikäli et halua ottaa etäyhteyttä.',
+ 'Login' => 'Kirjaudu',
+ 'Multibyte Encoding' => 'Itämaisten kielten tuki',
+ 'Name' => 'Nimi',
+ 'New Templates' => 'Uusi malli',
+ 'No Database Drivers available!' => 'Tietokanta-ajuria ei saatavilla!',
+ 'No Dataset selected!' => 'Ei tietolähdettä valittuna!',
+ 'Nothing to delete!' => 'Ei poistettavaa!',
+ 'Number Format' => 'Numeron muoto',
+ 'Oracle Database Administration' => 'Oracle-tietokannan ylläpito',
+ 'Password' => 'Salasana',
+ 'Password changed!' => 'Salasana muutettu!',
+ 'Pg Database Administration' => 'Postgres tietokannan ylläpito',
+ 'Phone' => 'Puhelin',
+ 'Port' => 'Portti',
+ 'Port missing!' => 'Portti puuttuu!',
+ 'Printer' => 'Kirjoitin',
+ 'Save' => 'Tallenna',
+ 'Select a Dataset to delete and press "Continue"' => 'Valitse poistettava tietolähde ja
+paina jatka',
+ 'Setup Templates' => 'Aseta mallit',
+ 'Ship via' => 'Lähetä kautta',
+ 'Signature' => 'Allekirjoitus',
+ 'Stylesheet' => 'Tyylimalli',
+ 'Templates' => 'Mallit',
+ 'The following Datasets are not in use and can be deleted' => 'Seuraavat tietolähteet
+eivät ole käytössä ja voidaan poistaa',
+ 'The following Datasets need to be updated' => 'Seuraavat tietolähteet päivitettävä',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Tämä on olemassa olevien lähteiden ennakkotarkistus. Mitään ei luoda tai poisteta tässä vaiheessa!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Lisätäksesi käyttäjän ryhmään muokkaa nimeä, muuta kirjautumisnimi ja tallenna.',
+ 'Update Dataset' => 'Päivitä tietolähde',
+ 'Use Templates' => 'Käytä mallia',
+ 'User' => 'Käyttäjä',
+ 'User deleted!' => 'Käyttäjä poistettu!',
+ 'User saved!' => 'Käyttäjä tallennettu!',
+ 'Version' => 'Versio',
+ 'You must enter a host and port for local and remote connections!' => 'Sinun täytyy antaa isäntäkone ja portti paikallisille ja etäyhteyksille!',
+ 'does not exist' => 'ei löydy',
+ 'is already a member!' => 'on jo käyttäjä',
+ 'localhost' => 'paikallinen tietokone',
+ 'successfully created!' => 'onnistuneesti luotu',
+ 'successfully deleted!' => 'onnistuneesti poistettu',
+ 'website' => 'www-sivu',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'lisää_käyttäjä' => 'add_user',
+ 'muuta_pääkäyttäjän_salasana' => 'change_admin_password',
+ 'muuta_salasana' => 'change_password',
+ 'jatka' => 'continue',
+ 'luo_tietolähteet' => 'create_dataset',
+ 'poista' => 'delete',
+ 'poista_tietolähde' => 'delete_dataset',
+ 'kirjaudu' => 'login',
+ 'oracle_tietokannan_ylläpito' => 'oracle_database_administration',
+ 'postgres_tietokannan_ylläpito' => 'pg_database_administration',
+ 'tallenna' => 'save',
+ 'päivitä_tietolähde' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/all b/sql-ledger/locale/fi/all
new file mode 100644
index 000000000..a3c22c507
--- /dev/null
+++ b/sql-ledger/locale/fi/all
@@ -0,0 +1,494 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Ostot',
+ 'AP Aging' => 'Erääntyvät ostolaskut',
+ 'AP Transaction' => 'Ostotapahtuma',
+ 'AP Transactions' => 'Ostotapahtumat',
+ 'AR' => 'Myynnit',
+ 'AR Aging' => 'Erääntyvät myyntilaskut',
+ 'AR Transaction' => 'Myyntitapahtuma',
+ 'AR Transactions' => 'Myyntitapahtumat',
+ 'About' => 'Lisätietoja',
+ 'Access Control' => 'Kulunvalvonta',
+ 'Account' => 'Tili',
+ 'Account Number' => 'Tilinumero',
+ 'Account Number missing!' => 'Tilinumero puuttuu',
+ 'Account Type' => 'Tilityyppi',
+ 'Account Type missing!' => 'Tilityyppi puuttuu',
+ 'Account deleted!' => 'Tili poistettu',
+ 'Account saved!' => 'Tili lisätty',
+ 'Accounting' => 'Kirjanpito',
+ 'Accounting Menu' => 'Kirjanpitovalikko',
+ 'Accounts' => 'Tilit',
+ 'Active' => 'Avoin',
+ 'Add' => 'Lisää',
+ 'Add Account' => 'Lisää tili',
+ 'Add Accounts Payables Transaction' => 'Lisää ostotapahtuma',
+ 'Add Accounts Receivables Transaction' => 'Lisää myyntitapahtuma',
+ 'Add Assembly' => 'Lisää tuote',
+ 'Add Customer' => 'Lisää asiakas',
+ 'Add GIFI' => 'Lisää GIFI',
+ 'Add General Ledger Transaction' => 'Lisää pääkirjatapahtuma',
+ 'Add Part' => 'Lisää raaka-aine/tarvike',
+ 'Add Project' => 'Lisää projekti',
+ 'Add Purchase Invoice' => 'Lisää ostolasku',
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Invoice' => 'Lisää myyntilasku',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Add Service' => 'Lisää palvelu',
+ 'Add Transaction' => 'Lisää tapahtuma',
+ 'Add User' => 'Lisää käyttäjä',
+ 'Add Vendor' => 'Lisää toimittaja',
+ 'Address' => 'Osoite',
+ 'Administration' => 'Ylläpito',
+ 'Administrator' => 'Pääkäyttäjä',
+ 'All' => 'Kaikki',
+ 'All Datasets up to date!' => 'Kaikki tietolähteet ajan tasalla',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Erääntyvä summa',
+ 'Amount does not equal applied!' => 'Määrä eri kuin sovellettu',
+ 'Amount missing!' => 'Määrä puuttuu',
+ 'Applied' => 'Sovellettu',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Invoice Number' => 'Haluatko poistaa laskun numero?',
+ 'Are you sure you want to delete Order Number' => 'Haluatko poistaa tilauksen numero',
+ 'Are you sure you want to delete Transaction' => 'Haluatko poistaa viennin?',
+ 'Assemblies' => 'Tuotteet',
+ 'Assemblies restocked!' => 'Tuotteet viety varastoon',
+ 'Assembly Number missing!' => 'Tuotenumero puuttuu!',
+ 'Asset' => 'Vastaavaa',
+ 'Attachment' => 'Liite',
+ 'Audit Control' => 'Tilien tarkistus',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'BOM' => 'Materiaalilista',
+ 'Backup' => 'Varmuuskopio',
+ 'Backup sent to' => 'Varmuuskopio lähetetty',
+ 'Balance' => 'Tase',
+ 'Balance Sheet' => 'Taselaskelma',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'Books are open' => 'Kirjat ovat avoinna',
+ 'Bought' => 'Ostettu',
+ 'Business Number' => 'Y-numero',
+ 'C' => 'C',
+ 'COGS' => 'Myydyn tuotteen kulut',
+ 'Cannot delete account!' => 'Tiliä ei voi poistaa!',
+ 'Cannot delete customer!' => 'Asiakasta ei voi poistaa!',
+ 'Cannot delete default account!' => 'Oletustiliä ei voi poistaa!',
+ 'Cannot delete invoice!' => 'Laskua ei voi poistaa!',
+ 'Cannot delete item already invoiced!' => 'Laskutettua nimikettä ei voi poistaa!',
+ 'Cannot delete item on order!' => 'Nimikettä tilauksessa ei voi poistaa',
+ 'Cannot delete item which is part of an assembly!' => 'Tuotteen raaka-ainetta/tarviketta ei voi poistaa!',
+ 'Cannot delete item!' => 'Nimikettä ei voi poistaa!',
+ 'Cannot delete order!' => 'Tilausta ei voi poistaa!',
+ 'Cannot delete transaction!' => 'Vientiä ei voi poistaa',
+ 'Cannot delete vendor!' => 'Toimittajaa ei voi poistaa!',
+ 'Cannot have a value in both Debit and Credit!' => 'Arvo sekä Kreditissä että Debetissä kielletty!',
+ 'Cannot post a transaction without a value!' => 'Viennin kirjaus ilman arvoa kielletty!',
+ 'Cannot post invoice for a closed period!' => 'Laskun kirjaus suljetulle ajanjaksolle kielletty!',
+ 'Cannot post invoice!' => 'Laskua ei voi kirjata!',
+ 'Cannot post payment for a closed period!' => 'Maksun kirjaus suljetulle ajanjaksolle kielletty ',
+ 'Cannot post payment!' => 'Maksua ei voi kirjata!',
+ 'Cannot post transaction for a closed period!' => 'Viennin kirjaus suljetulle ajanjaksolle kielletty',
+ 'Cannot post transaction!' => 'Vientiä ei voi kirjata',
+ 'Cannot process payment for a closed period!' => 'Suljetun ajanjakson maksua ei voi käsitellä',
+ 'Cannot save account!' => 'Tilin tallennus ei onnistu!',
+ 'Cannot save order!' => 'Tilauksen tallennus ei onnistu!',
+ 'Cannot save preferences!' => 'Asetuksien tallennus ei onnistu!',
+ 'Cannot stock assemblies!' => 'Tuotteiden varastointi ei onnistu!',
+ 'Cash' => 'Käteiskauppa',
+ 'Cash based' => 'Käteiseen perustuva',
+ 'Cc' => 'Kopio',
+ 'Change Admin Password' => 'Muuta pääkäyttäjän salasana',
+ 'Change Password' => 'Muuta salasana',
+ 'Character Set' => 'Näppäimistökartta ',
+ 'Chart of Accounts' => 'Tilikartta',
+ 'Check' => 'Sekki',
+ 'Check printed!' => 'Sekki tulostettu!',
+ 'Check printing failed!' => 'Sekin tulostus epäonnistui!',
+ 'Cleared Balance' => 'Tarkistettu tase',
+ 'Click on login name to edit!' => 'Klikkaa kirjautumisnimeä muokataksesi sitä!',
+ 'Close Books up to' => 'Sulje kirjat hetkeen',
+ 'Closed' => 'Suljettu',
+ 'Company' => 'Yritys',
+ 'Compare to' => 'verrattuna',
+ 'Confirm!' => 'Vahvista!',
+ 'Connect to' => 'Yhdistä',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Copy to COA' => 'Kopioi tilikarttaan',
+ 'Create Chart of Accounts' => 'Luo tilikartta',
+ 'Create Dataset' => 'Luo tietolähteet',
+ 'Credit' => 'Kredit',
+ 'Credit Limit' => 'Luottoraja',
+ 'Curr' => 'Valuutta',
+ 'Currency' => 'Valuutta',
+ 'Current' => 'Erääntyy',
+ 'Customer' => 'Asiakas',
+ 'Customer deleted!' => 'Asiakas poistettu!',
+ 'Customer missing!' => 'Asiakas puuttuu!',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Customer saved!' => 'Asiakas tallennettu!',
+ 'Customers' => 'Asiakkaat',
+ 'DBI not installed!' => 'DBI ei ole asennettu!',
+ 'Database' => 'Tietokanta',
+ 'Database Administration' => 'Tietokannan ylläpito',
+ 'Database Driver not checked!' => 'Tietokanta-ajuria ei ole tarkastettu',
+ 'Database Host' => 'Tietokannan isäntä',
+ 'Database User missing!' => 'Tietokannan käyttäjä puuttuu',
+ 'Dataset' => 'Tietolähde',
+ 'Dataset missing!' => 'Tietolähde puuttuu',
+ 'Dataset updated!' => 'Tietolähde päivitetty',
+ 'Date' => 'Päiväys',
+ 'Date Due' => 'Eräpäivä',
+ 'Date Format' => 'Päiväyksen muoto',
+ 'Date Paid' => 'Maksupäivä',
+ 'Date missing!' => 'Päiväys puuttuu',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet ja kredit erisuuruiset',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Decimalplaces' => 'Desimaalipaikkoja',
+ 'Delete' => 'Poista',
+ 'Delete Account' => 'Poista tili',
+ 'Delete Dataset' => 'Poista tietolähde',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Deposit' => 'Rahatallennus',
+ 'Description' => 'Kuvaus',
+ 'Difference' => 'Ero',
+ 'Directory' => 'Hakemisto',
+ 'Discount' => 'Alennus',
+ 'Done' => 'Suoritettu!',
+ 'Drawing' => 'Piirros',
+ 'Driver' => 'Ajuri',
+ 'Dropdown Limit' => 'Pudotusvalikkon rivimäärä',
+ 'Due' => 'Eräpv',
+ 'Due Date' => 'Eräpäivä',
+ 'Due Date missing!' => 'Eräpäivä puuttuu!',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail Statement to' => 'Sähköpostilla tiliote kenelle',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Edit' => 'Muokkaa',
+ 'Edit Account' => 'Muokkaa tiliä',
+ 'Edit Accounts Payables Transaction' => 'Muokkaa ostovientiä',
+ 'Edit Accounts Receivables Transaction' => 'Muokkaa myyntivientiä',
+ 'Edit Assembly' => 'Muokkaa tuotetta',
+ 'Edit Customer' => 'Muokkaa asiakas',
+ 'Edit GIFI' => 'Muokkaa GIFI',
+ 'Edit General Ledger Transaction' => 'Muokkaa pääkirjavientiä',
+ 'Edit Part' => 'Muokkaa raaka-ainetta/tarviketta',
+ 'Edit Preferences for' => 'Muokkaa asetuksia',
+ 'Edit Project' => 'Muokkaa projektia',
+ 'Edit Purchase Invoice' => 'Muokkaa ostolaskua',
+ 'Edit Purchase Order' => 'Muokkaa ostotilausta',
+ 'Edit Sales Invoice' => 'Muokkaa myyntilaskua',
+ 'Edit Sales Order' => 'Muokkaa myyntitilausta',
+ 'Edit Service' => 'Muokkaa palvelua',
+ 'Edit Template' => 'Muokkaa mallia',
+ 'Edit User' => 'Muokkaa käyttäjää',
+ 'Edit Vendor' => 'Muokkaa ',
+ 'Employee' => 'Työntekijä',
+ 'Enforce transaction reversal for all dates' => 'Pakota muunnos kaikille viennille',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Merkitse käyttämäsi valuutat 3 kirjaimella ja erota ne kaksoispisteellä, esim.(EUR:USD:SEK).',
+ 'Equity' => 'Oma pääoma',
+ 'Exch' => 'Vaihtokurssi',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate Difference' => 'Vaihtokurssin ero',
+ 'Exchangerate for payment missing!' => 'Maksun vaihtokurssi puuttuu',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Existing Datasets' => 'Nykyiset tietolähteet',
+ 'Expense' => 'Menot',
+ 'Expense Account' => 'Menotili',
+ 'Expense/Asset' => 'Menot/Varat',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'File locked!' => 'Tiedosto lukittu',
+ 'Foreign Exchange Gain' => 'Vaihtokurssivoitto',
+ 'Foreign Exchange Loss' => 'Vaihtokurssitappio',
+ 'From' => 'Alkaen',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI poistettu!',
+ 'GIFI missing!' => 'GIFI puuttuu!',
+ 'GIFI saved!' => 'GIFI tallennettu!',
+ 'GL Transaction' => 'Pääkirjavienti',
+ 'General Ledger' => 'Pääkirja',
+ 'Goods & Services' => 'Hyödykkeet ja palvelut',
+ 'HTML Templates' => 'HTML mallit',
+ 'Heading' => 'Otsikko',
+ 'Host' => 'Isäntätietokone',
+ 'Hostname missing!' => 'Isäntätietokoneen nimi puuttuu',
+ 'ID' => 'ID',
+ 'Image' => 'Kuva',
+ 'In-line' => 'Linjalla',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Include in drop-down menus' => 'Sisällytä pudotusvalikkoon',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Liitetäänkö tämä tili
+asiakas/toimittaja-lomakkeisiin merkitäkseen hänet verokelpoiseksi!',
+ 'Income' => 'Tulot',
+ 'Income Account' => 'Tulotili',
+ 'Income Statement' => 'Tuloslaskelma',
+ 'Incorrect Dataset version!' => 'Väärä tietolähdeversio!',
+ 'Incorrect Password!' => 'Väärä salasana!',
+ 'Individual Items' => 'Yksittäiset nimikkeet',
+ 'Inventory' => 'Varasto',
+ 'Inventory Account' => 'Varastotili',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Tuotteen varaston on oltava nolla ennen asettamista epäkurantiksi!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Raaka-aineen/tarvikkeen varaston määrä on oltava nolla ennen asettamista epäkurantiksi!',
+ 'Inventory quantity must be zero!' => 'Varaston määrä on oltava nolla!',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date' => 'Laskun päiväys',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Invoice deleted!' => 'Lasku poistettu!',
+ 'Invoice posted!' => 'Lasku kirjattu!',
+ 'Invoices' => 'Laskut',
+ 'Is this a summary account to record' => 'Onko tämä tallennettava yhteenvetotili?',
+ 'Item deleted!' => 'Nimike poistettu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'LaTeX Templates' => 'LaTeX mallit',
+ 'Language' => 'Kieli',
+ 'Last Cost' => 'Edellinen kustannus',
+ 'Last Invoice Number' => 'Edellinen laskunumero',
+ 'Last Numbers & Default Accounts' => 'Edelliset numerot ja oletustilit',
+ 'Last Purchase Order Number' => 'Edellisen ostotilauksen numero',
+ 'Last Sales Order Number' => 'Edellinen myyntinumero',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Jätä isäntä- ja porttikentät tyhjiksi mikäli et halua ottaa etäyhteyttä.',
+ 'Liability' => 'Vastattavaa',
+ 'Licensed to' => 'Lisenssin omistaja',
+ 'Line Total' => 'Rivi yhteensä',
+ 'Link' => 'Linkki',
+ 'Link Accounts' => 'Linkkaa tilit',
+ 'List Accounts' => 'Listaa tilit',
+ 'List GIFI' => 'Listaa GIFI',
+ 'List Price' => 'Listaa hinnat',
+ 'List Transactions' => 'Listaa viennit',
+ 'Login' => 'Kirjaudu',
+ 'Logout' => 'Kirjaudu ulos',
+ 'Make' => 'Valmistaja',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Microfiche' => 'Mikrokuva',
+ 'Model' => 'Tuotenimi',
+ 'Multibyte Encoding' => 'Itämaisten kielten tuki',
+ 'N/A' => 'Ei saatavilla',
+ 'Name' => 'Nimi',
+ 'Name missing!' => 'Nimi puuttuu!',
+ 'New Templates' => 'Uusi malli',
+ 'No' => 'Ei',
+ 'No Database Drivers available!' => 'Tietokanta-ajuria ei saatavilla!',
+ 'No Dataset selected!' => 'Ei tietolähdettä valittuna!',
+ 'No email address for' => 'Sähköpostiosoite puuttuu',
+ 'No.' => 'no',
+ 'Notes' => 'Lisätietoja',
+ 'Nothing applied!' => 'Mitään soveltamatta!',
+ 'Nothing selected!' => 'Mitään valitsematta!',
+ 'Nothing to delete!' => 'Ei poistettavaa!',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number Format' => 'Numeron muoto',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'O' => 'O',
+ 'Obsolete' => 'Epäkurantti',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'On Hand' => 'Varastossa',
+ 'On Order' => 'Tilauksesta',
+ 'Open' => 'Avoinna',
+ 'Oracle Database Administration' => 'Oracle-tietokannan ylläpito',
+ 'Order' => 'Tilaus',
+ 'Order Date' => 'Tilauspäivämäärä',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Entry' => 'Tilauksen kirjaus',
+ 'Order Number' => 'Tilausnumero',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'Order deleted!' => 'Tilaus poistettu!',
+ 'Order saved!' => 'Tilaus tallennettu!',
+ 'Ordered' => 'Tilattu',
+ 'Orphaned' => 'Hylätyt',
+ 'Out of balance!' => 'Ei tasapainossa',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Paid' => 'Maksettu',
+ 'Paid in full' => 'Täysin maksettu',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Part Number missing!' => 'Raaka-aine/tarvikenumero puuttuu!',
+ 'Parts' => 'Raaka-aineet/tarvikkeet',
+ 'Parts Inventory' => 'Raaka-aine/tarvikevarasto',
+ 'Password' => 'Salasana',
+ 'Password changed!' => 'Salasana muutettu!',
+ 'Payables' => 'Maksettavaa',
+ 'Payment' => 'Maksu',
+ 'Payment date missing!' => 'Maksupäivä puuttuu!',
+ 'Payment posted!' => 'Maksu kirjattu!',
+ 'Payments' => 'Maksut',
+ 'Pg Database Administration' => 'Postgres tietokannan ylläpito',
+ 'Phone' => 'Puhelin',
+ 'Port' => 'Portti',
+ 'Port missing!' => 'Portti puuttuu!',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Asetukset',
+ 'Preferences saved!' => 'Asetukset tallennettu!',
+ 'Price' => 'Hinta',
+ 'Print' => 'Tulosta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Project Number missing!' => 'Projektinumero puuttuu!',
+ 'Project deleted!' => 'Projekti poistettu!',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Project saved!' => 'Projekti tallennettu!',
+ 'Projects' => 'Projektit',
+ 'Purchase Invoice' => 'Ostolasku',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Purchase Orders' => 'Ostotilaukset',
+ 'Qty' => 'Määrä',
+ 'ROP' => 'Uudelleentilausraja',
+ 'Rate' => 'Kurssi',
+ 'Recd' => 'Vastaanotettu',
+ 'Receipt' => 'Kuitti',
+ 'Receipts' => 'Kuitit',
+ 'Receivables' => 'Saamiset',
+ 'Reconciliation' => 'Sovitus',
+ 'Record in' => 'Talleta tilille',
+ 'Reference' => 'Viite',
+ 'Reference missing!' => 'Viite puuttuu',
+ 'Remaining' => 'Jäljellä',
+ 'Report for' => 'Raportti',
+ 'Reports' => 'Raportit',
+ 'Required by' => 'Toimituspäivä',
+ 'Retained Earnings' => 'Käyttörahasto\jakamaton voitto',
+ 'Sales' => 'Myynti',
+ 'Sales Invoice' => 'Myyntilasku',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Sales Orders' => 'Tilausvahvistukset',
+ 'Save' => 'Tallenna',
+ 'Save as new' => 'Tallenna uutena',
+ 'Save to File' => 'Tallenna tiedostoon',
+ 'Screen' => 'Näyttö',
+ 'Select a Dataset to delete and press "Continue"' => 'Valitse poistettava tietolähde ja
+paina jatka',
+ 'Select all' => 'Valitse kaikki',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sell Price' => 'Myyntihinta',
+ 'Send by E-Mail' => 'Lähetä sähköpostilla',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Service Items' => 'Palvelun nimikkeet',
+ 'Service Number missing!' => 'Palvelun numero puuttuu',
+ 'Services' => 'Palvelut',
+ 'Setup Templates' => 'Aseta mallit',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Ship via' => 'Lähetä kautta',
+ 'Short' => 'Lyhytaikaiset',
+ 'Signature' => 'Allekirjoitus',
+ 'Sold' => 'Myyty',
+ 'Source' => 'Lähde',
+ 'Standard' => 'Vakio',
+ 'Statement' => 'Tiliote',
+ 'Statement Balance' => 'Tiliotteen tase',
+ 'Statement sent to' => 'Tiliote lähetetty',
+ 'Statements sent to printer!' => 'Tiliotteet lähetetty tulostimelle!',
+ 'Stock Assembly' => 'Varastoi tuote',
+ 'Stylesheet' => 'Tyylimalli',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'System' => 'Järjestelmä',
+ 'Tax' => 'Vero',
+ 'Tax Accounts' => 'Verotilit',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'Tax collected' => 'Veroa kerätty',
+ 'Tax paid' => 'Veroa maksettu ',
+ 'Taxable' => 'Verotettavaa',
+ 'Template saved!' => 'Malli tallennettu',
+ 'Templates' => 'Mallit',
+ 'Terms: Net' => 'Maksuehto',
+ 'The following Datasets are not in use and can be deleted' => 'Seuraavat tietolähteet
+eivät ole käytössä ja voidaan poistaa',
+ 'The following Datasets need to be updated' => 'Seuraavat tietolähteet päivitettävä',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Tämä on olemassa olevien lähteiden ennakkotarkistus. Mitään ei luoda tai poisteta tässä vaiheessa!',
+ 'To' => 'Hetkeen',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Lisätäksesi käyttäjän ryhmään muokkaa nimeä, muuta kirjautumisnimi ja tallenna.',
+ 'Top Level' => 'Ylin taso',
+ 'Total' => 'Yhteensä',
+ 'Transaction Date missing!' => 'Viennin päiväys puuttuu!',
+ 'Transaction deleted!' => 'Vienti poistettu!',
+ 'Transaction posted!' => 'Vienti kirjattu!',
+ 'Transaction reversal enforced for all dates' => 'Kirjaukset muunnettu kaikille päiväyksille',
+ 'Transaction reversal enforced up to' => 'Kirjaukset muunnnettu hetkeen ',
+ 'Transactions' => 'Tapahtumat',
+ 'Transactions exist, cannot delete customer!' => 'Vientejä olemassa. Asiakasta ei voi poistaa!',
+ 'Transactions exist, cannot delete vendor!' => 'Vientejä olemassa. Toimittajaa ei voi poistaa!',
+ 'Transactions exist; cannot delete account!' => 'Vientejä olemassa. Tiliä ei voi poistaa!',
+ 'Trial Balance' => 'Saldolista',
+ 'Unit' => 'Yksikkö',
+ 'Unit of measure' => 'mittayksikkö',
+ 'Update' => 'Päivitä',
+ 'Update Dataset' => 'Päivitä tietolähde',
+ 'Updated' => 'Päivitetty',
+ 'Use Templates' => 'Käytä mallia',
+ 'User' => 'Käyttäjä',
+ 'User deleted!' => 'Käyttäjä poistettu!',
+ 'User saved!' => 'Käyttäjä tallennettu!',
+ 'Vendor' => 'Toimittaja',
+ 'Vendor deleted!' => 'Toimittaja poistettu!',
+ 'Vendor missing!' => 'Toimittaja puuttuu!',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'Vendor saved!' => 'Toimittaja tallennettu',
+ 'Vendors' => 'Toimittajat',
+ 'Version' => 'Versio',
+ 'Weight' => 'Paino',
+ 'Weight Unit' => 'Painoyksikkö',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'Year End' => 'Tilikauden loppuun',
+ 'Yes' => 'Kyllä',
+ 'You are logged out!' => 'Olet poistunut järjestelmästä',
+ 'You did not enter a name!' => 'Et kirjoittanut nimeä',
+ 'You must enter a host and port for local and remote connections!' => 'Sinun täytyy antaa isäntäkone ja portti paikallisille ja etäyhteyksille!',
+ 'as at' => 'päivänä ',
+ 'collected on sales' => 'Kerätty myynneistä',
+ 'days' => 'päivää',
+ 'does not exist' => 'ei löydy',
+ 'ea' => 'kpl',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'for Period' => 'jaksolta',
+ 'hr' => 't',
+ 'is already a member!' => 'on jo käyttäjä',
+ 'is not a member!' => 'ei ole käyttäjä',
+ 'localhost' => 'paikallinen tietokone',
+ 'paid on purchases' => 'maksettu ostoista',
+ 'sent to printer' => 'lähetetty tulostimelle',
+ 'successfully created!' => 'onnistuneesti luotu',
+ 'successfully deleted!' => 'onnistuneesti poistettu',
+ 'to' => 'Kenelle',
+ 'website' => 'www-sivu',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/am b/sql-ledger/locale/fi/am
new file mode 100644
index 000000000..061e86293
--- /dev/null
+++ b/sql-ledger/locale/fi/am
@@ -0,0 +1,140 @@
+$self{texts} = {
+ 'AP' => 'Ostot',
+ 'AR' => 'Myynnit',
+ 'Account' => 'Tili',
+ 'Account Number' => 'Tilinumero',
+ 'Account Number missing!' => 'Tilinumero puuttuu',
+ 'Account Type' => 'Tilityyppi',
+ 'Account Type missing!' => 'Tilityyppi puuttuu',
+ 'Account deleted!' => 'Tili poistettu',
+ 'Account saved!' => 'Tili lisätty',
+ 'Add Account' => 'Lisää tili',
+ 'Add GIFI' => 'Lisää GIFI',
+ 'Address' => 'Osoite',
+ 'Asset' => 'Vastaavaa',
+ 'Audit Control' => 'Tilien tarkistus',
+ 'Backup sent to' => 'Varmuuskopio lähetetty',
+ 'Books are open' => 'Kirjat ovat avoinna',
+ 'Business Number' => 'Y-numero',
+ 'COGS' => 'Myydyn tuotteen kulut',
+ 'Cannot delete account!' => 'Tiliä ei voi poistaa!',
+ 'Cannot delete default account!' => 'Oletustiliä ei voi poistaa!',
+ 'Cannot save account!' => 'Tilin tallennus ei onnistu!',
+ 'Cannot save preferences!' => 'Asetuksien tallennus ei onnistu!',
+ 'Character Set' => 'Näppäimistökartta ',
+ 'Chart of Accounts' => 'Tilikartta',
+ 'Close Books up to' => 'Sulje kirjat hetkeen',
+ 'Company' => 'Yritys',
+ 'Continue' => 'Jatka',
+ 'Copy to COA' => 'Kopioi tilikarttaan',
+ 'Credit' => 'Kredit',
+ 'Date Format' => 'Päiväyksen muoto',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Poista',
+ 'Delete Account' => 'Poista tili',
+ 'Description' => 'Kuvaus',
+ 'Dropdown Limit' => 'Pudotusvalikkon rivimäärä',
+ 'E-mail' => 'Sähköposti',
+ 'Edit' => 'Muokkaa',
+ 'Edit Account' => 'Muokkaa tiliä',
+ 'Edit GIFI' => 'Muokkaa GIFI',
+ 'Edit Preferences for' => 'Muokkaa asetuksia',
+ 'Edit Template' => 'Muokkaa mallia',
+ 'Enforce transaction reversal for all dates' => 'Pakota muunnos kaikille viennille',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Merkitse käyttämäsi valuutat 3 kirjaimella ja erota ne kaksoispisteellä, esim.(EUR:USD:SEK).',
+ 'Equity' => 'Oma pääoma',
+ 'Expense' => 'Menot',
+ 'Expense Account' => 'Menotili',
+ 'Expense/Asset' => 'Menot/Varat',
+ 'Fax' => 'Faksi',
+ 'Foreign Exchange Gain' => 'Vaihtokurssivoitto',
+ 'Foreign Exchange Loss' => 'Vaihtokurssitappio',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI poistettu!',
+ 'GIFI missing!' => 'GIFI puuttuu!',
+ 'GIFI saved!' => 'GIFI tallennettu!',
+ 'Heading' => 'Otsikko',
+ 'Include in drop-down menus' => 'Sisällytä pudotusvalikkoon',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Liitetäänkö tämä tili
+asiakas/toimittaja-lomakkeisiin merkitäkseen hänet verokelpoiseksi!',
+ 'Income' => 'Tulot',
+ 'Income Account' => 'Tulotili',
+ 'Inventory' => 'Varasto',
+ 'Inventory Account' => 'Varastotili',
+ 'Is this a summary account to record' => 'Onko tämä tallennettava yhteenvetotili?',
+ 'Language' => 'Kieli',
+ 'Last Invoice Number' => 'Edellinen laskunumero',
+ 'Last Numbers & Default Accounts' => 'Edelliset numerot ja oletustilit',
+ 'Last Purchase Order Number' => 'Edellisen ostotilauksen numero',
+ 'Last Sales Order Number' => 'Edellinen myyntinumero',
+ 'Liability' => 'Vastattavaa',
+ 'Link' => 'Linkki',
+ 'Name' => 'Nimi',
+ 'No' => 'Ei',
+ 'No email address for' => 'Sähköpostiosoite puuttuu',
+ 'Number' => 'Numero',
+ 'Number Format' => 'Numeron muoto',
+ 'Parts Inventory' => 'Raaka-aine/tarvikevarasto',
+ 'Password' => 'Salasana',
+ 'Payables' => 'Maksettavaa',
+ 'Payment' => 'Maksu',
+ 'Phone' => 'Puhelin',
+ 'Preferences saved!' => 'Asetukset tallennettu!',
+ 'Rate' => 'Kurssi',
+ 'Receivables' => 'Saamiset',
+ 'Sales' => 'Myynti',
+ 'Save' => 'Tallenna',
+ 'Service Items' => 'Palvelun nimikkeet',
+ 'Ship via' => 'Lähetä kautta',
+ 'Signature' => 'Allekirjoitus',
+ 'Stylesheet' => 'Tyylimalli',
+ 'Tax' => 'Vero',
+ 'Tax Accounts' => 'Verotilit',
+ 'Template saved!' => 'Malli tallennettu',
+ 'Transaction reversal enforced for all dates' => 'Kirjaukset muunnettu kaikille päiväyksille',
+ 'Transaction reversal enforced up to' => 'Kirjaukset muunnnettu hetkeen ',
+ 'Transactions exist; cannot delete account!' => 'Vientejä olemassa. Tiliä ei voi poistaa!',
+ 'Weight Unit' => 'Painoyksikkö',
+ 'Year End' => 'Tilikauden loppuun',
+ 'Yes' => 'Kyllä',
+ 'does not exist' => 'ei löydy',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'lisää_tili' => 'add_account',
+ 'jatka' => 'continue',
+ 'kopioi_tilikarttaan' => 'copy_to_coa',
+ 'poista' => 'delete',
+ 'muokkaa' => 'edit',
+ 'muokkaa_tiliä' => 'edit_account',
+ 'tallenna' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ap b/sql-ledger/locale/fi/ap
new file mode 100644
index 000000000..ba053c8a5
--- /dev/null
+++ b/sql-ledger/locale/fi/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ostotapahtuma',
+ 'AP Transactions' => 'Ostotapahtumat',
+ 'Account' => 'Tili',
+ 'Add Accounts Payables Transaction' => 'Lisää ostotapahtuma',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Erääntyvä summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Transaction' => 'Haluatko poistaa viennin?',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Cannot delete transaction!' => 'Vientiä ei voi poistaa',
+ 'Cannot post payment for a closed period!' => 'Maksun kirjaus suljetulle ajanjaksolle kielletty ',
+ 'Cannot post transaction for a closed period!' => 'Viennin kirjaus suljetulle ajanjaksolle kielletty',
+ 'Cannot post transaction!' => 'Vientiä ei voi kirjata',
+ 'Closed' => 'Suljettu',
+ 'Confirm!' => 'Vahvista!',
+ 'Continue' => 'Jatka',
+ 'Currency' => 'Valuutta',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Date Paid' => 'Maksupäivä',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Description' => 'Kuvaus',
+ 'Due Date' => 'Eräpäivä',
+ 'Due Date missing!' => 'Eräpäivä puuttuu!',
+ 'Edit Accounts Payables Transaction' => 'Muokkaa ostovientiä',
+ 'Employee' => 'Työntekijä',
+ 'Exch' => 'Vaihtokurssi',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate for payment missing!' => 'Maksun vaihtokurssi puuttuu',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date' => 'Laskun päiväys',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Open' => 'Avoinna',
+ 'Order' => 'Tilaus',
+ 'Order Number' => 'Tilausnumero',
+ 'Paid' => 'Maksettu',
+ 'Payment date missing!' => 'Maksupäivä puuttuu!',
+ 'Payments' => 'Maksut',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Purchase Invoice' => 'Ostolasku',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Source' => 'Lähde',
+ 'Subtotal' => 'Välisumma',
+ 'Tax' => 'Vero',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Transaction deleted!' => 'Vienti poistettu!',
+ 'Transaction posted!' => 'Vienti kirjattu!',
+ 'Update' => 'Päivitä',
+ 'Vendor' => 'Toimittaja',
+ 'Vendor missing!' => 'Toimittaja puuttuu!',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'Yes' => 'Kyllä',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ostotapahtuma' => 'ap_transaction',
+ 'lisää_ostotapahtuma' => 'add_accounts_payables_transaction',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'muokkaa_ostovientiä' => 'edit_accounts_payables_transaction',
+ 'kirjaa' => 'post',
+ 'kirjaa_uutena' => 'post_as_new',
+ 'ostolasku' => 'purchase_invoice',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ar b/sql-ledger/locale/fi/ar
new file mode 100644
index 000000000..039402188
--- /dev/null
+++ b/sql-ledger/locale/fi/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Myyntitapahtuma',
+ 'AR Transactions' => 'Myyntitapahtumat',
+ 'Account' => 'Tili',
+ 'Add Accounts Receivables Transaction' => 'Lisää myyntitapahtuma',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Amount Due' => 'Erääntyvä summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Transaction' => 'Haluatko poistaa viennin?',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Cannot delete transaction!' => 'Vientiä ei voi poistaa',
+ 'Cannot post payment for a closed period!' => 'Maksun kirjaus suljetulle ajanjaksolle kielletty ',
+ 'Cannot post transaction for a closed period!' => 'Viennin kirjaus suljetulle ajanjaksolle kielletty',
+ 'Cannot post transaction!' => 'Vientiä ei voi kirjata',
+ 'Closed' => 'Suljettu',
+ 'Confirm!' => 'Vahvista!',
+ 'Continue' => 'Jatka',
+ 'Credit Limit' => 'Luottoraja',
+ 'Currency' => 'Valuutta',
+ 'Customer' => 'Asiakas',
+ 'Customer missing!' => 'Asiakas puuttuu!',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Date Paid' => 'Maksupäivä',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Description' => 'Kuvaus',
+ 'Due Date' => 'Eräpäivä',
+ 'Due Date missing!' => 'Eräpäivä puuttuu!',
+ 'Edit Accounts Receivables Transaction' => 'Muokkaa myyntivientiä',
+ 'Employee' => 'Työntekijä',
+ 'Exch' => 'Vaihtokurssi',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate for payment missing!' => 'Maksun vaihtokurssi puuttuu',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date' => 'Laskun päiväys',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Open' => 'Avoinna',
+ 'Order' => 'Tilaus',
+ 'Order Number' => 'Tilausnumero',
+ 'Paid' => 'Maksettu',
+ 'Payment date missing!' => 'Maksupäivä puuttuu!',
+ 'Payments' => 'Maksut',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Remaining' => 'Jäljellä',
+ 'Sales Invoice' => 'Myyntilasku',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Source' => 'Lähde',
+ 'Subtotal' => 'Välisumma',
+ 'Tax' => 'Vero',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Transaction deleted!' => 'Vienti poistettu!',
+ 'Transaction posted!' => 'Vienti kirjattu!',
+ 'Update' => 'Päivitä',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'Yes' => 'Kyllä',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'myyntitapahtuma' => 'ar_transaction',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'kirjaa' => 'post',
+ 'kirjaa_uutena' => 'post_as_new',
+ 'myyntilasku' => 'sales_invoice',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/arap b/sql-ledger/locale/fi/arap
new file mode 100644
index 000000000..8ba26e19e
--- /dev/null
+++ b/sql-ledger/locale/fi/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Osoite',
+ 'Continue' => 'Jatka',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Description' => 'Kuvaus',
+ 'Number' => 'Numero',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'jatka' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ca b/sql-ledger/locale/fi/ca
new file mode 100644
index 000000000..c5f3b37f5
--- /dev/null
+++ b/sql-ledger/locale/fi/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Tili',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Balance' => 'Tase',
+ 'Chart of Accounts' => 'Tilikartta',
+ 'Credit' => 'Kredit',
+ 'Date' => 'Päiväys',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Description' => 'Kuvaus',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'List Transactions' => 'Listaa viennit',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Reference' => 'Viite',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Subtotal' => 'Välisumma',
+ 'To' => 'Hetkeen',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listaa_viennit' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/cp b/sql-ledger/locale/fi/cp
new file mode 100644
index 000000000..202e8cf2b
--- /dev/null
+++ b/sql-ledger/locale/fi/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Tili',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Amount does not equal applied!' => 'Määrä eri kuin sovellettu',
+ 'Amount missing!' => 'Määrä puuttuu',
+ 'Applied' => 'Sovellettu',
+ 'Cannot post payment!' => 'Maksua ei voi kirjata!',
+ 'Cannot process payment for a closed period!' => 'Suljetun ajanjakson maksua ei voi käsitellä',
+ 'Check' => 'Sekki',
+ 'Check printed!' => 'Sekki tulostettu!',
+ 'Check printing failed!' => 'Sekin tulostus epäonnistui!',
+ 'Continue' => 'Jatka',
+ 'Currency' => 'Valuutta',
+ 'Customer' => 'Asiakas',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Date missing!' => 'Päiväys puuttuu',
+ 'Description' => 'Kuvaus',
+ 'Due' => 'Eräpv',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'From' => 'Alkaen',
+ 'Invoice' => 'Lasku',
+ 'Invoices' => 'Laskut',
+ 'Nothing applied!' => 'Mitään soveltamatta!',
+ 'Number' => 'Numero',
+ 'Paid in full' => 'Täysin maksettu',
+ 'Payment' => 'Maksu',
+ 'Payment posted!' => 'Maksu kirjattu!',
+ 'Post' => 'Kirjaa',
+ 'Print' => 'Tulosta',
+ 'Printer' => 'Kirjoitin',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Receipt' => 'Kuitti',
+ 'Reference' => 'Viite',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'To' => 'Hetkeen',
+ 'Update' => 'Päivitä',
+ 'Vendor' => 'Toimittaja',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'jatka' => 'continue',
+ 'kirjaa' => 'post',
+ 'tulosta' => 'print',
+ 'päivitä' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ct b/sql-ledger/locale/fi/ct
new file mode 100644
index 000000000..186b25dbb
--- /dev/null
+++ b/sql-ledger/locale/fi/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Lisää',
+ 'Address' => 'Osoite',
+ 'All' => 'Kaikki',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Cannot delete customer!' => 'Asiakasta ei voi poistaa!',
+ 'Cannot delete vendor!' => 'Toimittajaa ei voi poistaa!',
+ 'Cc' => 'Kopio',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Credit Limit' => 'Luottoraja',
+ 'Customer deleted!' => 'Asiakas poistettu!',
+ 'Customer saved!' => 'Asiakas tallennettu!',
+ 'Customers' => 'Asiakkaat',
+ 'Delete' => 'Poista',
+ 'Discount' => 'Alennus',
+ 'E-mail' => 'Sähköposti',
+ 'Edit Customer' => 'Muokkaa asiakas',
+ 'Edit Vendor' => 'Muokkaa ',
+ 'Fax' => 'Faksi',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Invoice' => 'Lasku',
+ 'Name' => 'Nimi',
+ 'Name missing!' => 'Nimi puuttuu!',
+ 'Notes' => 'Lisätietoja',
+ 'Number' => 'Numero',
+ 'Order' => 'Tilaus',
+ 'Orphaned' => 'Hylätyt',
+ 'Phone' => 'Puhelin',
+ 'Save' => 'Tallenna',
+ 'Ship to' => 'Toimitusosoite',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'Taxable' => 'Verotettavaa',
+ 'Terms: Net' => 'Maksuehto',
+ 'Transactions exist, cannot delete customer!' => 'Vientejä olemassa. Asiakasta ei voi poistaa!',
+ 'Transactions exist, cannot delete vendor!' => 'Vientejä olemassa. Toimittajaa ei voi poistaa!',
+ 'Vendor deleted!' => 'Toimittaja poistettu!',
+ 'Vendor saved!' => 'Toimittaja tallennettu',
+ 'Vendors' => 'Toimittajat',
+ 'days' => 'päivää',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'lisää' => 'add',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'lasku' => 'invoice',
+ 'tilaus' => 'order',
+ 'tallenna' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/gl b/sql-ledger/locale/fi/gl
new file mode 100644
index 000000000..6a07b153b
--- /dev/null
+++ b/sql-ledger/locale/fi/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ostotapahtuma',
+ 'AR Transaction' => 'Myyntitapahtuma',
+ 'Account' => 'Tili',
+ 'Add General Ledger Transaction' => 'Lisää pääkirjatapahtuma',
+ 'Address' => 'Osoite',
+ 'All' => 'Kaikki',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Transaction' => 'Haluatko poistaa viennin?',
+ 'Asset' => 'Vastaavaa',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Balance' => 'Tase',
+ 'Cannot delete transaction!' => 'Vientiä ei voi poistaa',
+ 'Cannot have a value in both Debit and Credit!' => 'Arvo sekä Kreditissä että Debetissä kielletty!',
+ 'Cannot post a transaction without a value!' => 'Viennin kirjaus ilman arvoa kielletty!',
+ 'Cannot post transaction for a closed period!' => 'Viennin kirjaus suljetulle ajanjaksolle kielletty',
+ 'Confirm!' => 'Vahvista!',
+ 'Continue' => 'Jatka',
+ 'Credit' => 'Kredit',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet ja kredit erisuuruiset',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Description' => 'Kuvaus',
+ 'Edit General Ledger Transaction' => 'Muokkaa pääkirjavientiä',
+ 'Equity' => 'Oma pääoma',
+ 'Expense' => 'Menot',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Pääkirjavienti',
+ 'General Ledger' => 'Pääkirja',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Income' => 'Tulot',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Liability' => 'Vastattavaa',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Purchase Invoice' => 'Ostolasku',
+ 'Reference' => 'Viite',
+ 'Reference missing!' => 'Viite puuttuu',
+ 'Reports' => 'Raportit',
+ 'Sales Invoice' => 'Myyntilasku',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Source' => 'Lähde',
+ 'Subtotal' => 'Välisumma',
+ 'To' => 'Hetkeen',
+ 'Transaction Date missing!' => 'Viennin päiväys puuttuu!',
+ 'Transaction deleted!' => 'Vienti poistettu!',
+ 'Transaction posted!' => 'Vienti kirjattu!',
+ 'Update' => 'Päivitä',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'Yes' => 'Kyllä',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ostotapahtuma' => 'ap_transaction',
+ 'myyntitapahtuma' => 'ar_transaction',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'pääkirjavienti' => 'gl_transaction',
+ 'kirjaa' => 'post',
+ 'kirjaa_uutena' => 'post_as_new',
+ 'ostolasku' => 'purchase_invoice',
+ 'myyntilasku' => 'sales_invoice',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ic b/sql-ledger/locale/fi/ic
new file mode 100644
index 000000000..55f37a123
--- /dev/null
+++ b/sql-ledger/locale/fi/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Avoin',
+ 'Add' => 'Lisää',
+ 'Add Assembly' => 'Lisää tuote',
+ 'Add Part' => 'Lisää raaka-aine/tarvike',
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Add Service' => 'Lisää palvelu',
+ 'Address' => 'Osoite',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Assemblies' => 'Tuotteet',
+ 'Assemblies restocked!' => 'Tuotteet viety varastoon',
+ 'Assembly Number missing!' => 'Tuotenumero puuttuu!',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'BOM' => 'Materiaalilista',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'Bought' => 'Ostettu',
+ 'COGS' => 'Myydyn tuotteen kulut',
+ 'Cannot delete item already invoiced!' => 'Laskutettua nimikettä ei voi poistaa!',
+ 'Cannot delete item on order!' => 'Nimikettä tilauksessa ei voi poistaa',
+ 'Cannot delete item which is part of an assembly!' => 'Tuotteen raaka-ainetta/tarviketta ei voi poistaa!',
+ 'Cannot delete item!' => 'Nimikettä ei voi poistaa!',
+ 'Cannot stock assemblies!' => 'Tuotteiden varastointi ei onnistu!',
+ 'Cc' => 'Kopio',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Description' => 'Kuvaus',
+ 'Drawing' => 'Piirros',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Edit Assembly' => 'Muokkaa tuotetta',
+ 'Edit Part' => 'Muokkaa raaka-ainetta/tarviketta',
+ 'Edit Service' => 'Muokkaa palvelua',
+ 'Expense' => 'Menot',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'Image' => 'Kuva',
+ 'In-line' => 'Linjalla',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Income' => 'Tulot',
+ 'Individual Items' => 'Yksittäiset nimikkeet',
+ 'Inventory' => 'Varasto',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Tuotteen varaston on oltava nolla ennen asettamista epäkurantiksi!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Raaka-aineen/tarvikkeen varaston määrä on oltava nolla ennen asettamista epäkurantiksi!',
+ 'Inventory quantity must be zero!' => 'Varaston määrä on oltava nolla!',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Item deleted!' => 'Nimike poistettu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Last Cost' => 'Edellinen kustannus',
+ 'Line Total' => 'Rivi yhteensä',
+ 'Link Accounts' => 'Linkkaa tilit',
+ 'List Price' => 'Listaa hinnat',
+ 'Make' => 'Valmistaja',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Microfiche' => 'Mikrokuva',
+ 'Model' => 'Tuotenimi',
+ 'Name' => 'Nimi',
+ 'No.' => 'no',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'Obsolete' => 'Epäkurantti',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'On Hand' => 'Varastossa',
+ 'On Order' => 'Tilauksesta',
+ 'Order' => 'Tilaus',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Number' => 'Tilausnumero',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'Ordered' => 'Tilattu',
+ 'Orphaned' => 'Hylätyt',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Part Number missing!' => 'Raaka-aine/tarvikenumero puuttuu!',
+ 'Parts' => 'Raaka-aineet/tarvikkeet',
+ 'Phone' => 'Puhelin',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hinta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Qty' => 'Määrä',
+ 'ROP' => 'Uudelleentilausraja',
+ 'Recd' => 'Vastaanotettu',
+ 'Required by' => 'Toimituspäivä',
+ 'Sales' => 'Myynti',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Save' => 'Tallenna',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sell Price' => 'Myyntihinta',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Service Number missing!' => 'Palvelun numero puuttuu',
+ 'Services' => 'Palvelut',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Short' => 'Lyhytaikaiset',
+ 'Sold' => 'Myyty',
+ 'Stock Assembly' => 'Varastoi tuote',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'Tax' => 'Vero',
+ 'To' => 'Hetkeen',
+ 'Top Level' => 'Ylin taso',
+ 'Total' => 'Yhteensä',
+ 'Unit' => 'Yksikkö',
+ 'Unit of measure' => 'mittayksikkö',
+ 'Update' => 'Päivitä',
+ 'Updated' => 'Päivitetty',
+ 'Weight' => 'Paino',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'ea' => 'kpl',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'hr' => 't',
+ 'sent to printer' => 'lähetetty tulostimelle',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'lisää' => 'add',
+ 'lisää_tuote' => 'add_assembly',
+ 'lisää_raaka_aine/tarvike' => 'add_part',
+ 'lisää_palvelu' => 'add_service',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'muokkaa_tuotetta' => 'edit_assembly',
+ 'muokkaa_raaka_ainetta/tarviketta' => 'edit_part',
+ 'muokkaa_palvelua' => 'edit_service',
+ 'tallenna' => 'save',
+ 'päivitä' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/io b/sql-ledger/locale/fi/io
new file mode 100644
index 000000000..cc147a86e
--- /dev/null
+++ b/sql-ledger/locale/fi/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Address' => 'Osoite',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'Cc' => 'Kopio',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Description' => 'Kuvaus',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'In-line' => 'Linjalla',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Name' => 'Nimi',
+ 'No.' => 'no',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Order' => 'Tilaus',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Phone' => 'Puhelin',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hinta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Qty' => 'Määrä',
+ 'Recd' => 'Vastaanotettu',
+ 'Required by' => 'Toimituspäivä',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Subject' => 'Aihe',
+ 'To' => 'Hetkeen',
+ 'Unit' => 'Yksikkö',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'sent to printer' => 'lähetetty tulostimelle',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'jatka' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/ir b/sql-ledger/locale/fi/ir
new file mode 100644
index 000000000..1070f99a2
--- /dev/null
+++ b/sql-ledger/locale/fi/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Tili',
+ 'Add Purchase Invoice' => 'Lisää ostolasku',
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Invoice Number' => 'Haluatko poistaa laskun numero?',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'Cannot delete invoice!' => 'Laskua ei voi poistaa!',
+ 'Cannot post invoice for a closed period!' => 'Laskun kirjaus suljetulle ajanjaksolle kielletty!',
+ 'Cannot post invoice!' => 'Laskua ei voi kirjata!',
+ 'Cannot post payment for a closed period!' => 'Maksun kirjaus suljetulle ajanjaksolle kielletty ',
+ 'Cc' => 'Kopio',
+ 'Confirm!' => 'Vahvista!',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Currency' => 'Valuutta',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Date Due' => 'Eräpäivä',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Description' => 'Kuvaus',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Edit Purchase Invoice' => 'Muokkaa ostolaskua',
+ 'Exch' => 'Vaihtokurssi',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate for payment missing!' => 'Maksun vaihtokurssi puuttuu',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'In-line' => 'Linjalla',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date' => 'Laskun päiväys',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Invoice deleted!' => 'Lasku poistettu!',
+ 'Invoice posted!' => 'Lasku kirjattu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Name' => 'Nimi',
+ 'No.' => 'no',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Order' => 'Tilaus',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Number' => 'Tilausnumero',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Payment date missing!' => 'Maksupäivä puuttuu!',
+ 'Payments' => 'Maksut',
+ 'Phone' => 'Puhelin',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hinta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Qty' => 'Määrä',
+ 'Recd' => 'Vastaanotettu',
+ 'Record in' => 'Talleta tilille',
+ 'Required by' => 'Toimituspäivä',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Source' => 'Lähde',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Unit' => 'Yksikkö',
+ 'Update' => 'Päivitä',
+ 'Vendor' => 'Toimittaja',
+ 'Vendor missing!' => 'Toimittaja puuttuu!',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'Yes' => 'Kyllä',
+ 'ea' => 'kpl',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'sent to printer' => 'lähetetty tulostimelle',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'tilaus' => 'order',
+ 'kirjaa' => 'post',
+ 'kirjaa_uutena' => 'post_as_new',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/is b/sql-ledger/locale/fi/is
new file mode 100644
index 000000000..da492f944
--- /dev/null
+++ b/sql-ledger/locale/fi/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Tili',
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Invoice' => 'Lisää myyntilasku',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Invoice Number' => 'Haluatko poistaa laskun numero?',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'Cannot delete invoice!' => 'Laskua ei voi poistaa!',
+ 'Cannot post invoice for a closed period!' => 'Laskun kirjaus suljetulle ajanjaksolle kielletty!',
+ 'Cannot post invoice!' => 'Laskua ei voi kirjata!',
+ 'Cannot post payment for a closed period!' => 'Maksun kirjaus suljetulle ajanjaksolle kielletty ',
+ 'Cc' => 'Kopio',
+ 'Confirm!' => 'Vahvista!',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Credit Limit' => 'Luottoraja',
+ 'Currency' => 'Valuutta',
+ 'Customer' => 'Asiakas',
+ 'Customer missing!' => 'Asiakas puuttuu!',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Date Due' => 'Eräpäivä',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Description' => 'Kuvaus',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Edit Sales Invoice' => 'Muokkaa myyntilaskua',
+ 'Exch' => 'Vaihtokurssi',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate for payment missing!' => 'Maksun vaihtokurssi puuttuu',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'In-line' => 'Linjalla',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date' => 'Laskun päiväys',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number' => 'Laskun numero',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Invoice deleted!' => 'Lasku poistettu!',
+ 'Invoice posted!' => 'Lasku kirjattu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Name' => 'Nimi',
+ 'No.' => 'no',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Order' => 'Tilaus',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Number' => 'Tilausnumero',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Payment date missing!' => 'Maksupäivä puuttuu!',
+ 'Payments' => 'Maksut',
+ 'Phone' => 'Puhelin',
+ 'Post' => 'Kirjaa',
+ 'Post as new' => 'Kirjaa uutena',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hinta',
+ 'Print' => 'Tulosta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Qty' => 'Määrä',
+ 'Recd' => 'Vastaanotettu',
+ 'Record in' => 'Talleta tilille',
+ 'Remaining' => 'Jäljellä',
+ 'Required by' => 'Toimituspäivä',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Ship via' => 'Lähetä kautta',
+ 'Source' => 'Lähde',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Unit' => 'Yksikkö',
+ 'Update' => 'Päivitä',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'Yes' => 'Kyllä',
+ 'ea' => 'kpl',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'sent to printer' => 'lähetetty tulostimelle',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'sähköposti' => 'e_mail',
+ 'tilaus' => 'order',
+ 'kirjaa' => 'post',
+ 'kirjaa_uutena' => 'post_as_new',
+ 'tulosta' => 'print',
+ 'toimitusosoite' => 'ship_to',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/login b/sql-ledger/locale/fi/login
new file mode 100644
index 000000000..783ae0559
--- /dev/null
+++ b/sql-ledger/locale/fi/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Lisätietoja',
+ 'Database Host' => 'Tietokannan isäntä',
+ 'Dataset' => 'Tietolähde',
+ 'Incorrect Dataset version!' => 'Väärä tietolähdeversio!',
+ 'Incorrect Password!' => 'Väärä salasana!',
+ 'Licensed to' => 'Lisenssin omistaja',
+ 'Login' => 'Kirjaudu',
+ 'Name' => 'Nimi',
+ 'Password' => 'Salasana',
+ 'User' => 'Käyttäjä',
+ 'Version' => 'Versio',
+ 'You are logged out!' => 'Olet poistunut järjestelmästä',
+ 'You did not enter a name!' => 'Et kirjoittanut nimeä',
+ 'is not a member!' => 'ei ole käyttäjä',
+ 'localhost' => 'paikallinen tietokone',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'kirjaudu' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/menu b/sql-ledger/locale/fi/menu
new file mode 100644
index 000000000..c3cde8b96
--- /dev/null
+++ b/sql-ledger/locale/fi/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Ostot',
+ 'AP Aging' => 'Erääntyvät ostolaskut',
+ 'AR' => 'Myynnit',
+ 'AR Aging' => 'Erääntyvät myyntilaskut',
+ 'Accounting Menu' => 'Kirjanpitovalikko',
+ 'Add Account' => 'Lisää tili',
+ 'Add Assembly' => 'Lisää tuote',
+ 'Add Customer' => 'Lisää asiakas',
+ 'Add GIFI' => 'Lisää GIFI',
+ 'Add Part' => 'Lisää raaka-aine/tarvike',
+ 'Add Project' => 'Lisää projekti',
+ 'Add Service' => 'Lisää palvelu',
+ 'Add Transaction' => 'Lisää tapahtuma',
+ 'Add Vendor' => 'Lisää toimittaja',
+ 'Assemblies' => 'Tuotteet',
+ 'Audit Control' => 'Tilien tarkistus',
+ 'Backup' => 'Varmuuskopio',
+ 'Balance Sheet' => 'Taselaskelma',
+ 'Cash' => 'Käteiskauppa',
+ 'Chart of Accounts' => 'Tilikartta',
+ 'Check' => 'Sekki',
+ 'Customers' => 'Asiakkaat',
+ 'General Ledger' => 'Pääkirja',
+ 'Goods & Services' => 'Hyödykkeet ja palvelut',
+ 'HTML Templates' => 'HTML mallit',
+ 'Income Statement' => 'Tuloslaskelma',
+ 'Invoice' => 'Lasku',
+ 'LaTeX Templates' => 'LaTeX mallit',
+ 'List Accounts' => 'Listaa tilit',
+ 'List GIFI' => 'Listaa GIFI',
+ 'Logout' => 'Kirjaudu ulos',
+ 'Order Entry' => 'Tilauksen kirjaus',
+ 'Packing List' => 'Pakkauslista',
+ 'Parts' => 'Raaka-aineet/tarvikkeet',
+ 'Payment' => 'Maksu',
+ 'Payments' => 'Maksut',
+ 'Preferences' => 'Asetukset',
+ 'Projects' => 'Projektit',
+ 'Purchase Invoice' => 'Ostolasku',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Purchase Orders' => 'Ostotilaukset',
+ 'Receipt' => 'Kuitti',
+ 'Receipts' => 'Kuitit',
+ 'Reconciliation' => 'Sovitus',
+ 'Reports' => 'Raportit',
+ 'Sales Invoice' => 'Myyntilasku',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Sales Orders' => 'Tilausvahvistukset',
+ 'Save to File' => 'Tallenna tiedostoon',
+ 'Send by E-Mail' => 'Lähetä sähköpostilla',
+ 'Services' => 'Palvelut',
+ 'Statement' => 'Tiliote',
+ 'Stock Assembly' => 'Varastoi tuote',
+ 'Stylesheet' => 'Tyylimalli',
+ 'System' => 'Järjestelmä',
+ 'Tax collected' => 'Veroa kerätty',
+ 'Tax paid' => 'Veroa maksettu ',
+ 'Transactions' => 'Tapahtumat',
+ 'Trial Balance' => 'Saldolista',
+ 'Vendors' => 'Toimittajat',
+ 'Version' => 'Versio',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/oe b/sql-ledger/locale/fi/oe
new file mode 100644
index 000000000..bf1f72659
--- /dev/null
+++ b/sql-ledger/locale/fi/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Lisää',
+ 'Add Purchase Invoice' => 'Lisää ostolasku',
+ 'Add Purchase Order' => 'Ostotilaus',
+ 'Add Sales Invoice' => 'Lisää myyntilasku',
+ 'Add Sales Order' => 'Lisää tilausvahvistus',
+ 'Address' => 'Osoite',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Are you sure you want to delete Order Number' => 'Haluatko poistaa tilauksen numero',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Bin' => 'Varastopaikka',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Tilausta ei voi poistaa!',
+ 'Cannot save order!' => 'Tilauksen tallennus ei onnistu!',
+ 'Cc' => 'Kopio',
+ 'Closed' => 'Suljettu',
+ 'Confirm!' => 'Vahvista!',
+ 'Contact' => 'Yhteyshenkilö',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Credit Limit' => 'Luottoraja',
+ 'Curr' => 'Valuutta',
+ 'Currency' => 'Valuutta',
+ 'Customer' => 'Asiakas',
+ 'Customer missing!' => 'Asiakas puuttuu!',
+ 'Customer not on file!' => 'Asiakas ei järjestelmässä!',
+ 'Date' => 'Päiväys',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Delete' => 'Poista',
+ 'Delivery Date' => 'Toimituspäivä',
+ 'Description' => 'Kuvaus',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail address missing!' => 'Sähköpostiosoite puuttuu!',
+ 'Edit Purchase Order' => 'Muokkaa ostotilausta',
+ 'Edit Sales Order' => 'Muokkaa myyntitilausta',
+ 'Exchangerate' => 'Vaihtokurssi',
+ 'Exchangerate missing!' => 'Vaihtokurssi puuttuu',
+ 'Extended' => 'Pidennetty',
+ 'Fax' => 'Faksi',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'ID' => 'ID',
+ 'In-line' => 'Linjalla',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Invoice' => 'Lasku',
+ 'Invoice Date missing!' => 'Laskun päiväys puuttuu!',
+ 'Invoice Number missing!' => 'Laskun numero puuttuu!',
+ 'Item not on file!' => 'Nimikettä ei ole järjestelmässä!',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'Name' => 'Nimi',
+ 'No.' => 'no',
+ 'Notes' => 'Lisätietoja',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Numero puuttuu kannan riviltä',
+ 'O' => 'O',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'Open' => 'Avoinna',
+ 'Order' => 'Tilaus',
+ 'Order Date' => 'Tilauspäivämäärä',
+ 'Order Date missing!' => 'Tilauspäivämäärä puuttuu!',
+ 'Order Number' => 'Tilausnumero',
+ 'Order Number missing!' => 'Tilausnumero puuttuu!',
+ 'Order deleted!' => 'Tilaus poistettu!',
+ 'Order saved!' => 'Tilaus tallennettu!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakkauslista',
+ 'Packing List Date missing!' => 'Pakkauslistan päiväys puuttuu!',
+ 'Packing List Number missing!' => 'Pakkauslistan numero puuttuu!',
+ 'Part' => 'Raaka-aine/tarvike',
+ 'Phone' => 'Puhelin',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Hinta',
+ 'Print' => 'Tulosta',
+ 'Printer' => 'Kirjoitin',
+ 'Project' => 'Projekti',
+ 'Project not on file!' => 'Projekti ei ole järjestelmässä!',
+ 'Purchase Order' => 'Ostotilaus',
+ 'Purchase Orders' => 'Ostotilaukset',
+ 'Qty' => 'Määrä',
+ 'Recd' => 'Vastaanotettu',
+ 'Remaining' => 'Jäljellä',
+ 'Required by' => 'Toimituspäivä',
+ 'Sales Order' => 'Tilausvahvistus',
+ 'Sales Orders' => 'Tilausvahvistukset',
+ 'Save' => 'Tallenna',
+ 'Save as new' => 'Tallenna uutena',
+ 'Screen' => 'Näyttö',
+ 'Select from one of the items below' => 'Valitse yksi nimike alapuolelta',
+ 'Select from one of the names below' => 'Valitse yksi nimi alapuolelta',
+ 'Select from one of the projects below' => 'Valitse yksi projekti alapuolelta',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Service' => 'Palvelu',
+ 'Ship' => 'Lähetä',
+ 'Ship to' => 'Toimitusosoite',
+ 'Ship via' => 'Lähetä kautta',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'Tax' => 'Vero',
+ 'Tax Included' => 'ALV sisältyy ',
+ 'Terms: Net' => 'Maksuehto',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Unit' => 'Yksikkö',
+ 'Update' => 'Päivitä',
+ 'Vendor' => 'Toimittaja',
+ 'Vendor missing!' => 'Toimittaja puuttuu!',
+ 'Vendor not on file!' => 'Toimittajaa ei järjestelmässä!',
+ 'What type of item is this?' => 'Minkä tyyppinen nimike tämä on?',
+ 'Yes' => 'Kyllä',
+ 'days' => 'päivää',
+ 'ea' => 'kpl',
+ 'emailed to' => 'lähetetty sähköpostilla',
+ 'sent to printer' => 'lähetetty tulostimelle',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'lisää' => 'add',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'sähköposti' => 'e_mail',
+ 'lasku' => 'invoice',
+ 'tulosta' => 'print',
+ 'tallenna' => 'save',
+ 'tallenna_uutena' => 'save_as_new',
+ 'toimitusosoite' => 'ship_to',
+ 'päivitä' => 'update',
+ 'kyllä' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/pe b/sql-ledger/locale/fi/pe
new file mode 100644
index 000000000..c9fe2c1f3
--- /dev/null
+++ b/sql-ledger/locale/fi/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Lisää',
+ 'Add Project' => 'Lisää projekti',
+ 'All' => 'Kaikki',
+ 'Continue' => 'Jatka',
+ 'Delete' => 'Poista',
+ 'Description' => 'Kuvaus',
+ 'Edit Project' => 'Muokkaa projektia',
+ 'Number' => 'Numero',
+ 'Orphaned' => 'Hylätyt',
+ 'Project' => 'Projekti',
+ 'Project Number missing!' => 'Projektinumero puuttuu!',
+ 'Project deleted!' => 'Projekti poistettu!',
+ 'Project saved!' => 'Projekti tallennettu!',
+ 'Projects' => 'Projektit',
+ 'Save' => 'Tallenna',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'lisää' => 'add',
+ 'jatka' => 'continue',
+ 'poista' => 'delete',
+ 'tallenna' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/rc b/sql-ledger/locale/fi/rc
new file mode 100644
index 000000000..57ea0dafe
--- /dev/null
+++ b/sql-ledger/locale/fi/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Tili',
+ 'Balance' => 'Tase',
+ 'Cleared Balance' => 'Tarkistettu tase',
+ 'Continue' => 'Jatka',
+ 'Date' => 'Päiväys',
+ 'Deposit' => 'Rahatallennus',
+ 'Description' => 'Kuvaus',
+ 'Difference' => 'Ero',
+ 'Done' => 'Suoritettu!',
+ 'Exchangerate Difference' => 'Vaihtokurssin ero',
+ 'From' => 'Alkaen',
+ 'Out of balance!' => 'Ei tasapainossa',
+ 'Payment' => 'Maksu',
+ 'Reconciliation' => 'Sovitus',
+ 'Select all' => 'Valitse kaikki',
+ 'Source' => 'Lähde',
+ 'Statement Balance' => 'Tiliotteen tase',
+ 'To' => 'Hetkeen',
+ 'Update' => 'Päivitä',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'jatka' => 'continue',
+ 'suoritettu!' => 'done',
+ 'valitse_kaikki' => 'select_all',
+ 'päivitä' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fi/rp b/sql-ledger/locale/fi/rp
new file mode 100644
index 000000000..cbc572fa6
--- /dev/null
+++ b/sql-ledger/locale/fi/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Erääntyvät ostolaskut',
+ 'AR Aging' => 'Erääntyvät myyntilaskut',
+ 'Account' => 'Tili',
+ 'Accounts' => 'Tilit',
+ 'Amount' => 'Summa',
+ 'Apr' => 'Huh',
+ 'April' => 'Huhtikuu',
+ 'Attachment' => 'Liite',
+ 'Aug' => 'Elo',
+ 'August' => 'Elokuu',
+ 'Balance Sheet' => 'Taselaskelma',
+ 'Bcc' => 'Näkymätön kopio',
+ 'Cash based' => 'Käteiseen perustuva',
+ 'Cc' => 'Kopio',
+ 'Compare to' => 'verrattuna',
+ 'Continue' => 'Jatka',
+ 'Copies' => 'Kopiot',
+ 'Credit' => 'Kredit',
+ 'Current' => 'Erääntyy',
+ 'Customer' => 'Asiakas',
+ 'Date' => 'Päiväys',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Jou',
+ 'December' => 'Joulukuu',
+ 'Decimalplaces' => 'Desimaalipaikkoja',
+ 'Description' => 'Kuvaus',
+ 'Due' => 'Eräpv',
+ 'E-mail' => 'Sähköposti',
+ 'E-mail Statement to' => 'Sähköpostilla tiliote kenelle',
+ 'Feb' => 'Hel',
+ 'February' => 'Helmikuu',
+ 'From' => 'Alkaen',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Otsikko',
+ 'ID' => 'ID',
+ 'In-line' => 'Linjalla',
+ 'Include in Report' => 'Sisällytä raporttiin',
+ 'Income Statement' => 'Tuloslaskelma',
+ 'Invoice' => 'Lasku',
+ 'Jan' => 'Tam',
+ 'January' => 'Tammikuu',
+ 'Jul' => 'Hei',
+ 'July' => 'Heinäkuu',
+ 'Jun' => 'Kes',
+ 'June' => 'Kesäkuu',
+ 'Mar' => 'Maa',
+ 'March' => 'Maaliskuu',
+ 'May' => 'Tou',
+ 'May ' => 'Toukokuu',
+ 'Message' => 'Viesti',
+ 'N/A' => 'Ei saatavilla',
+ 'Nothing selected!' => 'Mitään valitsematta!',
+ 'Nov' => 'Mar',
+ 'November' => 'Marraskuu',
+ 'Oct' => 'Lok',
+ 'October' => 'Lokakuu',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Maksut',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Tulosta',
+ 'Printer' => 'Kirjoitin',
+ 'Receipts' => 'Kuitit',
+ 'Report for' => 'Raportti',
+ 'Retained Earnings' => 'Käyttörahasto\jakamaton voitto',
+ 'Screen' => 'Näyttö',
+ 'Select all' => 'Valitse kaikki',
+ 'Select postscript or PDF!' => 'Valitse postscript tai PDF',
+ 'Sep' => 'Syy',
+ 'September' => 'Syyskuu',
+ 'Source' => 'Lähde',
+ 'Standard' => 'Vakio',
+ 'Statement' => 'Tiliote',
+ 'Statement sent to' => 'Tiliote lähetetty',
+ 'Statements sent to printer!' => 'Tiliotteet lähetetty tulostimelle!',
+ 'Subject' => 'Aihe',
+ 'Subtotal' => 'Välisumma',
+ 'Tax' => 'Vero',
+ 'Tax collected' => 'Veroa kerätty',
+ 'Tax paid' => 'Veroa maksettu ',
+ 'To' => 'Hetkeen',
+ 'Total' => 'Yhteensä',
+ 'Trial Balance' => 'Saldolista',
+ 'Vendor' => 'Toimittaja',
+ 'as at' => 'päivänä ',
+ 'collected on sales' => 'Kerätty myynneistä',
+ 'for Period' => 'jaksolta',
+ 'paid on purchases' => 'maksettu ostoista',
+ 'to' => 'Kenelle',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'jatka' => 'continue',
+ 'sähköposti' => 'e_mail',
+ 'tulosta' => 'print',
+ 'valitse_kaikki' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/COPYING b/sql-ledger/locale/fr/COPYING
new file mode 100644
index 000000000..2010dcc8e
--- /dev/null
+++ b/sql-ledger/locale/fr/COPYING
@@ -0,0 +1,27 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# French texts:
+#
+# Author: Sèbastien Brassard <sbrassar.cgocable.ca>
+# Oscar Buijten <oscar@elbie.com>
+# Wolfgang Sourdeau <wolfgang@contre.com>
+# Aguibou KONE <aguibou.kone@rocketmail.com>
+# Jens-Ingo Brodesser <jens-ingo@all2all.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/fr/LANGUAGE b/sql-ledger/locale/fr/LANGUAGE
new file mode 100644
index 000000000..744b2c3f1
--- /dev/null
+++ b/sql-ledger/locale/fr/LANGUAGE
@@ -0,0 +1 @@
+French
diff --git a/sql-ledger/locale/fr/admin b/sql-ledger/locale/fr/admin
new file mode 100644
index 000000000..38498b138
--- /dev/null
+++ b/sql-ledger/locale/fr/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Contrôle d\'accès',
+ 'Accounting' => 'Comptabilité',
+ 'Add User' => 'Ajouter utilisateur',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administrateur',
+ 'All Datasets up to date!' => 'Tous les fichiers de données sont à jour!',
+ 'Change Admin Password' => 'Changement de mot de passe administrateur',
+ 'Change Password' => 'Changement de mot de passe',
+ 'Character Set' => 'Encodage des caractères',
+ 'Click on login name to edit!' => 'Cliquer sur votre identifiant pour editer',
+ 'Company' => 'Société',
+ 'Connect to' => 'Connecter à',
+ 'Continue' => 'Continuer',
+ 'Create Chart of Accounts' => 'Créer le Plan Comptable',
+ 'Create Dataset' => 'Créer fichier de données',
+ 'DBI not installed!' => 'DBI non installée!',
+ 'Database' => 'Base de données',
+ 'Database Administration' => 'Gérer base de données',
+ 'Database Driver not checked!' => 'Pilotes de base de données pas verifiés!',
+ 'Database User missing!' => 'Utilisateur base de données manquante!',
+ 'Dataset' => 'Fichier de données',
+ 'Dataset missing!' => 'Fichier de données manquant!',
+ 'Dataset updated!' => 'Base de données mise à jour!',
+ 'Date Format' => 'Format de Date',
+ 'Delete' => 'Supprimer',
+ 'Delete Dataset' => 'Supprimer fichier de données',
+ 'Directory' => 'Répertoire',
+ 'Driver' => 'Pilote',
+ 'Dropdown Limit' => 'Limit de déroulement',
+ 'E-mail' => 'Email',
+ 'Edit User' => 'Modifier utilisateur',
+ 'Existing Datasets' => 'Fichiers de données existants',
+ 'Fax' => 'Fax',
+ 'Host' => 'Hôte',
+ 'Hostname missing!' => 'Nom de l\'hôte manquant',
+ 'Incorrect Password!' => 'Mot de passe incorrect!',
+ 'Language' => 'Langue',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Laisser "port" et "hôte" vide, sauf si vous voulez vous connecter à distance (par réseau)',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Encodage multibyte',
+ 'Name' => 'Nom',
+ 'New Templates' => 'Nouveaux modèles',
+ 'No Database Drivers available!' => 'Pas de pilotes de base de données disponibles!',
+ 'No Dataset selected!' => 'Pas de fichier de données sélectioné!',
+ 'Nothing to delete!' => 'Rien à supprimer',
+ 'Number Format' => 'Format des numéros',
+ 'Oracle Database Administration' => 'Administration de base de données Oracle',
+ 'Password' => 'Mot de Passe',
+ 'Password changed!' => 'Mot de passe changé!',
+ 'Pg Database Administration' => 'Administration base de données PostgreSQL',
+ 'Phone' => 'Tél.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port manquant!',
+ 'Printer' => 'Imprimante',
+ 'Save' => 'Enregistrer',
+ 'Select a Dataset to delete and press "Continue"' => 'Sélectionner la base de données à supprimer et cliquer sur "Continuer"',
+ 'Setup Templates' => 'Configuration des Gabarits',
+ 'Ship via' => 'Expédier via',
+ 'Signature' => 'Signature',
+ 'Stylesheet' => 'Feuille de style',
+ 'Templates' => 'Gabarits',
+ 'The following Datasets are not in use and can be deleted' => 'Les fichiers de données suivants ne sont pas utilisés et peuvent être supprimés.',
+ 'The following Datasets need to be updated' => 'Les fichiers de données suivants doivent être mis a jour',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Ceci est un test préliminaire des sources existante. Aucune modification à ce stade!!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Pour ajouter un utilisateur à un groupe, editer un "nom", changer le "login" et enregistrer. Un nouveau utilisateur avec les mêmes données sera enregistré avec le nouveau "login".',
+ 'Update Dataset' => 'Mis à jour de la base de données',
+ 'Use Templates' => 'Utiliser les modèles',
+ 'User' => 'Utilisateur',
+ 'User deleted!' => 'Utilisateur supprimé!',
+ 'User saved!' => 'Utilisateur enregistré!',
+ 'Version' => 'Version',
+ 'You must enter a host and port for local and remote connections!' => 'Vous devez saisir un "hôte" et un "port" pour les connexions distantes!',
+ 'does not exist' => 'n\'existe pas!',
+ 'is already a member!' => 'est déjà un membre!',
+ 'localhost' => 'hôte local',
+ 'locked!' => 'verrouillé!',
+ 'successfully created!' => 'créé avec succès',
+ 'successfully deleted!' => 'supprimé avec succès',
+ 'website' => 'site web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'ajouter_utilisateur' => 'add_user',
+ 'changement_de_mot_de_passe_administrateur' => 'change_admin_password',
+ 'changement_de_mot_de_passe' => 'change_password',
+ 'continuer' => 'continue',
+ 'créer_fichier_de_données' => 'create_dataset',
+ 'supprimer' => 'delete',
+ 'supprimer_fichier_de_données' => 'delete_dataset',
+ 'login' => 'login',
+ 'administration_de_base_de_données_oracle' => 'oracle_database_administration',
+ 'administration_base_de_données_postgresql' => 'pg_database_administration',
+ 'enregistrer' => 'save',
+ 'mis_à_jour_de_la_base_de_données' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/all b/sql-ledger/locale/fr/all
new file mode 100644
index 000000000..3d514c351
--- /dev/null
+++ b/sql-ledger/locale/fr/all
@@ -0,0 +1,495 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Dépenses',
+ 'AP Aging' => 'Dépenses exigibles',
+ 'AP Transaction' => 'Ecriture Dépense',
+ 'AP Transactions' => 'Mouvements - Dépenses',
+ 'AR' => 'Recettes',
+ 'AR Aging' => 'Recettes exigibles',
+ 'AR Transaction' => 'Ecriture Recette',
+ 'AR Transactions' => 'Mouvements - Recettes',
+ 'About' => 'A propos',
+ 'Access Control' => 'Contrôle d\'accès',
+ 'Account' => 'Compte',
+ 'Account Number' => 'Numéro de compte',
+ 'Account Number missing!' => 'Numéro de compte manquant!',
+ 'Account Type' => 'Type de compte',
+ 'Account Type missing!' => 'Type de compte manquant!',
+ 'Account deleted!' => 'Compte supprimé',
+ 'Account saved!' => 'Compte enregistré',
+ 'Accounting' => 'Comptabilité',
+ 'Accounting Menu' => 'Menu de comptabilité',
+ 'Accounts' => 'Comptes',
+ 'Active' => 'Actif',
+ 'Add' => 'Ajouter',
+ 'Add Account' => 'Ajouter compte',
+ 'Add Accounts Payables Transaction' => 'Saisie d\'écriture - Dépenses',
+ 'Add Accounts Receivables Transaction' => 'Saisie d\'écriture - Recettes',
+ 'Add Assembly' => 'Ajouter produit',
+ 'Add Customer' => 'Ajouter client',
+ 'Add GIFI' => 'Ajouter Code d\'Identification Comptable ou Fiscale',
+ 'Add General Ledger Transaction' => 'Ajouter une écriture au Grand Livre',
+ 'Add Part' => 'Ajouter marchandise',
+ 'Add Project' => 'Ajouter projet',
+ 'Add Purchase Invoice' => 'Etablir facture d\'achat',
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Invoice' => 'Etablir facture de vente',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Add Service' => 'Ajouter service',
+ 'Add Transaction' => 'Saisie d\'écriture',
+ 'Add User' => 'Ajouter utilisateur',
+ 'Add Vendor' => 'Ajouter fournisseur',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administrateur',
+ 'All' => 'Tous',
+ 'All Datasets up to date!' => 'Tous les fichiers de données sont à jour!',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Montant dû',
+ 'Amount does not equal applied!' => 'Le montant n\'est égal à celui appliqué!',
+ 'Amount missing!' => 'Montant manquant',
+ 'Applied' => 'Appliquer',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Invoice Number' => 'Êtes-vous sûr de vouloir supprimer la Facture No.:',
+ 'Are you sure you want to delete Order Number' => 'Êtes vous sûr de vouloir supprimer Commande N°',
+ 'Are you sure you want to delete Transaction' => 'Êtes vous sûr de vouloir effacer la saisie?',
+ 'Assemblies' => 'Produits finis',
+ 'Assemblies restocked!' => 'Renvoyer produits vers stock!',
+ 'Assembly Number missing!' => 'Numéro de produit manquant',
+ 'Asset' => 'Actif',
+ 'Attachment' => 'Pièce jointe',
+ 'Audit Control' => 'Clôture périodique',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'BOM' => 'Nomenclature composantes',
+ 'Backup' => 'Sauvegarder',
+ 'Backup sent to' => 'Sauvegarde envoyée à',
+ 'Balance' => 'Solde',
+ 'Balance Sheet' => 'Bilan',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'Books are open' => 'Début exercice',
+ 'Bought' => 'Acheté',
+ 'Business Number' => 'Numéro d\'enregistrement société',
+ 'C' => 'C',
+ 'COGS' => 'CMV',
+ 'Cannot delete account!' => 'Impossible de supprimer le compte!',
+ 'Cannot delete customer!' => 'Impossible de supprimer le client!',
+ 'Cannot delete default account!' => 'Ne peut pas supprimer le compte par defaut!',
+ 'Cannot delete invoice!' => 'Impossible de supprimer la facture',
+ 'Cannot delete item already invoiced!' => 'Ne peut pas effacer un élément qui est déjà facturé!',
+ 'Cannot delete item on order!' => 'Impossible de supprimer un élément faisant partie d\'une commande',
+ 'Cannot delete item which is part of an assembly!' => 'Ne peut pas supprimer une marchandise qui est intégrée dans un produit fini!',
+ 'Cannot delete item!' => 'Impossible de supprimer ce poste!',
+ 'Cannot delete order!' => 'Impossible de supprimer la commande!',
+ 'Cannot delete transaction!' => 'Impossible de supprimer la saisie!',
+ 'Cannot delete vendor!' => 'Impossible de supprimer le fournisseur!',
+ 'Cannot have a value in both Debit and Credit!' => 'Impossible d\'avoir des valeurs dans Crédit et Débit en même temps!',
+ 'Cannot post a transaction without a value!' => 'Impossible d\'effectuer une écriture sans valeur!',
+ 'Cannot post invoice for a closed period!' => 'Impossible d\'enregistrer la facture sur un exercice clos!',
+ 'Cannot post invoice!' => 'Impossible d\'enregistrer la facture!',
+ 'Cannot post payment for a closed period!' => 'Impossible d\'enregistrer le paiement sur un exercice clos!',
+ 'Cannot post payment!' => 'Impossible d\'enregistrer le paiement!',
+ 'Cannot post transaction for a closed period!' => 'Impossible d\'enregistrer l\'écriture sur un exercice clos!',
+ 'Cannot post transaction!' => 'Impossible d\'enregistrer l\'écriture!',
+ 'Cannot process payment for a closed period!' => 'Impossible de faire un paiement sur un exercice clos!',
+ 'Cannot save account!' => 'Impossible d\'enregistrer le compte!',
+ 'Cannot save order!' => 'Impossible d\'enregistrer la commande!',
+ 'Cannot save preferences!' => 'Impossible d\'enregistrer les préférences',
+ 'Cannot stock assemblies!' => 'Impossible de stocker l\'assemblage!',
+ 'Cash' => 'Caisse',
+ 'Cash based' => 'En liquide',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Changement de mot de passe administrateur',
+ 'Change Password' => 'Changement de mot de passe',
+ 'Character Set' => 'Encodage des caractères',
+ 'Chart of Accounts' => 'Plan Comptable',
+ 'Check' => 'Chèque',
+ 'Check printed!' => 'Chèque imprimé!',
+ 'Check printing failed!' => 'Impression du chèque échoué!',
+ 'Cleared Balance' => 'Solde rapproché',
+ 'Click on login name to edit!' => 'Cliquer sur votre identifiant pour editer',
+ 'Close Books up to' => 'Clôturer l\'exercice jusqu\'au',
+ 'Closed' => 'Clôturé',
+ 'Company' => 'Société',
+ 'Compare to' => 'Comparer à',
+ 'Confirm!' => 'Confirmez!',
+ 'Connect to' => 'Connecter à',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Copy to COA' => 'Copier dans le Plan Comptable',
+ 'Create Chart of Accounts' => 'Créer le Plan Comptable',
+ 'Create Dataset' => 'Créer fichier de données',
+ 'Credit' => 'Crédit',
+ 'Credit Limit' => 'Encours autorisé',
+ 'Curr' => 'En cours',
+ 'Currency' => 'Devise',
+ 'Current' => 'En cours',
+ 'Customer' => 'Client',
+ 'Customer deleted!' => 'Client supprimé!',
+ 'Customer missing!' => 'Client manquant!',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Customer saved!' => 'Client enregistré!',
+ 'Customers' => 'Clients',
+ 'DBI not installed!' => 'DBI non installée!',
+ 'Database' => 'Base de données',
+ 'Database Administration' => 'Gérer base de données',
+ 'Database Driver not checked!' => 'Pilotes de base de données pas verifiés!',
+ 'Database Host' => 'Hôte de base de données',
+ 'Database User missing!' => 'Utilisateur base de données manquante!',
+ 'Dataset' => 'Fichier de données',
+ 'Dataset missing!' => 'Fichier de données manquant!',
+ 'Dataset updated!' => 'Base de données mise à jour!',
+ 'Date' => 'Date',
+ 'Date Due' => 'Date d\'échéance',
+ 'Date Format' => 'Format de Date',
+ 'Date Paid' => 'Date de paiement',
+ 'Date missing!' => 'Date manquante!',
+ 'Debit' => 'Débit',
+ 'Debit and credit out of balance!' => 'Le débit et le crédit ne sont pas équilibrés!',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Decimalplaces' => 'Décimales',
+ 'Delete' => 'Supprimer',
+ 'Delete Account' => 'Supprimer compte',
+ 'Delete Dataset' => 'Supprimer fichier de données',
+ 'Delivery Date' => 'Date de livraison',
+ 'Department' => '',
+ 'Deposit' => 'Dépôt',
+ 'Description' => 'Description',
+ 'Difference' => 'Différence',
+ 'Directory' => 'Répertoire',
+ 'Discount' => 'Remise',
+ 'Done' => 'Fait!',
+ 'Drawing' => 'Dessin',
+ 'Driver' => 'Pilote',
+ 'Dropdown Limit' => 'Limit de déroulement',
+ 'Due' => 'Echéance',
+ 'Due Date' => 'Date d\'échéance',
+ 'Due Date missing!' => 'Date d\'échéance manquante!',
+ 'E-mail' => 'Email',
+ 'E-mail Statement to' => 'Message éléctronique à',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Edit' => 'Modifier',
+ 'Edit Account' => 'Modifier le compte',
+ 'Edit Accounts Payables Transaction' => 'Modifier Mouvements - Dépenses',
+ 'Edit Accounts Receivables Transaction' => 'Modifier Mouvements - Recettes',
+ 'Edit Assembly' => 'Modifier produit fini / transformé',
+ 'Edit Customer' => 'Modifier client',
+ 'Edit GIFI' => 'Modifier Code d\'Identification Comptable ou Fiscale',
+ 'Edit General Ledger Transaction' => 'Modifier écriture Grand Livre',
+ 'Edit Part' => 'Modifier marchandise',
+ 'Edit Preferences for' => 'Modifier les préférences pour',
+ 'Edit Project' => 'Modifier projet',
+ 'Edit Purchase Invoice' => 'Modifier facture d\'achat',
+ 'Edit Purchase Order' => 'Modifier commande d\'achat',
+ 'Edit Sales Invoice' => 'Modifier facture de vente',
+ 'Edit Sales Order' => 'Modifier commande de vente',
+ 'Edit Service' => 'Modifier service',
+ 'Edit Template' => 'Modifier modèle',
+ 'Edit User' => 'Modifier utilisateur',
+ 'Edit Vendor' => 'Modifier fournisseur',
+ 'Employee' => 'Employé',
+ 'Enforce transaction reversal for all dates' => 'Appliquer l\'inversion des écritures pour toutes les dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entrer le nom de la monnaie nationale et des monnaies étrangères en 3 lettres séparées par (:) (Ex: EUR:USD:CAD)',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Change',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate Difference' => 'Différence de taux de change',
+ 'Exchangerate for payment missing!' => 'Taux de change manquant pour le paiement!',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Existing Datasets' => 'Fichiers de données existants',
+ 'Expense' => 'Dépense',
+ 'Expense Account' => 'Compte Dépenses',
+ 'Expense/Asset' => 'Dépense/Actif',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'Foreign Exchange Gain' => 'Produit conversion devises',
+ 'Foreign Exchange Loss' => 'Perte conversion devises',
+ 'From' => 'De',
+ 'GIFI' => 'Code d\'Identification Comptable ou Fiscale',
+ 'GIFI deleted!' => 'Code d\'Identification Comptable ou Fiscale supprimé!',
+ 'GIFI missing!' => 'Code d\'Identification Comptable ou Fiscale manquant!',
+ 'GIFI saved!' => 'Code d\'Identification Comptable ou Fiscale enregistré!',
+ 'GL Transaction' => 'Transaction Grand Livre',
+ 'General Ledger' => 'Grand Livre',
+ 'Goods & Services' => 'Articles & Services',
+ 'HTML Templates' => 'Gabarits HTML',
+ 'Heading' => 'En-tête',
+ 'Host' => 'Hôte',
+ 'Hostname missing!' => 'Nom de l\'hôte manquant',
+ 'ID' => 'ID',
+ 'Image' => 'Image',
+ 'In-line' => 'En ligne',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Include in drop-down menus' => 'Inclure dans les menus deroulants',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Afficher ce compte sur les formulaires de client/fournisseur pour le marquer comme imposable?',
+ 'Income' => 'Recettes',
+ 'Income Account' => 'Compte Recettes',
+ 'Income Statement' => 'Compte de Résultat',
+ 'Incorrect Dataset version!' => 'Fichier de données incorrect!',
+ 'Incorrect Password!' => 'Mot de passe incorrect!',
+ 'Individual Items' => 'Composition en marchandises individuelles',
+ 'Inventory' => 'Inventaire',
+ 'Inventory Account' => 'Compte d\'Inventaire',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantité en stock doit être à zéro avant de pouvoir indiquer cet assemblage comme obsolète!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantité en stock devrait être zero avant de pouvoir indiquer cette pièce comme obsolète!',
+ 'Inventory quantity must be zero!' => 'La quantité en stock doit être zero!',
+ 'Invoice' => 'Facture',
+ 'Invoice Date' => 'Date de facturation',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Invoice deleted!' => 'Facture supprimé!',
+ 'Invoice posted!' => 'Facture enregistré!',
+ 'Invoices' => 'Factures',
+ 'Is this a summary account to record' => 'Est-ce que c\'est un compte sommaire à enregistrer?',
+ 'Item deleted!' => 'Objet supprimé!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'LaTeX Templates' => 'Gabarits LaTeX',
+ 'Language' => 'Langue',
+ 'Last Cost' => 'Dernier prix',
+ 'Last Invoice Number' => 'Dernier numéro de facture',
+ 'Last Numbers & Default Accounts' => 'Derniers numéros et comptes par défauts',
+ 'Last Purchase Order Number' => 'Dernier numéro de commande d\'achat',
+ 'Last Sales Order Number' => 'Numéro de la dernière commande de vente',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Laisser "port" et "hôte" vide, sauf si vous voulez vous connecter à distance (par réseau)',
+ 'Liability' => 'Passif',
+ 'Licensed to' => 'Licence à',
+ 'Line Total' => 'Total ligne',
+ 'Link' => 'Liens',
+ 'Link Accounts' => 'Lier Comptes',
+ 'List Accounts' => 'Liste des comptes',
+ 'List GIFI' => 'Afficher la liste des Codes d\'Identification Comptable ou Fiscale',
+ 'List Price' => 'Prix d\'achat',
+ 'List Transactions' => 'Afficher écritures',
+ 'Login' => 'Login',
+ 'Logout' => 'Déconnexion',
+ 'Make' => 'Marque',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modèle',
+ 'Multibyte Encoding' => 'Encodage multibyte',
+ 'N/A' => 'Non Applicable',
+ 'Name' => 'Nom',
+ 'Name missing!' => 'Nom manquant!',
+ 'New Templates' => 'Nouveaux modèles',
+ 'No' => 'Non',
+ 'No Database Drivers available!' => 'Pas de pilotes de base de données disponibles!',
+ 'No Dataset selected!' => 'Pas de fichier de données sélectioné!',
+ 'No email address for' => 'Pas d\'adresse email pour',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nothing applied!' => 'Rien n\'a été appliqué!',
+ 'Nothing selected!' => 'Pas de sélection!',
+ 'Nothing to delete!' => 'Rien à supprimer',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number Format' => 'Format des numéros',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'O' => 'O',
+ 'Obsolete' => 'Obsolète',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'On Hand' => 'En Stock / Disponible',
+ 'On Order' => 'Sur Commande',
+ 'Open' => 'Ouvert',
+ 'Oracle Database Administration' => 'Administration de base de données Oracle',
+ 'Order' => 'Commande',
+ 'Order Date' => 'Date commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Entry' => 'Bons de Commandes',
+ 'Order Number' => 'Numéro de commande',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'Order deleted!' => 'Commande supprimé!',
+ 'Order saved!' => 'Commande enregistré!',
+ 'Ordered' => 'Commandé',
+ 'Orphaned' => 'Orphelin',
+ 'Out of balance!' => 'Solde non équilibré!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Paid' => 'Total Payé',
+ 'Paid in full' => 'Complètement payé',
+ 'Part' => 'Marchandise',
+ 'Part Number missing!' => 'Numéro de marchandise manquant!',
+ 'Parts' => 'Marchandises',
+ 'Parts Inventory' => 'Inventaire marchandises',
+ 'Password' => 'Mot de Passe',
+ 'Password changed!' => 'Mot de passe changé!',
+ 'Payables' => 'À Payer',
+ 'Payment' => 'Paiement',
+ 'Payment date missing!' => 'Date de paiement manquant!',
+ 'Payment posted!' => 'Paiement enregistré!',
+ 'Payments' => 'Paiements',
+ 'Pg Database Administration' => 'Administration base de données PostgreSQL',
+ 'Phone' => 'Tél.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port manquant!',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Postscript' => 'Postcript',
+ 'Preferences' => 'Préférences',
+ 'Preferences saved!' => 'Préférences enregistrées!',
+ 'Price' => 'Prix',
+ 'Print' => 'Imprimer',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'Numéro du projet manquant!',
+ 'Project deleted!' => 'Projet supprimé!',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Project saved!' => 'Projet enregistré!',
+ 'Projects' => 'Projets',
+ 'Purchase Invoice' => 'Facture d\'Achat',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Purchase Orders' => 'Commandes d\'Achats',
+ 'Qty' => 'Qté',
+ 'ROP' => 'Niveau de commande',
+ 'Rate' => 'Cadence',
+ 'Recd' => 'Reçu',
+ 'Receipt' => 'Reçu',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'Reçus',
+ 'Receivables' => 'À recevoir',
+ 'Reconciliation' => 'Rapprochement',
+ 'Record in' => 'Enregistrer dans',
+ 'Reference' => 'Référence',
+ 'Reference missing!' => 'Référence manquant!',
+ 'Remaining' => 'Restant',
+ 'Report for' => 'Rapport de',
+ 'Reports' => 'Rapports',
+ 'Required by' => 'Requis pour',
+ 'Retained Earnings' => 'Éxcédents non distribués',
+ 'Sales' => 'Ventes',
+ 'Sales Invoice' => 'Facture de Vente',
+ 'Sales Order' => 'Commande de Vente',
+ 'Sales Orders' => 'Commandes de Vente',
+ 'Save' => 'Enregistrer',
+ 'Save as new' => 'Enregistrer comme nouveau',
+ 'Save to File' => 'Enregistrer comme fichier',
+ 'Screen' => 'Écran',
+ 'Select a Dataset to delete and press "Continue"' => 'Sélectionner la base de données à supprimer et cliquer sur "Continuer"',
+ 'Select all' => 'Sélectionner tout',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sell Price' => 'Prix de vente',
+ 'Send by E-Mail' => 'Envoyer par email',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Service Items' => 'Services',
+ 'Service Number missing!' => 'Numéro de service manquant!',
+ 'Services' => 'Services',
+ 'Setup Templates' => 'Configuration des Gabarits',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Ship via' => 'Expédier via',
+ 'Short' => 'Court',
+ 'Signature' => 'Signature',
+ 'Sold' => 'Vendu',
+ 'Source' => 'Source',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Relevé',
+ 'Statement Balance' => 'Relevé de compte',
+ 'Statement sent to' => 'Relevé envoyé à',
+ 'Statements sent to printer!' => 'Relevés envoyés à l\'imprimante!',
+ 'Stock Assembly' => 'Stock de produits',
+ 'Stylesheet' => 'Feuille de style',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'System' => 'Système',
+ 'Tax' => 'Taxe',
+ 'Tax Accounts' => 'Comptes de taxe',
+ 'Tax Included' => 'Taxe incluse',
+ 'Tax collected' => 'Taxe collectée',
+ 'Tax paid' => 'Taxe payée',
+ 'Taxable' => 'Imposable',
+ 'Template saved!' => 'Gabarit enregistré!',
+ 'Templates' => 'Gabarits',
+ 'Terms: Net' => 'Crédit limité à',
+ 'The following Datasets are not in use and can be deleted' => 'Les fichiers de données suivants ne sont pas utilisés et peuvent être supprimés.',
+ 'The following Datasets need to be updated' => 'Les fichiers de données suivants doivent être mis a jour',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Ceci est un test préliminaire des sources existante. Aucune modification à ce stade!!',
+ 'To' => 'à ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Pour ajouter un utilisateur à un groupe, editer un "nom", changer le "login" et enregistrer. Un nouveau utilisateur avec les mêmes données sera enregistré avec le nouveau "login".',
+ 'Top Level' => 'Description principale',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Date d\'écriture manquante!',
+ 'Transaction deleted!' => 'Ecriture supprimée!',
+ 'Transaction posted!' => 'Ecriture enregistrée!',
+ 'Transaction reversal enforced for all dates' => 'Inversion des écritures exécuté pour toutes les dates',
+ 'Transaction reversal enforced up to' => 'Inversion des écritures exécuté jusqu\'au',
+ 'Transactions' => 'Mouvements',
+ 'Transactions exist, cannot delete customer!' => 'Des écritures existent, impossible d\'effacer le client!',
+ 'Transactions exist, cannot delete vendor!' => 'Des écritures existent, impossible d\'effacer le fournisseur!',
+ 'Transactions exist; cannot delete account!' => 'Des écritures existent, impossible d\'effacer le compte!',
+ 'Trial Balance' => 'Balance Globale',
+ 'Unit' => 'Unité',
+ 'Unit of measure' => 'Unité de mesure',
+ 'Update' => 'Mettre à jour',
+ 'Update Dataset' => 'Mis à jour de la base de données',
+ 'Updated' => 'Mis à jour',
+ 'Use Templates' => 'Utiliser les modèles',
+ 'User' => 'Utilisateur',
+ 'User deleted!' => 'Utilisateur supprimé!',
+ 'User saved!' => 'Utilisateur enregistré!',
+ 'Vendor' => 'Fournisseur',
+ 'Vendor deleted!' => 'Fournisseur supprimé!',
+ 'Vendor missing!' => 'Fournisseur manquant!',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'Vendor saved!' => 'Fournisseur enregistré!',
+ 'Vendors' => 'Fournisseurs',
+ 'Version' => 'Version',
+ 'Weight' => 'Poids',
+ 'Weight Unit' => 'Unité de poids',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'Year End' => 'Fin d\'année',
+ 'Yes' => 'Oui',
+ 'You are logged out!' => 'Vous êtes déconnecté!',
+ 'You did not enter a name!' => 'Vous n\'avez pas saisi de nom!',
+ 'You must enter a host and port for local and remote connections!' => 'Vous devez saisir un "hôte" et un "port" pour les connexions distantes!',
+ 'as at' => 'au',
+ 'collected on sales' => 'collectées sur les ventes',
+ 'days' => 'jours',
+ 'does not exist' => 'n\'existe pas!',
+ 'ea' => 'ch',
+ 'emailed to' => 'envoyé par email à',
+ 'for Period' => 'pour la période',
+ 'hr' => 'h',
+ 'is already a member!' => 'est déjà un membre!',
+ 'is not a member!' => 'n\'est pas un membre',
+ 'localhost' => 'hôte local',
+ 'locked!' => 'verrouillé!',
+ 'paid on purchases' => 'payées sur les achats',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+ 'successfully created!' => 'créé avec succès',
+ 'successfully deleted!' => 'supprimé avec succès',
+ 'to' => 'jusqu\'au',
+ 'website' => 'site web',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/am b/sql-ledger/locale/fr/am
new file mode 100644
index 000000000..2c6126321
--- /dev/null
+++ b/sql-ledger/locale/fr/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Dépenses',
+ 'AR' => 'Recettes',
+ 'Account' => 'Compte',
+ 'Account Number' => 'Numéro de compte',
+ 'Account Number missing!' => 'Numéro de compte manquant!',
+ 'Account Type' => 'Type de compte',
+ 'Account Type missing!' => 'Type de compte manquant!',
+ 'Account deleted!' => 'Compte supprimé',
+ 'Account saved!' => 'Compte enregistré',
+ 'Add Account' => 'Ajouter compte',
+ 'Add GIFI' => 'Ajouter Code d\'Identification Comptable ou Fiscale',
+ 'Address' => 'Adresse',
+ 'Asset' => 'Actif',
+ 'Audit Control' => 'Clôture périodique',
+ 'Backup sent to' => 'Sauvegarde envoyée à',
+ 'Books are open' => 'Début exercice',
+ 'Business Number' => 'Numéro d\'enregistrement société',
+ 'COGS' => 'CMV',
+ 'Cannot delete account!' => 'Impossible de supprimer le compte!',
+ 'Cannot delete default account!' => 'Ne peut pas supprimer le compte par defaut!',
+ 'Cannot save account!' => 'Impossible d\'enregistrer le compte!',
+ 'Cannot save preferences!' => 'Impossible d\'enregistrer les préférences',
+ 'Character Set' => 'Encodage des caractères',
+ 'Chart of Accounts' => 'Plan Comptable',
+ 'Close Books up to' => 'Clôturer l\'exercice jusqu\'au',
+ 'Company' => 'Société',
+ 'Continue' => 'Continuer',
+ 'Copy to COA' => 'Copier dans le Plan Comptable',
+ 'Credit' => 'Crédit',
+ 'Date Format' => 'Format de Date',
+ 'Debit' => 'Débit',
+ 'Delete' => 'Supprimer',
+ 'Delete Account' => 'Supprimer compte',
+ 'Description' => 'Description',
+ 'Dropdown Limit' => 'Limit de déroulement',
+ 'E-mail' => 'Email',
+ 'Edit' => 'Modifier',
+ 'Edit Account' => 'Modifier le compte',
+ 'Edit GIFI' => 'Modifier Code d\'Identification Comptable ou Fiscale',
+ 'Edit Preferences for' => 'Modifier les préférences pour',
+ 'Edit Template' => 'Modifier modèle',
+ 'Enforce transaction reversal for all dates' => 'Appliquer l\'inversion des écritures pour toutes les dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Entrer le nom de la monnaie nationale et des monnaies étrangères en 3 lettres séparées par (:) (Ex: EUR:USD:CAD)',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Dépense',
+ 'Expense Account' => 'Compte Dépenses',
+ 'Expense/Asset' => 'Dépense/Actif',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Produit conversion devises',
+ 'Foreign Exchange Loss' => 'Perte conversion devises',
+ 'GIFI' => 'Code d\'Identification Comptable ou Fiscale',
+ 'GIFI deleted!' => 'Code d\'Identification Comptable ou Fiscale supprimé!',
+ 'GIFI missing!' => 'Code d\'Identification Comptable ou Fiscale manquant!',
+ 'GIFI saved!' => 'Code d\'Identification Comptable ou Fiscale enregistré!',
+ 'Heading' => 'En-tête',
+ 'Include in drop-down menus' => 'Inclure dans les menus deroulants',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Afficher ce compte sur les formulaires de client/fournisseur pour le marquer comme imposable?',
+ 'Income' => 'Recettes',
+ 'Income Account' => 'Compte Recettes',
+ 'Inventory' => 'Inventaire',
+ 'Inventory Account' => 'Compte d\'Inventaire',
+ 'Is this a summary account to record' => 'Est-ce que c\'est un compte sommaire à enregistrer?',
+ 'Language' => 'Langue',
+ 'Last Invoice Number' => 'Dernier numéro de facture',
+ 'Last Numbers & Default Accounts' => 'Derniers numéros et comptes par défauts',
+ 'Last Purchase Order Number' => 'Dernier numéro de commande d\'achat',
+ 'Last Sales Order Number' => 'Numéro de la dernière commande de vente',
+ 'Liability' => 'Passif',
+ 'Link' => 'Liens',
+ 'Name' => 'Nom',
+ 'No' => 'Non',
+ 'No email address for' => 'Pas d\'adresse email pour',
+ 'Number' => 'Numéro',
+ 'Number Format' => 'Format des numéros',
+ 'Parts Inventory' => 'Inventaire marchandises',
+ 'Password' => 'Mot de Passe',
+ 'Payables' => 'À Payer',
+ 'Payment' => 'Paiement',
+ 'Phone' => 'Tél.',
+ 'Preferences saved!' => 'Préférences enregistrées!',
+ 'Rate' => 'Cadence',
+ 'Receivables' => 'À recevoir',
+ 'Sales' => 'Ventes',
+ 'Save' => 'Enregistrer',
+ 'Service Items' => 'Services',
+ 'Ship via' => 'Expédier via',
+ 'Signature' => 'Signature',
+ 'Stylesheet' => 'Feuille de style',
+ 'Tax' => 'Taxe',
+ 'Tax Accounts' => 'Comptes de taxe',
+ 'Template saved!' => 'Gabarit enregistré!',
+ 'Transaction reversal enforced for all dates' => 'Inversion des écritures exécuté pour toutes les dates',
+ 'Transaction reversal enforced up to' => 'Inversion des écritures exécuté jusqu\'au',
+ 'Transactions exist; cannot delete account!' => 'Des écritures existent, impossible d\'effacer le compte!',
+ 'Weight Unit' => 'Unité de poids',
+ 'Year End' => 'Fin d\'année',
+ 'Yes' => 'Oui',
+ 'does not exist' => 'n\'existe pas!',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'ajouter_compte' => 'add_account',
+ 'continuer' => 'continue',
+ 'copier_dans_le_plan_comptable' => 'copy_to_coa',
+ 'supprimer' => 'delete',
+ 'modifier' => 'edit',
+ 'modifier_le_compte' => 'edit_account',
+ 'enregistrer' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ap b/sql-ledger/locale/fr/ap
new file mode 100644
index 000000000..ac20a0902
--- /dev/null
+++ b/sql-ledger/locale/fr/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ecriture Dépense',
+ 'AP Transactions' => 'Mouvements - Dépenses',
+ 'Account' => 'Compte',
+ 'Add Accounts Payables Transaction' => 'Saisie d\'écriture - Dépenses',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Montant dû',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Transaction' => 'Êtes vous sûr de vouloir effacer la saisie?',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Cannot delete transaction!' => 'Impossible de supprimer la saisie!',
+ 'Cannot post payment for a closed period!' => 'Impossible d\'enregistrer le paiement sur un exercice clos!',
+ 'Cannot post transaction for a closed period!' => 'Impossible d\'enregistrer l\'écriture sur un exercice clos!',
+ 'Cannot post transaction!' => 'Impossible d\'enregistrer l\'écriture!',
+ 'Closed' => 'Clôturé',
+ 'Confirm!' => 'Confirmez!',
+ 'Continue' => 'Continuer',
+ 'Currency' => 'Devise',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Date Paid' => 'Date de paiement',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Description' => 'Description',
+ 'Due Date' => 'Date d\'échéance',
+ 'Due Date missing!' => 'Date d\'échéance manquante!',
+ 'Edit Accounts Payables Transaction' => 'Modifier Mouvements - Dépenses',
+ 'Employee' => 'Employé',
+ 'Exch' => 'Change',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate for payment missing!' => 'Taux de change manquant pour le paiement!',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Invoice' => 'Facture',
+ 'Invoice Date' => 'Date de facturation',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Open' => 'Ouvert',
+ 'Order' => 'Commande',
+ 'Order Number' => 'Numéro de commande',
+ 'Paid' => 'Total Payé',
+ 'Payment date missing!' => 'Date de paiement manquant!',
+ 'Payments' => 'Paiements',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Purchase Invoice' => 'Facture d\'Achat',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Sous Total',
+ 'Tax' => 'Taxe',
+ 'Tax Included' => 'Taxe incluse',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Ecriture supprimée!',
+ 'Transaction posted!' => 'Ecriture enregistrée!',
+ 'Update' => 'Mettre à jour',
+ 'Vendor' => 'Fournisseur',
+ 'Vendor missing!' => 'Fournisseur manquant!',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'Yes' => 'Oui',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ecriture_dépense' => 'ap_transaction',
+ 'saisie_d\'écriture___dépenses' => 'add_accounts_payables_transaction',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'modifier_mouvements___dépenses' => 'edit_accounts_payables_transaction',
+ 'enregistrer' => 'post',
+ 'enregistrer_comme_nouveau' => 'post_as_new',
+ 'facture_d\'achat' => 'purchase_invoice',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ar b/sql-ledger/locale/fr/ar
new file mode 100644
index 000000000..49f282842
--- /dev/null
+++ b/sql-ledger/locale/fr/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Ecriture Recette',
+ 'AR Transactions' => 'Mouvements - Recettes',
+ 'Account' => 'Compte',
+ 'Add Accounts Receivables Transaction' => 'Saisie d\'écriture - Recettes',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Montant dû',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Transaction' => 'Êtes vous sûr de vouloir effacer la saisie?',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Cannot delete transaction!' => 'Impossible de supprimer la saisie!',
+ 'Cannot post payment for a closed period!' => 'Impossible d\'enregistrer le paiement sur un exercice clos!',
+ 'Cannot post transaction for a closed period!' => 'Impossible d\'enregistrer l\'écriture sur un exercice clos!',
+ 'Cannot post transaction!' => 'Impossible d\'enregistrer l\'écriture!',
+ 'Closed' => 'Clôturé',
+ 'Confirm!' => 'Confirmez!',
+ 'Continue' => 'Continuer',
+ 'Credit Limit' => 'Encours autorisé',
+ 'Currency' => 'Devise',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Client manquant!',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Date Paid' => 'Date de paiement',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Description' => 'Description',
+ 'Due Date' => 'Date d\'échéance',
+ 'Due Date missing!' => 'Date d\'échéance manquante!',
+ 'Edit Accounts Receivables Transaction' => 'Modifier Mouvements - Recettes',
+ 'Employee' => 'Employé',
+ 'Exch' => 'Change',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate for payment missing!' => 'Taux de change manquant pour le paiement!',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Invoice' => 'Facture',
+ 'Invoice Date' => 'Date de facturation',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Open' => 'Ouvert',
+ 'Order' => 'Commande',
+ 'Order Number' => 'Numéro de commande',
+ 'Paid' => 'Total Payé',
+ 'Payment date missing!' => 'Date de paiement manquant!',
+ 'Payments' => 'Paiements',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Remaining' => 'Restant',
+ 'Sales Invoice' => 'Facture de Vente',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Sous Total',
+ 'Tax' => 'Taxe',
+ 'Tax Included' => 'Taxe incluse',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Ecriture supprimée!',
+ 'Transaction posted!' => 'Ecriture enregistrée!',
+ 'Update' => 'Mettre à jour',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'Yes' => 'Oui',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ecriture_recette' => 'ar_transaction',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'enregistrer' => 'post',
+ 'enregistrer_comme_nouveau' => 'post_as_new',
+ 'facture_de_vente' => 'sales_invoice',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/arap b/sql-ledger/locale/fr/arap
new file mode 100644
index 000000000..369913fb1
--- /dev/null
+++ b/sql-ledger/locale/fr/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresse',
+ 'Continue' => 'Continuer',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Description' => 'Description',
+ 'Number' => 'Numéro',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuer' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ca b/sql-ledger/locale/fr/ca
new file mode 100644
index 000000000..1e011ac83
--- /dev/null
+++ b/sql-ledger/locale/fr/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Compte',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Balance' => 'Solde',
+ 'Chart of Accounts' => 'Plan Comptable',
+ 'Credit' => 'Crédit',
+ 'Date' => 'Date',
+ 'Debit' => 'Débit',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Description' => 'Description',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'GIFI' => 'Code d\'Identification Comptable ou Fiscale',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'List Transactions' => 'Afficher écritures',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Reference' => 'Référence',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Subtotal' => 'Sous Total',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'afficher_écritures' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/cp b/sql-ledger/locale/fr/cp
new file mode 100644
index 000000000..b7695132a
--- /dev/null
+++ b/sql-ledger/locale/fr/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Compte',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Le montant n\'est égal à celui appliqué!',
+ 'Amount missing!' => 'Montant manquant',
+ 'Applied' => 'Appliquer',
+ 'Cannot post payment!' => 'Impossible d\'enregistrer le paiement!',
+ 'Cannot process payment for a closed period!' => 'Impossible de faire un paiement sur un exercice clos!',
+ 'Check' => 'Chèque',
+ 'Check printed!' => 'Chèque imprimé!',
+ 'Check printing failed!' => 'Impression du chèque échoué!',
+ 'Continue' => 'Continuer',
+ 'Currency' => 'Devise',
+ 'Customer' => 'Client',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Date missing!' => 'Date manquante!',
+ 'Description' => 'Description',
+ 'Due' => 'Echéance',
+ 'Exchangerate' => 'Taux de change',
+ 'From' => 'De',
+ 'Invoice' => 'Facture',
+ 'Invoices' => 'Factures',
+ 'Nothing applied!' => 'Rien n\'a été appliqué!',
+ 'Number' => 'Numéro',
+ 'Paid in full' => 'Complètement payé',
+ 'Payment' => 'Paiement',
+ 'Payment posted!' => 'Paiement enregistré!',
+ 'Post' => 'Enregistrer',
+ 'Print' => 'Imprimer',
+ 'Printer' => 'Imprimante',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Receipt' => 'Reçu',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'Référence',
+ 'Screen' => 'Écran',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Update' => 'Mettre à jour',
+ 'Vendor' => 'Fournisseur',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuer' => 'continue',
+ 'enregistrer' => 'post',
+ 'imprimer' => 'print',
+ 'mettre_à_jour' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ct b/sql-ledger/locale/fr/ct
new file mode 100644
index 000000000..21be5e292
--- /dev/null
+++ b/sql-ledger/locale/fr/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Ajouter',
+ 'Address' => 'Adresse',
+ 'All' => 'Tous',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Impossible de supprimer le client!',
+ 'Cannot delete vendor!' => 'Impossible de supprimer le fournisseur!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Credit Limit' => 'Encours autorisé',
+ 'Customer deleted!' => 'Client supprimé!',
+ 'Customer saved!' => 'Client enregistré!',
+ 'Customers' => 'Clients',
+ 'Delete' => 'Supprimer',
+ 'Discount' => 'Remise',
+ 'E-mail' => 'Email',
+ 'Edit Customer' => 'Modifier client',
+ 'Edit Vendor' => 'Modifier fournisseur',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Invoice' => 'Facture',
+ 'Name' => 'Nom',
+ 'Name missing!' => 'Nom manquant!',
+ 'Notes' => 'Notes',
+ 'Number' => 'Numéro',
+ 'Order' => 'Commande',
+ 'Orphaned' => 'Orphelin',
+ 'Phone' => 'Tél.',
+ 'Save' => 'Enregistrer',
+ 'Ship to' => 'Expédier à',
+ 'Tax Included' => 'Taxe incluse',
+ 'Taxable' => 'Imposable',
+ 'Terms: Net' => 'Crédit limité à',
+ 'Transactions exist, cannot delete customer!' => 'Des écritures existent, impossible d\'effacer le client!',
+ 'Transactions exist, cannot delete vendor!' => 'Des écritures existent, impossible d\'effacer le fournisseur!',
+ 'Vendor deleted!' => 'Fournisseur supprimé!',
+ 'Vendor saved!' => 'Fournisseur enregistré!',
+ 'Vendors' => 'Fournisseurs',
+ 'days' => 'jours',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'ajouter' => 'add',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'facture' => 'invoice',
+ 'commande' => 'order',
+ 'enregistrer' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/gl b/sql-ledger/locale/fr/gl
new file mode 100644
index 000000000..da2e0ce94
--- /dev/null
+++ b/sql-ledger/locale/fr/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Ecriture Dépense',
+ 'AR Transaction' => 'Ecriture Recette',
+ 'Account' => 'Compte',
+ 'Add General Ledger Transaction' => 'Ajouter une écriture au Grand Livre',
+ 'Address' => 'Adresse',
+ 'All' => 'Tous',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Transaction' => 'Êtes vous sûr de vouloir effacer la saisie?',
+ 'Asset' => 'Actif',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Balance' => 'Solde',
+ 'Cannot delete transaction!' => 'Impossible de supprimer la saisie!',
+ 'Cannot have a value in both Debit and Credit!' => 'Impossible d\'avoir des valeurs dans Crédit et Débit en même temps!',
+ 'Cannot post a transaction without a value!' => 'Impossible d\'effectuer une écriture sans valeur!',
+ 'Cannot post transaction for a closed period!' => 'Impossible d\'enregistrer l\'écriture sur un exercice clos!',
+ 'Confirm!' => 'Confirmez!',
+ 'Continue' => 'Continuer',
+ 'Credit' => 'Crédit',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Debit' => 'Débit',
+ 'Debit and credit out of balance!' => 'Le débit et le crédit ne sont pas équilibrés!',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Description' => 'Description',
+ 'Edit General Ledger Transaction' => 'Modifier écriture Grand Livre',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Dépense',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'GIFI' => 'Code d\'Identification Comptable ou Fiscale',
+ 'GL Transaction' => 'Transaction Grand Livre',
+ 'General Ledger' => 'Grand Livre',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Income' => 'Recettes',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Liability' => 'Passif',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Purchase Invoice' => 'Facture d\'Achat',
+ 'Reference' => 'Référence',
+ 'Reference missing!' => 'Référence manquant!',
+ 'Reports' => 'Rapports',
+ 'Sales Invoice' => 'Facture de Vente',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Source' => 'Source',
+ 'Subtotal' => 'Sous Total',
+ 'Transaction Date missing!' => 'Date d\'écriture manquante!',
+ 'Transaction deleted!' => 'Ecriture supprimée!',
+ 'Transaction posted!' => 'Ecriture enregistrée!',
+ 'Update' => 'Mettre à jour',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'Yes' => 'Oui',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ecriture_dépense' => 'ap_transaction',
+ 'ecriture_recette' => 'ar_transaction',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'transaction_grand_livre' => 'gl_transaction',
+ 'enregistrer' => 'post',
+ 'enregistrer_comme_nouveau' => 'post_as_new',
+ 'facture_d\'achat' => 'purchase_invoice',
+ 'facture_de_vente' => 'sales_invoice',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ic b/sql-ledger/locale/fr/ic
new file mode 100644
index 000000000..58ffab76b
--- /dev/null
+++ b/sql-ledger/locale/fr/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Actif',
+ 'Add' => 'Ajouter',
+ 'Add Assembly' => 'Ajouter produit',
+ 'Add Part' => 'Ajouter marchandise',
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Add Service' => 'Ajouter service',
+ 'Address' => 'Adresse',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Assemblies' => 'Produits finis',
+ 'Assemblies restocked!' => 'Renvoyer produits vers stock!',
+ 'Assembly Number missing!' => 'Numéro de produit manquant',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'BOM' => 'Nomenclature composantes',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'Bought' => 'Acheté',
+ 'COGS' => 'CMV',
+ 'Cannot delete item already invoiced!' => 'Ne peut pas effacer un élément qui est déjà facturé!',
+ 'Cannot delete item on order!' => 'Impossible de supprimer un élément faisant partie d\'une commande',
+ 'Cannot delete item which is part of an assembly!' => 'Ne peut pas supprimer une marchandise qui est intégrée dans un produit fini!',
+ 'Cannot delete item!' => 'Impossible de supprimer ce poste!',
+ 'Cannot stock assemblies!' => 'Impossible de stocker l\'assemblage!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Delivery Date' => 'Date de livraison',
+ 'Description' => 'Description',
+ 'Drawing' => 'Dessin',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Edit Assembly' => 'Modifier produit fini / transformé',
+ 'Edit Part' => 'Modifier marchandise',
+ 'Edit Service' => 'Modifier service',
+ 'Expense' => 'Dépense',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'Image' => 'Image',
+ 'In-line' => 'En ligne',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Income' => 'Recettes',
+ 'Individual Items' => 'Composition en marchandises individuelles',
+ 'Inventory' => 'Inventaire',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantité en stock doit être à zéro avant de pouvoir indiquer cet assemblage comme obsolète!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantité en stock devrait être zero avant de pouvoir indiquer cette pièce comme obsolète!',
+ 'Inventory quantity must be zero!' => 'La quantité en stock doit être zero!',
+ 'Invoice' => 'Facture',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Item deleted!' => 'Objet supprimé!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Last Cost' => 'Dernier prix',
+ 'Line Total' => 'Total ligne',
+ 'Link Accounts' => 'Lier Comptes',
+ 'List Price' => 'Prix d\'achat',
+ 'Make' => 'Marque',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modèle',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'Obsolete' => 'Obsolète',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'On Hand' => 'En Stock / Disponible',
+ 'On Order' => 'Sur Commande',
+ 'Order' => 'Commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Number' => 'Numéro de commande',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'Ordered' => 'Commandé',
+ 'Orphaned' => 'Orphelin',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Part' => 'Marchandise',
+ 'Part Number missing!' => 'Numéro de marchandise manquant!',
+ 'Parts' => 'Marchandises',
+ 'Phone' => 'Tél.',
+ 'Postscript' => 'Postcript',
+ 'Price' => 'Prix',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Qty' => 'Qté',
+ 'ROP' => 'Niveau de commande',
+ 'Recd' => 'Reçu',
+ 'Required by' => 'Requis pour',
+ 'Sales' => 'Ventes',
+ 'Sales Order' => 'Commande de Vente',
+ 'Save' => 'Enregistrer',
+ 'Screen' => 'Écran',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sell Price' => 'Prix de vente',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Service Number missing!' => 'Numéro de service manquant!',
+ 'Services' => 'Services',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Short' => 'Court',
+ 'Sold' => 'Vendu',
+ 'Stock Assembly' => 'Stock de produits',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'Tax' => 'Taxe',
+ 'To' => 'à ',
+ 'Top Level' => 'Description principale',
+ 'Total' => 'Total',
+ 'Unit' => 'Unité',
+ 'Unit of measure' => 'Unité de mesure',
+ 'Update' => 'Mettre à jour',
+ 'Updated' => 'Mis à jour',
+ 'Weight' => 'Poids',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'ea' => 'ch',
+ 'emailed to' => 'envoyé par email à',
+ 'hr' => 'h',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'ajouter' => 'add',
+ 'ajouter_produit' => 'add_assembly',
+ 'ajouter_marchandise' => 'add_part',
+ 'ajouter_service' => 'add_service',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'modifier_produit_fini_/_transformé' => 'edit_assembly',
+ 'modifier_marchandise' => 'edit_part',
+ 'modifier_service' => 'edit_service',
+ 'enregistrer' => 'save',
+ 'mettre_à_jour' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/io b/sql-ledger/locale/fr/io
new file mode 100644
index 000000000..2ad48bc78
--- /dev/null
+++ b/sql-ledger/locale/fr/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Address' => 'Adresse',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delivery Date' => 'Date de livraison',
+ 'Description' => 'Description',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'In-line' => 'En ligne',
+ 'Invoice' => 'Facture',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Order' => 'Commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Part' => 'Marchandise',
+ 'Phone' => 'Tél.',
+ 'Postscript' => 'Postcript',
+ 'Price' => 'Prix',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Qty' => 'Qté',
+ 'Recd' => 'Reçu',
+ 'Required by' => 'Requis pour',
+ 'Sales Order' => 'Commande de Vente',
+ 'Screen' => 'Écran',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Subject' => 'Objet',
+ 'To' => 'à ',
+ 'Unit' => 'Unité',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'emailed to' => 'envoyé par email à',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuer' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/ir b/sql-ledger/locale/fr/ir
new file mode 100644
index 000000000..edeec1f0e
--- /dev/null
+++ b/sql-ledger/locale/fr/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Compte',
+ 'Add Purchase Invoice' => 'Etablir facture d\'achat',
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Invoice Number' => 'Êtes-vous sûr de vouloir supprimer la Facture No.:',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'Cannot delete invoice!' => 'Impossible de supprimer la facture',
+ 'Cannot post invoice for a closed period!' => 'Impossible d\'enregistrer la facture sur un exercice clos!',
+ 'Cannot post invoice!' => 'Impossible d\'enregistrer la facture!',
+ 'Cannot post payment for a closed period!' => 'Impossible d\'enregistrer le paiement sur un exercice clos!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmez!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Currency' => 'Devise',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Date Due' => 'Date d\'échéance',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Delivery Date' => 'Date de livraison',
+ 'Description' => 'Description',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Edit Purchase Invoice' => 'Modifier facture d\'achat',
+ 'Exch' => 'Change',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate for payment missing!' => 'Taux de change manquant pour le paiement!',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'In-line' => 'En ligne',
+ 'Invoice' => 'Facture',
+ 'Invoice Date' => 'Date de facturation',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Invoice deleted!' => 'Facture supprimé!',
+ 'Invoice posted!' => 'Facture enregistré!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Order' => 'Commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Number' => 'Numéro de commande',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Part' => 'Marchandise',
+ 'Payment date missing!' => 'Date de paiement manquant!',
+ 'Payments' => 'Paiements',
+ 'Phone' => 'Tél.',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Postscript' => 'Postcript',
+ 'Price' => 'Prix',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Qty' => 'Qté',
+ 'Recd' => 'Reçu',
+ 'Record in' => 'Enregistrer dans',
+ 'Required by' => 'Requis pour',
+ 'Sales Order' => 'Commande de Vente',
+ 'Screen' => 'Écran',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Source' => 'Source',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'Tax Included' => 'Taxe incluse',
+ 'To' => 'à ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unité',
+ 'Update' => 'Mettre à jour',
+ 'Vendor' => 'Fournisseur',
+ 'Vendor missing!' => 'Fournisseur manquant!',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'Yes' => 'Oui',
+ 'ea' => 'ch',
+ 'emailed to' => 'envoyé par email à',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'commande' => 'order',
+ 'enregistrer' => 'post',
+ 'enregistrer_comme_nouveau' => 'post_as_new',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/is b/sql-ledger/locale/fr/is
new file mode 100644
index 000000000..583e6271c
--- /dev/null
+++ b/sql-ledger/locale/fr/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Compte',
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Invoice' => 'Etablir facture de vente',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Invoice Number' => 'Êtes-vous sûr de vouloir supprimer la Facture No.:',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'Cannot delete invoice!' => 'Impossible de supprimer la facture',
+ 'Cannot post invoice for a closed period!' => 'Impossible d\'enregistrer la facture sur un exercice clos!',
+ 'Cannot post invoice!' => 'Impossible d\'enregistrer la facture!',
+ 'Cannot post payment for a closed period!' => 'Impossible d\'enregistrer le paiement sur un exercice clos!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmez!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Encours autorisé',
+ 'Currency' => 'Devise',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Client manquant!',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Date Due' => 'Date d\'échéance',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Delivery Date' => 'Date de livraison',
+ 'Description' => 'Description',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Edit Sales Invoice' => 'Modifier facture de vente',
+ 'Exch' => 'Change',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate for payment missing!' => 'Taux de change manquant pour le paiement!',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'In-line' => 'En ligne',
+ 'Invoice' => 'Facture',
+ 'Invoice Date' => 'Date de facturation',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number' => 'Numéro de facture',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Invoice deleted!' => 'Facture supprimé!',
+ 'Invoice posted!' => 'Facture enregistré!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Order' => 'Commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Number' => 'Numéro de commande',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Part' => 'Marchandise',
+ 'Payment date missing!' => 'Date de paiement manquant!',
+ 'Payments' => 'Paiements',
+ 'Phone' => 'Tél.',
+ 'Post' => 'Enregistrer',
+ 'Post as new' => 'Enregistrer comme nouveau',
+ 'Postscript' => 'Postcript',
+ 'Price' => 'Prix',
+ 'Print' => 'Imprimer',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Qty' => 'Qté',
+ 'Recd' => 'Reçu',
+ 'Record in' => 'Enregistrer dans',
+ 'Remaining' => 'Restant',
+ 'Required by' => 'Requis pour',
+ 'Sales Order' => 'Commande de Vente',
+ 'Screen' => 'Écran',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Ship via' => 'Expédier via',
+ 'Source' => 'Source',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'Tax Included' => 'Taxe incluse',
+ 'To' => 'à ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unité',
+ 'Update' => 'Mettre à jour',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'Yes' => 'Oui',
+ 'ea' => 'ch',
+ 'emailed to' => 'envoyé par email à',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'email' => 'e_mail',
+ 'commande' => 'order',
+ 'enregistrer' => 'post',
+ 'enregistrer_comme_nouveau' => 'post_as_new',
+ 'imprimer' => 'print',
+ 'expédier_à' => 'ship_to',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/login b/sql-ledger/locale/fr/login
new file mode 100644
index 000000000..1020ac221
--- /dev/null
+++ b/sql-ledger/locale/fr/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'A propos',
+ 'Database Host' => 'Hôte de base de données',
+ 'Dataset' => 'Fichier de données',
+ 'Incorrect Dataset version!' => 'Fichier de données incorrect!',
+ 'Incorrect Password!' => 'Mot de passe incorrect!',
+ 'Licensed to' => 'Licence à',
+ 'Login' => 'Login',
+ 'Name' => 'Nom',
+ 'Password' => 'Mot de Passe',
+ 'User' => 'Utilisateur',
+ 'Version' => 'Version',
+ 'You are logged out!' => 'Vous êtes déconnecté!',
+ 'You did not enter a name!' => 'Vous n\'avez pas saisi de nom!',
+ 'is not a member!' => 'n\'est pas un membre',
+ 'localhost' => 'hôte local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/menu b/sql-ledger/locale/fr/menu
new file mode 100644
index 000000000..102a1c24f
--- /dev/null
+++ b/sql-ledger/locale/fr/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Dépenses',
+ 'AP Aging' => 'Dépenses exigibles',
+ 'AR' => 'Recettes',
+ 'AR Aging' => 'Recettes exigibles',
+ 'Accounting Menu' => 'Menu de comptabilité',
+ 'Add Account' => 'Ajouter compte',
+ 'Add Assembly' => 'Ajouter produit',
+ 'Add Customer' => 'Ajouter client',
+ 'Add GIFI' => 'Ajouter Code d\'Identification Comptable ou Fiscale',
+ 'Add Part' => 'Ajouter marchandise',
+ 'Add Project' => 'Ajouter projet',
+ 'Add Service' => 'Ajouter service',
+ 'Add Transaction' => 'Saisie d\'écriture',
+ 'Add Vendor' => 'Ajouter fournisseur',
+ 'Assemblies' => 'Produits finis',
+ 'Audit Control' => 'Clôture périodique',
+ 'Backup' => 'Sauvegarder',
+ 'Balance Sheet' => 'Bilan',
+ 'Cash' => 'Caisse',
+ 'Chart of Accounts' => 'Plan Comptable',
+ 'Check' => 'Chèque',
+ 'Customers' => 'Clients',
+ 'General Ledger' => 'Grand Livre',
+ 'Goods & Services' => 'Articles & Services',
+ 'HTML Templates' => 'Gabarits HTML',
+ 'Income Statement' => 'Compte de Résultat',
+ 'Invoice' => 'Facture',
+ 'LaTeX Templates' => 'Gabarits LaTeX',
+ 'List Accounts' => 'Liste des comptes',
+ 'List GIFI' => 'Afficher la liste des Codes d\'Identification Comptable ou Fiscale',
+ 'Logout' => 'Déconnexion',
+ 'Order Entry' => 'Bons de Commandes',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Parts' => 'Marchandises',
+ 'Payment' => 'Paiement',
+ 'Payments' => 'Paiements',
+ 'Preferences' => 'Préférences',
+ 'Projects' => 'Projets',
+ 'Purchase Invoice' => 'Facture d\'Achat',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Purchase Orders' => 'Commandes d\'Achats',
+ 'Receipt' => 'Reçu',
+ 'Receipts' => 'Reçus',
+ 'Reconciliation' => 'Rapprochement',
+ 'Reports' => 'Rapports',
+ 'Sales Invoice' => 'Facture de Vente',
+ 'Sales Order' => 'Commande de Vente',
+ 'Sales Orders' => 'Commandes de Vente',
+ 'Save to File' => 'Enregistrer comme fichier',
+ 'Send by E-Mail' => 'Envoyer par email',
+ 'Services' => 'Services',
+ 'Statement' => 'Relevé',
+ 'Stock Assembly' => 'Stock de produits',
+ 'Stylesheet' => 'Feuille de style',
+ 'System' => 'Système',
+ 'Tax collected' => 'Taxe collectée',
+ 'Tax paid' => 'Taxe payée',
+ 'Transactions' => 'Mouvements',
+ 'Trial Balance' => 'Balance Globale',
+ 'Vendors' => 'Fournisseurs',
+ 'Version' => 'Version',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/oe b/sql-ledger/locale/fr/oe
new file mode 100644
index 000000000..d1c2b7454
--- /dev/null
+++ b/sql-ledger/locale/fr/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Ajouter',
+ 'Add Purchase Invoice' => 'Etablir facture d\'achat',
+ 'Add Purchase Order' => 'Etablir commande d\'achat',
+ 'Add Sales Invoice' => 'Etablir facture de vente',
+ 'Add Sales Order' => 'Etablir commande de vente',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Total',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Are you sure you want to delete Order Number' => 'Êtes vous sûr de vouloir supprimer Commande N°',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Localisation',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Impossible de supprimer la commande!',
+ 'Cannot save order!' => 'Impossible d\'enregistrer la commande!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Clôturé',
+ 'Confirm!' => 'Confirmez!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Encours autorisé',
+ 'Curr' => 'En cours',
+ 'Currency' => 'Devise',
+ 'Customer' => 'Client',
+ 'Customer missing!' => 'Client manquant!',
+ 'Customer not on file!' => 'Client absent du fichier!',
+ 'Date' => 'Date',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Delete' => 'Supprimer',
+ 'Delivery Date' => 'Date de livraison',
+ 'Description' => 'Description',
+ 'E-mail' => 'Email',
+ 'E-mail address missing!' => 'Adresse email manquante!',
+ 'Edit Purchase Order' => 'Modifier commande d\'achat',
+ 'Edit Sales Order' => 'Modifier commande de vente',
+ 'Exchangerate' => 'Taux de change',
+ 'Exchangerate missing!' => 'Taux de change manquant!',
+ 'Extended' => 'Prix Total',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'In-line' => 'En ligne',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Invoice' => 'Facture',
+ 'Invoice Date missing!' => 'Date de facture manquante!',
+ 'Invoice Number missing!' => 'Numéro de facture manquant!',
+ 'Item not on file!' => 'Objet non-listé!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'Name' => 'Nom',
+ 'No.' => 'No.',
+ 'Notes' => 'Notes',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Number' => 'Numéro',
+ 'Number missing in Row' => 'Numéro manquant dans ligne',
+ 'O' => 'O',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'Open' => 'Ouvert',
+ 'Order' => 'Commande',
+ 'Order Date' => 'Date commande',
+ 'Order Date missing!' => 'Date de commande manquante!',
+ 'Order Number' => 'Numéro de commande',
+ 'Order Number missing!' => 'Numéro de commande manquant!',
+ 'Order deleted!' => 'Commande supprimé!',
+ 'Order saved!' => 'Commande enregistré!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Liste d\'envoi',
+ 'Packing List Date missing!' => 'La date est manquante sur la liste d\'envoi!',
+ 'Packing List Number missing!' => 'Le numéro de liste d\'envoi est manquant!',
+ 'Part' => 'Marchandise',
+ 'Phone' => 'Tél.',
+ 'Postscript' => 'Postcript',
+ 'Price' => 'Prix',
+ 'Print' => 'Imprimer',
+ 'Printer' => 'Imprimante',
+ 'Project' => 'Projet',
+ 'Project not on file!' => 'Projet absent du fichier!',
+ 'Purchase Order' => 'Commande d\'Achat',
+ 'Purchase Orders' => 'Commandes d\'Achats',
+ 'Qty' => 'Qté',
+ 'Recd' => 'Reçu',
+ 'Remaining' => 'Restant',
+ 'Required by' => 'Requis pour',
+ 'Sales Order' => 'Commande de Vente',
+ 'Sales Orders' => 'Commandes de Vente',
+ 'Save' => 'Enregistrer',
+ 'Save as new' => 'Enregistrer comme nouveau',
+ 'Screen' => 'Écran',
+ 'Select from one of the items below' => 'Sélectionner un des postes ci-dessous',
+ 'Select from one of the names below' => 'Sélectionner un des noms ci-dessous',
+ 'Select from one of the projects below' => 'Sélectionner un des projets ci-dessous',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Service' => 'Service',
+ 'Ship' => 'Expédier',
+ 'Ship to' => 'Expédier à',
+ 'Ship via' => 'Expédier via',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'Tax' => 'Taxe',
+ 'Tax Included' => 'Taxe incluse',
+ 'Terms: Net' => 'Crédit limité à',
+ 'To' => 'à ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unité',
+ 'Update' => 'Mettre à jour',
+ 'Vendor' => 'Fournisseur',
+ 'Vendor missing!' => 'Fournisseur manquant!',
+ 'Vendor not on file!' => 'Fournisseur absent du fichier!',
+ 'What type of item is this?' => 'De quel type est ce poste?',
+ 'Yes' => 'Oui',
+ 'days' => 'jours',
+ 'ea' => 'ch',
+ 'emailed to' => 'envoyé par email à',
+ 'sent to printer' => 'envoyé à l\'imprimante',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ajouter' => 'add',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'email' => 'e_mail',
+ 'facture' => 'invoice',
+ 'imprimer' => 'print',
+ 'enregistrer' => 'save',
+ 'enregistrer_comme_nouveau' => 'save_as_new',
+ 'expédier_à' => 'ship_to',
+ 'mettre_à_jour' => 'update',
+ 'oui' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/pe b/sql-ledger/locale/fr/pe
new file mode 100644
index 000000000..84127dea2
--- /dev/null
+++ b/sql-ledger/locale/fr/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Ajouter',
+ 'Add Project' => 'Ajouter projet',
+ 'All' => 'Tous',
+ 'Continue' => 'Continuer',
+ 'Delete' => 'Supprimer',
+ 'Description' => 'Description',
+ 'Edit Project' => 'Modifier projet',
+ 'Number' => 'Numéro',
+ 'Orphaned' => 'Orphelin',
+ 'Project' => 'Projet',
+ 'Project Number missing!' => 'Numéro du projet manquant!',
+ 'Project deleted!' => 'Projet supprimé!',
+ 'Project saved!' => 'Projet enregistré!',
+ 'Projects' => 'Projets',
+ 'Save' => 'Enregistrer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'ajouter' => 'add',
+ 'continuer' => 'continue',
+ 'supprimer' => 'delete',
+ 'enregistrer' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/rc b/sql-ledger/locale/fr/rc
new file mode 100644
index 000000000..092aabece
--- /dev/null
+++ b/sql-ledger/locale/fr/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Compte',
+ 'Balance' => 'Solde',
+ 'Cleared Balance' => 'Solde rapproché',
+ 'Continue' => 'Continuer',
+ 'Date' => 'Date',
+ 'Deposit' => 'Dépôt',
+ 'Description' => 'Description',
+ 'Difference' => 'Différence',
+ 'Done' => 'Fait!',
+ 'Exchangerate Difference' => 'Différence de taux de change',
+ 'From' => 'De',
+ 'Out of balance!' => 'Solde non équilibré!',
+ 'Payment' => 'Paiement',
+ 'Reconciliation' => 'Rapprochement',
+ 'Select all' => 'Sélectionner tout',
+ 'Source' => 'Source',
+ 'Statement Balance' => 'Relevé de compte',
+ 'Update' => 'Mettre à jour',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuer' => 'continue',
+ 'fait!' => 'done',
+ 'sélectionner_tout' => 'select_all',
+ 'mettre_à_jour' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/fr/rp b/sql-ledger/locale/fr/rp
new file mode 100644
index 000000000..dad49de0c
--- /dev/null
+++ b/sql-ledger/locale/fr/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Dépenses exigibles',
+ 'AR Aging' => 'Recettes exigibles',
+ 'Account' => 'Compte',
+ 'Accounts' => 'Comptes',
+ 'Amount' => 'Total',
+ 'Apr' => 'Avril',
+ 'April' => 'Avril',
+ 'Attachment' => 'Pièce jointe',
+ 'Aug' => 'Août',
+ 'August' => 'Août',
+ 'Balance' => 'Solde',
+ 'Balance Sheet' => 'Bilan',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'En liquide',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparer à',
+ 'Continue' => 'Continuer',
+ 'Copies' => 'Copies',
+ 'Credit' => 'Crédit',
+ 'Current' => 'En cours',
+ 'Customer' => 'Client',
+ 'Date' => 'Date',
+ 'Debit' => 'Débit',
+ 'Dec' => 'Déc.',
+ 'December' => 'Décembre',
+ 'Decimalplaces' => 'Décimales',
+ 'Department' => 'Department',
+ 'Description' => 'Description',
+ 'Due' => 'Echéance',
+ 'E-mail' => 'Email',
+ 'E-mail Statement to' => 'Message éléctronique à',
+ 'Feb' => 'Fév.',
+ 'February' => 'Février',
+ 'From' => 'De',
+ 'GIFI' => 'Code d\'Identification Comptable ou Fiscale',
+ 'Heading' => 'En-tête',
+ 'ID' => 'ID',
+ 'In-line' => 'En ligne',
+ 'Include in Report' => 'Inclure dans l\'état',
+ 'Income Statement' => 'Compte de Résultat',
+ 'Invoice' => 'Facture',
+ 'Jan' => 'Jan.',
+ 'January' => 'Janvier',
+ 'Jul' => 'Juil.',
+ 'July' => 'Juillet',
+ 'Jun' => 'Juin',
+ 'June' => 'Juin',
+ 'Mar' => 'Mars',
+ 'March' => 'Mars',
+ 'May' => 'Mai',
+ 'May ' => 'Mai ',
+ 'Message' => 'Message',
+ 'N/A' => 'Non Applicable',
+ 'Nothing selected!' => 'Pas de sélection!',
+ 'Nov' => 'Nov.',
+ 'November' => 'Novembre',
+ 'Oct' => 'Oct.',
+ 'October' => 'Octobre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Paiements',
+ 'Postscript' => 'Postcript',
+ 'Print' => 'Imprimer',
+ 'Printer' => 'Imprimante',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'Reçus',
+ 'Report for' => 'Rapport de',
+ 'Retained Earnings' => 'Éxcédents non distribués',
+ 'Screen' => 'Écran',
+ 'Select all' => 'Sélectionner tout',
+ 'Select postscript or PDF!' => 'Sélectionner Postscript ou PDF',
+ 'Sep' => 'Sept.',
+ 'September' => 'Septembre',
+ 'Source' => 'Source',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Relevé',
+ 'Statement sent to' => 'Relevé envoyé à',
+ 'Statements sent to printer!' => 'Relevés envoyés à l\'imprimante!',
+ 'Subject' => 'Objet',
+ 'Subtotal' => 'Sous Total',
+ 'Tax' => 'Taxe',
+ 'Tax collected' => 'Taxe collectée',
+ 'Tax paid' => 'Taxe payée',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balance Globale',
+ 'Vendor' => 'Fournisseur',
+ 'as at' => 'au',
+ 'collected on sales' => 'collectées sur les ventes',
+ 'for Period' => 'pour la période',
+ 'paid on purchases' => 'payées sur les achats',
+ 'to' => 'jusqu\'au',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuer' => 'continue',
+ 'email' => 'e_mail',
+ 'imprimer' => 'print',
+ 'sélectionner_tout' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/COPYING b/sql-ledger/locale/hu/COPYING
new file mode 100644
index 000000000..890d2e83b
--- /dev/null
+++ b/sql-ledger/locale/hu/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# Hungarian texts:
+#
+# Author: Kabai József <kabai@investor.hu>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/hu/LANGUAGE b/sql-ledger/locale/hu/LANGUAGE
new file mode 100644
index 000000000..3459bb258
--- /dev/null
+++ b/sql-ledger/locale/hu/LANGUAGE
@@ -0,0 +1 @@
+Hungarian
diff --git a/sql-ledger/locale/hu/admin b/sql-ledger/locale/hu/admin
new file mode 100644
index 000000000..3aca70acc
--- /dev/null
+++ b/sql-ledger/locale/hu/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Hozzáférési jogok',
+ 'Accounting' => 'Könyvelés',
+ 'Add User' => 'Új felhasználó',
+ 'Address' => 'Cím',
+ 'Administration' => 'Rendszerfelügyelet',
+ 'Administrator' => 'Rendszergazda',
+ 'All Datasets up to date!' => 'Összes ügyféladatbázis frissítve!',
+ 'Change Admin Password' => 'Rendszergazda jelszavának megváltoztatása',
+ 'Change Password' => 'Jelszó megváltoztatása',
+ 'Character Set' => 'Betû kódlap',
+ 'Click on login name to edit!' => 'Módosításhoz klikkeljen a felhasználó nevére!',
+ 'Company' => 'Társaság',
+ 'Connect to' => 'Csatlakozva ehhez:',
+ 'Continue' => 'Folytatás',
+ 'Create Chart of Accounts' => 'Számlatükör készítése',
+ 'Create Dataset' => 'Új cégadatbázis',
+ 'DBI not installed!' => 'DBI program nincs installálva!',
+ 'Database' => 'Adatbázis',
+ 'Database Administration' => 'Adatbázis felügyelet',
+ 'Database Driver not checked!' => 'Nincs kijelölve az adatbázismotor típusa!',
+ 'Database User missing!' => 'Adatbázis felhasználója hiányzik!',
+ 'Dataset' => 'Cégadatbázis',
+ 'Dataset missing!' => 'Cégadatbázis hiányzik!',
+ 'Dataset updated!' => 'Cégadatbázis frissítve!',
+ 'Date Format' => 'Dátumformátum',
+ 'Delete' => 'Törlés',
+ 'Delete Dataset' => 'Cégadatbázis törlése',
+ 'Directory' => 'Könyvtár',
+ 'Driver' => 'Meghajtó',
+ 'Dropdown Limit' => 'Lenyíló ablak limit',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Felhasználó módosítása',
+ 'Existing Datasets' => 'Létezõ cégadatbázisok',
+ 'Fax' => 'Fax',
+ 'Host' => 'Adatbázis helye:',
+ 'Hostname missing!' => 'Adatbázis helye hiányzik!',
+ 'Incorrect Password!' => 'Érvénytelen jelszó!',
+ 'Language' => 'Nyelv',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Hagyja üresen a Hely és a Port mezõket, hacsak nem akar távoli kapcsolatot létesíteni',
+ 'Login' => 'Belépés',
+ 'Multibyte Encoding' => 'Multibyte kódolás',
+ 'Name' => 'Név',
+ 'New Templates' => 'Új sablonok',
+ 'No Database Drivers available!' => 'Nincs elérhetõ adatbázismeghajtó!',
+ 'No Dataset selected!' => 'Nincs kiválasztott cégadatbázis!',
+ 'Nothing to delete!' => 'Nincs mit törölni!',
+ 'Number Format' => 'Számformátum',
+ 'Oracle Database Administration' => 'Oracle adatbázis felügyelet',
+ 'Password' => 'Jelszó',
+ 'Password changed!' => 'Jelszó megváltozott!',
+ 'Pg Database Administration' => 'Postgresql adatbázis felügyelet',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port száma',
+ 'Port missing!' => 'Port száma hiányzik!',
+ 'Printer' => 'Nyomtató',
+ 'Save' => 'Mentés',
+ 'Select a Dataset to delete and press "Continue"' => 'Válassza ki a törölni kívánt cégadatbázist, és klikkeljen a "Folytatás"-ra',
+ 'Setup Templates' => 'Sablonok beállítása',
+ 'Ship via' => 'Szállítás innen:',
+ 'Signature' => 'Aláírás',
+ 'Stylesheet' => 'Stíluslap',
+ 'Templates' => 'Sablonok',
+ 'The following Datasets are not in use and can be deleted' => 'Az alábbi cégadatbázisok üresek, és törölhetõk',
+ 'The following Datasets need to be updated' => 'Az alábbi cégadatbázisokat frissíteni kell',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'A meglévõ adatbázisok elõzetes ellenõrzése. A program itt még nem töröl és nem hoz létre semmit!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Új felhasználót úgy hozhat létre egy meglévõ cégadatbázishoz, hogy egy létezõ felhasználóra kattint, és a belépési nevet és a jelszót megváltoztatja és elmenti. Az új felhasználó örökli a beállításokat.',
+ 'Update Dataset' => 'Cégadatbázis frissítése',
+ 'Use Templates' => 'Sablon használata',
+ 'User' => 'Felhasználó',
+ 'User deleted!' => 'Felhasználó törölve!',
+ 'User saved!' => 'Felhasználó elmentve!',
+ 'Version' => 'Verzió',
+ 'You must enter a host and port for local and remote connections!' => 'A helyi és távoli kapcsolat eléréséhez írjon be helyet, és portszámot!',
+ 'does not exist' => 'nem létezik',
+ 'is already a member!' => 'már tag!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'zárolva',
+ 'successfully created!' => 'sikeresen létrehozva!',
+ 'successfully deleted!' => 'sikeresen törölve!',
+ 'website' => 'honlap',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'Új_felhasználó' => 'add_user',
+ 'rendszergazda_jelszavának_megváltoztatása' => 'change_admin_password',
+ 'jelszó_megváltoztatása' => 'change_password',
+ 'folytatás' => 'continue',
+ 'Új_cégadatbázis' => 'create_dataset',
+ 'törlés' => 'delete',
+ 'cégadatbázis_törlése' => 'delete_dataset',
+ 'belépés' => 'login',
+ 'oracle_adatbázis_felügyelet' => 'oracle_database_administration',
+ 'postgresql_adatbázis_felügyelet' => 'pg_database_administration',
+ 'mentés' => 'save',
+ 'cégadatbázis_frissítése' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/all b/sql-ledger/locale/hu/all
new file mode 100644
index 000000000..823f3665b
--- /dev/null
+++ b/sql-ledger/locale/hu/all
@@ -0,0 +1,499 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Szállítók',
+ 'AP Aging' => 'Szállító lejárati lista',
+ 'AP Transaction' => 'Szállító tranzakció',
+ 'AP Transactions' => 'Szállító tranzakciók',
+ 'AR' => 'Vevõk',
+ 'AR Aging' => 'Vevõ lejárati lista',
+ 'AR Transaction' => 'Vevõ tranzakció',
+ 'AR Transactions' => 'Vevõ tranzakciók',
+ 'About' => ' ',
+ 'Access Control' => 'Hozzáférési jogok',
+ 'Account' => 'Számla',
+ 'Account Number' => 'Számlaszám',
+ 'Account Number missing!' => 'Számlaszám hiányzik!',
+ 'Account Type' => 'Számlatípus',
+ 'Account Type missing!' => 'Számlatípus hiányzik!',
+ 'Account deleted!' => 'Számla törölve!',
+ 'Account saved!' => 'Számla elmentve!',
+ 'Accounting' => 'Könyvelés',
+ 'Accounting Menu' => 'Menü',
+ 'Accounts' => 'Számlák',
+ 'Active' => 'Aktív',
+ 'Add' => 'Új',
+ 'Add Account' => 'Új számla',
+ 'Add Accounts Payables Transaction' => 'Új szállító tranzakció',
+ 'Add Accounts Receivables Transaction' => 'Új vevõ tranzakció',
+ 'Add Assembly' => 'Új saját termék',
+ 'Add Customer' => 'Új vevõ',
+ 'Add GIFI' => 'Új gyûjtõkód',
+ 'Add General Ledger Transaction' => 'Új fõkönyvi könyvelés',
+ 'Add Group' => '',
+ 'Add Part' => 'Új cikk',
+ 'Add Project' => 'Új munkaszám',
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Invoice' => 'Új vevõszámla',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Add Service' => 'Új szolgáltatás',
+ 'Add Transaction' => 'Új tranzakció',
+ 'Add User' => 'Új felhasználó',
+ 'Add Vendor' => 'Új szállító',
+ 'Add Vendor Invoice' => '',
+ 'Address' => 'Cím',
+ 'Administration' => 'Rendszerfelügyelet',
+ 'Administrator' => 'Rendszergazda',
+ 'All' => 'Összes',
+ 'All Datasets up to date!' => 'Összes ügyféladatbázis frissítve!',
+ 'Amount' => 'Összeg',
+ 'Amount Due' => 'Esedékes összeg',
+ 'Amount does not equal applied!' => 'Az összeg nem egyezik a kitöltött szám(ok) összegével',
+ 'Amount missing!' => 'Összeg hiányzik!',
+ 'Applied' => 'Kitöltés',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Invoice Number' => 'Biztos, hogy törölni akarja? Számlaszám:',
+ 'Are you sure you want to delete Order Number' => 'Biztos, hogy törölni akarja? Megrendelésszám:',
+ 'Are you sure you want to delete Transaction' => 'Biztos, hogy törölni akarja? Tranzakció:',
+ 'Assemblies' => 'Saját termékek',
+ 'Assemblies restocked!' => 'Saját termékek készletre véve',
+ 'Assembly Number missing!' => 'Saját termékszám hiányzik!',
+ 'Asset' => 'Eszköz',
+ 'Attachment' => 'Csatolás',
+ 'Audit Control' => 'Audit Kontroll',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'BOM' => '',
+ 'Backup' => 'Biztonsági másolat',
+ 'Backup sent to' => 'Biztonsági másolat elküldve:',
+ 'Balance' => 'Egyenleg',
+ 'Balance Sheet' => 'Mérleg',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Az ügyféladatbázisban lehet könyvelni',
+ 'Bought' => 'Vásárolt',
+ 'Business Number' => 'Cégszám',
+ 'C' => 'C',
+ 'COGS' => 'ELÁBÉ',
+ 'Cannot delete account!' => 'A számlát nem lehet törölni',
+ 'Cannot delete customer!' => 'A vevõt nem lehet törölni!',
+ 'Cannot delete default account!' => 'Az alapbeállítású számlát nem lehet törölni!',
+ 'Cannot delete invoice!' => 'A partnerszámlát nem lehet törölni!',
+ 'Cannot delete item!' => 'A tételt nem lehet törölni!',
+ 'Cannot delete order!' => 'A rendelést nem lehet törölni!',
+ 'Cannot delete transaction!' => 'A tranzakciót nem lehet törölni!',
+ 'Cannot delete vendor!' => 'Szállítót nem lehet törölni!',
+ 'Cannot have a value in both Debit and Credit!' => 'A Tartozik és Követel oldal is tartalmaz értéket!',
+ 'Cannot post a transaction without a value!' => 'Az összeg megadása nélkül nem lehet a tranzakciót rögzíteni!',
+ 'Cannot post invoice for a closed period!' => 'A lezárt idõszakban nem lehet számlát kiállítani!',
+ 'Cannot post invoice!' => 'A partnerszámlát nem lehet kiállítani',
+ 'Cannot post payment for a closed period!' => 'A lezárt idõszakban nem lehet fizetést rögzíteni!',
+ 'Cannot post payment!' => 'A pénzmozgást nem lehet rögzíteni',
+ 'Cannot post transaction for a closed period!' => 'A lezárt idõszakban nem lehet tranzakciót rögzíteni!!',
+ 'Cannot post transaction!' => 'A tranzakciót nem lehet rögzíteni!',
+ 'Cannot process payment for a closed period!' => 'A pénzmozgást nem lehet lezárt idõszakban rögzíteni!',
+ 'Cannot save account!' => 'A számlát nem lehet elmenteni!',
+ 'Cannot save order!' => 'A rendelést nem lehet elmenteni!',
+ 'Cannot save preferences!' => 'A beállításokat nem lehet elmenteni',
+ 'Cannot stock assemblies!' => 'A saját terméket nem lehet készletre venni!',
+ 'Cash' => 'Pénzmozgások',
+ 'Cash based' => 'Pénzmozgás alapján',
+ 'Cc' => 'Másolat',
+ 'Change Admin Password' => 'Rendszergazda jelszavának megváltoztatása',
+ 'Change Password' => 'Jelszó megváltoztatása',
+ 'Character Set' => 'Betû kódlap',
+ 'Chart of Accounts' => 'Számlatükör',
+ 'Check' => 'Csekk',
+ 'Check printed!' => 'Csekk kinyomtatva!',
+ 'Check printing failed!' => 'A csekk nyomtatása nem sikerült!',
+ 'Cleared Balance' => 'Egyeztetett egyenleg',
+ 'Click on login name to edit!' => 'Módosításhoz klikkeljen a felhasználó nevére!',
+ 'Close Books up to' => 'Könyvelés lezárása eddig az idõpontig:',
+ 'Closed' => 'Lezárt',
+ 'Company' => 'Társaság',
+ 'Compare to' => 'Összehasonlítva:',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Connect to' => 'Csatlakozva ehhez:',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Copy to COA' => 'Másolás a számlatükörbe',
+ 'Create Chart of Accounts' => 'Számlatükör készítése',
+ 'Create Dataset' => 'Új cégadatbázis',
+ 'Credit' => 'Követel',
+ 'Credit Limit' => 'Hitelkeret',
+ 'Curr' => 'Dev',
+ 'Currency' => 'Deviza',
+ 'Current' => 'Nem lejárt',
+ 'Customer' => 'Vevõ',
+ 'Customer deleted!' => 'Vevõ törölve!',
+ 'Customer missing!' => 'Vevõ hiányzik!',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Customer saved!' => 'Vevõ elmentve!',
+ 'Customers' => 'Vevõadatok',
+ 'DBI not installed!' => 'DBI program nincs installálva!',
+ 'Database' => 'Adatbázis',
+ 'Database Administration' => 'Adatbázis felügyelet',
+ 'Database Driver not checked!' => 'Nincs kijelölve az adatbázismotor típusa!',
+ 'Database Host' => 'Adatbázis helye',
+ 'Database User missing!' => 'Adatbázis felhasználója hiányzik!',
+ 'Dataset' => 'Cégadatbázis',
+ 'Dataset missing!' => 'Cégadatbázis hiányzik!',
+ 'Dataset updated!' => 'Cégadatbázis frissítve!',
+ 'Date' => 'Dátum',
+ 'Date Format' => 'Dátumformátum',
+ 'Date Paid' => 'Fizetés napja',
+ 'Date missing!' => 'Dátum hiányzik',
+ 'Debit' => 'Tartozik',
+ 'Debit and credit out of balance!' => 'Tartozik Követel összege nem egyezik!',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Decimalplaces' => 'Tizedeshelyek',
+ 'Delete' => 'Törlés',
+ 'Delete Account' => 'Számla törlése',
+ 'Delete Dataset' => 'Cégadatbázis törlése',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Deposit' => 'Betét',
+ 'Description' => 'Szöveges leírás',
+ 'Difference' => 'Eltérés',
+ 'Directory' => 'Könyvtár',
+ 'Discount' => 'Engedmény',
+ 'Done' => 'Elvégezve',
+ 'Drawing' => 'Rajz',
+ 'Driver' => 'Meghajtó',
+ 'Dropdown Limit' => 'Lenyíló ablak limit',
+ 'Due' => 'Esedékes',
+ 'Due Date' => 'Esedékesség',
+ 'Due Date missing!' => 'Esedékesség hiányzik!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Kimutatás küldése e-mail-ben:',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Edit' => 'Módosítás',
+ 'Edit Account' => 'Számlaszám módosítása',
+ 'Edit Accounts Payables Transaction' => 'Szállító tranzakció módosítása',
+ 'Edit Accounts Receivables Transaction' => 'Vevõ tranzakció módosítása',
+ 'Edit Assembly' => 'Saját termék módosítása',
+ 'Edit Customer' => 'Vevõ módosítása',
+ 'Edit GIFI' => 'Gyûjtõkód módosítása',
+ 'Edit General Ledger Transaction' => 'Vegyes könyvelési tétel módosítása',
+ 'Edit Group' => '',
+ 'Edit Part' => 'Cikk módosítása',
+ 'Edit Preferences for' => 'Felhasználói paraméterek módosítása:',
+ 'Edit Project' => 'Projekt módosítása',
+ 'Edit Purchase Order' => 'Beszerzési rendelés módosítása',
+ 'Edit Sales Invoice' => 'Vevõszámla módosítása',
+ 'Edit Sales Order' => 'Vevõrendelés módosítása',
+ 'Edit Service' => 'Szolgáltatás módosítása',
+ 'Edit Template' => 'Sablon módosítása',
+ 'Edit User' => 'Felhasználó módosítása',
+ 'Edit Vendor' => 'Szállító módosítása',
+ 'Edit Vendor Invoice' => '',
+ 'Employee' => 'Alkalmazott',
+ 'Enforce transaction reversal for all dates' => 'Minden dátum esetében visszautasítsa a tranzakció rögzítését?',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'A saját és külföldi devizákat jelölje 3 betûvel kettõsponttal elválasztva! (pl. HUF:EUR:USD)',
+ 'Equity' => 'Tõke',
+ 'Exch' => 'Árf',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate Difference' => 'Árfolyamkülönbség',
+ 'Exchangerate for payment missing!' => 'A fizetett összeg átváltási árfolyama hiányzik!',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Existing Datasets' => 'Létezõ cégadatbázisok',
+ 'Expense' => 'Költség',
+ 'Expense Account' => 'Költségszámla',
+ 'Expense/Asset' => 'Költség/Eszköz',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'Foreign Exchange Gain' => 'Árfolyamnyereség',
+ 'Foreign Exchange Loss' => 'Árfolyamveszteség',
+ 'From' => 'Mikortól:',
+ 'GIFI' => 'Gyûjtõkód',
+ 'GIFI deleted!' => 'Gyûjtõkód törölve!',
+ 'GIFI missing!' => 'Gyûjtõkód hiányzik!',
+ 'GIFI saved!' => 'Gyûjtõkód elmentve!',
+ 'GL Transaction' => 'Fõkönyvi tranzakció!',
+ 'General Ledger' => 'Fõkönyvi könyvelés',
+ 'Goods & Services' => 'Áruk & Szolgáltatások',
+ 'Group' => '',
+ 'Group Items' => '',
+ 'Group deleted!' => '',
+ 'Group missing!' => '',
+ 'Group saved!' => '',
+ 'Groups' => '',
+ 'HTML Templates' => 'HTML sablonok',
+ 'Heading' => 'Fejléc',
+ 'Host' => 'Adatbázis helye:',
+ 'Hostname missing!' => 'Adatbázis helye hiányzik!',
+ 'ID' => 'Azonosító',
+ 'Image' => 'Kép',
+ 'In-line' => 'Beágyazva',
+ 'Include in Report' => 'Oszlopok:',
+ 'Include in drop-down menus' => 'Mely tranzakció(k)-nál lehessen kiválasztani?:',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Kiválasztható legyen a vevõ/szállító ûrlapokon, mint adószámla?',
+ 'Income' => 'Árbevétel',
+ 'Income Account' => 'Árbevételszámla',
+ 'Income Statement' => 'Eredménykimutatás',
+ 'Incorrect Dataset version!' => 'Érvénytelen adatbázisverzió!',
+ 'Incorrect Password!' => 'Érvénytelen jelszó!',
+ 'Individual Items' => 'Összetevõk',
+ 'Inventory' => 'Készlet',
+ 'Inventory Account' => 'Készletszámla',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Mielõtt ezt a saját terméket elévültnek nyilvánítja,a mennyiségnek nullának kell lennie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Mielõtt ezt az anyagot/árut elévültnek nyilvánítja,a mennyiségnek nullának kell lennie!!',
+ 'Invoice' => 'Számla',
+ 'Invoice Date' => 'Teljesítés dátuma',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Invoice deleted!' => 'Számla törölve!',
+ 'Invoice posted!' => 'Számla rögzítve!',
+ 'Invoices' => 'Számlák',
+ 'Is this a summary account to record' => 'Gyûjtõszámlaként szerepeljen ezeknél a tranzakcióknál:',
+ 'Item deleted!' => 'Tétel törölve!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'LaTeX Templates' => 'LaTeX sablonok',
+ 'Language' => 'Nyelv',
+ 'Last Cost' => 'Utolsó beszerzési ár',
+ 'Last Invoice Number' => 'Utolsó számlaszám',
+ 'Last Numbers & Default Accounts' => 'Legutolsó számok & Alapszámlák',
+ 'Last Purchase Order Number' => 'Utolsó beszerzési rendelésszám',
+ 'Last Sales Order Number' => 'Utolsó vevõ rendelésszám',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Hagyja üresen a Hely és a Port mezõket, hacsak nem akar távoli kapcsolatot létesíteni',
+ 'Liability' => 'Kötelezettség',
+ 'Licensed to' => 'Cég:',
+ 'Line Total' => 'Sor összesen',
+ 'Link' => 'Kapcsolat',
+ 'Link Accounts' => 'Számlakapcsolatok',
+ 'List Accounts' => 'Számlák listázása',
+ 'List GIFI' => 'Gyûjtõkódok listázása',
+ 'List Price' => 'Listaár',
+ 'List Transactions' => 'Tranzakciók listázása',
+ 'Login' => 'Belépés',
+ 'Logout' => 'Kilépés',
+ 'Make' => 'Gyártmány',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modell',
+ 'Multibyte Encoding' => 'Multibyte kódolás',
+ 'N/A' => 'N/A',
+ 'Name' => 'Név',
+ 'Name missing!' => 'Név hiányzik',
+ 'New Templates' => 'Új sablonok',
+ 'No' => 'Nem',
+ 'No Database Drivers available!' => 'Nincs elérhetõ adatbázismeghajtó!',
+ 'No Dataset selected!' => 'Nincs kiválasztott cégadatbázis!',
+ 'No email address for' => 'Nincs e-mail címe:',
+ 'No.' => 'Sz.',
+ 'Notes' => 'Megjegyzés',
+ 'Nothing applied!' => 'Nincs semmi kitöltve!',
+ 'Nothing selected!' => 'Nincs semmi kiválasztva!',
+ 'Nothing to delete!' => 'Nincs mit törölni!',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number Format' => 'Számformátum',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'O' => 'Ny.',
+ 'Obsolete' => 'Elévült',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'On Hand' => 'Készleten',
+ 'On Order' => 'Beszerzési rendelések',
+ 'Open' => 'Nyitott',
+ 'Oracle Database Administration' => 'Oracle adatbázis felügyelet',
+ 'Order' => 'Rendelés',
+ 'Order Date' => 'Rendelés dátuma',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Entry' => 'Rendelések',
+ 'Order Number' => 'Rendelés száma',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'Order deleted!' => 'Rendelés törölve!',
+ 'Order saved!' => 'Rendelés elmentve!',
+ 'Ordered' => 'Vevõrendelések',
+ 'Orphaned' => 'Tranzakció nélküli',
+ 'Out of balance!' => 'Az egyenleg nem stimmel!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Paid' => 'Fizetve',
+ 'Paid in full' => 'Teljesen fizetve',
+ 'Part' => 'Cikk',
+ 'Part Number missing!' => 'Cikk száma hiányzik!',
+ 'Parts' => 'Cikkek',
+ 'Parts Inventory' => 'Cikkek készlete',
+ 'Password' => 'Jelszó',
+ 'Password changed!' => 'Jelszó megváltozott!',
+ 'Payables' => 'Szállítók',
+ 'Payment' => 'Kifizetés',
+ 'Payment date missing!' => 'Pénzmozgás dátuma hiányzik!',
+ 'Payment posted!' => 'Pénzmozgás rögzítve',
+ 'Payments' => 'Kifizetések',
+ 'Pg Database Administration' => 'Postgresql adatbázis felügyelet',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port száma',
+ 'Port missing!' => 'Port száma hiányzik!',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Beállítások',
+ 'Preferences saved!' => 'Beállítások elmentve!',
+ 'Price' => 'Ár',
+ 'Print' => 'Nyomtatás',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Project Number' => 'Munkaszám',
+ 'Project Number missing!' => 'Munkaszám száma hiányzik!',
+ 'Project deleted!' => 'Munkaszám törölve!',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Project saved!' => 'Munkaszám elmentve!',
+ 'Projects' => 'Munkaszámok',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Purchase Orders' => 'Beszerzési rendelések',
+ 'Qty' => 'Menny.',
+ 'ROP' => 'Rendelési pont',
+ 'Rate' => 'Árfolyam',
+ 'Recd' => 'Kapott',
+ 'Receipt' => 'Bevétel',
+ 'Receipt printed!' => 'Nyugta nyomtatva!',
+ 'Receipt printing failed!' => 'A nyugta nyomtatása nem sikerült!',
+ 'Receipts' => 'Bevételek',
+ 'Receivables' => 'Vevõk',
+ 'Reconciliation' => 'Egyeztetés',
+ 'Record in' => 'Feladás:',
+ 'Reference' => 'Hivatkozás',
+ 'Reference missing!' => 'Hivatkozás hiányzik',
+ 'Remaining' => 'Maradék',
+ 'Report for' => 'Jelentés:',
+ 'Reports' => 'Jelentések',
+ 'Required by' => 'Leszállítás',
+ 'Retained Earnings' => 'Adózás elõtti eredmény',
+ 'Sales' => 'Eladás',
+ 'Sales Invoice' => 'Számlázás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Sales Orders' => 'Vevõrendelések',
+ 'Salesperson' => '',
+ 'Save' => 'Mentés',
+ 'Save as new' => 'Mentés újként',
+ 'Save to File' => 'Másolat File-ba',
+ 'Screen' => 'Képernyõre',
+ 'Select a Dataset to delete and press "Continue"' => 'Válassza ki a törölni kívánt cégadatbázist, és klikkeljen a "Folytatás"-ra',
+ 'Select all' => 'Mindent kijelöl',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sell Price' => 'Eladási ár',
+ 'Send by E-Mail' => 'Másolat E-mail-ben',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Service Items' => 'Szolgáltatás tételek',
+ 'Service Number missing!' => 'Szolgáltatás száma hiányzik!',
+ 'Services' => 'Szolgáltatások',
+ 'Setup Templates' => 'Sablonok beállítása',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Ship via' => 'Szállítás innen:',
+ 'Short' => 'Hiányzó',
+ 'Signature' => 'Aláírás',
+ 'Sold' => 'Eladva',
+ 'Source' => 'Bizonylatszám',
+ 'Standard' => 'Sztenderd',
+ 'Statement' => 'Kimutatás',
+ 'Statement Balance' => 'Kimutatás egyenlege',
+ 'Statement sent to' => 'Kimutatás elküldve:',
+ 'Statements sent to printer!' => 'Kimutatás kinyomtatva!',
+ 'Stock' => '',
+ 'Stock Assembly' => 'Saját termék bevételezése',
+ 'Stylesheet' => 'Stíluslap',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'System' => 'Törzsadatok',
+ 'Tax' => 'Adó',
+ 'Tax Accounts' => 'Adószámlák',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'Tax collected' => 'Fizetendõ ÁFA',
+ 'Tax paid' => 'Levonható ÁFA',
+ 'Taxable' => 'Adó:',
+ 'Template saved!' => 'Sablon elmentve!',
+ 'Templates' => 'Sablonok',
+ 'Terms: Net' => 'Határidõ',
+ 'The following Datasets are not in use and can be deleted' => 'Az alábbi cégadatbázisok üresek, és törölhetõk',
+ 'The following Datasets need to be updated' => 'Az alábbi cégadatbázisokat frissíteni kell',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'A meglévõ adatbázisok elõzetes ellenõrzése. A program itt még nem töröl és nem hoz létre semmit!',
+ 'To' => 'Meddig:',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Új felhasználót úgy hozhat létre egy meglévõ cégadatbázishoz, hogy egy létezõ felhasználóra kattint, és a belépési nevet és a jelszót megváltoztatja és elmenti. Az új felhasználó örökli a beállításokat.',
+ 'Top Level' => 'Legfelsõ szint',
+ 'Total' => 'Végösszeg',
+ 'Transaction Date missing!' => 'Tranzakció dátuma hiányzik!',
+ 'Transaction deleted!' => 'Tranzakció törölve!',
+ 'Transaction posted!' => 'Tranzakció rögzítve!',
+ 'Transaction reversal enforced for all dates' => 'Bármilyen dátumú tranzakciót visszautasít',
+ 'Transaction reversal enforced up to' => 'E dátumig utasítja vissza a tranzakciókat',
+ 'Transactions' => 'Tranzakciók',
+ 'Transactions exist, cannot delete customer!' => 'A vevõhöz tranzakciók tartoznak, nem lehet törölni!',
+ 'Transactions exist, cannot delete vendor!' => 'A szállítóhoz tranzakciók tartoznak, nem lehet törölni!',
+ 'Transactions exist; cannot delete account!' => 'A számlához tranzakciók tartoznak, nem lehet törölni!',
+ 'Trial Balance' => 'Fõkönyvi kivonat',
+ 'Unit' => 'Egység',
+ 'Unit of measure' => 'Mértékegység',
+ 'Update' => 'Frissítés',
+ 'Update Dataset' => 'Cégadatbázis frissítése',
+ 'Updated' => 'Frissítve',
+ 'Use Templates' => 'Sablon használata',
+ 'User' => 'Felhasználó',
+ 'User deleted!' => 'Felhasználó törölve!',
+ 'User saved!' => 'Felhasználó elmentve!',
+ 'Vendor' => 'Szállító',
+ 'Vendor Invoice' => '',
+ 'Vendor deleted!' => 'Szállító törölve!',
+ 'Vendor missing!' => 'Szállító hiányzik!',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'Vendor saved!' => 'Szállító elmentve!',
+ 'Vendors' => 'Szállítók',
+ 'Version' => 'Verzió',
+ 'Weight' => 'Súly',
+ 'Weight Unit' => 'Súlyegység',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'Year End' => 'Évzárás',
+ 'Yes' => 'Igen',
+ 'You are logged out!' => 'Már kijelentkezett!',
+ 'You did not enter a name!' => 'Nem írt be nevet!',
+ 'You must enter a host and port for local and remote connections!' => 'A helyi és távoli kapcsolat eléréséhez írjon be helyet, és portszámot!',
+ 'as at' => 'Fordulónap:',
+ 'collected on sales' => 'vevõszámlák alapján',
+ 'days' => 'nap',
+ 'does not exist' => 'nem létezik',
+ 'ea' => 'db',
+ 'emailed to' => 'e-mail küldve:',
+ 'for Period' => 'Idõszak:',
+ 'hr' => 'óra',
+ 'is already a member!' => 'már tag!',
+ 'is not a member!' => 'nem tag!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'zárolva',
+ 'paid on purchases' => 'szállítószámlák alapján',
+ 'sent to printer' => 'kinyomtatva',
+ 'successfully created!' => 'sikeresen létrehozva!',
+ 'successfully deleted!' => 'sikeresen törölve!',
+ 'to' => 'Meddig:',
+ 'website' => 'honlap',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/am b/sql-ledger/locale/hu/am
new file mode 100644
index 000000000..0bb2b83a7
--- /dev/null
+++ b/sql-ledger/locale/hu/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Szállítók',
+ 'AR' => 'Vevõk',
+ 'Account' => 'Számla',
+ 'Account Number' => 'Számlaszám',
+ 'Account Number missing!' => 'Számlaszám hiányzik!',
+ 'Account Type' => 'Számlatípus',
+ 'Account Type missing!' => 'Számlatípus hiányzik!',
+ 'Account deleted!' => 'Számla törölve!',
+ 'Account saved!' => 'Számla elmentve!',
+ 'Add Account' => 'Új számla',
+ 'Add GIFI' => 'Új gyûjtõkód',
+ 'Address' => 'Cím',
+ 'Asset' => 'Eszköz',
+ 'Audit Control' => 'Audit Kontroll',
+ 'Backup sent to' => 'Biztonsági másolat elküldve:',
+ 'Books are open' => 'Az ügyféladatbázisban lehet könyvelni',
+ 'Business Number' => 'Cégszám',
+ 'COGS' => 'ELÁBÉ',
+ 'Cannot delete account!' => 'A számlát nem lehet törölni',
+ 'Cannot delete default account!' => 'Az alapbeállítású számlát nem lehet törölni!',
+ 'Cannot save account!' => 'A számlát nem lehet elmenteni!',
+ 'Cannot save preferences!' => 'A beállításokat nem lehet elmenteni',
+ 'Character Set' => 'Betû kódlap',
+ 'Chart of Accounts' => 'Számlatükör',
+ 'Close Books up to' => 'Könyvelés lezárása eddig az idõpontig:',
+ 'Company' => 'Társaság',
+ 'Continue' => 'Folytatás',
+ 'Copy to COA' => 'Másolás a számlatükörbe',
+ 'Credit' => 'Követel',
+ 'Date Format' => 'Dátumformátum',
+ 'Debit' => 'Tartozik',
+ 'Delete' => 'Törlés',
+ 'Delete Account' => 'Számla törlése',
+ 'Description' => 'Szöveges leírás',
+ 'Dropdown Limit' => 'Lenyíló ablak limit',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Módosítás',
+ 'Edit Account' => 'Számlaszám módosítása',
+ 'Edit GIFI' => 'Gyûjtõkód módosítása',
+ 'Edit Preferences for' => 'Felhasználói paraméterek módosítása:',
+ 'Edit Template' => 'Sablon módosítása',
+ 'Enforce transaction reversal for all dates' => 'Minden dátum esetében visszautasítsa a tranzakció rögzítését?',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'A saját és külföldi devizákat jelölje 3 betûvel kettõsponttal elválasztva! (pl. HUF:EUR:USD)',
+ 'Equity' => 'Tõke',
+ 'Expense' => 'Költség',
+ 'Expense Account' => 'Költségszámla',
+ 'Expense/Asset' => 'Költség/Eszköz',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Árfolyamnyereség',
+ 'Foreign Exchange Loss' => 'Árfolyamveszteség',
+ 'GIFI' => 'Gyûjtõkód',
+ 'GIFI deleted!' => 'Gyûjtõkód törölve!',
+ 'GIFI missing!' => 'Gyûjtõkód hiányzik!',
+ 'GIFI saved!' => 'Gyûjtõkód elmentve!',
+ 'Heading' => 'Fejléc',
+ 'Include in drop-down menus' => 'Mely tranzakció(k)-nál lehessen kiválasztani?:',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Kiválasztható legyen a vevõ/szállító ûrlapokon, mint adószámla?',
+ 'Income' => 'Árbevétel',
+ 'Income Account' => 'Árbevételszámla',
+ 'Inventory' => 'Készlet',
+ 'Inventory Account' => 'Készletszámla',
+ 'Is this a summary account to record' => 'Gyûjtõszámlaként szerepeljen ezeknél a tranzakcióknál:',
+ 'Language' => 'Nyelv',
+ 'Last Invoice Number' => 'Utolsó számlaszám',
+ 'Last Numbers & Default Accounts' => 'Legutolsó számok & Alapszámlák',
+ 'Last Purchase Order Number' => 'Utolsó beszerzési rendelésszám',
+ 'Last Sales Order Number' => 'Utolsó vevõ rendelésszám',
+ 'Liability' => 'Kötelezettség',
+ 'Link' => 'Kapcsolat',
+ 'Name' => 'Név',
+ 'No' => 'Nem',
+ 'No email address for' => 'Nincs e-mail címe:',
+ 'Number' => 'Szám',
+ 'Number Format' => 'Számformátum',
+ 'Parts Inventory' => 'Cikkek készlete',
+ 'Password' => 'Jelszó',
+ 'Payables' => 'Szállítók',
+ 'Payment' => 'Kifizetés',
+ 'Phone' => 'Telefon',
+ 'Preferences saved!' => 'Beállítások elmentve!',
+ 'Rate' => 'Árfolyam',
+ 'Receivables' => 'Vevõk',
+ 'Sales' => 'Eladás',
+ 'Save' => 'Mentés',
+ 'Service Items' => 'Szolgáltatás tételek',
+ 'Ship via' => 'Szállítás innen:',
+ 'Signature' => 'Aláírás',
+ 'Stylesheet' => 'Stíluslap',
+ 'Tax' => 'Adó',
+ 'Tax Accounts' => 'Adószámlák',
+ 'Template saved!' => 'Sablon elmentve!',
+ 'Transaction reversal enforced for all dates' => 'Bármilyen dátumú tranzakciót visszautasít',
+ 'Transaction reversal enforced up to' => 'E dátumig utasítja vissza a tranzakciókat',
+ 'Transactions exist; cannot delete account!' => 'A számlához tranzakciók tartoznak, nem lehet törölni!',
+ 'Weight Unit' => 'Súlyegység',
+ 'Year End' => 'Évzárás',
+ 'Yes' => 'Igen',
+ 'does not exist' => 'nem létezik',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'Új_számla' => 'add_account',
+ 'folytatás' => 'continue',
+ 'másolás_a_számlatükörbe' => 'copy_to_coa',
+ 'törlés' => 'delete',
+ 'módosítás' => 'edit',
+ 'számlaszám_módosítása' => 'edit_account',
+ 'mentés' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ap b/sql-ledger/locale/hu/ap
new file mode 100644
index 000000000..e39bd7055
--- /dev/null
+++ b/sql-ledger/locale/hu/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Szállító tranzakció',
+ 'AP Transactions' => 'Szállító tranzakciók',
+ 'Account' => 'Számla',
+ 'Add Accounts Payables Transaction' => 'Új szállító tranzakció',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Amount Due' => 'Esedékes összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Transaction' => 'Biztos, hogy törölni akarja? Tranzakció:',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Cannot delete transaction!' => 'A tranzakciót nem lehet törölni!',
+ 'Cannot post payment for a closed period!' => 'A lezárt idõszakban nem lehet fizetést rögzíteni!',
+ 'Cannot post transaction for a closed period!' => 'A lezárt idõszakban nem lehet tranzakciót rögzíteni!!',
+ 'Cannot post transaction!' => 'A tranzakciót nem lehet rögzíteni!',
+ 'Closed' => 'Lezárt',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Continue' => 'Folytatás',
+ 'Currency' => 'Deviza',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Date Paid' => 'Fizetés napja',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Description' => 'Szöveges leírás',
+ 'Due Date' => 'Esedékesség',
+ 'Due Date missing!' => 'Esedékesség hiányzik!',
+ 'Edit Accounts Payables Transaction' => 'Szállító tranzakció módosítása',
+ 'Employee' => 'Alkalmazott',
+ 'Exch' => 'Árf',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate for payment missing!' => 'A fizetett összeg átváltási árfolyama hiányzik!',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'ID' => 'Azonosító',
+ 'Include in Report' => 'Oszlopok:',
+ 'Invoice' => 'Számla',
+ 'Invoice Date' => 'Teljesítés dátuma',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Open' => 'Nyitott',
+ 'Order' => 'Rendelés',
+ 'Order Number' => 'Rendelés száma',
+ 'Paid' => 'Fizetve',
+ 'Payment date missing!' => 'Pénzmozgás dátuma hiányzik!',
+ 'Payments' => 'Kifizetések',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Source' => 'Bizonylatszám',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax' => 'Adó',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'Total' => 'Végösszeg',
+ 'Transaction deleted!' => 'Tranzakció törölve!',
+ 'Transaction posted!' => 'Tranzakció rögzítve!',
+ 'Update' => 'Frissítés',
+ 'Vendor' => 'Szállító',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor missing!' => 'Szállító hiányzik!',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'Yes' => 'Igen',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'szállító_tranzakció' => 'ap_transaction',
+ 'Új_szállító_tranzakció' => 'add_accounts_payables_transaction',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'szállító_tranzakció_módosítása' => 'edit_accounts_payables_transaction',
+ 'rögzítés' => 'post',
+ 'rögzítés_új_tranzakcióként' => 'post_as_new',
+ 'frissítés' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ar b/sql-ledger/locale/hu/ar
new file mode 100644
index 000000000..22430704b
--- /dev/null
+++ b/sql-ledger/locale/hu/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Vevõ tranzakció',
+ 'AR Transactions' => 'Vevõ tranzakciók',
+ 'Account' => 'Számla',
+ 'Add Accounts Receivables Transaction' => 'Új vevõ tranzakció',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Amount Due' => 'Esedékes összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Transaction' => 'Biztos, hogy törölni akarja? Tranzakció:',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Cannot delete transaction!' => 'A tranzakciót nem lehet törölni!',
+ 'Cannot post payment for a closed period!' => 'A lezárt idõszakban nem lehet fizetést rögzíteni!',
+ 'Cannot post transaction for a closed period!' => 'A lezárt idõszakban nem lehet tranzakciót rögzíteni!!',
+ 'Cannot post transaction!' => 'A tranzakciót nem lehet rögzíteni!',
+ 'Closed' => 'Lezárt',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Continue' => 'Folytatás',
+ 'Credit Limit' => 'Hitelkeret',
+ 'Currency' => 'Deviza',
+ 'Customer' => 'Vevõ',
+ 'Customer missing!' => 'Vevõ hiányzik!',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Date Paid' => 'Fizetés napja',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Description' => 'Szöveges leírás',
+ 'Due Date' => 'Esedékesség',
+ 'Due Date missing!' => 'Esedékesség hiányzik!',
+ 'Edit Accounts Receivables Transaction' => 'Vevõ tranzakció módosítása',
+ 'Exch' => 'Árf',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate for payment missing!' => 'A fizetett összeg átváltási árfolyama hiányzik!',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'ID' => 'Azonosító',
+ 'Include in Report' => 'Oszlopok:',
+ 'Invoice' => 'Számla',
+ 'Invoice Date' => 'Teljesítés dátuma',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Open' => 'Nyitott',
+ 'Order' => 'Rendelés',
+ 'Order Number' => 'Rendelés száma',
+ 'Paid' => 'Fizetve',
+ 'Payment date missing!' => 'Pénzmozgás dátuma hiányzik!',
+ 'Payments' => 'Kifizetések',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Remaining' => 'Maradék',
+ 'Sales Invoice' => 'Számlázás',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Ship via' => 'Szállítás innen:',
+ 'Source' => 'Bizonylatszám',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax' => 'Adó',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'Total' => 'Végösszeg',
+ 'Transaction deleted!' => 'Tranzakció törölve!',
+ 'Transaction posted!' => 'Tranzakció rögzítve!',
+ 'Update' => 'Frissítés',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'Yes' => 'Igen',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'vevõ_tranzakció' => 'ar_transaction',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'rögzítés' => 'post',
+ 'rögzítés_új_tranzakcióként' => 'post_as_new',
+ 'számlázás' => 'sales_invoice',
+ 'frissítés' => 'update',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/arap b/sql-ledger/locale/hu/arap
new file mode 100644
index 000000000..9809e3544
--- /dev/null
+++ b/sql-ledger/locale/hu/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Cím',
+ 'Continue' => 'Folytatás',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Description' => 'Szöveges leírás',
+ 'Number' => 'Szám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'folytatás' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ca b/sql-ledger/locale/hu/ca
new file mode 100644
index 000000000..df4726c7f
--- /dev/null
+++ b/sql-ledger/locale/hu/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Számla',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Balance' => 'Egyenleg',
+ 'Chart of Accounts' => 'Számlatükör',
+ 'Credit' => 'Követel',
+ 'Date' => 'Dátum',
+ 'Debit' => 'Tartozik',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Description' => 'Szöveges leírás',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'GIFI' => 'Gyûjtõkód',
+ 'Include in Report' => 'Oszlopok:',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'List Transactions' => 'Tranzakciók listázása',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Reference' => 'Hivatkozás',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Subtotal' => 'Részösszeg',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'tranzakciók_listázása' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/cp b/sql-ledger/locale/hu/cp
new file mode 100644
index 000000000..2a2b09a75
--- /dev/null
+++ b/sql-ledger/locale/hu/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Számla',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Amount does not equal applied!' => 'Az összeg nem egyezik a kitöltött szám(ok) összegével',
+ 'Amount missing!' => 'Összeg hiányzik!',
+ 'Applied' => 'Kitöltés',
+ 'Cannot post payment!' => 'A pénzmozgást nem lehet rögzíteni',
+ 'Cannot process payment for a closed period!' => 'A pénzmozgást nem lehet lezárt idõszakban rögzíteni!',
+ 'Check' => 'Csekk',
+ 'Check printed!' => 'Csekk kinyomtatva!',
+ 'Check printing failed!' => 'A csekk nyomtatása nem sikerült!',
+ 'Continue' => 'Folytatás',
+ 'Currency' => 'Deviza',
+ 'Customer' => 'Vevõ',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Date missing!' => 'Dátum hiányzik',
+ 'Description' => 'Szöveges leírás',
+ 'Due' => 'Esedékes',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'From' => 'Mikortól:',
+ 'Invoice' => 'Számla',
+ 'Invoices' => 'Számlák',
+ 'Nothing applied!' => 'Nincs semmi kitöltve!',
+ 'Number' => 'Szám',
+ 'Paid in full' => 'Teljesen fizetve',
+ 'Payment' => 'Kifizetés',
+ 'Payment posted!' => 'Pénzmozgás rögzítve',
+ 'Post' => 'Rögzítés',
+ 'Print' => 'Nyomtatás',
+ 'Printer' => 'Nyomtató',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Receipt' => 'Bevétel',
+ 'Receipt printed!' => 'Nyugta nyomtatva!',
+ 'Receipt printing failed!' => 'A nyugta nyomtatása nem sikerült!',
+ 'Reference' => 'Hivatkozás',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Update' => 'Frissítés',
+ 'Vendor' => 'Szállító',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'folytatás' => 'continue',
+ 'rögzítés' => 'post',
+ 'nyomtatás' => 'print',
+ 'frissítés' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ct b/sql-ledger/locale/hu/ct
new file mode 100644
index 000000000..55680ad20
--- /dev/null
+++ b/sql-ledger/locale/hu/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Új',
+ 'Address' => 'Cím',
+ 'All' => 'Összes',
+ 'Bcc' => 'Titkos másolat',
+ 'Cannot delete customer!' => 'A vevõt nem lehet törölni!',
+ 'Cannot delete vendor!' => 'Szállítót nem lehet törölni!',
+ 'Cc' => 'Másolat',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Credit Limit' => 'Hitelkeret',
+ 'Customer deleted!' => 'Vevõ törölve!',
+ 'Customer saved!' => 'Vevõ elmentve!',
+ 'Customers' => 'Vevõadatok',
+ 'Delete' => 'Törlés',
+ 'Discount' => 'Engedmény',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Vevõ módosítása',
+ 'Edit Vendor' => 'Szállító módosítása',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Oszlopok:',
+ 'Invoice' => 'Számla',
+ 'Name' => 'Név',
+ 'Name missing!' => 'Név hiányzik',
+ 'Notes' => 'Megjegyzés',
+ 'Number' => 'Szám',
+ 'Order' => 'Rendelés',
+ 'Orphaned' => 'Tranzakció nélküli',
+ 'Phone' => 'Telefon',
+ 'Save' => 'Mentés',
+ 'Ship to' => 'Szállítási cím',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'Taxable' => 'Adó:',
+ 'Terms: Net' => 'Határidõ',
+ 'Transactions exist, cannot delete customer!' => 'A vevõhöz tranzakciók tartoznak, nem lehet törölni!',
+ 'Transactions exist, cannot delete vendor!' => 'A szállítóhoz tranzakciók tartoznak, nem lehet törölni!',
+ 'Vendor deleted!' => 'Szállító törölve!',
+ 'Vendor saved!' => 'Szállító elmentve!',
+ 'Vendors' => 'Szállítók',
+ 'days' => 'nap',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'Új' => 'add',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'számla' => 'invoice',
+ 'rendelés' => 'order',
+ 'mentés' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/gl b/sql-ledger/locale/hu/gl
new file mode 100644
index 000000000..f62d53820
--- /dev/null
+++ b/sql-ledger/locale/hu/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Szállító tranzakció',
+ 'AR Transaction' => 'Vevõ tranzakció',
+ 'Account' => 'Számla',
+ 'Add General Ledger Transaction' => 'Új fõkönyvi könyvelés',
+ 'Address' => 'Cím',
+ 'All' => 'Összes',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Transaction' => 'Biztos, hogy törölni akarja? Tranzakció:',
+ 'Asset' => 'Eszköz',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Balance' => 'Egyenleg',
+ 'Cannot delete transaction!' => 'A tranzakciót nem lehet törölni!',
+ 'Cannot have a value in both Debit and Credit!' => 'A Tartozik és Követel oldal is tartalmaz értéket!',
+ 'Cannot post a transaction without a value!' => 'Az összeg megadása nélkül nem lehet a tranzakciót rögzíteni!',
+ 'Cannot post transaction for a closed period!' => 'A lezárt idõszakban nem lehet tranzakciót rögzíteni!!',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Continue' => 'Folytatás',
+ 'Credit' => 'Követel',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Debit' => 'Tartozik',
+ 'Debit and credit out of balance!' => 'Tartozik Követel összege nem egyezik!',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Description' => 'Szöveges leírás',
+ 'Edit General Ledger Transaction' => 'Vegyes könyvelési tétel módosítása',
+ 'Equity' => 'Tõke',
+ 'Expense' => 'Költség',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'GIFI' => 'Gyûjtõkód',
+ 'GL Transaction' => 'Fõkönyvi tranzakció!',
+ 'General Ledger' => 'Fõkönyvi könyvelés',
+ 'ID' => 'Azonosító',
+ 'Include in Report' => 'Oszlopok:',
+ 'Income' => 'Árbevétel',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Liability' => 'Kötelezettség',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Reference' => 'Hivatkozás',
+ 'Reference missing!' => 'Hivatkozás hiányzik',
+ 'Reports' => 'Jelentések',
+ 'Sales Invoice' => 'Számlázás',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Source' => 'Bizonylatszám',
+ 'Subtotal' => 'Részösszeg',
+ 'Transaction Date missing!' => 'Tranzakció dátuma hiányzik!',
+ 'Transaction deleted!' => 'Tranzakció törölve!',
+ 'Transaction posted!' => 'Tranzakció rögzítve!',
+ 'Update' => 'Frissítés',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'Yes' => 'Igen',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'szállító_tranzakció' => 'ap_transaction',
+ 'vevõ_tranzakció' => 'ar_transaction',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'fõkönyvi_tranzakció!' => 'gl_transaction',
+ 'rögzítés' => 'post',
+ 'rögzítés_új_tranzakcióként' => 'post_as_new',
+ 'számlázás' => 'sales_invoice',
+ 'frissítés' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ic b/sql-ledger/locale/hu/ic
new file mode 100644
index 000000000..768ba2170
--- /dev/null
+++ b/sql-ledger/locale/hu/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Aktív',
+ 'Add' => 'Új',
+ 'Add Assembly' => 'Új saját termék',
+ 'Add Part' => 'Új cikk',
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Add Service' => 'Új szolgáltatás',
+ 'Address' => 'Cím',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Assemblies' => 'Saját termékek',
+ 'Assemblies restocked!' => 'Saját termékek készletre véve',
+ 'Assembly Number missing!' => 'Saját termékszám hiányzik!',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Vásárolt',
+ 'COGS' => 'ELÁBÉ',
+ 'Cannot delete item!' => 'A tételt nem lehet törölni!',
+ 'Cannot stock assemblies!' => 'A saját terméket nem lehet készletre venni!',
+ 'Cc' => 'Másolat',
+ 'Closed' => 'Lezárt',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Description' => 'Szöveges leírás',
+ 'Drawing' => 'Rajz',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Edit Assembly' => 'Saját termék módosítása',
+ 'Edit Part' => 'Cikk módosítása',
+ 'Edit Service' => 'Szolgáltatás módosítása',
+ 'Expense' => 'Költség',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'Image' => 'Kép',
+ 'In-line' => 'Beágyazva',
+ 'Include in Report' => 'Oszlopok:',
+ 'Income' => 'Árbevétel',
+ 'Individual Items' => 'Összetevõk',
+ 'Inventory' => 'Készlet',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Mielõtt ezt a saját terméket elévültnek nyilvánítja,a mennyiségnek nullának kell lennie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Mielõtt ezt az anyagot/árut elévültnek nyilvánítja,a mennyiségnek nullának kell lennie!!',
+ 'Invoice' => 'Számla',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Item deleted!' => 'Tétel törölve!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Last Cost' => 'Utolsó beszerzési ár',
+ 'Line Total' => 'Sor összesen',
+ 'Link Accounts' => 'Számlakapcsolatok',
+ 'List Price' => 'Listaár',
+ 'Make' => 'Gyártmány',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modell',
+ 'Name' => 'Név',
+ 'No.' => 'Sz.',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'Obsolete' => 'Elévült',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'On Hand' => 'Készleten',
+ 'On Order' => 'Beszerzési rendelések',
+ 'Order' => 'Rendelés',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Number' => 'Rendelés száma',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'Ordered' => 'Vevõrendelések',
+ 'Orphaned' => 'Tranzakció nélküli',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Part' => 'Cikk',
+ 'Part Number missing!' => 'Cikk száma hiányzik!',
+ 'Parts' => 'Cikkek',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Ár',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Qty' => 'Menny.',
+ 'ROP' => 'Rendelési pont',
+ 'Recd' => 'Kapott',
+ 'Required by' => 'Leszállítás',
+ 'Sales' => 'Eladás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Save' => 'Mentés',
+ 'Save as new' => 'Mentés újként',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sell Price' => 'Eladási ár',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Service Number missing!' => 'Szolgáltatás száma hiányzik!',
+ 'Services' => 'Szolgáltatások',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Short' => 'Hiányzó',
+ 'Sold' => 'Eladva',
+ 'Stock' => 'Stock',
+ 'Stock Assembly' => 'Saját termék bevételezése',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax' => 'Adó',
+ 'To' => 'Meddig:',
+ 'Top Level' => 'Legfelsõ szint',
+ 'Total' => 'Végösszeg',
+ 'Unit' => 'Egység',
+ 'Unit of measure' => 'Mértékegység',
+ 'Update' => 'Frissítés',
+ 'Updated' => 'Frissítve',
+ 'Weight' => 'Súly',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'ea' => 'db',
+ 'emailed to' => 'e-mail küldve:',
+ 'hr' => 'óra',
+ 'sent to printer' => 'kinyomtatva',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'Új' => 'add',
+ 'Új_saját_termék' => 'add_assembly',
+ 'Új_cikk' => 'add_part',
+ 'Új_szolgáltatás' => 'add_service',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'saját_termék_módosítása' => 'edit_assembly',
+ 'cikk_módosítása' => 'edit_part',
+ 'szolgáltatás_módosítása' => 'edit_service',
+ 'mentés' => 'save',
+ 'mentés_újként' => 'save_as_new',
+ 'frissítés' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/io b/sql-ledger/locale/hu/io
new file mode 100644
index 000000000..c30d7e9ab
--- /dev/null
+++ b/sql-ledger/locale/hu/io
@@ -0,0 +1,108 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Address' => 'Cím',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Másolat',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Description' => 'Szöveges leírás',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Beágyazva',
+ 'Invoice' => 'Számla',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Name' => 'Név',
+ 'No.' => 'Sz.',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Order' => 'Rendelés',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Part' => 'Cikk',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Ár',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Qty' => 'Menny.',
+ 'Recd' => 'Kapott',
+ 'Required by' => 'Leszállítás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Subject' => 'Tárgy',
+ 'To' => 'Meddig:',
+ 'Unit' => 'Egység',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'emailed to' => 'e-mail küldve:',
+ 'sent to printer' => 'kinyomtatva',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'folytatás' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/ir b/sql-ledger/locale/hu/ir
new file mode 100644
index 000000000..5e8174500
--- /dev/null
+++ b/sql-ledger/locale/hu/ir
@@ -0,0 +1,180 @@
+$self{texts} = {
+ 'Account' => 'Számla',
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Invoice Number' => 'Biztos, hogy törölni akarja? Számlaszám:',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'A partnerszámlát nem lehet törölni!',
+ 'Cannot post invoice for a closed period!' => 'A lezárt idõszakban nem lehet számlát kiállítani!',
+ 'Cannot post invoice!' => 'A partnerszámlát nem lehet kiállítani',
+ 'Cannot post payment for a closed period!' => 'A lezárt idõszakban nem lehet fizetést rögzíteni!',
+ 'Cc' => 'Másolat',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Currency' => 'Deviza',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Description' => 'Szöveges leírás',
+ 'Due Date' => 'Esedékesség',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Edit Vendor Invoice' => 'Edit Vendor Invoice',
+ 'Exch' => 'Árf',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate for payment missing!' => 'A fizetett összeg átváltási árfolyama hiányzik!',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Beágyazva',
+ 'Invoice' => 'Számla',
+ 'Invoice Date' => 'Teljesítés dátuma',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Invoice deleted!' => 'Számla törölve!',
+ 'Invoice posted!' => 'Számla rögzítve!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Name' => 'Név',
+ 'No.' => 'Sz.',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Order' => 'Rendelés',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Number' => 'Rendelés száma',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Part' => 'Cikk',
+ 'Payment date missing!' => 'Pénzmozgás dátuma hiányzik!',
+ 'Payments' => 'Kifizetések',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Ár',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Qty' => 'Menny.',
+ 'Recd' => 'Kapott',
+ 'Record in' => 'Feladás:',
+ 'Required by' => 'Leszállítás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Source' => 'Bizonylatszám',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'To' => 'Meddig:',
+ 'Total' => 'Végösszeg',
+ 'Unit' => 'Egység',
+ 'Update' => 'Frissítés',
+ 'Vendor' => 'Szállító',
+ 'Vendor missing!' => 'Szállító hiányzik!',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'Yes' => 'Igen',
+ 'ea' => 'db',
+ 'emailed to' => 'e-mail küldve:',
+ 'sent to printer' => 'kinyomtatva',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'rendelés' => 'order',
+ 'rögzítés' => 'post',
+ 'rögzítés_új_tranzakcióként' => 'post_as_new',
+ 'frissítés' => 'update',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/is b/sql-ledger/locale/hu/is
new file mode 100644
index 000000000..54cc04a73
--- /dev/null
+++ b/sql-ledger/locale/hu/is
@@ -0,0 +1,187 @@
+$self{texts} = {
+ 'Account' => 'Számla',
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Invoice' => 'Új vevõszámla',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Invoice Number' => 'Biztos, hogy törölni akarja? Számlaszám:',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'A partnerszámlát nem lehet törölni!',
+ 'Cannot post invoice for a closed period!' => 'A lezárt idõszakban nem lehet számlát kiállítani!',
+ 'Cannot post invoice!' => 'A partnerszámlát nem lehet kiállítani',
+ 'Cannot post payment for a closed period!' => 'A lezárt idõszakban nem lehet fizetést rögzíteni!',
+ 'Cc' => 'Másolat',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Credit Limit' => 'Hitelkeret',
+ 'Currency' => 'Deviza',
+ 'Customer' => 'Vevõ',
+ 'Customer missing!' => 'Vevõ hiányzik!',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Description' => 'Szöveges leírás',
+ 'Due Date' => 'Esedékesség',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Edit Sales Invoice' => 'Vevõszámla módosítása',
+ 'Exch' => 'Árf',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate for payment missing!' => 'A fizetett összeg átváltási árfolyama hiányzik!',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Beágyazva',
+ 'Invoice' => 'Számla',
+ 'Invoice Date' => 'Teljesítés dátuma',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number' => 'Számlaszám',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Invoice deleted!' => 'Számla törölve!',
+ 'Invoice posted!' => 'Számla rögzítve!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Name' => 'Név',
+ 'No.' => 'Sz.',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Order' => 'Rendelés',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Number' => 'Rendelés száma',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Part' => 'Cikk',
+ 'Payment date missing!' => 'Pénzmozgás dátuma hiányzik!',
+ 'Payments' => 'Kifizetések',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Rögzítés',
+ 'Post as new' => 'Rögzítés új tranzakcióként',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Ár',
+ 'Print' => 'Nyomtatás',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Qty' => 'Menny.',
+ 'Recd' => 'Kapott',
+ 'Record in' => 'Feladás:',
+ 'Remaining' => 'Maradék',
+ 'Required by' => 'Leszállítás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Ship via' => 'Szállítás innen:',
+ 'Source' => 'Bizonylatszám',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'To' => 'Meddig:',
+ 'Total' => 'Végösszeg',
+ 'Unit' => 'Egység',
+ 'Update' => 'Frissítés',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'Yes' => 'Igen',
+ 'ea' => 'db',
+ 'emailed to' => 'e-mail küldve:',
+ 'sent to printer' => 'kinyomtatva',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'rendelés' => 'order',
+ 'rögzítés' => 'post',
+ 'rögzítés_új_tranzakcióként' => 'post_as_new',
+ 'nyomtatás' => 'print',
+ 'szállítási_cím' => 'ship_to',
+ 'frissítés' => 'update',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/login b/sql-ledger/locale/hu/login
new file mode 100644
index 000000000..1b730881f
--- /dev/null
+++ b/sql-ledger/locale/hu/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => ' ',
+ 'Database Host' => 'Adatbázis helye',
+ 'Dataset' => 'Cégadatbázis',
+ 'Incorrect Dataset version!' => 'Érvénytelen adatbázisverzió!',
+ 'Incorrect Password!' => 'Érvénytelen jelszó!',
+ 'Licensed to' => 'Cég:',
+ 'Login' => 'Belépés',
+ 'Name' => 'Név',
+ 'Password' => 'Jelszó',
+ 'User' => 'Felhasználó',
+ 'Version' => 'Verzió',
+ 'You are logged out!' => 'Már kijelentkezett!',
+ 'You did not enter a name!' => 'Nem írt be nevet!',
+ 'is not a member!' => 'nem tag!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'belépés' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/menu b/sql-ledger/locale/hu/menu
new file mode 100644
index 000000000..e1c3682fc
--- /dev/null
+++ b/sql-ledger/locale/hu/menu
@@ -0,0 +1,73 @@
+$self{texts} = {
+ 'AP' => 'Szállítók',
+ 'AP Aging' => 'Szállító lejárati lista',
+ 'AR' => 'Vevõk',
+ 'AR Aging' => 'Vevõ lejárati lista',
+ 'Accounting Menu' => 'Menü',
+ 'Add Account' => 'Új számla',
+ 'Add Assembly' => 'Új saját termék',
+ 'Add Customer' => 'Új vevõ',
+ 'Add GIFI' => 'Új gyûjtõkód',
+ 'Add Group' => 'Add Group',
+ 'Add Part' => 'Új cikk',
+ 'Add Project' => 'Új munkaszám',
+ 'Add Service' => 'Új szolgáltatás',
+ 'Add Transaction' => 'Új tranzakció',
+ 'Add Vendor' => 'Új szállító',
+ 'Assemblies' => 'Saját termékek',
+ 'Audit Control' => 'Audit Kontroll',
+ 'Backup' => 'Biztonsági másolat',
+ 'Balance Sheet' => 'Mérleg',
+ 'Cash' => 'Pénzmozgások',
+ 'Chart of Accounts' => 'Számlatükör',
+ 'Check' => 'Csekk',
+ 'Customers' => 'Vevõadatok',
+ 'General Ledger' => 'Fõkönyvi könyvelés',
+ 'Goods & Services' => 'Áruk & Szolgáltatások',
+ 'Groups' => 'Groups',
+ 'HTML Templates' => 'HTML sablonok',
+ 'Income Statement' => 'Eredménykimutatás',
+ 'Invoice' => 'Számla',
+ 'LaTeX Templates' => 'LaTeX sablonok',
+ 'List Accounts' => 'Számlák listázása',
+ 'List GIFI' => 'Gyûjtõkódok listázása',
+ 'Logout' => 'Kilépés',
+ 'Order Entry' => 'Rendelések',
+ 'Packing List' => 'Szállítólevél',
+ 'Parts' => 'Cikkek',
+ 'Payment' => 'Kifizetés',
+ 'Payments' => 'Kifizetések',
+ 'Preferences' => 'Beállítások',
+ 'Projects' => 'Munkaszámok',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Purchase Orders' => 'Beszerzési rendelések',
+ 'Receipt' => 'Bevétel',
+ 'Receipts' => 'Bevételek',
+ 'Reconciliation' => 'Egyeztetés',
+ 'Reports' => 'Jelentések',
+ 'Sales Invoice' => 'Számlázás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Sales Orders' => 'Vevõrendelések',
+ 'Save to File' => 'Másolat File-ba',
+ 'Send by E-Mail' => 'Másolat E-mail-ben',
+ 'Services' => 'Szolgáltatások',
+ 'Statement' => 'Kimutatás',
+ 'Stock Assembly' => 'Saját termék bevételezése',
+ 'Stylesheet' => 'Stíluslap',
+ 'System' => 'Törzsadatok',
+ 'Tax collected' => 'Fizetendõ ÁFA',
+ 'Tax paid' => 'Levonható ÁFA',
+ 'Transactions' => 'Tranzakciók',
+ 'Trial Balance' => 'Fõkönyvi kivonat',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendors' => 'Szállítók',
+ 'Version' => 'Verzió',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/oe b/sql-ledger/locale/hu/oe
new file mode 100644
index 000000000..c182bc679
--- /dev/null
+++ b/sql-ledger/locale/hu/oe
@@ -0,0 +1,202 @@
+$self{texts} = {
+ 'Add' => 'Új',
+ 'Add Purchase Order' => 'Új beszerzési rendelés',
+ 'Add Sales Invoice' => 'Új vevõszámla',
+ 'Add Sales Order' => 'Új vevõrendelés',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Cím',
+ 'Amount' => 'Összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Are you sure you want to delete Order Number' => 'Biztos, hogy törölni akarja? Megrendelésszám:',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Bcc' => 'Titkos másolat',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'A rendelést nem lehet törölni!',
+ 'Cannot save order!' => 'A rendelést nem lehet elmenteni!',
+ 'Cc' => 'Másolat',
+ 'Closed' => 'Lezárt',
+ 'Confirm!' => 'Megerõsítés:',
+ 'Contact' => 'Kapcsolat',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Credit Limit' => 'Hitelkeret',
+ 'Curr' => 'Dev',
+ 'Currency' => 'Deviza',
+ 'Customer' => 'Vevõ',
+ 'Customer missing!' => 'Vevõ hiányzik!',
+ 'Customer not on file!' => 'A vevõ hiányzik az adatbázisból!',
+ 'Date' => 'Dátum',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Delete' => 'Törlés',
+ 'Delivery Date' => 'Szállítás dátuma',
+ 'Description' => 'Szöveges leírás',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mail cím hiányzik!',
+ 'Edit Purchase Order' => 'Beszerzési rendelés módosítása',
+ 'Edit Sales Order' => 'Vevõrendelés módosítása',
+ 'Exchangerate' => 'Átváltási árfolyam',
+ 'Exchangerate missing!' => 'Átváltási árfolyam hiányzik!',
+ 'Extended' => 'Összeg',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'ID' => 'Azonosító',
+ 'In-line' => 'Beágyazva',
+ 'Include in Report' => 'Oszlopok:',
+ 'Invoice' => 'Számla',
+ 'Invoice Date missing!' => 'Teljesítés dátuma hiányzik!',
+ 'Invoice Number missing!' => 'Számlaszám hiányzik!',
+ 'Item not on file!' => 'A tétel nincs az adatbázisban!',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'Name' => 'Név',
+ 'No.' => 'Sz.',
+ 'Notes' => 'Megjegyzés',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Number' => 'Szám',
+ 'Number missing in Row' => 'Ebbõl a sorból hiányzik a szám:',
+ 'O' => 'Ny.',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'Open' => 'Nyitott',
+ 'Order' => 'Rendelés',
+ 'Order Date' => 'Rendelés dátuma',
+ 'Order Date missing!' => 'Rendelés dátuma hiányzik!',
+ 'Order Number' => 'Rendelés száma',
+ 'Order Number missing!' => 'Rendelés száma hiányzik!',
+ 'Order deleted!' => 'Rendelés törölve!',
+ 'Order saved!' => 'Rendelés elmentve!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Szállítólevél',
+ 'Packing List Date missing!' => 'Szállítólevél dátuma hiányzik!',
+ 'Packing List Number missing!' => 'Szállítólevél száma hiányzik!',
+ 'Part' => 'Cikk',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Ár',
+ 'Print' => 'Nyomtatás',
+ 'Printer' => 'Nyomtató',
+ 'Project' => 'Munkaszám',
+ 'Project not on file!' => 'Munkaszám hiányzik az adatbázisból!',
+ 'Purchase Order' => 'Beszerzési rendelés',
+ 'Purchase Orders' => 'Beszerzési rendelések',
+ 'Qty' => 'Menny.',
+ 'Recd' => 'Kapott',
+ 'Remaining' => 'Maradék',
+ 'Required by' => 'Leszállítás',
+ 'Sales Order' => 'Vevõrendelés',
+ 'Sales Orders' => 'Vevõrendelések',
+ 'Save' => 'Mentés',
+ 'Save as new' => 'Mentés újként',
+ 'Screen' => 'Képernyõre',
+ 'Select from one of the items below' => 'Válasszon ki egyet az alábbi tételek közül',
+ 'Select from one of the names below' => 'Válasszon ki egyet az alábbi nevek közül',
+ 'Select from one of the projects below' => 'Válasszon ki egyet az alábbi munkaszámok közül',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Service' => 'Szolgáltatás',
+ 'Ship' => 'Szállítás',
+ 'Ship to' => 'Szállítási cím',
+ 'Ship via' => 'Szállítás innen:',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax' => 'Adó',
+ 'Tax Included' => 'Adót tartalmazza',
+ 'Terms: Net' => 'Határidõ',
+ 'To' => 'Meddig:',
+ 'Total' => 'Végösszeg',
+ 'Unit' => 'Egység',
+ 'Update' => 'Frissítés',
+ 'Vendor' => 'Szállító',
+ 'Vendor missing!' => 'Szállító hiányzik!',
+ 'Vendor not on file!' => 'Szállító nincs az adatbázisban!',
+ 'What type of item is this?' => 'Ez milyen típusú tétel?',
+ 'Yes' => 'Igen',
+ 'days' => 'nap',
+ 'ea' => 'db',
+ 'emailed to' => 'e-mail küldve:',
+ 'sent to printer' => 'kinyomtatva',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'Új' => 'add',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'számla' => 'invoice',
+ 'nyomtatás' => 'print',
+ 'mentés' => 'save',
+ 'mentés_újként' => 'save_as_new',
+ 'szállítási_cím' => 'ship_to',
+ 'frissítés' => 'update',
+ 'igen' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/pe b/sql-ledger/locale/hu/pe
new file mode 100644
index 000000000..1105848a7
--- /dev/null
+++ b/sql-ledger/locale/hu/pe
@@ -0,0 +1,45 @@
+$self{texts} = {
+ 'Add' => 'Új',
+ 'Add Group' => 'Add Group',
+ 'Add Project' => 'Új munkaszám',
+ 'All' => 'Összes',
+ 'Continue' => 'Folytatás',
+ 'Delete' => 'Törlés',
+ 'Description' => 'Szöveges leírás',
+ 'Edit Group' => 'Edit Group',
+ 'Edit Project' => 'Projekt módosítása',
+ 'Group' => 'Group',
+ 'Group deleted!' => 'Group deleted!',
+ 'Group missing!' => 'Group missing!',
+ 'Group saved!' => 'Group saved!',
+ 'Groups' => 'Groups',
+ 'Number' => 'Szám',
+ 'Orphaned' => 'Tranzakció nélküli',
+ 'Project' => 'Munkaszám',
+ 'Project Number missing!' => 'Munkaszám száma hiányzik!',
+ 'Project deleted!' => 'Munkaszám törölve!',
+ 'Project saved!' => 'Munkaszám elmentve!',
+ 'Projects' => 'Munkaszámok',
+ 'Save' => 'Mentés',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_partsgroup_footer' => 'form_partsgroup_footer',
+ 'form_partsgroup_header' => 'form_partsgroup_header',
+ 'form_project_footer' => 'form_project_footer',
+ 'form_project_header' => 'form_project_header',
+ 'partsgroup_report' => 'partsgroup_report',
+ 'project_report' => 'project_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'Új' => 'add',
+ 'folytatás' => 'continue',
+ 'törlés' => 'delete',
+ 'mentés' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/rc b/sql-ledger/locale/hu/rc
new file mode 100644
index 000000000..f9fc61581
--- /dev/null
+++ b/sql-ledger/locale/hu/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Számla',
+ 'Balance' => 'Egyenleg',
+ 'Cleared Balance' => 'Egyeztetett egyenleg',
+ 'Continue' => 'Folytatás',
+ 'Date' => 'Dátum',
+ 'Deposit' => 'Betét',
+ 'Description' => 'Szöveges leírás',
+ 'Difference' => 'Eltérés',
+ 'Done' => 'Elvégezve',
+ 'Exchangerate Difference' => 'Árfolyamkülönbség',
+ 'From' => 'Mikortól:',
+ 'Out of balance!' => 'Az egyenleg nem stimmel!',
+ 'Payment' => 'Kifizetés',
+ 'Reconciliation' => 'Egyeztetés',
+ 'Select all' => 'Mindent kijelöl',
+ 'Source' => 'Bizonylatszám',
+ 'Statement Balance' => 'Kimutatás egyenlege',
+ 'Update' => 'Frissítés',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'folytatás' => 'continue',
+ 'elvégezve' => 'done',
+ 'mindent_kijelöl' => 'select_all',
+ 'frissítés' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/hu/rp b/sql-ledger/locale/hu/rp
new file mode 100644
index 000000000..3cdf7d44c
--- /dev/null
+++ b/sql-ledger/locale/hu/rp
@@ -0,0 +1,119 @@
+$self{texts} = {
+ 'AP Aging' => 'Szállító lejárati lista',
+ 'AR Aging' => 'Vevõ lejárati lista',
+ 'Account' => 'Számla',
+ 'Accounts' => 'Számlák',
+ 'Amount' => 'Összeg',
+ 'Apr' => 'Ápr.',
+ 'April' => 'Április',
+ 'Attachment' => 'Csatolás',
+ 'Aug' => 'Aug.',
+ 'August' => 'Augusztus',
+ 'Balance' => 'Egyenleg',
+ 'Balance Sheet' => 'Mérleg',
+ 'Bcc' => 'Titkos másolat',
+ 'Cash based' => 'Pénzmozgás alapján',
+ 'Cc' => 'Másolat',
+ 'Compare to' => 'Összehasonlítva:',
+ 'Continue' => 'Folytatás',
+ 'Copies' => 'Másolatok',
+ 'Credit' => 'Követel',
+ 'Current' => 'Nem lejárt',
+ 'Customer' => 'Vevõ',
+ 'Date' => 'Dátum',
+ 'Debit' => 'Tartozik',
+ 'Dec' => 'Dec.',
+ 'December' => 'December',
+ 'Decimalplaces' => 'Tizedeshelyek',
+ 'Description' => 'Szöveges leírás',
+ 'Due' => 'Esedékes',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Kimutatás küldése e-mail-ben:',
+ 'Feb' => 'Feb.',
+ 'February' => 'Február',
+ 'From' => 'Mikortól:',
+ 'GIFI' => 'Gyûjtõkód',
+ 'Heading' => 'Fejléc',
+ 'ID' => 'Azonosító',
+ 'In-line' => 'Beágyazva',
+ 'Include in Report' => 'Oszlopok:',
+ 'Income Statement' => 'Eredménykimutatás',
+ 'Invoice' => 'Számla',
+ 'Jan' => 'Jan.',
+ 'January' => 'Január',
+ 'Jul' => 'Júl.',
+ 'July' => 'Július',
+ 'Jun' => 'Jún.',
+ 'June' => 'Június',
+ 'Mar' => 'Márc.',
+ 'March' => 'Március',
+ 'May' => 'Máj.',
+ 'May ' => 'Május',
+ 'Message' => 'Üzenet',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nincs semmi kiválasztva!',
+ 'Nov' => 'Nov.',
+ 'November' => 'November',
+ 'Oct' => 'Okt.',
+ 'October' => 'Október',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Kifizetések',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Nyomtatás',
+ 'Printer' => 'Nyomtató',
+ 'Project Number' => 'Munkaszám',
+ 'Receipts' => 'Bevételek',
+ 'Report for' => 'Jelentés:',
+ 'Retained Earnings' => 'Adózás elõtti eredmény',
+ 'Screen' => 'Képernyõre',
+ 'Select all' => 'Mindent kijelöl',
+ 'Select postscript or PDF!' => 'Válassza ki a postscript vagy a PDF formátumot!',
+ 'Sep' => 'Szept.',
+ 'September' => 'Szeptember',
+ 'Source' => 'Bizonylatszám',
+ 'Standard' => 'Sztenderd',
+ 'Statement' => 'Kimutatás',
+ 'Statement sent to' => 'Kimutatás elküldve:',
+ 'Statements sent to printer!' => 'Kimutatás kinyomtatva!',
+ 'Subject' => 'Tárgy',
+ 'Subtotal' => 'Részösszeg',
+ 'Tax' => 'Adó',
+ 'Tax collected' => 'Fizetendõ ÁFA',
+ 'Tax paid' => 'Levonható ÁFA',
+ 'Total' => 'Végösszeg',
+ 'Trial Balance' => 'Fõkönyvi kivonat',
+ 'Vendor' => 'Szállító',
+ 'as at' => 'Fordulónap:',
+ 'collected on sales' => 'vevõszámlák alapján',
+ 'for Period' => 'Idõszak:',
+ 'paid on purchases' => 'szállítószámlák alapján',
+ 'to' => 'Meddig:',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'folytatás' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'nyomtatás' => 'print',
+ 'mindent_kijelöl' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/is/COPYING b/sql-ledger/locale/is/COPYING
new file mode 100644
index 000000000..1992b5095
--- /dev/null
+++ b/sql-ledger/locale/is/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# Icelandic texts:
+#
+# Author: Margeir Reynisson <margeir@met.is>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/is/LANGUAGE b/sql-ledger/locale/is/LANGUAGE
new file mode 100644
index 000000000..b91caef13
--- /dev/null
+++ b/sql-ledger/locale/is/LANGUAGE
@@ -0,0 +1 @@
+Icelandic
diff --git a/sql-ledger/locale/is/admin b/sql-ledger/locale/is/admin
new file mode 100644
index 000000000..ddf4c1a12
--- /dev/null
+++ b/sql-ledger/locale/is/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Aðgangsheimildir',
+ 'Accounting' => 'Bókhald',
+ 'Add User' => 'Nýr notandi',
+ 'Address' => 'Heimilisfang',
+ 'Administration' => 'Kerfisstjórnun',
+ 'Administrator' => 'Kerfisstjóri',
+ 'All Datasets up to date!' => 'Öll gagnasöfn uppfærð',
+ 'Change Admin Password' => 'Breyta kerfisstjóra lykilorði',
+ 'Change Password' => 'Breyta lykilorði',
+ 'Character Set' => 'Stafaset',
+ 'Click on login name to edit!' => 'Smellið á notendanafn til þess að breyta',
+ 'Company' => 'Fyritæki',
+ 'Connect to' => 'Tengjast við',
+ 'Continue' => 'Áfram',
+ 'Create Chart of Accounts' => 'Búa til lykklasett',
+ 'Create Dataset' => 'Búa til gagnasafn',
+ 'DBI not installed!' => 'DBI ekki virkt',
+ 'Database' => 'Gagnagrunnur',
+ 'Database Administration' => 'Kerfisstjórn gagnagrunns',
+ 'Database Driver not checked!' => 'Gagnagrunnstengi ekki athugað',
+ 'Database User missing!' => 'Gagnagrunns notanda vantar!',
+ 'Dataset' => 'Gagnasafn',
+ 'Dataset missing!' => 'Gagnasafn vantar!',
+ 'Dataset updated!' => 'gagnasafn uppfært!',
+ 'Date Format' => 'Dagsetningarform',
+ 'Delete' => 'Eyða',
+ 'Delete Dataset' => 'Eyða gagnasafni',
+ 'Directory' => 'Mapa',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Takmörk fyrir valmynd',
+ 'E-mail' => 'R-póstur',
+ 'Edit User' => 'Breyta notanda',
+ 'Existing Datasets' => 'Hætta með gagnasafn',
+ 'Fax' => 'Símbréf',
+ 'Host' => 'Netþjónn',
+ 'Hostname missing!' => 'Nafn netþjóns vantar',
+ 'Incorrect Password!' => 'Rangt lykilorð',
+ 'Language' => 'Túngumál',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Setjið engar upplýsingar í netþjónn og port nema um sé að ræða annan netþjón.',
+ 'Login' => 'Tengjast',
+ 'Multibyte Encoding' => 'Multibyte Encoding',
+ 'Name' => 'Nafn',
+ 'New Templates' => 'Nýtt skabalón',
+ 'No Database Drivers available!' => 'Engin gagnagrunnstengin til',
+ 'No Dataset selected!' => 'Ekkert gagnasafn valið',
+ 'Nothing to delete!' => 'Ekkert til þess að eyða!',
+ 'Number Format' => 'Númera útlit',
+ 'Oracle Database Administration' => 'Oracle kerfisstjórnun á gagnagrunni',
+ 'Password' => 'Aðgangsorð',
+ 'Password changed!' => 'Aðgangsorði breytt',
+ 'Pg Database Administration' => 'Pg kerfisstjórnun gagnarunns',
+ 'Phone' => 'Sími.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port vantar',
+ 'Printer' => 'Prentari',
+ 'Save' => 'Geyma',
+ 'Select a Dataset to delete and press "Continue"' => 'Veljið gagnasafn og ýtið á "Áfram"',
+ 'Setup Templates' => 'Skabalón fyrir uppsetningu',
+ 'Ship via' => 'Senda með',
+ 'Signature' => 'Undirskrift',
+ 'Stylesheet' => 'Stílblað',
+ 'Templates' => 'Skabalón',
+ 'The following Datasets are not in use and can be deleted' => 'Eftirfarandi gagnasöfn eru ekki í notkunn og er því ekki hægt að eyða þeim',
+ 'The following Datasets need to be updated' => 'Eftirfarandi gagnasafn þarfnast uppfærslu',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Engu verður eytt eða breytt með þessu ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Þú getur notað notanda sem til er til þess að útbúa nýjan notanda með þvi að breyta bara notendanafninu.',
+ 'Update Dataset' => 'Uppfæra gagnasafn',
+ 'Use Templates' => 'Nota skabalón',
+ 'User' => 'Notandi',
+ 'User deleted!' => 'Notanda eytt!',
+ 'User saved!' => 'Notandi geymdur!',
+ 'Version' => 'Útgáfa',
+ 'You must enter a host and port for local and remote connections!' => 'Þú verður að gefa upp netþjón of port til þess að geta tengst!',
+ 'does not exist' => 'er ekki til',
+ 'is already a member!' => 'er þegar meðlimur',
+ 'localhost' => 'lokal',
+ 'locked!' => 'læst',
+ 'successfully created!' => 'uppfært!',
+ 'successfully deleted!' => 'eytt!',
+ 'website' => 'á Internetinu',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'nýr_notandi' => 'add_user',
+ 'breyta_kerfisstjóra_lykilorði' => 'change_admin_password',
+ 'breyta_lykilorði' => 'change_password',
+ 'Áfram' => 'continue',
+ 'búa_til_gagnasafn' => 'create_dataset',
+ 'eyða' => 'delete',
+ 'eyða_gagnasafni' => 'delete_dataset',
+ 'tengjast' => 'login',
+ 'oracle_kerfisstjórnun_á_gagnagrunni' => 'oracle_database_administration',
+ 'pg_kerfisstjórnun_gagnarunns' => 'pg_database_administration',
+ 'geyma' => 'save',
+ 'uppfæra_gagnasafn' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/is/all b/sql-ledger/locale/is/all
new file mode 100644
index 000000000..4fc7b2d60
--- /dev/null
+++ b/sql-ledger/locale/is/all
@@ -0,0 +1,496 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Innkaupakerfi',
+ 'AP Aging' => 'Aldursgreining',
+ 'AP Transaction' => 'Innkaupafærsla',
+ 'AP Transactions' => 'Innkaupafærslur',
+ 'AR' => 'Sölukerfi',
+ 'AR Aging' => 'Aldursgreining',
+ 'AR Transaction' => 'Sölufærsla',
+ 'AR Transactions' => 'Sölufærslur',
+ 'About' => 'Um',
+ 'Access Control' => 'Aðgangsheimildir',
+ 'Account' => 'Reikningur',
+ 'Account Number' => 'Reikningsnúmer',
+ 'Account Number missing!' => 'Reikningsnúmer vantar!',
+ 'Account Type' => 'Reikningstegund',
+ 'Account Type missing!' => 'Reikningstegund vantar!',
+ 'Account deleted!' => 'Reikningi eytt!',
+ 'Account saved!' => 'Reikningur geymdur!',
+ 'Accounting' => 'Bókhald',
+ 'Accounting Menu' => 'Bókhalds valmynd',
+ 'Accounts' => 'Reikningar',
+ 'Active' => 'Virkja',
+ 'Add' => 'Nýr',
+ 'Add Account' => 'Nýr reikningur',
+ 'Add Accounts Payables Transaction' => 'Ný kredit færsla',
+ 'Add Accounts Receivables Transaction' => 'Ný debit færsla',
+ 'Add Assembly' => 'Ný samsetning',
+ 'Add Customer' => 'Nýr viðskiptavinur',
+ 'Add GIFI' => 'Ný GIFI',
+ 'Add General Ledger Transaction' => 'Ný höfuðfærsla',
+ 'Add Part' => 'Ný vara',
+ 'Add Project' => 'Nýt verkefni',
+ 'Add Purchase Invoice' => 'Nýr innkaupsreikningur',
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Invoice' => 'Nýr sölureikningur',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Add Service' => 'Ný þjónusta',
+ 'Add Transaction' => 'Ný bókhaldsfærsla',
+ 'Add User' => 'Nýr notandi',
+ 'Add Vendor' => 'Nýr byrgir',
+ 'Address' => 'Heimilisfang',
+ 'Administration' => 'Kerfisstjórnun',
+ 'Administrator' => 'Kerfisstjóri',
+ 'All' => 'Allt',
+ 'All Datasets up to date!' => 'Öll gagnasöfn uppfærð',
+ 'Amount' => 'Upphæð',
+ 'Amount Due' => 'Eindagi',
+ 'Amount does not equal applied!' => 'Upphæð stemmir ekki!',
+ 'Amount missing!' => 'Reikning vantar!',
+ 'Applied' => 'Uppfært',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Invoice Number' => 'Ert þú viss um að þú viljir eyða reikningi númer',
+ 'Are you sure you want to delete Order Number' => 'Ert þú viss um að þú viljir eyða pöntun númer',
+ 'Are you sure you want to delete Transaction' => 'Ert þú viss um að þú viljir eyða færslunni',
+ 'Assemblies' => 'Samsetningar',
+ 'Assemblies restocked!' => 'Samsetningar endurunnar',
+ 'Assembly Number missing!' => 'Samsetningar númer vantar',
+ 'Asset' => 'Eignir',
+ 'Attachment' => 'Hjálagt',
+ 'Audit Control' => 'Yfirlit stjórnun',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Afrit',
+ 'Backup sent to' => 'Afrit sendist til',
+ 'Balance' => 'Afstemming',
+ 'Balance Sheet' => 'Staða',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'Books are open' => 'Bókhald er opið fyrir leiðréttingar',
+ 'Bought' => 'Keypt',
+ 'Business Number' => 'Viðskiptanúmer',
+ 'C' => 'C',
+ 'COGS' => 'Innkaup',
+ 'Cannot delete account!' => 'Get ekki eytt reikningi!',
+ 'Cannot delete customer!' => 'Get ekki eytt viðskiptavini!',
+ 'Cannot delete default account!' => 'Get ekki eytt grunnreikningi!',
+ 'Cannot delete invoice!' => 'Get ekki eytt sölureikningi!',
+ 'Cannot delete item already invoiced!' => 'Get ekki eytt hlut sem þegar er til á sölureikningi!',
+ 'Cannot delete item on order!' => 'Get ekki eytt hlut sem er í pöntun!',
+ 'Cannot delete item which is part of an assembly!' => 'Get ekki eytt hlut sem er partur af samsetningu!',
+ 'Cannot delete item!' => 'Get ekki eytt hlut!',
+ 'Cannot delete order!' => 'Get ekki eytt pöntun!',
+ 'Cannot delete transaction!' => 'Get ekki eytt færslu!',
+ 'Cannot delete vendor!' => 'Get ekki eytt framleiðanda!',
+ 'Cannot have a value in both Debit and Credit!' => 'Get ekki haft gildi bæði í debit og kredit!',
+ 'Cannot post a transaction without a value!' => 'Get ekki bókað án upphæðar',
+ 'Cannot post invoice for a closed period!' => 'Get ekki bókað á lokað tímabil!',
+ 'Cannot post invoice!' => 'Get ekki bókað sölureikning!',
+ 'Cannot post payment for a closed period!' => 'Get ekki bókað greiðslu á lokað tímabil',
+ 'Cannot post payment!' => 'Get ekki bókað greiðslu',
+ 'Cannot post transaction for a closed period!' => 'Get ekki bókað færslu á lokað tímabil!',
+ 'Cannot post transaction!' => 'Get ekki bókað færslu!',
+ 'Cannot process payment for a closed period!' => 'Get ekki meðhöndlað greiðslu fyrir lokað tímabil!',
+ 'Cannot save account!' => 'Get ekki geymt reikning!',
+ 'Cannot save order!' => 'Get ekki geymt pöntun!',
+ 'Cannot save preferences!' => 'Get ekki geymt uppsetningu!',
+ 'Cannot stock assemblies!' => 'Get ekki fært samsetningar',
+ 'Cash' => 'Reiðufé',
+ 'Cash based' => 'Reiðufétengt',
+ 'Cc' => 'Afrit',
+ 'Change Admin Password' => 'Breyta kerfisstjóra lykilorði',
+ 'Change Password' => 'Breyta lykilorði',
+ 'Character Set' => 'Stafaset',
+ 'Chart of Accounts' => 'Listi yfir lykkla/reikninga',
+ 'Check' => 'Ávísun',
+ 'Check printed!' => 'Ávísun prentuð',
+ 'Check printing failed!' => 'Villa við prentun á ávísun',
+ 'Cleared Balance' => 'Hreynsað jafvægi',
+ 'Click on login name to edit!' => 'Smellið á notendanafn til þess að breyta',
+ 'Close Books up to' => 'Loka bókhaldi til dags',
+ 'Closed' => 'Lokað',
+ 'Company' => 'Fyritæki',
+ 'Compare to' => 'Bera saman við',
+ 'Confirm!' => 'Staðfesta!',
+ 'Connect to' => 'Tengjast við',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Copy to COA' => 'Afrita í COA',
+ 'Create Chart of Accounts' => 'Búa til lykklasett',
+ 'Create Dataset' => 'Búa til gagnasafn',
+ 'Credit' => 'Kredit',
+ 'Credit Limit' => 'Kreditmörk',
+ 'Curr' => 'Gjaldm',
+ 'Currency' => 'Gjaldmiðill',
+ 'Current' => 'Núvirði',
+ 'Customer' => 'Viðskiptavinur',
+ 'Customer deleted!' => 'Viðskiptavini eytt!',
+ 'Customer missing!' => 'Viðskiptavin vantar!',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Customer saved!' => 'Viðskiptavinur geymdur!',
+ 'Customers' => 'Viðskiptavinir',
+ 'DBI not installed!' => 'DBI ekki virkt',
+ 'Database' => 'Gagnagrunnur',
+ 'Database Administration' => 'Kerfisstjórn gagnagrunns',
+ 'Database Driver not checked!' => 'Gagnagrunnstengi ekki athugað',
+ 'Database Host' => 'Gagnagrunns-netþjónn',
+ 'Database User missing!' => 'Gagnagrunns notanda vantar!',
+ 'Dataset' => 'Gagnasafn',
+ 'Dataset missing!' => 'Gagnasafn vantar!',
+ 'Dataset updated!' => 'gagnasafn uppfært!',
+ 'Date' => 'Dagsetning',
+ 'Date Due' => 'Eindagi',
+ 'Date Format' => 'Dagsetningarform',
+ 'Date Paid' => 'Greiðsludagur',
+ 'Date missing!' => 'Dagsetningu vantar!',
+ 'Debit' => 'Debit',
+ 'Debit and credit out of balance!' => 'Debit og kredit skulu vera eins!',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Decimalplaces' => 'Aukastafir',
+ 'Delete' => 'Eyða',
+ 'Delete Account' => 'Eyða reikningi',
+ 'Delete Dataset' => 'Eyða gagnasafni',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Department' => '',
+ 'Deposit' => 'Innlagt',
+ 'Description' => 'Skýringar',
+ 'Difference' => 'Mismunur',
+ 'Directory' => 'Mapa',
+ 'Discount' => 'Afsláttur',
+ 'Done' => 'Búið',
+ 'Drawing' => 'Dregið',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Takmörk fyrir valmynd',
+ 'Due' => 'Lokið',
+ 'Due Date' => 'Dags. lokið',
+ 'Due Date missing!' => 'Vantar dags. lokið!',
+ 'E-mail' => 'R-póstur',
+ 'E-mail Statement to' => 'Senda yfirlit til',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Edit' => 'Breyta',
+ 'Edit Account' => 'Breyta reikningi',
+ 'Edit Accounts Payables Transaction' => 'Breyta greiðslufærslum',
+ 'Edit Accounts Receivables Transaction' => 'Breyta inn-færslum',
+ 'Edit Assembly' => 'Breyta samsetningu',
+ 'Edit Customer' => 'Breyta viðskiptavini',
+ 'Edit GIFI' => 'Breyta GIFI',
+ 'Edit General Ledger Transaction' => 'Breyta yfitbókunar færslum',
+ 'Edit Part' => 'Breyta vöru',
+ 'Edit Preferences for' => 'Breyta uppsetningu fyrir',
+ 'Edit Project' => 'Breyta verkefni',
+ 'Edit Purchase Invoice' => 'Breyta innkaupareikningi',
+ 'Edit Purchase Order' => 'Breyta innkaupapöntun',
+ 'Edit Sales Invoice' => 'Breyta sölureikningi',
+ 'Edit Sales Order' => 'Breyta sölupöntun',
+ 'Edit Service' => 'Breyta þjónustu',
+ 'Edit Template' => 'Breyta skabalóni',
+ 'Edit User' => 'Breyta notanda',
+ 'Edit Vendor' => 'Breyta byrgja',
+ 'Employee' => 'Starfsmenn',
+ 'Enforce transaction reversal for all dates' => 'Gennemtving explicitte rettelser af posteringer for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vinsamlega sláið inn 3 stafa nafn á gjaldeyri sem á að nota setji tvípúnkt á milli.',
+ 'Equity' => 'Eigiðfé',
+ 'Exch' => 'Vx',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate Difference' => 'Vaxtamunur',
+ 'Exchangerate for payment missing!' => 'Vextir fyrir greiðslu vantar!',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Existing Datasets' => 'Hætta með gagnasafn',
+ 'Expense' => 'Kostnaður',
+ 'Expense Account' => 'Kostnaðarreikningur',
+ 'Expense/Asset' => 'Kostnaður/Eignir',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'Foreign Exchange Gain' => 'Gengishagnaður',
+ 'Foreign Exchange Loss' => 'Gengistap',
+ 'From' => 'Frá',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI eytt!',
+ 'GIFI missing!' => 'GIFI vantar!',
+ 'GIFI saved!' => 'GIFI geymt!',
+ 'GL Transaction' => 'Færslur í aðalbók',
+ 'General Ledger' => 'Aðalbók',
+ 'Goods & Services' => 'Vörur og þjónusta',
+ 'HTML Templates' => 'HTML-skabalón',
+ 'Heading' => 'Yfirskriftir',
+ 'Host' => 'Netþjónn',
+ 'Hostname missing!' => 'Nafn netþjóns vantar',
+ 'ID' => 'ID',
+ 'Image' => 'Mynd',
+ 'In-line' => 'Inndregið',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Include in drop-down menus' => 'Innifela í fellivalmynd',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Innifela þennan lykil hjá viðskiptavinum til þess að geta gert hann vask skildan',
+ 'Income' => 'Innkoma',
+ 'Income Account' => 'Inn reikningur',
+ 'Income Statement' => 'Inn yfirlýsing',
+ 'Incorrect Dataset version!' => 'Röng útgáfa af gagnasfni!',
+ 'Incorrect Password!' => 'Rangt lykilorð',
+ 'Individual Items' => 'Sjálfstæðir hlutir',
+ 'Inventory' => 'Lager',
+ 'Inventory Account' => 'Lagerlykill',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne sammensætning',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne enhed',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning skal være nul',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date' => 'Sölureikningur dags.',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Invoice deleted!' => 'Sölureikningi eytt!',
+ 'Invoice posted!' => 'Sölureikningur bókfærður!',
+ 'Invoices' => 'Sölureikningar',
+ 'Is this a summary account to record' => 'Söfnunarreikningur fyrir',
+ 'Item deleted!' => 'Hlut eytt!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'LaTeX Templates' => 'LaTeX-skabalón',
+ 'Language' => 'Túngumál',
+ 'Last Cost' => 'Síðasta verð',
+ 'Last Invoice Number' => 'Síðasta sölureiknings númer',
+ 'Last Numbers & Default Accounts' => 'Síðasta númer og sjálfgefin reikningur',
+ 'Last Purchase Order Number' => 'Síðasta innkaupa pöntunar númer´',
+ 'Last Sales Order Number' => 'Síðasta sölupöntunar númer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Setjið engar upplýsingar í netþjónn og port nema um sé að ræða annan netþjón.',
+ 'Liability' => 'Passiv',
+ 'Licensed to' => 'Skráð á',
+ 'Line Total' => 'Samtals línur',
+ 'Link' => 'Tenglar',
+ 'Link Accounts' => 'Tengja lykla',
+ 'List Accounts' => 'Sýna lykla',
+ 'List GIFI' => 'Sýna GIFI',
+ 'List Price' => 'Sýna verð',
+ 'List Transactions' => 'Sýna færslur',
+ 'Login' => 'Tengjast',
+ 'Logout' => 'Aftengjast',
+ 'Make' => 'Tegund',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'Multibyte Encoding' => '',
+ 'N/A' => '',
+ 'Name' => 'Nafn',
+ 'Name missing!' => 'Nafn vantar!',
+ 'New Templates' => 'Nýtt skabalón',
+ 'No' => 'Nei',
+ 'No Database Drivers available!' => 'Engin gagnagrunnstengin til',
+ 'No Dataset selected!' => 'Ekkert gagnasafn valið',
+ 'No email address for' => 'Ekkert netfang fyrir',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Upplýsinar',
+ 'Nothing applied!' => 'Ekkert bókað!',
+ 'Nothing selected!' => 'Ekkert valið!',
+ 'Nothing to delete!' => 'Ekkert til þess að eyða!',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number Format' => 'Númera útlit',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'O' => 'O',
+ 'Obsolete' => 'Úrelt',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'On Hand' => 'Á lager',
+ 'On Order' => 'Í pöntun',
+ 'Open' => 'opna',
+ 'Oracle Database Administration' => 'Oracle kerfisstjórnun á gagnagrunni',
+ 'Order' => 'Pöntun',
+ 'Order Date' => 'Pöntunar dags.',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Entry' => 'Pöntunarblað',
+ 'Order Number' => 'Pöntun númer',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'Order deleted!' => 'Pöntun eytt',
+ 'Order saved!' => 'Pöntun geymd',
+ 'Ordered' => 'pantað',
+ 'Orphaned' => 'Sjáfstætt',
+ 'Out of balance!' => 'Ekki jafnvægi!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Paid' => 'Greitt',
+ 'Paid in full' => 'Greitt að fullu',
+ 'Part' => 'Vara',
+ 'Part Number missing!' => 'Vörunúmer vantar!',
+ 'Parts' => 'Vörur',
+ 'Parts Inventory' => 'Vörulisti',
+ 'Password' => 'Aðgangsorð',
+ 'Password changed!' => 'Aðgangsorði breytt',
+ 'Payables' => 'Útistandandi',
+ 'Payment' => 'Greislur',
+ 'Payment date missing!' => 'Greiðsudags. vantar!',
+ 'Payment posted!' => 'Greiðsla bókuð',
+ 'Payments' => 'Greiðslur',
+ 'Pg Database Administration' => 'Pg kerfisstjórnun gagnarunns',
+ 'Phone' => 'Sími.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port vantar',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Uppsetningar',
+ 'Preferences saved!' => 'Uppsetningar geymdar!',
+ 'Price' => 'Verð',
+ 'Print' => 'Prenta',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'Verkefnisnúmer vantar!',
+ 'Project deleted!' => 'Verkefni eytt!',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Project saved!' => 'verkefni geymt!',
+ 'Projects' => 'Verkefni',
+ 'Purchase Invoice' => 'Innkaupsreikningur',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Purchase Orders' => 'Innkaupspantanir',
+ 'Qty' => 'Magn',
+ 'ROP' => '',
+ 'Rate' => 'Taxti',
+ 'Recd' => 'Mótt:',
+ 'Receipt' => 'Kvittun',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'Kvittanir',
+ 'Receivables' => 'Innborganir',
+ 'Reconciliation' => 'Afstemingar',
+ 'Record in' => 'Bóka á',
+ 'Reference' => 'Fylgiskjal',
+ 'Reference missing!' => 'Fylgiskjal vantar',
+ 'Remaining' => 'Eftir',
+ 'Report for' => 'Skýrsla fyrir',
+ 'Reports' => 'Skýrslur',
+ 'Required by' => 'Pantað af',
+ 'Retained Earnings' => 'Realiseret overskud',
+ 'Sales' => 'Sala',
+ 'Sales Invoice' => 'Sölureikningur',
+ 'Sales Order' => 'Sölupöntun',
+ 'Sales Orders' => 'Sölupantanir',
+ 'Salesperson' => '',
+ 'Save' => 'Geyma',
+ 'Save as new' => 'Geyma sem nýtt',
+ 'Save to File' => 'Geyma í skrá',
+ 'Screen' => 'Skjá',
+ 'Select a Dataset to delete and press "Continue"' => 'Veljið gagnasafn og ýtið á "Áfram"',
+ 'Select all' => 'Velja allt',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sell Price' => 'Söluverð',
+ 'Send by E-Mail' => 'Senda með rafpósti',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Service Items' => 'Þjónustu hlutur',
+ 'Service Number missing!' => 'Þjónustunúmer vantar!',
+ 'Services' => 'Þjónustur',
+ 'Setup Templates' => 'Skabalón fyrir uppsetningu',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Ship via' => 'Senda með',
+ 'Short' => 'Stutt',
+ 'Signature' => 'Undirskrift',
+ 'Sold' => 'Selt',
+ 'Source' => 'Frálag',
+ 'Standard' => 'Standart',
+ 'Statement' => 'Uppgjör',
+ 'Statement Balance' => 'jöfnunaruppgjör',
+ 'Statement sent to' => 'Uppgjör sendist til',
+ 'Statements sent to printer!' => 'Uppgjör sendist á prentara',
+ 'Stock Assembly' => 'Lager samsetning',
+ 'Stylesheet' => 'Stílblað',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'System' => 'Kerfi',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax Accounts' => 'VSK lykill',
+ 'Tax Included' => 'Taka með VSK',
+ 'Tax collected' => 'VSK samtals',
+ 'Tax paid' => 'VSK greitt',
+ 'Taxable' => 'Skatskildur',
+ 'Template saved!' => 'Skabalón geymt!',
+ 'Templates' => 'Skabalón',
+ 'Terms: Net' => 'Nettó',
+ 'The following Datasets are not in use and can be deleted' => 'Eftirfarandi gagnasöfn eru ekki í notkunn og er því ekki hægt að eyða þeim',
+ 'The following Datasets need to be updated' => 'Eftirfarandi gagnasafn þarfnast uppfærslu',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Engu verður eytt eða breytt með þessu ',
+ 'To' => 'til',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Þú getur notað notanda sem til er til þess að útbúa nýjan notanda með þvi að breyta bara notendanafninu.',
+ 'Top Level' => 'Efsta þrep',
+ 'Total' => 'Samtals',
+ 'Transaction Date missing!' => 'Dags. vantar!',
+ 'Transaction deleted!' => 'Færslu eytt!',
+ 'Transaction posted!' => 'Færsla bókfærð!',
+ 'Transaction reversal enforced for all dates' => 'Rettelser af posteringer skal altid bogføres explicit',
+ 'Transaction reversal enforced up to' => 'Rettelser af posteringer skal bogføres explicit indtil',
+ 'Transactions' => 'Færslur',
+ 'Transactions exist, cannot delete customer!' => 'Ekki er hægt að eyða viðskipamanni með færslur!',
+ 'Transactions exist, cannot delete vendor!' => 'Ekki er hægt að eyða byrgja með færslur!',
+ 'Transactions exist; cannot delete account!' => 'Ekki hægt að eyða reikningi með færslur!',
+ 'Trial Balance' => 'Prufu staða',
+ 'Unit' => 'Einingar',
+ 'Unit of measure' => 'Mælieining',
+ 'Update' => 'Uppfærsla',
+ 'Update Dataset' => 'Uppfæra gagnasafn',
+ 'Updated' => 'Uppfæra',
+ 'Use Templates' => 'Nota skabalón',
+ 'User' => 'Notandi',
+ 'User deleted!' => 'Notanda eytt!',
+ 'User saved!' => 'Notandi geymdur!',
+ 'Vendor' => 'Byrgir',
+ 'Vendor deleted!' => 'Byrgja eytt!',
+ 'Vendor missing!' => 'Byrgja vantar!',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'Vendor saved!' => 'Byrgir geymdur!',
+ 'Vendors' => 'Byrgjar',
+ 'Version' => 'Útgáfa',
+ 'Weight' => 'Vigt',
+ 'Weight Unit' => 'Vigtareining',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'Year End' => 'Ársuppgjör',
+ 'Yes' => 'Já',
+ 'You are logged out!' => 'Þú ert loggaður út',
+ 'You did not enter a name!' => 'Þú gafst ekki upp nafn',
+ 'You must enter a host and port for local and remote connections!' => 'Þú verður að gefa upp netþjón of port til þess að geta tengst!',
+ 'as at' => 'líkt og með',
+ 'collected on sales' => 'samanlagt við sölu',
+ 'days' => 'dagar',
+ 'does not exist' => 'er ekki til',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendist með rafpósti',
+ 'for Period' => 'fyrir tímabilið',
+ 'hr' => 'tími',
+ 'is already a member!' => 'er þegar meðlimur',
+ 'is not a member!' => 'er ekki meðlimur!',
+ 'localhost' => 'lokal',
+ 'locked!' => 'læst',
+ 'paid on purchases' => 'greitt við innkaup',
+ 'sent to printer' => 'sendist á prentara',
+ 'successfully created!' => 'uppfært!',
+ 'successfully deleted!' => 'eytt!',
+ 'to' => 'til',
+ 'website' => 'á Internetinu',
+};
+
+1;
diff --git a/sql-ledger/locale/is/am b/sql-ledger/locale/is/am
new file mode 100644
index 000000000..e8d66bfde
--- /dev/null
+++ b/sql-ledger/locale/is/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Innkaupakerfi',
+ 'AR' => 'Sölukerfi',
+ 'Account' => 'Reikningur',
+ 'Account Number' => 'Reikningsnúmer',
+ 'Account Number missing!' => 'Reikningsnúmer vantar!',
+ 'Account Type' => 'Reikningstegund',
+ 'Account Type missing!' => 'Reikningstegund vantar!',
+ 'Account deleted!' => 'Reikningi eytt!',
+ 'Account saved!' => 'Reikningur geymdur!',
+ 'Add Account' => 'Nýr reikningur',
+ 'Add GIFI' => 'Ný GIFI',
+ 'Address' => 'Heimilisfang',
+ 'Asset' => 'Eignir',
+ 'Audit Control' => 'Yfirlit stjórnun',
+ 'Backup sent to' => 'Afrit sendist til',
+ 'Books are open' => 'Bókhald er opið fyrir leiðréttingar',
+ 'Business Number' => 'Viðskiptanúmer',
+ 'COGS' => 'Innkaup',
+ 'Cannot delete account!' => 'Get ekki eytt reikningi!',
+ 'Cannot delete default account!' => 'Get ekki eytt grunnreikningi!',
+ 'Cannot save account!' => 'Get ekki geymt reikning!',
+ 'Cannot save preferences!' => 'Get ekki geymt uppsetningu!',
+ 'Character Set' => 'Stafaset',
+ 'Chart of Accounts' => 'Listi yfir lykkla/reikninga',
+ 'Close Books up to' => 'Loka bókhaldi til dags',
+ 'Company' => 'Fyritæki',
+ 'Continue' => 'Áfram',
+ 'Copy to COA' => 'Afrita í COA',
+ 'Credit' => 'Kredit',
+ 'Date Format' => 'Dagsetningarform',
+ 'Debit' => 'Debit',
+ 'Delete' => 'Eyða',
+ 'Delete Account' => 'Eyða reikningi',
+ 'Description' => 'Skýringar',
+ 'Dropdown Limit' => 'Takmörk fyrir valmynd',
+ 'E-mail' => 'R-póstur',
+ 'Edit' => 'Breyta',
+ 'Edit Account' => 'Breyta reikningi',
+ 'Edit GIFI' => 'Breyta GIFI',
+ 'Edit Preferences for' => 'Breyta uppsetningu fyrir',
+ 'Edit Template' => 'Breyta skabalóni',
+ 'Enforce transaction reversal for all dates' => 'Gennemtving explicitte rettelser af posteringer for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vinsamlega sláið inn 3 stafa nafn á gjaldeyri sem á að nota setji tvípúnkt á milli.',
+ 'Equity' => 'Eigiðfé',
+ 'Expense' => 'Kostnaður',
+ 'Expense Account' => 'Kostnaðarreikningur',
+ 'Expense/Asset' => 'Kostnaður/Eignir',
+ 'Fax' => 'Símbréf',
+ 'Foreign Exchange Gain' => 'Gengishagnaður',
+ 'Foreign Exchange Loss' => 'Gengistap',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI eytt!',
+ 'GIFI missing!' => 'GIFI vantar!',
+ 'GIFI saved!' => 'GIFI geymt!',
+ 'Heading' => 'Yfirskriftir',
+ 'Include in drop-down menus' => 'Innifela í fellivalmynd',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Innifela þennan lykil hjá viðskiptavinum til þess að geta gert hann vask skildan',
+ 'Income' => 'Innkoma',
+ 'Income Account' => 'Inn reikningur',
+ 'Inventory' => 'Lager',
+ 'Inventory Account' => 'Lagerlykill',
+ 'Is this a summary account to record' => 'Söfnunarreikningur fyrir',
+ 'Language' => 'Túngumál',
+ 'Last Invoice Number' => 'Síðasta sölureiknings númer',
+ 'Last Numbers & Default Accounts' => 'Síðasta númer og sjálfgefin reikningur',
+ 'Last Purchase Order Number' => 'Síðasta innkaupa pöntunar númer´',
+ 'Last Sales Order Number' => 'Síðasta sölupöntunar númer',
+ 'Liability' => 'Passiv',
+ 'Link' => 'Tenglar',
+ 'Name' => 'Nafn',
+ 'No' => 'Nei',
+ 'No email address for' => 'Ekkert netfang fyrir',
+ 'Number' => 'Númer',
+ 'Number Format' => 'Númera útlit',
+ 'Parts Inventory' => 'Vörulisti',
+ 'Password' => 'Aðgangsorð',
+ 'Payables' => 'Útistandandi',
+ 'Payment' => 'Greislur',
+ 'Phone' => 'Sími.',
+ 'Preferences saved!' => 'Uppsetningar geymdar!',
+ 'Rate' => 'Taxti',
+ 'Receivables' => 'Innborganir',
+ 'Sales' => 'Sala',
+ 'Save' => 'Geyma',
+ 'Service Items' => 'Þjónustu hlutur',
+ 'Ship via' => 'Senda með',
+ 'Signature' => 'Undirskrift',
+ 'Stylesheet' => 'Stílblað',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax Accounts' => 'VSK lykill',
+ 'Template saved!' => 'Skabalón geymt!',
+ 'Transaction reversal enforced for all dates' => 'Rettelser af posteringer skal altid bogføres explicit',
+ 'Transaction reversal enforced up to' => 'Rettelser af posteringer skal bogføres explicit indtil',
+ 'Transactions exist; cannot delete account!' => 'Ekki hægt að eyða reikningi með færslur!',
+ 'Weight Unit' => 'Vigtareining',
+ 'Year End' => 'Ársuppgjör',
+ 'Yes' => 'Já',
+ 'does not exist' => 'er ekki til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'nýr_reikningur' => 'add_account',
+ 'Áfram' => 'continue',
+ 'afrita_í_coa' => 'copy_to_coa',
+ 'eyða' => 'delete',
+ 'breyta' => 'edit',
+ 'breyta_reikningi' => 'edit_account',
+ 'geyma' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ap b/sql-ledger/locale/is/ap
new file mode 100644
index 000000000..ea4afb26e
--- /dev/null
+++ b/sql-ledger/locale/is/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Innkaupafærsla',
+ 'AP Transactions' => 'Innkaupafærslur',
+ 'Account' => 'Reikningur',
+ 'Add Accounts Payables Transaction' => 'Ný kredit færsla',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Amount Due' => 'Eindagi',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Transaction' => 'Ert þú viss um að þú viljir eyða færslunni',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Cannot delete transaction!' => 'Get ekki eytt færslu!',
+ 'Cannot post payment for a closed period!' => 'Get ekki bókað greiðslu á lokað tímabil',
+ 'Cannot post transaction for a closed period!' => 'Get ekki bókað færslu á lokað tímabil!',
+ 'Cannot post transaction!' => 'Get ekki bókað færslu!',
+ 'Closed' => 'Lokað',
+ 'Confirm!' => 'Staðfesta!',
+ 'Continue' => 'Áfram',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Date Paid' => 'Greiðsludagur',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Description' => 'Skýringar',
+ 'Due Date' => 'Dags. lokið',
+ 'Due Date missing!' => 'Vantar dags. lokið!',
+ 'Edit Accounts Payables Transaction' => 'Breyta greiðslufærslum',
+ 'Employee' => 'Starfsmenn',
+ 'Exch' => 'Vx',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate for payment missing!' => 'Vextir fyrir greiðslu vantar!',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date' => 'Sölureikningur dags.',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Open' => 'opna',
+ 'Order' => 'Pöntun',
+ 'Order Number' => 'Pöntun númer',
+ 'Paid' => 'Greitt',
+ 'Payment date missing!' => 'Greiðsudags. vantar!',
+ 'Payments' => 'Greiðslur',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Purchase Invoice' => 'Innkaupsreikningur',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Frálag',
+ 'Subtotal' => 'Samtala',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax Included' => 'Taka með VSK',
+ 'Total' => 'Samtals',
+ 'Transaction deleted!' => 'Færslu eytt!',
+ 'Transaction posted!' => 'Færsla bókfærð!',
+ 'Update' => 'Uppfærsla',
+ 'Vendor' => 'Byrgir',
+ 'Vendor missing!' => 'Byrgja vantar!',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'Yes' => 'Já',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'innkaupafærsla' => 'ap_transaction',
+ 'ný_kredit_færsla' => 'add_accounts_payables_transaction',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'breyta_greiðslufærslum' => 'edit_accounts_payables_transaction',
+ 'bókfæra' => 'post',
+ 'bókfæra_sem_nýjan' => 'post_as_new',
+ 'innkaupsreikningur' => 'purchase_invoice',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ar b/sql-ledger/locale/is/ar
new file mode 100644
index 000000000..6619389dd
--- /dev/null
+++ b/sql-ledger/locale/is/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Sölufærsla',
+ 'AR Transactions' => 'Sölufærslur',
+ 'Account' => 'Reikningur',
+ 'Add Accounts Receivables Transaction' => 'Ný debit færsla',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Amount Due' => 'Eindagi',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Transaction' => 'Ert þú viss um að þú viljir eyða færslunni',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Cannot delete transaction!' => 'Get ekki eytt færslu!',
+ 'Cannot post payment for a closed period!' => 'Get ekki bókað greiðslu á lokað tímabil',
+ 'Cannot post transaction for a closed period!' => 'Get ekki bókað færslu á lokað tímabil!',
+ 'Cannot post transaction!' => 'Get ekki bókað færslu!',
+ 'Closed' => 'Lokað',
+ 'Confirm!' => 'Staðfesta!',
+ 'Continue' => 'Áfram',
+ 'Credit Limit' => 'Kreditmörk',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer' => 'Viðskiptavinur',
+ 'Customer missing!' => 'Viðskiptavin vantar!',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Date Paid' => 'Greiðsludagur',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Description' => 'Skýringar',
+ 'Due Date' => 'Dags. lokið',
+ 'Due Date missing!' => 'Vantar dags. lokið!',
+ 'Edit Accounts Receivables Transaction' => 'Breyta inn-færslum',
+ 'Exch' => 'Vx',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate for payment missing!' => 'Vextir fyrir greiðslu vantar!',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date' => 'Sölureikningur dags.',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Open' => 'opna',
+ 'Order' => 'Pöntun',
+ 'Order Number' => 'Pöntun númer',
+ 'Paid' => 'Greitt',
+ 'Payment date missing!' => 'Greiðsudags. vantar!',
+ 'Payments' => 'Greiðslur',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Remaining' => 'Eftir',
+ 'Sales Invoice' => 'Sölureikningur',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Ship via' => 'Senda með',
+ 'Source' => 'Frálag',
+ 'Subtotal' => 'Samtala',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax Included' => 'Taka með VSK',
+ 'Total' => 'Samtals',
+ 'Transaction deleted!' => 'Færslu eytt!',
+ 'Transaction posted!' => 'Færsla bókfærð!',
+ 'Update' => 'Uppfærsla',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'Yes' => 'Já',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'sölufærsla' => 'ar_transaction',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'bókfæra' => 'post',
+ 'bókfæra_sem_nýjan' => 'post_as_new',
+ 'sölureikningur' => 'sales_invoice',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/arap b/sql-ledger/locale/is/arap
new file mode 100644
index 000000000..3e6301144
--- /dev/null
+++ b/sql-ledger/locale/is/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Heimilisfang',
+ 'Continue' => 'Áfram',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Description' => 'Skýringar',
+ 'Number' => 'Númer',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'Áfram' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ca b/sql-ledger/locale/is/ca
new file mode 100644
index 000000000..8d3b38481
--- /dev/null
+++ b/sql-ledger/locale/is/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Reikningur',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Balance' => 'Afstemming',
+ 'Chart of Accounts' => 'Listi yfir lykkla/reikninga',
+ 'Credit' => 'Kredit',
+ 'Date' => 'Dagsetning',
+ 'Debit' => 'Debit',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Description' => 'Skýringar',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'List Transactions' => 'Sýna færslur',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Reference' => 'Fylgiskjal',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Subtotal' => 'Samtala',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'sýna_færslur' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/is/cp b/sql-ledger/locale/is/cp
new file mode 100644
index 000000000..d21df27a2
--- /dev/null
+++ b/sql-ledger/locale/is/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Reikningur',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Amount does not equal applied!' => 'Upphæð stemmir ekki!',
+ 'Amount missing!' => 'Reikning vantar!',
+ 'Applied' => 'Uppfært',
+ 'Cannot post payment!' => 'Get ekki bókað greiðslu',
+ 'Cannot process payment for a closed period!' => 'Get ekki meðhöndlað greiðslu fyrir lokað tímabil!',
+ 'Check' => 'Ávísun',
+ 'Check printed!' => 'Ávísun prentuð',
+ 'Check printing failed!' => 'Villa við prentun á ávísun',
+ 'Continue' => 'Áfram',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer' => 'Viðskiptavinur',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Date missing!' => 'Dagsetningu vantar!',
+ 'Description' => 'Skýringar',
+ 'Due' => 'Lokið',
+ 'Exchangerate' => 'Vextir',
+ 'From' => 'Frá',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoices' => 'Sölureikningar',
+ 'Nothing applied!' => 'Ekkert bókað!',
+ 'Number' => 'Númer',
+ 'Paid in full' => 'Greitt að fullu',
+ 'Payment' => 'Greislur',
+ 'Payment posted!' => 'Greiðsla bókuð',
+ 'Post' => 'Bókfæra',
+ 'Print' => 'Prenta',
+ 'Printer' => 'Prentari',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Receipt' => 'Kvittun',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'Fylgiskjal',
+ 'Screen' => 'Skjá',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Update' => 'Uppfærsla',
+ 'Vendor' => 'Byrgir',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'Áfram' => 'continue',
+ 'bókfæra' => 'post',
+ 'prenta' => 'print',
+ 'uppfærsla' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ct b/sql-ledger/locale/is/ct
new file mode 100644
index 000000000..d2be96531
--- /dev/null
+++ b/sql-ledger/locale/is/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Nýr',
+ 'Address' => 'Heimilisfang',
+ 'All' => 'Allt',
+ 'Bcc' => 'Blint afrit',
+ 'Cannot delete customer!' => 'Get ekki eytt viðskiptavini!',
+ 'Cannot delete vendor!' => 'Get ekki eytt framleiðanda!',
+ 'Cc' => 'Afrit',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Credit Limit' => 'Kreditmörk',
+ 'Customer deleted!' => 'Viðskiptavini eytt!',
+ 'Customer saved!' => 'Viðskiptavinur geymdur!',
+ 'Customers' => 'Viðskiptavinir',
+ 'Delete' => 'Eyða',
+ 'Discount' => 'Afsláttur',
+ 'E-mail' => 'R-póstur',
+ 'Edit Customer' => 'Breyta viðskiptavini',
+ 'Edit Vendor' => 'Breyta byrgja',
+ 'Fax' => 'Símbréf',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Invoice' => 'Sölureikningur',
+ 'Name' => 'Nafn',
+ 'Name missing!' => 'Nafn vantar!',
+ 'Notes' => 'Upplýsinar',
+ 'Number' => 'Númer',
+ 'Order' => 'Pöntun',
+ 'Orphaned' => 'Sjáfstætt',
+ 'Phone' => 'Sími.',
+ 'Save' => 'Geyma',
+ 'Ship to' => 'Senda til',
+ 'Tax Included' => 'Taka með VSK',
+ 'Taxable' => 'Skatskildur',
+ 'Terms: Net' => 'Nettó',
+ 'Transactions exist, cannot delete customer!' => 'Ekki er hægt að eyða viðskipamanni með færslur!',
+ 'Transactions exist, cannot delete vendor!' => 'Ekki er hægt að eyða byrgja með færslur!',
+ 'Vendor deleted!' => 'Byrgja eytt!',
+ 'Vendor saved!' => 'Byrgir geymdur!',
+ 'Vendors' => 'Byrgjar',
+ 'days' => 'dagar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'nýr' => 'add',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'sölureikningur' => 'invoice',
+ 'pöntun' => 'order',
+ 'geyma' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/is/gl b/sql-ledger/locale/is/gl
new file mode 100644
index 000000000..e659b9d1a
--- /dev/null
+++ b/sql-ledger/locale/is/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Innkaupafærsla',
+ 'AR Transaction' => 'Sölufærsla',
+ 'Account' => 'Reikningur',
+ 'Add General Ledger Transaction' => 'Ný höfuðfærsla',
+ 'Address' => 'Heimilisfang',
+ 'All' => 'Allt',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Transaction' => 'Ert þú viss um að þú viljir eyða færslunni',
+ 'Asset' => 'Eignir',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Balance' => 'Afstemming',
+ 'Cannot delete transaction!' => 'Get ekki eytt færslu!',
+ 'Cannot have a value in both Debit and Credit!' => 'Get ekki haft gildi bæði í debit og kredit!',
+ 'Cannot post a transaction without a value!' => 'Get ekki bókað án upphæðar',
+ 'Cannot post transaction for a closed period!' => 'Get ekki bókað færslu á lokað tímabil!',
+ 'Confirm!' => 'Staðfesta!',
+ 'Continue' => 'Áfram',
+ 'Credit' => 'Kredit',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Debit' => 'Debit',
+ 'Debit and credit out of balance!' => 'Debit og kredit skulu vera eins!',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Description' => 'Skýringar',
+ 'Edit General Ledger Transaction' => 'Breyta yfitbókunar færslum',
+ 'Equity' => 'Eigiðfé',
+ 'Expense' => 'Kostnaður',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Færslur í aðalbók',
+ 'General Ledger' => 'Aðalbók',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Income' => 'Innkoma',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Liability' => 'Passiv',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Purchase Invoice' => 'Innkaupsreikningur',
+ 'Reference' => 'Fylgiskjal',
+ 'Reference missing!' => 'Fylgiskjal vantar',
+ 'Reports' => 'Skýrslur',
+ 'Sales Invoice' => 'Sölureikningur',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Frálag',
+ 'Subtotal' => 'Samtala',
+ 'Transaction Date missing!' => 'Dags. vantar!',
+ 'Transaction deleted!' => 'Færslu eytt!',
+ 'Transaction posted!' => 'Færsla bókfærð!',
+ 'Update' => 'Uppfærsla',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'Yes' => 'Já',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'innkaupafærsla' => 'ap_transaction',
+ 'sölufærsla' => 'ar_transaction',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'færslur_í_aðalbók' => 'gl_transaction',
+ 'bókfæra' => 'post',
+ 'bókfæra_sem_nýjan' => 'post_as_new',
+ 'innkaupsreikningur' => 'purchase_invoice',
+ 'sölureikningur' => 'sales_invoice',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ic b/sql-ledger/locale/is/ic
new file mode 100644
index 000000000..7950a0c3e
--- /dev/null
+++ b/sql-ledger/locale/is/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Virkja',
+ 'Add' => 'Nýr',
+ 'Add Assembly' => 'Ný samsetning',
+ 'Add Part' => 'Ný vara',
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Add Service' => 'Ný þjónusta',
+ 'Address' => 'Heimilisfang',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Assemblies' => 'Samsetningar',
+ 'Assemblies restocked!' => 'Samsetningar endurunnar',
+ 'Assembly Number missing!' => 'Samsetningar númer vantar',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'Bought' => 'Keypt',
+ 'COGS' => 'Innkaup',
+ 'Cannot delete item already invoiced!' => 'Get ekki eytt hlut sem þegar er til á sölureikningi!',
+ 'Cannot delete item on order!' => 'Get ekki eytt hlut sem er í pöntun!',
+ 'Cannot delete item which is part of an assembly!' => 'Get ekki eytt hlut sem er partur af samsetningu!',
+ 'Cannot delete item!' => 'Get ekki eytt hlut!',
+ 'Cannot stock assemblies!' => 'Get ekki fært samsetningar',
+ 'Cc' => 'Afrit',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Description' => 'Skýringar',
+ 'Drawing' => 'Dregið',
+ 'E-mail' => 'R-póstur',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Edit Assembly' => 'Breyta samsetningu',
+ 'Edit Part' => 'Breyta vöru',
+ 'Edit Service' => 'Breyta þjónustu',
+ 'Expense' => 'Kostnaður',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'Image' => 'Mynd',
+ 'In-line' => 'Inndregið',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Income' => 'Innkoma',
+ 'Individual Items' => 'Sjálfstæðir hlutir',
+ 'Inventory' => 'Lager',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne sammensætning',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning skal være nul for at du kan forælde denne enhed',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning skal være nul',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Item deleted!' => 'Hlut eytt!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Last Cost' => 'Síðasta verð',
+ 'Line Total' => 'Samtals línur',
+ 'Link Accounts' => 'Tengja lykla',
+ 'List Price' => 'Sýna verð',
+ 'Make' => 'Tegund',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'Name' => 'Nafn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'Obsolete' => 'Úrelt',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'On Hand' => 'Á lager',
+ 'On Order' => 'Í pöntun',
+ 'Order' => 'Pöntun',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Number' => 'Pöntun númer',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'Ordered' => 'pantað',
+ 'Orphaned' => 'Sjáfstætt',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Part' => 'Vara',
+ 'Part Number missing!' => 'Vörunúmer vantar!',
+ 'Parts' => 'Vörur',
+ 'Phone' => 'Sími.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Verð',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Qty' => 'Magn',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Mótt:',
+ 'Required by' => 'Pantað af',
+ 'Sales' => 'Sala',
+ 'Sales Order' => 'Sölupöntun',
+ 'Save' => 'Geyma',
+ 'Screen' => 'Skjá',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sell Price' => 'Söluverð',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Service Number missing!' => 'Þjónustunúmer vantar!',
+ 'Services' => 'Þjónustur',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Short' => 'Stutt',
+ 'Sold' => 'Selt',
+ 'Stock Assembly' => 'Lager samsetning',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'Tax' => 'Virðisaukaskattur',
+ 'To' => 'til',
+ 'Top Level' => 'Efsta þrep',
+ 'Total' => 'Samtals',
+ 'Unit' => 'Einingar',
+ 'Unit of measure' => 'Mælieining',
+ 'Update' => 'Uppfærsla',
+ 'Updated' => 'Uppfæra',
+ 'Weight' => 'Vigt',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendist með rafpósti',
+ 'hr' => 'tími',
+ 'sent to printer' => 'sendist á prentara',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'nýr' => 'add',
+ 'ný_samsetning' => 'add_assembly',
+ 'ný_vara' => 'add_part',
+ 'ný_þjónusta' => 'add_service',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'breyta_samsetningu' => 'edit_assembly',
+ 'breyta_vöru' => 'edit_part',
+ 'breyta_þjónustu' => 'edit_service',
+ 'geyma' => 'save',
+ 'uppfærsla' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/is/io b/sql-ledger/locale/is/io
new file mode 100644
index 000000000..def8209c7
--- /dev/null
+++ b/sql-ledger/locale/is/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Address' => 'Heimilisfang',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'Cc' => 'Afrit',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Description' => 'Skýringar',
+ 'E-mail' => 'R-póstur',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'In-line' => 'Inndregið',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Name' => 'Nafn',
+ 'No.' => 'Nr.',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Order' => 'Pöntun',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Part' => 'Vara',
+ 'Phone' => 'Sími.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Verð',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Qty' => 'Magn',
+ 'Recd' => 'Mótt:',
+ 'Required by' => 'Pantað af',
+ 'Sales Order' => 'Sölupöntun',
+ 'Screen' => 'Skjá',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Subject' => 'Efni',
+ 'To' => 'til',
+ 'Unit' => 'Einingar',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'emailed to' => 'sendist með rafpósti',
+ 'sent to printer' => 'sendist á prentara',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'Áfram' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/is/ir b/sql-ledger/locale/is/ir
new file mode 100644
index 000000000..f94139510
--- /dev/null
+++ b/sql-ledger/locale/is/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Reikningur',
+ 'Add Purchase Invoice' => 'Nýr innkaupsreikningur',
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Invoice Number' => 'Ert þú viss um að þú viljir eyða reikningi númer',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'Cannot delete invoice!' => 'Get ekki eytt sölureikningi!',
+ 'Cannot post invoice for a closed period!' => 'Get ekki bókað á lokað tímabil!',
+ 'Cannot post invoice!' => 'Get ekki bókað sölureikning!',
+ 'Cannot post payment for a closed period!' => 'Get ekki bókað greiðslu á lokað tímabil',
+ 'Cc' => 'Afrit',
+ 'Confirm!' => 'Staðfesta!',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Date Due' => 'Eindagi',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Description' => 'Skýringar',
+ 'E-mail' => 'R-póstur',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Edit Purchase Invoice' => 'Breyta innkaupareikningi',
+ 'Exch' => 'Vx',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate for payment missing!' => 'Vextir fyrir greiðslu vantar!',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'In-line' => 'Inndregið',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date' => 'Sölureikningur dags.',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Invoice deleted!' => 'Sölureikningi eytt!',
+ 'Invoice posted!' => 'Sölureikningur bókfærður!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Name' => 'Nafn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Order' => 'Pöntun',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Number' => 'Pöntun númer',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Part' => 'Vara',
+ 'Payment date missing!' => 'Greiðsudags. vantar!',
+ 'Payments' => 'Greiðslur',
+ 'Phone' => 'Sími.',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Verð',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Qty' => 'Magn',
+ 'Recd' => 'Mótt:',
+ 'Record in' => 'Bóka á',
+ 'Required by' => 'Pantað af',
+ 'Sales Order' => 'Sölupöntun',
+ 'Screen' => 'Skjá',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Source' => 'Frálag',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'Tax Included' => 'Taka með VSK',
+ 'To' => 'til',
+ 'Total' => 'Samtals',
+ 'Unit' => 'Einingar',
+ 'Update' => 'Uppfærsla',
+ 'Vendor' => 'Byrgir',
+ 'Vendor missing!' => 'Byrgja vantar!',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'Yes' => 'Já',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendist með rafpósti',
+ 'sent to printer' => 'sendist á prentara',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'pöntun' => 'order',
+ 'bókfæra' => 'post',
+ 'bókfæra_sem_nýjan' => 'post_as_new',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/is b/sql-ledger/locale/is/is
new file mode 100644
index 000000000..041641802
--- /dev/null
+++ b/sql-ledger/locale/is/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Reikningur',
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Invoice' => 'Nýr sölureikningur',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Invoice Number' => 'Ert þú viss um að þú viljir eyða reikningi númer',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'Cannot delete invoice!' => 'Get ekki eytt sölureikningi!',
+ 'Cannot post invoice for a closed period!' => 'Get ekki bókað á lokað tímabil!',
+ 'Cannot post invoice!' => 'Get ekki bókað sölureikning!',
+ 'Cannot post payment for a closed period!' => 'Get ekki bókað greiðslu á lokað tímabil',
+ 'Cc' => 'Afrit',
+ 'Confirm!' => 'Staðfesta!',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Credit Limit' => 'Kreditmörk',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer' => 'Viðskiptavinur',
+ 'Customer missing!' => 'Viðskiptavin vantar!',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Date Due' => 'Eindagi',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Description' => 'Skýringar',
+ 'E-mail' => 'R-póstur',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Edit Sales Invoice' => 'Breyta sölureikningi',
+ 'Exch' => 'Vx',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate for payment missing!' => 'Vextir fyrir greiðslu vantar!',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'In-line' => 'Inndregið',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date' => 'Sölureikningur dags.',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number' => 'Sölureikningur Númer',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Invoice deleted!' => 'Sölureikningi eytt!',
+ 'Invoice posted!' => 'Sölureikningur bókfærður!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Name' => 'Nafn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Order' => 'Pöntun',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Number' => 'Pöntun númer',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Part' => 'Vara',
+ 'Payment date missing!' => 'Greiðsudags. vantar!',
+ 'Payments' => 'Greiðslur',
+ 'Phone' => 'Sími.',
+ 'Post' => 'Bókfæra',
+ 'Post as new' => 'Bókfæra sem nýjan',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Verð',
+ 'Print' => 'Prenta',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Qty' => 'Magn',
+ 'Recd' => 'Mótt:',
+ 'Record in' => 'Bóka á',
+ 'Remaining' => 'Eftir',
+ 'Required by' => 'Pantað af',
+ 'Sales Order' => 'Sölupöntun',
+ 'Screen' => 'Skjá',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Ship via' => 'Senda með',
+ 'Source' => 'Frálag',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'Tax Included' => 'Taka með VSK',
+ 'To' => 'til',
+ 'Total' => 'Samtals',
+ 'Unit' => 'Einingar',
+ 'Update' => 'Uppfærsla',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'Yes' => 'Já',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendist með rafpósti',
+ 'sent to printer' => 'sendist á prentara',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'r_póstur' => 'e_mail',
+ 'pöntun' => 'order',
+ 'bókfæra' => 'post',
+ 'bókfæra_sem_nýjan' => 'post_as_new',
+ 'prenta' => 'print',
+ 'senda_til' => 'ship_to',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/login b/sql-ledger/locale/is/login
new file mode 100644
index 000000000..2bb761d90
--- /dev/null
+++ b/sql-ledger/locale/is/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Um',
+ 'Database Host' => 'Gagnagrunns-netþjónn',
+ 'Dataset' => 'Gagnasafn',
+ 'Incorrect Dataset version!' => 'Röng útgáfa af gagnasfni!',
+ 'Incorrect Password!' => 'Rangt lykilorð',
+ 'Licensed to' => 'Skráð á',
+ 'Login' => 'Tengjast',
+ 'Name' => 'Nafn',
+ 'Password' => 'Aðgangsorð',
+ 'User' => 'Notandi',
+ 'Version' => 'Útgáfa',
+ 'You are logged out!' => 'Þú ert loggaður út',
+ 'You did not enter a name!' => 'Þú gafst ekki upp nafn',
+ 'is not a member!' => 'er ekki meðlimur!',
+ 'localhost' => 'lokal',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'tengjast' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/is/menu b/sql-ledger/locale/is/menu
new file mode 100644
index 000000000..1bfede947
--- /dev/null
+++ b/sql-ledger/locale/is/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Innkaupakerfi',
+ 'AP Aging' => 'Aldursgreining',
+ 'AR' => 'Sölukerfi',
+ 'AR Aging' => 'Aldursgreining',
+ 'Accounting Menu' => 'Bókhalds valmynd',
+ 'Add Account' => 'Nýr reikningur',
+ 'Add Assembly' => 'Ný samsetning',
+ 'Add Customer' => 'Nýr viðskiptavinur',
+ 'Add GIFI' => 'Ný GIFI',
+ 'Add Part' => 'Ný vara',
+ 'Add Project' => 'Nýt verkefni',
+ 'Add Service' => 'Ný þjónusta',
+ 'Add Transaction' => 'Ný bókhaldsfærsla',
+ 'Add Vendor' => 'Nýr byrgir',
+ 'Assemblies' => 'Samsetningar',
+ 'Audit Control' => 'Yfirlit stjórnun',
+ 'Backup' => 'Afrit',
+ 'Balance Sheet' => 'Staða',
+ 'Cash' => 'Reiðufé',
+ 'Chart of Accounts' => 'Listi yfir lykkla/reikninga',
+ 'Check' => 'Ávísun',
+ 'Customers' => 'Viðskiptavinir',
+ 'General Ledger' => 'Aðalbók',
+ 'Goods & Services' => 'Vörur og þjónusta',
+ 'HTML Templates' => 'HTML-skabalón',
+ 'Income Statement' => 'Inn yfirlýsing',
+ 'Invoice' => 'Sölureikningur',
+ 'LaTeX Templates' => 'LaTeX-skabalón',
+ 'List Accounts' => 'Sýna lykla',
+ 'List GIFI' => 'Sýna GIFI',
+ 'Logout' => 'Aftengjast',
+ 'Order Entry' => 'Pöntunarblað',
+ 'Packing List' => 'Fylgiseðill',
+ 'Parts' => 'Vörur',
+ 'Payment' => 'Greislur',
+ 'Payments' => 'Greiðslur',
+ 'Preferences' => 'Uppsetningar',
+ 'Projects' => 'Verkefni',
+ 'Purchase Invoice' => 'Innkaupsreikningur',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Purchase Orders' => 'Innkaupspantanir',
+ 'Receipt' => 'Kvittun',
+ 'Receipts' => 'Kvittanir',
+ 'Reconciliation' => 'Afstemingar',
+ 'Reports' => 'Skýrslur',
+ 'Sales Invoice' => 'Sölureikningur',
+ 'Sales Order' => 'Sölupöntun',
+ 'Sales Orders' => 'Sölupantanir',
+ 'Save to File' => 'Geyma í skrá',
+ 'Send by E-Mail' => 'Senda með rafpósti',
+ 'Services' => 'Þjónustur',
+ 'Statement' => 'Uppgjör',
+ 'Stock Assembly' => 'Lager samsetning',
+ 'Stylesheet' => 'Stílblað',
+ 'System' => 'Kerfi',
+ 'Tax collected' => 'VSK samtals',
+ 'Tax paid' => 'VSK greitt',
+ 'Transactions' => 'Færslur',
+ 'Trial Balance' => 'Prufu staða',
+ 'Vendors' => 'Byrgjar',
+ 'Version' => 'Útgáfa',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/is/oe b/sql-ledger/locale/is/oe
new file mode 100644
index 000000000..96756405c
--- /dev/null
+++ b/sql-ledger/locale/is/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Nýr',
+ 'Add Purchase Invoice' => 'Nýr innkaupsreikningur',
+ 'Add Purchase Order' => 'Ný innkaupspöntun',
+ 'Add Sales Invoice' => 'Nýr sölureikningur',
+ 'Add Sales Order' => 'Ný sölupöntun',
+ 'Address' => 'Heimilisfang',
+ 'Amount' => 'Upphæð',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Are you sure you want to delete Order Number' => 'Ert þú viss um að þú viljir eyða pöntun númer',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Bcc' => 'Blint afrit',
+ 'Bin' => 'Vörulager',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Get ekki eytt pöntun!',
+ 'Cannot save order!' => 'Get ekki geymt pöntun!',
+ 'Cc' => 'Afrit',
+ 'Closed' => 'Lokað',
+ 'Confirm!' => 'Staðfesta!',
+ 'Contact' => 'Talsmaður',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Credit Limit' => 'Kreditmörk',
+ 'Curr' => 'Gjaldm',
+ 'Currency' => 'Gjaldmiðill',
+ 'Customer' => 'Viðskiptavinur',
+ 'Customer missing!' => 'Viðskiptavin vantar!',
+ 'Customer not on file!' => 'Viðskiptavinur ekki á skrá!',
+ 'Date' => 'Dagsetning',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Eyða',
+ 'Delivery Date' => 'Afgreiðsludags.',
+ 'Description' => 'Skýringar',
+ 'E-mail' => 'R-póstur',
+ 'E-mail address missing!' => 'R-póst vantar!',
+ 'Edit Purchase Order' => 'Breyta innkaupapöntun',
+ 'Edit Sales Order' => 'Breyta sölupöntun',
+ 'Exchangerate' => 'Vextir',
+ 'Exchangerate missing!' => 'Vantar vexti!',
+ 'Extended' => 'Framlengt',
+ 'Fax' => 'Símbréf',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'ID' => 'ID',
+ 'In-line' => 'Inndregið',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Invoice' => 'Sölureikningur',
+ 'Invoice Date missing!' => 'Sölureiknings dags. vantar!',
+ 'Invoice Number missing!' => 'Sölureikningsnúmer vantar!',
+ 'Item not on file!' => 'Hlutur ekki á skrá!',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'Name' => 'Nafn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Upplýsinar',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Number' => 'Númer',
+ 'Number missing in Row' => 'Tölu vantar í röð',
+ 'O' => 'O',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'Open' => 'opna',
+ 'Order' => 'Pöntun',
+ 'Order Date' => 'Pöntunar dags.',
+ 'Order Date missing!' => 'Pöntunar dags. vantar',
+ 'Order Number' => 'Pöntun númer',
+ 'Order Number missing!' => 'Númer pöntunar vantar',
+ 'Order deleted!' => 'Pöntun eytt',
+ 'Order saved!' => 'Pöntun geymd',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Fylgiseðill',
+ 'Packing List Date missing!' => 'Dags. fylgiseðils vantar!',
+ 'Packing List Number missing!' => 'Númer fylgiseðils vantar!',
+ 'Part' => 'Vara',
+ 'Phone' => 'Sími.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Verð',
+ 'Print' => 'Prenta',
+ 'Printer' => 'Prentari',
+ 'Project' => 'Verkefni',
+ 'Project not on file!' => 'Verkefni ekki á skrá!',
+ 'Purchase Order' => 'Innkaupspöntun',
+ 'Purchase Orders' => 'Innkaupspantanir',
+ 'Qty' => 'Magn',
+ 'Recd' => 'Mótt:',
+ 'Remaining' => 'Eftir',
+ 'Required by' => 'Pantað af',
+ 'Sales Order' => 'Sölupöntun',
+ 'Sales Orders' => 'Sölupantanir',
+ 'Save' => 'Geyma',
+ 'Save as new' => 'Geyma sem nýtt',
+ 'Screen' => 'Skjá',
+ 'Select from one of the items below' => 'Veljið einhver að neðangreindum hlutum, og ýtið á "Áfram"',
+ 'Select from one of the names below' => 'Veljið einhvað að neðangreindum nöfnum',
+ 'Select from one of the projects below' => 'Veljið einhvað að neðangreindum verkefnum',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Þjónusta',
+ 'Ship' => 'Senda',
+ 'Ship to' => 'Senda til',
+ 'Ship via' => 'Senda með',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax Included' => 'Taka með VSK',
+ 'Terms: Net' => 'Nettó',
+ 'To' => 'til',
+ 'Total' => 'Samtals',
+ 'Unit' => 'Einingar',
+ 'Update' => 'Uppfærsla',
+ 'Vendor' => 'Byrgir',
+ 'Vendor missing!' => 'Byrgja vantar!',
+ 'Vendor not on file!' => 'Byrgir ekki til í gagnagrunni!',
+ 'What type of item is this?' => 'Hvernig hlutur er þetta?',
+ 'Yes' => 'Já',
+ 'days' => 'dagar',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendist með rafpósti',
+ 'sent to printer' => 'sendist á prentara',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'nýr' => 'add',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'r_póstur' => 'e_mail',
+ 'sölureikningur' => 'invoice',
+ 'prenta' => 'print',
+ 'geyma' => 'save',
+ 'geyma_sem_nýtt' => 'save_as_new',
+ 'senda_til' => 'ship_to',
+ 'uppfærsla' => 'update',
+ 'já' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/is/pe b/sql-ledger/locale/is/pe
new file mode 100644
index 000000000..38b91694d
--- /dev/null
+++ b/sql-ledger/locale/is/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Nýr',
+ 'Add Project' => 'Nýt verkefni',
+ 'All' => 'Allt',
+ 'Continue' => 'Áfram',
+ 'Delete' => 'Eyða',
+ 'Description' => 'Skýringar',
+ 'Edit Project' => 'Breyta verkefni',
+ 'Number' => 'Númer',
+ 'Orphaned' => 'Sjáfstætt',
+ 'Project' => 'Verkefni',
+ 'Project Number missing!' => 'Verkefnisnúmer vantar!',
+ 'Project deleted!' => 'Verkefni eytt!',
+ 'Project saved!' => 'verkefni geymt!',
+ 'Projects' => 'Verkefni',
+ 'Save' => 'Geyma',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'nýr' => 'add',
+ 'Áfram' => 'continue',
+ 'eyða' => 'delete',
+ 'geyma' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/is/rc b/sql-ledger/locale/is/rc
new file mode 100644
index 000000000..cdd9c82f9
--- /dev/null
+++ b/sql-ledger/locale/is/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Reikningur',
+ 'Balance' => 'Afstemming',
+ 'Cleared Balance' => 'Hreynsað jafvægi',
+ 'Continue' => 'Áfram',
+ 'Date' => 'Dagsetning',
+ 'Deposit' => 'Innlagt',
+ 'Description' => 'Skýringar',
+ 'Difference' => 'Mismunur',
+ 'Done' => 'Búið',
+ 'Exchangerate Difference' => 'Vaxtamunur',
+ 'From' => 'Frá',
+ 'Out of balance!' => 'Ekki jafnvægi!',
+ 'Payment' => 'Greislur',
+ 'Reconciliation' => 'Afstemingar',
+ 'Select all' => 'Velja allt',
+ 'Source' => 'Frálag',
+ 'Statement Balance' => 'jöfnunaruppgjör',
+ 'Update' => 'Uppfærsla',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'Áfram' => 'continue',
+ 'búið' => 'done',
+ 'velja_allt' => 'select_all',
+ 'uppfærsla' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/is/rp b/sql-ledger/locale/is/rp
new file mode 100644
index 000000000..ba164d860
--- /dev/null
+++ b/sql-ledger/locale/is/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Aldursgreining',
+ 'AR Aging' => 'Aldursgreining',
+ 'Account' => 'Reikningur',
+ 'Accounts' => 'Reikningar',
+ 'Amount' => 'Upphæð',
+ 'Apr' => 'apr',
+ 'April' => 'apríl',
+ 'Attachment' => 'Hjálagt',
+ 'Aug' => 'ágú',
+ 'August' => 'ágúst',
+ 'Balance' => 'Afstemming',
+ 'Balance Sheet' => 'Staða',
+ 'Bcc' => 'Blint afrit',
+ 'Cash based' => 'Reiðufétengt',
+ 'Cc' => 'Afrit',
+ 'Compare to' => 'Bera saman við',
+ 'Continue' => 'Áfram',
+ 'Copies' => 'Afrit',
+ 'Credit' => 'Kredit',
+ 'Current' => 'Núvirði',
+ 'Customer' => 'Viðskiptavinur',
+ 'Date' => 'Dagsetning',
+ 'Debit' => 'Debit',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Decimalplaces' => 'Aukastafir',
+ 'Department' => 'Department',
+ 'Description' => 'Skýringar',
+ 'Due' => 'Lokið',
+ 'E-mail' => 'R-póstur',
+ 'E-mail Statement to' => 'Senda yfirlit til',
+ 'Feb' => 'feb',
+ 'February' => 'febrúar',
+ 'From' => 'Frá',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Yfirskriftir',
+ 'ID' => 'ID',
+ 'In-line' => 'Inndregið',
+ 'Include in Report' => 'Innifela í skýrslu',
+ 'Income Statement' => 'Inn yfirlýsing',
+ 'Invoice' => 'Sölureikningur',
+ 'Jan' => 'jan',
+ 'January' => 'janúar',
+ 'Jul' => 'júl',
+ 'July' => 'júlí',
+ 'Jun' => 'jún',
+ 'June' => 'júní',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'maí',
+ 'May ' => 'maí',
+ 'Message' => 'Skilaboð',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Ekkert valið!',
+ 'Nov' => 'nóv',
+ 'November' => 'nóvember',
+ 'Oct' => 'ókt',
+ 'October' => 'óktóber',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Greiðslur',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Prenta',
+ 'Printer' => 'Prentari',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'Kvittanir',
+ 'Report for' => 'Skýrsla fyrir',
+ 'Retained Earnings' => 'Realiseret overskud',
+ 'Screen' => 'Skjá',
+ 'Select all' => 'Velja allt',
+ 'Select postscript or PDF!' => 'Veljið postscript eða PDF',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Frálag',
+ 'Standard' => 'Standart',
+ 'Statement' => 'Uppgjör',
+ 'Statement sent to' => 'Uppgjör sendist til',
+ 'Statements sent to printer!' => 'Uppgjör sendist á prentara',
+ 'Subject' => 'Efni',
+ 'Subtotal' => 'Samtala',
+ 'Tax' => 'Virðisaukaskattur',
+ 'Tax collected' => 'VSK samtals',
+ 'Tax paid' => 'VSK greitt',
+ 'Total' => 'Samtals',
+ 'Trial Balance' => 'Prufu staða',
+ 'Vendor' => 'Byrgir',
+ 'as at' => 'líkt og með',
+ 'collected on sales' => 'samanlagt við sölu',
+ 'for Period' => 'fyrir tímabilið',
+ 'paid on purchases' => 'greitt við innkaup',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'Áfram' => 'continue',
+ 'r_póstur' => 'e_mail',
+ 'prenta' => 'print',
+ 'velja_allt' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/it/COPYING b/sql-ledger/locale/it/COPYING
new file mode 100644
index 000000000..55c8de3c1
--- /dev/null
+++ b/sql-ledger/locale/it/COPYING
@@ -0,0 +1,25 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Italien texts:
+#
+# Author: Paolo Bizzarri <p.bizzarri@icube.it>
+# Luca Venturini <luca@yepa.com>
+# Alessandro Pasotti <apasotti@isoleborromee.it>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/it/LANGUAGE b/sql-ledger/locale/it/LANGUAGE
new file mode 100644
index 000000000..4e07e7ecd
--- /dev/null
+++ b/sql-ledger/locale/it/LANGUAGE
@@ -0,0 +1 @@
+Italian
diff --git a/sql-ledger/locale/it/Num2text b/sql-ledger/locale/it/Num2text
new file mode 100644
index 000000000..fccc1d4cc
--- /dev/null
+++ b/sql-ledger/locale/it/Num2text
@@ -0,0 +1,163 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Luca Venturini <luca@yepa.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# this is a variation of the Lingua package
+# written for check and receipt printing
+# it returns a properly formatted text string
+# for a number up to 10**12
+
+sub init {
+ my $self = shift;
+
+ %{ $self->{numbername} } =
+ (0 => 'Zero',
+ 1 => 'uno',
+ 2 => 'due',
+ 3 => 'tre',
+ 4 => 'quattro',
+ 5 => 'cinque',
+ 6 => 'sei',
+ 7 => 'sette',
+ 8 => 'otto',
+ 9 => 'nove',
+ 10 => 'dieci',
+ 11 => 'undici',
+ 12 => 'dodici',
+ 13 => 'tredici',
+ 14 => 'quattrodici',
+ 15 => 'quindici',
+ 16 => 'sedici',
+ 17 => 'diciassette',
+ 18 => 'diciotto',
+ 19 => 'diciannove',
+ 20 => 'venti',
+ 30 => 'trenta',
+ 40 => 'quaranta',
+ 50 => 'cinquanta',
+ 60 => 'sessanta',
+ 70 => 'settanta',
+ 80 => 'ottanta',
+ 90 => 'novanta',
+ 10**2 => 'cento',
+ 10**3 => 'mille',
+ 10**6 => 'milione',
+ 10**9 => 'miliardo',
+ 10**12 => 'mille miliardi'
+ );
+
+}
+
+
+sub num2text {
+ my ($self, $amount) = @_;
+
+ return $self->{numbername}{0} unless $amount;
+
+ my @textnumber = ();
+
+ # split amount into chunks of 3
+ my @num = reverse split //, $amount;
+ my @numblock = ();
+ my ($i, $appendn);
+ my @a = ();
+
+ while (@num) {
+ @a = ();
+ for (1 .. 3) {
+ push @a, shift @num;
+ }
+ push @numblock, join / /, reverse @a;
+ }
+
+ while (@numblock) {
+
+ $i = $#numblock;
+ @num = split //, $numblock[$i];
+
+ $numblock[$i] *= 1;
+
+ if ($numblock[$i] == 0) {
+ pop @numblock;
+ next;
+ }
+
+ if ($numblock[$i] > 99) {
+ # the one from hundreds
+ push @textnumber, $self->{numbername}{$num[0]};
+
+ # add hundred designation
+ push @textnumber, $self->{numbername}{10**2};
+
+ # reduce numblock
+ $numblock[$i] -= $num[0] * 100;
+ }
+
+ if ($numblock[$i] > 9) {
+ # tens
+ push @textnumber, $self->format_ten($numblock[$i]);
+ } elsif ($numblock[$i] > 1) {
+ # ones
+ push @textnumber, $self->{numbername}{$numblock[$i]};
+ }
+
+ # add thousand, million
+ if ($i) {
+ $amount = 10**($i * 3);
+ push @textnumber, $self->{numbername}{$amount};
+ }
+
+ pop @numblock;
+
+ }
+
+ join '', @textnumber;
+
+}
+
+
+sub format_ten {
+ my ($self, $amount) = @_;
+
+ my $textnumber = "";
+ my @num = split //, $amount;
+
+ if ($amount > 20) {
+ if ($num[1] == 0) {
+ $textnumber = $self->{numbername}{$amount};
+ } else {
+ $amount = $num[0] * 10;
+ $textnumber = $self->{numbername}{$amount}.$self->{numbername}{$num[1]};
+ }
+ }
+ } else {
+ $textnumber = $self->{numbername}{$amount};
+ }
+
+ $textnumber;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/locale/it/admin b/sql-ledger/locale/it/admin
new file mode 100644
index 000000000..22948230e
--- /dev/null
+++ b/sql-ledger/locale/it/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Controllo degli accessi',
+ 'Accounting' => 'Contabilit&agrave;',
+ 'Add User' => 'Aggiungi Utente',
+ 'Address' => 'Indirizzo',
+ 'Administration' => 'Amministrazione',
+ 'Administrator' => 'Amministratore',
+ 'All Datasets up to date!' => 'Tutti i Dataset sono aggiornati!',
+ 'Change Admin Password' => 'Cambia password dell\'amministratore',
+ 'Change Password' => 'Cambia password',
+ 'Character Set' => 'Set di Caratteri',
+ 'Click on login name to edit!' => 'Clicca sul nome per effettuare modifiche',
+ 'Company' => 'Ragione Sociale',
+ 'Connect to' => 'Connetti a',
+ 'Continue' => 'Continua',
+ 'Create Chart of Accounts' => 'Crea Piano dei Conti',
+ 'Create Dataset' => 'Crea Dataset',
+ 'DBI not installed!' => 'Modulo DBI non installato',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Amministratore del Database',
+ 'Database Driver not checked!' => 'Il driver del database non e\' stato controllato!',
+ 'Database User missing!' => 'Manca l\'utente del Database!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset mancante!',
+ 'Dataset updated!' => 'Dataset aggiornato!',
+ 'Date Format' => 'Formato della data',
+ 'Delete' => 'Cancella',
+ 'Delete Dataset' => 'Cancella Dataset',
+ 'Directory' => 'Directory',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Limite per i menu a discesa',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Modifica Utente',
+ 'Existing Datasets' => 'Datasets esistenti',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Manca il nome del server',
+ 'Incorrect Password!' => 'Password sbagliata!',
+ 'Language' => 'Lingua',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lascia in bianco il server e la porta a meno che tu non voglia fare una connessione remota',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Multibyte Encoding',
+ 'Name' => 'Nome',
+ 'New Templates' => 'Nuovi Modelli',
+ 'No Database Drivers available!' => 'Nessun Database Driver disponibile!',
+ 'No Dataset selected!' => 'Nessun Dataset selezionato!',
+ 'Nothing to delete!' => 'Nulla da cancellare!',
+ 'Number Format' => 'Formato Numerico',
+ 'Oracle Database Administration' => 'Amministratore del Database Oracle',
+ 'Password' => 'Password',
+ 'Password changed!' => 'Password cambiata!',
+ 'Pg Database Administration' => 'Amministratore del Database Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Porta',
+ 'Port missing!' => 'Manca la Porta',
+ 'Printer' => 'Stampante',
+ 'Save' => 'Salva',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleziona un dataset da cancellare e premi "Continua"',
+ 'Setup Templates' => 'Configurazione dei modelli',
+ 'Ship via' => 'Porto',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Foglio di Stile',
+ 'Templates' => 'Modelli',
+ 'The following Datasets are not in use and can be deleted' => 'I seguenti datasets non sono in uso e possono essere cancellati',
+ 'The following Datasets need to be updated' => 'I seguenti datasets devono essere aggiornati',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Questo &egrave; un controllo preliminare per verificare le risorse esistenti. Nulla verr&agrave; creato o cancellato in questa fase!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Per aggiungere un utente ad un gruppo, modifica i dati dell\'utente, cambia lo username e salva. Un nuovo utente con gli stessi dati verr&agrave; salvato con il nuovo username.',
+ 'Update Dataset' => 'Aggiorna il Dataset',
+ 'Use Templates' => 'Usa Modelli',
+ 'User' => 'Utente',
+ 'User deleted!' => 'Utente cancellato!',
+ 'User saved!' => 'Utente salvato!',
+ 'Version' => 'Versione',
+ 'You must enter a host and port for local and remote connections!' => 'Devi inserire un server ed una porta per le connessioni locali e remote!',
+ 'does not exist' => 'non esiste',
+ 'is already a member!' => '&egrave; gi&agrave; utente!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'locked!',
+ 'successfully created!' => 'creato!',
+ 'successfully deleted!' => 'cancellato!',
+ 'website' => 'sito web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'aggiungi_utente' => 'add_user',
+ 'cambia_password_dell\'amministratore' => 'change_admin_password',
+ 'cambia_password' => 'change_password',
+ 'continua' => 'continue',
+ 'crea_dataset' => 'create_dataset',
+ 'cancella' => 'delete',
+ 'cancella_dataset' => 'delete_dataset',
+ 'login' => 'login',
+ 'amministratore_del_database_oracle' => 'oracle_database_administration',
+ 'amministratore_del_database_pg' => 'pg_database_administration',
+ 'salva' => 'save',
+ 'aggiorna_il_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/it/all b/sql-ledger/locale/it/all
new file mode 100644
index 000000000..8f47e6cb5
--- /dev/null
+++ b/sql-ledger/locale/it/all
@@ -0,0 +1,495 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Debiti Fornitori',
+ 'AP Aging' => 'Partite Aperte',
+ 'AP Transaction' => 'Transazione Fornitore',
+ 'AP Transactions' => 'Transazioni Fornitori',
+ 'AR' => 'Crediti Clienti',
+ 'AR Aging' => 'Partite Aperte',
+ 'AR Transaction' => 'Transazione Cliente',
+ 'AR Transactions' => 'Transazioni Clienti',
+ 'About' => 'Informazioni',
+ 'Access Control' => 'Controllo degli accessi',
+ 'Account' => 'Conto',
+ 'Account Number' => 'Numero di conto',
+ 'Account Number missing!' => 'Manca il numero di conto!',
+ 'Account Type' => 'Tipo di conto',
+ 'Account Type missing!' => 'Manca il tipo del conto!',
+ 'Account deleted!' => 'Conto cancellato!',
+ 'Account saved!' => 'Conto salvato!',
+ 'Accounting' => 'Contabilit&agrave;',
+ 'Accounting Menu' => 'Menu Contabilit&agrave;',
+ 'Accounts' => 'Conti',
+ 'Active' => 'Attivo',
+ 'Add' => 'Aggiungi',
+ 'Add Account' => 'Aggiungi conto',
+ 'Add Accounts Payables Transaction' => 'Aggiungi Transazione Fornitori',
+ 'Add Accounts Receivables Transaction' => 'Aggiungi Transazione Clienti',
+ 'Add Assembly' => 'Aggiungi Assemblato',
+ 'Add Customer' => 'Aggiungi Cliente',
+ 'Add GIFI' => 'Aggiungi codice GIFI',
+ 'Add General Ledger Transaction' => 'Aggiungi Transazione di Contabilità Generale',
+ 'Add Part' => 'Aggiungi Articolo',
+ 'Add Project' => 'Aggiungi Progetto',
+ 'Add Purchase Invoice' => 'Aggiungi Fattura di acquisto',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Invoice' => 'Aggiungi Fattura di vendita',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Add Service' => 'Aggiungi Servizio',
+ 'Add Transaction' => 'Aggiungi Transazione',
+ 'Add User' => 'Aggiungi Utente',
+ 'Add Vendor' => 'Aggiungi Fornitore',
+ 'Address' => 'Indirizzo',
+ 'Administration' => 'Amministrazione',
+ 'Administrator' => 'Amministratore',
+ 'All' => 'Tutti',
+ 'All Datasets up to date!' => 'Tutti i Dataset sono aggiornati!',
+ 'Amount' => 'Importo',
+ 'Amount Due' => 'Importo Dovuto',
+ 'Amount does not equal applied!' => 'L\'importo non &egrave; uguale a quanto applicato alle diverse fatture!',
+ 'Amount missing!' => 'Manca l\'importo',
+ 'Applied' => 'Applicato a',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Invoice Number' => 'Sei sicuro di voler cancellare la Fattura numero',
+ 'Are you sure you want to delete Order Number' => 'Sei sicuro di voler cancellare l\'ordine numero',
+ 'Are you sure you want to delete Transaction' => 'Sei sicuro di voler cancellare la Transazione',
+ 'Assemblies' => 'Assemblati',
+ 'Assemblies restocked!' => 'Assemblati ricaricati!',
+ 'Assembly Number missing!' => 'Manca il codice dell\'assemblato',
+ 'Asset' => 'Attivit&agrave;',
+ 'Attachment' => 'Allegato',
+ 'Audit Control' => 'Controllo accessi',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Backup',
+ 'Backup sent to' => 'Backup inviato a',
+ 'Balance' => 'Saldo',
+ 'Balance Sheet' => 'Stato Patrimoniale',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'Books are open' => 'I conti sono aperti',
+ 'Bought' => 'Comprato',
+ 'Business Number' => 'Partita IVA',
+ 'C' => 'C',
+ 'COGS' => 'Costo dei Beni Venduti',
+ 'Cannot delete account!' => 'Non puoi cancellare il conto!',
+ 'Cannot delete customer!' => 'Non puoi cancellare il cliente!',
+ 'Cannot delete default account!' => 'Non puoi cancellare il conto predefinito!',
+ 'Cannot delete invoice!' => 'Non puoi cancellare la fattura!',
+ 'Cannot delete item already invoiced!' => 'Non puoi cancellare un articolo gi&agrave; fatturato!',
+ 'Cannot delete item on order!' => 'Non puoi cancellare un articolo ordinato!',
+ 'Cannot delete item which is part of an assembly!' => 'Non puoi cancellare un articolo che fa parte di un assemblato!',
+ 'Cannot delete item!' => 'Non puoi cancellare l\'articolo',
+ 'Cannot delete order!' => 'Non puoi cancellare l\'ordine',
+ 'Cannot delete transaction!' => 'Non puoi cancellare la transazione',
+ 'Cannot delete vendor!' => 'Non puoi cancellare il fornitore',
+ 'Cannot have a value in both Debit and Credit!' => 'Non pu&ograve; esserci un valore sia in Dare che in Avere!',
+ 'Cannot post a transaction without a value!' => 'Non puoi salvare una transazione senza un valore!',
+ 'Cannot post invoice for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post invoice!' => 'Non puoi salvare la fattura!',
+ 'Cannot post payment for a closed period!' => 'Non puoi salvare pagamenti per un periodo chiuso!',
+ 'Cannot post payment!' => 'Non puoi salvare il pagamento!',
+ 'Cannot post transaction for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post transaction!' => 'Non puoi salvare la transazione!',
+ 'Cannot process payment for a closed period!' => 'Non puoi processare un pagamento per un periodo chiuso!',
+ 'Cannot save account!' => 'Non puoi salvare il conto!',
+ 'Cannot save order!' => 'Non puoi salvare l\'ordine!',
+ 'Cannot save preferences!' => 'Non puoi salvare le preferenze!',
+ 'Cannot stock assemblies!' => 'Non puoi caricare gli assemblati!',
+ 'Cash' => 'Cassa',
+ 'Cash based' => 'Basato sulla cassa',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Cambia password dell\'amministratore',
+ 'Change Password' => 'Cambia password',
+ 'Character Set' => 'Set di Caratteri',
+ 'Chart of Accounts' => 'Piano dei Conti',
+ 'Check' => 'Assegno',
+ 'Check printed!' => 'Assegno stampato!',
+ 'Check printing failed!' => 'Stampa dell\'assegno fallita!',
+ 'Cleared Balance' => 'Saldo gi&agrave; Conciliato',
+ 'Click on login name to edit!' => 'Clicca sul nome per effettuare modifiche',
+ 'Close Books up to' => 'Chiudi i conti fino a',
+ 'Closed' => 'Chiuso',
+ 'Company' => 'Ragione Sociale',
+ 'Compare to' => 'Confronta con',
+ 'Confirm!' => 'Conferma!',
+ 'Connect to' => 'Connetti a',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Copy to COA' => 'Inserisci come Conto',
+ 'Create Chart of Accounts' => 'Crea Piano dei Conti',
+ 'Create Dataset' => 'Crea Dataset',
+ 'Credit' => 'Avere',
+ 'Credit Limit' => 'Fido',
+ 'Curr' => 'Valuta',
+ 'Currency' => 'Valuta',
+ 'Current' => 'Corrente',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => 'Cliente cancellato!',
+ 'Customer missing!' => 'Cliente mancante!',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Customer saved!' => 'Cliente salvato!',
+ 'Customers' => 'Clienti',
+ 'DBI not installed!' => 'Modulo DBI non installato',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Amministratore del Database',
+ 'Database Driver not checked!' => 'Il driver del database non e\' stato controllato!',
+ 'Database Host' => 'Server',
+ 'Database User missing!' => 'Manca l\'utente del Database!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset mancante!',
+ 'Dataset updated!' => 'Dataset aggiornato!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data di Scadenza',
+ 'Date Format' => 'Formato della data',
+ 'Date Paid' => 'Data di pagamento',
+ 'Date missing!' => 'Manca la data!',
+ 'Debit' => 'Dare',
+ 'Debit and credit out of balance!' => 'Dare e Avere non concordano!.',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Decimalplaces' => 'Numero di decimali',
+ 'Delete' => 'Cancella',
+ 'Delete Account' => 'Cancella Conto',
+ 'Delete Dataset' => 'Cancella Dataset',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Department' => '',
+ 'Deposit' => 'Deposito',
+ 'Description' => 'Descrizione',
+ 'Difference' => 'Differenza',
+ 'Directory' => 'Directory',
+ 'Discount' => 'Sconto',
+ 'Done' => 'Fatto',
+ 'Drawing' => 'Disegno',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Limite per i menu a discesa',
+ 'Due' => 'Dovuto',
+ 'Due Date' => 'Scadenza Fattura',
+ 'Due Date missing!' => 'Data di Scadenza mancante!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Manda il sollecito via e-mail a',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit' => 'Modifica',
+ 'Edit Account' => 'Modifica Conto',
+ 'Edit Accounts Payables Transaction' => 'Modifica Transazione Fornitori',
+ 'Edit Accounts Receivables Transaction' => 'Modifica Transazione Clienti',
+ 'Edit Assembly' => 'Modifica Assemblato',
+ 'Edit Customer' => '',
+ 'Edit GIFI' => 'Modifica codice GIFI',
+ 'Edit General Ledger Transaction' => 'Modifica Transazione di Contabilit&agrave; Generale',
+ 'Edit Part' => 'Modifica Articolo',
+ 'Edit Preferences for' => 'Modifica Preferenze di',
+ 'Edit Project' => 'Modifica Progetto',
+ 'Edit Purchase Invoice' => 'Modifica Fattura di acquisto',
+ 'Edit Purchase Order' => 'Modifica Ordine di acquisto',
+ 'Edit Sales Invoice' => 'Modifica Fattura di Vendita',
+ 'Edit Sales Order' => 'Modifica Ordine di vendita',
+ 'Edit Service' => 'Modifica Servizio',
+ 'Edit Template' => 'Modifica Modello',
+ 'Edit User' => 'Modifica Utente',
+ 'Edit Vendor' => '',
+ 'Employee' => 'Dipendente',
+ 'Enforce transaction reversal for all dates' => 'Forza l\'uso delle transazioni inverse per tutte le date',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Inserisci fino a 3 valute separate da ":" (es.: EUR:USD:CAD) per la valuta locale e quelle straniere',
+ 'Equity' => 'Capitale',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate Difference' => 'Differenza sul Tasso di Cambio',
+ 'Exchangerate for payment missing!' => 'Manca il Tasso di Cambio per il pagamento!',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Existing Datasets' => 'Datasets esistenti',
+ 'Expense' => 'Uscite',
+ 'Expense Account' => 'Conto Acquisti',
+ 'Expense/Asset' => 'Acquisti/Attivit&agrave;',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'Foreign Exchange Gain' => 'Guadagno da cambio valuta',
+ 'Foreign Exchange Loss' => 'Perdita da cambio valuta',
+ 'From' => 'Dal',
+ 'GIFI' => 'Codice GIFI',
+ 'GIFI deleted!' => 'Codice GIFI cancellato!',
+ 'GIFI missing!' => 'Codice GIFI mancante!',
+ 'GIFI saved!' => 'Codice GIFI salvato!',
+ 'GL Transaction' => 'Transazione di Contabilit&agrave; generale',
+ 'General Ledger' => 'Contabilit&agrave; generale',
+ 'Goods & Services' => 'Beni e Servizi',
+ 'HTML Templates' => 'Modelli HTML',
+ 'Heading' => 'Intestazione',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Manca il nome del server',
+ 'ID' => 'ID',
+ 'Image' => 'Immagine',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Include in drop-down menus' => 'Da includere nei menu a discesa dei seguenti moduli',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Includere questo conto nei moduli fornitore/cliente per identificare il soggetto come tassabile?',
+ 'Income' => 'Entrate',
+ 'Income Account' => 'Vendite',
+ 'Income Statement' => 'Conto Economico',
+ 'Incorrect Dataset version!' => 'Versione del Dataset non corretta!',
+ 'Incorrect Password!' => 'Password sbagliata!',
+ 'Individual Items' => 'Articoli Individuali',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Conto Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantit&agrave; in inventario deve essere zero per poter mettere l\'assemblato come obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantit&agrave; in inventario deve essere zero per poter mettere l\'articolo come obsoleto!',
+ 'Inventory quantity must be zero!' => 'La quantit&agrave; in inventario deve essere zero!',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date' => 'Data Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Invoice deleted!' => 'Fattura Cancellata!',
+ 'Invoice posted!' => 'Fattura Salvata!',
+ 'Invoices' => 'Fatture',
+ 'Is this a summary account to record' => 'Conto di riferimento del modulo:',
+ 'Item deleted!' => 'Articolo Cancellato!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'LaTeX Templates' => 'Modelli LaTeX',
+ 'Language' => 'Lingua',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Last Invoice Number' => 'Ultimo Numero di Fattura',
+ 'Last Numbers & Default Accounts' => 'Ultimi numeri e Conti di Default',
+ 'Last Purchase Order Number' => 'Ultimo numero d\'ordine di acquisto',
+ 'Last Sales Order Number' => 'Ultimo numero d\'ordine di vendita',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lascia in bianco il server e la porta a meno che tu non voglia fare una connessione remota',
+ 'Liability' => 'Passivit&agrave;',
+ 'Licensed to' => 'Dato in Licenza a',
+ 'Line Total' => 'Totale Linea',
+ 'Link' => 'Collegamenti',
+ 'Link Accounts' => 'Collegamenti tra Conti',
+ 'List Accounts' => 'Lista Conti',
+ 'List GIFI' => 'Lista codici GIFI',
+ 'List Price' => 'Prezzo di Listino',
+ 'List Transactions' => 'Lista Transazioni',
+ 'Login' => 'Login',
+ 'Logout' => 'Logout',
+ 'Make' => 'Produttore',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modello',
+ 'Multibyte Encoding' => '',
+ 'N/A' => 'N/A',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Manca il Nome!',
+ 'New Templates' => 'Nuovi Modelli',
+ 'No' => 'No',
+ 'No Database Drivers available!' => 'Nessun Database Driver disponibile!',
+ 'No Dataset selected!' => 'Nessun Dataset selezionato!',
+ 'No email address for' => 'Manca l\'indirizzo e-mail per',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nothing applied!' => 'Nulla di applicato!',
+ 'Nothing selected!' => 'Non hai selezionato nulla!',
+ 'Nothing to delete!' => 'Nulla da cancellare!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number Format' => 'Formato Numerico',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'O' => 'O',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'On Hand' => 'Disponibilit&agrave;',
+ 'On Order' => 'Mandato ordine fornitore',
+ 'Open' => 'Aperto',
+ 'Oracle Database Administration' => 'Amministratore del Database Oracle',
+ 'Order' => 'Ordine',
+ 'Order Date' => 'Data dell\'ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Entry' => 'Ordini',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'Order deleted!' => 'Ordine Cancellato!',
+ 'Order saved!' => 'Ordine Salvato!',
+ 'Ordered' => 'Ricevuto ordine da cliente',
+ 'Orphaned' => 'Orfano',
+ 'Out of balance!' => 'Non conciliato!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Paid' => 'Importo Pagato',
+ 'Paid in full' => 'Pagato completamente',
+ 'Part' => 'Articolo',
+ 'Part Number missing!' => 'Manca il Codice dell\'articolo!',
+ 'Parts' => 'Articoli',
+ 'Parts Inventory' => 'Inventario degli articoli',
+ 'Password' => 'Password',
+ 'Password changed!' => 'Password cambiata!',
+ 'Payables' => 'Debiti Fornitori',
+ 'Payment' => 'Pagamento',
+ 'Payment date missing!' => 'Manca la data del pagamento!',
+ 'Payment posted!' => 'Pagamento Salvato',
+ 'Payments' => 'Pagamenti',
+ 'Pg Database Administration' => 'Amministratore del Database Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Porta',
+ 'Port missing!' => 'Manca la Porta',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Preferenze',
+ 'Preferences saved!' => 'Preferenze Salvate!',
+ 'Price' => 'Prezzo',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'Manca il codice del progetto!',
+ 'Project deleted!' => 'Progetto cancellato!',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Project saved!' => 'Progetto salvato!',
+ 'Projects' => 'Progetti',
+ 'Purchase Invoice' => 'Fattura di acquisto',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Purchase Orders' => 'Ordini di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'ROP' => 'Soglia di Riordino',
+ 'Rate' => 'Tasso',
+ 'Recd' => 'Ricevuto',
+ 'Receipt' => 'Incasso',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'Incassi',
+ 'Receivables' => 'Crediti Clienti',
+ 'Reconciliation' => 'Conciliazione',
+ 'Record in' => 'Registra in',
+ 'Reference' => 'Riferimento',
+ 'Reference missing!' => 'Manca il riferimento!',
+ 'Remaining' => 'Rimanente',
+ 'Report for' => 'Prospetto per',
+ 'Reports' => 'Prospetti',
+ 'Required by' => 'Necessario dal',
+ 'Retained Earnings' => 'Guadagni',
+ 'Sales' => 'Vendite',
+ 'Sales Invoice' => 'Fattura di vendita',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Sales Orders' => 'Ordini di vendita',
+ 'Save' => 'Salva',
+ 'Save as new' => 'Salva come nuovo',
+ 'Save to File' => 'Salva su file',
+ 'Screen' => 'Schermo',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleziona un dataset da cancellare e premi "Continua"',
+ 'Select all' => 'Seleziona tutto',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sell Price' => 'Prezzo di Vendita',
+ 'Send by E-Mail' => 'Spedisci via e-mail',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Service Items' => 'Inventario (Servizi)',
+ 'Service Number missing!' => 'Manca il codice del servizio',
+ 'Services' => 'Servizi',
+ 'Setup Templates' => 'Configurazione dei modelli',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Ship via' => 'Porto',
+ 'Short' => 'Corto',
+ 'Signature' => 'Firma',
+ 'Sold' => 'Venduto',
+ 'Source' => 'Sorgente',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Sollecito',
+ 'Statement Balance' => 'Saldo',
+ 'Statement sent to' => 'Sollecito mandato a',
+ 'Statements sent to printer!' => 'Solleciti mandati in stampa!',
+ 'Stock Assembly' => 'Magazzino Assemblati',
+ 'Stylesheet' => 'Foglio di Stile',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'System' => 'Sistema',
+ 'Tax' => 'Tassa',
+ 'Tax Accounts' => 'Conti relativi a tasse',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Tax collected' => 'Debito IVA',
+ 'Tax paid' => 'Credito IVA',
+ 'Taxable' => 'Tassabile',
+ 'Template saved!' => 'Modello salvato!',
+ 'Templates' => 'Modelli',
+ 'Terms: Net' => 'Termini: Netto',
+ 'The following Datasets are not in use and can be deleted' => 'I seguenti datasets non sono in uso e possono essere cancellati',
+ 'The following Datasets need to be updated' => 'I seguenti datasets devono essere aggiornati',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Questo &egrave; un controllo preliminare per verificare le risorse esistenti. Nulla verr&agrave; creato o cancellato in questa fase!',
+ 'To' => 'Al',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Per aggiungere un utente ad un gruppo, modifica i dati dell\'utente, cambia lo username e salva. Un nuovo utente con gli stessi dati verr&agrave; salvato con il nuovo username.',
+ 'Top Level' => 'Livello Top',
+ 'Total' => 'Totale',
+ 'Transaction Date missing!' => 'Manca la data della transazione!',
+ 'Transaction deleted!' => 'Transazione cancellata!',
+ 'Transaction posted!' => 'Transazione salvata!',
+ 'Transaction reversal enforced for all dates' => 'Uso delle transazioni inverse forzato per tutte le date',
+ 'Transaction reversal enforced up to' => 'Uso delle transazioni inverse forzato fino a',
+ 'Transactions' => 'Transazioni',
+ 'Transactions exist, cannot delete customer!' => 'Impossibile cancellare il Cliente: ci sono transazioni a suo nome!',
+ 'Transactions exist, cannot delete vendor!' => 'Impossibile cancellare il Fornitore: ci sono transazioni a suo nome!',
+ 'Transactions exist; cannot delete account!' => 'Impossibile cancellare il Conto: ci sono transazioni!',
+ 'Trial Balance' => 'Bilancio di Verifica',
+ 'Unit' => 'Unit&agrave;',
+ 'Unit of measure' => 'Unit&agrave; di misura',
+ 'Update' => 'Aggiorna',
+ 'Update Dataset' => 'Aggiorna il Dataset',
+ 'Updated' => 'Aggiornato',
+ 'Use Templates' => 'Usa Modelli',
+ 'User' => 'Utente',
+ 'User deleted!' => 'Utente cancellato!',
+ 'User saved!' => 'Utente salvato!',
+ 'Vendor' => 'Fornitore',
+ 'Vendor deleted!' => 'Fornitore cancellato!',
+ 'Vendor missing!' => 'Manca il fornitore!',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'Vendor saved!' => 'Fornitore salvato!',
+ 'Vendors' => 'Fornitori',
+ 'Version' => 'Versione',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unit&agrave; di misura',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'Year End' => 'Fine anno',
+ 'Yes' => 'Si',
+ 'You are logged out!' => 'Sei disconnesso!',
+ 'You did not enter a name!' => 'Non hai inserito il nome!',
+ 'You must enter a host and port for local and remote connections!' => 'Devi inserire un server ed una porta per le connessioni locali e remote!',
+ 'as at' => 'Al',
+ 'collected on sales' => 'incassate su vendite',
+ 'days' => 'giorni',
+ 'does not exist' => 'non esiste',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'for Period' => 'per il Periodo',
+ 'hr' => 'ore',
+ 'is already a member!' => '&egrave; gi&agrave; utente!',
+ 'is not a member!' => 'non &eacute; un utente!',
+ 'localhost' => 'localhost',
+ 'locked!' => '',
+ 'paid on purchases' => 'pagato sugli acquisti',
+ 'sent to printer' => 'mandato in stampa',
+ 'successfully created!' => 'creato!',
+ 'successfully deleted!' => 'cancellato!',
+ 'to' => 'al',
+ 'website' => 'sito web',
+};
+
+1;
diff --git a/sql-ledger/locale/it/am b/sql-ledger/locale/it/am
new file mode 100644
index 000000000..285fa5042
--- /dev/null
+++ b/sql-ledger/locale/it/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Debiti Fornitori',
+ 'AR' => 'Crediti Clienti',
+ 'Account' => 'Conto',
+ 'Account Number' => 'Numero di conto',
+ 'Account Number missing!' => 'Manca il numero di conto!',
+ 'Account Type' => 'Tipo di conto',
+ 'Account Type missing!' => 'Manca il tipo del conto!',
+ 'Account deleted!' => 'Conto cancellato!',
+ 'Account saved!' => 'Conto salvato!',
+ 'Add Account' => 'Aggiungi conto',
+ 'Add GIFI' => 'Aggiungi codice GIFI',
+ 'Address' => 'Indirizzo',
+ 'Asset' => 'Attivit&agrave;',
+ 'Audit Control' => 'Controllo accessi',
+ 'Backup sent to' => 'Backup inviato a',
+ 'Books are open' => 'I conti sono aperti',
+ 'Business Number' => 'Partita IVA',
+ 'COGS' => 'Costo dei Beni Venduti',
+ 'Cannot delete account!' => 'Non puoi cancellare il conto!',
+ 'Cannot delete default account!' => 'Non puoi cancellare il conto predefinito!',
+ 'Cannot save account!' => 'Non puoi salvare il conto!',
+ 'Cannot save preferences!' => 'Non puoi salvare le preferenze!',
+ 'Character Set' => 'Set di Caratteri',
+ 'Chart of Accounts' => 'Piano dei Conti',
+ 'Close Books up to' => 'Chiudi i conti fino a',
+ 'Company' => 'Ragione Sociale',
+ 'Continue' => 'Continua',
+ 'Copy to COA' => 'Inserisci come Conto',
+ 'Credit' => 'Avere',
+ 'Date Format' => 'Formato della data',
+ 'Debit' => 'Dare',
+ 'Delete' => 'Cancella',
+ 'Delete Account' => 'Cancella Conto',
+ 'Description' => 'Descrizione',
+ 'Dropdown Limit' => 'Limite per i menu a discesa',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Modifica',
+ 'Edit Account' => 'Modifica Conto',
+ 'Edit GIFI' => 'Modifica codice GIFI',
+ 'Edit Preferences for' => 'Modifica Preferenze di',
+ 'Edit Template' => 'Modifica Modello',
+ 'Enforce transaction reversal for all dates' => 'Forza l\'uso delle transazioni inverse per tutte le date',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Inserisci fino a 3 valute separate da ":" (es.: EUR:USD:CAD) per la valuta locale e quelle straniere',
+ 'Equity' => 'Capitale',
+ 'Expense' => 'Uscite',
+ 'Expense Account' => 'Conto Acquisti',
+ 'Expense/Asset' => 'Acquisti/Attivit&agrave;',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Guadagno da cambio valuta',
+ 'Foreign Exchange Loss' => 'Perdita da cambio valuta',
+ 'GIFI' => 'Codice GIFI',
+ 'GIFI deleted!' => 'Codice GIFI cancellato!',
+ 'GIFI missing!' => 'Codice GIFI mancante!',
+ 'GIFI saved!' => 'Codice GIFI salvato!',
+ 'Heading' => 'Intestazione',
+ 'Include in drop-down menus' => 'Da includere nei menu a discesa dei seguenti moduli',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Includere questo conto nei moduli fornitore/cliente per identificare il soggetto come tassabile?',
+ 'Income' => 'Entrate',
+ 'Income Account' => 'Vendite',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Conto Inventario',
+ 'Is this a summary account to record' => 'Conto di riferimento del modulo:',
+ 'Language' => 'Lingua',
+ 'Last Invoice Number' => 'Ultimo Numero di Fattura',
+ 'Last Numbers & Default Accounts' => 'Ultimi numeri e Conti di Default',
+ 'Last Purchase Order Number' => 'Ultimo numero d\'ordine di acquisto',
+ 'Last Sales Order Number' => 'Ultimo numero d\'ordine di vendita',
+ 'Liability' => 'Passivit&agrave;',
+ 'Link' => 'Collegamenti',
+ 'Name' => 'Nome',
+ 'No' => 'No',
+ 'No email address for' => 'Manca l\'indirizzo e-mail per',
+ 'Number' => 'Numero',
+ 'Number Format' => 'Formato Numerico',
+ 'Parts Inventory' => 'Inventario degli articoli',
+ 'Password' => 'Password',
+ 'Payables' => 'Debiti Fornitori',
+ 'Payment' => 'Pagamento',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Preferenze Salvate!',
+ 'Rate' => 'Tasso',
+ 'Receivables' => 'Crediti Clienti',
+ 'Sales' => 'Vendite',
+ 'Save' => 'Salva',
+ 'Service Items' => 'Inventario (Servizi)',
+ 'Ship via' => 'Porto',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Foglio di Stile',
+ 'Tax' => 'Tassa',
+ 'Tax Accounts' => 'Conti relativi a tasse',
+ 'Template saved!' => 'Modello salvato!',
+ 'Transaction reversal enforced for all dates' => 'Uso delle transazioni inverse forzato per tutte le date',
+ 'Transaction reversal enforced up to' => 'Uso delle transazioni inverse forzato fino a',
+ 'Transactions exist; cannot delete account!' => 'Impossibile cancellare il Conto: ci sono transazioni!',
+ 'Weight Unit' => 'Unit&agrave; di misura',
+ 'Year End' => 'Fine anno',
+ 'Yes' => 'Si',
+ 'does not exist' => 'non esiste',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'aggiungi_conto' => 'add_account',
+ 'continua' => 'continue',
+ 'inserisci_come_conto' => 'copy_to_coa',
+ 'cancella' => 'delete',
+ 'modifica' => 'edit',
+ 'modifica_conto' => 'edit_account',
+ 'salva' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ap b/sql-ledger/locale/it/ap
new file mode 100644
index 000000000..3b57b5cdd
--- /dev/null
+++ b/sql-ledger/locale/it/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transazione Fornitore',
+ 'AP Transactions' => 'Transazioni Fornitori',
+ 'Account' => 'Conto',
+ 'Add Accounts Payables Transaction' => 'Aggiungi Transazione Fornitori',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Amount Due' => 'Importo Dovuto',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Transaction' => 'Sei sicuro di voler cancellare la Transazione',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Non puoi cancellare la transazione',
+ 'Cannot post payment for a closed period!' => 'Non puoi salvare pagamenti per un periodo chiuso!',
+ 'Cannot post transaction for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post transaction!' => 'Non puoi salvare la transazione!',
+ 'Closed' => 'Chiuso',
+ 'Confirm!' => 'Conferma!',
+ 'Continue' => 'Continua',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data di pagamento',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Description' => 'Descrizione',
+ 'Due Date' => 'Scadenza Fattura',
+ 'Due Date missing!' => 'Data di Scadenza mancante!',
+ 'Edit Accounts Payables Transaction' => 'Modifica Transazione Fornitori',
+ 'Employee' => 'Dipendente',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate for payment missing!' => 'Manca il Tasso di Cambio per il pagamento!',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date' => 'Data Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Open' => 'Aperto',
+ 'Order' => 'Ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Paid' => 'Importo Pagato',
+ 'Payment date missing!' => 'Manca la data del pagamento!',
+ 'Payments' => 'Pagamenti',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Invoice' => 'Fattura di acquisto',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Source' => 'Sorgente',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Total' => 'Totale',
+ 'Transaction deleted!' => 'Transazione cancellata!',
+ 'Transaction posted!' => 'Transazione salvata!',
+ 'Update' => 'Aggiorna',
+ 'Vendor' => 'Fornitore',
+ 'Vendor missing!' => 'Manca il fornitore!',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'Yes' => 'Si',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transazione_fornitore' => 'ap_transaction',
+ 'aggiungi_transazione_fornitori' => 'add_accounts_payables_transaction',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'modifica_transazione_fornitori' => 'edit_accounts_payables_transaction',
+ 'salva' => 'post',
+ 'salva_come_nuovo' => 'post_as_new',
+ 'fattura_di_acquisto' => 'purchase_invoice',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ar b/sql-ledger/locale/it/ar
new file mode 100644
index 000000000..301d421bf
--- /dev/null
+++ b/sql-ledger/locale/it/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Transazione Cliente',
+ 'AR Transactions' => 'Transazioni Clienti',
+ 'Account' => 'Conto',
+ 'Add Accounts Receivables Transaction' => 'Aggiungi Transazione Clienti',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Amount Due' => 'Importo Dovuto',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Transaction' => 'Sei sicuro di voler cancellare la Transazione',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Non puoi cancellare la transazione',
+ 'Cannot post payment for a closed period!' => 'Non puoi salvare pagamenti per un periodo chiuso!',
+ 'Cannot post transaction for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post transaction!' => 'Non puoi salvare la transazione!',
+ 'Closed' => 'Chiuso',
+ 'Confirm!' => 'Conferma!',
+ 'Continue' => 'Continua',
+ 'Credit Limit' => 'Fido',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente mancante!',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data di pagamento',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Description' => 'Descrizione',
+ 'Due Date' => 'Scadenza Fattura',
+ 'Due Date missing!' => 'Data di Scadenza mancante!',
+ 'Edit Accounts Receivables Transaction' => 'Modifica Transazione Clienti',
+ 'Employee' => 'Dipendente',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate for payment missing!' => 'Manca il Tasso di Cambio per il pagamento!',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date' => 'Data Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Open' => 'Aperto',
+ 'Order' => 'Ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Paid' => 'Importo Pagato',
+ 'Payment date missing!' => 'Manca la data del pagamento!',
+ 'Payments' => 'Pagamenti',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Remaining' => 'Rimanente',
+ 'Sales Invoice' => 'Fattura di vendita',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Source' => 'Sorgente',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Total' => 'Totale',
+ 'Transaction deleted!' => 'Transazione cancellata!',
+ 'Transaction posted!' => 'Transazione salvata!',
+ 'Update' => 'Aggiorna',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'Yes' => 'Si',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transazione_cliente' => 'ar_transaction',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'salva' => 'post',
+ 'salva_come_nuovo' => 'post_as_new',
+ 'fattura_di_vendita' => 'sales_invoice',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/arap b/sql-ledger/locale/it/arap
new file mode 100644
index 000000000..57651a9b0
--- /dev/null
+++ b/sql-ledger/locale/it/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Indirizzo',
+ 'Continue' => 'Continua',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Description' => 'Descrizione',
+ 'Number' => 'Numero',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continua' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ca b/sql-ledger/locale/it/ca
new file mode 100644
index 000000000..1fdc01d3a
--- /dev/null
+++ b/sql-ledger/locale/it/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Conto',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Saldo',
+ 'Chart of Accounts' => 'Piano dei Conti',
+ 'Credit' => 'Avere',
+ 'Date' => 'Data',
+ 'Debit' => 'Dare',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Description' => 'Descrizione',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'GIFI' => 'Codice GIFI',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'List Transactions' => 'Lista Transazioni',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Reference' => 'Riferimento',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Subtotal' => 'Totale Parziale',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'lista_transazioni' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/it/cp b/sql-ledger/locale/it/cp
new file mode 100644
index 000000000..3dacb5fd9
--- /dev/null
+++ b/sql-ledger/locale/it/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Conto',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Amount does not equal applied!' => 'L\'importo non &egrave; uguale a quanto applicato alle diverse fatture!',
+ 'Amount missing!' => 'Manca l\'importo',
+ 'Applied' => 'Applicato a',
+ 'Cannot post payment!' => 'Non puoi salvare il pagamento!',
+ 'Cannot process payment for a closed period!' => 'Non puoi processare un pagamento per un periodo chiuso!',
+ 'Check' => 'Assegno',
+ 'Check printed!' => 'Assegno stampato!',
+ 'Check printing failed!' => 'Stampa dell\'assegno fallita!',
+ 'Continue' => 'Continua',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Manca la data!',
+ 'Description' => 'Descrizione',
+ 'Due' => 'Dovuto',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'From' => 'Dal',
+ 'Invoice' => 'Fattura',
+ 'Invoices' => 'Fatture',
+ 'Nothing applied!' => 'Nulla di applicato!',
+ 'Number' => 'Numero',
+ 'Paid in full' => 'Pagato completamente',
+ 'Payment' => 'Pagamento',
+ 'Payment posted!' => 'Pagamento Salvato',
+ 'Post' => 'Salva',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Receipt' => 'Incasso',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'Riferimento',
+ 'Screen' => 'Schermo',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Update' => 'Aggiorna',
+ 'Vendor' => 'Fornitore',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continua' => 'continue',
+ 'salva' => 'post',
+ 'stampa' => 'print',
+ 'aggiorna' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ct b/sql-ledger/locale/it/ct
new file mode 100644
index 000000000..12bfa6e3e
--- /dev/null
+++ b/sql-ledger/locale/it/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Aggiungi',
+ 'Address' => 'Indirizzo',
+ 'All' => 'Tutti',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Non puoi cancellare il cliente!',
+ 'Cannot delete vendor!' => 'Non puoi cancellare il fornitore',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Credit Limit' => 'Fido',
+ 'Customer deleted!' => 'Cliente cancellato!',
+ 'Customer saved!' => 'Cliente salvato!',
+ 'Customers' => 'Clienti',
+ 'Delete' => 'Cancella',
+ 'Discount' => 'Sconto',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Edit Customer',
+ 'Edit Vendor' => 'Edit Vendor',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Invoice' => 'Fattura',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Manca il Nome!',
+ 'Notes' => 'Note',
+ 'Number' => 'Numero',
+ 'Order' => 'Ordine',
+ 'Orphaned' => 'Orfano',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Salva',
+ 'Ship to' => 'Spedire a',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Taxable' => 'Tassabile',
+ 'Terms: Net' => 'Termini: Netto',
+ 'Transactions exist, cannot delete customer!' => 'Impossibile cancellare il Cliente: ci sono transazioni a suo nome!',
+ 'Transactions exist, cannot delete vendor!' => 'Impossibile cancellare il Fornitore: ci sono transazioni a suo nome!',
+ 'Vendor deleted!' => 'Fornitore cancellato!',
+ 'Vendor saved!' => 'Fornitore salvato!',
+ 'Vendors' => 'Fornitori',
+ 'days' => 'giorni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'aggiungi' => 'add',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'fattura' => 'invoice',
+ 'ordine' => 'order',
+ 'salva' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/it/gl b/sql-ledger/locale/it/gl
new file mode 100644
index 000000000..087fb3eed
--- /dev/null
+++ b/sql-ledger/locale/it/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transazione Fornitore',
+ 'AR Transaction' => 'Transazione Cliente',
+ 'Account' => 'Conto',
+ 'Add General Ledger Transaction' => 'Aggiungi Transazione di Contabilità Generale',
+ 'Address' => 'Indirizzo',
+ 'All' => 'Tutti',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Transaction' => 'Sei sicuro di voler cancellare la Transazione',
+ 'Asset' => 'Attivit&agrave;',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Saldo',
+ 'Cannot delete transaction!' => 'Non puoi cancellare la transazione',
+ 'Cannot have a value in both Debit and Credit!' => 'Non pu&ograve; esserci un valore sia in Dare che in Avere!',
+ 'Cannot post a transaction without a value!' => 'Non puoi salvare una transazione senza un valore!',
+ 'Cannot post transaction for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Confirm!' => 'Conferma!',
+ 'Continue' => 'Continua',
+ 'Credit' => 'Avere',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Debit' => 'Dare',
+ 'Debit and credit out of balance!' => 'Dare e Avere non concordano!.',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Description' => 'Descrizione',
+ 'Edit General Ledger Transaction' => 'Modifica Transazione di Contabilit&agrave; Generale',
+ 'Equity' => 'Capitale',
+ 'Expense' => 'Uscite',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'GIFI' => 'Codice GIFI',
+ 'GL Transaction' => 'Transazione di Contabilit&agrave; generale',
+ 'General Ledger' => 'Contabilit&agrave; generale',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Income' => 'Entrate',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Liability' => 'Passivit&agrave;',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Invoice' => 'Fattura di acquisto',
+ 'Reference' => 'Riferimento',
+ 'Reference missing!' => 'Manca il riferimento!',
+ 'Reports' => 'Prospetti',
+ 'Sales Invoice' => 'Fattura di vendita',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Source' => 'Sorgente',
+ 'Subtotal' => 'Totale Parziale',
+ 'Transaction Date missing!' => 'Manca la data della transazione!',
+ 'Transaction deleted!' => 'Transazione cancellata!',
+ 'Transaction posted!' => 'Transazione salvata!',
+ 'Update' => 'Aggiorna',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'Yes' => 'Si',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transazione_fornitore' => 'ap_transaction',
+ 'transazione_cliente' => 'ar_transaction',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'transazione_di_contabilit&agrave;_generale' => 'gl_transaction',
+ 'salva' => 'post',
+ 'salva_come_nuovo' => 'post_as_new',
+ 'fattura_di_acquisto' => 'purchase_invoice',
+ 'fattura_di_vendita' => 'sales_invoice',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ic b/sql-ledger/locale/it/ic
new file mode 100644
index 000000000..2f0dc9569
--- /dev/null
+++ b/sql-ledger/locale/it/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Attivo',
+ 'Add' => 'Aggiungi',
+ 'Add Assembly' => 'Aggiungi Assemblato',
+ 'Add Part' => 'Aggiungi Articolo',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Add Service' => 'Aggiungi Servizio',
+ 'Address' => 'Indirizzo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Assemblies' => 'Assemblati',
+ 'Assemblies restocked!' => 'Assemblati ricaricati!',
+ 'Assembly Number missing!' => 'Manca il codice dell\'assemblato',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'Bought' => 'Comprato',
+ 'COGS' => 'Costo dei Beni Venduti',
+ 'Cannot delete item already invoiced!' => 'Non puoi cancellare un articolo gi&agrave; fatturato!',
+ 'Cannot delete item on order!' => 'Non puoi cancellare un articolo ordinato!',
+ 'Cannot delete item which is part of an assembly!' => 'Non puoi cancellare un articolo che fa parte di un assemblato!',
+ 'Cannot delete item!' => 'Non puoi cancellare l\'articolo',
+ 'Cannot stock assemblies!' => 'Non puoi caricare gli assemblati!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'Drawing' => 'Disegno',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit Assembly' => 'Modifica Assemblato',
+ 'Edit Part' => 'Modifica Articolo',
+ 'Edit Service' => 'Modifica Servizio',
+ 'Expense' => 'Uscite',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'Image' => 'Immagine',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Income' => 'Entrate',
+ 'Individual Items' => 'Articoli Individuali',
+ 'Inventory' => 'Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La quantit&agrave; in inventario deve essere zero per poter mettere l\'assemblato come obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La quantit&agrave; in inventario deve essere zero per poter mettere l\'articolo come obsoleto!',
+ 'Inventory quantity must be zero!' => 'La quantit&agrave; in inventario deve essere zero!',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Item deleted!' => 'Articolo Cancellato!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Line Total' => 'Totale Linea',
+ 'Link Accounts' => 'Collegamenti tra Conti',
+ 'List Price' => 'Prezzo di Listino',
+ 'Make' => 'Produttore',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modello',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'On Hand' => 'Disponibilit&agrave;',
+ 'On Order' => 'Mandato ordine fornitore',
+ 'Order' => 'Ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'Ordered' => 'Ricevuto ordine da cliente',
+ 'Orphaned' => 'Orfano',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Part Number missing!' => 'Manca il Codice dell\'articolo!',
+ 'Parts' => 'Articoli',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'ROP' => 'Soglia di Riordino',
+ 'Recd' => 'Ricevuto',
+ 'Required by' => 'Necessario dal',
+ 'Sales' => 'Vendite',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Save' => 'Salva',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sell Price' => 'Prezzo di Vendita',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Service Number missing!' => 'Manca il codice del servizio',
+ 'Services' => 'Servizi',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Short' => 'Corto',
+ 'Sold' => 'Venduto',
+ 'Stock Assembly' => 'Magazzino Assemblati',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'To' => 'Al',
+ 'Top Level' => 'Livello Top',
+ 'Total' => 'Totale',
+ 'Unit' => 'Unit&agrave;',
+ 'Unit of measure' => 'Unit&agrave; di misura',
+ 'Update' => 'Aggiorna',
+ 'Updated' => 'Aggiornato',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'hr' => 'ore',
+ 'sent to printer' => 'mandato in stampa',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'aggiungi' => 'add',
+ 'aggiungi_assemblato' => 'add_assembly',
+ 'aggiungi_articolo' => 'add_part',
+ 'aggiungi_servizio' => 'add_service',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'modifica_assemblato' => 'edit_assembly',
+ 'modifica_articolo' => 'edit_part',
+ 'modifica_servizio' => 'edit_service',
+ 'salva' => 'save',
+ 'aggiorna' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/it/io b/sql-ledger/locale/it/io
new file mode 100644
index 000000000..29149450e
--- /dev/null
+++ b/sql-ledger/locale/it/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Address' => 'Indirizzo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Order' => 'Ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'Recd' => 'Ricevuto',
+ 'Required by' => 'Necessario dal',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Subject' => 'Oggetto',
+ 'To' => 'Al',
+ 'Unit' => 'Unit&agrave;',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'sent to printer' => 'mandato in stampa',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continua' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/it/ir b/sql-ledger/locale/it/ir
new file mode 100644
index 000000000..242142e1e
--- /dev/null
+++ b/sql-ledger/locale/it/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Conto',
+ 'Add Purchase Invoice' => 'Aggiungi Fattura di acquisto',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Invoice Number' => 'Sei sicuro di voler cancellare la Fattura numero',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'Cannot delete invoice!' => 'Non puoi cancellare la fattura!',
+ 'Cannot post invoice for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post invoice!' => 'Non puoi salvare la fattura!',
+ 'Cannot post payment for a closed period!' => 'Non puoi salvare pagamenti per un periodo chiuso!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Conferma!',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data di Scadenza',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit Purchase Invoice' => 'Modifica Fattura di acquisto',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate for payment missing!' => 'Manca il Tasso di Cambio per il pagamento!',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date' => 'Data Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Invoice deleted!' => 'Fattura Cancellata!',
+ 'Invoice posted!' => 'Fattura Salvata!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Order' => 'Ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Payment date missing!' => 'Manca la data del pagamento!',
+ 'Payments' => 'Pagamenti',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'Recd' => 'Ricevuto',
+ 'Record in' => 'Registra in',
+ 'Required by' => 'Necessario dal',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Source' => 'Sorgente',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax Included' => 'Tasse Incluse',
+ 'To' => 'Al',
+ 'Total' => 'Totale',
+ 'Unit' => 'Unit&agrave;',
+ 'Update' => 'Aggiorna',
+ 'Vendor' => 'Fornitore',
+ 'Vendor missing!' => 'Manca il fornitore!',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'Yes' => 'Si',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'sent to printer' => 'mandato in stampa',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'ordine' => 'order',
+ 'salva' => 'post',
+ 'salva_come_nuovo' => 'post_as_new',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/is b/sql-ledger/locale/it/is
new file mode 100644
index 000000000..beb959384
--- /dev/null
+++ b/sql-ledger/locale/it/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Conto',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Invoice' => 'Aggiungi Fattura di vendita',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Invoice Number' => 'Sei sicuro di voler cancellare la Fattura numero',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'Cannot delete invoice!' => 'Non puoi cancellare la fattura!',
+ 'Cannot post invoice for a closed period!' => 'Non puoi salvare una transazione per un periodo chiuso!',
+ 'Cannot post invoice!' => 'Non puoi salvare la fattura!',
+ 'Cannot post payment for a closed period!' => 'Non puoi salvare pagamenti per un periodo chiuso!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Conferma!',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Credit Limit' => 'Fido',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente mancante!',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data di Scadenza',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit Sales Invoice' => 'Modifica Fattura di Vendita',
+ 'Exch' => 'Cambio',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate for payment missing!' => 'Manca il Tasso di Cambio per il pagamento!',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date' => 'Data Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number' => 'Fattura Numero',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Invoice deleted!' => 'Fattura Cancellata!',
+ 'Invoice posted!' => 'Fattura Salvata!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Order' => 'Ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Payment date missing!' => 'Manca la data del pagamento!',
+ 'Payments' => 'Pagamenti',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Salva',
+ 'Post as new' => 'Salva come nuovo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'Recd' => 'Ricevuto',
+ 'Record in' => 'Registra in',
+ 'Remaining' => 'Rimanente',
+ 'Required by' => 'Necessario dal',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Ship via' => 'Porto',
+ 'Source' => 'Sorgente',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax Included' => 'Tasse Incluse',
+ 'To' => 'Al',
+ 'Total' => 'Totale',
+ 'Unit' => 'Unit&agrave;',
+ 'Update' => 'Aggiorna',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'Yes' => 'Si',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'sent to printer' => 'mandato in stampa',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'ordine' => 'order',
+ 'salva' => 'post',
+ 'salva_come_nuovo' => 'post_as_new',
+ 'stampa' => 'print',
+ 'spedire_a' => 'ship_to',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/login b/sql-ledger/locale/it/login
new file mode 100644
index 000000000..aaca32d27
--- /dev/null
+++ b/sql-ledger/locale/it/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Informazioni',
+ 'Database Host' => 'Server',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => 'Versione del Dataset non corretta!',
+ 'Incorrect Password!' => 'Password sbagliata!',
+ 'Licensed to' => 'Dato in Licenza a',
+ 'Login' => 'Login',
+ 'Name' => 'Nome',
+ 'Password' => 'Password',
+ 'User' => 'Utente',
+ 'Version' => 'Versione',
+ 'You are logged out!' => 'Sei disconnesso!',
+ 'You did not enter a name!' => 'Non hai inserito il nome!',
+ 'is not a member!' => 'non &eacute; un utente!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/it/menu b/sql-ledger/locale/it/menu
new file mode 100644
index 000000000..58ed36a1b
--- /dev/null
+++ b/sql-ledger/locale/it/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Debiti Fornitori',
+ 'AP Aging' => 'Partite Aperte',
+ 'AR' => 'Crediti Clienti',
+ 'AR Aging' => 'Partite Aperte',
+ 'Accounting Menu' => 'Menu Contabilit&agrave;',
+ 'Add Account' => 'Aggiungi conto',
+ 'Add Assembly' => 'Aggiungi Assemblato',
+ 'Add Customer' => 'Aggiungi Cliente',
+ 'Add GIFI' => 'Aggiungi codice GIFI',
+ 'Add Part' => 'Aggiungi Articolo',
+ 'Add Project' => 'Aggiungi Progetto',
+ 'Add Service' => 'Aggiungi Servizio',
+ 'Add Transaction' => 'Aggiungi Transazione',
+ 'Add Vendor' => 'Aggiungi Fornitore',
+ 'Assemblies' => 'Assemblati',
+ 'Audit Control' => 'Controllo accessi',
+ 'Backup' => 'Backup',
+ 'Balance Sheet' => 'Stato Patrimoniale',
+ 'Cash' => 'Cassa',
+ 'Chart of Accounts' => 'Piano dei Conti',
+ 'Check' => 'Assegno',
+ 'Customers' => 'Clienti',
+ 'General Ledger' => 'Contabilit&agrave; generale',
+ 'Goods & Services' => 'Beni e Servizi',
+ 'HTML Templates' => 'Modelli HTML',
+ 'Income Statement' => 'Conto Economico',
+ 'Invoice' => 'Fattura',
+ 'LaTeX Templates' => 'Modelli LaTeX',
+ 'List Accounts' => 'Lista Conti',
+ 'List GIFI' => 'Lista codici GIFI',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Ordini',
+ 'Packing List' => 'Lista Etichette',
+ 'Parts' => 'Articoli',
+ 'Payment' => 'Pagamento',
+ 'Payments' => 'Pagamenti',
+ 'Preferences' => 'Preferenze',
+ 'Projects' => 'Progetti',
+ 'Purchase Invoice' => 'Fattura di acquisto',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Purchase Orders' => 'Ordini di acquisto',
+ 'Receipt' => 'Incasso',
+ 'Receipts' => 'Incassi',
+ 'Reconciliation' => 'Conciliazione',
+ 'Reports' => 'Prospetti',
+ 'Sales Invoice' => 'Fattura di vendita',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Sales Orders' => 'Ordini di vendita',
+ 'Save to File' => 'Salva su file',
+ 'Send by E-Mail' => 'Spedisci via e-mail',
+ 'Services' => 'Servizi',
+ 'Statement' => 'Sollecito',
+ 'Stock Assembly' => 'Magazzino Assemblati',
+ 'Stylesheet' => 'Foglio di Stile',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Debito IVA',
+ 'Tax paid' => 'Credito IVA',
+ 'Transactions' => 'Transazioni',
+ 'Trial Balance' => 'Bilancio di Verifica',
+ 'Vendors' => 'Fornitori',
+ 'Version' => 'Versione',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/it/oe b/sql-ledger/locale/it/oe
new file mode 100644
index 000000000..b14d61b8d
--- /dev/null
+++ b/sql-ledger/locale/it/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Aggiungi',
+ 'Add Purchase Invoice' => 'Aggiungi Fattura di acquisto',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Invoice' => 'Aggiungi Fattura di vendita',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Order Number' => 'Sei sicuro di voler cancellare l\'ordine numero',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Non puoi cancellare l\'ordine',
+ 'Cannot save order!' => 'Non puoi salvare l\'ordine!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Chiuso',
+ 'Confirm!' => 'Conferma!',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Credit Limit' => 'Fido',
+ 'Curr' => 'Valuta',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente mancante!',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit Purchase Order' => 'Modifica Ordine di acquisto',
+ 'Edit Sales Order' => 'Modifica Ordine di vendita',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Numero',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'O' => 'O',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Open' => 'Aperto',
+ 'Order' => 'Ordine',
+ 'Order Date' => 'Data dell\'ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'Order deleted!' => 'Ordine Cancellato!',
+ 'Order saved!' => 'Ordine Salvato!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Purchase Orders' => 'Ordini di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'Recd' => 'Ricevuto',
+ 'Remaining' => 'Rimanente',
+ 'Required by' => 'Necessario dal',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Sales Orders' => 'Ordini di vendita',
+ 'Save' => 'Salva',
+ 'Save as new' => 'Salva come nuovo',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Ship via' => 'Porto',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Terms: Net' => 'Termini: Netto',
+ 'To' => 'Al',
+ 'Total' => 'Totale',
+ 'Unit' => 'Unit&agrave;',
+ 'Update' => 'Aggiorna',
+ 'Vendor' => 'Fornitore',
+ 'Vendor missing!' => 'Manca il fornitore!',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'Yes' => 'Si',
+ 'days' => 'giorni',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'sent to printer' => 'mandato in stampa',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'aggiungi' => 'add',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'fattura' => 'invoice',
+ 'stampa' => 'print',
+ 'salva' => 'save',
+ 'salva_come_nuovo' => 'save_as_new',
+ 'spedire_a' => 'ship_to',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/pe b/sql-ledger/locale/it/pe
new file mode 100644
index 000000000..c37877bb0
--- /dev/null
+++ b/sql-ledger/locale/it/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Aggiungi',
+ 'Add Project' => 'Aggiungi Progetto',
+ 'All' => 'Tutti',
+ 'Continue' => 'Continua',
+ 'Delete' => 'Cancella',
+ 'Description' => 'Descrizione',
+ 'Edit Project' => 'Modifica Progetto',
+ 'Number' => 'Numero',
+ 'Orphaned' => 'Orfano',
+ 'Project' => 'Progetto',
+ 'Project Number missing!' => 'Manca il codice del progetto!',
+ 'Project deleted!' => 'Progetto cancellato!',
+ 'Project saved!' => 'Progetto salvato!',
+ 'Projects' => 'Progetti',
+ 'Save' => 'Salva',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'aggiungi' => 'add',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'salva' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/it/qe b/sql-ledger/locale/it/qe
new file mode 100644
index 000000000..67da640b4
--- /dev/null
+++ b/sql-ledger/locale/it/qe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Aggiungi',
+ 'Add Purchase Invoice' => 'Aggiungi Fattura di acquisto',
+ 'Add Purchase Order' => 'Aggiungi Ordine di acquisto',
+ 'Add Sales Invoice' => 'Aggiungi Fattura di vendita',
+ 'Add Sales Order' => 'Aggiungi Ordine di vendita',
+ 'Address' => 'Indirizzo',
+ 'Amount' => 'Importo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Are you sure you want to delete Order Number' => 'Sei sicuro di volre cancellare l\'ordine numero',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Codice BIN',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Non puoi cancellare l\'ordine',
+ 'Cannot save order!' => 'Non puoi salvare l\'ordine!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Chiuso',
+ 'Confirm!' => 'Conferma!',
+ 'Contact' => 'Contatto',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Credit Limit' => 'Fido',
+ 'Curr' => 'Valuta',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Cliente mancante!',
+ 'Customer not on file!' => 'Cliente non sul file!',
+ 'Date' => 'Data',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Delete' => 'Cancella',
+ 'Delivery Date' => 'Data di spedizione',
+ 'Description' => 'Descrizione',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Indirizzo e-mail mancante!',
+ 'Edit Purchase Order' => 'Modifica Ordine di acquisto',
+ 'Edit Sales Order' => 'Modifica Ordine di vendita',
+ 'Exchangerate' => 'Tasso di Cambio',
+ 'Exchangerate missing!' => 'Manca il Tasso di Cambio!',
+ 'Extended' => 'Esteso',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Invoice' => 'Fattura',
+ 'Invoice Date missing!' => 'Manca la data della Fattura!',
+ 'Invoice Number missing!' => 'Manca il numero della Fattura!',
+ 'Item not on file!' => 'Articolo non in archivio!',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Note',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Number' => 'Partita IVA',
+ 'Number missing in Row' => 'Manca il codice nella riga',
+ 'O' => 'O',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'Open' => 'Aperto',
+ 'Order' => 'Ordine',
+ 'Order Date' => 'Data dell\'ordine',
+ 'Order Date missing!' => 'Manca la data dell\'ordine',
+ 'Order Number' => 'Ordine Numero',
+ 'Order Number missing!' => 'Manca il numero dell\'ordine!',
+ 'Order deleted!' => 'Ordine Cancellato!',
+ 'Order saved!' => 'Ordine Salvato!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista Etichette',
+ 'Packing List Date missing!' => 'Manca la data della Packing List!',
+ 'Packing List Number missing!' => 'Manca il codice della Packing List!',
+ 'Part' => 'Articolo',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prezzo',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project' => 'Progetto',
+ 'Project not on file!' => 'Progetto non archiviato!',
+ 'Purchase Order' => 'Ordine di acquisto',
+ 'Purchase Orders' => 'Ordini di acquisto',
+ 'Qty' => 'Q.t&agrave;',
+ 'Recd' => 'Ricevuto',
+ 'Remaining' => 'Rimanente',
+ 'Required by' => 'Necessario dal',
+ 'Sales Order' => 'Ordine di vendita',
+ 'Sales Orders' => 'Ordini di vendita',
+ 'Save' => 'Salva',
+ 'Save as new' => 'Salva come nuovo',
+ 'Screen' => 'Schermo',
+ 'Select from one of the items below' => 'Seleziona uno dei seguenti Articoli',
+ 'Select from one of the names below' => 'Seleziona uno dei seguenti nomi',
+ 'Select from one of the projects below' => 'Seleziona uno dei seguenti progetti',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Service' => 'Servizio',
+ 'Ship' => 'Invio',
+ 'Ship to' => 'Spedire a',
+ 'Ship via' => 'Porto',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'Tax Included' => 'Tasse Incluse',
+ 'Terms: Net' => 'Termini: Netto',
+ 'To' => 'Al',
+ 'Total' => 'Totale',
+ 'Unit' => 'Unit&agrave;',
+ 'Update' => 'Aggiorna',
+ 'Vendor' => 'Fornitore',
+ 'Vendor missing!' => 'Manca il fornitore!',
+ 'Vendor not on file!' => 'Fornitore non in archivio!',
+ 'What type of item is this?' => 'Che tipo di Articolo &egrave; questo?',
+ 'Yes' => 'Si',
+ 'days' => 'giorni',
+ 'ea' => 'ci',
+ 'emailed to' => 'Mandato via e-mail a',
+ 'sent to printer' => 'mandato in stampa',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'aggiungi' => 'add',
+ 'continua' => 'continue',
+ 'cancella' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'fattura' => 'invoice',
+ 'stampa' => 'print',
+ 'salva' => 'save',
+ 'salva_come_nuovo' => 'save_as_new',
+ 'spedire_a' => 'ship_to',
+ 'aggiorna' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/it/rc b/sql-ledger/locale/it/rc
new file mode 100644
index 000000000..48aa805c0
--- /dev/null
+++ b/sql-ledger/locale/it/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Conto',
+ 'Balance' => 'Saldo',
+ 'Cleared Balance' => 'Saldo gi&agrave; Conciliato',
+ 'Continue' => 'Continua',
+ 'Date' => 'Data',
+ 'Deposit' => 'Deposito',
+ 'Description' => 'Descrizione',
+ 'Difference' => 'Differenza',
+ 'Done' => 'Fatto',
+ 'Exchangerate Difference' => 'Differenza sul Tasso di Cambio',
+ 'From' => 'Dal',
+ 'Out of balance!' => 'Non conciliato!',
+ 'Payment' => 'Pagamento',
+ 'Reconciliation' => 'Conciliazione',
+ 'Select all' => 'Seleziona tutto',
+ 'Source' => 'Sorgente',
+ 'Statement Balance' => 'Saldo',
+ 'Update' => 'Aggiorna',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continua' => 'continue',
+ 'fatto' => 'done',
+ 'seleziona_tutto' => 'select_all',
+ 'aggiorna' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/it/rp b/sql-ledger/locale/it/rp
new file mode 100644
index 000000000..3a8c51a0c
--- /dev/null
+++ b/sql-ledger/locale/it/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Partite Aperte',
+ 'AR Aging' => 'Partite Aperte',
+ 'Account' => 'Conto',
+ 'Accounts' => 'Conti',
+ 'Amount' => 'Importo',
+ 'Apr' => 'Apr',
+ 'April' => 'Aprile',
+ 'Attachment' => 'Allegato',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Saldo',
+ 'Balance Sheet' => 'Stato Patrimoniale',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Basato sulla cassa',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Confronta con',
+ 'Continue' => 'Continua',
+ 'Copies' => 'Copie',
+ 'Credit' => 'Avere',
+ 'Current' => 'Corrente',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Data',
+ 'Debit' => 'Dare',
+ 'Dec' => 'Dic',
+ 'December' => 'Dicembre',
+ 'Decimalplaces' => 'Numero di decimali',
+ 'Department' => 'Department',
+ 'Description' => 'Descrizione',
+ 'Due' => 'Dovuto',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Manda il sollecito via e-mail a',
+ 'Feb' => 'Feb',
+ 'February' => 'Febbraio',
+ 'From' => 'Dal',
+ 'GIFI' => 'Codice GIFI',
+ 'Heading' => 'Intestazione',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Includi nel Prospetto',
+ 'Income Statement' => 'Conto Economico',
+ 'Invoice' => 'Fattura',
+ 'Jan' => 'Gen',
+ 'January' => 'Gennaio',
+ 'Jul' => 'Lug',
+ 'July' => 'Luglio',
+ 'Jun' => 'Giu',
+ 'June' => 'Giugno',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'Mag',
+ 'May ' => 'Mag ',
+ 'Message' => 'Messaggio',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Non hai selezionato nulla!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembre',
+ 'Oct' => 'Ott',
+ 'October' => 'Ottobre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagamenti',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Stampa',
+ 'Printer' => 'Stampante',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'Incassi',
+ 'Report for' => 'Prospetto per',
+ 'Retained Earnings' => 'Guadagni',
+ 'Screen' => 'Schermo',
+ 'Select all' => 'Seleziona tutto',
+ 'Select postscript or PDF!' => 'Scegli tra postscript e PDF!',
+ 'Sep' => 'Set',
+ 'September' => 'Settembre',
+ 'Source' => 'Sorgente',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Sollecito',
+ 'Statement sent to' => 'Sollecito mandato a',
+ 'Statements sent to printer!' => 'Solleciti mandati in stampa!',
+ 'Subject' => 'Oggetto',
+ 'Subtotal' => 'Totale Parziale',
+ 'Tax' => 'Tassa',
+ 'Tax collected' => 'Debito IVA',
+ 'Tax paid' => 'Credito IVA',
+ 'Total' => 'Totale',
+ 'Trial Balance' => 'Bilancio di Verifica',
+ 'Vendor' => 'Fornitore',
+ 'as at' => 'Al',
+ 'collected on sales' => 'incassate su vendite',
+ 'for Period' => 'per il Periodo',
+ 'paid on purchases' => 'pagato sugli acquisti',
+ 'to' => 'al',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continua' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'stampa' => 'print',
+ 'seleziona_tutto' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/COPYING b/sql-ledger/locale/lt/COPYING
new file mode 100644
index 000000000..763715bfe
--- /dev/null
+++ b/sql-ledger/locale/lt/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# Lithuanian texts:
+#
+# Author:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/lt/LANGUAGE b/sql-ledger/locale/lt/LANGUAGE
new file mode 100644
index 000000000..dc243c561
--- /dev/null
+++ b/sql-ledger/locale/lt/LANGUAGE
@@ -0,0 +1 @@
+Lithuanian
diff --git a/sql-ledger/locale/lt/admin b/sql-ledger/locale/lt/admin
new file mode 100644
index 000000000..83cfc84db
--- /dev/null
+++ b/sql-ledger/locale/lt/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Priëjimo kontrolë',
+ 'Accounting' => 'Apskaita',
+ 'Add User' => 'Pridëti Vartotojà',
+ 'Address' => 'Adresas',
+ 'Administration' => 'Administracija',
+ 'Administrator' => 'Administratorius',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Change Admin Password' => 'Pakeisti Administratoriaus slaptaþodá',
+ 'Change Password' => 'Pakeisti slaptaþodá',
+ 'Character Set' => 'Simboliø aibë',
+ 'Click on login name to edit!' => 'Paspauskit prisijungimo vardà redagavimui!',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Prisijungti prie',
+ 'Continue' => 'Tæsti',
+ 'Create Chart of Accounts' => 'Sukûrti sàskaitø planà',
+ 'Create Dataset' => 'Sukûrti duomenø aibæ',
+ 'DBI not installed!' => 'DBI ne instaliuotas!',
+ 'Database' => 'Duomenø bazë',
+ 'Database Administration' => 'Duomenø bazës administravimas',
+ 'Database Driver not checked!' => 'Duomenø bazës tvarkiklë nepatikrinta!',
+ 'Database User missing!' => 'Duomenø bazës vartotojo nëra!',
+ 'Dataset' => 'Duomenø aibë',
+ 'Dataset missing!' => 'Duomenø aibës nëra!',
+ 'Dataset updated!' => 'Duomenø aibë atnaujinta!',
+ 'Date Format' => 'Datos Formatas',
+ 'Delete' => 'Iðtrinti',
+ 'Delete Dataset' => 'Iðtrinti Duomenø aibë',
+ 'Directory' => 'Direktorija',
+ 'Driver' => 'Tvarkyklë',
+ 'Dropdown Limit' => 'Iðsiskleidþianèio meniu riba',
+ 'E-mail' => 'E-paðtas',
+ 'Edit User' => 'Redaguoti vartotojà',
+ 'Existing Datasets' => 'Egzistuojanèios duomenø aibës',
+ 'Fax' => 'Faksas',
+ 'Host' => 'Hostas',
+ 'Hostname missing!' => 'Hosto vardo nëra!',
+ 'Incorrect Password!' => 'Neteisingas slaptaþodis!',
+ 'Language' => 'Kalba',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lokaliam prisijungimui palikite hosto ir porto laukelius tuðèiais',
+ 'Login' => 'Prisijungimas',
+ 'Multibyte Encoding' => 'Multibaitinë kodiruotë',
+ 'Name' => 'Vardas',
+ 'New Templates' => 'Nauji ðablonai',
+ 'No Database Drivers available!' => 'Nëra Duomenø baziø tvarkykliø!',
+ 'No Dataset selected!' => 'Duomenø aibë neiðrinkta!',
+ 'Nothing to delete!' => 'Nëra ko trinti!',
+ 'Number Format' => 'Skaièiaus formatas',
+ 'Oracle Database Administration' => 'Oracle Duomenø bazës Administravimas',
+ 'Password' => 'Slaptaþodis',
+ 'Password changed!' => 'Slaptaþodis pakeistas!',
+ 'Pg Database Administration' => 'Pg Duomenø bazës Administravimas',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Portas',
+ 'Port missing!' => 'Porto numerio nëra!',
+ 'Printer' => 'Spausdintuvas',
+ 'Save' => 'Iðsaugoti',
+ 'Select a Dataset to delete and press "Continue"' => 'Iðrinkite Duomenø aibæ trinimui ir paspauskite "Tæsti"',
+ 'Setup Templates' => 'Nustatyti ðablonus',
+ 'Ship via' => 'Pristatyti per',
+ 'Signature' => 'Paraðas',
+ 'Stylesheet' => 'Stiliø lentelë',
+ 'Templates' => 'Ðablonai',
+ 'The following Datasets are not in use and can be deleted' => 'Ðios duomenø aibës nëra naudojamos ir gali bûti iðtrintos',
+ 'The following Datasets need to be updated' => 'Ðios duomenø aibës turi bûti atnaujintos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Èia preliminarus egzistuojanèiø ðaltiniø patikrinimas. Niekas negali bûti sukurta arba iðtrinta ðioje stadijoje.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Kad pridëti vartotojà á grupæ redaguokite vardà, pakeiskite prisijungimo vardà ir iðsaugokite. Bus sukurtas naujas vartotojas su tais paèiais kintamaisiais ir nauju prisijungimo vardu',
+ 'Update Dataset' => 'Atnaujinti Duomenø Aibæ',
+ 'Use Templates' => 'Naudoti ðablonus',
+ 'User' => 'Vartotojas',
+ 'User deleted!' => 'Vartotojas iðtrintas!',
+ 'User saved!' => 'Vartotojas iðsaugotas!',
+ 'Version' => 'Versija',
+ 'You must enter a host and port for local and remote connections!' => 'Turite ávesti hostà ir portà lokalioms ir nuotoliniams prisijungimams!',
+ 'does not exist' => 'ne egzistuoja',
+ 'is already a member!' => 'jau narys',
+ 'localhost' => 'lokalhostas',
+ 'locked!' => 'uþblokuotas',
+ 'successfully created!' => 'sëkmingai sukurta',
+ 'successfully deleted!' => 'sëkmingai iðtrinta',
+ 'website' => 'Websaitas',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'pridëti_vartotojà' => 'add_user',
+ 'pakeisti_administratoriaus_slaptaþodá' => 'change_admin_password',
+ 'pakeisti_slaptaþodá' => 'change_password',
+ 'tæsti' => 'continue',
+ 'sukûrti_duomenø_aibæ' => 'create_dataset',
+ 'iðtrinti' => 'delete',
+ 'iðtrinti_duomenø_aibë' => 'delete_dataset',
+ 'prisijungimas' => 'login',
+ 'oracle_duomenø_bazës_administravimas' => 'oracle_database_administration',
+ 'pg_duomenø_bazës_administravimas' => 'pg_database_administration',
+ 'iðsaugoti' => 'save',
+ 'atnaujinti_duomenø_aibæ' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/all b/sql-ledger/locale/lt/all
new file mode 100644
index 000000000..93a877193
--- /dev/null
+++ b/sql-ledger/locale/lt/all
@@ -0,0 +1,497 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Pirkimai',
+ 'AP Aging' => 'Pirkimo Skolos',
+ 'AP Transaction' => 'Pirkimo Operacijà',
+ 'AP Transactions' => 'Pirkimo Operacijos',
+ 'AR' => 'Pardavimai',
+ 'AR Aging' => 'Pardavimo Skolos',
+ 'AR Transaction' => 'Pardavimo Operacijà',
+ 'AR Transactions' => 'Pardavimo Operacijos',
+ 'About' => 'Apie...',
+ 'Access Control' => 'Priëjimo kontrolë',
+ 'Account' => 'Sàskaita',
+ 'Account Number' => 'Sàskaitos numeris',
+ 'Account Number missing!' => 'Sàskaitos numerio nëra!',
+ 'Account Type' => 'Sàskaitos tipas',
+ 'Account Type missing!' => 'Sàskaitos tipo nëra!',
+ 'Account deleted!' => 'Sàskaitos iðtrintos',
+ 'Account saved!' => 'Sàskaitos iðsaugotos',
+ 'Accounting' => 'Apskaita',
+ 'Accounting Menu' => 'Apskaitos Menu',
+ 'Accounts' => 'Sàskaitos',
+ 'Active' => 'Aktyvus',
+ 'Add' => 'Pridëti',
+ 'Add Account' => 'Pridëti sàskaità',
+ 'Add Accounts Payables Transaction' => 'Pridëti Pirkimo Sàskaitas Operacijà',
+ 'Add Accounts Receivables Transaction' => 'Pridëti Pardavimo Sàskaitas Operacijà',
+ 'Add Assembly' => 'Pridëti rinkiná',
+ 'Add Customer' => 'Pridëti klientà',
+ 'Add GIFI' => 'Pridëti GIFI',
+ 'Add General Ledger Transaction' => 'Pridëti Bendroji Þurnalo Operacijà',
+ 'Add Part' => 'Pridëti prekæ',
+ 'Add Project' => 'Pridëti proektà',
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Invoice' => 'Pridëti Pardavimo sàskaità-faktûrà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Add Service' => 'Pridëti Paslaugà',
+ 'Add Transaction' => 'Pridëti Operacijà',
+ 'Add User' => 'Pridëti Vartotojà',
+ 'Add Vendor' => 'Pridëti Tiekëja',
+ 'Add Vendor Invoice' => '',
+ 'Address' => 'Adresas',
+ 'Administration' => 'Administracija',
+ 'Administrator' => 'Administratorius',
+ 'All' => 'Visi',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Amount' => 'Suma',
+ 'Amount Due' => 'Suma iki',
+ 'Amount does not equal applied!' => 'Suma ne lygi pritaikytai!',
+ 'Amount missing!' => 'Nëra sumos!',
+ 'Applied' => 'Pritaikyta',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Invoice Number' => 'Ar Jus tikrai norite iðtrinti saskaitu-fakturos numeris:',
+ 'Are you sure you want to delete Order Number' => 'Ar Jus tikrai norite iðtrinti uzsakimas numeris:',
+ 'Are you sure you want to delete Transaction' => 'Ar Jus tikrai norite iðtrinti operacijà?',
+ 'Assemblies' => 'Rinkiniai',
+ 'Assemblies restocked!' => 'Rinkiniai persandeliuoti!',
+ 'Assembly Number missing!' => 'Rinkiniø numeriø nëra!',
+ 'Asset' => 'Turtas',
+ 'Attachment' => 'Prisegta',
+ 'Audit Control' => 'Audito kontrolë',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Reservinë kopija',
+ 'Backup sent to' => 'Reservinë kopija iðsiusta á',
+ 'Balance' => 'Balansas',
+ 'Balance Sheet' => 'Balanso lëntelë',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'Books are open' => 'Þurnalai atidaryti',
+ 'Bought' => 'Nupirkta',
+ 'Business Number' => 'Ámonës kodas',
+ 'C' => 'C',
+ 'COGS' => 'PPS',
+ 'Cannot delete account!' => 'Neámanoma iðtrinti sàskaitos!',
+ 'Cannot delete customer!' => 'Neámanoma iðtrinti kliento!',
+ 'Cannot delete default account!' => 'Neámanoma iðtrinti sàskaitos pagal nutylejimà!',
+ 'Cannot delete invoice!' => 'Neámanoma iðtrinti sàskaitos-faktûros!',
+ 'Cannot delete item already invoiced!' => 'Negalima iðtrinti prekës, kuriai sukurta sàskaita-faktûra!',
+ 'Cannot delete item on order!' => 'Negalima iðtrinti prekës, kuri yra uþsakyme!',
+ 'Cannot delete item which is part of an assembly!' => 'Negalima iðtrinti prekës, kuri yra rinkinio dalis!',
+ 'Cannot delete item!' => 'Neámanoma iðtrinti prekës!',
+ 'Cannot delete order!' => 'Neámanoma iðtrinti uþsakymo!',
+ 'Cannot delete transaction!' => 'Neámanoma iðtrinti operacijos!',
+ 'Cannot delete vendor!' => 'Neámanoma iðtrinti tiekëjo!',
+ 'Cannot have a value in both Debit and Credit!' => 'Negalima turëti tos paèios reikðmës Debete ir Kredite!',
+ 'Cannot post a transaction without a value!' => 'Neámanoma patvirtinti operacijos be reikðmës!',
+ 'Cannot post invoice for a closed period!' => 'Neámanoma patvirtinti sàskaitos-faktûros uþdarajam periodui!',
+ 'Cannot post invoice!' => 'Neámanoma patvirtinti sàskaitos-faktûros!',
+ 'Cannot post payment for a closed period!' => 'Neámanoma patvirtinti mokëjimo uþdarajam periodui!',
+ 'Cannot post payment!' => 'Neámanoma patvirtinti mokëjimo!',
+ 'Cannot post transaction for a closed period!' => 'Neámanoma patvirtinti operacijos uþdarajam periodui!',
+ 'Cannot post transaction!' => 'Neámanoma patvirtinti operacijos!',
+ 'Cannot process payment for a closed period!' => 'Neámanoma vykdyti mokëjimo uþdarajam periodui!',
+ 'Cannot save account!' => 'Neámanoma iðsaugoti sàskaitos!',
+ 'Cannot save order!' => 'Neámanoma iðsaugoti uþsakymo!',
+ 'Cannot save preferences!' => 'Neámanoma iðsaugoti nuostatø!',
+ 'Cannot stock assemblies!' => 'Neámanoma sandelioti rinkinius!',
+ 'Cash' => 'Kasa',
+ 'Cash based' => 'Grynais',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Pakeisti Administratoriaus slaptaþodá',
+ 'Change Password' => 'Pakeisti slaptaþodá',
+ 'Character Set' => 'Simboliø aibë',
+ 'Chart of Accounts' => 'Sàskaitø planas',
+ 'Check' => 'Èekis',
+ 'Check printed!' => 'Èekis atspausdintas!',
+ 'Check printing failed!' => 'Èekio spausdinimas nepavyko!',
+ 'Cleared Balance' => 'Baigiamasis balansas',
+ 'Click on login name to edit!' => 'Paspauskit prisijungimo vardà redagavimui!',
+ 'Close Books up to' => 'Uþdaryti þurnalus iki',
+ 'Closed' => 'Uþdaryta',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Palyginti su',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Connect to' => 'Prisijungti prie',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Copy to COA' => 'Kopijuoti á SP',
+ 'Create Chart of Accounts' => 'Sukûrti sàskaitø planà',
+ 'Create Dataset' => 'Sukûrti duomenø aibæ',
+ 'Credit' => 'Kreditas',
+ 'Credit Limit' => 'Kredito riba',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valiûta',
+ 'Current' => 'Dabartinis',
+ 'Customer' => 'Klientas',
+ 'Customer deleted!' => 'Klientas iðtrintas!',
+ 'Customer missing!' => 'Kliento vardo nëra!',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Customer saved!' => 'Klientas iðsaugotas!',
+ 'Customers' => 'Klientai',
+ 'DBI not installed!' => 'DBI ne instaliuotas!',
+ 'Database' => 'Duomenø bazë',
+ 'Database Administration' => 'Duomenø bazës administravimas',
+ 'Database Driver not checked!' => 'Duomenø bazës tvarkiklë nepatikrinta!',
+ 'Database Host' => 'Duomenø bazës hostas',
+ 'Database User missing!' => 'Duomenø bazës vartotojo nëra!',
+ 'Dataset' => 'Duomenø aibë',
+ 'Dataset missing!' => 'Duomenø aibës nëra!',
+ 'Dataset updated!' => 'Duomenø aibë atnaujinta!',
+ 'Date' => 'Data',
+ 'Date Format' => 'Datos Formatas',
+ 'Date Paid' => 'Mokëjimo Data',
+ 'Date missing!' => 'Datos nëra!',
+ 'Debit' => 'Debetas',
+ 'Debit and credit out of balance!' => 'Debetas ir Kreditas nesubalansuoti!',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Decimalplaces' => 'Skaièiø po taðko',
+ 'Delete' => 'Iðtrinti',
+ 'Delete Account' => 'Iðtrinti sàskaità',
+ 'Delete Dataset' => 'Iðtrinti Duomenø aibë',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Department' => '',
+ 'Deposit' => 'Depozitas',
+ 'Description' => 'Apraðymas',
+ 'Difference' => 'Skirtumas',
+ 'Directory' => 'Direktorija',
+ 'Discount' => 'Nuolaidos',
+ 'Done' => 'Ávykdyta',
+ 'Drawing' => 'Brieþinys',
+ 'Driver' => 'Tvarkyklë',
+ 'Dropdown Limit' => 'Iðsiskleidþianèio meniu riba',
+ 'Due' => 'Iki',
+ 'Due Date' => 'Iki Data',
+ 'Due Date missing!' => 'Nëra Iki Datos!',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail Statement to' => 'Suvestinæ suisti per e-pastà á',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Edit' => 'Redaguoti',
+ 'Edit Account' => 'Redaguoti sàskaità',
+ 'Edit Accounts Payables Transaction' => 'Redaguoti pirkimo sàskaitø operacijià',
+ 'Edit Accounts Receivables Transaction' => 'Redaguoti pardavimo sàskaitø operacijià',
+ 'Edit Assembly' => 'Redaguoti rinkiná',
+ 'Edit Customer' => 'Redaguoti Klientà',
+ 'Edit GIFI' => 'Redaguoti GIFI',
+ 'Edit General Ledger Transaction' => 'Redaguoti Bendrojo Þurnalo operacijà',
+ 'Edit Part' => 'Redaguoti prekæ',
+ 'Edit Preferences for' => 'Redaguoti nuostatas...',
+ 'Edit Project' => 'Redaguoti projektà',
+ 'Edit Purchase Order' => 'Redaguoti pirkimo uþsakymà',
+ 'Edit Sales Invoice' => 'Redaguoti pardavimo sàskaità-faktûrà',
+ 'Edit Sales Order' => 'Redaguoti pardavimo uþsakymà',
+ 'Edit Service' => 'Redaguoti paslaugà',
+ 'Edit Template' => 'Redaguoti ðablonà',
+ 'Edit User' => 'Redaguoti vartotojà',
+ 'Edit Vendor' => 'Redaguoti Tiekijà',
+ 'Edit Vendor Invoice' => '',
+ 'Employee' => 'Darbuotojas',
+ 'Enforce transaction reversal for all dates' => 'Reversuoti operacijas visoms datoms',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Áveskite iki 3-jø raidþiø, iðskirtø taðkais (Pvz. LTL:EUR:USD:YEN) savo ir uþsienio valiutoms paþymëti',
+ 'Equity' => 'Turtas/Nuosavybë',
+ 'Exch' => 'Kurs.',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate Difference' => 'Keitimo kurso skirtumas',
+ 'Exchangerate for payment missing!' => 'Mokëjimo keitimo kurso nëra!',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Existing Datasets' => 'Egzistuojanèios duomenø aibës',
+ 'Expense' => 'Sànaudos',
+ 'Expense Account' => 'Sànaudø sàskaita',
+ 'Expense/Asset' => 'Sànaudos/Aktyvai',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'Foreign Exchange Gain' => 'Valiûtos keitimo pelnas',
+ 'Foreign Exchange Loss' => 'Valiûtos keitimo nuostolis',
+ 'From' => 'Nuo',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI iðtrintas!',
+ 'GIFI missing!' => 'GIFI nëra!',
+ 'GIFI saved!' => 'GIFI iðsaugotas!',
+ 'GL Transaction' => 'BÞ operacija',
+ 'General Ledger' => 'Bendrasis þurnalas',
+ 'Goods & Services' => 'Prekës ir Paslaugos',
+ 'Group' => '',
+ 'Group Items' => '',
+ 'HTML Templates' => 'HTML ðablonai',
+ 'Heading' => 'Antraðtë',
+ 'Host' => 'Hostas',
+ 'Hostname missing!' => 'Hosto vardo nëra!',
+ 'ID' => 'ID',
+ 'Image' => 'Pieðinys',
+ 'In-line' => 'Vienaeilis',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Include in drop-down menus' => 'Ádëti á iðsáskleidþianèius meniu',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Ádëti ðià sàskaità á kliento/tiekëjo formas, kad paþymëti klientà/tiekëjà kaip apmokestinamà?',
+ 'Income' => 'Pajamos',
+ 'Income Account' => 'Pajamø sàskaita',
+ 'Income Statement' => 'Pelno/nuostolio ataskaita',
+ 'Incorrect Dataset version!' => 'Neteisinga duomenø aibës versija!',
+ 'Incorrect Password!' => 'Neteisingas slaptaþodis!',
+ 'Individual Items' => 'Individualios prekës',
+ 'Inventory' => 'Prekës',
+ 'Inventory Account' => 'Prekës sàskaita',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Prekës kiekis turi bûti lygus nuliui prieð paþymint rinkiná pasenusiu!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Prekës kiekis turi bûti lygus nuliui prieð paþymint ðià dalá pasenusia!',
+ 'Inventory quantity must be zero!' => 'Prekës kiekis turi bûti lygus nuliui!',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date' => 'Sàskaitos-faktûros data',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Invoice deleted!' => 'Sàskaitos-faktûra iðtrintos!',
+ 'Invoice posted!' => 'Sàskaitos-faktûra patvirtintos!',
+ 'Invoices' => 'Sàskaitos-faktûros',
+ 'Is this a summary account to record' => 'Ar èia apibendrinta áraðo sàskaita',
+ 'Item deleted!' => 'Vienetas iðtrintas!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'LaTeX Templates' => 'LaTeX ðablonai',
+ 'Language' => 'Kalba',
+ 'Last Cost' => 'Paskutinë kaina',
+ 'Last Invoice Number' => 'Paskutinës sàskaitos-faktûros numeris',
+ 'Last Numbers & Default Accounts' => 'Paskutinieji numeriai ir sàskaitos pagal nutylëjimà',
+ 'Last Purchase Order Number' => 'Paskutinio pirkimo uþsakymo numeris',
+ 'Last Sales Order Number' => 'Paskutinio pardavimo uþsakymo numeris',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lokaliam prisijungimui palikite hosto ir porto laukelius tuðèiais',
+ 'Liability' => 'Nuosavybë',
+ 'Licensed to' => 'Licenzijuota...',
+ 'Line Total' => 'Viso eilutëje',
+ 'Link' => 'Ryðys',
+ 'Link Accounts' => 'Suriðti sàskaitas',
+ 'List Accounts' => 'Sàskaitø sàraðas',
+ 'List GIFI' => 'GIFI sàraðas',
+ 'List Price' => 'Pirkimo kaina',
+ 'List Transactions' => 'Parodyti operacijas',
+ 'Login' => 'Prisijungimas',
+ 'Logout' => 'Iðsijungti',
+ 'Make' => 'Gamintojas',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Microfiche' => 'Mikrofiða',
+ 'Model' => 'Modelis',
+ 'Multibyte Encoding' => 'Multibaitinë kodiruotë',
+ 'N/A' => 'N/A',
+ 'Name' => 'Vardas',
+ 'Name missing!' => 'Pavadinimo nëra',
+ 'New Templates' => 'Nauji ðablonai',
+ 'No' => 'Ne',
+ 'No Database Drivers available!' => 'Nëra Duomenø baziø tvarkykliø!',
+ 'No Dataset selected!' => 'Duomenø aibë neiðrinkta!',
+ 'No email address for' => 'Nëra e-paðto adreso...',
+ 'No.' => 'Num',
+ 'Notes' => 'Pastaba',
+ 'Nothing applied!' => 'Niekas nepanaudota!',
+ 'Nothing selected!' => 'Nieko neiðrinkta!',
+ 'Nothing to delete!' => 'Nëra ko trinti!',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number Format' => 'Skaièiaus formatas',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'O' => 'O',
+ 'Obsolete' => 'Pasenæ',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'On Hand' => 'Likutis',
+ 'On Order' => 'Uþsakyme',
+ 'Open' => 'Atidaryti',
+ 'Oracle Database Administration' => 'Oracle Duomenø bazës Administravimas',
+ 'Order' => 'Uþsakymas',
+ 'Order Date' => 'Uþsakymo data',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Entry' => 'Uþsakymo áraðas',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'Order deleted!' => 'Uþsakymai iðtrinti!',
+ 'Order saved!' => 'Uþsakymas iðsaugotas!',
+ 'Ordered' => 'Uþsakyta',
+ 'Orphaned' => 'Naðlaitinis',
+ 'Out of balance!' => 'Nesubalansuota!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Paid' => 'Apmokëta',
+ 'Paid in full' => 'Pilnai apmokëta',
+ 'Part' => 'Prekë',
+ 'Part Number missing!' => 'Prekës numerio nëra!',
+ 'Parts' => 'Prekës',
+ 'Parts Inventory' => 'Prekiø saraðas',
+ 'Password' => 'Slaptaþodis',
+ 'Password changed!' => 'Slaptaþodis pakeistas!',
+ 'Payables' => 'Pirkimai',
+ 'Payment' => 'Mokëjimas',
+ 'Payment date missing!' => 'Mokëjimo datos nëra',
+ 'Payment posted!' => 'Mokëjimas patvirtintas!',
+ 'Payments' => 'Mokëjimai',
+ 'Pg Database Administration' => 'Pg Duomenø bazës Administravimas',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Portas',
+ 'Port missing!' => 'Porto numerio nëra!',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Postscript' => 'Postscript(TM)',
+ 'Preferences' => 'Nuostatos',
+ 'Preferences saved!' => 'Nuostatos iðsaugotos!',
+ 'Price' => 'Kaina',
+ 'Print' => 'Spausdinti',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'Projekto numerio nëra!',
+ 'Project deleted!' => 'Projektas iðtrintas!',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Project saved!' => 'Projektas iðsaugotas!',
+ 'Projects' => 'Projektai',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Purchase Orders' => 'Pirkimo uþsakymai',
+ 'Qty' => 'Kks',
+ 'ROP' => 'ROP',
+ 'Rate' => 'Kursas',
+ 'Recd' => 'Gaut',
+ 'Receipt' => 'Kasos orderis',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'Kasos orderiai',
+ 'Receivables' => 'Pardavimai',
+ 'Reconciliation' => 'Sutaikinimas',
+ 'Record in' => 'Áraðyti á',
+ 'Reference' => 'Nuorodos',
+ 'Reference missing!' => 'Nuorodos nëra!',
+ 'Remaining' => 'Likutis',
+ 'Report for' => 'Ataskaita...',
+ 'Reports' => 'Ataskaitos',
+ 'Required by' => 'Iki kada',
+ 'Retained Earnings' => 'Turimi uþdarbiai',
+ 'Sales' => 'Pardavimai',
+ 'Sales Invoice' => 'Pardavimo SF',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Sales Orders' => 'Pardavimø uþsakymai',
+ 'Salesperson' => '',
+ 'Save' => 'Iðsaugoti',
+ 'Save as new' => 'Iðsaugoti kaip naujà',
+ 'Save to File' => 'Iðsaugoti á failà',
+ 'Screen' => 'Ekranas',
+ 'Select a Dataset to delete and press "Continue"' => 'Iðrinkite Duomenø aibæ trinimui ir paspauskite "Tæsti"',
+ 'Select all' => 'Iðrinkti viskà',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sell Price' => 'Pardavimo kaina',
+ 'Send by E-Mail' => 'Iðsiûsti e-paðtu',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Service Items' => 'Paslaugø sàraðas',
+ 'Service Number missing!' => 'Paslaugos numerio nëra!',
+ 'Services' => 'Paslaugos',
+ 'Setup Templates' => 'Nustatyti ðablonus',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Ship via' => 'Pristatyti per',
+ 'Short' => 'Stoka',
+ 'Signature' => 'Paraðas',
+ 'Sold' => 'Parduota',
+ 'Source' => 'Dokumentas',
+ 'Standard' => 'Standartas',
+ 'Statement' => 'Suvestinë',
+ 'Statement Balance' => 'Balanso suvestinë',
+ 'Statement sent to' => 'Siusti suvestinæ á',
+ 'Statements sent to printer!' => 'Siusti suvestinæ á spausdintuvà!',
+ 'Stock Assembly' => 'Rinkiniai sandëlyje',
+ 'Stylesheet' => 'Stiliø lentelë',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'System' => 'Sistema',
+ 'Tax' => 'Mokëstis',
+ 'Tax Accounts' => 'Mokesèiø sàskaitos',
+ 'Tax Included' => 'su mokesèiais',
+ 'Tax collected' => 'Mokesèiai surinkti',
+ 'Tax paid' => 'Mokesèiai sumokëti',
+ 'Taxable' => 'Apmokestinama',
+ 'Template saved!' => 'Ðablonai iðsaugoti!',
+ 'Templates' => 'Ðablonai',
+ 'Terms: Net' => 'Terminas: ',
+ 'The following Datasets are not in use and can be deleted' => 'Ðios duomenø aibës nëra naudojamos ir gali bûti iðtrintos',
+ 'The following Datasets need to be updated' => 'Ðios duomenø aibës turi bûti atnaujintos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Èia preliminarus egzistuojanèiø ðaltiniø patikrinimas. Niekas negali bûti sukurta arba iðtrinta ðioje stadijoje.',
+ 'To' => 'iki',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Kad pridëti vartotojà á grupæ redaguokite vardà, pakeiskite prisijungimo vardà ir iðsaugokite. Bus sukurtas naujas vartotojas su tais paèiais kintamaisiais ir nauju prisijungimo vardu',
+ 'Top Level' => 'Aukðèiausias lygis',
+ 'Total' => 'Ið viso',
+ 'Transaction Date missing!' => 'Operacijos datos nëra!',
+ 'Transaction deleted!' => 'Operacija iðtrinta!',
+ 'Transaction posted!' => 'Operacija patvirtinta!',
+ 'Transaction reversal enforced for all dates' => 'Operacijos bus reversuojamos visoms datoms',
+ 'Transaction reversal enforced up to' => 'Operacijos bus reversuojamos iki',
+ 'Transactions' => 'Operacijos',
+ 'Transactions exist, cannot delete customer!' => 'Operacijos egzistuoja, negalima iðtrinti kliento!',
+ 'Transactions exist, cannot delete vendor!' => 'Operacijos egzistuoja, negalima iðtrinti tiekëjo!',
+ 'Transactions exist; cannot delete account!' => 'Operacijos egzistuoja, negalima iðtrinti sàskaitos!',
+ 'Trial Balance' => 'Bandomasis balansas',
+ 'Unit' => 'Vienetas',
+ 'Unit of measure' => 'Matavimo vienetas',
+ 'Update' => 'Atnaujinti',
+ 'Update Dataset' => 'Atnaujinti Duomenø Aibæ',
+ 'Updated' => 'Atnaujinta',
+ 'Use Templates' => 'Naudoti ðablonus',
+ 'User' => 'Vartotojas',
+ 'User deleted!' => 'Vartotojas iðtrintas!',
+ 'User saved!' => 'Vartotojas iðsaugotas!',
+ 'Vendor' => 'Tiekëjas',
+ 'Vendor Invoice' => '',
+ 'Vendor deleted!' => 'Tiekëjas iðtrintas!',
+ 'Vendor missing!' => 'Tiekëjo Vardo nëra!',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'Vendor saved!' => 'Tiekëjai iðsaugoti',
+ 'Vendors' => 'Tiekëjai',
+ 'Version' => 'Versija',
+ 'Weight' => 'Svoris',
+ 'Weight Unit' => 'Svorio vienetas.',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'Year End' => 'Metø pabaiga',
+ 'Yes' => 'Taip',
+ 'You are logged out!' => 'Jûs iðsijungëte!',
+ 'You did not enter a name!' => 'Neávedëte vardo!',
+ 'You must enter a host and port for local and remote connections!' => 'Turite ávesti hostà ir portà lokalioms ir nuotoliniams prisijungimams!',
+ 'as at' => 'kaip',
+ 'collected on sales' => 'surinkta per pardavimus',
+ 'days' => 'dienos',
+ 'does not exist' => 'ne egzistuoja',
+ 'ea' => 'kk',
+ 'emailed to' => 'email do',
+ 'for Period' => 'periodui',
+ 'hr' => 'val',
+ 'is already a member!' => 'jau narys',
+ 'is not a member!' => 'nëra narys!',
+ 'localhost' => 'lokalhostas',
+ 'locked!' => 'uþblokuotas',
+ 'paid on purchases' => 'apmokëta per pirkimus',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+ 'successfully created!' => 'sëkmingai sukurta',
+ 'successfully deleted!' => 'sëkmingai iðtrinta',
+ 'to' => 'iki',
+ 'website' => 'Websaitas',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/am b/sql-ledger/locale/lt/am
new file mode 100644
index 000000000..4796a2b2d
--- /dev/null
+++ b/sql-ledger/locale/lt/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Pirkimai',
+ 'AR' => 'Pardavimai',
+ 'Account' => 'Sàskaita',
+ 'Account Number' => 'Sàskaitos numeris',
+ 'Account Number missing!' => 'Sàskaitos numerio nëra!',
+ 'Account Type' => 'Sàskaitos tipas',
+ 'Account Type missing!' => 'Sàskaitos tipo nëra!',
+ 'Account deleted!' => 'Sàskaitos iðtrintos',
+ 'Account saved!' => 'Sàskaitos iðsaugotos',
+ 'Add Account' => 'Pridëti sàskaità',
+ 'Add GIFI' => 'Pridëti GIFI',
+ 'Address' => 'Adresas',
+ 'Asset' => 'Turtas',
+ 'Audit Control' => 'Audito kontrolë',
+ 'Backup sent to' => 'Reservinë kopija iðsiusta á',
+ 'Books are open' => 'Þurnalai atidaryti',
+ 'Business Number' => 'Ámonës kodas',
+ 'COGS' => 'PPS',
+ 'Cannot delete account!' => 'Neámanoma iðtrinti sàskaitos!',
+ 'Cannot delete default account!' => 'Neámanoma iðtrinti sàskaitos pagal nutylejimà!',
+ 'Cannot save account!' => 'Neámanoma iðsaugoti sàskaitos!',
+ 'Cannot save preferences!' => 'Neámanoma iðsaugoti nuostatø!',
+ 'Character Set' => 'Simboliø aibë',
+ 'Chart of Accounts' => 'Sàskaitø planas',
+ 'Close Books up to' => 'Uþdaryti þurnalus iki',
+ 'Company' => 'Firma',
+ 'Continue' => 'Tæsti',
+ 'Copy to COA' => 'Kopijuoti á SP',
+ 'Credit' => 'Kreditas',
+ 'Date Format' => 'Datos Formatas',
+ 'Debit' => 'Debetas',
+ 'Delete' => 'Iðtrinti',
+ 'Delete Account' => 'Iðtrinti sàskaità',
+ 'Description' => 'Apraðymas',
+ 'Dropdown Limit' => 'Iðsiskleidþianèio meniu riba',
+ 'E-mail' => 'E-paðtas',
+ 'Edit' => 'Redaguoti',
+ 'Edit Account' => 'Redaguoti sàskaità',
+ 'Edit GIFI' => 'Redaguoti GIFI',
+ 'Edit Preferences for' => 'Redaguoti nuostatas...',
+ 'Edit Template' => 'Redaguoti ðablonà',
+ 'Enforce transaction reversal for all dates' => 'Reversuoti operacijas visoms datoms',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Áveskite iki 3-jø raidþiø, iðskirtø taðkais (Pvz. LTL:EUR:USD:YEN) savo ir uþsienio valiutoms paþymëti',
+ 'Equity' => 'Turtas/Nuosavybë',
+ 'Expense' => 'Sànaudos',
+ 'Expense Account' => 'Sànaudø sàskaita',
+ 'Expense/Asset' => 'Sànaudos/Aktyvai',
+ 'Fax' => 'Faksas',
+ 'Foreign Exchange Gain' => 'Valiûtos keitimo pelnas',
+ 'Foreign Exchange Loss' => 'Valiûtos keitimo nuostolis',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI iðtrintas!',
+ 'GIFI missing!' => 'GIFI nëra!',
+ 'GIFI saved!' => 'GIFI iðsaugotas!',
+ 'Heading' => 'Antraðtë',
+ 'Include in drop-down menus' => 'Ádëti á iðsáskleidþianèius meniu',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Ádëti ðià sàskaità á kliento/tiekëjo formas, kad paþymëti klientà/tiekëjà kaip apmokestinamà?',
+ 'Income' => 'Pajamos',
+ 'Income Account' => 'Pajamø sàskaita',
+ 'Inventory' => 'Prekës',
+ 'Inventory Account' => 'Prekës sàskaita',
+ 'Is this a summary account to record' => 'Ar èia apibendrinta áraðo sàskaita',
+ 'Language' => 'Kalba',
+ 'Last Invoice Number' => 'Paskutinës sàskaitos-faktûros numeris',
+ 'Last Numbers & Default Accounts' => 'Paskutinieji numeriai ir sàskaitos pagal nutylëjimà',
+ 'Last Purchase Order Number' => 'Paskutinio pirkimo uþsakymo numeris',
+ 'Last Sales Order Number' => 'Paskutinio pardavimo uþsakymo numeris',
+ 'Liability' => 'Nuosavybë',
+ 'Link' => 'Ryðys',
+ 'Name' => 'Vardas',
+ 'No' => 'Ne',
+ 'No email address for' => 'Nëra e-paðto adreso...',
+ 'Number' => 'Numeris',
+ 'Number Format' => 'Skaièiaus formatas',
+ 'Parts Inventory' => 'Prekiø saraðas',
+ 'Password' => 'Slaptaþodis',
+ 'Payables' => 'Pirkimai',
+ 'Payment' => 'Mokëjimas',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Nuostatos iðsaugotos!',
+ 'Rate' => 'Kursas',
+ 'Receivables' => 'Pardavimai',
+ 'Sales' => 'Pardavimai',
+ 'Save' => 'Iðsaugoti',
+ 'Service Items' => 'Paslaugø sàraðas',
+ 'Ship via' => 'Pristatyti per',
+ 'Signature' => 'Paraðas',
+ 'Stylesheet' => 'Stiliø lentelë',
+ 'Tax' => 'Mokëstis',
+ 'Tax Accounts' => 'Mokesèiø sàskaitos',
+ 'Template saved!' => 'Ðablonai iðsaugoti!',
+ 'Transaction reversal enforced for all dates' => 'Operacijos bus reversuojamos visoms datoms',
+ 'Transaction reversal enforced up to' => 'Operacijos bus reversuojamos iki',
+ 'Transactions exist; cannot delete account!' => 'Operacijos egzistuoja, negalima iðtrinti sàskaitos!',
+ 'Weight Unit' => 'Svorio vienetas.',
+ 'Year End' => 'Metø pabaiga',
+ 'Yes' => 'Taip',
+ 'does not exist' => 'ne egzistuoja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'pridëti_sàskaità' => 'add_account',
+ 'tæsti' => 'continue',
+ 'kopijuoti_á_sp' => 'copy_to_coa',
+ 'iðtrinti' => 'delete',
+ 'redaguoti' => 'edit',
+ 'redaguoti_sàskaità' => 'edit_account',
+ 'iðsaugoti' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ap b/sql-ledger/locale/lt/ap
new file mode 100644
index 000000000..749dbfbce
--- /dev/null
+++ b/sql-ledger/locale/lt/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Pirkimo Operacijà',
+ 'AP Transactions' => 'Pirkimo Operacijos',
+ 'Account' => 'Sàskaita',
+ 'Add Accounts Payables Transaction' => 'Pridëti Pirkimo Sàskaitas Operacijà',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Amount Due' => 'Suma iki',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Transaction' => 'Ar Jus tikrai norite iðtrinti operacijà?',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Cannot delete transaction!' => 'Neámanoma iðtrinti operacijos!',
+ 'Cannot post payment for a closed period!' => 'Neámanoma patvirtinti mokëjimo uþdarajam periodui!',
+ 'Cannot post transaction for a closed period!' => 'Neámanoma patvirtinti operacijos uþdarajam periodui!',
+ 'Cannot post transaction!' => 'Neámanoma patvirtinti operacijos!',
+ 'Closed' => 'Uþdaryta',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Continue' => 'Tæsti',
+ 'Currency' => 'Valiûta',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Mokëjimo Data',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Description' => 'Apraðymas',
+ 'Due Date' => 'Iki Data',
+ 'Due Date missing!' => 'Nëra Iki Datos!',
+ 'Edit Accounts Payables Transaction' => 'Redaguoti pirkimo sàskaitø operacijià',
+ 'Employee' => 'Darbuotojas',
+ 'Exch' => 'Kurs.',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate for payment missing!' => 'Mokëjimo keitimo kurso nëra!',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date' => 'Sàskaitos-faktûros data',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Open' => 'Atidaryti',
+ 'Order' => 'Uþsakymas',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Paid' => 'Apmokëta',
+ 'Payment date missing!' => 'Mokëjimo datos nëra',
+ 'Payments' => 'Mokëjimai',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Source' => 'Dokumentas',
+ 'Subtotal' => 'Viso',
+ 'Tax' => 'Mokëstis',
+ 'Tax Included' => 'su mokesèiais',
+ 'Total' => 'Ið viso',
+ 'Transaction deleted!' => 'Operacija iðtrinta!',
+ 'Transaction posted!' => 'Operacija patvirtinta!',
+ 'Update' => 'Atnaujinti',
+ 'Vendor' => 'Tiekëjas',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor missing!' => 'Tiekëjo Vardo nëra!',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'Yes' => 'Taip',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'pirkimo_operacijà' => 'ap_transaction',
+ 'pridëti_pirkimo_sàskaitas_operacijà' => 'add_accounts_payables_transaction',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'redaguoti_pirkimo_sàskaitø_operacijià' => 'edit_accounts_payables_transaction',
+ 'patvirtinti' => 'post',
+ 'patvirtinti_kaip_naujà' => 'post_as_new',
+ 'atnaujinti' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ar b/sql-ledger/locale/lt/ar
new file mode 100644
index 000000000..1b5616dc5
--- /dev/null
+++ b/sql-ledger/locale/lt/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Pardavimo Operacijà',
+ 'AR Transactions' => 'Pardavimo Operacijos',
+ 'Account' => 'Sàskaita',
+ 'Add Accounts Receivables Transaction' => 'Pridëti Pardavimo Sàskaitas Operacijà',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Amount Due' => 'Suma iki',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Transaction' => 'Ar Jus tikrai norite iðtrinti operacijà?',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Cannot delete transaction!' => 'Neámanoma iðtrinti operacijos!',
+ 'Cannot post payment for a closed period!' => 'Neámanoma patvirtinti mokëjimo uþdarajam periodui!',
+ 'Cannot post transaction for a closed period!' => 'Neámanoma patvirtinti operacijos uþdarajam periodui!',
+ 'Cannot post transaction!' => 'Neámanoma patvirtinti operacijos!',
+ 'Closed' => 'Uþdaryta',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Continue' => 'Tæsti',
+ 'Credit Limit' => 'Kredito riba',
+ 'Currency' => 'Valiûta',
+ 'Customer' => 'Klientas',
+ 'Customer missing!' => 'Kliento vardo nëra!',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Mokëjimo Data',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Description' => 'Apraðymas',
+ 'Due Date' => 'Iki Data',
+ 'Due Date missing!' => 'Nëra Iki Datos!',
+ 'Edit Accounts Receivables Transaction' => 'Redaguoti pardavimo sàskaitø operacijià',
+ 'Exch' => 'Kurs.',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate for payment missing!' => 'Mokëjimo keitimo kurso nëra!',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date' => 'Sàskaitos-faktûros data',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Open' => 'Atidaryti',
+ 'Order' => 'Uþsakymas',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Paid' => 'Apmokëta',
+ 'Payment date missing!' => 'Mokëjimo datos nëra',
+ 'Payments' => 'Mokëjimai',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Remaining' => 'Likutis',
+ 'Sales Invoice' => 'Pardavimo SF',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Ship via' => 'Pristatyti per',
+ 'Source' => 'Dokumentas',
+ 'Subtotal' => 'Viso',
+ 'Tax' => 'Mokëstis',
+ 'Tax Included' => 'su mokesèiais',
+ 'Total' => 'Ið viso',
+ 'Transaction deleted!' => 'Operacija iðtrinta!',
+ 'Transaction posted!' => 'Operacija patvirtinta!',
+ 'Update' => 'Atnaujinti',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'Yes' => 'Taip',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'pardavimo_operacijà' => 'ar_transaction',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'patvirtinti' => 'post',
+ 'patvirtinti_kaip_naujà' => 'post_as_new',
+ 'pardavimo_sf' => 'sales_invoice',
+ 'atnaujinti' => 'update',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/arap b/sql-ledger/locale/lt/arap
new file mode 100644
index 000000000..00334727b
--- /dev/null
+++ b/sql-ledger/locale/lt/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresas',
+ 'Continue' => 'Tæsti',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Description' => 'Apraðymas',
+ 'Number' => 'Numeris',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'tæsti' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ca b/sql-ledger/locale/lt/ca
new file mode 100644
index 000000000..89d18c3db
--- /dev/null
+++ b/sql-ledger/locale/lt/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Sàskaita',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Balance' => 'Balansas',
+ 'Chart of Accounts' => 'Sàskaitø planas',
+ 'Credit' => 'Kreditas',
+ 'Date' => 'Data',
+ 'Debit' => 'Debetas',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Description' => 'Apraðymas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'List Transactions' => 'Parodyti operacijas',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Reference' => 'Nuorodos',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Subtotal' => 'Viso',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'parodyti_operacijas' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/cp b/sql-ledger/locale/lt/cp
new file mode 100644
index 000000000..ec73d1836
--- /dev/null
+++ b/sql-ledger/locale/lt/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Sàskaita',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Amount does not equal applied!' => 'Suma ne lygi pritaikytai!',
+ 'Amount missing!' => 'Nëra sumos!',
+ 'Applied' => 'Pritaikyta',
+ 'Cannot post payment!' => 'Neámanoma patvirtinti mokëjimo!',
+ 'Cannot process payment for a closed period!' => 'Neámanoma vykdyti mokëjimo uþdarajam periodui!',
+ 'Check' => 'Èekis',
+ 'Check printed!' => 'Èekis atspausdintas!',
+ 'Check printing failed!' => 'Èekio spausdinimas nepavyko!',
+ 'Continue' => 'Tæsti',
+ 'Currency' => 'Valiûta',
+ 'Customer' => 'Klientas',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Datos nëra!',
+ 'Description' => 'Apraðymas',
+ 'Due' => 'Iki',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'From' => 'Nuo',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoices' => 'Sàskaitos-faktûros',
+ 'Nothing applied!' => 'Niekas nepanaudota!',
+ 'Number' => 'Numeris',
+ 'Paid in full' => 'Pilnai apmokëta',
+ 'Payment' => 'Mokëjimas',
+ 'Payment posted!' => 'Mokëjimas patvirtintas!',
+ 'Post' => 'Patvirtinti',
+ 'Print' => 'Spausdinti',
+ 'Printer' => 'Spausdintuvas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Receipt' => 'Kasos orderis',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'Nuorodos',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Update' => 'Atnaujinti',
+ 'Vendor' => 'Tiekëjas',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'tæsti' => 'continue',
+ 'patvirtinti' => 'post',
+ 'spausdinti' => 'print',
+ 'atnaujinti' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ct b/sql-ledger/locale/lt/ct
new file mode 100644
index 000000000..5de12f62f
--- /dev/null
+++ b/sql-ledger/locale/lt/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Pridëti',
+ 'Address' => 'Adresas',
+ 'All' => 'Visi',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Neámanoma iðtrinti kliento!',
+ 'Cannot delete vendor!' => 'Neámanoma iðtrinti tiekëjo!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Credit Limit' => 'Kredito riba',
+ 'Customer deleted!' => 'Klientas iðtrintas!',
+ 'Customer saved!' => 'Klientas iðsaugotas!',
+ 'Customers' => 'Klientai',
+ 'Delete' => 'Iðtrinti',
+ 'Discount' => 'Nuolaidos',
+ 'E-mail' => 'E-paðtas',
+ 'Edit Customer' => 'Redaguoti Klientà',
+ 'Edit Vendor' => 'Redaguoti Tiekijà',
+ 'Fax' => 'Faksas',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Name' => 'Vardas',
+ 'Name missing!' => 'Pavadinimo nëra',
+ 'Notes' => 'Pastaba',
+ 'Number' => 'Numeris',
+ 'Order' => 'Uþsakymas',
+ 'Orphaned' => 'Naðlaitinis',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Iðsaugoti',
+ 'Ship to' => 'Pristatyti á',
+ 'Tax Included' => 'su mokesèiais',
+ 'Taxable' => 'Apmokestinama',
+ 'Terms: Net' => 'Terminas: ',
+ 'Transactions exist, cannot delete customer!' => 'Operacijos egzistuoja, negalima iðtrinti kliento!',
+ 'Transactions exist, cannot delete vendor!' => 'Operacijos egzistuoja, negalima iðtrinti tiekëjo!',
+ 'Vendor deleted!' => 'Tiekëjas iðtrintas!',
+ 'Vendor saved!' => 'Tiekëjai iðsaugoti',
+ 'Vendors' => 'Tiekëjai',
+ 'days' => 'dienos',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'pridëti' => 'add',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'sàskaita_faktûra' => 'invoice',
+ 'uþsakymas' => 'order',
+ 'iðsaugoti' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/gl b/sql-ledger/locale/lt/gl
new file mode 100644
index 000000000..db28f7ead
--- /dev/null
+++ b/sql-ledger/locale/lt/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Pirkimo Operacijà',
+ 'AR Transaction' => 'Pardavimo Operacijà',
+ 'Account' => 'Sàskaita',
+ 'Add General Ledger Transaction' => 'Pridëti Bendroji Þurnalo Operacijà',
+ 'Address' => 'Adresas',
+ 'All' => 'Visi',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Transaction' => 'Ar Jus tikrai norite iðtrinti operacijà?',
+ 'Asset' => 'Turtas',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Balance' => 'Balansas',
+ 'Cannot delete transaction!' => 'Neámanoma iðtrinti operacijos!',
+ 'Cannot have a value in both Debit and Credit!' => 'Negalima turëti tos paèios reikðmës Debete ir Kredite!',
+ 'Cannot post a transaction without a value!' => 'Neámanoma patvirtinti operacijos be reikðmës!',
+ 'Cannot post transaction for a closed period!' => 'Neámanoma patvirtinti operacijos uþdarajam periodui!',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Continue' => 'Tæsti',
+ 'Credit' => 'Kreditas',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Debit' => 'Debetas',
+ 'Debit and credit out of balance!' => 'Debetas ir Kreditas nesubalansuoti!',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Description' => 'Apraðymas',
+ 'Edit General Ledger Transaction' => 'Redaguoti Bendrojo Þurnalo operacijà',
+ 'Equity' => 'Turtas/Nuosavybë',
+ 'Expense' => 'Sànaudos',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'BÞ operacija',
+ 'General Ledger' => 'Bendrasis þurnalas',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Income' => 'Pajamos',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Liability' => 'Nuosavybë',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Reference' => 'Nuorodos',
+ 'Reference missing!' => 'Nuorodos nëra!',
+ 'Reports' => 'Ataskaitos',
+ 'Sales Invoice' => 'Pardavimo SF',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Source' => 'Dokumentas',
+ 'Subtotal' => 'Viso',
+ 'Transaction Date missing!' => 'Operacijos datos nëra!',
+ 'Transaction deleted!' => 'Operacija iðtrinta!',
+ 'Transaction posted!' => 'Operacija patvirtinta!',
+ 'Update' => 'Atnaujinti',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'Yes' => 'Taip',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'pirkimo_operacijà' => 'ap_transaction',
+ 'pardavimo_operacijà' => 'ar_transaction',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'bÞ_operacija' => 'gl_transaction',
+ 'patvirtinti' => 'post',
+ 'patvirtinti_kaip_naujà' => 'post_as_new',
+ 'pardavimo_sf' => 'sales_invoice',
+ 'atnaujinti' => 'update',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ic b/sql-ledger/locale/lt/ic
new file mode 100644
index 000000000..e749d21e9
--- /dev/null
+++ b/sql-ledger/locale/lt/ic
@@ -0,0 +1,208 @@
+$self{texts} = {
+ 'Active' => 'Aktyvus',
+ 'Add' => 'Pridëti',
+ 'Add Assembly' => 'Pridëti rinkiná',
+ 'Add Part' => 'Pridëti prekæ',
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Add Service' => 'Pridëti Paslaugà',
+ 'Address' => 'Adresas',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Assemblies' => 'Rinkiniai',
+ 'Assemblies restocked!' => 'Rinkiniai persandeliuoti!',
+ 'Assembly Number missing!' => 'Rinkiniø numeriø nëra!',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'Bought' => 'Nupirkta',
+ 'COGS' => 'PPS',
+ 'Cannot delete item already invoiced!' => 'Negalima iðtrinti prekës, kuriai sukurta sàskaita-faktûra!',
+ 'Cannot delete item on order!' => 'Negalima iðtrinti prekës, kuri yra uþsakyme!',
+ 'Cannot delete item which is part of an assembly!' => 'Negalima iðtrinti prekës, kuri yra rinkinio dalis!',
+ 'Cannot delete item!' => 'Neámanoma iðtrinti prekës!',
+ 'Cannot stock assemblies!' => 'Neámanoma sandelioti rinkinius!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Description' => 'Apraðymas',
+ 'Drawing' => 'Brieþinys',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Edit Assembly' => 'Redaguoti rinkiná',
+ 'Edit Part' => 'Redaguoti prekæ',
+ 'Edit Service' => 'Redaguoti paslaugà',
+ 'Expense' => 'Sànaudos',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'Image' => 'Pieðinys',
+ 'In-line' => 'Vienaeilis',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Income' => 'Pajamos',
+ 'Individual Items' => 'Individualios prekës',
+ 'Inventory' => 'Prekës',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Prekës kiekis turi bûti lygus nuliui prieð paþymint rinkiná pasenusiu!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Prekës kiekis turi bûti lygus nuliui prieð paþymint ðià dalá pasenusia!',
+ 'Inventory quantity must be zero!' => 'Prekës kiekis turi bûti lygus nuliui!',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Item deleted!' => 'Vienetas iðtrintas!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Last Cost' => 'Paskutinë kaina',
+ 'Line Total' => 'Viso eilutëje',
+ 'Link Accounts' => 'Suriðti sàskaitas',
+ 'List Price' => 'Pirkimo kaina',
+ 'Make' => 'Gamintojas',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Microfiche' => 'Mikrofiða',
+ 'Model' => 'Modelis',
+ 'Name' => 'Vardas',
+ 'No.' => 'Num',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'Obsolete' => 'Pasenæ',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'On Hand' => 'Likutis',
+ 'On Order' => 'Uþsakyme',
+ 'Order' => 'Uþsakymas',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'Ordered' => 'Uþsakyta',
+ 'Orphaned' => 'Naðlaitinis',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Part' => 'Prekë',
+ 'Part Number missing!' => 'Prekës numerio nëra!',
+ 'Parts' => 'Prekës',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript(TM)',
+ 'Price' => 'Kaina',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Qty' => 'Kks',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Gaut',
+ 'Required by' => 'Iki kada',
+ 'Sales' => 'Pardavimai',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Save' => 'Iðsaugoti',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sell Price' => 'Pardavimo kaina',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Service Number missing!' => 'Paslaugos numerio nëra!',
+ 'Services' => 'Paslaugos',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Short' => 'Stoka',
+ 'Sold' => 'Parduota',
+ 'Stock Assembly' => 'Rinkiniai sandëlyje',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'Tax' => 'Mokëstis',
+ 'To' => 'iki',
+ 'Top Level' => 'Aukðèiausias lygis',
+ 'Total' => 'Ið viso',
+ 'Unit' => 'Vienetas',
+ 'Unit of measure' => 'Matavimo vienetas',
+ 'Update' => 'Atnaujinti',
+ 'Updated' => 'Atnaujinta',
+ 'Weight' => 'Svoris',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'ea' => 'kk',
+ 'emailed to' => 'email do',
+ 'hr' => 'val',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'pridëti' => 'add',
+ 'pridëti_rinkiná' => 'add_assembly',
+ 'pridëti_prekæ' => 'add_part',
+ 'pridëti_paslaugà' => 'add_service',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'redaguoti_rinkiná' => 'edit_assembly',
+ 'redaguoti_prekæ' => 'edit_part',
+ 'redaguoti_paslaugà' => 'edit_service',
+ 'iðsaugoti' => 'save',
+ 'atnaujinti' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/io b/sql-ledger/locale/lt/io
new file mode 100644
index 000000000..3b28ede41
--- /dev/null
+++ b/sql-ledger/locale/lt/io
@@ -0,0 +1,108 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Address' => 'Adresas',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Description' => 'Apraðymas',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Vienaeilis',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Name' => 'Vardas',
+ 'No.' => 'Num',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Order' => 'Uþsakymas',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Part' => 'Prekë',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript(TM)',
+ 'Price' => 'Kaina',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Qty' => 'Kks',
+ 'Recd' => 'Gaut',
+ 'Required by' => 'Iki kada',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Subject' => 'Dalykas',
+ 'To' => 'iki',
+ 'Unit' => 'Vienetas',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'tæsti' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/ir b/sql-ledger/locale/lt/ir
new file mode 100644
index 000000000..003b9a6b3
--- /dev/null
+++ b/sql-ledger/locale/lt/ir
@@ -0,0 +1,180 @@
+$self{texts} = {
+ 'Account' => 'Sàskaita',
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Invoice Number' => 'Ar Jus tikrai norite iðtrinti saskaitu-fakturos numeris:',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'Cannot delete invoice!' => 'Neámanoma iðtrinti sàskaitos-faktûros!',
+ 'Cannot post invoice for a closed period!' => 'Neámanoma patvirtinti sàskaitos-faktûros uþdarajam periodui!',
+ 'Cannot post invoice!' => 'Neámanoma patvirtinti sàskaitos-faktûros!',
+ 'Cannot post payment for a closed period!' => 'Neámanoma patvirtinti mokëjimo uþdarajam periodui!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Currency' => 'Valiûta',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Description' => 'Apraðymas',
+ 'Due Date' => 'Iki Data',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Edit Vendor Invoice' => 'Edit Vendor Invoice',
+ 'Exch' => 'Kurs.',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate for payment missing!' => 'Mokëjimo keitimo kurso nëra!',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Vienaeilis',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date' => 'Sàskaitos-faktûros data',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Invoice deleted!' => 'Sàskaitos-faktûra iðtrintos!',
+ 'Invoice posted!' => 'Sàskaitos-faktûra patvirtintos!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Name' => 'Vardas',
+ 'No.' => 'Num',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Order' => 'Uþsakymas',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Part' => 'Prekë',
+ 'Payment date missing!' => 'Mokëjimo datos nëra',
+ 'Payments' => 'Mokëjimai',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Postscript' => 'Postscript(TM)',
+ 'Price' => 'Kaina',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Qty' => 'Kks',
+ 'Recd' => 'Gaut',
+ 'Record in' => 'Áraðyti á',
+ 'Required by' => 'Iki kada',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Source' => 'Dokumentas',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'Tax Included' => 'su mokesèiais',
+ 'To' => 'iki',
+ 'Total' => 'Ið viso',
+ 'Unit' => 'Vienetas',
+ 'Update' => 'Atnaujinti',
+ 'Vendor' => 'Tiekëjas',
+ 'Vendor missing!' => 'Tiekëjo Vardo nëra!',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'Yes' => 'Taip',
+ 'ea' => 'kk',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'uþsakymas' => 'order',
+ 'patvirtinti' => 'post',
+ 'patvirtinti_kaip_naujà' => 'post_as_new',
+ 'atnaujinti' => 'update',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/is b/sql-ledger/locale/lt/is
new file mode 100644
index 000000000..d7b1e502b
--- /dev/null
+++ b/sql-ledger/locale/lt/is
@@ -0,0 +1,187 @@
+$self{texts} = {
+ 'Account' => 'Sàskaita',
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Invoice' => 'Pridëti Pardavimo sàskaità-faktûrà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Invoice Number' => 'Ar Jus tikrai norite iðtrinti saskaitu-fakturos numeris:',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'Cannot delete invoice!' => 'Neámanoma iðtrinti sàskaitos-faktûros!',
+ 'Cannot post invoice for a closed period!' => 'Neámanoma patvirtinti sàskaitos-faktûros uþdarajam periodui!',
+ 'Cannot post invoice!' => 'Neámanoma patvirtinti sàskaitos-faktûros!',
+ 'Cannot post payment for a closed period!' => 'Neámanoma patvirtinti mokëjimo uþdarajam periodui!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Credit Limit' => 'Kredito riba',
+ 'Currency' => 'Valiûta',
+ 'Customer' => 'Klientas',
+ 'Customer missing!' => 'Kliento vardo nëra!',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Description' => 'Apraðymas',
+ 'Due Date' => 'Iki Data',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Edit Sales Invoice' => 'Redaguoti pardavimo sàskaità-faktûrà',
+ 'Exch' => 'Kurs.',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate for payment missing!' => 'Mokëjimo keitimo kurso nëra!',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'In-line' => 'Vienaeilis',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date' => 'Sàskaitos-faktûros data',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number' => 'Sàskaitos-faktûros numeris',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Invoice deleted!' => 'Sàskaitos-faktûra iðtrintos!',
+ 'Invoice posted!' => 'Sàskaitos-faktûra patvirtintos!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Name' => 'Vardas',
+ 'No.' => 'Num',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Order' => 'Uþsakymas',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Part' => 'Prekë',
+ 'Payment date missing!' => 'Mokëjimo datos nëra',
+ 'Payments' => 'Mokëjimai',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Patvirtinti',
+ 'Post as new' => 'Patvirtinti kaip naujà',
+ 'Postscript' => 'Postscript(TM)',
+ 'Price' => 'Kaina',
+ 'Print' => 'Spausdinti',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Qty' => 'Kks',
+ 'Recd' => 'Gaut',
+ 'Record in' => 'Áraðyti á',
+ 'Remaining' => 'Likutis',
+ 'Required by' => 'Iki kada',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Ship via' => 'Pristatyti per',
+ 'Source' => 'Dokumentas',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'Tax Included' => 'su mokesèiais',
+ 'To' => 'iki',
+ 'Total' => 'Ið viso',
+ 'Unit' => 'Vienetas',
+ 'Update' => 'Atnaujinti',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'Yes' => 'Taip',
+ 'ea' => 'kk',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'e_paðtas' => 'e_mail',
+ 'uþsakymas' => 'order',
+ 'patvirtinti' => 'post',
+ 'patvirtinti_kaip_naujà' => 'post_as_new',
+ 'spausdinti' => 'print',
+ 'pristatyti_á' => 'ship_to',
+ 'atnaujinti' => 'update',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/login b/sql-ledger/locale/lt/login
new file mode 100644
index 000000000..8a42d2acb
--- /dev/null
+++ b/sql-ledger/locale/lt/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Apie...',
+ 'Database Host' => 'Duomenø bazës hostas',
+ 'Dataset' => 'Duomenø aibë',
+ 'Incorrect Dataset version!' => 'Neteisinga duomenø aibës versija!',
+ 'Incorrect Password!' => 'Neteisingas slaptaþodis!',
+ 'Licensed to' => 'Licenzijuota...',
+ 'Login' => 'Prisijungimas',
+ 'Name' => 'Vardas',
+ 'Password' => 'Slaptaþodis',
+ 'User' => 'Vartotojas',
+ 'Version' => 'Versija',
+ 'You are logged out!' => 'Jûs iðsijungëte!',
+ 'You did not enter a name!' => 'Neávedëte vardo!',
+ 'is not a member!' => 'nëra narys!',
+ 'localhost' => 'lokalhostas',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'prisijungimas' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/menu b/sql-ledger/locale/lt/menu
new file mode 100644
index 000000000..460ea5b95
--- /dev/null
+++ b/sql-ledger/locale/lt/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Pirkimai',
+ 'AP Aging' => 'Pirkimo Skolos',
+ 'AR' => 'Pardavimai',
+ 'AR Aging' => 'Pardavimo Skolos',
+ 'Accounting Menu' => 'Apskaitos Menu',
+ 'Add Account' => 'Pridëti sàskaità',
+ 'Add Assembly' => 'Pridëti rinkiná',
+ 'Add Customer' => 'Pridëti klientà',
+ 'Add GIFI' => 'Pridëti GIFI',
+ 'Add Part' => 'Pridëti prekæ',
+ 'Add Project' => 'Pridëti proektà',
+ 'Add Service' => 'Pridëti Paslaugà',
+ 'Add Transaction' => 'Pridëti Operacijà',
+ 'Add Vendor' => 'Pridëti Tiekëja',
+ 'Assemblies' => 'Rinkiniai',
+ 'Audit Control' => 'Audito kontrolë',
+ 'Backup' => 'Reservinë kopija',
+ 'Balance Sheet' => 'Balanso lëntelë',
+ 'Cash' => 'Kasa',
+ 'Chart of Accounts' => 'Sàskaitø planas',
+ 'Check' => 'Èekis',
+ 'Customers' => 'Klientai',
+ 'General Ledger' => 'Bendrasis þurnalas',
+ 'Goods & Services' => 'Prekës ir Paslaugos',
+ 'HTML Templates' => 'HTML ðablonai',
+ 'Income Statement' => 'Pelno/nuostolio ataskaita',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'LaTeX Templates' => 'LaTeX ðablonai',
+ 'List Accounts' => 'Sàskaitø sàraðas',
+ 'List GIFI' => 'GIFI sàraðas',
+ 'Logout' => 'Iðsijungti',
+ 'Order Entry' => 'Uþsakymo áraðas',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Parts' => 'Prekës',
+ 'Payment' => 'Mokëjimas',
+ 'Payments' => 'Mokëjimai',
+ 'Preferences' => 'Nuostatos',
+ 'Projects' => 'Projektai',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Purchase Orders' => 'Pirkimo uþsakymai',
+ 'Receipt' => 'Kasos orderis',
+ 'Receipts' => 'Kasos orderiai',
+ 'Reconciliation' => 'Sutaikinimas',
+ 'Reports' => 'Ataskaitos',
+ 'Sales Invoice' => 'Pardavimo SF',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Sales Orders' => 'Pardavimø uþsakymai',
+ 'Save to File' => 'Iðsaugoti á failà',
+ 'Send by E-Mail' => 'Iðsiûsti e-paðtu',
+ 'Services' => 'Paslaugos',
+ 'Statement' => 'Suvestinë',
+ 'Stock Assembly' => 'Rinkiniai sandëlyje',
+ 'Stylesheet' => 'Stiliø lentelë',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Mokesèiai surinkti',
+ 'Tax paid' => 'Mokesèiai sumokëti',
+ 'Transactions' => 'Operacijos',
+ 'Trial Balance' => 'Bandomasis balansas',
+ 'Vendor Invoice' => 'Vendor Invoice',
+ 'Vendors' => 'Tiekëjai',
+ 'Version' => 'Versija',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/oe b/sql-ledger/locale/lt/oe
new file mode 100644
index 000000000..c0786c129
--- /dev/null
+++ b/sql-ledger/locale/lt/oe
@@ -0,0 +1,202 @@
+$self{texts} = {
+ 'Add' => 'Pridëti',
+ 'Add Purchase Order' => 'Pridëti Pirkimo uþsakymà',
+ 'Add Sales Invoice' => 'Pridëti Pardavimo sàskaità-faktûrà',
+ 'Add Sales Order' => 'Pridëti Pardavimo uþsakymà',
+ 'Add Vendor Invoice' => 'Add Vendor Invoice',
+ 'Address' => 'Adresas',
+ 'Amount' => 'Suma',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Are you sure you want to delete Order Number' => 'Ar Jus tikrai norite iðtrinti uzsakimas numeris:',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Dëþë',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Neámanoma iðtrinti uþsakymo!',
+ 'Cannot save order!' => 'Neámanoma iðsaugoti uþsakymo!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Uþdaryta',
+ 'Confirm!' => 'Patvirtinti!',
+ 'Contact' => 'Kontaktas',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Credit Limit' => 'Kredito riba',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valiûta',
+ 'Customer' => 'Klientas',
+ 'Customer missing!' => 'Kliento vardo nëra!',
+ 'Customer not on file!' => 'Tokio kliento nëra!',
+ 'Date' => 'Data',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Delete' => 'Iðtrinti',
+ 'Delivery Date' => 'Prystatimo Data',
+ 'Description' => 'Apraðymas',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail address missing!' => 'E-paðto adreso nëra!',
+ 'Edit Purchase Order' => 'Redaguoti pirkimo uþsakymà',
+ 'Edit Sales Order' => 'Redaguoti pardavimo uþsakymà',
+ 'Exchangerate' => 'Keitimo kursas',
+ 'Exchangerate missing!' => 'Keitimo kurso nëra!',
+ 'Extended' => 'Iðplësta',
+ 'Fax' => 'Faksas',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'Group' => 'Group',
+ 'Group Items' => 'Group Items',
+ 'ID' => 'ID',
+ 'In-line' => 'Vienaeilis',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Invoice Date missing!' => 'Sàskaitos-faktûros datos nëra!',
+ 'Invoice Number missing!' => 'Sàskaitos-faktûra numerio nëra!',
+ 'Item not on file!' => 'Vieneto nëra áraðuose!',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'Name' => 'Vardas',
+ 'No.' => 'Num',
+ 'Notes' => 'Pastaba',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Number' => 'Numeris',
+ 'Number missing in Row' => 'Numerio nëra eilëje',
+ 'O' => 'O',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'Open' => 'Atidaryti',
+ 'Order' => 'Uþsakymas',
+ 'Order Date' => 'Uþsakymo data',
+ 'Order Date missing!' => 'Uþsakymo datos nëra!',
+ 'Order Number' => 'Uþsakymo numeris',
+ 'Order Number missing!' => 'Uþsakymo numerio nëra!',
+ 'Order deleted!' => 'Uþsakymai iðtrinti!',
+ 'Order saved!' => 'Uþsakymas iðsaugotas!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Ápakavimo sàraðas',
+ 'Packing List Date missing!' => 'Ápakavimo sàraðo datos nëra!',
+ 'Packing List Number missing!' => 'Ápakavimo sàraðo numerio nëra!',
+ 'Part' => 'Prekë',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript(TM)',
+ 'Price' => 'Kaina',
+ 'Print' => 'Spausdinti',
+ 'Printer' => 'Spausdintuvas',
+ 'Project' => 'Projektas',
+ 'Project not on file!' => 'Nëra tokio projekto!',
+ 'Purchase Order' => 'Pirkimo uþsakymas',
+ 'Purchase Orders' => 'Pirkimo uþsakymai',
+ 'Qty' => 'Kks',
+ 'Recd' => 'Gaut',
+ 'Remaining' => 'Likutis',
+ 'Required by' => 'Iki kada',
+ 'Sales Order' => 'Pardavimø uþsakymas',
+ 'Sales Orders' => 'Pardavimø uþsakymai',
+ 'Save' => 'Iðsaugoti',
+ 'Save as new' => 'Iðsaugoti kaip naujà',
+ 'Screen' => 'Ekranas',
+ 'Select from one of the items below' => 'Iðrinkite vienà ið prekiø apaèioje',
+ 'Select from one of the names below' => 'Iðrinkite vienà ið pavadinimø apaèioje',
+ 'Select from one of the projects below' => 'Iðrinkite vienà ið projektø apaèioje',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Service' => 'Paslauga',
+ 'Ship' => 'Pristatymas',
+ 'Ship to' => 'Pristatyti á',
+ 'Ship via' => 'Pristatyti per',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'Tax' => 'Mokëstis',
+ 'Tax Included' => 'su mokesèiais',
+ 'Terms: Net' => 'Terminas: ',
+ 'To' => 'iki',
+ 'Total' => 'Ið viso',
+ 'Unit' => 'Vienetas',
+ 'Update' => 'Atnaujinti',
+ 'Vendor' => 'Tiekëjas',
+ 'Vendor missing!' => 'Tiekëjo Vardo nëra!',
+ 'Vendor not on file!' => 'Tokio tiekëjo nëra!',
+ 'What type of item is this?' => 'Koks ðio dalyko tipas?',
+ 'Yes' => 'Taip',
+ 'days' => 'dienos',
+ 'ea' => 'kk',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'pasiûsta á spausdintuvà',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'yes' => 'yes',
+ 'pridëti' => 'add',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'e_paðtas' => 'e_mail',
+ 'sàskaita_faktûra' => 'invoice',
+ 'spausdinti' => 'print',
+ 'iðsaugoti' => 'save',
+ 'iðsaugoti_kaip_naujà' => 'save_as_new',
+ 'pristatyti_á' => 'ship_to',
+ 'atnaujinti' => 'update',
+ 'taip' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/pe b/sql-ledger/locale/lt/pe
new file mode 100644
index 000000000..fa58e628c
--- /dev/null
+++ b/sql-ledger/locale/lt/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Pridëti',
+ 'Add Project' => 'Pridëti proektà',
+ 'All' => 'Visi',
+ 'Continue' => 'Tæsti',
+ 'Delete' => 'Iðtrinti',
+ 'Description' => 'Apraðymas',
+ 'Edit Project' => 'Redaguoti projektà',
+ 'Number' => 'Numeris',
+ 'Orphaned' => 'Naðlaitinis',
+ 'Project' => 'Projektas',
+ 'Project Number missing!' => 'Projekto numerio nëra!',
+ 'Project deleted!' => 'Projektas iðtrintas!',
+ 'Project saved!' => 'Projektas iðsaugotas!',
+ 'Projects' => 'Projektai',
+ 'Save' => 'Iðsaugoti',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'pridëti' => 'add',
+ 'tæsti' => 'continue',
+ 'iðtrinti' => 'delete',
+ 'iðsaugoti' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/rc b/sql-ledger/locale/lt/rc
new file mode 100644
index 000000000..7e575848f
--- /dev/null
+++ b/sql-ledger/locale/lt/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Sàskaita',
+ 'Balance' => 'Balansas',
+ 'Cleared Balance' => 'Baigiamasis balansas',
+ 'Continue' => 'Tæsti',
+ 'Date' => 'Data',
+ 'Deposit' => 'Depozitas',
+ 'Description' => 'Apraðymas',
+ 'Difference' => 'Skirtumas',
+ 'Done' => 'Ávykdyta',
+ 'Exchangerate Difference' => 'Keitimo kurso skirtumas',
+ 'From' => 'Nuo',
+ 'Out of balance!' => 'Nesubalansuota!',
+ 'Payment' => 'Mokëjimas',
+ 'Reconciliation' => 'Sutaikinimas',
+ 'Select all' => 'Iðrinkti viskà',
+ 'Source' => 'Dokumentas',
+ 'Statement Balance' => 'Balanso suvestinë',
+ 'Update' => 'Atnaujinti',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'tæsti' => 'continue',
+ 'Ávykdyta' => 'done',
+ 'iðrinkti_viskà' => 'select_all',
+ 'atnaujinti' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/lt/rp b/sql-ledger/locale/lt/rp
new file mode 100644
index 000000000..83cb9c062
--- /dev/null
+++ b/sql-ledger/locale/lt/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Pirkimo Skolos',
+ 'AR Aging' => 'Pardavimo Skolos',
+ 'Account' => 'Sàskaita',
+ 'Accounts' => 'Sàskaitos',
+ 'Amount' => 'Suma',
+ 'Apr' => 'Bal',
+ 'April' => 'Balandis',
+ 'Attachment' => 'Prisegta',
+ 'Aug' => 'Rug',
+ 'August' => 'Rugpjûtis',
+ 'Balance' => 'Balansas',
+ 'Balance Sheet' => 'Balanso lëntelë',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Grynais',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Palyginti su',
+ 'Continue' => 'Tæsti',
+ 'Copies' => 'Kopijos',
+ 'Credit' => 'Kreditas',
+ 'Current' => 'Dabartinis',
+ 'Customer' => 'Klientas',
+ 'Date' => 'Data',
+ 'Debit' => 'Debetas',
+ 'Dec' => 'Grd',
+ 'December' => 'Gruodis',
+ 'Decimalplaces' => 'Skaièiø po taðko',
+ 'Department' => 'Department',
+ 'Description' => 'Apraðymas',
+ 'Due' => 'Iki',
+ 'E-mail' => 'E-paðtas',
+ 'E-mail Statement to' => 'Suvestinæ suisti per e-pastà á',
+ 'Feb' => 'Vas',
+ 'February' => 'Vasaris',
+ 'From' => 'Nuo',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Antraðtë',
+ 'ID' => 'ID',
+ 'In-line' => 'Vienaeilis',
+ 'Include in Report' => 'Ádëti á ataskaità',
+ 'Income Statement' => 'Pelno/nuostolio ataskaita',
+ 'Invoice' => 'Sàskaita-faktûra',
+ 'Jan' => 'Sau',
+ 'January' => 'Sausis',
+ 'Jul' => 'Lie',
+ 'July' => 'Liepa',
+ 'Jun' => 'Bir',
+ 'June' => 'Birþelis',
+ 'Mar' => 'Kov',
+ 'March' => 'Kovas',
+ 'May' => 'Geg',
+ 'May ' => 'Geguþë',
+ 'Message' => 'Þinutë',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nieko neiðrinkta!',
+ 'Nov' => 'Lap',
+ 'November' => 'Lapkritis',
+ 'Oct' => 'Spa',
+ 'October' => 'Spalis',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Mokëjimai',
+ 'Postscript' => 'Postscript(TM)',
+ 'Print' => 'Spausdinti',
+ 'Printer' => 'Spausdintuvas',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'Kasos orderiai',
+ 'Report for' => 'Ataskaita...',
+ 'Retained Earnings' => 'Turimi uþdarbiai',
+ 'Screen' => 'Ekranas',
+ 'Select all' => 'Iðrinkti viskà',
+ 'Select postscript or PDF!' => 'Iðrinkite postscript arba PDF!',
+ 'Sep' => 'Rgs',
+ 'September' => 'Rûgsëjis',
+ 'Source' => 'Dokumentas',
+ 'Standard' => 'Standartas',
+ 'Statement' => 'Suvestinë',
+ 'Statement sent to' => 'Siusti suvestinæ á',
+ 'Statements sent to printer!' => 'Siusti suvestinæ á spausdintuvà!',
+ 'Subject' => 'Dalykas',
+ 'Subtotal' => 'Viso',
+ 'Tax' => 'Mokëstis',
+ 'Tax collected' => 'Mokesèiai surinkti',
+ 'Tax paid' => 'Mokesèiai sumokëti',
+ 'Total' => 'Ið viso',
+ 'Trial Balance' => 'Bandomasis balansas',
+ 'Vendor' => 'Tiekëjas',
+ 'as at' => 'kaip',
+ 'collected on sales' => 'surinkta per pardavimus',
+ 'for Period' => 'periodui',
+ 'paid on purchases' => 'apmokëta per pirkimus',
+ 'to' => 'iki',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'tæsti' => 'continue',
+ 'e_paðtas' => 'e_mail',
+ 'spausdinti' => 'print',
+ 'iðrinkti_viskà' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/COPYING b/sql-ledger/locale/mx/COPYING
new file mode 100644
index 000000000..314fc90f7
--- /dev/null
+++ b/sql-ledger/locale/mx/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Spanish texts (Mexico):
+#
+# Author: Alberto Ladron <h@grupoh.com.mx>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/mx/LANGUAGE b/sql-ledger/locale/mx/LANGUAGE
new file mode 100644
index 000000000..22549dbb1
--- /dev/null
+++ b/sql-ledger/locale/mx/LANGUAGE
@@ -0,0 +1 @@
+Mexican Spanish
diff --git a/sql-ledger/locale/mx/admin b/sql-ledger/locale/mx/admin
new file mode 100644
index 000000000..707b48959
--- /dev/null
+++ b/sql-ledger/locale/mx/admin
@@ -0,0 +1,128 @@
+$self{texts} = {
+ 'Access Control' => 'Control de Acceso',
+ 'Accounting' => 'Contabilidad',
+ 'Add User' => 'Agregar Usuario',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => '! Todos los conjuntos de datos estan actualizados !',
+ 'Change Admin Password' => 'Cambiar Contraseña de Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de entrada a
+editar',
+ 'Company' => 'Compañía',
+ 'Connect to' => 'Conectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear set de datos',
+ 'DBI not installed!' => 'DBI no instalado!',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => '!No selecciono driver de base de datos!',
+ 'Database User missing!' => 'No se encuentra usuario de base de datos',
+ 'Dataset' => 'Set de datos',
+ 'Dataset missing!' => 'No se encuentra Set de datos!',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Formato de Fecha',
+ 'Delete' => 'Borrar',
+ 'Delete Dataset' => 'Borrar Set de Datos',
+ 'Directory' => 'Directorio',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Correo Electrónico',
+ 'Edit User' => 'Editar Usuario',
+ 'Existing Datasets' => 'Sets de dato existentes',
+ 'Fax' => 'Fax',
+ 'Host' => 'Servidor base de datos',
+ 'Hostname missing!' => 'No se encuentra servidor de base de datos',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Language' => 'Lenguaje',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Login' => 'Login',
+ 'Name' => 'Nombre',
+ 'New Templates' => 'Nuevas Plantillas',
+ 'No Database Drivers available!' => 'No hay manejador de base de datos
+disponible!',
+ 'No Dataset selected!' => 'No se ha seleccionado el set de datos',
+ 'Nothing to delete!' => '!Nada para borrar!',
+ 'Number Format' => 'Formato de Numero',
+ 'Oracle Database Administration' => 'Oracle Administración de base de datos',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Pg Administración de base de datos',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se encuentra el Puerto!',
+ 'Printer' => 'Impresora',
+ 'Save' => 'Salvar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione un set de
+datos para borrar y presione "Continuar"',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Templates' => 'Plantillas',
+ 'The following Datasets are not in use and can be deleted' => 'Los
+siguientes sets de datos no estan en uso y pueden ser borrados',
+ 'The following Datasets need to be updated' => 'Es necesario actualizar las siguientes bases de datos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. Nada será creado o borrado en esta etapa!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el nombre de entrada (login) y guarde los cambios. Un nuevo usuario, con las mismas variables será guardado bajo el nuevo nombre de entrada. (login)',
+ 'Update Dataset' => 'Actualizar conjunto de datos',
+ 'Use Templates' => 'Plantillas de Usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Versión',
+ 'You must enter a host and port for local and remote connections!' => 'Debe
+introducir un servidor de base de datos y un puerto para conexiones locales y
+remotas!',
+ 'does not exist' => 'No existe',
+ 'is already a member!' => 'ya es miembro!',
+ 'localhost' => 'servidor local',
+ 'successfully created!' => 'creado con éxito!',
+ 'successfully deleted!' => 'creado con éxito!',
+ 'website' => 'sitio web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'agregar_usuario' => 'add_user',
+ 'cambiar_contraseña_de_administrador' => 'change_admin_password',
+ 'cambiar_contraseña' => 'change_password',
+ 'continuar' => 'continue',
+ 'crear_set_de_datos' => 'create_dataset',
+ 'borrar' => 'delete',
+ 'borrar_set_de_datos' => 'delete_dataset',
+ 'login' => 'login',
+ 'oracle_administración_de_base_de_datos' => 'oracle_database_administration',
+ 'pg_administración_de_base_de_datos' => 'pg_database_administration',
+ 'salvar' => 'save',
+ 'actualizar_conjunto_de_datos' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/all b/sql-ledger/locale/mx/all
new file mode 100644
index 000000000..b3761a7a9
--- /dev/null
+++ b/sql-ledger/locale/mx/all
@@ -0,0 +1,496 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'Transacciones - Cuentas por Pagar',
+ 'AR' => 'Ctas X Cobrar',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'Transacciones de Cuentas por Cobrar',
+ 'About' => 'Acerca',
+ 'Access Control' => 'Control de Acceso',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'No existe el número de cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'No existe el tipo de la cuenta!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Contabilidad',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Accounts' => 'Cuentas',
+ 'Active' => '',
+ 'Add' => 'Agregar',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Add General Ledger Transaction' => 'Agregar Transacción - Mayor General',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transaccion',
+ 'Add User' => 'Agregar Usuario',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => '',
+ 'All' => 'Todos',
+ 'All Datasets up to date!' => '! Todos los conjuntos de datos estan actualizados !',
+ 'Amount' => 'Total',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la Orden No.:?',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Assemblies' => 'Ensamblajes',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'No existe Numero de Ensamblaje!',
+ 'Asset' => 'Activo',
+ 'Attachment' => 'Adjunto',
+ 'Audit Control' => 'Control de auditoria',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => '',
+ 'Backup' => 'Respaldo',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Balance' => '',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => '',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Los libros estan abiertos',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'Numero de Negocio',
+ 'C' => '',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'No se puede borrar cuenta por defecto!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'No puede suprimir el item ya facturado!',
+ 'Cannot delete item on order!' => 'No se puede eliminar un elemnto presente en una orden',
+ 'Cannot delete item which is part of an assembly!' => 'No puede suprimir un item que es parte de un ensamblaje!',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Cambiar Contraseña de Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de entrada a
+editar',
+ 'Close Books up to' => 'Se cerraron los libros hasta',
+ 'Closed' => 'Cerrado',
+ 'Company' => 'Compañía',
+ 'Compare to' => 'Comparar a',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Conectar a',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Copy to COA' => 'Copiar al catálogo de cuentas',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear set de datos',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Curr' => 'Mon.',
+ 'Currency' => 'Moneda',
+ 'Current' => '',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'DBI no instalado!',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => '!No selecciono driver de base de datos!',
+ 'Database Host' => 'Servidor de Base de Datos',
+ 'Database User missing!' => 'No se encuentra usuario de base de datos',
+ 'Dataset' => 'Set de datos',
+ 'Dataset missing!' => 'No se encuentra Set de datos!',
+ 'Dataset updated!' => '',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Date Format' => 'Formato de Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Date missing!' => '',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance.',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => '',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Delete Dataset' => 'Borrar Set de Datos',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'Descripción',
+ 'Difference' => '',
+ 'Directory' => 'Directorio',
+ 'Discount' => 'Descuento',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Vence',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit' => '',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'Editar Ensamblaje',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Editar Remisión',
+ 'Edit Service' => 'Editar Servicio',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Edit User' => 'Editar Usuario',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => 'Forzar la anulación de las transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Existing Datasets' => 'Sets de dato existentes',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Egreso',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'Foreign Exchange Gain' => 'Ganancia en Moneda Extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en Moneda Extranjera',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => 'No se ha definido el código GIFI',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Bienes y servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Heading' => 'Encabezado',
+ 'Host' => 'Servidor base de datos',
+ 'Hostname missing!' => 'No se encuentra servidor de base de datos',
+ 'ID' => 'ID',
+ 'Image' => '',
+ 'In-line' => 'En linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Include in drop-down menus' => 'Incluya en menús desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluya esta cuenta en las formas del cliente/proveedor para señalar al cliente/proveedor como gravable de impuesto?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Incorrect Dataset version!' => '!Versisn incorrecta de conjunto de datos!',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este ensamblaje a obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar esta parte a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser
+cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'Es esta una cuenta de resumen a registrar?',
+ 'Item deleted!' => '',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'LaTeX Templates' => 'Plantillas de LaTeX',
+ 'Language' => 'Lenguaje',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultima Orden de Compra',
+ 'Last Sales Order Number' => 'Número del último presupuesto',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Liability' => 'Pasivo',
+ 'Licensed to' => 'Licenciado a',
+ 'Line Total' => 'Total de la linea',
+ 'Link' => 'Enlaces',
+ 'Link Accounts' => 'Enlazar Cuentas',
+ 'List Accounts' => 'Listar Cuentas',
+ 'List GIFI' => 'Listar código GIFI',
+ 'List Price' => 'Precio de Lista',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Login' => 'Login',
+ 'Logout' => 'Salir',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => '',
+ 'Model' => 'Modelo',
+ 'N/A' => 'N/A',
+ 'Name' => 'Nombre',
+ 'Name missing!' => '',
+ 'New Templates' => 'Nuevas Plantillas',
+ 'No' => 'No',
+ 'No Database Drivers available!' => 'No hay manejador de base de datos
+disponible!',
+ 'No Dataset selected!' => 'No se ha seleccionado el set de datos',
+ 'No email address for' => 'Falta email para',
+ 'No.' => '',
+ 'Notes' => 'Notas',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => '!Nada para borrar!',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de Numero',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'O' => '',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'En Existencia',
+ 'On Order' => '',
+ 'Open' => 'Abierto',
+ 'Oracle Database Administration' => 'Oracle Administración de base de datos',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Entry' => 'Orden de Entrada',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'Huerfano',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Paid' => 'Total Pagado',
+ 'Paid in full' => '',
+ 'Part' => 'Partes',
+ 'Part Number missing!' => 'Falta del número de pieza!',
+ 'Parts' => 'Partes',
+ 'Parts Inventory' => 'Inventario de Partes',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => '',
+ 'Payables' => 'Por Pagar',
+ 'Payment' => 'Pago',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payment posted!' => '',
+ 'Payments' => 'Pagos',
+ 'Pg Database Administration' => 'Pg Administración de base de datos',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se encuentra el Puerto!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Preferencias',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Price' => 'Precio',
+ 'Print' => '',
+ 'Printer' => 'Impresora',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'ROP',
+ 'Rate' => 'Tarifa',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Por Cobrar',
+ 'Reconciliation' => '',
+ 'Record in' => 'Registrar en',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => 'Faltan',
+ 'Report for' => 'Informe para',
+ 'Reports' => 'Reportes',
+ 'Required by' => 'Requerido por',
+ 'Retained Earnings' => 'Ganacias Retenidas',
+ 'Sales' => 'Ventas',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save' => 'Salvar',
+ 'Save as new' => '',
+ 'Save to File' => 'Guardar en archivo',
+ 'Screen' => 'Pantalla',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione un set de
+datos para borrar y presione "Continuar"',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Precio de Venta',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Items' => 'Items de Servicio',
+ 'Service Number missing!' => 'Falta el número de servicio!',
+ 'Services' => 'Servicios',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Corto',
+ 'Signature' => 'Firma',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estándard',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'Sistema',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas De Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Gravable de Impuesto',
+ 'Template saved!' => '',
+ 'Templates' => 'Plantillas',
+ 'Terms: Net' => 'Crédito',
+ 'The following Datasets are not in use and can be deleted' => 'Los
+siguientes sets de datos no estan en uso y pueden ser borrados',
+ 'The following Datasets need to be updated' => 'Es necesario actualizar las siguientes bases de datos',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. Nada será creado o borrado en esta etapa!',
+ 'To' => 'Hasta ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el nombre de entrada (login) y guarde los cambios. Un nuevo usuario, con las mismas variables será guardado bajo el nuevo nombre de entrada. (login)',
+ 'Top Level' => '',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Falta la fecha de la transacción!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => 'Se ha forzado la anulación de las transacciones para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Se ha forzado la anulación de las transacciones hasta',
+ 'Transactions' => 'Transacciones',
+ 'Transactions exist, cannot delete customer!' => 'Las transacciones existen, no pueden suprimir el cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Las transacciones existen, no pueden suprimir a proveedor',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen,
+no puede suprimir la cuenta!',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => '',
+ 'Update Dataset' => 'Actualizar conjunto de datos',
+ 'Updated' => '',
+ 'Use Templates' => 'Plantillas de Usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Proveedor',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'Versión',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Year End' => 'Fin del Año Fiscal',
+ 'Yes' => 'Si',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'No introdujo un nombre!',
+ 'You must enter a host and port for local and remote connections!' => 'Debe
+introducir un servidor de base de datos y un puerto para conexiones locales y
+remotas!',
+ 'as at' => '',
+ 'collected on sales' => 'ingresado en ventas',
+ 'days' => 'Días',
+ 'does not exist' => 'No existe',
+ 'ea' => 'c/u',
+ 'emailed to' => 'Se envio email a',
+ 'for Period' => 'para el período',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ya es miembro!',
+ 'is not a member!' => '!no es miembro!',
+ 'localhost' => 'servidor local',
+ 'paid on purchases' => 'pagado en compras',
+ 'sent to printer' => 'Enviado a la impresora',
+ 'successfully created!' => 'creado con éxito!',
+ 'successfully deleted!' => 'creado con éxito!',
+ 'to' => '',
+ 'website' => 'sitio web',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/am b/sql-ledger/locale/mx/am
new file mode 100644
index 000000000..d96b138a3
--- /dev/null
+++ b/sql-ledger/locale/mx/am
@@ -0,0 +1,140 @@
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AR' => 'Ctas X Cobrar',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'No existe el número de cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'No existe el tipo de la cuenta!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Address' => 'Dirección',
+ 'Asset' => 'Activo',
+ 'Audit Control' => 'Control de auditoria',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Books are open' => 'Los libros estan abiertos',
+ 'Business Number' => 'Numero de Negocio',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'No se puede borrar cuenta por defecto!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Close Books up to' => 'Se cerraron los libros hasta',
+ 'Company' => 'Compañía',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar al catálogo de cuentas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato de Fecha',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Description' => 'Descripción',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Correo Electrónico',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Enforce transaction reversal for all dates' => 'Forzar la anulación de las transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Egreso',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Ganancia en Moneda Extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en Moneda Extranjera',
+ 'GIFI' => 'Código GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'No se ha definido el código GIFI',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Encabezado',
+ 'Include in drop-down menus' => 'Incluya en menús desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluya esta cuenta en las formas del cliente/proveedor para señalar al cliente/proveedor como gravable de impuesto?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Is this a summary account to record' => 'Es esta una cuenta de resumen a registrar?',
+ 'Language' => 'Lenguaje',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultima Orden de Compra',
+ 'Last Sales Order Number' => 'Número del último presupuesto',
+ 'Liability' => 'Pasivo',
+ 'Link' => 'Enlaces',
+ 'Name' => 'Nombre',
+ 'No' => 'No',
+ 'No email address for' => 'Falta email para',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de Numero',
+ 'Parts Inventory' => 'Inventario de Partes',
+ 'Password' => 'Contraseña',
+ 'Payables' => 'Por Pagar',
+ 'Payment' => 'Pago',
+ 'Phone' => 'Teléfono',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Rate' => 'Tarifa',
+ 'Receivables' => 'Por Cobrar',
+ 'Sales' => 'Ventas',
+ 'Save' => 'Salvar',
+ 'Service Items' => 'Items de Servicio',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas De Impuesto',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Se ha forzado la anulación de las transacciones para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Se ha forzado la anulación de las transacciones hasta',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen,
+no puede suprimir la cuenta!',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'Year End' => 'Fin del Año Fiscal',
+ 'Yes' => 'Si',
+ 'does not exist' => 'No existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'agregar_cuenta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_al_catálogo_de_cuentas' => 'copy_to_coa',
+ 'borrar' => 'delete',
+ 'edit' => 'edit',
+ 'editar_cuenta' => 'edit_account',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ap b/sql-ledger/locale/mx/ap
new file mode 100644
index 000000000..68d095cdb
--- /dev/null
+++ b/sql-ledger/locale/mx/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'Transacciones - Cuentas por Pagar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post transaction for a closed period!' => 'No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Total Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ar b/sql-ledger/locale/mx/ar
new file mode 100644
index 000000000..3f2fd0e7d
--- /dev/null
+++ b/sql-ledger/locale/mx/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'Transacciones de Cuentas por Cobrar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post transaction for a closed period!' => 'No se puede registrar una transacción para un periodo cerrado',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Total Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Faltan',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/arap b/sql-ledger/locale/mx/arap
new file mode 100644
index 000000000..f541192a7
--- /dev/null
+++ b/sql-ledger/locale/mx/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Dirección',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Descripción',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ca b/sql-ledger/locale/mx/ca
new file mode 100644
index 000000000..5d43318b2
--- /dev/null
+++ b/sql-ledger/locale/mx/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Description' => 'Descripción',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'Include in Report' => 'Incluya en informe',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transacciones' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/cp b/sql-ledger/locale/mx/cp
new file mode 100644
index 000000000..95085e00a
--- /dev/null
+++ b/sql-ledger/locale/mx/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'From' => 'Desde',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Pago',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'Hasta ',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ct b/sql-ledger/locale/mx/ct
new file mode 100644
index 000000000..0db8902c6
--- /dev/null
+++ b/sql-ledger/locale/mx/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Borrar',
+ 'Discount' => 'Descuento',
+ 'E-mail' => 'Correo Electrónico',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nombre',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Notas',
+ 'Number' => 'Número',
+ 'Order' => 'Orden',
+ 'Orphaned' => 'Huerfano',
+ 'Phone' => 'Teléfono',
+ 'Save' => 'Salvar',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Taxable' => 'Gravable de Impuesto',
+ 'Terms: Net' => 'Crédito',
+ 'Transactions exist, cannot delete customer!' => 'Las transacciones existen, no pueden suprimir el cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Las transacciones existen, no pueden suprimir a proveedor',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'Días',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'factura' => 'invoice',
+ 'orden' => 'order',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/gl b/sql-ledger/locale/mx/gl
new file mode 100644
index 000000000..b0957b69b
--- /dev/null
+++ b/sql-ledger/locale/mx/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'Cuenta',
+ 'Add General Ledger Transaction' => 'Agregar Transacción - Mayor General',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Asset' => 'Activo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'No se puede registrar una transacción para un periodo cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance.',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Mayor General',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income' => 'Ingreso',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Liability' => 'Pasivo',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+ 'Transaction Date missing!' => 'Falta la fecha de la transacción!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ic b/sql-ledger/locale/mx/ic
new file mode 100644
index 000000000..e5e1a86fe
--- /dev/null
+++ b/sql-ledger/locale/mx/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Agregar',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Add Service' => 'Agregar Servicio',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Ensamblajes',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'No existe Numero de Ensamblaje!',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete item already invoiced!' => 'No puede suprimir el item ya facturado!',
+ 'Cannot delete item on order!' => 'No se puede eliminar un elemnto presente en una orden',
+ 'Cannot delete item which is part of an assembly!' => 'No puede suprimir un item que es parte de un ensamblaje!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Assembly' => 'Editar Ensamblaje',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Service' => 'Editar Servicio',
+ 'Expense' => 'Egreso',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'Image' => 'Image',
+ 'In-line' => 'En linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income' => 'Ingreso',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este ensamblaje a obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar esta parte a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser
+cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Line Total' => 'Total de la linea',
+ 'Link Accounts' => 'Enlazar Cuentas',
+ 'List Price' => 'Precio de Lista',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'En Existencia',
+ 'On Order' => 'On Order',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Huerfano',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Part' => 'Partes',
+ 'Part Number missing!' => 'Falta del número de pieza!',
+ 'Parts' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Requerido por',
+ 'Sales' => 'Ventas',
+ 'Sales Order' => 'Orden de venta',
+ 'Save' => 'Salvar',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Precio de Venta',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Number missing!' => 'Falta el número de servicio!',
+ 'Services' => 'Servicios',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Corto',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'To' => 'Hasta ',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'ea' => 'c/u',
+ 'emailed to' => 'Se envio email a',
+ 'hr' => 'hr',
+ 'sent to printer' => 'Enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'agregar' => 'add',
+ 'agregar_ensamblaje' => 'add_assembly',
+ 'agregar_parte' => 'add_part',
+ 'agregar_servicio' => 'add_service',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_ensamblaje' => 'edit_assembly',
+ 'editar_parte' => 'edit_part',
+ 'editar_servicio' => 'edit_service',
+ 'salvar' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/io b/sql-ledger/locale/mx/io
new file mode 100644
index 000000000..89258a8e5
--- /dev/null
+++ b/sql-ledger/locale/mx/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Part' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Asunto',
+ 'To' => 'Hasta ',
+ 'Unit' => 'Unidad',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'emailed to' => 'Se envio email a',
+ 'sent to printer' => 'Enviado a la impresora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/ir b/sql-ledger/locale/mx/ir
new file mode 100644
index 000000000..2df2b83b6
--- /dev/null
+++ b/sql-ledger/locale/mx/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Part' => 'Partes',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registrar en',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'ea' => 'c/u',
+ 'emailed to' => 'Se envio email a',
+ 'sent to printer' => 'Enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'orden' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/is b/sql-ledger/locale/mx/is
new file mode 100644
index 000000000..9286ecbe0
--- /dev/null
+++ b/sql-ledger/locale/mx/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Part' => 'Partes',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registrar en',
+ 'Remaining' => 'Faltan',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'ea' => 'c/u',
+ 'emailed to' => 'Se envio email a',
+ 'sent to printer' => 'Enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'orden' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/login b/sql-ledger/locale/mx/login
new file mode 100644
index 000000000..0e7f5b8d1
--- /dev/null
+++ b/sql-ledger/locale/mx/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Acerca',
+ 'Accounting' => 'Contabilidad',
+ 'Database Host' => 'Servidor de Base de Datos',
+ 'Dataset' => 'Set de datos',
+ 'Incorrect Dataset version!' => '!Versisn incorrecta de conjunto de datos!',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Licensed to' => 'Licenciado a',
+ 'Login' => 'Login',
+ 'Name' => 'Nombre',
+ 'Password' => 'Contraseña',
+ 'User' => 'Usuario',
+ 'Version' => 'Versión',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'No introdujo un nombre!',
+ 'is not a member!' => '!no es miembro!',
+ 'localhost' => 'servidor local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/menu b/sql-ledger/locale/mx/menu
new file mode 100644
index 000000000..c0f9e4b47
--- /dev/null
+++ b/sql-ledger/locale/mx/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AR' => 'Ctas X Cobrar',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Añadir código GIFI',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transaccion',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Assemblies' => 'Ensamblajes',
+ 'Audit Control' => 'Control de auditoria',
+ 'Backup' => 'Respaldo',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Bienes y servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Plantillas de LaTeX',
+ 'List Accounts' => 'Listar Cuentas',
+ 'List GIFI' => 'Listar código GIFI',
+ 'Logout' => 'Salir',
+ 'Order Entry' => 'Orden de Entrada',
+ 'Packing List' => 'Lista de Empaque',
+ 'Parts' => 'Partes',
+ 'Payment' => 'Pago',
+ 'Payments' => 'Pagos',
+ 'Preferences' => 'Preferencias',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save to File' => 'Guardar en archivo',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Services' => 'Servicios',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Transacciones',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Versión',
+ 'localhost' => 'servidor local',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/oe b/sql-ledger/locale/mx/oe
new file mode 100644
index 000000000..6acc57a12
--- /dev/null
+++ b/sql-ledger/locale/mx/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Agregar Nota de Remisión',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la Orden No.:?',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Curr' => 'Mon.',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Order' => 'Editar Remisión',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'In-line' => 'En linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item not on file!' => '¡El artículo no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'O' => 'O',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => '!Falta fecha en lista de empaque!',
+ 'Packing List Number missing!' => '!Falta nzmero en lista de empaque!',
+ 'Part' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Faltan',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save' => 'Salvar',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Terms: Net' => 'Crédito',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'days' => 'Días',
+ 'ea' => 'c/u',
+ 'emailed to' => 'Se envio email a',
+ 'sent to printer' => 'Enviado a la impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'factura' => 'invoice',
+ 'print' => 'print',
+ 'salvar' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/pe b/sql-ledger/locale/mx/pe
new file mode 100644
index 000000000..e1306ae0f
--- /dev/null
+++ b/sql-ledger/locale/mx/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Project' => 'Add Project',
+ 'All' => 'Todos',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Huerfano',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Salvar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/rc b/sql-ledger/locale/mx/rc
new file mode 100644
index 000000000..7e0dbb163
--- /dev/null
+++ b/sql-ledger/locale/mx/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Fecha',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'Desde',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Pago',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Fuente',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'Hasta ',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/mx/rp b/sql-ledger/locale/mx/rp
new file mode 100644
index 000000000..f198c6fb6
--- /dev/null
+++ b/sql-ledger/locale/mx/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'Account' => 'Cuenta',
+ 'Accounts' => 'Cuentas',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar a',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Current',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'Código GIFI',
+ 'Heading' => 'Encabezado',
+ 'ID' => 'ID',
+ 'In-line' => 'En linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagos',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Informe para',
+ 'Retained Earnings' => 'Ganacias Retenidas',
+ 'Screen' => 'Pantalla',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estándard',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Asunto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Vendor' => 'Proveedor',
+ 'as at' => 'as at',
+ 'collected on sales' => 'ingresado en ventas',
+ 'for Period' => 'para el período',
+ 'paid on purchases' => 'pagado en compras',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'correo_electrónico' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/COPYING b/sql-ledger/locale/nl/COPYING
new file mode 100644
index 000000000..c5dd5191c
--- /dev/null
+++ b/sql-ledger/locale/nl/COPYING
@@ -0,0 +1,26 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Dutch texts:
+#
+# Author: AJ Hettema <Ignite@ecosse.net>
+# Oscar Buijten <oscar@elbie.com>
+# Bert Tijhuis <domino@dse.nl>
+# Paul Tammes <ptammes@home.nl>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/nl/LANGUAGE b/sql-ledger/locale/nl/LANGUAGE
new file mode 100644
index 000000000..890d7d5c7
--- /dev/null
+++ b/sql-ledger/locale/nl/LANGUAGE
@@ -0,0 +1 @@
+Dutch
diff --git a/sql-ledger/locale/nl/Num2text b/sql-ledger/locale/nl/Num2text
new file mode 100644
index 000000000..777c2f3ac
--- /dev/null
+++ b/sql-ledger/locale/nl/Num2text
@@ -0,0 +1,161 @@
+#=====================================================================
+# SQL-Ledger Accounting
+# Copyright (C) 2002
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors: Paul Tammes <finance@bermuda-holding.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#======================================================================
+#
+# this is a variation of the Lingua package
+# written for check and receipt printing
+# it returns a properly formatted text string
+# for a number up to 10**12
+
+sub init {
+ my $self = shift;
+
+ %{ $self->{numbername} } =
+ (0 => 'nul',
+ 1 => 'een',
+ 2 => 'twee',
+ 3 => 'drie',
+ 4 => 'vier',
+ 5 => 'vijf',
+ 6 => 'zes',
+ 7 => 'zeven',
+ 8 => 'acht',
+ 9 => 'negen',
+ 10 => 'tien',
+ 11 => 'elf',
+ 12 => 'twalf',
+ 13 => 'dertien',
+ 14 => 'veertien',
+ 15 => 'vijftien',
+ 16 => 'zestien',
+ 17 => 'zeventien',
+ 18 => 'achtien',
+ 19 => 'negentien',
+ 20 => 'twintig',
+ 30 => 'dertig',
+ 40 => 'veertig',
+ 50 => 'vijftig',
+ 60 => 'zestig',
+ 70 => 'zeventig',
+ 80 => 'tachtig',
+ 90 => 'negentig',
+ 10**2 => 'honderd',
+ 10**3 => 'duizend',
+ 10**6 => 'miljoen',
+ 10**9 => 'miljard',
+ 10**12 => 'biljoen'
+ );
+
+}
+
+
+sub num2text {
+ my ($self, $amount) = @_;
+
+ return $self->{numbername}{0} unless $amount;
+
+ my @textnumber = ('**');
+
+ # split amount into chunks of 3
+ my @num = reverse split //, $amount;
+ my @numblock = ();
+ my ($i, $appendn);
+ my @a = ();
+
+ while (@num) {
+ @a = ();
+ for (1 .. 3) {
+ push @a, shift @num;
+ }
+ push @numblock, join / /, reverse @a;
+ }
+
+
+ while (@numblock) {
+
+ $i = $#numblock;
+ @num = split //, $numblock[$i];
+
+ $numblock[$i] *= 1;
+
+ if ($numblock[$i] == 0) {
+ pop @numblock;
+ next;
+ }
+
+ if ($numblock[$i] > 99) {
+ # the one from hundreds
+ push @textnumber, $self->{numbername}{$num[0]};
+
+ # add hundred designation
+ push @textnumber, $self->{numbername}{10**2};
+
+ # reduce numblock
+ $numblock[$i] -= $num[0] * 100;
+ }
+
+ if ($numblock[$i] > 9) {
+ # tens
+ push @textnumber, $self->format_ten($numblock[$i]);
+ } else {
+ # ones
+ push @textnumber, $self->{numbername}{$numblock[$i]};
+ }
+
+ # add thousand, million
+ if ($i) {
+ $amount = 10**($i * 3);
+ push @textnumber, $self->{numbername}{$amount};
+ }
+
+ pop @numblock;
+
+ }
+
+ push @textnumber, '**';
+ join '', @textnumber;
+
+}
+
+
+sub format_ten {
+ my ($self, $amount) = @_;
+
+ my $textnumber = "";
+ my @num = split //, $amount;
+
+ if ($amount > 20) {
+ # reverse one and ten and glue together with 'en'
+ $amount = $num[0] * 10;
+ $textnumber = $self->{numbername}{$num[1]}.'en'.$self->{numbername}{$amount};
+ } else {
+ $textnumber = $self->{numbername}{$amount};
+ }
+
+ $textnumber;
+
+}
+
+
+1;
+
diff --git a/sql-ledger/locale/nl/admin b/sql-ledger/locale/nl/admin
new file mode 100644
index 000000000..37f5a0b4d
--- /dev/null
+++ b/sql-ledger/locale/nl/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Toegangsbeheer',
+ 'Accounting' => 'Boekhouding',
+ 'Add User' => 'Gebruiker toevoegen',
+ 'Address' => 'Adres',
+ 'Administration' => 'Administratie',
+ 'Administrator' => 'Beheerder',
+ 'All Datasets up to date!' => 'Alle Datasets actueel',
+ 'Change Admin Password' => 'Admin wachtwoord veranderen',
+ 'Change Password' => 'Verander wachtwoord',
+ 'Character Set' => 'Karakter set',
+ 'Click on login name to edit!' => 'Klik op login naam om deze te bewerken.',
+ 'Company' => 'Bedrijf',
+ 'Connect to' => 'Verbinden met',
+ 'Continue' => 'Verder',
+ 'Create Chart of Accounts' => 'Maak rekeningstelsel',
+ 'Create Dataset' => 'Maak dataset',
+ 'DBI not installed!' => 'DBI niet geinstalleerd',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Database administratie',
+ 'Database Driver not checked!' => 'Database Driver niet aangevinkt',
+ 'Database User missing!' => 'Geen database gebruiker aanwezig!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Geen dataset aanwezig',
+ 'Dataset updated!' => 'Dataset aangepast aan nieuwe versie!',
+ 'Date Format' => 'Datum formaat',
+ 'Delete' => 'Verwijder',
+ 'Delete Dataset' => 'Verwijder dataset',
+ 'Directory' => 'Directory',
+ 'Driver' => 'Besturings programma',
+ 'Dropdown Limit' => 'Maximum in dropdown-lijst',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Gebruiker wijzigen',
+ 'Existing Datasets' => 'Bestaande datasets',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Geen hostnaam!',
+ 'Incorrect Password!' => 'Verkeerd paswoord',
+ 'Language' => 'Taal',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Laat host en port veld leeg, tenzij u een netwerk connectie wilt opzetten.',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Multibyte Encoding',
+ 'Name' => 'Naam',
+ 'New Templates' => 'Nieuwe templates',
+ 'No Database Drivers available!' => 'Geen database besturings programma aanwezig',
+ 'No Dataset selected!' => 'Geen dataset geselecteerd',
+ 'Nothing to delete!' => 'Niets te verwijderen',
+ 'Number Format' => 'Nummeraanduiding',
+ 'Oracle Database Administration' => 'Oracle Database Administratie',
+ 'Password' => 'Wachtwoord',
+ 'Password changed!' => 'Wachtwoord gewijzigd!',
+ 'Pg Database Administration' => 'Pg Database Administratie',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Geen port aanwezig',
+ 'Printer' => 'Printer',
+ 'Save' => 'Opslaan',
+ 'Select a Dataset to delete and press "Continue"' => 'Selecteer de te verwijderen dataset en klik op "verder"',
+ 'Setup Templates' => 'Setup templates',
+ 'Ship via' => 'Verzenden via',
+ 'Signature' => 'Handtekening',
+ 'Stylesheet' => 'Stylesheet',
+ 'Templates' => 'Templates',
+ 'The following Datasets are not in use and can be deleted' => 'De volgende datasets zijn niet ingebruik en kunnen worder verwijderd.',
+ 'The following Datasets need to be updated' => 'De volgende datasets moeten worden bijgewerkt',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dit is een eerste controle. Er wordt niks gecreéerd of verwijderd.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Om een gebruiker aan een groep toe te voegen, een naam te wijzigen, een login naam te wijzigen en op te slaan. Een nieuwe gebruiker zal dan worder opgeslagen met dezelfde gegevens onder de nieuwe login naam.',
+ 'Update Dataset' => 'Dataset bijwerken',
+ 'Use Templates' => 'Gebruik templates',
+ 'User' => 'Gebruiker',
+ 'User deleted!' => 'Gebruiker verwijderd!',
+ 'User saved!' => 'Gebruiker opgeslagen!',
+ 'Version' => 'Versie',
+ 'You must enter a host and port for local and remote connections!' => 'Vul een "host" en een "port" voor netwerk connecties!',
+ 'does not exist' => 'bestaat niet',
+ 'is already a member!' => 'is al een gebruiker',
+ 'localhost' => 'localhost',
+ 'locked!' => 'geblokkeerd',
+ 'successfully created!' => 'Succesvol aangemaakt',
+ 'successfully deleted!' => 'Verwijderen succesvol',
+ 'website' => 'website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'gebruiker_toevoegen' => 'add_user',
+ 'admin_wachtwoord_veranderen' => 'change_admin_password',
+ 'verander_wachtwoord' => 'change_password',
+ 'verder' => 'continue',
+ 'maak_dataset' => 'create_dataset',
+ 'verwijder' => 'delete',
+ 'verwijder_dataset' => 'delete_dataset',
+ 'login' => 'login',
+ 'oracle_database_administratie' => 'oracle_database_administration',
+ 'pg_database_administratie' => 'pg_database_administration',
+ 'opslaan' => 'save',
+ 'dataset_bijwerken' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/all b/sql-ledger/locale/nl/all
new file mode 100644
index 000000000..2e550899f
--- /dev/null
+++ b/sql-ledger/locale/nl/all
@@ -0,0 +1,491 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Crediteuren',
+ 'AP Aging' => 'Crediteuren Ouderdomsoverzicht',
+ 'AP Transaction' => 'Crediteurenboeking',
+ 'AP Transactions' => 'Crediteurenboekingen',
+ 'AR' => 'Debiteuren',
+ 'AR Aging' => 'Debiteuren Ouderdomsoverzicht',
+ 'AR Transaction' => 'Debiteurenboeking',
+ 'AR Transactions' => 'Debiteurenboekingen',
+ 'About' => 'Over',
+ 'Access Control' => 'Toegangsbeheer',
+ 'Account' => 'Rekening',
+ 'Account Number' => 'Rekeningnummer',
+ 'Account Number missing!' => 'Rekeningnummer mist!',
+ 'Account Type' => 'Rekeningtype',
+ 'Account Type missing!' => 'Rekeningtype mist!',
+ 'Account deleted!' => 'Rekening verwijderd',
+ 'Account saved!' => 'Rekening opgeslagen',
+ 'Accounting' => 'Boekhouding',
+ 'Accounting Menu' => 'Boekhoudmenu',
+ 'Accounts' => 'Rekeningen',
+ 'Active' => 'Actief',
+ 'Add' => 'Toevoegen',
+ 'Add Account' => 'Rekening toevoegen',
+ 'Add Accounts Payables Transaction' => 'Crediteurenboeking toevoegen',
+ 'Add Accounts Receivables Transaction' => 'Debiteurenboeking toevoegen',
+ 'Add Assembly' => 'Assemblage toevoegen',
+ 'Add Customer' => 'Klant toevoegen',
+ 'Add GIFI' => 'Toevoegen GIFI',
+ 'Add General Ledger Transaction' => 'Journaalpost toevoegen',
+ 'Add Part' => 'Artikel toevoegen',
+ 'Add Project' => 'Project toevoegen',
+ 'Add Purchase Invoice' => 'Inkoopfactuur toevoegen',
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Invoice' => 'Verkoopfactuur toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Add Service' => 'Dienst toevoegen',
+ 'Add Transaction' => 'Boeking toevoegen',
+ 'Add User' => 'Gebruiker toevoegen',
+ 'Add Vendor' => 'Leverancier toevoegen',
+ 'Address' => 'Adres',
+ 'Administration' => 'Administratie',
+ 'Administrator' => 'Beheerder',
+ 'All' => 'Allemaal',
+ 'All Datasets up to date!' => 'Alle Datasets actueel',
+ 'Amount' => 'Bedrag',
+ 'Amount Due' => 'Verschuldigd bedrag',
+ 'Amount does not equal applied!' => 'Bedrag is ongelijk aan toewijzing!',
+ 'Amount missing!' => 'Bedrag ontbreekt!',
+ 'Applied' => 'Toewijzing',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Weet u zeker dat u dit factuurnummer wilt verwijderen?',
+ 'Are you sure you want to delete Order Number' => 'Weet u zeker dat u dit ordernummer wilt verwijderen?',
+ 'Are you sure you want to delete Transaction' => 'Weet u zeker dat u deze boeking wilt verwijderen?',
+ 'Assemblies' => 'Assemblage, samengestelde artikelen',
+ 'Assemblies restocked!' => 'Assemblage naar voorraad geboekt',
+ 'Assembly Number missing!' => 'Assemblagenummer mist!',
+ 'Asset' => 'Activa (bezittingen)',
+ 'Attachment' => 'Bijlage',
+ 'Audit Control' => 'Accountants Controle',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'BOM' => 'Onderdelenlijst',
+ 'Backup' => 'Backup',
+ 'Backup sent to' => 'Backup gezonden aan',
+ 'Balance' => 'Saldo',
+ 'Balance Sheet' => 'Balans',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'Books are open' => 'Boekingsperiode is open',
+ 'Bought' => 'Ingekocht',
+ 'Business Number' => 'Kamer van Koophandel nummer',
+ 'C' => 'C',
+ 'COGS' => 'Kostprijs Verkopen',
+ 'Cannot delete account!' => 'Kan bedrag niet verwijderen!',
+ 'Cannot delete customer!' => 'Kan klant niet verwijderen!',
+ 'Cannot delete default account!' => 'Kan standaardrekening niet verwijderen!',
+ 'Cannot delete invoice!' => 'Kan factuur niet verwijderen!',
+ 'Cannot delete item already invoiced!' => 'Kan reeds gefactureerd artikel niet verwijderen!',
+ 'Cannot delete item on order!' => 'Kan onderdeel van de order niet verwijderen',
+ 'Cannot delete item which is part of an assembly!' => 'Kan onderdeel van een samengesteld artikel niet verwijderen!',
+ 'Cannot delete item!' => 'Kan onderdeel niet verwijderen!',
+ 'Cannot delete order!' => 'Kan order niet verwijderen!',
+ 'Cannot delete transaction!' => 'Kan transactie niet verwijderen!',
+ 'Cannot delete vendor!' => 'Kan leverancier niet verwijderen!',
+ 'Cannot have a value in both Debit and Credit!' => 'Waarde kan alleen debet of credit voorkomen!',
+ 'Cannot post a transaction without a value!' => 'Kan geen boeking maken zonder waarde!',
+ 'Cannot post invoice for a closed period!' => 'Kan geen factuur boeken in afgesloten periode!',
+ 'Cannot post invoice!' => 'Kan factuur niet boeken!',
+ 'Cannot post payment for a closed period!' => 'Kan geen betaling boeken voor afgesloten periode!',
+ 'Cannot post payment!' => 'Kan betaling niet boeken!',
+ 'Cannot post transaction for a closed period!' => 'Kan geen boeking maken in afgesloten periode',
+ 'Cannot post transaction!' => 'Kan transactie niet boeken!',
+ 'Cannot process payment for a closed period!' => 'Kan geen betaling verwerken voor afgesloten periode!',
+ 'Cannot save account!' => 'Kan rekening niet opslaan!',
+ 'Cannot save order!' => 'Kan order niet opslaan!',
+ 'Cannot save preferences!' => 'Kan voorkeuren niet opslaan!',
+ 'Cannot stock assemblies!' => 'Kan assemblages niet in voorraad nemen!',
+ 'Cash' => 'Kas (contant)',
+ 'Cash based' => 'Kasbasis (contante verkopen)',
+ 'Cc' => 'Copie aan',
+ 'Change Admin Password' => 'Admin wachtwoord veranderen',
+ 'Change Password' => 'Verander wachtwoord',
+ 'Character Set' => 'Karakter set',
+ 'Chart of Accounts' => 'Rekeningstelsel',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque geprint!',
+ 'Check printing failed!' => 'Cheque printen mislukt!',
+ 'Cleared Balance' => 'Totaal geboekt vorige afschriften',
+ 'Click on login name to edit!' => 'Klik op login naam om deze te bewerken.',
+ 'Close Books up to' => 'Boeken afsluiten tot',
+ 'Closed' => 'Afgesloten',
+ 'Company' => 'Bedrijf',
+ 'Compare to' => 'Vergelijk met',
+ 'Confirm!' => 'Bevestig!',
+ 'Connect to' => 'Verbinden met',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Copy to COA' => 'Kopieër naar rekeningstelsel',
+ 'Create Chart of Accounts' => 'Maak rekeningstelsel',
+ 'Create Dataset' => 'Maak dataset',
+ 'Credit' => 'Credit',
+ 'Credit Limit' => 'Kredietlimiet',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valuta',
+ 'Current' => 'Huidig',
+ 'Customer' => 'Klant',
+ 'Customer deleted!' => 'Klant verwijderd!',
+ 'Customer missing!' => 'Klant ontbreekt!',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Customer saved!' => 'Klant opgeslagen!',
+ 'Customers' => 'Klanten',
+ 'DBI not installed!' => 'DBI niet geinstalleerd',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Database administratie',
+ 'Database Driver not checked!' => 'Database Driver niet aangevinkt',
+ 'Database Host' => 'Database computer',
+ 'Database User missing!' => 'Geen database gebruiker aanwezig!',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Geen dataset aanwezig',
+ 'Dataset updated!' => 'Dataset aangepast aan nieuwe versie!',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Vervaldatum',
+ 'Date Format' => 'Datum formaat',
+ 'Date Paid' => 'Betaaldatum',
+ 'Date missing!' => 'Datum ontbreekt!',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet en credit moeten gelijk zijn!',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Decimalplaces' => 'Aantal Decimalen',
+ 'Delete' => 'Verwijder',
+ 'Delete Account' => 'Rekening verwijderen',
+ 'Delete Dataset' => 'Verwijder dataset',
+ 'Delivery Date' => 'Leverdatum',
+ 'Deposit' => 'Storting',
+ 'Description' => 'Omschrijving',
+ 'Difference' => 'Verschil',
+ 'Directory' => 'Directory',
+ 'Discount' => 'Korting',
+ 'Done' => 'Klaar',
+ 'Drawing' => 'Tekening',
+ 'Driver' => 'Besturings programma',
+ 'Dropdown Limit' => 'Maximum in dropdown-lijst',
+ 'Due' => 'Verschuldigd',
+ 'Due Date' => 'Vervaldatum',
+ 'Due Date missing!' => 'Vervaldatum mist!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Overzicht aan',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Edit' => 'Wijzig',
+ 'Edit Account' => 'Rekening wijzigen',
+ 'Edit Accounts Payables Transaction' => 'Wijzig Crediteurenboeking',
+ 'Edit Accounts Receivables Transaction' => 'Wijzig Debiteurenboeking',
+ 'Edit Assembly' => 'Assemblage wijzigen',
+ 'Edit Customer' => 'Klant wijzigen',
+ 'Edit GIFI' => 'Wijzig GIFI',
+ 'Edit General Ledger Transaction' => 'Boeking in grootboek wijzigen',
+ 'Edit Part' => 'Artikel wijzigen',
+ 'Edit Preferences for' => 'Instellingen wijzigen voor',
+ 'Edit Project' => 'Project wijzigen',
+ 'Edit Purchase Invoice' => 'Inkoopfactuur wijzigen',
+ 'Edit Purchase Order' => 'Inkooporder wijzigen',
+ 'Edit Sales Invoice' => 'Verkoopfactuur wijzigen',
+ 'Edit Sales Order' => 'Verkoop order wijzigen',
+ 'Edit Service' => 'Dienst wijzigen',
+ 'Edit Template' => 'Template wijzigen',
+ 'Edit User' => 'Gebruiker wijzigen',
+ 'Edit Vendor' => 'Leverancier wijzigen',
+ 'Employee' => 'Werknemer',
+ 'Enforce transaction reversal for all dates' => 'Boeking terugdraaien voor alle data',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vul max drie karakters in, gescheiden door een dubbelepunt (b.v. EUR:USD:GBP:CAD) voor lokale en buitenlandse valuta',
+ 'Equity' => 'Passiva/Eigen Vermogen',
+ 'Exch' => 'Wisselkoers',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate Difference' => 'Koersverschil',
+ 'Exchangerate for payment missing!' => 'Wisselkoers voor Betaling mist!',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Existing Datasets' => 'Bestaande datasets',
+ 'Expense' => 'Onkosten',
+ 'Expense Account' => 'Onkostenrekening',
+ 'Expense/Asset' => 'Uitgaven',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'Foreign Exchange Gain' => 'Wisselkoers winst',
+ 'Foreign Exchange Loss' => 'Wisselkoers verlies',
+ 'From' => 'Van',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI verwijderd!',
+ 'GIFI missing!' => 'GIFI ontbreekt!',
+ 'GIFI saved!' => 'GIFI opgeslagen!',
+ 'GL Transaction' => 'Grootboekboeking (memoriaal) ',
+ 'General Ledger' => 'Grootboek',
+ 'Goods & Services' => 'Goederen & Diensten',
+ 'HTML Templates' => 'HTML Sjablonen',
+ 'Heading' => 'Kopregel',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Geen hostnaam!',
+ 'ID' => 'ID',
+ 'Image' => 'Plaatje',
+ 'In-line' => 'In Lijn',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Include in drop-down menus' => 'Invoegen in drop-down menus',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Deze klant/leverancier toevoegen als belastbaar?',
+ 'Income' => 'Inkomsten',
+ 'Income Account' => 'Inkomstenrekening',
+ 'Income Statement' => 'Inkomstenoverzicht',
+ 'Incorrect Dataset version!' => 'Ongeldige versie Dataset!!',
+ 'Incorrect Password!' => 'Verkeerd paswoord',
+ 'Individual Items' => 'Onderliggede onderdelen',
+ 'Inventory' => 'Voorraad',
+ 'Inventory Account' => 'Voorraadrekening',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Aanwezige voorraad moet nul zijn voordat een assemblage als \'niet actief\' kan worder gemarkeerd.',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Aanwezige voorraad moet nul zijn voordat een product als \'niet actief\' kan worder gemarkeerd.',
+ 'Inventory quantity must be zero!' => 'Aanwezige voorraad moet nul zijn!',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date' => 'Factuurdatum',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Invoice deleted!' => 'Factuur verwijderd!',
+ 'Invoice posted!' => 'Factuur geboekt!',
+ 'Invoices' => 'Facturen',
+ 'Is this a summary account to record' => 'Totaalrekening voor',
+ 'Item deleted!' => 'Onderdeel verwijderd!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'LaTeX Templates' => 'Latex Sjablonen',
+ 'Language' => 'Taal',
+ 'Last Cost' => 'Vorige kostprijs',
+ 'Last Invoice Number' => 'Laatste factuurnummer',
+ 'Last Numbers & Default Accounts' => 'Laatst toegekende nummers & Standaard Rekeningen',
+ 'Last Purchase Order Number' => 'Laatste inkoopordernummer',
+ 'Last Sales Order Number' => 'Laatste Verkooporder nummer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Laat host en port veld leeg, tenzij u een netwerk connectie wilt opzetten.',
+ 'Liability' => 'Passiva',
+ 'Licensed to' => 'Gelicenseerd aan',
+ 'Line Total' => 'Totaal Regel',
+ 'Link' => 'Verbinding',
+ 'Link Accounts' => 'Rekeningen verbinden',
+ 'List Accounts' => 'Rekeningen weergeven',
+ 'List GIFI' => 'GIFI weergeven',
+ 'List Price' => 'Prijzen weergeven',
+ 'List Transactions' => 'Boekingen tonen',
+ 'Login' => 'Login',
+ 'Logout' => 'Logout',
+ 'Make' => 'Fabrikant',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Type',
+ 'Multibyte Encoding' => '',
+ 'N/A' => 'N/A',
+ 'Name' => 'Naam',
+ 'Name missing!' => 'Naam ontbreekt!',
+ 'New Templates' => 'Nieuwe templates',
+ 'No' => 'Nee',
+ 'No Database Drivers available!' => 'Geen database besturings programma aanwezig',
+ 'No Dataset selected!' => 'Geen dataset geselecteerd',
+ 'No email address for' => 'Geen email adres voor',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Opmerkingen',
+ 'Nothing applied!' => 'Niets toegewezen!',
+ 'Nothing selected!' => 'Niets geselecteerd!',
+ 'Nothing to delete!' => 'Niets te verwijderen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Nummeraanduiding',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'O' => 'O',
+ 'Obsolete' => 'Niet actief',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'Op voorraad',
+ 'On Order' => 'In bestelling',
+ 'Open' => 'Open',
+ 'Oracle Database Administration' => 'Oracle Database Administratie',
+ 'Order' => 'Bestelling',
+ 'Order Date' => 'Orderdatum',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Entry' => 'Order invoer',
+ 'Order Number' => 'Referentie',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'Order deleted!' => 'Order verwijderd!',
+ 'Order saved!' => 'Order opgeslagen!',
+ 'Ordered' => 'Besteld',
+ 'Orphaned' => 'Wees',
+ 'Out of balance!' => 'Niet in evenwicht!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Paid' => 'Betaald',
+ 'Paid in full' => 'Volledig betaald',
+ 'Part' => 'Artikel',
+ 'Part Number missing!' => 'Artikelnummer mist!',
+ 'Parts' => 'Artikelen',
+ 'Parts Inventory' => 'Artikelenvrd',
+ 'Password' => 'Wachtwoord',
+ 'Password changed!' => 'Wachtwoord gewijzigd!',
+ 'Payables' => 'Betalingen',
+ 'Payment' => 'Betaling',
+ 'Payment date missing!' => 'Geen betalingsdatum aanwezig!',
+ 'Payment posted!' => 'Betaling geboekt!',
+ 'Payments' => 'Betalingen',
+ 'Pg Database Administration' => 'Pg Database Administratie',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Geen port aanwezig',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Instellingen',
+ 'Preferences saved!' => 'Instellingen bewaard!',
+ 'Price' => 'Prijs',
+ 'Print' => 'Afdrukken',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Projectnummer ontbreekt!',
+ 'Project deleted!' => 'Project verwijderd!',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Project saved!' => 'Project opgeslagen!',
+ 'Projects' => 'Projecten',
+ 'Purchase Invoice' => 'Inkoopfactuur',
+ 'Purchase Order' => 'Inkooporder',
+ 'Purchase Orders' => 'Inkooporders',
+ 'Qty' => 'Aantal',
+ 'ROP' => 'Minimum voorraad',
+ 'Rate' => 'Percentage',
+ 'Recd' => 'Ontvangen',
+ 'Receipt' => 'Ontvangstbewijs',
+ 'Receipts' => 'Ontvangstbewijzen',
+ 'Receivables' => 'Vorderingen',
+ 'Reconciliation' => 'Bank Overzicht',
+ 'Record in' => 'Boeken op',
+ 'Reference' => 'Referentie',
+ 'Reference missing!' => 'Referentie ontbreekt!',
+ 'Remaining' => 'Resterend',
+ 'Report for' => 'Rapport voor',
+ 'Reports' => 'Rapporten',
+ 'Required by' => 'Nodig voor',
+ 'Retained Earnings' => 'Winstreserve',
+ 'Sales' => 'Verkoop',
+ 'Sales Invoice' => 'Verkoopfactuur',
+ 'Sales Order' => 'Verkooporder',
+ 'Sales Orders' => 'Verkooporders',
+ 'Save' => 'Opslaan',
+ 'Save as new' => 'Opslaan als nieuw',
+ 'Save to File' => 'Opslaan als bestand',
+ 'Screen' => 'Scherm',
+ 'Select a Dataset to delete and press "Continue"' => 'Selecteer de te verwijderen dataset en klik op "verder"',
+ 'Select all' => 'Selecteer alles',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sell Price' => 'Verkoopprijs',
+ 'Send by E-Mail' => 'Verzenden per E-mail',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Service Items' => 'Dienst',
+ 'Service Number missing!' => 'Dienstnummer mist',
+ 'Services' => 'Diensten',
+ 'Setup Templates' => 'Setup templates',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Ship via' => 'Verzenden via',
+ 'Short' => 'Kort',
+ 'Signature' => 'Handtekening',
+ 'Sold' => 'Verkocht',
+ 'Source' => 'Herkomst',
+ 'Standard' => 'Standaard',
+ 'Statement' => 'Overzicht',
+ 'Statement Balance' => 'Saldo Overzicht',
+ 'Statement sent to' => 'Overzicht verzonden aan',
+ 'Statements sent to printer!' => 'Overzichten afgedrukt',
+ 'Stock Assembly' => 'Assemblage voorraad',
+ 'Stylesheet' => 'Stylesheet',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'System' => 'Systeem',
+ 'Tax' => 'Belasting',
+ 'Tax Accounts' => 'Belasting Rekeningen',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'Tax collected' => 'Belasting verschuldigd',
+ 'Tax paid' => 'Belasting Betaald',
+ 'Taxable' => 'Belastbaar percentage',
+ 'Template saved!' => 'Template opgeslagen!',
+ 'Templates' => 'Templates',
+ 'Terms: Net' => 'Netto',
+ 'The following Datasets are not in use and can be deleted' => 'De volgende datasets zijn niet ingebruik en kunnen worder verwijderd.',
+ 'The following Datasets need to be updated' => 'De volgende datasets moeten worden bijgewerkt',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dit is een eerste controle. Er wordt niks gecreéerd of verwijderd.',
+ 'To' => 'Tot',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Om een gebruiker aan een groep toe te voegen, een naam te wijzigen, een login naam te wijzigen en op te slaan. Een nieuwe gebruiker zal dan worder opgeslagen met dezelfde gegevens onder de nieuwe login naam.',
+ 'Top Level' => 'Top Niveau',
+ 'Total' => 'Totaal',
+ 'Transaction Date missing!' => 'Boekingsdatum mist!',
+ 'Transaction deleted!' => 'Boeking verwijderd!',
+ 'Transaction posted!' => 'Boeking opgeslagen!',
+ 'Transaction reversal enforced for all dates' => 'Boekingen verplicht terugdraaien voor alle datums',
+ 'Transaction reversal enforced up to' => 'Boekingen verplicht terugdraaien tot aan',
+ 'Transactions' => 'Boekingen',
+ 'Transactions exist, cannot delete customer!' => 'Kan klant niet verwijderen, er zijn onderliggende boekingen!',
+ 'Transactions exist, cannot delete vendor!' => 'Kan leverancier niet verwijderen, er zijn onderliggende boekingen!',
+ 'Transactions exist; cannot delete account!' => 'Kan rekening niet verwijderen, er zijn onderliggende boekingen!',
+ 'Trial Balance' => 'Proefbalans',
+ 'Unit' => 'Eenheid',
+ 'Unit of measure' => 'Rekeneenheid',
+ 'Update' => 'Bijwerken',
+ 'Update Dataset' => 'Dataset bijwerken',
+ 'Updated' => 'Bijgewerkt',
+ 'Use Templates' => 'Gebruik templates',
+ 'User' => 'Gebruiker',
+ 'User deleted!' => 'Gebruiker verwijderd!',
+ 'User saved!' => 'Gebruiker opgeslagen!',
+ 'Vendor' => 'Leverancier',
+ 'Vendor deleted!' => 'Leverancier verwijderd!',
+ 'Vendor missing!' => 'Leverancier ontbreekt!',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'Vendor saved!' => 'Leverancier opgeslagen!',
+ 'Vendors' => 'Leveranciers',
+ 'Version' => 'Versie',
+ 'Weight' => 'Gewicht',
+ 'Weight Unit' => 'Gewichtseenheid',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'Year End' => 'Einde van het boekjaar',
+ 'Yes' => 'Ja',
+ 'You are logged out!' => 'U bent uitgelogd!',
+ 'You did not enter a name!' => 'U heeft geen naam gegeven!',
+ 'You must enter a host and port for local and remote connections!' => 'Vul een "host" en een "port" voor netwerk connecties!',
+ 'as at' => 'per',
+ 'collected on sales' => 'verzameld voor de verkoop',
+ 'days' => 'dagen',
+ 'does not exist' => 'bestaat niet',
+ 'ea' => 'voor',
+ 'emailed to' => 'per email verzonden aan',
+ 'for Period' => 'voor periode',
+ 'hr' => 'uur',
+ 'is already a member!' => 'is al een gebruiker',
+ 'is not a member!' => 'is geen gebruiker',
+ 'localhost' => 'localhost',
+ 'locked!' => 'geblokkeerd',
+ 'paid on purchases' => 'betaald op inkopen',
+ 'sent to printer' => 'Afgedrukt',
+ 'successfully created!' => 'Succesvol aangemaakt',
+ 'successfully deleted!' => 'Verwijderen succesvol',
+ 'to' => 'tot',
+ 'website' => 'website',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/am b/sql-ledger/locale/nl/am
new file mode 100644
index 000000000..0b3633b2b
--- /dev/null
+++ b/sql-ledger/locale/nl/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Crediteuren',
+ 'AR' => 'Debiteuren',
+ 'Account' => 'Rekening',
+ 'Account Number' => 'Rekeningnummer',
+ 'Account Number missing!' => 'Rekeningnummer mist!',
+ 'Account Type' => 'Rekeningtype',
+ 'Account Type missing!' => 'Rekeningtype mist!',
+ 'Account deleted!' => 'Rekening verwijderd',
+ 'Account saved!' => 'Rekening opgeslagen',
+ 'Add Account' => 'Rekening toevoegen',
+ 'Add GIFI' => 'Toevoegen GIFI',
+ 'Address' => 'Adres',
+ 'Asset' => 'Activa (bezittingen)',
+ 'Audit Control' => 'Accountants Controle',
+ 'Backup sent to' => 'Backup gezonden aan',
+ 'Books are open' => 'Boekingsperiode is open',
+ 'Business Number' => 'Kamer van Koophandel nummer',
+ 'COGS' => 'Kostprijs Verkopen',
+ 'Cannot delete account!' => 'Kan bedrag niet verwijderen!',
+ 'Cannot delete default account!' => 'Kan standaardrekening niet verwijderen!',
+ 'Cannot save account!' => 'Kan rekening niet opslaan!',
+ 'Cannot save preferences!' => 'Kan voorkeuren niet opslaan!',
+ 'Character Set' => 'Karakter set',
+ 'Chart of Accounts' => 'Rekeningstelsel',
+ 'Close Books up to' => 'Boeken afsluiten tot',
+ 'Company' => 'Bedrijf',
+ 'Continue' => 'Verder',
+ 'Copy to COA' => 'Kopieër naar rekeningstelsel',
+ 'Credit' => 'Credit',
+ 'Date Format' => 'Datum formaat',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Verwijder',
+ 'Delete Account' => 'Rekening verwijderen',
+ 'Description' => 'Omschrijving',
+ 'Dropdown Limit' => 'Maximum in dropdown-lijst',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Wijzig',
+ 'Edit Account' => 'Rekening wijzigen',
+ 'Edit GIFI' => 'Wijzig GIFI',
+ 'Edit Preferences for' => 'Instellingen wijzigen voor',
+ 'Edit Template' => 'Template wijzigen',
+ 'Enforce transaction reversal for all dates' => 'Boeking terugdraaien voor alle data',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Vul max drie karakters in, gescheiden door een dubbelepunt (b.v. EUR:USD:GBP:CAD) voor lokale en buitenlandse valuta',
+ 'Equity' => 'Passiva/Eigen Vermogen',
+ 'Expense' => 'Onkosten',
+ 'Expense Account' => 'Onkostenrekening',
+ 'Expense/Asset' => 'Uitgaven',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Wisselkoers winst',
+ 'Foreign Exchange Loss' => 'Wisselkoers verlies',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI verwijderd!',
+ 'GIFI missing!' => 'GIFI ontbreekt!',
+ 'GIFI saved!' => 'GIFI opgeslagen!',
+ 'Heading' => 'Kopregel',
+ 'Include in drop-down menus' => 'Invoegen in drop-down menus',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Deze klant/leverancier toevoegen als belastbaar?',
+ 'Income' => 'Inkomsten',
+ 'Income Account' => 'Inkomstenrekening',
+ 'Inventory' => 'Voorraad',
+ 'Inventory Account' => 'Voorraadrekening',
+ 'Is this a summary account to record' => 'Totaalrekening voor',
+ 'Language' => 'Taal',
+ 'Last Invoice Number' => 'Laatste factuurnummer',
+ 'Last Numbers & Default Accounts' => 'Laatst toegekende nummers & Standaard Rekeningen',
+ 'Last Purchase Order Number' => 'Laatste inkoopordernummer',
+ 'Last Sales Order Number' => 'Laatste Verkooporder nummer',
+ 'Liability' => 'Passiva',
+ 'Link' => 'Verbinding',
+ 'Name' => 'Naam',
+ 'No' => 'Nee',
+ 'No email address for' => 'Geen email adres voor',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Nummeraanduiding',
+ 'Parts Inventory' => 'Artikelenvrd',
+ 'Password' => 'Wachtwoord',
+ 'Payables' => 'Betalingen',
+ 'Payment' => 'Betaling',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Instellingen bewaard!',
+ 'Rate' => 'Percentage',
+ 'Receivables' => 'Vorderingen',
+ 'Sales' => 'Verkoop',
+ 'Save' => 'Opslaan',
+ 'Service Items' => 'Dienst',
+ 'Ship via' => 'Verzenden via',
+ 'Signature' => 'Handtekening',
+ 'Stylesheet' => 'Stylesheet',
+ 'Tax' => 'Belasting',
+ 'Tax Accounts' => 'Belasting Rekeningen',
+ 'Template saved!' => 'Template opgeslagen!',
+ 'Transaction reversal enforced for all dates' => 'Boekingen verplicht terugdraaien voor alle datums',
+ 'Transaction reversal enforced up to' => 'Boekingen verplicht terugdraaien tot aan',
+ 'Transactions exist; cannot delete account!' => 'Kan rekening niet verwijderen, er zijn onderliggende boekingen!',
+ 'Weight Unit' => 'Gewichtseenheid',
+ 'Year End' => 'Einde van het boekjaar',
+ 'Yes' => 'Ja',
+ 'does not exist' => 'bestaat niet',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'rekening_toevoegen' => 'add_account',
+ 'verder' => 'continue',
+ 'kopieër_naar_rekeningstelsel' => 'copy_to_coa',
+ 'verwijder' => 'delete',
+ 'wijzig' => 'edit',
+ 'rekening_wijzigen' => 'edit_account',
+ 'opslaan' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ap b/sql-ledger/locale/nl/ap
new file mode 100644
index 000000000..177034cf9
--- /dev/null
+++ b/sql-ledger/locale/nl/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Crediteurenboeking',
+ 'AP Transactions' => 'Crediteurenboekingen',
+ 'Account' => 'Rekening',
+ 'Add Accounts Payables Transaction' => 'Crediteurenboeking toevoegen',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Amount Due' => 'Verschuldigd bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Weet u zeker dat u deze boeking wilt verwijderen?',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Cannot delete transaction!' => 'Kan transactie niet verwijderen!',
+ 'Cannot post payment for a closed period!' => 'Kan geen betaling boeken voor afgesloten periode!',
+ 'Cannot post transaction for a closed period!' => 'Kan geen boeking maken in afgesloten periode',
+ 'Cannot post transaction!' => 'Kan transactie niet boeken!',
+ 'Closed' => 'Afgesloten',
+ 'Confirm!' => 'Bevestig!',
+ 'Continue' => 'Verder',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Betaaldatum',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Description' => 'Omschrijving',
+ 'Due Date' => 'Vervaldatum',
+ 'Due Date missing!' => 'Vervaldatum mist!',
+ 'Edit Accounts Payables Transaction' => 'Wijzig Crediteurenboeking',
+ 'Employee' => 'Werknemer',
+ 'Exch' => 'Wisselkoers',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate for payment missing!' => 'Wisselkoers voor Betaling mist!',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date' => 'Factuurdatum',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Open',
+ 'Order' => 'Bestelling',
+ 'Order Number' => 'Referentie',
+ 'Paid' => 'Betaald',
+ 'Payment date missing!' => 'Geen betalingsdatum aanwezig!',
+ 'Payments' => 'Betalingen',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Purchase Invoice' => 'Inkoopfactuur',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Herkomst',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax' => 'Belasting',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'Total' => 'Totaal',
+ 'Transaction deleted!' => 'Boeking verwijderd!',
+ 'Transaction posted!' => 'Boeking opgeslagen!',
+ 'Update' => 'Bijwerken',
+ 'Vendor' => 'Leverancier',
+ 'Vendor missing!' => 'Leverancier ontbreekt!',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'Yes' => 'Ja',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'crediteurenboeking' => 'ap_transaction',
+ 'crediteurenboeking_toevoegen' => 'add_accounts_payables_transaction',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'wijzig_crediteurenboeking' => 'edit_accounts_payables_transaction',
+ 'boek' => 'post',
+ 'boek_als_nieuw' => 'post_as_new',
+ 'inkoopfactuur' => 'purchase_invoice',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ar b/sql-ledger/locale/nl/ar
new file mode 100644
index 000000000..73aed905d
--- /dev/null
+++ b/sql-ledger/locale/nl/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Debiteurenboeking',
+ 'AR Transactions' => 'Debiteurenboekingen',
+ 'Account' => 'Rekening',
+ 'Add Accounts Receivables Transaction' => 'Debiteurenboeking toevoegen',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Amount Due' => 'Verschuldigd bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Weet u zeker dat u deze boeking wilt verwijderen?',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Cannot delete transaction!' => 'Kan transactie niet verwijderen!',
+ 'Cannot post payment for a closed period!' => 'Kan geen betaling boeken voor afgesloten periode!',
+ 'Cannot post transaction for a closed period!' => 'Kan geen boeking maken in afgesloten periode',
+ 'Cannot post transaction!' => 'Kan transactie niet boeken!',
+ 'Closed' => 'Afgesloten',
+ 'Confirm!' => 'Bevestig!',
+ 'Continue' => 'Verder',
+ 'Credit Limit' => 'Kredietlimiet',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Klant',
+ 'Customer missing!' => 'Klant ontbreekt!',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Betaaldatum',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Description' => 'Omschrijving',
+ 'Due Date' => 'Vervaldatum',
+ 'Due Date missing!' => 'Vervaldatum mist!',
+ 'Edit Accounts Receivables Transaction' => 'Wijzig Debiteurenboeking',
+ 'Employee' => 'Werknemer',
+ 'Exch' => 'Wisselkoers',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate for payment missing!' => 'Wisselkoers voor Betaling mist!',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date' => 'Factuurdatum',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Open',
+ 'Order' => 'Bestelling',
+ 'Order Number' => 'Referentie',
+ 'Paid' => 'Betaald',
+ 'Payment date missing!' => 'Geen betalingsdatum aanwezig!',
+ 'Payments' => 'Betalingen',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Remaining' => 'Resterend',
+ 'Sales Invoice' => 'Verkoopfactuur',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Herkomst',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax' => 'Belasting',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'Total' => 'Totaal',
+ 'Transaction deleted!' => 'Boeking verwijderd!',
+ 'Transaction posted!' => 'Boeking opgeslagen!',
+ 'Update' => 'Bijwerken',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'Yes' => 'Ja',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'debiteurenboeking' => 'ar_transaction',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'boek' => 'post',
+ 'boek_als_nieuw' => 'post_as_new',
+ 'verkoopfactuur' => 'sales_invoice',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/arap b/sql-ledger/locale/nl/arap
new file mode 100644
index 000000000..70f1eb3fa
--- /dev/null
+++ b/sql-ledger/locale/nl/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adres',
+ 'Continue' => 'Verder',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Description' => 'Omschrijving',
+ 'Number' => 'Nummer',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'verder' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ca b/sql-ledger/locale/nl/ca
new file mode 100644
index 000000000..aeb0fabc4
--- /dev/null
+++ b/sql-ledger/locale/nl/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Rekening',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Balance' => 'Saldo',
+ 'Chart of Accounts' => 'Rekeningstelsel',
+ 'Credit' => 'Credit',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Description' => 'Omschrijving',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'List Transactions' => 'Boekingen tonen',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Reference' => 'Referentie',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Subtotal' => 'Subtotaal',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'boekingen_tonen' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/cp b/sql-ledger/locale/nl/cp
new file mode 100644
index 000000000..c1ae7d50a
--- /dev/null
+++ b/sql-ledger/locale/nl/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Rekening',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Amount does not equal applied!' => 'Bedrag is ongelijk aan toewijzing!',
+ 'Amount missing!' => 'Bedrag ontbreekt!',
+ 'Applied' => 'Toewijzing',
+ 'Cannot post payment!' => 'Kan betaling niet boeken!',
+ 'Cannot process payment for a closed period!' => 'Kan geen betaling verwerken voor afgesloten periode!',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque geprint!',
+ 'Check printing failed!' => 'Cheque printen mislukt!',
+ 'Continue' => 'Verder',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Klant',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Date missing!' => 'Datum ontbreekt!',
+ 'Description' => 'Omschrijving',
+ 'Due' => 'Verschuldigd',
+ 'Exchangerate' => 'Wisselkoers',
+ 'From' => 'Van',
+ 'Invoice' => 'Factuur',
+ 'Invoices' => 'Facturen',
+ 'Nothing applied!' => 'Niets toegewezen!',
+ 'Number' => 'Nummer',
+ 'Paid in full' => 'Volledig betaald',
+ 'Payment' => 'Betaling',
+ 'Payment posted!' => 'Betaling geboekt!',
+ 'Post' => 'Boek',
+ 'Print' => 'Afdrukken',
+ 'Printer' => 'Printer',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Receipt' => 'Ontvangstbewijs',
+ 'Reference' => 'Referentie',
+ 'Screen' => 'Scherm',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Update' => 'Bijwerken',
+ 'Vendor' => 'Leverancier',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'verder' => 'continue',
+ 'boek' => 'post',
+ 'afdrukken' => 'print',
+ 'bijwerken' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ct b/sql-ledger/locale/nl/ct
new file mode 100644
index 000000000..430053a27
--- /dev/null
+++ b/sql-ledger/locale/nl/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Toevoegen',
+ 'Address' => 'Adres',
+ 'All' => 'Allemaal',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Cannot delete customer!' => 'Kan klant niet verwijderen!',
+ 'Cannot delete vendor!' => 'Kan leverancier niet verwijderen!',
+ 'Cc' => 'Copie aan',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Credit Limit' => 'Kredietlimiet',
+ 'Customer deleted!' => 'Klant verwijderd!',
+ 'Customer saved!' => 'Klant opgeslagen!',
+ 'Customers' => 'Klanten',
+ 'Delete' => 'Verwijder',
+ 'Discount' => 'Korting',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Klant wijzigen',
+ 'Edit Vendor' => 'Leverancier wijzigen',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Invoice' => 'Factuur',
+ 'Name' => 'Naam',
+ 'Name missing!' => 'Naam ontbreekt!',
+ 'Notes' => 'Opmerkingen',
+ 'Number' => 'Nummer',
+ 'Order' => 'Bestelling',
+ 'Orphaned' => 'Wees',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Opslaan',
+ 'Ship to' => 'Verzenden aan',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'Taxable' => 'Belastbaar percentage',
+ 'Terms: Net' => 'Netto',
+ 'Transactions exist, cannot delete customer!' => 'Kan klant niet verwijderen, er zijn onderliggende boekingen!',
+ 'Transactions exist, cannot delete vendor!' => 'Kan leverancier niet verwijderen, er zijn onderliggende boekingen!',
+ 'Vendor deleted!' => 'Leverancier verwijderd!',
+ 'Vendor saved!' => 'Leverancier opgeslagen!',
+ 'Vendors' => 'Leveranciers',
+ 'days' => 'dagen',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'toevoegen' => 'add',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'factuur' => 'invoice',
+ 'bestelling' => 'order',
+ 'opslaan' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/gl b/sql-ledger/locale/nl/gl
new file mode 100644
index 000000000..9e7662211
--- /dev/null
+++ b/sql-ledger/locale/nl/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Crediteurenboeking',
+ 'AR Transaction' => 'Debiteurenboeking',
+ 'Account' => 'Rekening',
+ 'Add General Ledger Transaction' => 'Journaalpost toevoegen',
+ 'Address' => 'Adres',
+ 'All' => 'Allemaal',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Transaction' => 'Weet u zeker dat u deze boeking wilt verwijderen?',
+ 'Asset' => 'Activa (bezittingen)',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Balance' => 'Saldo',
+ 'Cannot delete transaction!' => 'Kan transactie niet verwijderen!',
+ 'Cannot have a value in both Debit and Credit!' => 'Waarde kan alleen debet of credit voorkomen!',
+ 'Cannot post a transaction without a value!' => 'Kan geen boeking maken zonder waarde!',
+ 'Cannot post transaction for a closed period!' => 'Kan geen boeking maken in afgesloten periode',
+ 'Confirm!' => 'Bevestig!',
+ 'Continue' => 'Verder',
+ 'Credit' => 'Credit',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet en credit moeten gelijk zijn!',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Description' => 'Omschrijving',
+ 'Edit General Ledger Transaction' => 'Boeking in grootboek wijzigen',
+ 'Equity' => 'Passiva/Eigen Vermogen',
+ 'Expense' => 'Onkosten',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Grootboekboeking (memoriaal) ',
+ 'General Ledger' => 'Grootboek',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Income' => 'Inkomsten',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Liability' => 'Passiva',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Purchase Invoice' => 'Inkoopfactuur',
+ 'Reference' => 'Referentie',
+ 'Reference missing!' => 'Referentie ontbreekt!',
+ 'Reports' => 'Rapporten',
+ 'Sales Invoice' => 'Verkoopfactuur',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Herkomst',
+ 'Subtotal' => 'Subtotaal',
+ 'Transaction Date missing!' => 'Boekingsdatum mist!',
+ 'Transaction deleted!' => 'Boeking verwijderd!',
+ 'Transaction posted!' => 'Boeking opgeslagen!',
+ 'Update' => 'Bijwerken',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'Yes' => 'Ja',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'crediteurenboeking' => 'ap_transaction',
+ 'debiteurenboeking' => 'ar_transaction',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'grootboekboeking_(memoriaal)_' => 'gl_transaction',
+ 'boek' => 'post',
+ 'boek_als_nieuw' => 'post_as_new',
+ 'inkoopfactuur' => 'purchase_invoice',
+ 'verkoopfactuur' => 'sales_invoice',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ic b/sql-ledger/locale/nl/ic
new file mode 100644
index 000000000..e8d7eeaec
--- /dev/null
+++ b/sql-ledger/locale/nl/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Actief',
+ 'Add' => 'Toevoegen',
+ 'Add Assembly' => 'Assemblage toevoegen',
+ 'Add Part' => 'Artikel toevoegen',
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Add Service' => 'Dienst toevoegen',
+ 'Address' => 'Adres',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Assemblies' => 'Assemblage, samengestelde artikelen',
+ 'Assemblies restocked!' => 'Assemblage naar voorraad geboekt',
+ 'Assembly Number missing!' => 'Assemblagenummer mist!',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'BOM' => 'Onderdelenlijst',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'Bought' => 'Ingekocht',
+ 'COGS' => 'Kostprijs Verkopen',
+ 'Cannot delete item already invoiced!' => 'Kan reeds gefactureerd artikel niet verwijderen!',
+ 'Cannot delete item on order!' => 'Kan onderdeel van de order niet verwijderen',
+ 'Cannot delete item which is part of an assembly!' => 'Kan onderdeel van een samengesteld artikel niet verwijderen!',
+ 'Cannot delete item!' => 'Kan onderdeel niet verwijderen!',
+ 'Cannot stock assemblies!' => 'Kan assemblages niet in voorraad nemen!',
+ 'Cc' => 'Copie aan',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Delivery Date' => 'Leverdatum',
+ 'Description' => 'Omschrijving',
+ 'Drawing' => 'Tekening',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Edit Assembly' => 'Assemblage wijzigen',
+ 'Edit Part' => 'Artikel wijzigen',
+ 'Edit Service' => 'Dienst wijzigen',
+ 'Expense' => 'Onkosten',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'Image' => 'Plaatje',
+ 'In-line' => 'In Lijn',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Income' => 'Inkomsten',
+ 'Individual Items' => 'Onderliggede onderdelen',
+ 'Inventory' => 'Voorraad',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Aanwezige voorraad moet nul zijn voordat een assemblage als \'niet actief\' kan worder gemarkeerd.',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Aanwezige voorraad moet nul zijn voordat een product als \'niet actief\' kan worder gemarkeerd.',
+ 'Inventory quantity must be zero!' => 'Aanwezige voorraad moet nul zijn!',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Item deleted!' => 'Onderdeel verwijderd!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Last Cost' => 'Vorige kostprijs',
+ 'Line Total' => 'Totaal Regel',
+ 'Link Accounts' => 'Rekeningen verbinden',
+ 'List Price' => 'Prijzen weergeven',
+ 'Make' => 'Fabrikant',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Type',
+ 'Name' => 'Naam',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'Obsolete' => 'Niet actief',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'Op voorraad',
+ 'On Order' => 'In bestelling',
+ 'Order' => 'Bestelling',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Number' => 'Referentie',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'Ordered' => 'Besteld',
+ 'Orphaned' => 'Wees',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Part' => 'Artikel',
+ 'Part Number missing!' => 'Artikelnummer mist!',
+ 'Parts' => 'Artikelen',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prijs',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Inkooporder',
+ 'Qty' => 'Aantal',
+ 'ROP' => 'Minimum voorraad',
+ 'Recd' => 'Ontvangen',
+ 'Required by' => 'Nodig voor',
+ 'Sales' => 'Verkoop',
+ 'Sales Order' => 'Verkooporder',
+ 'Save' => 'Opslaan',
+ 'Screen' => 'Scherm',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sell Price' => 'Verkoopprijs',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Service Number missing!' => 'Dienstnummer mist',
+ 'Services' => 'Diensten',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Short' => 'Kort',
+ 'Sold' => 'Verkocht',
+ 'Stock Assembly' => 'Assemblage voorraad',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax' => 'Belasting',
+ 'To' => 'Tot',
+ 'Top Level' => 'Top Niveau',
+ 'Total' => 'Totaal',
+ 'Unit' => 'Eenheid',
+ 'Unit of measure' => 'Rekeneenheid',
+ 'Update' => 'Bijwerken',
+ 'Updated' => 'Bijgewerkt',
+ 'Weight' => 'Gewicht',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'ea' => 'voor',
+ 'emailed to' => 'per email verzonden aan',
+ 'hr' => 'uur',
+ 'sent to printer' => 'Afgedrukt',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'toevoegen' => 'add',
+ 'assemblage_toevoegen' => 'add_assembly',
+ 'artikel_toevoegen' => 'add_part',
+ 'dienst_toevoegen' => 'add_service',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'assemblage_wijzigen' => 'edit_assembly',
+ 'artikel_wijzigen' => 'edit_part',
+ 'dienst_wijzigen' => 'edit_service',
+ 'opslaan' => 'save',
+ 'bijwerken' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/io b/sql-ledger/locale/nl/io
new file mode 100644
index 000000000..432a8e0c6
--- /dev/null
+++ b/sql-ledger/locale/nl/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Address' => 'Adres',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'Cc' => 'Copie aan',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delivery Date' => 'Leverdatum',
+ 'Description' => 'Omschrijving',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In Lijn',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Name' => 'Naam',
+ 'No.' => 'Nr.',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Bestelling',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Part' => 'Artikel',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prijs',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Inkooporder',
+ 'Qty' => 'Aantal',
+ 'Recd' => 'Ontvangen',
+ 'Required by' => 'Nodig voor',
+ 'Sales Order' => 'Verkooporder',
+ 'Screen' => 'Scherm',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Subject' => 'Onderwerp',
+ 'To' => 'Tot',
+ 'Unit' => 'Eenheid',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'emailed to' => 'per email verzonden aan',
+ 'sent to printer' => 'Afgedrukt',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'verder' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/ir b/sql-ledger/locale/nl/ir
new file mode 100644
index 000000000..235a7d4c4
--- /dev/null
+++ b/sql-ledger/locale/nl/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Rekening',
+ 'Add Purchase Invoice' => 'Inkoopfactuur toevoegen',
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Weet u zeker dat u dit factuurnummer wilt verwijderen?',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'Cannot delete invoice!' => 'Kan factuur niet verwijderen!',
+ 'Cannot post invoice for a closed period!' => 'Kan geen factuur boeken in afgesloten periode!',
+ 'Cannot post invoice!' => 'Kan factuur niet boeken!',
+ 'Cannot post payment for a closed period!' => 'Kan geen betaling boeken voor afgesloten periode!',
+ 'Cc' => 'Copie aan',
+ 'Confirm!' => 'Bevestig!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Vervaldatum',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Delivery Date' => 'Leverdatum',
+ 'Description' => 'Omschrijving',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Edit Purchase Invoice' => 'Inkoopfactuur wijzigen',
+ 'Exch' => 'Wisselkoers',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate for payment missing!' => 'Wisselkoers voor Betaling mist!',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In Lijn',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date' => 'Factuurdatum',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Invoice deleted!' => 'Factuur verwijderd!',
+ 'Invoice posted!' => 'Factuur geboekt!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Name' => 'Naam',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Bestelling',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Number' => 'Referentie',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Part' => 'Artikel',
+ 'Payment date missing!' => 'Geen betalingsdatum aanwezig!',
+ 'Payments' => 'Betalingen',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prijs',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Purchase Order' => 'Inkooporder',
+ 'Qty' => 'Aantal',
+ 'Recd' => 'Ontvangen',
+ 'Record in' => 'Boeken op',
+ 'Required by' => 'Nodig voor',
+ 'Sales Order' => 'Verkooporder',
+ 'Screen' => 'Scherm',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Source' => 'Herkomst',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'To' => 'Tot',
+ 'Total' => 'Totaal',
+ 'Unit' => 'Eenheid',
+ 'Update' => 'Bijwerken',
+ 'Vendor' => 'Leverancier',
+ 'Vendor missing!' => 'Leverancier ontbreekt!',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'Yes' => 'Ja',
+ 'ea' => 'voor',
+ 'emailed to' => 'per email verzonden aan',
+ 'sent to printer' => 'Afgedrukt',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'bestelling' => 'order',
+ 'boek' => 'post',
+ 'boek_als_nieuw' => 'post_as_new',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/is b/sql-ledger/locale/nl/is
new file mode 100644
index 000000000..f868dacfb
--- /dev/null
+++ b/sql-ledger/locale/nl/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Rekening',
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Invoice' => 'Verkoopfactuur toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Invoice Number' => 'Weet u zeker dat u dit factuurnummer wilt verwijderen?',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'Cannot delete invoice!' => 'Kan factuur niet verwijderen!',
+ 'Cannot post invoice for a closed period!' => 'Kan geen factuur boeken in afgesloten periode!',
+ 'Cannot post invoice!' => 'Kan factuur niet boeken!',
+ 'Cannot post payment for a closed period!' => 'Kan geen betaling boeken voor afgesloten periode!',
+ 'Cc' => 'Copie aan',
+ 'Confirm!' => 'Bevestig!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Credit Limit' => 'Kredietlimiet',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Klant',
+ 'Customer missing!' => 'Klant ontbreekt!',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Vervaldatum',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Delivery Date' => 'Leverdatum',
+ 'Description' => 'Omschrijving',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Edit Sales Invoice' => 'Verkoopfactuur wijzigen',
+ 'Exch' => 'Wisselkoers',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate for payment missing!' => 'Wisselkoers voor Betaling mist!',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In Lijn',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date' => 'Factuurdatum',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number' => 'Factuurnummer',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Invoice deleted!' => 'Factuur verwijderd!',
+ 'Invoice posted!' => 'Factuur geboekt!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Name' => 'Naam',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Bestelling',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Number' => 'Referentie',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Part' => 'Artikel',
+ 'Payment date missing!' => 'Geen betalingsdatum aanwezig!',
+ 'Payments' => 'Betalingen',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Boek',
+ 'Post as new' => 'Boek als nieuw',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prijs',
+ 'Print' => 'Afdrukken',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Purchase Order' => 'Inkooporder',
+ 'Qty' => 'Aantal',
+ 'Recd' => 'Ontvangen',
+ 'Record in' => 'Boeken op',
+ 'Remaining' => 'Resterend',
+ 'Required by' => 'Nodig voor',
+ 'Sales Order' => 'Verkooporder',
+ 'Screen' => 'Scherm',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Ship via' => 'Verzenden via',
+ 'Source' => 'Herkomst',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'To' => 'Tot',
+ 'Total' => 'Totaal',
+ 'Unit' => 'Eenheid',
+ 'Update' => 'Bijwerken',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'Yes' => 'Ja',
+ 'ea' => 'voor',
+ 'emailed to' => 'per email verzonden aan',
+ 'sent to printer' => 'Afgedrukt',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'bestelling' => 'order',
+ 'boek' => 'post',
+ 'boek_als_nieuw' => 'post_as_new',
+ 'afdrukken' => 'print',
+ 'verzenden_aan' => 'ship_to',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/login b/sql-ledger/locale/nl/login
new file mode 100644
index 000000000..4e01eb074
--- /dev/null
+++ b/sql-ledger/locale/nl/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Over',
+ 'Database Host' => 'Database computer',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => 'Ongeldige versie Dataset!!',
+ 'Incorrect Password!' => 'Verkeerd paswoord',
+ 'Licensed to' => 'Gelicenseerd aan',
+ 'Login' => 'Login',
+ 'Name' => 'Naam',
+ 'Password' => 'Wachtwoord',
+ 'User' => 'Gebruiker',
+ 'Version' => 'Versie',
+ 'You are logged out!' => 'U bent uitgelogd!',
+ 'You did not enter a name!' => 'U heeft geen naam gegeven!',
+ 'is not a member!' => 'is geen gebruiker',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/menu b/sql-ledger/locale/nl/menu
new file mode 100644
index 000000000..2c1a25714
--- /dev/null
+++ b/sql-ledger/locale/nl/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Crediteuren',
+ 'AP Aging' => 'Crediteuren Ouderdomsoverzicht',
+ 'AR' => 'Debiteuren',
+ 'AR Aging' => 'Debiteuren Ouderdomsoverzicht',
+ 'Accounting Menu' => 'Boekhoudmenu',
+ 'Add Account' => 'Rekening toevoegen',
+ 'Add Assembly' => 'Assemblage toevoegen',
+ 'Add Customer' => 'Klant toevoegen',
+ 'Add GIFI' => 'Toevoegen GIFI',
+ 'Add Part' => 'Artikel toevoegen',
+ 'Add Project' => 'Project toevoegen',
+ 'Add Service' => 'Dienst toevoegen',
+ 'Add Transaction' => 'Boeking toevoegen',
+ 'Add Vendor' => 'Leverancier toevoegen',
+ 'Assemblies' => 'Assemblage, samengestelde artikelen',
+ 'Audit Control' => 'Accountants Controle',
+ 'Backup' => 'Backup',
+ 'Balance Sheet' => 'Balans',
+ 'Cash' => 'Kas (contant)',
+ 'Chart of Accounts' => 'Rekeningstelsel',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Klanten',
+ 'General Ledger' => 'Grootboek',
+ 'Goods & Services' => 'Goederen & Diensten',
+ 'HTML Templates' => 'HTML Sjablonen',
+ 'Income Statement' => 'Inkomstenoverzicht',
+ 'Invoice' => 'Factuur',
+ 'LaTeX Templates' => 'Latex Sjablonen',
+ 'List Accounts' => 'Rekeningen weergeven',
+ 'List GIFI' => 'GIFI weergeven',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Order invoer',
+ 'Packing List' => 'Pakbon',
+ 'Parts' => 'Artikelen',
+ 'Payment' => 'Betaling',
+ 'Payments' => 'Betalingen',
+ 'Preferences' => 'Instellingen',
+ 'Projects' => 'Projecten',
+ 'Purchase Invoice' => 'Inkoopfactuur',
+ 'Purchase Order' => 'Inkooporder',
+ 'Purchase Orders' => 'Inkooporders',
+ 'Receipt' => 'Ontvangstbewijs',
+ 'Receipts' => 'Ontvangstbewijzen',
+ 'Reconciliation' => 'Bank Overzicht',
+ 'Reports' => 'Rapporten',
+ 'Sales Invoice' => 'Verkoopfactuur',
+ 'Sales Order' => 'Verkooporder',
+ 'Sales Orders' => 'Verkooporders',
+ 'Save to File' => 'Opslaan als bestand',
+ 'Send by E-Mail' => 'Verzenden per E-mail',
+ 'Services' => 'Diensten',
+ 'Statement' => 'Overzicht',
+ 'Stock Assembly' => 'Assemblage voorraad',
+ 'Stylesheet' => 'Stylesheet',
+ 'System' => 'Systeem',
+ 'Tax collected' => 'Belasting verschuldigd',
+ 'Tax paid' => 'Belasting Betaald',
+ 'Transactions' => 'Boekingen',
+ 'Trial Balance' => 'Proefbalans',
+ 'Vendors' => 'Leveranciers',
+ 'Version' => 'Versie',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/oe b/sql-ledger/locale/nl/oe
new file mode 100644
index 000000000..cf3a06205
--- /dev/null
+++ b/sql-ledger/locale/nl/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Toevoegen',
+ 'Add Purchase Invoice' => 'Inkoopfactuur toevoegen',
+ 'Add Purchase Order' => 'Inkooporder toevoegen',
+ 'Add Sales Invoice' => 'Verkoopfactuur toevoegen',
+ 'Add Sales Order' => 'Verkooporder toevoegen',
+ 'Address' => 'Adres',
+ 'Amount' => 'Bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Are you sure you want to delete Order Number' => 'Weet u zeker dat u dit ordernummer wilt verwijderen?',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Bin' => 'Locatie',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Kan order niet verwijderen!',
+ 'Cannot save order!' => 'Kan order niet opslaan!',
+ 'Cc' => 'Copie aan',
+ 'Closed' => 'Afgesloten',
+ 'Confirm!' => 'Bevestig!',
+ 'Contact' => 'Contact',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Credit Limit' => 'Kredietlimiet',
+ 'Curr' => 'Val.',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Klant',
+ 'Customer missing!' => 'Klant ontbreekt!',
+ 'Customer not on file!' => 'Klant bestaat niet!',
+ 'Date' => 'Datum',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Delete' => 'Verwijder',
+ 'Delivery Date' => 'Leverdatum',
+ 'Description' => 'Omschrijving',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'E-mailadres mist!',
+ 'Edit Purchase Order' => 'Inkooporder wijzigen',
+ 'Edit Sales Order' => 'Verkoop order wijzigen',
+ 'Exchangerate' => 'Wisselkoers',
+ 'Exchangerate missing!' => 'Wisselkoers mist!',
+ 'Extended' => 'Uitgebreid',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'ID' => 'ID',
+ 'In-line' => 'In Lijn',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Invoice' => 'Factuur',
+ 'Invoice Date missing!' => 'Factuurdatum mist!',
+ 'Invoice Number missing!' => 'Factuurnummer mist!',
+ 'Item not on file!' => 'Dit onderdeel is niet in de database gevonden!',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'Name' => 'Naam',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Opmerkingen',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Getal missend in regel',
+ 'O' => 'O',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Open',
+ 'Order' => 'Bestelling',
+ 'Order Date' => 'Orderdatum',
+ 'Order Date missing!' => 'Geen order datum aanwezig',
+ 'Order Number' => 'Referentie',
+ 'Order Number missing!' => 'Geen ordernummer aanwezig',
+ 'Order deleted!' => 'Order verwijderd!',
+ 'Order saved!' => 'Order opgeslagen!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Pakbon',
+ 'Packing List Date missing!' => 'Pakbon datum mist!',
+ 'Packing List Number missing!' => 'Pakbon nummer mist!',
+ 'Part' => 'Artikel',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Prijs',
+ 'Print' => 'Afdrukken',
+ 'Printer' => 'Printer',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project bestaat niet!',
+ 'Purchase Order' => 'Inkooporder',
+ 'Purchase Orders' => 'Inkooporders',
+ 'Qty' => 'Aantal',
+ 'Recd' => 'Ontvangen',
+ 'Remaining' => 'Resterend',
+ 'Required by' => 'Nodig voor',
+ 'Sales Order' => 'Verkooporder',
+ 'Sales Orders' => 'Verkooporders',
+ 'Save' => 'Opslaan',
+ 'Save as new' => 'Opslaan als nieuw',
+ 'Screen' => 'Scherm',
+ 'Select from one of the items below' => 'Kies een van de onderstaande items',
+ 'Select from one of the names below' => 'Kies een van de onderstaande namen',
+ 'Select from one of the projects below' => 'Kies een van de onderstaande projecten',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Dienst',
+ 'Ship' => 'Verzenden',
+ 'Ship to' => 'Verzenden aan',
+ 'Ship via' => 'Verzenden via',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax' => 'Belasting',
+ 'Tax Included' => 'Inclusief Belasting',
+ 'Terms: Net' => 'Netto',
+ 'To' => 'Tot',
+ 'Total' => 'Totaal',
+ 'Unit' => 'Eenheid',
+ 'Update' => 'Bijwerken',
+ 'Vendor' => 'Leverancier',
+ 'Vendor missing!' => 'Leverancier ontbreekt!',
+ 'Vendor not on file!' => 'Leverancier bestaat niet!',
+ 'What type of item is this?' => 'Wat voor soort artikel is dit?',
+ 'Yes' => 'Ja',
+ 'days' => 'dagen',
+ 'ea' => 'voor',
+ 'emailed to' => 'per email verzonden aan',
+ 'sent to printer' => 'Afgedrukt',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'toevoegen' => 'add',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'factuur' => 'invoice',
+ 'afdrukken' => 'print',
+ 'opslaan' => 'save',
+ 'opslaan_als_nieuw' => 'save_as_new',
+ 'verzenden_aan' => 'ship_to',
+ 'bijwerken' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/pe b/sql-ledger/locale/nl/pe
new file mode 100644
index 000000000..bf05662ec
--- /dev/null
+++ b/sql-ledger/locale/nl/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Toevoegen',
+ 'Add Project' => 'Project toevoegen',
+ 'All' => 'Allemaal',
+ 'Continue' => 'Verder',
+ 'Delete' => 'Verwijder',
+ 'Description' => 'Omschrijving',
+ 'Edit Project' => 'Project wijzigen',
+ 'Number' => 'Nummer',
+ 'Orphaned' => 'Wees',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Projectnummer ontbreekt!',
+ 'Project deleted!' => 'Project verwijderd!',
+ 'Project saved!' => 'Project opgeslagen!',
+ 'Projects' => 'Projecten',
+ 'Save' => 'Opslaan',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'toevoegen' => 'add',
+ 'verder' => 'continue',
+ 'verwijder' => 'delete',
+ 'opslaan' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/rc b/sql-ledger/locale/nl/rc
new file mode 100644
index 000000000..d86b58e3f
--- /dev/null
+++ b/sql-ledger/locale/nl/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Rekening',
+ 'Balance' => 'Saldo',
+ 'Cleared Balance' => 'Totaal geboekt vorige afschriften',
+ 'Continue' => 'Verder',
+ 'Date' => 'Datum',
+ 'Deposit' => 'Storting',
+ 'Description' => 'Omschrijving',
+ 'Difference' => 'Verschil',
+ 'Done' => 'Klaar',
+ 'Exchangerate Difference' => 'Koersverschil',
+ 'From' => 'Van',
+ 'Out of balance!' => 'Niet in evenwicht!',
+ 'Payment' => 'Betaling',
+ 'Reconciliation' => 'Bank Overzicht',
+ 'Select all' => 'Selecteer alles',
+ 'Source' => 'Herkomst',
+ 'Statement Balance' => 'Saldo Overzicht',
+ 'Update' => 'Bijwerken',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'verder' => 'continue',
+ 'klaar' => 'done',
+ 'selecteer_alles' => 'select_all',
+ 'bijwerken' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/nl/rp b/sql-ledger/locale/nl/rp
new file mode 100644
index 000000000..9061318f3
--- /dev/null
+++ b/sql-ledger/locale/nl/rp
@@ -0,0 +1,116 @@
+$self{texts} = {
+ 'AP Aging' => 'Crediteuren Ouderdomsoverzicht',
+ 'AR Aging' => 'Debiteuren Ouderdomsoverzicht',
+ 'Account' => 'Rekening',
+ 'Accounts' => 'Rekeningen',
+ 'Amount' => 'Bedrag',
+ 'Apr' => 'Apr',
+ 'April' => 'April',
+ 'Attachment' => 'Bijlage',
+ 'Aug' => 'Aug',
+ 'August' => 'Augustus',
+ 'Balance Sheet' => 'Balans',
+ 'Bcc' => 'Onzichtbare kopie aan',
+ 'Cash based' => 'Kasbasis (contante verkopen)',
+ 'Cc' => 'Copie aan',
+ 'Compare to' => 'Vergelijk met',
+ 'Continue' => 'Verder',
+ 'Copies' => 'Kopieën',
+ 'Credit' => 'Credit',
+ 'Current' => 'Huidig',
+ 'Customer' => 'Klant',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Dec',
+ 'December' => 'December',
+ 'Decimalplaces' => 'Aantal Decimalen',
+ 'Description' => 'Omschrijving',
+ 'Due' => 'Verschuldigd',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Overzicht aan',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Van',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Kopregel',
+ 'ID' => 'ID',
+ 'In-line' => 'In Lijn',
+ 'Include in Report' => 'Uitvoer inclusief',
+ 'Income Statement' => 'Inkomstenoverzicht',
+ 'Invoice' => 'Factuur',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mrt',
+ 'March' => 'Maart',
+ 'May' => 'Mei',
+ 'May ' => 'Mei',
+ 'Message' => 'Boodschap',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Niets geselecteerd!',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Betalingen',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Afdrukken',
+ 'Printer' => 'Printer',
+ 'Receipts' => 'Ontvangstbewijzen',
+ 'Report for' => 'Rapport voor',
+ 'Retained Earnings' => 'Winstreserve',
+ 'Screen' => 'Scherm',
+ 'Select all' => 'Selecteer alles',
+ 'Select postscript or PDF!' => 'Kies postscript of PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Herkomst',
+ 'Standard' => 'Standaard',
+ 'Statement' => 'Overzicht',
+ 'Statement sent to' => 'Overzicht verzonden aan',
+ 'Statements sent to printer!' => 'Overzichten afgedrukt',
+ 'Subject' => 'Onderwerp',
+ 'Subtotal' => 'Subtotaal',
+ 'Tax' => 'Belasting',
+ 'Tax collected' => 'Belasting verschuldigd',
+ 'Tax paid' => 'Belasting Betaald',
+ 'Total' => 'Totaal',
+ 'Trial Balance' => 'Proefbalans',
+ 'Vendor' => 'Leverancier',
+ 'as at' => 'per',
+ 'collected on sales' => 'verzameld voor de verkoop',
+ 'for Period' => 'voor periode',
+ 'paid on purchases' => 'betaald op inkopen',
+ 'to' => 'tot',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'verder' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'afdrukken' => 'print',
+ 'selecteer_alles' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/no/COPYING b/sql-ledger/locale/no/COPYING
new file mode 100644
index 000000000..b853d6cab
--- /dev/null
+++ b/sql-ledger/locale/no/COPYING
@@ -0,0 +1,24 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Norwegian texts:
+#
+# Author: Keld Jørn Simonsen <keld@dkuug.dk>
+# Morten Pedersen <morten@workzone.no>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/no/LANGUAGE b/sql-ledger/locale/no/LANGUAGE
new file mode 100644
index 000000000..ed23589f5
--- /dev/null
+++ b/sql-ledger/locale/no/LANGUAGE
@@ -0,0 +1 @@
+Norwegian
diff --git a/sql-ledger/locale/no/admin b/sql-ledger/locale/no/admin
new file mode 100644
index 000000000..f28ff844c
--- /dev/null
+++ b/sql-ledger/locale/no/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Aksesskontroll',
+ 'Accounting' => 'Bokføring',
+ 'Add User' => 'Ny bruker',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administrasjon',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'Alle datasett oppdatert!',
+ 'Change Admin Password' => 'Endre passord for admin',
+ 'Change Password' => 'Endre passord',
+ 'Character Set' => 'Tegnsett',
+ 'Click on login name to edit!' => 'Klikk på brukernavn for å redigere!',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Forbind til',
+ 'Continue' => 'Fortsett',
+ 'Create Chart of Accounts' => 'Opprett kontoplan',
+ 'Create Dataset' => 'Opprett datasett',
+ 'DBI not installed!' => 'DBI ikke installert!',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Administrasjon av database',
+ 'Database Driver not checked!' => 'Databasedriver ikke kontrollert!',
+ 'Database User missing!' => 'Bruker av database mangler!',
+ 'Dataset' => 'Datasett',
+ 'Dataset missing!' => 'Datasett mangler!',
+ 'Dataset updated!' => 'Datasett oppdatert!',
+ 'Date Format' => 'Datoformat',
+ 'Delete' => 'Fjern',
+ 'Delete Dataset' => 'Fjern datasett',
+ 'Directory' => 'Katalog',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Grense for dropdown',
+ 'E-mail' => 'E-post',
+ 'Edit User' => 'Redigér bruker',
+ 'Existing Datasets' => 'Eksisterende datasett',
+ 'Fax' => 'Faks',
+ 'Host' => 'Vert',
+ 'Hostname missing!' => 'Vertsnavn mangler!',
+ 'Incorrect Password!' => 'Galt passord!',
+ 'Language' => 'Språk',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'La vert- og port-felt være tomme med mindre du vil lage en ekstern forbindelse.',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Tegnsett',
+ 'Name' => 'Navn',
+ 'New Templates' => 'Nye maler',
+ 'No Database Drivers available!' => 'Ingen databasedrivere tilgjengelige!',
+ 'No Dataset selected!' => 'Ingen datasett valgt!',
+ 'Nothing to delete!' => 'Intet å slette!',
+ 'Number Format' => 'Numerisk format',
+ 'Oracle Database Administration' => 'Administrasjon av database Oracle',
+ 'Password' => 'Passord',
+ 'Password changed!' => 'Passord endret!',
+ 'Pg Database Administration' => 'Administrasjon av database Pg',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port mangler!',
+ 'Printer' => 'Printer',
+ 'Save' => 'Lagre',
+ 'Select a Dataset to delete and press "Continue"' => 'Velg et datasett det skal fjernes og trykk "Fortsett"',
+ 'Setup Templates' => 'Oppsett av maler',
+ 'Ship via' => 'Avsend via',
+ 'Signature' => 'Underskrift',
+ 'Stylesheet' => 'Stílark',
+ 'Templates' => 'Maler',
+ 'The following Datasets are not in use and can be deleted' => 'De følgende datasett er ikke i bruk og kan slettes',
+ 'The following Datasets need to be updated' => 'De følgende datasettene skal oppdateres',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dette er en innledende kontroll for eksisterende kilder. Ingenting vil bli opprettet eller stettet på dette trinnet!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'For å tilføye en bruker til en gruppe må du endre et brukernavn og så lagre. Den nye brukeren vil så bli lagret med de samme variablene under det nye loginnavn.',
+ 'Update Dataset' => 'Oppdatér datasett',
+ 'Use Templates' => 'Bruk maler',
+ 'User' => 'Bruker',
+ 'User deleted!' => 'Bruker slettet!',
+ 'User saved!' => 'Bruker lagret!',
+ 'Version' => 'Versjon',
+ 'You must enter a host and port for local and remote connections!' => 'Du må oppgi en vert og en port for lokale og eksterne forbindelser!',
+ 'does not exist' => 'eksisterer ikke',
+ 'is already a member!' => 'er allerede et medlem!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'Låst!',
+ 'successfully created!' => 'opprettet!',
+ 'successfully deleted!' => 'fjernet!',
+ 'website' => 'nettsted',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'ny_bruker' => 'add_user',
+ 'endre_passord_for_admin' => 'change_admin_password',
+ 'endre_passord' => 'change_password',
+ 'fortsett' => 'continue',
+ 'opprett_datasett' => 'create_dataset',
+ 'fjern' => 'delete',
+ 'fjern_datasett' => 'delete_dataset',
+ 'login' => 'login',
+ 'administrasjon_av_database_oracle' => 'oracle_database_administration',
+ 'administrasjon_av_database_pg' => 'pg_database_administration',
+ 'lagre' => 'save',
+ 'oppdatér_datasett' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/no/all b/sql-ledger/locale/no/all
new file mode 100644
index 000000000..1c5d7049e
--- /dev/null
+++ b/sql-ledger/locale/no/all
@@ -0,0 +1,496 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AP Aging' => 'Aldersfordeling',
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AP Transactions' => 'Leverandørfakturaer',
+ 'AR' => 'Debitorer',
+ 'AR Aging' => 'Aldersfordeling',
+ 'AR Transaction' => 'Debitorpostering',
+ 'AR Transactions' => 'Debitorposteringer',
+ 'About' => 'Om',
+ 'Access Control' => 'Aksesskontroll',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer mangler!',
+ 'Account Type' => 'Kontotype',
+ 'Account Type missing!' => 'Kontotype mangler!',
+ 'Account deleted!' => 'Konto slettet!',
+ 'Account saved!' => 'Konto lagret!',
+ 'Accounting' => 'Bokføring',
+ 'Accounting Menu' => 'Konto-meny',
+ 'Accounts' => 'Kontoer',
+ 'Active' => 'Aktiv',
+ 'Add' => 'Legg til',
+ 'Add Account' => 'Ny konto',
+ 'Add Accounts Payables Transaction' => 'Ny leverandørfaktura',
+ 'Add Accounts Receivables Transaction' => 'Ny debitorpostering',
+ 'Add Assembly' => 'Ny sammensetting',
+ 'Add Customer' => 'Ny kunde',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add General Ledger Transaction' => 'Ny postering i hovedbok',
+ 'Add Part' => 'Ny vare',
+ 'Add Project' => 'Nytt prosjekt',
+ 'Add Purchase Invoice' => 'Ny innkjøpsfaktura',
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Add Service' => 'Ny tjeneste',
+ 'Add Transaction' => 'Ny postering',
+ 'Add User' => 'Ny bruker',
+ 'Add Vendor' => 'Ny leverandør',
+ 'Address' => 'Adresse',
+ 'Administration' => 'Administrasjon',
+ 'Administrator' => 'Administrator',
+ 'All' => 'Alle',
+ 'All Datasets up to date!' => 'Alle datasett oppdatert!',
+ 'Amount' => 'Beløp',
+ 'Amount Due' => 'Forfallent beløp',
+ 'Amount does not equal applied!' => 'Beløp er ikke likt utført!',
+ 'Amount missing!' => 'Konto mangler!',
+ 'Applied' => 'Utført',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på at du vil fjerne fakturanummer',
+ 'Are you sure you want to delete Order Number' => 'Er du sikker på at du vil fjerne ordrenummer',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på at du vil fjerne postering',
+ 'Assemblies' => 'Sammensettinger',
+ 'Assemblies restocked!' => 'Sammensettinger omplassert!',
+ 'Assembly Number missing!' => 'Sammensettingsnummer mangler!',
+ 'Asset' => 'Aktiv',
+ 'Attachment' => 'Vedlegg',
+ 'Audit Control' => 'Revisjonskontroll',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Sikkerhetskopi',
+ 'Backup sent to' => 'Sikkerhetskopier sendt til',
+ 'Balance' => 'Balanse',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'Books are open' => 'Bokføringen er åpen for rettelser',
+ 'Bought' => 'Kjøpt',
+ 'Business Number' => 'Organisasjonsnummer',
+ 'C' => 'C',
+ 'COGS' => 'Innkjøp',
+ 'Cannot delete account!' => 'Kan ikke slette konto!',
+ 'Cannot delete customer!' => 'Kan ikke slette kunde!',
+ 'Cannot delete default account!' => 'Kan ikke slette standardkonto!',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot delete item already invoiced!' => 'Kan ikke slette allerede fakturert enkeltdel!',
+ 'Cannot delete item on order!' => 'Kan ikke slette enkeltdel i ordre!',
+ 'Cannot delete item which is part of an assembly!' => 'kan ikke slette en enhet som er en del av en sammensetting!',
+ 'Cannot delete item!' => 'Kan ikke slette enkeltdel!',
+ 'Cannot delete order!' => 'Kan ikke slette ordre!',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot delete vendor!' => 'Kan ikke slette leverandør!',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan ikke ha en verdi i både debet og kredit!',
+ 'Cannot post a transaction without a value!' => 'Kan ikke bokføre transaksjon uten verdi!',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bokføre faktura for en avsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bokføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bokføre betaling for en avsluttet periode!',
+ 'Cannot post payment!' => 'Kan ikke bokføre betaling!',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bokføre postering for en avsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bokføre postering!',
+ 'Cannot process payment for a closed period!' => 'Kan ikke behandle betaling for avsluttet periode!',
+ 'Cannot save account!' => 'Kan ikke lagre konto!',
+ 'Cannot save order!' => 'Kan ikke lagre ordre!',
+ 'Cannot save preferences!' => 'Kan ikke lagre preferenser!',
+ 'Cannot stock assemblies!' => 'Kan ikke plasere sammensetninger!',
+ 'Cash' => 'Bank',
+ 'Cash based' => 'Bank basert',
+ 'Cc' => 'Kopi til',
+ 'Change Admin Password' => 'Endre passord for admin',
+ 'Change Password' => 'Endre passord',
+ 'Character Set' => 'Tegnsett',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Sjekk',
+ 'Check printed!' => 'Sjekk utskrift!',
+ 'Check printing failed!' => 'Utskrift av sjekk feilet!',
+ 'Cleared Balance' => 'Utlignet balanse',
+ 'Click on login name to edit!' => 'Klikk på brukernavn for å redigere!',
+ 'Close Books up to' => 'Avslutt bokføring opp til',
+ 'Closed' => 'Avsluttet',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Sammenlign med',
+ 'Confirm!' => 'Bekreft!',
+ 'Connect to' => 'Forbind til',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Copy to COA' => 'Kopiér til COA',
+ 'Create Chart of Accounts' => 'Opprett kontoplan',
+ 'Create Dataset' => 'Opprett datasett',
+ 'Credit' => 'Kredit',
+ 'Credit Limit' => 'Kreditgrense',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Current' => 'Nåværende',
+ 'Customer' => 'Kunde',
+ 'Customer deleted!' => 'Kunde slettet!',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Customer saved!' => 'Kunde lagret!',
+ 'Customers' => 'Kunder',
+ 'DBI not installed!' => 'DBI ikke installert!',
+ 'Database' => 'Database',
+ 'Database Administration' => 'Administrasjon av database',
+ 'Database Driver not checked!' => 'Databasedriver ikke kontrollert!',
+ 'Database Host' => 'Database-vert',
+ 'Database User missing!' => 'Bruker av database mangler!',
+ 'Dataset' => 'Datasett',
+ 'Dataset missing!' => 'Datasett mangler!',
+ 'Dataset updated!' => 'Datasett oppdatert!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfallsdato',
+ 'Date Format' => 'Datoformat',
+ 'Date Paid' => 'Betalingsdato',
+ 'Date missing!' => 'Dato mangler!',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet og kredit må være det samme!',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Decimalplaces' => 'Desimalplasser',
+ 'Delete' => 'Fjern',
+ 'Delete Account' => 'Fjern konto',
+ 'Delete Dataset' => 'Fjern datasett',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Department' => 'Avdeling',
+ 'Deposit' => 'Depositum',
+ 'Description' => 'Beskrivelse',
+ 'Difference' => 'Forskjell',
+ 'Directory' => 'Katalog',
+ 'Discount' => 'Rabatt',
+ 'Done' => 'Ferdig',
+ 'Drawing' => 'Tegning',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Grense for dropdown',
+ 'Due' => 'Forfall',
+ 'Due Date' => 'Forfallsdato',
+ 'Due Date missing!' => 'Forfallsdato mangler!',
+ 'E-mail' => 'E-post',
+ 'E-mail Statement to' => 'Send oppgjør til',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit' => 'Redigér',
+ 'Edit Account' => 'Redigér konto',
+ 'Edit Accounts Payables Transaction' => 'Redigér leverandørpostering',
+ 'Edit Accounts Receivables Transaction' => 'Redigér debitorpostering',
+ 'Edit Assembly' => 'Redigér sammensetting',
+ 'Edit Customer' => 'Endre kundeopplysninger',
+ 'Edit GIFI' => 'Redigér GIFI',
+ 'Edit General Ledger Transaction' => 'Redigér en postering i hovedbok',
+ 'Edit Part' => 'Redigér vare',
+ 'Edit Preferences for' => 'Redigér innstillinger for',
+ 'Edit Project' => 'Redigér prosjekt',
+ 'Edit Purchase Invoice' => 'Redigér innkjøpsfaktura',
+ 'Edit Purchase Order' => 'Redigér innkjøpsordre',
+ 'Edit Sales Invoice' => 'Redigér salgsfaktura',
+ 'Edit Sales Order' => 'Redigér salgsordre',
+ 'Edit Service' => 'Redigér tjeneste',
+ 'Edit Template' => 'Redigér mal',
+ 'Edit User' => 'Redigér bruker',
+ 'Edit Vendor' => 'Endre produsent',
+ 'Employee' => 'Ansatt',
+ 'Enforce transaction reversal for all dates' => 'Tving eksplisitte transaksjonsrettelser for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Angi opp til 3 bokstaver adskilt med kolon (fx NOK:EUR:USD:JPY) for innenlandske og utenlandske valutaer',
+ 'Equity' => 'Egenkapital',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate Difference' => 'Forskjell på vekslingskurs',
+ 'Exchangerate for payment missing!' => 'Vekslingskurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Existing Datasets' => 'Eksisterende datasett',
+ 'Expense' => 'Utgift',
+ 'Expense Account' => 'Utgiftskonto',
+ 'Expense/Asset' => 'Utgift/Aktiv',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'Foreign Exchange Gain' => 'Gevinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Tap på valutahandel',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI slettet!',
+ 'GIFI missing!' => 'GIFI mangler!',
+ 'GIFI saved!' => 'GIFI lagret!',
+ 'GL Transaction' => 'Postering i hovedbok',
+ 'General Ledger' => 'Hovedbok',
+ 'Goods & Services' => 'Varer og tjenester',
+ 'HTML Templates' => 'HTML-maler',
+ 'Heading' => 'Overskrift',
+ 'Host' => 'Vert',
+ 'Hostname missing!' => 'Vertsnavn mangler!',
+ 'ID' => 'ID',
+ 'Image' => 'Bilde',
+ 'In-line' => 'Inne i',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Include in drop-down menus' => 'Inkludér i rullegardin-menyer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Skal denne konto kunne velges som avgifts- eller mva-konto ved opprettelsen av kunder/leverandører?',
+ 'Income' => 'Inntekt',
+ 'Income Account' => 'Inntektskonto',
+ 'Income Statement' => 'Driftsregnskap',
+ 'Incorrect Dataset version!' => 'Gal versjon av datasett!',
+ 'Incorrect Password!' => 'Galt passord!',
+ 'Individual Items' => 'Individuelle enheter',
+ 'Inventory' => 'Artikler',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning må være null for at du kan sette denne sammensetting som foreldet!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning må være null for at du kan sette denne enhet som foreldet!',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning må være null!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bokført!',
+ 'Invoices' => 'Fakturaer',
+ 'Is this a summary account to record' => 'Samlekonto for',
+ 'Item deleted!' => 'Enkeltdel slettet!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'LaTeX Templates' => 'LaTeX-maler',
+ 'Language' => 'Språk',
+ 'Last Cost' => 'Seneste pris',
+ 'Last Invoice Number' => 'Seneste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Løpenumre og standardkontoer',
+ 'Last Purchase Order Number' => 'Seneste innkjøpsordrenummer',
+ 'Last Sales Order Number' => 'Seneste salgsordrenummer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'La vert- og port-felt være tomme med mindre du vil lage en ekstern forbindelse.',
+ 'Liability' => 'Passiv',
+ 'Licensed to' => 'Utført for',
+ 'Line Total' => 'Antall linjer',
+ 'Link' => 'Referanse',
+ 'Link Accounts' => 'Kople kontoer',
+ 'List Accounts' => 'List kontoer',
+ 'List GIFI' => 'List GIFI',
+ 'List Price' => 'Listepris',
+ 'List Transactions' => 'Vis bokføringer',
+ 'Login' => 'Login',
+ 'Logout' => 'Log ut',
+ 'Make' => 'Fabrikat',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Modell',
+ 'Multibyte Encoding' => 'Tegnsett',
+ 'N/A' => 'I/T',
+ 'Name' => 'Navn',
+ 'Name missing!' => 'Navn mangler!',
+ 'New Templates' => 'Nye maler',
+ 'No' => 'Nei',
+ 'No Database Drivers available!' => 'Ingen databasedrivere tilgjengelige!',
+ 'No Dataset selected!' => 'Ingen datasett valgt!',
+ 'No email address for' => 'Ingen emailadresse for',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkninger',
+ 'Nothing applied!' => 'Ingenting utført!',
+ 'Nothing selected!' => 'Ingenting valgt!',
+ 'Nothing to delete!' => 'Intet å slette!',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Numerisk format',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'O' => 'O',
+ 'Obsolete' => 'Foreldet',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'On Hand' => 'På lager',
+ 'On Order' => 'I ordre',
+ 'Open' => 'Åpne',
+ 'Oracle Database Administration' => 'Administrasjon av database Oracle',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Ordredato',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Entry' => 'Ordreinngang',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'Order deleted!' => 'Ordre slettet!',
+ 'Order saved!' => 'Ordre lagret!',
+ 'Ordered' => 'Ordrer',
+ 'Orphaned' => 'Frittstående',
+ 'Out of balance!' => 'Ute av balanse!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Paid' => 'Betalt',
+ 'Paid in full' => 'Alt betalt',
+ 'Part' => 'Vare',
+ 'Part Number missing!' => 'Varenummer mangler!',
+ 'Parts' => 'Deler',
+ 'Parts Inventory' => 'Vareliste',
+ 'Password' => 'Passord',
+ 'Password changed!' => 'Passord endret!',
+ 'Payables' => 'Utbetalinger',
+ 'Payment' => 'Betaling',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payment posted!' => 'Betaling bokført!',
+ 'Payments' => 'Utbetaling',
+ 'Pg Database Administration' => 'Administrasjon av database Pg',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port mangler!',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Innstillinger',
+ 'Preferences saved!' => 'Innstillinger lagret!',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Project Number' => 'Prosjektnummer',
+ 'Project Number missing!' => 'Prosjektnummer mangler!',
+ 'Project deleted!' => 'Prosjekt slettet!',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Project saved!' => 'Prosjekt lagret!',
+ 'Projects' => 'Prosjekter',
+ 'Purchase Invoice' => 'Innkjøpsfaktura',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Purchase Orders' => 'Innkjøpsordrer',
+ 'Qty' => 'Antall',
+ 'ROP' => 'Etterbestill ved',
+ 'Rate' => 'Rate',
+ 'Recd' => 'Mottatt',
+ 'Receipt' => 'Kvittering',
+ 'Receipt printed!' => 'Kvittering skrevet!',
+ 'Receipt printing failed!' => 'Kvitteringsutskrift feilet!',
+ 'Receipts' => 'Kvitteringer',
+ 'Receivables' => 'Innbetalinger',
+ 'Reconciliation' => 'Bankoppgjør',
+ 'Record in' => 'Bokfør på',
+ 'Reference' => 'Referanse',
+ 'Reference missing!' => 'Referanser mangler!',
+ 'Remaining' => 'Resterende',
+ 'Report for' => 'Rapport for',
+ 'Reports' => 'Rapporter',
+ 'Required by' => 'Bestilt av',
+ 'Retained Earnings' => 'Realisert overskudd',
+ 'Sales' => 'Salg',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Salesperson' => '',
+ 'Save' => 'Lagre',
+ 'Save as new' => 'Lagre som ny',
+ 'Save to File' => 'Lagre i fil',
+ 'Screen' => 'Skjerm',
+ 'Select a Dataset to delete and press "Continue"' => 'Velg et datasett det skal fjernes og trykk "Fortsett"',
+ 'Select all' => 'Velg alt',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sell Price' => 'Salgspris',
+ 'Send by E-Mail' => 'Sendt per email',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Service Items' => 'Tjenester',
+ 'Service Number missing!' => 'Tjenestenummer mangler!',
+ 'Services' => 'Tjenester',
+ 'Setup Templates' => 'Oppsett av maler',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Ship via' => 'Avsend via',
+ 'Short' => 'Kort',
+ 'Signature' => 'Underskrift',
+ 'Sold' => 'Solgt',
+ 'Source' => 'Bilag',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Oppgjør',
+ 'Statement Balance' => 'Balanseoppgjør',
+ 'Statement sent to' => 'Oppgjør sendt til',
+ 'Statements sent to printer!' => 'Oppgjør sendt til skriver!',
+ 'Stock Assembly' => 'Lagersammensetting',
+ 'Stylesheet' => 'Stílark',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'System',
+ 'Tax' => 'Avgift/mva',
+ 'Tax Accounts' => 'Avgift/mva-kontoer',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'Tax collected' => 'Inngående avgift',
+ 'Tax paid' => 'Betalt avgift',
+ 'Taxable' => 'Avgifts/mvapliktig',
+ 'Template saved!' => 'Mal lagret!',
+ 'Templates' => 'Maler',
+ 'Terms: Net' => 'Netto',
+ 'The following Datasets are not in use and can be deleted' => 'De følgende datasett er ikke i bruk og kan slettes',
+ 'The following Datasets need to be updated' => 'De følgende datasettene skal oppdateres',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Dette er en innledende kontroll for eksisterende kilder. Ingenting vil bli opprettet eller stettet på dette trinnet!',
+ 'To' => 'Til',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'For å tilføye en bruker til en gruppe må du endre et brukernavn og så lagre. Den nye brukeren vil så bli lagret med de samme variablene under det nye loginnavn.',
+ 'Top Level' => 'Toppnivå',
+ 'Total' => 'I alt',
+ 'Transaction Date missing!' => 'Transaksjonsdato mangler!',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bokført!',
+ 'Transaction reversal enforced for all dates' => 'Transaksjonsrettelser skal alltid bokføres eksplisitt',
+ 'Transaction reversal enforced up to' => 'Transaksjonsrettelser skal bokføres eksplisitt inntil',
+ 'Transactions' => 'Posteringer',
+ 'Transactions exist, cannot delete customer!' => 'Kunde kan ikke fjernes da det er posteringer!',
+ 'Transactions exist, cannot delete vendor!' => 'Leverandør kan ikke fjernes da det er posteringer!',
+ 'Transactions exist; cannot delete account!' => 'Konto kan ikke fjernes da det er posteringer!',
+ 'Trial Balance' => 'Foreløpig status',
+ 'Unit' => 'Enhet',
+ 'Unit of measure' => 'Måleenhet',
+ 'Update' => 'Oppdatér',
+ 'Update Dataset' => 'Oppdatér datasett',
+ 'Updated' => 'Oppdateret',
+ 'Use Templates' => 'Bruk maler',
+ 'User' => 'Bruker',
+ 'User deleted!' => 'Bruker slettet!',
+ 'User saved!' => 'Bruker lagret!',
+ 'Vendor' => 'Leverandør',
+ 'Vendor deleted!' => 'Leverandør slettet!',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'Vendor saved!' => 'Leverandør lagret!',
+ 'Vendors' => 'Leverandører',
+ 'Version' => 'Versjon',
+ 'Weight' => 'Vekt',
+ 'Weight Unit' => 'Vektenhet',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Year End' => 'Årsslutt',
+ 'Yes' => 'Ja',
+ 'You are logged out!' => 'Du er logget av!',
+ 'You did not enter a name!' => 'Du gav ikke et navn!',
+ 'You must enter a host and port for local and remote connections!' => 'Du må oppgi en vert og en port for lokale og eksterne forbindelser!',
+ 'as at' => 'som ved',
+ 'collected on sales' => 'innbetalt på salg',
+ 'days' => 'dager',
+ 'does not exist' => 'eksisterer ikke',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt på epost til',
+ 'for Period' => 'for periode',
+ 'hr' => 'time',
+ 'is already a member!' => 'er allerede et medlem!',
+ 'is not a member!' => 'er ikke et medlem!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'Låst!',
+ 'paid on purchases' => 'betalt på kjøp',
+ 'sent to printer' => 'sendt til skriver',
+ 'successfully created!' => 'opprettet!',
+ 'successfully deleted!' => 'fjernet!',
+ 'to' => 'til',
+ 'website' => 'nettsted',
+};
+
+1;
diff --git a/sql-ledger/locale/no/am b/sql-ledger/locale/no/am
new file mode 100644
index 000000000..5e56e9a61
--- /dev/null
+++ b/sql-ledger/locale/no/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AR' => 'Debitorer',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer mangler!',
+ 'Account Type' => 'Kontotype',
+ 'Account Type missing!' => 'Kontotype mangler!',
+ 'Account deleted!' => 'Konto slettet!',
+ 'Account saved!' => 'Konto lagret!',
+ 'Add Account' => 'Ny konto',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Address' => 'Adresse',
+ 'Asset' => 'Aktiv',
+ 'Audit Control' => 'Revisjonskontroll',
+ 'Backup sent to' => 'Sikkerhetskopier sendt til',
+ 'Books are open' => 'Bokføringen er åpen for rettelser',
+ 'Business Number' => 'Organisasjonsnummer',
+ 'COGS' => 'Innkjøp',
+ 'Cannot delete account!' => 'Kan ikke slette konto!',
+ 'Cannot delete default account!' => 'Kan ikke slette standardkonto!',
+ 'Cannot save account!' => 'Kan ikke lagre konto!',
+ 'Cannot save preferences!' => 'Kan ikke lagre preferenser!',
+ 'Character Set' => 'Tegnsett',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Close Books up to' => 'Avslutt bokføring opp til',
+ 'Company' => 'Firma',
+ 'Continue' => 'Fortsett',
+ 'Copy to COA' => 'Kopiér til COA',
+ 'Credit' => 'Kredit',
+ 'Date Format' => 'Datoformat',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Fjern',
+ 'Delete Account' => 'Fjern konto',
+ 'Description' => 'Beskrivelse',
+ 'Dropdown Limit' => 'Grense for dropdown',
+ 'E-mail' => 'E-post',
+ 'Edit' => 'Redigér',
+ 'Edit Account' => 'Redigér konto',
+ 'Edit GIFI' => 'Redigér GIFI',
+ 'Edit Preferences for' => 'Redigér innstillinger for',
+ 'Edit Template' => 'Redigér mal',
+ 'Enforce transaction reversal for all dates' => 'Tving eksplisitte transaksjonsrettelser for alle datoer',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Angi opp til 3 bokstaver adskilt med kolon (fx NOK:EUR:USD:JPY) for innenlandske og utenlandske valutaer',
+ 'Equity' => 'Egenkapital',
+ 'Expense' => 'Utgift',
+ 'Expense Account' => 'Utgiftskonto',
+ 'Expense/Asset' => 'Utgift/Aktiv',
+ 'Fax' => 'Faks',
+ 'Foreign Exchange Gain' => 'Gevinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Tap på valutahandel',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI slettet!',
+ 'GIFI missing!' => 'GIFI mangler!',
+ 'GIFI saved!' => 'GIFI lagret!',
+ 'Heading' => 'Overskrift',
+ 'Include in drop-down menus' => 'Inkludér i rullegardin-menyer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Skal denne konto kunne velges som avgifts- eller mva-konto ved opprettelsen av kunder/leverandører?',
+ 'Income' => 'Inntekt',
+ 'Income Account' => 'Inntektskonto',
+ 'Inventory' => 'Artikler',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Is this a summary account to record' => 'Samlekonto for',
+ 'Language' => 'Språk',
+ 'Last Invoice Number' => 'Seneste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Løpenumre og standardkontoer',
+ 'Last Purchase Order Number' => 'Seneste innkjøpsordrenummer',
+ 'Last Sales Order Number' => 'Seneste salgsordrenummer',
+ 'Liability' => 'Passiv',
+ 'Link' => 'Referanse',
+ 'Name' => 'Navn',
+ 'No' => 'Nei',
+ 'No email address for' => 'Ingen emailadresse for',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Numerisk format',
+ 'Parts Inventory' => 'Vareliste',
+ 'Password' => 'Passord',
+ 'Payables' => 'Utbetalinger',
+ 'Payment' => 'Betaling',
+ 'Phone' => 'Tel',
+ 'Preferences saved!' => 'Innstillinger lagret!',
+ 'Rate' => 'Rate',
+ 'Receivables' => 'Innbetalinger',
+ 'Sales' => 'Salg',
+ 'Save' => 'Lagre',
+ 'Service Items' => 'Tjenester',
+ 'Ship via' => 'Avsend via',
+ 'Signature' => 'Underskrift',
+ 'Stylesheet' => 'Stílark',
+ 'Tax' => 'Avgift/mva',
+ 'Tax Accounts' => 'Avgift/mva-kontoer',
+ 'Template saved!' => 'Mal lagret!',
+ 'Transaction reversal enforced for all dates' => 'Transaksjonsrettelser skal alltid bokføres eksplisitt',
+ 'Transaction reversal enforced up to' => 'Transaksjonsrettelser skal bokføres eksplisitt inntil',
+ 'Transactions exist; cannot delete account!' => 'Konto kan ikke fjernes da det er posteringer!',
+ 'Weight Unit' => 'Vektenhet',
+ 'Year End' => 'Årsslutt',
+ 'Yes' => 'Ja',
+ 'does not exist' => 'eksisterer ikke',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'ny_konto' => 'add_account',
+ 'fortsett' => 'continue',
+ 'kopiér_til_coa' => 'copy_to_coa',
+ 'fjern' => 'delete',
+ 'redigér' => 'edit',
+ 'redigér_konto' => 'edit_account',
+ 'lagre' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ap b/sql-ledger/locale/no/ap
new file mode 100644
index 000000000..896bc69b1
--- /dev/null
+++ b/sql-ledger/locale/no/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AP Transactions' => 'Leverandørfakturaer',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Ny leverandørfaktura',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Amount Due' => 'Forfallent beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på at du vil fjerne postering',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bokføre betaling for en avsluttet periode!',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bokføre postering for en avsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bokføre postering!',
+ 'Closed' => 'Avsluttet',
+ 'Confirm!' => 'Bekreft!',
+ 'Continue' => 'Fortsett',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Date Paid' => 'Betalingsdato',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Due Date' => 'Forfallsdato',
+ 'Due Date missing!' => 'Forfallsdato mangler!',
+ 'Edit Accounts Payables Transaction' => 'Redigér leverandørpostering',
+ 'Employee' => 'Ansatt',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate for payment missing!' => 'Vekslingskurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åpne',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Ordrenummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Utbetaling',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Purchase Invoice' => 'Innkjøpsfaktura',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Avgift/mva',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'Total' => 'I alt',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bokført!',
+ 'Update' => 'Oppdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'Yes' => 'Ja',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'leverandørfaktura' => 'ap_transaction',
+ 'ny_leverandørfaktura' => 'add_accounts_payables_transaction',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'redigér_leverandørpostering' => 'edit_accounts_payables_transaction',
+ 'bokfør' => 'post',
+ 'bokfør_som_ny' => 'post_as_new',
+ 'innkjøpsfaktura' => 'purchase_invoice',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ar b/sql-ledger/locale/no/ar
new file mode 100644
index 000000000..d9ec705c7
--- /dev/null
+++ b/sql-ledger/locale/no/ar
@@ -0,0 +1,134 @@
+$self{texts} = {
+ 'AR Transaction' => 'Debitorpostering',
+ 'AR Transactions' => 'Debitorposteringer',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Ny debitorpostering',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Amount Due' => 'Forfallent beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på at du vil fjerne postering',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bokføre betaling for en avsluttet periode!',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bokføre postering for en avsluttet periode!',
+ 'Cannot post transaction!' => 'Kan ikke bokføre postering!',
+ 'Closed' => 'Avsluttet',
+ 'Confirm!' => 'Bekreft!',
+ 'Continue' => 'Fortsett',
+ 'Credit Limit' => 'Kreditgrense',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Date Paid' => 'Betalingsdato',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Due Date' => 'Forfallsdato',
+ 'Due Date missing!' => 'Forfallsdato mangler!',
+ 'Edit Accounts Receivables Transaction' => 'Redigér debitorpostering',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate for payment missing!' => 'Vekslingskurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åpne',
+ 'Order' => 'Ordre',
+ 'Order Number' => 'Ordrenummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Utbetaling',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Remaining' => 'Resterende',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Salesperson' => 'Salesperson',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Ship via' => 'Avsend via',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Avgift/mva',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'Total' => 'I alt',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bokført!',
+ 'Update' => 'Oppdatér',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'Yes' => 'Ja',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'debitorpostering' => 'ar_transaction',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'bokfør' => 'post',
+ 'bokfør_som_ny' => 'post_as_new',
+ 'salgsfaktura' => 'sales_invoice',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/arap b/sql-ledger/locale/no/arap
new file mode 100644
index 000000000..048ea799e
--- /dev/null
+++ b/sql-ledger/locale/no/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adresse',
+ 'Continue' => 'Fortsett',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Description' => 'Beskrivelse',
+ 'Number' => 'Nummer',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'fortsett' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ca b/sql-ledger/locale/no/ca
new file mode 100644
index 000000000..1b5cfacce
--- /dev/null
+++ b/sql-ledger/locale/no/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance' => 'Balanse',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Credit' => 'Kredit',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Description' => 'Beskrivelse',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'List Transactions' => 'Vis bokføringer',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Reference' => 'Referanse',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Subtotal' => 'Subtotal',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'vis_bokføringer' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/no/cp b/sql-ledger/locale/no/cp
new file mode 100644
index 000000000..670c80c05
--- /dev/null
+++ b/sql-ledger/locale/no/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Amount does not equal applied!' => 'Beløp er ikke likt utført!',
+ 'Amount missing!' => 'Konto mangler!',
+ 'Applied' => 'Utført',
+ 'Cannot post payment!' => 'Kan ikke bokføre betaling!',
+ 'Cannot process payment for a closed period!' => 'Kan ikke behandle betaling for avsluttet periode!',
+ 'Check' => 'Sjekk',
+ 'Check printed!' => 'Sjekk utskrift!',
+ 'Check printing failed!' => 'Utskrift av sjekk feilet!',
+ 'Continue' => 'Fortsett',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Date missing!' => 'Dato mangler!',
+ 'Description' => 'Beskrivelse',
+ 'Due' => 'Forfall',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'From' => 'Fra',
+ 'Invoice' => 'Faktura',
+ 'Invoices' => 'Fakturaer',
+ 'Nothing applied!' => 'Ingenting utført!',
+ 'Number' => 'Nummer',
+ 'Paid in full' => 'Alt betalt',
+ 'Payment' => 'Betaling',
+ 'Payment posted!' => 'Betaling bokført!',
+ 'Post' => 'Bokfør',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Printer',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Receipt' => 'Kvittering',
+ 'Receipt printed!' => 'Kvittering skrevet!',
+ 'Receipt printing failed!' => 'Kvitteringsutskrift feilet!',
+ 'Reference' => 'Referanse',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Update' => 'Oppdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'fortsett' => 'continue',
+ 'bokfør' => 'post',
+ 'skriv_ut' => 'print',
+ 'oppdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ct b/sql-ledger/locale/no/ct
new file mode 100644
index 000000000..994a0cfcb
--- /dev/null
+++ b/sql-ledger/locale/no/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Legg til',
+ 'Address' => 'Adresse',
+ 'All' => 'Alle',
+ 'Bcc' => 'Blind kopi',
+ 'Cannot delete customer!' => 'Kan ikke slette kunde!',
+ 'Cannot delete vendor!' => 'Kan ikke slette leverandør!',
+ 'Cc' => 'Kopi til',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Credit Limit' => 'Kreditgrense',
+ 'Customer deleted!' => 'Kunde slettet!',
+ 'Customer saved!' => 'Kunde lagret!',
+ 'Customers' => 'Kunder',
+ 'Delete' => 'Fjern',
+ 'Discount' => 'Rabatt',
+ 'E-mail' => 'E-post',
+ 'Edit Customer' => 'Endre kundeopplysninger',
+ 'Edit Vendor' => 'Endre produsent',
+ 'Fax' => 'Faks',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Name' => 'Navn',
+ 'Name missing!' => 'Navn mangler!',
+ 'Notes' => 'Bemerkninger',
+ 'Number' => 'Nummer',
+ 'Order' => 'Ordre',
+ 'Orphaned' => 'Frittstående',
+ 'Phone' => 'Tel',
+ 'Save' => 'Lagre',
+ 'Ship to' => 'Avsend til',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'Taxable' => 'Avgifts/mvapliktig',
+ 'Terms: Net' => 'Netto',
+ 'Transactions exist, cannot delete customer!' => 'Kunde kan ikke fjernes da det er posteringer!',
+ 'Transactions exist, cannot delete vendor!' => 'Leverandør kan ikke fjernes da det er posteringer!',
+ 'Vendor deleted!' => 'Leverandør slettet!',
+ 'Vendor saved!' => 'Leverandør lagret!',
+ 'Vendors' => 'Leverandører',
+ 'days' => 'dager',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'legg_til' => 'add',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'faktura' => 'invoice',
+ 'ordre' => 'order',
+ 'lagre' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/no/gl b/sql-ledger/locale/no/gl
new file mode 100644
index 000000000..0ce247d83
--- /dev/null
+++ b/sql-ledger/locale/no/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Leverandørfaktura',
+ 'AR Transaction' => 'Debitorpostering',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Ny postering i hovedbok',
+ 'Address' => 'Adresse',
+ 'All' => 'Alle',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Er du sikker på at du vil fjerne postering',
+ 'Asset' => 'Aktiv',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance' => 'Balanse',
+ 'Cannot delete transaction!' => 'Kan ikke slette postering!',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan ikke ha en verdi i både debet og kredit!',
+ 'Cannot post a transaction without a value!' => 'Kan ikke bokføre transaksjon uten verdi!',
+ 'Cannot post transaction for a closed period!' => 'Kan ikke bokføre postering for en avsluttet periode!',
+ 'Confirm!' => 'Bekreft!',
+ 'Continue' => 'Fortsett',
+ 'Credit' => 'Kredit',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet og kredit må være det samme!',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Edit General Ledger Transaction' => 'Redigér en postering i hovedbok',
+ 'Equity' => 'Egenkapital',
+ 'Expense' => 'Utgift',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Postering i hovedbok',
+ 'General Ledger' => 'Hovedbok',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income' => 'Inntekt',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Liability' => 'Passiv',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Purchase Invoice' => 'Innkjøpsfaktura',
+ 'Reference' => 'Referanse',
+ 'Reference missing!' => 'Referanser mangler!',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Subtotal' => 'Subtotal',
+ 'Transaction Date missing!' => 'Transaksjonsdato mangler!',
+ 'Transaction deleted!' => 'Postering slettet!',
+ 'Transaction posted!' => 'Postering bokført!',
+ 'Update' => 'Oppdatér',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'Yes' => 'Ja',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'leverandørfaktura' => 'ap_transaction',
+ 'debitorpostering' => 'ar_transaction',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'postering_i_hovedbok' => 'gl_transaction',
+ 'bokfør' => 'post',
+ 'bokfør_som_ny' => 'post_as_new',
+ 'innkjøpsfaktura' => 'purchase_invoice',
+ 'salgsfaktura' => 'sales_invoice',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ic b/sql-ledger/locale/no/ic
new file mode 100644
index 000000000..37c9015df
--- /dev/null
+++ b/sql-ledger/locale/no/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Aktiv',
+ 'Add' => 'Legg til',
+ 'Add Assembly' => 'Ny sammensetting',
+ 'Add Part' => 'Ny vare',
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Add Service' => 'Ny tjeneste',
+ 'Address' => 'Adresse',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Assemblies' => 'Sammensettinger',
+ 'Assemblies restocked!' => 'Sammensettinger omplassert!',
+ 'Assembly Number missing!' => 'Sammensettingsnummer mangler!',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'Bought' => 'Kjøpt',
+ 'COGS' => 'Innkjøp',
+ 'Cannot delete item already invoiced!' => 'Kan ikke slette allerede fakturert enkeltdel!',
+ 'Cannot delete item on order!' => 'Kan ikke slette enkeltdel i ordre!',
+ 'Cannot delete item which is part of an assembly!' => 'kan ikke slette en enhet som er en del av en sammensetting!',
+ 'Cannot delete item!' => 'Kan ikke slette enkeltdel!',
+ 'Cannot stock assemblies!' => 'Kan ikke plasere sammensetninger!',
+ 'Cc' => 'Kopi til',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'Drawing' => 'Tegning',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Assembly' => 'Redigér sammensetting',
+ 'Edit Part' => 'Redigér vare',
+ 'Edit Service' => 'Redigér tjeneste',
+ 'Expense' => 'Utgift',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'Image' => 'Bilde',
+ 'In-line' => 'Inne i',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income' => 'Inntekt',
+ 'Individual Items' => 'Individuelle enheter',
+ 'Inventory' => 'Artikler',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerbeholdning må være null for at du kan sette denne sammensetting som foreldet!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerbeholdning må være null for at du kan sette denne enhet som foreldet!',
+ 'Inventory quantity must be zero!' => 'Lagerbeholdning må være null!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item deleted!' => 'Enkeltdel slettet!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Last Cost' => 'Seneste pris',
+ 'Line Total' => 'Antall linjer',
+ 'Link Accounts' => 'Kople kontoer',
+ 'List Price' => 'Listepris',
+ 'Make' => 'Fabrikat',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Modell',
+ 'Name' => 'Navn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'Obsolete' => 'Foreldet',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'On Hand' => 'På lager',
+ 'On Order' => 'I ordre',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'Ordered' => 'Ordrer',
+ 'Orphaned' => 'Frittstående',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Part Number missing!' => 'Varenummer mangler!',
+ 'Parts' => 'Deler',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Qty' => 'Antall',
+ 'ROP' => 'Etterbestill ved',
+ 'Recd' => 'Mottatt',
+ 'Required by' => 'Bestilt av',
+ 'Sales' => 'Salg',
+ 'Sales Order' => 'Salgsordre',
+ 'Save' => 'Lagre',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sell Price' => 'Salgspris',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Service Number missing!' => 'Tjenestenummer mangler!',
+ 'Services' => 'Tjenester',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Short' => 'Kort',
+ 'Sold' => 'Solgt',
+ 'Stock Assembly' => 'Lagersammensetting',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Avgift/mva',
+ 'To' => 'Til',
+ 'Top Level' => 'Toppnivå',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhet',
+ 'Unit of measure' => 'Måleenhet',
+ 'Update' => 'Oppdatér',
+ 'Updated' => 'Oppdateret',
+ 'Weight' => 'Vekt',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt på epost til',
+ 'hr' => 'time',
+ 'sent to printer' => 'sendt til skriver',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'legg_til' => 'add',
+ 'ny_sammensetting' => 'add_assembly',
+ 'ny_vare' => 'add_part',
+ 'ny_tjeneste' => 'add_service',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'redigér_sammensetting' => 'edit_assembly',
+ 'redigér_vare' => 'edit_part',
+ 'redigér_tjeneste' => 'edit_service',
+ 'lagre' => 'save',
+ 'oppdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/no/io b/sql-ledger/locale/no/io
new file mode 100644
index 000000000..064657bde
--- /dev/null
+++ b/sql-ledger/locale/no/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'Cc' => 'Kopi til',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Inne i',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Name' => 'Navn',
+ 'No.' => 'Nr.',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Qty' => 'Antall',
+ 'Recd' => 'Mottatt',
+ 'Required by' => 'Bestilt av',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Subject' => 'Emne',
+ 'To' => 'Til',
+ 'Unit' => 'Enhet',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'emailed to' => 'sendt på epost til',
+ 'sent to printer' => 'sendt til skriver',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'fortsett' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/no/ir b/sql-ledger/locale/no/ir
new file mode 100644
index 000000000..ab755ba3f
--- /dev/null
+++ b/sql-ledger/locale/no/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Invoice' => 'Ny innkjøpsfaktura',
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på at du vil fjerne fakturanummer',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bokføre faktura for en avsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bokføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bokføre betaling for en avsluttet periode!',
+ 'Cc' => 'Kopi til',
+ 'Confirm!' => 'Bekreft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfallsdato',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Purchase Invoice' => 'Redigér innkjøpsfaktura',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate for payment missing!' => 'Vekslingskurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Inne i',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bokført!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Name' => 'Navn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Utbetaling',
+ 'Phone' => 'Tel',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Qty' => 'Antall',
+ 'Recd' => 'Mottatt',
+ 'Record in' => 'Bokfør på',
+ 'Required by' => 'Bestilt av',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Source' => 'Bilag',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'To' => 'Til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Oppdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt på epost til',
+ 'sent to printer' => 'sendt til skriver',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'ordre' => 'order',
+ 'bokfør' => 'post',
+ 'bokfør_som_ny' => 'post_as_new',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/is b/sql-ledger/locale/no/is
new file mode 100644
index 000000000..47f3222be
--- /dev/null
+++ b/sql-ledger/locale/no/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Er du sikker på at du vil fjerne fakturanummer',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'Cannot delete invoice!' => 'Kan ikke slette faktura!',
+ 'Cannot post invoice for a closed period!' => 'Kan ikke bokføre faktura for en avsluttet periode!',
+ 'Cannot post invoice!' => 'Kan ikke bokføre faktura!',
+ 'Cannot post payment for a closed period!' => 'Kan ikke bokføre betaling for en avsluttet periode!',
+ 'Cc' => 'Kopi til',
+ 'Confirm!' => 'Bekreft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Credit Limit' => 'Kreditgrense',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Date Due' => 'Forfallsdato',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Sales Invoice' => 'Redigér salgsfaktura',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate for payment missing!' => 'Vekslingskurs for betaling mangler!',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'In-line' => 'Inne i',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadato',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Invoice deleted!' => 'Faktura slettet!',
+ 'Invoice posted!' => 'Faktura bokført!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Name' => 'Navn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Order' => 'Ordre',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Payment date missing!' => 'Betalingsdato mangler!',
+ 'Payments' => 'Utbetaling',
+ 'Phone' => 'Tel',
+ 'Post' => 'Bokfør',
+ 'Post as new' => 'Bokfør som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Qty' => 'Antall',
+ 'Recd' => 'Mottatt',
+ 'Record in' => 'Bokfør på',
+ 'Remaining' => 'Resterende',
+ 'Required by' => 'Bestilt av',
+ 'Sales Order' => 'Salgsordre',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Ship via' => 'Avsend via',
+ 'Source' => 'Bilag',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'To' => 'Til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Oppdatér',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt på epost til',
+ 'sent to printer' => 'sendt til skriver',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'e_post' => 'e_mail',
+ 'ordre' => 'order',
+ 'bokfør' => 'post',
+ 'bokfør_som_ny' => 'post_as_new',
+ 'skriv_ut' => 'print',
+ 'avsend_til' => 'ship_to',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/login b/sql-ledger/locale/no/login
new file mode 100644
index 000000000..742ef4aa0
--- /dev/null
+++ b/sql-ledger/locale/no/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Om',
+ 'Database Host' => 'Database-vert',
+ 'Dataset' => 'Datasett',
+ 'Incorrect Dataset version!' => 'Gal versjon av datasett!',
+ 'Incorrect Password!' => 'Galt passord!',
+ 'Licensed to' => 'Utført for',
+ 'Login' => 'Login',
+ 'Name' => 'Navn',
+ 'Password' => 'Passord',
+ 'User' => 'Bruker',
+ 'Version' => 'Versjon',
+ 'You are logged out!' => 'Du er logget av!',
+ 'You did not enter a name!' => 'Du gav ikke et navn!',
+ 'is not a member!' => 'er ikke et medlem!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/no/menu b/sql-ledger/locale/no/menu
new file mode 100644
index 000000000..f8f95a0f5
--- /dev/null
+++ b/sql-ledger/locale/no/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Kreditorer',
+ 'AP Aging' => 'Aldersfordeling',
+ 'AR' => 'Debitorer',
+ 'AR Aging' => 'Aldersfordeling',
+ 'Accounting Menu' => 'Konto-meny',
+ 'Add Account' => 'Ny konto',
+ 'Add Assembly' => 'Ny sammensetting',
+ 'Add Customer' => 'Ny kunde',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add Part' => 'Ny vare',
+ 'Add Project' => 'Nytt prosjekt',
+ 'Add Service' => 'Ny tjeneste',
+ 'Add Transaction' => 'Ny postering',
+ 'Add Vendor' => 'Ny leverandør',
+ 'Assemblies' => 'Sammensettinger',
+ 'Audit Control' => 'Revisjonskontroll',
+ 'Backup' => 'Sikkerhetskopi',
+ 'Balance Sheet' => 'Status',
+ 'Cash' => 'Bank',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Sjekk',
+ 'Customers' => 'Kunder',
+ 'General Ledger' => 'Hovedbok',
+ 'Goods & Services' => 'Varer og tjenester',
+ 'HTML Templates' => 'HTML-maler',
+ 'Income Statement' => 'Driftsregnskap',
+ 'Invoice' => 'Faktura',
+ 'LaTeX Templates' => 'LaTeX-maler',
+ 'List Accounts' => 'List kontoer',
+ 'List GIFI' => 'List GIFI',
+ 'Logout' => 'Log ut',
+ 'Order Entry' => 'Ordreinngang',
+ 'Packing List' => 'Følgeseddel',
+ 'Parts' => 'Deler',
+ 'Payment' => 'Betaling',
+ 'Payments' => 'Utbetaling',
+ 'Preferences' => 'Innstillinger',
+ 'Projects' => 'Prosjekter',
+ 'Purchase Invoice' => 'Innkjøpsfaktura',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Purchase Orders' => 'Innkjøpsordrer',
+ 'Receipt' => 'Kvittering',
+ 'Receipts' => 'Kvitteringer',
+ 'Reconciliation' => 'Bankoppgjør',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Salgsfaktura',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Save to File' => 'Lagre i fil',
+ 'Send by E-Mail' => 'Sendt per email',
+ 'Services' => 'Tjenester',
+ 'Statement' => 'Oppgjør',
+ 'Stock Assembly' => 'Lagersammensetting',
+ 'Stylesheet' => 'Stílark',
+ 'System' => 'System',
+ 'Tax collected' => 'Inngående avgift',
+ 'Tax paid' => 'Betalt avgift',
+ 'Transactions' => 'Posteringer',
+ 'Trial Balance' => 'Foreløpig status',
+ 'Vendors' => 'Leverandører',
+ 'Version' => 'Versjon',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/no/oe b/sql-ledger/locale/no/oe
new file mode 100644
index 000000000..efadfa60a
--- /dev/null
+++ b/sql-ledger/locale/no/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Legg til',
+ 'Add Purchase Invoice' => 'Ny innkjøpsfaktura',
+ 'Add Purchase Order' => 'Ny innkjøpsordre',
+ 'Add Sales Invoice' => 'Ny salgsfaktura',
+ 'Add Sales Order' => 'Ny salgsordre',
+ 'Address' => 'Adresse',
+ 'Amount' => 'Beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Order Number' => 'Er du sikker på at du vil fjerne ordrenummer',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Bcc' => 'Blind kopi',
+ 'Bin' => 'Papirkurv',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Kan ikke slette ordre!',
+ 'Cannot save order!' => 'Kan ikke lagre ordre!',
+ 'Cc' => 'Kopi til',
+ 'Closed' => 'Avsluttet',
+ 'Confirm!' => 'Bekreft!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Credit Limit' => 'Kreditgrense',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kunde',
+ 'Customer missing!' => 'Kunde mangler!',
+ 'Customer not on file!' => 'Kunde ikke i database!',
+ 'Date' => 'Dato',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Delete' => 'Fjern',
+ 'Delivery Date' => 'Leveringsdato',
+ 'Description' => 'Beskrivelse',
+ 'E-mail' => 'E-post',
+ 'E-mail address missing!' => 'E-post-adresse mangler!',
+ 'Edit Purchase Order' => 'Redigér innkjøpsordre',
+ 'Edit Sales Order' => 'Redigér salgsordre',
+ 'Exchangerate' => 'Vekslingskurs',
+ 'Exchangerate missing!' => 'Vekslingskurs mangler!',
+ 'Extended' => 'Utvigt',
+ 'Fax' => 'Faks',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'ID' => 'ID',
+ 'In-line' => 'Inne i',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadato mangler!',
+ 'Invoice Number missing!' => 'Fakturanummer mangler!',
+ 'Item not on file!' => 'Enkeltdel er ikke i databasen!',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'Name' => 'Navn',
+ 'No.' => 'Nr.',
+ 'Notes' => 'Bemerkninger',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Tall mangler i rad',
+ 'O' => 'O',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'Open' => 'Åpne',
+ 'Order' => 'Ordre',
+ 'Order Date' => 'Ordredato',
+ 'Order Date missing!' => 'Ordredato mangler!',
+ 'Order Number' => 'Ordrenummer',
+ 'Order Number missing!' => 'Ordrenummer mangler!',
+ 'Order deleted!' => 'Ordre slettet!',
+ 'Order saved!' => 'Ordre lagret!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Følgeseddel',
+ 'Packing List Date missing!' => 'Dato for pakkeliste mangler!',
+ 'Packing List Number missing!' => 'Nummer for pakkeliste mangler!',
+ 'Part' => 'Vare',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Printer',
+ 'Project' => 'Prosjekt',
+ 'Project not on file!' => 'Prosjekt er ikke i database!',
+ 'Purchase Order' => 'Innkjøpsordre',
+ 'Purchase Orders' => 'Innkjøpsordrer',
+ 'Qty' => 'Antall',
+ 'Recd' => 'Mottatt',
+ 'Remaining' => 'Resterende',
+ 'Required by' => 'Bestilt av',
+ 'Sales Order' => 'Salgsordre',
+ 'Sales Orders' => 'Salgsordrer',
+ 'Save' => 'Lagre',
+ 'Save as new' => 'Lagre som ny',
+ 'Screen' => 'Skjerm',
+ 'Select from one of the items below' => 'Velg en fra listen under, og trykk "Fortsett"',
+ 'Select from one of the names below' => 'Velg fra et av navnene under',
+ 'Select from one of the projects below' => 'Velg fra et av prosjektene under',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Service' => 'Tjeneste',
+ 'Ship' => 'Avsend',
+ 'Ship to' => 'Avsend til',
+ 'Ship via' => 'Avsend via',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Avgift/mva',
+ 'Tax Included' => 'Inkl. avgifter og mva',
+ 'Terms: Net' => 'Netto',
+ 'To' => 'Til',
+ 'Total' => 'I alt',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Oppdatér',
+ 'Vendor' => 'Leverandør',
+ 'Vendor missing!' => 'Leverandør mangler!',
+ 'Vendor not on file!' => 'Leverandør er ikke i database!',
+ 'What type of item is this?' => 'Hvilken type ting er dette?',
+ 'Yes' => 'Ja',
+ 'days' => 'dager',
+ 'ea' => 'stk',
+ 'emailed to' => 'sendt på epost til',
+ 'sent to printer' => 'sendt til skriver',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'legg_til' => 'add',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'e_post' => 'e_mail',
+ 'faktura' => 'invoice',
+ 'skriv_ut' => 'print',
+ 'lagre' => 'save',
+ 'lagre_som_ny' => 'save_as_new',
+ 'avsend_til' => 'ship_to',
+ 'oppdatér' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/no/pe b/sql-ledger/locale/no/pe
new file mode 100644
index 000000000..95a1fa23d
--- /dev/null
+++ b/sql-ledger/locale/no/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Legg til',
+ 'Add Project' => 'Nytt prosjekt',
+ 'All' => 'Alle',
+ 'Continue' => 'Fortsett',
+ 'Delete' => 'Fjern',
+ 'Description' => 'Beskrivelse',
+ 'Edit Project' => 'Redigér prosjekt',
+ 'Number' => 'Nummer',
+ 'Orphaned' => 'Frittstående',
+ 'Project' => 'Prosjekt',
+ 'Project Number missing!' => 'Prosjektnummer mangler!',
+ 'Project deleted!' => 'Prosjekt slettet!',
+ 'Project saved!' => 'Prosjekt lagret!',
+ 'Projects' => 'Prosjekter',
+ 'Save' => 'Lagre',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'legg_til' => 'add',
+ 'fortsett' => 'continue',
+ 'fjern' => 'delete',
+ 'lagre' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/no/rc b/sql-ledger/locale/no/rc
new file mode 100644
index 000000000..4ff2cc819
--- /dev/null
+++ b/sql-ledger/locale/no/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Balanse',
+ 'Cleared Balance' => 'Utlignet balanse',
+ 'Continue' => 'Fortsett',
+ 'Date' => 'Dato',
+ 'Deposit' => 'Depositum',
+ 'Description' => 'Beskrivelse',
+ 'Difference' => 'Forskjell',
+ 'Done' => 'Ferdig',
+ 'Exchangerate Difference' => 'Forskjell på vekslingskurs',
+ 'From' => 'Fra',
+ 'Out of balance!' => 'Ute av balanse!',
+ 'Payment' => 'Betaling',
+ 'Reconciliation' => 'Bankoppgjør',
+ 'Select all' => 'Velg alt',
+ 'Source' => 'Bilag',
+ 'Statement Balance' => 'Balanseoppgjør',
+ 'Update' => 'Oppdatér',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'fortsett' => 'continue',
+ 'ferdig' => 'done',
+ 'velg_alt' => 'select_all',
+ 'oppdatér' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/no/rp b/sql-ledger/locale/no/rp
new file mode 100644
index 000000000..3592fd10f
--- /dev/null
+++ b/sql-ledger/locale/no/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'Aldersfordeling',
+ 'AR Aging' => 'Aldersfordeling',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Kontoer',
+ 'Amount' => 'Beløp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Vedlegg',
+ 'Aug' => 'aug',
+ 'August' => 'august',
+ 'Balance' => 'Balanse',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Blind kopi',
+ 'Cash based' => 'Bank basert',
+ 'Cc' => 'Kopi til',
+ 'Compare to' => 'Sammenlign med',
+ 'Continue' => 'Fortsett',
+ 'Copies' => 'Kopier',
+ 'Credit' => 'Kredit',
+ 'Current' => 'Nåværende',
+ 'Customer' => 'Kunde',
+ 'Date' => 'Dato',
+ 'Debit' => 'Debet',
+ 'Dec' => 'des',
+ 'December' => 'desember',
+ 'Decimalplaces' => 'Desimalplasser',
+ 'Department' => 'Avdeling',
+ 'Description' => 'Beskrivelse',
+ 'Due' => 'Forfall',
+ 'E-mail' => 'E-post',
+ 'E-mail Statement to' => 'Send oppgjør til',
+ 'Feb' => 'feb',
+ 'February' => 'februar',
+ 'From' => 'Fra',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Overskrift',
+ 'ID' => 'ID',
+ 'In-line' => 'Inne i',
+ 'Include in Report' => 'Inkludér i rapport',
+ 'Income Statement' => 'Driftsregnskap',
+ 'Invoice' => 'Faktura',
+ 'Jan' => 'jan',
+ 'January' => 'januar',
+ 'Jul' => 'jul',
+ 'July' => 'juli',
+ 'Jun' => 'jun',
+ 'June' => 'juni',
+ 'Mar' => 'mar',
+ 'March' => 'mars',
+ 'May' => 'mai',
+ 'May ' => 'mai ',
+ 'Message' => 'Melding',
+ 'N/A' => 'I/T',
+ 'Nothing selected!' => 'Ingenting valgt!',
+ 'Nov' => 'nov',
+ 'November' => 'november',
+ 'Oct' => 'okt',
+ 'October' => 'oktober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Utbetaling',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Printer',
+ 'Project Number' => 'Prosjektnummer',
+ 'Receipts' => 'Kvitteringer',
+ 'Report for' => 'Rapport for',
+ 'Retained Earnings' => 'Realisert overskudd',
+ 'Screen' => 'Skjerm',
+ 'Select all' => 'Velg alt',
+ 'Select postscript or PDF!' => 'Velg postscript eller PDF!',
+ 'Sep' => 'sep',
+ 'September' => 'september',
+ 'Source' => 'Bilag',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Oppgjør',
+ 'Statement sent to' => 'Oppgjør sendt til',
+ 'Statements sent to printer!' => 'Oppgjør sendt til skriver!',
+ 'Subject' => 'Emne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Avgift/mva',
+ 'Tax collected' => 'Inngående avgift',
+ 'Tax paid' => 'Betalt avgift',
+ 'Total' => 'I alt',
+ 'Trial Balance' => 'Foreløpig status',
+ 'Vendor' => 'Leverandør',
+ 'as at' => 'som ved',
+ 'collected on sales' => 'innbetalt på salg',
+ 'for Period' => 'for periode',
+ 'paid on purchases' => 'betalt på kjøp',
+ 'to' => 'til',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'fortsett' => 'continue',
+ 'e_post' => 'e_mail',
+ 'skriv_ut' => 'print',
+ 'velg_alt' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/COPYING b/sql-ledger/locale/pa/COPYING
new file mode 100644
index 000000000..44b6a93c9
--- /dev/null
+++ b/sql-ledger/locale/pa/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Spanish texts:
+#
+# Author: Maria Gabriela Fong <mgfong@maga.tzo.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/pa/LANGUAGE b/sql-ledger/locale/pa/LANGUAGE
new file mode 100644
index 000000000..012de50c7
--- /dev/null
+++ b/sql-ledger/locale/pa/LANGUAGE
@@ -0,0 +1 @@
+Panamanian Spanish
diff --git a/sql-ledger/locale/pa/admin b/sql-ledger/locale/pa/admin
new file mode 100644
index 000000000..1e69b2643
--- /dev/null
+++ b/sql-ledger/locale/pa/admin
@@ -0,0 +1,128 @@
+$self{texts} = {
+ 'Access Control' => 'Control de Acceso',
+ 'Accounting' => 'Contabilidad',
+ 'Add User' => 'Agregar Usuario',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'Todos los datasets actualizados',
+ 'Change Admin Password' => 'Cambiar Contraseña de Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de entrada a
+editar',
+ 'Company' => 'Compañía',
+ 'Connect to' => 'Conectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear set de datos',
+ 'DBI not installed!' => 'DBI no instalado!',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => 'Driver de base de datos no revisado',
+ 'Database User missing!' => 'No se encuentra usuario de base de datos',
+ 'Dataset' => 'Set de datos',
+ 'Dataset missing!' => 'No se encuentra Set de datos!',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Formato de Fecha',
+ 'Delete' => 'Borrar',
+ 'Delete Dataset' => 'Borrar Set de Datos',
+ 'Directory' => 'Directorio',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Correo Electrónico',
+ 'Edit User' => 'Editar Usuario',
+ 'Existing Datasets' => 'Sets de dato existentes',
+ 'Fax' => 'Fax',
+ 'Host' => 'Servidor base de datos',
+ 'Hostname missing!' => 'No se encuentra servidor de base de datos',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Language' => 'Lenguaje',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Login' => 'Login',
+ 'Name' => 'Nombre',
+ 'New Templates' => 'Nuevas Plantillas',
+ 'No Database Drivers available!' => 'No hay manejador de base de datos
+disponible!',
+ 'No Dataset selected!' => 'No se ha seleccionado el set de datos',
+ 'Nothing to delete!' => 'Noda que borrar',
+ 'Number Format' => 'Formato de Numero',
+ 'Oracle Database Administration' => 'Administración de base de datos Oracle',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Administración de base de datos Pg',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se encuentra el Puerto!',
+ 'Printer' => 'Impresora',
+ 'Save' => 'Salvar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione un set de
+datos para borrar y presione "Continuar"',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Templates' => 'Plantillas',
+ 'The following Datasets are not in use and can be deleted' => 'Los
+siguientes sets de datos no estan en uso y pueden ser borrados',
+ 'The following Datasets need to be updated' => 'Los siguientes datasets necesitan ser actualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. Nada será creado o borrado en esta etapa!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el nombre de entrada (login) y guarde los cambios. Un nuevo usuario, con las mismas variables será guardado bajo el nuevo nombre de entrada. (login)',
+ 'Update Dataset' => 'Actualizar Dataset',
+ 'Use Templates' => 'Plantillas de Usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Versión',
+ 'You must enter a host and port for local and remote connections!' => 'Debe
+introducir un servidor de base de datos y un puerto para conexiones locales y
+remotas!',
+ 'does not exist' => 'No existe',
+ 'is already a member!' => 'ya es miembro!',
+ 'localhost' => 'servidor local',
+ 'successfully created!' => 'creado con éxito!',
+ 'successfully deleted!' => 'creado con éxito!',
+ 'website' => 'sitio web',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'agregar_usuario' => 'add_user',
+ 'cambiar_contraseña_de_administrador' => 'change_admin_password',
+ 'cambiar_contraseña' => 'change_password',
+ 'continuar' => 'continue',
+ 'crear_set_de_datos' => 'create_dataset',
+ 'borrar' => 'delete',
+ 'borrar_set_de_datos' => 'delete_dataset',
+ 'login' => 'login',
+ 'administración_de_base_de_datos_oracle' => 'oracle_database_administration',
+ 'administración_de_base_de_datos_pg' => 'pg_database_administration',
+ 'salvar' => 'save',
+ 'actualizar_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/all b/sql-ledger/locale/pa/all
new file mode 100644
index 000000000..2981a10df
--- /dev/null
+++ b/sql-ledger/locale/pa/all
@@ -0,0 +1,496 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'Transacciones - Cuentas por Pagar',
+ 'AR' => 'Ctas X Cobrar',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'Transacciones de Cuentas por Cobrar',
+ 'About' => 'Acerca',
+ 'Access Control' => 'Control de Acceso',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'No existe el número de cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'No existe el tipo de la cuenta!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Contabilidad',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Accounts' => 'Cuentas',
+ 'Active' => '',
+ 'Add' => 'Agregar',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Add General Ledger Transaction' => 'Agregar Transacción - Mayor General',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transaccion',
+ 'Add User' => 'Agregar Usuario',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => '',
+ 'All' => 'Todos',
+ 'All Datasets up to date!' => 'Todos los datasets actualizados',
+ 'Amount' => 'Total',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la Orden No.:?',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Assemblies' => 'Ensamblajes',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'No existe Numero de Ensamblaje!',
+ 'Asset' => 'Activo',
+ 'Attachment' => 'Adjunto',
+ 'Audit Control' => 'Control de Audito',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => '',
+ 'Backup' => 'Respaldar datos',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Balance' => '',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => '',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Libros estan abiertos',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'Numero de Negocio',
+ 'C' => '',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'No se puede borrar cuenta por defecto!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'No puede suprimir el item ya facturado!',
+ 'Cannot delete item on order!' => 'No se puede borrar el item ya en cotizacion',
+ 'Cannot delete item which is part of an assembly!' => 'No puede suprimir un item que es parte de un ensamblaje!',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'No puede guardar transaccion para un periodo cerrado',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Cambiar Contraseña de Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Haga clic en el nombre de entrada a
+editar',
+ 'Close Books up to' => 'Cerrar libros hasta',
+ 'Closed' => 'Cerrado',
+ 'Company' => 'Compañía',
+ 'Compare to' => 'Comparar a',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Conectar a',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Copy to COA' => 'Copiar a catálogo de cuentas',
+ 'Create Chart of Accounts' => 'Crear catálogo de cuentas',
+ 'Create Dataset' => 'Crear set de datos',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Curr' => '$',
+ 'Currency' => 'Moneda',
+ 'Current' => '',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'DBI no instalado!',
+ 'Database' => 'Base de datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => 'Driver de base de datos no revisado',
+ 'Database Host' => 'Servidor de Base de Datos',
+ 'Database User missing!' => 'No se encuentra usuario de base de datos',
+ 'Dataset' => 'Set de datos',
+ 'Dataset missing!' => 'No se encuentra Set de datos!',
+ 'Dataset updated!' => '',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Date Format' => 'Formato de Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Date missing!' => '',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance.',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => '',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Delete Dataset' => 'Borrar Set de Datos',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'Descripción',
+ 'Difference' => '',
+ 'Directory' => 'Directorio',
+ 'Discount' => 'Descuento',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Vence',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit' => '',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'Editar Ensamblaje',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Editar Orden de Venta',
+ 'Edit Service' => 'Editar Servicio',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Edit User' => 'Editar Usuario',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => 'Forzar reversión de transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Existing Datasets' => 'Sets de dato existentes',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Egreso',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'Foreign Exchange Gain' => 'Ganancia en Moneda Extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en Moneda Extranjera',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => 'No se encuentra GIFI',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Partes y Servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Heading' => 'Encabezado',
+ 'Host' => 'Servidor base de datos',
+ 'Hostname missing!' => 'No se encuentra servidor de base de datos',
+ 'ID' => 'ID',
+ 'Image' => '',
+ 'In-line' => 'En-linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Include in drop-down menus' => 'Incluya en menús desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluya esta cuenta en las formas del cliente/proveedor para señalar al cliente/proveedor como gravable de impuesto?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Incorrect Dataset version!' => 'Version de dataset Incorrecta',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este ensamblaje a obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar esta parte a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser
+cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'Es esta una cuenta de resumen a registrar?',
+ 'Item deleted!' => '',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'Language' => 'Lenguaje',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultima Orden de Compra',
+ 'Last Sales Order Number' => 'Ultima Orden de Venta',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje los campos de servidor de base de datos y puerto vacíos al menos que quiera hacer una conexión remota',
+ 'Liability' => 'Pasivo',
+ 'Licensed to' => 'Licenciado a',
+ 'Line Total' => 'Total de Línea',
+ 'Link' => 'Enlaces',
+ 'Link Accounts' => 'Enlazar Cuentas',
+ 'List Accounts' => 'Listar Cuentas',
+ 'List GIFI' => 'Listar GIFI',
+ 'List Price' => 'Precio de Lista',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Login' => 'Login',
+ 'Logout' => 'Logout',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => '',
+ 'Model' => 'Modelo',
+ 'N/A' => 'N/D',
+ 'Name' => 'Nombre',
+ 'Name missing!' => '',
+ 'New Templates' => 'Nuevas Plantillas',
+ 'No' => 'No',
+ 'No Database Drivers available!' => 'No hay manejador de base de datos
+disponible!',
+ 'No Dataset selected!' => 'No se ha seleccionado el set de datos',
+ 'No email address for' => 'Falta dirección email para',
+ 'No.' => '',
+ 'Notes' => 'Notas',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => 'Noda que borrar',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de Numero',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'O' => '',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'En Existencia',
+ 'On Order' => '',
+ 'Open' => 'Abierto',
+ 'Oracle Database Administration' => 'Administración de base de datos Oracle',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Entry' => 'Orden de Entrada',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'Huerfano',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Paid' => 'Total Pagado',
+ 'Paid in full' => '',
+ 'Part' => 'Partes',
+ 'Part Number missing!' => 'Falta del número de pieza!',
+ 'Parts' => 'Partes',
+ 'Parts Inventory' => 'Inventario de Partes',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => '',
+ 'Payables' => 'Por Pagar',
+ 'Payment' => 'Pago',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payment posted!' => '',
+ 'Payments' => 'Pagos',
+ 'Pg Database Administration' => 'Administración de base de datos Pg',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Puerto',
+ 'Port missing!' => 'No se encuentra el Puerto!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Preferencias',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Price' => 'Precio',
+ 'Print' => '',
+ 'Printer' => 'Impresora',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'ROP',
+ 'Rate' => 'Tarifa',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Por Cobrar',
+ 'Reconciliation' => '',
+ 'Record in' => 'Registrar en',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => 'Remanente',
+ 'Report for' => 'Reportar por',
+ 'Reports' => 'Reportes',
+ 'Required by' => 'Requerido por',
+ 'Retained Earnings' => 'Ganacias Retenidas',
+ 'Sales' => 'Ventas',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save' => 'Salvar',
+ 'Save as new' => '',
+ 'Save to File' => 'Respaldar a Archivo',
+ 'Screen' => 'Pantalla',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione un set de
+datos para borrar y presione "Continuar"',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Precio de Venta',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Items' => 'Items de Servicio',
+ 'Service Number missing!' => 'Falta el número de servicio!',
+ 'Services' => 'Servicios',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Corto',
+ 'Signature' => 'Firma',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estandar',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'Sistema',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas De Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Gravable de Impuesto',
+ 'Template saved!' => '',
+ 'Templates' => 'Plantillas',
+ 'Terms: Net' => 'Crédito',
+ 'The following Datasets are not in use and can be deleted' => 'Los
+siguientes sets de datos no estan en uso y pueden ser borrados',
+ 'The following Datasets need to be updated' => 'Los siguientes datasets necesitan ser actualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta es una verificacion preliminar de fuentes existentes. Nada será creado o borrado en esta etapa!',
+ 'To' => 'Hasta ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el nombre de entrada (login) y guarde los cambios. Un nuevo usuario, con las mismas variables será guardado bajo el nuevo nombre de entrada. (login)',
+ 'Top Level' => '',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Falta la fecha de la transacción!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => 'Retorno de transacciones forzado para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Reversal de transacciones forzado hasta ',
+ 'Transactions' => 'Transacciones',
+ 'Transactions exist, cannot delete customer!' => 'Las transacciones existen, no pueden suprimir el cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Las transacciones existen, no pueden suprimir a proveedor',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen,
+no puede suprimir la cuenta!',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => '',
+ 'Update Dataset' => 'Actualizar Dataset',
+ 'Updated' => '',
+ 'Use Templates' => 'Plantillas de Usuarios',
+ 'User' => 'Usuario',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Proveedor',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'Versión',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Year End' => 'Fin del Año Fiscal',
+ 'Yes' => 'Si',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'No introdujo un nombre!',
+ 'You must enter a host and port for local and remote connections!' => 'Debe
+introducir un servidor de base de datos y un puerto para conexiones locales y
+remotas!',
+ 'as at' => '',
+ 'collected on sales' => 'Recabado en ventas',
+ 'days' => 'Días',
+ 'does not exist' => 'No existe',
+ 'ea' => 'c/u',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'for Period' => 'para el período',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ya es miembro!',
+ 'is not a member!' => 'no es un miembro!',
+ 'localhost' => 'servidor local',
+ 'paid on purchases' => 'pagado en compras',
+ 'sent to printer' => 'enviar a impresora',
+ 'successfully created!' => 'creado con éxito!',
+ 'successfully deleted!' => 'creado con éxito!',
+ 'to' => '',
+ 'website' => 'sitio web',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/am b/sql-ledger/locale/pa/am
new file mode 100644
index 000000000..47edf440a
--- /dev/null
+++ b/sql-ledger/locale/pa/am
@@ -0,0 +1,140 @@
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AR' => 'Ctas X Cobrar',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'No existe el número de cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'No existe el tipo de la cuenta!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Address' => 'Dirección',
+ 'Asset' => 'Activo',
+ 'Audit Control' => 'Control de Audito',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Books are open' => 'Libros estan abiertos',
+ 'Business Number' => 'Numero de Negocio',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'No se puede borrar cuenta por defecto!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Tabla de Caracteres',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Close Books up to' => 'Cerrar libros hasta',
+ 'Company' => 'Compañía',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar a catálogo de cuentas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato de Fecha',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Description' => 'Descripción',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Correo Electrónico',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Enforce transaction reversal for all dates' => 'Forzar reversión de transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Egreso',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Ganancia en Moneda Extranjera',
+ 'Foreign Exchange Loss' => 'Pérdida en Moneda Extranjera',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'No se encuentra GIFI',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Encabezado',
+ 'Include in drop-down menus' => 'Incluya en menús desplegables',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluya esta cuenta en las formas del cliente/proveedor para señalar al cliente/proveedor como gravable de impuesto?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Is this a summary account to record' => 'Es esta una cuenta de resumen a registrar?',
+ 'Language' => 'Lenguaje',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultima Orden de Compra',
+ 'Last Sales Order Number' => 'Ultima Orden de Venta',
+ 'Liability' => 'Pasivo',
+ 'Link' => 'Enlaces',
+ 'Name' => 'Nombre',
+ 'No' => 'No',
+ 'No email address for' => 'Falta dirección email para',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato de Numero',
+ 'Parts Inventory' => 'Inventario de Partes',
+ 'Password' => 'Contraseña',
+ 'Payables' => 'Por Pagar',
+ 'Payment' => 'Pago',
+ 'Phone' => 'Teléfono',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Rate' => 'Tarifa',
+ 'Receivables' => 'Por Cobrar',
+ 'Sales' => 'Ventas',
+ 'Save' => 'Salvar',
+ 'Service Items' => 'Items de Servicio',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'Tax' => 'Impuesto',
+ 'Tax Accounts' => 'Cuentas De Impuesto',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Retorno de transacciones forzado para todas las fechas',
+ 'Transaction reversal enforced up to' => 'Reversal de transacciones forzado hasta ',
+ 'Transactions exist; cannot delete account!' => 'Las transacciones existen,
+no puede suprimir la cuenta!',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'Year End' => 'Fin del Año Fiscal',
+ 'Yes' => 'Si',
+ 'does not exist' => 'No existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'agregar_cuenta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_a_catálogo_de_cuentas' => 'copy_to_coa',
+ 'borrar' => 'delete',
+ 'edit' => 'edit',
+ 'editar_cuenta' => 'edit_account',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ap b/sql-ledger/locale/pa/ap
new file mode 100644
index 000000000..0741d00b4
--- /dev/null
+++ b/sql-ledger/locale/pa/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'Transacciones - Cuentas por Pagar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post transaction for a closed period!' => 'No puede guardar transaccion para un periodo cerrado',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Total Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ar b/sql-ledger/locale/pa/ar
new file mode 100644
index 000000000..7106f79b8
--- /dev/null
+++ b/sql-ledger/locale/pa/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'Transacciones de Cuentas por Cobrar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cannot post transaction for a closed period!' => 'No puede guardar transaccion para un periodo cerrado',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha de pago',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Fecha de Vencimiento',
+ 'Due Date missing!' => 'Falta Fecha de Vencimiento!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Total Pagado',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Remanente',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/arap b/sql-ledger/locale/pa/arap
new file mode 100644
index 000000000..f541192a7
--- /dev/null
+++ b/sql-ledger/locale/pa/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Dirección',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Descripción',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ca b/sql-ledger/locale/pa/ca
new file mode 100644
index 000000000..0d3d00efa
--- /dev/null
+++ b/sql-ledger/locale/pa/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Description' => 'Descripción',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Incluya en informe',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transacciones' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/cp b/sql-ledger/locale/pa/cp
new file mode 100644
index 000000000..95085e00a
--- /dev/null
+++ b/sql-ledger/locale/pa/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'From' => 'Desde',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Pago',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'Hasta ',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ct b/sql-ledger/locale/pa/ct
new file mode 100644
index 000000000..0db8902c6
--- /dev/null
+++ b/sql-ledger/locale/pa/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Borrar',
+ 'Discount' => 'Descuento',
+ 'E-mail' => 'Correo Electrónico',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nombre',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Notas',
+ 'Number' => 'Número',
+ 'Order' => 'Orden',
+ 'Orphaned' => 'Huerfano',
+ 'Phone' => 'Teléfono',
+ 'Save' => 'Salvar',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Taxable' => 'Gravable de Impuesto',
+ 'Terms: Net' => 'Crédito',
+ 'Transactions exist, cannot delete customer!' => 'Las transacciones existen, no pueden suprimir el cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Las transacciones existen, no pueden suprimir a proveedor',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'Días',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'factura' => 'invoice',
+ 'orden' => 'order',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/gl b/sql-ledger/locale/pa/gl
new file mode 100644
index 000000000..8667f1c2b
--- /dev/null
+++ b/sql-ledger/locale/pa/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'Cuenta',
+ 'Add General Ledger Transaction' => 'Agregar Transacción - Mayor General',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => '¿Está usted seguro de que desea suprimir la transacción?',
+ 'Asset' => 'Activo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede tener un valor en Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'No puede guardar transaccion para un periodo cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance.',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Mayor General',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income' => 'Ingreso',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Liability' => 'Pasivo',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Hasta ',
+ 'Transaction Date missing!' => 'Falta la fecha de la transacción!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Si',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ic b/sql-ledger/locale/pa/ic
new file mode 100644
index 000000000..44cfa3694
--- /dev/null
+++ b/sql-ledger/locale/pa/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Agregar',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Add Service' => 'Agregar Servicio',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Ensamblajes',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'No existe Numero de Ensamblaje!',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Costo de Ventas',
+ 'Cannot delete item already invoiced!' => 'No puede suprimir el item ya facturado!',
+ 'Cannot delete item on order!' => 'No se puede borrar el item ya en cotizacion',
+ 'Cannot delete item which is part of an assembly!' => 'No puede suprimir un item que es parte de un ensamblaje!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Assembly' => 'Editar Ensamblaje',
+ 'Edit Part' => 'Editar Parte',
+ 'Edit Service' => 'Editar Servicio',
+ 'Expense' => 'Egreso',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'Image' => 'Image',
+ 'In-line' => 'En-linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income' => 'Ingreso',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar este ensamblaje a obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'La cantidad en inventario debe ser cero antes de cambiar esta parte a obsoleto',
+ 'Inventory quantity must be zero!' => 'La cantidad en inventario debe ser
+cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Line Total' => 'Total de Línea',
+ 'Link Accounts' => 'Enlazar Cuentas',
+ 'List Price' => 'Precio de Lista',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'On Hand' => 'En Existencia',
+ 'On Order' => 'On Order',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Huerfano',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Part' => 'Partes',
+ 'Part Number missing!' => 'Falta del número de pieza!',
+ 'Parts' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Requerido por',
+ 'Sales' => 'Ventas',
+ 'Sales Order' => 'Orden de venta',
+ 'Save' => 'Salvar',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Precio de Venta',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Service Number missing!' => 'Falta el número de servicio!',
+ 'Services' => 'Servicios',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Corto',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'To' => 'Hasta ',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'ea' => 'c/u',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'hr' => 'hr',
+ 'sent to printer' => 'enviar a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'agregar' => 'add',
+ 'agregar_ensamblaje' => 'add_assembly',
+ 'agregar_parte' => 'add_part',
+ 'agregar_servicio' => 'add_service',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_ensamblaje' => 'edit_assembly',
+ 'editar_parte' => 'edit_part',
+ 'editar_servicio' => 'edit_service',
+ 'salvar' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/io b/sql-ledger/locale/pa/io
new file mode 100644
index 000000000..1252b51e8
--- /dev/null
+++ b/sql-ledger/locale/pa/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Address' => 'Dirección',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En-linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Part' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Sujeto',
+ 'To' => 'Hasta ',
+ 'Unit' => 'Unidad',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'sent to printer' => 'enviar a impresora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/ir b/sql-ledger/locale/pa/ir
new file mode 100644
index 000000000..042ca21ce
--- /dev/null
+++ b/sql-ledger/locale/pa/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Currency' => 'Moneda',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En-linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Part' => 'Partes',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registrar en',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'ea' => 'c/u',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'sent to printer' => 'enviar a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'orden' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/is b/sql-ledger/locale/pa/is
new file mode 100644
index 000000000..577b51fc1
--- /dev/null
+++ b/sql-ledger/locale/pa/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Esta seguro de que desea borrar la Factura No.:',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'No se puede registrar factura para un periodo cerrado!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'No se puede registrar pago para un periodo cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Fecha de Vencimiento',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Interc.',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'In-line' => 'En-linea',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha de Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Part' => 'Partes',
+ 'Payment date missing!' => 'No se encuentra la fecha de Pago!',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Registrar en',
+ 'Remaining' => 'Remanente',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Fuente',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'ea' => 'c/u',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'sent to printer' => 'enviar a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'orden' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/login b/sql-ledger/locale/pa/login
new file mode 100644
index 000000000..d6199be25
--- /dev/null
+++ b/sql-ledger/locale/pa/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Acerca',
+ 'Accounting' => 'Contabilidad',
+ 'Database Host' => 'Servidor de Base de Datos',
+ 'Dataset' => 'Set de datos',
+ 'Incorrect Dataset version!' => 'Version de dataset Incorrecta',
+ 'Incorrect Password!' => 'Contraseña Incorrecta!',
+ 'Licensed to' => 'Licenciado a',
+ 'Login' => 'Login',
+ 'Name' => 'Nombre',
+ 'Password' => 'Contraseña',
+ 'User' => 'Usuario',
+ 'Version' => 'Versión',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'No introdujo un nombre!',
+ 'is not a member!' => 'no es un miembro!',
+ 'localhost' => 'servidor local',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/menu b/sql-ledger/locale/pa/menu
new file mode 100644
index 000000000..25ba59674
--- /dev/null
+++ b/sql-ledger/locale/pa/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Ctas X Pagar',
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AR' => 'Ctas X Cobrar',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Assembly' => 'Agregar Ensamblaje',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Add Part' => 'Agregar Parte',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transaccion',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Assemblies' => 'Ensamblajes',
+ 'Audit Control' => 'Control de Audito',
+ 'Backup' => 'Respaldar datos',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Catálogo Contable',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Partes y Servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'List Accounts' => 'Listar Cuentas',
+ 'List GIFI' => 'Listar GIFI',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Orden de Entrada',
+ 'Packing List' => 'Lista de Empaque',
+ 'Parts' => 'Partes',
+ 'Payment' => 'Pago',
+ 'Payments' => 'Pagos',
+ 'Preferences' => 'Preferencias',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save to File' => 'Respaldar a Archivo',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Services' => 'Servicios',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Inventariar Ensamblaje?',
+ 'Stylesheet' => 'Estilo de hoja',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Transacciones',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Versión',
+ 'localhost' => 'servidor local',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/oe b/sql-ledger/locale/pa/oe
new file mode 100644
index 000000000..a7ee60a37
--- /dev/null
+++ b/sql-ledger/locale/pa/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Agregar Orden de Venta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => '¿Esta seguro de que desea
+borrar la Orden No.:?',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Limite de Credito',
+ 'Curr' => '$',
+ 'Currency' => 'Moneda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Fecha',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail address missing!' => 'Falta E-mail!',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Order' => 'Editar Orden de Venta',
+ 'Exchangerate' => 'Tasa de Intercambio',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'In-line' => 'En-linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta la Fecha de la Factura!',
+ 'Invoice Number missing!' => 'Falta el Número de Factura!',
+ 'Item not on file!' => 'El item no se encuentra en archivo!',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'No se encuentra el número en la fila',
+ 'O' => 'O',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha de Orden',
+ 'Order Date missing!' => 'No se encuentra la fecha de orden!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'No se encuentra el número de orden!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'No se encuentra fecha de Lista de Empaque',
+ 'Packing List Number missing!' => 'No se encuentra Número de Lista de Empaque',
+ 'Part' => 'Partes',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cantidad',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Remanente',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Orden de venta',
+ 'Sales Orders' => 'Ordenes de venta',
+ 'Save' => 'Salvar',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los items',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Terms: Net' => 'Crédito',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Update',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¿Que tipo de Item es este?',
+ 'Yes' => 'Si',
+ 'days' => 'Días',
+ 'ea' => 'c/u',
+ 'emailed to' => 'enviado a (e-mail)',
+ 'sent to printer' => 'enviar a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'correo_electrónico' => 'e_mail',
+ 'factura' => 'invoice',
+ 'print' => 'print',
+ 'salvar' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'si' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/pe b/sql-ledger/locale/pa/pe
new file mode 100644
index 000000000..e1306ae0f
--- /dev/null
+++ b/sql-ledger/locale/pa/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Project' => 'Add Project',
+ 'All' => 'Todos',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Huerfano',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Salvar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'salvar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/rc b/sql-ledger/locale/pa/rc
new file mode 100644
index 000000000..7e0dbb163
--- /dev/null
+++ b/sql-ledger/locale/pa/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Fecha',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'Desde',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Pago',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Fuente',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'Hasta ',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pa/rp b/sql-ledger/locale/pa/rp
new file mode 100644
index 000000000..ad8b35bab
--- /dev/null
+++ b/sql-ledger/locale/pa/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Envejecimiento - CxP',
+ 'AR Aging' => 'Envejecimiento - CxC ',
+ 'Account' => 'Cuenta',
+ 'Accounts' => 'Cuentas',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Adjunto',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar a',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Current',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dic',
+ 'December' => 'Diciembre',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'E-mail' => 'Correo Electrónico',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Feb',
+ 'February' => 'Febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Encabezado',
+ 'ID' => 'ID',
+ 'In-line' => 'En-linea',
+ 'Include in Report' => 'Incluya en informe',
+ 'Income Statement' => 'Estado de Cuentas',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'Ene',
+ 'January' => 'Enero',
+ 'Jul' => 'Jul',
+ 'July' => 'Julio',
+ 'Jun' => 'Jun',
+ 'June' => 'Junio',
+ 'Mar' => 'Mar',
+ 'March' => 'Marzo',
+ 'May' => 'May',
+ 'May ' => 'Mayo',
+ 'Message' => 'Mensaje',
+ 'N/A' => 'N/D',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Nov',
+ 'November' => 'Noviembre',
+ 'Oct' => 'Oct',
+ 'October' => 'Octubre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagos',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Impresora',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Reportar por',
+ 'Retained Earnings' => 'Ganacias Retenidas',
+ 'Screen' => 'Pantalla',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Sep',
+ 'September' => 'Septiembre',
+ 'Source' => 'Fuente',
+ 'Standard' => 'Estandar',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Sujeto',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Impuesto',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'Hasta ',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balance De Comprobación',
+ 'Vendor' => 'Proveedor',
+ 'as at' => 'as at',
+ 'collected on sales' => 'Recabado en ventas',
+ 'for Period' => 'para el período',
+ 'paid on purchases' => 'pagado en compras',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'correo_electrónico' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/COPYING b/sql-ledger/locale/pl/COPYING
new file mode 100644
index 000000000..e8ae22433
--- /dev/null
+++ b/sql-ledger/locale/pl/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Polish texts:
+#
+# Author: Peter Dabrowski <meritage@mail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/pl/LANGUAGE b/sql-ledger/locale/pl/LANGUAGE
new file mode 100644
index 000000000..692d02401
--- /dev/null
+++ b/sql-ledger/locale/pl/LANGUAGE
@@ -0,0 +1 @@
+Polish
diff --git a/sql-ledger/locale/pl/admin b/sql-ledger/locale/pl/admin
new file mode 100644
index 000000000..9dc5b6acd
--- /dev/null
+++ b/sql-ledger/locale/pl/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Kontrola Dostêpu',
+ 'Accounting' => 'Ksiêgowo¶æ',
+ 'Add User' => 'Dodaj U¿ytkownika',
+ 'Address' => 'Adres',
+ 'Administration' => 'Administracja',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'Zbiory Danych uzupe³nione!',
+ 'Change Admin Password' => 'Zmiana Has³a Administratora',
+ 'Change Password' => 'Zmieñ Has³o',
+ 'Character Set' => 'Zestaw Znaków',
+ 'Click on login name to edit!' => 'Kliknij nazwê u¿ytkownika ¿eby dokonaæ zmian!',
+ 'Company' => 'Firma',
+ 'Connect to' => 'Pod³±cz do',
+ 'Continue' => 'Kontynuj',
+ 'Create Chart of Accounts' => 'Utwórz Wzór Kont',
+ 'Create Dataset' => 'Utwórz Zbiór Danych',
+ 'DBI not installed!' => 'Nie zainstalowane DBI!',
+ 'Database' => 'Baza Danych',
+ 'Database Administration' => 'Administracja Bazy Danych',
+ 'Database Driver not checked!' => 'Sterownik Bazy Danych nie zaznaczony!',
+ 'Database User missing!' => 'Brak U¿ytkownika Bazy Danych!',
+ 'Dataset' => 'Zbiór Danych',
+ 'Dataset missing!' => 'Brak Zbioru Danych',
+ 'Dataset updated!' => 'Zbiór Danych uzupe³niony!',
+ 'Date Format' => 'Format Daty',
+ 'Delete' => 'Usuñ',
+ 'Delete Dataset' => 'Usuñ Zbior Danych',
+ 'Directory' => 'Katalog',
+ 'Driver' => 'Sterownik',
+ 'Dropdown Limit' => 'Limit Rozwiniêcia',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Zmiany U¿ytkownika',
+ 'Existing Datasets' => 'Istniej±cy Zbiór Danych',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Brak Nazwy Hosta',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Language' => 'Jêzyk',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Opu¶æ pole wêz³a i portu, chyba ¿e chcesz mieæ zdalne po³±czenie',
+ 'Login' => 'Zarejestrój siê',
+ 'Name' => 'Nazwa',
+ 'New Templates' => 'Nowe Szablony',
+ 'No Database Drivers available!' => 'Sterownik Bazy Danych jest niedostêpny',
+ 'No Dataset selected!' => 'Nie jest zaznaczony Zbiór Danych',
+ 'Nothing to delete!' => 'Niema nic do usuniêcia!',
+ 'Number Format' => 'Format Numeru',
+ 'Oracle Database Administration' => 'Administracja Bazy Danych Oracle',
+ 'Password' => 'Has³o',
+ 'Password changed!' => 'Has³o zmienione',
+ 'Pg Database Administration' => 'Administracja Bazy Danych Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Brak Portu',
+ 'Printer' => 'Drukarka',
+ 'Save' => 'Zapisz',
+ 'Select a Dataset to delete and press "Continue"' => 'Wybierz Zbiór Danych do usuniêcia i naci¶nij "Kontynuj"',
+ 'Setup Templates' => 'Ustaw Szablony',
+ 'Ship via' => 'Wy¶lij przez',
+ 'Signature' => 'Podpis',
+ 'Stylesheet' => 'Strona Stylowa',
+ 'Templates' => 'Szablony',
+ 'The following Datasets are not in use and can be deleted' => 'Te Zbiory Danych s± nieu¿ywane i mo¿na je usun±æ',
+ 'The following Datasets need to be updated' => 'Zbiory Danych do uzupe³nienia',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Jest to wstêpne sprawdzenie istniej±cych ¿róde³. Narazie nic nie bêdzie utworzone lub usuniête.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '¯eby dodaæ do grupy u¿ytkownika zmieñ nazwê, nazwê zarejestrowania i zapisz. Nowy u¿ytkownik z tymi samymi zmiennymi warto¶ciami bêdzie zapisany pod now± nazw± rejestruj±c±',
+ 'Update Dataset' => 'Uzupe³nij Zbiór Danych',
+ 'Use Templates' => 'U¿yj Szablony',
+ 'User' => 'U¿ytkownik',
+ 'User deleted!' => 'U¿ytkownik usuniêty',
+ 'User saved!' => 'U¿ytkownik zapisany',
+ 'Version' => 'Wersja',
+ 'You must enter a host and port for local and remote connections!' => 'Wstaw wêze³ i port dla lokalnego i zdalnego po³±czenia',
+ 'does not exist' => 'nie istnieje',
+ 'is already a member!' => 'Jest ju¿ cz³onkiem',
+ 'localhost' => 'host lokalny',
+ 'successfully created!' => 'stworzone z powodzeniem',
+ 'successfully deleted!' => 'usuniête z powodzeniem',
+ 'website' => 'witryna WWW',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'dodaj_u¿ytkownika' => 'add_user',
+ 'zmiana_has³a_administratora' => 'change_admin_password',
+ 'zmieñ_has³o' => 'change_password',
+ 'kontynuj' => 'continue',
+ 'utwórz_zbiór_danych' => 'create_dataset',
+ 'usuñ' => 'delete',
+ 'usuñ_zbior_danych' => 'delete_dataset',
+ 'zarejestrój_siê' => 'login',
+ 'administracja_bazy_danych_oracle' => 'oracle_database_administration',
+ 'administracja_bazy_danych_pg' => 'pg_database_administration',
+ 'zapisz' => 'save',
+ 'uzupe³nij_zbiór_danych' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/all b/sql-ledger/locale/pl/all
new file mode 100644
index 000000000..fabdb594e
--- /dev/null
+++ b/sql-ledger/locale/pl/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Ksiêga Zobowi±zañ',
+ 'AP Aging' => 'Zobowi±zania Przeterminowane',
+ 'AP Transaction' => 'Transakcja Zobowi±zañ',
+ 'AP Transactions' => 'Transakcje Zobowi±zañ',
+ 'AR' => 'Ksiêga Nale¿no¶ci',
+ 'AR Aging' => 'Nale¿no¶ci Przeterminowane',
+ 'AR Transaction' => 'Transakcja Nale¿no¶ci',
+ 'AR Transactions' => 'Transakcje Nale¿no¶ci',
+ 'About' => 'Na Temat',
+ 'Access Control' => 'Kontrola Dostêpu',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Numer Konta',
+ 'Account Number missing!' => 'Brak Numeru Konta!',
+ 'Account Type' => 'Rodzaj Konta',
+ 'Account Type missing!' => 'Brak Rodzaju Konta!',
+ 'Account deleted!' => 'Usuniêto Konto',
+ 'Account saved!' => 'Zapisano Konto',
+ 'Accounting' => 'Ksiêgowo¶æ',
+ 'Accounting Menu' => 'Menu Ksiêgowo¶ci',
+ 'Accounts' => 'Konta',
+ 'Active' => 'Aktywne',
+ 'Add' => 'Dodaj',
+ 'Add Account' => 'Dodaj Konto',
+ 'Add Accounts Payables Transaction' => 'Rejestr w Ksiêdze Zobowi±zañ',
+ 'Add Accounts Receivables Transaction' => 'Rejestr w Ksiêdze Nale¿no¶ci',
+ 'Add Assembly' => 'Dodaj Zestawienie',
+ 'Add Customer' => 'Dodaj Odbiorcê',
+ 'Add GIFI' => 'Dodaj GIFI',
+ 'Add General Ledger Transaction' => 'Dodaj Transakcjê w Ksiêdze G³ównej',
+ 'Add Part' => 'Dodaj Produkt',
+ 'Add Project' => 'Dodaj Projekt',
+ 'Add Purchase Invoice' => 'Zarejestrój Fakturê VAT Zakupu',
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Invoice' => 'Zarejestrój Fakturê VAT Sprzeda¿y',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Add Service' => 'Dodaj Us³ugi',
+ 'Add Transaction' => 'Dodaj Transakcjê',
+ 'Add User' => 'Dodaj U¿ytkownika',
+ 'Add Vendor' => 'Dodaj Dostawcê',
+ 'Address' => 'Adres',
+ 'Administration' => 'Administracja',
+ 'Administrator' => 'Administrator',
+ 'All' => 'Wszystko',
+ 'All Datasets up to date!' => 'Zbiory Danych uzupe³nione!',
+ 'Amount' => 'Kwota',
+ 'Amount Due' => 'Kwota Nale¿na',
+ 'Amount does not equal applied!' => 'Kwota nie jest równa',
+ 'Amount missing!' => 'Brakuje kwoty!',
+ 'Applied' => 'Zastosowano',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Invoice Number' => 'Czy chcesz usun±æ Numer Faktury?',
+ 'Are you sure you want to delete Order Number' => 'Czy chcesz usun±æ Numer Zamówienia?',
+ 'Are you sure you want to delete Transaction' => 'Czy chcesz usun±æ Transakcjê?',
+ 'Assemblies' => 'Zestawienia',
+ 'Assemblies restocked!' => 'Zestawienia uzupe³nione',
+ 'Assembly Number missing!' => 'Brak Numeru Zestawienia!',
+ 'Asset' => 'Aktywy',
+ 'Attachment' => 'Za³±cznik',
+ 'Audit Control' => 'Kontrola Audytu',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'BOM' => 'Zestawienie materia³owe',
+ 'Backup' => 'Kopia Zapasowa',
+ 'Backup sent to' => 'Kopia Zapasowa wys³ana do',
+ 'Balance' => 'Saldo',
+ 'Balance Sheet' => 'Bilans',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'Books are open' => 'Ksiêgi otwarte',
+ 'Bought' => 'Zakupione',
+ 'Business Number' => 'NIP',
+ 'C' => 'C',
+ 'COGS' => 'Koszta Sprzeda¿y',
+ 'Cannot delete account!' => 'Nie mo¿esz usun±æ konta!',
+ 'Cannot delete customer!' => 'Nie mo¿esz usun±æ klienta!',
+ 'Cannot delete default account!' => 'Konto Domy¶lne nie mo¿e byæ usuniête!',
+ 'Cannot delete invoice!' => 'Nie mo¿esz usun±æ factury!',
+ 'Cannot delete item already invoiced!' => 'Nie mo¿na usun±æ pozycji zafakturowanej!',
+ 'Cannot delete item on order!' => 'Nie mo¿na usunac zamówionego produktu!',
+ 'Cannot delete item which is part of an assembly!' => 'Nie mo¿na usun±æ czê¶ci z zestawienia!',
+ 'Cannot delete item!' => 'Nie mo¿esz usun±æ pozycji!',
+ 'Cannot delete order!' => 'Nie mo¿esz usun±æ zamówienia!',
+ 'Cannot delete transaction!' => 'Nie mo¿esz usun±æ transakcji!',
+ 'Cannot delete vendor!' => 'Nie mo¿esz usun±æ dostawcy!',
+ 'Cannot have a value in both Debit and Credit!' => 'Nie mo¿na wpisaæ warto¶ci w Debet i Kredyt równocze¶nie!',
+ 'Cannot post a transaction without a value!' => 'Nie mo¿esz zatwierdziæ transakcji bez warto¶ci',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu!',
+ 'Cannot post invoice!' => 'Nie mo¿esz zatwierdziæ faktury!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post payment!' => 'Nie mo¿esz zatwierdziæ p³atno¶ci!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji po zamkniêciu okresu!',
+ 'Cannot post transaction!' => 'Nie mo¿esz zatwierdziæ transakcji!',
+ 'Cannot process payment for a closed period!' => 'Niemo¿na przetworzyæ p³atno¶ci po zamkniêciu okresu',
+ 'Cannot save account!' => 'Nie mo¿na zapisaæ konta!',
+ 'Cannot save order!' => 'Nie mo¿na zapisaæ zamowienia!',
+ 'Cannot save preferences!' => 'Nie mo¿na zapisaæ preferencji!',
+ 'Cannot stock assemblies!' => 'Nie mo¿na wstawiæ z³o¿enia',
+ 'Cash' => 'Kasa',
+ 'Cash based' => 'Tryb Kasowy',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Zmiana Has³a Administratora',
+ 'Change Password' => 'Zmieñ Has³o',
+ 'Character Set' => 'Zestaw Znaków',
+ 'Chart of Accounts' => 'Plan Kont',
+ 'Check' => 'Czek',
+ 'Check printed!' => 'Czek wydrukowany!',
+ 'Check printing failed!' => 'B³±dw drukowaniu czeku',
+ 'Cleared Balance' => 'Zgadzaj±ce Saldo',
+ 'Click on login name to edit!' => 'Kliknij nazwê u¿ytkownika ¿eby dokonaæ zmian!',
+ 'Close Books up to' => 'Zamkniêcie Ksi±g do',
+ 'Closed' => 'Zamkniêto',
+ 'Company' => 'Firma',
+ 'Compare to' => 'Porównaj z',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Connect to' => 'Pod³±cz do',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Copy to COA' => 'Skopiuj do Planu Kont',
+ 'Create Chart of Accounts' => 'Utwórz Wzór Kont',
+ 'Create Dataset' => 'Utwórz Zbiór Danych',
+ 'Credit' => 'Kredyt',
+ 'Credit Limit' => 'Limit Kredytu',
+ 'Curr' => 'Waluta',
+ 'Currency' => 'Waluta',
+ 'Current' => 'Bi¿±cy',
+ 'Customer' => 'Klient',
+ 'Customer deleted!' => 'Klient usuniêty',
+ 'Customer missing!' => 'Brak Klienta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Customer saved!' => 'Klient zapisany!',
+ 'Customers' => 'Klienci',
+ 'DBI not installed!' => 'Nie zainstalowane DBI!',
+ 'Database' => 'Baza Danych',
+ 'Database Administration' => 'Administracja Bazy Danych',
+ 'Database Driver not checked!' => 'Sterownik Bazy Danych nie zaznaczony!',
+ 'Database Host' => 'Host Bazy Danych',
+ 'Database User missing!' => 'Brak U¿ytkownika Bazy Danych!',
+ 'Dataset' => 'Zbiór Danych',
+ 'Dataset missing!' => 'Brak Zbioru Danych',
+ 'Dataset updated!' => 'Zbiór Danych uzupe³niony!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Termin P³atno¶ci',
+ 'Date Format' => 'Format Daty',
+ 'Date Paid' => 'Data Zap³aty',
+ 'Date missing!' => 'Brak Daty',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet i Kredyt siê niebalansuj±!',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Decimalplaces' => 'Miejsca Dziesiêtne',
+ 'Delete' => 'Usuñ',
+ 'Delete Account' => 'Usuñ Konto',
+ 'Delete Dataset' => 'Usuñ Zbior Danych',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Deposit' => 'Wp³ata',
+ 'Description' => 'Opis',
+ 'Difference' => 'Ró¿nica',
+ 'Directory' => 'Katalog',
+ 'Discount' => 'Rabat',
+ 'Done' => 'Zrobione',
+ 'Drawing' => 'Rysunek',
+ 'Driver' => 'Sterownik',
+ 'Dropdown Limit' => 'Limit Rozwiniêcia',
+ 'Due' => 'P³atno¶æ',
+ 'Due Date' => 'Termin P³atno¶ci',
+ 'Due Date missing!' => 'Brak Terminu P³atno¶ci!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Wykaz do',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Edit' => 'Zmieñ',
+ 'Edit Account' => 'Zmiany Konta',
+ 'Edit Accounts Payables Transaction' => 'Zmiany Transakcji Konta Zobowi±zañ',
+ 'Edit Accounts Receivables Transaction' => 'Zmiany Transakcji Konta Nale¿no¶ci',
+ 'Edit Assembly' => 'Zmiany Zestawieñ',
+ 'Edit GIFI' => 'Zmieñ GIFI',
+ 'Edit General Ledger Transaction' => 'Zmiany w Ksiêdze G³ównej',
+ 'Edit Part' => 'Zmiany Produktu',
+ 'Edit Preferences for' => 'Zmiany Preferencji dla',
+ 'Edit Project' => 'Zmiany Projektu',
+ 'Edit Purchase Invoice' => 'Zmiany Faktury Zamówienia',
+ 'Edit Purchase Order' => 'Zmiany Zamówienia Zakupu',
+ 'Edit Sales Invoice' => 'Zmiany Faktury Sprzeda¿y',
+ 'Edit Sales Order' => 'Zmiany Zamówienia Klienta',
+ 'Edit Service' => 'Zmiany Us³ug',
+ 'Edit Template' => 'Zmiany Wzorca',
+ 'Edit User' => 'Zmiany U¿ytkownika',
+ 'Employee' => 'Pracownik',
+ 'Enforce transaction reversal for all dates' => 'Egzekwój zmiany transakcji dla wszystkich okresów',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Wpisz symbole (nap. PLN:USD:EUR:YEN) krajowych i zagranicznych walut ',
+ 'Equity' => 'Kapita³',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate Difference' => 'Ró¿nica Kursowa',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Existing Datasets' => 'Istniej±cy Zbiór Danych',
+ 'Expense' => 'Koszt',
+ 'Expense Account' => 'Konto Kosztów',
+ 'Expense/Asset' => 'Koszt/Aktywy',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'Foreign Exchange Gain' => 'Zysk przy Wymianie Walut',
+ 'Foreign Exchange Loss' => 'Strata przy Wymianie Walut',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI usuniête',
+ 'GIFI missing!' => 'Brakuje GIFI',
+ 'GIFI saved!' => 'GIFI zapisane',
+ 'GL Transaction' => 'Transakcja Ksiêgi G³ównej',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'Goods & Services' => 'Produkty i Us³ugi',
+ 'HTML Templates' => 'Szablony HTML',
+ 'Heading' => 'Nag³ówek',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Brak Nazwy Hosta',
+ 'ID' => 'Identyfikator',
+ 'Image' => 'Grafika',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Include in drop-down menus' => 'Do³±cz w menu rozwijanym',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Do³±cz Konto w formularzach Kontrachentów ¿eby wskazaæ ¿e podlegaj± opodatkowaniu',
+ 'Income' => 'Przychód',
+ 'Income Account' => 'Konto Przychodów',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Incorrect Dataset version!' => 'Nieprawid³owa wersja Zbioru Danych',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Individual Items' => 'Indywidualne Czê¶ci',
+ 'Inventory' => 'Inwentarz',
+ 'Inventory Account' => 'Konto Materia³owe',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Ilo¶æ Inventarza musi byæ równa zero zanim bêdzie mozna zdezaktualizowaæ to z³o¿enie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Ilo¶æ inventarza musi byæ równa zero zanim bêdzie mo¿na zdezaktualizowaæ t± czê¶æ!',
+ 'Inventory quantity must be zero!' => 'Ilo¶æc Inventarza musi byæ równa zero',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Data Wystawienia',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Invoice deleted!' => 'Faktura usuniêta',
+ 'Invoice posted!' => 'Faktura zatwierdzona',
+ 'Invoices' => 'Faktury',
+ 'Is this a summary account to record' => 'Czy jest to konto sumaryczne?',
+ 'Item deleted!' => 'Pozycja usuniêta',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'LaTeX Templates' => 'Szablony LaTeX',
+ 'Language' => 'Jêzyk',
+ 'Last Cost' => 'Cena Zakupu',
+ 'Last Invoice Number' => 'Ostatni Numer Faktury',
+ 'Last Numbers & Default Accounts' => 'Ostatnie Numery i Konta Domy¶lne',
+ 'Last Purchase Order Number' => 'Ostatni Numer Faktury Zamówienia',
+ 'Last Sales Order Number' => 'Ostatni Numer Faktury Sprzeda¿y',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Opu¶æ pole wêz³a i portu, chyba ¿e chcesz mieæ zdalne po³±czenie',
+ 'Liability' => 'Zobowi±zania',
+ 'Licensed to' => 'Licencja nale¿y do:',
+ 'Line Total' => 'Suma ca³kowita',
+ 'Link' => 'Dowi±zanie',
+ 'Link Accounts' => 'Konta dowi±zane',
+ 'List Accounts' => 'Spis Kont',
+ 'List GIFI' => 'Wykaz GIFI',
+ 'List Price' => 'Cena',
+ 'List Transactions' => 'Wykaz Transakcji',
+ 'Login' => 'Zarejestrój siê',
+ 'Logout' => 'Wyrejestrój siê',
+ 'Make' => 'Marka',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'N/A' => 'N/A',
+ 'Name' => 'Nazwa',
+ 'Name missing!' => 'Brak Nazwy',
+ 'New Templates' => 'Nowe Szablony',
+ 'No' => 'Nie',
+ 'No Database Drivers available!' => 'Sterownik Bazy Danych jest niedostêpny',
+ 'No Dataset selected!' => 'Nie jest zaznaczony Zbiór Danych',
+ 'No email address for' => 'Brak adresu email',
+ 'No.' => '',
+ 'Notes' => 'Noty',
+ 'Nothing applied!' => 'Niczego nie zastosowano',
+ 'Nothing selected!' => 'Nic nie zaznaczone!',
+ 'Nothing to delete!' => 'Niema nic do usuniêcia!',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number Format' => 'Format Numeru',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'O' => 'O',
+ 'Obsolete' => 'Zdezaktualizowane',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'On Hand' => 'Na Stanie',
+ 'On Order' => 'Zamawiane',
+ 'Open' => 'Otworzono',
+ 'Oracle Database Administration' => 'Administracja Bazy Danych Oracle',
+ 'Order' => 'Zamówienie',
+ 'Order Date' => 'Data Zamówienia',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Entry' => 'Wystawianie Zamówieñ',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Order deleted!' => 'Zamówienie usuniête',
+ 'Order saved!' => 'Zamówienie zapisane',
+ 'Ordered' => 'Zamówione',
+ 'Orphaned' => 'Zbêdne',
+ 'Out of balance!' => 'Niezgodne Saldo',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Paid' => 'Zap³acono',
+ 'Paid in full' => 'Zap³acono w ca³o¶ci',
+ 'Part' => 'Produkt',
+ 'Part Number missing!' => 'Brak Symbolu Produktu!',
+ 'Parts' => 'Produkty',
+ 'Parts Inventory' => 'Inwentarz',
+ 'Password' => 'Has³o',
+ 'Password changed!' => 'Has³o zmienione',
+ 'Payables' => 'Zobowi±zania',
+ 'Payment' => 'P³atno¶æ',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payment posted!' => 'P³atno¶æ zatwierdzona',
+ 'Payments' => 'P³atno¶ci',
+ 'Pg Database Administration' => 'Administracja Bazy Danych Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Brak Portu',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Preferencje',
+ 'Preferences saved!' => 'Preferencje Zapisane!',
+ 'Price' => 'Cena Netto',
+ 'Print' => 'Drukuj',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Brak Numeru Projektu',
+ 'Project deleted!' => 'Projekt usuniêty',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Project saved!' => 'Projekt zapisany',
+ 'Projects' => 'Projekty',
+ 'Purchase Invoice' => 'Faktura VAT Zakupu',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'ROP' => 'PPZ',
+ 'Rate' => 'Stawka',
+ 'Recd' => 'Otrzymano',
+ 'Receipt' => 'Wp³ata',
+ 'Receipts' => 'Wp³aty',
+ 'Receivables' => 'Nale¿no¶ci',
+ 'Reconciliation' => 'Zgodno¶æ Rozliczeñ',
+ 'Record in' => 'Zapisz w',
+ 'Reference' => 'Odno¶nik',
+ 'Reference missing!' => 'Brak Odno¶nika',
+ 'Remaining' => 'Pozosta³e',
+ 'Report for' => 'Raport dla',
+ 'Reports' => 'Sprawozdania',
+ 'Required by' => 'Termin Dostawy',
+ 'Retained Earnings' => 'Zysk',
+ 'Sales' => 'Sprzeda¿',
+ 'Sales Invoice' => 'Faktura VAT Sprzeda¿y',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save' => 'Zapisz',
+ 'Save as new' => 'Zapisz jako nowe',
+ 'Save to File' => 'Zapisz w zbiorze',
+ 'Screen' => 'Ekran',
+ 'Select a Dataset to delete and press "Continue"' => 'Wybierz Zbiór Danych do usuniêcia i naci¶nij "Kontynuj"',
+ 'Select all' => 'Wybierz wszystko',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sell Price' => 'Cena Sprzeda¿y',
+ 'Send by E-Mail' => 'Wys³ano przy u¿yciu E-Mail',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Service Items' => 'Artyku³y Us³ugowe',
+ 'Service Number missing!' => 'Brak Numeru Us³ugi!',
+ 'Services' => 'Us³ugi',
+ 'Setup Templates' => 'Ustaw Szablony',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Ship via' => 'Wy¶lij przez',
+ 'Short' => 'Niedobór',
+ 'Signature' => 'Podpis',
+ 'Sold' => 'Sprzedane',
+ 'Source' => '¯ród³o',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Wykaz',
+ 'Statement Balance' => 'Wykaz Salda',
+ 'Statement sent to' => 'Wykaz wys³any do',
+ 'Statements sent to printer!' => 'Wykaz wys³any do drukarki',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Stylesheet' => 'Strona Stylowa',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'System' => 'System',
+ 'Tax' => 'Podatek',
+ 'Tax Accounts' => 'Konta Podatkowe',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Tax collected' => 'Podatek pobrany',
+ 'Tax paid' => 'Podatek zap³acony',
+ 'Taxable' => 'Opodatkowane',
+ 'Template saved!' => 'Szablon zapisany',
+ 'Templates' => 'Szablony',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'The following Datasets are not in use and can be deleted' => 'Te Zbiory Danych s± nieu¿ywane i mo¿na je usun±æ',
+ 'The following Datasets need to be updated' => 'Zbiory Danych do uzupe³nienia',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Jest to wstêpne sprawdzenie istniej±cych ¿róde³. Narazie nic nie bêdzie utworzone lub usuniête.',
+ 'To' => 'do',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '¯eby dodaæ do grupy u¿ytkownika zmieñ nazwê, nazwê zarejestrowania i zapisz. Nowy u¿ytkownik z tymi samymi zmiennymi warto¶ciami bêdzie zapisany pod now± nazw± rejestruj±c±',
+ 'Top Level' => 'Najwy¿szy Poziom',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction Date missing!' => 'Brak Daty Transakcji!',
+ 'Transaction deleted!' => 'Transakcja usuniêta',
+ 'Transaction posted!' => 'Transakcja zatwierdzona',
+ 'Transaction reversal enforced for all dates' => 'Zmiana transakcji narzucona dla wszystkich okresów',
+ 'Transaction reversal enforced up to' => 'Zmiana transakcji narzucona do',
+ 'Transactions' => 'Transakcje',
+ 'Transactions exist, cannot delete customer!' => 'Istniej± Transakcje, niemo¿na usun±æ odbiorcy',
+ 'Transactions exist, cannot delete vendor!' => 'Istniej± Transakcje, nie mo¿na usun±æ dostawcy',
+ 'Transactions exist; cannot delete account!' => 'Istniej± Transakcje, nie mo¿na usun±æ konta',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Unit' => 'Jednostka',
+ 'Unit of measure' => 'Jednostka miary',
+ 'Update' => 'Uzupe³nij',
+ 'Update Dataset' => 'Uzupe³nij Zbiór Danych',
+ 'Updated' => 'Uzupe³nione',
+ 'Use Templates' => 'U¿yj Szablony',
+ 'User' => 'U¿ytkownik',
+ 'User deleted!' => 'U¿ytkownik usuniêty',
+ 'User saved!' => 'U¿ytkownik zapisany',
+ 'Vendor' => 'Dostawca',
+ 'Vendor deleted!' => 'Dostawca usuniêty',
+ 'Vendor missing!' => 'Brak Dostawcy',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'Vendor saved!' => 'Dostawca zapisany',
+ 'Vendors' => 'Dostawcy',
+ 'Version' => 'Wersja',
+ 'Weight' => 'Waga',
+ 'Weight Unit' => 'Jednostka Wagi',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Year End' => 'Koniec Roku Finansowego',
+ 'Yes' => 'Tak',
+ 'You are logged out!' => 'Jeste¶ wyrejestrowany!',
+ 'You did not enter a name!' => 'Nie wstawiono nazwy!',
+ 'You must enter a host and port for local and remote connections!' => 'Wstaw wêze³ i port dla lokalnego i zdalnego po³±czenia',
+ 'as at' => 'tak samo',
+ 'collected on sales' => 'zebrany przy sprzeda¿y',
+ 'days' => 'dni',
+ 'does not exist' => 'nie istnieje',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'for Period' => 'za Okres',
+ 'hr' => 'godz',
+ 'is already a member!' => 'Jest ju¿ cz³onkiem',
+ 'is not a member!' => 'Nie jest cz³onkiem',
+ 'localhost' => 'host lokalny',
+ 'paid on purchases' => 'zap³acony przy zakupach',
+ 'sent to printer' => 'wys³ano do drukarki',
+ 'successfully created!' => 'stworzone z powodzeniem',
+ 'successfully deleted!' => 'usuniête z powodzeniem',
+ 'to' => 'do',
+ 'website' => 'witryna WWW',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/am b/sql-ledger/locale/pl/am
new file mode 100644
index 000000000..98de453eb
--- /dev/null
+++ b/sql-ledger/locale/pl/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Ksiêga Zobowi±zañ',
+ 'AR' => 'Ksiêga Nale¿no¶ci',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Numer Konta',
+ 'Account Number missing!' => 'Brak Numeru Konta!',
+ 'Account Type' => 'Rodzaj Konta',
+ 'Account Type missing!' => 'Brak Rodzaju Konta!',
+ 'Account deleted!' => 'Usuniêto Konto',
+ 'Account saved!' => 'Zapisano Konto',
+ 'Add Account' => 'Dodaj Konto',
+ 'Add GIFI' => 'Dodaj GIFI',
+ 'Address' => 'Adres',
+ 'Asset' => 'Aktywy',
+ 'Audit Control' => 'Kontrola Audytu',
+ 'Backup sent to' => 'Kopia Zapasowa wys³ana do',
+ 'Books are open' => 'Ksiêgi otwarte',
+ 'Business Number' => 'NIP',
+ 'COGS' => 'Koszta Sprzeda¿y',
+ 'Cannot delete account!' => 'Nie mo¿esz usun±æ konta!',
+ 'Cannot delete default account!' => 'Konto Domy¶lne nie mo¿e byæ usuniête!',
+ 'Cannot save account!' => 'Nie mo¿na zapisaæ konta!',
+ 'Cannot save preferences!' => 'Nie mo¿na zapisaæ preferencji!',
+ 'Character Set' => 'Zestaw Znaków',
+ 'Chart of Accounts' => 'Plan Kont',
+ 'Close Books up to' => 'Zamkniêcie Ksi±g do',
+ 'Company' => 'Firma',
+ 'Continue' => 'Kontynuj',
+ 'Copy to COA' => 'Skopiuj do Planu Kont',
+ 'Credit' => 'Kredyt',
+ 'Date Format' => 'Format Daty',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Usuñ',
+ 'Delete Account' => 'Usuñ Konto',
+ 'Description' => 'Opis',
+ 'Dropdown Limit' => 'Limit Rozwiniêcia',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Zmieñ',
+ 'Edit Account' => 'Zmiany Konta',
+ 'Edit GIFI' => 'Zmieñ GIFI',
+ 'Edit Preferences for' => 'Zmiany Preferencji dla',
+ 'Edit Template' => 'Zmiany Wzorca',
+ 'Enforce transaction reversal for all dates' => 'Egzekwój zmiany transakcji dla wszystkich okresów',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Wpisz symbole (nap. PLN:USD:EUR:YEN) krajowych i zagranicznych walut ',
+ 'Equity' => 'Kapita³',
+ 'Expense' => 'Koszt',
+ 'Expense Account' => 'Konto Kosztów',
+ 'Expense/Asset' => 'Koszt/Aktywy',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Zysk przy Wymianie Walut',
+ 'Foreign Exchange Loss' => 'Strata przy Wymianie Walut',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI usuniête',
+ 'GIFI missing!' => 'Brakuje GIFI',
+ 'GIFI saved!' => 'GIFI zapisane',
+ 'Heading' => 'Nag³ówek',
+ 'Include in drop-down menus' => 'Do³±cz w menu rozwijanym',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Do³±cz Konto w formularzach Kontrachentów ¿eby wskazaæ ¿e podlegaj± opodatkowaniu',
+ 'Income' => 'Przychód',
+ 'Income Account' => 'Konto Przychodów',
+ 'Inventory' => 'Inwentarz',
+ 'Inventory Account' => 'Konto Materia³owe',
+ 'Is this a summary account to record' => 'Czy jest to konto sumaryczne?',
+ 'Language' => 'Jêzyk',
+ 'Last Invoice Number' => 'Ostatni Numer Faktury',
+ 'Last Numbers & Default Accounts' => 'Ostatnie Numery i Konta Domy¶lne',
+ 'Last Purchase Order Number' => 'Ostatni Numer Faktury Zamówienia',
+ 'Last Sales Order Number' => 'Ostatni Numer Faktury Sprzeda¿y',
+ 'Liability' => 'Zobowi±zania',
+ 'Link' => 'Dowi±zanie',
+ 'Name' => 'Nazwa',
+ 'No' => 'Nie',
+ 'No email address for' => 'Brak adresu email',
+ 'Number' => 'Numer Katalogu',
+ 'Number Format' => 'Format Numeru',
+ 'Parts Inventory' => 'Inwentarz',
+ 'Password' => 'Has³o',
+ 'Payables' => 'Zobowi±zania',
+ 'Payment' => 'P³atno¶æ',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Preferencje Zapisane!',
+ 'Rate' => 'Stawka',
+ 'Receivables' => 'Nale¿no¶ci',
+ 'Sales' => 'Sprzeda¿',
+ 'Save' => 'Zapisz',
+ 'Service Items' => 'Artyku³y Us³ugowe',
+ 'Ship via' => 'Wy¶lij przez',
+ 'Signature' => 'Podpis',
+ 'Stylesheet' => 'Strona Stylowa',
+ 'Tax' => 'Podatek',
+ 'Tax Accounts' => 'Konta Podatkowe',
+ 'Template saved!' => 'Szablon zapisany',
+ 'Transaction reversal enforced for all dates' => 'Zmiana transakcji narzucona dla wszystkich okresów',
+ 'Transaction reversal enforced up to' => 'Zmiana transakcji narzucona do',
+ 'Transactions exist; cannot delete account!' => 'Istniej± Transakcje, nie mo¿na usun±æ konta',
+ 'Weight Unit' => 'Jednostka Wagi',
+ 'Year End' => 'Koniec Roku Finansowego',
+ 'Yes' => 'Tak',
+ 'does not exist' => 'nie istnieje',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'dodaj_konto' => 'add_account',
+ 'kontynuj' => 'continue',
+ 'skopiuj_do_planu_kont' => 'copy_to_coa',
+ 'usuñ' => 'delete',
+ 'zmieñ' => 'edit',
+ 'zmiany_konta' => 'edit_account',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ap b/sql-ledger/locale/pl/ap
new file mode 100644
index 000000000..5e5f8f834
--- /dev/null
+++ b/sql-ledger/locale/pl/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transakcja Zobowi±zañ',
+ 'AP Transactions' => 'Transakcje Zobowi±zañ',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Rejestr w Ksiêdze Zobowi±zañ',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Amount Due' => 'Kwota Nale¿na',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Transaction' => 'Czy chcesz usun±æ Transakcjê?',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Cannot delete transaction!' => 'Nie mo¿esz usun±æ transakcji!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji po zamkniêciu okresu!',
+ 'Cannot post transaction!' => 'Nie mo¿esz zatwierdziæ transakcji!',
+ 'Closed' => 'Zamkniêto',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Continue' => 'Kontynuj',
+ 'Currency' => 'Waluta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data Zap³aty',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Description' => 'Opis',
+ 'Due Date' => 'Termin P³atno¶ci',
+ 'Due Date missing!' => 'Brak Terminu P³atno¶ci!',
+ 'Edit Accounts Payables Transaction' => 'Zmiany Transakcji Konta Zobowi±zañ',
+ 'Employee' => 'Pracownik',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Data Wystawienia',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otworzono',
+ 'Order' => 'Zamówienie',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Paid' => 'Zap³acono',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'P³atno¶ci',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Purchase Invoice' => 'Faktura VAT Zakupu',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax' => 'Podatek',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction deleted!' => 'Transakcja usuniêta',
+ 'Transaction posted!' => 'Transakcja zatwierdzona',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Brak Dostawcy',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transakcja_zobowi±zañ' => 'ap_transaction',
+ 'rejestr_w_ksiêdze_zobowi±zañ' => 'add_accounts_payables_transaction',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'zmiany_transakcji_konta_zobowi±zañ' => 'edit_accounts_payables_transaction',
+ 'zatwierd¿' => 'post',
+ 'zatwierd¿_jako_nowe' => 'post_as_new',
+ 'faktura_vat_zakupu' => 'purchase_invoice',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ar b/sql-ledger/locale/pl/ar
new file mode 100644
index 000000000..22a90b841
--- /dev/null
+++ b/sql-ledger/locale/pl/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Transakcja Nale¿no¶ci',
+ 'AR Transactions' => 'Transakcje Nale¿no¶ci',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Rejestr w Ksiêdze Nale¿no¶ci',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Amount Due' => 'Kwota Nale¿na',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Transaction' => 'Czy chcesz usun±æ Transakcjê?',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Cannot delete transaction!' => 'Nie mo¿esz usun±æ transakcji!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji po zamkniêciu okresu!',
+ 'Cannot post transaction!' => 'Nie mo¿esz zatwierdziæ transakcji!',
+ 'Closed' => 'Zamkniêto',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Continue' => 'Kontynuj',
+ 'Credit Limit' => 'Limit Kredytu',
+ 'Currency' => 'Waluta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Brak Klienta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data Zap³aty',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Description' => 'Opis',
+ 'Due Date' => 'Termin P³atno¶ci',
+ 'Due Date missing!' => 'Brak Terminu P³atno¶ci!',
+ 'Edit Accounts Receivables Transaction' => 'Zmiany Transakcji Konta Nale¿no¶ci',
+ 'Employee' => 'Pracownik',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Data Wystawienia',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otworzono',
+ 'Order' => 'Zamówienie',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Paid' => 'Zap³acono',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'P³atno¶ci',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Remaining' => 'Pozosta³e',
+ 'Sales Invoice' => 'Faktura VAT Sprzeda¿y',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax' => 'Podatek',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction deleted!' => 'Transakcja usuniêta',
+ 'Transaction posted!' => 'Transakcja zatwierdzona',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transakcja_nale¿no¶ci' => 'ar_transaction',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'zatwierd¿' => 'post',
+ 'zatwierd¿_jako_nowe' => 'post_as_new',
+ 'faktura_vat_sprzeda¿y' => 'sales_invoice',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/arap b/sql-ledger/locale/pl/arap
new file mode 100644
index 000000000..b24860ee7
--- /dev/null
+++ b/sql-ledger/locale/pl/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adres',
+ 'Continue' => 'Kontynuj',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Description' => 'Opis',
+ 'Number' => 'Numer Katalogu',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'kontynuj' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ca b/sql-ledger/locale/pl/ca
new file mode 100644
index 000000000..07f9e6d1e
--- /dev/null
+++ b/sql-ledger/locale/pl/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Balance' => 'Saldo',
+ 'Chart of Accounts' => 'Plan Kont',
+ 'Credit' => 'Kredyt',
+ 'Date' => 'Data',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Description' => 'Opis',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'List Transactions' => 'Wykaz Transakcji',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Reference' => 'Odno¶nik',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'To' => 'do',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'wykaz_transakcji' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/cp b/sql-ledger/locale/pl/cp
new file mode 100644
index 000000000..bd154d9a7
--- /dev/null
+++ b/sql-ledger/locale/pl/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Amount does not equal applied!' => 'Kwota nie jest równa',
+ 'Amount missing!' => 'Brakuje kwoty!',
+ 'Applied' => 'Zastosowano',
+ 'Cannot post payment!' => 'Nie mo¿esz zatwierdziæ p³atno¶ci!',
+ 'Cannot process payment for a closed period!' => 'Niemo¿na przetworzyæ p³atno¶ci po zamkniêciu okresu',
+ 'Check' => 'Czek',
+ 'Check printed!' => 'Czek wydrukowany!',
+ 'Check printing failed!' => 'B³±dw drukowaniu czeku',
+ 'Continue' => 'Kontynuj',
+ 'Currency' => 'Waluta',
+ 'Customer' => 'Klient',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Brak Daty',
+ 'Description' => 'Opis',
+ 'Due' => 'P³atno¶æ',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'From' => 'Od',
+ 'Invoice' => 'Faktura',
+ 'Invoices' => 'Faktury',
+ 'Nothing applied!' => 'Niczego nie zastosowano',
+ 'Number' => 'Numer Katalogu',
+ 'Paid in full' => 'Zap³acono w ca³o¶ci',
+ 'Payment' => 'P³atno¶æ',
+ 'Payment posted!' => 'P³atno¶æ zatwierdzona',
+ 'Post' => 'Zatwierd¿',
+ 'Print' => 'Drukuj',
+ 'Printer' => 'Drukarka',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Receipt' => 'Wp³ata',
+ 'Reference' => 'Odno¶nik',
+ 'Screen' => 'Ekran',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'To' => 'do',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor' => 'Dostawca',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'kontynuj' => 'continue',
+ 'zatwierd¿' => 'post',
+ 'drukuj' => 'print',
+ 'uzupe³nij' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ct b/sql-ledger/locale/pl/ct
new file mode 100644
index 000000000..e210cdac1
--- /dev/null
+++ b/sql-ledger/locale/pl/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Dodaj',
+ 'Address' => 'Adres',
+ 'All' => 'Wszystko',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Nie mo¿esz usun±æ klienta!',
+ 'Cannot delete vendor!' => 'Nie mo¿esz usun±æ dostawcy!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Credit Limit' => 'Limit Kredytu',
+ 'Customer deleted!' => 'Klient usuniêty',
+ 'Customer saved!' => 'Klient zapisany!',
+ 'Customers' => 'Klienci',
+ 'Delete' => 'Usuñ',
+ 'Discount' => 'Rabat',
+ 'E-mail' => 'E-mail',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'Faktura',
+ 'Name' => 'Nazwa',
+ 'Name missing!' => 'Brak Nazwy',
+ 'Notes' => 'Noty',
+ 'Number' => 'Numer Katalogu',
+ 'Order' => 'Zamówienie',
+ 'Orphaned' => 'Zbêdne',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Zapisz',
+ 'Ship to' => 'Wy¶lij do',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Taxable' => 'Opodatkowane',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'Transactions exist, cannot delete customer!' => 'Istniej± Transakcje, niemo¿na usun±æ odbiorcy',
+ 'Transactions exist, cannot delete vendor!' => 'Istniej± Transakcje, nie mo¿na usun±æ dostawcy',
+ 'Vendor deleted!' => 'Dostawca usuniêty',
+ 'Vendor saved!' => 'Dostawca zapisany',
+ 'Vendors' => 'Dostawcy',
+ 'days' => 'dni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'dodaj' => 'add',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'faktura' => 'invoice',
+ 'zamówienie' => 'order',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/gl b/sql-ledger/locale/pl/gl
new file mode 100644
index 000000000..1f8883f28
--- /dev/null
+++ b/sql-ledger/locale/pl/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transakcja Zobowi±zañ',
+ 'AR Transaction' => 'Transakcja Nale¿no¶ci',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Dodaj Transakcjê w Ksiêdze G³ównej',
+ 'Address' => 'Adres',
+ 'All' => 'Wszystko',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Transaction' => 'Czy chcesz usun±æ Transakcjê?',
+ 'Asset' => 'Aktywy',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Balance' => 'Saldo',
+ 'Cannot delete transaction!' => 'Nie mo¿esz usun±æ transakcji!',
+ 'Cannot have a value in both Debit and Credit!' => 'Nie mo¿na wpisaæ warto¶ci w Debet i Kredyt równocze¶nie!',
+ 'Cannot post a transaction without a value!' => 'Nie mo¿esz zatwierdziæ transakcji bez warto¶ci',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji po zamkniêciu okresu!',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Continue' => 'Kontynuj',
+ 'Credit' => 'Kredyt',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet i Kredyt siê niebalansuj±!',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Description' => 'Opis',
+ 'Edit General Ledger Transaction' => 'Zmiany w Ksiêdze G³ównej',
+ 'Equity' => 'Kapita³',
+ 'Expense' => 'Koszt',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Transakcja Ksiêgi G³ównej',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income' => 'Przychód',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Liability' => 'Zobowi±zania',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Purchase Invoice' => 'Faktura VAT Zakupu',
+ 'Reference' => 'Odno¶nik',
+ 'Reference missing!' => 'Brak Odno¶nika',
+ 'Reports' => 'Sprawozdania',
+ 'Sales Invoice' => 'Faktura VAT Sprzeda¿y',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'To' => 'do',
+ 'Transaction Date missing!' => 'Brak Daty Transakcji!',
+ 'Transaction deleted!' => 'Transakcja usuniêta',
+ 'Transaction posted!' => 'Transakcja zatwierdzona',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transakcja_zobowi±zañ' => 'ap_transaction',
+ 'transakcja_nale¿no¶ci' => 'ar_transaction',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'transakcja_ksiêgi_g³ównej' => 'gl_transaction',
+ 'zatwierd¿' => 'post',
+ 'zatwierd¿_jako_nowe' => 'post_as_new',
+ 'faktura_vat_zakupu' => 'purchase_invoice',
+ 'faktura_vat_sprzeda¿y' => 'sales_invoice',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ic b/sql-ledger/locale/pl/ic
new file mode 100644
index 000000000..c7fc3090b
--- /dev/null
+++ b/sql-ledger/locale/pl/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Aktywne',
+ 'Add' => 'Dodaj',
+ 'Add Assembly' => 'Dodaj Zestawienie',
+ 'Add Part' => 'Dodaj Produkt',
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Add Service' => 'Dodaj Us³ugi',
+ 'Address' => 'Adres',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Assemblies' => 'Zestawienia',
+ 'Assemblies restocked!' => 'Zestawienia uzupe³nione',
+ 'Assembly Number missing!' => 'Brak Numeru Zestawienia!',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'BOM' => 'Zestawienie materia³owe',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'Bought' => 'Zakupione',
+ 'COGS' => 'Koszta Sprzeda¿y',
+ 'Cannot delete item already invoiced!' => 'Nie mo¿na usun±æ pozycji zafakturowanej!',
+ 'Cannot delete item on order!' => 'Nie mo¿na usunac zamówionego produktu!',
+ 'Cannot delete item which is part of an assembly!' => 'Nie mo¿na usun±æ czê¶ci z zestawienia!',
+ 'Cannot delete item!' => 'Nie mo¿esz usun±æ pozycji!',
+ 'Cannot stock assemblies!' => 'Nie mo¿na wstawiæ z³o¿enia',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Description' => 'Opis',
+ 'Drawing' => 'Rysunek',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Edit Assembly' => 'Zmiany Zestawieñ',
+ 'Edit Part' => 'Zmiany Produktu',
+ 'Edit Service' => 'Zmiany Us³ug',
+ 'Expense' => 'Koszt',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'Image' => 'Grafika',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income' => 'Przychód',
+ 'Individual Items' => 'Indywidualne Czê¶ci',
+ 'Inventory' => 'Inwentarz',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Ilo¶æ Inventarza musi byæ równa zero zanim bêdzie mozna zdezaktualizowaæ to z³o¿enie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Ilo¶æ inventarza musi byæ równa zero zanim bêdzie mo¿na zdezaktualizowaæ t± czê¶æ!',
+ 'Inventory quantity must be zero!' => 'Ilo¶æc Inventarza musi byæ równa zero',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Item deleted!' => 'Pozycja usuniêta',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Last Cost' => 'Cena Zakupu',
+ 'Line Total' => 'Suma ca³kowita',
+ 'Link Accounts' => 'Konta dowi±zane',
+ 'List Price' => 'Cena',
+ 'Make' => 'Marka',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Microfiche' => 'Mikrofilm',
+ 'Model' => 'Model',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Obsolete' => 'Zdezaktualizowane',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'On Hand' => 'Na Stanie',
+ 'On Order' => 'Zamawiane',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Ordered' => 'Zamówione',
+ 'Orphaned' => 'Zbêdne',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Part Number missing!' => 'Brak Symbolu Produktu!',
+ 'Parts' => 'Produkty',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'ROP' => 'PPZ',
+ 'Recd' => 'Otrzymano',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales' => 'Sprzeda¿',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Save' => 'Zapisz',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sell Price' => 'Cena Sprzeda¿y',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Service Number missing!' => 'Brak Numeru Us³ugi!',
+ 'Services' => 'Us³ugi',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Short' => 'Niedobór',
+ 'Sold' => 'Sprzedane',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax' => 'Podatek',
+ 'To' => 'do',
+ 'Top Level' => 'Najwy¿szy Poziom',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Unit of measure' => 'Jednostka miary',
+ 'Update' => 'Uzupe³nij',
+ 'Updated' => 'Uzupe³nione',
+ 'Weight' => 'Waga',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'hr' => 'godz',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'dodaj' => 'add',
+ 'dodaj_zestawienie' => 'add_assembly',
+ 'dodaj_produkt' => 'add_part',
+ 'dodaj_us³ugi' => 'add_service',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'zmiany_zestawieñ' => 'edit_assembly',
+ 'zmiany_produktu' => 'edit_part',
+ 'zmiany_us³ug' => 'edit_service',
+ 'zapisz' => 'save',
+ 'uzupe³nij' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/io b/sql-ledger/locale/pl/io
new file mode 100644
index 000000000..98079072e
--- /dev/null
+++ b/sql-ledger/locale/pl/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Address' => 'Adres',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Description' => 'Opis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Otrzymano',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Subject' => 'Tre¶æ',
+ 'To' => 'do',
+ 'Unit' => 'Jednostka',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'kontynuj' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/ir b/sql-ledger/locale/pl/ir
new file mode 100644
index 000000000..2196cd167
--- /dev/null
+++ b/sql-ledger/locale/pl/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Invoice' => 'Zarejestrój Fakturê VAT Zakupu',
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Invoice Number' => 'Czy chcesz usun±æ Numer Faktury?',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'Cannot delete invoice!' => 'Nie mo¿esz usun±æ factury!',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu!',
+ 'Cannot post invoice!' => 'Nie mo¿esz zatwierdziæ faktury!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Currency' => 'Waluta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Date Due' => 'Termin P³atno¶ci',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Description' => 'Opis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Edit Purchase Invoice' => 'Zmiany Faktury Zamówienia',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Data Wystawienia',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Invoice deleted!' => 'Faktura usuniêta',
+ 'Invoice posted!' => 'Faktura zatwierdzona',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'P³atno¶ci',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Otrzymano',
+ 'Record in' => 'Zapisz w',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Source' => '¯ród³o',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Brak Dostawcy',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'zamówienie' => 'order',
+ 'zatwierd¿' => 'post',
+ 'zatwierd¿_jako_nowe' => 'post_as_new',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/is b/sql-ledger/locale/pl/is
new file mode 100644
index 000000000..b431b775b
--- /dev/null
+++ b/sql-ledger/locale/pl/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Invoice' => 'Zarejestrój Fakturê VAT Sprzeda¿y',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Invoice Number' => 'Czy chcesz usun±æ Numer Faktury?',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'Cannot delete invoice!' => 'Nie mo¿esz usun±æ factury!',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu!',
+ 'Cannot post invoice!' => 'Nie mo¿esz zatwierdziæ faktury!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Credit Limit' => 'Limit Kredytu',
+ 'Currency' => 'Waluta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Brak Klienta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Date Due' => 'Termin P³atno¶ci',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Description' => 'Opis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Edit Sales Invoice' => 'Zmiany Faktury Sprzeda¿y',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Data Wystawienia',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number' => 'Numer Faktury',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Invoice deleted!' => 'Faktura usuniêta',
+ 'Invoice posted!' => 'Faktura zatwierdzona',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'P³atno¶ci',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Zatwierd¿',
+ 'Post as new' => 'Zatwierd¿ jako nowe',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Print' => 'Drukuj',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Otrzymano',
+ 'Record in' => 'Zapisz w',
+ 'Remaining' => 'Pozosta³e',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Ship via' => 'Wy¶lij przez',
+ 'Source' => '¯ród³o',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'zamówienie' => 'order',
+ 'zatwierd¿' => 'post',
+ 'zatwierd¿_jako_nowe' => 'post_as_new',
+ 'drukuj' => 'print',
+ 'wy¶lij_do' => 'ship_to',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/login b/sql-ledger/locale/pl/login
new file mode 100644
index 000000000..cd96d952c
--- /dev/null
+++ b/sql-ledger/locale/pl/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Na Temat',
+ 'Accounting' => 'Ksiêgowo¶æ',
+ 'Database Host' => 'Host Bazy Danych',
+ 'Dataset' => 'Zbiór Danych',
+ 'Incorrect Dataset version!' => 'Nieprawid³owa wersja Zbioru Danych',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Licensed to' => 'Licencja nale¿y do:',
+ 'Login' => 'Zarejestrój siê',
+ 'Name' => 'Nazwa',
+ 'Password' => 'Has³o',
+ 'User' => 'U¿ytkownik',
+ 'Version' => 'Wersja',
+ 'You are logged out!' => 'Jeste¶ wyrejestrowany!',
+ 'You did not enter a name!' => 'Nie wstawiono nazwy!',
+ 'is not a member!' => 'Nie jest cz³onkiem',
+ 'localhost' => 'host lokalny',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'zarejestrój_siê' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/menu b/sql-ledger/locale/pl/menu
new file mode 100644
index 000000000..0bd3b890e
--- /dev/null
+++ b/sql-ledger/locale/pl/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Ksiêga Zobowi±zañ',
+ 'AP Aging' => 'Zobowi±zania Przeterminowane',
+ 'AR' => 'Ksiêga Nale¿no¶ci',
+ 'AR Aging' => 'Nale¿no¶ci Przeterminowane',
+ 'Accounting Menu' => 'Menu Ksiêgowo¶ci',
+ 'Add Account' => 'Dodaj Konto',
+ 'Add Assembly' => 'Dodaj Zestawienie',
+ 'Add Customer' => 'Dodaj Odbiorcê',
+ 'Add GIFI' => 'Dodaj GIFI',
+ 'Add Part' => 'Dodaj Produkt',
+ 'Add Project' => 'Dodaj Projekt',
+ 'Add Service' => 'Dodaj Us³ugi',
+ 'Add Transaction' => 'Dodaj Transakcjê',
+ 'Add Vendor' => 'Dodaj Dostawcê',
+ 'Assemblies' => 'Zestawienia',
+ 'Audit Control' => 'Kontrola Audytu',
+ 'Backup' => 'Kopia Zapasowa',
+ 'Balance Sheet' => 'Bilans',
+ 'Cash' => 'Kasa',
+ 'Chart of Accounts' => 'Plan Kont',
+ 'Check' => 'Czek',
+ 'Customers' => 'Klienci',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'Goods & Services' => 'Produkty i Us³ugi',
+ 'HTML Templates' => 'Szablony HTML',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Invoice' => 'Faktura',
+ 'LaTeX Templates' => 'Szablony LaTeX',
+ 'List Accounts' => 'Spis Kont',
+ 'List GIFI' => 'Wykaz GIFI',
+ 'Logout' => 'Wyrejestrój siê',
+ 'Order Entry' => 'Wystawianie Zamówieñ',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Parts' => 'Produkty',
+ 'Payment' => 'P³atno¶æ',
+ 'Payments' => 'P³atno¶ci',
+ 'Preferences' => 'Preferencje',
+ 'Projects' => 'Projekty',
+ 'Purchase Invoice' => 'Faktura VAT Zakupu',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Receipt' => 'Wp³ata',
+ 'Receipts' => 'Wp³aty',
+ 'Reconciliation' => 'Zgodno¶æ Rozliczeñ',
+ 'Reports' => 'Sprawozdania',
+ 'Sales Invoice' => 'Faktura VAT Sprzeda¿y',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save to File' => 'Zapisz w zbiorze',
+ 'Send by E-Mail' => 'Wys³ano przy u¿yciu E-Mail',
+ 'Services' => 'Us³ugi',
+ 'Statement' => 'Wykaz',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Stylesheet' => 'Strona Stylowa',
+ 'System' => 'System',
+ 'Tax collected' => 'Podatek pobrany',
+ 'Tax paid' => 'Podatek zap³acony',
+ 'Transactions' => 'Transakcje',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Vendors' => 'Dostawcy',
+ 'Version' => 'Wersja',
+ 'localhost' => 'host lokalny',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/oe b/sql-ledger/locale/pl/oe
new file mode 100644
index 000000000..511b834aa
--- /dev/null
+++ b/sql-ledger/locale/pl/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Dodaj',
+ 'Add Purchase Invoice' => 'Zarejestrój Fakturê VAT Zakupu',
+ 'Add Purchase Order' => 'Dodaj Zamówienie Zakupu',
+ 'Add Sales Invoice' => 'Zarejestrój Fakturê VAT Sprzeda¿y',
+ 'Add Sales Order' => 'Dodaj Zamówienie Klienta',
+ 'Address' => 'Adres',
+ 'Amount' => 'Kwota',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Are you sure you want to delete Order Number' => 'Czy chcesz usun±æ Numer Zamówienia?',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Pojemnik',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Nie mo¿esz usun±æ zamówienia!',
+ 'Cannot save order!' => 'Nie mo¿na zapisaæ zamowienia!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Zamkniêto',
+ 'Confirm!' => 'Potwierd¿!',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Credit Limit' => 'Limit Kredytu',
+ 'Curr' => 'Waluta',
+ 'Currency' => 'Waluta',
+ 'Customer' => 'Klient',
+ 'Customer missing!' => 'Brak Klienta',
+ 'Customer not on file!' => 'Brak Klienta w bazie danych',
+ 'Date' => 'Data',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Delete' => 'Usuñ',
+ 'Delivery Date' => 'Data Dostawy',
+ 'Description' => 'Opis',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Brak adresu E-mail!',
+ 'Edit Purchase Order' => 'Zmiany Zamówienia Zakupu',
+ 'Edit Sales Order' => 'Zmiany Zamówienia Klienta',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Warto¶æ Netto',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Brak Daty Wystawienia',
+ 'Invoice Number missing!' => 'Brak Numeru Faktury',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'O' => 'O',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otworzono',
+ 'Order' => 'Zamówienie',
+ 'Order Date' => 'Data Zamówienia',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Order deleted!' => 'Zamówienie usuniête',
+ 'Order saved!' => 'Zamówienie zapisane',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Print' => 'Drukuj',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Brak Projektu w zbiorze danych!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Otrzymano',
+ 'Remaining' => 'Pozosta³e',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save' => 'Zapisz',
+ 'Save as new' => 'Zapisz jako nowe',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybierz jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Wybierz nazwê z poni¿szych',
+ 'Select from one of the projects below' => 'Wybierz z projektów',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Service' => 'Us³ugi',
+ 'Ship' => 'Wy¶lij',
+ 'Ship to' => 'Wy¶lij do',
+ 'Ship via' => 'Wy¶lij przez',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax' => 'Podatek',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Uzupe³nij',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Brak Dostawcy',
+ 'Vendor not on file!' => 'Brak Dostawcy w bazie danych',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'days' => 'dni',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'dodaj' => 'add',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'faktura' => 'invoice',
+ 'drukuj' => 'print',
+ 'zapisz' => 'save',
+ 'zapisz_jako_nowe' => 'save_as_new',
+ 'wy¶lij_do' => 'ship_to',
+ 'uzupe³nij' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/pe b/sql-ledger/locale/pl/pe
new file mode 100644
index 000000000..88ab7fd6f
--- /dev/null
+++ b/sql-ledger/locale/pl/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Dodaj',
+ 'Add Project' => 'Dodaj Projekt',
+ 'All' => 'Wszystko',
+ 'Continue' => 'Kontynuj',
+ 'Delete' => 'Usuñ',
+ 'Description' => 'Opis',
+ 'Edit Project' => 'Zmiany Projektu',
+ 'Number' => 'Numer Katalogu',
+ 'Orphaned' => 'Zbêdne',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Brak Numeru Projektu',
+ 'Project deleted!' => 'Projekt usuniêty',
+ 'Project saved!' => 'Projekt zapisany',
+ 'Projects' => 'Projekty',
+ 'Save' => 'Zapisz',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'dodaj' => 'add',
+ 'kontynuj' => 'continue',
+ 'usuñ' => 'delete',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/rc b/sql-ledger/locale/pl/rc
new file mode 100644
index 000000000..98bc9bdd8
--- /dev/null
+++ b/sql-ledger/locale/pl/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Saldo',
+ 'Cleared Balance' => 'Zgadzaj±ce Saldo',
+ 'Continue' => 'Kontynuj',
+ 'Date' => 'Data',
+ 'Deposit' => 'Wp³ata',
+ 'Description' => 'Opis',
+ 'Difference' => 'Ró¿nica',
+ 'Done' => 'Zrobione',
+ 'Exchangerate Difference' => 'Ró¿nica Kursowa',
+ 'From' => 'Od',
+ 'Out of balance!' => 'Niezgodne Saldo',
+ 'Payment' => 'P³atno¶æ',
+ 'Reconciliation' => 'Zgodno¶æ Rozliczeñ',
+ 'Select all' => 'Wybierz wszystko',
+ 'Source' => '¯ród³o',
+ 'Statement Balance' => 'Wykaz Salda',
+ 'To' => 'do',
+ 'Update' => 'Uzupe³nij',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'kontynuj' => 'continue',
+ 'zrobione' => 'done',
+ 'wybierz_wszystko' => 'select_all',
+ 'uzupe³nij' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pl/rp b/sql-ledger/locale/pl/rp
new file mode 100644
index 000000000..6abd7022a
--- /dev/null
+++ b/sql-ledger/locale/pl/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Zobowi±zania Przeterminowane',
+ 'AR Aging' => 'Nale¿no¶ci Przeterminowane',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Konta',
+ 'Amount' => 'Kwota',
+ 'Apr' => 'Kwiecieñ',
+ 'April' => 'Kwiecieñ',
+ 'Attachment' => 'Za³±cznik',
+ 'Aug' => 'Sierpieñ',
+ 'August' => 'Sierpieñ',
+ 'Balance Sheet' => 'Bilans',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Tryb Kasowy',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Porównaj z',
+ 'Continue' => 'Kontynuj',
+ 'Copies' => 'Kopie',
+ 'Credit' => 'Kredyt',
+ 'Current' => 'Bi¿±cy',
+ 'Customer' => 'Klient',
+ 'Date' => 'Data',
+ 'Debit' => 'Debet',
+ 'Dec' => 'Grudzieñ',
+ 'December' => 'Grudzieñ',
+ 'Decimalplaces' => 'Miejsca Dziesiêtne',
+ 'Description' => 'Opis',
+ 'Due' => 'P³atno¶æ',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Wykaz do',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Nag³ówek',
+ 'ID' => 'Identyfikator',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Invoice' => 'Faktura',
+ 'Jan' => 'Styczeñ',
+ 'January' => 'Styczeñ',
+ 'Jul' => 'Lipiec',
+ 'July' => 'Lipiec',
+ 'Jun' => 'Czerwiec',
+ 'June' => 'Czerwiec',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nic nie zaznaczone!',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'PDF' => 'PDF',
+ 'Payments' => 'P³atno¶ci',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Drukuj',
+ 'Printer' => 'Drukarka',
+ 'Receipts' => 'Wp³aty',
+ 'Report for' => 'Raport dla',
+ 'Retained Earnings' => 'Zysk',
+ 'Screen' => 'Ekran',
+ 'Select all' => 'Wybierz wszystko',
+ 'Select postscript or PDF!' => 'Wybierz postscript lub PDF',
+ 'Sep' => 'Wrzesieñ',
+ 'September' => 'Wrzesieñ',
+ 'Source' => '¯ród³o',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Wykaz',
+ 'Statement sent to' => 'Wykaz wys³any do',
+ 'Statements sent to printer!' => 'Wykaz wys³any do drukarki',
+ 'Subject' => 'Tre¶æ',
+ 'Subtotal' => 'Warto¶æ Netto',
+ 'Tax' => 'Podatek',
+ 'Tax collected' => 'Podatek pobrany',
+ 'Tax paid' => 'Podatek zap³acony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Vendor' => 'Dostawca',
+ 'as at' => 'tak samo',
+ 'collected on sales' => 'zebrany przy sprzeda¿y',
+ 'for Period' => 'za Okres',
+ 'paid on purchases' => 'zap³acony przy zakupach',
+ 'to' => 'do',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'kontynuj' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'drukuj' => 'print',
+ 'wybierz_wszystko' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/COPYING b/sql-ledger/locale/pt/COPYING
new file mode 100644
index 000000000..bd508c552
--- /dev/null
+++ b/sql-ledger/locale/pt/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Portugese texts:
+#
+# Author: Paulo Rodrigues <prodrigues@vianetworks.pt>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/pt/LANGUAGE b/sql-ledger/locale/pt/LANGUAGE
new file mode 100644
index 000000000..3d5f0c178
--- /dev/null
+++ b/sql-ledger/locale/pt/LANGUAGE
@@ -0,0 +1 @@
+Portuguese
diff --git a/sql-ledger/locale/pt/admin b/sql-ledger/locale/pt/admin
new file mode 100644
index 000000000..827c4e93d
--- /dev/null
+++ b/sql-ledger/locale/pt/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Controlo de Acessos',
+ 'Accounting' => 'Contabilidade',
+ 'Add User' => 'Novo Utilizador',
+ 'Address' => 'Endereço',
+ 'Administration' => 'Administração',
+ 'Administrator' => 'Administrador',
+ 'All Datasets up to date!' => 'Todos os Datasets estão Actualizados!',
+ 'Change Admin Password' => 'Mudar Password Admin',
+ 'Change Password' => 'Mudar Password',
+ 'Character Set' => 'Character Set',
+ 'Click on login name to edit!' => 'Clique no login para editar!',
+ 'Company' => 'Companhia',
+ 'Connect to' => 'Ligar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Criar Plano de Contas',
+ 'Create Dataset' => 'Criar Dataset',
+ 'DBI not installed!' => 'DBI não está instalado!',
+ 'Database' => 'Base de Dados',
+ 'Database Administration' => 'Administração de Base de Dados',
+ 'Database Driver not checked!' => 'Não seleccionou Driver Base de Dados',
+ 'Database User missing!' => 'Não existe Utilizador de Base de Dados',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset não existe!',
+ 'Dataset updated!' => 'Dataset actualizado!',
+ 'Date Format' => 'Formato de Data',
+ 'Delete' => 'Remover',
+ 'Delete Dataset' => 'Remover Dataset',
+ 'Directory' => 'Directoria',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-Mail',
+ 'Edit User' => 'Editar Utilizador',
+ 'Existing Datasets' => 'Datasets Existentes',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Não indicou Hostname!',
+ 'Incorrect Password!' => 'Password Incorrecta!',
+ 'Language' => 'Língua',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Não indique host nem port, a não ser que deseje efectuar uma ligação remota',
+ 'Login' => 'Login',
+ 'Name' => 'Nome',
+ 'New Templates' => 'Novos Modelos',
+ 'No Database Drivers available!' => 'Não há Drivers de Base de Dados disponiveis!',
+ 'No Dataset selected!' => 'Não seleccionou Dataset!',
+ 'Nothing to delete!' => 'Nada para remover!',
+ 'Number Format' => 'Formato numérico',
+ 'Oracle Database Administration' => 'Administração Base de Dados Oracle',
+ 'Password' => 'Password',
+ 'Password changed!' => 'Password alterada',
+ 'Pg Database Administration' => 'Administração Base de Dados Postgres',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Falta o port!',
+ 'Printer' => 'Impressora',
+ 'Save' => 'Guardar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione um Dataset a remover e clique "Continuar"',
+ 'Setup Templates' => 'Configurar Modelos',
+ 'Ship via' => 'Expedir via',
+ 'Signature' => 'Assinatura',
+ 'Stylesheet' => 'Stylesheet',
+ 'Templates' => 'Modelos',
+ 'The following Datasets are not in use and can be deleted' => 'Os seguintes Datasets estão em uso e não podem ser removidos',
+ 'The following Datasets need to be updated' => 'Os seguintes Datasets necessitam ser actualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta é uma validação preliminar. Nada será criado nem removido neste ponto!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para adicionar um utilizador a um grupo, edite um nome, mude o login e guarde. O novo utilizador com as mesmas variáveis será guardado sob o novo login',
+ 'Update Dataset' => 'Actualizar Dataset',
+ 'Use Templates' => 'Usar Templates',
+ 'User' => 'Utilizador',
+ 'User deleted!' => 'Utilizador removido',
+ 'User saved!' => 'Utilizador guardado',
+ 'Version' => 'Versão',
+ 'You must enter a host and port for local and remote connections!' => 'Tem de indicar host e port para ligações locais e remotas!',
+ 'does not exist' => 'não existe',
+ 'is already a member!' => 'já é membro!',
+ 'localhost' => 'localhost',
+ 'successfully created!' => 'criado com sucesso!',
+ 'successfully deleted!' => 'removido com sucesso!',
+ 'website' => 'website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'novo_utilizador' => 'add_user',
+ 'mudar_password_admin' => 'change_admin_password',
+ 'mudar_password' => 'change_password',
+ 'continuar' => 'continue',
+ 'criar_dataset' => 'create_dataset',
+ 'remover' => 'delete',
+ 'remover_dataset' => 'delete_dataset',
+ 'login' => 'login',
+ 'administração_base_de_dados_oracle' => 'oracle_database_administration',
+ 'administração_base_de_dados_postgres' => 'pg_database_administration',
+ 'guardar' => 'save',
+ 'actualizar_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/all b/sql-ledger/locale/pt/all
new file mode 100644
index 000000000..bcfd2229c
--- /dev/null
+++ b/sql-ledger/locale/pt/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Fornecedores',
+ 'AP Aging' => 'Idade Saldos Fornecedores',
+ 'AP Transaction' => 'Transacção Fornecedores',
+ 'AP Transactions' => 'Transacções Fornecedores',
+ 'AR' => 'Clientes',
+ 'AR Aging' => 'Idade Saldos Clientes',
+ 'AR Transaction' => 'Transacção Clientes',
+ 'AR Transactions' => 'Transacções Clientes',
+ 'About' => 'Acerca',
+ 'Access Control' => 'Controlo de Acessos',
+ 'Account' => 'Conta',
+ 'Account Number' => 'Número da Conta',
+ 'Account Number missing!' => 'Número da Conta não encontrado!',
+ 'Account Type' => 'Tipo de Conta',
+ 'Account Type missing!' => 'Tipo de Conta não encontrado!',
+ 'Account deleted!' => 'Conta apagada',
+ 'Account saved!' => 'Conta guardada',
+ 'Accounting' => 'Contabilidade',
+ 'Accounting Menu' => 'Menu de Contabilidade',
+ 'Accounts' => 'Contas',
+ 'Active' => 'Activo',
+ 'Add' => 'Novo',
+ 'Add Account' => 'Nova Conta',
+ 'Add Accounts Payables Transaction' => 'Nova Transacção Fornecedores',
+ 'Add Accounts Receivables Transaction' => 'Nova Transacção Clientes',
+ 'Add Assembly' => 'Novo Conjunto',
+ 'Add Customer' => 'Novo Cliente',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Add General Ledger Transaction' => 'Nova Transacção Livro Razão',
+ 'Add Part' => 'Novo Produto',
+ 'Add Project' => 'Novo Projecto',
+ 'Add Purchase Invoice' => 'Nova Factura de Compra',
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Invoice' => 'Nova Factura de Venda',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Add Service' => 'Novo Serviço',
+ 'Add Transaction' => 'Nova Transacção',
+ 'Add User' => 'Novo Utilizador',
+ 'Add Vendor' => 'Novo Fornecedor',
+ 'Address' => 'Endereço',
+ 'Administration' => 'Administração',
+ 'Administrator' => 'Administrador',
+ 'All' => 'Todos',
+ 'All Datasets up to date!' => 'Todos os Datasets estão Actualizados!',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total em dívida',
+ 'Amount does not equal applied!' => 'Valor diferente do aplicado!',
+ 'Amount missing!' => 'Falta o valor!',
+ 'Applied' => 'Aplicado',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem a certeza que quer APAGAR a Factura Número',
+ 'Are you sure you want to delete Order Number' => 'Confirma a remoção da Encomenda?',
+ 'Are you sure you want to delete Transaction' => 'Tem a certeza que quer APAGAR a Transacção',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'Falta o Número de Produto',
+ 'Asset' => 'Activo',
+ 'Attachment' => 'Attachment',
+ 'Audit Control' => 'Controlo de Auditoria',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Backup',
+ 'Backup sent to' => 'Backup enviado para',
+ 'Balance' => 'Saldo',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'Livros Abertos',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'Número de negócio',
+ 'C' => '',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete account!' => 'Não é possivel apagar a conta!',
+ 'Cannot delete customer!' => 'Não é possivel apagar o cliente!',
+ 'Cannot delete default account!' => 'Não é possível apagar a conta por defeito!',
+ 'Cannot delete invoice!' => 'Não é possivel apagar a factura!',
+ 'Cannot delete item already invoiced!' => 'Não posso apagar item já facturado!',
+ 'Cannot delete item on order!' => 'Não pode apagar item no pedido',
+ 'Cannot delete item which is part of an assembly!' => 'Não é possível apagar Produto que faz parte de um Conjunto!',
+ 'Cannot delete item!' => 'Não é possivel apagar o item!',
+ 'Cannot delete order!' => 'Não é possivel apagar a encomenda!',
+ 'Cannot delete transaction!' => 'Não é possivel apagar a transacção',
+ 'Cannot delete vendor!' => 'Não é possivel apagar o fornecedor',
+ 'Cannot have a value in both Debit and Credit!' => 'Não pode ter o valor a Débito E Crédito!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar factura em período fechado!',
+ 'Cannot post invoice!' => 'Não é possivel lançar factura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post payment!' => 'Não é possivel lançar pagamento',
+ 'Cannot post transaction for a closed period!' => 'Não é possivel lançar transacção para um periodo fechado!',
+ 'Cannot post transaction!' => 'Não é possivel lançar transacção',
+ 'Cannot process payment for a closed period!' => 'Não é possivel lançar pagamento para um período fechado',
+ 'Cannot save account!' => 'Não é possível guardar conta!',
+ 'Cannot save order!' => 'Não é possível guardar encomenda!',
+ 'Cannot save preferences!' => 'Não é possível guardar preferências!',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => 'Dinheiro',
+ 'Cash based' => '',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Mudar Password Admin',
+ 'Change Password' => 'Mudar Password',
+ 'Character Set' => 'Character Set',
+ 'Chart of Accounts' => 'Plano de Contas',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impresso!',
+ 'Check printing failed!' => 'Falhou a impressão de cheques!',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Clique no login para editar!',
+ 'Close Books up to' => 'Fechar Livros até',
+ 'Closed' => 'Fechado',
+ 'Company' => 'Companhia',
+ 'Compare to' => 'Comparar com',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Ligar a',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Copy to COA' => 'Copiar para Plano de Contas',
+ 'Create Chart of Accounts' => 'Criar Plano de Contas',
+ 'Create Dataset' => 'Criar Dataset',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Curr' => 'Moeda',
+ 'Currency' => 'Moeda',
+ 'Current' => '',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => 'Cliente apagado!',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Customer saved!' => 'Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'DBI not installed!' => 'DBI não está instalado!',
+ 'Database' => 'Base de Dados',
+ 'Database Administration' => 'Administração de Base de Dados',
+ 'Database Driver not checked!' => 'Não seleccionou Driver Base de Dados',
+ 'Database Host' => 'Servidor de Base de Dados',
+ 'Database User missing!' => 'Não existe Utilizador de Base de Dados',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset não existe!',
+ 'Dataset updated!' => 'Dataset actualizado!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Date Format' => 'Formato de Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Date missing!' => 'Falta a data!',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito e crédito fora de balanço!',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Decimalplaces' => 'Casas decimais',
+ 'Delete' => 'Remover',
+ 'Delete Account' => 'Apagar Conta',
+ 'Delete Dataset' => 'Remover Dataset',
+ 'Delivery Date' => 'Data de entrega',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descrição',
+ 'Difference' => 'Diferença',
+ 'Directory' => 'Directoria',
+ 'Discount' => 'Desconto',
+ 'Done' => 'Pronto',
+ 'Drawing' => '',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Vence',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Falta Data de Vencimento!',
+ 'E-mail' => 'E-Mail',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Conta',
+ 'Edit Accounts Payables Transaction' => 'Editar transacção Fornecedores',
+ 'Edit Accounts Receivables Transaction' => 'Editar transacção Clientes',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit GIFI' => 'Editar CFOP',
+ 'Edit General Ledger Transaction' => 'Editar Transacção Livro Razão',
+ 'Edit Part' => 'Editar Produto',
+ 'Edit Preferences for' => 'Editar Preferências para',
+ 'Edit Project' => 'Editar Projecto',
+ 'Edit Purchase Invoice' => 'Editar Factura de Compra',
+ 'Edit Purchase Order' => 'Editar Ordem de Compra',
+ 'Edit Sales Invoice' => 'Editar Factura de Venda',
+ 'Edit Sales Order' => 'Editar Encomenda',
+ 'Edit Service' => 'Editar Serviço',
+ 'Edit Template' => 'Editar Modelo',
+ 'Edit User' => 'Editar Utilizador',
+ 'Employee' => 'Funcionário',
+ 'Enforce transaction reversal for all dates' => 'Forçar anulação das transacções para todas as datas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Indique as suas moedas nativa e estrangeiras usando os códigos de 3 letras (p.ex. EUR:USD:CAD)',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate Difference' => 'Diferença na Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Existing Datasets' => 'Datasets Existentes',
+ 'Expense' => 'Despesa',
+ 'Expense Account' => 'Conta de Despesas',
+ 'Expense/Asset' => 'Despesa/Activo',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'Foreign Exchange Gain' => 'Diferenças de Câmbio - Proveitos',
+ 'Foreign Exchange Loss' => 'Diferenças de Câmbio - Prejuizos',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GIFI deleted!' => 'CFOP apagado',
+ 'GIFI missing!' => 'Falta CFOP!',
+ 'GIFI saved!' => 'CFOP guardado',
+ 'GL Transaction' => 'Transacção Livro Razão',
+ 'General Ledger' => 'Livro Razão',
+ 'Goods & Services' => 'Bens e Serviços',
+ 'HTML Templates' => 'Templates HTML',
+ 'Heading' => 'Cabeçalho',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Não indicou Hostname!',
+ 'ID' => 'ID',
+ 'Image' => 'Imagem',
+ 'In-line' => 'Inline',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Include in drop-down menus' => 'Incluir nos menus drop-down',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir esta conta nos formulários de cliente/fornecedor para marcar cliente/fornecedor como sujeito a impostos.',
+ 'Income' => 'Receita',
+ 'Income Account' => 'Conta de Receitas',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Incorrect Dataset version!' => 'Versão Dataset incorrecta!',
+ 'Incorrect Password!' => 'Password Incorrecta!',
+ 'Individual Items' => 'Produtos Individuais',
+ 'Inventory' => 'Inventário',
+ 'Inventory Account' => 'Conta de Inventário',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Quantidade em Stock tem de ser zero para poder declarar este conjunto obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Quantidade em Stock tem de ser zero para poder declarar esta peça obsoleta!',
+ 'Inventory quantity must be zero!' => 'Quantidade em Stock tem de ser zero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data de Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Invoice deleted!' => 'Factura apagada',
+ 'Invoice posted!' => 'Factura processada',
+ 'Invoices' => 'Facturas',
+ 'Is this a summary account to record' => 'Esta é uma conta sumária a registar',
+ 'Item deleted!' => 'Item apagado',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'LaTeX Templates' => 'Modelos LaTeX',
+ 'Language' => 'Língua',
+ 'Last Cost' => 'Último Custo',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos números e Contas por defeito',
+ 'Last Purchase Order Number' => 'Ultimo numero de Ordem de Compra',
+ 'Last Sales Order Number' => 'Último número de Encomenda de vendas',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Não indique host nem port, a não ser que deseje efectuar uma ligação remota',
+ 'Liability' => 'Passivo',
+ 'Licensed to' => 'Licenciado a',
+ 'Line Total' => 'Total da Linha',
+ 'Link' => 'Ligar',
+ 'Link Accounts' => 'Ligar Contas',
+ 'List Accounts' => 'Listar Contas',
+ 'List GIFI' => 'Listar CFOP',
+ 'List Price' => 'Listar Preço',
+ 'List Transactions' => 'Listar Transacções',
+ 'Login' => 'Login',
+ 'Logout' => 'Logout',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'N/A' => 'N/D',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Falta o nome!',
+ 'New Templates' => 'Novos Modelos',
+ 'No' => 'Não',
+ 'No Database Drivers available!' => 'Não há Drivers de Base de Dados disponiveis!',
+ 'No Dataset selected!' => 'Não seleccionou Dataset!',
+ 'No email address for' => 'Não existe endereço de email para',
+ 'No.' => '',
+ 'Notes' => 'Notas',
+ 'Nothing applied!' => 'Nada aplicado',
+ 'Nothing selected!' => 'Nada seleccionado',
+ 'Nothing to delete!' => 'Nada para remover!',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato numérico',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'O' => '',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'On Hand' => 'Em Stock',
+ 'On Order' => 'Encomendado',
+ 'Open' => 'Abrir',
+ 'Oracle Database Administration' => 'Administração Base de Dados Oracle',
+ 'Order' => 'Encomenda',
+ 'Order Date' => 'Data da Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Entry' => 'Encomendas de Clientes',
+ 'Order Number' => 'Encomenda Número',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'Order deleted!' => 'Encomenda apagada',
+ 'Order saved!' => 'Encomenda guardada',
+ 'Ordered' => 'Encomendado',
+ 'Orphaned' => 'Órfão',
+ 'Out of balance!' => '',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Paid' => 'Total Pago',
+ 'Paid in full' => '',
+ 'Part' => 'Produto',
+ 'Part Number missing!' => 'Número de produto não encontrado!',
+ 'Parts' => 'Produtos',
+ 'Parts Inventory' => 'Inventário',
+ 'Password' => 'Password',
+ 'Password changed!' => 'Password alterada',
+ 'Payables' => 'Fornecedores',
+ 'Payment' => 'Pagamento',
+ 'Payment date missing!' => 'Falta Data de Pagamento!',
+ 'Payment posted!' => 'Pagamento processado',
+ 'Payments' => 'Pagamentos',
+ 'Pg Database Administration' => 'Administração Base de Dados Postgres',
+ 'Phone' => 'Tel',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Falta o port!',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Postscript' => 'PostScript',
+ 'Preferences' => 'Preferências',
+ 'Preferences saved!' => 'Preferências Guardadas!',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Project Number missing!' => 'Falta o número do projecto',
+ 'Project deleted!' => 'Projecto apagado',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Project saved!' => 'Projecto guardado',
+ 'Projects' => 'Projectos',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Qty' => 'Qtd',
+ 'ROP' => 'Nível mínimo de stock',
+ 'Rate' => 'Taxa',
+ 'Recd' => 'Recebido',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Receivables' => 'Clientes',
+ 'Reconciliation' => 'Reconciliação',
+ 'Record in' => 'Registar em',
+ 'Reference' => 'Referência',
+ 'Reference missing!' => 'Falta referência',
+ 'Remaining' => 'Sobram',
+ 'Report for' => 'Relatório para',
+ 'Reports' => 'Relatórios',
+ 'Required by' => 'Requerido por',
+ 'Retained Earnings' => 'Lucros Retidos',
+ 'Sales' => 'Vendas',
+ 'Sales Invoice' => 'Factura de Venda',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Sales Orders' => 'Encomendas de Venda',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como novo',
+ 'Save to File' => 'Guardar em Ficheiro',
+ 'Screen' => 'Ecran',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione um Dataset a remover e clique "Continuar"',
+ 'Select all' => 'Seleccionar todos',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sell Price' => 'Preço de Venda',
+ 'Send by E-Mail' => 'Enviar por Email',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Service Items' => 'Items de Serviço',
+ 'Service Number missing!' => 'Número do serviço não encontrado!',
+ 'Services' => 'Serviços',
+ 'Setup Templates' => 'Configurar Modelos',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Ship via' => 'Expedir via',
+ 'Short' => 'Curta',
+ 'Signature' => 'Assinatura',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Origem',
+ 'Standard' => 'Padrão',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Conjunto em stock',
+ 'Stylesheet' => 'Stylesheet',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'System' => 'Sistema',
+ 'Tax' => 'Imposto',
+ 'Tax Accounts' => 'Contas de Impostos',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'Taxable' => 'Sujeito a impostos',
+ 'Template saved!' => 'Modelo guardado',
+ 'Templates' => 'Modelos',
+ 'Terms: Net' => 'Termos: A pronto',
+ 'The following Datasets are not in use and can be deleted' => 'Os seguintes Datasets estão em uso e não podem ser removidos',
+ 'The following Datasets need to be updated' => 'Os seguintes Datasets necessitam ser actualizados',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Esta é uma validação preliminar. Nada será criado nem removido neste ponto!',
+ 'To' => 'Até',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para adicionar um utilizador a um grupo, edite um nome, mude o login e guarde. O novo utilizador com as mesmas variáveis será guardado sob o novo login',
+ 'Top Level' => 'Nivel de topo',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Falta Data de transacção!',
+ 'Transaction deleted!' => 'Transacção apagada',
+ 'Transaction posted!' => 'Transacção processada',
+ 'Transaction reversal enforced for all dates' => 'Cancelamento de transacção forçado para todas as datas',
+ 'Transaction reversal enforced up to' => 'Cancelamento de transacção forçado até',
+ 'Transactions' => 'Transacções',
+ 'Transactions exist, cannot delete customer!' => 'Existem transacções, não pode apagar o cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Existem transacções, não pode apagar fornecedor!',
+ 'Transactions exist; cannot delete account!' => 'Existem Transacções, não é possivel remover conta!',
+ 'Trial Balance' => 'Balancete',
+ 'Unit' => 'Unidade',
+ 'Unit of measure' => 'Unidade de medida',
+ 'Update' => 'Actualizar',
+ 'Update Dataset' => 'Actualizar Dataset',
+ 'Updated' => 'Actualizado',
+ 'Use Templates' => 'Usar Templates',
+ 'User' => 'Utilizador',
+ 'User deleted!' => 'Utilizador removido',
+ 'User saved!' => 'Utilizador guardado',
+ 'Vendor' => 'Fornecedor',
+ 'Vendor deleted!' => 'Fornecedor apagado',
+ 'Vendor missing!' => 'Falta fornecedor',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'Vendor saved!' => 'Fornecedor guardado',
+ 'Vendors' => 'Fornecedores',
+ 'Version' => 'Versão',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidade de Peso',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Year End' => 'Fim de ano',
+ 'Yes' => 'Sim',
+ 'You are logged out!' => 'Terminou a sessão!',
+ 'You did not enter a name!' => 'Não indicou nome!',
+ 'You must enter a host and port for local and remote connections!' => 'Tem de indicar host e port para ligações locais e remotas!',
+ 'as at' => '',
+ 'collected on sales' => 'recolhido sobre vendas',
+ 'days' => 'dias',
+ 'does not exist' => 'não existe',
+ 'ea' => 'cd',
+ 'emailed to' => 'enviado por email para',
+ 'for Period' => 'pelo período',
+ 'hr' => 'hr',
+ 'is already a member!' => 'já é membro!',
+ 'is not a member!' => 'não é membro!',
+ 'localhost' => 'localhost',
+ 'paid on purchases' => 'pago em aquisições',
+ 'sent to printer' => 'enviado para a impressora',
+ 'successfully created!' => 'criado com sucesso!',
+ 'successfully deleted!' => 'removido com sucesso!',
+ 'to' => 'para',
+ 'website' => 'website',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/am b/sql-ledger/locale/pt/am
new file mode 100644
index 000000000..a926fe3ea
--- /dev/null
+++ b/sql-ledger/locale/pt/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Fornecedores',
+ 'AR' => 'Clientes',
+ 'Account' => 'Conta',
+ 'Account Number' => 'Número da Conta',
+ 'Account Number missing!' => 'Número da Conta não encontrado!',
+ 'Account Type' => 'Tipo de Conta',
+ 'Account Type missing!' => 'Tipo de Conta não encontrado!',
+ 'Account deleted!' => 'Conta apagada',
+ 'Account saved!' => 'Conta guardada',
+ 'Add Account' => 'Nova Conta',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Address' => 'Endereço',
+ 'Asset' => 'Activo',
+ 'Audit Control' => 'Controlo de Auditoria',
+ 'Backup sent to' => 'Backup enviado para',
+ 'Books are open' => 'Livros Abertos',
+ 'Business Number' => 'Número de negócio',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete account!' => 'Não é possivel apagar a conta!',
+ 'Cannot delete default account!' => 'Não é possível apagar a conta por defeito!',
+ 'Cannot save account!' => 'Não é possível guardar conta!',
+ 'Cannot save preferences!' => 'Não é possível guardar preferências!',
+ 'Character Set' => 'Character Set',
+ 'Chart of Accounts' => 'Plano de Contas',
+ 'Close Books up to' => 'Fechar Livros até',
+ 'Company' => 'Companhia',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar para Plano de Contas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato de Data',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Remover',
+ 'Delete Account' => 'Apagar Conta',
+ 'Description' => 'Descrição',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-Mail',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Conta',
+ 'Edit GIFI' => 'Editar CFOP',
+ 'Edit Preferences for' => 'Editar Preferências para',
+ 'Edit Template' => 'Editar Modelo',
+ 'Enforce transaction reversal for all dates' => 'Forçar anulação das transacções para todas as datas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Indique as suas moedas nativa e estrangeiras usando os códigos de 3 letras (p.ex. EUR:USD:CAD)',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Despesa',
+ 'Expense Account' => 'Conta de Despesas',
+ 'Expense/Asset' => 'Despesa/Activo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Diferenças de Câmbio - Proveitos',
+ 'Foreign Exchange Loss' => 'Diferenças de Câmbio - Prejuizos',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GIFI deleted!' => 'CFOP apagado',
+ 'GIFI missing!' => 'Falta CFOP!',
+ 'GIFI saved!' => 'CFOP guardado',
+ 'Heading' => 'Cabeçalho',
+ 'Include in drop-down menus' => 'Incluir nos menus drop-down',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir esta conta nos formulários de cliente/fornecedor para marcar cliente/fornecedor como sujeito a impostos.',
+ 'Income' => 'Receita',
+ 'Income Account' => 'Conta de Receitas',
+ 'Inventory' => 'Inventário',
+ 'Inventory Account' => 'Conta de Inventário',
+ 'Is this a summary account to record' => 'Esta é uma conta sumária a registar',
+ 'Language' => 'Língua',
+ 'Last Invoice Number' => 'Último Número de Factura',
+ 'Last Numbers & Default Accounts' => 'Últimos números e Contas por defeito',
+ 'Last Purchase Order Number' => 'Ultimo numero de Ordem de Compra',
+ 'Last Sales Order Number' => 'Último número de Encomenda de vendas',
+ 'Liability' => 'Passivo',
+ 'Link' => 'Ligar',
+ 'Name' => 'Nome',
+ 'No' => 'Não',
+ 'No email address for' => 'Não existe endereço de email para',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato numérico',
+ 'Parts Inventory' => 'Inventário',
+ 'Password' => 'Password',
+ 'Payables' => 'Fornecedores',
+ 'Payment' => 'Pagamento',
+ 'Phone' => 'Tel',
+ 'Preferences saved!' => 'Preferências Guardadas!',
+ 'Rate' => 'Taxa',
+ 'Receivables' => 'Clientes',
+ 'Sales' => 'Vendas',
+ 'Save' => 'Guardar',
+ 'Service Items' => 'Items de Serviço',
+ 'Ship via' => 'Expedir via',
+ 'Signature' => 'Assinatura',
+ 'Stylesheet' => 'Stylesheet',
+ 'Tax' => 'Imposto',
+ 'Tax Accounts' => 'Contas de Impostos',
+ 'Template saved!' => 'Modelo guardado',
+ 'Transaction reversal enforced for all dates' => 'Cancelamento de transacção forçado para todas as datas',
+ 'Transaction reversal enforced up to' => 'Cancelamento de transacção forçado até',
+ 'Transactions exist; cannot delete account!' => 'Existem Transacções, não é possivel remover conta!',
+ 'Weight Unit' => 'Unidade de Peso',
+ 'Year End' => 'Fim de ano',
+ 'Yes' => 'Sim',
+ 'does not exist' => 'não existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'nova_conta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_para_plano_de_contas' => 'copy_to_coa',
+ 'remover' => 'delete',
+ 'editar' => 'edit',
+ 'editar_conta' => 'edit_account',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ap b/sql-ledger/locale/pt/ap
new file mode 100644
index 000000000..f3a6467e6
--- /dev/null
+++ b/sql-ledger/locale/pt/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transacção Fornecedores',
+ 'AP Transactions' => 'Transacções Fornecedores',
+ 'Account' => 'Conta',
+ 'Add Accounts Payables Transaction' => 'Nova Transacção Fornecedores',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total em dívida',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem a certeza que quer APAGAR a Transacção',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Não é possivel apagar a transacção',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post transaction for a closed period!' => 'Não é possivel lançar transacção para um periodo fechado!',
+ 'Cannot post transaction!' => 'Não é possivel lançar transacção',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moeda',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Description' => 'Descrição',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Falta Data de Vencimento!',
+ 'Edit Accounts Payables Transaction' => 'Editar transacção Fornecedores',
+ 'Employee' => 'Funcionário',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data de Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Paid' => 'Total Pago',
+ 'Payment date missing!' => 'Falta Data de Pagamento!',
+ 'Payments' => 'Pagamentos',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Origem',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transacção apagada',
+ 'Transaction posted!' => 'Transacção processada',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Fornecedor',
+ 'Vendor missing!' => 'Falta fornecedor',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transacção_fornecedores' => 'ap_transaction',
+ 'nova_transacção_fornecedores' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'editar_transacção_fornecedores' => 'edit_accounts_payables_transaction',
+ 'processar' => 'post',
+ 'processar_como_novo' => 'post_as_new',
+ 'factura_de_compra' => 'purchase_invoice',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ar b/sql-ledger/locale/pt/ar
new file mode 100644
index 000000000..7790e3c18
--- /dev/null
+++ b/sql-ledger/locale/pt/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Transacção Clientes',
+ 'AR Transactions' => 'Transacções Clientes',
+ 'Account' => 'Conta',
+ 'Add Accounts Receivables Transaction' => 'Nova Transacção Clientes',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount Due' => 'Total em dívida',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem a certeza que quer APAGAR a Transacção',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Cannot delete transaction!' => 'Não é possivel apagar a transacção',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cannot post transaction for a closed period!' => 'Não é possivel lançar transacção para um periodo fechado!',
+ 'Cannot post transaction!' => 'Não é possivel lançar transacção',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Date Paid' => 'Data de pagamento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Description' => 'Descrição',
+ 'Due Date' => 'Data de Vencimento',
+ 'Due Date missing!' => 'Falta Data de Vencimento!',
+ 'Edit Accounts Receivables Transaction' => 'Editar transacção Clientes',
+ 'Employee' => 'Funcionário',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data de Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Paid' => 'Total Pago',
+ 'Payment date missing!' => 'Falta Data de Pagamento!',
+ 'Payments' => 'Pagamentos',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Remaining' => 'Sobram',
+ 'Sales Invoice' => 'Factura de Venda',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Origem',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transacção apagada',
+ 'Transaction posted!' => 'Transacção processada',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transacção_clientes' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'processar' => 'post',
+ 'processar_como_novo' => 'post_as_new',
+ 'factura_de_venda' => 'sales_invoice',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/arap b/sql-ledger/locale/pt/arap
new file mode 100644
index 000000000..bbfaad043
--- /dev/null
+++ b/sql-ledger/locale/pt/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Endereço',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Description' => 'Descrição',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ca b/sql-ledger/locale/pt/ca
new file mode 100644
index 000000000..01ea0fe43
--- /dev/null
+++ b/sql-ledger/locale/pt/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Saldo',
+ 'Chart of Accounts' => 'Plano de Contas',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Description' => 'Descrição',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'List Transactions' => 'Listar Transacções',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Reference' => 'Referência',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Subtotal' => 'Sub-total',
+ 'To' => 'Até',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transacções' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/cp b/sql-ledger/locale/pt/cp
new file mode 100644
index 000000000..1d62d31b0
--- /dev/null
+++ b/sql-ledger/locale/pt/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Amount does not equal applied!' => 'Valor diferente do aplicado!',
+ 'Amount missing!' => 'Falta o valor!',
+ 'Applied' => 'Aplicado',
+ 'Cannot post payment!' => 'Não é possivel lançar pagamento',
+ 'Cannot process payment for a closed period!' => 'Não é possivel lançar pagamento para um período fechado',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impresso!',
+ 'Check printing failed!' => 'Falhou a impressão de cheques!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Date missing!' => 'Falta a data!',
+ 'Description' => 'Descrição',
+ 'Due' => 'Vence',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'From' => 'De',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Facturas',
+ 'Nothing applied!' => 'Nada aplicado',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Pagamento',
+ 'Payment posted!' => 'Pagamento processado',
+ 'Post' => 'Processar',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Receipt' => 'Recibo',
+ 'Reference' => 'Referência',
+ 'Screen' => 'Ecran',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'To' => 'Até',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Fornecedor',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'processar' => 'post',
+ 'imprimir' => 'print',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ct b/sql-ledger/locale/pt/ct
new file mode 100644
index 000000000..74187f226
--- /dev/null
+++ b/sql-ledger/locale/pt/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Novo',
+ 'Address' => 'Endereço',
+ 'All' => 'Todos',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Não é possivel apagar o cliente!',
+ 'Cannot delete vendor!' => 'Não é possivel apagar o fornecedor',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Customer deleted!' => 'Cliente apagado!',
+ 'Customer saved!' => 'Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'Delete' => 'Remover',
+ 'Discount' => 'Desconto',
+ 'E-mail' => 'E-Mail',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nome',
+ 'Name missing!' => 'Falta o nome!',
+ 'Notes' => 'Notas',
+ 'Number' => 'Número',
+ 'Order' => 'Encomenda',
+ 'Orphaned' => 'Órfão',
+ 'Phone' => 'Tel',
+ 'Save' => 'Guardar',
+ 'Ship to' => 'Expedir para',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Taxable' => 'Sujeito a impostos',
+ 'Terms: Net' => 'Termos: A pronto',
+ 'Transactions exist, cannot delete customer!' => 'Existem transacções, não pode apagar o cliente!',
+ 'Transactions exist, cannot delete vendor!' => 'Existem transacções, não pode apagar fornecedor!',
+ 'Vendor deleted!' => 'Fornecedor apagado',
+ 'Vendor saved!' => 'Fornecedor guardado',
+ 'Vendors' => 'Fornecedores',
+ 'days' => 'dias',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'novo' => 'add',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'factura' => 'invoice',
+ 'encomenda' => 'order',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/gl b/sql-ledger/locale/pt/gl
new file mode 100644
index 000000000..e2065ec15
--- /dev/null
+++ b/sql-ledger/locale/pt/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Transacção Fornecedores',
+ 'AR Transaction' => 'Transacção Clientes',
+ 'Account' => 'Conta',
+ 'Add General Ledger Transaction' => 'Nova Transacção Livro Razão',
+ 'Address' => 'Endereço',
+ 'All' => 'Todos',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Transaction' => 'Tem a certeza que quer APAGAR a Transacção',
+ 'Asset' => 'Activo',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance' => 'Saldo',
+ 'Cannot delete transaction!' => 'Não é possivel apagar a transacção',
+ 'Cannot have a value in both Debit and Credit!' => 'Não pode ter o valor a Débito E Crédito!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Não é possivel lançar transacção para um periodo fechado!',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito e crédito fora de balanço!',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Description' => 'Descrição',
+ 'Edit General Ledger Transaction' => 'Editar Transacção Livro Razão',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Despesa',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'GL Transaction' => 'Transacção Livro Razão',
+ 'General Ledger' => 'Livro Razão',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income' => 'Receita',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Liability' => 'Passivo',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Reference' => 'Referência',
+ 'Reference missing!' => 'Falta referência',
+ 'Reports' => 'Relatórios',
+ 'Sales Invoice' => 'Factura de Venda',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Origem',
+ 'Subtotal' => 'Sub-total',
+ 'To' => 'Até',
+ 'Transaction Date missing!' => 'Falta Data de transacção!',
+ 'Transaction deleted!' => 'Transacção apagada',
+ 'Transaction posted!' => 'Transacção processada',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'Yes' => 'Sim',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'transacção_fornecedores' => 'ap_transaction',
+ 'transacção_clientes' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'transacção_livro_razão' => 'gl_transaction',
+ 'processar' => 'post',
+ 'processar_como_novo' => 'post_as_new',
+ 'factura_de_compra' => 'purchase_invoice',
+ 'factura_de_venda' => 'sales_invoice',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ic b/sql-ledger/locale/pt/ic
new file mode 100644
index 000000000..80d4eb6a6
--- /dev/null
+++ b/sql-ledger/locale/pt/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Activo',
+ 'Add' => 'Novo',
+ 'Add Assembly' => 'Novo Conjunto',
+ 'Add Part' => 'Novo Produto',
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Add Service' => 'Novo Serviço',
+ 'Address' => 'Endereço',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'Falta o Número de Produto',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Custo de Vendas',
+ 'Cannot delete item already invoiced!' => 'Não posso apagar item já facturado!',
+ 'Cannot delete item on order!' => 'Não pode apagar item no pedido',
+ 'Cannot delete item which is part of an assembly!' => 'Não é possível apagar Produto que faz parte de um Conjunto!',
+ 'Cannot delete item!' => 'Não é possivel apagar o item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit Part' => 'Editar Produto',
+ 'Edit Service' => 'Editar Serviço',
+ 'Expense' => 'Despesa',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'Image' => 'Imagem',
+ 'In-line' => 'Inline',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income' => 'Receita',
+ 'Individual Items' => 'Produtos Individuais',
+ 'Inventory' => 'Inventário',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Quantidade em Stock tem de ser zero para poder declarar este conjunto obsoleto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Quantidade em Stock tem de ser zero para poder declarar esta peça obsoleta!',
+ 'Inventory quantity must be zero!' => 'Quantidade em Stock tem de ser zero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Item deleted!' => 'Item apagado',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Last Cost' => 'Último Custo',
+ 'Line Total' => 'Total da Linha',
+ 'Link Accounts' => 'Ligar Contas',
+ 'List Price' => 'Listar Preço',
+ 'Make' => 'Marca',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'On Hand' => 'Em Stock',
+ 'On Order' => 'Encomendado',
+ 'Order' => 'Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'Ordered' => 'Encomendado',
+ 'Orphaned' => 'Órfão',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Part' => 'Produto',
+ 'Part Number missing!' => 'Número de produto não encontrado!',
+ 'Parts' => 'Produtos',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'PostScript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtd',
+ 'ROP' => 'Nível mínimo de stock',
+ 'Recd' => 'Recebido',
+ 'Required by' => 'Requerido por',
+ 'Sales' => 'Vendas',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Save' => 'Guardar',
+ 'Screen' => 'Ecran',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sell Price' => 'Preço de Venda',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Service Number missing!' => 'Número do serviço não encontrado!',
+ 'Services' => 'Serviços',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Short' => 'Curta',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Conjunto em stock',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'To' => 'Até',
+ 'Top Level' => 'Nivel de topo',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Unit of measure' => 'Unidade de medida',
+ 'Update' => 'Actualizar',
+ 'Updated' => 'Actualizado',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'ea' => 'cd',
+ 'emailed to' => 'enviado por email para',
+ 'hr' => 'hr',
+ 'sent to printer' => 'enviado para a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'novo' => 'add',
+ 'novo_conjunto' => 'add_assembly',
+ 'novo_produto' => 'add_part',
+ 'novo_serviço' => 'add_service',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'editar_conjunto' => 'edit_assembly',
+ 'editar_produto' => 'edit_part',
+ 'editar_serviço' => 'edit_service',
+ 'guardar' => 'save',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/io b/sql-ledger/locale/pt/io
new file mode 100644
index 000000000..b85c3520b
--- /dev/null
+++ b/sql-ledger/locale/pt/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Address' => 'Endereço',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'Inline',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Part' => 'Produto',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'PostScript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtd',
+ 'Recd' => 'Recebido',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Screen' => 'Ecran',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Subject' => 'Assunto',
+ 'To' => 'Até',
+ 'Unit' => 'Unidade',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para a impressora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/ir b/sql-ledger/locale/pt/ir
new file mode 100644
index 000000000..88fb49e5a
--- /dev/null
+++ b/sql-ledger/locale/pt/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Add Purchase Invoice' => 'Nova Factura de Compra',
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem a certeza que quer APAGAR a Factura Número',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Não é possivel apagar a factura!',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar factura em período fechado!',
+ 'Cannot post invoice!' => 'Não é possivel lançar factura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Currency' => 'Moeda',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Edit Purchase Invoice' => 'Editar Factura de Compra',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'Inline',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data de Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Invoice deleted!' => 'Factura apagada',
+ 'Invoice posted!' => 'Factura processada',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Part' => 'Produto',
+ 'Payment date missing!' => 'Falta Data de Pagamento!',
+ 'Payments' => 'Pagamentos',
+ 'Phone' => 'Tel',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Postscript' => 'PostScript',
+ 'Price' => 'Preço',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtd',
+ 'Recd' => 'Recebido',
+ 'Record in' => 'Registar em',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Screen' => 'Ecran',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Source' => 'Origem',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Fornecedor',
+ 'Vendor missing!' => 'Falta fornecedor',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'ea' => 'cd',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'encomenda' => 'order',
+ 'processar' => 'post',
+ 'processar_como_novo' => 'post_as_new',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/is b/sql-ledger/locale/pt/is
new file mode 100644
index 000000000..9a33604f6
--- /dev/null
+++ b/sql-ledger/locale/pt/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Invoice' => 'Nova Factura de Venda',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Invoice Number' => 'Tem a certeza que quer APAGAR a Factura Número',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Não é possivel apagar a factura!',
+ 'Cannot post invoice for a closed period!' => 'Não pode lançar factura em período fechado!',
+ 'Cannot post invoice!' => 'Não é possivel lançar factura!',
+ 'Cannot post payment for a closed period!' => 'Não pode lançar pagamento em período fechado!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Date Due' => 'Data de Vencimento',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Edit Sales Invoice' => 'Editar Factura de Venda',
+ 'Exch' => 'Câmbio',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate for payment missing!' => 'Falta a taxa de câmbio para o pagamento!',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'In-line' => 'Inline',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Data de Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number' => 'Número de Factura',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Invoice deleted!' => 'Factura apagada',
+ 'Invoice posted!' => 'Factura processada',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Order' => 'Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Part' => 'Produto',
+ 'Payment date missing!' => 'Falta Data de Pagamento!',
+ 'Payments' => 'Pagamentos',
+ 'Phone' => 'Tel',
+ 'Post' => 'Processar',
+ 'Post as new' => 'Processar como novo',
+ 'Postscript' => 'PostScript',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Qty' => 'Qtd',
+ 'Recd' => 'Recebido',
+ 'Record in' => 'Registar em',
+ 'Remaining' => 'Sobram',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Screen' => 'Ecran',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Ship via' => 'Expedir via',
+ 'Source' => 'Origem',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax Included' => 'Impostos incluídos',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'ea' => 'cd',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'encomenda' => 'order',
+ 'processar' => 'post',
+ 'processar_como_novo' => 'post_as_new',
+ 'imprimir' => 'print',
+ 'expedir_para' => 'ship_to',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/login b/sql-ledger/locale/pt/login
new file mode 100644
index 000000000..cbe762404
--- /dev/null
+++ b/sql-ledger/locale/pt/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Acerca',
+ 'Accounting' => 'Contabilidade',
+ 'Database Host' => 'Servidor de Base de Dados',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => 'Versão Dataset incorrecta!',
+ 'Incorrect Password!' => 'Password Incorrecta!',
+ 'Licensed to' => 'Licenciado a',
+ 'Login' => 'Login',
+ 'Name' => 'Nome',
+ 'Password' => 'Password',
+ 'User' => 'Utilizador',
+ 'Version' => 'Versão',
+ 'You are logged out!' => 'Terminou a sessão!',
+ 'You did not enter a name!' => 'Não indicou nome!',
+ 'is not a member!' => 'não é membro!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/menu b/sql-ledger/locale/pt/menu
new file mode 100644
index 000000000..97b81f736
--- /dev/null
+++ b/sql-ledger/locale/pt/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Fornecedores',
+ 'AP Aging' => 'Idade Saldos Fornecedores',
+ 'AR' => 'Clientes',
+ 'AR Aging' => 'Idade Saldos Clientes',
+ 'Accounting Menu' => 'Menu de Contabilidade',
+ 'Add Account' => 'Nova Conta',
+ 'Add Assembly' => 'Novo Conjunto',
+ 'Add Customer' => 'Novo Cliente',
+ 'Add GIFI' => 'Adicionar CFOP',
+ 'Add Part' => 'Novo Produto',
+ 'Add Project' => 'Novo Projecto',
+ 'Add Service' => 'Novo Serviço',
+ 'Add Transaction' => 'Nova Transacção',
+ 'Add Vendor' => 'Novo Fornecedor',
+ 'Assemblies' => 'Conjuntos',
+ 'Audit Control' => 'Controlo de Auditoria',
+ 'Backup' => 'Backup',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Cash' => 'Dinheiro',
+ 'Chart of Accounts' => 'Plano de Contas',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Clientes',
+ 'General Ledger' => 'Livro Razão',
+ 'Goods & Services' => 'Bens e Serviços',
+ 'HTML Templates' => 'Templates HTML',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Modelos LaTeX',
+ 'List Accounts' => 'Listar Contas',
+ 'List GIFI' => 'Listar CFOP',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Encomendas de Clientes',
+ 'Packing List' => 'Lista de Expedição',
+ 'Parts' => 'Produtos',
+ 'Payment' => 'Pagamento',
+ 'Payments' => 'Pagamentos',
+ 'Preferences' => 'Preferências',
+ 'Projects' => 'Projectos',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Receipt' => 'Recibo',
+ 'Receipts' => 'Recibos',
+ 'Reconciliation' => 'Reconciliação',
+ 'Reports' => 'Relatórios',
+ 'Sales Invoice' => 'Factura de Venda',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Sales Orders' => 'Encomendas de Venda',
+ 'Save to File' => 'Guardar em Ficheiro',
+ 'Send by E-Mail' => 'Enviar por Email',
+ 'Services' => 'Serviços',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Conjunto em stock',
+ 'Stylesheet' => 'Stylesheet',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'Transactions' => 'Transacções',
+ 'Trial Balance' => 'Balancete',
+ 'Vendors' => 'Fornecedores',
+ 'Version' => 'Versão',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/oe b/sql-ledger/locale/pt/oe
new file mode 100644
index 000000000..1be330f15
--- /dev/null
+++ b/sql-ledger/locale/pt/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Novo',
+ 'Add Purchase Invoice' => 'Nova Factura de Compra',
+ 'Add Purchase Order' => 'Nova Ordem de Compra',
+ 'Add Sales Invoice' => 'Nova Factura de Venda',
+ 'Add Sales Order' => 'Nova Encomenda de Cliente',
+ 'Address' => 'Endereço',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Are you sure you want to delete Order Number' => 'Confirma a remoção da Encomenda?',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Não é possivel apagar a encomenda!',
+ 'Cannot save order!' => 'Não é possível guardar encomenda!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Fechado',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit Limit' => 'Limite de Crédito',
+ 'Curr' => 'Moeda',
+ 'Currency' => 'Moeda',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente inexistente!',
+ 'Date' => 'Data',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Delete' => 'Remover',
+ 'Delivery Date' => 'Data de entrega',
+ 'Description' => 'Descrição',
+ 'E-mail' => 'E-Mail',
+ 'E-mail address missing!' => 'Falta Endereço de E-mail!',
+ 'Edit Purchase Order' => 'Editar Ordem de Compra',
+ 'Edit Sales Order' => 'Editar Encomenda',
+ 'Exchangerate' => 'Taxa de Câmbio',
+ 'Exchangerate missing!' => 'Falta a taxa de câmbio!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'ID' => 'ID',
+ 'In-line' => 'Inline',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Data de Factura não encontrada!',
+ 'Invoice Number missing!' => 'Número de Factura não encontrado!',
+ 'Item not on file!' => 'Item não está no arquivo!',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'Name' => 'Nome',
+ 'No.' => 'No.',
+ 'Notes' => 'Notas',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta numero na Linha',
+ 'O' => 'O',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'Open' => 'Abrir',
+ 'Order' => 'Encomenda',
+ 'Order Date' => 'Data da Encomenda',
+ 'Order Date missing!' => 'Falta data da Encomenda',
+ 'Order Number' => 'Encomenda Número',
+ 'Order Number missing!' => 'Falta numero da Encomenda!',
+ 'Order deleted!' => 'Encomenda apagada',
+ 'Order saved!' => 'Encomenda guardada',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Expedição',
+ 'Packing List Date missing!' => 'Falta Data da Lista de Expedição',
+ 'Packing List Number missing!' => 'Falta Numero de Lista de Expedição',
+ 'Part' => 'Produto',
+ 'Phone' => 'Tel',
+ 'Postscript' => 'PostScript',
+ 'Price' => 'Preço',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Project' => 'Projecto',
+ 'Project not on file!' => 'Projecto não existe',
+ 'Purchase Order' => 'Ordem de Compra',
+ 'Purchase Orders' => 'Ordens de Compra',
+ 'Qty' => 'Qtd',
+ 'Recd' => 'Recebido',
+ 'Remaining' => 'Sobram',
+ 'Required by' => 'Requerido por',
+ 'Sales Order' => 'Encomenda de Venda',
+ 'Sales Orders' => 'Encomendas de Venda',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como novo',
+ 'Screen' => 'Ecran',
+ 'Select from one of the items below' => 'Seleccione um dos items abaixo',
+ 'Select from one of the names below' => 'Seleccione um dos nomes abaixo',
+ 'Select from one of the projects below' => 'Seleccione um dos projectos abaixo',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Service' => 'Serviço',
+ 'Ship' => 'Expedir',
+ 'Ship to' => 'Expedir para',
+ 'Ship via' => 'Expedir via',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax Included' => 'Impostos incluídos',
+ 'Terms: Net' => 'Termos: A pronto',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidade',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Fornecedor',
+ 'Vendor missing!' => 'Falta fornecedor',
+ 'Vendor not on file!' => 'Fornecedor não existe',
+ 'What type of item is this?' => 'Que tipo de Item é este?',
+ 'Yes' => 'Sim',
+ 'days' => 'dias',
+ 'ea' => 'cd',
+ 'emailed to' => 'enviado por email para',
+ 'sent to printer' => 'enviado para a impressora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'novo' => 'add',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'factura' => 'invoice',
+ 'imprimir' => 'print',
+ 'guardar' => 'save',
+ 'guardar_como_novo' => 'save_as_new',
+ 'expedir_para' => 'ship_to',
+ 'actualizar' => 'update',
+ 'sim' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/pe b/sql-ledger/locale/pt/pe
new file mode 100644
index 000000000..fc7139396
--- /dev/null
+++ b/sql-ledger/locale/pt/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Novo',
+ 'Add Project' => 'Novo Projecto',
+ 'All' => 'Todos',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Remover',
+ 'Description' => 'Descrição',
+ 'Edit Project' => 'Editar Projecto',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Órfão',
+ 'Project' => 'Projecto',
+ 'Project Number missing!' => 'Falta o número do projecto',
+ 'Project deleted!' => 'Projecto apagado',
+ 'Project saved!' => 'Projecto guardado',
+ 'Projects' => 'Projectos',
+ 'Save' => 'Guardar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'novo' => 'add',
+ 'continuar' => 'continue',
+ 'remover' => 'delete',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/rc b/sql-ledger/locale/pt/rc
new file mode 100644
index 000000000..28c8216bb
--- /dev/null
+++ b/sql-ledger/locale/pt/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Conta',
+ 'Balance' => 'Saldo',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Data',
+ 'Deposit' => 'Depósito',
+ 'Description' => 'Descrição',
+ 'Difference' => 'Diferença',
+ 'Done' => 'Pronto',
+ 'Exchangerate Difference' => 'Diferença na Taxa de Câmbio',
+ 'From' => 'De',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Pagamento',
+ 'Reconciliation' => 'Reconciliação',
+ 'Select all' => 'Seleccionar todos',
+ 'Source' => 'Origem',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'Até',
+ 'Update' => 'Actualizar',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'pronto' => 'done',
+ 'seleccionar_todos' => 'select_all',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/pt/rp b/sql-ledger/locale/pt/rp
new file mode 100644
index 000000000..c452e9c24
--- /dev/null
+++ b/sql-ledger/locale/pt/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Idade Saldos Fornecedores',
+ 'AR Aging' => 'Idade Saldos Clientes',
+ 'Account' => 'Conta',
+ 'Accounts' => 'Contas',
+ 'Amount' => 'Total',
+ 'Apr' => 'Abr',
+ 'April' => 'Abril',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Ago',
+ 'August' => 'Agosto',
+ 'Balance Sheet' => 'Folha de Balanço',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar com',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Cópias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Current',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Data',
+ 'Debit' => 'Débito',
+ 'Dec' => 'Dez',
+ 'December' => 'Dezembro',
+ 'Decimalplaces' => 'Casas decimais',
+ 'Description' => 'Descrição',
+ 'Due' => 'Vence',
+ 'E-mail' => 'E-Mail',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Fev',
+ 'February' => 'Fevereiro',
+ 'From' => 'De',
+ 'GIFI' => 'CFOP - Código Fiscal da Operação',
+ 'Heading' => 'Cabeçalho',
+ 'ID' => 'ID',
+ 'In-line' => 'Inline',
+ 'Include in Report' => 'Incluir no Relatório',
+ 'Income Statement' => 'Estado de Receitas',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'Jan',
+ 'January' => 'Janeiro',
+ 'Jul' => 'Jul',
+ 'July' => 'Julho',
+ 'Jun' => 'Jun',
+ 'June' => 'Junho',
+ 'Mar' => 'Mar',
+ 'March' => 'Março',
+ 'May' => 'Mai',
+ 'May ' => 'Maio',
+ 'Message' => 'Mensagem',
+ 'N/A' => 'N/D',
+ 'Nothing selected!' => 'Nada seleccionado',
+ 'Nov' => 'Nov',
+ 'November' => 'Novembro',
+ 'Oct' => 'Out',
+ 'October' => 'Outubro',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagamentos',
+ 'Postscript' => 'PostScript',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impressora',
+ 'Receipts' => 'Recibos',
+ 'Report for' => 'Relatório para',
+ 'Retained Earnings' => 'Lucros Retidos',
+ 'Screen' => 'Ecran',
+ 'Select all' => 'Seleccionar todos',
+ 'Select postscript or PDF!' => 'Seleccione PostScript ou PDF',
+ 'Sep' => 'Set',
+ 'September' => 'Setembro',
+ 'Source' => 'Origem',
+ 'Standard' => 'Padrão',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Assunto',
+ 'Subtotal' => 'Sub-total',
+ 'Tax' => 'Imposto',
+ 'Tax collected' => 'Imposto recolhido',
+ 'Tax paid' => 'Imposto pago',
+ 'To' => 'Até',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balancete',
+ 'Vendor' => 'Fornecedor',
+ 'as at' => 'as at',
+ 'collected on sales' => 'recolhido sobre vendas',
+ 'for Period' => 'pelo período',
+ 'paid on purchases' => 'pago em aquisições',
+ 'to' => 'para',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'imprimir' => 'print',
+ 'seleccionar_todos' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/COPYING b/sql-ledger/locale/ru/COPYING
new file mode 100644
index 000000000..411c17049
--- /dev/null
+++ b/sql-ledger/locale/ru/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Russian texts:
+#
+# Author:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/ru/LANGUAGE b/sql-ledger/locale/ru/LANGUAGE
new file mode 100644
index 000000000..64c957825
--- /dev/null
+++ b/sql-ledger/locale/ru/LANGUAGE
@@ -0,0 +1 @@
+Russian
diff --git a/sql-ledger/locale/ru/admin b/sql-ledger/locale/ru/admin
new file mode 100644
index 000000000..3f10bcf97
--- /dev/null
+++ b/sql-ledger/locale/ru/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'ëÏÎÔÒÏÌØ ÄÏÓÔÕÐÁ',
+ 'Accounting' => 'Accounting',
+ 'Add User' => 'îÏ×ÙÊ ÐÏÌØÚÏ×ÁÔÅÌØ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Administration' => 'áÄÍÉÎÉÓÔÒÉÒÏ×ÁÎÉÅ',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Change Admin Password' => 'éÚÍÅÎÉÔØ ÐÁÒÏÌØ áÄÍÉÎÉÓÔÒÁÔÏÒÁ',
+ 'Change Password' => 'éÚÍÅÎÉÔØ ÐÁÒÏÌØ',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Click on login name to edit!' => 'Kliknij nazwê u¿ytkownika ¿eby dokonaæ zmian',
+ 'Company' => 'ïÒÇÁÎÉÚÁÃÉÑ',
+ 'Connect to' => 'ðÏÄËÌÀÞÉÔØÓÑ Ë',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Create Chart of Accounts' => 'óÏÚÄÁÔØ çðó',
+ 'Create Dataset' => 'Utwórz Zbiór Danych',
+ 'DBI not installed!' => 'îÅ ÕÓÔÁÎÏ×ÌÅÎ ÄÒÁÊ×ÅÒ DBI!',
+ 'Database' => 'âÁÚÁ ÄÁÎÎÙÈ',
+ 'Database Administration' => 'áÄÍÉÎÉÓÔÒÉÒÏ×ÁÎÉÅ ÂÁÚÙ ÄÁÎÎÙÈ',
+ 'Database Driver not checked!' => 'Sterownik Bazy Danych nie zaznaczony!',
+ 'Database User missing!' => 'Brak U¿ytkownika Bazy Danych!',
+ 'Dataset' => 'Zbiór Danych',
+ 'Dataset missing!' => 'Brak Zbioru Danych',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÙ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delete Dataset' => 'Usuñ Zbior Danych',
+ 'Directory' => 'ëÁÔÁÌÏÇ',
+ 'Driver' => 'Sterownik',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Zmiany U¿ytkownika',
+ 'Existing Datasets' => 'Istniej±cy Zbiór Danych',
+ 'Fax' => 'Fax',
+ 'Host' => 'Wêze³',
+ 'Hostname missing!' => 'Brak Nazwy Wêz³a',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Language' => 'ñÚÙË',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Opu¶æ pole wêz³a i portu, chyba ¿e chcesz mieæ zdalne po³±czenie',
+ 'Login' => 'Zarejestrój siê',
+ 'Name' => 'Nazwa',
+ 'New Templates' => 'Nowe Szablony',
+ 'No Database Drivers available!' => 'Sterownik Bazy Danych jest niedostêpny',
+ 'No Dataset selected!' => 'Nie jest zaznaczony Zbiór Danych',
+ 'Nothing to delete!' => 'Niema nic do usuniêcia!',
+ 'Number Format' => 'Format Numeru',
+ 'Oracle Database Administration' => 'Administracja Bazy Danych Oracle',
+ 'Password' => 'Has³o',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Administracja Bazy Danych Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Brak Portu',
+ 'Printer' => 'Drukarka',
+ 'Save' => 'Zapisz',
+ 'Select a Dataset to delete and press "Continue"' => 'Wybierz Zbiór Danych do usuniêcia i naci¶nij "Kontynuj"',
+ 'Setup Templates' => 'Ustaw Szablony',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'ðÏÄÐÉÓØ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÉÅ',
+ 'Templates' => 'æÏÒÍÙ',
+ 'The following Datasets are not in use and can be deleted' => 'Te Zbiory Danych s± nieu¿ywane i mo¿na je usun±æ',
+ 'The following Datasets need to be updated' => 'Zbiory Danych do uzupe³nienia',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Jest to wstêpne sprawdzenie istniej±cych ¿róde³. Narazie nic nie bêdzie utworzone lub usuniête.',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '¯eby dodaæ do grupy u¿ytkownika zmieñ nazwê, nazwê zarejestrowania i zapisz. Nowy u¿ytkownik z tymi samymi zmiennymi warto¶ciami bêdzie zapisany pod now± nazw± rejestruj±c±',
+ 'Update Dataset' => 'Uzupe³nij Zbiór Danych',
+ 'Use Templates' => 'U¿yj Szablony',
+ 'User' => 'U¿ytkownik',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => '÷ÅÒÓÉÑ',
+ 'You must enter a host and port for local and remote connections!' => 'Wstaw wêze³ i port dla lokalnego i zdalnego po³±czenia',
+ 'does not exist' => 'nie istnieje',
+ 'is already a member!' => 'Jest ju¿ cz³onkiem',
+ 'localhost' => 'wêze³',
+ 'successfully created!' => 'stworzone z powodzeniem',
+ 'successfully deleted!' => 'usuniête z powodzeniem',
+ 'website' => 'witryna WWW',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'îÏ×ÙÊ_ÐÏÌØÚÏ×ÁÔÅÌØ' => 'add_user',
+ 'éÚÍÅÎÉÔØ_ÐÁÒÏÌØ_áÄÍÉÎÉÓÔÒÁÔÏÒÁ' => 'change_admin_password',
+ 'éÚÍÅÎÉÔØ_ÐÁÒÏÌØ' => 'change_password',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'utwórz_zbiór_danych' => 'create_dataset',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'usuñ_zbior_danych' => 'delete_dataset',
+ 'zarejestrój_siê' => 'login',
+ 'administracja_bazy_danych_oracle' => 'oracle_database_administration',
+ 'administracja_bazy_danych_pg' => 'pg_database_administration',
+ 'zapisz' => 'save',
+ 'uzupe³nij_zbiór_danych' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/all b/sql-ledger/locale/ru/all
new file mode 100644
index 000000000..a87eee98f
--- /dev/null
+++ b/sql-ledger/locale/ru/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'òÁÓÈÏÄ',
+ 'AP Aging' => 'AP Aging',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'ðÒÏ×ÏÄËÉ ÒÁÓÈÏÄÁ',
+ 'AR' => 'äÏÈÏÄ',
+ 'AR Aging' => 'AR Aging',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'ðÒÏ×ÏÄËÉ ÄÏÈÏÄÁ',
+ 'About' => 'ï ÐÒÏÇÒÁÍÍÅ',
+ 'Access Control' => 'ëÏÎÔÒÏÌØ ÄÏÓÔÕÐÁ',
+ 'Account' => 'óÞÅÔ',
+ 'Account Number' => 'ëÏÄ ÓÞÅÔÁ',
+ 'Account Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ!',
+ 'Account Type' => 'ôÉÐ ÓÞÅÔÁ',
+ 'Account Type missing!' => 'îÅ ÕËÁÚÁÎ ÔÉÐ ÓÞÅÔÁ!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Accounting',
+ 'Accounting Menu' => 'Accounting Menu',
+ 'Accounts' => 'óÞÅÔÁ',
+ 'Active' => '',
+ 'Add' => 'îÏ×ÙÊ',
+ 'Add Account' => 'îÏ×ÙÊ ÓÞÅÔ',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'îÏ×ÙÊ ËÏÍÐÌÅËÔ',
+ 'Add Customer' => 'îÏ×ÙÊ ËÌÉÅÎÔ',
+ 'Add GIFI' => 'îÏ×ÙÊ GIFI',
+ 'Add General Ledger Transaction' => 'îÏ×ÁÑ ÐÒÏ×ÏÄËÁ',
+ 'Add Part' => 'îÏ×ÙÊ ÐÒÏÄÕËÔ',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Add Service' => 'îÏ×ÁÑ ÕÓÌÕÇÁ',
+ 'Add Transaction' => 'îÏ×ÁÑ ÐÒÏ×ÏÄËÁ',
+ 'Add User' => 'îÏ×ÙÊ ÐÏÌØÚÏ×ÁÔÅÌØ',
+ 'Add Vendor' => 'îÏ×ÙÊ ÐÏÓÔÁ×ÝÉË',
+ 'Address' => 'áÄÒÅÓ',
+ 'Administration' => 'áÄÍÉÎÉÓÔÒÉÒÏ×ÁÎÉÅ',
+ 'Administrator' => '',
+ 'All' => '÷ÓÅ',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Invoice Number' => '÷Ù Õ×ÅÒÅÎÙ, ÞÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÙÊ ÓÞÅÔ?',
+ 'Are you sure you want to delete Order Number' => '÷Ù Õ×ÅÒÅÎÙ, ÞÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÙÊ ÚÁËÁÚ?',
+ 'Are you sure you want to delete Transaction' => '÷Ù Õ×ÅÒÅÎÙ, ÓÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÕÀ ÐÒÏ×ÏÄËÕ?',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÙ',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ËÏÍÐÌÅËÔÁ!',
+ 'Asset' => 'áËÔÉ×',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'BOM' => '',
+ 'Backup' => 'òÅÚÅÒ×ÎÁÑ ËÏÐÉÑ',
+ 'Backup sent to' => 'òÅÚÅÒ×ÎÁÑ ËÏÐÉÑ ÏÔÏÓÌÁÎÁ ÎÁ',
+ 'Balance' => '',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Bcc' => '',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'ëÎÉÇÁ ÏÔËÒÙÔÁ',
+ 'Bought' => 'ëÕÐÌÅÎÏ',
+ 'Business Number' => 'òîî',
+ 'C' => '',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'îÅÌØÚÑ ÕÄÁÌÉÔØ ÏÓÎÏ×ÎÏÊ ÓÞÅÔ!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'Nie mo¿na usun±æ pozycji zafakturowanej!',
+ 'Cannot delete item on order!' => 'Nie mo¿na usunac zamówionego produktu!',
+ 'Cannot delete item which is part of an assembly!' => 'Nie mo¿na usun±æ czê¶ci z zestawienia!',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'Nie mo¿na wpisaæ warto¶ci w Debet i Kredyt równocze¶nie!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji w zamkniêtym okresie',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'éÚÍÅÎÉÔØ ÐÁÒÏÌØ áÄÍÉÎÉÓÔÒÁÔÏÒÁ',
+ 'Change Password' => 'éÚÍÅÎÉÔØ ÐÁÒÏÌØ',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Chart of Accounts' => 'ðÌÁÎ ÓÞÅÔÏ×',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Kliknij nazwê u¿ytkownika ¿eby dokonaæ zmian',
+ 'Close Books up to' => 'Zamkniêcie Ksi±g do!',
+ 'Closed' => 'úÁËÒÙÔ',
+ 'Company' => 'ïÒÇÁÎÉÚÁÃÉÑ',
+ 'Compare to' => 'óÒÁ×ÎÉÔØ Ó',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Connect to' => 'ðÏÄËÌÀÞÉÔØÓÑ Ë',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Copy to COA' => 'ëÏÐÉÒÏ×ÁÔØ × çðó',
+ 'Create Chart of Accounts' => 'óÏÚÄÁÔØ çðó',
+ 'Create Dataset' => 'Utwórz Zbiór Danych',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Credit Limit' => 'ìÉÍÉÔ ËÒÅÄÉÔÁ',
+ 'Curr' => '÷ÁÌÀÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Current' => '',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'îÅ ÕÓÔÁÎÏ×ÌÅÎ ÄÒÁÊ×ÅÒ DBI!',
+ 'Database' => 'âÁÚÁ ÄÁÎÎÙÈ',
+ 'Database Administration' => 'áÄÍÉÎÉÓÔÒÉÒÏ×ÁÎÉÅ ÂÁÚÙ ÄÁÎÎÙÈ',
+ 'Database Driver not checked!' => 'Sterownik Bazy Danych nie zaznaczony!',
+ 'Database Host' => 'Wêze³ Bazy Danych',
+ 'Database User missing!' => 'Brak U¿ytkownika Bazy Danych!',
+ 'Dataset' => 'Zbiór Danych',
+ 'Dataset missing!' => 'Brak Zbioru Danych',
+ 'Dataset updated!' => '',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÙ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÙ',
+ 'Date missing!' => '',
+ 'Debit' => 'äÅÂÅÔ',
+ 'Debit and credit out of balance!' => 'Debet i Kredyt siê niebalansuj±!',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Decimalplaces' => '',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delete Account' => 'õÄÁÌÍÔØ ÓÞÅÔ',
+ 'Delete Dataset' => 'Usuñ Zbior Danych',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Difference' => '',
+ 'Directory' => 'ëÁÔÁÌÏÇ',
+ 'Discount' => 'óËÉÄËÁ',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Sterownik',
+ 'Dropdown Limit' => '',
+ 'Due' => 'äÏ',
+ 'Due Date' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Due Date missing!' => 'îÅ ÕËÁÚÁÎ ÓÒÏË ÏÐÌÁÔÙ!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Edit' => '',
+ 'Edit Account' => 'éÚÍÅÎÉÔØ ÓÞÅÔ',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'éÚÍÅÎÉÔØ ËÏÍÐÌÅËÔ',
+ 'Edit GIFI' => 'éÚÍÅÎÉÔØ GIFI',
+ 'Edit General Ledger Transaction' => 'Zmiany w Ksiêdze G³ównej',
+ 'Edit Part' => 'Zmiany Produktu',
+ 'Edit Preferences for' => 'Zmiany Preferencji dla',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Zmiany Zamówienia Zakupu',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Zmiany Zamówienia Klienta',
+ 'Edit Service' => 'éÚÍÅÎÉÔØ ÕÓÌÕÇÕ',
+ 'Edit Template' => 'Zmiany Wzorca',
+ 'Edit User' => 'Zmiany U¿ytkownika',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => 'Egzekwuj zmiany transakcji dla wszystkich terminów',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '',
+ 'Equity' => 'Kapita³',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Existing Datasets' => 'Istniej±cy Zbiór Danych',
+ 'Expense' => 'òÁÓÈÏÄ',
+ 'Expense Account' => 'Konto Kosztów',
+ 'Expense/Asset' => 'Koszt/Aktywy',
+ 'Extended' => '',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'Foreign Exchange Gain' => 'Zysk przy Wymianie Walut',
+ 'Foreign Exchange Loss' => 'Strata przy Wymianie Walut',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => 'Brakuje GIFI',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'Goods & Services' => 'Produkty i Us³ugi',
+ 'HTML Templates' => 'Szablony HTML',
+ 'Heading' => 'òÁÚÄÅÌ',
+ 'Host' => 'Wêze³',
+ 'Hostname missing!' => 'Brak Nazwy Wêz³a',
+ 'ID' => 'Identyfikator',
+ 'Image' => '',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Include in drop-down menus' => 'Do³±cz w menu rozwijanym',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Do³±cz Konto w formularzach Kontrachentów ¿eby wskazaæ ¿e podlegaj± opodatkowaniu',
+ 'Income' => 'äÏÈÏÄ',
+ 'Income Account' => 'Konto Przychodów',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Incorrect Dataset version!' => 'Nieprawid³owa wersja Zbioru Danych',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Individual Items' => 'Indywidualne Czê¶ci',
+ 'Inventory' => 'éÎ×ÅÎÔÁÒÎÙÊ',
+ 'Inventory Account' => 'Konto Materia³owe',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Ilo¶æ Inventarza musi byæ równa zero zanim bêdzie mozna zdezaktualizowaæ to z³o¿enie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Ilo¶æ inventarza musi byæ równa zero zanim bêdzie mo¿na zdezaktualizowaæ t± czê¶æ!',
+ 'Inventory quantity must be zero!' => 'Ilo¶æc Inventarza musi byæ równa zero',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'Czy jest to konto sumaryczne?',
+ 'Item deleted!' => '',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'LaTeX Templates' => 'Szablony LaTeX',
+ 'Language' => 'ñÚÙË',
+ 'Last Cost' => 'Cena Zakupu',
+ 'Last Invoice Number' => 'Ostatni Numer Faktury',
+ 'Last Numbers & Default Accounts' => 'Ostatnie Numery i Konta Domy¶lne',
+ 'Last Purchase Order Number' => 'Ostatni Numer Faktury Zamówienia',
+ 'Last Sales Order Number' => 'Ostatni Numer Faktury Sprzeda¿y',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Opu¶æ pole wêz³a i portu, chyba ¿e chcesz mieæ zdalne po³±czenie',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Licensed to' => 'ìÉÃÅÎÚÉÅÊ ÏÂÌÁÄÁÅÔ:',
+ 'Line Total' => 'Suma ca³kowita',
+ 'Link' => 'Dowi±zanie',
+ 'Link Accounts' => 'Konta dowi±zane',
+ 'List Accounts' => 'Spis Kont',
+ 'List GIFI' => 'Wykaz GIFI',
+ 'List Price' => 'Cena',
+ 'List Transactions' => 'Wykaz Transakcji',
+ 'Login' => 'Zarejestrój siê',
+ 'Logout' => 'Wyrejestrój siê',
+ 'Make' => 'Marka',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Microfiche' => '',
+ 'Model' => 'Model',
+ 'N/A' => 'N/A',
+ 'Name' => 'Nazwa',
+ 'Name missing!' => '',
+ 'New Templates' => 'Nowe Szablony',
+ 'No' => 'Nie',
+ 'No Database Drivers available!' => 'Sterownik Bazy Danych jest niedostêpny',
+ 'No Dataset selected!' => 'Nie jest zaznaczony Zbiór Danych',
+ 'No email address for' => 'Brak adresu email',
+ 'No.' => '',
+ 'Notes' => 'Noty',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => 'Niema nic do usuniêcia!',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number Format' => 'Format Numeru',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'O' => '',
+ 'Obsolete' => 'Zdezaktualizowany',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'On Hand' => 'Na Stanie',
+ 'On Order' => '',
+ 'Open' => 'Otwórz',
+ 'Oracle Database Administration' => 'Administracja Bazy Danych Oracle',
+ 'Order' => 'Zamówienie',
+ 'Order Date' => 'Data Zamówienia',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Entry' => 'Wystawianie Zamówieñ',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'Zbêdny',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Paid' => 'Zap³acono',
+ 'Paid in full' => '',
+ 'Part' => 'Produkt',
+ 'Part Number missing!' => 'Brak Symbolu Produktu!',
+ 'Parts' => 'Produkty',
+ 'Parts Inventory' => 'Inwentarz',
+ 'Password' => 'Has³o',
+ 'Password changed!' => '',
+ 'Payables' => 'Zobowi±zania',
+ 'Payment' => 'P³atno¶æ',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payment posted!' => '',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Pg Database Administration' => 'Administracja Bazy Danych Pg',
+ 'Phone' => 'Tel.',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Brak Portu',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Preferencje',
+ 'Preferences saved!' => 'Preferencje Zapisane!',
+ 'Price' => 'Cena Netto',
+ 'Print' => '',
+ 'Printer' => 'Drukarka',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'ROP' => 'PPZ',
+ 'Rate' => 'Stawka',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Nale¿no¶ci',
+ 'Reconciliation' => '',
+ 'Record in' => 'ïÔÎÅÓÔÉ ÎÁ ÓÞÅÔ',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => 'Pozosta³e',
+ 'Report for' => 'Raport dla',
+ 'Reports' => 'Sprawozdania',
+ 'Required by' => 'Termin Dostawy',
+ 'Retained Earnings' => 'Zysk',
+ 'Sales' => 'Sprzeda¿',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save' => 'Zapisz',
+ 'Save as new' => '',
+ 'Save to File' => 'Zapisz w zbiorze',
+ 'Screen' => 'Ekran',
+ 'Select a Dataset to delete and press "Continue"' => 'Wybierz Zbiór Danych do usuniêcia i naci¶nij "Kontynuj"',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Cena Sprzeda¿y',
+ 'Send by E-Mail' => 'Wys³ano przy u¿yciu E-Mail',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Service Items' => 'Artyku³y Us³ugowe',
+ 'Service Number missing!' => 'Brak Numeru Us³ugi!',
+ 'Services' => 'õÓÌÕÇÉ',
+ 'Setup Templates' => 'Ustaw Szablony',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Niedobór',
+ 'Signature' => 'ðÏÄÐÉÓØ',
+ 'Sold' => 'Sprzedano',
+ 'Source' => '¯ród³o',
+ 'Standard' => 'óÔÁÎÄÁÒÔÎÙÅ',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÉÅ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'System' => 'óÉÓÔÅÍÁ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax Accounts' => 'Konta Podatkowe',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Opodatkowane',
+ 'Template saved!' => '',
+ 'Templates' => 'æÏÒÍÙ',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'The following Datasets are not in use and can be deleted' => 'Te Zbiory Danych s± nieu¿ywane i mo¿na je usun±æ',
+ 'The following Datasets need to be updated' => 'Zbiory Danych do uzupe³nienia',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Jest to wstêpne sprawdzenie istniej±cych ¿róde³. Narazie nic nie bêdzie utworzone lub usuniête.',
+ 'To' => 'do',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '¯eby dodaæ do grupy u¿ytkownika zmieñ nazwê, nazwê zarejestrowania i zapisz. Nowy u¿ytkownik z tymi samymi zmiennymi warto¶ciami bêdzie zapisany pod now± nazw± rejestruj±c±',
+ 'Top Level' => '',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction Date missing!' => 'Brak Daty Transakcji!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => 'Zmiana transakcji narzucona dla wszystkich okresów',
+ 'Transaction reversal enforced up to' => 'Zmiana transakcji narzucona do',
+ 'Transactions' => 'Transakcje',
+ 'Transactions exist, cannot delete customer!' => 'Istniej± Transakcje, niemo¿na usun±æ odbiorcy',
+ 'Transactions exist, cannot delete vendor!' => 'Istniej± Transakcje, nie mo¿na usun±æ dostawcy',
+ 'Transactions exist; cannot delete account!' => 'Istniej± Transakcje, nie mo¿na usun±æ konta',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Unit' => 'Jednostka',
+ 'Unit of measure' => 'Jednostka miary',
+ 'Update' => '',
+ 'Update Dataset' => 'Uzupe³nij Zbiór Danych',
+ 'Updated' => '',
+ 'Use Templates' => 'U¿yj Szablony',
+ 'User' => 'U¿ytkownik',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Dostawca',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => '÷ÅÒÓÉÑ',
+ 'Weight' => 'Waga',
+ 'Weight Unit' => 'Jednostka Wagi',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Year End' => 'Koniec Roku Finansowego',
+ 'Yes' => 'Tak',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'Nie wstawiono nazwy!',
+ 'You must enter a host and port for local and remote connections!' => 'Wstaw wêze³ i port dla lokalnego i zdalnego po³±czenia',
+ 'as at' => '',
+ 'collected on sales' => 'zebranego przy sprzeda¿y',
+ 'days' => 'dni',
+ 'does not exist' => 'nie istnieje',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'for Period' => 'za Okres',
+ 'hr' => 'godz',
+ 'is already a member!' => 'Jest ju¿ cz³onkiem',
+ 'is not a member!' => 'Nie jest cz³onkiem',
+ 'localhost' => 'wêze³',
+ 'paid on purchases' => 'zap³aconego przy zakupach',
+ 'sent to printer' => 'wys³ano do drukarki',
+ 'successfully created!' => 'stworzone z powodzeniem',
+ 'successfully deleted!' => 'usuniête z powodzeniem',
+ 'to' => '',
+ 'website' => 'witryna WWW',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/am b/sql-ledger/locale/ru/am
new file mode 100644
index 000000000..204e1c33a
--- /dev/null
+++ b/sql-ledger/locale/ru/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'òÁÓÈÏÄ',
+ 'AR' => 'äÏÈÏÄ',
+ 'Account' => 'óÞÅÔ',
+ 'Account Number' => 'ëÏÄ ÓÞÅÔÁ',
+ 'Account Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ!',
+ 'Account Type' => 'ôÉÐ ÓÞÅÔÁ',
+ 'Account Type missing!' => 'îÅ ÕËÁÚÁÎ ÔÉÐ ÓÞÅÔÁ!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'îÏ×ÙÊ ÓÞÅÔ',
+ 'Add GIFI' => 'îÏ×ÙÊ GIFI',
+ 'Address' => 'áÄÒÅÓ',
+ 'Asset' => 'áËÔÉ×',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Backup sent to' => 'òÅÚÅÒ×ÎÁÑ ËÏÐÉÑ ÏÔÏÓÌÁÎÁ ÎÁ',
+ 'Books are open' => 'ëÎÉÇÁ ÏÔËÒÙÔÁ',
+ 'Business Number' => 'òîî',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'îÅÌØÚÑ ÕÄÁÌÉÔØ ÏÓÎÏ×ÎÏÊ ÓÞÅÔ!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Chart of Accounts' => 'ðÌÁÎ ÓÞÅÔÏ×',
+ 'Close Books up to' => 'Zamkniêcie Ksi±g do!',
+ 'Company' => 'ïÒÇÁÎÉÚÁÃÉÑ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copy to COA' => 'ëÏÐÉÒÏ×ÁÔØ × çðó',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÙ',
+ 'Debit' => 'äÅÂÅÔ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delete Account' => 'õÄÁÌÍÔØ ÓÞÅÔ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'éÚÍÅÎÉÔØ ÓÞÅÔ',
+ 'Edit GIFI' => 'éÚÍÅÎÉÔØ GIFI',
+ 'Edit Preferences for' => 'Zmiany Preferencji dla',
+ 'Edit Template' => 'Zmiany Wzorca',
+ 'Enforce transaction reversal for all dates' => 'Egzekwuj zmiany transakcji dla wszystkich terminów',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies',
+ 'Equity' => 'Kapita³',
+ 'Expense' => 'òÁÓÈÏÄ',
+ 'Expense Account' => 'Konto Kosztów',
+ 'Expense/Asset' => 'Koszt/Aktywy',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Zysk przy Wymianie Walut',
+ 'Foreign Exchange Loss' => 'Strata przy Wymianie Walut',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'Brakuje GIFI',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'òÁÚÄÅÌ',
+ 'Include in drop-down menus' => 'Do³±cz w menu rozwijanym',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Do³±cz Konto w formularzach Kontrachentów ¿eby wskazaæ ¿e podlegaj± opodatkowaniu',
+ 'Income' => 'äÏÈÏÄ',
+ 'Income Account' => 'Konto Przychodów',
+ 'Inventory' => 'éÎ×ÅÎÔÁÒÎÙÊ',
+ 'Inventory Account' => 'Konto Materia³owe',
+ 'Is this a summary account to record' => 'Czy jest to konto sumaryczne?',
+ 'Language' => 'ñÚÙË',
+ 'Last Invoice Number' => 'Ostatni Numer Faktury',
+ 'Last Numbers & Default Accounts' => 'Ostatnie Numery i Konta Domy¶lne',
+ 'Last Purchase Order Number' => 'Ostatni Numer Faktury Zamówienia',
+ 'Last Sales Order Number' => 'Ostatni Numer Faktury Sprzeda¿y',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Link' => 'Dowi±zanie',
+ 'Name' => 'Nazwa',
+ 'No' => 'Nie',
+ 'No email address for' => 'Brak adresu email',
+ 'Number' => 'Numer Katalogu',
+ 'Number Format' => 'Format Numeru',
+ 'Parts Inventory' => 'Inwentarz',
+ 'Password' => 'Has³o',
+ 'Payables' => 'Zobowi±zania',
+ 'Payment' => 'P³atno¶æ',
+ 'Phone' => 'Tel.',
+ 'Preferences saved!' => 'Preferencje Zapisane!',
+ 'Rate' => 'Stawka',
+ 'Receivables' => 'Nale¿no¶ci',
+ 'Sales' => 'Sprzeda¿',
+ 'Save' => 'Zapisz',
+ 'Service Items' => 'Artyku³y Us³ugowe',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'ðÏÄÐÉÓØ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÉÅ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax Accounts' => 'Konta Podatkowe',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Zmiana transakcji narzucona dla wszystkich okresów',
+ 'Transaction reversal enforced up to' => 'Zmiana transakcji narzucona do',
+ 'Transactions exist; cannot delete account!' => 'Istniej± Transakcje, nie mo¿na usun±æ konta',
+ 'Weight Unit' => 'Jednostka Wagi',
+ 'Year End' => 'Koniec Roku Finansowego',
+ 'Yes' => 'Tak',
+ 'does not exist' => 'nie istnieje',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'îÏ×ÙÊ_ÓÞÅÔ' => 'add_account',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'ëÏÐÉÒÏ×ÁÔØ_×_çðó' => 'copy_to_coa',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'edit' => 'edit',
+ 'éÚÍÅÎÉÔØ_ÓÞÅÔ' => 'edit_account',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ap b/sql-ledger/locale/ru/ap
new file mode 100644
index 000000000..3c243ebdb
--- /dev/null
+++ b/sql-ledger/locale/ru/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'ðÒÏ×ÏÄËÉ ÒÁÓÈÏÄÁ',
+ 'Account' => 'óÞÅÔ',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Transaction' => '÷Ù Õ×ÅÒÅÎÙ, ÓÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÕÀ ÐÒÏ×ÏÄËÕ?',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji w zamkniêtym okresie',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'úÁËÒÙÔ',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÙ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Due Date' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Due Date missing!' => 'îÅ ÕËÁÚÁÎ ÓÒÏË ÏÐÌÁÔÙ!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otwórz',
+ 'Order' => 'Zamówienie',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Paid' => 'Zap³acono',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ar b/sql-ledger/locale/ru/ar
new file mode 100644
index 000000000..3970754c3
--- /dev/null
+++ b/sql-ledger/locale/ru/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'ðÒÏ×ÏÄËÉ ÄÏÈÏÄÁ',
+ 'Account' => 'óÞÅÔ',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Transaction' => '÷Ù Õ×ÅÒÅÎÙ, ÓÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÕÀ ÐÒÏ×ÏÄËÕ?',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji w zamkniêtym okresie',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'úÁËÒÙÔ',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Credit Limit' => 'ìÉÍÉÔ ËÒÅÄÉÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÙ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Due Date' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Due Date missing!' => 'îÅ ÕËÁÚÁÎ ÓÒÏË ÏÐÌÁÔÙ!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otwórz',
+ 'Order' => 'Zamówienie',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Paid' => 'Zap³acono',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Pozosta³e',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/arap b/sql-ledger/locale/ru/arap
new file mode 100644
index 000000000..24fe71638
--- /dev/null
+++ b/sql-ledger/locale/ru/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'áÄÒÅÓ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Number' => 'Numer Katalogu',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ca b/sql-ledger/locale/ru/ca
new file mode 100644
index 000000000..1b1b139c7
--- /dev/null
+++ b/sql-ledger/locale/ru/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'óÞÅÔ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'ðÌÁÎ ÓÞÅÔÏ×',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÅÔ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'List Transactions' => 'Wykaz Transakcji',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Reference' => 'Reference',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'To' => 'do',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'wykaz_transakcji' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/cp b/sql-ledger/locale/ru/cp
new file mode 100644
index 000000000..6ff1936b3
--- /dev/null
+++ b/sql-ledger/locale/ru/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'óÞÅÔ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Due' => 'äÏ',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'From' => 'Od',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Numer Katalogu',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'P³atno¶æ',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Drukarka',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Ekran',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'do',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dostawca',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ct b/sql-ledger/locale/ru/ct
new file mode 100644
index 000000000..7c3988415
--- /dev/null
+++ b/sql-ledger/locale/ru/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÙÊ',
+ 'Address' => 'áÄÒÅÓ',
+ 'All' => '÷ÓÅ',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Credit Limit' => 'ìÉÍÉÔ ËÒÅÄÉÔÁ',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Discount' => 'óËÉÄËÁ',
+ 'E-mail' => 'E-mail',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Name' => 'Nazwa',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Noty',
+ 'Number' => 'Numer Katalogu',
+ 'Order' => 'Zamówienie',
+ 'Orphaned' => 'Zbêdny',
+ 'Phone' => 'Tel.',
+ 'Save' => 'Zapisz',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Taxable' => 'Opodatkowane',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'Transactions exist, cannot delete customer!' => 'Istniej± Transakcje, niemo¿na usun±æ odbiorcy',
+ 'Transactions exist, cannot delete vendor!' => 'Istniej± Transakcje, nie mo¿na usun±æ dostawcy',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'dni',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'îÏ×ÙÊ' => 'add',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'óÞÅÔ_ÆÁËÔÕÒÁ' => 'invoice',
+ 'zamówienie' => 'order',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/gl b/sql-ledger/locale/ru/gl
new file mode 100644
index 000000000..28292adb9
--- /dev/null
+++ b/sql-ledger/locale/ru/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'óÞÅÔ',
+ 'Add General Ledger Transaction' => 'îÏ×ÁÑ ÐÒÏ×ÏÄËÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'All' => '÷ÓÅ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Transaction' => '÷Ù Õ×ÅÒÅÎÙ, ÓÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÕÀ ÐÒÏ×ÏÄËÕ?',
+ 'Asset' => 'áËÔÉ×',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'Nie mo¿na wpisaæ warto¶ci w Debet i Kredyt równocze¶nie!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Nie mo¿na zaksiêgowaæ transakcji w zamkniêtym okresie',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÅÔ',
+ 'Debit and credit out of balance!' => 'Debet i Kredyt siê niebalansuj±!',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Edit General Ledger Transaction' => 'Zmiany w Ksiêdze G³ównej',
+ 'Equity' => 'Kapita³',
+ 'Expense' => 'òÁÓÈÏÄ',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'ID' => 'Identyfikator',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income' => 'äÏÈÏÄ',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Sprawozdania',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Source' => '¯ród³o',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'To' => 'do',
+ 'Transaction Date missing!' => 'Brak Daty Transakcji!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Tak',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ic b/sql-ledger/locale/ru/ic
new file mode 100644
index 000000000..b879e88e6
--- /dev/null
+++ b/sql-ledger/locale/ru/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'îÏ×ÙÊ',
+ 'Add Assembly' => 'îÏ×ÙÊ ËÏÍÐÌÅËÔ',
+ 'Add Part' => 'îÏ×ÙÊ ÐÒÏÄÕËÔ',
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Add Service' => 'îÏ×ÁÑ ÕÓÌÕÇÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÙ',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ËÏÍÐÌÅËÔÁ!',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'ëÕÐÌÅÎÏ',
+ 'COGS' => 'COGS',
+ 'Cannot delete item already invoiced!' => 'Nie mo¿na usun±æ pozycji zafakturowanej!',
+ 'Cannot delete item on order!' => 'Nie mo¿na usunac zamówionego produktu!',
+ 'Cannot delete item which is part of an assembly!' => 'Nie mo¿na usun±æ czê¶ci z zestawienia!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Edit Assembly' => 'éÚÍÅÎÉÔØ ËÏÍÐÌÅËÔ',
+ 'Edit Part' => 'Zmiany Produktu',
+ 'Edit Service' => 'éÚÍÅÎÉÔØ ÕÓÌÕÇÕ',
+ 'Expense' => 'òÁÓÈÏÄ',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'Image' => 'Image',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income' => 'äÏÈÏÄ',
+ 'Individual Items' => 'Indywidualne Czê¶ci',
+ 'Inventory' => 'éÎ×ÅÎÔÁÒÎÙÊ',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Ilo¶æ Inventarza musi byæ równa zero zanim bêdzie mozna zdezaktualizowaæ to z³o¿enie!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Ilo¶æ inventarza musi byæ równa zero zanim bêdzie mo¿na zdezaktualizowaæ t± czê¶æ!',
+ 'Inventory quantity must be zero!' => 'Ilo¶æc Inventarza musi byæ równa zero',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Last Cost' => 'Cena Zakupu',
+ 'Line Total' => 'Suma ca³kowita',
+ 'Link Accounts' => 'Konta dowi±zane',
+ 'List Price' => 'Cena',
+ 'Make' => 'Marka',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Model',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Obsolete' => 'Zdezaktualizowany',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'On Hand' => 'Na Stanie',
+ 'On Order' => 'On Order',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Zbêdny',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Part Number missing!' => 'Brak Symbolu Produktu!',
+ 'Parts' => 'Produkty',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'ROP' => 'PPZ',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales' => 'Sprzeda¿',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Save' => 'Zapisz',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Cena Sprzeda¿y',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Service Number missing!' => 'Brak Numeru Us³ugi!',
+ 'Services' => 'õÓÌÕÇÉ',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Niedobór',
+ 'Sold' => 'Sprzedano',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'To' => 'do',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Unit of measure' => 'Jednostka miary',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Waga',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'hr' => 'godz',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'îÏ×ÙÊ' => 'add',
+ 'îÏ×ÙÊ_ËÏÍÐÌÅËÔ' => 'add_assembly',
+ 'îÏ×ÙÊ_ÐÒÏÄÕËÔ' => 'add_part',
+ 'îÏ×ÁÑ_ÕÓÌÕÇÁ' => 'add_service',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'éÚÍÅÎÉÔØ_ËÏÍÐÌÅËÔ' => 'edit_assembly',
+ 'zmiany_produktu' => 'edit_part',
+ 'éÚÍÅÎÉÔØ_ÕÓÌÕÇÕ' => 'edit_service',
+ 'zapisz' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/io b/sql-ledger/locale/ru/io
new file mode 100644
index 000000000..36137b2be
--- /dev/null
+++ b/sql-ledger/locale/ru/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'ôÅÍÁ',
+ 'To' => 'do',
+ 'Unit' => 'Jednostka',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/ir b/sql-ledger/locale/ru/ir
new file mode 100644
index 000000000..67db20387
--- /dev/null
+++ b/sql-ledger/locale/ru/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'óÞÅÔ',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Invoice Number' => '÷Ù Õ×ÅÒÅÎÙ, ÞÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÙÊ ÓÞÅÔ?',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Recd',
+ 'Record in' => 'ïÔÎÅÓÔÉ ÎÁ ÓÞÅÔ',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => '¯ród³o',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'zamówienie' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/is b/sql-ledger/locale/ru/is
new file mode 100644
index 000000000..a4a4621ad
--- /dev/null
+++ b/sql-ledger/locale/ru/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'óÞÅÔ',
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Invoice Number' => '÷Ù Õ×ÅÒÅÎÙ, ÞÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÙÊ ÓÞÅÔ?',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Nie mo¿na zksiêgowaæ faktury pozamkniêciu okresu',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Nie mo¿na zaksiêgowaæ p³atno¶ci po zamkniêciu okresu!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Credit Limit' => 'ìÉÍÉÔ ËÒÅÄÉÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'ïÐÌÁÔÉÔØ ÄÏ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'Kurs',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate for payment missing!' => 'Brakuje kursu wymiany dla p³atno¶ci!',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'In-line' => 'W³±czony',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number' => 'îÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Order' => 'Zamówienie',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Payment date missing!' => 'Brak Daty P³atno¶ci',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Phone' => 'Tel.',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Print' => 'Print',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Recd',
+ 'Record in' => 'ïÔÎÅÓÔÉ ÎÁ ÓÞÅÔ',
+ 'Remaining' => 'Pozosta³e',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => '¯ród³o',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'zamówienie' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/login b/sql-ledger/locale/ru/login
new file mode 100644
index 000000000..4ff4effbb
--- /dev/null
+++ b/sql-ledger/locale/ru/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'ï ÐÒÏÇÒÁÍÍÅ',
+ 'Accounting' => 'Accounting',
+ 'Database Host' => 'Wêze³ Bazy Danych',
+ 'Dataset' => 'Zbiór Danych',
+ 'Incorrect Dataset version!' => 'Nieprawid³owa wersja Zbioru Danych',
+ 'Incorrect Password!' => 'Nieprawid³owe Has³o',
+ 'Licensed to' => 'ìÉÃÅÎÚÉÅÊ ÏÂÌÁÄÁÅÔ:',
+ 'Login' => 'Zarejestrój siê',
+ 'Name' => 'Nazwa',
+ 'Password' => 'Has³o',
+ 'User' => 'U¿ytkownik',
+ 'Version' => '÷ÅÒÓÉÑ',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'Nie wstawiono nazwy!',
+ 'is not a member!' => 'Nie jest cz³onkiem',
+ 'localhost' => 'wêze³',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'zarejestrój_siê' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/menu b/sql-ledger/locale/ru/menu
new file mode 100644
index 000000000..af96c02d9
--- /dev/null
+++ b/sql-ledger/locale/ru/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'òÁÓÈÏÄ',
+ 'AP Aging' => 'AP Aging',
+ 'AR' => 'äÏÈÏÄ',
+ 'AR Aging' => 'AR Aging',
+ 'Accounting Menu' => 'Accounting Menu',
+ 'Add Account' => 'îÏ×ÙÊ ÓÞÅÔ',
+ 'Add Assembly' => 'îÏ×ÙÊ ËÏÍÐÌÅËÔ',
+ 'Add Customer' => 'îÏ×ÙÊ ËÌÉÅÎÔ',
+ 'Add GIFI' => 'îÏ×ÙÊ GIFI',
+ 'Add Part' => 'îÏ×ÙÊ ÐÒÏÄÕËÔ',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'îÏ×ÁÑ ÕÓÌÕÇÁ',
+ 'Add Transaction' => 'îÏ×ÁÑ ÐÒÏ×ÏÄËÁ',
+ 'Add Vendor' => 'îÏ×ÙÊ ÐÏÓÔÁ×ÝÉË',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÙ',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Backup' => 'òÅÚÅÒ×ÎÁÑ ËÏÐÉÑ',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'ðÌÁÎ ÓÞÅÔÏ×',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Ksiêga G³ówna',
+ 'Goods & Services' => 'Produkty i Us³ugi',
+ 'HTML Templates' => 'Szablony HTML',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'LaTeX Templates' => 'Szablony LaTeX',
+ 'List Accounts' => 'Spis Kont',
+ 'List GIFI' => 'Wykaz GIFI',
+ 'Logout' => 'Wyrejestrój siê',
+ 'Order Entry' => 'Wystawianie Zamówieñ',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Parts' => 'Produkty',
+ 'Payment' => 'P³atno¶æ',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Preferences' => 'Preferencje',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Sprawozdania',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save to File' => 'Zapisz w zbiorze',
+ 'Send by E-Mail' => 'Wys³ano przy u¿yciu E-Mail',
+ 'Services' => 'õÓÌÕÇÉ',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Wstaw Z³o¿enie',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÉÅ',
+ 'System' => 'óÉÓÔÅÍÁ',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Transakcje',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Vendors' => 'Vendors',
+ 'Version' => '÷ÅÒÓÉÑ',
+ 'localhost' => 'wêze³',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/oe b/sql-ledger/locale/ru/oe
new file mode 100644
index 000000000..24b26df88
--- /dev/null
+++ b/sql-ledger/locale/ru/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÙÊ',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'îÏ×ÙÊ ÚÁËÁÚ ÐÏÓÔÁ×ÝÉËÁ',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'îÏ×ÙÊ ÚÁËÁÚ ËÌÉÅÎÔÁ',
+ 'Address' => 'áÄÒÅÓ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Are you sure you want to delete Order Number' => '÷Ù Õ×ÅÒÅÎÙ, ÞÔÏ ÈÏÔÉÔÅ ÕÄÁÌÉÔØ ÄÁÎÎÙÊ ÚÁËÁÚ?',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'úÁËÒÙÔ',
+ 'Confirm!' => 'ðÏÄÔ×ÅÒÄÉÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÏÅ ÌÉÃÏ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Credit Limit' => 'ìÉÍÉÔ ËÒÅÄÉÔÁ',
+ 'Curr' => '÷ÁÌÀÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'äÁÔÁ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'îÅ ÕËÁÚÁÎ ÁÄÒÅÓ E-mail!',
+ 'Edit Purchase Order' => 'Zmiany Zamówienia Zakupu',
+ 'Edit Sales Order' => 'Zmiany Zamówienia Klienta',
+ 'Exchangerate' => 'Kurs Wymiany',
+ 'Exchangerate missing!' => 'Brakuje kursu wymiany',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'ID' => 'Identyfikator',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ÕËÁÚÁÎÁ ÄÁÔÁ ×ÙÓÔÁ×ÌÅÎÉÑ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Invoice Number missing!' => 'îÅ ÕËÁÚÁÎ ÎÏÍÅÒ ÓÞÅÔÁ-ÆÁËÔÕÒÙ',
+ 'Item not on file!' => 'Produkt nie jest w zbiorze!',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'Name' => 'Nazwa',
+ 'No.' => 'No.',
+ 'Notes' => 'Noty',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Number' => 'Numer Katalogu',
+ 'Number missing in Row' => 'Brak Numeru w Rzêdzie',
+ 'O' => 'O',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'Open' => 'Otwórz',
+ 'Order' => 'Zamówienie',
+ 'Order Date' => 'Data Zamówienia',
+ 'Order Date missing!' => 'Brak Daty Zamówienia',
+ 'Order Number' => 'Numer Zamówienia',
+ 'Order Number missing!' => 'Brak Numeru Zamówienia',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Wykaz Dostawy',
+ 'Packing List Date missing!' => 'Brak Daty Wykazu Dostawy',
+ 'Packing List Number missing!' => 'Brak Numeru Wykazu Dostawy',
+ 'Part' => 'Produkt',
+ 'Phone' => 'Tel.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Cena Netto',
+ 'Print' => 'Print',
+ 'Printer' => 'Drukarka',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Zamówienie Zakupu',
+ 'Purchase Orders' => 'Zamówienia Zakupu',
+ 'Qty' => 'Ilo¶æ',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Pozosta³e',
+ 'Required by' => 'Termin Dostawy',
+ 'Sales Order' => 'Zamówienie Klienta',
+ 'Sales Orders' => 'Zamówienia Klientów',
+ 'Save' => 'Zapisz',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Ekran',
+ 'Select from one of the items below' => 'Wybie¿ jeden z poni¿szych artyku³ów',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Service' => 'õÓÌÕÇÁ',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax Included' => 'Podatek Wliczony',
+ 'Terms: Net' => 'Warunki: Netto',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Unit' => 'Jednostka',
+ 'Update' => 'Update',
+ 'Vendor' => 'Dostawca',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Co to za rodzaj artyku³u',
+ 'Yes' => 'Tak',
+ 'days' => 'dni',
+ 'ea' => 'szt',
+ 'emailed to' => 'email do',
+ 'sent to printer' => 'wys³ano do drukarki',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'îÏ×ÙÊ' => 'add',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'óÞÅÔ_ÆÁËÔÕÒÁ' => 'invoice',
+ 'print' => 'print',
+ 'zapisz' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/pe b/sql-ledger/locale/ru/pe
new file mode 100644
index 000000000..2505a266b
--- /dev/null
+++ b/sql-ledger/locale/ru/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÙÊ',
+ 'Add Project' => 'Add Project',
+ 'All' => '÷ÓÅ',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Delete' => 'õÄÁÌÉÔØ',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Numer Katalogu',
+ 'Orphaned' => 'Zbêdny',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Zapisz',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'îÏ×ÙÊ' => 'add',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'õÄÁÌÉÔØ' => 'delete',
+ 'zapisz' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/rc b/sql-ledger/locale/ru/rc
new file mode 100644
index 000000000..a14f22a22
--- /dev/null
+++ b/sql-ledger/locale/ru/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'óÞÅÔ',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Date' => 'äÁÔÁ',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'Od',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'P³atno¶æ',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => '¯ród³o',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'do',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ru/rp b/sql-ledger/locale/ru/rp
new file mode 100644
index 000000000..acea23f41
--- /dev/null
+++ b/sql-ledger/locale/ru/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'AP Aging',
+ 'AR Aging' => 'AR Aging',
+ 'Account' => 'óÞÅÔ',
+ 'Accounts' => 'óÞÅÔÁ',
+ 'Amount' => 'óÕÍÍÁ',
+ 'Apr' => 'áÐÒ',
+ 'April' => 'áÐÒÅÌØ',
+ 'Attachment' => '÷ÌÏÖÅÎÉÅ',
+ 'Aug' => 'á×Ç',
+ 'August' => 'á×ÇÕÓÔ',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'óÒÁ×ÎÉÔØ Ó',
+ 'Continue' => 'ðÒÏÄÏÌÖÉÔØ',
+ 'Copies' => 'ëÏÐÉÊ',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Current' => 'Current',
+ 'Customer' => 'ëÌÉÅÎÔ',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÅÔ',
+ 'Dec' => 'äÅË',
+ 'December' => 'äÅËÁÂÒØ',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'ïÐÉÓÁÎÉÅ',
+ 'Due' => 'äÏ',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Luty',
+ 'February' => 'Luty',
+ 'From' => 'Od',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'òÁÚÄÅÌ',
+ 'ID' => 'Identyfikator',
+ 'In-line' => 'W³±czony',
+ 'Include in Report' => 'Do³±cz w Sprawozdaniu',
+ 'Income Statement' => 'Rachunek Zysków i Strat',
+ 'Invoice' => 'óÞÅÔ-ÆÁËÔÕÒÁ',
+ 'Jan' => 'ñÎ×',
+ 'January' => 'ñÎ×ÁÒØ',
+ 'Jul' => 'éÀÌ',
+ 'July' => 'éÀÌØ',
+ 'Jun' => 'éÀÎ',
+ 'June' => 'éÀÎØ',
+ 'Mar' => 'Marzec',
+ 'March' => 'Marzec',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Wiadomo¶æ',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Listopad',
+ 'November' => 'Listopad',
+ 'Oct' => 'Pa¿dziernik',
+ 'October' => 'Pa¿dziernik',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Rozliczenia P³atno¶ci',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Drukarka',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Raport dla',
+ 'Retained Earnings' => 'Zysk',
+ 'Screen' => 'Ekran',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'óÅÎ',
+ 'September' => 'óÅÎÔÑÂÒØ',
+ 'Source' => '¯ród³o',
+ 'Standard' => 'óÔÁÎÄÁÒÔÎÙÅ',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'éÔÏÇÏ ÐÏ ÒÁÚÄÅÌÕ',
+ 'Tax' => 'îÁÌÏÇ',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'do',
+ 'Total' => 'Warto¶æ Brutto',
+ 'Trial Balance' => 'Bilans Porównawczy',
+ 'Vendor' => 'Dostawca',
+ 'as at' => 'as at',
+ 'collected on sales' => 'zebranego przy sprzeda¿y',
+ 'for Period' => 'za Okres',
+ 'paid on purchases' => 'zap³aconego przy zakupach',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'ðÒÏÄÏÌÖÉÔØ' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/se/COPYING b/sql-ledger/locale/se/COPYING
new file mode 100644
index 000000000..5e4eee363
--- /dev/null
+++ b/sql-ledger/locale/se/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2002
+#
+# Swedish texts:
+#
+# Author: jonny@lernbo.com
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/se/LANGUAGE b/sql-ledger/locale/se/LANGUAGE
new file mode 100644
index 000000000..e3753939a
--- /dev/null
+++ b/sql-ledger/locale/se/LANGUAGE
@@ -0,0 +1 @@
+Swedish
diff --git a/sql-ledger/locale/se/admin b/sql-ledger/locale/se/admin
new file mode 100644
index 000000000..5b8e1402b
--- /dev/null
+++ b/sql-ledger/locale/se/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Accesskontroll',
+ 'Accounting' => 'Bokföring',
+ 'Add User' => 'Ny användare',
+ 'Address' => 'Adress',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administratör',
+ 'All Datasets up to date!' => 'Alla dataset uppdaterade',
+ 'Change Admin Password' => 'Ändra lösenord för admin',
+ 'Change Password' => 'Ändra lösenord',
+ 'Character Set' => 'Teckenuppsättning',
+ 'Click on login name to edit!' => 'Klicka på användarnamn för att redigera!',
+ 'Company' => 'Företag',
+ 'Connect to' => 'Anslut till',
+ 'Continue' => 'Fortsätt',
+ 'Create Chart of Accounts' => 'Skapa kontoplan',
+ 'Create Dataset' => 'Skapa dataset',
+ 'DBI not installed!' => 'DBI inte installerad',
+ 'Database' => 'Databas',
+ 'Database Administration' => 'Administration av databas',
+ 'Database Driver not checked!' => 'Databasedriver icke kontrollerad',
+ 'Database User missing!' => 'Databasanvändare saknas',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset saknas',
+ 'Dataset updated!' => 'Dataset uppdaterat',
+ 'Date Format' => 'Datumformat',
+ 'Delete' => 'Radera',
+ 'Delete Dataset' => 'Radera dataset',
+ 'Directory' => 'Katalog',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Dropdown gräns',
+ 'E-mail' => 'E-Post',
+ 'Edit User' => 'Redigera användare',
+ 'Existing Datasets' => 'Existerande Dataset',
+ 'Fax' => 'Fax',
+ 'File locked!' => 'Fil låst',
+ 'Host' => 'Värd',
+ 'Hostname missing!' => 'Värdnamn saknas',
+ 'Incorrect Password!' => 'Felaktigt lösenord',
+ 'Language' => 'Språk',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lämna värd och port fälten tomma om du inte vill göra en fjärranslutning',
+ 'Login' => 'Logga in',
+ 'Multibyte Encoding' => 'Multibytekodning',
+ 'Name' => 'Namn',
+ 'New Templates' => 'Ny mall',
+ 'No Database Drivers available!' => 'Inga databasdrivers tillgängliga',
+ 'No Dataset selected!' => 'Inget Dataset valt',
+ 'Nothing to delete!' => 'Inget att radera',
+ 'Number Format' => 'Nummerformat',
+ 'Oracle Database Administration' => 'Oracle Databasadministration',
+ 'Password' => 'Lösenord',
+ 'Password changed!' => 'Lösenord ändrat',
+ 'Pg Database Administration' => 'Administration av databas PG',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port saknas',
+ 'Printer' => 'Skrivare',
+ 'Save' => 'Spara',
+ 'Select a Dataset to delete and press "Continue"' => 'Välj en databas att radera och klicka på "Fortsätt"',
+ 'Setup Templates' => 'Sätt upp mallar',
+ 'Ship via' => 'Skicka via',
+ 'Signature' => 'Signatur',
+ 'Stylesheet' => 'Stilmall',
+ 'Templates' => 'Mallar',
+ 'The following Datasets are not in use and can be deleted' => 'Följande Dataset är inte i bruk och kan raderas',
+ 'The following Datasets need to be updated' => 'Följande Dataset behöver uppdateras',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Det här är en preliminär kontroll av existerande källor. Ingenting kommer att sparas eller raderas vid detta tillfälle',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'För att lägga till en användare till en grupp, editera namnet, ändra login namnet och spara. En ny användare med samma variabler sparas då under det nya namnet.',
+ 'Update Dataset' => 'Uppdatera dataset',
+ 'Use Templates' => 'Använd mallar',
+ 'User' => 'Användare',
+ 'User deleted!' => 'Användare raderad',
+ 'User saved!' => 'Användare sparad',
+ 'Version' => 'Version',
+ 'You must enter a host and port for local and remote connections!' => 'Du måste ange en värd och en port för att göra en fjärrsnslutning',
+ 'does not exist' => 'finns inte',
+ 'is already a member!' => 'är redan medlem!',
+ 'localhost' => 'localhost',
+ 'successfully created!' => 'skapades',
+ 'successfully deleted!' => 'raderades',
+ 'website' => 'website',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'ny_användare' => 'add_user',
+ 'Ändra_lösenord_för_admin' => 'change_admin_password',
+ 'Ändra_lösenord' => 'change_password',
+ 'fortsätt' => 'continue',
+ 'skapa_dataset' => 'create_dataset',
+ 'radera' => 'delete',
+ 'radera_dataset' => 'delete_dataset',
+ 'logga_in' => 'login',
+ 'oracle_databasadministration' => 'oracle_database_administration',
+ 'administration_av_databas_pg' => 'pg_database_administration',
+ 'spara' => 'save',
+ 'uppdatera_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/se/all b/sql-ledger/locale/se/all
new file mode 100644
index 000000000..dc1dd2d88
--- /dev/null
+++ b/sql-ledger/locale/se/all
@@ -0,0 +1,491 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Kredit',
+ 'AP Aging' => 'Kredit åldersfördeling',
+ 'AP Transaction' => 'Kredit verifikat',
+ 'AP Transactions' => 'Kredit verifikationer',
+ 'AR' => 'Debet',
+ 'AR Aging' => 'Debet åldersfördeling',
+ 'AR Transaction' => 'Debet verifikat',
+ 'AR Transactions' => 'Debet verifikationer',
+ 'About' => 'Om',
+ 'Access Control' => 'Accesskontroll',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer saknas',
+ 'Account Type' => 'Kontotyp',
+ 'Account Type missing!' => 'Kontotyp saknas!',
+ 'Account deleted!' => 'Konto raderat!',
+ 'Account saved!' => 'Konto sparat!',
+ 'Accounting' => 'Bokföring',
+ 'Accounting Menu' => 'Konto-meny',
+ 'Accounts' => 'Konton',
+ 'Active' => 'Aktiv',
+ 'Add' => 'Lägg til',
+ 'Add Account' => 'Nytt konto',
+ 'Add Accounts Payables Transaction' => 'Lägg till kreditverifikat',
+ 'Add Accounts Receivables Transaction' => 'Lägg till debetverifikat',
+ 'Add Assembly' => 'Ny sammansätting',
+ 'Add Customer' => 'Ny kund',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add General Ledger Transaction' => 'Ny post i huvudbok',
+ 'Add Part' => 'Ny vara',
+ 'Add Project' => 'Nytt projekt',
+ 'Add Purchase Invoice' => 'Ny inköpsfaktura',
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Invoice' => 'Ny säljfaktura',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Add Service' => 'Ny tjänst',
+ 'Add Transaction' => 'Ny post',
+ 'Add User' => 'Ny användare',
+ 'Add Vendor' => 'Ny leverantör',
+ 'Address' => 'Adress',
+ 'Administration' => 'Administration',
+ 'Administrator' => 'Administratör',
+ 'All' => 'Alla',
+ 'All Datasets up to date!' => 'Alla dataset uppdaterade',
+ 'Amount' => 'Belopp',
+ 'Amount Due' => 'Belopp förfallet',
+ 'Amount does not equal applied!' => 'Förfallet belopp stämmer ej med det tillagda',
+ 'Amount missing!' => 'Summa saknas',
+ 'Applied' => 'Tillagt',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Är du säker på att du vill radera Faktura Nummer',
+ 'Are you sure you want to delete Order Number' => 'Är du säker på att du vill radera Order Nummer',
+ 'Are you sure you want to delete Transaction' => 'Är du säker på att du vill radera Transaktionen',
+ 'Assemblies' => 'Sammansättningar',
+ 'Assemblies restocked!' => 'Sammansättningar åter i lager',
+ 'Assembly Number missing!' => 'Sammansättningsnummer saknas',
+ 'Asset' => 'Tillgång',
+ 'Attachment' => 'Bilaga',
+ 'Audit Control' => 'Revisionskontroll',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'BOM' => 'BOM',
+ 'Backup' => 'Säkerhetkopia',
+ 'Backup sent to' => 'Säkerhetskopia har sänts till',
+ 'Balance' => 'Balans',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'Books are open' => 'Bokföringen är öppen för rättning',
+ 'Bought' => 'Köpt',
+ 'Business Number' => 'Organisationsnummer',
+ 'C' => 'C',
+ 'COGS' => 'Inköp',
+ 'Cannot delete account!' => 'Kan inte radera konto',
+ 'Cannot delete customer!' => 'Kan inte radera kund',
+ 'Cannot delete default account!' => 'Kan inte radera standardkonto',
+ 'Cannot delete invoice!' => 'Kan inte radera faktura',
+ 'Cannot delete item already invoiced!' => 'Kan inte radera redan fakturerade varor!',
+ 'Cannot delete item on order!' => 'Kan inte radera vara i order!',
+ 'Cannot delete item which is part of an assembly!' => 'Kan inte radera vara som är del av en sammansättning!',
+ 'Cannot delete item!' => 'Kan inte radera vara',
+ 'Cannot delete order!' => 'Kan inte radera order',
+ 'Cannot delete transaction!' => 'Kan inte radera händelse',
+ 'Cannot delete vendor!' => 'Kan inte radera Leverantör',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan inte ha värde i både Debet och Kredit!',
+ 'Cannot post a transaction without a value!' => 'Kan inte lägga till en händelse utan ett värde',
+ 'Cannot post invoice for a closed period!' => 'Kan inte lägga till en faktura för en avslutad period',
+ 'Cannot post invoice!' => 'Kan inte lägga till faktura',
+ 'Cannot post payment for a closed period!' => 'Kan inte lägga till en betalning för en stängd period',
+ 'Cannot post payment!' => 'Kan inte lägga till betalning',
+ 'Cannot post transaction for a closed period!' => 'Kan inte bokföra för en stängd period',
+ 'Cannot post transaction!' => 'Kan inte lägga till händelsen',
+ 'Cannot process payment for a closed period!' => 'Kan inte processa betalning för en avslutad period',
+ 'Cannot save account!' => 'Kan inte spara konto',
+ 'Cannot save order!' => 'Kan inte spara order',
+ 'Cannot save preferences!' => 'Kan inte spara preferenser',
+ 'Cannot stock assemblies!' => 'Kan lagerföra sammansättningar',
+ 'Cash' => 'Kontant',
+ 'Cash based' => 'Kontantbaserad',
+ 'Cc' => 'Kopia',
+ 'Change Admin Password' => 'Ändra lösenord för admin',
+ 'Change Password' => 'Ändra lösenord',
+ 'Character Set' => 'Teckenuppsättning',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check utskriven',
+ 'Check printing failed!' => 'Utskrift av check misslyckades',
+ 'Cleared Balance' => 'Rensade balans',
+ 'Click on login name to edit!' => 'Klicka på användarnamn för att redigera!',
+ 'Close Books up to' => 'Avsluta bokföring fram till och med',
+ 'Closed' => 'Avslutad',
+ 'Company' => 'Företag',
+ 'Compare to' => 'Jämför med',
+ 'Confirm!' => 'Bekräfta',
+ 'Connect to' => 'Anslut till',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Copy to COA' => 'Kopiera till COA',
+ 'Create Chart of Accounts' => 'Skapa kontoplan',
+ 'Create Dataset' => 'Skapa dataset',
+ 'Credit' => 'Kredit',
+ 'Credit Limit' => 'Kreditgräns',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Current' => 'Nuvarande',
+ 'Customer' => 'Kund',
+ 'Customer deleted!' => 'Kund raderad',
+ 'Customer missing!' => 'Kund saknas',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Customer saved!' => 'Kund sparad',
+ 'Customers' => 'Kunder',
+ 'DBI not installed!' => 'DBI inte installerad',
+ 'Database' => 'Databas',
+ 'Database Administration' => 'Administration av databas',
+ 'Database Driver not checked!' => 'Databasedriver icke kontrollerad',
+ 'Database Host' => 'Databasvärd',
+ 'Database User missing!' => 'Databasanvändare saknas',
+ 'Dataset' => 'Dataset',
+ 'Dataset missing!' => 'Dataset saknas',
+ 'Dataset updated!' => 'Dataset uppdaterat',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Förfallodatum',
+ 'Date Format' => 'Datumformat',
+ 'Date Paid' => 'Betalningsdatum',
+ 'Date missing!' => 'Datum saknas',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet och kredit måste vara lika!',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Decimalplaces' => 'Decimalplaceringar',
+ 'Delete' => 'Radera',
+ 'Delete Account' => 'Radera konto',
+ 'Delete Dataset' => 'Radera dataset',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Deposit' => 'Säkerhet',
+ 'Description' => 'Beskrivning',
+ 'Difference' => 'Differens',
+ 'Directory' => 'Katalog',
+ 'Discount' => 'Rabatt',
+ 'Done' => 'Klart',
+ 'Drawing' => 'Ritning',
+ 'Driver' => 'Driver',
+ 'Dropdown Limit' => 'Dropdown gräns',
+ 'Due' => 'Förfallen',
+ 'Due Date' => 'Förfallodatum',
+ 'Due Date missing!' => 'Förfallodatum saknas',
+ 'E-mail' => 'E-Post',
+ 'E-mail Statement to' => 'E-Post anmaning till',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Edit' => 'Redigera',
+ 'Edit Account' => 'Redigera konto',
+ 'Edit Accounts Payables Transaction' => 'Redigera kreditkonton',
+ 'Edit Accounts Receivables Transaction' => 'Redigera debetkonton',
+ 'Edit Assembly' => 'Redigera sammansättning',
+ 'Edit Customer' => 'Redigera kund',
+ 'Edit GIFI' => 'Redigera GIFI',
+ 'Edit General Ledger Transaction' => 'Redigera en post i Huvudboken',
+ 'Edit Part' => 'Redigera vara',
+ 'Edit Preferences for' => 'Redigera inställningar för',
+ 'Edit Project' => 'Redigera projekt',
+ 'Edit Purchase Invoice' => 'Redigera inköpsfakturor',
+ 'Edit Purchase Order' => 'Redigera inköpsorder',
+ 'Edit Sales Invoice' => 'Redigera säljfakturor',
+ 'Edit Sales Order' => 'Redigera säljorder',
+ 'Edit Service' => 'Redigera tjänster',
+ 'Edit Template' => 'Redigera mall',
+ 'Edit User' => 'Redigera användare',
+ 'Edit Vendor' => 'Redigera Leverantör',
+ 'Employee' => 'Anställd',
+ 'Enforce transaction reversal for all dates' => 'Tvinga rättelser för alla konton',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Ange upp till 3 bokstäver (SEK:EUR:USD) för egen och utländsk valuta',
+ 'Equity' => 'Eget kapital',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate Difference' => 'Differens Växlingskurs',
+ 'Exchangerate for payment missing!' => 'Växlingskurs för saknad betalning',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Existing Datasets' => 'Existerande Dataset',
+ 'Expense' => 'Utgift',
+ 'Expense Account' => 'Utgiftskonto',
+ 'Expense/Asset' => 'Utgift/Tillgång',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'File locked!' => 'Fil låst',
+ 'Foreign Exchange Gain' => 'Vinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Förlust på valutahandel',
+ 'From' => 'Från',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI raderad',
+ 'GIFI missing!' => 'GIFI saknas',
+ 'GIFI saved!' => 'GIFI sparad',
+ 'GL Transaction' => 'GL händelse',
+ 'General Ledger' => 'Huvudbok',
+ 'Goods & Services' => 'Varor och Tjänster',
+ 'HTML Templates' => 'HTML mallar',
+ 'Heading' => 'Överskrift',
+ 'Host' => 'Värd',
+ 'Hostname missing!' => 'Värdnamn saknas',
+ 'ID' => 'ID',
+ 'Image' => 'Bild',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Include in drop-down menus' => 'Inkludera i rullgardinsmenyer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Inkludera det här kontot för kund/leverantör för att markera kund/leverantör som momspliktig',
+ 'Income' => 'Intäkt',
+ 'Income Account' => 'Intäktskonto',
+ 'Income Statement' => 'Inkomstberäkning',
+ 'Incorrect Dataset version!' => 'Felaktig databasversion',
+ 'Incorrect Password!' => 'Felaktigt lösenord',
+ 'Individual Items' => 'Individuella enheter',
+ 'Inventory' => 'Lager',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerkvantitet måste vara noll innan du kan sätta sammansättningen som utgången!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerkvantitet måste vara noll innan du kan sätta varan som utgången!',
+ 'Inventory quantity must be zero!' => 'Lagerkvantiteten måste vara noll!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadatum',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Invoice deleted!' => 'Faktura raderad',
+ 'Invoice posted!' => 'Faktura postad',
+ 'Invoices' => 'Fakturor',
+ 'Is this a summary account to record' => 'Samlingskonto för',
+ 'Item deleted!' => 'Vara raderad',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'LaTeX Templates' => 'LaTeX Mallar',
+ 'Language' => 'Språk',
+ 'Last Cost' => 'Senaste kostnad',
+ 'Last Invoice Number' => 'Senaste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Senaste nummer och standardkonto',
+ 'Last Purchase Order Number' => 'Senaste inköpsordernummer',
+ 'Last Sales Order Number' => 'Senaste säljordernummer',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Lämna värd och port fälten tomma om du inte vill göra en fjärranslutning',
+ 'Liability' => 'Ansvar',
+ 'Licensed to' => 'Licensierad till',
+ 'Line Total' => 'Antal rader',
+ 'Link' => 'Referens',
+ 'Link Accounts' => 'Koppla konton',
+ 'List Accounts' => 'Lista konton',
+ 'List GIFI' => 'Lista GIFI',
+ 'List Price' => 'Inköpspris',
+ 'List Transactions' => 'Lista transaktioner',
+ 'Login' => 'Logga in',
+ 'Logout' => 'Logga ut',
+ 'Make' => 'Skapa',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modell',
+ 'Multibyte Encoding' => 'Multibytekodning',
+ 'N/A' => 'N/A',
+ 'Name' => 'Namn',
+ 'Name missing!' => 'Namn saknas',
+ 'New Templates' => 'Ny mall',
+ 'No' => 'Rad',
+ 'No Database Drivers available!' => 'Inga databasdrivers tillgängliga',
+ 'No Dataset selected!' => 'Inget Dataset valt',
+ 'No email address for' => 'Ingen E-Postadress för',
+ 'No.' => 'Rad',
+ 'Notes' => 'Anmärkningar',
+ 'Nothing applied!' => 'Ingenting lades till',
+ 'Nothing selected!' => 'Ingenting valt',
+ 'Nothing to delete!' => 'Inget att radera',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Nummerformat',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'O' => 'O',
+ 'Obsolete' => 'Utgången',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'I lager',
+ 'On Order' => 'På order',
+ 'Open' => 'Öppen',
+ 'Oracle Database Administration' => 'Oracle Databasadministration',
+ 'Order' => 'Order',
+ 'Order Date' => 'Orderdatum',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Entry' => 'Orderingång',
+ 'Order Number' => 'Ordernummer',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'Order deleted!' => 'Order raderad',
+ 'Order saved!' => 'Order sparad',
+ 'Ordered' => 'Beställt',
+ 'Orphaned' => 'Fristående',
+ 'Out of balance!' => 'Ej i balans',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Paid' => 'Betalt',
+ 'Paid in full' => 'Slutbetalt',
+ 'Part' => 'Vara',
+ 'Part Number missing!' => 'Artikelnummer saknas',
+ 'Parts' => 'Varor',
+ 'Parts Inventory' => 'Artikellista',
+ 'Password' => 'Lösenord',
+ 'Password changed!' => 'Lösenord ändrat',
+ 'Payables' => 'Utbetalningar',
+ 'Payment' => 'Betalning',
+ 'Payment date missing!' => 'Betalningsdatum saknas',
+ 'Payment posted!' => 'Betalning postad',
+ 'Payments' => 'Betalningar',
+ 'Pg Database Administration' => 'Administration av databas PG',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port saknas',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Inställningar',
+ 'Preferences saved!' => 'Inställningar sparade',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projektnummer saknas',
+ 'Project deleted!' => 'Projekt raderat',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Project saved!' => 'Projekt sparat',
+ 'Projects' => 'Projekt',
+ 'Purchase Invoice' => 'Inköpsfaktura',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Purchase Orders' => 'Inköpsordrar',
+ 'Qty' => 'Antal',
+ 'ROP' => 'Efterbeställning vid',
+ 'Rate' => 'Rate',
+ 'Recd' => 'Mottagen',
+ 'Receipt' => 'Kvitto',
+ 'Receipts' => 'Kvitton',
+ 'Receivables' => 'Inbetalningar',
+ 'Reconciliation' => 'Bankuppgörelse',
+ 'Record in' => 'Bokför på',
+ 'Reference' => 'Referens',
+ 'Reference missing!' => 'Referens saknas',
+ 'Remaining' => 'Resterar',
+ 'Report for' => 'Rapport för',
+ 'Reports' => 'Rapporter',
+ 'Required by' => 'Beställt den',
+ 'Retained Earnings' => 'Realiserat överskott',
+ 'Sales' => 'Försäljning',
+ 'Sales Invoice' => 'Säljfaktura',
+ 'Sales Order' => 'Säljorder',
+ 'Sales Orders' => 'Säljordrar',
+ 'Save' => 'Spara',
+ 'Save as new' => 'Spara som ny',
+ 'Save to File' => 'Spara till fil',
+ 'Screen' => 'Skärm',
+ 'Select a Dataset to delete and press "Continue"' => 'Välj en databas att radera och klicka på "Fortsätt"',
+ 'Select all' => 'Välj alla',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sell Price' => 'Försäljningspris',
+ 'Send by E-Mail' => 'Skicka via E-Post',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Service Items' => 'Tjänsteartiklar',
+ 'Service Number missing!' => 'Tjänstenummer saknas',
+ 'Services' => 'Tjänster',
+ 'Setup Templates' => 'Sätt upp mallar',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Ship via' => 'Skicka via',
+ 'Short' => 'Kort',
+ 'Signature' => 'Signatur',
+ 'Sold' => 'Såld',
+ 'Source' => 'Källa',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Anmärkning',
+ 'Statement Balance' => 'Anmärkning status',
+ 'Statement sent to' => 'Anmärkning skickad till',
+ 'Statements sent to printer!' => 'Anmärkningar skickade till skrivare',
+ 'Stock Assembly' => 'Lagersammansättning',
+ 'Stylesheet' => 'Stilmall',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'System',
+ 'Tax' => 'Moms',
+ 'Tax Accounts' => 'Momskonton',
+ 'Tax Included' => 'Moms ingår',
+ 'Tax collected' => 'Moms total',
+ 'Tax paid' => 'Moms betalad',
+ 'Taxable' => 'Momspliktigt',
+ 'Template saved!' => 'Mall sparad',
+ 'Templates' => 'Mallar',
+ 'Terms: Net' => 'Netto',
+ 'The following Datasets are not in use and can be deleted' => 'Följande Dataset är inte i bruk och kan raderas',
+ 'The following Datasets need to be updated' => 'Följande Dataset behöver uppdateras',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Det här är en preliminär kontroll av existerande källor. Ingenting kommer att sparas eller raderas vid detta tillfälle',
+ 'To' => 'Till',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'För att lägga till en användare till en grupp, editera namnet, ändra login namnet och spara. En ny användare med samma variabler sparas då under det nya namnet.',
+ 'Top Level' => 'Toppnivå',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Transaktionsdatum saknas',
+ 'Transaction deleted!' => 'Transaktion raderad',
+ 'Transaction posted!' => 'Transaktion sparad',
+ 'Transaction reversal enforced for all dates' => 'Transaktion påtvingas för alla datum',
+ 'Transaction reversal enforced up to' => 'Transaktion påtvingas upp till',
+ 'Transactions' => 'Transaktioner',
+ 'Transactions exist, cannot delete customer!' => 'Transaktioner finns, kan inte radera kund',
+ 'Transactions exist, cannot delete vendor!' => 'Transaktioner finns, kan inte radera leverantör',
+ 'Transactions exist; cannot delete account!' => 'Transaktioner finns, kan inte radera konto',
+ 'Trial Balance' => 'Provbalans',
+ 'Unit' => 'Enhet',
+ 'Unit of measure' => 'Måttenhet',
+ 'Update' => 'Uppdatera',
+ 'Update Dataset' => 'Uppdatera dataset',
+ 'Updated' => 'Uppdaterad',
+ 'Use Templates' => 'Använd mallar',
+ 'User' => 'Användare',
+ 'User deleted!' => 'Användare raderad',
+ 'User saved!' => 'Användare sparad',
+ 'Vendor' => 'Leverantör',
+ 'Vendor deleted!' => 'Leverantör raderad',
+ 'Vendor missing!' => 'Leverantör saknas',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'Vendor saved!' => 'Leverantör sparad',
+ 'Vendors' => 'Leverantörer',
+ 'Version' => 'Version',
+ 'Weight' => 'Vikt',
+ 'Weight Unit' => 'Viktenhet',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'Year End' => 'Årsslut',
+ 'Yes' => 'Ja',
+ 'You are logged out!' => 'Du är utloggad',
+ 'You did not enter a name!' => 'Du skrev inte in något namn',
+ 'You must enter a host and port for local and remote connections!' => 'Du måste ange en värd och en port för att göra en fjärrsnslutning',
+ 'as at' => 'som vid',
+ 'collected on sales' => 'inbetalt på försäljning',
+ 'days' => 'dagar',
+ 'does not exist' => 'finns inte',
+ 'ea' => 'st',
+ 'emailed to' => 'E-Postat till',
+ 'for Period' => 'för perioden',
+ 'hr' => 'timme',
+ 'is already a member!' => 'är redan medlem!',
+ 'is not a member!' => 'är inte medlem!',
+ 'localhost' => 'localhost',
+ 'paid on purchases' => 'betalt vid köp',
+ 'sent to printer' => 'skickat till skrivare',
+ 'successfully created!' => 'skapades',
+ 'successfully deleted!' => 'raderades',
+ 'to' => 'till',
+ 'website' => 'website',
+};
+
+1;
diff --git a/sql-ledger/locale/se/am b/sql-ledger/locale/se/am
new file mode 100644
index 000000000..d8e084b94
--- /dev/null
+++ b/sql-ledger/locale/se/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Kredit',
+ 'AR' => 'Debet',
+ 'Account' => 'Konto',
+ 'Account Number' => 'Kontonummer',
+ 'Account Number missing!' => 'Kontonummer saknas',
+ 'Account Type' => 'Kontotyp',
+ 'Account Type missing!' => 'Kontotyp saknas!',
+ 'Account deleted!' => 'Konto raderat!',
+ 'Account saved!' => 'Konto sparat!',
+ 'Add Account' => 'Nytt konto',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Address' => 'Adress',
+ 'Asset' => 'Tillgång',
+ 'Audit Control' => 'Revisionskontroll',
+ 'Backup sent to' => 'Säkerhetskopia har sänts till',
+ 'Books are open' => 'Bokföringen är öppen för rättning',
+ 'Business Number' => 'Organisationsnummer',
+ 'COGS' => 'Inköp',
+ 'Cannot delete account!' => 'Kan inte radera konto',
+ 'Cannot delete default account!' => 'Kan inte radera standardkonto',
+ 'Cannot save account!' => 'Kan inte spara konto',
+ 'Cannot save preferences!' => 'Kan inte spara preferenser',
+ 'Character Set' => 'Teckenuppsättning',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Close Books up to' => 'Avsluta bokföring fram till och med',
+ 'Company' => 'Företag',
+ 'Continue' => 'Fortsätt',
+ 'Copy to COA' => 'Kopiera till COA',
+ 'Credit' => 'Kredit',
+ 'Date Format' => 'Datumformat',
+ 'Debit' => 'Debet',
+ 'Delete' => 'Radera',
+ 'Delete Account' => 'Radera konto',
+ 'Description' => 'Beskrivning',
+ 'Dropdown Limit' => 'Dropdown gräns',
+ 'E-mail' => 'E-Post',
+ 'Edit' => 'Redigera',
+ 'Edit Account' => 'Redigera konto',
+ 'Edit GIFI' => 'Redigera GIFI',
+ 'Edit Preferences for' => 'Redigera inställningar för',
+ 'Edit Template' => 'Redigera mall',
+ 'Enforce transaction reversal for all dates' => 'Tvinga rättelser för alla konton',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Ange upp till 3 bokstäver (SEK:EUR:USD) för egen och utländsk valuta',
+ 'Equity' => 'Eget kapital',
+ 'Expense' => 'Utgift',
+ 'Expense Account' => 'Utgiftskonto',
+ 'Expense/Asset' => 'Utgift/Tillgång',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Vinst på valutahandel',
+ 'Foreign Exchange Loss' => 'Förlust på valutahandel',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI raderad',
+ 'GIFI missing!' => 'GIFI saknas',
+ 'GIFI saved!' => 'GIFI sparad',
+ 'Heading' => 'Överskrift',
+ 'Include in drop-down menus' => 'Inkludera i rullgardinsmenyer',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Inkludera det här kontot för kund/leverantör för att markera kund/leverantör som momspliktig',
+ 'Income' => 'Intäkt',
+ 'Income Account' => 'Intäktskonto',
+ 'Inventory' => 'Lager',
+ 'Inventory Account' => 'Lagerkonto',
+ 'Is this a summary account to record' => 'Samlingskonto för',
+ 'Language' => 'Språk',
+ 'Last Invoice Number' => 'Senaste fakturanummer',
+ 'Last Numbers & Default Accounts' => 'Senaste nummer och standardkonto',
+ 'Last Purchase Order Number' => 'Senaste inköpsordernummer',
+ 'Last Sales Order Number' => 'Senaste säljordernummer',
+ 'Liability' => 'Ansvar',
+ 'Link' => 'Referens',
+ 'Name' => 'Namn',
+ 'No' => 'Rad',
+ 'No email address for' => 'Ingen E-Postadress för',
+ 'Number' => 'Nummer',
+ 'Number Format' => 'Nummerformat',
+ 'Parts Inventory' => 'Artikellista',
+ 'Password' => 'Lösenord',
+ 'Payables' => 'Utbetalningar',
+ 'Payment' => 'Betalning',
+ 'Phone' => 'Telefon',
+ 'Preferences saved!' => 'Inställningar sparade',
+ 'Rate' => 'Rate',
+ 'Receivables' => 'Inbetalningar',
+ 'Sales' => 'Försäljning',
+ 'Save' => 'Spara',
+ 'Service Items' => 'Tjänsteartiklar',
+ 'Ship via' => 'Skicka via',
+ 'Signature' => 'Signatur',
+ 'Stylesheet' => 'Stilmall',
+ 'Tax' => 'Moms',
+ 'Tax Accounts' => 'Momskonton',
+ 'Template saved!' => 'Mall sparad',
+ 'Transaction reversal enforced for all dates' => 'Transaktion påtvingas för alla datum',
+ 'Transaction reversal enforced up to' => 'Transaktion påtvingas upp till',
+ 'Transactions exist; cannot delete account!' => 'Transaktioner finns, kan inte radera konto',
+ 'Weight Unit' => 'Viktenhet',
+ 'Year End' => 'Årsslut',
+ 'Yes' => 'Ja',
+ 'does not exist' => 'finns inte',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'nytt_konto' => 'add_account',
+ 'fortsätt' => 'continue',
+ 'kopiera_till_coa' => 'copy_to_coa',
+ 'radera' => 'delete',
+ 'redigera' => 'edit',
+ 'redigera_konto' => 'edit_account',
+ 'spara' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ap b/sql-ledger/locale/se/ap
new file mode 100644
index 000000000..94021c98a
--- /dev/null
+++ b/sql-ledger/locale/se/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Kredit verifikat',
+ 'AP Transactions' => 'Kredit verifikationer',
+ 'Account' => 'Konto',
+ 'Add Accounts Payables Transaction' => 'Lägg till kreditverifikat',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Amount Due' => 'Belopp förfallet',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Är du säker på att du vill radera Transaktionen',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Cannot delete transaction!' => 'Kan inte radera händelse',
+ 'Cannot post payment for a closed period!' => 'Kan inte lägga till en betalning för en stängd period',
+ 'Cannot post transaction for a closed period!' => 'Kan inte bokföra för en stängd period',
+ 'Cannot post transaction!' => 'Kan inte lägga till händelsen',
+ 'Closed' => 'Avslutad',
+ 'Confirm!' => 'Bekräfta',
+ 'Continue' => 'Fortsätt',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Betalningsdatum',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Description' => 'Beskrivning',
+ 'Due Date' => 'Förfallodatum',
+ 'Due Date missing!' => 'Förfallodatum saknas',
+ 'Edit Accounts Payables Transaction' => 'Redigera kreditkonton',
+ 'Employee' => 'Anställd',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate for payment missing!' => 'Växlingskurs för saknad betalning',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadatum',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Öppen',
+ 'Order' => 'Order',
+ 'Order Number' => 'Ordernummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalningsdatum saknas',
+ 'Payments' => 'Betalningar',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Purchase Invoice' => 'Inköpsfaktura',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Källa',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Moms',
+ 'Tax Included' => 'Moms ingår',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaktion raderad',
+ 'Transaction posted!' => 'Transaktion sparad',
+ 'Update' => 'Uppdatera',
+ 'Vendor' => 'Leverantör',
+ 'Vendor missing!' => 'Leverantör saknas',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'kredit_verifikat' => 'ap_transaction',
+ 'lägg_till_kreditverifikat' => 'add_accounts_payables_transaction',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'redigera_kreditkonton' => 'edit_accounts_payables_transaction',
+ 'lägg_till' => 'post',
+ 'lägg_till_som_ny' => 'post_as_new',
+ 'inköpsfaktura' => 'purchase_invoice',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ar b/sql-ledger/locale/se/ar
new file mode 100644
index 000000000..c72f7cf9d
--- /dev/null
+++ b/sql-ledger/locale/se/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Debet verifikat',
+ 'AR Transactions' => 'Debet verifikationer',
+ 'Account' => 'Konto',
+ 'Add Accounts Receivables Transaction' => 'Lägg till debetverifikat',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Amount Due' => 'Belopp förfallet',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Är du säker på att du vill radera Transaktionen',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Cannot delete transaction!' => 'Kan inte radera händelse',
+ 'Cannot post payment for a closed period!' => 'Kan inte lägga till en betalning för en stängd period',
+ 'Cannot post transaction for a closed period!' => 'Kan inte bokföra för en stängd period',
+ 'Cannot post transaction!' => 'Kan inte lägga till händelsen',
+ 'Closed' => 'Avslutad',
+ 'Confirm!' => 'Bekräfta',
+ 'Continue' => 'Fortsätt',
+ 'Credit Limit' => 'Kreditgräns',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kund',
+ 'Customer missing!' => 'Kund saknas',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Date Paid' => 'Betalningsdatum',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Description' => 'Beskrivning',
+ 'Due Date' => 'Förfallodatum',
+ 'Due Date missing!' => 'Förfallodatum saknas',
+ 'Edit Accounts Receivables Transaction' => 'Redigera debetkonton',
+ 'Employee' => 'Anställd',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate for payment missing!' => 'Växlingskurs för saknad betalning',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadatum',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Öppen',
+ 'Order' => 'Order',
+ 'Order Number' => 'Ordernummer',
+ 'Paid' => 'Betalt',
+ 'Payment date missing!' => 'Betalningsdatum saknas',
+ 'Payments' => 'Betalningar',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Remaining' => 'Resterar',
+ 'Sales Invoice' => 'Säljfaktura',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Källa',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Moms',
+ 'Tax Included' => 'Moms ingår',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transaktion raderad',
+ 'Transaction posted!' => 'Transaktion sparad',
+ 'Update' => 'Uppdatera',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'debet_verifikat' => 'ar_transaction',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'lägg_till' => 'post',
+ 'lägg_till_som_ny' => 'post_as_new',
+ 'säljfaktura' => 'sales_invoice',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/arap b/sql-ledger/locale/se/arap
new file mode 100644
index 000000000..51fa73abd
--- /dev/null
+++ b/sql-ledger/locale/se/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adress',
+ 'Continue' => 'Fortsätt',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Description' => 'Beskrivning',
+ 'Number' => 'Nummer',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'fortsätt' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ca b/sql-ledger/locale/se/ca
new file mode 100644
index 000000000..d186a629e
--- /dev/null
+++ b/sql-ledger/locale/se/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Balance' => 'Balans',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Credit' => 'Kredit',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Description' => 'Beskrivning',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'List Transactions' => 'Lista transaktioner',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Reference' => 'Referens',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Till',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'lista_transaktioner' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/se/cp b/sql-ledger/locale/se/cp
new file mode 100644
index 000000000..c6b1f472e
--- /dev/null
+++ b/sql-ledger/locale/se/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Amount does not equal applied!' => 'Förfallet belopp stämmer ej med det tillagda',
+ 'Amount missing!' => 'Summa saknas',
+ 'Applied' => 'Tillagt',
+ 'Cannot post payment!' => 'Kan inte lägga till betalning',
+ 'Cannot process payment for a closed period!' => 'Kan inte processa betalning för en avslutad period',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check utskriven',
+ 'Check printing failed!' => 'Utskrift av check misslyckades',
+ 'Continue' => 'Fortsätt',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kund',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Date missing!' => 'Datum saknas',
+ 'Description' => 'Beskrivning',
+ 'Due' => 'Förfallen',
+ 'Exchangerate' => 'Växlingskurs',
+ 'From' => 'Från',
+ 'Invoice' => 'Faktura',
+ 'Invoices' => 'Fakturor',
+ 'Nothing applied!' => 'Ingenting lades till',
+ 'Number' => 'Nummer',
+ 'Paid in full' => 'Slutbetalt',
+ 'Payment' => 'Betalning',
+ 'Payment posted!' => 'Betalning postad',
+ 'Post' => 'Lägg till',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Skrivare',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Receipt' => 'Kvitto',
+ 'Reference' => 'Referens',
+ 'Screen' => 'Skärm',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'To' => 'Till',
+ 'Update' => 'Uppdatera',
+ 'Vendor' => 'Leverantör',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'fortsätt' => 'continue',
+ 'lägg_till' => 'post',
+ 'skriv_ut' => 'print',
+ 'uppdatera' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ct b/sql-ledger/locale/se/ct
new file mode 100644
index 000000000..16d6b6446
--- /dev/null
+++ b/sql-ledger/locale/se/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Lägg til',
+ 'Address' => 'Adress',
+ 'All' => 'Alla',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Kan inte radera kund',
+ 'Cannot delete vendor!' => 'Kan inte radera Leverantör',
+ 'Cc' => 'Kopia',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Credit Limit' => 'Kreditgräns',
+ 'Customer deleted!' => 'Kund raderad',
+ 'Customer saved!' => 'Kund sparad',
+ 'Customers' => 'Kunder',
+ 'Delete' => 'Radera',
+ 'Discount' => 'Rabatt',
+ 'E-mail' => 'E-Post',
+ 'Edit Customer' => 'Redigera kund',
+ 'Edit Vendor' => 'Redigera Leverantör',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Invoice' => 'Faktura',
+ 'Name' => 'Namn',
+ 'Name missing!' => 'Namn saknas',
+ 'Notes' => 'Anmärkningar',
+ 'Number' => 'Nummer',
+ 'Order' => 'Order',
+ 'Orphaned' => 'Fristående',
+ 'Phone' => 'Telefon',
+ 'Save' => 'Spara',
+ 'Ship to' => 'Skicka till',
+ 'Tax Included' => 'Moms ingår',
+ 'Taxable' => 'Momspliktigt',
+ 'Terms: Net' => 'Netto',
+ 'Transactions exist, cannot delete customer!' => 'Transaktioner finns, kan inte radera kund',
+ 'Transactions exist, cannot delete vendor!' => 'Transaktioner finns, kan inte radera leverantör',
+ 'Vendor deleted!' => 'Leverantör raderad',
+ 'Vendor saved!' => 'Leverantör sparad',
+ 'Vendors' => 'Leverantörer',
+ 'days' => 'dagar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'lägg_til' => 'add',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'faktura' => 'invoice',
+ 'order' => 'order',
+ 'spara' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/se/gl b/sql-ledger/locale/se/gl
new file mode 100644
index 000000000..314839f3b
--- /dev/null
+++ b/sql-ledger/locale/se/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Kredit verifikat',
+ 'AR Transaction' => 'Debet verifikat',
+ 'Account' => 'Konto',
+ 'Add General Ledger Transaction' => 'Ny post i huvudbok',
+ 'Address' => 'Adress',
+ 'All' => 'Alla',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Transaction' => 'Är du säker på att du vill radera Transaktionen',
+ 'Asset' => 'Tillgång',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Balance' => 'Balans',
+ 'Cannot delete transaction!' => 'Kan inte radera händelse',
+ 'Cannot have a value in both Debit and Credit!' => 'Kan inte ha värde i både Debet och Kredit!',
+ 'Cannot post a transaction without a value!' => 'Kan inte lägga till en händelse utan ett värde',
+ 'Cannot post transaction for a closed period!' => 'Kan inte bokföra för en stängd period',
+ 'Confirm!' => 'Bekräfta',
+ 'Continue' => 'Fortsätt',
+ 'Credit' => 'Kredit',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Debit and credit out of balance!' => 'Debet och kredit måste vara lika!',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Description' => 'Beskrivning',
+ 'Edit General Ledger Transaction' => 'Redigera en post i Huvudboken',
+ 'Equity' => 'Eget kapital',
+ 'Expense' => 'Utgift',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL händelse',
+ 'General Ledger' => 'Huvudbok',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Income' => 'Intäkt',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Liability' => 'Ansvar',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Purchase Invoice' => 'Inköpsfaktura',
+ 'Reference' => 'Referens',
+ 'Reference missing!' => 'Referens saknas',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Säljfaktura',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Källa',
+ 'Subtotal' => 'Subtotal',
+ 'To' => 'Till',
+ 'Transaction Date missing!' => 'Transaktionsdatum saknas',
+ 'Transaction deleted!' => 'Transaktion raderad',
+ 'Transaction posted!' => 'Transaktion sparad',
+ 'Update' => 'Uppdatera',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'Yes' => 'Ja',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'kredit_verifikat' => 'ap_transaction',
+ 'debet_verifikat' => 'ar_transaction',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'gl_händelse' => 'gl_transaction',
+ 'lägg_till' => 'post',
+ 'lägg_till_som_ny' => 'post_as_new',
+ 'inköpsfaktura' => 'purchase_invoice',
+ 'säljfaktura' => 'sales_invoice',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ic b/sql-ledger/locale/se/ic
new file mode 100644
index 000000000..176b68b05
--- /dev/null
+++ b/sql-ledger/locale/se/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Aktiv',
+ 'Add' => 'Lägg til',
+ 'Add Assembly' => 'Ny sammansätting',
+ 'Add Part' => 'Ny vara',
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Add Service' => 'Ny tjänst',
+ 'Address' => 'Adress',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Assemblies' => 'Sammansättningar',
+ 'Assemblies restocked!' => 'Sammansättningar åter i lager',
+ 'Assembly Number missing!' => 'Sammansättningsnummer saknas',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'Bought' => 'Köpt',
+ 'COGS' => 'Inköp',
+ 'Cannot delete item already invoiced!' => 'Kan inte radera redan fakturerade varor!',
+ 'Cannot delete item on order!' => 'Kan inte radera vara i order!',
+ 'Cannot delete item which is part of an assembly!' => 'Kan inte radera vara som är del av en sammansättning!',
+ 'Cannot delete item!' => 'Kan inte radera vara',
+ 'Cannot stock assemblies!' => 'Kan lagerföra sammansättningar',
+ 'Cc' => 'Kopia',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Description' => 'Beskrivning',
+ 'Drawing' => 'Ritning',
+ 'E-mail' => 'E-Post',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Edit Assembly' => 'Redigera sammansättning',
+ 'Edit Part' => 'Redigera vara',
+ 'Edit Service' => 'Redigera tjänster',
+ 'Expense' => 'Utgift',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'Image' => 'Bild',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Income' => 'Intäkt',
+ 'Individual Items' => 'Individuella enheter',
+ 'Inventory' => 'Lager',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Lagerkvantitet måste vara noll innan du kan sätta sammansättningen som utgången!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Lagerkvantitet måste vara noll innan du kan sätta varan som utgången!',
+ 'Inventory quantity must be zero!' => 'Lagerkvantiteten måste vara noll!',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Item deleted!' => 'Vara raderad',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Last Cost' => 'Senaste kostnad',
+ 'Line Total' => 'Antal rader',
+ 'Link Accounts' => 'Koppla konton',
+ 'List Price' => 'Inköpspris',
+ 'Make' => 'Skapa',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Modell',
+ 'Name' => 'Namn',
+ 'No.' => 'Rad',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'Obsolete' => 'Utgången',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'On Hand' => 'I lager',
+ 'On Order' => 'På order',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Number' => 'Ordernummer',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'Ordered' => 'Beställt',
+ 'Orphaned' => 'Fristående',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Part' => 'Vara',
+ 'Part Number missing!' => 'Artikelnummer saknas',
+ 'Parts' => 'Varor',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Qty' => 'Antal',
+ 'ROP' => 'Efterbeställning vid',
+ 'Recd' => 'Mottagen',
+ 'Required by' => 'Beställt den',
+ 'Sales' => 'Försäljning',
+ 'Sales Order' => 'Säljorder',
+ 'Save' => 'Spara',
+ 'Screen' => 'Skärm',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sell Price' => 'Försäljningspris',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Service Number missing!' => 'Tjänstenummer saknas',
+ 'Services' => 'Tjänster',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Short' => 'Kort',
+ 'Sold' => 'Såld',
+ 'Stock Assembly' => 'Lagersammansättning',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Moms',
+ 'To' => 'Till',
+ 'Top Level' => 'Toppnivå',
+ 'Total' => 'Total',
+ 'Unit' => 'Enhet',
+ 'Unit of measure' => 'Måttenhet',
+ 'Update' => 'Uppdatera',
+ 'Updated' => 'Uppdaterad',
+ 'Weight' => 'Vikt',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'ea' => 'st',
+ 'emailed to' => 'E-Postat till',
+ 'hr' => 'timme',
+ 'sent to printer' => 'skickat till skrivare',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'lägg_til' => 'add',
+ 'ny_sammansätting' => 'add_assembly',
+ 'ny_vara' => 'add_part',
+ 'ny_tjänst' => 'add_service',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'redigera_sammansättning' => 'edit_assembly',
+ 'redigera_vara' => 'edit_part',
+ 'redigera_tjänster' => 'edit_service',
+ 'spara' => 'save',
+ 'uppdatera' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/se/io b/sql-ledger/locale/se/io
new file mode 100644
index 000000000..68418c35b
--- /dev/null
+++ b/sql-ledger/locale/se/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Address' => 'Adress',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'Cc' => 'Kopia',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Description' => 'Beskrivning',
+ 'E-mail' => 'E-Post',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Name' => 'Namn',
+ 'No.' => 'Rad',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Part' => 'Vara',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Mottagen',
+ 'Required by' => 'Beställt den',
+ 'Sales Order' => 'Säljorder',
+ 'Screen' => 'Skärm',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Subject' => 'Ämne',
+ 'To' => 'Till',
+ 'Unit' => 'Enhet',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'emailed to' => 'E-Postat till',
+ 'sent to printer' => 'skickat till skrivare',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'fortsätt' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/se/ir b/sql-ledger/locale/se/ir
new file mode 100644
index 000000000..113fa9c78
--- /dev/null
+++ b/sql-ledger/locale/se/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Invoice' => 'Ny inköpsfaktura',
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Är du säker på att du vill radera Faktura Nummer',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'Cannot delete invoice!' => 'Kan inte radera faktura',
+ 'Cannot post invoice for a closed period!' => 'Kan inte lägga till en faktura för en avslutad period',
+ 'Cannot post invoice!' => 'Kan inte lägga till faktura',
+ 'Cannot post payment for a closed period!' => 'Kan inte lägga till en betalning för en stängd period',
+ 'Cc' => 'Kopia',
+ 'Confirm!' => 'Bekräfta',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Currency' => 'Valuta',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Förfallodatum',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Description' => 'Beskrivning',
+ 'E-mail' => 'E-Post',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Edit Purchase Invoice' => 'Redigera inköpsfakturor',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate for payment missing!' => 'Växlingskurs för saknad betalning',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadatum',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Invoice deleted!' => 'Faktura raderad',
+ 'Invoice posted!' => 'Faktura postad',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Name' => 'Namn',
+ 'No.' => 'Rad',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Number' => 'Ordernummer',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Part' => 'Vara',
+ 'Payment date missing!' => 'Betalningsdatum saknas',
+ 'Payments' => 'Betalningar',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Mottagen',
+ 'Record in' => 'Bokför på',
+ 'Required by' => 'Beställt den',
+ 'Sales Order' => 'Säljorder',
+ 'Screen' => 'Skärm',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Source' => 'Källa',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Moms ingår',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Uppdatera',
+ 'Vendor' => 'Leverantör',
+ 'Vendor missing!' => 'Leverantör saknas',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'Yes' => 'Ja',
+ 'ea' => 'st',
+ 'emailed to' => 'E-Postat till',
+ 'sent to printer' => 'skickat till skrivare',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'order' => 'order',
+ 'lägg_till' => 'post',
+ 'lägg_till_som_ny' => 'post_as_new',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/is b/sql-ledger/locale/se/is
new file mode 100644
index 000000000..92f640ad4
--- /dev/null
+++ b/sql-ledger/locale/se/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Invoice' => 'Ny säljfaktura',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Invoice Number' => 'Är du säker på att du vill radera Faktura Nummer',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'Cannot delete invoice!' => 'Kan inte radera faktura',
+ 'Cannot post invoice for a closed period!' => 'Kan inte lägga till en faktura för en avslutad period',
+ 'Cannot post invoice!' => 'Kan inte lägga till faktura',
+ 'Cannot post payment for a closed period!' => 'Kan inte lägga till en betalning för en stängd period',
+ 'Cc' => 'Kopia',
+ 'Confirm!' => 'Bekräfta',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Credit Limit' => 'Kreditgräns',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kund',
+ 'Customer missing!' => 'Kund saknas',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Date Due' => 'Förfallodatum',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Description' => 'Beskrivning',
+ 'E-mail' => 'E-Post',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Edit Sales Invoice' => 'Redigera säljfakturor',
+ 'Exch' => 'Vxl',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate for payment missing!' => 'Växlingskurs för saknad betalning',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date' => 'Fakturadatum',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number' => 'Fakturanummer',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Invoice deleted!' => 'Faktura raderad',
+ 'Invoice posted!' => 'Faktura postad',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Name' => 'Namn',
+ 'No.' => 'Rad',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Order' => 'Order',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Number' => 'Ordernummer',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Part' => 'Vara',
+ 'Payment date missing!' => 'Betalningsdatum saknas',
+ 'Payments' => 'Betalningar',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Lägg till',
+ 'Post as new' => 'Lägg till som ny',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Mottagen',
+ 'Record in' => 'Bokför på',
+ 'Remaining' => 'Resterar',
+ 'Required by' => 'Beställt den',
+ 'Sales Order' => 'Säljorder',
+ 'Screen' => 'Skärm',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Ship via' => 'Skicka via',
+ 'Source' => 'Källa',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Moms ingår',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Uppdatera',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'Yes' => 'Ja',
+ 'ea' => 'st',
+ 'emailed to' => 'E-Postat till',
+ 'sent to printer' => 'skickat till skrivare',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'e_post' => 'e_mail',
+ 'order' => 'order',
+ 'lägg_till' => 'post',
+ 'lägg_till_som_ny' => 'post_as_new',
+ 'skriv_ut' => 'print',
+ 'skicka_till' => 'ship_to',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/login b/sql-ledger/locale/se/login
new file mode 100644
index 000000000..2fe34aa80
--- /dev/null
+++ b/sql-ledger/locale/se/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Om',
+ 'Database Host' => 'Databasvärd',
+ 'Dataset' => 'Dataset',
+ 'Incorrect Dataset version!' => 'Felaktig databasversion',
+ 'Incorrect Password!' => 'Felaktigt lösenord',
+ 'Licensed to' => 'Licensierad till',
+ 'Login' => 'Logga in',
+ 'Name' => 'Namn',
+ 'Password' => 'Lösenord',
+ 'User' => 'Användare',
+ 'Version' => 'Version',
+ 'You are logged out!' => 'Du är utloggad',
+ 'You did not enter a name!' => 'Du skrev inte in något namn',
+ 'is not a member!' => 'är inte medlem!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'logga_in' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/se/menu b/sql-ledger/locale/se/menu
new file mode 100644
index 000000000..2e7ae3439
--- /dev/null
+++ b/sql-ledger/locale/se/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'Kredit',
+ 'AP Aging' => 'Kredit åldersfördeling',
+ 'AR' => 'Debet',
+ 'AR Aging' => 'Debet åldersfördeling',
+ 'Accounting Menu' => 'Konto-meny',
+ 'Add Account' => 'Nytt konto',
+ 'Add Assembly' => 'Ny sammansätting',
+ 'Add Customer' => 'Ny kund',
+ 'Add GIFI' => 'Ny GIFI',
+ 'Add Part' => 'Ny vara',
+ 'Add Project' => 'Nytt projekt',
+ 'Add Service' => 'Ny tjänst',
+ 'Add Transaction' => 'Ny post',
+ 'Add Vendor' => 'Ny leverantör',
+ 'Assemblies' => 'Sammansättningar',
+ 'Audit Control' => 'Revisionskontroll',
+ 'Backup' => 'Säkerhetkopia',
+ 'Balance Sheet' => 'Status',
+ 'Cash' => 'Kontant',
+ 'Chart of Accounts' => 'Kontoplan',
+ 'Check' => 'Check',
+ 'Customers' => 'Kunder',
+ 'General Ledger' => 'Huvudbok',
+ 'Goods & Services' => 'Varor och Tjänster',
+ 'HTML Templates' => 'HTML mallar',
+ 'Income Statement' => 'Inkomstberäkning',
+ 'Invoice' => 'Faktura',
+ 'LaTeX Templates' => 'LaTeX Mallar',
+ 'List Accounts' => 'Lista konton',
+ 'List GIFI' => 'Lista GIFI',
+ 'Logout' => 'Logga ut',
+ 'Order Entry' => 'Orderingång',
+ 'Packing List' => 'Packsedel',
+ 'Parts' => 'Varor',
+ 'Payment' => 'Betalning',
+ 'Payments' => 'Betalningar',
+ 'Preferences' => 'Inställningar',
+ 'Projects' => 'Projekt',
+ 'Purchase Invoice' => 'Inköpsfaktura',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Purchase Orders' => 'Inköpsordrar',
+ 'Receipt' => 'Kvitto',
+ 'Receipts' => 'Kvitton',
+ 'Reconciliation' => 'Bankuppgörelse',
+ 'Reports' => 'Rapporter',
+ 'Sales Invoice' => 'Säljfaktura',
+ 'Sales Order' => 'Säljorder',
+ 'Sales Orders' => 'Säljordrar',
+ 'Save to File' => 'Spara till fil',
+ 'Send by E-Mail' => 'Skicka via E-Post',
+ 'Services' => 'Tjänster',
+ 'Statement' => 'Anmärkning',
+ 'Stock Assembly' => 'Lagersammansättning',
+ 'Stylesheet' => 'Stilmall',
+ 'System' => 'System',
+ 'Tax collected' => 'Moms total',
+ 'Tax paid' => 'Moms betalad',
+ 'Transactions' => 'Transaktioner',
+ 'Trial Balance' => 'Provbalans',
+ 'Vendors' => 'Leverantörer',
+ 'Version' => 'Version',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/se/oe b/sql-ledger/locale/se/oe
new file mode 100644
index 000000000..2a62a153a
--- /dev/null
+++ b/sql-ledger/locale/se/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Lägg til',
+ 'Add Purchase Invoice' => 'Ny inköpsfaktura',
+ 'Add Purchase Order' => 'Ny inköpsorder',
+ 'Add Sales Invoice' => 'Ny säljfaktura',
+ 'Add Sales Order' => 'Ny säljorder',
+ 'Address' => 'Adress',
+ 'Amount' => 'Belopp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Are you sure you want to delete Order Number' => 'Är du säker på att du vill radera Order Nummer',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Antal i lager',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Kan inte radera order',
+ 'Cannot save order!' => 'Kan inte spara order',
+ 'Cc' => 'Kopia',
+ 'Closed' => 'Avslutad',
+ 'Confirm!' => 'Bekräfta',
+ 'Contact' => 'Kontakt',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Credit Limit' => 'Kreditgräns',
+ 'Curr' => 'Val',
+ 'Currency' => 'Valuta',
+ 'Customer' => 'Kund',
+ 'Customer missing!' => 'Kund saknas',
+ 'Customer not on file!' => 'Kund finns ej',
+ 'Date' => 'Datum',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Delete' => 'Radera',
+ 'Delivery Date' => 'Leveransdatum',
+ 'Description' => 'Beskrivning',
+ 'E-mail' => 'E-Post',
+ 'E-mail address missing!' => 'E-Postadress saknas',
+ 'Edit Purchase Order' => 'Redigera inköpsorder',
+ 'Edit Sales Order' => 'Redigera säljorder',
+ 'Exchangerate' => 'Växlingskurs',
+ 'Exchangerate missing!' => 'Växelkurs saknas',
+ 'Extended' => 'Utökad',
+ 'Fax' => 'Fax',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Invoice' => 'Faktura',
+ 'Invoice Date missing!' => 'Fakturadatum saknas',
+ 'Invoice Number missing!' => 'Fakturanummer saknas',
+ 'Item not on file!' => 'Varan finns inte i databasen',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'Name' => 'Namn',
+ 'No.' => 'Rad',
+ 'Notes' => 'Anmärkningar',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Number' => 'Nummer',
+ 'Number missing in Row' => 'Nummer saknas i rad',
+ 'O' => 'O',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'Open' => 'Öppen',
+ 'Order' => 'Order',
+ 'Order Date' => 'Orderdatum',
+ 'Order Date missing!' => 'Orderdatum saknas',
+ 'Order Number' => 'Ordernummer',
+ 'Order Number missing!' => 'Ordernummer saknas',
+ 'Order deleted!' => 'Order raderad',
+ 'Order saved!' => 'Order sparad',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Packsedel',
+ 'Packing List Date missing!' => 'Packsedelsdatum saknas',
+ 'Packing List Number missing!' => 'Packsedelsnummer saknas',
+ 'Part' => 'Vara',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Pris',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Skrivare',
+ 'Project' => 'Projekt',
+ 'Project not on file!' => 'Projekt finns ej',
+ 'Purchase Order' => 'Inköpsorder',
+ 'Purchase Orders' => 'Inköpsordrar',
+ 'Qty' => 'Antal',
+ 'Recd' => 'Mottagen',
+ 'Remaining' => 'Resterar',
+ 'Required by' => 'Beställt den',
+ 'Sales Order' => 'Säljorder',
+ 'Sales Orders' => 'Säljordrar',
+ 'Save' => 'Spara',
+ 'Save as new' => 'Spara som ny',
+ 'Screen' => 'Skärm',
+ 'Select from one of the items below' => 'Välj en artikel nedan',
+ 'Select from one of the names below' => 'Välj ett av namnen nedan',
+ 'Select from one of the projects below' => 'Välj ett av projekten nedan',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Service' => 'Tjänster',
+ 'Ship' => 'Skicka',
+ 'Ship to' => 'Skicka till',
+ 'Ship via' => 'Skicka via',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Moms',
+ 'Tax Included' => 'Moms ingår',
+ 'Terms: Net' => 'Netto',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Unit' => 'Enhet',
+ 'Update' => 'Uppdatera',
+ 'Vendor' => 'Leverantör',
+ 'Vendor missing!' => 'Leverantör saknas',
+ 'Vendor not on file!' => 'Leverantör finns ej',
+ 'What type of item is this?' => 'Vilken typ av artikel är detta?',
+ 'Yes' => 'Ja',
+ 'days' => 'dagar',
+ 'ea' => 'st',
+ 'emailed to' => 'E-Postat till',
+ 'sent to printer' => 'skickat till skrivare',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'lägg_til' => 'add',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'e_post' => 'e_mail',
+ 'faktura' => 'invoice',
+ 'skriv_ut' => 'print',
+ 'spara' => 'save',
+ 'spara_som_ny' => 'save_as_new',
+ 'skicka_till' => 'ship_to',
+ 'uppdatera' => 'update',
+ 'ja' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/se/pe b/sql-ledger/locale/se/pe
new file mode 100644
index 000000000..c8d5b425f
--- /dev/null
+++ b/sql-ledger/locale/se/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Lägg til',
+ 'Add Project' => 'Nytt projekt',
+ 'All' => 'Alla',
+ 'Continue' => 'Fortsätt',
+ 'Delete' => 'Radera',
+ 'Description' => 'Beskrivning',
+ 'Edit Project' => 'Redigera projekt',
+ 'Number' => 'Nummer',
+ 'Orphaned' => 'Fristående',
+ 'Project' => 'Projekt',
+ 'Project Number missing!' => 'Projektnummer saknas',
+ 'Project deleted!' => 'Projekt raderat',
+ 'Project saved!' => 'Projekt sparat',
+ 'Projects' => 'Projekt',
+ 'Save' => 'Spara',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'lägg_til' => 'add',
+ 'fortsätt' => 'continue',
+ 'radera' => 'delete',
+ 'spara' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/se/rc b/sql-ledger/locale/se/rc
new file mode 100644
index 000000000..84df25d00
--- /dev/null
+++ b/sql-ledger/locale/se/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Konto',
+ 'Balance' => 'Balans',
+ 'Cleared Balance' => 'Rensade balans',
+ 'Continue' => 'Fortsätt',
+ 'Date' => 'Datum',
+ 'Deposit' => 'Säkerhet',
+ 'Description' => 'Beskrivning',
+ 'Difference' => 'Differens',
+ 'Done' => 'Klart',
+ 'Exchangerate Difference' => 'Differens Växlingskurs',
+ 'From' => 'Från',
+ 'Out of balance!' => 'Ej i balans',
+ 'Payment' => 'Betalning',
+ 'Reconciliation' => 'Bankuppgörelse',
+ 'Select all' => 'Välj alla',
+ 'Source' => 'Källa',
+ 'Statement Balance' => 'Anmärkning status',
+ 'To' => 'Till',
+ 'Update' => 'Uppdatera',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'fortsätt' => 'continue',
+ 'klart' => 'done',
+ 'välj_alla' => 'select_all',
+ 'uppdatera' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/se/rp b/sql-ledger/locale/se/rp
new file mode 100644
index 000000000..da93e1b5f
--- /dev/null
+++ b/sql-ledger/locale/se/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Kredit åldersfördeling',
+ 'AR Aging' => 'Debet åldersfördeling',
+ 'Account' => 'Konto',
+ 'Accounts' => 'Konton',
+ 'Amount' => 'Belopp',
+ 'Apr' => 'apr',
+ 'April' => 'april',
+ 'Attachment' => 'Bilaga',
+ 'Aug' => 'aug',
+ 'August' => 'augusti',
+ 'Balance Sheet' => 'Status',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Kontantbaserad',
+ 'Cc' => 'Kopia',
+ 'Compare to' => 'Jämför med',
+ 'Continue' => 'Fortsätt',
+ 'Copies' => 'Kopior',
+ 'Credit' => 'Kredit',
+ 'Current' => 'Nuvarande',
+ 'Customer' => 'Kund',
+ 'Date' => 'Datum',
+ 'Debit' => 'Debet',
+ 'Dec' => 'dec',
+ 'December' => 'december',
+ 'Decimalplaces' => 'Decimalplaceringar',
+ 'Description' => 'Beskrivning',
+ 'Due' => 'Förfallen',
+ 'E-mail' => 'E-Post',
+ 'E-mail Statement to' => 'E-Post anmaning till',
+ 'Feb' => 'Feb',
+ 'February' => 'Februari',
+ 'From' => 'Från',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Överskrift',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Inkludera i rapport',
+ 'Income Statement' => 'Inkomstberäkning',
+ 'Invoice' => 'Faktura',
+ 'Jan' => 'Jan',
+ 'January' => 'Januari',
+ 'Jul' => 'Jul',
+ 'July' => 'Juli',
+ 'Jun' => 'Jun',
+ 'June' => 'Juni',
+ 'Mar' => 'Mar',
+ 'March' => 'Mars',
+ 'May' => 'Maj',
+ 'May ' => 'Maj',
+ 'Message' => 'Meddelande',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Ingenting valt',
+ 'Nov' => 'Nov',
+ 'November' => 'November',
+ 'Oct' => 'Okt',
+ 'October' => 'Oktober',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Betalningar',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Skriv ut',
+ 'Printer' => 'Skrivare',
+ 'Receipts' => 'Kvitton',
+ 'Report for' => 'Rapport för',
+ 'Retained Earnings' => 'Realiserat överskott',
+ 'Screen' => 'Skärm',
+ 'Select all' => 'Välj alla',
+ 'Select postscript or PDF!' => 'Välj Postscript eller PDF',
+ 'Sep' => 'Sep',
+ 'September' => 'September',
+ 'Source' => 'Källa',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Anmärkning',
+ 'Statement sent to' => 'Anmärkning skickad till',
+ 'Statements sent to printer!' => 'Anmärkningar skickade till skrivare',
+ 'Subject' => 'Ämne',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'Moms',
+ 'Tax collected' => 'Moms total',
+ 'Tax paid' => 'Moms betalad',
+ 'To' => 'Till',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Provbalans',
+ 'Vendor' => 'Leverantör',
+ 'as at' => 'som vid',
+ 'collected on sales' => 'inbetalt på försäljning',
+ 'for Period' => 'för perioden',
+ 'paid on purchases' => 'betalt vid köp',
+ 'to' => 'till',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'fortsätt' => 'continue',
+ 'e_post' => 'e_mail',
+ 'skriv_ut' => 'print',
+ 'välj_alla' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/COPYING b/sql-ledger/locale/tr/COPYING
new file mode 100644
index 000000000..523dffa68
--- /dev/null
+++ b/sql-ledger/locale/tr/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Turkish texts:
+#
+# Author: Mufit Eribol <meribol@deltagrup.com.tr>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/tr/LANGUAGE b/sql-ledger/locale/tr/LANGUAGE
new file mode 100644
index 000000000..d7b2f1fb5
--- /dev/null
+++ b/sql-ledger/locale/tr/LANGUAGE
@@ -0,0 +1 @@
+Turkish
diff --git a/sql-ledger/locale/tr/admin b/sql-ledger/locale/tr/admin
new file mode 100644
index 000000000..5d0b0fd3a
--- /dev/null
+++ b/sql-ledger/locale/tr/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Giriþ Kontrol',
+ 'Accounting' => 'Muhasebe',
+ 'Add User' => 'Kullanýcý Ekle',
+ 'Address' => 'Adres',
+ 'Administration' => 'Yönetim',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => 'All Datasets up to date!',
+ 'Change Admin Password' => 'Yönetici Þifresini Deðiþtir',
+ 'Change Password' => 'Þifre Deðiþtir',
+ 'Character Set' => 'Karakter Seti',
+ 'Click on login name to edit!' => 'Düzenlemek için giriþ ismini týklayýn.',
+ 'Company' => 'Þirket',
+ 'Connect to' => 'Baðlan',
+ 'Continue' => 'Devam',
+ 'Create Chart of Accounts' => 'Hesap Planý Oluþtur',
+ 'Create Dataset' => 'Veriseti Oluþtur',
+ 'DBI not installed!' => 'DBJ kurulu deðil',
+ 'Database' => 'Veritabaný',
+ 'Database Administration' => 'Veritabani Yonetimi',
+ 'Database Driver not checked!' => 'Database Driver not checked!',
+ 'Database User missing!' => 'Veritabaný Kullanýcýsý yok!',
+ 'Dataset' => 'Veriseti',
+ 'Dataset missing!' => 'Veriseti Yok!',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => 'Tarih Formatý',
+ 'Delete' => 'Sil',
+ 'Delete Dataset' => 'Verisetini Sil',
+ 'Directory' => 'Dizin',
+ 'Driver' => 'Sürücü',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Posta',
+ 'Edit User' => 'Kullanýcý Bilgilerini Düzenle',
+ 'Existing Datasets' => 'Verisetleri',
+ 'Fax' => 'Faks',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Host yok!',
+ 'Incorrect Password!' => 'Yanlýþ Þifre!',
+ 'Language' => 'Dil',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Uzakta baglantý yapmak istemiyorsanýz host ve port alanlarýný boþ býrakýnýz.',
+ 'Login' => 'Giriþ',
+ 'Name' => 'Ýsim',
+ 'New Templates' => 'Yeni Þablonlar',
+ 'No Database Drivers available!' => 'Veritabaný Sürücüsü yok!',
+ 'No Dataset selected!' => 'Veriseti seçilmedi!',
+ 'Nothing to delete!' => 'Nothing to delete!',
+ 'Number Format' => 'Rakam Formatý',
+ 'Oracle Database Administration' => 'Oracle Veritabaný Yönetimi',
+ 'Password' => 'Þifre',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Pg Veritabaný Yönetimi',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port yok!',
+ 'Printer' => 'Yazýcý',
+ 'Save' => 'Kaydet',
+ 'Select a Dataset to delete and press "Continue"' => 'Silmek için bir Veriseti seçin ve "Devam"ý týklayýn.',
+ 'Setup Templates' => 'Þablon Kur',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Ýmza',
+ 'Stylesheet' => 'Düzen Sayfasý',
+ 'Templates' => 'Þablonlar',
+ 'The following Datasets are not in use and can be deleted' => 'Aþaðýdaki Verisetleri kullanýlmamaktadýr ve silinebilir',
+ 'The following Datasets need to be updated' => 'The following Datasets need to be updated',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Mevcut fiþ bilgileri için bu bir ön kontroldür. Bu aþamada hiçbirþey oluþturulmaz ve silinemez',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Gruba yeni kullanýcý eklemek için, giriþ ismini deðiþtirin ve kaydedin. Yeni kullanýcý yeni giriþ altýnda ayný parametrelerle kaydedilecektir.',
+ 'Update Dataset' => 'Update Dataset',
+ 'Use Templates' => 'Þablon Kullan',
+ 'User' => 'Kullanýcý',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'Versiyon',
+ 'You must enter a host and port for local and remote connections!' => 'Yerel ve uzak baðlantýlar için bir host ve port girmek zorundasýnýz!',
+ 'does not exist' => 'mevcut deðil',
+ 'is already a member!' => 'üyedir!',
+ 'localhost' => 'Yerelhost',
+ 'successfully created!' => 'baþarýyla oluþturuldu!',
+ 'successfully deleted!' => 'baþarýyla silindi!',
+ 'website' => 'Websitesi',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'kullanýcý_ekle' => 'add_user',
+ 'yönetici_Þifresini_deðiþtir' => 'change_admin_password',
+ 'Þifre_deðiþtir' => 'change_password',
+ 'devam' => 'continue',
+ 'veriseti_oluþtur' => 'create_dataset',
+ 'sil' => 'delete',
+ 'verisetini_sil' => 'delete_dataset',
+ 'giriþ' => 'login',
+ 'oracle_veritabaný_yönetimi' => 'oracle_database_administration',
+ 'pg_veritabaný_yönetimi' => 'pg_database_administration',
+ 'kaydet' => 'save',
+ 'update_dataset' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/all b/sql-ledger/locale/tr/all
new file mode 100644
index 000000000..2eefc628a
--- /dev/null
+++ b/sql-ledger/locale/tr/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'Borçlar',
+ 'AP Aging' => 'Gecikmiþ Borçlar',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'Borç Ýþlemleri',
+ 'AR' => 'Alacaklar',
+ 'AR Aging' => 'Gecikmiþ Alacaklar',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'Alacak Ýþlemleri',
+ 'About' => 'Program bilgileri',
+ 'Access Control' => 'Giriþ Kontrol',
+ 'Account' => 'Hesap',
+ 'Account Number' => 'Hesap Numarasý',
+ 'Account Number missing!' => 'Hesap Numarasý yok!',
+ 'Account Type' => 'Hesap Türü',
+ 'Account Type missing!' => 'Hesap Türü yok!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => 'Muhasebe',
+ 'Accounting Menu' => 'Muhasebe Menüsü',
+ 'Accounts' => '',
+ 'Active' => '',
+ 'Add' => 'Ekle',
+ 'Add Account' => 'Hesap Ekle',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => 'Grup Ekle',
+ 'Add Customer' => 'Alýcý Ekle',
+ 'Add GIFI' => '',
+ 'Add General Ledger Transaction' => 'Defteri Kebire Ýþlem Ekle',
+ 'Add Part' => 'Parça Ekle',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Add Service' => 'Hizmet Ekle',
+ 'Add Transaction' => 'Ýþlem Ekle',
+ 'Add User' => 'Kullanýcý Ekle',
+ 'Add Vendor' => 'Satýcý Ekle',
+ 'Address' => 'Adres',
+ 'Administration' => 'Yönetim',
+ 'Administrator' => '',
+ 'All' => 'Hepsi',
+ 'All Datasets up to date!' => '',
+ 'Amount' => 'Miktar',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Invoice Number' => 'Fatura Numarasýný silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Are you sure you want to delete Order Number' => 'Sipariþ Numarasýný silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Are you sure you want to delete Transaction' => 'Ýþlemi silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Assemblies' => 'Gruplar',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => 'Grup Numarasý yok!',
+ 'Asset' => 'Aktif',
+ 'Attachment' => '',
+ 'Audit Control' => '',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'BOM' => '',
+ 'Backup' => 'Yedekleme',
+ 'Backup sent to' => '',
+ 'Balance' => '',
+ 'Balance Sheet' => 'Bilanço',
+ 'Bcc' => '',
+ 'Bin' => '',
+ 'Books are open' => '',
+ 'Bought' => 'Alýnan',
+ 'Business Number' => 'ÞirketNo',
+ 'C' => '',
+ 'COGS' => 'SMM',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => 'Öntanýmlý hesap silinmez!',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => 'Faturalanmýþ kalem silinemez!',
+ 'Cannot delete item on order!' => '',
+ 'Cannot delete item which is part of an assembly!' => 'Grubun parçasý olan kalem silinemez!',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => 'Borç ve Alacak hanelerine ayný anda deðer yazýlamaz!',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => '',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => '',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => '',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => 'Yönetici Þifresini Deðiþtir',
+ 'Change Password' => 'Þifre Deðiþtir',
+ 'Character Set' => 'Karakter Seti',
+ 'Chart of Accounts' => 'Hesap Planý',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => 'Düzenlemek için giriþ ismini týklayýn.',
+ 'Close Books up to' => '',
+ 'Closed' => '',
+ 'Company' => 'Þirket',
+ 'Compare to' => '...kýyasla',
+ 'Confirm!' => 'Onayla!',
+ 'Connect to' => 'Baðlan',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => '',
+ 'Copy to COA' => '',
+ 'Create Chart of Accounts' => 'Hesap Planý Oluþtur',
+ 'Create Dataset' => 'Veriseti Oluþtur',
+ 'Credit' => 'Alacak',
+ 'Credit Limit' => 'Kredi Limiti',
+ 'Curr' => '',
+ 'Currency' => 'Para Birimi',
+ 'Current' => '',
+ 'Customer' => 'Alýcý',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => 'DBJ kurulu deðil',
+ 'Database' => 'Veritabaný',
+ 'Database Administration' => 'Veritabani Yonetimi',
+ 'Database Driver not checked!' => '',
+ 'Database Host' => 'Veritabaný Hostu',
+ 'Database User missing!' => 'Veritabaný Kullanýcýsý yok!',
+ 'Dataset' => 'Veriseti',
+ 'Dataset missing!' => 'Veriseti Yok!',
+ 'Dataset updated!' => '',
+ 'Date' => 'Tarih',
+ 'Date Due' => 'Vade Tarihi',
+ 'Date Format' => 'Tarih Formatý',
+ 'Date Paid' => 'Ödendiði Tarih',
+ 'Date missing!' => '',
+ 'Debit' => 'Borç',
+ 'Debit and credit out of balance!' => 'Borç ve alacak eþit deðil!',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Decimalplaces' => '',
+ 'Delete' => 'Sil',
+ 'Delete Account' => 'Hesabý Sil',
+ 'Delete Dataset' => 'Verisetini Sil',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => 'Açýklama',
+ 'Difference' => '',
+ 'Directory' => 'Dizin',
+ 'Discount' => 'Ýndirim',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'Sürücü',
+ 'Dropdown Limit' => '',
+ 'Due' => 'Vade',
+ 'Due Date' => 'Vade Tarihi',
+ 'Due Date missing!' => 'Vade Tarihi yok!',
+ 'E-mail' => 'Posta',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Edit' => '',
+ 'Edit Account' => 'Hesabý Düzenle',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => 'Grubu Düzenle',
+ 'Edit GIFI' => '',
+ 'Edit General Ledger Transaction' => 'Defteri Kebir Ýþlemini Düzenle',
+ 'Edit Part' => 'Parçayý Düzenle',
+ 'Edit Preferences for' => 'Tercihleri Düzenle: ',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => 'Alýþ Sipariþini Düzenle',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => 'Satýþ Sipariþini Düzenle',
+ 'Edit Service' => 'Hizmeti Düzenle',
+ 'Edit Template' => 'Þablonu Düzenle',
+ 'Edit User' => 'Kullanýcý Bilgilerini Düzenle',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => '',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Yerel ve yabancý para birimleri için 3 harfli tanýmlama giriniz yi týklayýnýz (USD:TRL:EUR)',
+ 'Equity' => 'Sermaye',
+ 'Exch' => 'D.Kuru',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => '',
+ 'Exchangerate missing!' => '',
+ 'Existing Datasets' => 'Verisetleri',
+ 'Expense' => 'Gider',
+ 'Expense Account' => 'Gider Hesabý',
+ 'Expense/Asset' => 'Gider/Varlýklar',
+ 'Extended' => '',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'Foreign Exchange Gain' => 'Kur Kazancý',
+ 'Foreign Exchange Loss' => 'Kur Kaybý',
+ 'From' => 'Baþlangýç',
+ 'GIFI' => '',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => '',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Defteri Kebir',
+ 'Goods & Services' => '',
+ 'HTML Templates' => '',
+ 'Heading' => 'Baþlýk',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Host yok!',
+ 'ID' => '',
+ 'Image' => '',
+ 'In-line' => '',
+ 'Include in Report' => 'Raporla',
+ 'Include in drop-down menus' => 'Seçmeli Menüye dahil et',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Vergiye tabi alýcý/satýcý belirlemek için bu hesabý alýcý/aatýcý formlarýna dahil ediniz?',
+ 'Income' => 'Gelirler',
+ 'Income Account' => 'Gelir Hesabý',
+ 'Income Statement' => 'Gelir Tablosu',
+ 'Incorrect Dataset version!' => '',
+ 'Incorrect Password!' => 'Yanlýþ Þifre!',
+ 'Individual Items' => 'Farklý Kalemler',
+ 'Inventory' => 'Stok',
+ 'Inventory Account' => 'Stok Hesabý',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Bu grubu çýkarmadan önce stok miktarý sýfýr olmalýdýr',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Bu Parçayý çýkarmadan önce stok miktarý sýfýr olmalýdýr',
+ 'Inventory quantity must be zero!' => 'Stok miktarý sýfýr olmalý!',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Fatura Tarihi',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => 'Bu kaydedilecek hesap özeti mi',
+ 'Item deleted!' => '',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'LaTeX Templates' => '',
+ 'Language' => 'Dil',
+ 'Last Cost' => 'Son Maliyet',
+ 'Last Invoice Number' => 'Son Fatura Numarasý',
+ 'Last Numbers & Default Accounts' => 'Son Numaralar ve Öntanýmlý Hesaplar',
+ 'Last Purchase Order Number' => 'Son Satýnalma Sipariþ Numarasý',
+ 'Last Sales Order Number' => '',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Uzakta baglantý yapmak istemiyorsanýz host ve port alanlarýný boþ býrakýnýz.',
+ 'Liability' => 'Pasif',
+ 'Licensed to' => 'Lisans Sahibi:',
+ 'Line Total' => '',
+ 'Link' => 'Baðla',
+ 'Link Accounts' => 'Baðlý Hesaplar',
+ 'List Accounts' => '',
+ 'List GIFI' => '',
+ 'List Price' => 'Liste Fiyatý',
+ 'List Transactions' => 'Ýþlemleri Listele',
+ 'Login' => 'Giriþ',
+ 'Logout' => '',
+ 'Make' => 'Marka',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => '',
+ 'Microfiche' => '',
+ 'Model' => 'Model',
+ 'N/A' => '',
+ 'Name' => 'Ýsim',
+ 'Name missing!' => '',
+ 'New Templates' => 'Yeni Þablonlar',
+ 'No' => 'Hayýr',
+ 'No Database Drivers available!' => 'Veritabaný Sürücüsü yok!',
+ 'No Dataset selected!' => 'Veriseti seçilmedi!',
+ 'No email address for' => 'E-posta adresi yok: ',
+ 'No.' => '',
+ 'Notes' => 'Notlar:',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => '',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number Format' => 'Rakam Formatý',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'O' => '',
+ 'Obsolete' => 'Eski',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'On Hand' => 'Stok:',
+ 'On Order' => '',
+ 'Open' => '',
+ 'Oracle Database Administration' => 'Oracle Veritabaný Yönetimi',
+ 'Order' => 'Sipariþ',
+ 'Order Date' => 'Sipariþ Tarihi',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Entry' => 'Sipariþ Giriþi',
+ 'Order Number' => 'Sipariþ No',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => '',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => '',
+ 'Packing List Number missing!' => '',
+ 'Paid' => 'Ödendi',
+ 'Paid in full' => '',
+ 'Part' => 'Parça',
+ 'Part Number missing!' => 'Parça Numarasý yok!',
+ 'Parts' => 'Parçalar',
+ 'Parts Inventory' => 'Parça Stoðu',
+ 'Password' => 'Þifre',
+ 'Password changed!' => '',
+ 'Payables' => 'Borçlar',
+ 'Payment' => 'Ödeme',
+ 'Payment date missing!' => 'Ödeme Tarihi yok',
+ 'Payment posted!' => '',
+ 'Payments' => 'Ödemeler',
+ 'Pg Database Administration' => 'Pg Veritabaný Yönetimi',
+ 'Phone' => 'Telefon',
+ 'Port' => 'Port',
+ 'Port missing!' => 'Port yok!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => 'Tercihler',
+ 'Preferences saved!' => 'Tercihler kaydedildi!',
+ 'Price' => 'Fiyat',
+ 'Print' => '',
+ 'Printer' => 'Yazýcý',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Purchase Orders' => 'Satýnalma Sipariþleri',
+ 'Qty' => 'Adet',
+ 'ROP' => '',
+ 'Rate' => 'Oran',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'Alacaklar',
+ 'Reconciliation' => '',
+ 'Record in' => 'Kaydet',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => '',
+ 'Report for' => '',
+ 'Reports' => 'Raporlar',
+ 'Required by' => 'Talep tarihi:',
+ 'Retained Earnings' => 'Net Dönem Karý (Zararý)',
+ 'Sales' => 'Satýþlar',
+ 'Sales Invoice' => '',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Sales Orders' => 'Satýþ Sipariþleri',
+ 'Save' => 'Kaydet',
+ 'Save as new' => '',
+ 'Save to File' => 'Dosyaya Kaydet',
+ 'Screen' => '',
+ 'Select a Dataset to delete and press "Continue"' => 'Silmek için bir Veriseti seçin ve "Devam"ý týklayýn.',
+ 'Select all' => '',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => 'Satýþ Fiyatý',
+ 'Send by E-Mail' => 'E-postayla gönder',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Service Items' => 'Hizmet Kalemleri',
+ 'Service Number missing!' => 'Hizmet Numarasý yok!',
+ 'Services' => 'Servisler',
+ 'Setup Templates' => 'Þablon Kur',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'Kýsa',
+ 'Signature' => 'Ýmza',
+ 'Sold' => 'satýlan',
+ 'Source' => 'Kaynak',
+ 'Standard' => '',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => 'Grubu Stokla',
+ 'Stylesheet' => 'Düzen Sayfasý',
+ 'Subject' => '',
+ 'Subtotal' => 'Aratoplam',
+ 'System' => '',
+ 'Tax' => 'Vergi',
+ 'Tax Accounts' => 'Vergi Hesaplarý',
+ 'Tax Included' => 'Vergi Dahil',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'Vergiye tabi',
+ 'Template saved!' => '',
+ 'Templates' => 'Þablonlar',
+ 'Terms: Net' => 'Þartlar: Net',
+ 'The following Datasets are not in use and can be deleted' => 'Aþaðýdaki Verisetleri kullanýlmamaktadýr ve silinebilir',
+ 'The following Datasets need to be updated' => '',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Mevcut fiþ bilgileri için bu bir ön kontroldür. Bu aþamada hiçbirþey oluþturulmaz ve silinemez',
+ 'To' => 'Bitiþ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Gruba yeni kullanýcý eklemek için, giriþ ismini deðiþtirin ve kaydedin. Yeni kullanýcý yeni giriþ altýnda ayný parametrelerle kaydedilecektir.',
+ 'Top Level' => '',
+ 'Total' => 'Toplam',
+ 'Transaction Date missing!' => 'Ýþlem Tarihi yok!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => '',
+ 'Transaction reversal enforced up to' => '',
+ 'Transactions' => 'Ýþlemler',
+ 'Transactions exist, cannot delete customer!' => 'Ýþlem var, alýcý silinemez!',
+ 'Transactions exist, cannot delete vendor!' => 'Ýþlem var, satýcý silinemez!',
+ 'Transactions exist; cannot delete account!' => 'Ýþlem var, hesap silinemez!',
+ 'Trial Balance' => 'Proforma Bilanço',
+ 'Unit' => 'Birim',
+ 'Unit of measure' => 'Ölçme Birimi',
+ 'Update' => '',
+ 'Update Dataset' => '',
+ 'Updated' => '',
+ 'Use Templates' => 'Þablon Kullan',
+ 'User' => 'Kullanýcý',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => 'Satýcý',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'Versiyon',
+ 'Weight' => 'Aðýrlýk',
+ 'Weight Unit' => 'Aðýrlýk Birimi',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'Year End' => 'Sene Sonu',
+ 'Yes' => 'Evet',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => 'Ýsim girmediniz!',
+ 'You must enter a host and port for local and remote connections!' => 'Yerel ve uzak baðlantýlar için bir host ve port girmek zorundasýnýz!',
+ 'as at' => '',
+ 'collected on sales' => '',
+ 'days' => 'gün. ',
+ 'does not exist' => 'mevcut deðil',
+ 'ea' => 'ad',
+ 'emailed to' => '',
+ 'for Period' => 'Dönem:',
+ 'hr' => 'sa',
+ 'is already a member!' => 'üyedir!',
+ 'is not a member!' => '',
+ 'localhost' => 'Yerelhost',
+ 'paid on purchases' => '',
+ 'sent to printer' => '',
+ 'successfully created!' => 'baþarýyla oluþturuldu!',
+ 'successfully deleted!' => 'baþarýyla silindi!',
+ 'to' => '',
+ 'website' => 'Websitesi',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/am b/sql-ledger/locale/tr/am
new file mode 100644
index 000000000..1ce2de00b
--- /dev/null
+++ b/sql-ledger/locale/tr/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'Borçlar',
+ 'AR' => 'Alacaklar',
+ 'Account' => 'Hesap',
+ 'Account Number' => 'Hesap Numarasý',
+ 'Account Number missing!' => 'Hesap Numarasý yok!',
+ 'Account Type' => 'Hesap Türü',
+ 'Account Type missing!' => 'Hesap Türü yok!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => 'Hesap Ekle',
+ 'Add GIFI' => 'Add GIFI',
+ 'Address' => 'Adres',
+ 'Asset' => 'Aktif',
+ 'Audit Control' => 'Audit Control',
+ 'Backup sent to' => 'Backup sent to',
+ 'Books are open' => 'Books are open',
+ 'Business Number' => 'ÞirketNo',
+ 'COGS' => 'SMM',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'Öntanýmlý hesap silinmez!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => 'Karakter Seti',
+ 'Chart of Accounts' => 'Hesap Planý',
+ 'Close Books up to' => 'Close Books up to',
+ 'Company' => 'Þirket',
+ 'Continue' => 'Devam',
+ 'Copy to COA' => 'Copy to COA',
+ 'Credit' => 'Alacak',
+ 'Date Format' => 'Tarih Formatý',
+ 'Debit' => 'Borç',
+ 'Delete' => 'Sil',
+ 'Delete Account' => 'Hesabý Sil',
+ 'Description' => 'Açýklama',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => 'Posta',
+ 'Edit' => 'Edit',
+ 'Edit Account' => 'Hesabý Düzenle',
+ 'Edit GIFI' => 'Edit GIFI',
+ 'Edit Preferences for' => 'Tercihleri Düzenle: ',
+ 'Edit Template' => 'Þablonu Düzenle',
+ 'Enforce transaction reversal for all dates' => 'Enforce transaction reversal for all dates',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Yerel ve yabancý para birimleri için 3 harfli tanýmlama giriniz yi týklayýnýz (USD:TRL:EUR)',
+ 'Equity' => 'Sermaye',
+ 'Expense' => 'Gider',
+ 'Expense Account' => 'Gider Hesabý',
+ 'Expense/Asset' => 'Gider/Varlýklar',
+ 'Fax' => 'Faks',
+ 'Foreign Exchange Gain' => 'Kur Kazancý',
+ 'Foreign Exchange Loss' => 'Kur Kaybý',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => 'GIFI missing!',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'Baþlýk',
+ 'Include in drop-down menus' => 'Seçmeli Menüye dahil et',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Vergiye tabi alýcý/satýcý belirlemek için bu hesabý alýcý/aatýcý formlarýna dahil ediniz?',
+ 'Income' => 'Gelirler',
+ 'Income Account' => 'Gelir Hesabý',
+ 'Inventory' => 'Stok',
+ 'Inventory Account' => 'Stok Hesabý',
+ 'Is this a summary account to record' => 'Bu kaydedilecek hesap özeti mi',
+ 'Language' => 'Dil',
+ 'Last Invoice Number' => 'Son Fatura Numarasý',
+ 'Last Numbers & Default Accounts' => 'Son Numaralar ve Öntanýmlý Hesaplar',
+ 'Last Purchase Order Number' => 'Son Satýnalma Sipariþ Numarasý',
+ 'Last Sales Order Number' => 'Last Sales Order Number',
+ 'Liability' => 'Pasif',
+ 'Link' => 'Baðla',
+ 'Name' => 'Ýsim',
+ 'No' => 'Hayýr',
+ 'No email address for' => 'E-posta adresi yok: ',
+ 'Number' => 'Numara',
+ 'Number Format' => 'Rakam Formatý',
+ 'Parts Inventory' => 'Parça Stoðu',
+ 'Password' => 'Þifre',
+ 'Payables' => 'Borçlar',
+ 'Payment' => 'Ödeme',
+ 'Phone' => 'Telefon',
+ 'Preferences saved!' => 'Tercihler kaydedildi!',
+ 'Rate' => 'Oran',
+ 'Receivables' => 'Alacaklar',
+ 'Sales' => 'Satýþlar',
+ 'Save' => 'Kaydet',
+ 'Service Items' => 'Hizmet Kalemleri',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'Ýmza',
+ 'Stylesheet' => 'Düzen Sayfasý',
+ 'Tax' => 'Vergi',
+ 'Tax Accounts' => 'Vergi Hesaplarý',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => 'Transaction reversal enforced for all dates',
+ 'Transaction reversal enforced up to' => 'Transaction reversal enforced up to',
+ 'Transactions exist; cannot delete account!' => 'Ýþlem var, hesap silinemez!',
+ 'Weight Unit' => 'Aðýrlýk Birimi',
+ 'Year End' => 'Sene Sonu',
+ 'Yes' => 'Evet',
+ 'does not exist' => 'mevcut deðil',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'hesap_ekle' => 'add_account',
+ 'devam' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'sil' => 'delete',
+ 'edit' => 'edit',
+ 'hesabý_düzenle' => 'edit_account',
+ 'kaydet' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ap b/sql-ledger/locale/tr/ap
new file mode 100644
index 000000000..f6c817fa3
--- /dev/null
+++ b/sql-ledger/locale/tr/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'Borç Ýþlemleri',
+ 'Account' => 'Hesap',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Transaction' => 'Ýþlemi silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Onayla!',
+ 'Continue' => 'Devam',
+ 'Currency' => 'Para Birimi',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Date Paid' => 'Ödendiði Tarih',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Description' => 'Açýklama',
+ 'Due Date' => 'Vade Tarihi',
+ 'Due Date missing!' => 'Vade Tarihi yok!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'D.Kuru',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Raporla',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Fatura Tarihi',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Open' => 'Open',
+ 'Order' => 'Sipariþ',
+ 'Order Number' => 'Sipariþ No',
+ 'Paid' => 'Ödendi',
+ 'Payment date missing!' => 'Ödeme Tarihi yok',
+ 'Payments' => 'Ödemeler',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Source' => 'Kaynak',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax' => 'Vergi',
+ 'Tax Included' => 'Vergi Dahil',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => 'Satýcý',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Evet',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ar b/sql-ledger/locale/tr/ar
new file mode 100644
index 000000000..642c5562e
--- /dev/null
+++ b/sql-ledger/locale/tr/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'Alacak Ýþlemleri',
+ 'Account' => 'Hesap',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Transaction' => 'Ýþlemi silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Onayla!',
+ 'Continue' => 'Devam',
+ 'Credit Limit' => 'Kredi Limiti',
+ 'Currency' => 'Para Birimi',
+ 'Customer' => 'Alýcý',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Date Paid' => 'Ödendiði Tarih',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Description' => 'Açýklama',
+ 'Due Date' => 'Vade Tarihi',
+ 'Due Date missing!' => 'Vade Tarihi yok!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => 'D.Kuru',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Raporla',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Fatura Tarihi',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Open' => 'Open',
+ 'Order' => 'Sipariþ',
+ 'Order Number' => 'Sipariþ No',
+ 'Paid' => 'Ödendi',
+ 'Payment date missing!' => 'Ödeme Tarihi yok',
+ 'Payments' => 'Ödemeler',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => 'Remaining',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Source' => 'Kaynak',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax' => 'Vergi',
+ 'Tax Included' => 'Vergi Dahil',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Evet',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/arap b/sql-ledger/locale/tr/arap
new file mode 100644
index 000000000..fb56368a6
--- /dev/null
+++ b/sql-ledger/locale/tr/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Adres',
+ 'Continue' => 'Devam',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => 'Açýklama',
+ 'Number' => 'Numara',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'devam' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ca b/sql-ledger/locale/tr/ca
new file mode 100644
index 000000000..f379cd63a
--- /dev/null
+++ b/sql-ledger/locale/tr/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Hesap',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Hesap Planý',
+ 'Credit' => 'Alacak',
+ 'Date' => 'Tarih',
+ 'Debit' => 'Borç',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Description' => 'Açýklama',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Raporla',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'List Transactions' => 'Ýþlemleri Listele',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Reference' => 'Reference',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Subtotal' => 'Aratoplam',
+ 'To' => 'Bitiþ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'Ýþlemleri_listele' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/cp b/sql-ledger/locale/tr/cp
new file mode 100644
index 000000000..a08a0b7d7
--- /dev/null
+++ b/sql-ledger/locale/tr/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Hesap',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Devam',
+ 'Currency' => 'Para Birimi',
+ 'Customer' => 'Alýcý',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => 'Açýklama',
+ 'Due' => 'Vade',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'From' => 'Baþlangýç',
+ 'Invoice' => 'Fatura',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => 'Numara',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => 'Ödeme',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => 'Yazýcý',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => 'Screen',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => 'Bitiþ',
+ 'Update' => 'Update',
+ 'Vendor' => 'Satýcý',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'devam' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ct b/sql-ledger/locale/tr/ct
new file mode 100644
index 000000000..b7b0e4fff
--- /dev/null
+++ b/sql-ledger/locale/tr/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => 'Ekle',
+ 'Address' => 'Adres',
+ 'All' => 'Hepsi',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Credit Limit' => 'Kredi Limiti',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => 'Sil',
+ 'Discount' => 'Ýndirim',
+ 'E-mail' => 'Posta',
+ 'Fax' => 'Faks',
+ 'Include in Report' => 'Raporla',
+ 'Invoice' => 'Fatura',
+ 'Name' => 'Ýsim',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => 'Notlar:',
+ 'Number' => 'Numara',
+ 'Order' => 'Sipariþ',
+ 'Orphaned' => 'Orphaned',
+ 'Phone' => 'Telefon',
+ 'Save' => 'Kaydet',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => 'Vergi Dahil',
+ 'Taxable' => 'Vergiye tabi',
+ 'Terms: Net' => 'Þartlar: Net',
+ 'Transactions exist, cannot delete customer!' => 'Ýþlem var, alýcý silinemez!',
+ 'Transactions exist, cannot delete vendor!' => 'Ýþlem var, satýcý silinemez!',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => 'gün. ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'ekle' => 'add',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'fatura' => 'invoice',
+ 'sipariþ' => 'order',
+ 'kaydet' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/gl b/sql-ledger/locale/tr/gl
new file mode 100644
index 000000000..7370defd2
--- /dev/null
+++ b/sql-ledger/locale/tr/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => 'Hesap',
+ 'Add General Ledger Transaction' => 'Defteri Kebire Ýþlem Ekle',
+ 'Address' => 'Adres',
+ 'All' => 'Hepsi',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Transaction' => 'Ýþlemi silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Asset' => 'Aktif',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'Borç ve Alacak hanelerine ayný anda deðer yazýlamaz!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'Cannot post transaction for a closed period!',
+ 'Confirm!' => 'Onayla!',
+ 'Continue' => 'Devam',
+ 'Credit' => 'Alacak',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Debit' => 'Borç',
+ 'Debit and credit out of balance!' => 'Borç ve alacak eþit deðil!',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Description' => 'Açýklama',
+ 'Edit General Ledger Transaction' => 'Defteri Kebir Ýþlemini Düzenle',
+ 'Equity' => 'Sermaye',
+ 'Expense' => 'Gider',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Defteri Kebir',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Raporla',
+ 'Income' => 'Gelirler',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Liability' => 'Pasif',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => 'Raporlar',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Source' => 'Kaynak',
+ 'Subtotal' => 'Aratoplam',
+ 'To' => 'Bitiþ',
+ 'Transaction Date missing!' => 'Ýþlem Tarihi yok!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => 'Evet',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ic b/sql-ledger/locale/tr/ic
new file mode 100644
index 000000000..b069b8100
--- /dev/null
+++ b/sql-ledger/locale/tr/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => 'Ekle',
+ 'Add Assembly' => 'Grup Ekle',
+ 'Add Part' => 'Parça Ekle',
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Add Service' => 'Hizmet Ekle',
+ 'Address' => 'Adres',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Assemblies' => 'Gruplar',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => 'Grup Numarasý yok!',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Bought' => 'Alýnan',
+ 'COGS' => 'SMM',
+ 'Cannot delete item already invoiced!' => 'Faturalanmýþ kalem silinemez!',
+ 'Cannot delete item on order!' => 'Cannot delete item on order!',
+ 'Cannot delete item which is part of an assembly!' => 'Grubun parçasý olan kalem silinemez!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Açýklama',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => 'Posta',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Edit Assembly' => 'Grubu Düzenle',
+ 'Edit Part' => 'Parçayý Düzenle',
+ 'Edit Service' => 'Hizmeti Düzenle',
+ 'Expense' => 'Gider',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'Image' => 'Image',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Raporla',
+ 'Income' => 'Gelirler',
+ 'Individual Items' => 'Farklý Kalemler',
+ 'Inventory' => 'Stok',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Bu grubu çýkarmadan önce stok miktarý sýfýr olmalýdýr',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Bu Parçayý çýkarmadan önce stok miktarý sýfýr olmalýdýr',
+ 'Inventory quantity must be zero!' => 'Stok miktarý sýfýr olmalý!',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Last Cost' => 'Son Maliyet',
+ 'Line Total' => 'Line Total',
+ 'Link Accounts' => 'Baðlý Hesaplar',
+ 'List Price' => 'Liste Fiyatý',
+ 'Make' => 'Marka',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => 'Model',
+ 'Name' => 'Ýsim',
+ 'No.' => 'No.',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'Obsolete' => 'Eski',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'On Hand' => 'Stok:',
+ 'On Order' => 'On Order',
+ 'Order' => 'Sipariþ',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Number' => 'Sipariþ No',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'Orphaned',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Parça',
+ 'Part Number missing!' => 'Parça Numarasý yok!',
+ 'Parts' => 'Parçalar',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Fiyat',
+ 'Printer' => 'Yazýcý',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Qty' => 'Adet',
+ 'ROP' => 'ROP',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Talep tarihi:',
+ 'Sales' => 'Satýþlar',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Save' => 'Kaydet',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => 'Satýþ Fiyatý',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Service Number missing!' => 'Hizmet Numarasý yok!',
+ 'Services' => 'Servisler',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'Kýsa',
+ 'Sold' => 'satýlan',
+ 'Stock Assembly' => 'Grubu Stokla',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax' => 'Vergi',
+ 'To' => 'Bitiþ',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Toplam',
+ 'Unit' => 'Birim',
+ 'Unit of measure' => 'Ölçme Birimi',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => 'Aðýrlýk',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'ea' => 'ad',
+ 'emailed to' => 'emailed to',
+ 'hr' => 'sa',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'ekle' => 'add',
+ 'grup_ekle' => 'add_assembly',
+ 'parça_ekle' => 'add_part',
+ 'hizmet_ekle' => 'add_service',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'grubu_düzenle' => 'edit_assembly',
+ 'parçayý_düzenle' => 'edit_part',
+ 'hizmeti_düzenle' => 'edit_service',
+ 'kaydet' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/io b/sql-ledger/locale/tr/io
new file mode 100644
index 000000000..8ce89dd58
--- /dev/null
+++ b/sql-ledger/locale/tr/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Address' => 'Adres',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Açýklama',
+ 'E-mail' => 'Posta',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'Name' => 'Ýsim',
+ 'No.' => 'No.',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Order' => 'Sipariþ',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Parça',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Fiyat',
+ 'Printer' => 'Yazýcý',
+ 'Project' => 'Project',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Qty' => 'Adet',
+ 'Recd' => 'Recd',
+ 'Required by' => 'Talep tarihi:',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => 'Subject',
+ 'To' => 'Bitiþ',
+ 'Unit' => 'Birim',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'devam' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/ir b/sql-ledger/locale/tr/ir
new file mode 100644
index 000000000..c62536a6f
--- /dev/null
+++ b/sql-ledger/locale/tr/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Hesap',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Invoice Number' => 'Fatura Numarasýný silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Onayla!',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Currency' => 'Para Birimi',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Date Due' => 'Vade Tarihi',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Açýklama',
+ 'E-mail' => 'Posta',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => 'D.Kuru',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Fatura Tarihi',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'Name' => 'Ýsim',
+ 'No.' => 'No.',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Order' => 'Sipariþ',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Number' => 'Sipariþ No',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Parça',
+ 'Payment date missing!' => 'Ödeme Tarihi yok',
+ 'Payments' => 'Ödemeler',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Fiyat',
+ 'Printer' => 'Yazýcý',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Qty' => 'Adet',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Kaydet',
+ 'Required by' => 'Talep tarihi:',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => 'Kaynak',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax Included' => 'Vergi Dahil',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Unit' => 'Birim',
+ 'Update' => 'Update',
+ 'Vendor' => 'Satýcý',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'Yes' => 'Evet',
+ 'ea' => 'ad',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'sipariþ' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/is b/sql-ledger/locale/tr/is
new file mode 100644
index 000000000..29342c3cb
--- /dev/null
+++ b/sql-ledger/locale/tr/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Hesap',
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Invoice Number' => 'Fatura Numarasýný silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Onayla!',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Kredi Limiti',
+ 'Currency' => 'Para Birimi',
+ 'Customer' => 'Alýcý',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Date Due' => 'Vade Tarihi',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Açýklama',
+ 'E-mail' => 'Posta',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => 'D.Kuru',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'In-line' => 'In-line',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date' => 'Fatura Tarihi',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number' => 'Fatura No',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'Name' => 'Ýsim',
+ 'No.' => 'No.',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Order' => 'Sipariþ',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Number' => 'Sipariþ No',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Parça',
+ 'Payment date missing!' => 'Ödeme Tarihi yok',
+ 'Payments' => 'Ödemeler',
+ 'Phone' => 'Telefon',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Fiyat',
+ 'Print' => 'Print',
+ 'Printer' => 'Yazýcý',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Qty' => 'Adet',
+ 'Recd' => 'Recd',
+ 'Record in' => 'Kaydet',
+ 'Remaining' => 'Remaining',
+ 'Required by' => 'Talep tarihi:',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => 'Kaynak',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax Included' => 'Vergi Dahil',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Unit' => 'Birim',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'Yes' => 'Evet',
+ 'ea' => 'ad',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'posta' => 'e_mail',
+ 'sipariþ' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/login b/sql-ledger/locale/tr/login
new file mode 100644
index 000000000..3c6fb0b34
--- /dev/null
+++ b/sql-ledger/locale/tr/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Program bilgileri',
+ 'Accounting' => 'Muhasebe',
+ 'Database Host' => 'Veritabaný Hostu',
+ 'Dataset' => 'Veriseti',
+ 'Incorrect Dataset version!' => 'Incorrect Dataset version!',
+ 'Incorrect Password!' => 'Yanlýþ Þifre!',
+ 'Licensed to' => 'Lisans Sahibi:',
+ 'Login' => 'Giriþ',
+ 'Name' => 'Ýsim',
+ 'Password' => 'Þifre',
+ 'User' => 'Kullanýcý',
+ 'Version' => 'Versiyon',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => 'Ýsim girmediniz!',
+ 'is not a member!' => 'is not a member!',
+ 'localhost' => 'Yerelhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'giriþ' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/menu b/sql-ledger/locale/tr/menu
new file mode 100644
index 000000000..45a429664
--- /dev/null
+++ b/sql-ledger/locale/tr/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'Borçlar',
+ 'AP Aging' => 'Gecikmiþ Borçlar',
+ 'AR' => 'Alacaklar',
+ 'AR Aging' => 'Gecikmiþ Alacaklar',
+ 'Accounting Menu' => 'Muhasebe Menüsü',
+ 'Add Account' => 'Hesap Ekle',
+ 'Add Assembly' => 'Grup Ekle',
+ 'Add Customer' => 'Alýcý Ekle',
+ 'Add GIFI' => 'Add GIFI',
+ 'Add Part' => 'Parça Ekle',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => 'Hizmet Ekle',
+ 'Add Transaction' => 'Ýþlem Ekle',
+ 'Add Vendor' => 'Satýcý Ekle',
+ 'Assemblies' => 'Gruplar',
+ 'Audit Control' => 'Audit Control',
+ 'Backup' => 'Yedekleme',
+ 'Balance Sheet' => 'Bilanço',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => 'Hesap Planý',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Defteri Kebir',
+ 'Goods & Services' => 'Goods & Services',
+ 'HTML Templates' => 'HTML Templates',
+ 'Income Statement' => 'Gelir Tablosu',
+ 'Invoice' => 'Fatura',
+ 'LaTeX Templates' => 'LaTeX Templates',
+ 'List Accounts' => 'List Accounts',
+ 'List GIFI' => 'List GIFI',
+ 'Logout' => 'Logout',
+ 'Order Entry' => 'Sipariþ Giriþi',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Parts' => 'Parçalar',
+ 'Payment' => 'Ödeme',
+ 'Payments' => 'Ödemeler',
+ 'Preferences' => 'Tercihler',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Purchase Orders' => 'Satýnalma Sipariþleri',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => 'Raporlar',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Sales Orders' => 'Satýþ Sipariþleri',
+ 'Save to File' => 'Dosyaya Kaydet',
+ 'Send by E-Mail' => 'E-postayla gönder',
+ 'Services' => 'Servisler',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => 'Grubu Stokla',
+ 'Stylesheet' => 'Düzen Sayfasý',
+ 'System' => 'System',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => 'Ýþlemler',
+ 'Trial Balance' => 'Proforma Bilanço',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'Versiyon',
+ 'localhost' => 'Yerelhost',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/oe b/sql-ledger/locale/tr/oe
new file mode 100644
index 000000000..31415c66e
--- /dev/null
+++ b/sql-ledger/locale/tr/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => 'Ekle',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => 'Satýnalma Sip. Ekle',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => 'Satýþ Sipariþi Ekle',
+ 'Address' => 'Adres',
+ 'Amount' => 'Miktar',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Are you sure you want to delete Order Number' => 'Sipariþ Numarasýný silmek istediðinizden emin misiniz? Fiþ: ',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Bin',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Closed',
+ 'Confirm!' => 'Onayla!',
+ 'Contact' => 'Kontak',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Credit Limit' => 'Kredi Limiti',
+ 'Curr' => 'Curr',
+ 'Currency' => 'Para Birimi',
+ 'Customer' => 'Alýcý',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => 'Tarih',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Delete' => 'Sil',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => 'Açýklama',
+ 'E-mail' => 'Posta',
+ 'E-mail address missing!' => 'Posta adresi yok!',
+ 'Edit Purchase Order' => 'Alýþ Sipariþini Düzenle',
+ 'Edit Sales Order' => 'Satýþ Sipariþini Düzenle',
+ 'Exchangerate' => 'Döviz Kuru',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => 'Faks',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Raporla',
+ 'Invoice' => 'Fatura',
+ 'Invoice Date missing!' => 'Fatura Tarihi yok!',
+ 'Invoice Number missing!' => 'Fatura Numarasý yok!',
+ 'Item not on file!' => 'Bu kalem dosyada yok!',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'Name' => 'Ýsim',
+ 'No.' => 'No.',
+ 'Notes' => 'Notlar:',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Number' => 'Numara',
+ 'Number missing in Row' => 'Sýrada Numara yok!',
+ 'O' => 'O',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'Open' => 'Open',
+ 'Order' => 'Sipariþ',
+ 'Order Date' => 'Sipariþ Tarihi',
+ 'Order Date missing!' => 'Sipariþ Tarihi yok!',
+ 'Order Number' => 'Sipariþ No',
+ 'Order Number missing!' => 'Sipariþ Numarasý yok!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Paketleme Listesi',
+ 'Packing List Date missing!' => 'Packing List Date missing!',
+ 'Packing List Number missing!' => 'Packing List Number missing!',
+ 'Part' => 'Parça',
+ 'Phone' => 'Telefon',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Fiyat',
+ 'Print' => 'Print',
+ 'Printer' => 'Yazýcý',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => 'Satýnalma Sipariþi',
+ 'Purchase Orders' => 'Satýnalma Sipariþleri',
+ 'Qty' => 'Adet',
+ 'Recd' => 'Recd',
+ 'Remaining' => 'Remaining',
+ 'Required by' => 'Talep tarihi:',
+ 'Sales Order' => 'Satýþ Sipariþi',
+ 'Sales Orders' => 'Satýþ Sipariþleri',
+ 'Save' => 'Kaydet',
+ 'Save as new' => 'Save as new',
+ 'Screen' => 'Screen',
+ 'Select from one of the items below' => 'Aþaðýdaki kalemlerden birini seç',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Service' => 'servis',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax' => 'Vergi',
+ 'Tax Included' => 'Vergi Dahil',
+ 'Terms: Net' => 'Þartlar: Net',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Unit' => 'Birim',
+ 'Update' => 'Update',
+ 'Vendor' => 'Satýcý',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => 'Bu ne çeþit bir kalemdir?',
+ 'Yes' => 'Evet',
+ 'days' => 'gün. ',
+ 'ea' => 'ad',
+ 'emailed to' => 'emailed to',
+ 'sent to printer' => 'sent to printer',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ekle' => 'add',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'posta' => 'e_mail',
+ 'fatura' => 'invoice',
+ 'print' => 'print',
+ 'kaydet' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'evet' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/pe b/sql-ledger/locale/tr/pe
new file mode 100644
index 000000000..d010eca59
--- /dev/null
+++ b/sql-ledger/locale/tr/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Ekle',
+ 'Add Project' => 'Add Project',
+ 'All' => 'Hepsi',
+ 'Continue' => 'Devam',
+ 'Delete' => 'Sil',
+ 'Description' => 'Açýklama',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => 'Numara',
+ 'Orphaned' => 'Orphaned',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Kaydet',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'ekle' => 'add',
+ 'devam' => 'continue',
+ 'sil' => 'delete',
+ 'kaydet' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/rc b/sql-ledger/locale/tr/rc
new file mode 100644
index 000000000..4e71d0cce
--- /dev/null
+++ b/sql-ledger/locale/tr/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Hesap',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Devam',
+ 'Date' => 'Tarih',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Açýklama',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => 'Baþlangýç',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => 'Ödeme',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => 'Kaynak',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => 'Bitiþ',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'devam' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tr/rp b/sql-ledger/locale/tr/rp
new file mode 100644
index 000000000..78072627b
--- /dev/null
+++ b/sql-ledger/locale/tr/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'Gecikmiþ Borçlar',
+ 'AR Aging' => 'Gecikmiþ Alacaklar',
+ 'Account' => 'Hesap',
+ 'Accounts' => 'Accounts',
+ 'Amount' => 'Miktar',
+ 'Apr' => 'Nis',
+ 'April' => 'Nisan',
+ 'Attachment' => 'Attachment',
+ 'Aug' => 'Aðu',
+ 'August' => 'Aðustos',
+ 'Balance Sheet' => 'Bilanço',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => '...kýyasla',
+ 'Continue' => 'Devam',
+ 'Copies' => 'Copies',
+ 'Credit' => 'Alacak',
+ 'Current' => 'Current',
+ 'Customer' => 'Alýcý',
+ 'Date' => 'Tarih',
+ 'Debit' => 'Borç',
+ 'Dec' => 'Ara',
+ 'December' => 'Aralýk',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => 'Açýklama',
+ 'Due' => 'Vade',
+ 'E-mail' => 'Posta',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => 'Þub',
+ 'February' => 'Þubat',
+ 'From' => 'Baþlangýç',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Baþlýk',
+ 'ID' => 'ID',
+ 'In-line' => 'In-line',
+ 'Include in Report' => 'Raporla',
+ 'Income Statement' => 'Gelir Tablosu',
+ 'Invoice' => 'Fatura',
+ 'Jan' => 'Oca',
+ 'January' => 'Ocak',
+ 'Jul' => 'Tem',
+ 'July' => 'Temmuz',
+ 'Jun' => 'Haz',
+ 'June' => 'Haziran',
+ 'Mar' => 'Mar',
+ 'March' => 'Mart',
+ 'May' => 'May',
+ 'May ' => 'Mayýs',
+ 'Message' => 'Message',
+ 'N/A' => 'N/A',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => 'Kas',
+ 'November' => 'Kasým',
+ 'Oct' => 'Eki',
+ 'October' => 'Ekim',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Ödemeler',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => 'Yazýcý',
+ 'Receipts' => 'Receipts',
+ 'Report for' => 'Report for',
+ 'Retained Earnings' => 'Net Dönem Karý (Zararý)',
+ 'Screen' => 'Screen',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => 'Eyl',
+ 'September' => 'Eylül',
+ 'Source' => 'Kaynak',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => 'Subject',
+ 'Subtotal' => 'Aratoplam',
+ 'Tax' => 'Vergi',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => 'Bitiþ',
+ 'Total' => 'Toplam',
+ 'Trial Balance' => 'Proforma Bilanço',
+ 'Vendor' => 'Satýcý',
+ 'as at' => 'as at',
+ 'collected on sales' => 'collected on sales',
+ 'for Period' => 'Dönem:',
+ 'paid on purchases' => 'paid on purchases',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'devam' => 'continue',
+ 'posta' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/COPYING b/sql-ledger/locale/tw/COPYING
new file mode 100644
index 000000000..835a214db
--- /dev/null
+++ b/sql-ledger/locale/tw/COPYING
@@ -0,0 +1,25 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2001
+#
+# Traditional Chinese texts:
+#
+# Author: ¤è²»³Ç (Jacky Fang) <jackyf@5star.com.tw>
+# Chien Hsin Chang <werther@elixus.org>
+# Autrijus Tang <autrijus@autrijus.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/tw/LANGUAGE b/sql-ledger/locale/tw/LANGUAGE
new file mode 100644
index 000000000..b8ba9c3e3
--- /dev/null
+++ b/sql-ledger/locale/tw/LANGUAGE
@@ -0,0 +1 @@
+Traditional Chinese
diff --git a/sql-ledger/locale/tw/admin b/sql-ledger/locale/tw/admin
new file mode 100644
index 000000000..6c19c1138
--- /dev/null
+++ b/sql-ledger/locale/tw/admin
@@ -0,0 +1,122 @@
+$self{texts} = {
+ 'Access Control' => 'Åv­­±±¨î',
+ 'Accounting' => '·|­p',
+ 'Add User' => '·s¼W¨Ï¥ÎªÌ',
+ 'Address' => '¦a§}',
+ 'Administration' => '¨t²ÎºÞ²z',
+ 'Administrator' => 'Administrator',
+ 'All Datasets up to date!' => '©Ò¦³¸ê®Æ¬Ò¤w§ó·s!',
+ 'Change Admin Password' => '§ó§ïºÞ²z­û±K½X',
+ 'Change Password' => '§ó§ï±K½X',
+ 'Character Set' => '¦r¤¸¶°',
+ 'Click on login name to edit!' => '½Ð«öµn¤J¦WºÙ¥H¶i¦æ­×§ï!',
+ 'Company' => '¤½¥q¦WºÙ',
+ 'Connect to' => '³sµ²¨ì',
+ 'Continue' => 'Ä~Äò',
+ 'Create Chart of Accounts' => '«Ø¥ß±b¤á¹Ïªí',
+ 'Create Dataset' => '«Ø¥ß¸ê®Æ¶°',
+ 'DBI not installed!' => '¥¼¦w¸Ë DBI ¼Ò²Õ!',
+ 'Database' => '¸ê®Æ®w',
+ 'Database Administration' => '¸ê®Æ®wºÞ²z',
+ 'Database Driver not checked!' => '¥¼¿ï©w¸ê®Æ®wÅX°Êµ{¦¡!',
+ 'Database User missing!' => '¥¼«ü©ú¸ê®Æ®w¨Ï¥ÎªÌ!',
+ 'Dataset' => '¸ê®Æ¶°',
+ 'Dataset missing!' => '¥¼«ü©ú¸ê®Æ¶°!',
+ 'Dataset updated!' => 'Dataset updated!',
+ 'Date Format' => '¤é´Á®æ¦¡',
+ 'Delete' => '§R°£',
+ 'Delete Dataset' => '§R°£¸ê®Æ¶°',
+ 'Directory' => '¥Ø¿ý',
+ 'Driver' => 'ÅX°Êµ{¦¡',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'Edit User' => '½s¿è¨Ï¥ÎªÌ',
+ 'Existing Datasets' => '¬J¦³ªº¸ê®Æ¶°',
+ 'Fax' => '¶Ç¯u',
+ 'Host' => '¥D¾÷',
+ 'Hostname missing!' => '¥¼«ü©ú¥D¾÷¦WºÙ!',
+ 'Incorrect Password!' => '±K½X¿ù»~!',
+ 'Language' => '»y¨t',
+ 'Leave host and port field empty unless you want to make a remote connection.' => '°£«D±z·Q­n¶i¦æ»·ºÝ³s½u, §_«h½Ð±N¥D¾÷¤Î°ð¸¹¯d¥Õ.',
+ 'Login' => 'µn¤J',
+ 'Name' => '¦WºÙ',
+ 'New Templates' => '·s¼W¼Òª©',
+ 'No Database Drivers available!' => '¨S¦³¥i¥ÎªºÅX°Êµ{¦¡!',
+ 'No Dataset selected!' => '¥¼¿ï©w¸ê®Æ¶°!',
+ 'Nothing to delete!' => '¨S¦³¥i§R°£ªº¶µ¥Ø',
+ 'Number Format' => '¼Æ¦r®æ¦¡',
+ 'Oracle Database Administration' => 'Oracle ¸ê®Æ®wºÞ²z',
+ 'Password' => '±K½X',
+ 'Password changed!' => 'Password changed!',
+ 'Pg Database Administration' => 'Pg ¸ê®Æ®wºÞ²z',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Port' => '°ð¸¹',
+ 'Port missing!' => '¥¼«ü©ú°ð¸¹!',
+ 'Printer' => '¦Lªí¾÷',
+ 'Save' => 'Àx¦s',
+ 'Select a Dataset to delete and press "Continue"' => '½Ð¿ï¾Ü±ý§R°£ªº¸ê®Æ¶°, ¦A«ö "Ä~Äò"',
+ 'Setup Templates' => '³]©w¼Òª©',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'ñ¦W',
+ 'Stylesheet' => '¼Ë¦¡ªí',
+ 'Templates' => '¼Òª©',
+ 'The following Datasets are not in use and can be deleted' => '¤U¦C¸ê®Æ¶°¨Ã¥¼¨Ï¥Î, ¥i¥H§R°£',
+ 'The following Datasets need to be updated' => '¤U¦C¸ê®Æ¶°»Ý­n§ó·s',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => '³o¬O¹ï¬J¦s¸ê®Æ¨Ó·½ªºªì¨BÀˬd. ¦b¦¹¶¥¬q, ¤£·|§R°£©Î·s¼W¥ô¦ó¸ê®Æ!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '­Y­n·s¼W¸s²Õ¤ºªº¨Ï¥ÎªÌ, ½Ð½s¿è¦WºÙ, §ó§ïµn¤J¦W, µM«áÀx¦s. ³o¼Ë¤@¨Ó, ·s¨Ï¥ÎªÌ·|«O¯d¬Û¦PªºÅܼÆ, ¨Ã¥H·sªºµn¤J¦W¦s¤J.',
+ 'Update Dataset' => '§ó·s¸ê®Æ¶°',
+ 'Use Templates' => '¨Ï¥Î¼Òª©',
+ 'User' => '¨Ï¥ÎªÌ',
+ 'User deleted!' => 'User deleted!',
+ 'User saved!' => 'User saved!',
+ 'Version' => 'ª©¥»',
+ 'You must enter a host and port for local and remote connections!' => '±z¥²»ÝÁä¤J¥D¾÷¤Î°ð¸¹, ¥H¶i¦æ¥»¾÷©Î»·ºÝ³s½u!',
+ 'does not exist' => '¤£¦s¦b',
+ 'is already a member!' => '¤w¸g¬O¦¨­û¤F!',
+ 'localhost' => 'localhost',
+ 'successfully created!' => '¦¨¥\«Ø¥ß!',
+ 'successfully deleted!' => '¦¨¥\§R°£!',
+ 'website' => 'ºô¯¸',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ '·s¼w¨Ï¥ÎªÌ' => 'add_user',
+ '§ó§ïºÞ²z­û±k½x' => 'change_admin_password',
+ '§ó§ï±k½x' => 'change_password',
+ 'Ä~Äò' => 'continue',
+ '«Ø¥ß¸ê®Æ¶°' => 'create_dataset',
+ '§r°£' => 'delete',
+ '§r°£¸ê®Æ¶°' => 'delete_dataset',
+ 'µn¤j' => 'login',
+ 'oracle_¸ê®Æ®wºÞ²z' => 'oracle_database_administration',
+ 'pg_¸ê®Æ®wºÞ²z' => 'pg_database_administration',
+ 'Àx¦s' => 'save',
+ '§ó·s¸ê®Æ¶°' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/all b/sql-ledger/locale/tw/all
new file mode 100644
index 000000000..016df2c0d
--- /dev/null
+++ b/sql-ledger/locale/tw/all
@@ -0,0 +1,487 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'À³¥I±b´Ú',
+ 'AP Aging' => 'À³¥I±bÄÖ¤ÀªR',
+ 'AP Transaction' => '',
+ 'AP Transactions' => 'À³¥I±b¥Ø',
+ 'AR' => 'À³¦¬±b´Ú',
+ 'AR Aging' => 'À³¦¬±bÄÖ¤ÀªR',
+ 'AR Transaction' => '',
+ 'AR Transactions' => 'À³¦¬±b¥Ø',
+ 'About' => 'Ãö©ó',
+ 'Access Control' => 'Åv­­±±¨î',
+ 'Account' => '¬ì¥Ø',
+ 'Account Number' => '¬ì¥Ø½s¸¹',
+ 'Account Number missing!' => 'º|¶ñ¬ì¥Ø½s¸¹!',
+ 'Account Type' => '¬ì¥ØÃþ§O',
+ 'Account Type missing!' => 'º|¶ñ¬ì¥ØÃþ§O!',
+ 'Account deleted!' => '',
+ 'Account saved!' => '',
+ 'Accounting' => '·|­p',
+ 'Accounting Menu' => '·|­p¿ï³æ',
+ 'Accounts' => '±b¤á',
+ 'Active' => '',
+ 'Add' => '·s¼W',
+ 'Add Account' => '·s¼W¬ì¥Ø',
+ 'Add Accounts Payables Transaction' => '',
+ 'Add Accounts Receivables Transaction' => '',
+ 'Add Assembly' => '·s¼W°Ó«~',
+ 'Add Customer' => '·s¼W«È¤á',
+ 'Add GIFI' => '·s¼W GIFI',
+ 'Add General Ledger Transaction' => '·s¼WÁ`±b',
+ 'Add Part' => '·s¼W­ì®Æ',
+ 'Add Project' => '',
+ 'Add Purchase Invoice' => '',
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Invoice' => '',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Add Service' => '·s¼WªA°È',
+ 'Add Transaction' => '·s¼W±b¥Ø',
+ 'Add User' => '·s¼W¨Ï¥ÎªÌ',
+ 'Add Vendor' => '·s¼W¼t°Ó',
+ 'Address' => '¦a§}',
+ 'Administration' => '¨t²ÎºÞ²z',
+ 'Administrator' => '',
+ 'All' => '¥þ³¡',
+ 'All Datasets up to date!' => '©Ò¦³¸ê®Æ¬Ò¤w§ó·s!',
+ 'Amount' => 'Á`­p',
+ 'Amount Due' => '',
+ 'Amount does not equal applied!' => '',
+ 'Amount missing!' => '',
+ 'Applied' => '',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Invoice Number' => '±z½T©w­n§R°£µo²¼½s¸¹',
+ 'Are you sure you want to delete Order Number' => '±z¬O§_½T©w­n§R°£­q³æ',
+ 'Are you sure you want to delete Transaction' => '±z½T©w­n§R°£±b¥Ø',
+ 'Assemblies' => '°Ó«~',
+ 'Assemblies restocked!' => '',
+ 'Assembly Number missing!' => '¬dµL¦¹°Ó«~!',
+ 'Asset' => '¸ê²£',
+ 'Attachment' => 'ªþÀÉ',
+ 'Audit Control' => '½]®Ö±±¨î',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'BOM' => '',
+ 'Backup' => '³Æ¥÷',
+ 'Backup sent to' => '³Æ¥÷±H°e¨ì',
+ 'Balance' => '',
+ 'Balance Sheet' => '¸ê²£­t¶Åªí',
+ 'Bcc' => '',
+ 'Bin' => '½c',
+ 'Books are open' => '±bï¤w¶}±Ò',
+ 'Bought' => '¤wÁʶR',
+ 'Business Number' => '²Î¤@½s¸¹',
+ 'C' => '',
+ 'COGS' => '³f¾P¦¨¥»',
+ 'Cannot delete account!' => '',
+ 'Cannot delete customer!' => '',
+ 'Cannot delete default account!' => '',
+ 'Cannot delete invoice!' => '',
+ 'Cannot delete item already invoiced!' => '',
+ 'Cannot delete item on order!' => 'µLªk§R°£³æ¤Wªº¶µ¥Ø!',
+ 'Cannot delete item which is part of an assembly!' => '',
+ 'Cannot delete item!' => '',
+ 'Cannot delete order!' => '',
+ 'Cannot delete transaction!' => '',
+ 'Cannot delete vendor!' => '',
+ 'Cannot have a value in both Debit and Credit!' => '',
+ 'Cannot post a transaction without a value!' => '',
+ 'Cannot post invoice for a closed period!' => '',
+ 'Cannot post invoice!' => '',
+ 'Cannot post payment for a closed period!' => '',
+ 'Cannot post payment!' => '',
+ 'Cannot post transaction for a closed period!' => 'µLªk¦b¤wÃö³¬ªº®É¬q¤º¥[¤J¥æ©ö!',
+ 'Cannot post transaction!' => '',
+ 'Cannot process payment for a closed period!' => '',
+ 'Cannot save account!' => '',
+ 'Cannot save order!' => '',
+ 'Cannot save preferences!' => '',
+ 'Cannot stock assemblies!' => '',
+ 'Cash' => '',
+ 'Cash based' => '',
+ 'Cc' => '',
+ 'Change Admin Password' => '§ó§ïºÞ²z­û±K½X',
+ 'Change Password' => '§ó§ï±K½X',
+ 'Character Set' => '¦r¤¸¶°',
+ 'Chart of Accounts' => '·|­p¬ì¥Øªí',
+ 'Check' => '',
+ 'Check printed!' => '',
+ 'Check printing failed!' => '',
+ 'Cleared Balance' => '',
+ 'Click on login name to edit!' => '½Ð«öµn¤J¦WºÙ¥H¶i¦æ­×§ï!',
+ 'Close Books up to' => 'Ãö³¬¨ì¦¹¬°¤îªº±bï',
+ 'Closed' => '¤wÃö³¬',
+ 'Company' => '¤½¥q¦WºÙ',
+ 'Compare to' => '¹ï·Ó',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Connect to' => '³sµ²¨ì',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Copy to COA' => '½Æ»s¨ì COA',
+ 'Create Chart of Accounts' => '«Ø¥ß±b¤á¹Ïªí',
+ 'Create Dataset' => '«Ø¥ß¸ê®Æ¶°',
+ 'Credit' => '¶U¤è',
+ 'Credit Limit' => '«H¥ÎÃB«×',
+ 'Curr' => '¥Ø«e',
+ 'Currency' => '¹ô§O',
+ 'Current' => '',
+ 'Customer' => '«È¤á',
+ 'Customer deleted!' => '',
+ 'Customer missing!' => '',
+ 'Customer not on file!' => '',
+ 'Customer saved!' => '',
+ 'Customers' => '',
+ 'DBI not installed!' => '¥¼¦w¸Ë DBI ¼Ò²Õ!',
+ 'Database' => '¸ê®Æ®w',
+ 'Database Administration' => '¸ê®Æ®wºÞ²z',
+ 'Database Driver not checked!' => '¥¼¿ï©w¸ê®Æ®wÅX°Êµ{¦¡!',
+ 'Database Host' => '¸ê®Æ®w¥D¾÷',
+ 'Database User missing!' => '¥¼«ü©ú¸ê®Æ®w¨Ï¥ÎªÌ!',
+ 'Dataset' => '¸ê®Æ¶°',
+ 'Dataset missing!' => '¥¼«ü©ú¸ê®Æ¶°!',
+ 'Dataset updated!' => '',
+ 'Date' => '¤é´Á',
+ 'Date Due' => 'À³¥I¤é´Á',
+ 'Date Format' => '¤é´Á®æ¦¡',
+ 'Date Paid' => '¥I´Ú¤é´Á',
+ 'Date missing!' => '',
+ 'Debit' => '­É¤è',
+ 'Debit and credit out of balance!' => '­É¶U¤£¥­¿Å!',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Decimalplaces' => '',
+ 'Delete' => '§R°£',
+ 'Delete Account' => '§R°£¬ì¥Ø',
+ 'Delete Dataset' => '§R°£¸ê®Æ¶°',
+ 'Delivery Date' => '',
+ 'Deposit' => '',
+ 'Description' => '»¡©ú',
+ 'Difference' => '',
+ 'Directory' => '¥Ø¿ý',
+ 'Discount' => '§é¦©',
+ 'Done' => '',
+ 'Drawing' => '',
+ 'Driver' => 'ÅX°Êµ{¦¡',
+ 'Dropdown Limit' => '',
+ 'Due' => '¨ì´Á',
+ 'Due Date' => '¨ì´Á¤é',
+ 'Due Date missing!' => 'º|¶ñ¨ì´Á¤é!',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail Statement to' => '',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Edit' => '',
+ 'Edit Account' => '½s¿è¬ì¥Ø',
+ 'Edit Accounts Payables Transaction' => '',
+ 'Edit Accounts Receivables Transaction' => '',
+ 'Edit Assembly' => '½s¿è°Ó«~',
+ 'Edit GIFI' => '½s¿è GIFI',
+ 'Edit General Ledger Transaction' => '½s¿èÁ`±b',
+ 'Edit Part' => '½s¿è­ì®Æ',
+ 'Edit Preferences for' => '³]©w¨Ï¥ÎªÌ',
+ 'Edit Project' => '',
+ 'Edit Purchase Invoice' => '',
+ 'Edit Purchase Order' => '½s¿è±ÄÁʳæ',
+ 'Edit Sales Invoice' => '',
+ 'Edit Sales Order' => '½s¿è¾P³f³æ',
+ 'Edit Service' => '½s¿èªA°È',
+ 'Edit Template' => '½s¿è¼Òª©',
+ 'Edit User' => '½s¿è¨Ï¥ÎªÌ',
+ 'Employee' => '',
+ 'Enforce transaction reversal for all dates' => '±j¨î©Ò¦³¤é´Áªº¥æ©ö¦^´_',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '½ÐÁä¤J¥H«_¸¹¤À¹jªº­^¤å¦r¥À, ¨C¶µ¤£¶W¹L¤T­Ó¦r (¦p CAD:USD:EUR), §@¬°±zªº¥»°ê¤Î¥~°ê³f¹ô',
+ 'Equity' => 'ªÑÅv',
+ 'Exch' => '¶×²v',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate Difference' => '',
+ 'Exchangerate for payment missing!' => '',
+ 'Exchangerate missing!' => '',
+ 'Existing Datasets' => '¬J¦³ªº¸ê®Æ¶°',
+ 'Expense' => '¶O¥Î',
+ 'Expense Account' => '¶O¥Î¬ì¥Ø',
+ 'Expense/Asset' => '¶O¥Î/¸ê²£',
+ 'Extended' => '',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'Foreign Exchange Gain' => '¥~¶×¦¬¯q',
+ 'Foreign Exchange Loss' => '¥~¶×·l¥¢',
+ 'From' => '±q',
+ 'GIFI' => '',
+ 'GIFI deleted!' => '',
+ 'GIFI missing!' => '¥¼«ü©ú GIFI!',
+ 'GIFI saved!' => '',
+ 'GL Transaction' => '',
+ 'General Ledger' => 'Á`±b',
+ 'Goods & Services' => '³fª«¤ÎªA°È',
+ 'HTML Templates' => 'HTML ªí³æ',
+ 'Heading' => 'ªíÀY',
+ 'Host' => '¥D¾÷',
+ 'Hostname missing!' => '¥¼«ü©ú¥D¾÷¦WºÙ!',
+ 'ID' => '½s¸¹',
+ 'Image' => '',
+ 'In-line' => '¦æ¤º',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Include in drop-down menus' => '¥]§t¦b¤U©Ô¦¡¿ï³æ¤¤',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => '­n±N³o­Ó«È¤á/¼t°Ó¥[¤JÀ³¥[µ|²M³æ?',
+ 'Income' => '¦¬¯q',
+ 'Income Account' => '·l¯q¬ì¥Ø',
+ 'Income Statement' => '·l¯qªí',
+ 'Incorrect Dataset version!' => '¸ê®Æ¶°ª©¥»¿ù»~!',
+ 'Incorrect Password!' => '±K½X¿ù»~!',
+ 'Individual Items' => '²Õ¦¨¶µ¥Ø',
+ 'Inventory' => '®w¦s',
+ 'Inventory Account' => '¦s³f¬ì¥Ø',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => '¦b°±¥Î¦¹¶µ²Õ¦X«~¤§«e, ¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => '°±¥Î¦¹¶µ¹s¥ó¤§«e, ¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Inventory quantity must be zero!' => '¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date' => 'µo²¼¤é´Á',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Invoice deleted!' => '',
+ 'Invoice posted!' => '',
+ 'Invoices' => '',
+ 'Is this a summary account to record' => '¦¹¬°Á`µ²¬ì¥Ø¶Ü?',
+ 'Item deleted!' => '',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'LaTeX Templates' => 'LaTex ¼Òª©',
+ 'Language' => '»y¨t',
+ 'Last Cost' => '¤W¤@µ§¦¨¥»',
+ 'Last Invoice Number' => '¤W¤@µ§µo²¼½s¸¹',
+ 'Last Numbers & Default Accounts' => '¤W¤@µ§½s¸¹¤Î¹w³]¬ì¥Ø',
+ 'Last Purchase Order Number' => '«e¦¸±ÄÁʳ渹',
+ 'Last Sales Order Number' => '«e¦¸¾P',
+ 'Leave host and port field empty unless you want to make a remote connection.' => '°£«D±z·Q­n¶i¦æ»·ºÝ³s½u, §_«h½Ð±N¥D¾÷¤Î°ð¸¹¯d¥Õ.',
+ 'Liability' => '­t¶Å',
+ 'Licensed to' => '±ÂÅv¤©',
+ 'Line Total' => 'Á`¦C¼Æ',
+ 'Link' => '³sµ²',
+ 'Link Accounts' => '³sµ²¬ì¥Ø',
+ 'List Accounts' => '¦C¥X±b¸¹',
+ 'List GIFI' => '¦C¥X GIFI',
+ 'List Price' => '¶i»ù',
+ 'List Transactions' => '¦C¥X±b¥Ø',
+ 'Login' => 'µn¤J',
+ 'Logout' => 'µn¥X',
+ 'Make' => '»s³y',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Microfiche' => '',
+ 'Model' => '«¬¸¹',
+ 'N/A' => '¤£¾A¥Î',
+ 'Name' => '¦WºÙ',
+ 'Name missing!' => '',
+ 'New Templates' => '·s¼W¼Òª©',
+ 'No' => '§_',
+ 'No Database Drivers available!' => '¨S¦³¥i¥ÎªºÅX°Êµ{¦¡!',
+ 'No Dataset selected!' => '¥¼¿ï©w¸ê®Æ¶°!',
+ 'No email address for' => '¥¼«ü©ú¹q¤l¶l¥ó¦ì¸m',
+ 'No.' => '',
+ 'Notes' => '³Æµù',
+ 'Nothing applied!' => '',
+ 'Nothing selected!' => '',
+ 'Nothing to delete!' => '¨S¦³¥i§R°£ªº¶µ¥Ø',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number Format' => '¼Æ¦r®æ¦¡',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'O' => '',
+ 'Obsolete' => '°±¥Î',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'On Hand' => '¦s¶q',
+ 'On Order' => '',
+ 'Open' => '¶}±Ò',
+ 'Oracle Database Administration' => 'Oracle ¸ê®Æ®wºÞ²z',
+ 'Order' => '­q³æ',
+ 'Order Date' => '¤U³æ¤é´Á',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Entry' => '¤U³æ¶µ¥Ø',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'Order deleted!' => '',
+ 'Order saved!' => '',
+ 'Ordered' => '',
+ 'Orphaned' => 'µL¥D',
+ 'Out of balance!' => '',
+ 'PDF' => '',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Paid' => '¤w¥I',
+ 'Paid in full' => '',
+ 'Part' => '­ì®Æ',
+ 'Part Number missing!' => 'º|¶ñ­ì®Æ½s¸¹!',
+ 'Parts' => '­ì®Æ',
+ 'Parts Inventory' => '®w¦s­ì®Æ',
+ 'Password' => '±K½X',
+ 'Password changed!' => '',
+ 'Payables' => 'À³¥I¬ì¥Ø',
+ 'Payment' => '¥I´Ú¤è¦¡',
+ 'Payment date missing!' => '¥¼«ü©ú¥I´Ú¤é´Á!',
+ 'Payment posted!' => '',
+ 'Payments' => '¥I´Ú',
+ 'Pg Database Administration' => 'Pg ¸ê®Æ®wºÞ²z',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Port' => '°ð¸¹',
+ 'Port missing!' => '¥¼«ü©ú°ð¸¹!',
+ 'Post' => '',
+ 'Post as new' => '',
+ 'Postscript' => '',
+ 'Preferences' => '­Ó¤H³]©w',
+ 'Preferences saved!' => '­Ó¤H³]©w¤wÀx¦s!',
+ 'Price' => '»ù®æ',
+ 'Print' => '',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => '',
+ 'Project Number missing!' => '',
+ 'Project deleted!' => '',
+ 'Project not on file!' => '',
+ 'Project saved!' => '',
+ 'Projects' => '',
+ 'Purchase Invoice' => '',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Purchase Orders' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'ROP' => '¦A­qÂI',
+ 'Rate' => 'µ|²v',
+ 'Recd' => '',
+ 'Receipt' => '',
+ 'Receipts' => '',
+ 'Receivables' => 'À³¦¬¬ì¥Ø',
+ 'Reconciliation' => '',
+ 'Record in' => '°O¿ý©ó',
+ 'Reference' => '',
+ 'Reference missing!' => '',
+ 'Remaining' => '©|¾l',
+ 'Report for' => '³øªí¨Ó·½',
+ 'Reports' => '³øªí',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Retained Earnings' => '«O¯d¬Õ¾l',
+ 'Sales' => '·~°È',
+ 'Sales Invoice' => '',
+ 'Sales Order' => '¾P³f³æ',
+ 'Sales Orders' => '¾P³f³æ',
+ 'Save' => 'Àx¦s',
+ 'Save as new' => '',
+ 'Save to File' => 'Àx¦s¦ÜÀÉ®×',
+ 'Screen' => '¿Ã¹õ',
+ 'Select a Dataset to delete and press "Continue"' => '½Ð¿ï¾Ü±ý§R°£ªº¸ê®Æ¶°, ¦A«ö "Ä~Äò"',
+ 'Select all' => '',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select from one of the names below' => '',
+ 'Select from one of the projects below' => '',
+ 'Select postscript or PDF!' => '',
+ 'Sell Price' => '°â»ù',
+ 'Send by E-Mail' => '¥H¹q¤l¶l¥ó±H°e',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Service Items' => 'ªA°È¶µ¥Ø',
+ 'Service Number missing!' => 'º|¶ñªA°È½s¸¹!',
+ 'Services' => 'ªA°È',
+ 'Setup Templates' => '³]©w¼Òª©',
+ 'Ship' => '',
+ 'Ship to' => '',
+ 'Ship via' => '',
+ 'Short' => 'µu',
+ 'Signature' => 'ñ¦W',
+ 'Sold' => '¤w½æ¥X',
+ 'Source' => '¨Ó·½',
+ 'Standard' => '¼Ð·Ç',
+ 'Statement' => '',
+ 'Statement Balance' => '',
+ 'Statement sent to' => '',
+ 'Statements sent to printer!' => '',
+ 'Stock Assembly' => '½LÂI',
+ 'Stylesheet' => '¼Ë¦¡ªí',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'System' => '¨t²Î',
+ 'Tax' => 'µ|ª÷',
+ 'Tax Accounts' => 'µ|ª÷¬ì¥Ø',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'Tax collected' => '',
+ 'Tax paid' => '',
+ 'Taxable' => 'À³µ|',
+ 'Template saved!' => '',
+ 'Templates' => '¼Òª©',
+ 'Terms: Net' => '²¼´Á²b­p',
+ 'The following Datasets are not in use and can be deleted' => '¤U¦C¸ê®Æ¶°¨Ã¥¼¨Ï¥Î, ¥i¥H§R°£',
+ 'The following Datasets need to be updated' => '¤U¦C¸ê®Æ¶°»Ý­n§ó·s',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => '³o¬O¹ï¬J¦s¸ê®Æ¨Ó·½ªºªì¨BÀˬd. ¦b¦¹¶¥¬q, ¤£·|§R°£©Î·s¼W¥ô¦ó¸ê®Æ!',
+ 'To' => '¦Ü',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => '­Y­n·s¼W¸s²Õ¤ºªº¨Ï¥ÎªÌ, ½Ð½s¿è¦WºÙ, §ó§ïµn¤J¦W, µM«áÀx¦s. ³o¼Ë¤@¨Ó, ·s¨Ï¥ÎªÌ·|«O¯d¬Û¦PªºÅܼÆ, ¨Ã¥H·sªºµn¤J¦W¦s¤J.',
+ 'Top Level' => '',
+ 'Total' => 'Á`­p',
+ 'Transaction Date missing!' => 'º|¶ñ±b¥Ø¤é´Á!',
+ 'Transaction deleted!' => '',
+ 'Transaction posted!' => '',
+ 'Transaction reversal enforced for all dates' => '±j¨î¦^´_©Ò¦³¤é´Áªº¥æ©ö',
+ 'Transaction reversal enforced up to' => '±j¨î¦^´_¥æ©öª½¨ì',
+ 'Transactions' => '±b¥Ø',
+ 'Transactions exist, cannot delete customer!' => '¦¹«È¤á¤w¦³±b¥Ø, ¤£¯à§R°£!',
+ 'Transactions exist, cannot delete vendor!' => '¦¹¼t°Ó¤w¦³±b¥Ø, ¤£¯à§R°£!',
+ 'Transactions exist; cannot delete account!' => '©|¦³¥æ©ö¦s¦b; µLªk§R°£±b¤á!',
+ 'Trial Balance' => '¸Õºâªí',
+ 'Unit' => '³æ¦ì',
+ 'Unit of measure' => '«×¶q³æ¦ì',
+ 'Update' => '',
+ 'Update Dataset' => '§ó·s¸ê®Æ¶°',
+ 'Updated' => '',
+ 'Use Templates' => '¨Ï¥Î¼Òª©',
+ 'User' => '¨Ï¥ÎªÌ',
+ 'User deleted!' => '',
+ 'User saved!' => '',
+ 'Vendor' => '¼t°Ó',
+ 'Vendor deleted!' => '',
+ 'Vendor missing!' => '',
+ 'Vendor not on file!' => '',
+ 'Vendor saved!' => '',
+ 'Vendors' => '',
+ 'Version' => 'ª©¥»',
+ 'Weight' => '­«¶q',
+ 'Weight Unit' => '­«¶q³æ¦ì',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'Year End' => '·|­p¦~«×',
+ 'Yes' => '¬O',
+ 'You are logged out!' => '',
+ 'You did not enter a name!' => '±z¨Ã¥¼Áä¤J¦WºÙ!',
+ 'You must enter a host and port for local and remote connections!' => '±z¥²»ÝÁä¤J¥D¾÷¤Î°ð¸¹, ¥H¶i¦æ¥»¾÷©Î»·ºÝ³s½u!',
+ 'as at' => '',
+ 'collected on sales' => '¦b¾P³f®Éµ²²M',
+ 'days' => '¤é',
+ 'does not exist' => '¤£¦s¦b',
+ 'ea' => '­Ó',
+ 'emailed to' => '¤w±H¦Ü',
+ 'for Period' => '´Á¶¡',
+ 'hr' => 'hr',
+ 'is already a member!' => '¤w¸g¬O¦¨­û¤F!',
+ 'is not a member!' => '¨Ã¤£¬O¦¨­û!',
+ 'localhost' => 'localhost',
+ 'paid on purchases' => '¦b±ÄÁʮɵ²²M',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+ 'successfully created!' => '¦¨¥\«Ø¥ß!',
+ 'successfully deleted!' => '¦¨¥\§R°£!',
+ 'to' => '',
+ 'website' => 'ºô¯¸',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/am b/sql-ledger/locale/tw/am
new file mode 100644
index 000000000..77df0d322
--- /dev/null
+++ b/sql-ledger/locale/tw/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'À³¥I±b´Ú',
+ 'AR' => 'À³¦¬±b´Ú',
+ 'Account' => '¬ì¥Ø',
+ 'Account Number' => '¬ì¥Ø½s¸¹',
+ 'Account Number missing!' => 'º|¶ñ¬ì¥Ø½s¸¹!',
+ 'Account Type' => '¬ì¥ØÃþ§O',
+ 'Account Type missing!' => 'º|¶ñ¬ì¥ØÃþ§O!',
+ 'Account deleted!' => 'Account deleted!',
+ 'Account saved!' => 'Account saved!',
+ 'Add Account' => '·s¼W¬ì¥Ø',
+ 'Add GIFI' => '·s¼W GIFI',
+ 'Address' => '¦a§}',
+ 'Asset' => '¸ê²£',
+ 'Audit Control' => '½]®Ö±±¨î',
+ 'Backup sent to' => '³Æ¥÷±H°e¨ì',
+ 'Books are open' => '±bï¤w¶}±Ò',
+ 'Business Number' => '²Î¤@½s¸¹',
+ 'COGS' => '³f¾P¦¨¥»',
+ 'Cannot delete account!' => 'Cannot delete account!',
+ 'Cannot delete default account!' => 'Cannot delete default account!',
+ 'Cannot save account!' => 'Cannot save account!',
+ 'Cannot save preferences!' => 'Cannot save preferences!',
+ 'Character Set' => '¦r¤¸¶°',
+ 'Chart of Accounts' => '·|­p¬ì¥Øªí',
+ 'Close Books up to' => 'Ãö³¬¨ì¦¹¬°¤îªº±bï',
+ 'Company' => '¤½¥q¦WºÙ',
+ 'Continue' => 'Ä~Äò',
+ 'Copy to COA' => '½Æ»s¨ì COA',
+ 'Credit' => '¶U¤è',
+ 'Date Format' => '¤é´Á®æ¦¡',
+ 'Debit' => '­É¤è',
+ 'Delete' => '§R°£',
+ 'Delete Account' => '§R°£¬ì¥Ø',
+ 'Description' => '»¡©ú',
+ 'Dropdown Limit' => 'Dropdown Limit',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'Edit' => 'Edit',
+ 'Edit Account' => '½s¿è¬ì¥Ø',
+ 'Edit GIFI' => '½s¿è GIFI',
+ 'Edit Preferences for' => '³]©w¨Ï¥ÎªÌ',
+ 'Edit Template' => '½s¿è¼Òª©',
+ 'Enforce transaction reversal for all dates' => '±j¨î©Ò¦³¤é´Áªº¥æ©ö¦^´_',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '½ÐÁä¤J¥H«_¸¹¤À¹jªº­^¤å¦r¥À, ¨C¶µ¤£¶W¹L¤T­Ó¦r (¦p CAD:USD:EUR), §@¬°±zªº¥»°ê¤Î¥~°ê³f¹ô',
+ 'Equity' => 'ªÑÅv',
+ 'Expense' => '¶O¥Î',
+ 'Expense Account' => '¶O¥Î¬ì¥Ø',
+ 'Expense/Asset' => '¶O¥Î/¸ê²£',
+ 'Fax' => '¶Ç¯u',
+ 'Foreign Exchange Gain' => '¥~¶×¦¬¯q',
+ 'Foreign Exchange Loss' => '¥~¶×·l¥¢',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI deleted!',
+ 'GIFI missing!' => '¥¼«ü©ú GIFI!',
+ 'GIFI saved!' => 'GIFI saved!',
+ 'Heading' => 'ªíÀY',
+ 'Include in drop-down menus' => '¥]§t¦b¤U©Ô¦¡¿ï³æ¤¤',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => '­n±N³o­Ó«È¤á/¼t°Ó¥[¤JÀ³¥[µ|²M³æ?',
+ 'Income' => '¦¬¯q',
+ 'Income Account' => '·l¯q¬ì¥Ø',
+ 'Inventory' => '®w¦s',
+ 'Inventory Account' => '¦s³f¬ì¥Ø',
+ 'Is this a summary account to record' => '¦¹¬°Á`µ²¬ì¥Ø¶Ü?',
+ 'Language' => '»y¨t',
+ 'Last Invoice Number' => '¤W¤@µ§µo²¼½s¸¹',
+ 'Last Numbers & Default Accounts' => '¤W¤@µ§½s¸¹¤Î¹w³]¬ì¥Ø',
+ 'Last Purchase Order Number' => '«e¦¸±ÄÁʳ渹',
+ 'Last Sales Order Number' => '«e¦¸¾P',
+ 'Liability' => '­t¶Å',
+ 'Link' => '³sµ²',
+ 'Name' => '¦WºÙ',
+ 'No' => '§_',
+ 'No email address for' => '¥¼«ü©ú¹q¤l¶l¥ó¦ì¸m',
+ 'Number' => '½s¸¹',
+ 'Number Format' => '¼Æ¦r®æ¦¡',
+ 'Parts Inventory' => '®w¦s­ì®Æ',
+ 'Password' => '±K½X',
+ 'Payables' => 'À³¥I¬ì¥Ø',
+ 'Payment' => '¥I´Ú¤è¦¡',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Preferences saved!' => '­Ó¤H³]©w¤wÀx¦s!',
+ 'Rate' => 'µ|²v',
+ 'Receivables' => 'À³¦¬¬ì¥Ø',
+ 'Sales' => '·~°È',
+ 'Save' => 'Àx¦s',
+ 'Service Items' => 'ªA°È¶µ¥Ø',
+ 'Ship via' => 'Ship via',
+ 'Signature' => 'ñ¦W',
+ 'Stylesheet' => '¼Ë¦¡ªí',
+ 'Tax' => 'µ|ª÷',
+ 'Tax Accounts' => 'µ|ª÷¬ì¥Ø',
+ 'Template saved!' => 'Template saved!',
+ 'Transaction reversal enforced for all dates' => '±j¨î¦^´_©Ò¦³¤é´Áªº¥æ©ö',
+ 'Transaction reversal enforced up to' => '±j¨î¦^´_¥æ©öª½¨ì',
+ 'Transactions exist; cannot delete account!' => '©|¦³¥æ©ö¦s¦b; µLªk§R°£±b¤á!',
+ 'Weight Unit' => '­«¶q³æ¦ì',
+ 'Year End' => '·|­p¦~«×',
+ 'Yes' => '¬O',
+ 'does not exist' => '¤£¦s¦b',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ '·s¼w¬ì¥Ø' => 'add_account',
+ 'Ä~Äò' => 'continue',
+ '½Æ»s¨ì_coa' => 'copy_to_coa',
+ '§r°£' => 'delete',
+ 'edit' => 'edit',
+ '½s¿è¬ì¥Ø' => 'edit_account',
+ 'Àx¦s' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ap b/sql-ledger/locale/tw/ap
new file mode 100644
index 000000000..c25179765
--- /dev/null
+++ b/sql-ledger/locale/tw/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AP Transactions' => 'À³¥I±b¥Ø',
+ 'Account' => '¬ì¥Ø',
+ 'Add Accounts Payables Transaction' => 'Add Accounts Payables Transaction',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Transaction' => '±z½T©w­n§R°£±b¥Ø',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'µLªk¦b¤wÃö³¬ªº®É¬q¤º¥[¤J¥æ©ö!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => '¤wÃö³¬',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Continue' => 'Ä~Äò',
+ 'Currency' => '¹ô§O',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Date Paid' => '¥I´Ú¤é´Á',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Description' => '»¡©ú',
+ 'Due Date' => '¨ì´Á¤é',
+ 'Due Date missing!' => 'º|¶ñ¨ì´Á¤é!',
+ 'Edit Accounts Payables Transaction' => 'Edit Accounts Payables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => '¶×²v',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'ID' => '½s¸¹',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date' => 'µo²¼¤é´Á',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Open' => '¶}±Ò',
+ 'Order' => '­q³æ',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Paid' => '¤w¥I',
+ 'Payment date missing!' => '¥¼«ü©ú¥I´Ú¤é´Á!',
+ 'Payments' => '¥I´Ú',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Source' => '¨Ó·½',
+ 'Subtotal' => '¤p­p',
+ 'Tax' => 'µ|ª÷',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor' => '¼t°Ó',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => '¬O',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'add_accounts_payables_transaction' => 'add_accounts_payables_transaction',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ 'edit_accounts_payables_transaction' => 'edit_accounts_payables_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ar b/sql-ledger/locale/tw/ar
new file mode 100644
index 000000000..a864b4174
--- /dev/null
+++ b/sql-ledger/locale/tw/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'AR Transaction',
+ 'AR Transactions' => 'À³¦¬±b¥Ø',
+ 'Account' => '¬ì¥Ø',
+ 'Add Accounts Receivables Transaction' => 'Add Accounts Receivables Transaction',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Amount Due' => 'Amount Due',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Transaction' => '±z½T©w­n§R°£±b¥Ø',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cannot post transaction for a closed period!' => 'µLªk¦b¤wÃö³¬ªº®É¬q¤º¥[¤J¥æ©ö!',
+ 'Cannot post transaction!' => 'Cannot post transaction!',
+ 'Closed' => '¤wÃö³¬',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Continue' => 'Ä~Äò',
+ 'Credit Limit' => '«H¥ÎÃB«×',
+ 'Currency' => '¹ô§O',
+ 'Customer' => '«È¤á',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Date Paid' => '¥I´Ú¤é´Á',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Description' => '»¡©ú',
+ 'Due Date' => '¨ì´Á¤é',
+ 'Due Date missing!' => 'º|¶ñ¨ì´Á¤é!',
+ 'Edit Accounts Receivables Transaction' => 'Edit Accounts Receivables Transaction',
+ 'Employee' => 'Employee',
+ 'Exch' => '¶×²v',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'ID' => '½s¸¹',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date' => 'µo²¼¤é´Á',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Open' => '¶}±Ò',
+ 'Order' => '­q³æ',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Paid' => '¤w¥I',
+ 'Payment date missing!' => '¥¼«ü©ú¥I´Ú¤é´Á!',
+ 'Payments' => '¥I´Ú',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Remaining' => '©|¾l',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Source' => '¨Ó·½',
+ 'Subtotal' => '¤p­p',
+ 'Tax' => 'µ|ª÷',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => '¬O',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ar_transaction' => 'ar_transaction',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/arap b/sql-ledger/locale/tw/arap
new file mode 100644
index 000000000..e82552c06
--- /dev/null
+++ b/sql-ledger/locale/tw/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => '¦a§}',
+ 'Continue' => 'Ä~Äò',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Description' => '»¡©ú',
+ 'Number' => '½s¸¹',
+ 'Project not on file!' => 'Project not on file!',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'Ä~Äò' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ca b/sql-ledger/locale/tw/ca
new file mode 100644
index 000000000..677a41fd9
--- /dev/null
+++ b/sql-ledger/locale/tw/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => '¬ì¥Ø',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => '·|­p¬ì¥Øªí',
+ 'Credit' => '¶U¤è',
+ 'Date' => '¤é´Á',
+ 'Debit' => '­É¤è',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Description' => '»¡©ú',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'List Transactions' => '¦C¥X±b¥Ø',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Reference' => 'Reference',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Subtotal' => '¤p­p',
+ 'To' => '¦Ü',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ '¦c¥x±b¥Ø' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/cp b/sql-ledger/locale/tw/cp
new file mode 100644
index 000000000..af8421af7
--- /dev/null
+++ b/sql-ledger/locale/tw/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => '¬ì¥Ø',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Amount does not equal applied!' => 'Amount does not equal applied!',
+ 'Amount missing!' => 'Amount missing!',
+ 'Applied' => 'Applied',
+ 'Cannot post payment!' => 'Cannot post payment!',
+ 'Cannot process payment for a closed period!' => 'Cannot process payment for a closed period!',
+ 'Check' => 'Check',
+ 'Check printed!' => 'Check printed!',
+ 'Check printing failed!' => 'Check printing failed!',
+ 'Continue' => 'Ä~Äò',
+ 'Currency' => '¹ô§O',
+ 'Customer' => '«È¤á',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Date missing!' => 'Date missing!',
+ 'Description' => '»¡©ú',
+ 'Due' => '¨ì´Á',
+ 'Exchangerate' => '¶×²v',
+ 'From' => '±q',
+ 'Invoice' => 'µo²¼',
+ 'Invoices' => 'Invoices',
+ 'Nothing applied!' => 'Nothing applied!',
+ 'Number' => '½s¸¹',
+ 'Paid in full' => 'Paid in full',
+ 'Payment' => '¥I´Ú¤è¦¡',
+ 'Payment posted!' => 'Payment posted!',
+ 'Post' => 'Post',
+ 'Print' => 'Print',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project not on file!' => 'Project not on file!',
+ 'Receipt' => 'Receipt',
+ 'Reference' => 'Reference',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'To' => '¦Ü',
+ 'Update' => 'Update',
+ 'Vendor' => '¼t°Ó',
+ 'Vendor not on file!' => 'Vendor not on file!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'Ä~Äò' => 'continue',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ct b/sql-ledger/locale/tw/ct
new file mode 100644
index 000000000..1597c9fa7
--- /dev/null
+++ b/sql-ledger/locale/tw/ct
@@ -0,0 +1,69 @@
+$self{texts} = {
+ 'Add' => '·s¼W',
+ 'Address' => '¦a§}',
+ 'All' => '¥þ³¡',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'Cannot delete customer!',
+ 'Cannot delete vendor!' => 'Cannot delete vendor!',
+ 'Cc' => 'Cc',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Credit Limit' => '«H¥ÎÃB«×',
+ 'Customer deleted!' => 'Customer deleted!',
+ 'Customer saved!' => 'Customer saved!',
+ 'Customers' => 'Customers',
+ 'Delete' => '§R°£',
+ 'Discount' => '§é¦©',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'Fax' => '¶Ç¯u',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Invoice' => 'µo²¼',
+ 'Name' => '¦WºÙ',
+ 'Name missing!' => 'Name missing!',
+ 'Notes' => '³Æµù',
+ 'Number' => '½s¸¹',
+ 'Order' => '­q³æ',
+ 'Orphaned' => 'µL¥D',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Save' => 'Àx¦s',
+ 'Ship to' => 'Ship to',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'Taxable' => 'À³µ|',
+ 'Terms: Net' => '²¼´Á²b­p',
+ 'Transactions exist, cannot delete customer!' => '¦¹«È¤á¤w¦³±b¥Ø, ¤£¯à§R°£!',
+ 'Transactions exist, cannot delete vendor!' => '¦¹¼t°Ó¤w¦³±b¥Ø, ¤£¯à§R°£!',
+ 'Vendor deleted!' => 'Vendor deleted!',
+ 'Vendor saved!' => 'Vendor saved!',
+ 'Vendors' => 'Vendors',
+ 'days' => '¤é',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ '·s¼w' => 'add',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ 'µo²¼' => 'invoice',
+ '­q³æ' => 'order',
+ 'Àx¦s' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/gl b/sql-ledger/locale/tw/gl
new file mode 100644
index 000000000..ce671a945
--- /dev/null
+++ b/sql-ledger/locale/tw/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'AP Transaction',
+ 'AR Transaction' => 'AR Transaction',
+ 'Account' => '¬ì¥Ø',
+ 'Add General Ledger Transaction' => '·s¼WÁ`±b',
+ 'Address' => '¦a§}',
+ 'All' => '¥þ³¡',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Transaction' => '±z½T©w­n§R°£±b¥Ø',
+ 'Asset' => '¸ê²£',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'Cannot delete transaction!',
+ 'Cannot have a value in both Debit and Credit!' => 'Cannot have a value in both Debit and Credit!',
+ 'Cannot post a transaction without a value!' => 'Cannot post a transaction without a value!',
+ 'Cannot post transaction for a closed period!' => 'µLªk¦b¤wÃö³¬ªº®É¬q¤º¥[¤J¥æ©ö!',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Continue' => 'Ä~Äò',
+ 'Credit' => '¶U¤è',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Debit' => '­É¤è',
+ 'Debit and credit out of balance!' => '­É¶U¤£¥­¿Å!',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Description' => '»¡©ú',
+ 'Edit General Ledger Transaction' => '½s¿èÁ`±b',
+ 'Equity' => 'ªÑÅv',
+ 'Expense' => '¶O¥Î',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'GL Transaction',
+ 'General Ledger' => 'Á`±b',
+ 'ID' => '½s¸¹',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Income' => '¦¬¯q',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Liability' => '­t¶Å',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Reference' => 'Reference',
+ 'Reference missing!' => 'Reference missing!',
+ 'Reports' => '³øªí',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Source' => '¨Ó·½',
+ 'Subtotal' => '¤p­p',
+ 'To' => '¦Ü',
+ 'Transaction Date missing!' => 'º|¶ñ±b¥Ø¤é´Á!',
+ 'Transaction deleted!' => 'Transaction deleted!',
+ 'Transaction posted!' => 'Transaction posted!',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'Yes' => '¬O',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ 'gl_transaction' => 'gl_transaction',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ic b/sql-ledger/locale/tw/ic
new file mode 100644
index 000000000..7be481d63
--- /dev/null
+++ b/sql-ledger/locale/tw/ic
@@ -0,0 +1,205 @@
+$self{texts} = {
+ 'Active' => 'Active',
+ 'Add' => '·s¼W',
+ 'Add Assembly' => '·s¼W°Ó«~',
+ 'Add Part' => '·s¼W­ì®Æ',
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Add Service' => '·s¼WªA°È',
+ 'Address' => '¦a§}',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Assemblies' => '°Ó«~',
+ 'Assemblies restocked!' => 'Assemblies restocked!',
+ 'Assembly Number missing!' => '¬dµL¦¹°Ó«~!',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'Bcc',
+ 'Bin' => '½c',
+ 'Bought' => '¤wÁʶR',
+ 'COGS' => '³f¾P¦¨¥»',
+ 'Cannot delete item already invoiced!' => 'Cannot delete item already invoiced!',
+ 'Cannot delete item on order!' => 'µLªk§R°£³æ¤Wªº¶µ¥Ø!',
+ 'Cannot delete item which is part of an assembly!' => 'Cannot delete item which is part of an assembly!',
+ 'Cannot delete item!' => 'Cannot delete item!',
+ 'Cannot stock assemblies!' => 'Cannot stock assemblies!',
+ 'Cc' => 'Cc',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => '»¡©ú',
+ 'Drawing' => 'Drawing',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Edit Assembly' => '½s¿è°Ó«~',
+ 'Edit Part' => '½s¿è­ì®Æ',
+ 'Edit Service' => '½s¿èªA°È',
+ 'Expense' => '¶O¥Î',
+ 'Extended' => 'Extended',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'Image' => 'Image',
+ 'In-line' => '¦æ¤º',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Income' => '¦¬¯q',
+ 'Individual Items' => '²Õ¦¨¶µ¥Ø',
+ 'Inventory' => '®w¦s',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => '¦b°±¥Î¦¹¶µ²Õ¦X«~¤§«e, ¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => '°±¥Î¦¹¶µ¹s¥ó¤§«e, ¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Inventory quantity must be zero!' => '¦s³f¼Æ¶q¥²»Ý¬°¹s!',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Item deleted!' => 'Item deleted!',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Last Cost' => '¤W¤@µ§¦¨¥»',
+ 'Line Total' => 'Á`¦C¼Æ',
+ 'Link Accounts' => '³sµ²¬ì¥Ø',
+ 'List Price' => '¶i»ù',
+ 'Make' => '»s³y',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Microfiche' => 'Microfiche',
+ 'Model' => '«¬¸¹',
+ 'Name' => '¦WºÙ',
+ 'No.' => 'No.',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'Obsolete' => '°±¥Î',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'On Hand' => '¦s¶q',
+ 'On Order' => 'On Order',
+ 'Order' => '­q³æ',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'Ordered' => 'Ordered',
+ 'Orphaned' => 'µL¥D',
+ 'PDF' => 'PDF',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Part' => '­ì®Æ',
+ 'Part Number missing!' => 'º|¶ñ­ì®Æ½s¸¹!',
+ 'Parts' => '­ì®Æ',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Postscript' => 'Postscript',
+ 'Price' => '»ù®æ',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => 'Project',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'ROP' => '¦A­qÂI',
+ 'Recd' => 'Recd',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Sales' => '·~°È',
+ 'Sales Order' => '¾P³f³æ',
+ 'Save' => 'Àx¦s',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sell Price' => '°â»ù',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Service Number missing!' => 'º|¶ñªA°È½s¸¹!',
+ 'Services' => 'ªA°È',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Short' => 'µu',
+ 'Sold' => '¤w½æ¥X',
+ 'Stock Assembly' => '½LÂI',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'Tax' => 'µ|ª÷',
+ 'To' => '¦Ü',
+ 'Top Level' => 'Top Level',
+ 'Total' => 'Á`­p',
+ 'Unit' => '³æ¦ì',
+ 'Unit of measure' => '«×¶q³æ¦ì',
+ 'Update' => 'Update',
+ 'Updated' => 'Updated',
+ 'Weight' => '­«¶q',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'ea' => '­Ó',
+ 'emailed to' => '¤w±H¦Ü',
+ 'hr' => 'hr',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ '·s¼w' => 'add',
+ '·s¼w°Ó«~' => 'add_assembly',
+ '·s¼w­ì®Æ' => 'add_part',
+ '·s¼wªa°È' => 'add_service',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ '½s¿è°Ó«~' => 'edit_assembly',
+ '½s¿è­ì®Æ' => 'edit_part',
+ '½s¿èªa°È' => 'edit_service',
+ 'Àx¦s' => 'save',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/io b/sql-ledger/locale/tw/io
new file mode 100644
index 000000000..64c8ed71f
--- /dev/null
+++ b/sql-ledger/locale/tw/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Address' => '¦a§}',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Bcc' => 'Bcc',
+ 'Bin' => '½c',
+ 'Cc' => 'Cc',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => '»¡©ú',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Extended' => 'Extended',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'In-line' => '¦æ¤º',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Name' => '¦WºÙ',
+ 'No.' => 'No.',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Order' => '­q³æ',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Part' => '­ì®Æ',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Postscript' => 'Postscript',
+ 'Price' => '»ù®æ',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => 'Project',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'Recd' => 'Recd',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Sales Order' => '¾P³f³æ',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Subject' => '¼ÐÃD',
+ 'To' => '¦Ü',
+ 'Unit' => '³æ¦ì',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'emailed to' => '¤w±H¦Ü',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'Ä~Äò' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/ir b/sql-ledger/locale/tw/ir
new file mode 100644
index 000000000..daa90e49b
--- /dev/null
+++ b/sql-ledger/locale/tw/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => '¬ì¥Ø',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Invoice Number' => '±z½T©w­n§R°£µo²¼½s¸¹',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Bcc' => 'Bcc',
+ 'Bin' => '½c',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Currency' => '¹ô§O',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Date Due' => 'À³¥I¤é´Á',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => '»¡©ú',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Edit Purchase Invoice' => 'Edit Purchase Invoice',
+ 'Exch' => '¶×²v',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'In-line' => '¦æ¤º',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date' => 'µo²¼¤é´Á',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Name' => '¦WºÙ',
+ 'No.' => 'No.',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Order' => '­q³æ',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Part' => '­ì®Æ',
+ 'Payment date missing!' => '¥¼«ü©ú¥I´Ú¤é´Á!',
+ 'Payments' => '¥I´Ú',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => '»ù®æ',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'Recd' => 'Recd',
+ 'Record in' => '°O¿ý©ó',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Sales Order' => '¾P³f³æ',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Source' => '¨Ó·½',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Unit' => '³æ¦ì',
+ 'Update' => 'Update',
+ 'Vendor' => '¼t°Ó',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'Yes' => '¬O',
+ 'ea' => '­Ó',
+ 'emailed to' => '¤w±H¦Ü',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ '­q³æ' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/is b/sql-ledger/locale/tw/is
new file mode 100644
index 000000000..1b0c6ec56
--- /dev/null
+++ b/sql-ledger/locale/tw/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => '¬ì¥Ø',
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Invoice Number' => '±z½T©w­n§R°£µo²¼½s¸¹',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Bcc' => 'Bcc',
+ 'Bin' => '½c',
+ 'Cannot delete invoice!' => 'Cannot delete invoice!',
+ 'Cannot post invoice for a closed period!' => 'Cannot post invoice for a closed period!',
+ 'Cannot post invoice!' => 'Cannot post invoice!',
+ 'Cannot post payment for a closed period!' => 'Cannot post payment for a closed period!',
+ 'Cc' => 'Cc',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Credit Limit' => '«H¥ÎÃB«×',
+ 'Currency' => '¹ô§O',
+ 'Customer' => '«È¤á',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Date Due' => 'À³¥I¤é´Á',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => '»¡©ú',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Edit Sales Invoice' => 'Edit Sales Invoice',
+ 'Exch' => '¶×²v',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate for payment missing!' => 'Exchangerate for payment missing!',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'In-line' => '¦æ¤º',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date' => 'µo²¼¤é´Á',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number' => 'µo²¼½s¸¹',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Invoice deleted!' => 'Invoice deleted!',
+ 'Invoice posted!' => 'Invoice posted!',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Name' => '¦WºÙ',
+ 'No.' => 'No.',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Order' => '­q³æ',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Part' => '­ì®Æ',
+ 'Payment date missing!' => '¥¼«ü©ú¥I´Ú¤é´Á!',
+ 'Payments' => '¥I´Ú',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Post' => 'Post',
+ 'Post as new' => 'Post as new',
+ 'Postscript' => 'Postscript',
+ 'Price' => '»ù®æ',
+ 'Print' => 'Print',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'Recd' => 'Recd',
+ 'Record in' => '°O¿ý©ó',
+ 'Remaining' => '©|¾l',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Sales Order' => '¾P³f³æ',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Source' => '¨Ó·½',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Unit' => '³æ¦ì',
+ 'Update' => 'Update',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'Yes' => '¬O',
+ 'ea' => '­Ó',
+ 'emailed to' => '¤w±H¦Ü',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ '¹q¤l¶l¥ó' => 'e_mail',
+ '­q³æ' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/login b/sql-ledger/locale/tw/login
new file mode 100644
index 000000000..d934f5a63
--- /dev/null
+++ b/sql-ledger/locale/tw/login
@@ -0,0 +1,28 @@
+$self{texts} = {
+ 'About' => 'Ãö©ó',
+ 'Accounting' => '·|­p',
+ 'Database Host' => '¸ê®Æ®w¥D¾÷',
+ 'Dataset' => '¸ê®Æ¶°',
+ 'Incorrect Dataset version!' => '¸ê®Æ¶°ª©¥»¿ù»~!',
+ 'Incorrect Password!' => '±K½X¿ù»~!',
+ 'Licensed to' => '±ÂÅv¤©',
+ 'Login' => 'µn¤J',
+ 'Name' => '¦WºÙ',
+ 'Password' => '±K½X',
+ 'User' => '¨Ï¥ÎªÌ',
+ 'Version' => 'ª©¥»',
+ 'You are logged out!' => 'You are logged out!',
+ 'You did not enter a name!' => '±z¨Ã¥¼Áä¤J¦WºÙ!',
+ 'is not a member!' => '¨Ã¤£¬O¦¨­û!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'µn¤j' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/menu b/sql-ledger/locale/tw/menu
new file mode 100644
index 000000000..54a3f071a
--- /dev/null
+++ b/sql-ledger/locale/tw/menu
@@ -0,0 +1,72 @@
+$self{texts} = {
+ 'AP' => 'À³¥I±b´Ú',
+ 'AP Aging' => 'À³¥I±bÄÖ¤ÀªR',
+ 'AR' => 'À³¦¬±b´Ú',
+ 'AR Aging' => 'À³¦¬±bÄÖ¤ÀªR',
+ 'Accounting Menu' => '·|­p¿ï³æ',
+ 'Add Account' => '·s¼W¬ì¥Ø',
+ 'Add Assembly' => '·s¼W°Ó«~',
+ 'Add Customer' => '·s¼W«È¤á',
+ 'Add GIFI' => '·s¼W GIFI',
+ 'Add Part' => '·s¼W­ì®Æ',
+ 'Add Project' => 'Add Project',
+ 'Add Service' => '·s¼WªA°È',
+ 'Add Transaction' => '·s¼W±b¥Ø',
+ 'Add Vendor' => '·s¼W¼t°Ó',
+ 'Assemblies' => '°Ó«~',
+ 'Audit Control' => '½]®Ö±±¨î',
+ 'Backup' => '³Æ¥÷',
+ 'Balance Sheet' => '¸ê²£­t¶Åªí',
+ 'Cash' => 'Cash',
+ 'Chart of Accounts' => '·|­p¬ì¥Øªí',
+ 'Check' => 'Check',
+ 'Customers' => 'Customers',
+ 'General Ledger' => 'Á`±b',
+ 'Goods & Services' => '³fª«¤ÎªA°È',
+ 'HTML Templates' => 'HTML ªí³æ',
+ 'Income Statement' => '·l¯qªí',
+ 'Invoice' => 'µo²¼',
+ 'LaTeX Templates' => 'LaTex ¼Òª©',
+ 'List Accounts' => '¦C¥X±b¸¹',
+ 'List GIFI' => '¦C¥X GIFI',
+ 'Logout' => 'µn¥X',
+ 'Order Entry' => '¤U³æ¶µ¥Ø',
+ 'Packing List' => '¥X³f³æ',
+ 'Parts' => '­ì®Æ',
+ 'Payment' => '¥I´Ú¤è¦¡',
+ 'Payments' => '¥I´Ú',
+ 'Preferences' => '­Ó¤H³]©w',
+ 'Projects' => 'Projects',
+ 'Purchase Invoice' => 'Purchase Invoice',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Purchase Orders' => '±ÄÁʳæ',
+ 'Receipt' => 'Receipt',
+ 'Receipts' => 'Receipts',
+ 'Reconciliation' => 'Reconciliation',
+ 'Reports' => '³øªí',
+ 'Sales Invoice' => 'Sales Invoice',
+ 'Sales Order' => '¾P³f³æ',
+ 'Sales Orders' => '¾P³f³æ',
+ 'Save to File' => 'Àx¦s¦ÜÀÉ®×',
+ 'Send by E-Mail' => '¥H¹q¤l¶l¥ó±H°e',
+ 'Services' => 'ªA°È',
+ 'Statement' => 'Statement',
+ 'Stock Assembly' => '½LÂI',
+ 'Stylesheet' => '¼Ë¦¡ªí',
+ 'System' => '¨t²Î',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'Transactions' => '±b¥Ø',
+ 'Trial Balance' => '¸Õºâªí',
+ 'Vendors' => 'Vendors',
+ 'Version' => 'ª©¥»',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/oe b/sql-ledger/locale/tw/oe
new file mode 100644
index 000000000..57dd3828c
--- /dev/null
+++ b/sql-ledger/locale/tw/oe
@@ -0,0 +1,199 @@
+$self{texts} = {
+ 'Add' => '·s¼W',
+ 'Add Purchase Invoice' => 'Add Purchase Invoice',
+ 'Add Purchase Order' => '·s¼W±ÄÁʳæ',
+ 'Add Sales Invoice' => 'Add Sales Invoice',
+ 'Add Sales Order' => '·s¼W¾P³f³æ',
+ 'Address' => '¦a§}',
+ 'Amount' => 'Á`­p',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Are you sure you want to delete Order Number' => '±z¬O§_½T©w­n§R°£­q³æ',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Bcc' => 'Bcc',
+ 'Bin' => '½c',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'Cannot delete order!',
+ 'Cannot save order!' => 'Cannot save order!',
+ 'Cc' => 'Cc',
+ 'Closed' => '¤wÃö³¬',
+ 'Confirm!' => '¤J±b¦¨¥\!',
+ 'Contact' => '³sµ¸¤H',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Credit Limit' => '«H¥ÎÃB«×',
+ 'Curr' => '¥Ø«e',
+ 'Currency' => '¹ô§O',
+ 'Customer' => '«È¤á',
+ 'Customer missing!' => 'Customer missing!',
+ 'Customer not on file!' => 'Customer not on file!',
+ 'Date' => '¤é´Á',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Delete' => '§R°£',
+ 'Delivery Date' => 'Delivery Date',
+ 'Description' => '»¡©ú',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail address missing!' => 'º|¶ñ¹q¤l¶l¥ó¦ì§}!',
+ 'Edit Purchase Order' => '½s¿è±ÄÁʳæ',
+ 'Edit Sales Order' => '½s¿è¾P³f³æ',
+ 'Exchangerate' => '¶×²v',
+ 'Exchangerate missing!' => 'Exchangerate missing!',
+ 'Extended' => 'Extended',
+ 'Fax' => '¶Ç¯u',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'ID' => '½s¸¹',
+ 'In-line' => '¦æ¤º',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Invoice' => 'µo²¼',
+ 'Invoice Date missing!' => 'µo²¼¤é´Á¿ù»~!',
+ 'Invoice Number missing!' => 'µo²¼½s¸¹¿ù»~!',
+ 'Item not on file!' => '¬dµL¦¹¶µ¥Ø',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'Name' => '¦WºÙ',
+ 'No.' => 'No.',
+ 'Notes' => '³Æµù',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Number' => '½s¸¹',
+ 'Number missing in Row' => '¦¹¦C¤¤¯Ê¤Ö¼Æ­È',
+ 'O' => 'O',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'Open' => '¶}±Ò',
+ 'Order' => '­q³æ',
+ 'Order Date' => '¤U³æ¤é´Á',
+ 'Order Date missing!' => '¥¼«ü©ú¤U³æ¤é´Á!',
+ 'Order Number' => '­q³æ½s¸¹',
+ 'Order Number missing!' => '¥¼«ü©ú­q³æ½s¸¹!',
+ 'Order deleted!' => 'Order deleted!',
+ 'Order saved!' => 'Order saved!',
+ 'PDF' => 'PDF',
+ 'Packing List' => '¥X³f³æ',
+ 'Packing List Date missing!' => '¥¼«ü©ú¥]¸Ë²M³æ¤é´Á!',
+ 'Packing List Number missing!' => '¥¼«ü©ú¥]¸Ë²M³æ½s¸¹!',
+ 'Part' => '­ì®Æ',
+ 'Phone' => '¹q¸Ü¸¹½X',
+ 'Postscript' => 'Postscript',
+ 'Price' => '»ù®æ',
+ 'Print' => 'Print',
+ 'Printer' => '¦Lªí¾÷',
+ 'Project' => 'Project',
+ 'Project not on file!' => 'Project not on file!',
+ 'Purchase Order' => '±ÄÁʳæ',
+ 'Purchase Orders' => '±ÄÁʳæ',
+ 'Qty' => '¼Æ¶q',
+ 'Recd' => 'Recd',
+ 'Remaining' => '©|¾l',
+ 'Required by' => '¤l¶µ¥Ø',
+ 'Sales Order' => '¾P³f³æ',
+ 'Sales Orders' => '¾P³f³æ',
+ 'Save' => 'Àx¦s',
+ 'Save as new' => 'Save as new',
+ 'Screen' => '¿Ã¹õ',
+ 'Select from one of the items below' => '©ó¤U¦C¶µ¥Ø¤¤¿ï¾Ü¤@¶µ',
+ 'Select from one of the names below' => 'Select from one of the names below',
+ 'Select from one of the projects below' => 'Select from one of the projects below',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Service' => 'ªA°È',
+ 'Ship' => 'Ship',
+ 'Ship to' => 'Ship to',
+ 'Ship via' => 'Ship via',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'Tax' => 'µ|ª÷',
+ 'Tax Included' => '¤£¦¬ªA°È¶O',
+ 'Terms: Net' => '²¼´Á²b­p',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Unit' => '³æ¦ì',
+ 'Update' => 'Update',
+ 'Vendor' => '¼t°Ó',
+ 'Vendor missing!' => 'Vendor missing!',
+ 'Vendor not on file!' => 'Vendor not on file!',
+ 'What type of item is this?' => '¦¹¶µ¥Øªº«¬ºA?',
+ 'Yes' => '¬O',
+ 'days' => '¤é',
+ 'ea' => '­Ó',
+ 'emailed to' => '¤w±H¦Ü',
+ 'sent to printer' => '°e¦Ü¦Lªí¾÷',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ '·s¼w' => 'add',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ '¹q¤l¶l¥ó' => 'e_mail',
+ 'µo²¼' => 'invoice',
+ 'print' => 'print',
+ 'Àx¦s' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ '¬o' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/pe b/sql-ledger/locale/tw/pe
new file mode 100644
index 000000000..6e7b6389b
--- /dev/null
+++ b/sql-ledger/locale/tw/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => '·s¼W',
+ 'Add Project' => 'Add Project',
+ 'All' => '¥þ³¡',
+ 'Continue' => 'Ä~Äò',
+ 'Delete' => '§R°£',
+ 'Description' => '»¡©ú',
+ 'Edit Project' => 'Edit Project',
+ 'Number' => '½s¸¹',
+ 'Orphaned' => 'µL¥D',
+ 'Project' => 'Project',
+ 'Project Number missing!' => 'Project Number missing!',
+ 'Project deleted!' => 'Project deleted!',
+ 'Project saved!' => 'Project saved!',
+ 'Projects' => 'Projects',
+ 'Save' => 'Àx¦s',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ '·s¼w' => 'add',
+ 'Ä~Äò' => 'continue',
+ '§r°£' => 'delete',
+ 'Àx¦s' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/rc b/sql-ledger/locale/tw/rc
new file mode 100644
index 000000000..2f813ab14
--- /dev/null
+++ b/sql-ledger/locale/tw/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => '¬ì¥Ø',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Ä~Äò',
+ 'Date' => '¤é´Á',
+ 'Deposit' => 'Deposit',
+ 'Description' => '»¡©ú',
+ 'Difference' => 'Difference',
+ 'Done' => 'Done',
+ 'Exchangerate Difference' => 'Exchangerate Difference',
+ 'From' => '±q',
+ 'Out of balance!' => 'Out of balance!',
+ 'Payment' => '¥I´Ú¤è¦¡',
+ 'Reconciliation' => 'Reconciliation',
+ 'Select all' => 'Select all',
+ 'Source' => '¨Ó·½',
+ 'Statement Balance' => 'Statement Balance',
+ 'To' => '¦Ü',
+ 'Update' => 'Update',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'Ä~Äò' => 'continue',
+ 'done' => 'done',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/tw/rp b/sql-ledger/locale/tw/rp
new file mode 100644
index 000000000..603745b40
--- /dev/null
+++ b/sql-ledger/locale/tw/rp
@@ -0,0 +1,117 @@
+$self{texts} = {
+ 'AP Aging' => 'À³¥I±bÄÖ¤ÀªR',
+ 'AR Aging' => 'À³¦¬±bÄÖ¤ÀªR',
+ 'Account' => '¬ì¥Ø',
+ 'Accounts' => '±b¤á',
+ 'Amount' => 'Á`­p',
+ 'Apr' => '¥|¤ë',
+ 'April' => '¥|¤ë',
+ 'Attachment' => 'ªþÀÉ',
+ 'Aug' => '¤K¤ë',
+ 'August' => '¤K¤ë',
+ 'Balance Sheet' => '¸ê²£­t¶Åªí',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => '¹ï·Ó',
+ 'Continue' => 'Ä~Äò',
+ 'Copies' => '«þ¨©',
+ 'Credit' => '¶U¤è',
+ 'Current' => 'Current',
+ 'Customer' => '«È¤á',
+ 'Date' => '¤é´Á',
+ 'Debit' => '­É¤è',
+ 'Dec' => '¤Q¤G¤ë',
+ 'December' => '¤Q¤G¤ë',
+ 'Decimalplaces' => 'Decimalplaces',
+ 'Description' => '»¡©ú',
+ 'Due' => '¨ì´Á',
+ 'E-mail' => '¹q¤l¶l¥ó',
+ 'E-mail Statement to' => 'E-mail Statement to',
+ 'Feb' => '¤G¤ë',
+ 'February' => '¤G¤ë',
+ 'From' => '±q',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'ªíÀY',
+ 'ID' => '½s¸¹',
+ 'In-line' => '¦æ¤º',
+ 'Include in Report' => '¤@¨ÖÅã¥Ü',
+ 'Income Statement' => '·l¯qªí',
+ 'Invoice' => 'µo²¼',
+ 'Jan' => '¤@¤ë',
+ 'January' => '¤@¤ë',
+ 'Jul' => '¤C¤ë',
+ 'July' => '¤C¤ë',
+ 'Jun' => '¤»¤ë',
+ 'June' => '¤»¤ë',
+ 'Mar' => '¤T¤ë',
+ 'March' => '¤T¤ë',
+ 'May' => '¤­¤ë',
+ 'May ' => '¤­¤ë',
+ 'Message' => '°T®§',
+ 'N/A' => '¤£¾A¥Î',
+ 'Nothing selected!' => 'Nothing selected!',
+ 'Nov' => '¤Q¤@¤ë',
+ 'November' => '¤Q¤@¤ë',
+ 'Oct' => '¤Q¤ë',
+ 'October' => '¤Q¤ë',
+ 'PDF' => 'PDF',
+ 'Payments' => '¥I´Ú',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Print',
+ 'Printer' => '¦Lªí¾÷',
+ 'Receipts' => 'Receipts',
+ 'Report for' => '³øªí¨Ó·½',
+ 'Retained Earnings' => '«O¯d¬Õ¾l',
+ 'Screen' => '¿Ã¹õ',
+ 'Select all' => 'Select all',
+ 'Select postscript or PDF!' => 'Select postscript or PDF!',
+ 'Sep' => '¤E¤ë',
+ 'September' => '¤E¤ë',
+ 'Source' => '¨Ó·½',
+ 'Standard' => '¼Ð·Ç',
+ 'Statement' => 'Statement',
+ 'Statement sent to' => 'Statement sent to',
+ 'Statements sent to printer!' => 'Statements sent to printer!',
+ 'Subject' => '¼ÐÃD',
+ 'Subtotal' => '¤p­p',
+ 'Tax' => 'µ|ª÷',
+ 'Tax collected' => 'Tax collected',
+ 'Tax paid' => 'Tax paid',
+ 'To' => '¦Ü',
+ 'Total' => 'Á`­p',
+ 'Trial Balance' => '¸Õºâªí',
+ 'Vendor' => '¼t°Ó',
+ 'as at' => 'as at',
+ 'collected on sales' => '¦b¾P³f®Éµ²²M',
+ 'for Period' => '´Á¶¡',
+ 'paid on purchases' => '¦b±ÄÁʮɵ²²M',
+ 'to' => 'to',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'Ä~Äò' => 'continue',
+ '¹q¤l¶l¥ó' => 'e_mail',
+ 'print' => 'print',
+ 'select_all' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/COPYING b/sql-ledger/locale/ua/COPYING
new file mode 100644
index 000000000..001a4f8f8
--- /dev/null
+++ b/sql-ledger/locale/ua/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (c) 2003
+#
+# Ukrainian texts:
+#
+# Author: Ivan Petrouchtchak <impe@telus.net>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/ua/LANGUAGE b/sql-ledger/locale/ua/LANGUAGE
new file mode 100644
index 000000000..368ad3bfa
--- /dev/null
+++ b/sql-ledger/locale/ua/LANGUAGE
@@ -0,0 +1 @@
+Ukrainian
diff --git a/sql-ledger/locale/ua/admin b/sql-ledger/locale/ua/admin
new file mode 100644
index 000000000..2ba71b062
--- /dev/null
+++ b/sql-ledger/locale/ua/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'ëÏÎÔÒÏÌØ äÏÓÔÕÐÕ',
+ 'Accounting' => 'ïÂ̦Ë',
+ 'Add User' => 'îÏ×ÉÊ ËÏÒÉÓÔÕ×ÁÞ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Administration' => 'áÄͦΦÓÔÒÕ×ÁÎÎÑ',
+ 'Administrator' => 'áÄͦΦÓÔÒÁÔÏÒ',
+ 'All Datasets up to date!' => 'âÁÚÉ äÁÎÉÈ ÎÅ ÐÏÔÒÅÂÕÀÔØ ÐÏÎÏ×ÌÅÎÎÑ!',
+ 'Change Admin Password' => 'úͦÎÉÔÉ ÐÁÒÏÌØ áÄͦΦÓÔÒÁÔÏÒÁ',
+ 'Change Password' => 'úͦÎÉÔÉ ÐÁÒÏÌØ',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Click on login name to edit!' => 'îÁÔÉÓÎ¦ÔØ ÎÁ ÎÁÚ×Õ ËÏÒÉÓÔÕ×ÁÞÁ, ÝÏ ÚÒÏÂÉÔÉ ÚͦÎÉ!',
+ 'Company' => 'ð¦ÄÐÒɤÍÓÔ×Ï',
+ 'Connect to' => 'ð¦ÄËÌÀÞÉÔÉÓØ ÄÏ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Create Chart of Accounts' => 'óÔ×ÏÒÉÔÉ ðÌÁÎ òÁÈÕÎ˦×',
+ 'Create Dataset' => 'óÔ×ÏÒÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'DBI not installed!' => 'îÅ ×ÓÔÁÎÏ×ÌÅÎÉÊ ÄÒÁÊ×ÅÒ DBI!',
+ 'Database' => 'âÁÚÁ äÁÎÉÈ',
+ 'Database Administration' => 'áÄͦΦÓÔÒÕ×ÁÎÎÑ ÂÁÚÉ ÄÁÎÉÈ',
+ 'Database Driver not checked!' => 'îÅ ÚÁÚÎÁÞÅÎÉÊ ÄÒÁÊ×ÅÒ âÁÚÉ äÁÎÉÈ (Pg)!',
+ 'Database User missing!' => 'îÅ ×ËÁÚÁÎÉÊ ëÏÒÉÓÔÕ×ÁÞ âÁÚÉ äÁÎÉÈ!',
+ 'Dataset' => 'âÁÚÁ äÁÎÉÈ',
+ 'Dataset missing!' => 'îÅ ×ËÁÚÁÎÁ âÁÚÁ äÁÎÉÈ!',
+ 'Dataset updated!' => 'âÁÚÁ äÁÎÉÈ ÐÏÎÏ×ÌÅÎÁ!',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÉ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delete Dataset' => '÷ÉÄÁÌÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'Directory' => 'ëÁÔÁÌÏÇ',
+ 'Driver' => 'äÒÁÊ×ÅÒ',
+ 'Dropdown Limit' => 'ïÂÍÅÖÅÎÎÑ ÌÉÓÔÏ×ÏÇÏ ÍÅÎÀ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'Edit User' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÏÒÉÓÔÕ×ÁÞÁ',
+ 'Existing Datasets' => '¶ÓÎÕÀÞ¦ âÁÚÉ äÁÎÉÈ',
+ 'Fax' => 'æÁÈ',
+ 'Host' => 'íÁÛÉÎÁ/Host',
+ 'Hostname missing!' => 'îÅ ×ËÁÚÁÎÁ ÎÁÚ×Á ÍÁÛÉÎÉ!',
+ 'Incorrect Password!' => 'îÅצÒÎÉÊ ðÁÒÏÌØ!',
+ 'Language' => 'íÏ×Á',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'ñËÝÏ ×É ÎÅ ÂÁÖÁ¤ÔÅ ×ÓÔÁÎÏ×ÉÔÉ ×¦ÄÄÁÌÅÎÉÊ Ú×ÑÚÏË, ÎÅ ÚÁÐÏ×ÎÀÊÔÅ ÐÏÌÑ ÍÁÛÉÎÉ ¦ ÐÏÒÔÕ.',
+ 'Login' => 'ðÏÞÁÔÏË óÅÁÎÓÕ',
+ 'Multibyte Encoding' => 'íÕÌØÔÉÂÉÔÎÅ ëÏÄÕ×ÁÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'New Templates' => 'îÏצ ûÁÂÌÏÎÉ',
+ 'No Database Drivers available!' => 'îÅÄÏÓÔÕÐÎÉÊ ÄÒÁÊ×ÅÒ âÁÚÉ äÁÎÉÈ!',
+ 'No Dataset selected!' => 'îÅ ÐÏÚÎÁÞÅÎÏ ×ÉÂÒÁÎÕ âÁÚÕ äÁÎÉÈ!',
+ 'Nothing to delete!' => 'îÅÍÁ ÝÏ ×ÉÄÁÌÉÔÉ!',
+ 'Number Format' => 'æÏÒÍÁÔ þÉÓÌÁ',
+ 'Oracle Database Administration' => 'áÄͦΦÓÔÒÁÃ¦Ñ âÁÚÉ äÁÎÉÈ Oracle',
+ 'Password' => 'ðÁÒÏÌØ',
+ 'Password changed!' => 'ðÁÒÏÌØ ÚͦÎÅÎÏ!',
+ 'Pg Database Administration' => 'áÄͦΦÓÔÒÁÃ¦Ñ âÁÚÉ äÁÎÉÈ Pg',
+ 'Phone' => 'ôÅÌ.',
+ 'Port' => 'ðÏÒÔ',
+ 'Port missing!' => 'ðÏÒÔ ÎÅ ×ËÁÚÁÎÏ!',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Select a Dataset to delete and press "Continue"' => '÷ÉÂÅÒ¦ÔØ âÁÚÕ äÁÎÉÈ ÄÌÑ ×ÉÄÁÌÅÎÎÑ ¦ ÎÁÔÉÓÎ¦ÔØ "ðÒÏÄÏ×ÖÉÔÉ"',
+ 'Setup Templates' => 'îÁÌÁÛÔÕ×ÁÔÉ ûÁÂÌÏÎÉ',
+ 'Ship via' => 'ðÏÓÌÁÔÉ ÞÅÒÅÚ',
+ 'Signature' => 'ð¦ÄÐÉÓ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÎÎÑ',
+ 'Templates' => 'ûÁÂÌÏÎÉ',
+ 'The following Datasets are not in use and can be deleted' => 'îÁÓÔÕÐΦ âÁÚÉ äÁÎÉÈ ÎÅ ×ÉËÏÒÉÓÔÏ×ÕÀÔØÓÑ ¦ ÍÏÖÕÔØ ÂÕÔÉ ×ÉÄÁÌÅΦ',
+ 'The following Datasets need to be updated' => 'îÁÓÔÕÐΦ âÁÚÉ äÁÎÉÈ ÐÏ×ÉÎΦ ÂÕÔÉ ÐÏÎÏ×ÌÅΦ',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'ðÏÐÅÒÅÄÎÑ ÐÅÒÅצÒËÁ ¦ÓÎÕÀÞÉÈ ÄÖÅÒÅÌ. ðÏËÉ ÝÏ Î¦ÞÏÇÏ ÎÅ ÂÕÄÅ ÓÔ×ÏÒÅÎÏ ÁÂÏ ×ÉÄÁÌÅÎÏ!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'ýÏ ÄÏÄÁÔÉ ËÏÒÉÓÔÕ×ÁÞÁ ÄÏ ÇÒÕÐÉ, ÔÒÅÂÁ ÐÏͦÎÑÔÉ ¦Í\'Ñ, login/××ÏÄÎÅ ¦ÍÑ ¦ ÚÂÅÒÅÇÔÉ. îÏ×ÉÊ ËÏÒÉÓÔÕ×ÁÞÁ ¦Ú ÏÄÎÁËÏ×ÉÍÉ ÐÁÒÁÍÅÔÒÁÍÉ ÂÕÄÅ ÚÂÅÒÅÖÅÎÏ Ð¦Ä ÎÏ×ÉÍ login/××ÏÄÎÉÍ ¦Í\'ÑÍ.',
+ 'Update Dataset' => 'ðÏÎÏ×ÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'Use Templates' => '÷ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ûÁÂÌÏÎÉ',
+ 'User' => 'ëÏÒÉÓÔÕ×ÁÞ',
+ 'User deleted!' => 'ëÏÒÉÓÔÕ×ÁÞ ÷ÉÄÁÌÅÎÉÊ',
+ 'User saved!' => 'ëÏÒÉÓÔÕ×ÁÞ ÚÂÅÒÅÖÅÎÉÊ',
+ 'Version' => '÷ÅÒÓ¦Ñ',
+ 'You must enter a host and port for local and remote connections!' => 'íÕÓÉÔÅ ××ÅÓÔÉ ÎÁÚ×Õ ÍÁÛÉÎÉ ¦ ÐÏÒÔÁ ÄÌÑ Í¦ÓÃÅ×ÏÇÏ ¦ צÄÄÁÌÅÎÏÇÏ Ú×ÑÚËÕ!',
+ 'does not exist' => 'ÎÅ ¦ÓÎÕ¤',
+ 'is already a member!' => '×ÖÅ ¤ ÞÌÅÎÏÍ!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'ÚÁÍËÎÕÔÉÊ!',
+ 'successfully created!' => 'ÕÓЦÛÎÏ ÓÔ×ÏÒÅÎÏ!',
+ 'successfully deleted!' => 'ÕÓЦÛÎÏ ×ÉÄÁÌÅÎÏ!',
+ 'website' => '×ÅÂ-ÓÔÏÒ¦ÎËÁ',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'îÏ×ÉÊ_ËÏÒÉÓÔÕ×ÁÞ' => 'add_user',
+ 'úͦÎÉÔÉ_ÐÁÒÏÌØ_áÄͦΦÓÔÒÁÔÏÒÁ' => 'change_admin_password',
+ 'úͦÎÉÔÉ_ÐÁÒÏÌØ' => 'change_password',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ 'óÔ×ÏÒÉÔÉ_âÁÚÕ_äÁÎÉÈ' => 'create_dataset',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ '÷ÉÄÁÌÉÔÉ_âÁÚÕ_äÁÎÉÈ' => 'delete_dataset',
+ 'ðÏÞÁÔÏË_óÅÁÎÓÕ' => 'login',
+ 'áÄͦΦÓÔÒÁæÑ_âÁÚÉ_äÁÎÉÈ_oracle' => 'oracle_database_administration',
+ 'áÄͦΦÓÔÒÁæÑ_âÁÚÉ_äÁÎÉÈ_pg' => 'pg_database_administration',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+ 'ðÏÎÏ×ÉÔÉ_âÁÚÕ_äÁÎÉÈ' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/all b/sql-ledger/locale/ua/all
new file mode 100644
index 000000000..c863ea31e
--- /dev/null
+++ b/sql-ledger/locale/ua/all
@@ -0,0 +1,495 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => '÷ÉÔÒÁÔÉ',
+ 'AP Aging' => 'AP Aging (×ÉÔÒÁÔÉ)',
+ 'AP Transaction' => 'ïÐÅÒÁæ§ ÷ÉÔÒÁÔ',
+ 'AP Transactions' => 'ïÐÅÒÁæ§ ÷ÉÔÒÁÔ',
+ 'AR' => 'äÏÈÏÄÉ',
+ 'AR Aging' => 'AR Aging (ÄÏÈÏÄÉ)',
+ 'AR Transaction' => 'ïÐÅÒÁÃ¦Ñ äÏÈÏĦ×',
+ 'AR Transactions' => 'ïÐÅÒÁÃ¦Ñ äÏÈÏĦ×',
+ 'About' => 'ðÒÏ ÐÒÏÇÒÁÍÕ',
+ 'Access Control' => 'ëÏÎÔÒÏÌØ äÏÓÔÕÐÕ',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Account Number' => 'îÏÍÅÒ òÁÈÕÎËÕ',
+ 'Account Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÕ!',
+ 'Account Type' => '÷ÉÄ ÒÁÈÕÎËÕ',
+ 'Account Type missing!' => 'îÅ ×ËÁÚÁÎÉÊ ×ÉÄ ÒÁÈÕÎËÕ!',
+ 'Account deleted!' => 'òÁÈÕÎÏË ×ÉÄÁÌÅÎÉÊ',
+ 'Account saved!' => 'òÁÈÕÎÏË ÚÂÅÒÅÖÅÎÏ',
+ 'Accounting' => 'ïÂ̦Ë',
+ 'Accounting Menu' => 'íÅÎÀ ïÂ̦ËÕ',
+ 'Accounts' => 'òÁÈÕÎËÉ',
+ 'Active' => 'áËÔÉ×ÎÉÊ',
+ 'Add' => 'îÏ×ÉÊ',
+ 'Add Account' => 'îÏ×ÉÊ ÒÁÈÕÎÏË',
+ 'Add Accounts Payables Transaction' => 'îÏ×Á ÏÐÅÒÁÃ¦Ñ ×ÉÔÒÁÔ',
+ 'Add Accounts Receivables Transaction' => 'îÏ×Á ÏÐÅÒÁÃ¦Ñ ÄÏÈÏĦ×',
+ 'Add Assembly' => 'îÏ×ÉÊ ËÏÍÐÌÅËÔ',
+ 'Add Customer' => 'îÏ×ÉÊ Ë̦¤ÎÔ',
+ 'Add GIFI' => 'îÏ×ÉÊ GIFI',
+ 'Add General Ledger Transaction' => 'îÏ×Á ÏÐÅÒÁæÑ',
+ 'Add Part' => 'îÏ×ÉÊ ôÏ×ÁÒ',
+ 'Add Project' => 'îÏ×ÉÊ ðÒÏÅËÔ',
+ 'Add Purchase Invoice' => 'îÏ×ÉÊ ëÕЦ×ÅÌØÎÉÊ òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Invoice' => 'îÏ×ÉÊ òÁÈÕÎÏ-ÆÁËÔÕÒÁ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Add Service' => 'îÏ×Á ÐÏÓÌÕÇÁ',
+ 'Add Transaction' => 'îÏ×Á ÏÐÅÒÁæÑ',
+ 'Add User' => 'îÏ×ÉÊ ËÏÒÉÓÔÕ×ÁÞ',
+ 'Add Vendor' => 'îÏ×ÉÊ ÐÏÓÔÁÞÁÌØÎÉË',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Administration' => 'áÄͦΦÓÔÒÕ×ÁÎÎÑ',
+ 'Administrator' => 'áÄͦΦÓÔÒÁÔÏÒ',
+ 'All' => '÷Ó¦',
+ 'All Datasets up to date!' => 'âÁÚÉ äÁÎÉÈ ÎÅ ÐÏÔÒÅÂÕÀÔØ ÐÏÎÏ×ÌÅÎÎÑ!',
+ 'Amount' => 'óÕÍÁ',
+ 'Amount Due' => 'úÁÐÌÁÔÉÔÉ óÕÍÕ',
+ 'Amount does not equal applied!' => 'óÕÍÁ ÎÅ ÄÏÒ¦×ÎÀ¤ ÚÁÓÔÏÓÏ×ÁΦÊ!',
+ 'Amount missing!' => 'îÅ ×ËÁÚÁÎÁ ÓÕÍÁ!',
+ 'Applied' => 'úÁÓÔÏÓÏ×ÁÎÏ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Invoice Number' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÉÊ ÒÁÈÕÎÏË?',
+ 'Are you sure you want to delete Order Number' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÅ ÚÁÍÏ×ÌÅÎÎÑ?',
+ 'Are you sure you want to delete Transaction' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÕ ÏÐÅÒÁæÀ?',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÉ',
+ 'Assemblies restocked!' => 'ëÏÍÐÌÅËÔÉ ¦Î×ÅÎÔÁÒÉÚÏ×ÁΦ!',
+ 'Assembly Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ËÏÍÐÌÅËÔÕ!',
+ 'Asset' => 'áËÔÉ×',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'BOM' => 'BOM',
+ 'Backup' => 'òÅÚÅÒ×ÎÁ ËÏЦÑ',
+ 'Backup sent to' => 'òÅÚÅÒ×ÎÁ ËÏÐ¦Ñ ÐÏÓÌÁÎÁ ÄÏ',
+ 'Balance' => 'âÁÌÁÎÓ',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'Books are open' => 'ëÎÉÇÁ צÄËÒÉÔÁ',
+ 'Bought' => 'ëÕÐÌÅÎÏ',
+ 'Business Number' => 'â¦ÚÎÅÓ-ÎÏÍÅÒ',
+ 'C' => 'ó',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Cannot delete customer!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ Ë̦¤ÎÔÁ',
+ 'Cannot delete default account!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÓÎÏ×ÎÉÊ ÒÁÈÕÎÏË!',
+ 'Cannot delete invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Cannot delete item already invoiced!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÔÏ×ÁÒ, ÎÁ ÑËÉÊ ×ÖÅ ×ÉÐÉÓÁÎÁ ÒÁÈÕÎÏË-ÆÁËÔÕÒÁ!',
+ 'Cannot delete item on order!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ Ò¦Þ ¦Ú ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cannot delete item which is part of an assembly!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÔÏ×ÁÒ, ÑËÉÊ ¤ ÞÁÓÔÉÎÏÀ ËÏÍÐÌÅËÔÕ!',
+ 'Cannot delete item!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÃÅÊ ÅÌÅÍÅÎÔ',
+ 'Cannot delete order!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cannot delete transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÒÅ!',
+ 'Cannot delete vendor!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÐÏÓÔÁÞÁÌØÎÉËÁ!',
+ 'Cannot have a value in both Debit and Credit!' => 'îÅ ÍÏÖÎÁ ÏÄÎÏÞÁÓÎÏ ÍÁÔÉ ÓÕÍÉ × äÅÂÉÔ¦ ¦ ëÒÅÄÉÔ¦',
+ 'Cannot post a transaction without a value!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÂÅÚ ×ÁÒÔÏÓÔ¦!',
+ 'Cannot post invoice for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ!',
+ 'Cannot post payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post payment!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö!',
+ 'Cannot post transaction for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ!',
+ 'Cannot process payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ÐÒÏ×ÅÓÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot save account!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÒÁÈÕÎÏË!',
+ 'Cannot save order!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cannot save preferences!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÎÁÓÔÒÏÊËÉ!',
+ 'Cannot stock assemblies!' => 'îÅ ÍÏÖÌÉ×Ï ¦Î×ÅÎÔÁÒÉÚÕ×ÁÔÉ ËÏÍÐÌÅËÔÉ!',
+ 'Cash' => 'çÏÔ¦×ËÁ',
+ 'Cash based' => 'çÏÔ¦×ËÏ×ÉÊ',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Change Admin Password' => 'úͦÎÉÔÉ ÐÁÒÏÌØ áÄͦΦÓÔÒÁÔÏÒÁ',
+ 'Change Password' => 'úͦÎÉÔÉ ÐÁÒÏÌØ',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Chart of Accounts' => 'ðÌÁÎ òÁÈÕÎ˦×',
+ 'Check' => 'þÅË',
+ 'Check printed!' => 'þÅË ÎÁÄÒÕËÏ×ÁÎÏ!',
+ 'Check printing failed!' => 'äÒÕË ÞÅËÕ ÎÅ ×ÄÁ×ÓÑ!',
+ 'Cleared Balance' => 'ë¦ÎÃÅ×Å óÁÌØÄÏ',
+ 'Click on login name to edit!' => 'îÁÔÉÓÎ¦ÔØ ÎÁ ÎÁÚ×Õ ËÏÒÉÓÔÕ×ÁÞÁ, ÝÏ ÚÒÏÂÉÔÉ ÚͦÎÉ!',
+ 'Close Books up to' => 'úÁËÒÉÔÉ ëÎÉÇÉ ÄÏ',
+ 'Closed' => 'úÁËÒÉÔÏ',
+ 'Company' => 'ð¦ÄÐÒɤÍÓÔ×Ï',
+ 'Compare to' => 'ðÏÒ¦×ÎÑÔÉ Ú',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Connect to' => 'ð¦ÄËÌÀÞÉÔÉÓØ ÄÏ',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Copy to COA' => 'óËÏЦÀ×ÁÔÉ ÄÏ ðÌÁÎÕ òÁÈÕÎ˦×',
+ 'Create Chart of Accounts' => 'óÔ×ÏÒÉÔÉ ðÌÁÎ òÁÈÕÎ˦×',
+ 'Create Dataset' => 'óÔ×ÏÒÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Credit Limit' => 'ì¦Í¦Ô ËÒÅÄÉÔÕ',
+ 'Curr' => '÷ÁÌÀÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Current' => 'ðÏÔÏÞÎÉÊ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Customer deleted!' => 'ë̦¤ÎÔÁ ×ÉÄÁÌÅÎÏ!',
+ 'Customer missing!' => 'îÅ ×ËÁÚÁÎÉÊ Ë̦¤ÎÔ!',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Customer saved!' => 'ë̦¤ÎÔÁ ÚÂÅÒÅÖÅÎÏ!',
+ 'Customers' => 'ë̦¤ÎÔÉ',
+ 'DBI not installed!' => 'îÅ ×ÓÔÁÎÏ×ÌÅÎÉÊ ÄÒÁÊ×ÅÒ DBI!',
+ 'Database' => 'âÁÚÁ äÁÎÉÈ',
+ 'Database Administration' => 'áÄͦΦÓÔÒÕ×ÁÎÎÑ ÂÁÚÉ ÄÁÎÉÈ',
+ 'Database Driver not checked!' => 'îÅ ÚÁÚÎÁÞÅÎÉÊ ÄÒÁÊ×ÅÒ âÁÚÉ äÁÎÉÈ (Pg)!',
+ 'Database Host' => 'íÁÛÉÎÁ âÁÚÉ äÁÎÉÈ',
+ 'Database User missing!' => 'îÅ ×ËÁÚÁÎÉÊ ëÏÒÉÓÔÕ×ÁÞ âÁÚÉ äÁÎÉÈ!',
+ 'Dataset' => 'âÁÚÁ äÁÎÉÈ',
+ 'Dataset missing!' => 'îÅ ×ËÁÚÁÎÁ âÁÚÁ äÁÎÉÈ!',
+ 'Dataset updated!' => 'âÁÚÁ äÁÎÉÈ ÐÏÎÏ×ÌÅÎÁ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÉ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÉ',
+ 'Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ!',
+ 'Debit' => 'äÅÂÉÔ',
+ 'Debit and credit out of balance!' => 'äÅÂÉÔ ¦ ËÒÅÄÉÔ ÎÅ ÚÂÁÌÁÎÓÏ×ÁΦ!',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Decimalplaces' => 'äÅÓÑÔÉÞΦ ͦÓÃÑ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delete Account' => '÷ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Delete Dataset' => '÷ÉÄÁÌÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Department' => '',
+ 'Deposit' => 'äÅÐÏÚÉÔ/÷ËÌÁÄ',
+ 'Description' => 'ïÐÉÓ',
+ 'Difference' => 'ò¦ÚÎÉÃÑ',
+ 'Directory' => 'ëÁÔÁÌÏÇ',
+ 'Discount' => 'óËÉÄËÁ',
+ 'Done' => 'úÒÏÂÌÅÎÏ',
+ 'Drawing' => 'íÁÌÀÎÏË',
+ 'Driver' => 'äÒÁÊ×ÅÒ',
+ 'Dropdown Limit' => 'ïÂÍÅÖÅÎÎÑ ÌÉÓÔÏ×ÏÇÏ ÍÅÎÀ',
+ 'Due' => 'äÏ',
+ 'Due Date' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Due Date missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÔÅÒͦΠÏÐÌÁÔÉ!',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail Statement to' => 'ðÏÓÌÁÔÉ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Edit' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ',
+ 'Edit Account' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ òÁÈÕÎÏË',
+ 'Edit Accounts Payables Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏ×ÏÄËÕ ÷ÉÔÒÁÔ',
+ 'Edit Accounts Receivables Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏ×ÏÄËÕ äÏÈÏĦ×',
+ 'Edit Assembly' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ËÏÍÐÌÅËÔ',
+ 'Edit Customer' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ë̦¤ÎÔÁ',
+ 'Edit GIFI' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ GIFI',
+ 'Edit General Ledger Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ïÐÅÒÁæÀ çÏÌÏ×Îϧ ëÎÉÇÉ',
+ 'Edit Part' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ôÏ×ÁÒ',
+ 'Edit Preferences for' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ îÁÓÔÒÏÊËÉ',
+ 'Edit Project' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏÅËÔ',
+ 'Edit Purchase Invoice' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÕЦ×ÅÌØÎÉÊ òÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Edit Purchase Order' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Edit Sales Invoice' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ òÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Edit Sales Order' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ îÁËÌÁÄÎÕ ðÒÏÄÁÖÕ',
+ 'Edit Service' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ÐÏÓÌÕÇÕ',
+ 'Edit Template' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ûÁÂÌÏÎ',
+ 'Edit User' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÏÒÉÓÔÕ×ÁÞÁ',
+ 'Edit Vendor' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÏÓÔÁÞÁÌØÎÉËÁ',
+ 'Employee' => 'ðÒÁæ×ÎÉË',
+ 'Enforce transaction reversal for all dates' => 'úÁÓÔÁ×ÉÔÉ Ú×ÏÒÏÔÎÕ ÚͦÎÕ ÐÒÏ×ÏÄÏË ÄÌÑ ×Ó¦È ÄÁÔ',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '÷×ÅÄ¦ÔØ ÄÏ 3 ̦ÔÅÒ ÒÏÚĦÌÅÎÉÈ Ä×ÏËÒÁÐËÁÍÉ (i.e CAD:USD:EUR) ÄÌÑ ÐÏÚÎÁÞÅÎÎÑ Í¦ÓÃÅ×ϧ ¦ ¦ÎÏÚÅÍÎÉÈ ÇÒÏÛÏ×ÉÈ ÏÄÉÎÉÃØ',
+ 'Equity' => 'ëÁЦÔÁÌ',
+ 'Exch' => 'ëÕÒÓ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate Difference' => 'ò¦ÚÎÉÃÑ ëÕÒÓÕ ×ÁÌÀÔÉ',
+ 'Exchangerate for payment missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ ÄÌÑ ÐÌÁÔÅÖÕ!',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Existing Datasets' => '¶ÓÎÕÀÞ¦ âÁÚÉ äÁÎÉÈ',
+ 'Expense' => '÷ÉÄÁÔËÉ',
+ 'Expense Account' => 'òÁÈÕÎÏË ÷ÉÄÁÔ˦×',
+ 'Expense/Asset' => '÷ÉÄÁÔÏË/áËÔÉ×',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'Foreign Exchange Gain' => 'ðÒÉÂÕÔÏË Ú ïÂͦÎÕ ÷ÁÌÀÔÉ',
+ 'Foreign Exchange Loss' => '÷ÔÒÁÔÁ ÎÁ ïÂͦΦ ÷ÁÌÀÔÉ',
+ 'From' => '÷¦Ä / Ú',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI ×ÉÄÁÌÅÎÏ!',
+ 'GIFI missing!' => 'îÅ ×ËÁÚÁÎÏ GIFI!',
+ 'GIFI saved!' => 'GIFI ÚÂÅÒÅÖÅÎÏ!',
+ 'GL Transaction' => 'çë ïÐÅÒÁæÑ',
+ 'General Ledger' => 'çÏÌÏ×ÎÁ ëÎÉÇÁ',
+ 'Goods & Services' => 'ôÏ×ÁÒÉ ¦ ðÏÓÌÕÇÉ',
+ 'HTML Templates' => 'HTML ûÁÂÌÏÎÉ ',
+ 'Heading' => 'òÏÚĦÌ',
+ 'Host' => 'íÁÛÉÎÁ/Host',
+ 'Hostname missing!' => 'îÅ ×ËÁÚÁÎÁ ÎÁÚ×Á ÍÁÛÉÎÉ!',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'Image' => 'úÏÂÒÁÖÅÎÎÑ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Include in drop-down menus' => 'äÏÄÁÔÉ ÄÏ ÌÉÓÔÏ×ÉÈ ÍÅÎÀ',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'äÏÄÁÔÉ ÒÁÈÕÎÏË ÄÏ ÆÏÒÍ Ë̦¤ÎÔ¦×/ÐÏÓÔÁÞÁÌØÎÉ˦×, ÝÏ ÐÏÚÎÁÞÁÔÉ Ë̦¤ÎÔ¦×/ÐÏÓÔÁÞÁÌØÎÉË¦× Ú ÑËÉÈ ÓÔÑÇÕÀÔØÓÑ ÐÏÄÁÔËÉ?',
+ 'Income' => 'ðÒÉÂÕÔÏË',
+ 'Income Account' => 'òÁÈÕÎÏË ðÒÉÂÕÔ˦×',
+ 'Income Statement' => 'ú×¦Ô ÐÒÏ ÄÏÈÏÄÉ ¦ ×ÉÄÁÔËÉ',
+ 'Incorrect Dataset version!' => 'îÅצÒÎÁ ×ÅÒÓ¦Ñ âÁÚÉ äÁÎÉÈ!',
+ 'Incorrect Password!' => 'îÅצÒÎÉÊ ðÁÒÏÌØ!',
+ 'Individual Items' => '¶ÎÄÉצÄÕÁÌØÎ¦ þÁÓÔÉÎÉ',
+ 'Inventory' => '¶Î×ÅÎÔÁÒ',
+ 'Inventory Account' => '¶Î×ÅÎÔÁÒÎÉÊ ÒÁÈÕÎÏË',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ, ÐÅÒÛ Î¦Ö ÍÏÖÎÁ ÐÏÚÎÁÞÉÔÉ ËÏÍÐÌÅËÔ ÚÁÓÔÁÒ¦ÌÉÍ!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ, ÐÅÒÛ Î¦Ö ÍÏÖÎÁ ÐÏÚÎÁÞÉÔÉ ÃÉÊ ÔÏ×ÁÒ ÚÁÓÔÁÒ¦ÌÉÍ!',
+ 'Inventory quantity must be zero!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ!',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice deleted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÄÁÌÅÎÉÊ!',
+ 'Invoice posted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÓÔÁ×ÌÅÎÉÊ!',
+ 'Invoices' => 'òÁÈÕÎËÉ-ÆÁËÔÕÒÉ',
+ 'Is this a summary account to record' => 'þÉ ÃŠЦÄÓÕÍËÏ×ÉÊ ÒÁÈÕÎÏË ÄÌÑ ÚÁÐÉÓÕ?',
+ 'Item deleted!' => 'ò¦Þ ×ÉÄÁÌÅÎÏ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'LaTeX Templates' => 'LaTeX ûÁÂÌÏÎÉ',
+ 'Language' => 'íÏ×Á',
+ 'Last Cost' => 'ëÕЦ×ÅÌØÎÁ ã¦ÎÁ',
+ 'Last Invoice Number' => 'îÏÍÅÒ ïÓÔÁÎÎØÏÇÏ òÁÈÕÎËÕ-æÁËÔÕÒÉ',
+ 'Last Numbers & Default Accounts' => 'ïÓÔÁÎΦ îÏÍÅÒÉ ¦ ôÉÐÏצ òÁÈÕÎËÉ',
+ 'Last Purchase Order Number' => 'îÏÍÅÒ ÏÓÔÁÎÎØÏÇÏ úÁÍÏ×ÌÅÎÎÑ ÎÁ ðÏÓÔÁÞÕ',
+ 'Last Sales Order Number' => 'îÏÍÅÒ ÏÓÔÁÎÎØÏ§ ðÒÏÄÁÖÎϧ îÁËÌÁÄÎϧ',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'ñËÝÏ ×É ÎÅ ÂÁÖÁ¤ÔÅ ×ÓÔÁÎÏ×ÉÔÉ ×¦ÄÄÁÌÅÎÉÊ Ú×ÑÚÏË, ÎÅ ÚÁÐÏ×ÎÀÊÔÅ ÐÏÌÑ ÍÁÛÉÎÉ ¦ ÐÏÒÔÕ.',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Licensed to' => 'ì¦ÃÅÎÚ¦¤À ×ÏÌÏĦ¤:',
+ 'Line Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Link' => 'ðÏÓÉÌÁÎÎÑ',
+ 'Link Accounts' => 'ðÏ×ÑÚÁÔÉ òÁÈÕÎËÉ',
+ 'List Accounts' => 'óÐÉÓÏË òÁÈÕÎ˦×',
+ 'List GIFI' => 'óÐÉÓÏË GIFI',
+ 'List Price' => 'ã¦ÎÁ',
+ 'List Transactions' => 'óÐÉÓÏË ðÒÏ×ÏÄÏË',
+ 'Login' => 'ðÏÞÁÔÏË óÅÁÎÓÕ',
+ 'Logout' => 'ë¦ÎÅÃØ óÅÁÎÓÕ',
+ 'Make' => '÷ÉÒÏÂÎÉÃÔ×Ï',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Microfiche' => 'í¦ËÒÏÆ¦ÛÁ',
+ 'Model' => 'íÏÄÅÌØ',
+ 'Multibyte Encoding' => 'íÕÌØÔÉÂÉÔÎÅ ëÏÄÕ×ÁÎÎÑ',
+ 'N/A' => 'îÅ óÔÏÓÕ¤ÔØÓÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'Name missing!' => 'îÅ ×ËÁÚÁÎÅ ¦Í\'Ñ (ÎÁÚ×Á)!',
+ 'New Templates' => 'îÏצ ûÁÂÌÏÎÉ',
+ 'No' => 'î¦',
+ 'No Database Drivers available!' => 'îÅÄÏÓÔÕÐÎÉÊ ÄÒÁÊ×ÅÒ âÁÚÉ äÁÎÉÈ!',
+ 'No Dataset selected!' => 'îÅ ÐÏÚÎÁÞÅÎÏ ×ÉÂÒÁÎÕ âÁÚÕ äÁÎÉÈ!',
+ 'No email address for' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ ÄÌÑ',
+ 'No.' => 'No.',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nothing applied!' => 'î¦ÞÏÇÏ ÎÅ ÚÁÓÔÏÓÏ×ÁÎÏ!',
+ 'Nothing selected!' => 'î¦ÞÏÇÏ ÎÅ ×ÉÂÒÁÎÏ!',
+ 'Nothing to delete!' => 'îÅÍÁ ÝÏ ×ÉÄÁÌÉÔÉ!',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number Format' => 'æÏÒÍÁÔ þÉÓÌÁ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'O' => 'ï',
+ 'Obsolete' => 'úÁÓÔÁÒ¦ÌÅ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'On Hand' => 'îÁ òÕËÁÈ',
+ 'On Order' => 'îÁ úÁÍÏ×ÌÅÎΦ',
+ 'Open' => '÷¦ÄËÒÉÔÏ',
+ 'Oracle Database Administration' => 'áÄͦΦÓÔÒÁÃ¦Ñ âÁÚÉ äÁÎÉÈ Oracle',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date' => 'äÁÔÁ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Entry' => '÷ÉÓÔÁ×ÌÅÎÎÑ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order deleted!' => 'úÁÍÏ×ÌÅÎÎÑ ×ÉÄÁÌÅÎÏ!',
+ 'Order saved!' => 'úÁÍÏ×ÌÅÎÎÑ ÚÂÅÒÅÖÅÎÏ!',
+ 'Ordered' => 'úÁÍÏ×ÌÅÎÏ',
+ 'Orphaned' => '÷¦ÄÏËÒÅÍÌÅÎÉÊ/ïÓÉÒÏÔ¦ÌÉÊ',
+ 'Out of balance!' => 'îÅ ÚÂÁÌÁÎÓÏ×ÁÎÏ!',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Paid' => 'úÁÐÌÁÞÅÎÏ',
+ 'Paid in full' => 'úÁÐÌÁÞÅÎÏ ×ÐÏ×Φ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Part Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ ôÏ×ÁÒÕ!',
+ 'Parts' => 'ÔÏ×ÁÒÉ',
+ 'Parts Inventory' => '¶Î×ÅÎÔÁÒ ôÏ×ÁÒ¦×',
+ 'Password' => 'ðÁÒÏÌØ',
+ 'Password changed!' => 'ðÁÒÏÌØ ÚͦÎÅÎÏ!',
+ 'Payables' => 'úÏÂÏ×ÑÚÁÎÎÑ (ÐÌÁÔ¦ÖΦ)',
+ 'Payment' => 'ðÌÁÔ¦Ö',
+ 'Payment date missing!' => 'îÅ ×ËÁÚÁÎÏ ÄÁÔÕ ðÌÁÔÅÖÕ!',
+ 'Payment posted!' => 'ðÌÁÔ¦Ö ×ÉÓÔÁ×ÌÅÎÏ!',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Pg Database Administration' => 'áÄͦΦÓÔÒÁÃ¦Ñ âÁÚÉ äÁÎÉÈ Pg',
+ 'Phone' => 'ôÅÌ.',
+ 'Port' => 'ðÏÒÔ',
+ 'Port missing!' => 'ðÏÒÔ ÎÅ ×ËÁÚÁÎÏ!',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'îÁÓÔÒÏÊËÉ',
+ 'Preferences saved!' => 'îÁÓÔÒÏÊËÉ ÚÂÅÒÅÖÅÎÏ!',
+ 'Price' => 'ã¦ÎÁ',
+ 'Print' => 'îÁÄÒÕËÕ×ÁÔÉ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project Number' => '',
+ 'Project Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÐÒÏÅËÔÕ!',
+ 'Project deleted!' => 'ðÒÏÅËÔ ×ÉÄÁÌÅÎÏ!',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Project saved!' => 'ðÒÏÅËÔ ÚÂÅÒÅÖÅÎÏ!',
+ 'Projects' => 'ðÒÏÅËÔÉ',
+ 'Purchase Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Purchase Orders' => 'ëÕЦ×ÅÌØÎ¦ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'ROP' => 'ROP',
+ 'Rate' => 'òÏÚæÎËÁ',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Receipt' => 'ë×ÉÔÁÎæÑ',
+ 'Receipt printed!' => '',
+ 'Receipt printing failed!' => '',
+ 'Receipts' => 'ë×ÉÔÁÎæ§',
+ 'Receivables' => 'îÁÌÅÖÎÏÓÔ¦ (ÄÅÂÉÔÉ)',
+ 'Reconciliation' => 'õÚÇÏÄÖÅÎÎÑ',
+ 'Record in' => '÷ÎÅÓÔÉ ×',
+ 'Reference' => 'úÓÉÌËÁ',
+ 'Reference missing!' => 'îÅ ×ËÁÚÁÎÁ ÚÓÉÌËÁ!',
+ 'Remaining' => 'úÁÌÉÛÉÌÏÓØ',
+ 'Report for' => 'ú×¦Ô ÄÌÑ',
+ 'Reports' => 'úצÔÉ',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Retained Earnings' => 'ðÒÉÂÕÔÏË (ÎÅÒÏÚÐÏĦÌÅÎÉÊ)',
+ 'Sales' => 'úÂÕÔ',
+ 'Sales Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Sales Orders' => 'îÁËÌÁÄΦ ðÒÏÄÁÖÕ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Save as new' => 'úÂÅÒÅÇÔÉ ÑË ÎÏ×Å',
+ 'Save to File' => 'úÂÅÒÅÇÔÉ Õ æÁÊ̦',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select a Dataset to delete and press "Continue"' => '÷ÉÂÅÒ¦ÔØ âÁÚÕ äÁÎÉÈ ÄÌÑ ×ÉÄÁÌÅÎÎÑ ¦ ÎÁÔÉÓÎ¦ÔØ "ðÒÏÄÏ×ÖÉÔÉ"',
+ 'Select all' => '÷ÉÂÒÁÔÉ ×ÓÅ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sell Price' => '÷¦ÄÐÕÓËÎÁ ã¦ÎÁ',
+ 'Send by E-Mail' => '÷ÉÓÌÁÔÉ ÐÏ ÅÌ. ÐÏÛÔ¦',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Service Items' => 'ðÏÓÌÕÇÉ',
+ 'Service Number missing!' => 'îÏÍÅÒ ðÏÓÌÕÇÉ ÎÅ ×ËÁÚÁÎÏ',
+ 'Services' => 'ðÏÓÌÕÇÉ',
+ 'Setup Templates' => 'îÁÌÁÛÔÕ×ÁÔÉ ûÁÂÌÏÎÉ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Ship via' => 'ðÏÓÌÁÔÉ ÞÅÒÅÚ',
+ 'Short' => 'óËÏÒÏÞÅÎÏ',
+ 'Signature' => 'ð¦ÄÐÉÓ',
+ 'Sold' => 'ðÒÏÄÁÎÏ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Standard' => 'óÔÁÎÄÁÒÔΦ',
+ 'Statement' => 'úצÔ',
+ 'Statement Balance' => 'âÁÌÁÎÓÏ×ÉÊ úצÔ',
+ 'Statement sent to' => 'ú×¦Ô ÐÏÓÌÁÎÏ ÄÏ',
+ 'Statements sent to printer!' => 'ú×¦Ô ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ!',
+ 'Stock Assembly' => '¶Î×ÅÎÔÁÒ ëÏÍÐÌÅËÔÕ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÎÎÑ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'System' => 'óÉÓÔÅÍÁ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax Accounts' => 'ðÏÄÁÔËÏצ òÁÈÕÎËÉ',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'Tax collected' => 'ú¦ÂÒÁÎÏ ÐÏÄÁÔË¦× ',
+ 'Tax paid' => 'ðÏÄÁÔÏË ÚÁÐÌÁÞÅÎÏ',
+ 'Taxable' => 'ïÐÏÄÁÔËÏ×Õ¤ÔØÓÑ',
+ 'Template saved!' => 'ûÁÂÌÏÎ ÚÂÅÒÅÖÅÎÏ!',
+ 'Templates' => 'ûÁÂÌÏÎÉ',
+ 'Terms: Net' => 'õÍÏ×É: úÁÐÌÁÔÉÔÉ',
+ 'The following Datasets are not in use and can be deleted' => 'îÁÓÔÕÐΦ âÁÚÉ äÁÎÉÈ ÎÅ ×ÉËÏÒÉÓÔÏ×ÕÀÔØÓÑ ¦ ÍÏÖÕÔØ ÂÕÔÉ ×ÉÄÁÌÅΦ',
+ 'The following Datasets need to be updated' => 'îÁÓÔÕÐΦ âÁÚÉ äÁÎÉÈ ÐÏ×ÉÎΦ ÂÕÔÉ ÐÏÎÏ×ÌÅΦ',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'ðÏÐÅÒÅÄÎÑ ÐÅÒÅצÒËÁ ¦ÓÎÕÀÞÉÈ ÄÖÅÒÅÌ. ðÏËÉ ÝÏ Î¦ÞÏÇÏ ÎÅ ÂÕÄÅ ÓÔ×ÏÒÅÎÏ ÁÂÏ ×ÉÄÁÌÅÎÏ!',
+ 'To' => 'äÏ',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'ýÏ ÄÏÄÁÔÉ ËÏÒÉÓÔÕ×ÁÞÁ ÄÏ ÇÒÕÐÉ, ÔÒÅÂÁ ÐÏͦÎÑÔÉ ¦Í\'Ñ, login/××ÏÄÎÅ ¦ÍÑ ¦ ÚÂÅÒÅÇÔÉ. îÏ×ÉÊ ËÏÒÉÓÔÕ×ÁÞÁ ¦Ú ÏÄÎÁËÏ×ÉÍÉ ÐÁÒÁÍÅÔÒÁÍÉ ÂÕÄÅ ÚÂÅÒÅÖÅÎÏ Ð¦Ä ÎÏ×ÉÍ login/××ÏÄÎÉÍ ¦Í\'ÑÍ.',
+ 'Top Level' => '÷ÅÒÈÎ¦Ê ò¦×ÅÎØ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Transaction Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ÏÐÅÒÁæ§',
+ 'Transaction deleted!' => 'ïÐÅÒÁÃ¦Ñ ×ÉÄÁÌÅÎÁ',
+ 'Transaction posted!' => 'ïÐÅÒÁÃ¦Ñ ÚĦÊÓÎÅÎÁ',
+ 'Transaction reversal enforced for all dates' => 'ðÒÉÚÎÁÞÅÎÏ ÒÅ×ÅÓÉ×ÎÕ ÚͦÎÕ ÏÐÅÒÁÃ¦Ê ÄÌÑ ×Ó¦È ÄÁÔ',
+ 'Transaction reversal enforced up to' => ' ðÒÉÚÎÁÞÅÎÏ ÒÅ×ÅÓÉ×ÎÕ ÚͦÎÁ ÏÐÅÒÁÃ¦Ê ÁÖ ÄÏ',
+ 'Transactions' => 'ïÐÅÒÁæ§',
+ 'Transactions exist, cannot delete customer!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ Ë̦¤ÎÔÁ',
+ 'Transactions exist, cannot delete vendor!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ ÐÏÓÔÁÞÁÌØÎÉËÁ',
+ 'Transactions exist; cannot delete account!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Trial Balance' => 'ðÒÏÂÎÉÊ âÁÌÁÎÓ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'Unit of measure' => 'ïÄÉÎÉÃÑ ×ÉͦÒÕ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Update Dataset' => 'ðÏÎÏ×ÉÔÉ âÁÚÕ äÁÎÉÈ',
+ 'Updated' => 'ðÏÎÏ×ÌÅÎÏ',
+ 'Use Templates' => '÷ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ûÁÂÌÏÎÉ',
+ 'User' => 'ëÏÒÉÓÔÕ×ÁÞ',
+ 'User deleted!' => 'ëÏÒÉÓÔÕ×ÁÞ ÷ÉÄÁÌÅÎÉÊ',
+ 'User saved!' => 'ëÏÒÉÓÔÕ×ÁÞ ÚÂÅÒÅÖÅÎÉÊ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'Vendor deleted!' => 'ðÏÓÔÁÞÁÌØÎÉË ×ÉÄÁÌÅÎÉÊ',
+ 'Vendor missing!' => 'ðÏÓÔÁÞÁÌØÎÉË ÎÅ ¦ÓÎÕ¤',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'Vendor saved!' => 'ðÏÓÔÁÞÁÌØÎÉËÁ ÚÂÅÒÅÖÅÎÏ',
+ 'Vendors' => 'ðÏÓÔÁÞÁÌØÎÉËÉ',
+ 'Version' => '÷ÅÒÓ¦Ñ',
+ 'Weight' => '÷ÁÇÁ',
+ 'Weight Unit' => 'ïÄÉÎÉÃÑ ÷ÁÇÉ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'Year End' => 'ë¦ÎÅÃØ æ¦ÎÁÎÓÏ×ÏÇÏ òÏËÕ',
+ 'Yes' => 'Tak',
+ 'You are logged out!' => '÷ÁÛ ÓÅÁÎÓ ÚÁ˦ÎÞÉ×ÓÑ!',
+ 'You did not enter a name!' => 'îÅ ××ÅÄÅÎÏ ¦Í\'Ñ/ÎÁÚ×Õ',
+ 'You must enter a host and port for local and remote connections!' => 'íÕÓÉÔÅ ××ÅÓÔÉ ÎÁÚ×Õ ÍÁÛÉÎÉ ¦ ÐÏÒÔÁ ÄÌÑ Í¦ÓÃÅ×ÏÇÏ ¦ צÄÄÁÌÅÎÏÇÏ Ú×ÑÚËÕ!',
+ 'as at' => 'ÑË ×',
+ 'collected on sales' => 'Ú¦ÂÒÁÎÏ ÐÒÉ ÐÒÏÄÁÖÕ',
+ 'days' => 'ÄΦ×',
+ 'does not exist' => 'ÎÅ ¦ÓÎÕ¤',
+ 'ea' => 'ÛÔ.',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'for Period' => 'ÚÁ ðÅÒ¦ÏÄ',
+ 'hr' => 'ÇÏÄ.',
+ 'is already a member!' => '×ÖÅ ¤ ÞÌÅÎÏÍ!',
+ 'is not a member!' => 'ÎÅ ¤ ÞÌÅÎÏÍ!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'ÚÁÍËÎÕÔÉÊ!',
+ 'paid on purchases' => 'ÚÁÐÌÁÞÅÎÏ ÎÁ ÐÏËÕÐËÉ',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+ 'successfully created!' => 'ÕÓЦÛÎÏ ÓÔ×ÏÒÅÎÏ!',
+ 'successfully deleted!' => 'ÕÓЦÛÎÏ ×ÉÄÁÌÅÎÏ!',
+ 'to' => 'ÄÏ',
+ 'website' => '×ÅÂ-ÓÔÏÒ¦ÎËÁ',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/am b/sql-ledger/locale/ua/am
new file mode 100644
index 000000000..90643016c
--- /dev/null
+++ b/sql-ledger/locale/ua/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => '÷ÉÔÒÁÔÉ',
+ 'AR' => 'äÏÈÏÄÉ',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Account Number' => 'îÏÍÅÒ òÁÈÕÎËÕ',
+ 'Account Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÕ!',
+ 'Account Type' => '÷ÉÄ ÒÁÈÕÎËÕ',
+ 'Account Type missing!' => 'îÅ ×ËÁÚÁÎÉÊ ×ÉÄ ÒÁÈÕÎËÕ!',
+ 'Account deleted!' => 'òÁÈÕÎÏË ×ÉÄÁÌÅÎÉÊ',
+ 'Account saved!' => 'òÁÈÕÎÏË ÚÂÅÒÅÖÅÎÏ',
+ 'Add Account' => 'îÏ×ÉÊ ÒÁÈÕÎÏË',
+ 'Add GIFI' => 'îÏ×ÉÊ GIFI',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Asset' => 'áËÔÉ×',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Backup sent to' => 'òÅÚÅÒ×ÎÁ ËÏÐ¦Ñ ÐÏÓÌÁÎÁ ÄÏ',
+ 'Books are open' => 'ëÎÉÇÁ צÄËÒÉÔÁ',
+ 'Business Number' => 'â¦ÚÎÅÓ-ÎÏÍÅÒ',
+ 'COGS' => 'COGS',
+ 'Cannot delete account!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Cannot delete default account!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÓÎÏ×ÎÉÊ ÒÁÈÕÎÏË!',
+ 'Cannot save account!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÒÁÈÕÎÏË!',
+ 'Cannot save preferences!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÎÁÓÔÒÏÊËÉ!',
+ 'Character Set' => 'ëÏÄÉÒÏ×ËÁ',
+ 'Chart of Accounts' => 'ðÌÁÎ òÁÈÕÎ˦×',
+ 'Close Books up to' => 'úÁËÒÉÔÉ ëÎÉÇÉ ÄÏ',
+ 'Company' => 'ð¦ÄÐÒɤÍÓÔ×Ï',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copy to COA' => 'óËÏЦÀ×ÁÔÉ ÄÏ ðÌÁÎÕ òÁÈÕÎ˦×',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Date Format' => 'æÏÒÍÁÔ ÄÁÔÉ',
+ 'Debit' => 'äÅÂÉÔ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delete Account' => '÷ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Description' => 'ïÐÉÓ',
+ 'Dropdown Limit' => 'ïÂÍÅÖÅÎÎÑ ÌÉÓÔÏ×ÏÇÏ ÍÅÎÀ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'Edit' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ',
+ 'Edit Account' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ òÁÈÕÎÏË',
+ 'Edit GIFI' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ GIFI',
+ 'Edit Preferences for' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ îÁÓÔÒÏÊËÉ',
+ 'Edit Template' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ûÁÂÌÏÎ',
+ 'Enforce transaction reversal for all dates' => 'úÁÓÔÁ×ÉÔÉ Ú×ÏÒÏÔÎÕ ÚͦÎÕ ÐÒÏ×ÏÄÏË ÄÌÑ ×Ó¦È ÄÁÔ',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => '÷×ÅÄ¦ÔØ ÄÏ 3 ̦ÔÅÒ ÒÏÚĦÌÅÎÉÈ Ä×ÏËÒÁÐËÁÍÉ (i.e CAD:USD:EUR) ÄÌÑ ÐÏÚÎÁÞÅÎÎÑ Í¦ÓÃÅ×ϧ ¦ ¦ÎÏÚÅÍÎÉÈ ÇÒÏÛÏ×ÉÈ ÏÄÉÎÉÃØ',
+ 'Equity' => 'ëÁЦÔÁÌ',
+ 'Expense' => '÷ÉÄÁÔËÉ',
+ 'Expense Account' => 'òÁÈÕÎÏË ÷ÉÄÁÔ˦×',
+ 'Expense/Asset' => '÷ÉÄÁÔÏË/áËÔÉ×',
+ 'Fax' => 'æÁÈ',
+ 'Foreign Exchange Gain' => 'ðÒÉÂÕÔÏË Ú ïÂͦÎÕ ÷ÁÌÀÔÉ',
+ 'Foreign Exchange Loss' => '÷ÔÒÁÔÁ ÎÁ ïÂͦΦ ÷ÁÌÀÔÉ',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI ×ÉÄÁÌÅÎÏ!',
+ 'GIFI missing!' => 'îÅ ×ËÁÚÁÎÏ GIFI!',
+ 'GIFI saved!' => 'GIFI ÚÂÅÒÅÖÅÎÏ!',
+ 'Heading' => 'òÏÚĦÌ',
+ 'Include in drop-down menus' => 'äÏÄÁÔÉ ÄÏ ÌÉÓÔÏ×ÉÈ ÍÅÎÀ',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'äÏÄÁÔÉ ÒÁÈÕÎÏË ÄÏ ÆÏÒÍ Ë̦¤ÎÔ¦×/ÐÏÓÔÁÞÁÌØÎÉ˦×, ÝÏ ÐÏÚÎÁÞÁÔÉ Ë̦¤ÎÔ¦×/ÐÏÓÔÁÞÁÌØÎÉË¦× Ú ÑËÉÈ ÓÔÑÇÕÀÔØÓÑ ÐÏÄÁÔËÉ?',
+ 'Income' => 'ðÒÉÂÕÔÏË',
+ 'Income Account' => 'òÁÈÕÎÏË ðÒÉÂÕÔ˦×',
+ 'Inventory' => '¶Î×ÅÎÔÁÒ',
+ 'Inventory Account' => '¶Î×ÅÎÔÁÒÎÉÊ ÒÁÈÕÎÏË',
+ 'Is this a summary account to record' => 'þÉ ÃŠЦÄÓÕÍËÏ×ÉÊ ÒÁÈÕÎÏË ÄÌÑ ÚÁÐÉÓÕ?',
+ 'Language' => 'íÏ×Á',
+ 'Last Invoice Number' => 'îÏÍÅÒ ïÓÔÁÎÎØÏÇÏ òÁÈÕÎËÕ-æÁËÔÕÒÉ',
+ 'Last Numbers & Default Accounts' => 'ïÓÔÁÎΦ îÏÍÅÒÉ ¦ ôÉÐÏצ òÁÈÕÎËÉ',
+ 'Last Purchase Order Number' => 'îÏÍÅÒ ÏÓÔÁÎÎØÏÇÏ úÁÍÏ×ÌÅÎÎÑ ÎÁ ðÏÓÔÁÞÕ',
+ 'Last Sales Order Number' => 'îÏÍÅÒ ÏÓÔÁÎÎØÏ§ ðÒÏÄÁÖÎϧ îÁËÌÁÄÎϧ',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Link' => 'ðÏÓÉÌÁÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No' => 'î¦',
+ 'No email address for' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ ÄÌÑ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number Format' => 'æÏÒÍÁÔ þÉÓÌÁ',
+ 'Parts Inventory' => '¶Î×ÅÎÔÁÒ ôÏ×ÁÒ¦×',
+ 'Password' => 'ðÁÒÏÌØ',
+ 'Payables' => 'úÏÂÏ×ÑÚÁÎÎÑ (ÐÌÁÔ¦ÖΦ)',
+ 'Payment' => 'ðÌÁÔ¦Ö',
+ 'Phone' => 'ôÅÌ.',
+ 'Preferences saved!' => 'îÁÓÔÒÏÊËÉ ÚÂÅÒÅÖÅÎÏ!',
+ 'Rate' => 'òÏÚæÎËÁ',
+ 'Receivables' => 'îÁÌÅÖÎÏÓÔ¦ (ÄÅÂÉÔÉ)',
+ 'Sales' => 'úÂÕÔ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Service Items' => 'ðÏÓÌÕÇÉ',
+ 'Ship via' => 'ðÏÓÌÁÔÉ ÞÅÒÅÚ',
+ 'Signature' => 'ð¦ÄÐÉÓ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÎÎÑ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax Accounts' => 'ðÏÄÁÔËÏצ òÁÈÕÎËÉ',
+ 'Template saved!' => 'ûÁÂÌÏÎ ÚÂÅÒÅÖÅÎÏ!',
+ 'Transaction reversal enforced for all dates' => 'ðÒÉÚÎÁÞÅÎÏ ÒÅ×ÅÓÉ×ÎÕ ÚͦÎÕ ÏÐÅÒÁÃ¦Ê ÄÌÑ ×Ó¦È ÄÁÔ',
+ 'Transaction reversal enforced up to' => ' ðÒÉÚÎÁÞÅÎÏ ÒÅ×ÅÓÉ×ÎÕ ÚͦÎÁ ÏÐÅÒÁÃ¦Ê ÁÖ ÄÏ',
+ 'Transactions exist; cannot delete account!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË',
+ 'Weight Unit' => 'ïÄÉÎÉÃÑ ÷ÁÇÉ',
+ 'Year End' => 'ë¦ÎÅÃØ æ¦ÎÁÎÓÏ×ÏÇÏ òÏËÕ',
+ 'Yes' => 'Tak',
+ 'does not exist' => 'ÎÅ ¦ÓÎÕ¤',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'îÏ×ÉÊ_ÒÁÈÕÎÏË' => 'add_account',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ 'óËÏЦÀ×ÁÔÉ_ÄÏ_ðÌÁÎÕ_òÁÈÕÎ˦×' => 'copy_to_coa',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ' => 'edit',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ_òÁÈÕÎÏË' => 'edit_account',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ap b/sql-ledger/locale/ua/ap
new file mode 100644
index 000000000..a5ec52db5
--- /dev/null
+++ b/sql-ledger/locale/ua/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'ïÐÅÒÁæ§ ÷ÉÔÒÁÔ',
+ 'AP Transactions' => 'ïÐÅÒÁæ§ ÷ÉÔÒÁÔ',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Add Accounts Payables Transaction' => 'îÏ×Á ÏÐÅÒÁÃ¦Ñ ×ÉÔÒÁÔ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Amount Due' => 'úÁÐÌÁÔÉÔÉ óÕÍÕ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Transaction' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÕ ÏÐÅÒÁæÀ?',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Cannot delete transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÒÅ!',
+ 'Cannot post payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post transaction for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ!',
+ 'Closed' => 'úÁËÒÉÔÏ',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÉ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'Due Date' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Due Date missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÔÅÒͦΠÏÐÌÁÔÉ!',
+ 'Edit Accounts Payables Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏ×ÏÄËÕ ÷ÉÔÒÁÔ',
+ 'Employee' => 'ðÒÁæ×ÎÉË',
+ 'Exch' => 'ëÕÒÓ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate for payment missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ ÄÌÑ ÐÌÁÔÅÖÕ!',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Open' => '÷¦ÄËÒÉÔÏ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Paid' => 'úÁÐÌÁÞÅÎÏ',
+ 'Payment date missing!' => 'îÅ ×ËÁÚÁÎÏ ÄÁÔÕ ðÌÁÔÅÖÕ!',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Purchase Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Transaction deleted!' => 'ïÐÅÒÁÃ¦Ñ ×ÉÄÁÌÅÎÁ',
+ 'Transaction posted!' => 'ïÐÅÒÁÃ¦Ñ ÚĦÊÓÎÅÎÁ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'Vendor missing!' => 'ðÏÓÔÁÞÁÌØÎÉË ÎÅ ¦ÓÎÕ¤',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'Yes' => 'Tak',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ïÐÅÒÁæ§_÷ÉÔÒÁÔ' => 'ap_transaction',
+ 'îÏ×Á_ÏÐÅÒÁæÑ_×ÉÔÒÁÔ' => 'add_accounts_payables_transaction',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ_ðÒÏ×ÏÄËÕ_÷ÉÔÒÁÔ' => 'edit_accounts_payables_transaction',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ '÷ÉÓÔÁ×ÉÔÉ_ÑË_ÎÏ×ÉÊ' => 'post_as_new',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'purchase_invoice',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ar b/sql-ledger/locale/ua/ar
new file mode 100644
index 000000000..cbbc5b182
--- /dev/null
+++ b/sql-ledger/locale/ua/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'ïÐÅÒÁÃ¦Ñ äÏÈÏĦ×',
+ 'AR Transactions' => 'ïÐÅÒÁÃ¦Ñ äÏÈÏĦ×',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Add Accounts Receivables Transaction' => 'îÏ×Á ÏÐÅÒÁÃ¦Ñ ÄÏÈÏĦ×',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Amount Due' => 'úÁÐÌÁÔÉÔÉ óÕÍÕ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Transaction' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÕ ÏÐÅÒÁæÀ?',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Cannot delete transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÒÅ!',
+ 'Cannot post payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post transaction for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ!',
+ 'Closed' => 'úÁËÒÉÔÏ',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Credit Limit' => 'ì¦Í¦Ô ËÒÅÄÉÔÕ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Customer missing!' => 'îÅ ×ËÁÚÁÎÉÊ Ë̦¤ÎÔ!',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Paid' => 'äÁÔÁ ÏÐÌÁÔÉ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'Due Date' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Due Date missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÔÅÒͦΠÏÐÌÁÔÉ!',
+ 'Edit Accounts Receivables Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏ×ÏÄËÕ äÏÈÏĦ×',
+ 'Employee' => 'ðÒÁæ×ÎÉË',
+ 'Exch' => 'ëÕÒÓ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate for payment missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ ÄÌÑ ÐÌÁÔÅÖÕ!',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Open' => '÷¦ÄËÒÉÔÏ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Paid' => 'úÁÐÌÁÞÅÎÏ',
+ 'Payment date missing!' => 'îÅ ×ËÁÚÁÎÏ ÄÁÔÕ ðÌÁÔÅÖÕ!',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Remaining' => 'úÁÌÉÛÉÌÏÓØ',
+ 'Sales Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Transaction deleted!' => 'ïÐÅÒÁÃ¦Ñ ×ÉÄÁÌÅÎÁ',
+ 'Transaction posted!' => 'ïÐÅÒÁÃ¦Ñ ÚĦÊÓÎÅÎÁ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'Yes' => 'Tak',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ïÐÅÒÁæÑ_äÏÈÏĦ×' => 'ar_transaction',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ '÷ÉÓÔÁ×ÉÔÉ_ÑË_ÎÏ×ÉÊ' => 'post_as_new',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'sales_invoice',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/arap b/sql-ledger/locale/ua/arap
new file mode 100644
index 000000000..64f47c52b
--- /dev/null
+++ b/sql-ledger/locale/ua/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Description' => 'ïÐÉÓ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ca b/sql-ledger/locale/ua/ca
new file mode 100644
index 000000000..64f42dd11
--- /dev/null
+++ b/sql-ledger/locale/ua/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Balance' => 'âÁÌÁÎÓ',
+ 'Chart of Accounts' => 'ðÌÁÎ òÁÈÕÎ˦×',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÉÔ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Description' => 'ïÐÉÓ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'List Transactions' => 'óÐÉÓÏË ðÒÏ×ÏÄÏË',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Reference' => 'úÓÉÌËÁ',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'óÐÉÓÏË_ðÒÏ×ÏÄÏË' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/cp b/sql-ledger/locale/ua/cp
new file mode 100644
index 000000000..0a74130fe
--- /dev/null
+++ b/sql-ledger/locale/ua/cp
@@ -0,0 +1,77 @@
+$self{texts} = {
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Amount does not equal applied!' => 'óÕÍÁ ÎÅ ÄÏÒ¦×ÎÀ¤ ÚÁÓÔÏÓÏ×ÁΦÊ!',
+ 'Amount missing!' => 'îÅ ×ËÁÚÁÎÁ ÓÕÍÁ!',
+ 'Applied' => 'úÁÓÔÏÓÏ×ÁÎÏ',
+ 'Cannot post payment!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö!',
+ 'Cannot process payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ÐÒÏ×ÅÓÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Check' => 'þÅË',
+ 'Check printed!' => 'þÅË ÎÁÄÒÕËÏ×ÁÎÏ!',
+ 'Check printing failed!' => 'äÒÕË ÞÅËÕ ÎÅ ×ÄÁ×ÓÑ!',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ!',
+ 'Description' => 'ïÐÉÓ',
+ 'Due' => 'äÏ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'From' => '÷¦Ä / Ú',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoices' => 'òÁÈÕÎËÉ-ÆÁËÔÕÒÉ',
+ 'Nothing applied!' => 'î¦ÞÏÇÏ ÎÅ ÚÁÓÔÏÓÏ×ÁÎÏ!',
+ 'Number' => 'îÏÍÅÒ',
+ 'Paid in full' => 'úÁÐÌÁÞÅÎÏ ×ÐÏ×Φ',
+ 'Payment' => 'ðÌÁÔ¦Ö',
+ 'Payment posted!' => 'ðÌÁÔ¦Ö ×ÉÓÔÁ×ÌÅÎÏ!',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Print' => 'îÁÄÒÕËÕ×ÁÔÉ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Receipt' => 'ë×ÉÔÁÎæÑ',
+ 'Receipt printed!' => 'Receipt printed!',
+ 'Receipt printing failed!' => 'Receipt printing failed!',
+ 'Reference' => 'úÓÉÌËÁ',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ 'îÁÄÒÕËÕ×ÁÔÉ' => 'print',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ct b/sql-ledger/locale/ua/ct
new file mode 100644
index 000000000..80db8dfa1
--- /dev/null
+++ b/sql-ledger/locale/ua/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÉÊ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'All' => '÷Ó¦',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Cannot delete customer!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ Ë̦¤ÎÔÁ',
+ 'Cannot delete vendor!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÐÏÓÔÁÞÁÌØÎÉËÁ!',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Credit Limit' => 'ì¦Í¦Ô ËÒÅÄÉÔÕ',
+ 'Customer deleted!' => 'ë̦¤ÎÔÁ ×ÉÄÁÌÅÎÏ!',
+ 'Customer saved!' => 'ë̦¤ÎÔÁ ÚÂÅÒÅÖÅÎÏ!',
+ 'Customers' => 'ë̦¤ÎÔÉ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Discount' => 'óËÉÄËÁ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'Edit Customer' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ë̦¤ÎÔÁ',
+ 'Edit Vendor' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÏÓÔÁÞÁÌØÎÉËÁ',
+ 'Fax' => 'æÁÈ',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'Name missing!' => 'îÅ ×ËÁÚÁÎÅ ¦Í\'Ñ (ÎÁÚ×Á)!',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Orphaned' => '÷¦ÄÏËÒÅÍÌÅÎÉÊ/ïÓÉÒÏÔ¦ÌÉÊ',
+ 'Phone' => 'ôÅÌ.',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'Taxable' => 'ïÐÏÄÁÔËÏ×Õ¤ÔØÓÑ',
+ 'Terms: Net' => 'õÍÏ×É: úÁÐÌÁÔÉÔÉ',
+ 'Transactions exist, cannot delete customer!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ Ë̦¤ÎÔÁ',
+ 'Transactions exist, cannot delete vendor!' => '¶ÓÎÕÀÔØ ÏÐÅÒÁæ§, ÎÅ ÍÏÖÎÁ ×ÉÄÁÌÉÔÉ ÐÏÓÔÁÞÁÌØÎÉËÁ',
+ 'Vendor deleted!' => 'ðÏÓÔÁÞÁÌØÎÉË ×ÉÄÁÌÅÎÉÊ',
+ 'Vendor saved!' => 'ðÏÓÔÁÞÁÌØÎÉËÁ ÚÂÅÒÅÖÅÎÏ',
+ 'Vendors' => 'ðÏÓÔÁÞÁÌØÎÉËÉ',
+ 'days' => 'ÄΦ×',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'îÏ×ÉÊ' => 'add',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'invoice',
+ 'úÁÍÏ×ÌÅÎÎÑ' => 'order',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/gl b/sql-ledger/locale/ua/gl
new file mode 100644
index 000000000..77e0736ac
--- /dev/null
+++ b/sql-ledger/locale/ua/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'ïÐÅÒÁæ§ ÷ÉÔÒÁÔ',
+ 'AR Transaction' => 'ïÐÅÒÁÃ¦Ñ äÏÈÏĦ×',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Add General Ledger Transaction' => 'îÏ×Á ÏÐÅÒÁæÑ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'All' => '÷Ó¦',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Transaction' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÕ ÏÐÅÒÁæÀ?',
+ 'Asset' => 'áËÔÉ×',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Balance' => 'âÁÌÁÎÓ',
+ 'Cannot delete transaction!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÏÒÅ!',
+ 'Cannot have a value in both Debit and Credit!' => 'îÅ ÍÏÖÎÁ ÏÄÎÏÞÁÓÎÏ ÍÁÔÉ ÓÕÍÉ × äÅÂÉÔ¦ ¦ ëÒÅÄÉÔ¦',
+ 'Cannot post a transaction without a value!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÂÅÚ ×ÁÒÔÏÓÔ¦!',
+ 'Cannot post transaction for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÏÐÅÒÁæÀ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÉÔ',
+ 'Debit and credit out of balance!' => 'äÅÂÉÔ ¦ ËÒÅÄÉÔ ÎÅ ÚÂÁÌÁÎÓÏ×ÁΦ!',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'Edit General Ledger Transaction' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ïÐÅÒÁæÀ çÏÌÏ×Îϧ ëÎÉÇÉ',
+ 'Equity' => 'ëÁЦÔÁÌ',
+ 'Expense' => '÷ÉÄÁÔËÉ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'çë ïÐÅÒÁæÑ',
+ 'General Ledger' => 'çÏÌÏ×ÎÁ ëÎÉÇÁ',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Income' => 'ðÒÉÂÕÔÏË',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Liability' => 'ðÁÓÓÉ×',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Purchase Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Reference' => 'úÓÉÌËÁ',
+ 'Reference missing!' => 'îÅ ×ËÁÚÁÎÁ ÚÓÉÌËÁ!',
+ 'Reports' => 'úצÔÉ',
+ 'Sales Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Transaction Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ÏÐÅÒÁæ§',
+ 'Transaction deleted!' => 'ïÐÅÒÁÃ¦Ñ ×ÉÄÁÌÅÎÁ',
+ 'Transaction posted!' => 'ïÐÅÒÁÃ¦Ñ ÚĦÊÓÎÅÎÁ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'Yes' => 'Tak',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'ïÐÅÒÁæ§_÷ÉÔÒÁÔ' => 'ap_transaction',
+ 'ïÐÅÒÁæÑ_äÏÈÏĦ×' => 'ar_transaction',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'çë_ïÐÅÒÁæÑ' => 'gl_transaction',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ '÷ÉÓÔÁ×ÉÔÉ_ÑË_ÎÏ×ÉÊ' => 'post_as_new',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'purchase_invoice',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'sales_invoice',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ic b/sql-ledger/locale/ua/ic
new file mode 100644
index 000000000..9a3256877
--- /dev/null
+++ b/sql-ledger/locale/ua/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'áËÔÉ×ÎÉÊ',
+ 'Add' => 'îÏ×ÉÊ',
+ 'Add Assembly' => 'îÏ×ÉÊ ËÏÍÐÌÅËÔ',
+ 'Add Part' => 'îÏ×ÉÊ ôÏ×ÁÒ',
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Add Service' => 'îÏ×Á ÐÏÓÌÕÇÁ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÉ',
+ 'Assemblies restocked!' => 'ëÏÍÐÌÅËÔÉ ¦Î×ÅÎÔÁÒÉÚÏ×ÁΦ!',
+ 'Assembly Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ËÏÍÐÌÅËÔÕ!',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'BOM' => 'BOM',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'Bought' => 'ëÕÐÌÅÎÏ',
+ 'COGS' => 'COGS',
+ 'Cannot delete item already invoiced!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÔÏ×ÁÒ, ÎÁ ÑËÉÊ ×ÖÅ ×ÉÐÉÓÁÎÁ ÒÁÈÕÎÏË-ÆÁËÔÕÒÁ!',
+ 'Cannot delete item on order!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ Ò¦Þ ¦Ú ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cannot delete item which is part of an assembly!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÔÏ×ÁÒ, ÑËÉÊ ¤ ÞÁÓÔÉÎÏÀ ËÏÍÐÌÅËÔÕ!',
+ 'Cannot delete item!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÃÅÊ ÅÌÅÍÅÎÔ',
+ 'Cannot stock assemblies!' => 'îÅ ÍÏÖÌÉ×Ï ¦Î×ÅÎÔÁÒÉÚÕ×ÁÔÉ ËÏÍÐÌÅËÔÉ!',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'Drawing' => 'íÁÌÀÎÏË',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Edit Assembly' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ËÏÍÐÌÅËÔ',
+ 'Edit Part' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ôÏ×ÁÒ',
+ 'Edit Service' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ÐÏÓÌÕÇÕ',
+ 'Expense' => '÷ÉÄÁÔËÉ',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'Image' => 'úÏÂÒÁÖÅÎÎÑ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Income' => 'ðÒÉÂÕÔÏË',
+ 'Individual Items' => '¶ÎÄÉצÄÕÁÌØÎ¦ þÁÓÔÉÎÉ',
+ 'Inventory' => '¶Î×ÅÎÔÁÒ',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ, ÐÅÒÛ Î¦Ö ÍÏÖÎÁ ÐÏÚÎÁÞÉÔÉ ËÏÍÐÌÅËÔ ÚÁÓÔÁÒ¦ÌÉÍ!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ, ÐÅÒÛ Î¦Ö ÍÏÖÎÁ ÐÏÚÎÁÞÉÔÉ ÃÉÊ ÔÏ×ÁÒ ÚÁÓÔÁÒ¦ÌÉÍ!',
+ 'Inventory quantity must be zero!' => 'ë¦ÌØË¦ÓÔØ × ¦Î×ÅÎÔÁÒ¦ ÐÏ×ÉÎÎÁ ÂÕÔÉ ÎÕÌØ!',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Item deleted!' => 'ò¦Þ ×ÉÄÁÌÅÎÏ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Last Cost' => 'ëÕЦ×ÅÌØÎÁ ã¦ÎÁ',
+ 'Line Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Link Accounts' => 'ðÏ×ÑÚÁÔÉ òÁÈÕÎËÉ',
+ 'List Price' => 'ã¦ÎÁ',
+ 'Make' => '÷ÉÒÏÂÎÉÃÔ×Ï',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Microfiche' => 'í¦ËÒÏÆ¦ÛÁ',
+ 'Model' => 'íÏÄÅÌØ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No.' => 'No.',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'Obsolete' => 'úÁÓÔÁÒ¦ÌÅ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'On Hand' => 'îÁ òÕËÁÈ',
+ 'On Order' => 'îÁ úÁÍÏ×ÌÅÎΦ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Ordered' => 'úÁÍÏ×ÌÅÎÏ',
+ 'Orphaned' => '÷¦ÄÏËÒÅÍÌÅÎÉÊ/ïÓÉÒÏÔ¦ÌÉÊ',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Part Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ ôÏ×ÁÒÕ!',
+ 'Parts' => 'ÔÏ×ÁÒÉ',
+ 'Phone' => 'ôÅÌ.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'ã¦ÎÁ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'ROP' => 'ROP',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Sales' => 'úÂÕÔ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sell Price' => '÷¦ÄÐÕÓËÎÁ ã¦ÎÁ',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Service Number missing!' => 'îÏÍÅÒ ðÏÓÌÕÇÉ ÎÅ ×ËÁÚÁÎÏ',
+ 'Services' => 'ðÏÓÌÕÇÉ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Short' => 'óËÏÒÏÞÅÎÏ',
+ 'Sold' => 'ðÒÏÄÁÎÏ',
+ 'Stock Assembly' => '¶Î×ÅÎÔÁÒ ëÏÍÐÌÅËÔÕ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'To' => 'äÏ',
+ 'Top Level' => '÷ÅÒÈÎ¦Ê ò¦×ÅÎØ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'Unit of measure' => 'ïÄÉÎÉÃÑ ×ÉͦÒÕ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Updated' => 'ðÏÎÏ×ÌÅÎÏ',
+ 'Weight' => '÷ÁÇÁ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'ea' => 'ÛÔ.',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'hr' => 'ÇÏÄ.',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'îÏ×ÉÊ' => 'add',
+ 'îÏ×ÉÊ_ËÏÍÐÌÅËÔ' => 'add_assembly',
+ 'îÏ×ÉÊ_ôÏ×ÁÒ' => 'add_part',
+ 'îÏ×Á_ÐÏÓÌÕÇÁ' => 'add_service',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ_ËÏÍÐÌÅËÔ' => 'edit_assembly',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ_ôÏ×ÁÒ' => 'edit_part',
+ '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ_ÐÏÓÌÕÇÕ' => 'edit_service',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/io b/sql-ledger/locale/ua/io
new file mode 100644
index 000000000..dba856755
--- /dev/null
+++ b/sql-ledger/locale/ua/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No.' => 'No.',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Phone' => 'ôÅÌ.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'ã¦ÎÁ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Subject' => 'ôÅÍÁ',
+ 'To' => 'äÏ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/ir b/sql-ledger/locale/ua/ir
new file mode 100644
index 000000000..8caf3fd03
--- /dev/null
+++ b/sql-ledger/locale/ua/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Add Purchase Invoice' => 'îÏ×ÉÊ ëÕЦ×ÅÌØÎÉÊ òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Invoice Number' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÉÊ ÒÁÈÕÎÏË?',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Cannot post invoice for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ!',
+ 'Cannot post payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Edit Purchase Invoice' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÕЦ×ÅÌØÎÉÊ òÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Exch' => 'ëÕÒÓ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate for payment missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ ÄÌÑ ÐÌÁÔÅÖÕ!',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice deleted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÄÁÌÅÎÉÊ!',
+ 'Invoice posted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÓÔÁ×ÌÅÎÉÊ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No.' => 'No.',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Payment date missing!' => 'îÅ ×ËÁÚÁÎÏ ÄÁÔÕ ðÌÁÔÅÖÕ!',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Phone' => 'ôÅÌ.',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'ã¦ÎÁ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Record in' => '÷ÎÅÓÔÉ ×',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'To' => 'äÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'Vendor missing!' => 'ðÏÓÔÁÞÁÌØÎÉË ÎÅ ¦ÓÎÕ¤',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'Yes' => 'Tak',
+ 'ea' => 'ÛÔ.',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'úÁÍÏ×ÌÅÎÎÑ' => 'order',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ '÷ÉÓÔÁ×ÉÔÉ_ÑË_ÎÏ×ÉÊ' => 'post_as_new',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/is b/sql-ledger/locale/ua/is
new file mode 100644
index 000000000..f62cc69b9
--- /dev/null
+++ b/sql-ledger/locale/ua/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Invoice' => 'îÏ×ÉÊ òÁÈÕÎÏ-ÆÁËÔÕÒÁ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Invoice Number' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÉÊ ÒÁÈÕÎÏË?',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'Cannot delete invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Cannot post invoice for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cannot post invoice!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÒÁÈÕÎÏË-ÆÁËÔÕÒÕ!',
+ 'Cannot post payment for a closed period!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÓÔÁ×ÉÔÉ ÐÌÁÔ¦Ö ÄÌÑ ÚÁËÒÉÔÏÇÏ ÐÅÒ¦ÏÄÕ!',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Credit Limit' => 'ì¦Í¦Ô ËÒÅÄÉÔÕ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Customer missing!' => 'îÅ ×ËÁÚÁÎÉÊ Ë̦¤ÎÔ!',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Date Due' => 'úÁÐÌÁÔÉÔÉ ÄÏ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Edit Sales Invoice' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ òÁÈÕÎÏË-ÆÁËÔÕÒÕ',
+ 'Exch' => 'ëÕÒÓ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate for payment missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ ÄÌÑ ÐÌÁÔÅÖÕ!',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date' => 'äÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number' => 'îÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice deleted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÄÁÌÅÎÉÊ!',
+ 'Invoice posted!' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ ×ÉÓÔÁ×ÌÅÎÉÊ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No.' => 'No.',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Payment date missing!' => 'îÅ ×ËÁÚÁÎÏ ÄÁÔÕ ðÌÁÔÅÖÕ!',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Phone' => 'ôÅÌ.',
+ 'Post' => '÷ÉÓÔÁ×ÉÔÉ',
+ 'Post as new' => '÷ÉÓÔÁ×ÉÔÉ ÑË ÎÏ×ÉÊ',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'ã¦ÎÁ',
+ 'Print' => 'îÁÄÒÕËÕ×ÁÔÉ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Record in' => '÷ÎÅÓÔÉ ×',
+ 'Remaining' => 'úÁÌÉÛÉÌÏÓØ',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Ship via' => 'ðÏÓÌÁÔÉ ÞÅÒÅÚ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'To' => 'äÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'Yes' => 'Tak',
+ 'ea' => 'ÛÔ.',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'åÌ._ÐÏÛÔÁ' => 'e_mail',
+ 'úÁÍÏ×ÌÅÎÎÑ' => 'order',
+ '÷ÉÓÔÁ×ÉÔÉ' => 'post',
+ '÷ÉÓÔÁ×ÉÔÉ_ÑË_ÎÏ×ÉÊ' => 'post_as_new',
+ 'îÁÄÒÕËÕ×ÁÔÉ' => 'print',
+ 'ðÏÓÌÁÔÉ_ÄÏ' => 'ship_to',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/login b/sql-ledger/locale/ua/login
new file mode 100644
index 000000000..4810b07c1
--- /dev/null
+++ b/sql-ledger/locale/ua/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'ðÒÏ ÐÒÏÇÒÁÍÕ',
+ 'Database Host' => 'íÁÛÉÎÁ âÁÚÉ äÁÎÉÈ',
+ 'Dataset' => 'âÁÚÁ äÁÎÉÈ',
+ 'Incorrect Dataset version!' => 'îÅצÒÎÁ ×ÅÒÓ¦Ñ âÁÚÉ äÁÎÉÈ!',
+ 'Incorrect Password!' => 'îÅצÒÎÉÊ ðÁÒÏÌØ!',
+ 'Licensed to' => 'ì¦ÃÅÎÚ¦¤À ×ÏÌÏĦ¤:',
+ 'Login' => 'ðÏÞÁÔÏË óÅÁÎÓÕ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'Password' => 'ðÁÒÏÌØ',
+ 'User' => 'ëÏÒÉÓÔÕ×ÁÞ',
+ 'Version' => '÷ÅÒÓ¦Ñ',
+ 'You are logged out!' => '÷ÁÛ ÓÅÁÎÓ ÚÁ˦ÎÞÉ×ÓÑ!',
+ 'You did not enter a name!' => 'îÅ ××ÅÄÅÎÏ ¦Í\'Ñ/ÎÁÚ×Õ',
+ 'is not a member!' => 'ÎÅ ¤ ÞÌÅÎÏÍ!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'ðÏÞÁÔÏË_óÅÁÎÓÕ' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/menu b/sql-ledger/locale/ua/menu
new file mode 100644
index 000000000..0417db043
--- /dev/null
+++ b/sql-ledger/locale/ua/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => '÷ÉÔÒÁÔÉ',
+ 'AP Aging' => 'AP Aging (×ÉÔÒÁÔÉ)',
+ 'AR' => 'äÏÈÏÄÉ',
+ 'AR Aging' => 'AR Aging (ÄÏÈÏÄÉ)',
+ 'Accounting Menu' => 'íÅÎÀ ïÂ̦ËÕ',
+ 'Add Account' => 'îÏ×ÉÊ ÒÁÈÕÎÏË',
+ 'Add Assembly' => 'îÏ×ÉÊ ËÏÍÐÌÅËÔ',
+ 'Add Customer' => 'îÏ×ÉÊ Ë̦¤ÎÔ',
+ 'Add GIFI' => 'îÏ×ÉÊ GIFI',
+ 'Add Part' => 'îÏ×ÉÊ ôÏ×ÁÒ',
+ 'Add Project' => 'îÏ×ÉÊ ðÒÏÅËÔ',
+ 'Add Service' => 'îÏ×Á ÐÏÓÌÕÇÁ',
+ 'Add Transaction' => 'îÏ×Á ÏÐÅÒÁæÑ',
+ 'Add Vendor' => 'îÏ×ÉÊ ÐÏÓÔÁÞÁÌØÎÉË',
+ 'Assemblies' => 'ëÏÍÐÌÅËÔÉ',
+ 'Audit Control' => 'ëÏÎÔÒÏÌØ',
+ 'Backup' => 'òÅÚÅÒ×ÎÁ ËÏЦÑ',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Cash' => 'çÏÔ¦×ËÁ',
+ 'Chart of Accounts' => 'ðÌÁÎ òÁÈÕÎ˦×',
+ 'Check' => 'þÅË',
+ 'Customers' => 'ë̦¤ÎÔÉ',
+ 'General Ledger' => 'çÏÌÏ×ÎÁ ëÎÉÇÁ',
+ 'Goods & Services' => 'ôÏ×ÁÒÉ ¦ ðÏÓÌÕÇÉ',
+ 'HTML Templates' => 'HTML ûÁÂÌÏÎÉ ',
+ 'Income Statement' => 'ú×¦Ô ÐÒÏ ÄÏÈÏÄÉ ¦ ×ÉÄÁÔËÉ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'LaTeX Templates' => 'LaTeX ûÁÂÌÏÎÉ',
+ 'List Accounts' => 'óÐÉÓÏË òÁÈÕÎ˦×',
+ 'List GIFI' => 'óÐÉÓÏË GIFI',
+ 'Logout' => 'ë¦ÎÅÃØ óÅÁÎÓÕ',
+ 'Order Entry' => '÷ÉÓÔÁ×ÌÅÎÎÑ úÁÍÏ×ÌÅÎÎÑ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Parts' => 'ÔÏ×ÁÒÉ',
+ 'Payment' => 'ðÌÁÔ¦Ö',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Preferences' => 'îÁÓÔÒÏÊËÉ',
+ 'Projects' => 'ðÒÏÅËÔÉ',
+ 'Purchase Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Purchase Orders' => 'ëÕЦ×ÅÌØÎ¦ úÁÍÏ×ÌÅÎÎÑ',
+ 'Receipt' => 'ë×ÉÔÁÎæÑ',
+ 'Receipts' => 'ë×ÉÔÁÎæ§',
+ 'Reconciliation' => 'õÚÇÏÄÖÅÎÎÑ',
+ 'Reports' => 'úצÔÉ',
+ 'Sales Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Sales Orders' => 'îÁËÌÁÄΦ ðÒÏÄÁÖÕ',
+ 'Save to File' => 'úÂÅÒÅÇÔÉ Õ æÁÊ̦',
+ 'Send by E-Mail' => '÷ÉÓÌÁÔÉ ÐÏ ÅÌ. ÐÏÛÔ¦',
+ 'Services' => 'ðÏÓÌÕÇÉ',
+ 'Statement' => 'úצÔ',
+ 'Stock Assembly' => '¶Î×ÅÎÔÁÒ ëÏÍÐÌÅËÔÕ',
+ 'Stylesheet' => 'ïÆÏÒÍÌÅÎÎÎÑ',
+ 'System' => 'óÉÓÔÅÍÁ',
+ 'Tax collected' => 'ú¦ÂÒÁÎÏ ÐÏÄÁÔË¦× ',
+ 'Tax paid' => 'ðÏÄÁÔÏË ÚÁÐÌÁÞÅÎÏ',
+ 'Transactions' => 'ïÐÅÒÁæ§',
+ 'Trial Balance' => 'ðÒÏÂÎÉÊ âÁÌÁÎÓ',
+ 'Vendors' => 'ðÏÓÔÁÞÁÌØÎÉËÉ',
+ 'Version' => '÷ÅÒÓ¦Ñ',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/oe b/sql-ledger/locale/ua/oe
new file mode 100644
index 000000000..16c97078e
--- /dev/null
+++ b/sql-ledger/locale/ua/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÉÊ',
+ 'Add Purchase Invoice' => 'îÏ×ÉÊ ëÕЦ×ÅÌØÎÉÊ òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Add Purchase Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ËÕЦ×ÌÀ',
+ 'Add Sales Invoice' => 'îÏ×ÉÊ òÁÈÕÎÏ-ÆÁËÔÕÒÁ',
+ 'Add Sales Order' => 'îÏ×Å ÚÁÍÏ×ÌÅÎÎÑ ÎÁ ÐÒÏÄÁÖ',
+ 'Address' => 'áÄÒÅÓÁ',
+ 'Amount' => 'óÕÍÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Are you sure you want to delete Order Number' => '÷É ÐÅ×Φ, ÝÏ ÈÏÞÅÔÅ ×ÉÄÁÌÉÔÉ ÄÁÎÅ ÚÁÍÏ×ÌÅÎÎÑ?',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Bin' => 'Bin',
+ 'C' => 'ó',
+ 'Cannot delete order!' => 'îÅ ÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cannot save order!' => 'îÅ ÍÏÖÌÉ×Ï ÚÂÅÒÅÇÔÉ ÚÁÍÏ×ÌÅÎÎÑ!',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Closed' => 'úÁËÒÉÔÏ',
+ 'Confirm!' => 'ð¦ÄÔ×ÅÒÄ¦ÔØ!',
+ 'Contact' => 'ëÏÎÔÁËÔÎÁ ÏÓÏÂÁ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Credit Limit' => 'ì¦Í¦Ô ËÒÅÄÉÔÕ',
+ 'Curr' => '÷ÁÌÀÔÁ',
+ 'Currency' => '÷ÁÌÀÔÁ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Customer missing!' => 'îÅ ×ËÁÚÁÎÉÊ Ë̦¤ÎÔ!',
+ 'Customer not on file!' => 'ë̦¤ÎÔÁ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Date' => 'äÁÔÁ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Delivery Date' => 'äÁÔÁ ÄÏÓÔÁ×ËÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail address missing!' => 'îÅ ×ËÁÚÁÎÁ ÁÄÒÅÓÁ ÅÌ. ÐÏÛÔÉ!',
+ 'Edit Purchase Order' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Edit Sales Order' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ îÁËÌÁÄÎÕ ðÒÏÄÁÖÕ',
+ 'Exchangerate' => 'ëÕÒÓ ×ÁÌÀÔÉ',
+ 'Exchangerate missing!' => 'îÅ ×ËÁÚÁÎÉÊ ËÕÒÓ ×ÁÌÀÔÉ!',
+ 'Extended' => 'ðÒÏÄÏ×ÖÅÎÏ',
+ 'Fax' => 'æÁÈ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Invoice Date missing!' => 'îÅ ×ËÁÚÁÎÁ ÄÁÔÁ ×ÉÓÔÁ×ÌÅÎÎÑ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Invoice Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÒÁÈÕÎËÁ-ÆÁËÔÕÒÉ!',
+ 'Item not on file!' => 'òÅÞ¦ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'Name' => '¶Í\'Ñ / îÁÚ×Á',
+ 'No.' => 'No.',
+ 'Notes' => 'ðÒÉͦÔËÉ',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Number missing in Row' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ Õ ÒÑÄËÕ',
+ 'O' => 'ï',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'Open' => '÷¦ÄËÒÉÔÏ',
+ 'Order' => 'úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date' => 'äÁÔÁ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ úÁÍÏ×ÌÅÎÎÑ!',
+ 'Order Number' => 'îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order Number missing!' => 'îÅ ×ËÁÚÁÎÏ îÏÍÅÒ úÁÍÏ×ÌÅÎÎÑ',
+ 'Order deleted!' => 'úÁÍÏ×ÌÅÎÎÑ ×ÉÄÁÌÅÎÏ!',
+ 'Order saved!' => 'úÁÍÏ×ÌÅÎÎÑ ÚÂÅÒÅÖÅÎÏ!',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Packing List' => 'ðÁËÕ×ÁÌØÎÉÊ óÐÉÓÏË',
+ 'Packing List Date missing!' => 'îÅ ×ËÁÚÁÎÁ äÁÔÁ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Packing List Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ îÏÍÅÒ ðÁËÕ×ÁÌØÎÏÇÏ óÐÉÓÏËÕ',
+ 'Part' => 'ôÏ×ÁÒ',
+ 'Phone' => 'ôÅÌ.',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'ã¦ÎÁ',
+ 'Print' => 'îÁÄÒÕËÕ×ÁÔÉ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project not on file!' => 'ðÒÏÅËÔÕ ÎÅÍÁ × ÓÐÉÓËÕ!',
+ 'Purchase Order' => 'ëÕЦ×ÅÌØÎÅ úÁÍÏ×ÌÅÎÎÑ',
+ 'Purchase Orders' => 'ëÕЦ×ÅÌØÎ¦ úÁÍÏ×ÌÅÎÎÑ',
+ 'Qty' => 'ë¦ÌØË¦ÓÔØ',
+ 'Recd' => 'ïÔÒÉÍÁÎÏ',
+ 'Remaining' => 'úÁÌÉÛÉÌÏÓØ',
+ 'Required by' => 'ôÅÒͦΠÄÏÓÔÁ×ËÉ',
+ 'Sales Order' => 'îÁËÌÁÄÎÁ ðÒÏÄÁÖÕ ',
+ 'Sales Orders' => 'îÁËÌÁÄΦ ðÒÏÄÁÖÕ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+ 'Save as new' => 'úÂÅÒÅÇÔÉ ÑË ÎÏ×Å',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select from one of the items below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÕ ¦Ú ÎÁÓÔÕÐÎÉÈ ÒÅÞÅÊ',
+ 'Select from one of the names below' => '÷ÉÂÅÒ¦ÔØ ÏÄÎÅ ¦Ú ÎÁÓÔÕÐÎÉÈ ¦ÍÅÎ/ÎÁÚ×',
+ 'Select from one of the projects below' => '÷ÉÂÅÒ¦ÔØ ÏÄÉÎ ¦Ú ÎÁÓÔÕÐÎÉÈ ÐÒÏÅËÔ¦×',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Service' => 'ðÏÓÌÕÇÁ',
+ 'Ship' => 'ðÏÓÌÁÔÉ',
+ 'Ship to' => 'ðÏÓÌÁÔÉ ÄÏ',
+ 'Ship via' => 'ðÏÓÌÁÔÉ ÞÅÒÅÚ',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax Included' => 'ðÏÄÁÔÏË ×ËÌÀÞÅÎÏ',
+ 'Terms: Net' => 'õÍÏ×É: úÁÐÌÁÔÉÔÉ',
+ 'To' => 'äÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Unit' => 'ïÄÉÎÉÃÑ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'Vendor missing!' => 'ðÏÓÔÁÞÁÌØÎÉË ÎÅ ¦ÓÎÕ¤',
+ 'Vendor not on file!' => 'ðÏÔÁÞÁÌØÎÉËÁ ÎÅÍÁ Õ ÓÐÉÓËÕ ',
+ 'What type of item is this?' => 'ñËÉÊ ÃÅ ×ÉÄ/ÔÉÐ ÔÏ×ÁÒÕ',
+ 'Yes' => 'Tak',
+ 'days' => 'ÄΦ×',
+ 'ea' => 'ÛÔ.',
+ 'emailed to' => 'ÐÏÓÌÁÎÏ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'sent to printer' => 'ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'îÏ×ÉÊ' => 'add',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'åÌ._ÐÏÛÔÁ' => 'e_mail',
+ 'òÁÈÕÎÏË_ÆÁËÔÕÒÁ' => 'invoice',
+ 'îÁÄÒÕËÕ×ÁÔÉ' => 'print',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+ 'úÂÅÒÅÇÔÉ_ÑË_ÎÏ×Å' => 'save_as_new',
+ 'ðÏÓÌÁÔÉ_ÄÏ' => 'ship_to',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+ 'tak' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/pe b/sql-ledger/locale/ua/pe
new file mode 100644
index 000000000..3f4e95983
--- /dev/null
+++ b/sql-ledger/locale/ua/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'îÏ×ÉÊ',
+ 'Add Project' => 'îÏ×ÉÊ ðÒÏÅËÔ',
+ 'All' => '÷Ó¦',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Delete' => '÷ÉÄÁÌÉÔÉ',
+ 'Description' => 'ïÐÉÓ',
+ 'Edit Project' => '÷¦ÄÒÅÄÁÇÕ×ÁÔÉ ðÒÏÅËÔ',
+ 'Number' => 'îÏÍÅÒ',
+ 'Orphaned' => '÷¦ÄÏËÒÅÍÌÅÎÉÊ/ïÓÉÒÏÔ¦ÌÉÊ',
+ 'Project' => 'ðÒÏÅËÔ',
+ 'Project Number missing!' => 'îÅ ×ËÁÚÁÎÉÊ ÎÏÍÅÒ ÐÒÏÅËÔÕ!',
+ 'Project deleted!' => 'ðÒÏÅËÔ ×ÉÄÁÌÅÎÏ!',
+ 'Project saved!' => 'ðÒÏÅËÔ ÚÂÅÒÅÖÅÎÏ!',
+ 'Projects' => 'ðÒÏÅËÔÉ',
+ 'Save' => 'úÂÅÒÅÇÔÉ',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'îÏ×ÉÊ' => 'add',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ '÷ÉÄÁÌÉÔÉ' => 'delete',
+ 'úÂÅÒÅÇÔÉ' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/rc b/sql-ledger/locale/ua/rc
new file mode 100644
index 000000000..0a91d0059
--- /dev/null
+++ b/sql-ledger/locale/ua/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Balance' => 'âÁÌÁÎÓ',
+ 'Cleared Balance' => 'ë¦ÎÃÅ×Å óÁÌØÄÏ',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Date' => 'äÁÔÁ',
+ 'Deposit' => 'äÅÐÏÚÉÔ/÷ËÌÁÄ',
+ 'Description' => 'ïÐÉÓ',
+ 'Difference' => 'ò¦ÚÎÉÃÑ',
+ 'Done' => 'úÒÏÂÌÅÎÏ',
+ 'Exchangerate Difference' => 'ò¦ÚÎÉÃÑ ëÕÒÓÕ ×ÁÌÀÔÉ',
+ 'From' => '÷¦Ä / Ú',
+ 'Out of balance!' => 'îÅ ÚÂÁÌÁÎÓÏ×ÁÎÏ!',
+ 'Payment' => 'ðÌÁÔ¦Ö',
+ 'Reconciliation' => 'õÚÇÏÄÖÅÎÎÑ',
+ 'Select all' => '÷ÉÂÒÁÔÉ ×ÓÅ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Statement Balance' => 'âÁÌÁÎÓÏ×ÉÊ úצÔ',
+ 'Update' => 'ðÏÎÏ×ÉÔÉ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ 'úÒÏÂÌÅÎÏ' => 'done',
+ '÷ÉÂÒÁÔÉ_×ÓÅ' => 'select_all',
+ 'ðÏÎÏ×ÉÔÉ' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ua/rp b/sql-ledger/locale/ua/rp
new file mode 100644
index 000000000..0553ba67e
--- /dev/null
+++ b/sql-ledger/locale/ua/rp
@@ -0,0 +1,120 @@
+$self{texts} = {
+ 'AP Aging' => 'AP Aging (×ÉÔÒÁÔÉ)',
+ 'AR Aging' => 'AR Aging (ÄÏÈÏÄÉ)',
+ 'Account' => 'òÁÈÕÎÏË',
+ 'Accounts' => 'òÁÈÕÎËÉ',
+ 'Amount' => 'óÕÍÁ',
+ 'Apr' => 'ËצÔÎÑ',
+ 'April' => 'ëצÔÅÎØ',
+ 'Attachment' => 'äÏÄÁÔÏË',
+ 'Aug' => 'ÓÅÒÐÎÑ',
+ 'August' => 'óÅÒÐÅÎØ',
+ 'Balance' => 'âÁÌÁÎÓ',
+ 'Balance Sheet' => 'âÁÌÁÎÓ',
+ 'Bcc' => 'ðÒÉ×ÁÔÎÁ ËÏÐ¦Ñ ÄÏ',
+ 'Cash based' => 'çÏÔ¦×ËÏ×ÉÊ',
+ 'Cc' => 'ëÏÐ¦Ñ ÄÏ',
+ 'Compare to' => 'ðÏÒ¦×ÎÑÔÉ Ú',
+ 'Continue' => 'ðÒÏÄÏ×ÖÉÔÉ',
+ 'Copies' => 'ëÏЦÊ',
+ 'Credit' => 'ëÒÅÄÉÔ',
+ 'Current' => 'ðÏÔÏÞÎÉÊ',
+ 'Customer' => 'ë̦¤ÎÔ',
+ 'Date' => 'äÁÔÁ',
+ 'Debit' => 'äÅÂÉÔ',
+ 'Dec' => 'ÇÒÕÄÎÑ',
+ 'December' => 'çÒÕÄÅÎØ',
+ 'Decimalplaces' => 'äÅÓÑÔÉÞΦ ͦÓÃÑ',
+ 'Department' => 'Department',
+ 'Description' => 'ïÐÉÓ',
+ 'Due' => 'äÏ',
+ 'E-mail' => 'åÌ. ÐÏÛÔÁ',
+ 'E-mail Statement to' => 'ðÏÓÌÁÔÉ ÐÏ ÅÌ. ÐÏÛÔ¦ ÄÏ',
+ 'Feb' => 'ÌÀÔÏÇÏ',
+ 'February' => 'ìÀÔÉÊ',
+ 'From' => '÷¦Ä / Ú',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'òÏÚĦÌ',
+ 'ID' => '¶ÄÅÎÔÉÆ¦ËÁæÊÎÉÊ ÎÏÍÅÒ',
+ 'In-line' => '÷ËÌÀÞÅÎÏ (In-line)',
+ 'Include in Report' => 'äÏÄÁÔÉ ÄÏ úצÔÕ',
+ 'Income Statement' => 'ú×¦Ô ÐÒÏ ÄÏÈÏÄÉ ¦ ×ÉÄÁÔËÉ',
+ 'Invoice' => 'òÁÈÕÎÏË-ÆÁËÔÕÒÁ',
+ 'Jan' => 'Ó¦ÞÎÑ',
+ 'January' => 'Ó¦ÞÅÎØ',
+ 'Jul' => 'ÌÉÐÎÑ',
+ 'July' => 'ìÉÐÅÎØ',
+ 'Jun' => 'ÞÅÒ×ÎÑ',
+ 'June' => 'þÅÒ×ÅÎØ',
+ 'Mar' => 'ÂÅÒÅÚÎÑ',
+ 'March' => 'âÅÒÅÚÅÎØ',
+ 'May' => 'ÔÒÁ×ÎÑ',
+ 'May ' => 'ôÒÁ×ÅÎØ',
+ 'Message' => 'ðÏצÄÏÍÌÅÎÎÑ',
+ 'N/A' => 'îÅ óÔÏÓÕ¤ÔØÓÑ',
+ 'Nothing selected!' => 'î¦ÞÏÇÏ ÎÅ ×ÉÂÒÁÎÏ!',
+ 'Nov' => 'ÌÉÓÔÏÐÁÄÁ',
+ 'November' => 'ìÉÓÔÏÐÁÄ',
+ 'Oct' => 'ÖÏ×ÔÎÑ',
+ 'October' => 'öÏ×ÔÅÎØ',
+ 'PDF' => 'PDF ÆÏÒÍÁÔ',
+ 'Payments' => 'ðÌÁÔÅÖ¦',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'îÁÄÒÕËÕ×ÁÔÉ',
+ 'Printer' => 'ðÒÉÎÔÅÒ',
+ 'Project Number' => 'Project Number',
+ 'Receipts' => 'ë×ÉÔÁÎæ§',
+ 'Report for' => 'ú×¦Ô ÄÌÑ',
+ 'Retained Earnings' => 'ðÒÉÂÕÔÏË (ÎÅÒÏÚÐÏĦÌÅÎÉÊ)',
+ 'Screen' => 'åËÒÁÎ',
+ 'Select all' => '÷ÉÂÒÁÔÉ ×ÓÅ',
+ 'Select postscript or PDF!' => '÷ÉÂÅÒ¦ÔØ postscript ÁÂÏ PDF ÆÏÒÍÁÔ!',
+ 'Sep' => '×ÅÒÅÓÎÑ',
+ 'September' => '÷ÅÒÅÓÅÎØ',
+ 'Source' => 'äÖÅÒÅÌÏ',
+ 'Standard' => 'óÔÁÎÄÁÒÔΦ',
+ 'Statement' => 'úצÔ',
+ 'Statement sent to' => 'ú×¦Ô ÐÏÓÌÁÎÏ ÄÏ',
+ 'Statements sent to printer!' => 'ú×¦Ô ÐÏÓÌÁÎÏ ÄÏ ÐÒÉÎÔÅÒÁ!',
+ 'Subject' => 'ôÅÍÁ',
+ 'Subtotal' => 'ð¦ÄÓÕÍÏË ÐÏ ÒÏÚĦÌÕ',
+ 'Tax' => 'ðÏÄÁÔÏË',
+ 'Tax collected' => 'ú¦ÂÒÁÎÏ ÐÏÄÁÔË¦× ',
+ 'Tax paid' => 'ðÏÄÁÔÏË ÚÁÐÌÁÞÅÎÏ',
+ 'Total' => 'úÁÇÁÌØÎÁ óÕÍÁ',
+ 'Trial Balance' => 'ðÒÏÂÎÉÊ âÁÌÁÎÓ',
+ 'Vendor' => 'ðÏÓÔÁÞÁÌØÎÉË',
+ 'as at' => 'ÑË ×',
+ 'collected on sales' => 'Ú¦ÂÒÁÎÏ ÐÒÉ ÐÒÏÄÁÖÕ',
+ 'for Period' => 'ÚÁ ðÅÒ¦ÏÄ',
+ 'paid on purchases' => 'ÚÁÐÌÁÞÅÎÏ ÎÁ ÐÏËÕÐËÉ',
+ 'to' => 'ÄÏ',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_accounts' => 'list_accounts',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'ðÒÏÄÏ×ÖÉÔÉ' => 'continue',
+ 'åÌ._ÐÏÛÔÁ' => 'e_mail',
+ 'îÁÄÒÕËÕ×ÁÔÉ' => 'print',
+ '÷ÉÂÒÁÔÉ_×ÓÅ' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/COPYING b/sql-ledger/locale/ve/COPYING
new file mode 100644
index 000000000..11c55f3c4
--- /dev/null
+++ b/sql-ledger/locale/ve/COPYING
@@ -0,0 +1,23 @@
+######################################################################
+# SQL-Ledger, Accounting Software
+# Copyright (c) 2001
+#
+# Spanish Texts (Venezuela):
+#
+# Author: John Stoddart <jstypo@imagencolor.com.ve>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#######################################################################
+
diff --git a/sql-ledger/locale/ve/LANGUAGE b/sql-ledger/locale/ve/LANGUAGE
new file mode 100644
index 000000000..182ea8401
--- /dev/null
+++ b/sql-ledger/locale/ve/LANGUAGE
@@ -0,0 +1 @@
+Venezuelan Spanish
diff --git a/sql-ledger/locale/ve/admin b/sql-ledger/locale/ve/admin
new file mode 100644
index 000000000..19be1bf8a
--- /dev/null
+++ b/sql-ledger/locale/ve/admin
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'Access Control' => 'Control de Acceso',
+ 'Accounting' => 'Contabilidad',
+ 'Add User' => 'Agregar Usuario',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrador',
+ 'All Datasets up to date!' => 'Bases de datos actualizadas!',
+ 'Change Admin Password' => 'Cambiar contraseña del Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Conjunto de Caracteres',
+ 'Click on login name to edit!' => 'Haga click sobre el login para editar',
+ 'Company' => 'Compañía',
+ 'Connect to' => 'Conectar a',
+ 'Continue' => 'Continuar',
+ 'Create Chart of Accounts' => 'Crear Plan de Cuentas',
+ 'Create Dataset' => 'Crear base de datos',
+ 'DBI not installed!' => 'DBI no ha sido instalado!',
+ 'Database' => 'Base de Datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => 'Manejador no seleccionado!',
+ 'Database User missing!' => 'Falta usuario de base de datos!',
+ 'Dataset' => 'Base de datos',
+ 'Dataset missing!' => 'Falta base de datos!',
+ 'Dataset updated!' => 'Base de datos actualizada!',
+ 'Date Format' => 'Formato Fecha',
+ 'Delete' => 'Borrar',
+ 'Delete Dataset' => 'Borrar base de datos',
+ 'Directory' => 'Directorio',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => 'Límite menu dropdown',
+ 'E-mail' => 'E-mail',
+ 'Edit User' => 'Editar Usuario',
+ 'Existing Datasets' => 'Bases de datos existentes',
+ 'Fax' => 'Fax',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Falta nombre del Host!',
+ 'Incorrect Password!' => 'Contraseña equivocada',
+ 'Language' => 'Idioma',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje en blanco los campos Host y Puerto si no requiere una conección remota',
+ 'Login' => 'Login',
+ 'Multibyte Encoding' => 'Codificación conjunto de caracteres',
+ 'Name' => 'Nombre',
+ 'New Templates' => 'Plantillas Nuevas',
+ 'No Database Drivers available!' => 'No hay manejadores para base de datos!',
+ 'No Dataset selected!' => 'Base de datos no seleccionada!',
+ 'Nothing to delete!' => 'Nada para borrar!',
+ 'Number Format' => 'Formato Numérico',
+ 'Oracle Database Administration' => 'Administración bases de datos Oracle',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => 'Contraseña cambiada!',
+ 'Pg Database Administration' => 'Administración bases de datos Pg',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Número de Puerto',
+ 'Port missing!' => 'Falta número de puerto',
+ 'Printer' => 'Impresora',
+ 'Save' => 'Guardar',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione base de datos a borrar y pulse "Continue"',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship via' => 'Envía vía',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Hoja de Estilo',
+ 'Templates' => 'Plantillas',
+ 'The following Datasets are not in use and can be deleted' => 'Las siguientes bases de datos no están en uso y pueden ser borradas',
+ 'The following Datasets need to be updated' => 'Las siguientes bases de datos requieren actualización',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Chequeo preliminar. En esta etapa no se creará ni se borrará nada!',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el login y guárdelo de nuevo. Un nuevo usuario con las mismas variables se creará bajo el nuevo login.',
+ 'Update Dataset' => 'Actualizar base de datos',
+ 'Use Templates' => 'Use Plantilla',
+ 'User' => 'Usuario',
+ 'User deleted!' => 'Usuario borrado!',
+ 'User saved!' => 'Usuario guardado!',
+ 'Version' => 'Versión',
+ 'You must enter a host and port for local and remote connections!' => 'Debe ingresar un host y un puerto para conecciones locales y remotas!',
+ 'does not exist' => 'no existe',
+ 'is already a member!' => 'ya es miembro!',
+ 'localhost' => 'localhost',
+ 'locked!' => 'locked!',
+ 'successfully created!' => 'creado!',
+ 'successfully deleted!' => 'borrado!',
+ 'website' => 'en internet',
+};
+
+$self{subs} = {
+ 'add_user' => 'add_user',
+ 'adminlogin' => 'adminlogin',
+ 'change_admin_password' => 'change_admin_password',
+ 'change_password' => 'change_password',
+ 'check_password' => 'check_password',
+ 'continue' => 'continue',
+ 'create_dataset' => 'create_dataset',
+ 'dbcreate' => 'dbcreate',
+ 'dbdelete' => 'dbdelete',
+ 'dbdriver_defaults' => 'dbdriver_defaults',
+ 'dbselect_source' => 'dbselect_source',
+ 'dbupdate' => 'dbupdate',
+ 'delete' => 'delete',
+ 'delete_dataset' => 'delete_dataset',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'get_value' => 'get_value',
+ 'list_users' => 'list_users',
+ 'login' => 'login',
+ 'login_name' => 'login_name',
+ 'oracle_database_administration' => 'oracle_database_administration',
+ 'pg_database_administration' => 'pg_database_administration',
+ 'save' => 'save',
+ 'update_dataset' => 'update_dataset',
+ 'agregar_usuario' => 'add_user',
+ 'cambiar_contraseña_del_administrador' => 'change_admin_password',
+ 'cambiar_contraseña' => 'change_password',
+ 'continuar' => 'continue',
+ 'crear_base_de_datos' => 'create_dataset',
+ 'borrar' => 'delete',
+ 'borrar_base_de_datos' => 'delete_dataset',
+ 'login' => 'login',
+ 'administración_bases_de_datos_oracle' => 'oracle_database_administration',
+ 'administración_bases_de_datos_pg' => 'pg_database_administration',
+ 'guardar' => 'save',
+ 'actualizar_base_de_datos' => 'update_dataset',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/all b/sql-ledger/locale/ve/all
new file mode 100644
index 000000000..b422b8ca0
--- /dev/null
+++ b/sql-ledger/locale/ve/all
@@ -0,0 +1,491 @@
+# These are all the texts to build the translations files.
+# The file has the form of 'english text' => 'foreign text',
+# you can add the translation in this file or in the 'missing' file
+# run locales.pl from this directory to rebuild the translation files
+
+$self{texts} = {
+ 'AP' => 'CXP',
+ 'AP Aging' => 'Vencimientos',
+ 'AP Transaction' => 'Cuenta por Pagar',
+ 'AP Transactions' => 'Cuentas por Pagar',
+ 'AR' => 'CXC',
+ 'AR Aging' => 'Vencimientos',
+ 'AR Transaction' => 'Cuenta por Cobrar',
+ 'AR Transactions' => 'Cuentas por Cobrar',
+ 'About' => 'Acerca de',
+ 'Access Control' => 'Control de Acceso',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'Falta Número de Cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'Falta Tipo de Cuenta!',
+ 'Account deleted!' => 'Cuenta borrada!',
+ 'Account saved!' => 'Cuenta guardada!',
+ 'Accounting' => 'Contabilidad',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Accounts' => 'Cuentas',
+ 'Active' => 'Activa',
+ 'Add' => 'Agregar',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Accounts Payables Transaction' => 'Agregar Cuenta por Pagar',
+ 'Add Accounts Receivables Transaction' => 'Agregar Cuenta por Cobrar',
+ 'Add Assembly' => 'Agregar Conjunto',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Add General Ledger Transaction' => 'Agregar Transacción al Mayor General',
+ 'Add Part' => 'Agregar Item',
+ 'Add Project' => 'Agregar Proyecto',
+ 'Add Purchase Invoice' => 'Agregar Factura de Compra',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Agregar Factura de Venta',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transacción',
+ 'Add User' => 'Agregar Usuario',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Address' => 'Dirección',
+ 'Administration' => 'Administración',
+ 'Administrator' => 'Administrador',
+ 'All' => 'Todos',
+ 'All Datasets up to date!' => 'Bases de datos actualizadas!',
+ 'Amount' => 'Monto',
+ 'Amount Due' => 'Monto Vencido',
+ 'Amount does not equal applied!' => 'Monto no es igual!',
+ 'Amount missing!' => 'Falta monto!',
+ 'Applied' => 'Aplicado',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Seguro que desea borrar Factura?',
+ 'Are you sure you want to delete Order Number' => '¿Seguro que desea borrar Orden de Compra/Pedido?',
+ 'Are you sure you want to delete Transaction' => '¿Seguro que desea borrar Transacción?',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => 'Conjuntos re-inventariados',
+ 'Assembly Number missing!' => 'Falta Número Conjunto!',
+ 'Asset' => 'Activo',
+ 'Attachment' => 'Anexo',
+ 'Audit Control' => 'Control de Auditoría',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'BOM' => 'Lista de Materiales',
+ 'Backup' => 'Respaldos',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Balance' => 'Balance',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'Books are open' => 'Libros aperturados',
+ 'Bought' => 'Comprado',
+ 'Business Number' => 'RIF/NIT/CI',
+ 'C' => 'C',
+ 'COGS' => 'Costo Perpetuo',
+ 'Cannot delete account!' => 'No puede borrar cuenta!',
+ 'Cannot delete customer!' => 'No puede borrar cliente!',
+ 'Cannot delete default account!' => 'No puede borrar cuenta "default"!',
+ 'Cannot delete invoice!' => 'No puede borraar factura!',
+ 'Cannot delete item already invoiced!' => 'No puede borrar ítem facturado!',
+ 'Cannot delete item on order!' => 'No puede borrar ítem pedido!',
+ 'Cannot delete item which is part of an assembly!' => 'No puede borrar ítem parte de conjunto!',
+ 'Cannot delete item!' => 'No puede borrar ítem!',
+ 'Cannot delete order!' => 'No puede borrar pedido!',
+ 'Cannot delete transaction!' => 'No puede borrar transacción!',
+ 'Cannot delete vendor!' => 'No puede borrar proveedor!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede haber Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => 'No puede registrar transacción sin monto!',
+ 'Cannot post invoice for a closed period!' => 'No puede registrar factura para ejercicio cerrado!',
+ 'Cannot post invoice!' => 'No puede registrar factura!',
+ 'Cannot post payment for a closed period!' => 'No puede registrar pago para ejercicio cerrado',
+ 'Cannot post payment!' => 'No puede registrar pago!',
+ 'Cannot post transaction for a closed period!' => 'No puede registrar transacción para ejercicio cerrado!',
+ 'Cannot post transaction!' => 'No puede registrar transacción!',
+ 'Cannot process payment for a closed period!' => 'No puede procesar pago para ejercicio cerrado!',
+ 'Cannot save account!' => 'No puede guardar cuenta!',
+ 'Cannot save order!' => 'No puede guardar órden!',
+ 'Cannot save preferences!' => 'No puede guardar preferencias!',
+ 'Cannot stock assemblies!' => 'No puede inventariar conjuntos!',
+ 'Cash' => 'Caja',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Change Admin Password' => 'Cambiar contraseña del Administrador',
+ 'Change Password' => 'Cambiar Contraseña',
+ 'Character Set' => 'Conjunto de Caracteres',
+ 'Chart of Accounts' => 'Plan de Cuentas',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impreso!',
+ 'Check printing failed!' => 'No se pudo imprimir cheque!',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Click on login name to edit!' => 'Haga click sobre el login para editar',
+ 'Close Books up to' => 'Cerrar ejercicio hasta',
+ 'Closed' => 'Cerrado',
+ 'Company' => 'Compañía',
+ 'Compare to' => 'Comparar a',
+ 'Confirm!' => 'Confirmar!',
+ 'Connect to' => 'Conectar a',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Copy to COA' => 'Copiar a Plan de Cuentas',
+ 'Create Chart of Accounts' => 'Crear Plan de Cuentas',
+ 'Create Dataset' => 'Crear base de datos',
+ 'Credit' => 'Crédito',
+ 'Credit Limit' => 'Límite de Crédito',
+ 'Curr' => 'Div',
+ 'Currency' => 'Divisa',
+ 'Current' => 'Actual',
+ 'Customer' => 'Cliente',
+ 'Customer deleted!' => 'Cliente borrado!',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Customer saved!' => 'Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'DBI not installed!' => 'DBI no ha sido instalado!',
+ 'Database' => 'Base de Datos',
+ 'Database Administration' => 'Administración de base de datos',
+ 'Database Driver not checked!' => 'Manejador no seleccionado!',
+ 'Database Host' => 'Servidor de base de datos',
+ 'Database User missing!' => 'Falta usuario de base de datos!',
+ 'Dataset' => 'Base de datos',
+ 'Dataset missing!' => 'Falta base de datos!',
+ 'Dataset updated!' => 'Base de datos actualizada!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Vencimiento',
+ 'Date Format' => 'Formato Fecha',
+ 'Date Paid' => 'Fecha Pago',
+ 'Date missing!' => 'Falta fecha!',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance!',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Decimalplaces' => 'Posiciones decimales',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Delete Dataset' => 'Borrar base de datos',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Diferencia',
+ 'Directory' => 'Directorio',
+ 'Discount' => 'Descuento',
+ 'Done' => 'Listo',
+ 'Drawing' => 'Retiro',
+ 'Driver' => 'Manejador',
+ 'Dropdown Limit' => 'Límite menu dropdown',
+ 'Due' => 'Vence',
+ 'Due Date' => 'Vencimiento',
+ 'Due Date missing!' => 'Falta Vencimiento!',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Enviar estado de cuenta por E-mail a',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit Accounts Payables Transaction' => 'Editar Transacción Cuentas por Pagar',
+ 'Edit Accounts Receivables Transaction' => 'Editar Transacción Cuentas por Cobrar',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit Customer' => 'Editar Cliente',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Edit Part' => 'Editar Item',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Project' => 'Editar Proyecto',
+ 'Edit Purchase Invoice' => 'Editar Factura de Compra',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Invoice' => 'Editar Factura de Venta',
+ 'Edit Sales Order' => 'Editar Pedido',
+ 'Edit Service' => 'Editar Servicio',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Edit User' => 'Editar Usuario',
+ 'Edit Vendor' => 'Editar Proveedor',
+ 'Employee' => 'Empleado',
+ 'Enforce transaction reversal for all dates' => 'Obligar reverso de transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Ingrese símbolo de hasta 3 letras para divisas nativa y extranjeras',
+ 'Equity' => 'Capital',
+ 'Exch' => 'Tasa',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate Difference' => 'Diferencial Dambiario',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Existing Datasets' => 'Bases de datos existentes',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Gasto',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'Foreign Exchange Gain' => 'Ganancia Cambiaria',
+ 'Foreign Exchange Loss' => 'Pérdida Cambiaria',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI borrado!',
+ 'GIFI missing!' => 'Falta GIFI!',
+ 'GIFI saved!' => 'GIFI guardado!',
+ 'GL Transaction' => 'Transacción de mayor',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Bienes y Servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Heading' => 'Encabezado',
+ 'Host' => 'Host',
+ 'Hostname missing!' => 'Falta nombre del Host!',
+ 'ID' => 'ID',
+ 'Image' => 'Imagen',
+ 'In-line' => 'Incorporado',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Include in drop-down menus' => 'Incluya en menús "drop-down"',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir cuenta en pantallas Cliente/Proveedor para señalar como contribuyente?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Income Statement' => 'Estado de Cuentas de Ingreso',
+ 'Incorrect Dataset version!' => 'Versión incorrecta de base de datos!',
+ 'Incorrect Password!' => 'Contraseña equivocada',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Existencia debe ser cero antes de hacer obsoleto a este conjunto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Existencia debe ser cero antes de hacer obsoleto este ítem!',
+ 'Inventory quantity must be zero!' => 'Existencia debe ser cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Invoice deleted!' => 'Factura borrada!',
+ 'Invoice posted!' => 'Factura registrada!',
+ 'Invoices' => 'Facturas',
+ 'Is this a summary account to record' => 'Registrar en cuenta de resumen ',
+ 'Item deleted!' => 'Item borrado!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'Language' => 'Idioma',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Last Invoice Number' => 'Ultima Factura Emitida',
+ 'Last Numbers & Default Accounts' => 'Ultimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultimo número Orden de Compra',
+ 'Last Sales Order Number' => 'Ultimo número Pedido',
+ 'Leave host and port field empty unless you want to make a remote connection.' => 'Deje en blanco los campos Host y Puerto si no requiere una conección remota',
+ 'Liability' => 'Pasivo',
+ 'Licensed to' => 'Licenciatario',
+ 'Line Total' => 'Total línea',
+ 'Link' => 'Vinculado a',
+ 'Link Accounts' => 'Vincular Cuentas',
+ 'List Accounts' => 'Listar cuentas',
+ 'List GIFI' => 'Listar GIFI',
+ 'List Price' => 'Precio de Lista',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Login' => 'Login',
+ 'Logout' => 'Salir del sistema',
+ 'Make' => 'Marca',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'Multibyte Encoding' => 'Codificación conjunto de caracteres',
+ 'N/A' => 'N/D',
+ 'Name' => 'Nombre',
+ 'Name missing!' => 'Falta nombre!',
+ 'New Templates' => 'Plantillas Nuevas',
+ 'No' => ' No ',
+ 'No Database Drivers available!' => 'No hay manejadores para base de datos!',
+ 'No Dataset selected!' => 'Base de datos no seleccionada!',
+ 'No email address for' => 'Falta dirección email para',
+ 'No.' => 'No.',
+ 'Notes' => 'Comentario',
+ 'Nothing applied!' => 'Nada aplicado!',
+ 'Nothing selected!' => 'Nada seleccionado!',
+ 'Nothing to delete!' => 'Nada para borrar!',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato Numérico',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'O' => 'O',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'On Hand' => 'Existencia',
+ 'On Order' => 'Pedido',
+ 'Open' => 'Abierto',
+ 'Oracle Database Administration' => 'Administración bases de datos Oracle',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha Pedido',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Entry' => 'Pedidos<br>Ordenes de Compra',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'Order deleted!' => 'Orden borrada!',
+ 'Order saved!' => 'Orden guardada!',
+ 'Ordered' => 'Pedido',
+ 'Orphaned' => 'Huérfano',
+ 'Out of balance!' => 'Fuera de balance!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Paid' => 'Pagado',
+ 'Paid in full' => 'Cancelado',
+ 'Part' => 'Item',
+ 'Part Number missing!' => 'Falta Número de Item!',
+ 'Parts' => 'Items',
+ 'Parts Inventory' => 'Inventario de Items',
+ 'Password' => 'Contraseña',
+ 'Password changed!' => 'Contraseña cambiada!',
+ 'Payables' => 'X Pagar',
+ 'Payment' => 'Pago',
+ 'Payment date missing!' => 'Falta Fecha de Pago',
+ 'Payment posted!' => 'Pago registrado!',
+ 'Payments' => 'Pagos',
+ 'Pg Database Administration' => 'Administración bases de datos Pg',
+ 'Phone' => 'Teléfono',
+ 'Port' => 'Número de Puerto',
+ 'Port missing!' => 'Falta número de puerto',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => 'Postscript',
+ 'Preferences' => 'Preferencias',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project Number missing!' => 'Falta número de proyecto!',
+ 'Project deleted!' => 'Proyecto borrado!',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Project saved!' => 'Proyecto guardado!',
+ 'Projects' => 'Proyectos',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cnt',
+ 'ROP' => 'Existencia mínima',
+ 'Rate' => 'Tasa',
+ 'Recd' => 'Rec',
+ 'Receipt' => 'Ingreso',
+ 'Receipts' => 'Ingresos',
+ 'Receivables' => 'X Cobrar',
+ 'Reconciliation' => 'Conciliación',
+ 'Record in' => 'Registrar en',
+ 'Reference' => 'Referencia',
+ 'Reference missing!' => 'Falta referencia!',
+ 'Remaining' => 'Quedan',
+ 'Report for' => 'Reporte de',
+ 'Reports' => 'Reportes',
+ 'Required by' => 'Requerido para el',
+ 'Retained Earnings' => 'Ganancias Retenidas',
+ 'Sales' => 'Ventas',
+ 'Sales Invoice' => 'Factura de Venta',
+ 'Sales Order' => 'Pedido',
+ 'Sales Orders' => 'Pedidos',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como nuevo',
+ 'Save to File' => 'Respaldar a Archivo',
+ 'Screen' => 'Pantalla',
+ 'Select a Dataset to delete and press "Continue"' => 'Seleccione base de datos a borrar y pulse "Continue"',
+ 'Select all' => 'Seleccione todos',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sell Price' => 'Precio de Venta',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Service Items' => 'Inventario de Servicios',
+ 'Service Number missing!' => 'Falta Número de Servicio!',
+ 'Services' => 'Servicios',
+ 'Setup Templates' => 'Configurar Plantillas',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Ship via' => 'Envía vía',
+ 'Short' => 'Corto',
+ 'Signature' => 'Firma',
+ 'Sold' => 'Vendido',
+ 'Source' => 'Referencia',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Estado de Cuenta',
+ 'Statement Balance' => 'Balance Estado de Cuenta',
+ 'Statement sent to' => 'Estado de Cuenta enviado a',
+ 'Statements sent to printer!' => 'Estados de Cuenta enviados a impresora!',
+ 'Stock Assembly' => 'Reponer Conjuntos',
+ 'Stylesheet' => 'Hoja de Estilo',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'System' => 'Sistema',
+ 'Tax' => 'ISV',
+ 'Tax Accounts' => 'Cuentas de Impuesto',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Tax collected' => 'Impuesto recaudado',
+ 'Tax paid' => 'Impuesto pagado',
+ 'Taxable' => 'Base imponible',
+ 'Template saved!' => 'Plantilla guardada!',
+ 'Templates' => 'Plantillas',
+ 'Terms: Net' => 'Crédito a',
+ 'The following Datasets are not in use and can be deleted' => 'Las siguientes bases de datos no están en uso y pueden ser borradas',
+ 'The following Datasets need to be updated' => 'Las siguientes bases de datos requieren actualización',
+ 'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'Chequeo preliminar. En esta etapa no se creará ni se borrará nada!',
+ 'To' => 'Hasta',
+ 'To add a user to a group edit a name, change the login name and save. A new user with the same variables will then be saved under the new login name.' => 'Para agregar un usuario a un grupo, edite un nombre, cambie el login y guárdelo de nuevo. Un nuevo usuario con las mismas variables se creará bajo el nuevo login.',
+ 'Top Level' => 'Nivel superior',
+ 'Total' => 'Total',
+ 'Transaction Date missing!' => 'Falta Fecha Transacción!',
+ 'Transaction deleted!' => 'Transacción borrada!',
+ 'Transaction posted!' => 'Transacción registrada!',
+ 'Transaction reversal enforced for all dates' => 'Reverso de transacciones obligadas para todas la fechas',
+ 'Transaction reversal enforced up to' => 'Reverso de transacciones obligadas hasta',
+ 'Transactions' => 'Transacciones',
+ 'Transactions exist, cannot delete customer!' => 'No podemos borrar cliente, existen transacciones!',
+ 'Transactions exist, cannot delete vendor!' => 'No podemos borrar proveedor, existen transacciones!',
+ 'Transactions exist; cannot delete account!' => 'No podemos borrar cuenta, existen transacciones!',
+ 'Trial Balance' => 'Balance de Comprobación',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Actualizar',
+ 'Update Dataset' => 'Actualizar base de datos',
+ 'Updated' => 'Actalizado',
+ 'Use Templates' => 'Use Plantilla',
+ 'User' => 'Usuario',
+ 'User deleted!' => 'Usuario borrado!',
+ 'User saved!' => 'Usuario guardado!',
+ 'Vendor' => 'Proveedor',
+ 'Vendor deleted!' => 'Proveedor borrado!',
+ 'Vendor missing!' => 'Falta proveedor',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'Vendor saved!' => 'Proveedor guardado!',
+ 'Vendors' => 'Proveedores',
+ 'Version' => 'Versión',
+ 'Weight' => 'Peso',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'Year End' => 'Cierre',
+ 'Yes' => ' Sí ',
+ 'You are logged out!' => 'Ha salido del sistema!',
+ 'You did not enter a name!' => 'No se ingresó un nombre!',
+ 'You must enter a host and port for local and remote connections!' => 'Debe ingresar un host y un puerto para conecciones locales y remotas!',
+ 'as at' => 'Al',
+ 'collected on sales' => 'recaudado sobre ventas',
+ 'days' => 'días',
+ 'does not exist' => 'no existe',
+ 'ea' => 'cu',
+ 'emailed to' => 'enviado por email a',
+ 'for Period' => 'para el período',
+ 'hr' => 'hr',
+ 'is already a member!' => 'ya es miembro!',
+ 'is not a member!' => 'no es miembro!',
+ 'localhost' => 'localhost',
+ 'locked!' => '',
+ 'paid on purchases' => 'pagado sobre compras',
+ 'sent to printer' => 'enviado a impresora',
+ 'successfully created!' => 'creado!',
+ 'successfully deleted!' => 'borrado!',
+ 'to' => 'a',
+ 'website' => 'en internet',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/am b/sql-ledger/locale/ve/am
new file mode 100644
index 000000000..3002447ed
--- /dev/null
+++ b/sql-ledger/locale/ve/am
@@ -0,0 +1,139 @@
+$self{texts} = {
+ 'AP' => 'CXP',
+ 'AR' => 'CXC',
+ 'Account' => 'Cuenta',
+ 'Account Number' => 'Número de Cuenta',
+ 'Account Number missing!' => 'Falta Número de Cuenta!',
+ 'Account Type' => 'Tipo de Cuenta',
+ 'Account Type missing!' => 'Falta Tipo de Cuenta!',
+ 'Account deleted!' => 'Cuenta borrada!',
+ 'Account saved!' => 'Cuenta guardada!',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Address' => 'Dirección',
+ 'Asset' => 'Activo',
+ 'Audit Control' => 'Control de Auditoría',
+ 'Backup sent to' => 'Respaldo enviado a',
+ 'Books are open' => 'Libros aperturados',
+ 'Business Number' => 'RIF/NIT/CI',
+ 'COGS' => 'Costo Perpetuo',
+ 'Cannot delete account!' => 'No puede borrar cuenta!',
+ 'Cannot delete default account!' => 'No puede borrar cuenta "default"!',
+ 'Cannot save account!' => 'No puede guardar cuenta!',
+ 'Cannot save preferences!' => 'No puede guardar preferencias!',
+ 'Character Set' => 'Conjunto de Caracteres',
+ 'Chart of Accounts' => 'Plan de Cuentas',
+ 'Close Books up to' => 'Cerrar ejercicio hasta',
+ 'Company' => 'Compañía',
+ 'Continue' => 'Continuar',
+ 'Copy to COA' => 'Copiar a Plan de Cuentas',
+ 'Credit' => 'Crédito',
+ 'Date Format' => 'Formato Fecha',
+ 'Debit' => 'Débito',
+ 'Delete' => 'Borrar',
+ 'Delete Account' => 'Borrar Cuenta',
+ 'Description' => 'Descripción',
+ 'Dropdown Limit' => 'Límite menu dropdown',
+ 'E-mail' => 'E-mail',
+ 'Edit' => 'Editar',
+ 'Edit Account' => 'Editar Cuenta',
+ 'Edit GIFI' => 'Editar GIFI',
+ 'Edit Preferences for' => 'Editar Preferencias para',
+ 'Edit Template' => 'Editar Plantilla',
+ 'Enforce transaction reversal for all dates' => 'Obligar reverso de transacciones para todas las fechas',
+ 'Enter up to 3 letters separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' => 'Ingrese símbolo de hasta 3 letras para divisas nativa y extranjeras',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Expense Account' => 'Cuenta de Gasto',
+ 'Expense/Asset' => 'Egreso/Activo',
+ 'Fax' => 'Fax',
+ 'Foreign Exchange Gain' => 'Ganancia Cambiaria',
+ 'Foreign Exchange Loss' => 'Pérdida Cambiaria',
+ 'GIFI' => 'GIFI',
+ 'GIFI deleted!' => 'GIFI borrado!',
+ 'GIFI missing!' => 'Falta GIFI!',
+ 'GIFI saved!' => 'GIFI guardado!',
+ 'Heading' => 'Encabezado',
+ 'Include in drop-down menus' => 'Incluya en menús "drop-down"',
+ 'Include this account on the customer/vendor forms to flag customer/vendor as taxable?' => 'Incluir cuenta en pantallas Cliente/Proveedor para señalar como contribuyente?',
+ 'Income' => 'Ingreso',
+ 'Income Account' => 'Cuenta de Ingreso',
+ 'Inventory' => 'Inventario',
+ 'Inventory Account' => 'Cuenta de Inventario',
+ 'Is this a summary account to record' => 'Registrar en cuenta de resumen ',
+ 'Language' => 'Idioma',
+ 'Last Invoice Number' => 'Ultima Factura Emitida',
+ 'Last Numbers & Default Accounts' => 'Ultimos Números y Cuentas por Defecto',
+ 'Last Purchase Order Number' => 'Ultimo número Orden de Compra',
+ 'Last Sales Order Number' => 'Ultimo número Pedido',
+ 'Liability' => 'Pasivo',
+ 'Link' => 'Vinculado a',
+ 'Name' => 'Nombre',
+ 'No' => ' No ',
+ 'No email address for' => 'Falta dirección email para',
+ 'Number' => 'Número',
+ 'Number Format' => 'Formato Numérico',
+ 'Parts Inventory' => 'Inventario de Items',
+ 'Password' => 'Contraseña',
+ 'Payables' => 'X Pagar',
+ 'Payment' => 'Pago',
+ 'Phone' => 'Teléfono',
+ 'Preferences saved!' => 'Preferencias guardadas!',
+ 'Rate' => 'Tasa',
+ 'Receivables' => 'X Cobrar',
+ 'Sales' => 'Ventas',
+ 'Save' => 'Guardar',
+ 'Service Items' => 'Inventario de Servicios',
+ 'Ship via' => 'Envía vía',
+ 'Signature' => 'Firma',
+ 'Stylesheet' => 'Hoja de Estilo',
+ 'Tax' => 'ISV',
+ 'Tax Accounts' => 'Cuentas de Impuesto',
+ 'Template saved!' => 'Plantilla guardada!',
+ 'Transaction reversal enforced for all dates' => 'Reverso de transacciones obligadas para todas la fechas',
+ 'Transaction reversal enforced up to' => 'Reverso de transacciones obligadas hasta',
+ 'Transactions exist; cannot delete account!' => 'No podemos borrar cuenta, existen transacciones!',
+ 'Weight Unit' => 'Unidad de Peso',
+ 'Year End' => 'Cierre',
+ 'Yes' => ' Sí ',
+ 'does not exist' => 'no existe',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_gifi' => 'add_gifi',
+ 'audit_control' => 'audit_control',
+ 'backup' => 'backup',
+ 'config' => 'config',
+ 'continue' => 'continue',
+ 'copy_to_coa' => 'copy_to_coa',
+ 'delete' => 'delete',
+ 'delete_account' => 'delete_account',
+ 'delete_gifi' => 'delete_gifi',
+ 'display_form' => 'display_form',
+ 'display_stylesheet' => 'display_stylesheet',
+ 'doclose' => 'doclose',
+ 'edit' => 'edit',
+ 'edit_gifi' => 'edit_gifi',
+ 'edit_template' => 'edit_template',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gifi_footer' => 'gifi_footer',
+ 'gifi_header' => 'gifi_header',
+ 'list' => 'list',
+ 'list_gifi' => 'list_gifi',
+ 'save' => 'save',
+ 'save_account' => 'save_account',
+ 'save_gifi' => 'save_gifi',
+ 'save_preferences' => 'save_preferences',
+ 'save_template' => 'save_template',
+ 'agregar_cuenta' => 'add_account',
+ 'continuar' => 'continue',
+ 'copiar_a_plan_de_cuentas' => 'copy_to_coa',
+ 'borrar' => 'delete',
+ 'editar' => 'edit',
+ 'editar_cuenta' => 'edit_account',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ap b/sql-ledger/locale/ve/ap
new file mode 100644
index 000000000..754f856b6
--- /dev/null
+++ b/sql-ledger/locale/ve/ap
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AP Transaction' => 'Cuenta por Pagar',
+ 'AP Transactions' => 'Cuentas por Pagar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Payables Transaction' => 'Agregar Cuenta por Pagar',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Amount Due' => 'Monto Vencido',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Transaction' => '¿Seguro que desea borrar Transacción?',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Cannot delete transaction!' => 'No puede borrar transacción!',
+ 'Cannot post payment for a closed period!' => 'No puede registrar pago para ejercicio cerrado',
+ 'Cannot post transaction for a closed period!' => 'No puede registrar transacción para ejercicio cerrado!',
+ 'Cannot post transaction!' => 'No puede registrar transacción!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Divisa',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha Pago',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Vencimiento',
+ 'Due Date missing!' => 'Falta Vencimiento!',
+ 'Edit Accounts Payables Transaction' => 'Editar Transacción Cuentas por Pagar',
+ 'Employee' => 'Empleado',
+ 'Exch' => 'Tasa',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Pagado',
+ 'Payment date missing!' => 'Falta Fecha de Pago',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Source' => 'Referencia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'ISV',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transacción borrada!',
+ 'Transaction posted!' => 'Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Falta proveedor',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'Yes' => ' Sí ',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_subtotal' => 'ap_subtotal',
+ 'ap_transaction' => 'ap_transaction',
+ 'ap_transactions' => 'ap_transactions',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'cuenta_por_pagar' => 'ap_transaction',
+ 'agregar_cuenta_por_pagar' => 'add_accounts_payables_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_transacción_cuentas_por_pagar' => 'edit_accounts_payables_transaction',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'factura_de_compra' => 'purchase_invoice',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ar b/sql-ledger/locale/ve/ar
new file mode 100644
index 000000000..55da07b19
--- /dev/null
+++ b/sql-ledger/locale/ve/ar
@@ -0,0 +1,133 @@
+$self{texts} = {
+ 'AR Transaction' => 'Cuenta por Cobrar',
+ 'AR Transactions' => 'Cuentas por Cobrar',
+ 'Account' => 'Cuenta',
+ 'Add Accounts Receivables Transaction' => 'Agregar Cuenta por Cobrar',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Amount Due' => 'Monto Vencido',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Transaction' => '¿Seguro que desea borrar Transacción?',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Cannot delete transaction!' => 'No puede borrar transacción!',
+ 'Cannot post payment for a closed period!' => 'No puede registrar pago para ejercicio cerrado',
+ 'Cannot post transaction for a closed period!' => 'No puede registrar transacción para ejercicio cerrado!',
+ 'Cannot post transaction!' => 'No puede registrar transacción!',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Límite de Crédito',
+ 'Currency' => 'Divisa',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Date Paid' => 'Fecha Pago',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Due Date' => 'Vencimiento',
+ 'Due Date missing!' => 'Falta Vencimiento!',
+ 'Edit Accounts Receivables Transaction' => 'Editar Transacción Cuentas por Cobrar',
+ 'Employee' => 'Empleado',
+ 'Exch' => 'Tasa',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Number' => 'Orden Número',
+ 'Paid' => 'Pagado',
+ 'Payment date missing!' => 'Falta Fecha de Pago',
+ 'Payments' => 'Pagos',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Remaining' => 'Quedan',
+ 'Sales Invoice' => 'Factura de Venta',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Source' => 'Referencia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'ISV',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Total' => 'Total',
+ 'Transaction deleted!' => 'Transacción borrada!',
+ 'Transaction posted!' => 'Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'Yes' => ' Sí ',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_subtotal' => 'ar_subtotal',
+ 'ar_transaction' => 'ar_transaction',
+ 'ar_transactions' => 'ar_transactions',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_links' => 'create_links',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'cuenta_por_cobrar' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'factura_de_venta' => 'sales_invoice',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/arap b/sql-ledger/locale/ve/arap
new file mode 100644
index 000000000..deba2e5a4
--- /dev/null
+++ b/sql-ledger/locale/ve/arap
@@ -0,0 +1,30 @@
+$self{texts} = {
+ 'Address' => 'Dirección',
+ 'Continue' => 'Continuar',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Description' => 'Descripción',
+ 'Number' => 'Número',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ca b/sql-ledger/locale/ve/ca
new file mode 100644
index 000000000..8de34b6b6
--- /dev/null
+++ b/sql-ledger/locale/ve/ca
@@ -0,0 +1,50 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Balance' => 'Balance',
+ 'Chart of Accounts' => 'Plan de Cuentas',
+ 'Credit' => 'Crédito',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Description' => 'Descripción',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'List Transactions' => 'Listar Transacciones',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Reference' => 'Referencia',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Subtotal' => 'Subtotal',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'ca_subtotal' => 'ca_subtotal',
+ 'chart_of_accounts' => 'chart_of_accounts',
+ 'list' => 'list',
+ 'list_transactions' => 'list_transactions',
+ 'listar_transacciones' => 'list_transactions',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/cp b/sql-ledger/locale/ve/cp
new file mode 100644
index 000000000..91c935041
--- /dev/null
+++ b/sql-ledger/locale/ve/cp
@@ -0,0 +1,75 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Amount does not equal applied!' => 'Monto no es igual!',
+ 'Amount missing!' => 'Falta monto!',
+ 'Applied' => 'Aplicado',
+ 'Cannot post payment!' => 'No puede registrar pago!',
+ 'Cannot process payment for a closed period!' => 'No puede procesar pago para ejercicio cerrado!',
+ 'Check' => 'Cheque',
+ 'Check printed!' => 'Cheque impreso!',
+ 'Check printing failed!' => 'No se pudo imprimir cheque!',
+ 'Continue' => 'Continuar',
+ 'Currency' => 'Divisa',
+ 'Customer' => 'Cliente',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Date missing!' => 'Falta fecha!',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'From' => 'Desde',
+ 'Invoice' => 'Factura',
+ 'Invoices' => 'Facturas',
+ 'Nothing applied!' => 'Nada aplicado!',
+ 'Number' => 'Número',
+ 'Paid in full' => 'Cancelado',
+ 'Payment' => 'Pago',
+ 'Payment posted!' => 'Pago registrado!',
+ 'Post' => 'Registrar',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Receipt' => 'Ingreso',
+ 'Reference' => 'Referencia',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'list_invoices' => 'list_invoices',
+ 'name_selected' => 'name_selected',
+ 'payment' => 'payment',
+ 'post' => 'post',
+ 'print' => 'print',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+ 'registrar' => 'post',
+ 'imprimir' => 'print',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ct b/sql-ledger/locale/ve/ct
new file mode 100644
index 000000000..60f585be7
--- /dev/null
+++ b/sql-ledger/locale/ve/ct
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Bcc' => 'Bcc',
+ 'Cannot delete customer!' => 'No puede borrar cliente!',
+ 'Cannot delete vendor!' => 'No puede borrar proveedor!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Credit Limit' => 'Límite de Crédito',
+ 'Customer deleted!' => 'Cliente borrado!',
+ 'Customer saved!' => 'Cliente guardado!',
+ 'Customers' => 'Clientes',
+ 'Delete' => 'Borrar',
+ 'Discount' => 'Descuento',
+ 'E-mail' => 'E-mail',
+ 'Edit Customer' => 'Editar Cliente',
+ 'Edit Vendor' => 'Editar Proveedor',
+ 'Fax' => 'Fax',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Invoice' => 'Factura',
+ 'Name' => 'Nombre',
+ 'Name missing!' => 'Falta nombre!',
+ 'Notes' => 'Comentario',
+ 'Number' => 'Número',
+ 'Order' => 'Orden',
+ 'Orphaned' => 'Huérfano',
+ 'Phone' => 'Teléfono',
+ 'Save' => 'Guardar',
+ 'Ship to' => 'Envíe a',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Taxable' => 'Base imponible',
+ 'Terms: Net' => 'Crédito a',
+ 'Transactions exist, cannot delete customer!' => 'No podemos borrar cliente, existen transacciones!',
+ 'Transactions exist, cannot delete vendor!' => 'No podemos borrar proveedor, existen transacciones!',
+ 'Vendor deleted!' => 'Proveedor borrado!',
+ 'Vendor saved!' => 'Proveedor guardado!',
+ 'Vendors' => 'Proveedores',
+ 'days' => 'días',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'customer_invoice' => 'customer_invoice',
+ 'customer_order' => 'customer_order',
+ 'delete' => 'delete',
+ 'delete_customer' => 'delete_customer',
+ 'delete_vendor' => 'delete_vendor',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'invoice' => 'invoice',
+ 'list_names' => 'list_names',
+ 'order' => 'order',
+ 'save' => 'save',
+ 'save_customer' => 'save_customer',
+ 'save_vendor' => 'save_vendor',
+ 'search' => 'search',
+ 'vendor_invoice' => 'vendor_invoice',
+ 'vendor_order' => 'vendor_order',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'factura' => 'invoice',
+ 'orden' => 'order',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/gl b/sql-ledger/locale/ve/gl
new file mode 100644
index 000000000..06c41373a
--- /dev/null
+++ b/sql-ledger/locale/ve/gl
@@ -0,0 +1,124 @@
+$self{texts} = {
+ 'AP Transaction' => 'Cuenta por Pagar',
+ 'AR Transaction' => 'Cuenta por Cobrar',
+ 'Account' => 'Cuenta',
+ 'Add General Ledger Transaction' => 'Agregar Transacción al Mayor General',
+ 'Address' => 'Dirección',
+ 'All' => 'Todos',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Transaction' => '¿Seguro que desea borrar Transacción?',
+ 'Asset' => 'Activo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Balance' => 'Balance',
+ 'Cannot delete transaction!' => 'No puede borrar transacción!',
+ 'Cannot have a value in both Debit and Credit!' => 'No puede haber Débito y Crédito simultáneamente!',
+ 'Cannot post a transaction without a value!' => 'No puede registrar transacción sin monto!',
+ 'Cannot post transaction for a closed period!' => 'No puede registrar transacción para ejercicio cerrado!',
+ 'Confirm!' => 'Confirmar!',
+ 'Continue' => 'Continuar',
+ 'Credit' => 'Crédito',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Debit and credit out of balance!' => 'Débito y Crédito fuera de balance!',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit General Ledger Transaction' => 'Editar Transacción de Mayor General',
+ 'Equity' => 'Capital',
+ 'Expense' => 'Egreso',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'GL Transaction' => 'Transacción de mayor',
+ 'General Ledger' => 'Mayor General',
+ 'ID' => 'ID',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Income' => 'Ingreso',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Liability' => 'Pasivo',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Reference' => 'Referencia',
+ 'Reference missing!' => 'Falta referencia!',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Factura de Venta',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Source' => 'Referencia',
+ 'Subtotal' => 'Subtotal',
+ 'Transaction Date missing!' => 'Falta Fecha Transacción!',
+ 'Transaction deleted!' => 'Transacción borrada!',
+ 'Transaction posted!' => 'Transacción registrada!',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'Yes' => ' Sí ',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'form_row' => 'form_row',
+ 'generate_report' => 'generate_report',
+ 'gl_subtotal' => 'gl_subtotal',
+ 'gl_transaction' => 'gl_transaction',
+ 'name_selected' => 'name_selected',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'search' => 'search',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'update' => 'update',
+ 'yes' => 'yes',
+ 'cuenta_por_pagar' => 'ap_transaction',
+ 'cuenta_por_cobrar' => 'ar_transaction',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'transacción_de_mayor' => 'gl_transaction',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'factura_de_compra' => 'purchase_invoice',
+ 'factura_de_venta' => 'sales_invoice',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ic b/sql-ledger/locale/ve/ic
new file mode 100644
index 000000000..9c4e9c801
--- /dev/null
+++ b/sql-ledger/locale/ve/ic
@@ -0,0 +1,206 @@
+$self{texts} = {
+ 'Active' => 'Activa',
+ 'Add' => 'Agregar',
+ 'Add Assembly' => 'Agregar Conjunto',
+ 'Add Part' => 'Agregar Item',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Add Service' => 'Agregar Servicio',
+ 'Address' => 'Dirección',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Assemblies' => 'Conjuntos',
+ 'Assemblies restocked!' => 'Conjuntos re-inventariados',
+ 'Assembly Number missing!' => 'Falta Número Conjunto!',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'BOM' => 'Lista de Materiales',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'Bought' => 'Comprado',
+ 'COGS' => 'Costo Perpetuo',
+ 'Cannot delete item already invoiced!' => 'No puede borrar ítem facturado!',
+ 'Cannot delete item on order!' => 'No puede borrar ítem pedido!',
+ 'Cannot delete item which is part of an assembly!' => 'No puede borrar ítem parte de conjunto!',
+ 'Cannot delete item!' => 'No puede borrar ítem!',
+ 'Cannot stock assemblies!' => 'No puede inventariar conjuntos!',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Description' => 'Descripción',
+ 'Drawing' => 'Retiro',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Edit Assembly' => 'Editar Conjunto',
+ 'Edit Part' => 'Editar Item',
+ 'Edit Service' => 'Editar Servicio',
+ 'Expense' => 'Egreso',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'Image' => 'Imagen',
+ 'In-line' => 'Incorporado',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Income' => 'Ingreso',
+ 'Individual Items' => 'Items Individuales',
+ 'Inventory' => 'Inventario',
+ 'Inventory quantity must be zero before you can set this assembly obsolete!' => 'Existencia debe ser cero antes de hacer obsoleto a este conjunto!',
+ 'Inventory quantity must be zero before you can set this part obsolete!' => 'Existencia debe ser cero antes de hacer obsoleto este ítem!',
+ 'Inventory quantity must be zero!' => 'Existencia debe ser cero!',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Item deleted!' => 'Item borrado!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Last Cost' => 'Ultimo Costo',
+ 'Line Total' => 'Total línea',
+ 'Link Accounts' => 'Vincular Cuentas',
+ 'List Price' => 'Precio de Lista',
+ 'Make' => 'Marca',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Microfiche' => 'Microficha',
+ 'Model' => 'Modelo',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'Obsolete' => 'Obsoleto',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'On Hand' => 'Existencia',
+ 'On Order' => 'Pedido',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'Ordered' => 'Pedido',
+ 'Orphaned' => 'Huérfano',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Part' => 'Item',
+ 'Part Number missing!' => 'Falta Número de Item!',
+ 'Parts' => 'Items',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cnt',
+ 'ROP' => 'Existencia mínima',
+ 'Recd' => 'Rec',
+ 'Required by' => 'Requerido para el',
+ 'Sales' => 'Ventas',
+ 'Sales Order' => 'Pedido',
+ 'Save' => 'Guardar',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sell Price' => 'Precio de Venta',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Service Number missing!' => 'Falta Número de Servicio!',
+ 'Services' => 'Servicios',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Short' => 'Corto',
+ 'Sold' => 'Vendido',
+ 'Stock Assembly' => 'Reponer Conjuntos',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'ISV',
+ 'To' => 'Hasta',
+ 'Top Level' => 'Nivel superior',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Unit of measure' => 'Unidad de medida',
+ 'Update' => 'Actualizar',
+ 'Updated' => 'Actalizado',
+ 'Weight' => 'Peso',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'ea' => 'cu',
+ 'emailed to' => 'enviado por email a',
+ 'hr' => 'hr',
+ 'sent to printer' => 'enviado a impresora',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'assembly_row' => 'assembly_row',
+ 'check_form' => 'check_form',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'delete_assembly' => 'delete_assembly',
+ 'delete_item' => 'delete_item',
+ 'delete_part' => 'delete_part',
+ 'delete_service' => 'delete_service',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'link_part' => 'link_part',
+ 'list_assemblies' => 'list_assemblies',
+ 'makemodel_row' => 'makemodel_row',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'parts_subtotal' => 'parts_subtotal',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'restock_assemblies' => 'restock_assemblies',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'stock_assembly' => 'stock_assembly',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'agregar' => 'add',
+ 'agregar_conjunto' => 'add_assembly',
+ 'agregar_item' => 'add_part',
+ 'agregar_servicio' => 'add_service',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'editar_conjunto' => 'edit_assembly',
+ 'editar_item' => 'edit_part',
+ 'editar_servicio' => 'edit_service',
+ 'guardar' => 'save',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/io b/sql-ledger/locale/ve/io
new file mode 100644
index 000000000..9370f8f6a
--- /dev/null
+++ b/sql-ledger/locale/ve/io
@@ -0,0 +1,106 @@
+$self{texts} = {
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Address' => 'Dirección',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'Cc' => 'Cc',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'In-line' => 'Incorporado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Part' => 'Item',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cnt',
+ 'Recd' => 'Rec',
+ 'Required by' => 'Requerido para el',
+ 'Sales Order' => 'Pedido',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Subject' => 'Materia',
+ 'To' => 'Hasta',
+ 'Unit' => 'Unidad',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'emailed to' => 'enviado por email a',
+ 'sent to printer' => 'enviado a impresora',
+};
+
+$self{subs} = {
+ 'check_form' => 'check_form',
+ 'customer_details' => 'customer_details',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post_as_new' => 'post_as_new',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'select_item' => 'select_item',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'continuar' => 'continue',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/ir b/sql-ledger/locale/ve/ir
new file mode 100644
index 000000000..29eec2292
--- /dev/null
+++ b/sql-ledger/locale/ve/ir
@@ -0,0 +1,178 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Invoice' => 'Agregar Factura de Compra',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Seguro que desea borrar Factura?',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'Cannot delete invoice!' => 'No puede borraar factura!',
+ 'Cannot post invoice for a closed period!' => 'No puede registrar factura para ejercicio cerrado!',
+ 'Cannot post invoice!' => 'No puede registrar factura!',
+ 'Cannot post payment for a closed period!' => 'No puede registrar pago para ejercicio cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Currency' => 'Divisa',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Vencimiento',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Edit Purchase Invoice' => 'Editar Factura de Compra',
+ 'Exch' => 'Tasa',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'In-line' => 'Incorporado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Invoice deleted!' => 'Factura borrada!',
+ 'Invoice posted!' => 'Factura registrada!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Part' => 'Item',
+ 'Payment date missing!' => 'Falta Fecha de Pago',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cnt',
+ 'Recd' => 'Rec',
+ 'Record in' => 'Registrar en',
+ 'Required by' => 'Requerido para el',
+ 'Sales Order' => 'Pedido',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Source' => 'Referencia',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Falta proveedor',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'Yes' => ' Sí ',
+ 'ea' => 'cu',
+ 'emailed to' => 'enviado por email a',
+ 'sent to printer' => 'enviado a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'orden' => 'order',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/is b/sql-ledger/locale/ve/is
new file mode 100644
index 000000000..28d7abdec
--- /dev/null
+++ b/sql-ledger/locale/ve/is
@@ -0,0 +1,185 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Agregar Factura de Venta',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Invoice Number' => '¿Seguro que desea borrar Factura?',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'Cannot delete invoice!' => 'No puede borraar factura!',
+ 'Cannot post invoice for a closed period!' => 'No puede registrar factura para ejercicio cerrado!',
+ 'Cannot post invoice!' => 'No puede registrar factura!',
+ 'Cannot post payment for a closed period!' => 'No puede registrar pago para ejercicio cerrado',
+ 'Cc' => 'Cc',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Límite de Crédito',
+ 'Currency' => 'Divisa',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Date Due' => 'Vencimiento',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Edit Sales Invoice' => 'Editar Factura de Venta',
+ 'Exch' => 'Tasa',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate for payment missing!' => 'No se encuentra pago por cambio de moneda',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'In-line' => 'Incorporado',
+ 'Invoice' => 'Factura',
+ 'Invoice Date' => 'Fecha Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number' => 'Número Factura',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Invoice deleted!' => 'Factura borrada!',
+ 'Invoice posted!' => 'Factura registrada!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Order' => 'Orden',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Part' => 'Item',
+ 'Payment date missing!' => 'Falta Fecha de Pago',
+ 'Payments' => 'Pagos',
+ 'Phone' => 'Teléfono',
+ 'Post' => 'Registrar',
+ 'Post as new' => 'Registrar como nuevo',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Qty' => 'Cnt',
+ 'Recd' => 'Rec',
+ 'Record in' => 'Registrar en',
+ 'Remaining' => 'Quedan',
+ 'Required by' => 'Requerido para el',
+ 'Sales Order' => 'Pedido',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Ship via' => 'Envía vía',
+ 'Source' => 'Referencia',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'To' => 'Hasta',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'Yes' => ' Sí ',
+ 'ea' => 'cu',
+ 'emailed to' => 'enviado por email a',
+ 'sent to printer' => 'enviado a impresora',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice_links' => 'invoice_links',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'post' => 'post',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_invoice' => 'prepare_invoice',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'orden' => 'order',
+ 'registrar' => 'post',
+ 'registrar_como_nuevo' => 'post_as_new',
+ 'imprimir' => 'print',
+ 'envíe_a' => 'ship_to',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/login b/sql-ledger/locale/ve/login
new file mode 100644
index 000000000..0546b907c
--- /dev/null
+++ b/sql-ledger/locale/ve/login
@@ -0,0 +1,27 @@
+$self{texts} = {
+ 'About' => 'Acerca de',
+ 'Database Host' => 'Servidor de base de datos',
+ 'Dataset' => 'Base de datos',
+ 'Incorrect Dataset version!' => 'Versión incorrecta de base de datos!',
+ 'Incorrect Password!' => 'Contraseña equivocada',
+ 'Licensed to' => 'Licenciatario',
+ 'Login' => 'Login',
+ 'Name' => 'Nombre',
+ 'Password' => 'Contraseña',
+ 'User' => 'Usuario',
+ 'Version' => 'Versión',
+ 'You are logged out!' => 'Ha salido del sistema!',
+ 'You did not enter a name!' => 'No se ingresó un nombre!',
+ 'is not a member!' => 'no es miembro!',
+ 'localhost' => 'localhost',
+};
+
+$self{subs} = {
+ 'company_logo' => 'company_logo',
+ 'login' => 'login',
+ 'login_screen' => 'login_screen',
+ 'logout' => 'logout',
+ 'login' => 'login',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/menu b/sql-ledger/locale/ve/menu
new file mode 100644
index 000000000..063e0affa
--- /dev/null
+++ b/sql-ledger/locale/ve/menu
@@ -0,0 +1,71 @@
+$self{texts} = {
+ 'AP' => 'CXP',
+ 'AP Aging' => 'Vencimientos',
+ 'AR' => 'CXC',
+ 'AR Aging' => 'Vencimientos',
+ 'Accounting Menu' => 'Menú de Contabilidad',
+ 'Add Account' => 'Agregar Cuenta',
+ 'Add Assembly' => 'Agregar Conjunto',
+ 'Add Customer' => 'Agregar Cliente',
+ 'Add GIFI' => 'Agregar GIFI',
+ 'Add Part' => 'Agregar Item',
+ 'Add Project' => 'Agregar Proyecto',
+ 'Add Service' => 'Agregar Servicio',
+ 'Add Transaction' => 'Agregar Transacción',
+ 'Add Vendor' => 'Agregar Proveedor',
+ 'Assemblies' => 'Conjuntos',
+ 'Audit Control' => 'Control de Auditoría',
+ 'Backup' => 'Respaldos',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Cash' => 'Caja',
+ 'Chart of Accounts' => 'Plan de Cuentas',
+ 'Check' => 'Cheque',
+ 'Customers' => 'Clientes',
+ 'General Ledger' => 'Mayor General',
+ 'Goods & Services' => 'Bienes y Servicios',
+ 'HTML Templates' => 'Plantillas HTML',
+ 'Income Statement' => 'Estado de Cuentas de Ingreso',
+ 'Invoice' => 'Factura',
+ 'LaTeX Templates' => 'Plantillas LaTeX',
+ 'List Accounts' => 'Listar cuentas',
+ 'List GIFI' => 'Listar GIFI',
+ 'Logout' => 'Salir del sistema',
+ 'Order Entry' => 'Pedidos<br>Ordenes de Compra',
+ 'Packing List' => 'Lista de Empaque',
+ 'Parts' => 'Items',
+ 'Payment' => 'Pago',
+ 'Payments' => 'Pagos',
+ 'Preferences' => 'Preferencias',
+ 'Projects' => 'Proyectos',
+ 'Purchase Invoice' => 'Factura de Compra',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Receipt' => 'Ingreso',
+ 'Receipts' => 'Ingresos',
+ 'Reconciliation' => 'Conciliación',
+ 'Reports' => 'Reportes',
+ 'Sales Invoice' => 'Factura de Venta',
+ 'Sales Order' => 'Pedido',
+ 'Sales Orders' => 'Pedidos',
+ 'Save to File' => 'Respaldar a Archivo',
+ 'Send by E-Mail' => 'Enviar por E-Mail',
+ 'Services' => 'Servicios',
+ 'Statement' => 'Estado de Cuenta',
+ 'Stock Assembly' => 'Reponer Conjuntos',
+ 'Stylesheet' => 'Hoja de Estilo',
+ 'System' => 'Sistema',
+ 'Tax collected' => 'Impuesto recaudado',
+ 'Tax paid' => 'Impuesto pagado',
+ 'Transactions' => 'Transacciones',
+ 'Trial Balance' => 'Balance de Comprobación',
+ 'Vendors' => 'Proveedores',
+ 'Version' => 'Versión',
+};
+
+$self{subs} = {
+ 'acc_menu' => 'acc_menu',
+ 'display' => 'display',
+ 'section_menu' => 'section_menu',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/oe b/sql-ledger/locale/ve/oe
new file mode 100644
index 000000000..899747c7e
--- /dev/null
+++ b/sql-ledger/locale/ve/oe
@@ -0,0 +1,200 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Purchase Invoice' => 'Agregar Factura de Compra',
+ 'Add Purchase Order' => 'Agregar Orden de Compra',
+ 'Add Sales Invoice' => 'Agregar Factura de Venta',
+ 'Add Sales Order' => 'Agregar Pedido',
+ 'Address' => 'Dirección',
+ 'Amount' => 'Monto',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Are you sure you want to delete Order Number' => '¿Seguro que desea borrar Orden de Compra/Pedido?',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Bcc' => 'Bcc',
+ 'Bin' => 'Ubicación',
+ 'C' => 'C',
+ 'Cannot delete order!' => 'No puede borrar pedido!',
+ 'Cannot save order!' => 'No puede guardar órden!',
+ 'Cc' => 'Cc',
+ 'Closed' => 'Cerrado',
+ 'Confirm!' => 'Confirmar!',
+ 'Contact' => 'Contacto',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit Limit' => 'Límite de Crédito',
+ 'Curr' => 'Div',
+ 'Currency' => 'Divisa',
+ 'Customer' => 'Cliente',
+ 'Customer missing!' => 'Falta cliente!',
+ 'Customer not on file!' => 'Cliente no existe en archivo!',
+ 'Date' => 'Fecha',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Delete' => 'Borrar',
+ 'Delivery Date' => 'Fecha de Entrega',
+ 'Description' => 'Descripción',
+ 'E-mail' => 'E-mail',
+ 'E-mail address missing!' => 'Falta dirección E-mail!',
+ 'Edit Purchase Order' => 'Editar Orden de Compra',
+ 'Edit Sales Order' => 'Editar Pedido',
+ 'Exchangerate' => 'Tasa de Cambio',
+ 'Exchangerate missing!' => 'No se encuentra cambio de moneda',
+ 'Extended' => 'Extendido',
+ 'Fax' => 'Fax',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'ID' => 'ID',
+ 'In-line' => 'Incorporado',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Invoice' => 'Factura',
+ 'Invoice Date missing!' => 'Falta Fecha Factura!',
+ 'Invoice Number missing!' => 'Falta Número Factura!',
+ 'Item not on file!' => 'Item no archivado!',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'Name' => 'Nombre',
+ 'No.' => 'No.',
+ 'Notes' => 'Comentario',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Number' => 'Número',
+ 'Number missing in Row' => 'Falta número en Hilera',
+ 'O' => 'O',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'Open' => 'Abierto',
+ 'Order' => 'Orden',
+ 'Order Date' => 'Fecha Pedido',
+ 'Order Date missing!' => 'Falta Fecha Pedido!',
+ 'Order Number' => 'Orden Número',
+ 'Order Number missing!' => 'Falta Número de Orden',
+ 'Order deleted!' => 'Orden borrada!',
+ 'Order saved!' => 'Orden guardada!',
+ 'PDF' => 'PDF',
+ 'Packing List' => 'Lista de Empaque',
+ 'Packing List Date missing!' => 'Falta Fecha en Nota de Entrega',
+ 'Packing List Number missing!' => 'Falta Número en Nota de Entrega',
+ 'Part' => 'Item',
+ 'Phone' => 'Teléfono',
+ 'Postscript' => 'Postscript',
+ 'Price' => 'Precio',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Project' => 'Proyecto',
+ 'Project not on file!' => 'Proyecto no archivado!',
+ 'Purchase Order' => 'Orden de Compra',
+ 'Purchase Orders' => 'Ordenes de Compra',
+ 'Qty' => 'Cnt',
+ 'Recd' => 'Rec',
+ 'Remaining' => 'Quedan',
+ 'Required by' => 'Requerido para el',
+ 'Sales Order' => 'Pedido',
+ 'Sales Orders' => 'Pedidos',
+ 'Save' => 'Guardar',
+ 'Save as new' => 'Guardar como nuevo',
+ 'Screen' => 'Pantalla',
+ 'Select from one of the items below' => 'Seleccione uno de los ítems listados',
+ 'Select from one of the names below' => 'Seleccione de uno de los nombres a continuación',
+ 'Select from one of the projects below' => 'Seleccione de uno de los proyectos a continuación',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Service' => 'Servicio',
+ 'Ship' => 'Envíe',
+ 'Ship to' => 'Envíe a',
+ 'Ship via' => 'Envía vía',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'ISV',
+ 'Tax Included' => 'Impuesto Incluido',
+ 'Terms: Net' => 'Crédito a',
+ 'To' => 'Hasta',
+ 'Total' => 'Total',
+ 'Unit' => 'Unidad',
+ 'Update' => 'Actualizar',
+ 'Vendor' => 'Proveedor',
+ 'Vendor missing!' => 'Falta proveedor',
+ 'Vendor not on file!' => 'Proveedor no está en archivo!',
+ 'What type of item is this?' => '¿Qué tipo de ítem es éste?',
+ 'Yes' => ' Sí ',
+ 'days' => 'días',
+ 'ea' => 'cu',
+ 'emailed to' => 'enviado por email a',
+ 'sent to printer' => 'enviado a impresora',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'add_transaction' => 'add_transaction',
+ 'ap_transaction' => 'ap_transaction',
+ 'ar_transaction' => 'ar_transaction',
+ 'check_form' => 'check_form',
+ 'check_name' => 'check_name',
+ 'check_project' => 'check_project',
+ 'continue' => 'continue',
+ 'create_backorder' => 'create_backorder',
+ 'customer_details' => 'customer_details',
+ 'delete' => 'delete',
+ 'display_form' => 'display_form',
+ 'display_row' => 'display_row',
+ 'e_mail' => 'e_mail',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'gl_transaction' => 'gl_transaction',
+ 'invoice' => 'invoice',
+ 'invoicetotal' => 'invoicetotal',
+ 'item_selected' => 'item_selected',
+ 'name_selected' => 'name_selected',
+ 'new_item' => 'new_item',
+ 'order' => 'order',
+ 'order_links' => 'order_links',
+ 'orders' => 'orders',
+ 'post_as_new' => 'post_as_new',
+ 'prepare_order' => 'prepare_order',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'project_selected' => 'project_selected',
+ 'purchase_invoice' => 'purchase_invoice',
+ 'sales_invoice' => 'sales_invoice',
+ 'save' => 'save',
+ 'save_as_new' => 'save_as_new',
+ 'search' => 'search',
+ 'select_item' => 'select_item',
+ 'select_name' => 'select_name',
+ 'select_project' => 'select_project',
+ 'send_email' => 'send_email',
+ 'ship_to' => 'ship_to',
+ 'subtotal' => 'subtotal',
+ 'update' => 'update',
+ 'validate_items' => 'validate_items',
+ 'vendor_details' => 'vendor_details',
+ 'yes' => 'yes',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'e_mail' => 'e_mail',
+ 'factura' => 'invoice',
+ 'imprimir' => 'print',
+ 'guardar' => 'save',
+ 'guardar_como_nuevo' => 'save_as_new',
+ 'envíe_a' => 'ship_to',
+ 'actualizar' => 'update',
+ '_sí_' => 'yes',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/pe b/sql-ledger/locale/ve/pe
new file mode 100644
index 000000000..cafe0af34
--- /dev/null
+++ b/sql-ledger/locale/ve/pe
@@ -0,0 +1,35 @@
+$self{texts} = {
+ 'Add' => 'Agregar',
+ 'Add Project' => 'Agregar Proyecto',
+ 'All' => 'Todos',
+ 'Continue' => 'Continuar',
+ 'Delete' => 'Borrar',
+ 'Description' => 'Descripción',
+ 'Edit Project' => 'Editar Proyecto',
+ 'Number' => 'Número',
+ 'Orphaned' => 'Huérfano',
+ 'Project' => 'Proyecto',
+ 'Project Number missing!' => 'Falta número de proyecto!',
+ 'Project deleted!' => 'Proyecto borrado!',
+ 'Project saved!' => 'Proyecto guardado!',
+ 'Projects' => 'Proyectos',
+ 'Save' => 'Guardar',
+};
+
+$self{subs} = {
+ 'add' => 'add',
+ 'continue' => 'continue',
+ 'delete' => 'delete',
+ 'edit' => 'edit',
+ 'form_footer' => 'form_footer',
+ 'form_header' => 'form_header',
+ 'generate_report' => 'generate_report',
+ 'save' => 'save',
+ 'search' => 'search',
+ 'agregar' => 'add',
+ 'continuar' => 'continue',
+ 'borrar' => 'delete',
+ 'guardar' => 'save',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/rc b/sql-ledger/locale/ve/rc
new file mode 100644
index 000000000..caeb32ad8
--- /dev/null
+++ b/sql-ledger/locale/ve/rc
@@ -0,0 +1,37 @@
+$self{texts} = {
+ 'Account' => 'Cuenta',
+ 'Balance' => 'Balance',
+ 'Cleared Balance' => 'Cleared Balance',
+ 'Continue' => 'Continuar',
+ 'Date' => 'Fecha',
+ 'Deposit' => 'Deposit',
+ 'Description' => 'Descripción',
+ 'Difference' => 'Diferencia',
+ 'Done' => 'Listo',
+ 'Exchangerate Difference' => 'Diferencial Dambiario',
+ 'From' => 'Desde',
+ 'Out of balance!' => 'Fuera de balance!',
+ 'Payment' => 'Pago',
+ 'Reconciliation' => 'Conciliación',
+ 'Select all' => 'Seleccione todos',
+ 'Source' => 'Referencia',
+ 'Statement Balance' => 'Balance Estado de Cuenta',
+ 'Update' => 'Actualizar',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'continue' => 'continue',
+ 'display_form' => 'display_form',
+ 'done' => 'done',
+ 'get_payments' => 'get_payments',
+ 'reconciliation' => 'reconciliation',
+ 'select_all' => 'select_all',
+ 'update' => 'update',
+ 'continuar' => 'continue',
+ 'listo' => 'done',
+ 'seleccione_todos' => 'select_all',
+ 'actualizar' => 'update',
+};
+
+1;
diff --git a/sql-ledger/locale/ve/rp b/sql-ledger/locale/ve/rp
new file mode 100644
index 000000000..bdc2bb61e
--- /dev/null
+++ b/sql-ledger/locale/ve/rp
@@ -0,0 +1,116 @@
+$self{texts} = {
+ 'AP Aging' => 'Vencimientos',
+ 'AR Aging' => 'Vencimientos',
+ 'Account' => 'Cuenta',
+ 'Accounts' => 'Cuentas',
+ 'Amount' => 'Monto',
+ 'Apr' => 'abr',
+ 'April' => 'de abril',
+ 'Attachment' => 'Anexo',
+ 'Aug' => 'ago',
+ 'August' => 'de agosto',
+ 'Balance Sheet' => 'Hoja de Balance',
+ 'Bcc' => 'Bcc',
+ 'Cash based' => 'Cash based',
+ 'Cc' => 'Cc',
+ 'Compare to' => 'Comparar a',
+ 'Continue' => 'Continuar',
+ 'Copies' => 'Copias',
+ 'Credit' => 'Crédito',
+ 'Current' => 'Actual',
+ 'Customer' => 'Cliente',
+ 'Date' => 'Fecha',
+ 'Debit' => 'Débito',
+ 'Dec' => 'dic',
+ 'December' => 'de diciembre',
+ 'Decimalplaces' => 'Posiciones decimales',
+ 'Description' => 'Descripción',
+ 'Due' => 'Vence',
+ 'E-mail' => 'E-mail',
+ 'E-mail Statement to' => 'Enviar estado de cuenta por E-mail a',
+ 'Feb' => 'feb',
+ 'February' => 'de febrero',
+ 'From' => 'Desde',
+ 'GIFI' => 'GIFI',
+ 'Heading' => 'Encabezado',
+ 'ID' => 'ID',
+ 'In-line' => 'Incorporado',
+ 'Include in Report' => 'Incluya en Reporte',
+ 'Income Statement' => 'Estado de Cuentas de Ingreso',
+ 'Invoice' => 'Factura',
+ 'Jan' => 'ene',
+ 'January' => 'de enero',
+ 'Jul' => 'jul',
+ 'July' => 'de julio',
+ 'Jun' => 'jun',
+ 'June' => 'de junio',
+ 'Mar' => 'mar',
+ 'March' => 'de marzo',
+ 'May' => 'may',
+ 'May ' => 'de mayo',
+ 'Message' => 'Mensaje',
+ 'N/A' => 'N/D',
+ 'Nothing selected!' => 'Nada seleccionado!',
+ 'Nov' => 'nov',
+ 'November' => 'de noviembre',
+ 'Oct' => 'oct',
+ 'October' => 'de octubre',
+ 'PDF' => 'PDF',
+ 'Payments' => 'Pagos',
+ 'Postscript' => 'Postscript',
+ 'Print' => 'Imprimir',
+ 'Printer' => 'Impresora',
+ 'Receipts' => 'Ingresos',
+ 'Report for' => 'Reporte de',
+ 'Retained Earnings' => 'Ganancias Retenidas',
+ 'Screen' => 'Pantalla',
+ 'Select all' => 'Seleccione todos',
+ 'Select postscript or PDF!' => 'Seleccione postscript o PDF',
+ 'Sep' => 'sep',
+ 'September' => 'de septiembre',
+ 'Source' => 'Referencia',
+ 'Standard' => 'Standard',
+ 'Statement' => 'Estado de Cuenta',
+ 'Statement sent to' => 'Estado de Cuenta enviado a',
+ 'Statements sent to printer!' => 'Estados de Cuenta enviados a impresora!',
+ 'Subject' => 'Materia',
+ 'Subtotal' => 'Subtotal',
+ 'Tax' => 'ISV',
+ 'Tax collected' => 'Impuesto recaudado',
+ 'Tax paid' => 'Impuesto pagado',
+ 'Total' => 'Total',
+ 'Trial Balance' => 'Balance de Comprobación',
+ 'Vendor' => 'Proveedor',
+ 'as at' => 'Al',
+ 'collected on sales' => 'recaudado sobre ventas',
+ 'for Period' => 'para el período',
+ 'paid on purchases' => 'pagado sobre compras',
+ 'to' => 'a',
+};
+
+$self{subs} = {
+ 'aging' => 'aging',
+ 'continue' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'generate_ap_aging' => 'generate_ap_aging',
+ 'generate_ar_aging' => 'generate_ar_aging',
+ 'generate_balance_sheet' => 'generate_balance_sheet',
+ 'generate_income_statement' => 'generate_income_statement',
+ 'generate_tax_report' => 'generate_tax_report',
+ 'generate_trial_balance' => 'generate_trial_balance',
+ 'list_payments' => 'list_payments',
+ 'print' => 'print',
+ 'print_form' => 'print_form',
+ 'print_options' => 'print_options',
+ 'report' => 'report',
+ 'select_all' => 'select_all',
+ 'send_email' => 'send_email',
+ 'statement_details' => 'statement_details',
+ 'tax_subtotal' => 'tax_subtotal',
+ 'continuar' => 'continue',
+ 'e_mail' => 'e_mail',
+ 'imprimir' => 'print',
+ 'seleccione_todos' => 'select_all',
+};
+
+1;
diff --git a/sql-ledger/login.pl b/sql-ledger/login.pl
new file mode 100755
index 000000000..726c78027
--- /dev/null
+++ b/sql-ledger/login.pl
@@ -0,0 +1,132 @@
+#!/usr/bin/perl
+#
+######################################################################
+# SQL-Ledger Accounting
+# Copyright (C) 2001
+#
+# Author: Dieter Simader
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+# Contributors:
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#######################################################################
+#
+# this script sets up the terminal and runs the scripts
+# in bin/$terminal directory
+# admin.pl is linked to this script
+#
+#######################################################################
+
+
+# setup defaults, these are overidden by sql-ledger.conf
+# DO NOT CHANGE
+$userspath = "users";
+$templates = "templates";
+$memberfile = "users/members";
+$sendmail = "| /usr/sbin/sendmail -t";
+########## end ###########################################
+
+
+$| = 1;
+
+eval { require "sql-ledger.conf"; };
+
+if (-e "$userspath/nologin") {
+ print "
+Login disabled!\n";
+
+ exit;
+}
+
+
+if ($ENV{CONTENT_LENGTH}) {
+ read(STDIN, $_, $ENV{CONTENT_LENGTH});
+}
+
+if ($ENV{QUERY_STRING}) {
+ $_ = $ENV{QUERY_STRING};
+}
+
+if ($ARGV[0]) {
+ $_ = $ARGV[0];
+}
+
+
+%form = split /[&=]/;
+
+# fix for apache 2.0
+map { $form{$_} =~ s/\\$// } keys %form;
+
+# name of this script
+$0 =~ tr/\\/\//;
+$pos = rindex $0, '/';
+$script = substr($0, $pos + 1);
+
+
+if ($form{path}) {
+ $form{path} =~ s/%2[fF]/\//g;
+ $form{path} =~ s/\.\.\///g;
+
+ if ($form{path} !~ /^bin\//) {
+ print "
+Invalid path!\n";
+ die;
+ }
+
+
+ $ARGV[0] = "$_&script=$script";
+ require "$form{path}/$script";
+} else {
+
+ if (!$form{terminal}) {
+ if ($ENV{HTTP_USER_AGENT}) {
+ # web browser
+ if ($ENV{HTTP_USER_AGENT} =~ /(mozilla|links|opera|w3m)/i) {
+ $form{terminal} = "mozilla";
+ }
+
+ if ($ENV{HTTP_USER_AGENT} =~ /lynx/i) {
+ $form{terminal} = "lynx";
+ }
+ } else {
+ if ($ENV{TERM} =~ /xterm/) {
+ $form{terminal} = "xterm";
+ }
+ if ($ENV{TERM} =~ /(console|linux|vt.*)/i) {
+ $form{terminal} = "console";
+ }
+ }
+ }
+
+
+ if ($form{terminal}) {
+
+ $ARGV[0] = "path=bin/$form{terminal}&script=$script";
+ map { $ARGV[0] .= "&${_}=$form{$_}" } keys %form;
+
+ require "bin/$form{terminal}/$script";
+
+ } else {
+
+ print qq|
+ Unknown terminal
+ |;
+ }
+
+}
+
+# end of main
+
diff --git a/sql-ledger/menu.ini b/sql-ledger/menu.ini
new file mode 100644
index 000000000..87207982e
--- /dev/null
+++ b/sql-ledger/menu.ini
@@ -0,0 +1,394 @@
+[AR]
+
+[AR--Add Transaction]
+module=ar.pl
+action=add
+
+[AR--Sales Invoice]
+module=is.pl
+action=add
+type=invoice
+
+[AR--Reports]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[AR--Reports--Transactions]
+module=ar.pl
+action=search
+nextsub=ar_transactions
+
+[AR--Reports--AR Aging]
+module=rp.pl
+action=report
+report=ar_aging
+
+[AR--Reports--Tax collected]
+module=rp.pl
+action=report
+report=tax_collected
+
+[AR--Customers]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[AR--Customers--Add Customer]
+module=ct.pl
+action=add
+db=customer
+
+[AR--Customers--Reports]
+module=ct.pl
+action=search
+db=customer
+
+[AP]
+
+[AP--Add Transaction]
+module=ap.pl
+action=add
+
+[AP--Vendor Invoice]
+module=ir.pl
+action=add
+type=invoice
+
+[AP--Reports]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[AP--Reports--Transactions]
+module=ap.pl
+action=search
+nextsub=ap_transactions
+
+[AP--Reports--AP Aging]
+module=rp.pl
+action=report
+report=ap_aging
+
+[AP--Reports--Tax paid]
+module=rp.pl
+action=report
+report=tax_paid
+
+[AP--Vendors]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[AP--Vendors--Add Vendor]
+module=ct.pl
+action=add
+db=vendor
+
+[AP--Vendors--Reports]
+module=ct.pl
+action=search
+db=vendor
+
+[Cash]
+
+[Cash--Receipt]
+module=cp.pl
+action=payment
+vc=customer
+
+[Cash--Payment]
+module=cp.pl
+action=payment
+vc=vendor
+
+[Cash--Reports]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[Cash--Reports--Receipts]
+module=rp.pl
+action=report
+report=receipts
+
+[Cash--Reports--Payments]
+module=rp.pl
+action=report
+report=payments
+
+[Cash--Reconciliation]
+module=rc.pl
+action=reconciliation
+
+[Order Entry]
+
+[Order Entry--Sales Order]
+module=oe.pl
+action=add
+type=sales_order
+
+[Order Entry--Purchase Order]
+module=oe.pl
+action=add
+type=purchase_order
+
+[Order Entry--Reports]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[Order Entry--Reports--Sales Orders]
+module=oe.pl
+action=search
+type=sales_order
+
+[Order Entry--Reports--Purchase Orders]
+module=oe.pl
+action=search
+type=purchase_order
+
+[General Ledger]
+
+[General Ledger--Add Transaction]
+module=gl.pl
+action=add
+
+[General Ledger--Reports]
+module=gl.pl
+action=search
+
+[Goods & Services]
+
+[Goods & Services--Add Part]
+module=ic.pl
+action=add
+item=part
+
+[Goods & Services--Add Service]
+module=ic.pl
+action=add
+item=service
+
+[Goods & Services--Add Assembly]
+module=ic.pl
+action=add
+item=assembly
+
+[Goods & Services--Add Group]
+module=pe.pl
+action=add
+type=partsgroup
+
+[Goods & Services--Stock Assembly]
+module=ic.pl
+action=stock_assembly
+
+[Goods & Services--Reports]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[Goods & Services--Reports--Parts]
+module=ic.pl
+action=search
+searchitems=part
+
+[Goods & Services--Reports--Services]
+module=ic.pl
+action=search
+searchitems=service
+
+[Goods & Services--Reports--Assemblies]
+module=ic.pl
+action=search
+searchitems=assembly
+
+[Goods & Services--Reports--Groups]
+module=pe.pl
+action=search
+type=partsgroup
+
+[Projects]
+
+[Projects--Add Project]
+module=pe.pl
+action=add
+type=project
+
+[Projects--Reports]
+module=pe.pl
+action=search
+type=project
+
+[Reports]
+
+[Reports--Chart of Accounts]
+module=ca.pl
+action=chart_of_accounts
+
+[Reports--Trial Balance]
+module=rp.pl
+action=report
+report=trial_balance
+
+[Reports--Income Statement]
+module=rp.pl
+action=report
+report=income_statement
+
+[Reports--Balance Sheet]
+module=rp.pl
+action=report
+report=balance_sheet
+
+[System]
+
+[System--Chart of Accounts]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[System--Chart of Accounts--Add Account]
+module=am.pl
+action=add
+
+[System--Chart of Accounts--List Accounts]
+module=am.pl
+action=list
+
+[System--Chart of Accounts--Add GIFI]
+module=am.pl
+action=add_gifi
+
+[System--Chart of Accounts--List GIFI]
+module=am.pl
+action=list_gifi
+
+[System--HTML Templates]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[System--HTML Templates--Income Statement]
+module=am.pl
+action=display_form
+file=templates=income_statement.html
+
+[System--HTML Templates--Balance Sheet]
+module=am.pl
+action=display_form
+file=templates=balance_sheet.html
+
+[System--HTML Templates--Invoice]
+module=am.pl
+action=display_form
+file=templates=invoice.html
+
+[System--HTML Templates--Packing List]
+module=am.pl
+action=display_form
+file=templates=packing_list.html
+
+[System--HTML Templates--Sales Order]
+module=am.pl
+action=display_form
+file=templates=sales_order.html
+
+[System--HTML Templates--Purchase Order]
+module=am.pl
+action=display_form
+file=templates=purchase_order.html
+
+[System--HTML Templates--Statement]
+module=am.pl
+action=display_form
+file=templates=statement.html
+
+[System--LaTeX Templates]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[System--LaTeX Templates--Invoice]
+module=am.pl
+action=display_form
+file=templates=invoice.tex
+
+[System--LaTeX Templates--Packing List]
+module=am.pl
+action=display_form
+file=templates=packing_list.tex
+
+[System--LaTeX Templates--Sales Order]
+module=am.pl
+action=display_form
+file=templates=sales_order.tex
+
+[System--LaTeX Templates--Purchase Order]
+module=am.pl
+action=display_form
+file=templates=purchase_order.tex
+
+[System--LaTeX Templates--Statement]
+module=am.pl
+action=display_form
+file=templates=statement.tex
+
+[System--LaTeX Templates--Check]
+module=am.pl
+action=display_form
+file=templates=check.tex
+
+[System--LaTeX Templates--Receipt]
+module=am.pl
+action=display_form
+file=templates=receipt.tex
+
+[System--Stylesheet]
+module=am.pl
+action=display_stylesheet
+
+[System--Backup]
+module=menu.pl
+action=acc_menu
+target=acc_menu
+submenu=1
+
+[System--Backup--Send by E-Mail]
+module=am.pl
+action=backup
+media=email
+
+[System--Backup--Save to File]
+module=am.pl
+action=backup
+media=file
+
+[System--Audit Control]
+module=am.pl
+action=audit_control
+
+[System--Preferences]
+module=am.pl
+action=config
+
+[Version]
+module=login.pl
+action=company_logo
+
+[Logout]
+module=login.pl
+action=logout
+target=_top
+
diff --git a/sql-ledger/setup.pl b/sql-ledger/setup.pl
new file mode 100755
index 000000000..740a86945
--- /dev/null
+++ b/sql-ledger/setup.pl
@@ -0,0 +1,594 @@
+#!/usr/bin/perl
+#
+######################################################################
+# SQL-Ledger, Accounting Software Installer
+# Copyright (c) 2002, Dieter Simader
+#
+# Email: dsimader@sql-ledger.org
+# Web: http://www.sql-ledger.org
+#
+#######################################################################
+
+$| = 1;
+
+if ($ENV{HTTP_USER_AGENT}) {
+ print "
+This does not work yet!
+use $0 from the command line";
+ exit;
+}
+
+$lynx = `lynx -version`; # if LWP is not installed use lynx
+$gzip = `gzip -V 2>&1`; # gz decompression utility
+$tar = `tar --version 2>&1`; # tar archiver
+$latex = `latex -version`;
+
+@source = ( "http://unc.dl.sourceforge.net/sourceforge/sql-ledger",
+ "http://www.sql-ledger.org/source",
+ "http://abacus.sql-ledger.org/source" );
+
+$userspath = "users"; # default for new installation
+
+eval { require "sql-ledger.conf"; };
+
+$filename = shift;
+
+# is LWP installed
+eval { require LWP::Simple; };
+$lwp = !($@);
+
+unless ($lwp || $lynx || $filename) {
+ die "You must have either lynx or LWP installed
+or specify a filename.
+perl $0 filename\n";
+}
+
+if ($filename) {
+ # extract version
+ die "Not a SQL-Ledger archive\n" if ($filename !~ /^sql-ledger/);
+
+ $version = $filename;
+ $version =~ s/sql-ledger-(\d+\.\d+\.\d+).*$/$1/;
+
+ $newinstall = 1;
+}
+
+if (!$filename && -f "VERSION") {
+ # get installed version from VERSION file
+ open(FH, "VERSION");
+ @a = <FH>;
+ close(FH);
+ $version = $a[0];
+ chomp $version;
+
+ $newinstall = !$version;
+} else {
+ $newinstall = 1;
+}
+
+
+$webowner = $<;
+$webgroup = $(;
+
+if ($httpd = `find /etc /usr/local/etc -type f -name 'httpd.conf'`) {
+ chomp $httpd;
+ $webowner = `grep "^User " $httpd`;
+ $webgroup = `grep "^Group " $httpd`;
+ $serverroot = `grep "^ServerRoot " $httpd`;
+
+ chomp $webowner;
+ chomp $webgroup;
+ chomp $serverroot;
+
+ ($null, $webowner) = split / /, $webowner;
+ ($null, $webgroup) = split / /, $webgroup;
+ ($null, $serverroot) = split / /, $serverroot;
+
+ $serverroot =~ s/"//g;
+
+}
+
+system("tput clear");
+
+if ($filename) {
+ $install = "\ninstall $version from (f)ile\n";
+}
+
+# check for latest version
+&get_latest_version;
+
+if (!$newinstall) {
+
+ $install .= "\n(r)einstall $version\n";
+
+}
+
+if ($version && $latest_version) {
+ if (!$filename && $version ne $latest_version) {
+ if (substr($version, 0, rindex($version, ".")) eq substr($latest_version, 0, rindex($latest_version, "."))) {
+ $install .= "\n(u)pgrade to $latest_version\n";
+ }
+ }
+}
+
+
+$install .= "\n(i)nstall $latest_version (from Internet)\n" if $latest_version;
+
+$install .= "\n(d)ownload $latest_version (no installation)" unless $filename;
+
+ print qq|
+
+
+ SQL-Ledger Accounting Software Installation
+
+
+
+$install
+
+
+Enter: |;
+
+$a = <STDIN>;
+chomp $a;
+
+exit unless $a;
+$a = lc $a;
+
+ if ($newinstall && ($a =~ /(i|r|f)/)) {
+
+ print qq|\nEnter httpd owner [$webowner] : |;
+ $web = <STDIN>;
+ chomp $web;
+ $webowner = $web if $web;
+
+ print qq|\nEnter httpd group [$webgroup] : |;
+ $web = <STDIN>;
+ chomp $web;
+ $webgroup = $web if $web;
+
+ }
+
+if ($a eq 'd') {
+ &download;
+}
+if ($a eq 'i') {
+ &install;
+}
+if ($a eq 'r') {
+ $latest_version = $version;
+ &install;
+}
+if ($a eq 'u') {
+ &upgrade;
+}
+
+if ($a eq 'f') {
+ &install;
+}
+
+exit;
+# end main
+
+
+sub download {
+
+ &get_source_code;
+
+}
+
+
+sub get_latest_version {
+
+ print "Checking for latest version number .... ";
+
+ if ($filename) {
+ print "skipping, filename supplied\n";
+ return;
+ }
+
+ if ($lwp) {
+ foreach $source (@source) {
+ $host = $source;
+ $host =~ s/(\w\/).*/$1/g;
+ chop $host;
+ print "\nTrying $host ... ";
+
+ $latest_version = LWP::Simple::get("$source/latest_version");
+
+ if ($latest_version) {
+ last;
+ } else {
+ print "not found";
+ }
+ }
+ } else {
+ if (!$lynx) {
+ print "\nYou must have either lynx or LWP installed";
+ exit 1;
+ }
+
+ foreach $source (@source) {
+ $host = $source;
+ $host =~ s/(\w\/).*/$1/g;
+ chop $host;
+ print "\nTrying $host ... ";
+ $ok = `lynx -dump -head $source/latest_version`;
+ if ($ok = ($ok =~ s/HTTP.*?200 OK//g)) {
+ $latest_version = `lynx -dump $source/latest_version`;
+ chomp $latest_version;
+ last;
+ } else {
+ print "not found";
+ }
+ }
+ die unless $ok;
+ }
+
+ chomp $latest_version;
+ if ($latest_version) {
+ print "ok\n";
+ 1;
+ }
+
+}
+
+
+sub get_source_code {
+
+ $err = 0;
+
+ if ($latest_version) {
+ # download it
+ $latest_version = "sql-ledger-${latest_version}.tar.gz";
+
+ print "\nStatus\n";
+ print "Downloading $latest_version .... ";
+
+ foreach $source (@source) {
+ $host = $source;
+ $host =~ s/(\w\/).*/$1/g;
+ chop $host;
+ print "\nTrying $host .... ";
+
+ if ($lwp) {
+ $err = LWP::Simple::getstore("$source/$latest_version", "$latest_version");
+ $err -= 200;
+ } else {
+ $ok = `lynx -dump -head $source/$latest_version`;
+ $err = !($ok =~ s/HTTP.*?200 OK//);
+
+ if (!$err) {
+ $err = system("lynx -dump $source/$latest_version > $latest_version");
+ }
+ }
+
+ last unless $err;
+
+ }
+
+ } else {
+ $err = -1;
+ }
+
+ if ($err) {
+ die "Cannot get $latest_version";
+ } else {
+ print "ok\n";
+ }
+
+ $latest_version;
+
+}
+
+
+sub install {
+
+ if ($filename) {
+ $latest_version = $filename;
+ } else {
+ $latest_version = &get_source_code;
+ }
+
+ &decompress;
+
+ if ($upgrade) {
+ print qq|
+
+Don't forget to upgrade the datasets!
+
+Load the admin panel in your web browser
+|;
+ }
+
+ if ($newinstall) {
+ # if this is not root, check if user is part of $webgroup
+ if ($>) {
+ if ($permset = ($) =~ getgrnam $webgroup)) {
+ `chown -R :$webgroup *`;
+ }
+ } else {
+ `chown -R $webowner:$webgroup *`;
+ }
+
+ chmod 0771, 'users', 'templates';
+
+ open(FH, "sql-ledger.conf.default");
+ @f = <FH>;
+ close(FH);
+ unless ($latex) {
+ grep { s/^\$latex.*/\$latex = 0;/ } @f;
+ }
+ open(FH, ">sql-ledger.conf");
+ print FH @f;
+ close(FH);
+
+ $alias = $absolutealias = $ENV{'PWD'};
+ $alias =~ s/.*\///g;
+
+ $httpddir = `dirname $httpd`;
+ chomp $httpddir;
+ $filename = "sql-ledger-httpd.conf";
+
+ # do we have write permission?
+ if (!open(FH, ">>$httpddir/$filename")) {
+ open(FH, ">$filename");
+ $norw = 1;
+ }
+
+ $directives = qq|
+Alias /$alias/ $absolutealias/
+<Directory $absolutealias>
+ AllowOverride All
+ AddHandler cgi-script .pl
+ Options ExecCGI Includes FollowSymlinks
+ Order Allow,Deny
+ Allow from All
+</Directory>
+
+<Directory $absolutealias/users>
+ Order Deny,Allow
+ Deny from All
+</Directory>
+
+|;
+
+ print FH $directives;
+ close(FH);
+
+ print qq|
+This is a new installation.
+
+|;
+
+ if ($norw) {
+ print qq|
+Webserver directives were written to $filename
+
+Copy $filename to $httpddir and add
+|;
+
+ # strip serverroot off httpddir
+ $httpddir =~ s/$serverroot\///;
+
+ print qq|
+Include $httpddir/$filename
+
+to $httpd
+
+Don't forget to restart your webserver!
+|;
+
+ if (!$permset) {
+ print qq|
+WARNING: permissions for templates and users directory
+could not be set. Login as root and set permissions
+
+# chown $webowner:$webgroup users templates
+# chmod 771 users templates
+
+|;
+ }
+
+ } else {
+
+ if (!(`grep "^# SQL-Ledger" $httpd`)) {
+ # append Include directive
+ $httpddir =~ s/$serverroot\///;
+
+ open(FH, ">>$httpd");
+
+ print FH qq|
+
+# SQL-Ledger
+Include $httpddir/$filename
+|;
+ close(FH);
+
+ print qq|
+Webserver directives were written to
+
+ $httpddir/$filename
+|;
+ }
+ }
+
+ if (!$>) {
+ # send SIGHUP to httpd
+ $pid = `cat /var/run/httpd.pid`;
+ chomp $pid;
+ system("kill -s HUP $pid") if $pid;
+ }
+ }
+
+ unlink "sql-ledger.conf.default";
+
+ &cleanup;
+
+ while ($a !~ /(Y|N)/) {
+ print qq|\nDisplay README (Y/n) : |;
+ $a = <STDIN>;
+ chomp $a;
+ $a = ($a) ? uc $a : 'Y';
+
+ if ($a eq 'Y') {
+ @args = ("more", "doc/README");
+ system(@args);
+ }
+ }
+
+}
+
+
+sub decompress {
+
+ die "Error: gzip not installed\n" unless ($gzip);
+ die "Error: tar not installed\n" unless ($tar);
+
+ &create_lockfile;
+
+ # ungzip and extract source code
+ print "Decompressing $latest_version ... ";
+
+ if (system("gzip -df $latest_version")) {
+ print "Error: Could not decompress $latest_version\n";
+ &remove_lockfile;
+ exit;
+ } else {
+ print "done\n";
+ }
+
+ # strip gz from latest_version
+ $latest_version =~ s/\.gz//;
+
+ # now untar it
+ print "Unpacking $latest_version ... ";
+ if (system("tar -xf $latest_version")) {
+ print "Error: Could not unpack $latest_version\n";
+ &remove_lockfile;
+ exit;
+ } else {
+ # now we have a copy in sql-ledger
+ if (system("tar -cf $latest_version -C sql-ledger .")) {
+ print "Error: Could not create archive for $latest_version\n";
+ &remove_lockfile;
+ exit;
+ } else {
+ if (system("tar -xf $latest_version")) {
+ print "Error: Could not unpack $latest_version\n";
+ &remove_lockfile;
+ exit;
+ } else {
+ print "done\n";
+ print "cleaning up ... ";
+ `rm -rf sql-ledger`;
+ print "done\n";
+ }
+ }
+ }
+}
+
+
+sub create_lockfile {
+
+ if (-d "$userspath") {
+ open(FH, ">$userspath/nologin");
+ close(FH);
+ $upgrade = 1;
+ }
+
+}
+
+
+sub cleanup {
+
+ unlink "$latest_version";
+ unlink "$userspath/members.default" if (-f "$userspath/members.default");
+
+ &remove_lockfile;
+
+}
+
+
+sub remove_lockfile { unlink "$userspath/nologin" if (-f "$userspath/nologin") };
+
+
+sub upgrade {
+
+ $latest_version = &get_patch;
+
+ &decompress;
+
+ &cleanup;
+
+ # if this is not root, check if user is part of $webgroup
+ if ($>) {
+ if ($permset = ($) =~ getgrnam $webgroup)) {
+ `chown -R :$webgroup *`;
+ }
+ } else {
+ `chown -R $webowner:$webgroup *`;
+ }
+
+ chmod 0771, 'users', 'templates';
+
+
+ print qq|
+
+Don't forget to upgrade your datasets and read
+the upgrade file in the doc directory.
+
+|;
+
+}
+
+
+
+sub get_patch {
+
+ $err = 0;
+
+ if ($version) {
+ # download the patch
+ $patchfile = "patch-${latest_version}.tar.gz";
+
+ print "Status\n";
+ print "Downloading $patchfile .... ";
+
+ foreach $source (@source) {
+ $host = $source;
+ $host =~ s/(\w\/).*/$1/g;
+ chop $host;
+ print "\nTrying $host .... ";
+
+ if ($lwp) {
+ $err = LWP::Simple::getstore("$source/$patchfile", "$patchfile");
+ $err -= 200;
+ } else {
+ $ok = `lynx -dump -head $source/$patchfile`;
+ $err = !($ok =~ /HTTP.*?200 OK/);
+
+ if (!$err) {
+ $err = system("lynx -dump $source/$patchfile > $patchfile");
+ }
+ }
+
+ last unless $err;
+
+ }
+
+ } else {
+ $err = -1;
+ }
+
+ if ($err) {
+ print "Cannot get $patchfile\n";
+ exit;
+ } else {
+ print "ok\n";
+ }
+
+ $patchfile;
+
+}
+
+
diff --git a/sql-ledger/sql-ledger.conf.default b/sql-ledger/sql-ledger.conf.default
new file mode 100644
index 000000000..96fb9b893
--- /dev/null
+++ b/sql-ledger/sql-ledger.conf.default
@@ -0,0 +1,33 @@
+use vars qw($userspath $memberfile $templates $sendmail $language $sid);
+
+# path to user configuration files
+# you may use an absolute path i.e. /var/tmp
+$userspath = "users";
+
+# templates base directory; this one needs to be here for now
+$templates = "templates";
+
+# member file, could also be in "/usr/local/etc/slusers"
+$memberfile = "users/members";
+
+# location of sendmail
+$sendmail = "| /usr/sbin/sendmail -t";
+
+# set language for login and admin; two letter code
+$language = "";
+
+# Oracle
+$sid = "T80509";
+$ENV{"ORACLE_HOME"} = "/usr/local/oracle";
+
+# if you have latex installed set to 1
+$latex = 1;
+
+# if the server can't find latex, dvips or pdflatex, add the path
+$ENV{PATH} .= ":/usr/local/bin";
+
+# on mac os X using Fink's Perl libs, add the path
+$ENV{PERL5LIB} .= ":/sw/lib/perl5";
+
+
+1;
diff --git a/sql-ledger/sql-ledger.png b/sql-ledger/sql-ledger.png
new file mode 100644
index 000000000..0297a1bd4
--- /dev/null
+++ b/sql-ledger/sql-ledger.png
Binary files differ
diff --git a/sql-ledger/sql/Austria-chart.sql b/sql-ledger/sql/Austria-chart.sql
new file mode 100644
index 000000000..85810c549
--- /dev/null
+++ b/sql-ledger/sql/Austria-chart.sql
@@ -0,0 +1,143 @@
+-- Kontoplan für Österreich
+-- Ferdinand Gassauer, Tue, 5 Feb 2002
+-- checked and completed, Thu, 7 Feb 2002, Dieter Simader
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0000','AUFWENDUNGEN FÜR INGANGSETZEN UND ERWEITERN DES BETRIEBES','H','00','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0010','Firmenwert','A','015','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0100','IMMATERIELLE VERMÖGENSGEGENSTÄNDE','H','01','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0110','Rechte','A','011','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0200','GRUNDSTÜCKE','H','02-03','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0210','unbebaute Grundstücke','A','020','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0220','bebaute Grundstücke','A','021','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0229','kum. Abschreibung bebaute Grundstücke','A','039','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0400','MASCHINEN','H','04-05','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0410','Maschinen','A','041','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0419','kum. Abschreibung Maschinen','A','069','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0500','FAHRZEUGE','H','06','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0510','Fahrzeuge','A','063','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0519','kum. Abschreibung Fahrzeuge','A','069','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0600','BETRIEBS- UND GESCHÄFTSAUSSTATTUNG','H','06','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0620','Büroeinrichtungen','A','066','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0625','kum. Abschreibung Betriebs- und Geschäftsausstattung','A','069','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0700','GELEISTETE ANZAHLUNGEN','H','07','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0800','FINANZANLAGEN','H','08-09','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0810','Beteiligungen','A','081','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0820','Wertpapiere','A','080','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1100','ROHSTOFFE','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1120','Vorräte - Rohstoffe','A','110-119','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','BEZOGENE TEILE','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1220','Vorräte - bezogene Teile','A','120-129','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1300','HILFS- UND BETRIEBSSTOFFE','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1320','Hilfsstoffe','A','130-134','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1350','Betriebssstoffe','A','135-139','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1400','UNFERTIGE ERZEUGNISSE','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1420','Vorräte - unfertige Erzeugnisse','A','140-149','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','FERTIGE ERZEUGNISSE','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Vorräte - Hardware','A','150-159','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Vorräte - Software','A','150-159','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Vorräte - Ersatzteile','A','150-159','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1600','WAREN','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1700','NOCH NICHT ABGERECHNETE LEISTUNGEN','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','GELEISTETE ANZAHLUNGEN','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1900','WERTBERICHTIGUNGEN','H','1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','FORDEUNGEN AUS LIEFERUNGEN UND LEISTUNGEN','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2010','Forderungen Lieferung & Leistung','A','200-207','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2019','Wertberichtigung uneinbringliche Forderungen','A','20-21','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2300','SONSTIGE FORDERUNGEN','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2320','sonstige Forderungen','A','23-24','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2500','FORDERUNGEN AUS ABGABENVERRECHNUNG','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2520','sonstige Forderungen aus Abgebenverrechnung','A','25','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','WERTPAPIERE UND ANTEILE','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Wertpapiere Umlaufvermögen','A','26','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2700','KASSABESTAND','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2701','Kassa','A','27-28','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2800','SCHECKS, GUTHABEN BEI KREDITINSTITUTEN','H','2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2810','Schecks','A','27-28','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2820','Bankguthaben','A','280-288','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3100','LANGFRISTIGE VERBINDLICHKEITEN','H','3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3110','Bank Verbindlichkeiten','A','31','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3120','Kredite von Eigentümern','A','310','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','VERBINDLICHKEITEN AUS LIEFERUNGEN UND LEISTUNGEN','H','33','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3310','Verbindlichkeiten aus Lieferungen und Leistungen','A','330-335','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','VERBINDLICHKEITEN FINANZAMT','H','35','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3510','Finanzamt Verrechnung Körperschaftssteuer','A','350-359','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3520','Finanzamt Verrechnung Umsatzsteuer','A','350-359','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3530','Mehrwertsteuer 0%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3531','Mehrwertsteuer 10%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3532','Mehrwertsteuer 20%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3540','Vorsteuer 0%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3541','Vorsteuer 10%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3542','Vorsteuer 20%','A','350-359','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','UMSATZ','H','4','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','Verkauf - Hardware','A','40-44','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Verkauf - Software ','A','40-44','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Verkauf - Ersatzteile','A','40-44','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','UMSATZ BERATUNG','H','4','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Erlöse Beratung','A','40-44','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Erlöse Programmierung','A','40-44','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4600','SONSTIGE ERLÖSE','H','4','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4630','Frachterlöse','A','46-49','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','WARENEINSATZ','H','5','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','Wareneinsatz / Hardware','A','500-509','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','Wareneinsatz / Software','A','500-509','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','Wareneinsatz / Ersatzteile','A','520-529','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','VERBRAUCH BRENN- UND TREIBSTOFFEN, ENERGIE UND WASSER','H','5','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Energie, Wasser','A','560-569','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6000','LOHNAUFWAND','H','6','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6010','Lohn ','A','600-619','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6200','GEAHLTSAUFWAND','H','6','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6210','Gehalt ','A','620-639','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6500','GESETZLICHER SOZIALAUFWAND','H','6','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6510','Dienstgeberanteile','A','645-649','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6700','FREIWILLIGER SOZIALAUFWAND','H','6','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6710','freiwilliger Sozialaufwand','A','660-665','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7000','ABSCHREIBUNGEN','H','7','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7010','Abschreibungen','A','700','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7020','geringwertige Wirtschaftsgüter','A','701-708','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7100','SONSTIGE STEUERN','H','71','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7110','Ertragssteuern','A','710-719','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7120','Grundsteuern','A','710-719','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7200','INSTANDHALTUNGSAUFWAND','H','7','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7210','Reparatur und Instandhaltung','A','720-729','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7300','TRANSPORTKOSTEN','H','73','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7310','Frachtaufwand','A','730-731','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7400','MIET-,PACHT-,LEASING-, LIZENZAUFWAND','H','74','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7410','Miete','A','740-743','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7411','Lizenzen','A','748-749','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7600','VERWALTUNGSKOSTEN','H','76','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7610','Beratungsaufwand','A','775-776','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7611','Büromaterialien','A','760','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7615','Werbung und Marketing','A','765-768','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7620','uneinbringliche Forderungen','A','799','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7630','Telephonkosten','A','738-739','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7631','Internetkosten','A','738-739','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7632','Reise- und Repräsentationsaufwand','A','734-735','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7634','Registrierungsgebühren','A','748-749','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7700','VERSICHERUNGEN','H','77-78','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7710','Versicherung','A','770-774','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8000','FINANZERTRÄGE UND FINANZAUFWENDUNGEN','H','8','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8020','Bankzinsen und Gebühren','A','80-83','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8100','BETEILIGUNGSERTRÄGE','H','8','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8110','Erträge aus Beteiligungen','A','800-804','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9000','KAPITAL','H','9','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9010','Aktien, Geschäftsanteile','A','900-918','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9020','nicht einbezahltes Kapital','A','919','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9200','KAPITALRÜCKLAGEN','H','9','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9210','freie Rücklage','A','920-929','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9300','GEWINN','H','939','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9310','Gewinnvortrag Vorjahr','A','980','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9320','Jahresgewinn','A','985','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9400','RÜCKSTELLUNGEN','H','3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9420','Abfertigungsrückstellung','A','300','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9430','Urlaubsrückstellung','A','304-309','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9700','EINLAGEN STILLER GESELLSCHAFTER','H','9','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9800','EB,SB,G+V KONTEN','H','9','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4640','Devisengewinne','A','80-83','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8050','Devisenverluste','A','80-83','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3530'),0.00);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3531'),0.10);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3532'),0.20);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '7610'), fxgain_accno_id = (select id from chart where accno = '4640'), fxloss_accno_id = (select id from chart where accno = '8050'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'EUR:USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Austria-gifi.sql b/sql-ledger/sql/Austria-gifi.sql
new file mode 100644
index 000000000..43f213f28
--- /dev/null
+++ b/sql-ledger/sql/Austria-gifi.sql
@@ -0,0 +1,334 @@
+-- Österreichischer Einheitskontenrahmen / Kontenplan (ÖSV Österreichischer Steuerverein)
+--
+INSERT INTO gifi (accno, description) VALUES ('0', 'Anlagevermögen und Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes');
+--
+INSERT INTO gifi (accno, description) VALUES ('00', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes');
+INSERT INTO gifi (accno, description) VALUES ('001', 'Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes');
+INSERT INTO gifi (accno, description) VALUES ('009', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('01', 'Immaterielle Vermögensgegenstände');
+INSERT INTO gifi (accno, description) VALUES ('010', 'Konzessionen');
+INSERT INTO gifi (accno, description) VALUES ('011', 'Patentrechte und Lizenzen');
+INSERT INTO gifi (accno, description) VALUES ('012', 'Datenverarbeitungsprogramme');
+INSERT INTO gifi (accno, description) VALUES ('013', 'Marken, Warenzeichen und Musterschutzrechte, sonstige Urheberrechte');
+INSERT INTO gifi (accno, description) VALUES ('014', 'Pacht- und Mietrechte');
+INSERT INTO gifi (accno, description) VALUES ('015', 'Geschäfts(Firmen)wert');
+INSERT INTO gifi (accno, description) VALUES ('018', 'Geleistete Anzahlungen');
+INSERT INTO gifi (accno, description) VALUES ('019', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('02-03', 'Grundstücke, grundstücksgleiche Rechte und Bauten, einschließlich der Bauten auf fremden Grund');
+INSERT INTO gifi (accno, description) VALUES ('020', 'Unbebaute Grundstücke');
+INSERT INTO gifi (accno, description) VALUES ('021', 'Bebaute Grundstücke (Grundwert)');
+INSERT INTO gifi (accno, description) VALUES ('022', 'Grundstücksgleiche Rechte');
+INSERT INTO gifi (accno, description) VALUES ('030', 'Betriebs- und Geschäftsgebäude auf eigenem Grund');
+INSERT INTO gifi (accno, description) VALUES ('031', 'Wohn- und Sozialgebäude auf eigenem Grund');
+INSERT INTO gifi (accno, description) VALUES ('032', 'Betriebs- und Geschäftsgebäude auf fremdem Grund');
+INSERT INTO gifi (accno, description) VALUES ('033', 'Wohn- und Sozialgebäude auf fremdem Grund');
+INSERT INTO gifi (accno, description) VALUES ('034', 'Grundstückseinrichtungen auf eigenem Grund');
+INSERT INTO gifi (accno, description) VALUES ('035', 'Grundstückseinrichtungen auf fremdem Grund');
+INSERT INTO gifi (accno, description) VALUES ('036', 'Bauliche Investitionen in fremden (gepachteten) Betriebs- und Geschäftsgebäuden');
+INSERT INTO gifi (accno, description) VALUES ('037', 'Bauliche Investitionen in fremden (gepachteten) Wohn- und Sozialgebäuden');
+INSERT INTO gifi (accno, description) VALUES ('039', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('04-05', 'Technische Anlagen und Maschinen');
+INSERT INTO gifi (accno, description) VALUES ('040', 'Fertigungsmaschinen');
+INSERT INTO gifi (accno, description) VALUES ('041', 'Antriebsmaschinen');
+INSERT INTO gifi (accno, description) VALUES ('042', 'Energieversorgungsanlagen');
+INSERT INTO gifi (accno, description) VALUES ('043', 'Transportanlagen');
+INSERT INTO gifi (accno, description) VALUES ('044-049', 'Sonstige Maschinen und maschinelle Anlagen');
+INSERT INTO gifi (accno, description) VALUES ('050', 'Maschinenwerkzeuge');
+INSERT INTO gifi (accno, description) VALUES ('051', 'Allgemeine Werkzeuge und Handwerkzeuge');
+INSERT INTO gifi (accno, description) VALUES ('052', 'Vorrichtungen, Formen und Modelle');
+INSERT INTO gifi (accno, description) VALUES ('053', 'Andere Erzeugungshilfsmittel');
+INSERT INTO gifi (accno, description) VALUES ('054', 'Hebezeuge und Montageanlagen');
+INSERT INTO gifi (accno, description) VALUES ('055', 'Geringwertige Vermögensgegenstände, soweit im Erzeugungsprozeß verwendet');
+--
+INSERT INTO gifi (accno, description) VALUES ('06', 'Andere Anlagen, Betriebs- und Geschäftsausstattung');
+INSERT INTO gifi (accno, description) VALUES ('060', 'Beheizungs- und Beleuchtungsanlagen');
+INSERT INTO gifi (accno, description) VALUES ('061', 'Nachrichten- und Kontrollanlagen');
+INSERT INTO gifi (accno, description) VALUES ('062', 'Büromaschinen, EDV-Anlagen');
+INSERT INTO gifi (accno, description) VALUES ('063', 'PKW');
+INSERT INTO gifi (accno, description) VALUES ('064', 'LKW');
+INSERT INTO gifi (accno, description) VALUES ('065', 'Andere Beförderungsmittel');
+INSERT INTO gifi (accno, description) VALUES ('066', 'Andere Betriebs- und Geschäftsausstattung');
+INSERT INTO gifi (accno, description) VALUES ('067', 'Gebinde');
+INSERT INTO gifi (accno, description) VALUES ('068', 'Geringwertige Vermögensgegenstände, soweit nicht im Erzeugungsprozeß verwendet');
+INSERT INTO gifi (accno, description) VALUES ('069', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('07', 'Geleistete Anzahlungen und Anlagen in Bau');
+INSERT INTO gifi (accno, description) VALUES ('070', 'Geleistete Anzahlungen');
+INSERT INTO gifi (accno, description) VALUES ('071', 'Anlagen in Bau');
+INSERT INTO gifi (accno, description) VALUES ('079', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('08-09', 'Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('080', 'Anteile an verbundenen Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('081', 'Beteiligungen an Gemeinschaftsunternehmen');
+INSERT INTO gifi (accno, description) VALUES ('082', 'Beteiligungen an angeschlossenen (assoziierten) Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('083', 'Sonstige Beteiligungen');
+INSERT INTO gifi (accno, description) VALUES ('084', 'Ausleihungen an verbundene Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('085', 'Ausleihungen an Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno, description) VALUES ('086', 'Sonstige Ausleihungen');
+INSERT INTO gifi (accno, description) VALUES ('087', 'Anteile an Kapitalgesellschaften ohne Beteiligungscharakter');
+INSERT INTO gifi (accno, description) VALUES ('088', 'Anteile an Personengesellschaften ohne Beteiligungscharakter');
+INSERT INTO gifi (accno, description) VALUES ('090', 'Genossenschaftsanteile ohne Beteiligungscharakter');
+INSERT INTO gifi (accno, description) VALUES ('091', 'Anteile an Investmentfonds');
+INSERT INTO gifi (accno, description) VALUES ('092-093', 'Festverzinsliche Wertpapiere des Anlagevermögens');
+INSERT INTO gifi (accno, description) VALUES ('094-097', 'Sonstige Finanzanlagen, Wertrechte');
+INSERT INTO gifi (accno, description) VALUES ('098', 'Geleistete Anzahlungen');
+INSERT INTO gifi (accno, description) VALUES ('099', 'Kumulierte Abschreibungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('1', 'Vorräte');
+INSERT INTO gifi (accno, description) VALUES ('100-109', 'Bezugsverrechnung');
+INSERT INTO gifi (accno, description) VALUES ('110-119', 'Rohstoffe');
+INSERT INTO gifi (accno, description) VALUES ('120-129', 'Bezogene Teile');
+INSERT INTO gifi (accno, description) VALUES ('130-134', 'Hilfsstoffe');
+INSERT INTO gifi (accno, description) VALUES ('135-139', 'Betriebsstoffe');
+INSERT INTO gifi (accno, description) VALUES ('140-149', 'Unfertige Erzeugnisse');
+INSERT INTO gifi (accno, description) VALUES ('150-159', 'Fertige Erzeugnisse');
+INSERT INTO gifi (accno, description) VALUES ('160-169', 'Waren');
+INSERT INTO gifi (accno, description) VALUES ('170-179', 'Noch nicht abrechenbare Leistungen');
+INSERT INTO gifi (accno, description) VALUES ('180', 'Geleistete Anzahlungen');
+INSERT INTO gifi (accno, description) VALUES ('190-199', 'Wertberichtigungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('2', 'Sonstiges Umlaufvermögen, Rechnungsabgrenzungsposten');
+INSERT INTO gifi (accno, description) VALUES ('20-21', 'Forderungen aus Lieferungen und Leistungen');
+INSERT INTO gifi (accno, description) VALUES ('200-207', 'Forderungen aus Lieferungen und Leistungen Inland');
+INSERT INTO gifi (accno, description) VALUES ('208', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland');
+INSERT INTO gifi (accno, description) VALUES ('209', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Inland');
+INSERT INTO gifi (accno, description) VALUES ('210-212', 'Forderungen aus Lieferungen und Leistungen Währungsunion');
+INSERT INTO gifi (accno, description) VALUES ('213', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion');
+INSERT INTO gifi (accno, description) VALUES ('214', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen Währungsunion');
+INSERT INTO gifi (accno, description) VALUES ('215-217', 'Forderungen aus Lieferungen und Leistungen sonstiges Ausland');
+INSERT INTO gifi (accno, description) VALUES ('218', 'Einzelwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland');
+INSERT INTO gifi (accno, description) VALUES ('219', 'Pauschalwertberichtigungen zu Forderungen aus Lieferungen und Leistungen sonstiges Ausland');
+--
+INSERT INTO gifi (accno, description) VALUES ('22', 'Forderungen gegenüber verbundenen Unternehmen und Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno, description) VALUES ('220-222', 'Forderungen gegenüber verbundenen Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('223', 'Einzelwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('224', 'Pauschalwertberichtigungen zu Forderungen gegenüber verbundenen Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('225-227', 'Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno, description) VALUES ('228', 'Einzelwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno, description) VALUES ('229', 'Pauschalwertberichtigungen zu Forderungen gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+--
+INSERT INTO gifi (accno, description) VALUES ('23-24', 'Sonstige Forderungen und Vermögensgegenstände');
+INSERT INTO gifi (accno, description) VALUES ('230-246', 'Sonstige Forderungen und Vermögensgegenstände');
+INSERT INTO gifi (accno, description) VALUES ('247', 'Eingeforderte, aber noch nicht eingezahlte Einlagen');
+INSERT INTO gifi (accno, description) VALUES ('248', 'Einzelwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen');
+INSERT INTO gifi (accno, description) VALUES ('249', 'Pauschalwertberichtigungen zu sonstigen Forderungen und Vermögensgegenständen');
+--
+INSERT INTO gifi (accno, description) VALUES ('25', 'Forderungen aus der Abgabenverrechnung');
+INSERT INTO gifi (accno, description) VALUES ('250-259', 'Forderungen aus der Abgabenverrechnung');
+--
+INSERT INTO gifi (accno, description) VALUES ('26', 'Wertpapiere und Anteile');
+INSERT INTO gifi (accno, description) VALUES ('260', 'Eigene Anteile');
+INSERT INTO gifi (accno, description) VALUES ('261', 'Anteile an verbundenen Unternehmen');
+INSERT INTO gifi (accno, description) VALUES ('262', 'Sonstige Anteile');
+INSERT INTO gifi (accno, description) VALUES ('263-267', 'Sonstige Wertpapiere');
+INSERT INTO gifi (accno, description) VALUES ('268', 'Besitzwechsel, soweit dem Unternehmen nicht die der Ausstellung zugrundeliegenden Forderungen zustehen');
+INSERT INTO gifi (accno, description) VALUES ('269', 'Wertberichtigungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('27-28', 'Kassenbestand, Schecks, Guthaben bei Kreditinstituten');
+INSERT INTO gifi (accno, description) VALUES ('270-272', 'Kassenbestände in Inlandswährung');
+INSERT INTO gifi (accno, description) VALUES ('273', 'Postwertzeichen');
+INSERT INTO gifi (accno, description) VALUES ('274', 'Stempelmarken');
+INSERT INTO gifi (accno, description) VALUES ('275-277', 'Kassenbestände in Fremdwährung');
+INSERT INTO gifi (accno, description) VALUES ('278', 'Schecks in Inlandswährung');
+INSERT INTO gifi (accno, description) VALUES ('280-288', 'Guthaben bei Kreditinstituten');
+INSERT INTO gifi (accno, description) VALUES ('289', 'Wertberichtigungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('29', 'Rechnungsabgrenzungsposten');
+INSERT INTO gifi (accno, description) VALUES ('290', 'Aktive Rechnungsabgrenzungsposten');
+INSERT INTO gifi (accno, description) VALUES ('295', 'Disagio');
+INSERT INTO gifi (accno, description) VALUES ('296', 'Unterschiedsbetrag zur gebotenen Pensionsrückstellung');
+INSERT INTO gifi (accno, description) VALUES ('297', 'Unterschiedsbetrag gem. Abschnitt XII Pensionskassengesetz');
+INSERT INTO gifi (accno, description) VALUES ('298', 'Steuerabgrenzung');
+--
+INSERT INTO gifi (accno, description) VALUES ('3', 'Rückstellungen, Verbindlichkeiten und Rechnungsabgrenzungsposten');
+--
+INSERT INTO gifi (accno, description) VALUES ('30', 'Rückstellungen');
+INSERT INTO gifi (accno, description) VALUES ('300', 'Rückstellungen für Abfertigungen');
+INSERT INTO gifi (accno, description) VALUES ('301', 'Rückstellungen für Pensionen');
+INSERT INTO gifi (accno, description) VALUES ('302-303', 'Steuerrückstellungen');
+INSERT INTO gifi (accno, description) VALUES ('304-309', 'Sonstige Rückstellungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('31', 'Anleihen, Verbindlichkeiten gegenüber Kreditinstituten und Finanzinstituten');
+INSERT INTO gifi (accno, description) VALUES ('310', 'Anleihen (einschließlich konvertibler)');
+INSERT INTO gifi (accno, description) VALUES ('311-317', 'Verbindlichkeiten gegenüber Kreditinstituten');
+INSERT INTO gifi (accno, description) VALUES ('318-319', 'Verbindlichkeiten gegenüber Finanzinstituten');
+--
+INSERT INTO gifi (accno, description) VALUES ('32', 'Erhaltene Anzahlungen auf Bestellungen');
+INSERT INTO gifi (accno, description) VALUES ('320', 'Erhaltene Anzahlungen auf Bestellungen');
+INSERT INTO gifi (accno, description) VALUES ('321', 'Umsatzsteuer-Evidenzkonto für erhaltene Anzahlungen auf Bestellungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('33', 'Verbindlichkeiten aus Lieferungen und Leistungen, Verbindlichkeiten aus der Annahme gezogener und der Ausstellung eigener Wechsel');
+INSERT INTO gifi (accno, description) VALUES ('330-335', 'Verbindlichkeiten aus Lieferungen und Leistungen Inland');
+INSERT INTO gifi (accno, description) VALUES ('336', 'Verbindlichkeiten aus Lieferungen und Leistungen Währungsunion');
+INSERT INTO gifi (accno, description) VALUES ('337', 'Verbindlichkeiten aus Lieferungen und Leistungen sonstiges Ausland');
+INSERT INTO gifi (accno, description) VALUES ('338-339', 'Verbindlichkeiten aus der Annahme gezogener Wechsel und der Ausstellung eigener Wechsel');
+--
+INSERT INTO gifi (accno, description) VALUES ('34', 'Verbindlichkeiten gegenüber verbundenen Unternehmen, gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht und gegenüber Gesellschaftern');
+INSERT INTO gifi (accno, description) VALUES ('340-347', 'Verbindlichkeiten gegenüber verbundenen Unternehmen, Verbindlichkeiten gegenüber Unternehmen, mit denen ein Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno, description) VALUES ('348', 'Verbindlichkeiten gegenüber Gesellschaftern');
+--
+INSERT INTO gifi (accno, description) VALUES ('35', 'Verbindlichkeiten aus Steuern');
+INSERT INTO gifi (accno, description) VALUES ('350-359', 'Verbindlichkeiten aus Steuern');
+--
+INSERT INTO gifi (accno, description) VALUES ('36', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit');
+INSERT INTO gifi (accno, description) VALUES ('360-369', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit');
+--
+INSERT INTO gifi (accno, description) VALUES ('37-38', 'Übrige sonstige Verbindlichkeiten');
+INSERT INTO gifi (accno, description) VALUES ('370-389', 'Übrige sonstige Verbindlichkeiten');
+--
+INSERT INTO gifi (accno, description) VALUES ('39', 'Rechnungsabgrenzungsposten');
+INSERT INTO gifi (accno, description) VALUES ('390-399', 'Passive Rechnungsabgrenzungsposten');
+--
+INSERT INTO gifi (accno, description) VALUES ('4', 'Betriebliche Erträge');
+--
+INSERT INTO gifi (accno, description) VALUES ('40-44', 'Brutto-Umsatzerlöse und Erlösschmälerungen');
+INSERT INTO gifi (accno, description) VALUES ('400-439', 'Brutto-Umsatzerlöse');
+INSERT INTO gifi (accno, description) VALUES ('440-449', 'Erlösschmälerungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('45', 'Bestandsveränderungen und aktivierte Eigenleistungen');
+INSERT INTO gifi (accno, description) VALUES ('450-457', 'Veränderungen des Bestandes an fertigen und unfertigen Erzeugnissen sowie an noch nicht abrechenbaren Leistungen');
+INSERT INTO gifi (accno, description) VALUES ('458-459', 'andere aktivierte Eigenleistungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('46-49', 'Sonstige betriebliche Erträge');
+INSERT INTO gifi (accno, description) VALUES ('460-462', 'Erlöse aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('463-465', 'Erträge aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('466-467', 'Erträge aus der Zuschreibung zum Anlagevermögen, ausgenommen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('470-479', 'Erträge aus der Auflösung von Rückstellungen');
+INSERT INTO gifi (accno, description) VALUES ('480-499', 'Übrige betriebliche Erträge');
+--
+INSERT INTO gifi (accno, description) VALUES ('5', 'Materialaufwand und sonstige bezogene Herstellungsleistungen');
+INSERT INTO gifi (accno, description) VALUES ('500-509', 'Wareneinsatz');
+INSERT INTO gifi (accno, description) VALUES ('510-519', 'Verbrauch von Rohstoffen');
+INSERT INTO gifi (accno, description) VALUES ('520-529', 'Verbrauch von bezogenen Fertig- und Einzelteilen');
+INSERT INTO gifi (accno, description) VALUES ('530-539', 'Verbrauch von Hilfsstoffen');
+INSERT INTO gifi (accno, description) VALUES ('540-549', 'Verbrauch von Betriebsstoffen');
+INSERT INTO gifi (accno, description) VALUES ('550-559', 'Verbrauch von Werkzeugen und anderen Erzeugungshilfsmitteln');
+INSERT INTO gifi (accno, description) VALUES ('560-569', 'Verbrauch von Brenn- und Treibstoffen, Energie und Wasser');
+INSERT INTO gifi (accno, description) VALUES ('570-579', 'Sonstige bezogene Herstellungsleistungen');
+INSERT INTO gifi (accno, description) VALUES ('580', 'Skontoerträge auf Materialaufwand');
+INSERT INTO gifi (accno, description) VALUES ('581', 'Skontoerträge auf sonstige bezogene Herstellungsleistungen');
+INSERT INTO gifi (accno, description) VALUES ('590', 'Aufwandsstellenrechnung');
+--
+INSERT INTO gifi (accno, description) VALUES ('6', 'Personalaufwand');
+INSERT INTO gifi (accno, description) VALUES ('600-619', 'Löhne');
+INSERT INTO gifi (accno, description) VALUES ('620-639', 'Gehälter');
+INSERT INTO gifi (accno, description) VALUES ('640-644', 'Aufwendungen für Abfertigungen');
+INSERT INTO gifi (accno, description) VALUES ('645-649', 'Aufwendungen für Altersversorgung');
+INSERT INTO gifi (accno, description) VALUES ('650-655', 'Gesetzlicher Sozialaufwand Arbeiter');
+INSERT INTO gifi (accno, description) VALUES ('656-659', 'Gesetzlicher Sozialaufwand Angestellte');
+INSERT INTO gifi (accno, description) VALUES ('660-665', 'Lohnabhängige Abgaben und Pflichtbeiträge');
+INSERT INTO gifi (accno, description) VALUES ('666-669', 'Gehaltsabhängige Abgaben und Pflichtbeiträge');
+INSERT INTO gifi (accno, description) VALUES ('670-689', 'Sonstige Sozialaufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('690', 'Aufwandsstellenrechnung');
+--
+INSERT INTO gifi (accno, description) VALUES ('7', 'Abschreibungen und sonstige betriebliche Aufwendunge');
+--
+INSERT INTO gifi (accno, description) VALUES ('70', 'Abschreibungen');
+INSERT INTO gifi (accno, description) VALUES ('700', 'Abschreibungen auf aktivierte Aufwendungen für das Ingangsetzen und Erweitern eines Betriebes');
+INSERT INTO gifi (accno, description) VALUES ('701-708', 'Abschreibungen auf das Anlagevermögen (ausgenommen Finanzanlagen)');
+INSERT INTO gifi (accno, description) VALUES ('709', 'Abschreibungen vom Umlaufvermögen, soweit diese die im Unternehmen üblichen Abschreibungen übersteigen');
+--
+INSERT INTO gifi (accno, description) VALUES ('71', 'Sonstige Steuern');
+INSERT INTO gifi (accno, description) VALUES ('710-719', 'Sonstige Steuern');
+--
+INSERT INTO gifi (accno, description) VALUES ('72-78', 'Übrige betriebliche Aufwendungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('72', 'Instandhaltung und Reinigung durch Dritte, Entsorgung, Beleuchtung');
+INSERT INTO gifi (accno, description) VALUES ('720-729', 'Instandhaltung und Reinigung durch Dritte, Entsorgung, Beleuchtung');
+--
+INSERT INTO gifi (accno, description) VALUES ('73', 'Transport-, Reise- und Fahrtaufwand, Nachrichtenaufwand');
+INSERT INTO gifi (accno, description) VALUES ('730-731', 'Transporte durch Dritte');
+INSERT INTO gifi (accno, description) VALUES ('732-733', 'Kfz-Aufwand');
+INSERT INTO gifi (accno, description) VALUES ('734-735', 'Reise- und Fahrtaufwand');
+INSERT INTO gifi (accno, description) VALUES ('736-737', 'Tag- und Nächtigungsgelder');
+INSERT INTO gifi (accno, description) VALUES ('738-739', 'Nachrichtenaufwand');
+--
+INSERT INTO gifi (accno, description) VALUES ('74', 'Miet-, Pacht-, Leasing- und Lizenzaufwand');
+INSERT INTO gifi (accno, description) VALUES ('740-743', 'Miet- und Pachtaufwand');
+INSERT INTO gifi (accno, description) VALUES ('744-747', 'Leasingaufwand');
+INSERT INTO gifi (accno, description) VALUES ('748-749', 'Lizenzaufwand');
+--
+INSERT INTO gifi (accno, description) VALUES ('75', 'Aufwand für beigestelltes Personal, Provisionen an Dritte, Aufsichtsratsvergütungen');
+INSERT INTO gifi (accno, description) VALUES ('750-753', 'Aufwand für beigestelltes Personal');
+INSERT INTO gifi (accno, description) VALUES ('754-757', 'Provisionen an Dritte');
+INSERT INTO gifi (accno, description) VALUES ('758-759', 'Aufsichtsratsvergütungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('76', 'Büro-, Werbe- und Repräsentationsaufwand');
+INSERT INTO gifi (accno, description) VALUES ('760', 'Büromaterial und Drucksorten');
+INSERT INTO gifi (accno, description) VALUES ('761-762', 'Druckerzeugnisse und Vervielfältigungen');
+INSERT INTO gifi (accno, description) VALUES ('763', 'Fachliteratur und Zeitungen');
+INSERT INTO gifi (accno, description) VALUES ('765-768', 'Werbung und Repräsentation');
+INSERT INTO gifi (accno, description) VALUES ('769', 'Spenden und Trinkgelder');
+--
+INSERT INTO gifi (accno, description) VALUES ('77-78', 'Versicherungen, Übrige Aufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('770-774', 'Versicherungen');
+INSERT INTO gifi (accno, description) VALUES ('775-776', 'Beratungs- und Prüfungsaufwand');
+INSERT INTO gifi (accno, description) VALUES ('777', 'Aus- und Fortbildung');
+INSERT INTO gifi (accno, description) VALUES ('778', 'Mitgliedsbeiträge');
+INSERT INTO gifi (accno, description) VALUES ('779', 'Spesen des Geldverkehrs');
+INSERT INTO gifi (accno, description) VALUES ('780-781', 'Schadensfälle');
+INSERT INTO gifi (accno, description) VALUES ('782', 'Buchwert abgegangener Anlagen, ausgenommen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('783', 'Verluste aus dem Abgang vom Anlagevermögen, ausgenommen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('784-788', 'Verschiedene betriebliche Aufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('789', 'Skontoerträge auf sonstige betriebliche Aufwendungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('79', 'Konten für das Umsatzkostenverfahren');
+INSERT INTO gifi (accno, description) VALUES ('790', 'Aufwandsstellenrechnung');
+INSERT INTO gifi (accno, description) VALUES ('791-799', 'Aufwandsstellen im Rahmen des Umsatzkostenverfahrens');
+INSERT INTO gifi (accno, description) VALUES ('791-795', 'Aufwandsstellen der Herstellung');
+INSERT INTO gifi (accno, description) VALUES ('796', 'Herstellungskosten der zur Erzielung der Umsatzerlöse erbrachten Leistungen');
+INSERT INTO gifi (accno, description) VALUES ('797', 'Vertriebskosten');
+INSERT INTO gifi (accno, description) VALUES ('798', 'Verwaltungskosten');
+INSERT INTO gifi (accno, description) VALUES ('799', 'Sonstige betriebliche Aufwendungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('8', 'Finanzerträge und Finanzaufwendungen, a.o. Erträge und a.o. Aufwendungen, Steuern vom Einkommen und vom Ertrag, Rücklagenbewegung');
+--
+INSERT INTO gifi (accno, description) VALUES ('80-83', 'Finanzerträge und Finanzaufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('800-804', 'Erträge aus Beteiligungen');
+INSERT INTO gifi (accno, description) VALUES ('805-809', 'Erträge aus anderen Wertpapieren und Ausleihungen des Finanzanlagevermögens');
+INSERT INTO gifi (accno, description) VALUES ('810-813', 'Sonstige Zinsen und ähnliche Erträge');
+INSERT INTO gifi (accno, description) VALUES ('814', 'Erlöse aus dem Abgang von Beteiligungen');
+INSERT INTO gifi (accno, description) VALUES ('815', 'Erlöse aus dem Abgang von sonstigen Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('816', 'Erlöse aus dem Abgang von Wertpapieren des Umlaufvermögens');
+INSERT INTO gifi (accno, description) VALUES ('817', 'Buchwert abgegangener Beteiligungen');
+INSERT INTO gifi (accno, description) VALUES ('818', 'Buchwert abgegangener sonstiger Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('819', 'Buchwert abgegangener Wertpapiere des Umlaufvermögens');
+INSERT INTO gifi (accno, description) VALUES ('820', 'Erträge aus dem Abgang von und der Zuschreibung zu Finanzanlagen');
+INSERT INTO gifi (accno, description) VALUES ('821', 'Erträge aus dem Abgang von und der Zuschreibung zu Wertpapieren des Umlaufvermögens');
+INSERT INTO gifi (accno, description) VALUES ('822-825', 'Aufwendungen aus Beteiligungen');
+INSERT INTO gifi (accno, description) VALUES ('826-827', 'Aufwendungen aus sonstigen Finanzanlagen und aus Wertpapieren des Umlaufvermögens');
+INSERT INTO gifi (accno, description) VALUES ('828-834', 'Zinsen und ähnliche Aufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('835', 'Nicht ausgenützte Lieferantenskonti');
+--
+INSERT INTO gifi (accno, description) VALUES ('84', 'Außerordentliche Erträge und außerordentliche Aufwendungen');
+INSERT INTO gifi (accno, description) VALUES ('840-844', 'Außerordentliche Erträge');
+INSERT INTO gifi (accno, description) VALUES ('845-849', 'Außerordentliche Aufwendungen');
+--
+INSERT INTO gifi (accno, description) VALUES ('85', 'Steuern vom Einkommen und vom Ertrag');
+INSERT INTO gifi (accno, description) VALUES ('850-859', 'Steuern vom Einkommen und vom Ertrag');
+--
+INSERT INTO gifi (accno, description) VALUES ('86-89', 'Rücklagenbewegung, Ergebnisüberrechnung');
+INSERT INTO gifi (accno, description) VALUES ('860-869', 'Auflösung unversteuerter Rücklagen');
+INSERT INTO gifi (accno, description) VALUES ('870-874', 'Auflösung von Kapitalrücklagen');
+INSERT INTO gifi (accno, description) VALUES ('875-879', 'Auflösung von Gewinnrücklagen');
+INSERT INTO gifi (accno, description) VALUES ('880-889', 'Zuweisung zu unversteuerten Rücklagen');
+INSERT INTO gifi (accno, description) VALUES ('890-895', 'Zuweisung zu Gewinnrücklagen');
+INSERT INTO gifi (accno, description) VALUES ('899', 'Gewinnabfuhr bzw. Verlustüberrechnung aus Ergebnisabführungsverträgen');
+--
+INSERT INTO gifi (accno, description) VALUES ('9', 'Eigenkapital, unversteuerte Rücklagen, Einlagen Stiller Gesellschafter, Abschluß- und Evidenzkonten');
+--
+INSERT INTO gifi (accno, description) VALUES ('900-918', 'Gezeichnetes bzw. gewidmetes Kapital');
+INSERT INTO gifi (accno, description) VALUES ('919', 'Nicht eingeforderte ausstehende Einlagen');
+INSERT INTO gifi (accno, description) VALUES ('920-929', 'Kapitalrücklagen');
+INSERT INTO gifi (accno, description) VALUES ('930-938', 'Gewinnrücklagen');
+INSERT INTO gifi (accno, description) VALUES ('939', 'Bilanzgewinn (-verlust)');
+INSERT INTO gifi (accno, description) VALUES ('940-959', 'Bewertungsreserven und sonstige unversteuerte Rücklagen');
+INSERT INTO gifi (accno, description) VALUES ('960-969', 'Privat- und Verrechnungskonten bei Einzelunternehmen und Personengesellschaften');
+INSERT INTO gifi (accno, description) VALUES ('970-979', 'Einlagen Stiller Gesellschafter');
+INSERT INTO gifi (accno, description) VALUES ('980', 'Eröffnungsbilanz');
+INSERT INTO gifi (accno, description) VALUES ('985', 'Schlußbilanz');
+INSERT INTO gifi (accno, description) VALUES ('989', 'Gewinn- und Verlustrechnung');
+INSERT INTO gifi (accno, description) VALUES ('990-999', 'Evidenzkonten');
diff --git a/sql-ledger/sql/Brazil_General-chart.sql b/sql-ledger/sql/Brazil_General-chart.sql
new file mode 100644
index 000000000..1c983e6ed
--- /dev/null
+++ b/sql-ledger/sql/Brazil_General-chart.sql
@@ -0,0 +1,70 @@
+-- General Brazilien Portuguese COA
+-- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','RECURSOS ATUAIS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1060','Checando Cliente','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','Caixa Baixo','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Contas a Receber','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','Provisão para devedors duvidosos','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','INVENTÁRIO DE CLIENTES','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Inventário / Geral','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Inventário / Mercado Secundário','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Inventário / Computer Parts','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','CAPITAL ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Escritório Móvel & Equipamentos','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','Accum. Amort. -Móvel. & Equip.','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','Veículo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','Accum. Amort. -Veículo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','BALANÇO ATUAL','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Contas a Pagar','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2170','Taxas federais','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','VAT (7%)','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2320','VAT (8%)','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2380','Contas a pagar de férias','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2400','DEDUÇÕES DE FOLHA DE PAGAMENTO','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2450','Imposto de Renda Devido','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','Passivi exigível a longo prazo','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Empréstimo bancário','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','Empréstimo de Acionistas','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','DIVISÃO DE CAPITAL','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','Divisão comum','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','VENDAS RECEITAS','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','Vendas Gerais','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Partes para mercado secundário','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Parte Computacional','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','CONSULTANDO FONTES DE RENDA','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Consultando','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Programando','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4340','Loja','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','OUTRAS RENDAS','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','Transporte & Taxa','A','','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','Juros Acumulados','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Ganho de câmbio estrangeiro','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','CUSTO DE VENDAS DE PRODUTOS','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','Compras','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5050','Mercado Secundário','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5060','Parte Computacional','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','Frete','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','DESPESAS E FOLHA DE PAGAMENTO','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Salários','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','GERAL E DESPESAS ADMINISTRATIVAS','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Contabilidade & Leis','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','Publicidade & Promoções','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Balanço','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','Amortização','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','Imposto de Renda','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','Seguro','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','Interesses & Encargos Bancários','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','Materiais de Escritório','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','Aluguel','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','Manutenção & Reparos','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','Telefone','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Cursos & Entretenimentos','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','Serviços Públicos','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Licenciamento para exportações','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Troca com Estrangeiro','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'R$:EUR:USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Canada-gifi.sql b/sql-ledger/sql/Canada-gifi.sql
new file mode 100644
index 000000000..fe9641c72
--- /dev/null
+++ b/sql-ledger/sql/Canada-gifi.sql
@@ -0,0 +1,754 @@
+-- GIFI codes as set by the Canadian Government
+-- It's a dirty job, but it seems somebody allready did it
+-- PDF Tammes, Tue , 02 Apr 2002
+-- remarks or questions to finance@bermuda-holding.com
+--
+-- From the GIFI documentation:
+--
+-- The GIFI information has to balance. We use the following rules to verify the information you provide.
+-- total assets = total liabilities + total shareholder equity
+-- total revenue - total expenses = net non-farming income
+-- total farm revenue - total farm expenses = net farm income
+--
+-- You have to provide certain line items so that we can verify the above equations. Each GIFI must include:
+-- balance sheet
+-- Item 2599 Total assets
+-- Item 3499 Total liabilities
+-- Item 3620 Total shareholder equity
+-- non-farming income and expenses
+-- Item 8299 Total revenue
+-- Item 9368 Total expenses
+-- and/or
+-- farming income and expenses
+-- Item 9659 Total farm revenue
+-- Item 9898 Total farm expenses
+-- when reporting a breakdown of retained earnings
+-- Item 3849 Retained earnings/deficit end
+-- extraordinary items and income taxes
+-- Item 9999 Net income/loss after taxes and extraordinary items
+-- If the amount of a required item is NIL, you have to enter 0.
+--
+INSERT INTO gifi (accno,description) VALUES ('1000', 'Cash & Deposits');
+INSERT INTO gifi (accno,description) VALUES ('1001', 'Cash');
+INSERT INTO gifi (accno,description) VALUES ('1002', 'Deposits In Canadian Banks And Institutions - Canadian Currency');
+INSERT INTO gifi (accno,description) VALUES ('1003', 'Deposits In Canadian Banks And Institutions - Foreign Currency');
+INSERT INTO gifi (accno,description) VALUES ('1004', 'Deposits In Foreign Banks - Canadian Currency');
+INSERT INTO gifi (accno,description) VALUES ('1005', 'Deposits In Foreign Banks - Foreign Currency');
+INSERT INTO gifi (accno,description) VALUES ('1006', 'Credit Union Central Deposits');
+INSERT INTO gifi (accno,description) VALUES ('1007', 'Other Cash Like Instruments - Gold Bullion, Silver Bullion');
+INSERT INTO gifi (accno,description) VALUES ('1060', 'Accounts Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1061', 'Allowance For Doubtfull Accounts Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1062', 'Trade Accounts Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1063', 'Allowance For Doubtfull Trade Accounts Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1064', 'Trade Accounts Receivable Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1065', 'Allowance For Doubtfull Trade Accounts Receivable Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1066', 'Taxes Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1067', 'Intrest Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1068', 'Holdbacks Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1069', 'Leases Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1070', 'Allowance For Doubtfull Leases Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1071', 'Accounts Receivable Employees');
+INSERT INTO gifi (accno,description) VALUES ('1072', 'Allowance For Doubtfull Accounts Receivable Employees');
+INSERT INTO gifi (accno,description) VALUES ('1073', 'Accounts Receivable From Members Of NPO');
+INSERT INTO gifi (accno,description) VALUES ('1120', 'Inventories');
+INSERT INTO gifi (accno,description) VALUES ('1121', 'Inventory Of Goods For Sale/Finished Goods');
+INSERT INTO gifi (accno,description) VALUES ('1122', 'Inventory Of Parts And Supplies');
+INSERT INTO gifi (accno,description) VALUES ('1125', 'Work In Progress');
+INSERT INTO gifi (accno,description) VALUES ('1126', 'Raw Materials');
+INSERT INTO gifi (accno,description) VALUES ('1180', 'Short Term Investments');
+INSERT INTO gifi (accno,description) VALUES ('1181', 'Canadian Term Deposits');
+INSERT INTO gifi (accno,description) VALUES ('1182', 'Canadian Shares');
+INSERT INTO gifi (accno,description) VALUES ('1183', 'Canadian Bonds');
+INSERT INTO gifi (accno,description) VALUES ('1184', 'Canadian Treasury Bills');
+INSERT INTO gifi (accno,description) VALUES ('1185', 'Securities Purchased Under Resale Agreement');
+INSERT INTO gifi (accno,description) VALUES ('1186', 'Other Short Term Canadian Investments');
+INSERT INTO gifi (accno,description) VALUES ('1187', 'Short Term Foreign Investments');
+INSERT INTO gifi (accno,description) VALUES ('1240', 'Loans & Notes Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1241', 'Demand Loans Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1242', 'Other Loans Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1243', 'Notes Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1244', 'Mortgages Receivable');
+INSERT INTO gifi (accno,description) VALUES ('1300', 'Due From Shareholder(s)/Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('1301', 'Due From Individual Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('1302', 'Due From Corporate Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('1303', 'Due From Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('1360', 'Investment In Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('1380', 'Due From Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('1400', 'Due From/Investment In Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1401', 'Demand Notes From Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1402', 'Interest Receivable From Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1403', 'Loans/Advances Due From Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('1480', 'Other Current Assets');
+INSERT INTO gifi (accno,description) VALUES ('1481', 'Deferred Income Taxes');
+INSERT INTO gifi (accno,description) VALUES ('1482', 'Accrued Investment Income');
+INSERT INTO gifi (accno,description) VALUES ('1483', 'Taxes Recoverable/Refundable');
+INSERT INTO gifi (accno,description) VALUES ('1484', 'Prepaid Expenses');
+INSERT INTO gifi (accno,description) VALUES ('1485', 'Drilling Advances');
+INSERT INTO gifi (accno,description) VALUES ('1486', 'Security Deposits');
+INSERT INTO gifi (accno,description) VALUES ('1599', 'Total Current Assets');
+INSERT INTO gifi (accno,description) VALUES ('1600', 'Land');
+INSERT INTO gifi (accno,description) VALUES ('1601', 'Land Improvement');
+INSERT INTO gifi (accno,description) VALUES ('1602', 'Accumulated Amortization Of Land & Land Improvement');
+INSERT INTO gifi (accno,description) VALUES ('1620', 'Depletable Assets');
+INSERT INTO gifi (accno,description) VALUES ('1621', 'Accumulated Amortization Of Depletable Assets');
+INSERT INTO gifi (accno,description) VALUES ('1622', 'Petroleum & Natural Gas Properties');
+INSERT INTO gifi (accno,description) VALUES ('1623', 'Accumulated Amortization Of Petroleum & Natural Gas Properties');
+INSERT INTO gifi (accno,description) VALUES ('1624', 'Mining Properties');
+INSERT INTO gifi (accno,description) VALUES ('1625', 'Accumulated Amortization Of Mining Properties');
+INSERT INTO gifi (accno,description) VALUES ('1626', 'Deferred Exporation & Development charges');
+INSERT INTO gifi (accno,description) VALUES ('1627', 'Accumulated Amortization Of Petroleum & Deferred Exporation & Development charges');
+INSERT INTO gifi (accno,description) VALUES ('1628', 'Quarries');
+INSERT INTO gifi (accno,description) VALUES ('1629', 'Accumulated Amortization Of Quarries');
+INSERT INTO gifi (accno,description) VALUES ('1630', 'Gravel Pits');
+INSERT INTO gifi (accno,description) VALUES ('1631', 'Accumulated Amortization Of Gravel Pits');
+INSERT INTO gifi (accno,description) VALUES ('1632', 'Timber Limits');
+INSERT INTO gifi (accno,description) VALUES ('1633', 'Accumulated Amortization Of Timber Limits');
+INSERT INTO gifi (accno,description) VALUES ('1680', 'Buildings');
+INSERT INTO gifi (accno,description) VALUES ('1681', 'Accumulated Amortization Of Buildings');
+INSERT INTO gifi (accno,description) VALUES ('1682', 'Manufacturing And Processing Plant');
+INSERT INTO gifi (accno,description) VALUES ('1683', 'Accumulated Amortization Of Manufacturing and Processing Plant');
+INSERT INTO gifi (accno,description) VALUES ('1684', 'Buildings Under Construction');
+INSERT INTO gifi (accno,description) VALUES ('1740', 'Machinery, Equipment, furniture & fixtures');
+INSERT INTO gifi (accno,description) VALUES ('1741', 'Accumulated Amortization Of Machinery, Equipment, furniture & fixtures');
+INSERT INTO gifi (accno,description) VALUES ('1742', 'Motor Vehicles');
+INSERT INTO gifi (accno,description) VALUES ('1743', 'Accumulated Amortization Of Motor Vehicles');
+INSERT INTO gifi (accno,description) VALUES ('1744', 'Tools and Dies');
+INSERT INTO gifi (accno,description) VALUES ('1745', 'Accumulated Amortization Of Tools and Dies');
+INSERT INTO gifi (accno,description) VALUES ('1746', 'Construction & Excavating Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1747', 'Accumulated Amortization Of Construction & Excavating Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1748', 'Forestry & Logging Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1749', 'Accumulated Amortization Of Forestry & Logging Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1750', 'Fishing Gear & Nets');
+INSERT INTO gifi (accno,description) VALUES ('1751', 'Accumulated Amortization Of Fishing Gear & Nets');
+INSERT INTO gifi (accno,description) VALUES ('1752', 'Mining Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1753', 'Accumulated Amortization Of Mining Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1754', 'Oil & Gas Systems');
+INSERT INTO gifi (accno,description) VALUES ('1755', 'Accumulated Amortization Of Oil & Gas Systems');
+INSERT INTO gifi (accno,description) VALUES ('1756', 'Production Equipment for resource industries');
+INSERT INTO gifi (accno,description) VALUES ('1757', 'Accumulated Amortization Of Production Equipment for resource industries');
+INSERT INTO gifi (accno,description) VALUES ('1758', 'Production Equipment for other industries');
+INSERT INTO gifi (accno,description) VALUES ('1759', 'Accumulated Amortization Of Production Equipment for other industries');
+INSERT INTO gifi (accno,description) VALUES ('1760', 'Exploration Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1761', 'Accumulated Amortization Of Exploration Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1762', 'Shipping Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1763', 'Accumulated Amortization Of Shipping Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1764', 'Ships & Boats');
+INSERT INTO gifi (accno,description) VALUES ('1765', 'Accumulated Amortization Of Ships & Boats');
+INSERT INTO gifi (accno,description) VALUES ('1766', 'Aircraft');
+INSERT INTO gifi (accno,description) VALUES ('1767', 'Accumulated Amortization Of Aircraft');
+INSERT INTO gifi (accno,description) VALUES ('1768', 'Signs');
+INSERT INTO gifi (accno,description) VALUES ('1769', 'Accumulated Amortization Of Signs');
+INSERT INTO gifi (accno,description) VALUES ('1770', 'Small Tools');
+INSERT INTO gifi (accno,description) VALUES ('1771', 'Accumulated Amortization Of Small Tools');
+INSERT INTO gifi (accno,description) VALUES ('1772', 'Radio & Communication Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1773', 'Accumulated Amortization Of Radio & Communication Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1774', 'Computer Equipment/Software');
+INSERT INTO gifi (accno,description) VALUES ('1775', 'Accumulated Amortization Of Computer Equipment/software');
+INSERT INTO gifi (accno,description) VALUES ('1776', 'Musical Instruments');
+INSERT INTO gifi (accno,description) VALUES ('1777', 'Accumulated Amortization Of Musical Instruments');
+INSERT INTO gifi (accno,description) VALUES ('1778', 'Satellites');
+INSERT INTO gifi (accno,description) VALUES ('1779', 'Accumulated Amortization Of Satellites');
+INSERT INTO gifi (accno,description) VALUES ('1780', 'Earth Stations');
+INSERT INTO gifi (accno,description) VALUES ('1781', 'Accumulated Amortization Of Earth Stations');
+INSERT INTO gifi (accno,description) VALUES ('1782', 'Machinery & Equipment Under Construction');
+INSERT INTO gifi (accno,description) VALUES ('1783', 'Transportation Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1784', 'Accumulated Amortization Of Transportation Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1785', 'Other Machinery & Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1786', 'Accumulated Amortization Of Other Machinery & Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1787', 'Furniture & Fixtures');
+INSERT INTO gifi (accno,description) VALUES ('1788', 'Accumulated Amortization Of Furniture & Fixtures');
+INSERT INTO gifi (accno,description) VALUES ('1900', 'Other Tangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('1901', 'Accumulated Amortization Of Other Tangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('1902', 'Logging Roads');
+INSERT INTO gifi (accno,description) VALUES ('1903', 'Accumulated Amortization Of Logging Roads');
+INSERT INTO gifi (accno,description) VALUES ('1904', 'Asphalt & Parking Areas');
+INSERT INTO gifi (accno,description) VALUES ('1905', 'Accumulated Amortization Of Asphalt & Parking Areas');
+INSERT INTO gifi (accno,description) VALUES ('1906', 'Wharves, Docks & Marinas');
+INSERT INTO gifi (accno,description) VALUES ('1907', 'Accumulated Amortization Of Wharves, Docks & Marinas');
+INSERT INTO gifi (accno,description) VALUES ('1908', 'Fences');
+INSERT INTO gifi (accno,description) VALUES ('1909', 'Accumulated Amortization Of Fences');
+INSERT INTO gifi (accno,description) VALUES ('1910', 'Capital Leases - Buildings');
+INSERT INTO gifi (accno,description) VALUES ('1911', 'Accumulated Amortization Of Capital Leases - Buildings');
+INSERT INTO gifi (accno,description) VALUES ('1912', 'Capital Leases - Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1913', 'Accumulated Amortization Of Capital Leases - Equipment');
+INSERT INTO gifi (accno,description) VALUES ('1914', 'Capital Leases - Vehicles');
+INSERT INTO gifi (accno,description) VALUES ('1915', 'Accumulated Amortization Of Capital Leases - Vehicles');
+INSERT INTO gifi (accno,description) VALUES ('1916', 'Capital Leases - Other');
+INSERT INTO gifi (accno,description) VALUES ('1917', 'Accumulated Amortization Of Capital Leases - Other');
+INSERT INTO gifi (accno,description) VALUES ('1918', 'Leasehold Improvements');
+INSERT INTO gifi (accno,description) VALUES ('1919', 'Accumulated Amortization Of Leasehold Improvements');
+INSERT INTO gifi (accno,description) VALUES ('1920', 'Other Capital Assets Under Construction');
+INSERT INTO gifi (accno,description) VALUES ('1921', 'Campsites');
+INSERT INTO gifi (accno,description) VALUES ('1922', 'Accumulated Amortization Of Campsites');
+INSERT INTO gifi (accno,description) VALUES ('2008', 'Total Tangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('2009', 'Total Accumulated Amortization Of Tangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('2010', 'Intangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('2011', 'Accumulated Amortization Of Intangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('2012', 'Goodwill');
+INSERT INTO gifi (accno,description) VALUES ('2013', 'Accumulated Amortization Of Goodwill');
+INSERT INTO gifi (accno,description) VALUES ('2014', 'Quota');
+INSERT INTO gifi (accno,description) VALUES ('2015', 'Accumulated Amortization Of Quota');
+INSERT INTO gifi (accno,description) VALUES ('2016', 'Licences');
+INSERT INTO gifi (accno,description) VALUES ('2017', 'Accumulated Amortization Of Licences');
+INSERT INTO gifi (accno,description) VALUES ('2018', 'Incorporation Costs');
+INSERT INTO gifi (accno,description) VALUES ('2019', 'Accumulated Amortization Of Incorporation Costs');
+INSERT INTO gifi (accno,description) VALUES ('2020', 'Trademarks & Patents');
+INSERT INTO gifi (accno,description) VALUES ('2021', 'Accumulated Amortization Of Trademarks & Patents');
+INSERT INTO gifi (accno,description) VALUES ('2022', 'Customer Lists');
+INSERT INTO gifi (accno,description) VALUES ('2023', 'Accumulated Amortization Of Customer Lists');
+INSERT INTO gifi (accno,description) VALUES ('2024', 'Rights');
+INSERT INTO gifi (accno,description) VALUES ('2025', 'Accumulated Amortization Of Rights');
+INSERT INTO gifi (accno,description) VALUES ('2026', 'Research & Development');
+INSERT INTO gifi (accno,description) VALUES ('2027', 'Accumulated Amortization Of Research & Development');
+INSERT INTO gifi (accno,description) VALUES ('2070', 'Resource Rights');
+INSERT INTO gifi (accno,description) VALUES ('2071', 'Accumulated Amortization Of Resource Rights');
+INSERT INTO gifi (accno,description) VALUES ('2072', 'Timber Rights');
+INSERT INTO gifi (accno,description) VALUES ('2073', 'Accumulated Amortization Of Timber Rights');
+INSERT INTO gifi (accno,description) VALUES ('2074', 'Mining Rights');
+INSERT INTO gifi (accno,description) VALUES ('2075', 'Accumulated Amortization Of Mining Rights');
+INSERT INTO gifi (accno,description) VALUES ('2076', 'Oil & Gas Rights');
+INSERT INTO gifi (accno,description) VALUES ('2077', 'Accumulated Amortization Of Oil & Gas Rights');
+INSERT INTO gifi (accno,description) VALUES ('2078', 'Total Intangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('2079', 'Total Accumulated Amortization Of Intangible Capital Assets');
+INSERT INTO gifi (accno,description) VALUES ('2180', 'Long Term Due From Shareholder(s)/Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('2181', 'Long Term Due From Individual Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('2182', 'Long Term Due From Corporate Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('2183', 'Long Term Due From Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('2200', 'Long Term Investment In Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('2220', 'Long Term Due From Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('2240', 'Long Term Due From/Investment In Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2241', 'Due From/Investment In Canadian Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2242', 'Shares In Canadian Related Corporations');
+INSERT INTO gifi (accno,description) VALUES ('2243', 'Loans/Advances To Canadian Related Corporations');
+INSERT INTO gifi (accno,description) VALUES ('2244', 'Investment In Canadian Related Corporations At Cost');
+INSERT INTO gifi (accno,description) VALUES ('2245', 'Investment In Canadian Related Corporations At Equity');
+INSERT INTO gifi (accno,description) VALUES ('2246', 'Due From/Investment In Foreign Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2247', 'Shares In Foreign Related Corporations');
+INSERT INTO gifi (accno,description) VALUES ('2248', 'Loans/Advances To Foreign Related Corporations');
+INSERT INTO gifi (accno,description) VALUES ('2249', 'Investment In Foreign Related Corporations At Cost');
+INSERT INTO gifi (accno,description) VALUES ('2250', 'Investment In Foreign Related Corporations At Equity');
+INSERT INTO gifi (accno,description) VALUES ('2280', 'Investment In Co-Tenancy');
+INSERT INTO gifi (accno,description) VALUES ('2300', 'Long Term Investments');
+INSERT INTO gifi (accno,description) VALUES ('2301', 'Foreign Shares');
+INSERT INTO gifi (accno,description) VALUES ('2302', 'Other Type Of Foreign Investments');
+INSERT INTO gifi (accno,description) VALUES ('2303', 'Canadian Shares');
+INSERT INTO gifi (accno,description) VALUES ('2304', 'Government Of Canada Debt');
+INSERT INTO gifi (accno,description) VALUES ('2305', 'Canadian Provinvial & Municipal Government Debt');
+INSERT INTO gifi (accno,description) VALUES ('2306', 'Canadian Corporate Bonds & Debentures');
+INSERT INTO gifi (accno,description) VALUES ('2307', 'Debt Securities');
+INSERT INTO gifi (accno,description) VALUES ('2308', 'Equity Securities');
+INSERT INTO gifi (accno,description) VALUES ('2309', 'Securities Purchased Under Resale Agreements');
+INSERT INTO gifi (accno,description) VALUES ('2310', 'Central Credit Union Shares');
+INSERT INTO gifi (accno,description) VALUES ('2311', 'Other Long Term Canadian Investments');
+INSERT INTO gifi (accno,description) VALUES ('2360', 'Long Term Loans');
+INSERT INTO gifi (accno,description) VALUES ('2361', 'Mortgages');
+INSERT INTO gifi (accno,description) VALUES ('2362', 'Personal & Credit Card Loans');
+INSERT INTO gifi (accno,description) VALUES ('2363', 'Business & Government Loans');
+INSERT INTO gifi (accno,description) VALUES ('2364', 'Line Of Credit');
+INSERT INTO gifi (accno,description) VALUES ('2420', 'Other Long Term Assets');
+INSERT INTO gifi (accno,description) VALUES ('2421', 'Deferred Income Taxes / Tax Reserves');
+INSERT INTO gifi (accno,description) VALUES ('2422', 'Deferred Pension Charges');
+INSERT INTO gifi (accno,description) VALUES ('2423', 'Deferred Unrealized Exchange Losses');
+INSERT INTO gifi (accno,description) VALUES ('2424', 'Other Deferred Items/Charges');
+INSERT INTO gifi (accno,description) VALUES ('2425', 'Accumulated Amortization Of Deferred Charges');
+INSERT INTO gifi (accno,description) VALUES ('2426', 'Reserve Fund');
+INSERT INTO gifi (accno,description) VALUES ('2427', 'Cash Surrender Value Of Life Insurance');
+INSERT INTO gifi (accno,description) VALUES ('2589', 'Total Long Term Assets');
+INSERT INTO gifi (accno,description) VALUES ('2590', 'Assets Held In Trust');
+INSERT INTO gifi (accno,description) VALUES ('2599', 'Total Assets');
+INSERT INTO gifi (accno,description) VALUES ('2600', 'Bank Overdraft');
+INSERT INTO gifi (accno,description) VALUES ('2620', 'Amounts Payable & Accrued Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('2621', 'Accounts Payable Trade');
+INSERT INTO gifi (accno,description) VALUES ('2622', 'Accounts Payable To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2623', 'Holdbacks Payable');
+INSERT INTO gifi (accno,description) VALUES ('2624', 'Wages Payable');
+INSERT INTO gifi (accno,description) VALUES ('2625', 'Management Fees Payable');
+INSERT INTO gifi (accno,description) VALUES ('2626', 'Bonuses Payable');
+INSERT INTO gifi (accno,description) VALUES ('2627', 'Employee Deductions Payable');
+INSERT INTO gifi (accno,description) VALUES ('2628', 'Withholding Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2629', 'Intrest Payable');
+INSERT INTO gifi (accno,description) VALUES ('2680', 'Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2681', 'Capital Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2682', 'Foreign Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2683', 'Federal Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2684', 'Provincial Taxes Payable');
+INSERT INTO gifi (accno,description) VALUES ('2685', 'GST Payable');
+INSERT INTO gifi (accno,description) VALUES ('2686', 'PST Payable');
+INSERT INTO gifi (accno,description) VALUES ('2700', 'Short Term Debt');
+INSERT INTO gifi (accno,description) VALUES ('2701', 'Loans From Canadian Banks');
+INSERT INTO gifi (accno,description) VALUES ('2702', 'Liability For Securities Sold Short');
+INSERT INTO gifi (accno,description) VALUES ('2703', 'Liability For Securities Sold Under Repurchase Agreements');
+INSERT INTO gifi (accno,description) VALUES ('2704', 'Gold & Silver Certificates');
+INSERT INTO gifi (accno,description) VALUES ('2705', 'Cheques & Other Items In Transit');
+INSERT INTO gifi (accno,description) VALUES ('2706', 'Lien Notes');
+INSERT INTO gifi (accno,description) VALUES ('2770', 'Deferred Income');
+INSERT INTO gifi (accno,description) VALUES ('2780', 'Due To Shareholder(s)/Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('2781', 'Due To Individual Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('2782', 'Due To Corporate Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('2783', 'Due To Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('2840', 'Due To Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('2860', 'Due To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2861', 'Demand Notes Due To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2862', 'Interest Payable To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2863', 'Advances Due To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('2920', 'Current Portion Of Long Term Liability');
+INSERT INTO gifi (accno,description) VALUES ('2960', 'Other Current Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('2961', 'Deposits Received');
+INSERT INTO gifi (accno,description) VALUES ('2962', 'Dividends Payable');
+INSERT INTO gifi (accno,description) VALUES ('2963', 'Deferred Income Taxes');
+INSERT INTO gifi (accno,description) VALUES ('2964', 'Reserves For Guarantees, Warranties Or Indemnities');
+INSERT INTO gifi (accno,description) VALUES ('2965', 'General Reserves / Provisions');
+INSERT INTO gifi (accno,description) VALUES ('2966', 'Crew Shares');
+INSERT INTO gifi (accno,description) VALUES ('3139', 'Total Current Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('3140', 'Long Term Debt');
+INSERT INTO gifi (accno,description) VALUES ('3141', 'Mortgages');
+INSERT INTO gifi (accno,description) VALUES ('3142', 'Farm Credit Corporation Loan');
+INSERT INTO gifi (accno,description) VALUES ('3143', 'Chartered Bank Loan');
+INSERT INTO gifi (accno,description) VALUES ('3144', 'Credit Union/Caisse Populaire Loan');
+INSERT INTO gifi (accno,description) VALUES ('3145', 'Provincial Government Loan');
+INSERT INTO gifi (accno,description) VALUES ('3146', 'Supply Company Loan');
+INSERT INTO gifi (accno,description) VALUES ('3147', 'Private Loan');
+INSERT INTO gifi (accno,description) VALUES ('3148', 'Central, Leagues And Federation Loans');
+INSERT INTO gifi (accno,description) VALUES ('3149', 'Line Of Credit');
+INSERT INTO gifi (accno,description) VALUES ('3150', 'Liability For Securities Sold Short');
+INSERT INTO gifi (accno,description) VALUES ('3151', 'Liability For Securities Sold Under Repurchase Agreements');
+INSERT INTO gifi (accno,description) VALUES ('3152', 'Lien Notes');
+INSERT INTO gifi (accno,description) VALUES ('3210', 'Bonds And Debentures');
+INSERT INTO gifi (accno,description) VALUES ('3220', 'Deferred Income');
+INSERT INTO gifi (accno,description) VALUES ('3240', 'Deferred Income Taxes');
+INSERT INTO gifi (accno,description) VALUES ('3260', 'Long Term Due To Shareholder(s)/Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('3261', 'Long Term Due To Individual Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('3262', 'Long Term Due To Corporate Shareholder(s)');
+INSERT INTO gifi (accno,description) VALUES ('3263', 'Long Term Due To Director(s)');
+INSERT INTO gifi (accno,description) VALUES ('3280', 'Long Term Due To Joint Venture(s)/Partnership(s)');
+INSERT INTO gifi (accno,description) VALUES ('3300', 'Long Term Due To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('3301', 'Amounts Owing To Related Canadian Parties');
+INSERT INTO gifi (accno,description) VALUES ('3302', 'Amounts Owing To Related Foreign Parties');
+INSERT INTO gifi (accno,description) VALUES ('3320', 'Other Long Term Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('3321', 'Long Term Obligations/Commitments/Leases');
+INSERT INTO gifi (accno,description) VALUES ('3322', 'Reserves For Guarantees, Warranties Or Indemnities');
+INSERT INTO gifi (accno,description) VALUES ('3323', 'Provision For Site Restoration');
+INSERT INTO gifi (accno,description) VALUES ('3324', 'Contributions To Qualifying Environmental Trust');
+INSERT INTO gifi (accno,description) VALUES ('3325', 'General Provisions / Reserves');
+INSERT INTO gifi (accno,description) VALUES ('3326', 'Preference Shares Restated');
+INSERT INTO gifi (accno,description) VALUES ('3327', 'Member Allocations');
+INSERT INTO gifi (accno,description) VALUES ('3328', 'Deferred Income From Incomplete Contracts');
+INSERT INTO gifi (accno,description) VALUES ('3450', 'Total Long Term Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('3460', 'Subordinated Debt');
+INSERT INTO gifi (accno,description) VALUES ('3470', 'Amounts Held In Trust');
+INSERT INTO gifi (accno,description) VALUES ('3499', 'Total Liabilities');
+INSERT INTO gifi (accno,description) VALUES ('3500', 'Common Shares');
+INSERT INTO gifi (accno,description) VALUES ('3520', 'Preferred Shares');
+INSERT INTO gifi (accno,description) VALUES ('3540', 'Contributed & Other Surplus');
+INSERT INTO gifi (accno,description) VALUES ('3541', 'Contributed Surplus');
+INSERT INTO gifi (accno,description) VALUES ('3542', 'Appraisal Surplus');
+INSERT INTO gifi (accno,description) VALUES ('3543', 'General Reserve');
+INSERT INTO gifi (accno,description) VALUES ('3570', 'Head Office Account');
+INSERT INTO gifi (accno,description) VALUES ('3600', 'Retained Earnings/Deficit');
+INSERT INTO gifi (accno,description) VALUES ('3620', 'Total Shareholder Equity');
+INSERT INTO gifi (accno,description) VALUES ('3640', 'Total Liabilities & Shareholder Equity');
+INSERT INTO gifi (accno,description) VALUES ('3660', 'Retained Earnings/Deficit Start');
+INSERT INTO gifi (accno,description) VALUES ('3680', 'Net Income/Loss');
+INSERT INTO gifi (accno,description) VALUES ('3700', 'Dividend Declared');
+INSERT INTO gifi (accno,description) VALUES ('3701', 'Cash Dividend');
+INSERT INTO gifi (accno,description) VALUES ('3702', 'Patronage Dividend');
+INSERT INTO gifi (accno,description) VALUES ('3720', 'Prior Year Adjustments');
+INSERT INTO gifi (accno,description) VALUES ('3740', 'Other Items Affecting Retained Earnings');
+INSERT INTO gifi (accno,description) VALUES ('3741', 'Share Redemptions');
+INSERT INTO gifi (accno,description) VALUES ('3742', 'Special Reserves');
+INSERT INTO gifi (accno,description) VALUES ('3743', 'Currency Adjustments');
+INSERT INTO gifi (accno,description) VALUES ('3744', 'Unusual Revenue Items');
+INSERT INTO gifi (accno,description) VALUES ('3745', 'Interfund Transfers (NPO)');
+INSERT INTO gifi (accno,description) VALUES ('3849', 'Retained Earnings/Deficit End');
+INSERT INTO gifi (accno,description) VALUES ('8000', 'Trade Sales of Goods and Services');
+INSERT INTO gifi (accno,description) VALUES ('8020', 'Sales To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('8030', 'Interdivisional Sales');
+INSERT INTO gifi (accno,description) VALUES ('8040', 'Sales From Resource Properties');
+INSERT INTO gifi (accno,description) VALUES ('8041', 'Petroleum & Natural Gas Sales');
+INSERT INTO gifi (accno,description) VALUES ('8042', 'Petroleum & Natural Gas Sales To Related Parties');
+INSERT INTO gifi (accno,description) VALUES ('8043', 'Gas Marketing');
+INSERT INTO gifi (accno,description) VALUES ('8044', 'Processing Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8045', 'Pipeline Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8046', 'Seismic Sales');
+INSERT INTO gifi (accno,description) VALUES ('8047', 'Mining Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8048', 'Coal Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8049', 'Oil Sands Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8050', 'Royalty Income');
+INSERT INTO gifi (accno,description) VALUES ('8051', 'Oil & Gas Partnership/Joint Venture Income/Loss');
+INSERT INTO gifi (accno,description) VALUES ('8052', 'Mining Partnership/Joint Venture Income/Loss');
+INSERT INTO gifi (accno,description) VALUES ('8053', 'Other Production Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8089', 'Total Sales Of Goods And Services');
+INSERT INTO gifi (accno,description) VALUES ('8090', 'Investment Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8091', 'Interest From Foreign Sources');
+INSERT INTO gifi (accno,description) VALUES ('8092', 'Interest From Canadian Bonds And Debentures');
+INSERT INTO gifi (accno,description) VALUES ('8093', 'Interest From Canadian Mortgage Loans');
+INSERT INTO gifi (accno,description) VALUES ('8094', 'Interest From Other Canadian Sources');
+INSERT INTO gifi (accno,description) VALUES ('8095', 'Dividend Income');
+INSERT INTO gifi (accno,description) VALUES ('8096', 'Dividend From Canadian Sources');
+INSERT INTO gifi (accno,description) VALUES ('8097', 'Interest From Foreign Sources');
+INSERT INTO gifi (accno,description) VALUES ('8120', 'Commission Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8121', 'Commission Income On Real Estate Transactions');
+INSERT INTO gifi (accno,description) VALUES ('8140', 'Rental Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8141', 'Real Estate Rental Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8150', 'Vehicle Leasing');
+INSERT INTO gifi (accno,description) VALUES ('8160', 'Fishing Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8161', 'Fish Products');
+INSERT INTO gifi (accno,description) VALUES ('8162', 'Other Marine Products');
+INSERT INTO gifi (accno,description) VALUES ('8163', 'Fishing Grants, Credits & Rebates');
+INSERT INTO gifi (accno,description) VALUES ('8164', 'Fishing Subsidies');
+INSERT INTO gifi (accno,description) VALUES ('8165', 'Compensation For Loss Of Fishing Income/Property');
+INSERT INTO gifi (accno,description) VALUES ('8166', 'Sharesman Income');
+INSERT INTO gifi (accno,description) VALUES ('8210', 'Realized Gains/Losses On Disposal Of Assets');
+INSERT INTO gifi (accno,description) VALUES ('8211', 'Realized Gains/Losses On Sale Of Investments');
+INSERT INTO gifi (accno,description) VALUES ('8212', 'Realized Gains/Losses On Sale Of Resource Properties');
+INSERT INTO gifi (accno,description) VALUES ('8220', 'NPO Amounts Received');
+INSERT INTO gifi (accno,description) VALUES ('8221', 'Membership Fees');
+INSERT INTO gifi (accno,description) VALUES ('8222', 'Assessments');
+INSERT INTO gifi (accno,description) VALUES ('8223', 'Gifts');
+INSERT INTO gifi (accno,description) VALUES ('8224', 'Gross Sales And Revenues From Organizational Activities');
+INSERT INTO gifi (accno,description) VALUES ('8230', 'Other Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8231', 'Foreign Exchange Gains/Losses');
+INSERT INTO gifi (accno,description) VALUES ('8232', 'Income/Loss Of Subsidiaries/Affiliates');
+INSERT INTO gifi (accno,description) VALUES ('8233', 'Income/Loss Of Other Divisions');
+INSERT INTO gifi (accno,description) VALUES ('8234', 'Income/Loss Of Joint Ventures');
+INSERT INTO gifi (accno,description) VALUES ('8235', 'Income/Loss Of Partnerships');
+INSERT INTO gifi (accno,description) VALUES ('8236', 'RealizaTion Of Deferred Revenues');
+INSERT INTO gifi (accno,description) VALUES ('8237', 'Royalty Income Other Than Resource');
+INSERT INTO gifi (accno,description) VALUES ('8238', 'Alberta Royalty Tax Credits');
+INSERT INTO gifi (accno,description) VALUES ('8239', 'Management & Administration Fees');
+INSERT INTO gifi (accno,description) VALUES ('8240', 'Telecommunications Revenues');
+INSERT INTO gifi (accno,description) VALUES ('8241', 'Consulting Fees');
+INSERT INTO gifi (accno,description) VALUES ('8242', 'Subsidies & Grants');
+INSERT INTO gifi (accno,description) VALUES ('8243', 'Sale Of By-Products');
+INSERT INTO gifi (accno,description) VALUES ('8244', 'Deposit Services');
+INSERT INTO gifi (accno,description) VALUES ('8245', 'Credit Services');
+INSERT INTO gifi (accno,description) VALUES ('8246', 'Card Services');
+INSERT INTO gifi (accno,description) VALUES ('8247', 'Patronage Dividends');
+INSERT INTO gifi (accno,description) VALUES ('8248', 'Insurance Recoveries');
+INSERT INTO gifi (accno,description) VALUES ('8249', 'Expense Recoveries');
+INSERT INTO gifi (accno,description) VALUES ('8250', 'Bad Debt Recoveries');
+INSERT INTO gifi (accno,description) VALUES ('8299', 'Total Revenue');
+INSERT INTO gifi (accno,description) VALUES ('8300', 'Opening Inventory');
+INSERT INTO gifi (accno,description) VALUES ('8301', 'Opening Inventory - finished goods');
+INSERT INTO gifi (accno,description) VALUES ('8302', 'Opening Inventory - raw materials');
+INSERT INTO gifi (accno,description) VALUES ('8303', 'Opening Inventory - goods in process');
+INSERT INTO gifi (accno,description) VALUES ('8304', 'Opening Inventory - work in process');
+INSERT INTO gifi (accno,description) VALUES ('8320', 'Purchases / Cost of Materials');
+INSERT INTO gifi (accno,description) VALUES ('8321', 'Purchases Product A');
+INSERT INTO gifi (accno,description) VALUES ('8322', 'Purchases Product B');
+INSERT INTO gifi (accno,description) VALUES ('8331', 'Price Differences & Discounts On Purchases');
+INSERT INTO gifi (accno,description) VALUES ('8340', 'Direct Wages');
+INSERT INTO gifi (accno,description) VALUES ('8350', 'Benefits On Direct Wages');
+INSERT INTO gifi (accno,description) VALUES ('8360', 'Trades & Sub-contracts');
+INSERT INTO gifi (accno,description) VALUES ('8370', 'Production Costs Other Than Resource');
+INSERT INTO gifi (accno,description) VALUES ('8400', 'Resource Production Costs');
+INSERT INTO gifi (accno,description) VALUES ('8401', 'Pipeline Operations');
+INSERT INTO gifi (accno,description) VALUES ('8402', 'Drilling');
+INSERT INTO gifi (accno,description) VALUES ('8403', 'Site Restoration Costs');
+INSERT INTO gifi (accno,description) VALUES ('8404', 'Gross Overriding Royalty');
+INSERT INTO gifi (accno,description) VALUES ('8405', 'Freehold Royalties');
+INSERT INTO gifi (accno,description) VALUES ('8406', 'Other Producing Properties Rental');
+INSERT INTO gifi (accno,description) VALUES ('8407', 'Prospect & Geological');
+INSERT INTO gifi (accno,description) VALUES ('8408', 'Well Operating, Fuel & Equipment');
+INSERT INTO gifi (accno,description) VALUES ('8409', 'Well Abandonment & Dry Holes');
+INSERT INTO gifi (accno,description) VALUES ('8410', 'Other Lease Rentals');
+INSERT INTO gifi (accno,description) VALUES ('8411', 'Exploration Expenses, Aerial Surveys');
+INSERT INTO gifi (accno,description) VALUES ('8412', 'Development Expenses, stripping costs');
+INSERT INTO gifi (accno,description) VALUES ('8435', 'Crown Charges');
+INSERT INTO gifi (accno,description) VALUES ('8436', 'Crown royalties');
+INSERT INTO gifi (accno,description) VALUES ('8437', 'Crown lease rentals');
+INSERT INTO gifi (accno,description) VALUES ('8438', 'Freehold mineral tax');
+INSERT INTO gifi (accno,description) VALUES ('8439', 'Mining taxes');
+INSERT INTO gifi (accno,description) VALUES ('8440', 'Oil and Sand leases');
+INSERT INTO gifi (accno,description) VALUES ('8441', 'Saskatchewan resource surcharge');
+INSERT INTO gifi (accno,description) VALUES ('8450', 'Other Direct Costs');
+INSERT INTO gifi (accno,description) VALUES ('8451', 'Equipment Hire & Operation');
+INSERT INTO gifi (accno,description) VALUES ('8452', 'Log Yard');
+INSERT INTO gifi (accno,description) VALUES ('8453', 'Forestry costs');
+INSERT INTO gifi (accno,description) VALUES ('8454', 'Logging Road costs');
+INSERT INTO gifi (accno,description) VALUES ('8455', 'Stumpage costs');
+INSERT INTO gifi (accno,description) VALUES ('8456', 'Royalty costs');
+INSERT INTO gifi (accno,description) VALUES ('8457', 'Freight In & Customs Duty');
+INSERT INTO gifi (accno,description) VALUES ('8458', 'Inventory Write Down');
+INSERT INTO gifi (accno,description) VALUES ('8459', 'Direct cost amortization of tangible assets');
+INSERT INTO gifi (accno,description) VALUES ('8460', 'Direct cost amortization of natural resource assets');
+INSERT INTO gifi (accno,description) VALUES ('8461', 'Overhead expenses allocated to cost of sales');
+INSERT INTO gifi (accno,description) VALUES ('8500', 'Closing Inventory');
+INSERT INTO gifi (accno,description) VALUES ('8501', 'Closing Inventory - Finished Goods');
+INSERT INTO gifi (accno,description) VALUES ('8502', 'Closing Inventory - Raw Materials');
+INSERT INTO gifi (accno,description) VALUES ('8503', 'Closing Inventory - Goods In Process');
+INSERT INTO gifi (accno,description) VALUES ('8504', 'Closing Inventory - Work In Process');
+INSERT INTO gifi (accno,description) VALUES ('8518', 'Cost Of Sales');
+INSERT INTO gifi (accno,description) VALUES ('8519', 'Gross Profit/Loss');
+INSERT INTO gifi (accno,description) VALUES ('8520', 'Advertising & Promotion');
+INSERT INTO gifi (accno,description) VALUES ('8521', 'Advertising');
+INSERT INTO gifi (accno,description) VALUES ('8522', 'Donations');
+INSERT INTO gifi (accno,description) VALUES ('8523', 'Meals & Entertainment');
+INSERT INTO gifi (accno,description) VALUES ('8524', 'Promotion');
+INSERT INTO gifi (accno,description) VALUES ('8570', 'Amortization Of Intangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('8590', 'Bad Debt Expense');
+INSERT INTO gifi (accno,description) VALUES ('8610', 'Loan Losses');
+INSERT INTO gifi (accno,description) VALUES ('8611', 'Provision for Loan Losses');
+INSERT INTO gifi (accno,description) VALUES ('8620', 'Employee Benefits');
+INSERT INTO gifi (accno,description) VALUES ('8621', 'Group Insurance Benefits');
+INSERT INTO gifi (accno,description) VALUES ('8622', 'Employers Portion Of Employee Benefits');
+INSERT INTO gifi (accno,description) VALUES ('8623', 'Contributions To Deferred Income Plans');
+INSERT INTO gifi (accno,description) VALUES ('8650', 'Amortization Of Natural Resource Assets');
+INSERT INTO gifi (accno,description) VALUES ('8670', 'Amortization Of Tangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('8690', 'Insurance');
+INSERT INTO gifi (accno,description) VALUES ('8691', 'Life Insurance On Executives');
+INSERT INTO gifi (accno,description) VALUES ('8710', 'Interest & Bank Charges');
+INSERT INTO gifi (accno,description) VALUES ('8711', 'Interest On Short Term Debt');
+INSERT INTO gifi (accno,description) VALUES ('8712', 'Interest On Bonds And Debentures');
+INSERT INTO gifi (accno,description) VALUES ('8713', 'Interest On Mortgages');
+INSERT INTO gifi (accno,description) VALUES ('8714', 'Interest On Long Term Debt');
+INSERT INTO gifi (accno,description) VALUES ('8715', 'Bank Charges');
+INSERT INTO gifi (accno,description) VALUES ('8716', 'Credit Card Charges');
+INSERT INTO gifi (accno,description) VALUES ('8717', 'Collection & Credit costs');
+INSERT INTO gifi (accno,description) VALUES ('8760', 'Business Taxes, Licences & Memberships');
+INSERT INTO gifi (accno,description) VALUES ('8761', 'Memberships');
+INSERT INTO gifi (accno,description) VALUES ('8762', 'Business Taxes');
+INSERT INTO gifi (accno,description) VALUES ('8763', 'Franchise Fees');
+INSERT INTO gifi (accno,description) VALUES ('8764', 'Government Fees');
+INSERT INTO gifi (accno,description) VALUES ('8780', 'New Brunswick Tax On Large Corporations');
+INSERT INTO gifi (accno,description) VALUES ('8790', 'Nova Scotia Tax On Large Corporations');
+INSERT INTO gifi (accno,description) VALUES ('8810', 'Office Expenses');
+INSERT INTO gifi (accno,description) VALUES ('8811', 'Office Stationary And Supplies');
+INSERT INTO gifi (accno,description) VALUES ('8812', 'Office Utilities');
+INSERT INTO gifi (accno,description) VALUES ('8813', 'Data Processing');
+INSERT INTO gifi (accno,description) VALUES ('8860', 'Professional Fees');
+INSERT INTO gifi (accno,description) VALUES ('8861', 'Legal Fees');
+INSERT INTO gifi (accno,description) VALUES ('8862', 'Accounting Fees');
+INSERT INTO gifi (accno,description) VALUES ('8863', 'Consulting Fees');
+INSERT INTO gifi (accno,description) VALUES ('8864', 'Architect Fees');
+INSERT INTO gifi (accno,description) VALUES ('8865', 'Appraisal Fees');
+INSERT INTO gifi (accno,description) VALUES ('8866', 'Laboratory Fees');
+INSERT INTO gifi (accno,description) VALUES ('8867', 'Medical Fees');
+INSERT INTO gifi (accno,description) VALUES ('8868', 'Veterinary Fees');
+INSERT INTO gifi (accno,description) VALUES ('8869', 'Brokerage Fees');
+INSERT INTO gifi (accno,description) VALUES ('8870', 'Transfer Fees');
+INSERT INTO gifi (accno,description) VALUES ('8871', 'Management & Administration Fees');
+INSERT INTO gifi (accno,description) VALUES ('8872', 'Refining & Assay');
+INSERT INTO gifi (accno,description) VALUES ('8873', 'Registrar & Transfer Agent Fees');
+INSERT INTO gifi (accno,description) VALUES ('8874', 'Restructuring Costs');
+INSERT INTO gifi (accno,description) VALUES ('8875', 'Security & Exchange Commission Fees');
+INSERT INTO gifi (accno,description) VALUES ('8876', 'Training Expense');
+INSERT INTO gifi (accno,description) VALUES ('8877', 'Studio & Recording');
+INSERT INTO gifi (accno,description) VALUES ('8910', 'Rental');
+INSERT INTO gifi (accno,description) VALUES ('8911', 'Real Estate Rental');
+INSERT INTO gifi (accno,description) VALUES ('8912', 'Occupancy Costs');
+INSERT INTO gifi (accno,description) VALUES ('8913', 'Condominium Fees');
+INSERT INTO gifi (accno,description) VALUES ('8914', 'Equipment Rental');
+INSERT INTO gifi (accno,description) VALUES ('8915', 'Motor Vehicle Rental');
+INSERT INTO gifi (accno,description) VALUES ('8916', 'Moorage (Boat)');
+INSERT INTO gifi (accno,description) VALUES ('8917', 'Storage');
+INSERT INTO gifi (accno,description) VALUES ('8918', 'Quota Rental');
+INSERT INTO gifi (accno,description) VALUES ('8960', 'Repairs & Maintenance - Aircraft');
+INSERT INTO gifi (accno,description) VALUES ('8961', 'Repairs & Maintenance - Buildings');
+INSERT INTO gifi (accno,description) VALUES ('8962', 'Repairs & Maintenance - Vehicles');
+INSERT INTO gifi (accno,description) VALUES ('8963', 'Repairs & Maintenance - Boats');
+INSERT INTO gifi (accno,description) VALUES ('8964', 'Repairs & Maintenance - Machinery & Equipment');
+INSERT INTO gifi (accno,description) VALUES ('9010', 'Other Repairs & Maintenance - Janitor & Yard');
+INSERT INTO gifi (accno,description) VALUES ('9011', 'Machine Shop Expense');
+INSERT INTO gifi (accno,description) VALUES ('9012', 'Road Costs');
+INSERT INTO gifi (accno,description) VALUES ('9013', 'Security');
+INSERT INTO gifi (accno,description) VALUES ('9014', 'Garbage Removal');
+INSERT INTO gifi (accno,description) VALUES ('9060', 'Salaries & Wages');
+INSERT INTO gifi (accno,description) VALUES ('9061', 'Commissions');
+INSERT INTO gifi (accno,description) VALUES ('9062', 'Crew Share');
+INSERT INTO gifi (accno,description) VALUES ('9063', 'Bonuses');
+INSERT INTO gifi (accno,description) VALUES ('9064', 'Director''s Fees');
+INSERT INTO gifi (accno,description) VALUES ('9065', 'Management Salaries');
+INSERT INTO gifi (accno,description) VALUES ('9066', 'Employee Salaries');
+INSERT INTO gifi (accno,description) VALUES ('9110', 'Sub-Contracts');
+INSERT INTO gifi (accno,description) VALUES ('9130', 'Supplies');
+INSERT INTO gifi (accno,description) VALUES ('9131', 'Small Tools');
+INSERT INTO gifi (accno,description) VALUES ('9132', 'Shop Expense');
+INSERT INTO gifi (accno,description) VALUES ('9133', 'Uniforms');
+INSERT INTO gifi (accno,description) VALUES ('9134', 'Laundry');
+INSERT INTO gifi (accno,description) VALUES ('9135', 'Food & Catering');
+INSERT INTO gifi (accno,description) VALUES ('9136', 'Fishing Gear');
+INSERT INTO gifi (accno,description) VALUES ('9137', 'Nets & Traps');
+INSERT INTO gifi (accno,description) VALUES ('9138', 'Salt, Bait & Ice');
+INSERT INTO gifi (accno,description) VALUES ('9139', 'Camp Supplies');
+INSERT INTO gifi (accno,description) VALUES ('9150', 'Computer Related Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9151', 'Upgrade');
+INSERT INTO gifi (accno,description) VALUES ('9152', 'Internet');
+INSERT INTO gifi (accno,description) VALUES ('9180', 'Property Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9200', 'Travel Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9201', 'Meetings & Conventions');
+INSERT INTO gifi (accno,description) VALUES ('9220', 'Utilities');
+INSERT INTO gifi (accno,description) VALUES ('9221', 'Electricity');
+INSERT INTO gifi (accno,description) VALUES ('9222', 'Water');
+INSERT INTO gifi (accno,description) VALUES ('9223', 'Heat');
+INSERT INTO gifi (accno,description) VALUES ('9224', 'Fuel Costs');
+INSERT INTO gifi (accno,description) VALUES ('9225', 'Telephone & Communications');
+INSERT INTO gifi (accno,description) VALUES ('9270', 'Other Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9271', 'Cash Over/Short');
+INSERT INTO gifi (accno,description) VALUES ('9272', 'Reimbursement Of Parent Company Expense');
+INSERT INTO gifi (accno,description) VALUES ('9273', 'Selling Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9274', 'Shipping & Warehouse Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9275', 'Delivery, Freight & Express');
+INSERT INTO gifi (accno,description) VALUES ('9276', 'Warranty Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9277', 'Royalty Expenses - Resident');
+INSERT INTO gifi (accno,description) VALUES ('9278', 'Royalty Expenses - Non-Resident');
+INSERT INTO gifi (accno,description) VALUES ('9279', 'Dumping Charges');
+INSERT INTO gifi (accno,description) VALUES ('9280', 'Land Fill Fees');
+INSERT INTO gifi (accno,description) VALUES ('9281', 'Vehicle Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9282', 'Research & Development');
+INSERT INTO gifi (accno,description) VALUES ('9283', 'Withholding Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9284', 'General & Administrative Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9285', 'Interdivisional Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9286', 'Interfund Transfer (NPO)');
+INSERT INTO gifi (accno,description) VALUES ('9367', 'Total Operating Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9368', 'Total Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9369', 'Net Non-Farming Income');
+INSERT INTO gifi (accno,description) VALUES ('9370', 'Grains And Oilseeds');
+INSERT INTO gifi (accno,description) VALUES ('9371', 'Wheat');
+INSERT INTO gifi (accno,description) VALUES ('9372', 'Oats');
+INSERT INTO gifi (accno,description) VALUES ('9373', 'Barley');
+INSERT INTO gifi (accno,description) VALUES ('9374', 'Mixed Grains');
+INSERT INTO gifi (accno,description) VALUES ('9375', 'Corn');
+INSERT INTO gifi (accno,description) VALUES ('9376', 'Canola');
+INSERT INTO gifi (accno,description) VALUES ('9377', 'Flaxseed');
+INSERT INTO gifi (accno,description) VALUES ('9378', 'Soya Beans');
+INSERT INTO gifi (accno,description) VALUES ('9379', 'Wheat Board Payments');
+INSERT INTO gifi (accno,description) VALUES ('9420', 'Other Crop Revenues');
+INSERT INTO gifi (accno,description) VALUES ('9321', 'Fruit');
+INSERT INTO gifi (accno,description) VALUES ('9322', 'Potatoes');
+INSERT INTO gifi (accno,description) VALUES ('9323', 'Vegetables');
+INSERT INTO gifi (accno,description) VALUES ('9324', 'Tobacco');
+INSERT INTO gifi (accno,description) VALUES ('9325', 'Greenhouse & Nursery Products');
+INSERT INTO gifi (accno,description) VALUES ('9326', 'Forage Crops');
+INSERT INTO gifi (accno,description) VALUES ('9470', 'Livestock & Animal Products Revenue');
+INSERT INTO gifi (accno,description) VALUES ('9471', 'Cattle');
+INSERT INTO gifi (accno,description) VALUES ('9472', 'Swine');
+INSERT INTO gifi (accno,description) VALUES ('9473', 'Poultry');
+INSERT INTO gifi (accno,description) VALUES ('9474', 'Sheep & Lambs');
+INSERT INTO gifi (accno,description) VALUES ('9475', 'Pregnant Mare Urine (PMU)');
+INSERT INTO gifi (accno,description) VALUES ('9476', 'Milk & Cream - Excluding Dairy Subsidies');
+INSERT INTO gifi (accno,description) VALUES ('9477', 'Eggs For Consumption');
+INSERT INTO gifi (accno,description) VALUES ('9478', 'Hatching Eggs');
+INSERT INTO gifi (accno,description) VALUES ('9479', 'Aquaculture');
+INSERT INTO gifi (accno,description) VALUES ('9480', 'Horses - Breeding & Meat');
+INSERT INTO gifi (accno,description) VALUES ('9520', 'Other Commodities');
+INSERT INTO gifi (accno,description) VALUES ('9521', 'Maple Products');
+INSERT INTO gifi (accno,description) VALUES ('9522', 'Artificial Insemination (AI)');
+INSERT INTO gifi (accno,description) VALUES ('9523', 'Semen Production');
+INSERT INTO gifi (accno,description) VALUES ('9524', 'Embryo Production');
+INSERT INTO gifi (accno,description) VALUES ('9540', 'Program Payment Revenues');
+INSERT INTO gifi (accno,description) VALUES ('9541', 'Dairy Subsidies');
+INSERT INTO gifi (accno,description) VALUES ('9542', 'Crop Insurance');
+INSERT INTO gifi (accno,description) VALUES ('9543', 'NISA Payments');
+INSERT INTO gifi (accno,description) VALUES ('9544', 'Disaster Assistance Program Payments');
+INSERT INTO gifi (accno,description) VALUES ('9570', 'Rebates');
+INSERT INTO gifi (accno,description) VALUES ('9571', 'Rebates - Fuel');
+INSERT INTO gifi (accno,description) VALUES ('9572', 'Rebates - Interest');
+INSERT INTO gifi (accno,description) VALUES ('9573', 'Rebates - Property Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9574', 'Resales, Rebates, GST For NISA Eligible Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9575', 'Rebates, GST For NISA Non-Eligible Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9600', 'Other Farm Revenues/Losses');
+INSERT INTO gifi (accno,description) VALUES ('9601', 'Custom Or Contract Work');
+INSERT INTO gifi (accno,description) VALUES ('9602', 'Wood Sales');
+INSERT INTO gifi (accno,description) VALUES ('9603', 'Horse Racing');
+INSERT INTO gifi (accno,description) VALUES ('9604', 'Insurance Proceeds');
+INSERT INTO gifi (accno,description) VALUES ('9605', 'Patronage Dividends');
+INSERT INTO gifi (accno,description) VALUES ('9606', 'Rental Income');
+INSERT INTO gifi (accno,description) VALUES ('9607', 'Interest Income');
+INSERT INTO gifi (accno,description) VALUES ('9608', 'Dividend Income');
+INSERT INTO gifi (accno,description) VALUES ('9609', 'Gains/Losses On Disposal Of Assets');
+INSERT INTO gifi (accno,description) VALUES ('9610', 'Gravel');
+INSERT INTO gifi (accno,description) VALUES ('9611', 'Trucking');
+INSERT INTO gifi (accno,description) VALUES ('9612', 'Resale Of Commodities Purchased');
+INSERT INTO gifi (accno,description) VALUES ('9613', 'Leases');
+INSERT INTO gifi (accno,description) VALUES ('9614', 'Machine Rentals');
+INSERT INTO gifi (accno,description) VALUES ('9615', 'Farming Partnership Income/Loss');
+INSERT INTO gifi (accno,description) VALUES ('9616', 'Farming Joint Venture Income/Loss');
+INSERT INTO gifi (accno,description) VALUES ('9650', 'Non-Farming Income');
+INSERT INTO gifi (accno,description) VALUES ('9659', 'Total Farm Revenue');
+INSERT INTO gifi (accno,description) VALUES ('9660', 'Crop Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9661', 'Containers, Twine And Baling Wire');
+INSERT INTO gifi (accno,description) VALUES ('9662', 'Fertilizers And Lime');
+INSERT INTO gifi (accno,description) VALUES ('9663', 'Pesticides');
+INSERT INTO gifi (accno,description) VALUES ('9664', 'Seeds & Plants');
+INSERT INTO gifi (accno,description) VALUES ('9665', 'Insurance Premiums (Crop) NISA ACS');
+INSERT INTO gifi (accno,description) VALUES ('9710', 'Livestock Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9711', 'Feed, Supplements, Straw & Bedding');
+INSERT INTO gifi (accno,description) VALUES ('9712', 'Livestock Purchases');
+INSERT INTO gifi (accno,description) VALUES ('9713', 'Veterinary Fees, Medicine & Breeding Fees');
+INSERT INTO gifi (accno,description) VALUES ('9760', 'Machinery Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9761', 'Machinery Insurance');
+INSERT INTO gifi (accno,description) VALUES ('9762', 'Machinery Licences');
+INSERT INTO gifi (accno,description) VALUES ('9763', 'Machinery Repairs');
+INSERT INTO gifi (accno,description) VALUES ('9764', 'Machinery Fuel');
+INSERT INTO gifi (accno,description) VALUES ('9765', 'Machinery Lease');
+INSERT INTO gifi (accno,description) VALUES ('9790', 'General Farm Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9791', 'Amortization Of Tangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('9792', 'Advertising, Marketing Costs & Promotion');
+INSERT INTO gifi (accno,description) VALUES ('9793', 'Bad Debt');
+INSERT INTO gifi (accno,description) VALUES ('9794', 'Benefits Related To Employee Salaries');
+INSERT INTO gifi (accno,description) VALUES ('9795', 'Building Repairs & Maintenance');
+INSERT INTO gifi (accno,description) VALUES ('9796', 'Clearing, Levelling & Draining Land');
+INSERT INTO gifi (accno,description) VALUES ('9797', 'Crop Insurance, GRIP and Stabilization Premiums');
+INSERT INTO gifi (accno,description) VALUES ('9798', 'Custom Or Contract Work');
+INSERT INTO gifi (accno,description) VALUES ('9799', 'Electricity');
+INSERT INTO gifi (accno,description) VALUES ('9800', 'Fence Repairs & Maintenance');
+INSERT INTO gifi (accno,description) VALUES ('9801', 'Freight & Trucking');
+INSERT INTO gifi (accno,description) VALUES ('9802', 'Heating Fuel & Curing Fuel');
+INSERT INTO gifi (accno,description) VALUES ('9803', 'Insurance Program Overpayment Recapture');
+INSERT INTO gifi (accno,description) VALUES ('9804', 'Other Insurance Premiums');
+INSERT INTO gifi (accno,description) VALUES ('9805', 'Interest & Bank Charges');
+INSERT INTO gifi (accno,description) VALUES ('9806', 'Marketing Board Fees');
+INSERT INTO gifi (accno,description) VALUES ('9807', 'Membership/Subscription Fees');
+INSERT INTO gifi (accno,description) VALUES ('9808', 'Office Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9809', 'Professional Fees');
+INSERT INTO gifi (accno,description) VALUES ('9810', 'Property Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9811', 'Rent - Land & Buildings');
+INSERT INTO gifi (accno,description) VALUES ('9812', 'Rent - Machinery');
+INSERT INTO gifi (accno,description) VALUES ('9813', 'Other Rental Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9814', 'Salaries & Wages');
+INSERT INTO gifi (accno,description) VALUES ('9815', 'Salaries & Wages Other Than Spouse Or Dependants');
+INSERT INTO gifi (accno,description) VALUES ('9816', 'Salaries & Wages Paid To Dependants');
+INSERT INTO gifi (accno,description) VALUES ('9817', 'Selling Costs');
+INSERT INTO gifi (accno,description) VALUES ('9818', 'Supplies');
+INSERT INTO gifi (accno,description) VALUES ('9819', 'Motor Vehicle Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9820', 'Small Tools');
+INSERT INTO gifi (accno,description) VALUES ('9821', 'Soil Testing');
+INSERT INTO gifi (accno,description) VALUES ('9822', 'Storage/Drying');
+INSERT INTO gifi (accno,description) VALUES ('9823', 'Licences/Permits');
+INSERT INTO gifi (accno,description) VALUES ('9824', 'Telephone');
+INSERT INTO gifi (accno,description) VALUES ('9825', 'Quota Rental');
+INSERT INTO gifi (accno,description) VALUES ('9826', 'Gravel');
+INSERT INTO gifi (accno,description) VALUES ('9827', 'Purchases Of Commodities Resold');
+INSERT INTO gifi (accno,description) VALUES ('9828', 'Salaries & Wages Paid To Spouse');
+INSERT INTO gifi (accno,description) VALUES ('9829', 'Motor Vehicle Interest And Leasing Costs');
+INSERT INTO gifi (accno,description) VALUES ('9830', 'Prepared Feed');
+INSERT INTO gifi (accno,description) VALUES ('9831', 'Custom Feed');
+INSERT INTO gifi (accno,description) VALUES ('9832', 'Amortization Of Intangible Assets');
+INSERT INTO gifi (accno,description) VALUES ('9833', 'Amortization Of Milk Quota');
+INSERT INTO gifi (accno,description) VALUES ('9834', 'Travel Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9835', 'Capital/Business Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9850', 'Non-Farming Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9870', 'Net Inventory Adjustment');
+INSERT INTO gifi (accno,description) VALUES ('9898', 'Total Farm Expenses');
+INSERT INTO gifi (accno,description) VALUES ('9899', 'Net Farm Income');
+INSERT INTO gifi (accno,description) VALUES ('9970', 'Net Income/Loss Before Taxes And Extraordinary Items');
+INSERT INTO gifi (accno,description) VALUES ('9975', 'Extraordinary Items');
+INSERT INTO gifi (accno,description) VALUES ('9976', 'Legal Settlements');
+INSERT INTO gifi (accno,description) VALUES ('9980', 'Unrealized Gains/Losses');
+INSERT INTO gifi (accno,description) VALUES ('9985', 'Unusual Items');
+INSERT INTO gifi (accno,description) VALUES ('9990', 'Current Income Taxes');
+INSERT INTO gifi (accno,description) VALUES ('9995', 'Deferred Income Tax Provision');
+INSERT INTO gifi (accno,description) VALUES ('9999', 'Net Income/Loss After Taxes And Extraordinary Items');
+-- This item represents the net amount of:
+-- Item 9970 - Net income/loss before taxes and extraordinary items minus
+-- Item 9975 - Extraordinary item(s) minus
+-- Item 9976 - Legal settlements plus
+-- Item 9980 - Unrealized gains/losses minus
+-- Item 9985 - Unusual items minus
+-- Item 9990 - Current income taxes minus
+-- Item 9995 - Deferred income tax provision
+-- and must be reported.
+-- Any amount reported in this item should be equal to the amount reported at Item 3680 - Net income/loss,
+-- in the retained earnings section.
+--
diff --git a/sql-ledger/sql/Canada_General-chart.sql b/sql-ledger/sql/Canada_General-chart.sql
new file mode 100644
index 000000000..a0b9e7f37
--- /dev/null
+++ b/sql-ledger/sql/Canada_General-chart.sql
@@ -0,0 +1,77 @@
+-- General Canadian COA
+-- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','CURRENT ASSETS','H','1000','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1060','Chequing Account','A','1002','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','Petty Cash','A','1001','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Accounts Receivables','A','1060','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','Allowance for doubtful accounts','A','1063','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','INVENTORY ASSETS','H','1120','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Inventory / General','A','1122','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Inventory / Aftermarket Parts','A','1122','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Inventory / Computer Parts','A','1122','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','CAPITAL ASSETS','H','1900','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Office Furniture & Equipment','A','1787','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','Accum. Amort. -Furn. & Equip.','A','1788','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','Vehicle','A','1742','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','Accum. Amort. -Vehicle','A','1743','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','CURRENT LIABILITIES','H','2620','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Accounts Payable','A','2621','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','Federal Taxes Payable','A','2683','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2170','Provincial Taxes Payable','A','2684','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','GST','A','2685','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2320','PST','A','2686','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2380','Vacation Pay Payable','A','2624','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2390','WCB Payable','A','2627','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2400','PAYROLL DEDUCTIONS','H','2620','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2410','EI Payable','A','2627','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2420','CPP Payable','A','2627','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2450','Income Tax Payable','A','2628','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','LONG TERM LIABILITIES','H','3140','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Bank Loans','A','2701','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','Loans from Shareholders','A','2780','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','SHARE CAPITAL','H','3500','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','Common Shares','A','3500','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','SALES REVENUE','H','8000','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','General Sales','A','8000','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Aftermarket Parts','A','8000','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Computer Parts','A','8000','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','CONSULTING REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Consulting','A','8241','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Programming','A','8000','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4340','Shop Labour','A','8000','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','OTHER REVENUE','H','8090','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','Shipping & Handling','A','8457','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','Interest','A','8090','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','8231','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','COST OF GOODS SOLD','H','8515','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','Purchases','A','8320','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5050','Aftermarket Parts','A','8320','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5060','Computer Parts','A','8320','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','Freight','A','8457','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','PAYROLL EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Wages & Salaries','A','9060','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','EI Expense','A','8622','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5430','CPP Expense','A','8622','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5440','WCB Expense','A','8622','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','GENERAL & ADMINISTRATIVE EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Accounting & Legal','A','8862','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','Advertising & Promotions','A','8520','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Bad Debts','A','8590','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','Amortization Expense','A','8670','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','Income Taxes','A','9990','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','Insurance','A','9804','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','Interest & Bank Charges','A','9805','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','Office Supplies','A','8811','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','Rent','A','9811','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','Repair & Maintenance','A','8964','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','Telephone','A','9225','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Travel & Entertainment','A','8523','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','Utilities','A','8812','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Licenses','A','8760','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','8231','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.08);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'CAD:USD:EUR', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Czech_Republic-chart.sql b/sql-ledger/sql/Czech_Republic-chart.sql
new file mode 100644
index 000000000..c43fed4d3
--- /dev/null
+++ b/sql-ledger/sql/Czech_Republic-chart.sql
@@ -0,0 +1,317 @@
+-- Czech chart of accounts
+-- Tomas.Fencl@centrum.cz
+-- Kompletní úètová osnova platná v roce 2001
+-- Osnova má 2 místa pro tvorbu analytik
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000', 'Dlouhodobý nehmotný majetek','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1100', 'Zøizovací výdaje','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200', 'Nehmotné výsledky výzkumu a vývoje','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1300', 'Software','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1400', 'Ocenitelná práva','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800', 'Drobný dlouhodobý nehmotný majetek','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1900', 'Ostatní dlouhodobý nehmotný majetek','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000', 'Dlouhodobý Hmotný majetek odpisovaný','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100', 'Stavby','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2200', 'Samostatné movité vìci a soubory movitých vìcí','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2500', 'Pìstitelské celky trvalých porostù','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600', 'Základní stádo a ta¾ná zvíøata','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2800', 'Drobný dlouhodobý hmotný majetek','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2900', 'Ostatní dlouhodobý hmotný majetek','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3000', 'Dlouhodobý hmotný majetek neodpisovaný','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3100', 'Pozemky','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3200', 'Umìlecká díla a sbírky','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000', 'Poøízení dlouhodobého nehmotného a hmotného majetku','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4100', 'Poøízení dlouhodobého nehmotného majetku','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4200', 'Poøízení dlouhodobého hmotného majetku','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000', 'Poskytnuté zálohy na dlouhodobý nehmotný a hmotný majetek','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100', 'Poskytnuté zálohy na dlouhodobý nehmotný majetek','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5200', 'Poskytnuté zálohy na dlouhodobý hmotný majetek','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6000', 'Dlouhodobý finanèní majetek','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6100', 'Podílové cenné papíry a vklady v podnicích s rozhodujícím','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6200', 'Podílové cenné papíry a vklady v podnicích s podstatným','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6300', 'Ostatní dlouhodobé cenné papíry a vklady','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6600', 'Pùjèky podnikùm ve skupinì','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6700', 'Ostatní pùjèky','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6900', 'Ostatní dlouhodobý finanèní majetek','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7000', 'Oprávky k dlouhodobému nehmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7100', 'Oprávky ke zøizovacím výdajùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7200', 'Oprávky k nehmotným výsledkùm výzkumu a vývoje','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7300', 'Oprávky k softwaru','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7400', 'Oprávky k ocenitelným právùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7800', 'Oprávky k drobnému dlouhodobému nehmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7900', 'Oprávky k ostatnímu dlouhodobému nehmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8000', 'Oprávky k dlouhodobému hmotnému majetku','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8100', 'Oprávky ke stavbám','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8200', 'Oprávky k samostatným movitým vìcem a souborùm movitých vìcí','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8500', 'Oprávky k pìstitelským celkùm trvalých porostù','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8600', 'Oprávky k základnímu stádu a ta¾ným zvíøatùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8800', 'Oprávky k drobnému dlouhodobému hmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8900', 'Oprávky k ostatnímu dlouhodobému hmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9000', 'Opravné polo¾ky k dlouhodobému majetku','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9100', 'Opravná polo¾ka k dlouhodobému nehmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9200', 'Opravná polo¾ka k dlouhodobému hmotnému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9300', 'Opravná polo¾ka k dlouhodobému nedokonèenému nehmotnému','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9400', 'Opravná polo¾ka k dlouhodobému nedokonèenému hmotnému','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9500', 'Opravná polo¾ka k poskytnutým zálohám','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9600', 'Opravná polo¾ka k dlouhodobému finanènímu majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9700', 'Opravná polo¾ka k nabytému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9800', 'Oprávky k opravné polo¾ce k nabytému majetku','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('10000', 'Zásoby','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('11000', 'Materiál','H','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('11100', 'Poøízení materiálu','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('11200', 'Materiál na skladì','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('11900', 'Materiál na cestì','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('12000', 'Zásoby vlastní výroby','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('12100', 'Nedokonèená výroba','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('12200', 'Polotovary vlastní výroby','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('12300', 'Výrobky','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('12400', 'Zvíøata','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('13000', 'Zbo¾í','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('13100', 'Poøízení zbo¾í','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('13200', 'Zbo¾í na skladì a v prodejnách','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('13900', 'Zbo¾í na cestì','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19000', 'Opravné polo¾ky k zásobám','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19100', 'Opravná polo¾ka k materiálu','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19200', 'Opravná polo¾ka k nedokonèené výrobì','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19300', 'Opravná polo¾ka k polotovarùm vlastní výroby','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19400', 'Opravná polo¾ka k výrobkùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19500', 'Opravná polo¾ka ke zvíøatùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('19600', 'Opravná polo¾ka ke zbo¾í','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('20000', 'Finanèní úèty','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('21000', 'Peníze','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('21100', 'Pokladna','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('21300', 'Ceniny','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('22000', 'Úèty v bankách','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('22100', 'Bankovní úèty','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('22200', 'Bankovní úèty klientù','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('23000', 'Bì¾né bankovní úvìry','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('23100', 'Krátkodobé bankovní úvìry','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('23200', 'Eskontní úvìry','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('24000', 'Jiné krátkodobé finanèní výpomoci','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('24100', 'Emitované krátkodobé dluhopisy','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('24900', 'Ostatní krátkodobé finanèní výpomoci','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25000', 'Krátkodobý finanèní majetek','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25100', 'Majetkové cenné papíry','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25200', 'Vlastní akcie a vlastní obchodní podíly','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25300', 'Dlu¾né cenné papíry','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25500', 'Vlastní dluhopisy','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('25600', 'Ostatní cenné papíry','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('26000', 'Pøevody mezi finanèními úèty','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('26100', 'Peníze na cestì','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('29000', 'Opravné polo¾ky ke krátkodobému finanènímu majetku','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('29100', 'Opravná polo¾ka k majetkovým cenným papírùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('29300', 'Opravná polo¾ka k dlu¾ným cenným papírùm','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('30000', 'Zúètovací vztahy','H','','H','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31000', 'Pohledávky','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31100', 'Odbìratelé','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31200', 'Smìnky k inkasu','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31300', 'Pohledávky za eskontované cenné papíry','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31400', 'Poskytnuté provozní zálohy','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('31500', 'Ostatní pohledávky','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32000', 'Závazky','H','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32100', 'Dodavatelé','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32200', 'Smìnky k úhradì','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32400', 'Pøijaté zálohy','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32500', 'Ostatní závazky','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32600', ' Závazky vùèi klientùm','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('32700', ' Závazky vùèi trhùm','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('33000', 'Zúètování se zamìstnanci a institucemi','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('33100', 'Zamìstnanci','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('33300', 'Ostatní závazky vùèi zamìstnancùm','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('33500', 'Pohledávky za zamìstnanci','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('33600', 'Zúètování s institucemi sociálního zabezpeèení a zdravotního','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34000', 'Zúètování daní a dotací','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34100', 'Daò z pøíjmù','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34200', 'Ostatní pøímé danì','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34300', 'Daò z pøidané hodnoty - zúètování','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34311', 'DPH 5% vstup','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34312', 'DPH 22% vstup','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34321', 'DPH 5% výstup','A','','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34322', 'DPH 22% výstup','A','','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34500', 'Ostatní danì a poplatky','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34600', 'Dotace ze státního rozpoètu','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('34700', 'Ostatní dotace','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35000', 'Pohledávky ke spoleèníkùm a sdru¾ení','H','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35100', 'Pohledávky k podnikùm ve skupinì','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35300', 'Pohledávky za upsaný vlastní kapitál','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35400', 'Pohledávky za spoleèníky pøi úhradì ztráty','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35500', 'Ostatní pohledávky za spoleèníky','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('35800', 'Pohledávky k úèastníkùm sdru¾ení','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36000', 'Závazky ke spoleèníkùm a sdru¾ení','H','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36100', 'Závazky k podnikùm ve skupinì','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36400', 'Závazky ke spoleèníkùm pøi rozdìlování zisku','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36500', 'Ostatní závazky ke spoleèníkùm','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36600', 'Závazky ke spoleèníkùm a èlenùm dru¾stva ze závislé','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36700', 'Závazky z upsaných nesplacených cenných papírù a vkladù','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('36800', 'Závazky k úèastníkùm sdru¾ení','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37000', 'Jiné pohledávky a závazky','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37100', 'Odlo¾ená daòová pohledávka a závazek','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37300', 'Nakoupené opce','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37400', 'Prodané opce','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37500', 'Pohledávky z emitovaných dluhopisù','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37700', ' Zúètování obchodù','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37800', 'Jiné pohledávky','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('37900', 'Jiné závazky','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38000', 'Pøechodné úèty aktiv a pasív','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38100', 'Náklady pøí¹tích období','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38200', 'Komplexní náklady pøí¹tích období','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38300', 'Výdaje pøí¹tích období','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38400', 'Výnosy pøí¹tích období','A','','L','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38500', 'Pøíjmy pøí¹tích období','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38600', 'Kursové rozdíly aktivní','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38700', 'Kursové rozdíly pasívní','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38800', 'Dohadné úèty aktivní','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('38900', 'Dohadné úèty pasívní','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('39000', 'Opravná polo¾ka k zúètovacím vztahùm a vnitøní zúètování','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('39100', 'Opravná polo¾ka k pohledávkám','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('39500', 'Vnitøní zúètování','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('39800', 'Spojovací úèet pøi sdru¾ení','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('40000', 'Kapitálové úèty a dlouhodobé závazky','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('41000', 'Základní kapitál a kapitálové fondy','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('41100', 'Základní kapitál','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('41200', 'Emisní á¾io','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('41300', 'Ostatní kapitálové fondy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('41400', 'Oceòovací rozdíly z pøecenìní majetku a závazkù','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42000', 'Fondy ze zisku a pøevedené hospodáøské výsledky','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42100', 'Zákonný rezervní fond','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42200', 'Nedìlitelný fond','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42300', 'Statutární fondy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42700', 'Ostatní fondy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42800', 'Nerozdìlený zisk minulých let','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('42900', 'Neuhrazená ztráta minulých let','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('43000', 'Hospodáøský výsledek','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('43100', 'Hospodáøský výsledek ve schvalovacím øízení','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('45000', 'Rezervy','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('45100', 'Rezervy zákonné','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('45400', 'Rezerva na kursové ztráty','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('45900', 'Ostatní rezervy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('46000', 'Bankovní úvìry','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('46100', 'Bankovní úvìry','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47000', 'Dlouhodobé závazky','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47100', 'Dlouhodobé závazky k podnikùm ve skupinì','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47300', 'Emitované dluhopisy','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47400', 'Závazky z pronájmu','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47500', 'Dlouhodobé pøijaté zálohy','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47800', 'Dlouhodobé smìnky k úhradì','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('47900', 'Ostatní dlouhodobé závazky','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('49000', 'Individuální podnikatel','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('49100', 'Úèet individuálního podnikatele','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('50000', 'Spotøebované nákupy','A','','E','AP_amount:IC_COGS');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('50100', 'Spotøeba materiálu','A','','E','AP_amount:IC_COGS');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('50200', 'Spotøeba energie','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('50300', 'Spotøeba ostatních neskladovatelných dodávek','A','','E','AP_amount:IC_COGS');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('50400', 'Prodané zbo¾í','A','','E','AP_amount:IC_COGS');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('51000', 'Slu¾by','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('51100', 'Opravy a udr¾ování','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('51200', 'Cestovné','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('51300', 'Náklady na reprezentaci','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('51800', 'Ostatní slu¾by','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52000', 'Osobní náklady','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52100', 'Mzdové náklady','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52200', 'Pøíjmy spoleèníkù a èlenù dru¾stva ze závislé èinnosti','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52300', 'Odmìny èlenùm orgánù spoleènosti a dru¾stva','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52400', 'Zákonné sociální poji¹tìní','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52500', 'Ostatní sociální poji¹tìní','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52600', 'Sociální náklady individuálního podnikatele','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52700', 'Zákonné sociální náklady','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('52800', 'Ostatní sociální náklady','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('53000', 'Danì a poplatky','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('53100', 'Daò silnièní','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('53200', 'Daò z nemovitostí','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('53800', 'Ostatní danì a poplatky','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54000', 'Jiné provozní náklady','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54100', 'Zùstatková cena prodaného dlouhodobého nehmotného a hmotného','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54200', 'Prodaný materiál','A','','E','IC_COGS');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54300', 'Dary','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54400', 'Smluvní pokuty a úroky z prodlení','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54500', 'Ostatní pokuty a penále','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54600', 'Odpis pohledávky','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('54800', 'Ostatní provozní náklady','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55000', 'Odpisy, rezervy a opravné polo¾ky provozních nákladù','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55100', 'Odpisy dlouhodobého nehmotného a hmotného majetku','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55200', 'Tvorba zákonných rezerv','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55400', 'Tvorba ostatních rezerv','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55500', 'Zúètování komplexních nákladù pøí¹tích období','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55700', 'Zúètování oprávky k opravné polo¾ce k nabytému majetku','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55800', 'Tvorba zákonných opravných polo¾ek','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('55900', 'Tvorba opravných polo¾ek','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('56000', 'Finanèní náklady','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('56100', 'Prodané cenné papíry a vklady','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('56200', 'Úroky','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('56300', 'Kursové ztráty','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('56800', 'Ostatní finanèní náklady','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('57000', 'Rezervy a opravné polo¾ky finanèních nákladù','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('57400', 'Tvorba rezerv','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('57900', 'Tvorba opravných polo¾ek','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58000', 'Mimoøádné náklady','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58100', 'Náklady na zmìnu metody','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58200', 'Manka a ¹kody','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58400', 'Tvorba rezerv','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58800', 'Ostatní mimoøádné náklady','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('58900', 'Tvorba opravných polo¾ek','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59000', 'Danì z pøíjmù a pøevodové úèty','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59100', 'Daò z pøíjmù z bì¾né èinnosti - splatná','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59200', 'Daò z pøíjmù z bì¾né èinnosti - odlo¾ená','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59300', 'Daò z pøíjmù z mimoøádné èinnosti - splatná','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59400', 'Daò z pøíjmù z mimoøádné èinnosti - odlo¾ené','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59500', 'Dodateèné odvody danì z pøíjmù','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59600', 'Pøevod podílu na hospodáøském výsledku spoleèníkùm','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59700', 'Pøevod provozních nákladù','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('59800', 'Pøevod finanèních nákladù','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('60000', 'Tr¾by za vlastní výkony a zbo¾í','A','','I','AR_amount:IC_sale:IC_Income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('60100', 'Tr¾by za vlastní výrobky','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('60200', 'Tr¾by z prodeje slu¾eb','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('60400', 'Tr¾by za zbo¾í','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('61000', 'Zmìny stavu vnitropodnikových zásob','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('61100', 'Zmìna stavu nedokonèené výroby','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('61200', 'Zmìna stavu polotovarù','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('61300', 'Zmìna stavu výrobkù','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('61400', 'Zmìna stavu zvíøat','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('62000', 'Aktivace','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('62100', 'Aktivace materiálu a zbo¾í','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('62200', 'Aktivace vnitropodnikových slu¾eb','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('62300', 'Aktivace dlouhodobého nehmotného majetku','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('62400', 'Aktivace dlouhodobého hmotného majetku','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64000', 'Jiné provozní výnosy.','A','','I','AR_amount:IC_sale:IC_Income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64100', 'Tr¾by z prodeje dlouhodobého nehmotného a hmotného majetku','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64200', 'Tr¾by z prodeje materiálu','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64400', 'Smluvní pokuty a úroky z prodlení','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64600', 'Výnosy z odepsaných pohledávek','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('64800', 'Jiné provozní výnosy','A','','I','AR_amount:IC_sale:IC_Income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65000', 'Zúètování rezerv a opravných polo¾ek provozních výnosù','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65200', 'Zúètování zákonných rezerv','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65400', 'Zúètování ostatních rezerv','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65500', 'Zúètování komplexních nákladù pøí¹tích období','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65700', 'Zúètování oprávky k opravné polo¾ce k nabytému majetku','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65800', 'Zúètování zákonných opravných polo¾ek','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('65900', 'Zúètování opravných polo¾ek','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66000', 'Finanèní výnosy','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66100', 'Tr¾by z prodeje cenných papírù a vkladù','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66200', 'Úroky','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66300', 'Kursové zisky','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66500', 'Výnosy z dlouhodobého finanèního majetku','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66600', 'Výnosy z krátkodobého finanèního majetku','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('66800', 'Ostatní finanèní výnosy','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('67000', 'Zúètování rezerv a opravných polo¾ek finanèních výnosù','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('67400', 'Zúètování rezerv','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('67900', 'Zúètování opravných polo¾ek','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('68000', 'Mimoøádné výnosy','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('68100', 'Výnosy ze zmìny metody','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('68400', 'Zúètování rezerv','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('68800', 'Ostatní mimoøádné výnosy','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('68900', 'Zúètování opravných polo¾ek','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('69000', 'Pøevodové úèty','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('69700', 'Pøevod provozních výnosù','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('69800', 'Pøevod finanèních výnosù','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('70000', 'Úèty rozva¾né','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('70100', 'Poèáteèní úèet rozva¾ný','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('70200', 'Koneèný úèet rozva¾ný','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('71000', 'Úèet ziskù a ztrát','A','','A','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '34311'),0.05);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '34312'),0.22);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '34321'),0.05);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '34322'),0.22);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '13200'), income_accno_id = (select id from chart where accno = '60000'), expense_accno_id = (select id from chart where accno = '50000'), fxgain_accno_id = (select id from chart where accno = '99998'), fxloss_accno_id = (select id from chart where accno = '99999'), invnumber = '1000', sonumber = '5000', ponumber = '1000', curr = 'Kè', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Danish_Default-chart.sql b/sql-ledger/sql/Danish_Default-chart.sql
new file mode 100644
index 000000000..aafcfb05c
--- /dev/null
+++ b/sql-ledger/sql/Danish_Default-chart.sql
@@ -0,0 +1,75 @@
+-- Default chart of accounts
+-- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','KORTFRISTEDE AKTIVER','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1061','Bank','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','Kasse','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Indbetalinger','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','Hensættelser til formodet gæld','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1210','Moms indgående','A','','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','LAGER-AKTIVER','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Lager / udstyr','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Lager / programmel','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Lager / tillægssalg','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1550','Lager / arrangementer','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','AKTIVER','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Kontorinventar og -udstyr','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','Samlede afskrivninger, inventar, udstyr','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','Køretøjer','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','Samlede afskrivninger, køretøjer','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','KORTFRISTET GÆLD','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Udbetalinger','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','Selskabsskat','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2190','Afgifter','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2311','Moms udgående','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','LANGFRISTET GÆLD','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Banklån','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','AKTIEKAPITAL','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','Almindelige aktier','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','EGENKAPITAL','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3510','Egenkapital primo','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3600','Årets resultat','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','SALGSINDTÆGT','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','Salg / udstyr','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Salg / programmel','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Salg / tillægssalg','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4050','Salg / arrangementer','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','KONSULENTINDTÆGT','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Konsulentbistand','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Programmering','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','ANDEN INDTÆGT','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','Renter','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','SALGSOMKOSTNINGER','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','Omkostninger / udstyr','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','Anskaffelser under 8.000','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5011','Anskaffelser over 8.000','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','Omkostninger / programmel','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','Omkostninger / tillægssalg','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5050','Omkostninger / arrangementer','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','Fragt, post','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','LØNUDGIFTER','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Lønninger og honorarer','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','ATP','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5470','Personalegoder','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','GENERELLE & ADMINISTRATIVE UDGIFTER','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Bogføring, revision, advokat','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','Marketing','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Dårlige skyldnere','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','Afdrag på lån','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','A-skat','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','Forsikringer','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','Renter og bankgebyrer','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','Kontorudgifter','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','Husleje','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','Vedligeholdelse og reparation','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','Telefon','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Rejser & repræsentation','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','El, vand, varme','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Licenser','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1210'),0.25);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.25);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'DKK', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Default-chart.sql b/sql-ledger/sql/Default-chart.sql
new file mode 100644
index 000000000..c85d41baa
--- /dev/null
+++ b/sql-ledger/sql/Default-chart.sql
@@ -0,0 +1,81 @@
+-- Default chart of accounts
+-- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','CURRENT ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1060','Chequing Account','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','Petty Cash','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Accounts Receivables','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','Allowance for doubtful accounts','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','INVENTORY ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Inventory / Computer Parts','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Inventory / Software','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Inventory / Aftermarket Parts','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','CAPITAL ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Office Furniture & Equipment','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','Accum. Amort. -Furn. & Equip.','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','Vehicle','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','Accum. Amort. -Vehicle','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','CURRENT LIABILITIES','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Accounts Payable','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','Corporate Taxes Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2190','Federal Income Tax Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2210','Workers Comp Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2220','Vacation Pay Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2250','Pension Plan Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2260','Employment Insurance Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2280','Payroll Taxes Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','VAT (10%)','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2320','VAT (14%)','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2330','VAT (30%)','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','LONG TERM LIABILITIES','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Bank Loans','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','Loans from Shareholders','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','SHARE CAPITAL','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','Common Shares','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','SALES REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','Sales / Hardware','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Sales / Software','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Sales / Aftermarket Parts','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','CONSULTING REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Consulting','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Programming','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','OTHER REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','Shipping & Handling','A','','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','Interest','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','COST OF GOODS SOLD','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','Purchases','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','COGS / Hardware','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','COGS / Software','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','COGS / Aftermarket Parts','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','Freight','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','PAYROLL EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Wages & Salaries','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','Employment Insurance Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5430','Pension Plan Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5440','Workers Comp Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5470','Employee Benefits','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','GENERAL & ADMINISTRATIVE EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Accounting & Legal','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','Advertising & Promotions','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Bad Debts','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5650','Capital Cost Allowance Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','Amortization Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','Income Taxes','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','Insurance','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','Interest & Bank Charges','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','Office Supplies','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','Rent','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','Repair & Maintenance','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','Telephone','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Travel & Entertainment','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','Utilities','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5795','Registrations','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Licenses','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.1);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2320'),0.14);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2330'),0.3);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'USD:CAD:EUR', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Dutch_Default-chart.sql b/sql-ledger/sql/Dutch_Default-chart.sql
new file mode 100644
index 000000000..758d6d4ec
--- /dev/null
+++ b/sql-ledger/sql/Dutch_Default-chart.sql
@@ -0,0 +1,80 @@
+--
+-- Dutch Chart of Accounts
+-- AJ Hettema, Mon, 20 Aug 2001
+--
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1000','HUIDIGE ACTIVA','H','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1061','Bank','A','','A','AR_paid:AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1065','Kas','A','','A','AR_paid:AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1200','Debiteuren','A','','A','AR');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1205','Toelage voor precaire rekeningen','A','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1500','VOORRAAD ACTIVA','H','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1520','Voorraad / Hardware','A','','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1530','Voorraad / Software','A','','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1540','Voorraad / Aftermarket Parts','A','','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1800','LANGE TERMIJN ACTIVA','H','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1820','Inventaris','A','','A','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1825','Afschrijving inventaris','A','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1840','Auto','A','','A','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1845','Afschrijving auto','A','','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2000','HUIDIGE PASSIVA','H','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2100','Crediteuren','A','','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2160','Niet-rijks Belastingen','A','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2170','Omzetbelasting','A','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2190','Vennootschapsbelasting','A','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2310','BTW hoog','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2311','BTW laag','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2600','LANGE TERMIJN PASSIVA','H','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2620','Bank Leningen','A','','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2680','Aandelenvermogen','A','','L','AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3300','AANDELEN KAPITAAL','H','','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3350','Aandelen in portefeuille','A','','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3500','WINSTRESERVE','H','','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3590','Winstreserve voorgaande jaren','A','','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3600','Huidige winstreserve','A','','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4000','VERKOOP INKOMSTEN','H','','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4020','Verkoop / Hardware','A','','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4030','Verkoop / Software','A','','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4040','Verkoop / Aftermarket Parts','A','','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4300','CONSULTANCY INKOMSTEN','H','','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4320','Consultancy','A','','I','AR_amount:IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4330','Programmeren','A','','I','AR_amount:IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4400','ANDERE INKOMSTEN','H','','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4430','Verzend & Administratie','A','','I','IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4440','Rente','A','','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4450','Foreign Exchange Gain','A','','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5000','INKOOPPRIJS VERKOPEN','H','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5010','Inkoopkosten algemeen','A','','E','AP_amount:IC_cogs:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5020','Inkoopkosten / Hardware','A','','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5030','Inkoopkosten / Software','A','','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5040','Inkoopkosten / Aftermarket Parts','A','','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5100','Vrachtkosten','A','','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5400','PERSONEELS KOSTEN','H','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5410','Salarissen','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5420','EI Expense','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5430','CPP Expense','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5440','WCB Expense','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5470','Employee Benefits','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5600','GENERAL & ADMINISTRATIVE EXPENSES','H','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5610','Boekhouding- & Rechtkosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5615','Reclame- & Promotiekosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5620','Slechte Schulden','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5660','Afschrijvingskosten','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5680','Inkomsten Belastingen','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5685','Verzekeringen','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5690','Rente & Bankkosten','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5700','Kantoorvoorzieningen','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5760','Huurkosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5765','Reparatie- & Onderhoudskosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5780','Telefoonkosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5781','Internetkosten','A','','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5785','Reis- & Vermaakkosten','A','','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5790','NUTS Kosten','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5795','Registratie''s','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5800','Licenties','A','','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.19);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.06);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'EUR:USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Dutch_Standard-chart.sql b/sql-ledger/sql/Dutch_Standard-chart.sql
new file mode 100644
index 000000000..cd7c8eb22
--- /dev/null
+++ b/sql-ledger/sql/Dutch_Standard-chart.sql
@@ -0,0 +1,233 @@
+-- Nederlandstalig Rekeningschema conform het Decimaal Stelsel.
+-- Dutch Chart of Accounts following the Decimal Standards as set by the famous Philips Accounting Department
+-- PDF Tammes, Fri, 29 Mar 2002 ( remarks or questions to finance@bermuda-holding.com )
+-- Just delete any accounts not needed after importing the scheme, beats entering all manually (or add -- at the beginning)
+-- Account groups (first number in accountnumber defines to which group it belongs)
+-- 0 : Vaste Activa, Eigen Vermogen, Voorzieningen en lang vreemd vermogen => Fixed Assets, Capital, Accruals and long term loans
+-- 1 : Financiele Rekeningen => Financial Accounts
+-- 2 : Tussenrekeningen => Intermediate Accounts
+-- 3 : Voorraad grond- en hulpstoffen => Stocks (minerals, parts not yet assembled etc)
+-- 4 : Kostenrekeningen => Costs Accounts
+-- 5 : Verdeling Directe kosten => Accounts to recharge several Direct Costs to separate departments
+-- 6 : Fabricagekosten => Assembly Costs
+-- 7 : Voorraad gereed produkt en product in bewerking => Stocks (Trade Articles, half-finished assemblies, projects under construction)
+-- 8 : Rekeningen voor vaststelling van het verkoopresultaat => Accounts for dediding Sales Result
+-- 9 : Rekeningen voor vaststelling van de resultatenrekening => Accounts for dediding Profit & Loss (P/L)
+-- The general idea is to allocate all costs to the 4/5/6 accounts, all stock transactions to 7 and sales related to 8. At the end of the
+-- year you clean out the seperate accounts via x999 and kick the result to the relevant 9xxx series. That way you have a specialized
+-- P/L in the seperate accounts and an overview/shirt version of the P/L in the 9 series, where also various results not related to normal
+-- operations is recorded (tax, donations, that kind of thing. Finally the 9999 account is used to kick the result to retained earnings and
+-- related accounts in the balance sheet, and we are ready for the next year
+--
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0000','Vaste Activa & Eigen Vermogen','H','0000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0010','Terreinen','A','0010','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0015','Afschrijving Terreinen','A','0015','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0200','Gebouwen','A','0200','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0205','Afschrijving Gebouwen','A','0205','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0230','Inventaris','A','0230','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0235','Afschrijving Inventaris','A','0235','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0240','Computers','A','0240','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0245','Afschrijving Computers','A','0245','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0250','Auto','A','0250','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0255','Afschrijving Auto','A','0255','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0260','Machines','A','0260','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0265','Afschrijving Machines','A','0265','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0290','Goodwill','A','0290','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0295','Afschrijving Goodwill','A','0295','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0370','Overige Leningen u/g','A','0370','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0380','Aandelen & Effecten','A','0380','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0381','Beleggingen Spaarbeleg','A','0381','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0390','Beleggingen Legiolease','A','0390','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0400','Aandelenkapitaal','A','0400','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0410','Aandelen in portefeuille','A','0410','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0420','Aandelen uit te reiken','A','0420','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0430','Agioreserve','A','0430','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0440','Winstreserve','A','0440','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0450','Herwaarderingsreserve','A','0450','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0470','Oprichtingskosten','A','0470','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0480','Winst na belasting lopend jaar','A','0480','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0500','Eigen Vermogen','A','0500','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0510','Prive','A','0510','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0550','Onverdeeld Resultaat','A','0550','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0600','Voorziening Onderhoud','A','0600','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0610','Voorziening Garantie','A','0610','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0620','Voorziening Assurantie','A','0620','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0630','Voorziening Debiteuren','A','0630','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0700','Obligatielening','A','0700','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0710','Obligaties in portefeuille','A','0710','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0720','Converteerbare Obligatielening','A','0720','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0730','Agio op Obligaties','A','0730','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0740','Disagio op Obligaties','A','0740','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('0800','Hypothecaire lening o/g','A','0800','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1000','Financiele Rekeningen','H','1000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1001','Kas','A','1001','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1050','Contante Verkopen','A','1050','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1100','Interbank','A','1100','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1110','ABN-AMRO','A','1110','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1119','Postbank Plus','A','1119','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1120','Postbank Giro','A','1120','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1121','Postbank Kapitaal','A','1121','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1122','Postbank Leeuw','A','1122','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1139','Postbank Effectenrekening','A','1139','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1140','Rabobank','A','1140','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1141','Rabobank Rendementrekening','A','1141','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1160','van Lanschotbank','A','1160','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1170','Finansbank','A','1170','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1180','VISA Creditcard','A','1180','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1190','Kruisposten','A','1190','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1200','Debiteuren','A','1200','A','AR');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1205','Dubieuze Debiteuren','A','1205','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1321','Rekening Courant < A','A','1321','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1322','Rekening Courant < B','A','1322','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1340','Goederen ontvangen / GO','A','1340','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1500','Te betalen loonheffing','A','1500','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1520','Te betalen Sociale Lasten','A','1520','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1530','Te betalen Pensioenpremies','A','1530','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1600','Crediteuren','A','1600','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1605','Nog te Ontvangen Facturen / NOF','A','1605','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1610','Te betalen tantiemes','A','1610','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1615','Te betalen Vennootschapsbelasting','A','1615','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1620','Interimdividend','A','1620','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1630','Te betalen dividend','A','1630','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1640','Te betalen dividendbelasting','A','1640','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1650','Aandeelhouders nog te storten','A','1650','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1700','Te betalen interest','A','1700','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1710','Te betalen coupons','A','1710','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1770','Uitgelote obligaties','A','1770','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1800','Te vorderen BTW hoog','A','1800','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1801','Te vorderen BTW laag','A','1801','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1810','Te betalen BTW hoog','A','1810','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1811','Te betalen BTW laag','A','1811','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1850','Saldo BTW','A','1850','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1941','Rekening Courant > A','A','1941','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1942','Rekening Courant > B','A','1942','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1960','Vooruitbetaalde bedragen','A','1960','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1970','Vooruitontvangen bedragen','A','1970','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1980','Nog te ontvangen bedragen','A','1980','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('1990','Nog te betalen bedragen','A','1990','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2000','Tussenrekeningen','H','2000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2100','Vraagposten','A','2100','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2400','Onbekende betalingen','A','2400','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2800','Tussenrekening Lonen','A','2800','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('2900','Tussenrekening Beginbalans','A','2900','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3000','Voorraad Grond- en Hulpstoffen','H','3000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('3010','Voorraad Grondstof A','A','3010','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4000','Kostenrekeningen','H','4000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4001','Verbruik Grondstoffen','A','4001','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4100','Directe Loonkosten','A','4100','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4110','Indirecte Loonkosten','A','4110','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4120','Sociale Lasten','A','4120','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4130','Kosten Pensioenen','A','4130','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4190','Overige Personeelskosten','A','4190','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4200','Kosten externe medewerkers','A','4200','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4210','Kosten Personeelsuitjes','A','4210','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4220','Kantinekosten','A','4220','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4240','Lief en Leedpot externe medewerkers','A','4240','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4300','Afschrijvingskosten Gebouwen','A','4300','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4330','Afschrijvingskosten Inventaris','A','4330','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4340','Afschrijvingskosten Computers','A','4340','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4350','Afschrijvingskosten Autos','A','4350','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4360','Afschrijvingskosten Machines','A','4360','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4390','Afschrijvingskosten Goodwill','A','4390','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4400','Huurkosten','A','4400','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4410','Asurantiekosten','A','4410','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4520','Gas, Licht & Water','A','4520','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4530','Vaste Lasten','A','4530','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4540','Reparatie- & Onderhoudskosten','A','4540','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4560','Verzekering en Beveiliging Pand','A','4560','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4600','Directe Verkoopkosten','A','4600','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4650','Indirecte Verkoopkosten','A','4650','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4730','Relatiegeschenken','A','4730','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4740','Reis en Verblijfkosten','A','4740','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4800','Kasverschillen','A','4800','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4810','Voorraadverschillen','A','4810','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4900','Telefoon & Faxkosten','A','4900','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4910','Contributies & Abonnementen','A','4910','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4920','Verzekeringen Algemeen','A','4920','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4930','Kantoorartikelen','A','4930','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4931','Kantoorbenodigdheden','A','4931','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4932','Vakliteratuur','A','4932','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4940','Licenties & Software','A','4940','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4941','Administratie & Acountantskosten','A','4941','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4943','Notaris & Advocaatkosten','A','4943','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4950','Drukwerk & Papier','A','4950','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4970','Porti','A','4970','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4980','Bankkosten','A','4980','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4981','Bankprovisie Effectenhandel','A','4981','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4990','Overige Algemene Kosten','A','4990','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4991','Bijzondere baten en lasten','A','4991','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('4999','Overboekingsrekening Rubriek 4','A','4999','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5000','Verdeling Indirecte Kosten','H','5000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5400','Indirecte fabricagekosten','A','5400','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5450','Opslag Indirecte fabricagekosten','A','5450','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5500','Indirecte verkoopkosten','A','5500','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5550','Opslag Indirecte verkoopkosten','A','5550','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('5999','Overboekingsrekening Rubriek 5','A','5999','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6000','Fabricagerekeningen','H','6000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6001','Verbruik Grondstoffen','A','6001','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6010','Directe Lonen','A','6010','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6020','Toeslag Indirecte fabricagekosten','A','6020','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6101','Standaard Verbruik Grondstoffen','A','6101','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6110','Standaard Directe Lonen','A','6110','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6120','Standaard Toeslag Indirecte fabricagekosten','A','6120','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('6999','Overboekingsrekening Rubriek 6','A','6999','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7000','Voorraden gereed product','H','7000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7001','Voorraad A','A','7001','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7002','Voorraad B','A','7002','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7003','Voorraad C','A','7003','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7010','Voorraad Incourante goederen','A','7010','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7015','Afschrijving Incourante goederen','A','7015','L','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7200','Voorraad Goederen in bewerking','A','7200','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7300','Nog te Ontvangen Goederen / NOG','A','7300','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7350','Nog af te leveren goederen','A','7350','L','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7400','Prijsverschillen bij inkoop','A','7400','I','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('7999','Overboekingsrekening Rubriek 7','A','7999','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8000','Rekeningen tbv Verkoopresultaat','H','8000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8010','Inkoopkosten algemeen','A','8010','E','AP_amount:IC_cogs:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8020','Kostprijs Verkopen A','A','8020','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8030','Kostprijs Verkopen B','A','8030','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8040','Kostprijs Verkopen C','A','8040','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8100','Directe Verkoopkosten','A','8100','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8150','Toeslag Indirecte Verkoopkosten','E','8150','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8300','Kortingen bij Verkoop','A','8300','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8520','Opbrengst Verkopen A','A','8520','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8530','Opbrengst Verkopen B','A','8530','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8540','Opbrengst Verkopen C','A','8540','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('8999','Overboekingsrekening Rubriek 8','A','8999','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9000','Rekeningen tbv Resultatenrekening','H','9000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9010','Resultaat Indirecte Kosten','A','9010','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9011','Resultaat Fabricage','A','9011','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9012','Resultaat Verkoop','A','9012','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9015','Resultaat Prijsverschillen','A','9015','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9030','Rente bate deposito','A','9030','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9040','Rente bate lening u/g','A','9040','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9050','Rente bate bank','A','9050','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9080','Rente bate Fiscus','A','9080','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9100','Rente last hypothecaire lening','A','9100','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9110','Rente last lening bank','A','9110','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9130','Rente last lening o/g','A','9130','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9150','Rente last bank','A','9150','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9180','Rente last Fiscus','A','9180','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9190','Rente last overig','A','9190','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9200','Ontvangen Dividend (bruto)','A','9200','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9205','Ingehouden Dividendbelasting','A','9205','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9210','Koersresultaat Effecten)','A','9210','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9220','Valutaresultaat','A','9220','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9300','Huuropbrengsten','A','9300','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9400','Resultaat tgv inhaalafschrijvingen','A','9400','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9500','Incidentele Resultaten','A','9500','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9600','Giften en Donaties','A','9600','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9700','Tantiemes','A','9700','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9800','Belasting Lopend Jaar','A','9800','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9810','Belasting Voorgaande Jaren','A','9810','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9900','Vennootschapsbelasting','A','9900','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('9999','Overboekingsrekening','A','9999','I','');
+--
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1800'),0.19);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1801'),0.06);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1810'),0.19);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1811'),0.06);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '7001'), income_accno_id = (select id from chart where accno = '8520'), expense_accno_id = (select id from chart where accno = '8010'), fxgain_accno_id = (select id from chart where accno = '9220'), fxloss_accno_id = (select id from chart where accno = '9220'), invnumber = '0000', sonumber = '0000', ponumber = '0000', curr = 'EUR:USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/France-chart.sql b/sql-ledger/sql/France-chart.sql
new file mode 100644
index 000000000..a34e013a2
--- /dev/null
+++ b/sql-ledger/sql/France-chart.sql
@@ -0,0 +1,951 @@
+-- Chart of Accounts for France
+-- From: Oscar Buijten <oscar@elbie.com>
+-- Mon, 6 Aug 2001
+--
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101000', 'CAPITAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101100', 'CAPITAL SOUSCRIT NON APPELE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101200', 'CAPITAL SOUSCRIT APPELE NON VERSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101300', 'CAPITAL SOUSCRIT APPELE VERSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101310', 'CAPITAL NON AMORTI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101320', 'CAPITAL AMORTI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('101800', 'CAPITAL SOUSCR. A REGLEM. PART.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104000', 'PRIMES LIEES AU CAPITAL SOCIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104100', 'PRIMES D\'EMISSION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104200', 'PRIMES DE FUSION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104300', 'PRIMES D\'APPORT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104400', 'PRIMES CONVERS. OBLIGAT. ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('104500', 'BONS DE SOUSCRIPTION D\'ACTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105000', 'ECARTS DE REEVALUATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105100', 'RESERVE SPECIALE DE REEVALUATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105200', 'ECART DE REEVALUATION LIBRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105300', 'RESERVE DE REEVALUATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105500', 'ECARTS REEVAL. (AUT. OPER. LEG.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105700', 'AUT. ECARTS REEVAL. EN FRANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('105800', 'AUT. ECARTS REEVAL. A L\'ETRANGER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106000', 'RESERVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106100', 'RESERVE LEGALE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106110', 'RESERVE LEGALE PROPREMENT DITE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106120', 'PLUS-VALUES NETTES A LONG TERME', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106200', 'RESERVES INDISPONIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106300', 'RESERVES STATUT. OU CONTRACTUELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106400', 'RESERVES REGLEMENTEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106410', 'PLUS-VALUES NETTES A LONG TERME', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106430', 'RESER. CONSEC. OCTROI SUBV. INVEST', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106480', 'AUTRES RESERVES REGLEMENTEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106800', 'AUTRES RESERVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106810', 'RESERVE DE PROPRE ASSUREUR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('106880', 'RESERVES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('107000', 'ECART D\'EQUIVALENCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('109000', 'ACTIONN. CAPITAL SOUSC. NON APPELE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('110000', 'REPORT A NOUVEAU (SOLDE CREDITEUR)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('119000', 'REPORT A NOUVEAU (SOLDE DEBITEUR)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('120000', 'RESULTAT DE L\'EXERCICE (BENEFICE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('129000', 'RESULTAT DE L\'EXERCICE (PERTE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131000', 'SUBVENTIONS D\'EQUIPEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131100', 'ETAT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131200', 'REGIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131300', 'DEPARTEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131400', 'COMMUNES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131500', 'COLLECTIVITES PUBLIQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131600', 'ENTREPRISES PUBLIQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131700', 'ENTREPRISES ET ORGANISMES PRIVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('131800', 'AUTRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('138000', 'AUTRES SUBVENTIONS D\'INVESTIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139000', 'SUBV. INVES. INSC. AU CPTE RESULT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139100', 'SUBVENTIONS D\'EQUIPEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139110', 'ETAT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139120', 'REGIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139130', 'DEPARTEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139140', 'COMMUNES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139150', 'COLLECTIVITES PUBLIQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139160', 'ENTREPRISES PUBLIQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139170', 'ENTREPRISES ET ORGANISMES PRIVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139180', 'AUTRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('139800', 'AUTRES SUBVENTIONS D\'INVESTIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('142000', 'PROVIS. REGLEM. RELATIV. AUX IMMO.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('142300', 'PROVIS. POUR RECONSTITUTION GIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('142400', 'PROVIS. INVESTIS. (PARTIC. SALAR.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('143000', 'PROVIS. REGLEMENT. RELATIV. STOCKS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('143100', 'HAUSSE DES PRIX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('143200', 'FLUCTUATION DES COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('144000', 'PROVIS. REGLEM. RELAT. ELEM. ACTIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('145000', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('146000', 'PROVISION SPECIALE DE REEVALUATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('147000', 'PLUS-VALUES REINVESTIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('148000', 'AUTRES PROVISIONS REGLEMENTEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151000', 'PROVISIONS POUR RISQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151100', 'PROVISIONS POUR LITIGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151200', 'PROV. GARANT. DONNEES AUX CLIENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151300', 'PROV. PERTES SUR MARCHES A TERME.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151400', 'PROVIS. POUR AMENDES ET PENALITES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151500', 'PROVIS. POUR PERTES DE CHANGE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('151800', 'AUTRES PROVISIONS POUR RISQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('153000', 'PROVIS. PENSIONS ET OBLIG. SIMIL.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('155000', 'PROVISIONS POUR IMPOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('156000', 'PROVIS. RENOUV. IMMO (ETS CONCESS)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('157000', 'PROV. CHARG. A REPART. SUR EXERC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('157200', 'PROVIS. POUR GROSSES REPARATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('158000', 'AUTRES PROVISIONS POUR CHARGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('158200', 'PROVIS. CHARG. SOCIA. FISC. SUR CP', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('161000', 'EMPRUNTS OBLIGATOIRES CONVERTIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('163000', 'AUTRES EMPRUNTS OBLIGATAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('164000', 'EMPRUNTS AUPRES ETABLIS. DE CREDIT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('165000', 'DEPOTS ET CAUTIONNEMENTS RECUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('165100', 'DEPOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('165500', 'CAUTIONNEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('166000', 'PARTICIP. SALARIES AUX RESULTAS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('166100', 'COMPTES BLOQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('166200', 'FONDS DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('167000', 'EMPR. DETTES ASSORT. CONDIT. PART.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('167100', 'EMISSION DE TITRES PARTICIPATIFS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('167400', 'AVANCES CONDITIONNEES DE L\'ETAT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('167500', 'EMPRUNTS PARTICIPATIFS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168000', 'AUTRES EMPR. ET DETTES ASSIMILEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168100', 'AUTRES EMPRUNTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168500', 'RENTES VIAGERES CAPITALISEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168700', 'AUTRES DETTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168810', 'SUR EMPR. OBLIGATAIR. CONVERTIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168830', 'SUR AUTRES EMPRUNTS OBLIGATAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168840', 'SUR EMPRUNTS AUPRES ETABLI. CREDIT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168850', 'SUR DEPOTS ET CAUTIONNEMENTS RECUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168860', 'SUR PARTICIP. SALAR. RESULTATS ETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168870', 'SUR EMPR. DETTES ASSOR. COND. PART', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('168880', 'SUR AUTRES EMPR. DETTES ASSIMILEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('169000', 'PRIMES REMBOURSEMENT OBLIGATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('171000', 'DETTES RATTACH. A PARTIC. (GROUPE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('174000', 'DETTES RATT. A PART. (HORS GROUPE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('178000', 'DETTES RATTACH. A STES EN PARTIC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('178100', 'PRINCIPAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('178800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('181000', 'COMPTE DE LIAISON ETABLISSEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('186000', 'BIENS PREST. SERV. ECH. (CHARGES)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('187000', 'BIENS PREST. SERV. ECH. (PRODUITS)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('188000', 'COMPTES DE LIAISON STES EN PARTIC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201100', 'FRAIS DE CONSTITUTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201200', 'FRAIS DE PREMIER ETABLISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201210', 'FRAIS DE PROSPECTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201220', 'FRAIS DE PUBLICITE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201300', 'FRAIS AUGMEN. CAPIT. OPER. DIVERS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('203000', 'FRAIS RECHERCHE ET DEVELOPPEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('205000', 'CONCESSIONS ET DROITS SIMILAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('206000', 'DROIT AU BAIL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('207000', 'FONDS COMMERCIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('208000', 'AUTRES IMMOBILISATIONS INCORPOR.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211000', 'TERRAINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211100', 'TERRAINS NUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211200', 'TERRAINS AMENAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211300', 'SOUS-SOLS ET SUR-SOLS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211400', 'TERRAINS DE GISEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211410', 'CARRIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211500', 'TERRAINS BATIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211510', 'ENSEMBLES IMMOBILIERS INDUSTRIELS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211550', 'ENSEMBLES IMMOB. ADM. ET COMMERC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211580', 'AUTRES ENSEMBLES IMMOBILIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211581', 'AFFECTES AUX OPERAT. PROFESSION.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211588', 'AFFECTES AUX OPERAT. NON PROF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('211600', 'COMPTE D\'ORDRE SUR IMMOBILISATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('212000', 'AGENCEMENTS AMENAGEMENTS TERRAINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213000', 'CONSTRUCTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213100', 'BATIMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213110', 'ENSEMBLES IMMOB. INDUSTRIELS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213150', 'ENSEMBLES IMMOB. ADM. ET COMMERC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213180', 'AUTRES ENSEMBLES IMMOBILIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213181', 'AFFECTES AUX OPERAT. PROFESSION.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213188', 'AFFECTES AUX OPERAT. NON PROF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213500', 'INSTALLATIONS GENERALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213800', 'OUVRAGES D\'INFRASTRUCTURE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213810', 'VOIES DE TERRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213820', 'VOIES DE FER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213830', 'VOIES D\'EAU', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213840', 'BARRAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('213850', 'PISTES D\'AERODROMES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('214000', 'CONSTRUCTIONS SUR SOL D\'AUTRUI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215000', 'INSTALL. TECH. MAT. OUTIL. INDUS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215100', 'INSTALL. COMPLEXES SPECIALISEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215110', 'SUR SOL PROPRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215140', 'SUR SOL D\'AUTRUI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215300', 'INSTALL. A CARACTERE SPECIFIQUE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215310', 'SUR SOL PROPRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215340', 'SUR SOL D\'AUTRUI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215400', 'MATERIEL INDUSTRIEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215500', 'OUTILLAGE INDUSTRIEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('215700', 'AGENCEM. AMENAG. MAT. OUTIL. INDUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218000', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218100', 'INSTALL. GENE. AGENC. AMENAG. DIV.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218200', 'MATERIEL DE TRANSPORT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218300', 'MATERIEL DE BUREAU ET INFORMATIQUE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218400', 'MOBILIER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218500', 'CHEPTEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('218600', 'EMBALLAGES RECUPERABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('231000', 'IMMOBILISAT. CORPORELLES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('231200', 'TERRAINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('231300', 'CONSTRUCTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('231500', 'INSTALL. TECH. MAT. OUTIL. INDUST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('231800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('232000', 'IMMO. INCORPORELLES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('237000', 'AVANC. ACOMPT. VERSES SUR IMM. INC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('238000', 'AVANC. ACOMP. VERSES CDES IMM. COR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('238200', 'TERRAINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('238300', 'CONSTRUCTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('238500', 'INSTALL. TECH. MAT. OUTIL. INDUST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('238800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('261000', 'TITRES DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('261100', 'ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('261800', 'AUTRES TITRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('266000', 'AUTRES FORMES DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267000', 'CREANCES RATTACHEES A PARTICIPAT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267100', 'CREANCES RATT. A PART. (GROUPE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267400', 'CREANC. RATT. PART. (HORS GROUPE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267500', 'VERSEM. D\'APPORTS NON CAPITALISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267600', 'AVANCES CONSOLIDABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267700', 'AUTRES CREANCES RATT. A PART.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('267800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('268000', 'CREANCES RATT. A STE EN PART.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('268100', 'PRINCIPAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('268800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('269000', 'VERS. REST. A EFFECT. SUR T.P.N.L.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('271000', 'TITRES IMMOBILISES (DROIT PROP.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('271100', 'ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('271800', 'AUTRES TITRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('272000', 'TITRES IMMOBILISES (DROIT CREANCE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('272100', 'OBLIGATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('272200', 'BONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('273000', 'TITRES IMMOBILISES DE L\'ACT. DE PORTEF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('274000', 'PRETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('274100', 'PRETS PARTICIPATIFS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('274200', 'PRETS AUX ASSOCIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('274300', 'PRETS AU PERSONNEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('274800', 'AUTRES PRETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('275000', 'DEPOTS ET CAUTIONNEMENTS VERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('275100', 'DEPOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('275500', 'CAUTIONNEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276000', 'AUTRES CREANCES IMMOBILISEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276100', 'CREANCES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276820', 'SUR TITRES IMMOB. (DROIT CREANCE)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276840', 'SUR PRETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276850', 'SUR DEPOTS ET CAUTIONNEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('276880', 'SUR CREANCES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('277100', 'ACTIONS PROPRES OU PARTS PROPRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('277200', 'ACT. PRO. OU PARTS PRO. VOIE D\'ANNUL.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('279000', 'VERSEM. A EFFECT. SUR T.I.N.L.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280000', 'AMORTISS. IMMOBILISATIONS INCORP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280100', 'FRAIS D\'ETABLISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280300', 'FRAIS DE RECHERCHE ET DEVELOPP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280500', 'CONCESSIONS ET DROITS SIMILAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280700', 'FONDS COMMERCIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('280800', 'AUTRES IMMOBILISATIONS INCORPOR.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281000', 'AMORTISS. IMMOBILISATIONS CORPOR.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281100', 'TERRAINS DE GISEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281200', 'AGENCEMENTS AMENAGEMENTS TERRAINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281300', 'CONSTRUCTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281400', 'CONSTRUCTIONS SUR SOL D\'AUTRUI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281500', 'INSTALL TECH. MAT. OUTIL. INDUST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('281800', 'AUTRES IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('282000', 'AMORTISS. IMMOBIL. EN CONCESSION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('290000', 'PROVIS. DEPRECIATION IMMOB. INCORP', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('290500', 'MARQUES PROCEDES DROITS ET VALEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('290600', 'DROIT AU BAIL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('290700', 'FONDS COMMERCIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('290800', 'AUTRES IMMOB. INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('291000', 'PROVIS. DEPRECIATION IMMOB. CORPOR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('291100', 'TERRAINS (AUTRES QUE GISEMENT)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('292000', 'PROVIS. DEPRECIAT. IMMOB. CONCESS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('293000', 'PROVIS. DEPRECIAT. IMMOB. EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('293100', 'IMMOBILISATIONS CORPOR. EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('293200', 'IMMO. INCORPORELLES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('296000', 'PROV. DEPREC. PART ET CREANC. PART', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('296100', 'TITRES DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('296600', 'AUTRES FORMES DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('296700', 'CREANCES RATT. A PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('296800', 'CREANCES RATT. A STE EN PARTICIP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297000', 'PROVIS. DEPRECIATION AUTRES IMMOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297100', 'TITRES IMMOBILISES DROIT PROPRIETE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297200', 'TITRES IMMOBILISES DROIT CREANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297300', 'TITRES IMMO. DE L\'ACT. DE PORTEF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297400', 'PRETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297500', 'DEPOTS ET CAUTIONNEMENTS VERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('297600', 'AUTRES CREANCES IMMOBILISEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('311000', 'MATIERE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('312000', 'MATIERE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('317000', 'FOURNITURES A, B, C...', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('321000', 'MATIERES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('321100', 'MATIERE (OU GROUPE) C', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('321200', 'MATIERE (OU GROUPE) D', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322000', 'FOURNITURES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322100', 'COMBUSTIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322200', 'PRODUITS D\'ENTRETIEN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322300', 'FOURNITURES D\'ATELIER ET D\'USINE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322400', 'FOURNITURES DE MAGASIN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('322500', 'FOURNITURES DE BUREAU', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('326000', 'EMBALLAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('326100', 'EMBALLAGES PERDUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('326500', 'EMBAL. RECUPER. NON IDENTIFIABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('326700', 'EMBALLAGES A USAGE MIXTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('331000', 'PRODUITS EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('331100', 'PRODUITS EN COURS P1', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('331200', 'PRODUITS EN COURS P2', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('335000', 'TRAVAUX EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('335100', 'TRAVAUX EN COURS T1', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('335200', 'TRAVAUX EN COURS T2', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('341000', 'ETUDES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('341100', 'ETUDE EN COURS E1', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('341200', 'ETUDE EN COURS E2', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('345000', 'PRESTATIONS DE SERVICES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('345100', 'PRESTATION DE SERVICES S1', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('345200', 'PRESTATION DE SERVICES S2', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('351000', 'PRODUITS INTERMEDIAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('351100', 'PRODUIT INTERMEDIAIRE (OU GRPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('351200', 'PRODUIT INTERMEDIAIRE (OU GRPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('355000', 'PRODUITS FINIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('355100', 'PRODUIT FINI (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('355200', 'PRODUIT FINI (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('358000', 'PROD. RESIDUELS (OU MAT. RECUP.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('358100', 'DECHETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('358500', 'REBUTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('358600', 'MATIERES DE RECUPERATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('371000', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('372000', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('391000', 'PROVIS. POUR DEPRECIAT. MAT. PREM.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('391100', 'MATIERE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('391200', 'MATIERE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('391700', 'FOURNITURE A, B, C...', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('392000', 'PROVIS. POUR DEPRECIAT. AUT. APPRO', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('392100', 'MATIERES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('392200', 'FOURNITURES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('392600', 'EMBALLAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('393000', 'PROV. DEPREC. EN-COURS PROD. BIENS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('393100', 'PRODUITS EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('393500', 'TRAVAUX EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('394000', 'PROV. DEPREC. EN-COURS PROD. SERV.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('394100', 'ETUDES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('394500', 'PRESTATIONS DE SERVICES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('395000', 'PROV. POUR DEPREC. STOCKS DE PROD.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('395100', 'PRODUITS INTERMEDIAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('395500', 'PRODUITS FINIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('397000', 'PROV. POUR DEPREC. STOCKS MARCHAN.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('397100', 'MARCHANDISE OU GROUPE A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('397200', 'MARCHANDISE OU GROUPE B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('401000', 'FOURNISSEURS DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('403000', 'FOURNISSEURS - EFFETS A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('404000', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('404100', 'FOURNISSEURS ACHATS D\'IMMOBILISAT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('404700', 'FOURNIS. D\'IMMOB. RETENUES DE GAR.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('405000', 'FOURNIS. D\'IMMOB. EFFETS A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('408000', 'FOURNIS. FACTURES NON PARVENUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('408100', 'FOURNISSEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('408400', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('408800', 'FOURNISSEURS INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409000', 'FOURNISSEURS DEBITEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409100', 'FOURNIS. AVANC. & ACOMPT. SUR CDES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409600', 'FOURN. CREAN. EMB. & MAT. A RENDRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409700', 'FOURNISSEURS AUTRES AVOIRS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409710', 'FOURNISSEURS D\'EXPLOITATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409740', 'FOURNISSEURS D\'IMMOBILISATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('409800', 'RABAIS REMISES RISTOUR. A OBTENIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('410000', 'CLIENTS ET COMPTES RATTACHES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('411000', 'CLIENTS DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('413000', 'CLIENTS EFFETS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('416000', 'CLIENTS DOUTEUX OU LITIGIEUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('417000', 'CREANC. SUR TRAV. NON ENCORE FACT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('418000', 'CLIENTS PRODUITS NON ENCORE FACT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('418100', 'CLIENTS FACTURES A ETABLIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('418800', 'CLIENTS INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('419000', 'CLIENTS CREDITEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('419100', 'CLTS AVANC. & ACOMP. RECUS SUR CDE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('419600', 'CLTS DETT. POUR EMB. & MAT. CONSIG', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('419700', 'CLIENTS - AUTRES AVOIRS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('419800', 'RABAIS REMISES RIST. A ACCORDER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('421000', 'PERSONNEL REMUNERATIONS DUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('422000', 'COMITES D\'ENTREPRISE, D\'ETABLIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('424000', 'PARTICIP. DES SALAR. AUX RESULTATS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('424600', 'RESERVE SPECIALE (ART L442.2)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('424800', 'COMPTES COURANTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('425000', 'PERSONNEL AVANCES ET ACOMPTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('426000', 'PERSONNEL DEPOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('427000', 'PERSONNEL OPPOSITIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('428000', 'PERS. CHARG. A PAY. & PROD. A REC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('428200', 'DETTES PROVISIO. POUR CONGES PAYES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('428400', 'DETT. PROV. PART. SAL. AUX RESULT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('428600', 'AUTRES CHARGES A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('428700', 'PRODUITS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('438000', 'ORG. SOC. CHARG. A PAY. & PROD.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('438200', 'CHARGES SOCIALES SUR CONGES PAYES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('438700', 'PRODUITS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('441000', 'ETATS SUBVENTIONS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('441100', 'SUBVENTIONS D\'INVESTISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('441700', 'SUBVENTIONS D\'EXPLOITATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('441800', 'SUBVENTIONS D\'EQUILIBRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('441900', 'AVANCES SUR SUBVENTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('442000', 'ETAT IMP. & TAX. RECOUV. SUR TIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('442400', 'OBLIGATAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('442500', 'ASSOCIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('443000', 'OPERATIONS PART. AVEC L\'ETAT,...', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('443100', 'CREANCES ETAT SUPPR. DECAL. TVA', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('443800', 'INTERES COURUS CREANCES CPTE 443100', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('444000', 'ETAT IMPOTS SUR LES BENEFICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('444500', 'ETAT TAXES SUR LE CHIFFRE D\'AFF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445200', 'TVA DUE INTRACOMMUNAUTAIRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445510', 'TVA A DECAISSER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445580', 'TAXES ASSIMILEES A TVA', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445600', 'TAXES SUR LE CA DEDUCTIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445621', 'TVA SUR IMMO. 5.5%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445622', 'TVA SUR IMMO. 20.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445623', 'TVA SUR IMMO. 19.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445630', 'TVA TRANSFEREE PAR D\'AUTRES ETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445662', 'TVA DEDUCTIBLE 20.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445670', 'CREDIT DE TVA A REPORTER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445680', 'TAXES ASSIMILEES A LA TVA', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445700', 'TAXE SUR LE C.A. COLLECT. ENTREPR.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445712', 'TVA COLLECTEE 20.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445800', 'TAXES SUR CA A REGULAR. OU EN ATT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445810', 'ACOMPTES REGIME SIMPLIFIE D\'IMPOS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445820', 'ACOMPTES REGIME DU FORFAIT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445830', 'REMBOURS. TAXES SUR CA DEMANDE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445840', 'TVA RECUPEREE D\'AVANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445861', 'TVA EN ATTENTE DEDUCTIBLE 5.5%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445862', 'TVA EN ATTENTE DEDUCTIBLE 20.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445863', 'TVA EN ATTENTE DEDUCTIBLE 19.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445871', 'TVA EN ATTENTE COLLECTEE 5.5%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445872', 'TVA EN ATTENTE COLLECTEE 20.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445873', 'TVA EN ATTENTE COLLECTEE 19.6%', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('446000', 'TITRES SUR TVA', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('446100', 'OBLIGATIONS CAUTIONNEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('446900', 'CREANCE TVA DECALAGE D\'UN MOIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('447000', 'AUTRES IMPOTS, TAX. ET VERS. ASSIM', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('448000', 'ETAT CHARG. A PAY. & PROD. A RECEV', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('448200', 'CHARGES FISCALES SUR CONG. A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('448600', 'AUTRES CHARGES A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('448700', 'PRODUITS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('451000', 'GROUPE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('455000', 'ASSOCIES COMPTES COURANTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('455100', 'PRINCIPAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('455780', 'TAXES ASSIMILEES A LA TVA', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('455800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456000', 'ASSOCIES OPERATIONS SUR LE CAPITAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456100', 'ASSOCIES COMPTES D\'APPORT EN STE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456110', 'APPORTS EN NATURE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456150', 'APPORTS EN NUMERAIRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456200', 'APPORTEURS CAPIT. APPELE NON VERSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456210', 'ACTION. CAP. SOUSC. APP. NON VERSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456250', 'ASSOCIES CAPITAL APPELE NON VERSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456300', 'ASSOC. VERS. RECUS SUR AUGM. CAPIT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456400', 'ASSOCIES VERSEMENTS ANTICIPES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456600', 'ACTIONNAIRES DEFAILLANTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('456700', 'ASSOCIES CAPITAL A REMBOURSER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('457000', 'ASSOCIES DIVIDENDES A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('458000', 'ASSOC. OPERAT. EN COMMUN ET EN GIE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('458100', 'OPERATIONS COURANTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('458800', 'INTERETS COURUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('462000', 'CREANCES SUR CESSIONS D\'IMMOBILIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('464000', 'DETTES SUR ACQUIS. VALEURS MOBI.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('465000', 'CREANC. SUR CESSIONS VALEURS MOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('467000', 'AUTRES COMPTES DEBIT. OU CREDIT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('467200', 'DEBOURS PAYES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('468000', 'DIVERS CHARG. A PAY. & PROD. A REC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('468600', 'CHARGES A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('468700', 'PRODUITS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('471000', 'COMPTES D\'ATTENTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('471100', 'REIMPUTATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('476000', 'DIFFERENCES DE CONVERSION ACTIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('476100', 'DIMINUTION DES CREANCES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('476200', 'AUGMENTATION DES DETTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('476800', 'DIFFER. COMPENS. PAR COUV. CHANGE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('477000', 'DIFFERENCES DE CONVERSION PASSIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('477100', 'AUGMENTATION DES CREANCES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('477200', 'DIMINUTION DES DETTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('477800', 'DIFFER. COMPENS. PAR COUV. CHANGE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('478000', 'AUTRES COMPTES TRANSITOIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('481000', 'CHARG. A REPART. SUR PLUS. EXERC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('481100', 'CHARGES DIFFEREES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('481200', 'FRAIS D\'ACQUISITION DES IMMOBILIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('481600', 'FRAIS D\'EMISSION DES EMPRUNTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('481800', 'CHARGES A ETALER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('486000', 'CHARGES CONSTATEES D\'AVANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('487000', 'PRODUITS CONSTATES D\'AVANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('488000', 'CPTES REPART. PERIO. CHARG. & PROD', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('488600', 'CHARGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('488700', 'PRODUITS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('491000', 'PROVIS. POUR DEPREC. CPTES CLIENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('495000', 'PROV. POUR DEPREC. CPTES GRPE ASS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('495100', 'COMPTES DU GROUPE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('495500', 'COMPTES COURANTS DES ASSOCIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('495800', 'OPERAT. FAITES EN COMMUN & EN GIE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('496000', 'PROVIS. POUR DEPREC. CPTES DEBIT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('496200', 'CREANCES SUR CESSIONS D\'IMMOBILIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('496500', 'CREANC. SUR CESSIONS VALEURS MOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('496700', 'AUTRES COMPTES DEBITEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('501000', 'PARTS DANS DES ENTREPRISES LIEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('502000', 'ACTIONS PROPRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('503000', 'ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('503100', 'TITRES COTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('503500', 'TITRES NON COTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('504000', 'AUTRES TITRES CONFERANT DROIT PROP', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('505000', 'OBLIG. & BONS EMIS PAR LA SOCIETE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('506000', 'OBLIGATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('506100', 'TITRES COTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('506500', 'TITRES NON COTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('507000', 'BONS TRESOR & BONS CAISSE A CT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('508000', 'AUTRES VALEURS MOB. ET CREANC. ASS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('508100', 'AUTRES VALEURS MOBILIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('508200', 'BONS DE SOUSCRIPTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('508800', 'INTER. COURUS SUR OBLIGATIONS BONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('509000', 'VERS. A EFFECT. SUR VALEURS MOBIL.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('511000', 'VALEURS A L\'ENCAISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('511100', 'COUPONS ECHUS A L\'ENCAISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('511200', 'CHEQUES A ENCAISSER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('511300', 'EFFETS A L\'ENCAISSEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('511400', 'EFFETS A L\'ESCOMPTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512100', 'COMPTES EN MONNAIE NATIONALE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512400', 'COMPTES EN DEVISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('514000', 'CHEQUES POSTAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('515000', 'CAISSES DU TRESOR ET ETS PUBLICS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('516000', 'SOCIETE DE BOURSE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('517000', 'AUTRES ORGANISMES FINANCIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('518000', 'INTERETS EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('518600', 'INTERETS COURUS A PAYER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('518700', 'INTERETS COURUS A RECEVOIR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('519000', 'CONCOURS BANCAIRES COURANTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('519100', 'CREDIT MOBIL. CREANC. CCIALES CMCC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('519300', 'MOBIL. CREANCES NEES A L\'ETRANGER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('519800', 'INT. COURUS SUR CONCOURS BANCAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('520000', 'INSTRUMENTS DE TRESORERIE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('531000', 'CAISSE SIEGE SOCIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('531100', 'CAISSE EN MONNAIE NATIONALE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('531400', 'CAISSE EN DEVISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('532000', 'CAISSE SUCCURSALE (OU USINE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('533000', 'CAISSE SUCCURSALE (OU USINE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('580100', 'VIREMENT DE TRESORERIE A TRESORERIE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('590000', 'PROVIS. POUR DEPREC. VALEURS MOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('590300', 'ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('590400', 'AUTRES TIT. CONFERANT DROIT PROP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('590600', 'OBLIGATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('590800', 'AUTRES VALEURS MOB. & CREANC. ASS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('601100', 'MATIERE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('601200', 'MATIERE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('601700', 'FOURNITURES A, B, C...', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602000', 'ACHATS STOCKES AUTRES APPROV.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602100', 'MATIERES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602110', 'MATIERE (OU GROUPE) C', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602120', 'MATIERE (OU GROUPE) D', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602200', 'FOURNITURES CONSOMMABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602210', 'COMBUSTIBLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602220', 'PRODUITS D\'ENTRETIEN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602230', 'FOURNITURES D\'ATELIER / USINES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602240', 'FOURNITURES DE MAGASINS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602250', 'FOURNITURES DE BUREAU', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602600', 'EMBALLAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602610', 'EMBALLAGES PERDUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602650', 'EMBALL. RECUPERA. NON IDENTIF.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('602670', 'EMBALLAGES A USAGE MIXTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('603000', 'VARIATION DES STOCKS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('603100', 'VARIAT. STOCKS MAT. PREM. ET FOURN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('603200', 'VARIAT. STOCKS AUTRES APPROVISION.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('603700', 'VARIATION STOCKS DE MARCHANDISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('604000', 'ACHATS ETUDES ET PRESTAT. SERVICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('605000', 'ACHATS MATERIEL EQUIPEM. TRAVAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606000', 'ACHATS NON STOCKES DE MAT. PREM.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606400', 'FOURNITURES ADMINISTRATIVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606500', 'ACHATS SPECIAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606800', 'AUTRES MATIERES ET FOURNITURES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('607100', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('607200', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('608000', 'FRAIS ACCESSOIRES D\'ACHAT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609000', 'RABAIS REMISES RIST. SUR ACHATS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609100', 'DE MATIERES PREMIERES (ET FOURN.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609200', 'D\'AUTRES APPROVISIONN. STOCKES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609500', 'DE MATERIEL EQUIPEMENTS DE TRAVAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609600', 'D\'APPROVISIONNEMENTS NON STOCKES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609700', 'DE MARCHANDISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609800', 'RABAIS REMISES RIST. NON AFFECTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('612000', 'REDEVANCES DE CREDIT-BAIL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('612200', 'CREDIT-BAIL MOBILIER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('612500', 'CREDIT-BAIL IMMOBILIER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('613000', 'LOCATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('613600', 'MALIS SUR EMBALLAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('614000', 'CHARGES LOCATIVES & DE COPROPRIETE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('615200', 'SUR BIENS IMMOBILIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('615500', 'SUR BIENS MOBILIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('615600', 'MAINTENANCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616100', 'MULTIRISQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616200', 'ASSUR. OBLIGAT. DOMMAGE-CONSTRUCT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616300', 'ASSURANCE-TRANSPORT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616360', 'SUR ACHATS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616370', 'SUR VENTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616380', 'SUR AUTRES BIENS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616400', 'RISQUES D\'EXPLOITATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616500', 'INSOLVABILITE CLIENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('618000', 'DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('618100', 'DOCUMENTATION GENERALE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('618500', 'FRAIS DE COLLOQUES, SEMIN., CONFER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('619000', 'RABAIS REMISES RIST. SUR SERV. EXT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('621000', 'PERSONNEL EXTERIEUR A L\'ENTREPRISE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('621400', 'PERSONNEL DETACHE OU PRETE A L\'ETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622000', 'REMUNERAT. D\'INTERM. ET HONORAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622100', 'COMMISSIONS & COURTAGES SUR ACHATS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622200', 'COMMISSIONS & COURTAGES SUR VENTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622400', 'REMUNERATIONS DES TRANSITAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622500', 'REMUNERATIONS D\'AFFACTURAGE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622800', 'DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623000', 'PUBLICITE PUBLICAT. RELAT. PUBLIQ.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623100', 'ANNONCES ET INSERTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623200', 'ECHANTILLONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623300', 'FOIRES ET EXPOSITIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623500', 'PRIMES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623600', 'CATALOGUES ET IMPRIMES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623700', 'PUBLICATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623800', 'DIVERS (POURBOIRES, DONS COURANTS)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624000', 'TRANSP. BIENS & TRANSP. COLL. PERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624100', 'TRANSPORTS SUR ACHATS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624200', 'TRANSPORTS SUR VENTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624300', 'TRANSPORTS ENTRE ETS OU CHANTIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624400', 'TRANSPORTS ADMINISTRATIFS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624700', 'TRANSPORTS COLLECTIFS DU PERSONNEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('624800', 'DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625000', 'DEPLACEM. MISSIONS ET RECEPTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625500', 'FRAIS DE DEMENAGEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625700', 'RECEPTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627000', 'SERVICES BANCAIRES ET ASSIMILES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627100', 'FRAIS SUR TITRES (ACHAT, VENTE,.).', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627200', 'COMMISSIONS & FRAIS SUR EMPRUNTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627500', 'FRAIS SUR EFFETS (COMM. D\'ENDOS,.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627600', 'LOCATION DE COFFRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('627800', 'AUTRES FRAIS & COMM. PREST. SERV.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('628000', 'DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('628400', 'FRAIS DE RECRUTEMENT DU PERSONNEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('629000', 'RABAIS REMISES RIST. SUR SERV. EXT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631000', 'IMPOTS TAXES & VERS. SUR REMUNER.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631100', 'TAXE SUR LES SALAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631200', 'TAXE D\'APPRENTISSAGE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631300', 'PART. EMPLOY. A FORM. PROF. CONT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631400', 'COTIS. DEFAUT INVEST. DANS CONST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('631800', 'AUTRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633000', 'IMPOTS TAXES & VERS. SUR REMUNER.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633100', 'VERSEMENT SUR LE TRANSPORT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633200', 'ALLOCATION LOGEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633300', 'PART. EMPLOY. A FORM. PROF. CONT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633400', 'PART. EMPLOY. A EFFORT CONSTRUCT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633500', 'VERS. LIBERAT. A EXONER. TAXE APP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635000', 'AUTRES IMPOTS TAXES & VERS. ASS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635100', 'IMPOTS DIRECTS (SAUF IMPOT BENEF.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635120', 'TAXES FONCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635130', 'AUTRES IMPOTS LOCAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635140', 'TAXE SUR LES VEHICULES SOCIETES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635200', 'TAXES SUR CA NON RECUPERABLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635300', 'IMPOTS INDIRECTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635400', 'DROITS D\'ENREGISTREMENT ET TIMBRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635410', 'DROIT DE MUTATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635800', 'AUTRES DROITS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('637000', 'AUTRES IMPOTS TAXES ET VERS. ASS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('637100', 'CONTRIB. SOC. SOLID. A CHARGE STES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('637200', 'TAXES PERCUES PAR ORG. PUBLICS INT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('637400', 'IMPOTS & TAXES EXIGIB. A L\'ETRANG.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('637800', 'TAXES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641100', 'SALAIRES APPOINT. COMMIS. DE BASE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641200', 'CONGES PAYES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641300', 'PRIMES ET GRATIFICATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641400', 'SALAIRES, APPOINTEMENTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641500', 'SUPPLEMENT FAMILIAL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('644000', 'REMUNERATION TRAVAIL DE L\'EXPLOIT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647000', 'AUTRES CHARGES SOCIALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647100', 'PRESTATIONS DIRECTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647200', 'VERS. AUX COMITES D\'ETS & D\'ETAB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647300', 'VERS. AUX COMITES HYGIENE ET SECUR', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647400', 'VERSEMENTS AUX OEUVRES SOCIALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('647500', 'MEDECINE DU TRAVAIL, PHARMACIE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('648000', 'AUTRES CHARGES DE PERSONNEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('651000', 'REDEVANC. CONCESS. BREV. LICENC,..', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('651100', 'REDEV. CONCESS. BREV, LIC, MARQ,..', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('651600', 'DROITS D\'AUTEUR ET DE REPRODUCT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('651800', 'AUTRES DROITS & VALEURS SIMILAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('653000', 'JETONS DE PRESENCE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('654000', 'PERTES SUR CREANCES IRRECOUVRAB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('654100', 'CREANCES DE L\'EXERCICE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('654400', 'CREANCES DES EXERCICES ANTERIEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('655000', 'QUOTE-PARTS RESULT. OPER. EN COMM.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('655100', 'Q-P BENEF. TRANSF. (CPTA GERANT)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('655500', 'QUOTE-PART PERTE SUPP. (CPTA ASS)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('658000', 'CHARGES DIVERSES GESTION COURANTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661000', 'CHARGES D\'INTERETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661100', 'INTERETS DES EMPRUNTS ET DETTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661160', 'DES EMPRUNTS ET DETTES ASSIMILEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661170', 'DES DETTES RATT. A PARTICIPATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661500', 'INTERETS CPTES COUR. & DEP. CREDIT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661600', 'INTERETS BANC. & SUR OPER. FINANC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661700', 'INTERETS OBLIGATIONS CAUTIONNEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661800', 'INTERETS DES AUTRES DETTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661810', 'DES DETTES COMMERCIALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('661880', 'DES DETTES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('664000', 'PERTES CREANCES LIEES A PARTICIP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('665000', 'ESCOMPTES ACCORDES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('667000', 'CHARG. NETTES SUR CESS. VAL. MOBIL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('668000', 'AUTRES CHARGES FINANCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('668800', 'ECART DE CONVERSION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671000', 'CHARG. EXCEPT. SUR OPERAT. GESTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671100', 'PENALITES SUR MARCHES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671200', 'PENALITES AMENDES FISC. & PENALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671300', 'DONS, LIBERALITES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671400', 'CREANC. DEVEN. IRRECOUV. SUR BENEF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671500', 'SUBVENTIONS ACCORDEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671700', 'RAPPEL D\'IMPOTS (AUTRE QUE BENEF)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('671800', 'AUT. CHARG. EXCEP. SUR OPER. GEST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('672000', 'CHARGES SUR EXERCICES ANTERIEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('675000', 'VAL. COMPT. DES ELEM. ACTIF CEDES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('675100', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('675200', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('675600', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('675800', 'AUTRES ELEMENTS D\'ACTIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('678000', 'AUTRES CHARGES EXCEPTIONNELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('678100', 'MALIS PROVENANT DE CLAUSES INDEXAT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('678200', 'LOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('678300', 'MALIS DU RACHAT PAR ETS D\'ACTIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('678800', 'CHARGES EXCEPTIONNELLES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681100', 'DOTAT. AUX AMORT. DES IMMOB. CORPO', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681110', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681120', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681200', 'DOTAT. AUX AMORT. CHARG. EXPLOIT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681500', 'DOTAT. AUX PROV. RISQ. & CHARG. EX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681600', 'DOTAT. AUX PROV. DEPREC. IMMOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681610', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681620', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681700', 'DOTAT. AUX PROV. DEPREC. ACTIFS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681740', 'CREANCES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686000', 'DOTAT. AUX AMORT. ET AUX PROVIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686100', 'DOT. AUX AMORT. PRIME REMB. OBLIG.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686500', 'DOT. AUX PROV. RISQ. & CHARG. FIN.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686600', 'DOT. AUX PROV. DEPREC. ELEM. FINAN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686620', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686650', 'VALEURS MOBILIERES DE PLACEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('686800', 'AUTRES DOTATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687000', 'DOTAT. AUX AMORT. ET PROVISIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687100', 'DOTAT. AUX AMORT. EXCEPT. IMMOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687200', 'DOTAT. AUX PROV. REGLEM. (IMMOB)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687250', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687300', 'DOTAT. AUX PROV. REGLEM. (STOCKS)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687400', 'DOTAT. AUX AUTRES PROV. REGLEMENT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687500', 'DOTAT. PROV. RISQ. & CHARG. EXCEP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('691000', 'PARTICIPATIONS DES SALARIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('695200', 'CONTRIB. ADDITIO. IMPOT BENEFICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('695400', 'IMPOTS DUS A L\'ETRANGER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('696000', 'SUPPLEMENT D\'IMPOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('697000', 'IMPOSITION FORF. ANUELLE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('698000', 'INTEGRATION FISCALE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('698100', 'INTEGRATION FISCALE - CHARGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('698900', 'INTEGRATION FISCALE - PRODUITS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('699000', 'PRODUITS REP. EN ARR. DES DEFICITS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('701000', 'VENTES DE PRODUITS FINIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('701100', 'PRODUIT FINI (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('701200', 'PRODUIT FINI (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('702000', 'VENTES DE PRODUITS INTERMEDIAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('703000', 'VENTES DE PRODUITS RESIDUELS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('704000', 'TRAVAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('704100', 'TRAVAUX DE CATEG. (OU ACTIV.) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('704200', 'TRAVAUX DE CATEG. (OU ACTIV.) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('705000', 'ETUDES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('707100', 'MARCHANDISE (OU GROUPE) A', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('707200', 'MARCHANDISE (OU GROUPE) B', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708000', 'PRODUITS DES ACTIVITES ANNEXES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708100', 'PROD. SERV. EXPLOIT. INTER. PERSON', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708200', 'COMMISSIONS ET COURTAGES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708300', 'LOCATIONS DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708400', 'MISE A DISPOS. PERSONNEL FACTUREE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708500', 'PORTS ET FRAIS ACCESSOIRES FACT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708600', 'BONIS SUR REPRISES EMBALL. CONSIG.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708700', 'BONIFICAT. CLTS & PRIMES VENTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('708800', 'AUTRES PRODUITS ACTIVITES ANNEXES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709000', 'RABAIS REMISES RIST. ACCORD. A ETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709100', 'SUR VENTES DE PRODUITS FINIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709200', 'SUR VENTES PRODUITS INTERMEDIAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709400', 'SUR TRAVAUX', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709500', 'SUR ETUDES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709600', 'SUR PRESTATIONS DE SERVICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709700', 'SUR VENTES MARCHANDISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('709800', 'SUR PRODUITS ACTIVITES ANNEXES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713000', 'VARIAT. STOCKS (EN-COURS PRODUCT.)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713300', 'VARIATION EN-COURS PRODUC. BIENS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713310', 'PRODUITS EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713350', 'TRAVAUX EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713400', 'VARIATION EN-COURS PROD. SERVICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713410', 'ETUDES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713450', 'PRESTATIONS SERVICES EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713500', 'VARIATION STOCKS DE PRODUITS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713510', 'PRODUITS INTERMEDIAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713550', 'PRODUITS FINIS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('713580', 'PRODUITS RESIDUELS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('721000', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('722000', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('731000', 'PROD. NETS PART. SUR OP. EN COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('739000', 'PROD. NETS PART. SUR OP. TERMINEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('751000', 'REDEV. POUR CONCES. BREV. LIC....', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('751100', 'REDEV. POUR CONCES. BREV. LIC...', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('751600', 'DROITS D\'AUTEUR ET DE REPRODUCTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('751800', 'AUTRES DROITS & VALEURS SIMILAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('752000', 'REV. IMMEUB. NON AFFECT. ACT. PROF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('753000', 'JETONS PRESENCE ET REMUN. ADMINIST', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('754000', 'RISTOURNES PERCUES COOPERATIVES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('755000', 'QUOTES-PARTS RESULT. OP. EN COMMUN', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('755100', 'QUOTE-PART PERTE TRANSFEREE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('755500', 'QUOTE-PART BENEFICE ATTRIBUEE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('758000', 'PRODUITS DIVERS GESTION COURANTE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('761000', 'PRODUITS DE PARTICIPATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('761100', 'REVENUS TITRES DE PARTICIPATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('761600', 'REVENUS AUTRES FORMES PARTICIP.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('762000', 'PRODUITS AUTRES IMMOB. FINANC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('762100', 'REVENUS DES TITRES IMMOBILISES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('762400', 'REVENUS DES PRETS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('762700', 'REVENUS CREANCES IMMOBILISEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('763000', 'REVENUS DES AUTRES CREANCES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('763100', 'REVENUS CREANCES COMMERCIALES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('763800', 'REVENUS DES CREANCES DIVERSES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('764000', 'REVENUS VALEURS MOBIL. PLACEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('765000', 'ESCOMPTES OBTENUS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('767000', 'PROD. NETS SUR CESS. VALEURS MOB.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('767100', 'REVENUS CRE. RATT. PARTICIPATIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('768000', 'AUTRES PRODUITS FINANCIERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771000', 'PRODUITS EXCEPT. SUR OPER. GESTION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771100', 'DEDITS PENAL. SUR ACHATS & VENTES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771300', 'LIBERALITES PERCUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771400', 'RENTREES SUR CREANCES AMORTIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771500', 'SUBVENTIONS D\'EQUILIBRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771700', 'DEGREVEM. IMPOTS (AUT. IMP. BENEF)', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('771800', 'AUTRES PROD. EXCEPT. SUR OP. GEST.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('772000', 'PRODUITS SUR EXERCICES ANTERIEURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('775000', 'PRODUITS CESSIONS ELEMENTS D\'ACTIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('775100', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('775200', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('775600', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('775800', 'AUTRES ELEMENTS D\'ACTIF', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('777000', 'Q-P SUBV. INVEST. AU RESULT. EXERC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('778000', 'AUTRES PRODUITS EXCEPTIONNELS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('778100', 'BONIS PROVENANT CLAUSES D\'INDEXAT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('778200', 'LOTS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('778300', 'BONIS RACHAT PAR ETS ACT. & OBLIG.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('778800', 'PRODUITS EXCEPTIONNELS DIVERS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781000', 'REPRISES SUR AMORTISS. & PROVIS.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781100', 'REPRIS. AMORT. IMMOB. CORP. & INC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781110', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781120', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781500', 'REPRIS. PROVIS. RISQ. & CH. EXPLOI', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781600', 'REP. PROV. DEPREC. IMM. CORP & INC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781610', 'IMMOBILISATIONS INCORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781620', 'IMMOBILISATIONS CORPORELLES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781700', 'REPRIS. PROV. DEPREC. ACT. CIRCUL.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781730', 'STOCKS ET EN-COURS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('781740', 'CREANCES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('786000', 'REPRISES SUR PROVIS. POUR RISQUES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('786500', 'REP. PROV. RISQ. & CHARG. FINANC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('786600', 'REPRIS. PROV. DEPREC. ELEM. FINANC', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('786620', 'IMMOBILISATIONS FINANCIERES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('786650', 'VALEURS MOBILIERES DE PLACEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787000', 'REPRISES SUR PROVISIONS', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787200', 'REPRISES SUR PROV. REGLEMENTEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787250', 'AMORTISSEMENTS DEROGATOIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787260', 'PROVISION SPECIALE DE REEVALUATION', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787270', 'PLUS-VALUES REINVESTIES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787300', 'REPRISES SUR PROV. REGLEMENTEES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787400', 'REPRIS. SUR AUTRES PROV. REGLEMENT', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787500', 'REPRIS. PROV. RISQ. & CHARG. EXPL.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('787600', 'REPRIS. PROV. POUR DEPREC. EXCEPT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('791000', 'TRANSFERTS DE CHARGES D\'EXPLOIT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('796000', 'TRANSFERTS DE CHARGES FINANC.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('797000', 'TRANSFERTS DE CHARGES EXCEPT.', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('201000', 'FRAIS D\'ETABLISSEMENT', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('209000', 'SORTIE D\'IMMOBILISATION', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('474100', 'DIVERS A REINTEGRER', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('474200', 'BENEFICE SCM', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('475000', 'PLUS VALUES A COURT TERME', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('530000', 'CAISSE', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('760000', 'PRODUITS FINANCIERS', 'A', '', 'I', 'AR_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('770000', 'PRODUITS EXCEPTIONNELS', 'A', '', 'I', 'AR_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('530010', 'CAISSE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('607000', 'ACHATS DE MARCHANDISES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622700', 'FRAIS D\'ACTES ET DE CONTENTIEUX', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('438600', 'AUTRES CHARGES A PAYER', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('473000', 'DIVERS A DEDUIRE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('613200', 'LOCATIONS IMMOBILIERES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('616000', 'PRIMES D\'ASSURANCE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('633800', 'AUTRES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('695000', 'IMPOTS SUR LES BENEFICES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('108100', 'COMPTE DE LEXPLOITANT', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512030', 'EPARGNE', 'A', '', 'A', 'AR_paid:AP_paid');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('100000', 'CLASSE 1', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('300000', 'CLASSE 3', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('500000', 'CLASSE 5', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('600000', 'CLASSE 6', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('700000', 'CLASSE 7', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('108000', 'COMPTE DE LEXPLOITANT', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('200001', 'IMMOBILISATION', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('200000', 'CLASSE 2', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('400001', 'FOURNISSEURS ET COMPTES RATTACHES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('400000', 'CLASSE 4', 'H', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('695100', 'IMPOTS DUS EN FRANCE', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('646000', 'COTIS. SOCIAL. PERSON. EXPLOITANT', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645000', 'CHARGES DE SECUR. SOC. ET PREVOY.', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('617000', 'ETUDES ET RECHERCHES', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('615000', 'ENTRETIEN ET REPARATIONS', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('613500', 'LOCATIONS MOBILIERES', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('611000', 'SOUS-TRAITANCE GENERALE', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('695500', 'DEBOURS PAYES POUR LE COMPTE', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('690000', 'PARTICIP. SAL. / IMPOTS SUR BEN.', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('687600', 'DOTAT. AUX PROV. DEPREC. EXCEPT.', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681000', 'DOTATIONS AUX AMORT. & AUX PROVIS.', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('628100', 'CONCOURS DIVERS (COTISATIONS,...)', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625600', 'MISSIONS', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645800', 'COTISATIONS AUX AUTRES ORG. SOC.', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('641000', 'REMUNERATIONS DU PERSONNEL', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625020', 'DEPLACEMENTS MOTO', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('622600', 'HONORAIRES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('621100', 'PERSONNEL INTERIMAIRE', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445500', 'TAXES SUR CA A DECAISSER', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('706000', 'PRESTATIONS DE SERVICES', 'A', '', 'I', 'IC_income');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('707000', 'VENTES DE MARCHANDISES', 'A', '', 'I', 'IC_sale');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445713', 'TVA COLLECTEE 19.6%', 'A', '', 'I', 'AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512020', 'BANQUE DEBIT', 'A', '', 'E', 'AP');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445711', 'TVA COLLECTEE 5.5%', 'A', '', 'I', 'AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445661', 'TVA DEDUCTIBLE 5.5%', 'A', '', 'E', 'AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512010', 'BANQUE CREDIT', 'A', '', 'I', 'AR:AR_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('681730', 'STOCKS ET EN-COURS', 'A', '', 'A', 'IC');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('580010', 'VIREMENT INTERNE', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('580000', 'VIREMENT INTERNE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('766000', 'GAINS DE CHANGE', 'A', '', 'I', 'AR_amount:IC_income');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('472000', 'MOINS VALUES A COURT TERME', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('474000', 'DEFICIT SCM', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('670000', 'CHARGES FINANCIERES', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645100', 'COTISATIONS A L\'URSSAF', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645200', 'COTISATIONS AUX MUTUELES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645300', 'COTISATIONS AUX CAISSES RETR.', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('646400', 'COTISATIONS AUX ASSEDIC', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('623400', 'CADEAUX A LA CLIENTELE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('437000', 'AUTRES ORGANISMES SOCIAUX', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606100', 'FOURNITURES NON STOCK. EAU ENERG.', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('606300', 'FOURNIT. ENTRETIEN & PETIT EQUIP.', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625010', 'DEPLACEMENTS AUTO', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('635110', 'TAXE PROFESSIONNELLE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('645001', 'CSG', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('660000', 'CHARGES FINANCIERES', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('666000', 'PERTES DE CHANGE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512040', 'EXPLOITANT', 'A', '', 'E', 'AP_paid');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('431000', 'SECURITE SOCIALE', 'A', '', 'E', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('609400', 'D\'ETUDES & PRESTATIONS DE SERVICES', 'A', '', '', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('625100', 'VOYAGES ET DEPLACEMENTS', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('618300', 'DOCUMENTATION TECHNIQUE', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('445663', 'TVA DEDUCTIBLE 19.6%', 'A', '', 'E', 'AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('601000', 'ACHATS STOCKES MAT. PREM. (FOURN.)', 'A', '', 'E', 'AP_amount:IC_cogs');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('626000', 'FRAIS POSTAUX ET TELECOMMUNIC.', 'A', '', 'E', 'AP_amount');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('512000', 'BANQUE', 'A', '', 'A', 'AR_paid:AP_paid');
+--
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('999000', 'Foreign Exchange Gain', 'A', '', 'I', '');
+INSERT INTO "chart" ("accno", "description", "charttype", "gifi_accno", "category", "link") VALUES ('999010', 'Foreign Exchange Loss', 'A', '', 'E', '');
+--
+-- insert taxes
+--
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '445661'), 0.055);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '445663'), 0.196);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '445711'), 0.055);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '445713'), 0.196);
+--
+-- update defaults
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '681730'), income_accno_id = (select id from chart where accno = '707000'), expense_accno_id = (select id from chart where accno = '601000'), fxgain_accno_id = (select id from chart where accno = '999000'), fxloss_accno_id = (select id from chart where accno = '999010'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'EUR', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/German-Sample-chart.sql b/sql-ledger/sql/German-Sample-chart.sql
new file mode 100644
index 000000000..3ebfdec46
--- /dev/null
+++ b/sql-ledger/sql/German-Sample-chart.sql
@@ -0,0 +1,216 @@
+-- Einfacher Deutscher Kontenrahmen => Very Easy German Default Chart
+-- Vorbereitet von / Prepared by Paul Tammes May 9th, 2002. Kommentar / Comments : finance@bermuda-holding.com
+-- Englische Texte für eigene Zwecke und um Refernz in SQL-Ledger Dokumentation zu erleichtern.
+-- English terms used mostly for my own reference and to make lookup in SQL-Ledger documentation easier.
+-- GIFI-codes werden benutzt/misbraucht um die art der Rechnung zu deuten, Fehler nicht ausgeschlossen denn
+-- Ich bin kein Deutscher Steuerberater ;-(
+-- GIFI field codes re-used for following specs:
+-- Link: Achtung, sehr wenig benutzt da mir die Kentnisse zum Deutschen System fehlen. Sehr gut aufpassen und wenn
+-- Ihr Fehler oder Praktische TIPS hat: gerne!
+-- Link: used to a minimum, update and customization may well be needed!
+-- A0 = Anlagevermögen / Fixed Assets
+-- A1-1 = Warenbestand / Inventory
+-- A1-2 = Forderungen / Liabilities
+-- A1-3 = Liquide Mittel / Assets
+-- A1-4 = Aktive Rechnungsabgrenzung / Closing Account results
+-- E = Erträge / Income
+-- K0 = Wareneinsatz / COGS
+-- K1 = Personalkosten / Salaries etc
+-- K2 = Raumkosten / Rental etc
+-- K3 = Sonstige Kosten / Various costs
+-- NA = Neutrale Aufwendungen / Neutral Costs
+-- NE - Neutrale Erlöse / Neutral Income
+-- P0 = Eigenkapital / Equity
+-- P1 = Rückstellungen / Reserves
+-- P2 = Fremdkapital Langfristig / Liabilities Long Term
+-- P3 = Fremdkapital Kurzfristig / Liabilities Short Term
+-- P4 = Passive Rechnungsabgrenzung / Closing Account results
+--
+-- A0
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0000','ANLAGEVERMÖGEN','H','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0100','Konzessionen & Lizenzen','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0135','EDV-Programme','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0440','Maschinen','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0500','Betriebsausstattung','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0520','PKW','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0650','Büroeinrichtung','A','A0','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('0670','GWG','A','A0','A','');
+-- A1-1
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1100','WARENBESTAND','H','A1-1','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1140','Warenbestand','A','A1-1','A','IC');
+-- A1-2
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','FORDERUNGEN','H','A1-2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1201','Geleistete Anzahlungen','A','A1-2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1210','Forderungen ohne Kontokorrent','A','A1-2','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1300','Sonstige Forderungen','A','A1-2','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1400','Anrechenbare Vorsteuer','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1401','Anrechenbare Vorsteuer 7%','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1402','Vorsteuer ig Erwerb','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1403','Vorsteuer ig Erwerb 16%','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1405','Anrechenbare Vorsteuer 16%','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1406','Anrechenbare Vorsteuer 15%','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1433','bezahlte Einfuhrumsatzsteuer','A','A1-2','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1370','Ungeklärte Posten','A','A1-2','A','');
+-- A1-3
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1600','LIQUIDE MITTEL','H','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1601','Kasse','A','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1700','Postgiro','A','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','Bank','A','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1810','Bank USD','A','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Kreditkarten','A','A1-3','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1890','Geldtransit','A','A1-3','A','');
+-- A1-4
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1900','Aktive Rechnungsabgrenzung','A','A1-4','A','');
+-- P0
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','EIGENKAPITAL','H','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2001','Eigenkapital','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Privatentnahmen','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2150','Privatsteuern','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2180','Privateinlagen','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2200','Sonderausgaben beschr.abzugsf.','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2900','Gezeichnetes Kapital','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2910','Ausstehende Einlagen','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2970','Gewinnvortrag vor Verwendung','A','P0','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2978','Verlustvortrag vor Verwendung','A','P0','Q','');
+-- P1
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3000','RÜCKSTELLUNGEN','H','P1','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3030','Gewerbesteuerrückstellung','A','P1','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3070','Sonstige Rückstellungen','A','P1','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3095','Rückstellung für Abschlusskosten','A','P1','L','');
+-- P2
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3100','FREMDKAPITAL LANGFRISTIG','H','P2','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3160','Bankdarlehen','A','P2','L','');
+-- P3
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3200','FREMDKAPITAL KURZFRISTIG','H','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3280','Erhaltene Anzahlungen','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3310','Kreditoren ohne Kontokorrent','A','P3','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','Sonstige Verbindlichkeiten','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3560','Darlehen','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3700','Verbindl. Betr.steuern u.Abgaben','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3720','Verbindlichkeiten Löhne und Gehälter','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3730','Verbindlichkeiten Lohnsteuer','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3740','Verbindlichkeiten Sozialversicherung','A','P3','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3800','Umsatzsteuer','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3801','Umsatzsteuer 7%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3802','Umsatzsteuer ig. Erwerb','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3803','Umsatzsteuer ig. Erwerb 16%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3805','Umsatzsteuer 16%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3806','Umsatzsteuer 15%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3815','Umsatzsteuer nicht fällig 16%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3816','Umsatzsteuer nicht fällig 15%','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3820','Umsatzsteuer-Vorauszahlungen','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3841','Umsatzsteuer Vorjahr','A','P3','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+-- P4
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3900','Aktive Rechnungsabgrenzung','A','P4','L','');
+-- K0
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','WARENEINGANG','H','K0','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5200','Wareneingang ohne Vorsteuer','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5300','Wareneingang 7%','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','Wareneingang 15%','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','ig.Erwerb 7% VoSt. und 7% USt.','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5425','ig.Erwerb 15% VoSt. und 15% USt.','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5731','Erhaltene Skonti 7% Vorsteuer','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5736','Erhaltene Skonti 15% Vorsteuer','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Anschaffungsnebenkosten','A','K0','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5900','Fremdarbeiten','A','K0','E','AP_amount:IC_cogs:IC_expense');
+-- K1
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6000','PERSONALKOSTEN','H','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6001','Personalkosten','H','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6010','Löhne','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6020','Gehälter','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6030','Aushilfslöhne','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6040','Lohnsteuer Aushilfen','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6080','Vermögenswirksame Leistungen','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6090','Fahrtkostenerst.Whg./Arbeitsstätte','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6110','Sozialversicherung','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6120','Berufsgenossenschaft','A','K1','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6130','Freiw. Soz. Aufw. LSt- u. Soz.Vers.frei','A','K1','E','');
+-- K2
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6300','RAUMKOSTEN','H','K2','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6310','Miete','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6315','Pacht','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6320','Heizung','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6325','Gas Strom Wasser','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6330','Reinigung','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6335','Instandhaltung betriebliche Räume','A','K2','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6345','Sonstige Raumkosten','A','K2','E','AP_amount:IC_expense');
+-- K3
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6400','SONSTIGE KOSTEN','H','K3','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6402','Abschreibungen','A','K3','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6403','Kaufleasing','A','K3','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6404','Sofortabschreibung GWG','A','K3','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6405','Sonstige Kosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6410','Versicherung','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6420','Beiträge und Gebühren','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6430','Sonstige Abgaben','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470','Rep. und Instandhaltung BGA','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6520','Kfz-Versicherung','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6530','Lfd. Kfz-Kosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6540','Kfz-Reparaturen','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6560','Fremdfahrzeuge','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6570','Sonstige Kfz-Kosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6600','Werbung','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6610','Kundengeschenke bis DM 75.','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6620','Kundengeschenke über DM 75.-','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6630','Repräsentationkosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6640','Bewirtungskosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6644','Nicht abzugsf.Bewirtungskosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6650','Reisekosten Arbeitnehmer','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6660','Reisekosten Arbeitnehmer 12.3%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6665','Reisekosten Arbeitnehmer 9.8%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6670','Reisekosten Unternehmer','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6680','Reisekosten Unternehmer 12.3%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6685','Reisekosten Unternehmer 9.8%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6688','Reisekosten Unternehmer 5.7%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6690','Km-Geld-Erstattung 8.2%','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6710','Verpackungsmaterial','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6740','Ausgangsfrachten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6780','Fremdarbeiten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6800','Porto','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6805','Telefon','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6815','Bürobedarf','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6820','Zeitschriften & Bücher','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6825','Rechts- und Beratungskosten','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6835','Mieten für Einrichtungen','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6840','Mietleasing','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6845','Werkzeuge und Kleingeräte','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6850','Betriebsbedarf','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6852','Gastättenbedarf','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6855','Nebenkosten des Geldverkehrs','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6880','Aufwendungen aus Kursdifferenzen','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6885','Erlöse aus Anlageverk.(Buchverlust)','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7610','Gewerbesteuer','A','K3','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7685','Kfz-Steuer','A','K3','E','AP_amount:IC_cogs:IC_expense');
+-- E
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8100','ERTRÄGE','H','E','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8120','Steuerfreie Umsätze 4 Nr. 1a UStG.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8125','Steuerfreie ig. Lieferungen 1b UStG.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8200','Erlöse ohne Umsatzsteuer','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8300','Erlöse 7% Umsatzsteuer','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8400','Erlöse 15% Umsatzsteuer','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8500','Provisionserlöse','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8630','Entnahme sonstg. Leistungen 7% USt.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8640','Entnahme sonstg. Leistungen 15% USt.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8731','Gew. Skonti 7% USt.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8736','Gew. Skonti 15% USt.','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8840','Erträge aus Kursdifferenzen','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8845','Erlöse aus Anlageverk. (Buchgewinn)','A','E','I','AR_amount:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8900','Erträge aus Abgang von Anlageverm.','A','E','I','AR_amount:IC_sale:IC_income');
+-- NA
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9300','NEUTRALE AUFWENDUNGEN','H','NA','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9310','Zinsen kurzfr. Verbindlichkeiten','A','NA','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9320','Zinsen langfr. Verbindlichkeiten','A','NA','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9500','Ausserordentl.Aufwendungen','A','NA','E','');
+-- NE
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9600','NEUTRALE ERTRÄGE','H','NE','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9610','Guthabenzinsen','H','NE','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9700','Ausserordentl.Erträge','H','NE','I','');
+--
+-- Default settings
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3801'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3805'),0.16);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3806'),0.15);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1140'), income_accno_id = (select id from chart where accno = '8120'), expense_accno_id = (select id from chart where accno = '5800'), fxgain_accno_id = (select id from chart where accno = '8840'), fxloss_accno_id = (select id from chart where accno = '6880'), invnumber = '0000', sonumber = '0000', ponumber = '0000', curr = 'EUR', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/German-Sample-gifi.sql b/sql-ledger/sql/German-Sample-gifi.sql
new file mode 100644
index 000000000..78eaed4e7
--- /dev/null
+++ b/sql-ledger/sql/German-Sample-gifi.sql
@@ -0,0 +1,19 @@
+-- Einfacher Kontoplan für Deutschland
+--
+INSERT INTO gifi (accno,description) VALUES ('A0', 'Anlagevermögen');
+INSERT INTO gifi (accno,description) VALUES ('A1-1', 'Warenbestand');
+INSERT INTO gifi (accno,description) VALUES ('A1-2', 'Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('A1-3', 'Liquide Mittel');
+INSERT INTO gifi (accno,description) VALUES ('A1-4', 'Aktive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('E', 'Erträge');
+INSERT INTO gifi (accno,description) VALUES ('K0', 'Wareneinsatz');
+INSERT INTO gifi (accno,description) VALUES ('K1', 'Personalkosten');
+INSERT INTO gifi (accno,description) VALUES ('K2', 'Raumkosten');
+INSERT INTO gifi (accno,description) VALUES ('K3', 'Sonstige Kosten');
+INSERT INTO gifi (accno,description) VALUES ('NA', 'Neutrale Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('NE', 'Neutrale Erlöse');
+INSERT INTO gifi (accno,description) VALUES ('P0', 'Eigenkapital');
+INSERT INTO gifi (accno,description) VALUES ('P1', 'Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('P2', 'Fremdkapital Langfristig');
+INSERT INTO gifi (accno,description) VALUES ('P3', 'Fremdkapital Kurzfristig');
+INSERT INTO gifi (accno,description) VALUES ('P4', 'Passive Rechnungsabgrenzung');
diff --git a/sql-ledger/sql/Germany-DATEV-SKR03-chart.sql b/sql-ledger/sql/Germany-DATEV-SKR03-chart.sql
new file mode 100644
index 000000000..126ce22fa
--- /dev/null
+++ b/sql-ledger/sql/Germany-DATEV-SKR03-chart.sql
@@ -0,0 +1,262 @@
+-- DATEV-SKR03 - Kontenrahmen
+-- Mon, 10 Feb 2003
+-- Yvonne Einberger
+
+
+-- Jetzt beginnt der Kontenrahmen !
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0002700','EDV-Software','A','A','','0002700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0010000','Fabrikbauten','A','A','','0010000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0011000','Garagen','A','A','','0011000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0011100','Außenanlagen','A','A','','0011100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0011200','Hof-und Wegebefestigung','A','A','','0011200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0011500','Andere Bauten','A','A','','0011500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0016500','Geschäftsbauten','A','A','','0016500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0008500','Grundstückswert eige.bebau.Grundst.','A','A','','0008500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0009000','Geschäftsbauten','A','A','','0009000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0017000','Fabrikbauten','A','A','','0017000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0017500','Garagen','A','A','','0017500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0017600','Außenanlage','A','A','','0017600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0021000','Maschinen','A','A','','0021000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0022000','Maschinengebundene Werkzeuge','A','A','','0022000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0024000','Maschinelle Anlagen','A','A','','0024000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0028000','Betriebsvorrichtung','A','A','','0028000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0031000','Andere Anlagen','A','A','','0031000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0032000','PKW','A','A','','0032000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0035000','LKW','A','A','','0035000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0040000','Betriebsausstattung','A','A','','0040000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0041000','Geschäftsausstattung','A','A','','0041000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0042000','Büroeinrichtung','A','A','','0042000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0043000','Ladeneinrichtung','A','A','','0043000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0049000','Sons.Betriebs- Geschäftsausstattung','A','A','','0049000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0050400','Ant.a.herr.o.m.Mehrh.bet.Ges.schaft','A','A','','0050400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0051300','Typisch stille Beteiligungen','A','A','','0051300');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0063100','- Restlaufzeit bis 1 Jahr','A','L','','0063100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0051600','Atypische stille Beteiligungen','A','A','','0051600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0064000','- Restlaufzeit 1 bis 5 Jahre','A','L','','0064000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0065000','- Restlaufzeit größer als 5 Jahre','A','L','','0065000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0099600','Pauschalwertb.m.Restlaufzeit v. 1J.','A','A','','0099600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0140000','Ford. a.Lieferungen und Leistungen','A','A','AR','0140000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0153000','Forderungen gegen Personal','A','A','','0153000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0154500','Umsatzsteuerforderungen','A','A','','0154500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0100000','Kasse','A','A','AR_paid:AP_paid','0100000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0120000','Bank','A','A','AR_paid:AP_paid','0120000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0096300','Körperschaftssteuerrückstellung','A','Q','','0096300');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0095700','Gewerbesteuerrückstellung','A','Q','','0095700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0051000','Beteiligungen','A','A','','0051000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0063000','Verbindl.gegenüber Kreditinstituten','A','L','','0063000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0097000','Sonstige Rückstellungen','A','L','','0097000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0097400','Rückstellungen für Gewährleistungen','A','L','','0097400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0097800','Aufwandsrückstellungen','A','L','','0097800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0099800','Einzelwertber.m.Restlaufzeit v.1 J.','A','A','','0099800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0146000','Zweifelhafte Forderungen','A','A','','0146000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0151100','Geleistete Anzahlungen 7%','A','A','','0151100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0151700','Geleistete Anzahlung 16%','A','A','','0151700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0152500','Kautionen','A','A','','0152500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0154000','Steuerüberzahlungen','A','A','','0154000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0157000','Abziehbare Vorsteuer','A','A','AR_tax:AP_tax','0157000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0160000','Verbindlichkeiten aus Lief.u.Leist.','A','L','AP','0160000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0174100','Verbindl.a.Lohn-und Kirchensteuer','A','L','','0174100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0178100','Umsatzsteuer-Vorauszahlung 1/11','A','L','','0178100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0178900','Umsatzsteuer laufendes Jahr','A','L','','0178900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0179000','Umsatzsteuer Vorjahr','A','L','','0179000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0179100','Umsatzsteuer frühere Jahre','A','L','','0179100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0180000','Privatentnahme allgemein','A','Q','','0180000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0189000','Privateinlagen','A','Q','','0189000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0211000','Zinsaufwendung f.kurzf.Verbindlichk','A','E','','0211000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0212000','Zinsaufwendung f.langf.Verbindlichk','A','E','','0212000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0221000','Kapitalertragssteuer','A','E','','0221000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0231000','Anlagenabgänge - bei Buchverlust','A','E','','0231000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0231500','Anlagenabgänge-Buchgewinn','A','I','','0231500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0237500','Grundsteuer','A','E','','0237500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0245000','Einstell.i.d.Pauschalwertbe.z.Forde','A','E','','0245000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0245100','Einstell.i.d.Einzelwertb.z.Forderun','A','E','','0245100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0250000','Außerordentliche Erträge','A','I','','0250000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0251000','Betriebsfremde Erträge n.außerorden','A','I','','0251000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0252000','Periodenfremde Erträge nicht außero','A','I','','0252000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0273000','Ertr.a.Herab.d.Pauschal.z.Forderung','A','I','','0273000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0273100','Ertr.a.Herab.d.Einzelw.z.Forderunge','A','I','','0273100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0273200','Ertr. aus abgeschriebenen Forderung','A','I','','0273200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0274200','Versicherungsentschädigungen','A','I','','0274200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0286800','Verlustvortrag nach Verwendung','A','L','','0286800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0286900','Vortrag auf neue Rechnungen','A','L','','0286900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0375000','Erhaltene Boni 7% Vorsteuer','A','I','','0375000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0376000','Erhaltene Boni 16% Vorsteuer','A','I','','0376000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0380000','Anschaffungsnebenkosten','A','E','IC_cogs:IC_expense','0380000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0385000','Zölle und Einfuhrabgaben','A','E','IC_cogs:IC_expense','0385000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0396000','Bestandsver.Roh-,Hilfs-.Betriebs.','A','E','','0396000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0397000','Bestand Roh-,Hilfs-,u.Betriebsstoff','A','A','IC','0397000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0399000','Verrechnete Stoffkosten','A','E','IC_cogs:IC_expense','0399000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0400000','Material-und Stoffverbrauch','A','E','IC_cogs:IC_expense','0400000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0410000','Löhne und Gehälter','A','E','AP_amount','0410000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0412500','Ehegattengehalt','A','E','AP_amount','0412500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0342000','Innergemein.Erwerb 7% VorSt u. Ust','A','E','AP_amount','0342000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0342500','Innergem.Erwerb 16% VorSt u. Ust','A','E','AP_amount','0342500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0373100','Erhaltene Skonti 7% Vorsteuer','A','I','AP_paid','0373100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0373500','Erhaltene Skonti 16% Vorsteuer','A','I','AP_paid','0373500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0330000','Wareneingang 7% Vorsteuer','A','E','AP_amount','0330000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0413000','Gesetzlich soziale Aufwendungen','A','E','AP_amount','0413000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0413800','Beiträge zur Berufsgenossenschaftr','A','E','AP_amount','0413800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0414500','Freiwillige sozi.Aufw.lohnsteuerfr.','A','E','AP_amount','0414500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0414900','Pauschale Lohnsteuera.sons.Bezüge','A','E','AP_amount','0414900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0416500','Aufwendung f.Altersversorgung','A','E','AP_amount','0416500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0417000','Vermögenswirksame Leistungen','A','E','AP_amount','0417000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0420000','Raumkosten','A','E','AP_amount:AP_tax','0420000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0417500','Fahrtkostenerst.Wohnung/Arbeitsstät','A','E','AP_amount','0417500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0419000','Aushilfslöhne','A','E','AP_amount','0419000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0419900','Lohnsteuer für Aushilfe','A','E','AP_amount','0419900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0159000','Durchlaufende Posten','A','A','','0159000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0422000','Pacht','A','E','AP_amount','0422000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0423000','Heizung','A','E','AP_amount','0423000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0424000','Gas,Strom, Wasser','A','E','AP_amount','0424000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0425000','Reinigung','A','E','AP_amount','0425000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0426000','Instandhaltung betrieb.Räume','A','E','AP_amount','0426000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0428000','Sonstige Raumkosten','A','E','AP_amount','0428000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0432000','Gewerbesteuer','A','E','AP_amount','0432000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0439000','Sonstige Abgaben','A','E','AP_amount','0439000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0453000','Laufende Kfz-Betriebskosten','A','E','AP_amount','0453000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0454000','Kfz-Reparaturen','A','E','AP_amount','0454000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0455000','Garagenmiete','A','E','AP_amount','0455000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0457000','Fremdfahrzeuge','A','E','AP_amount','0457000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0458000','Sonstige Kfz-Kosten','A','E','AP_amount','0458000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0461000','Werbekosten','A','E','AP_amount','0461000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0463000','Geschenke bis 40 EUR','A','E','AP_amount','0463000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0463500','Geschenke über 40 EUR','A','E','AP_amount','0463500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0464000','Repräsentationskosten','A','E','AP_amount','0464000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0465000','Bewirtungskosten','A','E','AP_amount','0465000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0465400','Nicht abzugsfähige Bewirtungskosten','A','E','AP_amount','0465400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0465500','Nicht abzugsfähige Betriebsausgaben','A','E','','0465500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0466300','Reisekosten Arbeitn.m.Vorsteuerabzu','A','E','AP_amount','0466300');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0466600','Reisekosten Arbeitn.Übernachtungsau','A','E','','0466600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0466800','Kilometerentgelderstattung Arbeitne','A','E','','0466800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0467400','Reisekosten Untern.Verpflegungsmehr','A','E','','0467400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0467600','Reisekosten Untern.Übernachtungsauf','A','E','','0467600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0467800','Kilometererstattungsgeld Unternehme','A','E','','0467800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0470000','Kosten der Warenabgabe','A','E','IC_cogs','0470000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0471000','Verpackungsmaterial','A','E','IC_cogs','0471000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0473000','Ausgangsfracht','A','E','IC_cogs','0473000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0475000','Transportversicherung','A','E','IC_cogs','0475000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0476000','Verkaufsprovision','A','E','IC_cogs','0476000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0478000','Fremdarbeiten','A','E','IC_cogs','0478000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0479000','Aufwand für Gewährleistungen','A','E','','0479000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0480900','Sonstige Reparaturen u.Instandhalt.','A','E','AP_amount','0480900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0481000','Mietleasing','A','E','AP_amount','0481000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0481500','Kaufleasing','A','E','AP_amount','0481500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0482000','AfA a.Aufw.f.d.Inga.u.Erw.Geschäfts','A','E','AP_amount','0482000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0482100','AfA a.Aufw.f.d.Währungsumst.a.Euro','A','E','AP_amount','0482100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0483000','Abschreibungen auf Sachanlagen','A','E','AP_amount','0483000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0485500','Sofortabschreibung GWG','A','E','AP_amount','0485500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0491000','Porto','A','E','AP_amount','0491000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0492000','Telefon','A','E','AP_amount','0492000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0492500','Telefax','A','E','AP_amount','0492500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0493000','Bürobedarf','A','E','AP_amount','0493000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0494000','Zeitschriften, Bücher','A','E','AP_amount','0494000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0494500','Fortbildungskosten','A','E','AP_amount','0494500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0494600','Freiwillige Sozialleistungen','A','E','','0494600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0495000','Rechts- und Beratungskosten','A','E','AP_amount','0495000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0495500','Buchführungskosten','A','E','AP_amount','0495500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0495700','Abschluß- und Prüfungskosten','A','E','AP_amount','0495700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0496000','Mieten für Einrichtungen','A','E','AP_amount','0496000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0497000','Nebenkosten des Geldverkehrs','A','E','','0497000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0498000','Betriebsbedarf','A','E','AP_amount','0498000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0498500','Werkzeuge und Kleingeräte','A','E','AP_amount','0498500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0498600','Sonstige Aufwendungen (Ausbuchung)','A','E','AP_amount','0498600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0136000','Geldtransit','A','A','','0136000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0705000','Unfertige Erzeugnisse','A','A','IC','0705000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0708000','Unfertige Leistungen','A','A','IC','0708000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0711000','Fertige Erzeugnisse (Bestand)','A','A','IC','0711000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0714000','Waren (Bestand)','A','A','IC','0714000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0873100','Gewährte Skonti 7% USt','A','I','AP_paid','0873100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0873500','Gewährte Skonti 16% USt.','A','I','AP_paid','0873500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0875000','Gewährte Boni 7% USt.','A','I','','0875000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0876000','Gewährte Boni 16% USt.','A','I','','0876000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0882000','Erlöse aus Anlageverkäufen 16%Ust','A','I','IC_sale','0882000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0895500','Umsatzsteuervergütungen','A','I','','0895500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0890500','Entnahme v. Gegenst.o.USt.','A','I','','0890500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0266000','Erträge aus Kursdifferenzen','A','I','','0266000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0215000','Aufwendungen aus Kursdifferenzen','A','E','','0215000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0850000','Provisionserlöse','A','I','AR_amount:IC_income','0850000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0830000','Erlöse 7%USt','A','I','AR_amount:IC_sale:IC_income','0830000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0840000','Erlöse 16% USt.','A','I','AR_amount:IC_sale:IC_income','0840000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0177100','Umsatzsteuer 7%','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','0177100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0177500','Umsatzsteuer 16%','A','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax','0177500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0178000','Umsatzsteuer-Vorauszahlungen','A','L','AP_amount','0178000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0157100','Abziebare Vorsteuer 7%','A','A','AP_tax:IC_taxpart:IC_taxservice:CT_tax','0157100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0398000','Bestand Waren','A','A','IC','0398000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0340000','Wareneingang 16% Vorsteuer','A','E','AP_amount:IC_cogs','0340000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0383000','Leergut','A','E','IC_cogs','0383000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0492700','Internetkosten','A','E','AP_amount:IC_expense','0492700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0451000','Kfz-Steuer','A','E','AP_amount','0451000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0452000','Kfz-Versicherungen','A','E','AP_amount','0452000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0492100','Telefon D1 Handy','A','E','AP_amount:IC_expense','0492000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0157500','Abziehbare Vorsteuer 16%','A','A','AP_tax:IC_taxpart:IC_taxservice:CT_tax','0157500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0900000','Saldenvorträge,Sachkonten','A','L','','0900000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0286000','Gewinnvortrag nach Verwendung','A','L','','0286000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0320000','Wareneingang o.Steuer','A','E','AP_amount','0320000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0084000','Kapitalrücklage','A','Q','','0084000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0086000','Gewinnvortrag vor Verwendung','A','Q','','0086000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0086800','Verlustvortrag vor Verwendung','A','L','','0086800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0086900','Vortrag auf neue Rechnungen','A','Q','','0086900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0081000','Ausstehende Einlagen a.d.gez.Kapital eingefordert','A','A','','0081000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0080100','Ausst.Einl.a.d.gezeichnete Kapital n.eingef.','A','A','','0080100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0093000','Sonderposten mit Rücklagenanteil steuerf.Rückl.','A','L','','0093000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0095000','Rückstellungen f.Pensionen u.ähnl.Verpflichtungen','A','Q','','0095000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0098300','Abgrenzung aktive latente Steuern','A','A','','0098300');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0098600','Damnum/Disagio','A','A','','0098600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0099200','Wertberichtigungen','A','A','','0099200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0016000','Bauten auf fremden Grundstücken','A','A','','0016000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0020000','Techn.Anlagen und Maschinen','A','A','','0020000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0030000','Andere Anlagen,Betrieb-und Geschäftsaus','A','A','','0030000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0050000','Finanzanlagen','A','A','','0050000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0060000','Verbindlichkeiten','A','L','','0060000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0080000','Gezeichnetes Kapital','A','Q','','0080000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0095500','Steuerrückstellung','A','Q','','0095500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0098000','Aktive Rechnungsabgrenzung','A','A','','0098000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0099000','Passive Rechnungsabgrenzung','A','L','','0099000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0134500','Eigene Anteile','A','A','','0134500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0134800','Sonstige Wertpapiere','A','A','','0134800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0150000','Sonstige Vermögensgegenstände','A','A','','0150000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0151000','Geleistete Anzahlung auf Vorräte','A','A','','0151000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0159400','Forderungen geg. verb. Unternehmen','A','A','','0159400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0171000','Erhaltene Anzahlungen-Verbindlichke','A','L','','0171000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0175500','Lohn-und Gehaltsverrechnung','A','L','','0175500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0210000','Zinsen und ähnl.Aufwendungen','A','E','','0210000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0230000','Sonstige Aufwendungen','A','E','','0230000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0240000','Forderungsverlust-übliche Höhe','A','E','','0240000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0260000','Erträge aus Beteiligten','A','I','','0260000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0262000','Erträge a.and.Wertpap.u.Ausl.des FinanzAV','A','I','','0262000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0265000','Sonstige Zinsen und ähnliche Erträg','A','I','','0265000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0270000','Sonstige Erträge','A','I','','0270000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0310000','Fremdleistungen','A','E','','0310000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0421000','Miete','A','E','AP_amount','0421000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0048000','Geringwertige WG bis 410EUR','A','A','AP_amount','0048000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0097700','Rückstellung.f.Abschluß-u.Prüfungskosten','A','L','','0097700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0087000','Festkapital','A','Q','','0087000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0088000','Variables Kapital','A','Q','','0088000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0093100','Sonderpost.m.Rücklageanteil nach §6bEStG','A','Q','','0093100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0093200','Sonderpost.m.Rücklageanteil n.35 EStR','A','Q','','0093200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0130000','Wechsel a. Lieferungen u.Leistungen','A','A','','0130000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0131000','Besitzwechsel geg.verb.Unternehmen','A','A','','0131000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0132000','Besitzw.geg.Untern.m.Beteiligungsve','A','A','','0132000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0132700','Finanzwechsel','A','A','','0132700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0133000','Schecks ','A','A','','0133000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0134000','Anteile verb.Untern.-Umlaufvermögen','A','A','','0134000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0272500','Erträge a.d.Abgang.v.Geg.d.UV','A','I','','0272500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0272000','Erträge a.d.Abgang v.Geg.d.AV','A','I','','0272000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0434000','Sonstige Betriebssteuern','A','E','AP_amount','0434000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0436000','Versicherungen','A','E','AP_amount','0436000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0438000','Beiträge','A','E','AP_amount','0438000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0450000','Fahrzugkosten','A','E','AP_amount','0450000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0700000','Unfertige Erzeugnisse unfert.Leistungen','A','A','','0700000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0900800','Saldenvorträge,Debitoren','A','L','','0900800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('0900900','Saldenvorträge,Kreditoren','A','L','','0900900');
+--
+-- Taxes
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '0397000'), income_accno_id = (select id from chart where accno = '0840000'), expense_accno_id = (select id from chart where accno = '0400000'), fxgain_accno_id = (select id from chart where accno = '0266000'), fxloss_accno_id = (select id from chart where accno = '0215000'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'EUR:USD', weightunit = 'kg';
+--
+INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157100'),0.07);
+INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0157500'),0.16);
+INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177100'),0.07);
+INSERT INTO tax (chart_id,rate) VALUES ((SELECT id FROM chart WHERE accno = '0177500'),0.16);
+
+
diff --git a/sql-ledger/sql/Germany-DATEV-SKR03-gifi.sql b/sql-ledger/sql/Germany-DATEV-SKR03-gifi.sql
new file mode 100644
index 000000000..36d11ab34
--- /dev/null
+++ b/sql-ledger/sql/Germany-DATEV-SKR03-gifi.sql
@@ -0,0 +1,550 @@
+-- DATEV SKR03
+--
+INSERT INTO gifi (accno,description) VALUES ('0000100', 'Aufwand Geschäftsbetrieb');
+INSERT INTO gifi (accno,description) VALUES ('0000200', 'Aufwendungen Umstellung a.d.Euro');
+INSERT INTO gifi (accno,description) VALUES ('0001000', 'Konzession,gewerb.Schutzre.u.Werten');
+INSERT INTO gifi (accno,description) VALUES ('0001500', 'Konzessionen');
+INSERT INTO gifi (accno,description) VALUES ('0002700', 'EDV-Software');
+INSERT INTO gifi (accno,description) VALUES ('0003500', 'Geschäfts-oder Firmenwert');
+INSERT INTO gifi (accno,description) VALUES ('0003800', 'Anzahlungen a.Geschäft-o.Firmenwert');
+INSERT INTO gifi (accno,description) VALUES ('0003900', 'Anz.a.immaterielle Vermögsgegenstän');
+INSERT INTO gifi (accno,description) VALUES ('0004000', 'Verschmelzungsmehrwert');
+INSERT INTO gifi (accno,description) VALUES ('0005000', 'Grundstücke,grundstücksgl.Rechte..');
+INSERT INTO gifi (accno,description) VALUES ('0006000', 'Grundstücke u.grundstgl.Rech.o.Baut');
+INSERT INTO gifi (accno,description) VALUES ('0008000', 'Bauten a.eig. Grundstücken,Grgl.Rec');
+INSERT INTO gifi (accno,description) VALUES ('0008500', 'Grundstückswert eige.bebau.Grundst.');
+INSERT INTO gifi (accno,description) VALUES ('0009000', 'Geschäftsbauten');
+INSERT INTO gifi (accno,description) VALUES ('0010000', 'Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0011000', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0011100', 'Außenanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0011200', 'Hof-und Wegebefestigung');
+INSERT INTO gifi (accno,description) VALUES ('0011500', 'Andere Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0012000', 'Geschäfts-,Fabrik-,andere Bau.imBau');
+INSERT INTO gifi (accno,description) VALUES ('0012900', 'Anz.Geschäfts-,Fabrik u. and.Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0015000', 'Wohnbauten im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0016000', 'Bauten auf fremden Grundstücken');
+INSERT INTO gifi (accno,description) VALUES ('0016500', 'Geschäftsbauten');
+INSERT INTO gifi (accno,description) VALUES ('0017000', 'Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0017500', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0017600', 'Außenanlage');
+INSERT INTO gifi (accno,description) VALUES ('0020000', 'Techn.Anlagen und Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0021000', 'Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0022000', 'Maschinengebundene Werkzeuge');
+INSERT INTO gifi (accno,description) VALUES ('0024000', 'Maschinelle Anlagen');
+INSERT INTO gifi (accno,description) VALUES ('0028000', 'Betriebsvorrichtung');
+INSERT INTO gifi (accno,description) VALUES ('0029000', 'Techn.Anlagen u.Maschinen im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0029900', 'Anz.a.techn.Anlagen und Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0030000', 'Andere Anlagen,Betrieb-Geschäftsaus');
+INSERT INTO gifi (accno,description) VALUES ('0031000', 'Andere Anlagen');
+INSERT INTO gifi (accno,description) VALUES ('0032000', 'PKW');
+INSERT INTO gifi (accno,description) VALUES ('0035000', 'LKW');
+INSERT INTO gifi (accno,description) VALUES ('0040000', 'Betriebsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0041000', 'Geschäftsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0042000', 'Büroeinrichtung');
+INSERT INTO gifi (accno,description) VALUES ('0043000', 'Ladeneinrichtung');
+INSERT INTO gifi (accno,description) VALUES ('0048000', 'Geringwertige Wirtschaftsg.b.800DM');
+INSERT INTO gifi (accno,description) VALUES ('0049000', 'Sons.Betriebs- Geschäftsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0049800', 'And. Anlagen,Betrieb/Geschäf.im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0049900', 'Anz.and.Anlagen,Betrieb.Geschäftsau');
+INSERT INTO gifi (accno,description) VALUES ('0050000', 'Anteile a.verb.Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0050400', 'Ant.a.herr.o.m.Mehrh.bet.Ges.schaft');
+INSERT INTO gifi (accno,description) VALUES ('0050500', 'Ausleihung an verb.Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0051000', 'Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0051300', 'Typisch stille Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0051600', 'Atypische stille Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0052000', 'Ausl.a.Untern.m.Beteiligungsverhält');
+INSERT INTO gifi (accno,description) VALUES ('0052500', 'Wertpapiere des Anlagevermögens');
+INSERT INTO gifi (accno,description) VALUES ('0054000', 'Sonstige Ausleihungen');
+INSERT INTO gifi (accno,description) VALUES ('0057000', 'Genossenschaftsan.z.langf.Verbleib');
+INSERT INTO gifi (accno,description) VALUES ('0059500', 'Rückdeckansp.Lebensvers.langf.Verbl');
+INSERT INTO gifi (accno,description) VALUES ('0060000', 'Anleihen-nicht konvertibel');
+INSERT INTO gifi (accno,description) VALUES ('0063000', 'Verbindl.gegenüber Kreditinstituten');
+INSERT INTO gifi (accno,description) VALUES ('0070000', 'Verbind.gegenüber verb.Unternehmern');
+INSERT INTO gifi (accno,description) VALUES ('0071500', 'Verbind.gegen.Untern.m.Beteili.Verh');
+INSERT INTO gifi (accno,description) VALUES ('0073000', 'Verbindlichkeiten gegen. Gesellscha');
+INSERT INTO gifi (accno,description) VALUES ('0076000', 'Darl.typ.stiller Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('0078000', 'Partiarische Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0080000', 'Gezeichnetes Kapital');
+INSERT INTO gifi (accno,description) VALUES ('0080100', 'Ausst.Einl.a.d.gezeichnete Kapital');
+INSERT INTO gifi (accno,description) VALUES ('0084000', 'Kapitalrücklage');
+INSERT INTO gifi (accno,description) VALUES ('0084600', 'Gesetzliche Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('0085000', 'Rücklage für eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('0085100', 'Satzungsmäßige Rücklagen');
+INSERT INTO gifi (accno,description) VALUES ('0086000', 'Gewinnvortrag vor Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0086800', 'Verlustvortrag vor Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0086900', 'Vortrag auf neue Rechnungen');
+INSERT INTO gifi (accno,description) VALUES ('0087000', 'Festkapital');
+INSERT INTO gifi (accno,description) VALUES ('0088000', 'Variables Kapital');
+INSERT INTO gifi (accno,description) VALUES ('0089000', 'Gesellschafter-Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0090000', 'Kommandit-Kapital');
+INSERT INTO gifi (accno,description) VALUES ('0091000', 'Verlustausgleichskonto');
+INSERT INTO gifi (accno,description) VALUES ('0092000', 'Gesellschafter-Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0093000', 'Sonderposten mit Rücklagenanteil');
+INSERT INTO gifi (accno,description) VALUES ('0093100', 'Sopo m.Rückl.ant.nach §6b EstG');
+INSERT INTO gifi (accno,description) VALUES ('0093200', 'Sopo m.Rückl.ant.Abschn.35 EstR');
+INSERT INTO gifi (accno,description) VALUES ('0093500', 'Sopo aus Währungsumstellung Euro');
+INSERT INTO gifi (accno,description) VALUES ('0094700', 'Sopo m.Rückl.ant. §7g Abs.1 EstG');
+INSERT INTO gifi (accno,description) VALUES ('0094800', 'Sopo m.Rückl.ant. §7g Abs.3,7 EstG');
+INSERT INTO gifi (accno,description) VALUES ('0095500', 'Steuerrückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0095700', 'Gewerbesteuerrückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0096300', 'Körperschaftssteuerrückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0096900', 'Rückstellung für latente Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0097000', 'Sonstige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0097400', 'Rückstellungen für Gewährleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0097600', 'Rücks.f.drohe.Verl.schweb.Geschäft');
+INSERT INTO gifi (accno,description) VALUES ('0097700', 'Rücks.f.Abschluß-u.Prüfungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0097800', 'Aufwandsrückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0098000', 'Aktive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('0098300', 'Abgrenzung aktive latente Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0098600', 'Damnum/Disagio');
+INSERT INTO gifi (accno,description) VALUES ('0099000', 'Passive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('0099200', 'Wertberichtigungen');
+INSERT INTO gifi (accno,description) VALUES ('0099600', 'Pauschalwertb.m.Restlaufzeit v. 1J.');
+INSERT INTO gifi (accno,description) VALUES ('0099800', 'Einzelwertber.m.Restlaufzeit v.1 J.');
+INSERT INTO gifi (accno,description) VALUES ('0100000', 'Kasse');
+INSERT INTO gifi (accno,description) VALUES ('0110000', 'Postbank');
+INSERT INTO gifi (accno,description) VALUES ('0120000', 'Bank');
+INSERT INTO gifi (accno,description) VALUES ('0121000', 'Dresdner Bank AG');
+INSERT INTO gifi (accno,description) VALUES ('0121009', 'Verrechnungskonto Dresdner Bank AG');
+INSERT INTO gifi (accno,description) VALUES ('0122000', 'Deutsche Bank AG');
+INSERT INTO gifi (accno,description) VALUES ('0130000', 'Wechsel a. Lieferungen u.Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('0131000', 'Besitzwechsel geg.verb.Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0132000', 'Besitzw.geg.Untern.m.Beteiligungsve');
+INSERT INTO gifi (accno,description) VALUES ('0132700', 'Finanzwechsel');
+INSERT INTO gifi (accno,description) VALUES ('0133000', 'Schecks (Eingang)');
+INSERT INTO gifi (accno,description) VALUES ('0133300', 'Schecks (Ausgang)');
+INSERT INTO gifi (accno,description) VALUES ('0133500', 'Überweisungen (unterwegs)');
+INSERT INTO gifi (accno,description) VALUES ('0134000', 'Anteile verb.Untern.-Umlaufvermögen');
+INSERT INTO gifi (accno,description) VALUES ('0134400', 'Anteil an herr.m.betei.Gesellschaft');
+INSERT INTO gifi (accno,description) VALUES ('0134500', 'Eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('0134800', 'Sonstige Wertpapiere');
+INSERT INTO gifi (accno,description) VALUES ('0136000', 'Geldtransit');
+INSERT INTO gifi (accno,description) VALUES ('0136100', 'Geldtransit (Überweisungen)');
+INSERT INTO gifi (accno,description) VALUES ('0136200', 'Geldtransit,Bankeinzug/Lastschrift');
+INSERT INTO gifi (accno,description) VALUES ('0136300', 'Scheck / Wechsel');
+INSERT INTO gifi (accno,description) VALUES ('0140000', 'Ford. a.Lieferungen und Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('0141100', 'Forderungssammelkonto Vorausre.');
+INSERT INTO gifi (accno,description) VALUES ('0141200', 'Forderungssammelkonto Anzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0146000', 'Zweifelhafte Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('0147000', 'Forder.a.Liefe.u.Leis.geg.verb.Unte');
+INSERT INTO gifi (accno,description) VALUES ('0147800', 'Wertb.a.Ford.m.Rest.1j.geg.verb.Unt');
+INSERT INTO gifi (accno,description) VALUES ('0148000', 'Lief.u.Leis.geg.Untern.m.Beteiligve');
+INSERT INTO gifi (accno,description) VALUES ('0148800', 'Wertb.a.Ford.m.Rest.1j.Beteiligungs');
+INSERT INTO gifi (accno,description) VALUES ('0149000', 'Forderung a.Leis.u.Lief.geg.Gesells');
+INSERT INTO gifi (accno,description) VALUES ('0150000', 'Sonstige Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('0150300', 'Forde.geg.Vorstandsm.u.Geschäftsfüh');
+INSERT INTO gifi (accno,description) VALUES ('0150800', 'Forderungen gegen Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('0151000', 'Geleistete Anzahlung auf Vorräte');
+INSERT INTO gifi (accno,description) VALUES ('0151100', 'Geleistete Anzahlungen 7%');
+INSERT INTO gifi (accno,description) VALUES ('0151700', 'Geleistete Anzahlung 16%');
+INSERT INTO gifi (accno,description) VALUES ('0152500', 'Kautionen');
+INSERT INTO gifi (accno,description) VALUES ('0153000', 'Forderungen gegen Personal');
+INSERT INTO gifi (accno,description) VALUES ('0154000', 'Steuerüberzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0154500', 'Umsatzsteuerforderungen');
+INSERT INTO gifi (accno,description) VALUES ('0154800', 'Vorsteuer im Folgejahr abziehbar');
+INSERT INTO gifi (accno,description) VALUES ('0154900', 'Körperschaftsteuerrückforderung');
+INSERT INTO gifi (accno,description) VALUES ('0155000', 'Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0156000', 'Aufzuteilende Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0156500', 'Aufzuteilende Vorsteuer 16%');
+INSERT INTO gifi (accno,description) VALUES ('0157000', 'Abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0157100', 'Abziebare Vorsteuer 7%');
+INSERT INTO gifi (accno,description) VALUES ('0157200', 'Abziehb. VorSt innergemein. Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('0157300', 'Abziehb.VorSt. innergem.Erwerb 16%');
+INSERT INTO gifi (accno,description) VALUES ('0157500', 'Abziehbare Vorsteuer 16%');
+INSERT INTO gifi (accno,description) VALUES ('0157800', 'Berichtigung d.Vorstabzugs früh.J.');
+INSERT INTO gifi (accno,description) VALUES ('0157900', 'Vorsteuer 0%');
+INSERT INTO gifi (accno,description) VALUES ('0158400', 'abziehb.VorSt IG Erwerb Neufahrzeug');
+INSERT INTO gifi (accno,description) VALUES ('0158800', 'Bezahlte Einfuhrumsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0159000', 'Durchlaufende Posten');
+INSERT INTO gifi (accno,description) VALUES ('0159400', 'Forderungen geg. verb. Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0159700', 'Ford.geg.Untern.m.Beteiligungsverh.');
+INSERT INTO gifi (accno,description) VALUES ('0160000', 'Verbindlichkeiten aus Lief.u.Leist.');
+INSERT INTO gifi (accno,description) VALUES ('0160100', 'Verbindlichkeiten a.Lief.und Leist.');
+INSERT INTO gifi (accno,description) VALUES ('0163000', 'Verbindl.Lief.u.Leist.gegü.verb.Unt');
+INSERT INTO gifi (accno,description) VALUES ('0164000', 'Verb.L.u.L gegü.Unter.Beteiligungsv');
+INSERT INTO gifi (accno,description) VALUES ('0165000', 'Verb.L.u.L gegü.Gesellschaftern');
+INSERT INTO gifi (accno,description) VALUES ('0166000', 'Schuldwechsel');
+INSERT INTO gifi (accno,description) VALUES ('0170000', 'Sonstige Verbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('0170500', 'Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0170900', 'Gewinnverfügungskonto stiller Ges.');
+INSERT INTO gifi (accno,description) VALUES ('0171000', 'Erhaltene Anzahlungen-Verbindlichke');
+INSERT INTO gifi (accno,description) VALUES ('0171100', 'Erhaltene,versteuert Anzahlungen 7%');
+INSERT INTO gifi (accno,description) VALUES ('0171700', 'Erhaltene,versteuerte Anzahl. 16%');
+INSERT INTO gifi (accno,description) VALUES ('0171900', 'Erhaltene Anzahlungen bis 1j.');
+INSERT INTO gifi (accno,description) VALUES ('0172200', 'Erhaltene Anzahlung');
+INSERT INTO gifi (accno,description) VALUES ('0172300', 'Verbindlichkeiten S-konto Vorausre.');
+INSERT INTO gifi (accno,description) VALUES ('0173200', 'Erhaltene Kautionen');
+INSERT INTO gifi (accno,description) VALUES ('0174100', 'Verbindl.a.Lohn-und Kirchensteuer');
+INSERT INTO gifi (accno,description) VALUES ('0175500', 'Lohn-und Gehaltsverrechnung');
+INSERT INTO gifi (accno,description) VALUES ('0175800', 'USt-Abzugsverfahren 16%');
+INSERT INTO gifi (accno,description) VALUES ('0175900', 'Ust 0%');
+INSERT INTO gifi (accno,description) VALUES ('0176000', 'Umsatzsteuer nicht fällig');
+INSERT INTO gifi (accno,description) VALUES ('0176100', 'Umsatzsteuer nicht fällig 7%');
+INSERT INTO gifi (accno,description) VALUES ('0176200', 'Umsatzsteuer nicht fällig EG Lief.');
+INSERT INTO gifi (accno,description) VALUES ('0177000', 'Umsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0177100', 'Umsatzsteuer 7%');
+INSERT INTO gifi (accno,description) VALUES ('0177200', 'Umsatzsteuer aus innergem. Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('0177300', 'Umsatzsteuer innergem.Erwerb 16%');
+INSERT INTO gifi (accno,description) VALUES ('0177500', 'Umsatzsteuer 16%');
+INSERT INTO gifi (accno,description) VALUES ('0177700', 'Ust aus im Inland stpfl. EG-Lief16%');
+INSERT INTO gifi (accno,description) VALUES ('0178000', 'Umsatzsteuer-Vorauszahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0178100', 'Umsatzsteuer-Vorauszahlung 1/11');
+INSERT INTO gifi (accno,description) VALUES ('0178300', 'In Rechn unberecht.ausgew.gesch Ust');
+INSERT INTO gifi (accno,description) VALUES ('0178400', 'Ust IG Erwerb Neufahrzeug o.Ust ID');
+INSERT INTO gifi (accno,description) VALUES ('0178800', 'Einfuhrumsatzsteuer augeschoben bis');
+INSERT INTO gifi (accno,description) VALUES ('0178900', 'Umsatzsteuer laufendes Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0179000', 'Umsatzsteuer Vorjahr');
+INSERT INTO gifi (accno,description) VALUES ('0179100', 'Umsatzsteuer frühere Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0179200', 'Sonstige Verrechnungskonten');
+INSERT INTO gifi (accno,description) VALUES ('0180000', 'Privatentnahme allgemein');
+INSERT INTO gifi (accno,description) VALUES ('0181000', 'Privatsteuern');
+INSERT INTO gifi (accno,description) VALUES ('0189000', 'Privateinlagen');
+INSERT INTO gifi (accno,description) VALUES ('0200000', 'Außerordentliche Aufwendung');
+INSERT INTO gifi (accno,description) VALUES ('0201000', 'Betriebsfremde Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0202000', 'Periodenfremde Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0210000', 'Zinsen und ähnl.Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0210300', 'Steuerl.abzugsfähig,and.Nebenl.Steu');
+INSERT INTO gifi (accno,description) VALUES ('0210400', 'Steuerl.nicht.abzugsf.ande.Nl.z.Ste');
+INSERT INTO gifi (accno,description) VALUES ('0210700', 'Zinsaufwendung-betriebliche Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0210800', 'Zinsaufwendung-Personsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0210900', 'Zinsaufwendungen an verb.Unternehm.');
+INSERT INTO gifi (accno,description) VALUES ('0211000', 'Zinsaufwendung f.kurzf.Verbindlichk');
+INSERT INTO gifi (accno,description) VALUES ('0212000', 'Zinsaufwendung f.langf.Verbindlichk');
+INSERT INTO gifi (accno,description) VALUES ('0213000', 'Diskontaufwendung');
+INSERT INTO gifi (accno,description) VALUES ('0215000', 'Aufwendungen aus Kursdifferenzen');
+INSERT INTO gifi (accno,description) VALUES ('0216500', 'Aufw.a.d.Währungsumstell.a.d.Euro');
+INSERT INTO gifi (accno,description) VALUES ('0217000', 'Nicht abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0217100', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO gifi (accno,description) VALUES ('0217500', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO gifi (accno,description) VALUES ('0220000', 'Körperschaftssteuer');
+INSERT INTO gifi (accno,description) VALUES ('0220300', 'Körperschaftssteuer für Vorjahr');
+INSERT INTO gifi (accno,description) VALUES ('0220500', 'Anrechb.Körperschaftsst.vereinn.Kap');
+INSERT INTO gifi (accno,description) VALUES ('0220800', 'Solidaritätszuschlag');
+INSERT INTO gifi (accno,description) VALUES ('0220900', 'Solidaritätszuschlag für Vorjahr');
+INSERT INTO gifi (accno,description) VALUES ('0221000', 'Kapitalertragssteuer');
+INSERT INTO gifi (accno,description) VALUES ('0221300', 'Anrechb.Solidaritätszusch.a.Zinsabs');
+INSERT INTO gifi (accno,description) VALUES ('0221500', 'Zinsabschlagsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0221800', 'Anrechb.Solidari.zuschlag a.Zinsabs');
+INSERT INTO gifi (accno,description) VALUES ('0228000', 'Stnachzahl.Vorj.v.Einkomm u.Ertrag');
+INSERT INTO gifi (accno,description) VALUES ('0228200', 'Sterstat.Vorj.Steuer v.Eink.u.Ertra');
+INSERT INTO gifi (accno,description) VALUES ('0228400', 'Ertr.a.d.Aufl.v.Rücks.f.St.v.Ein.Er');
+INSERT INTO gifi (accno,description) VALUES ('0228500', 'Steuernachzahlung Vorj.f.sons.Steue');
+INSERT INTO gifi (accno,description) VALUES ('0228700', 'Steuererstattung Vorj.f.sons.Steuer');
+INSERT INTO gifi (accno,description) VALUES ('0228900', 'Erträge a.d.Aufl.v. Rück.f.sons.Ste');
+INSERT INTO gifi (accno,description) VALUES ('0230000', 'Sonstige Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0231000', 'Anlagenabgänge - bei Buchverlust');
+INSERT INTO gifi (accno,description) VALUES ('0231500', 'Anlagenabgänge-Buchgewinn');
+INSERT INTO gifi (accno,description) VALUES ('0232000', 'Verluste Abgang Gegenst.d.Anlagever');
+INSERT INTO gifi (accno,description) VALUES ('0232500', 'Verlust a.d.Abg.v.Gegens.d.Umlaufve');
+INSERT INTO gifi (accno,description) VALUES ('0234000', 'Einstellungen Sopo m.Rückanlageant.');
+INSERT INTO gifi (accno,description) VALUES ('0234500', 'Einstellungen Sopo m.R.(Sonderafa)');
+INSERT INTO gifi (accno,description) VALUES ('0237500', 'Grundsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0240000', 'Forderungsverlust-übliche Höhe');
+INSERT INTO gifi (accno,description) VALUES ('0241000', 'Einstellungen Sopo m.Rückl.(§7g )');
+INSERT INTO gifi (accno,description) VALUES ('0243000', 'Forderungsverluste-unüblich hoch');
+INSERT INTO gifi (accno,description) VALUES ('0245000', 'Einstell.i.d.Pauschalwertbe.z.Forde');
+INSERT INTO gifi (accno,description) VALUES ('0245100', 'Einstell.i.d.Einzelwertb.z.Forderun');
+INSERT INTO gifi (accno,description) VALUES ('0249000', 'Aufwendung aus Verlustübernahme');
+INSERT INTO gifi (accno,description) VALUES ('0249200', 'Abgef.Gewinn aufgr.e.Gewinngemeinsc');
+INSERT INTO gifi (accno,description) VALUES ('0249300', 'Abgef.Gewinnant.an stille Gesellsch');
+INSERT INTO gifi (accno,description) VALUES ('0249500', 'Einst.Kapitalrückl.n.Vorschr.vere.K');
+INSERT INTO gifi (accno,description) VALUES ('0249600', 'Einstellungen in die gesetzl.Rückla');
+INSERT INTO gifi (accno,description) VALUES ('0250000', 'Außerordentliche Erträge');
+INSERT INTO gifi (accno,description) VALUES ('0251000', 'Betriebsfremde Erträge n.außerorden');
+INSERT INTO gifi (accno,description) VALUES ('0252000', 'Periodenfremde Erträge nicht außero');
+INSERT INTO gifi (accno,description) VALUES ('0260000', 'Erträge aus Beteiligten');
+INSERT INTO gifi (accno,description) VALUES ('0261700', 'Gewinn a.Anteila.nicht stbef.Kapita');
+INSERT INTO gifi (accno,description) VALUES ('0261900', 'Erträge a.Beteil.a.verb.Untérnehmer');
+INSERT INTO gifi (accno,description) VALUES ('0262000', 'Erträge a.anderen Wertp u.Ausl.Fina');
+INSERT INTO gifi (accno,description) VALUES ('0265000', 'Sonstige Zinsen und ähnliche Erträg');
+INSERT INTO gifi (accno,description) VALUES ('0265700', 'Zinserträge-betriebliche Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0265800', 'Zinserträge-Körperschaftssteuer');
+INSERT INTO gifi (accno,description) VALUES ('0265900', 'Sons.Zinsen u.ähl.Ertr.a.verb.Unter');
+INSERT INTO gifi (accno,description) VALUES ('0266000', 'Erträge aus Kursdifferenzen');
+INSERT INTO gifi (accno,description) VALUES ('0266500', 'Erträge a.d.Währungumst.a.d. Euro');
+INSERT INTO gifi (accno,description) VALUES ('0267000', 'Diskonerträge');
+INSERT INTO gifi (accno,description) VALUES ('0270000', 'Sonstige Erträge');
+INSERT INTO gifi (accno,description) VALUES ('0270500', 'Sons.Erträge betrieb. u. regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('0271000', 'Ertrag a.d.Zuschreib.d.Anlagevermög');
+INSERT INTO gifi (accno,description) VALUES ('0271500', 'Ertr.a.Zuschreib.d.Umlaufvermögens');
+INSERT INTO gifi (accno,description) VALUES ('0272000', 'Ertr.a.d.Abgang v.Gegens.d.Anlageve');
+INSERT INTO gifi (accno,description) VALUES ('0272500', 'Ertä.a.d.Abg.v.Gegenst.d.Umlaufverm');
+INSERT INTO gifi (accno,description) VALUES ('0273000', 'Ertr.a.Herab.d.Pauschal.z.Forderung');
+INSERT INTO gifi (accno,description) VALUES ('0273100', 'Ertr.a.Herab.d.Einzelw.z.Forderunge');
+INSERT INTO gifi (accno,description) VALUES ('0273200', 'Ertr. aus abgeschriebenen Forderung');
+INSERT INTO gifi (accno,description) VALUES ('0273500', 'Ertr.a.d.Auflösung v.Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0273600', 'Ertr.a.d.steuerl.niedrig.Bewertung');
+INSERT INTO gifi (accno,description) VALUES ('0273700', 'Ertr.a.d..Aufl.v.Sonderp.m.Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('0273800', 'Ertr.a.d.Aufl.v.Sopo.m.Rücklageant.');
+INSERT INTO gifi (accno,description) VALUES ('0273900', 'Erträge Aufl. Sopo m.R.(Ansparafa)');
+INSERT INTO gifi (accno,description) VALUES ('0274000', 'Erträge Auflösung Sopo (stfreie Rü)');
+INSERT INTO gifi (accno,description) VALUES ('0274100', 'Ertr.a.d.Aufl.v.Sonderp.m.Rücklagen');
+INSERT INTO gifi (accno,description) VALUES ('0274200', 'Versicherungsentschädigungen');
+INSERT INTO gifi (accno,description) VALUES ('0274300', 'Investitionszuschüsse-steuerpflicht');
+INSERT INTO gifi (accno,description) VALUES ('0274400', 'Investitionszulage-steuerfrei');
+INSERT INTO gifi (accno,description) VALUES ('0274500', 'Erträge aus Kapitalherabsetzung');
+INSERT INTO gifi (accno,description) VALUES ('0279000', 'Erträge aus Verlustübernahme');
+INSERT INTO gifi (accno,description) VALUES ('0279200', 'Erhalt.Gewinne aufgr.e.Gewinngemein');
+INSERT INTO gifi (accno,description) VALUES ('0279400', 'Erhalt.Gewinn aufgr.e.GAV-TeilGAV');
+INSERT INTO gifi (accno,description) VALUES ('0279500', 'Entnahme aus der Kapitalrücklage');
+INSERT INTO gifi (accno,description) VALUES ('0279600', 'Entnahme a.d. gesetzlichen Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('0286000', 'Gewinnvortrag nach Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0286800', 'Verlustvortrag nach Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0286900', 'Vortrag auf neue Rechnungen');
+INSERT INTO gifi (accno,description) VALUES ('0287000', 'Vorabausschüttung');
+INSERT INTO gifi (accno,description) VALUES ('0289200', 'Verrechnete kalkulatorische Zinsen');
+INSERT INTO gifi (accno,description) VALUES ('0289300', 'Verrechnete kalkulatorische AfA');
+INSERT INTO gifi (accno,description) VALUES ('0299000', 'Aufwendung/Erträge Umrechnungsdiff');
+INSERT INTO gifi (accno,description) VALUES ('0300000', 'Roh,-Hilfs,-und Betriebsstoffe');
+INSERT INTO gifi (accno,description) VALUES ('0309000', 'Energiestoffe (Fertigung)');
+INSERT INTO gifi (accno,description) VALUES ('0310000', 'Fremdleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0315000', 'Leist.v.ausländ.Untern.(0-Regelung)');
+INSERT INTO gifi (accno,description) VALUES ('0320000', 'Wareneingang');
+INSERT INTO gifi (accno,description) VALUES ('0330000', 'Wareneingang 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0340000', 'Wareneingang 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0342000', 'Innergemein.Erwerb 7% VorSt u. Ust');
+INSERT INTO gifi (accno,description) VALUES ('0342500', 'Innergem.Erwerb 16% VorSt u. Ust');
+INSERT INTO gifi (accno,description) VALUES ('0355000', 'Steuerfreier innergem.Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('0360000', 'Nicht abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0370000', 'Nachlässe');
+INSERT INTO gifi (accno,description) VALUES ('0371000', 'Nachlässe 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0372000', 'Nachlässe 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0373000', 'Erhaltene Skonti');
+INSERT INTO gifi (accno,description) VALUES ('0373100', 'Erhaltene Skonti 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0373500', 'Erhaltene Skonti 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0374000', 'Erhaltene Boni');
+INSERT INTO gifi (accno,description) VALUES ('0375000', 'Erhaltene Boni 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0376000', 'Erhaltene Boni 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0377000', 'Erhaltene Rabatte');
+INSERT INTO gifi (accno,description) VALUES ('0378000', 'Erhaltene Rabatte 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0379000', 'Erhaltene Rabatte 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0380000', 'Anschaffungsnebenkosten');
+INSERT INTO gifi (accno,description) VALUES ('0383000', 'Leergut');
+INSERT INTO gifi (accno,description) VALUES ('0385000', 'Zölle und Einfuhrabgaben');
+INSERT INTO gifi (accno,description) VALUES ('0396000', 'Bestandsver.Roh-,Hilfs-.Betriebs.');
+INSERT INTO gifi (accno,description) VALUES ('0397000', 'Bestand Roh-,Hilfs-,u.Betriebsstoff');
+INSERT INTO gifi (accno,description) VALUES ('0398000', 'Bestand Waren');
+INSERT INTO gifi (accno,description) VALUES ('0399000', 'Verrechnete Stoffkosten');
+INSERT INTO gifi (accno,description) VALUES ('0400000', 'Material-und Stoffverbrauch');
+INSERT INTO gifi (accno,description) VALUES ('0410000', 'Löhne und Gehälter');
+INSERT INTO gifi (accno,description) VALUES ('0412400', 'Geschäftsführ.gehälter GmbH-Gesell.');
+INSERT INTO gifi (accno,description) VALUES ('0412500', 'Ehegattengehalt');
+INSERT INTO gifi (accno,description) VALUES ('0412600', 'Tantiemen');
+INSERT INTO gifi (accno,description) VALUES ('0412700', 'Geschäftsführergehälter');
+INSERT INTO gifi (accno,description) VALUES ('0412800', 'Vergütung a.angestellte Mitunterneh');
+INSERT INTO gifi (accno,description) VALUES ('0413000', 'Gesetzlich soziale Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0413700', 'Gesetz.sozi.Aufw.f.Mitunternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0413800', 'Beiträge zur Berufsgenossenschaftr');
+INSERT INTO gifi (accno,description) VALUES ('0414500', 'Freiwillige sozi.Aufw.lohnsteuerfr.');
+INSERT INTO gifi (accno,description) VALUES ('0414900', 'Pauschale Lohnsteuera.sons.Bezüge');
+INSERT INTO gifi (accno,description) VALUES ('0415000', 'Krankengeldzuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('0416000', 'Versorgungskasse');
+INSERT INTO gifi (accno,description) VALUES ('0416500', 'Aufwendung f.Altersversorgung');
+INSERT INTO gifi (accno,description) VALUES ('0417000', 'Vermögenswirksame Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('0417500', 'Fahrtkostenerst.Wohnung/Arbeitsstät');
+INSERT INTO gifi (accno,description) VALUES ('0419000', 'Aushilfslöhne');
+INSERT INTO gifi (accno,description) VALUES ('0419900', 'Lohnsteuer für Aushilfe');
+INSERT INTO gifi (accno,description) VALUES ('0420000', 'Raumkosten');
+INSERT INTO gifi (accno,description) VALUES ('0421000', 'Miete');
+INSERT INTO gifi (accno,description) VALUES ('0422000', 'Pacht');
+INSERT INTO gifi (accno,description) VALUES ('0423000', 'Heizung');
+INSERT INTO gifi (accno,description) VALUES ('0424000', 'Gas,Strom, Wasser');
+INSERT INTO gifi (accno,description) VALUES ('0425000', 'Reinigung');
+INSERT INTO gifi (accno,description) VALUES ('0426000', 'Instandhaltung betrieb.Räume');
+INSERT INTO gifi (accno,description) VALUES ('0427000', 'Abgaben f.betrieb.genutz.Grundstück');
+INSERT INTO gifi (accno,description) VALUES ('0428000', 'Sonstige Raumkosten');
+INSERT INTO gifi (accno,description) VALUES ('0430000', 'Nicht abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('0430100', 'Nicht abziehbare Vorsteuer 7%');
+INSERT INTO gifi (accno,description) VALUES ('0430500', 'Nicht abziehbare Vorsteuer 16%');
+INSERT INTO gifi (accno,description) VALUES ('0432000', 'Gewerbesteuer');
+INSERT INTO gifi (accno,description) VALUES ('0434000', 'Sonstige Betriebssteuern');
+INSERT INTO gifi (accno,description) VALUES ('0435000', 'Verbrauchssteuer');
+INSERT INTO gifi (accno,description) VALUES ('0435500', 'Ökosteuer');
+INSERT INTO gifi (accno,description) VALUES ('0436000', 'Versicherungen');
+INSERT INTO gifi (accno,description) VALUES ('0437000', 'Nettoprä.f.Rückd.künf.Versorgungsle');
+INSERT INTO gifi (accno,description) VALUES ('0438000', 'Beiträge');
+INSERT INTO gifi (accno,description) VALUES ('0439000', 'Sonstige Abgaben');
+INSERT INTO gifi (accno,description) VALUES ('0439600', 'Steuerl.abzugs.Verspä.u.Zwangsgelde');
+INSERT INTO gifi (accno,description) VALUES ('0450000', 'Fahrzugkosten');
+INSERT INTO gifi (accno,description) VALUES ('0451000', 'Kfz-Steuer');
+INSERT INTO gifi (accno,description) VALUES ('0452000', 'Kfz-Versicherungen');
+INSERT INTO gifi (accno,description) VALUES ('0453000', 'Laufende Kfz-Betriebskosten');
+INSERT INTO gifi (accno,description) VALUES ('0454000', 'Kfz-Reparaturen');
+INSERT INTO gifi (accno,description) VALUES ('0455000', 'Garagenmiete');
+INSERT INTO gifi (accno,description) VALUES ('0457000', 'Fremdfahrzeuge');
+INSERT INTO gifi (accno,description) VALUES ('0458000', 'Sonstige Kfz-Kosten');
+INSERT INTO gifi (accno,description) VALUES ('0460000', 'Werbe-und Reisekosten');
+INSERT INTO gifi (accno,description) VALUES ('0461000', 'Werbekosten');
+INSERT INTO gifi (accno,description) VALUES ('0463000', 'Geschenke bis 75 DM');
+INSERT INTO gifi (accno,description) VALUES ('0463500', 'Geschenke bis 75 DM');
+INSERT INTO gifi (accno,description) VALUES ('0463800', 'Geschenke ausschließl.betrieb.genut');
+INSERT INTO gifi (accno,description) VALUES ('0464000', 'Repräsentationskosten');
+INSERT INTO gifi (accno,description) VALUES ('0465000', 'Bewirtungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0465300', 'Aufmerksamkeiten');
+INSERT INTO gifi (accno,description) VALUES ('0465400', 'Nicht abzugsfähige Bewirtungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0465500', 'Nicht abzugsfähige Betriebsausgaben');
+INSERT INTO gifi (accno,description) VALUES ('0466000', 'Reisekosten Arbeitnehmer');
+INSERT INTO gifi (accno,description) VALUES ('0466300', 'Reisekosten Arbeitn.m.Vorsteuerabzu');
+INSERT INTO gifi (accno,description) VALUES ('0466400', 'Reisekosten Arbeitn.Verpflegungmehr');
+INSERT INTO gifi (accno,description) VALUES ('0466600', 'Reisekosten Arbeitn.Übernachtungsau');
+INSERT INTO gifi (accno,description) VALUES ('0466800', 'Kilometerentgelderstattung Arbeitne');
+INSERT INTO gifi (accno,description) VALUES ('0467000', 'Reisekosten Unternehmer');
+INSERT INTO gifi (accno,description) VALUES ('0467400', 'Reisekosten Untern.Verpflegungsmehr');
+INSERT INTO gifi (accno,description) VALUES ('0467600', 'Reisekosten Untern.Übernachtungsauf');
+INSERT INTO gifi (accno,description) VALUES ('0467800', 'Kilometererstattungsgeld Unternehme');
+INSERT INTO gifi (accno,description) VALUES ('0470000', 'Kosten der Warenabgabe');
+INSERT INTO gifi (accno,description) VALUES ('0471000', 'Verpackungsmaterial');
+INSERT INTO gifi (accno,description) VALUES ('0473000', 'Ausgangsfracht');
+INSERT INTO gifi (accno,description) VALUES ('0475000', 'Transportversicherung');
+INSERT INTO gifi (accno,description) VALUES ('0476000', 'Verkaufsprovision');
+INSERT INTO gifi (accno,description) VALUES ('0478000', 'Fremdarbeiten');
+INSERT INTO gifi (accno,description) VALUES ('0479000', 'Aufwand für Gewährleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0480900', 'Sonstige Reparaturen u.Instandhalt.');
+INSERT INTO gifi (accno,description) VALUES ('0481000', 'Mietleasing');
+INSERT INTO gifi (accno,description) VALUES ('0481500', 'Kaufleasing');
+INSERT INTO gifi (accno,description) VALUES ('0482000', 'AfA a.Aufw.f.d.Inga.u.Erw.Geschäfts');
+INSERT INTO gifi (accno,description) VALUES ('0482100', 'AfA a.Aufw.f.d.Währungsumst.a.Euro');
+INSERT INTO gifi (accno,description) VALUES ('0482200', 'Abschreibungen a.immat.Vermögensgeg');
+INSERT INTO gifi (accno,description) VALUES ('0482400', 'Abschreibung a.d.Geschäft-o.Firmenw');
+INSERT INTO gifi (accno,description) VALUES ('0482600', 'Außerplan.AfA a.immat.Vermögensgeg.');
+INSERT INTO gifi (accno,description) VALUES ('0483000', 'Abschreibungen auf Sachanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0484000', 'Außerplanmäßig Abschr.a.Sachanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0485000', 'Abschr.a.Sachanl.steuerl.Sondervors');
+INSERT INTO gifi (accno,description) VALUES ('0485500', 'Sofortabschreibung GWG');
+INSERT INTO gifi (accno,description) VALUES ('0486000', 'Abschreibungen auf aktivierte GWG');
+INSERT INTO gifi (accno,description) VALUES ('0487000', 'Abschreibungen auf Finanzanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0487500', 'Abschr.a.Wertp.d.Umlaufvermögens');
+INSERT INTO gifi (accno,description) VALUES ('0490000', 'Sonstige betriebliche Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('0490500', 'Sons.Aufw.betriebl. und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('0490900', 'Fremdleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0491000', 'Porto');
+INSERT INTO gifi (accno,description) VALUES ('0492000', 'Telefon');
+INSERT INTO gifi (accno,description) VALUES ('0492500', 'Telefax');
+INSERT INTO gifi (accno,description) VALUES ('0493000', 'Bürobedarf');
+INSERT INTO gifi (accno,description) VALUES ('0494000', 'Zeitschriften, Bücher');
+INSERT INTO gifi (accno,description) VALUES ('0494500', 'Fortbildungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0494600', 'Freiwillige Sozialleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0495000', 'Rechts- und Beratungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0495500', 'Buchführungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0495700', 'Abschluß- und Prüfungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0496000', 'Mieten für Einrichtungen');
+INSERT INTO gifi (accno,description) VALUES ('0497000', 'Nebenkosten des Geldverkehrs');
+INSERT INTO gifi (accno,description) VALUES ('0498000', 'Betriebsbedarf');
+INSERT INTO gifi (accno,description) VALUES ('0498500', 'Werkzeuge und Kleingeräte');
+INSERT INTO gifi (accno,description) VALUES ('0498600', 'Sonstige Aufwendungen (Ausbuchung)');
+INSERT INTO gifi (accno,description) VALUES ('0499000', 'Kalkulatorischer Unternehmerlohn');
+INSERT INTO gifi (accno,description) VALUES ('0499200', 'Kalkulatorische Zinsen');
+INSERT INTO gifi (accno,description) VALUES ('0499300', 'Kalkulatorische Aschreibungen');
+INSERT INTO gifi (accno,description) VALUES ('0499600', 'Herstellungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0499700', 'Verwaltungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0499800', 'Vertriebskosten');
+INSERT INTO gifi (accno,description) VALUES ('0700000', 'Unfertige Erzeu.unfert.Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('0705000', 'Unfertige Erzeugnisse');
+INSERT INTO gifi (accno,description) VALUES ('0708000', 'Unfertige Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('0709000', 'In Ausführung befindl. Bauaufträge');
+INSERT INTO gifi (accno,description) VALUES ('0709500', 'In Arbeit befindliche Aufträge');
+INSERT INTO gifi (accno,description) VALUES ('0710000', 'Fertige Erzeugnisse und Waren');
+INSERT INTO gifi (accno,description) VALUES ('0711000', 'Fertige Erzeugnisse (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('0714000', 'Waren (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('0810000', 'Steuerfreie Umsätze §4Nr.8ff UstG');
+INSERT INTO gifi (accno,description) VALUES ('0811000', 'Sonstige steuerfreie Umsätze Inland');
+INSERT INTO gifi (accno,description) VALUES ('0812000', 'Steuerfreie Umsätze §4Nr.1a UstG');
+INSERT INTO gifi (accno,description) VALUES ('0812500', 'Steuerfrei innergem. Lieferungen');
+INSERT INTO gifi (accno,description) VALUES ('0813000', 'Liefe.d.1.Abnehm.innergem.Dreiecksg');
+INSERT INTO gifi (accno,description) VALUES ('0815000', 'Sonstige steuerfreie Umsätze');
+INSERT INTO gifi (accno,description) VALUES ('0819000', 'Sonstige Erlöse (Ausbuchung 0%)');
+INSERT INTO gifi (accno,description) VALUES ('0819100', 'Sonstige Erlöse (Ausbuchung 16%)');
+INSERT INTO gifi (accno,description) VALUES ('0819200', 'Sonstige Erlöse (Ausbuchung 7%)');
+INSERT INTO gifi (accno,description) VALUES ('0820000', 'Erlöse');
+INSERT INTO gifi (accno,description) VALUES ('0830000', 'Erlöse 7%USt');
+INSERT INTO gifi (accno,description) VALUES ('0831000', 'Erlöse Inland stpfl. EG-Lieferung7%');
+INSERT INTO gifi (accno,description) VALUES ('0831500', 'Erlös Inland stpfl.EG-Lieferung 16%');
+INSERT INTO gifi (accno,description) VALUES ('0833900', 'Erl.EG-Land stpfl.so.Leist.(0-Regl)');
+INSERT INTO gifi (accno,description) VALUES ('0840000', 'Erlöse 16% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0850000', 'Provisionserlöse');
+INSERT INTO gifi (accno,description) VALUES ('0852000', 'Erlöse Abfallverwertung');
+INSERT INTO gifi (accno,description) VALUES ('0854000', 'Erlös Leergut');
+INSERT INTO gifi (accno,description) VALUES ('0859000', 'Verrechnete sons. Sachbezüge');
+INSERT INTO gifi (accno,description) VALUES ('0859100', 'Sachbezüge 7% Ust (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('0859500', 'Sachbezüge 16% Ust (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('0860000', 'Sonstige Erlöse betriebl.u.regelmäß');
+INSERT INTO gifi (accno,description) VALUES ('0861000', 'Verrechnete sonstige Sachbezüge');
+INSERT INTO gifi (accno,description) VALUES ('0861100', 'Verr.sons.Sachbezüge 16%USt(Kfz-Ge)');
+INSERT INTO gifi (accno,description) VALUES ('0861400', 'Verrechnete sons.Sachbezüge o. USt');
+INSERT INTO gifi (accno,description) VALUES ('0862500', 'Sons. Erlöse betriebl.u.reg.steuerf');
+INSERT INTO gifi (accno,description) VALUES ('0865000', 'Erlöse Zinsen und Diskotspesen');
+INSERT INTO gifi (accno,description) VALUES ('0870000', 'Erlösschmälerungen');
+INSERT INTO gifi (accno,description) VALUES ('0871000', 'Erlösschmälerung 7% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0872000', 'Erlösschmälerung 16% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0872400', 'Erlösschmäler.a.stfrei.IG Lieferung');
+INSERT INTO gifi (accno,description) VALUES ('0872500', 'Erlösschmä.Inl.stpfl.EG-Lief. 7%USt');
+INSERT INTO gifi (accno,description) VALUES ('0872600', 'Erlösschmä.Inl.stpfl.EG-Lief.16%USt');
+INSERT INTO gifi (accno,description) VALUES ('0872700', 'Erlösschmä.and.EG Land stpfl.Liefer');
+INSERT INTO gifi (accno,description) VALUES ('0873000', 'Gewährte Skonti');
+INSERT INTO gifi (accno,description) VALUES ('0873100', 'Gewährte Skonti 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('0873500', 'Gewährte Skonti 16% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0874000', 'Gewährte Boni');
+INSERT INTO gifi (accno,description) VALUES ('0875000', 'Gewährte Boni 7% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0876000', 'Gewährte Boni 16% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0877000', 'Gewährte Rabatte');
+INSERT INTO gifi (accno,description) VALUES ('0878000', 'Gewährte Rabatte 7% USt.');
+INSERT INTO gifi (accno,description) VALUES ('0879000', 'Gewährte Rabatte 16% Ust.');
+INSERT INTO gifi (accno,description) VALUES ('0880000', 'Erlöse aus Anlagenverkäufen');
+INSERT INTO gifi (accno,description) VALUES ('0880100', 'Erlöse aus Anlagenverkäufen 16%USt.');
+INSERT INTO gifi (accno,description) VALUES ('0882000', 'Erlöse aus Anlageverkäufen 16%Ust');
+INSERT INTO gifi (accno,description) VALUES ('0882900', 'Erl.a.Anlagenverk.bei Buchgewinn');
+INSERT INTO gifi (accno,description) VALUES ('0890000', 'Unentgeldliche Wertabgaben');
+INSERT INTO gifi (accno,description) VALUES ('0890500', 'Entnahme v. Gegenst.o.USt.');
+INSERT INTO gifi (accno,description) VALUES ('0891000', 'Entnahme außerhalb d.Untern.16%USt.');
+INSERT INTO gifi (accno,description) VALUES ('0891500', 'Entnah.d.U.Zweckaußerh.d.Untn 7%USt');
+INSERT INTO gifi (accno,description) VALUES ('0891800', 'Entn.d.Untern.außerh.d.Untern.o.USt');
+INSERT INTO gifi (accno,description) VALUES ('0892000', 'Verw.v.Gegens.außerh.Untern.16%USt.');
+INSERT INTO gifi (accno,description) VALUES ('0892500', 'Unentgeldl.Erbring.sons.Leis.16%USt');
+INSERT INTO gifi (accno,description) VALUES ('0893200', 'Unentgelt.Erbring.sons.Leist. 7%Ust');
+INSERT INTO gifi (accno,description) VALUES ('0893500', 'Unentgeltl.Zuwend.v.Gegens. 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('0893900', 'Unentgeldl.Zuw.v.Gegens.ohne Ust');
+INSERT INTO gifi (accno,description) VALUES ('0894000', 'Unentgeltl.Zuw.v Waren 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('0894500', 'Unentgeltl.Zuw.von Waren 7% Ust');
+INSERT INTO gifi (accno,description) VALUES ('0895000', 'Nicht steuerbare Umsätze');
+INSERT INTO gifi (accno,description) VALUES ('0895500', 'Umsatzsteuervergütungen');
+INSERT INTO gifi (accno,description) VALUES ('0896000', 'Bestandsveränderung-unfertige Erzeu');
+INSERT INTO gifi (accno,description) VALUES ('0897000', 'Bestandsveränderung-unfertige Leist');
+INSERT INTO gifi (accno,description) VALUES ('0897500', 'Bestandsverä.i.Ausfü.befi.Bauaufträ');
+INSERT INTO gifi (accno,description) VALUES ('0897700', 'Bestandsverä.i.Arbeit befindl.Auftr');
+INSERT INTO gifi (accno,description) VALUES ('0898000', 'Bestandsverä.fertige Erzeugnisse');
+INSERT INTO gifi (accno,description) VALUES ('0899000', 'Andere aktivierte Eigenleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0900000', 'Saldenverträge,Sachkonten');
+INSERT INTO gifi (accno,description) VALUES ('0900800', 'Saldenverträge,Debitoren');
+INSERT INTO gifi (accno,description) VALUES ('0900900', 'Saldenverträge,Kreditoren');
+INSERT INTO gifi (accno,description) VALUES ('0906000', 'Offene Posten aus 1990');
+INSERT INTO gifi (accno,description) VALUES ('0906900', 'Offene Posten aus 1999');
+INSERT INTO gifi (accno,description) VALUES ('0907000', 'Offene Posten aus 2000');
+INSERT INTO gifi (accno,description) VALUES ('0909000', 'Summenvortragskonto');
+INSERT INTO gifi (accno,description) VALUES ('0922000', 'Gezeichnetes kapital in DM');
+INSERT INTO gifi (accno,description) VALUES ('0922100', 'Gezeichnetes Kapital in Euro');
+INSERT INTO gifi (accno,description) VALUES ('0923000', 'Baukostenzuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('0923200', 'Investitionszulagen');
+INSERT INTO gifi (accno,description) VALUES ('0923400', 'Investitionszuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('0924500', 'Forde.a.Anlageverk.sons.Vermögensge');
+INSERT INTO gifi (accno,description) VALUES ('0925000', 'Eigenkapitalersetzende Ges''terdarl.');
+INSERT INTO gifi (accno,description) VALUES ('0926000', 'Kurzfristige Rückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0926200', 'Mittelfristige Rückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0926400', 'Langfristige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0928000', 'Bemessungsgrundlage IG Erwerb 16%');
+INSERT INTO gifi (accno,description) VALUES ('0928100', 'Gegenkonto Bmsgrl. IG Erwerb 16%');
+INSERT INTO gifi (accno,description) VALUES ('0928200', 'Bemessungsgrundlage IG Erwerb 7%');
+INSERT INTO gifi (accno,description) VALUES ('0928400', 'Gegenkonto Bmsgrl. IG Erwerb 7%');
+INSERT INTO gifi (accno,description) VALUES ('0988100', 'Verrechnungskonto Abgang');
+INSERT INTO gifi (accno,description) VALUES ('0988200', 'Verrechnungskonto erh. Anzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0988210', 'Verrechnungskto Anzahlungen netto');
+INSERT INTO gifi (accno,description) VALUES ('0988220', 'Verrechnungskto.Anzahlungen brutto');
+INSERT INTO gifi (accno,description) VALUES ('0988300', 'Verrechnungskonto gel.Anzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0988400', 'Statistisches Konto Konzern AfA');
+INSERT INTO gifi (accno,description) VALUES ('0988500', 'Statistisches Konto kalkulator.AfA');
+INSERT INTO gifi (accno,description) VALUES ('0988600', 'Statistisches Konto außerplanm AfA');
+INSERT INTO gifi (accno,description) VALUES ('0988700', 'Statistisches Konto AfA (Konzern)');
+INSERT INTO gifi (accno,description) VALUES ('0988800', 'Statistisches Konto Sonderafa');
+INSERT INTO gifi (accno,description) VALUES ('0988900', 'Statistisches Konto AfA (SBil)');
+INSERT INTO gifi (accno,description) VALUES ('0989800', 'Statistisches Konto AfA (Kalkul.)');
+INSERT INTO gifi (accno,description) VALUES ('0989900', 'Statistisches Konto AfA');
+INSERT INTO gifi (accno,description) VALUES ('0999999', 'Fehlerauffangkonto');
diff --git a/sql-ledger/sql/Germany-SKR03-chart.sql b/sql-ledger/sql/Germany-SKR03-chart.sql
new file mode 100644
index 000000000..a7f87e2ee
--- /dev/null
+++ b/sql-ledger/sql/Germany-SKR03-chart.sql
@@ -0,0 +1,267 @@
+-- General COA
+-- provided by Yvonne
+-- June 13, 2002
+--
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('420','Büroeinrichtung','A','A','','420');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('430','Ladeneinrichtung','A','A','','430');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('440','Werkzeuge','A','A','','440');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('450','Einbauten','A','A','','450');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('460','Gerüst- und Schalungsmaterial','A','A','','460');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('480','Geringwertige Wirtschaftsgüter bis DM 800,-','A','A','','480');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('490','Sonstige Betriebs- und Geschäftsausstattung','A','A','','490');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('650','Verb. gg. Kreditinstituten - Restlaufz. größer 5 Jahre','A','L','','650');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1000','Kasse','A','A','AR_paid:AP_paid','1000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1200','Bank-Giro','A','A','AR_paid:AP_paid','1200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1400','Forderungen aus Lief. und Leist. Kundengruppe 0','A','A','AR','1400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1540','Steuerüberzahlungen','A','A','AR','1540');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1542','Steuererstattungsansprüche gg. anderen EU-Ländern','A','A','AR','1542');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1545','Umsatzsteuerforderungen','A','A','AR','1545');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1548','Vorsteuer im Folgejahr abziehbar','A','A','AR','1548');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1570','Abziehbare Vorsteuer','A','A','AR_tax:AP_tax:CT_tax','1570');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1571','Abziehbare Vorsteuer, 7%','A','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax','1571');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1575','Abziehbare Vorsteuer, 16%','A','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax','1575');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1576','Abziehbare Vorsteuer, 15%','A','A','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax','1576');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1577','Vorsteuer nach allg. Durchschnittssätzen UStVA KZ 63','A','A','AR_tax:AP_tax:CT_tax','1577');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1775','Umsatzsteuer, 16%','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax','1775');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1776','Umsatzsteuer, 15%','A','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax','1776');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1780','Umsatzsteuer - Vorauszahlungen','A','L','','1780');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1781','Umsatzsteuer - Vorauszahlungen 1/11','A','L','','1781');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1782','Nachsteuer, UStVA KZ 65','A','L','','1782');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1789','Umsatzsteuer laufendes Jahr','A','L','','1789');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1790','Umsatzsteuer Vorjahr','A','L','','1790');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1791','Umsatzsteuer frühere Jahre','A','L','','1791');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1820','Sonderausg. beschr. abzugsf. (Privat Vollhaft./Einzelu.)','A','','','1820');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1830','Sonderausg. unbeschr. abzugsf. (Privat Vollhaft./Einzelu.)','A','','','1830');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1840','Privatspenden (Privat Vollhafter / Einzelunternehmer)','A','','','1840');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1850','Außergewöhnliche Belastungen (Privat Vollhaft. / Einzelunt.)','A','','','1850');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1890','Privateinlagen (Privat Vollhafter / Einzelunternehmer)','A','','','1890');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2010','Betriebsfremde Aufw. (soweit nicht außerordentlich)','A','','','2010');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2020','Periodenfremde Aufw. (soweit nicht außerordentlich)','A','','','2020');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2100','Zinsen und ähnliche Aufwendungen','A','','','2100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2103','Steuerlich abzugsfähige, andere Nebenleistungen zu Steuern','A','','','2103');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2104','Steuerlich nicht abzugsfähige, andere Nebenleistungen zu Steuern','A','','','2104');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2107','Zinsaufwendungen §233a AO betriebliche Steuern','A','','','2107');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2108','Zinsaufw. §233a, §234, §237 AO Personenst. §8 GewStG','A','','','2108');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2109','Zinsaufwendungen an verbundene Unternehmen','A','','','2109');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2110','Zinsaufwendungen für kurzfristige Verbindlichkeiten','A','','','2110');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3410','Wareneingang, 16% Vorsteuer','A','','','3410');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3736','Erhaltene Skonti, 16% Vorsteuer','A','','','3736');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3740','Erhaltene Boni','A','','','3740');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3750','Erhaltene Boni, 7% Vorsteuer','A','','','3750');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3760','Erhaltene Boni, 15%+16% Vorsteuer','A','','','3760');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3762','Erhaltene Boni, 16% Vorsteuer','A','','','3762');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3764','Erhaltene Boni, 15% Vorsteuer','A','','','3764');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3800','Anschaffungsnebenkosten','A','','','3800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3830','Leergut','A','','','3830');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3850','Zölle und Einfuhrabgaben','A','','','3850');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3960','Bestandsv. Roh-, Hilfs- u. Betriebsstoffe / bezogene Waren','A','','','3960');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3970','Bestand Roh-, Hilfs- und Betriebsstoffe','A','','','3970');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3980','Bestand Waren','A','','','3980');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3990','Verrechnete Stoffkosten','A','','','3990');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4000','Material- und Stoffverbrauch','A','E','AP_amount','4000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4100','Löhne und Gehälter','A','E','AP_amount','4100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4110','Löhne','A','E','AP_amount','4110');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4120','Gehälter','A','E','AP_amount','4120');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4124','Geschäftsführergehälter der GmbH-Gesellschafter','A','E','AP_amount','4124');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4125','Ehegattengehalt','A','E','AP_amount','4125');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4126','Tantiemen','A','E','AP_amount','4126');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4127','Geschäftsführergehälter','A','E','AP_amount','4127');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4128','Vergütungen an angestellte Mitunternehmer §15 EStG','A','E','AP_amount','4128');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4130','Gesetzliche soziale Aufwendungen','A','E','AP_amount','4130');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4137','Gesetzliche soziale Aufw. für Mitunternehmer §15 EStG','A','E','AP_amount','4137');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4138','Beiträge zur Berufsgenossenschaft','A','E','AP_amount','4138');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1360','Geldtransit Bank 1','A','A','','1360');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4140','Freiw. soziale Aufwendungen (lohnsteuerfrei)','A','E','AP_amount','4140');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4145','Freiw. soziale Aufwendungen (lohnsteuerpflichtig)','A','E','AP_amount','4145');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4149','Pauschale Lohnsteuer auf s. Bezüge (z.B. Fahrtkostenzuschuß)','A','E','AP_amount','4149');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4150','Krankengeldzuschüsse','A','E','AP_amount','4150');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4160','Versorgungskassen','A','E','AP_amount','4160');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4165','Aufwendungen für die Altersversorgung','A','E','AP_amount','4165');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4167','Pauschale Lohnsteuer auf s. Bezüge (z.B. Direktversicherung)','A','E','AP_amount','4167');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4168','Aufw. f. die Altersversorgung f. Mitunternehmer §15 EStG','A','E','AP_amount','4168');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4169','Aufwendungen für Unterstützung','A','E','AP_amount','4169');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4170','Vermögenswirksame Leistungen','A','E','AP_amount','4170');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4175','Fahrtkostenerstattung - Wohnung / Arbeitsstätte','A','E','AP_amount','4175');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4180','Bedienungsgelder','A','E','AP_amount','4180');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4190','Aushilfslöhne','A','E','AP_amount','4190');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4199','Lohnsteuer für Aushilfen','A','E','AP_amount','4199');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4200','Raumkosten','A','E','AP_amount','4200');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4210','Miete','A','E','AP_amount','4210');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4218','Gewerbesteuerlich zu berücks. Miete §8 GewStG','A','E','AP_amount','4218');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4219','Vergütung an Mitu. f. mietw. Überl. v. Wirtschaftsg. §15EStG','A','E','AP_amount','4219');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4220','Pacht','A','E','AP_amount','4220');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4228','Gewerbesteuerlich zu berücks. Pacht §8 GewStG','A','E','AP_amount','4228');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4229','Vergütung an Mitu. f. pachtw. Überl. v. Wirtschaftsg.§15EStG','A','E','AP_amount','4229');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4230','Heizung','A','E','AP_amount','4230');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4240','Gas, Strom, Wasser (Verwaltung, Vertrieb)','A','E','AP_amount','4240');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4250','Reinigung','A','E','AP_amount','4250');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4260','Instandhaltung betrieblicher Räume','A','E','AP_amount','4260');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4270','Abgaben für betrieblich genutzten Grundbesitz','A','E','AP_amount','4270');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4280','Sonstige Raumkosten','A','E','AP_amount','4280');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4320','Gewerbesteuer (Vorauszahlung)','A','E','AP_amount','4320');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4330','Gewerbeertragsteuer','A','E','AP_amount','4330');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4335','Gewerbekapitalsteuer','A','E','AP_amount','4335');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4340','Sonstige Betriebsteuern','A','E','AP_amount','4340');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4350','Verbrauchsteuer','A','E','AP_amount','4350');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4360','Versicherungen','A','E','AP_amount','4360');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4380','Beiträge','A','E','AP_amount','4380');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4390','Sonstige Abgaben','A','E','AP_amount','4390');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4396','Steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder','A','E','AP_amount','4396');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4397','Steuerlich nicht abzugsfähige Verspätungszuschläge und Zwangsgelder','A','E','AP_amount','4397');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4400','Besondere Kosten (zur freien Verfügung)','A','E','AP_amount','4400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4500','Fahrzeugkosten','A','E','AP_amount','4500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4510','Kfz-Steuern','A','E','AP_amount','4510');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4520','Kfz-Versicherungen','A','E','AP_amount','4520');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4530','Laufende Kfz-Betriebskosten','A','E','AP_amount','4530');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4540','Kfz-Reparaturen','A','E','AP_amount','4540');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4550','Garagenmieten','A','E','AP_amount','4550');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4570','Fremdfahrzeuge','A','E','AP_amount','4570');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4580','Sonstige Kfz-Kosten','A','E','AP_amount','4580');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4600','Werbe- und Reisekosten','A','E','AP_amount','4600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4610','Werbekosten','A','E','AP_amount','4610');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4630','Geschenke bis DM 75,00','A','E','AP_amount','4630');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4635','Geschenke über DM 75,00','A','E','AP_amount','4635');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4638','Geschenke ausschließlich betrieblich genutzt','A','E','AP_amount','4638');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4640','Repräsentationskosten','A','E','AP_amount','4640');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4650','Bewirtungskosten','A','E','AP_amount','4650');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4653','Aufwerksamkeiten','A','E','AP_amount','4653');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4654','Nicht abzugsfähige Bewirtungskosten','A','E','AP_amount','4654');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4655','Nicht abzugsfähige Betriebsausgaben','A','E','AP_amount','4655');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4660','Reisekosten Arbeitnehmer','A','E','AP_amount','4660');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4666','Reisekost. Arbeitn., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.','A','E','AP_amount','4666');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4667','Reisekost. Arbeitn., 9,8%/10,5% VSt Gesamtpauschal.','A','E','AP_amount','4667');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4670','Reisekosten Unternehmer','A','E','AP_amount','4670');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4675','Reisekosten Unternehmer, 9,8/10,5% VSt sonst.Gesamtpauschal.','A','E','AP_amount','4675');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4676','Reisekost. Untern., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.','A','E','AP_amount','4676');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4677','Reisekosten Unternehmer, 9,8%/10,5% VSt Verpfl.Mehraufw. Gesamtpauschal.','A','E','AP_amount','4677');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4678','Km-Geld Erstattung, Unternehmer, 5,7%/6,1% VSt','A','E','AP_amount','4678');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4685','Km-Geld-Erstattung, Arbeitnehmer 8,2%/8,7% VSt','A','E','AP_amount','4685');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4700','Kosten der Warenabgabe','A','E','AP_amount:IC_expense:IC_cogs','4700');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4710','Verpackungsmaterial','A','E','AP_amount','4710');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4730','Ausgangsfrachten','A','E','AP_amount','4730');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4750','Transportversicherungen','A','E','AP_amount','4750');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4760','Verkaufsprovisionen','A','E','AP_amount','4760');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4780','Fremdarbeiten','A','E','AP_amount','4780');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4790','Aufwand für Gewährleistungen','A','E','AP_amount','4790');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4800','Reparat. u. Inst. v. Maschinen u. technischen Anlagen','A','E','AP_amount','4800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4805','Reparat. u. Inst. v. and. Anl. d. Betr.- u. Geschäftsausst.','A','E','AP_amount','4805');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4809','Sonstige Reparaturen und Instandhaltungen','A','E','AP_amount','4809');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4810','Mietleasing','A','E','AP_amount','4810');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4815','Kaufleasing','A','E','AP_amount','4815');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4820','Abschr. a. Aufw. f.d. Ingangs. u. Erw. des Geschäftsbetr.','A','E','AP_amount','4820');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4822','Abschr. a. immaterielle Vermögensgegenstände','A','E','AP_amount','4822');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4824','Abschreibung auf den Geschäfts- oder Firmenwert','A','E','AP_amount','4824');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4826','Außerplanm. Abschr. a. immaterielle Vermögensgegenstände','A','E','AP_amount','4826');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4830','Abschreibungen auf Sachanlagen','A','E','AP_amount','4830');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4840','Außerplanm. Abschreibungen auf Sachanlagen','A','E','AP_amount','4840');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4850','Abschr. a. Sachanl. aufgrund steuerl. Sondervorschriften','A','E','AP_amount','4850');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4855','Sofortabschreibung geringwertiger Wirtschaftsgüter','A','E','AP_amount','4855');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4860','Abschreibung auf aktivierte, geringwertige Wirtschaftsgüter','A','E','AP_amount','4860');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4865','Außerplanmäßige Abschr. a. aktivierte GWG','A','E','AP_amount','4865');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4870','Abschreibungen auf Finanzanlagen','A','E','AP_amount','4870');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4872','Abschr. aufgrund v. Verlustant. an Mitunt. §8 GewStG','A','E','AP_amount','4872');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4874','Abschr. a. Finanzanl. aufgrund steuerl. Sondervorschriften','A','E','AP_amount','4874');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4875','Abschreibungen auf Wertpapiere des Umlaufvermögens','A','E','AP_amount','4875');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4880','Abschr. a. Umlaufv. ohne Wertpapiere (soweit unübl. Höhe)','A','E','AP_amount','4880');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4882','Abschr. a. Umlaufv. steuerrechtl. bedingt (unübl. Höhe)','A','E','AP_amount','4882');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4887','Abschr. a. Umlaufv., steuerrechtlich bedingt (übl. Höhe)','A','E','AP_amount','4887');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4890','Vorwegn. künftiger Wertschw. im Umlaufv. (unübl. Höhe)','A','E','AP_amount','4890');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4900','Sonstige betriebliche Aufwendungen','A','E','AP_amount','4900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4905','Sonstige Aufwendungen betrieblich und regelmäßig','A','E','AP_amount','4905');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4910','Porto','A','E','AP_amount','4910');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4920','Telefon','A','E','AP_amount','4920');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4925','Telefax, Fernschreiber','A','E','AP_amount','4925');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4930','Bürobedarf','A','E','AP_amount','4930');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4940','Zeitschriften, Bücher','A','E','AP_amount','4940');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4945','Fortbildungskosten','A','E','AP_amount','4945');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4946','Freiwillige Sozialleistungen','A','E','AP_amount','4946');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4948','Vergütungen an freiberufliche Mitunternehmer §15 EStG','A','E','AP_amount','4948');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4950','Rechts- und Beratungskosten','A','E','AP_amount','4950');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4955','Buchführungskosten','A','E','AP_amount','4955');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4957','Abschluß- und Prüfungskosten','A','E','AP_amount','4957');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4960','Mieten für Einrichtungen','A','E','AP_amount','4960');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4968','Gewerbest. zu berücks. Miete f. Einrichtungen §8 GewStG','A','','','4968');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4969','Aufwendungen für Abraum- und Abfallbeseitigung','A','E','AP_amount','4969');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4970','Nebenkosten des Geldverkehrs','A','E','AP_amount','4970');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4980','Betriebsbedarf','A','E','AP_amount','4980');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4985','Werkzeuge und Kleingeräte','A','E','AP_amount','4985');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4996','Herstellungskosten','A','E','AP_amount','4996');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4997','Verwaltungskosten','A','E','AP_amount','4997');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4998','Vertriebskosten','A','E','AP_amount','4998');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('4999','Gegenkonto 49960-49980','A','','','4999');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('7140','Fertige Waren (Bestand)','A','A','IC','7140');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8100','Steuerfreie Umsätze o. VSt-Abzug §4 Nr.8 ff. UStG','A','I','AR_amount:IC_sale','8100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8500','Provisionserlöse','A','I','AR_amount:IC_sale','8500');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8504','Provisionserlöse steuerfrei (§4 Nr.8ff UStG)','A','I','AR_amount:IC_sale','8504');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8505','Provisionserlöse steuerfrei (§4 Nr.5 UStG)','A','I','AR_amount:IC_sale','8505');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8506','Provisionserlöse, 7% USt','A','I','AR_amount:IC_sale','8506');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8507','Provisionserlöse, 15% Ust','A','I','AR_amount:IC_sale','8507');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8508','Provisionserlöse, 15%/16% USt','A','I','AR_amount:IC_sale','8508');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8509','Provisionserlöse, 16% Ust','A','I','AR_amount:IC_sale','8509');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8591','Sachbezüge, 7% USt (Waren)','A','I','AR_amount:IC_sale','8591');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8595','Sachbezüge, 15%/16% USt (Waren)','A','I','AR_amount:IC_sale','8595');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8596','Sachbezüge, 16% USt (Waren)','A','I','AR_amount:IC_sale','8596');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8597','Sachbezüge, 15% USt (Waren)','A','I','AR_amount:IC_sale','8597');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8630','Sonstige Erlöse betrieblich und regelmäßig, 7% USt','A','I','AR_amount:IC_sale','8630');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8645','Sonstige Erlöse betrieblich und regelmäßig, 16% Ust','A','I','AR_amount:IC_sale','8645');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8730','Gewährte Skonti','A','','','8730');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8731','Gewährte Skonti, 7% USt','A','','','8731');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8735','Gewährte Skonti, 16% Ust','A','','','8735');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8740','Gewährte Boni','A','','','8740');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8750','Gewährte Boni, 7% USt','A','','','8750');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8762','Gewährte Boni, 16% Ust','A','','','8762');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8770','Gewährte Rabatte','A','','','8770');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8780','Gewährte Rabatte, 7% USt','A','','','8780');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8792','Gewährte Rabatte, 16% Ust','A','','','8792');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8800','Erlöse aus Anlagenverkäufen','A','','','8800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8801','Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchverlust)','A','','','8801');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8810','Erlöse aus Anlagenverkäufen 16% USt (bei Buchverlust)','A','','','8810');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8815','Erlöse aus Anlagenverkäufen 15% USt (bei Buchverlust)','A','','','8815');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8820','Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchgewinn)','A','','','8820');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8829','Erlöse aus Anlagenverkäufen (bei Buchgewinn)','A','','','8829');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8830','Erlöse aus Anlagenverkäufen 16% USt (bei Buchgewinn)','A','','','8830');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8835','Erlöse aus Anlagenverkäufen 15% USt (bei Buchgewinn)','A','','','8835');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8900','Eigenverbrauch','A','','','8900');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8905','Entnahme Gegenstände ohne USt','A','','','8905');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8908','Entnahme von Gegenstände, 16% USt §1 Abs.1 Nr.2a UStG','A','','','8908');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8909','Entnahme von Gegenstände, 15% USt §1 Abs.1 Nr.2a UStG','A','','','8909');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8910','Entnahme von Gegenstände, 15%/16% USt §1 Abs.1 Nr.2a UStG','A','','','8910');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8915','Entnahme von Gegenstände, 7% USt §1 Abs.1 Nr.2a UStG','A','','','8915');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8920','Entnahme v. sonst. Leist., 15%/16% USt §1 A.1 Nr.2b UStG','A','','','8920');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8930','Entnahme v. sonst. Leist., 7% USt §1 A.1 Nr.2b UStG','A','','','8930');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8937','Entnahme v. sonst. Leist., 16% USt §1 A.1 Nr.2b UStG','A','','','8937');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8938','Entnahme v. sonst. Leist., 15% USt §1 A.1 Nr.2b UStG','A','','','8938');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8939','Entnahme v. sonst. Leist., ohne USt §1 A.1 Nr.2b UStG','A','','','8939');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8941','Eigenverbr., 7% Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8941');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8942','Eigenverbr., 16% Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8942');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8944','Eigenverbr., ohne Ust §4 A.1 Nr.5 1-7, A.7 EStG','A','','','8944');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8950','Nicht steuerbare Umsätze','A','','','8950');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8955','Umsatzsteuervergütungen','A','','','8955');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8960','Bestandsveränd. - unfertige Erzeugnisse','A','','','8960');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8970','Bestandsveränd. - unfertige Leistungen','A','','','8970');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8975','Bestandsveränd. - in Ausführung befindliche Bauaufträge','A','','','8975');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8977','Bestandsveränd. - in Arbeit befindliche Aufträge','A','','','8977');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8980','Bestandsveränd. - fertige Erzeugnisse','A','','','8980');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8990','Bestandsveränd. - andere aktivierte Eigenleistungen','A','','','8990');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9000','Saldenvorträge Sachkonten','A','','','9000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9008','Saldenvorträge Debitoren','A','','','9008');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9009','Saldenvorträge Kreditoren','A','','','9009');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('9100','Saldovortragskonto der Statistikkonten','A','','','9100');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1800','Privatentn. allg. (Privat Vollhafter / Einzelunternehmer)','A','Q','','1800');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('2000','Außerordentliche Aufwendungen','A','A','','2000');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('1600','Verb. aus Lief. und Leist. Lieferantengruppe 0','A','L','AP:CT_tax','1600');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('3400','Wareneingang, 16% Vorsteuer','A','E','AP_amount:CT_tax','3400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8400','Umsatzerlöse 16%','A','I','AR_amount:IC_sale:CT_tax','8400');
+INSERT INTO chart (accno,description,charttype,category,link,gifi_accno) VALUES ('8840','Ertrge aus Kursdifferenzen','A','I','AR_amount:IC_sale:IC_income','8840');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1571'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1575'),0.16);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1576'),0.15);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1775'),0.16);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '1776'),0.15);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '3400'),0.16);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '8400'),0.16);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '7140'), income_accno_id = (select id from chart where accno = '8400'), expense_accno_id = (select id from chart where accno = '4700'), fxgain_accno_id = (select id from chart where accno = '8840'), fxloss_accno_id = (select id from chart where accno = '8840'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'EUR:USD', weightunit = 'kg';
+--
+
diff --git a/sql-ledger/sql/Germany-SKR03-gifi.sql b/sql-ledger/sql/Germany-SKR03-gifi.sql
new file mode 100644
index 000000000..7fc0ff622
--- /dev/null
+++ b/sql-ledger/sql/Germany-SKR03-gifi.sql
@@ -0,0 +1,1083 @@
+-- Kontenrahmen für Deutschland
+--
+INSERT INTO gifi (accno,description) VALUES ('0001', 'Aufw. f. die Ingangsetzung u. Erweit. des Geschäftsbetr.');
+INSERT INTO gifi (accno,description) VALUES ('0002', 'Aufw. f. die Währungsumstellung auf den EURO');
+INSERT INTO gifi (accno,description) VALUES ('0010', 'Konzess., gew. Schutzr. u. ähnl. Rechte/Werte sowie Liz.');
+INSERT INTO gifi (accno,description) VALUES ('0015', 'Konzessionen');
+INSERT INTO gifi (accno,description) VALUES ('0020', 'Gewerbliche Schutzrechte');
+INSERT INTO gifi (accno,description) VALUES ('0025', 'Ähnliche Rechte und Werte');
+INSERT INTO gifi (accno,description) VALUES ('0027', 'EDV-Software');
+INSERT INTO gifi (accno,description) VALUES ('0030', 'Lizenzen an gewerbl. Schutzr. u. ähnl. Rechten u. Werten');
+INSERT INTO gifi (accno,description) VALUES ('0035', 'Geschäfts- oder Firmenwert');
+INSERT INTO gifi (accno,description) VALUES ('0038', 'Anzahlungen auf Geschäfts- oder Firmenwert');
+INSERT INTO gifi (accno,description) VALUES ('0039', 'Anzahlungen auf immaterielle Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('0040', 'Verschmelzungsmehrwert');
+INSERT INTO gifi (accno,description) VALUES ('0050', 'Grundst., gl. Rechte/Bauten einschl. Bauten a. fr. Grundst.');
+INSERT INTO gifi (accno,description) VALUES ('0060', 'Grundstücke und grundstücksgleiche Rechte ohne Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0065', 'Unbebaute Grundstücke');
+INSERT INTO gifi (accno,description) VALUES ('0070', 'Grundstücksgleiche Rechte (Erbbaurecht, Dauerwohnrecht)');
+INSERT INTO gifi (accno,description) VALUES ('0075', 'Grundstücke mit Substanzverzehr');
+INSERT INTO gifi (accno,description) VALUES ('0079', 'Anzahl. a. Grundst. u. grundstücksgl. Rechte ohne Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0080', 'Bauten auf eigenen Grundst. und grundstücksgl. Rechten');
+INSERT INTO gifi (accno,description) VALUES ('0085', 'Grundstückswerte eigener bebauter Grundsstücke');
+INSERT INTO gifi (accno,description) VALUES ('0090', 'Geschäftsbauten');
+INSERT INTO gifi (accno,description) VALUES ('0100', 'Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0110', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0111', 'Außenanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0112', 'Hof- u. Wegebefestigungen');
+INSERT INTO gifi (accno,description) VALUES ('0113', 'Einrichtungen für Geschäfts- u. Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0115', 'Andere Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0120', 'Geschäfts-, Fabrik- u. andere Bauten im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0129', 'Anz. a. Geschäfts-, Fabrik-, u.a. Bauten a. eig. Grundst+Rechte');
+INSERT INTO gifi (accno,description) VALUES ('0140', 'Wohnbauten');
+INSERT INTO gifi (accno,description) VALUES ('0145', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0146', 'Außenanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0147', 'Hof- und Wegebefestigungen');
+INSERT INTO gifi (accno,description) VALUES ('0148', 'Einrichtungen für Wohnbauten');
+INSERT INTO gifi (accno,description) VALUES ('0150', 'Wohnbauten im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0159', 'Anz. auf Wohnbauten auf eig. Grundstücken u. grundst.gl. Rechten');
+INSERT INTO gifi (accno,description) VALUES ('0160', 'Bauten auf fremden Grundstücken');
+INSERT INTO gifi (accno,description) VALUES ('0165', 'Geschäftsbauten');
+INSERT INTO gifi (accno,description) VALUES ('0170', 'Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0175', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0176', 'Außenanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0177', 'Hof- und Wegebefestigen');
+INSERT INTO gifi (accno,description) VALUES ('0178', 'Einrichtungen für Geschäfts- und Fabrikbauten');
+INSERT INTO gifi (accno,description) VALUES ('0179', 'Andere Bauten');
+INSERT INTO gifi (accno,description) VALUES ('0180', 'Geschäfts-, Fabrik- und andere Bauten im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0189', 'Anzahl. a. Geschäfts-, Fabrik-, u.a. Bauten a. fr. Grundst.');
+INSERT INTO gifi (accno,description) VALUES ('0190', 'Wohnbauten');
+INSERT INTO gifi (accno,description) VALUES ('0191', 'Garagen');
+INSERT INTO gifi (accno,description) VALUES ('0192', 'Außenanlagen');
+INSERT INTO gifi (accno,description) VALUES ('0193', 'Hof- und Wegebefestigungen');
+INSERT INTO gifi (accno,description) VALUES ('0194', 'Einrichtungen für Wohnbauten');
+INSERT INTO gifi (accno,description) VALUES ('0195', 'Wohnbauten im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0199', 'Anzahlungen auf Wohnbauten auf fremden Grundstücken');
+INSERT INTO gifi (accno,description) VALUES ('0200', 'Technische Anlagen und Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0210', 'Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0220', 'Maschinengebundene Werkzeuge');
+INSERT INTO gifi (accno,description) VALUES ('0240', 'Maschinelle Anlagen');
+INSERT INTO gifi (accno,description) VALUES ('0260', 'Transportanlagen und ähnliches');
+INSERT INTO gifi (accno,description) VALUES ('0280', 'Betriebsvorrichtungen');
+INSERT INTO gifi (accno,description) VALUES ('0290', 'Technische Anlagen und Maschinen im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0299', 'Anzahlungen auf technische Anlagen und Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('0300', 'Andere Anlagen, Betriebs- und Geschäftsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0310', 'Andere Anlagen');
+INSERT INTO gifi (accno,description) VALUES ('0320', 'Pkw');
+INSERT INTO gifi (accno,description) VALUES ('0350', 'Lkw');
+INSERT INTO gifi (accno,description) VALUES ('0380', 'Sonstige Transportmittel');
+INSERT INTO gifi (accno,description) VALUES ('0400', 'Betriebsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0410', 'Geschäftsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0420', 'Büroeinrichtung');
+INSERT INTO gifi (accno,description) VALUES ('0430', 'Ladeneinrichtung');
+INSERT INTO gifi (accno,description) VALUES ('0440', 'Werkzeuge');
+INSERT INTO gifi (accno,description) VALUES ('0450', 'Einbauten');
+INSERT INTO gifi (accno,description) VALUES ('0460', 'Gerüst- und Schalungsmaterial');
+INSERT INTO gifi (accno,description) VALUES ('0480', 'Geringwertige Wirtschaftsgüter bis DM 800,-');
+INSERT INTO gifi (accno,description) VALUES ('0490', 'Sonstige Betriebs- und Geschäftsausstattung');
+INSERT INTO gifi (accno,description) VALUES ('0498', 'Andere Anlagen, Betriebs- und Geschäftsausstatt. im Bau');
+INSERT INTO gifi (accno,description) VALUES ('0499', 'Anzahl. a. andere Anlagen, Betriebs- u. Geschäftsausstatt.');
+INSERT INTO gifi (accno,description) VALUES ('0500', 'Anteile an verbundenen Unternehmen (Anlagevermögen)');
+INSERT INTO gifi (accno,description) VALUES ('0504', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft');
+INSERT INTO gifi (accno,description) VALUES ('0505', 'Ausleihungen an verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0510', 'Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0513', 'Typisch stille Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0516', 'Atypisch stille Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('0517', 'Andere Beteiligungen an Kapitalgesellschaften');
+INSERT INTO gifi (accno,description) VALUES ('0518', 'Andere Beteiligungen an Personengesellschaften');
+INSERT INTO gifi (accno,description) VALUES ('0519', 'Beteiligung einer GmbH&CoKG an einer Komplementär GmbH');
+INSERT INTO gifi (accno,description) VALUES ('0520', 'Ausleihung an Untern. m.d.e. Beteiligungsverhältnis besteht');
+INSERT INTO gifi (accno,description) VALUES ('0525', 'Wertpapiere des Anlagevermögens');
+INSERT INTO gifi (accno,description) VALUES ('0530', 'Wertpapiere mit Gewinnbeteiligungsansprüchen');
+INSERT INTO gifi (accno,description) VALUES ('0535', 'Festverzinsliche Wertpapiere');
+INSERT INTO gifi (accno,description) VALUES ('0540', 'Sonstige Ausleihungen');
+INSERT INTO gifi (accno,description) VALUES ('0550', 'Darlehen / Sonstige Ausleihungen');
+INSERT INTO gifi (accno,description) VALUES ('0570', 'Genossenschaftsanteile zum langfristigen Verbleib');
+INSERT INTO gifi (accno,description) VALUES ('0580', 'Ausleihungen an Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('0590', 'Ausleihungen an nahestehende Personen');
+INSERT INTO gifi (accno,description) VALUES ('0595', 'Rückdeckungsanspr. a. Lebensvers. z. langfrist. Verbleib');
+INSERT INTO gifi (accno,description) VALUES ('0600', 'Anleihen nicht konvertibel');
+INSERT INTO gifi (accno,description) VALUES ('0601', 'Anleihen nicht konvertibel - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0605', 'Anleihen nicht konvertibel - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0610', 'Anleihen nicht konvertibel - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0615', 'Anleihen konvertibel');
+INSERT INTO gifi (accno,description) VALUES ('0616', 'Anleihen konvertibel - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0620', 'Anleihen konvertibel - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0625', 'Anleihen konvertibel - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0630', 'Verbindlichkeiten gegenüber Kreditinstituten');
+INSERT INTO gifi (accno,description) VALUES ('0631', 'Verb. gg. Kreditinstituten - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0640', 'Verb. gg. Kreditinstituten - Restlaufz. 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0650', 'Verb. gg. Kreditinstituten - Restlaufz. größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0660', 'Verbindlichkeiten gg. Kreditinst. aus TZ-Verträgen');
+INSERT INTO gifi (accno,description) VALUES ('0661', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('0670', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0680', 'Verb. gg. Kreditinst. aus TZ-Verträgen - Restl. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0700', 'Verbindlichkeiten gg. verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('0701', 'Verb. gg. verbundenen Unternehmen - Restlaufz. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('0705', 'Verb. gg. verbundenen Unternehmen - Restlaufz. 1 b. 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0710', 'Verb. gg. verb. Untern. - Restlaufz. gr. 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0715', 'Verb. gg. Untern. mit denen ein Beteiligungsverh. besteht');
+INSERT INTO gifi (accno,description) VALUES ('0716', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. b. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('0720', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. 1 b. 5 J');
+INSERT INTO gifi (accno,description) VALUES ('0725', 'Verb. gg. U. m.d.e. Beteiligungsv. best. - Restl. gr. 5 J');
+INSERT INTO gifi (accno,description) VALUES ('0730', 'Verbindlichkeiten gegenüber Gesellschaftern');
+INSERT INTO gifi (accno,description) VALUES ('0731', 'Verb. gg. Gesellschaftern - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0740', 'Verb. gg. Gesellschaftern - Restlaufz. 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0750', 'Verb. gg. Gesellschaftern - Restlaufz. größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0755', 'Verb. gg. Gesellschaftern für offene Ausschüttungen');
+INSERT INTO gifi (accno,description) VALUES ('0760', 'Darlehen typisch stiller Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('0761', 'Darlehen typ. stiller Gesellschafter - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0764', 'Darlehen typ. stiller Gesellschafter - Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0767', 'Darlehen typ. stiller Gesellschafter - Restlaufz. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0770', 'Darlehen atypisch stiller Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('0771', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('0774', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0777', 'Darlehen atyp. stiller Gesellsch.- Restlaufz. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('0780', 'Partiarische Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('0781', 'Partiarische Darlehen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0784', 'Partiarische Darlehen - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0787', 'Partiarische Darlehen - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('0800', 'Gezeichnetes Kapital');
+INSERT INTO gifi (accno,description) VALUES ('0801', 'Ausst. Einl. a.d. gez. Kapital, nicht eingef. (Aktivausw.)');
+INSERT INTO gifi (accno,description) VALUES ('0810', 'Ausst. Einl. a.d. gez. Kapital, eingeford. (Aktivausw.)');
+INSERT INTO gifi (accno,description) VALUES ('0820', 'Ausst. Einl. a.d. gez. Kapital, nicht eingef. (Passivausw.)');
+INSERT INTO gifi (accno,description) VALUES ('0830', 'Ausst. Einl. a.d. gez. Kapital, eingef. (Passivausw.)');
+INSERT INTO gifi (accno,description) VALUES ('0839', 'Eingeforderte Nachschüsse');
+INSERT INTO gifi (accno,description) VALUES ('0840', 'Kapitalrücklage');
+INSERT INTO gifi (accno,description) VALUES ('0841', 'Kapitalrückl. durch Ausgabe von Anteilen über Nennbetrag');
+INSERT INTO gifi (accno,description) VALUES ('0842', 'Kap.Rückl. Schuldver. f. Wandl.- u. Optionsr. z. Erw. v. Ant');
+INSERT INTO gifi (accno,description) VALUES ('0843', 'Kapitalrückl. d. Zuzahl. gg. Gewähr e. Vorzuges f. Anteile');
+INSERT INTO gifi (accno,description) VALUES ('0844', 'Kapitalrückl. d. andere Zuzahlungen in das Eigenkapital');
+INSERT INTO gifi (accno,description) VALUES ('0845', 'Eingefordertes Nachschußkapital');
+INSERT INTO gifi (accno,description) VALUES ('0846', 'Gesetzliche Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('0847', 'Gesetzliche Rücklage 50/45% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0848', 'Gesetzliche Rücklage 30% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0849', 'Gesetzliche Rücklage 0% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0850', 'Rücklage für eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('0851', 'Satzungsmäßige Rücklagen');
+INSERT INTO gifi (accno,description) VALUES ('0852', 'Satzungsmäßige Rücklage 50/45% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0853', 'Satzungsmäßige Rücklage 30% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0854', 'Satzungsmäßige Rücklage 0% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0855', 'Andere Gewinnrücklagen 50/45% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0856', 'Eigenkapitalanteil von Wertaufholungen');
+INSERT INTO gifi (accno,description) VALUES ('0857', 'Eigenkapitalanteil von Preissteigerungsrücklagen');
+INSERT INTO gifi (accno,description) VALUES ('0858', 'Andere Gewinnrücklagen 30% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0859', 'Andere Gewinnrücklagen 0% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0860', 'Gewinnvortrag vor Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0862', 'Gewinnvortrag 50/45% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0864', 'Gewinnvortrag 30% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0866', 'Gewinnvortrag 0% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('0868', 'Verlustvortrag vor Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('0869', 'Vorträge auf neue Rechnung (Bilanz)');
+INSERT INTO gifi (accno,description) VALUES ('0870', 'Festkapital (Personenges. Vollhafter / Einzelu.)');
+INSERT INTO gifi (accno,description) VALUES ('0880', 'Variables Kapital (Personenges. Vollhaft. / Einzelu.)');
+INSERT INTO gifi (accno,description) VALUES ('0890', 'Gesellsch.-Darlehen (Personenges. Vollhaft. / Einzelu.)');
+INSERT INTO gifi (accno,description) VALUES ('0900', 'Kommandit-Kapital (Personenges. Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('0910', 'Verlustausgleichskonto (Personenges. Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('0920', 'Gesellschafter-Darlehen (Personenges. Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('0930', 'Sonderposten mit Rücklageanteil');
+INSERT INTO gifi (accno,description) VALUES ('0931', 'Sonderposten mit Rücklageanteil §6b EStG');
+INSERT INTO gifi (accno,description) VALUES ('0932', 'Sonderposten mit Rücklageanteil Abschnitt 35 EStR');
+INSERT INTO gifi (accno,description) VALUES ('0933', 'Sonderposten mit Rücklageanteil §6dEStG');
+INSERT INTO gifi (accno,description) VALUES ('0934', 'Sonderposten mit Rücklageanteil §1 EntwLStG');
+INSERT INTO gifi (accno,description) VALUES ('0935', 'Sonderposten mit Rücklageanteil §3 Ausl-InvG');
+INSERT INTO gifi (accno,description) VALUES ('0936', 'Sonderposten mit Rücklageanteil §7d EStG');
+INSERT INTO gifi (accno,description) VALUES ('0937', 'Sonderposten mit Rücklageanteil §79 EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0938', 'Sonderposten mit Rücklageanteil §80 EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0939', 'Sonderposten mit Rücklageanteil §81 EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0940', 'Sonderposten mit Rücklageanteil §82 EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0941', 'Sonderposten mit Rücklageanteil §82a EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0942', 'Sonderposten mit Rücklageanteil §82d EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0943', 'Sonderposten mit Rücklageanteil §82e EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0944', 'Sonderposten mit Rücklageanteil §14 BerlinFG');
+INSERT INTO gifi (accno,description) VALUES ('0945', 'Sonderposten mit Rücklageanteil §3 ZonenRFG / §4-6 FördergebietsG');
+INSERT INTO gifi (accno,description) VALUES ('0946', 'Sonderposten mit Rücklageanteil §52 Abs. 5 EStG');
+INSERT INTO gifi (accno,description) VALUES ('0947', 'Sonderposten mit Rücklageanteil §7g Abs. 1 EStG');
+INSERT INTO gifi (accno,description) VALUES ('0948', 'Sonderposten mit Rücklageanteil §7g Abs. 3 EStG');
+INSERT INTO gifi (accno,description) VALUES ('0949', 'Sonderposten mit Rücklageanteil §74 EStDV');
+INSERT INTO gifi (accno,description) VALUES ('0950', 'Rückstellungen für Pensionen und ähnliche Verpflichtungen');
+INSERT INTO gifi (accno,description) VALUES ('0955', 'Steuerrückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0957', 'Gewerbesteuerrückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0963', 'Körperschaftsteuerrückstellung');
+INSERT INTO gifi (accno,description) VALUES ('0969', 'Rückstellungen für latente Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0970', 'Sonstige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('0971', 'Rückst. unterl. Aufw. Instandhalt., Nachhol. in 3 Mon');
+INSERT INTO gifi (accno,description) VALUES ('0972', 'Rückst. unterl. Aufw. Instandhalt., Nachhol. in 4-12 Mon');
+INSERT INTO gifi (accno,description) VALUES ('0973', 'Rückstellungen für Abraum- und Abfallbeseitigung');
+INSERT INTO gifi (accno,description) VALUES ('0974', 'Rückstellungen für Gewährleistungen');
+INSERT INTO gifi (accno,description) VALUES ('0976', 'Rückst. f. drohende Verluste a. schwebenden Geschäften');
+INSERT INTO gifi (accno,description) VALUES ('0977', 'Rückstellungen für Abschluß- und Prüfungskosten');
+INSERT INTO gifi (accno,description) VALUES ('0978', 'Aufwandsrückstellungen gemäß § 249 Abs. 2 HGB');
+INSERT INTO gifi (accno,description) VALUES ('0979', 'Rückstellungen für den Umweltschutz');
+INSERT INTO gifi (accno,description) VALUES ('0980', 'Aktive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('0983', 'Abgrenzung aktive latente Steuern');
+INSERT INTO gifi (accno,description) VALUES ('0984', 'Als Aufwand berücks. Zölle u. Verbrauchsst. a. Vorräte');
+INSERT INTO gifi (accno,description) VALUES ('0985', 'Als Aufwand berücks. Umsatzsteuer auf Anzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('0986', 'Damnum / Disagio');
+INSERT INTO gifi (accno,description) VALUES ('0990', 'Passive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('0992', 'Wertber.n (zur unterjährigen Kostenverrechnung f. BWA)');
+INSERT INTO gifi (accno,description) VALUES ('0996', 'Pauschalwertberichtigung a. Ford. - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0997', 'Pauschalwertberichtigung a. Ford. - Restlaufz. größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0998', 'Einzelwertberichtigung a. Ford. - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('0999', 'Einzelwertberichtigung a. Ford. - Restlaufz. größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1000', 'Kasse');
+INSERT INTO gifi (accno,description) VALUES ('1010', 'Nebenkasse 1');
+INSERT INTO gifi (accno,description) VALUES ('1020', 'Nebenkasse 2');
+INSERT INTO gifi (accno,description) VALUES ('1100', 'Postgiro');
+INSERT INTO gifi (accno,description) VALUES ('1110', 'Postgiro 1');
+INSERT INTO gifi (accno,description) VALUES ('1120', 'Postgiro 2');
+INSERT INTO gifi (accno,description) VALUES ('1130', 'Postgiro 3');
+INSERT INTO gifi (accno,description) VALUES ('1190', 'LZB-Guthaben');
+INSERT INTO gifi (accno,description) VALUES ('1195', 'Bundesbankguthaben');
+INSERT INTO gifi (accno,description) VALUES ('1200', 'Bank-Giro');
+INSERT INTO gifi (accno,description) VALUES ('1210', 'Bank-Giro 1');
+INSERT INTO gifi (accno,description) VALUES ('1220', 'Bank-Giro 2');
+INSERT INTO gifi (accno,description) VALUES ('1230', 'Bank-Giro 3');
+INSERT INTO gifi (accno,description) VALUES ('1300', 'Wechsel aus Lieferungen und Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('1301', 'Wechsel aus Lieferungen u. Leistungen - Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1302', 'Wechsel aus Lieferungen u. Leistungen - Restl. größer 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1305', 'Wechsel aus Lieferungen u. Leistungen, bundesbankfähig');
+INSERT INTO gifi (accno,description) VALUES ('1310', 'Besitzwechsel gg. verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('1311', 'Besitzwechsel gg. verbundenen Untern. - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1312', 'Besitzwechsel gg. verbundenen Untern. - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1315', 'Besitzwechsel gg. verb. Unternehmen, bundesbankfähig');
+INSERT INTO gifi (accno,description) VALUES ('1320', 'Besitzwechsel gg. Untern. m.d.e. Beteiligungsverh. best.');
+INSERT INTO gifi (accno,description) VALUES ('1321', 'Besitzwechsel gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('1322', 'Besitzwechsel gg. U. m.d.e. Beteilig. best. - Restl. gr. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('1325', 'Besitzwechsel gg. U. m.d.e. Beteilig. best., bundsbankfähig');
+INSERT INTO gifi (accno,description) VALUES ('1327', 'Finanzwechsel');
+INSERT INTO gifi (accno,description) VALUES ('1330', 'Schecks');
+INSERT INTO gifi (accno,description) VALUES ('1340', 'Anteile an verb. Unternehmen (Umlaufvermögen)');
+INSERT INTO gifi (accno,description) VALUES ('1344', 'Anteile an herrschender oder mit Mehrheit beteiligter Gesellschaft');
+INSERT INTO gifi (accno,description) VALUES ('1345', 'Eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('1348', 'Sonstige Wertpapiere');
+INSERT INTO gifi (accno,description) VALUES ('1350', 'GmbH-Anteile zum kurzfristigen Verbleib');
+INSERT INTO gifi (accno,description) VALUES ('1352', 'Genossenschaftsanteile zum kurzfristigen Verbleib');
+INSERT INTO gifi (accno,description) VALUES ('1355', 'Ansprüche aus Rückdeckungsversicherungen');
+INSERT INTO gifi (accno,description) VALUES ('1360', 'Geldtransit Bank');
+INSERT INTO gifi (accno,description) VALUES ('1361', 'Geldtransit Bank 1');
+INSERT INTO gifi (accno,description) VALUES ('1362', 'Geldtransit Bank 2');
+INSERT INTO gifi (accno,description) VALUES ('1363', 'Geldtransit Bank 3');
+INSERT INTO gifi (accno,description) VALUES ('1369', 'Interne Umbuchung');
+INSERT INTO gifi (accno,description) VALUES ('1370', 'Verrechnungskonto Gewinnermittlung §4/3 EStG, ergebniswirksam');
+INSERT INTO gifi (accno,description) VALUES ('1371', 'Verrechnungskonto für Gewinnermittl. §4/3EStG, nicht ergebniswirksam');
+INSERT INTO gifi (accno,description) VALUES ('1380', 'Überleitungskonto Kostenstelle');
+INSERT INTO gifi (accno,description) VALUES ('1390', 'Verrechnungskonto Ist-Versteuerung');
+INSERT INTO gifi (accno,description) VALUES ('1400', 'Forderungen aus Lief. und Leist. Kundengruppe 0');
+INSERT INTO gifi (accno,description) VALUES ('1401', 'Forderungen aus Lief. und Leist. Kundengruppe 1');
+INSERT INTO gifi (accno,description) VALUES ('1402', 'Forderungen aus Lief. und Leist. Kundengruppe 2');
+INSERT INTO gifi (accno,description) VALUES ('1410', 'Forderungen aus Lief. und Leist. ohne Kontokorrent');
+INSERT INTO gifi (accno,description) VALUES ('1450', 'Forderungen nach §11, Abs.1 Satz 2 EStG für § 4/3 EStG');
+INSERT INTO gifi (accno,description) VALUES ('1451', 'Ford.a.Lief.u.Leist. ohne Kontokorrent - Restlaufz. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1455', 'Ford.a.Lief.u.Leist. ohne Kontokorrent - Restlaufz. gr.1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1460', 'Zweifelhafte Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('1461', 'Zweifelhafte Forderungen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1465', 'Zweifelhafte Forderungen - Restlaufzeit größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1470', 'Ford.a.Lief.u.Leist. gg. verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('1471', 'Ford.a.Lief.u.Leist. gg. verb. Untern. - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1475', 'Ford.a.Lief.u.Leist. gg. verb. Untern. - Restl. größer 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1478', 'Wertber. a. Ford.a.L.u.L. gg. verb. U. - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1479', 'Wertber. a. Ford.a.L.u.L. gg. verb. U. - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1480', 'Ford.a.L.u.L. gg. Untern. m.d.e. Beteiligungsverh. best.');
+INSERT INTO gifi (accno,description) VALUES ('1481', 'Ford.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('1485', 'Ford.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. gr. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('1488', 'Wertber. a. Ford. Restl. b. 1 J. gg. U. m.d.e. Beteilig.');
+INSERT INTO gifi (accno,description) VALUES ('1489', 'Wertber. a. Ford. Restl. gr. 1 J. gg. U. m.d.e. Beteilig.');
+INSERT INTO gifi (accno,description) VALUES ('1490', 'Ford.a.Lief.u.Leist. gegen Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('1491', 'Ford.a.Lief.u.Leist. gg. Gesellsch.- Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1495', 'Ford.a.Lief.u.Leist. gg. Gesellsch.- Restlaufz. größer 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1499', 'Gegenkonto 14510-14980 bei Aufteilung Debitoren');
+INSERT INTO gifi (accno,description) VALUES ('1500', 'Sonstige Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('1501', 'Sonstige Vermögensgegenstände - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1502', 'Sonstige Vermögensgegenstände - Restlaufz. größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1503', 'Ford. gg. Vorstandsmitgl. u. Geschäftsf. - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1504', 'Ford. gg. Vorstandsmitgl. u. Geschäftsf. - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1505', 'Ford. gg. Aufsichtsrats- u. Beiratsmitgl. - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1506', 'Ford. gg. Aufsichtsrats- u. Beiratsmitgl. - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1507', 'Ford. gg. Gesellschafter - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1508', 'Ford. gg. Gesellschafter - Restlaufzeit größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1510', 'Geleistete Anzahlungen auf Vorräte');
+INSERT INTO gifi (accno,description) VALUES ('1511', 'Geleistete Anzahlungen, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1516', 'Geleistete Anzahlungen, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1517', 'Geleistete Anzahlungen, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1521', 'Agenturwarenabrechnung');
+INSERT INTO gifi (accno,description) VALUES ('1525', 'Kautionen');
+INSERT INTO gifi (accno,description) VALUES ('1526', 'Kautionen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1527', 'Kautionen - Restlaufzeit größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1530', 'Forderungen gegen Personal');
+INSERT INTO gifi (accno,description) VALUES ('1531', 'Forderungen gegen Personal - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1537', 'Forderungen gegen Personal - Restlaufzeit größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1540', 'Steuerüberzahlungen');
+INSERT INTO gifi (accno,description) VALUES ('1542', 'Steuererstattungsansprüche gg. anderen EU-Ländern');
+INSERT INTO gifi (accno,description) VALUES ('1545', 'Umsatzsteuerforderungen');
+INSERT INTO gifi (accno,description) VALUES ('1547', 'Forderungen aus entrichteten Verbrauchssteuern');
+INSERT INTO gifi (accno,description) VALUES ('1548', 'Vorsteuer im Folgejahr abziehbar');
+INSERT INTO gifi (accno,description) VALUES ('1549', 'Körperschaftsteuerrückforderung');
+INSERT INTO gifi (accno,description) VALUES ('1550', 'Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('1551', 'Darlehen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1555', 'Darlehen - Restlaufzeit größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1560', 'Aufzuteilende Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1561', 'Aufzuteilende Vorsteuer, 7%');
+INSERT INTO gifi (accno,description) VALUES ('1562', 'Aufzuteilende Vorsteuer aus ig. Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('1565', 'Aufzuteilende Vorsteuer, 16 %');
+INSERT INTO gifi (accno,description) VALUES ('1566', 'Aufzuteilende Vorsteuer, 15 %');
+INSERT INTO gifi (accno,description) VALUES ('1570', 'Abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1571', 'Abziehbare Vorsteuer, 7%');
+INSERT INTO gifi (accno,description) VALUES ('1572', 'Abziehbare Vorsteuer aus ig. Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('1573', 'Abziehbare Vorsteuer aus ig. Erwerb, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1575', 'Abziehbare Vorsteuer, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1576', 'Abziehbare Vorsteuer, 15%');
+INSERT INTO gifi (accno,description) VALUES ('1577', 'Vorsteuer nach allg. Durchschnittssätzen UStVA KZ 63');
+INSERT INTO gifi (accno,description) VALUES ('1578', 'Berichtigung des VSt-Abzugs früherer Jahre UStVA KZ 64');
+INSERT INTO gifi (accno,description) VALUES ('1580', 'Gegenkonto Vorsteuer § 4/3 EStG');
+INSERT INTO gifi (accno,description) VALUES ('1581', 'Auflösung Vorsteuer aus Vorjahr § 4/3 EStG');
+INSERT INTO gifi (accno,description) VALUES ('1584', 'Abziehb. VSt. a. ig. Erw. v. Neufahrz. v. Lief. ohne USt-ID');
+INSERT INTO gifi (accno,description) VALUES ('1586', 'Kürzung BerlinFG');
+INSERT INTO gifi (accno,description) VALUES ('1588', 'Bezahlte Einfuhrumsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1590', 'Durchlaufende Posten');
+INSERT INTO gifi (accno,description) VALUES ('1593', 'Verrechnungskto erhalt. Anzahl. b. Buchung ü. Kundenkto');
+INSERT INTO gifi (accno,description) VALUES ('1594', 'Forderungen gegen verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('1595', 'Ford. gg. verbundene Unternehmen - Restlaufz. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1596', 'Ford. gg. verbundene Unternehmen - Restlaufz. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1597', 'Ford. gg. Untern. mit denen ein Beteiligungsverh. besteht');
+INSERT INTO gifi (accno,description) VALUES ('1598', 'Ford. gg. U. m.d.e. Beteiligungsv. best. - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1599', 'Ford. gg. U. m.d.e. Beteiligungsv. best. - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1600', 'Verb. aus Lief. und Leist. Lieferantengruppe 0');
+INSERT INTO gifi (accno,description) VALUES ('1601', 'Verb. aus Lief. und Leist. Lieferantengruppe 1');
+INSERT INTO gifi (accno,description) VALUES ('1602', 'Verb. aus Lief. und Leist. Lieferantengruppe 2');
+INSERT INTO gifi (accno,description) VALUES ('1610', 'Verb.a.L.u.L. ohne Kontokorrent');
+INSERT INTO gifi (accno,description) VALUES ('1624', 'Verbindlichkeiten aus Lief. u. Leist. für Investitionen für §4/3 EStG');
+INSERT INTO gifi (accno,description) VALUES ('1625', 'Verb.a.L.u.L. ohne Kontokorrent - Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1626', 'Verb.a.L.u.L. ohne Kontokorrent - Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1628', 'Verb.a.L.u.L. ohne Kontokorrent - Restlaufz. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1630', 'Verb.a.Lief.u.Leist. gg. verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('1631', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1635', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1638', 'Verb.a.L.u.L. gg. verb. Untern. - Restlaufz. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1640', 'Verb.a.L.u.L. gg. Untern. m.d.e. Beteiligungsverh. best.');
+INSERT INTO gifi (accno,description) VALUES ('1641', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. b. 1 J');
+INSERT INTO gifi (accno,description) VALUES ('1645', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. 1 b 5 J');
+INSERT INTO gifi (accno,description) VALUES ('1648', 'Verb.a.L.u.L. gg. U. m.d.e. Beteilig. best. - Restl. gr. 5 J');
+INSERT INTO gifi (accno,description) VALUES ('1650', 'Verb.a.Lief.u.Leist. gegen Gesellschaftern');
+INSERT INTO gifi (accno,description) VALUES ('1651', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1655', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1658', 'Verb.a.Lief.u.Leist. gg. Gesellsch. - Restl. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1659', 'Gegenkonto 16250-16580 bei Aufteilung Kreditoren-Konto');
+INSERT INTO gifi (accno,description) VALUES ('1660', 'Schuldwechsel');
+INSERT INTO gifi (accno,description) VALUES ('1661', 'Schuldwechsel - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1680', 'Schuldwechsel - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1690', 'Schuldwechsel - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1700', 'Sonstige Verbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('1701', 'Sonstige Verbindlichkeiten - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1702', 'Sonstige Verbindlichkeiten - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1703', 'Sonstige Verbindlichkeiten - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1704', 'Sonstige Verbindlichkeiten, z.B. nach §11,Abs.2,2 EStG für §4/3');
+INSERT INTO gifi (accno,description) VALUES ('1705', 'Darlehen');
+INSERT INTO gifi (accno,description) VALUES ('1706', 'Darlehen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1707', 'Darlehen - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1708', 'Darlehen - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1709', 'Gewinnverfügungskonto stiller Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('1710', 'Erhaltene Anzahlungen (Verbindlichkeiten)');
+INSERT INTO gifi (accno,description) VALUES ('1711', 'Erhaltene verst. Anzahl., 7% USt (Verbindlichkeiten)');
+INSERT INTO gifi (accno,description) VALUES ('1716', 'Erhaltene verst. Anzahl., 15% USt (Verbindlichkeiten)');
+INSERT INTO gifi (accno,description) VALUES ('1717', 'Erhaltene verst. Anzahl., 16% USt (Verbindlichkeiten)');
+INSERT INTO gifi (accno,description) VALUES ('1719', 'Erhaltene Anzahlungen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1720', 'Erhaltene Anzahlungen - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1721', 'Erhaltene Anzahlungen - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1722', 'Erhaltene Anzahlungen (von Vorräten offen abgesetzt)');
+INSERT INTO gifi (accno,description) VALUES ('1731', 'Agenturwarenabrechnung');
+INSERT INTO gifi (accno,description) VALUES ('1732', 'Erhaltene Kautionen');
+INSERT INTO gifi (accno,description) VALUES ('1733', 'Erhaltene Kautionen - Restlaufzeit bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1734', 'Erhaltene Kautionen - Restlaufzeit 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1735', 'Erhaltene Kautionen - Restlaufzeit größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1736', 'Verbindlichkeiten aus Betriebsteuern und Abgaben');
+INSERT INTO gifi (accno,description) VALUES ('1737', 'Verb. aus Betriebsteuern u. Abgaben - Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1738', 'Verb. aus Betriebsteuern u. Abgaben - Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1739', 'Verb. aus Betriebsteuern u. Abgaben - Restl. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1740', 'Verbindlichkeiten aus Lohn und Gehalt');
+INSERT INTO gifi (accno,description) VALUES ('1741', 'Verbindlichkeiten aus Lohn- und Kirchensteuer');
+INSERT INTO gifi (accno,description) VALUES ('1742', 'Verbindlichkeiten im Rahmen der sozialen Sicherheit');
+INSERT INTO gifi (accno,description) VALUES ('1743', 'Verb. im Rahmen der sozialen Sicherheit - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('1744', 'Verb. im Rahmen der sozialen Sicherheit - Restl. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1745', 'Verb. im Rahmen der sozialen Sicherheit - Restl. gr. 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('1746', 'Verbindlichkeiten aus Einbehaltungen');
+INSERT INTO gifi (accno,description) VALUES ('1747', 'Verbindlichkeiten für Verbrauchssteuern');
+INSERT INTO gifi (accno,description) VALUES ('1750', 'Verbindlichkeiten aus Vermögensbildung');
+INSERT INTO gifi (accno,description) VALUES ('1751', 'Verb. aus Vermögensbildung - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1752', 'Verb. aus Vermögensbildung - Restlaufz. 1 bis 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1753', 'Verb. aus Vermögensbildung - Restlaufz. größer 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1755', 'Lohn- und Gehaltsverrechnung');
+INSERT INTO gifi (accno,description) VALUES ('1758', 'Umsatzsteuerabzugsverfahren, 16% Umsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1759', 'Umsatzsteuerabzugsverfahren, 15% Umsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1760', 'Umsatzsteuer nicht fällig');
+INSERT INTO gifi (accno,description) VALUES ('1761', 'Umsatzsteuer nicht fällig , 7%');
+INSERT INTO gifi (accno,description) VALUES ('1762', 'Umsatzsteuer nicht fällig a.i. Inland steuerpfl. EU-Lief.');
+INSERT INTO gifi (accno,description) VALUES ('1763', 'Umsatzsteuer nicht fällig a.i. Inland steuerpfl. EU-Lief., 16%');
+INSERT INTO gifi (accno,description) VALUES ('1765', 'Umsatzsteuer nicht fällig, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1766', 'Umsatzsteuer nicht fällig, 15%');
+INSERT INTO gifi (accno,description) VALUES ('1767', 'Umsatzsteuer a.i. and. EU-Land steuerpfl. Lief.');
+INSERT INTO gifi (accno,description) VALUES ('1768', 'Umsatzsteuer a.i. and. EU-Land steuerpfl. sonst. Lief./Werkl.');
+INSERT INTO gifi (accno,description) VALUES ('1769', 'Steuerzahlungen an andere EU-Länder');
+INSERT INTO gifi (accno,description) VALUES ('1770', 'Umsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('1771', 'Umsatzsteuer, 7%');
+INSERT INTO gifi (accno,description) VALUES ('1772', 'Umsatzsteuer aus ig. Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('1773', 'Umsatzsteuer aus ig. Erwerb, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1775', 'Umsatzsteuer, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1776', 'Umsatzsteuer, 15%');
+INSERT INTO gifi (accno,description) VALUES ('1777', 'Umsatzsteuer aus im Inland steuerpfl. EU-Lieferungen');
+INSERT INTO gifi (accno,description) VALUES ('1778', 'Umsatzsteuer aus im Inland steuerpfl. EU-Lieferungen, 16%');
+INSERT INTO gifi (accno,description) VALUES ('1779', 'Umsatzsteuer aus ig. Erwerb ohne Vorsteuerabzug');
+INSERT INTO gifi (accno,description) VALUES ('1780', 'Umsatzsteuer - Vorauszahlungen');
+INSERT INTO gifi (accno,description) VALUES ('1781', 'Umsatzsteuer - Vorauszahlungen 1/11');
+INSERT INTO gifi (accno,description) VALUES ('1782', 'Nachsteuer, UStVA KZ 65');
+INSERT INTO gifi (accno,description) VALUES ('1783', 'In Rechnung unber. ausgewiesene und geschuldete Steuer, UStVA KZ 69');
+INSERT INTO gifi (accno,description) VALUES ('1784', 'Umsatzsteuer aus ig. Erw. v. Neufahrz. v. Lief. ohne USt-ID');
+INSERT INTO gifi (accno,description) VALUES ('1788', 'Einfuhrumsatzsteuer aufgeschoben bis');
+INSERT INTO gifi (accno,description) VALUES ('1789', 'Umsatzsteuer laufendes Jahr');
+INSERT INTO gifi (accno,description) VALUES ('1790', 'Umsatzsteuer Vorjahr');
+INSERT INTO gifi (accno,description) VALUES ('1791', 'Umsatzsteuer frühere Jahre');
+INSERT INTO gifi (accno,description) VALUES ('1792', 'Abgrenzung für Grundstücke');
+INSERT INTO gifi (accno,description) VALUES ('1794', 'Abgrenzung für immaterielle Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('1795', 'Abgrenzung für Bauten auf eigenen Grundstücken');
+INSERT INTO gifi (accno,description) VALUES ('1796', 'Abgrenzung für andere Anlagen, B.u.G. Ausstattung');
+INSERT INTO gifi (accno,description) VALUES ('1797', 'Abgrenzung für Bauten auf fremden Grundstücken');
+INSERT INTO gifi (accno,description) VALUES ('1798', 'Abgrenzung für technische Anlagen und Maschinen');
+INSERT INTO gifi (accno,description) VALUES ('1799', 'Sonstige Verrechnungskonten (Interimskonten)');
+INSERT INTO gifi (accno,description) VALUES ('1793', 'Verrechnungskto geleist. Anzahl. bei Buchung über Lief.Kto.');
+INSERT INTO gifi (accno,description) VALUES ('1800', 'Privatentn. allg. (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1810', 'Privatsteuern (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1820', 'Sonderausg. beschr. abzugsf. (Privat Vollhaft./Einzelu.)');
+INSERT INTO gifi (accno,description) VALUES ('1830', 'Sonderausg. unbeschr. abzugsf. (Privat Vollhaft./Einzelu.)');
+INSERT INTO gifi (accno,description) VALUES ('1840', 'Privatspenden (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1850', 'Außergewöhnliche Belastungen (Privat Vollhaft. / Einzelunt.)');
+INSERT INTO gifi (accno,description) VALUES ('1860', 'Grundstücksaufwand (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1870', 'Grundstücksertrag (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1880', 'Eigenverbrauch (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1890', 'Privateinlagen (Privat Vollhafter / Einzelunternehmer)');
+INSERT INTO gifi (accno,description) VALUES ('1900', 'Privatentnahmen allgemein (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1910', 'Privatsteuern (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1920', 'Sonderausgaben beschränkt abzugsf. (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1930', 'Sonderausgaben unbeschränkt abzugsf. (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1940', 'Privatspenden (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1950', 'Außergewöhnliche Belastungen (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1960', 'Grundstücksaufwand (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1970', 'Grundstücksertrag (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1980', 'Eigenverbrauch (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('1990', 'Privateinlagen (Privat Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('2000', 'Außerordentliche Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2010', 'Betriebsfremde Aufw. (soweit nicht außerordentlich)');
+INSERT INTO gifi (accno,description) VALUES ('2020', 'Periodenfremde Aufw. (soweit nicht außerordentlich)');
+INSERT INTO gifi (accno,description) VALUES ('2100', 'Zinsen und ähnliche Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2103', 'Steuerlich abzugsfähige, andere Nebenleistungen zu Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2104', 'Steuerlich nicht abzugsfähige, andere Nebenleistungen zu Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2107', 'Zinsaufwendungen §233a AO betriebliche Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2108', 'Zinsaufw. §233a, §234, §237 AO Personenst. §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('2109', 'Zinsaufwendungen an verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2110', 'Zinsaufwendungen für kurzfristige Verbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('2118', 'In Dauerschuldzins. umqualif. Zinsen a. kurzfristige Verb.');
+INSERT INTO gifi (accno,description) VALUES ('2119', 'Zinsaufw. f. kurzfristige Verb. an verbunden Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2120', 'Zinsaufwendungen für langfristige Verbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('2127', 'Renten u. dauernde Last. a. Gründung/Erwerb §8GewStG');
+INSERT INTO gifi (accno,description) VALUES ('2128', 'Zinsaufw. an Mitu. f. Hingabe v. langfrist. Kapital §15 EStG');
+INSERT INTO gifi (accno,description) VALUES ('2129', 'Zinsaufw. f. langfristige Verb. an verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2130', 'Diskontaufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2139', 'Diskontaufwendungen an verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2140', 'Zinsähnliche Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2149', 'Zinsähnliche Aufwendungen an verbundene Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2150', 'Aufwendungen aus Kursdifferenzen');
+INSERT INTO gifi (accno,description) VALUES ('2170', 'Nicht abziehb. VSt a. Zinsen u. ähnl. Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('2171', 'Nicht abziehb. VSt, 7% a. Zinsen u. ähnl. Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('2175', 'Nicht abziehb. VSt. 16% a. Zinsen u. ähnl. Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('2176', 'Nicht abziehb. VSt, 15% a. Zinsen u. ähnl. Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('2200', 'Körperschaftsteuer');
+INSERT INTO gifi (accno,description) VALUES ('2203', 'Körperschaftsteuer für Vorjahre');
+INSERT INTO gifi (accno,description) VALUES ('2205', 'Anrechenbare Körperschaftssteuer auf vereinnahmte Kapitalerträge');
+INSERT INTO gifi (accno,description) VALUES ('2208', 'Solidaritätszuschlag');
+INSERT INTO gifi (accno,description) VALUES ('2209', 'Solidaritätszuschlag für Vorjahre');
+INSERT INTO gifi (accno,description) VALUES ('2210', 'Kapitalertragsteuer');
+INSERT INTO gifi (accno,description) VALUES ('2213', 'Anrechenbarer Solidaritätszuschlag auf Kapitalertragssteuer');
+INSERT INTO gifi (accno,description) VALUES ('2215', 'Zinsabschlagsteuer');
+INSERT INTO gifi (accno,description) VALUES ('2218', 'Anrechenbarer Solidaritätszuschlag auf Zinsabschlagsteuer');
+INSERT INTO gifi (accno,description) VALUES ('2223', 'Vermögensteuer für Vorjahre');
+INSERT INTO gifi (accno,description) VALUES ('2280', 'Steuernachz. Vorjahre f. Steuern v. Einkommen u. Ertrag');
+INSERT INTO gifi (accno,description) VALUES ('2282', 'Steuererstatt. Vorjahre f. Steuern v. Einkommen u. Ertrag');
+INSERT INTO gifi (accno,description) VALUES ('2284', 'Erträge a. Aufl. v. Rückst. f. Steuern v. Eink. u. Ertrag');
+INSERT INTO gifi (accno,description) VALUES ('2285', 'Steuernachzahlung Vorjahre für sonstige Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2287', 'Steuererstattung Vorjahre für sonstige Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2289', 'Erträge a. d. Auflösung v. Rückstell. f. sonstige Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2300', 'Sonstige Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2307', 'Sonstige Aufwendungen betriebsfremd und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('2309', 'Sonstige Aufwendungen unregelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('2310', 'Anlagenabgänge (Restbuchwert und Buchverlust)');
+INSERT INTO gifi (accno,description) VALUES ('2315', 'Anlagenabgänge (Restbuchwert bei Buchgewinn)');
+INSERT INTO gifi (accno,description) VALUES ('2320', 'Verluste a. Abgang v. Gegenst. d. Anlagevermögens');
+INSERT INTO gifi (accno,description) VALUES ('2325', 'Verluste a. Abgang v. Gegenst. d. Umlaufv. (außer Vorräte)');
+INSERT INTO gifi (accno,description) VALUES ('2340', 'Einstell. in Sonderpost. m. Rücklageant. (steuerfr. Rückl.)');
+INSERT INTO gifi (accno,description) VALUES ('2341', 'Einstell. in Sonderpost. m. Rücklageant. (Ansparabschreibungen)');
+INSERT INTO gifi (accno,description) VALUES ('2345', 'Einstell. in Sonderpost. m. Rücklageant. (Sonderabschr.)');
+INSERT INTO gifi (accno,description) VALUES ('2350', 'Grundstücksaufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('2375', 'Grundsteuer');
+INSERT INTO gifi (accno,description) VALUES ('2380', 'Spenden, steuerlich nicht absetzbar');
+INSERT INTO gifi (accno,description) VALUES ('2381', 'Beiträge u. Spenden f. wissenschaftl. u. kulturelle Zwecke');
+INSERT INTO gifi (accno,description) VALUES ('2382', 'Beiträge u. Spenden f. mildtätige Zwecke');
+INSERT INTO gifi (accno,description) VALUES ('2383', 'Beiträge u. Spenden f. kirchl., religiöse u. gemeinn. Zwecke');
+INSERT INTO gifi (accno,description) VALUES ('2384', 'Beiträge u. Spenden an politische Parteien');
+INSERT INTO gifi (accno,description) VALUES ('2385', 'Nicht abziehbare Hälfte der Aufsichtsratsvergütungen');
+INSERT INTO gifi (accno,description) VALUES ('2386', 'Abziehbare Aufsichtsratsvergütungen');
+INSERT INTO gifi (accno,description) VALUES ('2400', 'Forderungsverluste (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2401', 'Forderungsverluste, 7% USt (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2402', 'Ford.Verl. a. steuerfr. EU-Lief. (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2403', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 7% USt (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2404', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 15%+16%USt (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2405', 'Forderungsverluste, 15%+16% USt (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2406', 'Forderungsverluste, 16% USt (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2407', 'Forderungsverluste, 15% USt (übliche Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2408', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 16%USt (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2409', 'Ford.Verl. a.i. Inl. steuerpfl. EU-Lief., 15%USt (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('2430', 'Forderungsverlust unüblich hoch');
+INSERT INTO gifi (accno,description) VALUES ('2450', 'Einstellungen in Pauschalwertberichtigung zu Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('2451', 'Einstellungen in Einzelwertberichtigung zu Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('2490', 'Aufwendungen aus Verlustübernahme');
+INSERT INTO gifi (accno,description) VALUES ('2492', 'Abgef. Gew. aufgrund einer Gewinngemeinschaft');
+INSERT INTO gifi (accno,description) VALUES ('2493', 'Abgef. Gew. a. stille Gesellschafter §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('2494', 'Abgef. Gew. a. Gewinn- oder Teilgewinnabführungsvertr.');
+INSERT INTO gifi (accno,description) VALUES ('2495', 'Einst. in die Kapitalrückl. n. Vorschr. d. vereinf. Kap.Herabs.');
+INSERT INTO gifi (accno,description) VALUES ('2496', 'Einst. in die gesetzliche Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('2497', 'Einst. in die satzungsmäßige Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('2498', 'Einst. in die Rücklage für eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('2499', 'Einst. in andere Gewinnrücklagen');
+INSERT INTO gifi (accno,description) VALUES ('2500', 'Außerordentliche Erträge');
+INSERT INTO gifi (accno,description) VALUES ('2510', 'Betriebsfremde Erträge (soweit nicht außerordentlich)');
+INSERT INTO gifi (accno,description) VALUES ('2520', 'Periodenfremde Erträge (soweit nicht außerordentlich)');
+INSERT INTO gifi (accno,description) VALUES ('2600', 'Erträge aus Beteiligungen');
+INSERT INTO gifi (accno,description) VALUES ('2617', 'Gewinne a.Ant. an nicht steuerbefr. inländischen KG §9Nr.2aGewStG');
+INSERT INTO gifi (accno,description) VALUES ('2618', 'Gewinnanteile aus Mitunternehmerschaften §9 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('2619', 'Erträge aus Beteiligungen an verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2620', 'Ertr. a. and. Wertpap. u. Ausl. d. Finanzanlageverm.');
+INSERT INTO gifi (accno,description) VALUES ('2649', 'Ertr. a. and. Wertpap. u. Ausl. d. Fin.Anl.Verm. a. verb. U.');
+INSERT INTO gifi (accno,description) VALUES ('2650', 'Sonstige Zinsen und ähnliche Erträge');
+INSERT INTO gifi (accno,description) VALUES ('2657', 'Zinserträge §233a AO betriebliche Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2658', 'Zinserträge §233a AO Körperschaftsteuer / Vermögensteuer');
+INSERT INTO gifi (accno,description) VALUES ('2659', 'Sonstige Zinsen u. ähnliche Erträge aus verb. Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2660', 'Erträge aus Kursdifferenzen');
+INSERT INTO gifi (accno,description) VALUES ('2670', 'Diskonterträge');
+INSERT INTO gifi (accno,description) VALUES ('2679', 'Diskonterträge aus verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2680', 'Zinsähnliche Erträge');
+INSERT INTO gifi (accno,description) VALUES ('2689', 'Zinsähnliche Erträge aus verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('2700', 'Sonstige Erträge');
+INSERT INTO gifi (accno,description) VALUES ('2705', 'Sonstige Erträge betrieblich und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('2707', 'Sonstige Erträge betriebsfremd und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('2709', 'Sonstige Erträge unregelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('2710', 'Erträge aus Zuschreibungen des Anlagevermögens');
+INSERT INTO gifi (accno,description) VALUES ('2715', 'Erträge aus Zuschreibungen des Umlaufvermögens');
+INSERT INTO gifi (accno,description) VALUES ('2720', 'Ertr. a. Abgang v. Gegenst. d. Anlagevermögens');
+INSERT INTO gifi (accno,description) VALUES ('2725', 'Ertr. a. Abgang v. Gegenst. d. Umlaufv.s (außer Vorräte)');
+INSERT INTO gifi (accno,description) VALUES ('2730', 'Ertr. a. Herabs. d. Pauschalwertber. zu Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('2731', 'Ertr. a. Herabs. d. Einzelwertber. zu Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('2732', 'Erträge aus abgeschriebenen Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('2735', 'Erträge aus der Auflösung von Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('2739', 'Erträge aus der Auflösung von Sonderpost. m. Rücklageant. (Ansparabschr.)');
+INSERT INTO gifi (accno,description) VALUES ('2740', 'Ertr. a. Aufl. v. Sonderp. m. Rückl.Ant. (steuerfr. Rückl.)');
+INSERT INTO gifi (accno,description) VALUES ('2741', 'Ertr. a. Aufl. v. Sonderp. m. Rückl.Ant. (Sonderabschr.)');
+INSERT INTO gifi (accno,description) VALUES ('2742', 'Versicherungsentschädigungen');
+INSERT INTO gifi (accno,description) VALUES ('2743', 'Investitionszuschüsse (steuerpflichtig)');
+INSERT INTO gifi (accno,description) VALUES ('2744', 'Investitionszulagen (steuerfrei)');
+INSERT INTO gifi (accno,description) VALUES ('2745', 'Erträge aus Kapitalherabsetzung');
+INSERT INTO gifi (accno,description) VALUES ('2750', 'Grundstückserträge');
+INSERT INTO gifi (accno,description) VALUES ('2780', 'Steuererstattung Vorjahre f. Steuern vom Eink. u. Ertrag');
+INSERT INTO gifi (accno,description) VALUES ('2785', 'Steuererstattung Vorjahre f. sonstige Steuern');
+INSERT INTO gifi (accno,description) VALUES ('2790', 'Erträge aus Verlustübernahme');
+INSERT INTO gifi (accno,description) VALUES ('2792', 'Erh. Gew. aufgrund einer Gewinngemeinschaft');
+INSERT INTO gifi (accno,description) VALUES ('2794', 'Erh. Gew. aufgrund eines Gew.- oder Teilgew.Abführ.Vertr.');
+INSERT INTO gifi (accno,description) VALUES ('2795', 'Entnahmen aus der Kapitalrücklage');
+INSERT INTO gifi (accno,description) VALUES ('2796', 'Entnahmen aus der gesetzlichen Rücklage');
+INSERT INTO gifi (accno,description) VALUES ('2797', 'Entnahmen aus satzungsgemäßen Rücklagen');
+INSERT INTO gifi (accno,description) VALUES ('2798', 'Entnahmen aus der Rücklage für eigene Anteile');
+INSERT INTO gifi (accno,description) VALUES ('2799', 'Entnahmen aus anderen Gewinnrücklagen');
+INSERT INTO gifi (accno,description) VALUES ('2860', 'Gewinnvortrag nach Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('2862', 'Gewinnvortrag 50/45% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('2864', 'Gewinnvortrag 30% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('2866', 'Gewinnvortrag 0% Vorbelastung');
+INSERT INTO gifi (accno,description) VALUES ('2868', 'Verlustvortrag nach Verwendung');
+INSERT INTO gifi (accno,description) VALUES ('2869', 'Vorträge auf neue Rechnung (GuV)');
+INSERT INTO gifi (accno,description) VALUES ('2870', 'Ausschüttung');
+INSERT INTO gifi (accno,description) VALUES ('2890', 'Verrechneter kalkulatorischer Unternehmerlohn');
+INSERT INTO gifi (accno,description) VALUES ('2891', 'Verrechnete kalkulatorische Miete und Pacht');
+INSERT INTO gifi (accno,description) VALUES ('2892', 'Verrechnete kalkulatorische Zinsen');
+INSERT INTO gifi (accno,description) VALUES ('2893', 'Verrechnete kalkulatorische Abschreibung');
+INSERT INTO gifi (accno,description) VALUES ('2894', 'Verrechnete kalkulatorische Wagnisse');
+INSERT INTO gifi (accno,description) VALUES ('2895', 'Verrechneter kalkulatorischer Lohn für unentgeltliche Mitarbeiter');
+INSERT INTO gifi (accno,description) VALUES ('3000', 'Roh-, Hilfs- und Betriebsstoffe');
+INSERT INTO gifi (accno,description) VALUES ('3090', 'Energiestoffe (Fertigung)');
+INSERT INTO gifi (accno,description) VALUES ('3100', 'Fremdleistungen');
+INSERT INTO gifi (accno,description) VALUES ('3150', 'Leistungen von ausländischen Unternehmen (Nullregelung)');
+INSERT INTO gifi (accno,description) VALUES ('3200', 'Wareneingang');
+INSERT INTO gifi (accno,description) VALUES ('3300', 'Wareneingang, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3340', 'Wareneingang, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3400', 'Wareneingang, 15%+16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3410', 'Wareneingang, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3420', 'Innergem. Erwerb, 7% VSt u. 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('3425', 'Innergem. Erwerb, 15%+16% VSt u. 15%+16% USt');
+INSERT INTO gifi (accno,description) VALUES ('3430', 'Innergem. Erwerb, ohne VSt-Abzug u. 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('3431', 'Innergem. Erwerb, 16% VSt u. 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3433', 'Innergem. Erwerb, 15% VSt u. 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3435', 'Innergem. Erwerb, ohne VSt-Abzug u. 15%+16% USt');
+INSERT INTO gifi (accno,description) VALUES ('3436', 'Innergem. Erwerb, ohne VSt-Abzug u. 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3437', 'Innergem. Erwerb, ohne VSt-Abzug u. 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3440', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 15%+16% USt');
+INSERT INTO gifi (accno,description) VALUES ('3441', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3442', 'Innergem. Erw. v. Neufahrz. v. Lief. ohne USt-ID, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3500', 'Wareneingang, 5% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3530', 'Wareneingang, 9% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3540', 'Wareneingang, 9,5% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3550', 'Steuerfreier innergemeinschaftlicher Erwerb');
+INSERT INTO gifi (accno,description) VALUES ('3600', 'Nicht abziehbare Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3610', 'Nicht abziehbare Vorsteuer, 7%');
+INSERT INTO gifi (accno,description) VALUES ('3650', 'Nicht abziehbare Vorsteuer, 16%');
+INSERT INTO gifi (accno,description) VALUES ('3660', 'Nicht abziehbare Vorsteuer, 15%');
+INSERT INTO gifi (accno,description) VALUES ('3700', 'Nachlässe');
+INSERT INTO gifi (accno,description) VALUES ('3710', 'Nachlässe, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3720', 'Nachlässe, 15%+16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3722', 'Nachlässe, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3723', 'Nachlässe, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3724', 'Nachlässe aus ig. Erwerb, 7% VSt und 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('3725', 'Nachlässe aus ig. Erwerb, 15%+16% VSt und 15%+16% USt');
+INSERT INTO gifi (accno,description) VALUES ('3726', 'Nachlässe aus ig. Erwerb, 16% VSt und 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3727', 'Nachlässe aus ig. Erwerb, 15% VSt und 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('3730', 'Erhaltene Skonti');
+INSERT INTO gifi (accno,description) VALUES ('3731', 'Erhaltene Skonti, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3735', 'Erhaltene Skonti, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3736', 'Erhaltene Skonti, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3740', 'Erhaltene Boni');
+INSERT INTO gifi (accno,description) VALUES ('3750', 'Erhaltene Boni, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3760', 'Erhaltene Boni, 15%+16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3762', 'Erhaltene Boni, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3764', 'Erhaltene Boni, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3770', 'Erhaltene Rabatte');
+INSERT INTO gifi (accno,description) VALUES ('3780', 'Erhaltene Rabatte, 7% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3790', 'Erhaltene Rabatte, 15%+16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3792', 'Erhaltene Rabatte, 16% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3794', 'Erhaltene Rabatte, 15% Vorsteuer');
+INSERT INTO gifi (accno,description) VALUES ('3800', 'Anschaffungsnebenkosten');
+INSERT INTO gifi (accno,description) VALUES ('3830', 'Leergut');
+INSERT INTO gifi (accno,description) VALUES ('3850', 'Zölle und Einfuhrabgaben');
+INSERT INTO gifi (accno,description) VALUES ('3960', 'Bestandsv. Roh-, Hilfs- u. Betriebsstoffe / bezogene Waren');
+INSERT INTO gifi (accno,description) VALUES ('3970', 'Bestand Roh-, Hilfs- und Betriebsstoffe');
+INSERT INTO gifi (accno,description) VALUES ('3980', 'Bestand Waren');
+INSERT INTO gifi (accno,description) VALUES ('3990', 'Verrechnete Stoffkosten');
+INSERT INTO gifi (accno,description) VALUES ('4000', 'Material- und Stoffverbrauch');
+INSERT INTO gifi (accno,description) VALUES ('4100', 'Löhne und Gehälter');
+INSERT INTO gifi (accno,description) VALUES ('4110', 'Löhne');
+INSERT INTO gifi (accno,description) VALUES ('4120', 'Gehälter');
+INSERT INTO gifi (accno,description) VALUES ('4124', 'Geschäftsführergehälter der GmbH-Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('4125', 'Ehegattengehalt');
+INSERT INTO gifi (accno,description) VALUES ('4126', 'Tantiemen');
+INSERT INTO gifi (accno,description) VALUES ('4127', 'Geschäftsführergehälter');
+INSERT INTO gifi (accno,description) VALUES ('4128', 'Vergütungen an angestellte Mitunternehmer §15 EStG');
+INSERT INTO gifi (accno,description) VALUES ('4130', 'Gesetzliche soziale Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('4137', 'Gesetzliche soziale Aufw. für Mitunternehmer §15 EStG');
+INSERT INTO gifi (accno,description) VALUES ('4138', 'Beiträge zur Berufsgenossenschaft');
+INSERT INTO gifi (accno,description) VALUES ('4139', 'Ausgleichsabgabe i. S. d. Schwerbehindertengesetzes');
+INSERT INTO gifi (accno,description) VALUES ('4140', 'Freiw. soziale Aufwendungen (lohnsteuerfrei)');
+INSERT INTO gifi (accno,description) VALUES ('4145', 'Freiw. soziale Aufwendungen (lohnsteuerpflichtig)');
+INSERT INTO gifi (accno,description) VALUES ('4149', 'Pauschale Lohnsteuer auf s. Bezüge (z.B. Fahrtkostenzuschuß)');
+INSERT INTO gifi (accno,description) VALUES ('4150', 'Krankengeldzuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('4160', 'Versorgungskassen');
+INSERT INTO gifi (accno,description) VALUES ('4165', 'Aufwendungen für die Altersversorgung');
+INSERT INTO gifi (accno,description) VALUES ('4167', 'Pauschale Lohnsteuer auf s. Bezüge (z.B. Direktversicherung)');
+INSERT INTO gifi (accno,description) VALUES ('4168', 'Aufw. f. die Altersversorgung f. Mitunternehmer §15 EStG');
+INSERT INTO gifi (accno,description) VALUES ('4169', 'Aufwendungen für Unterstützung');
+INSERT INTO gifi (accno,description) VALUES ('4170', 'Vermögenswirksame Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('4175', 'Fahrtkostenerstattung - Wohnung / Arbeitsstätte');
+INSERT INTO gifi (accno,description) VALUES ('4180', 'Bedienungsgelder');
+INSERT INTO gifi (accno,description) VALUES ('4190', 'Aushilfslöhne');
+INSERT INTO gifi (accno,description) VALUES ('4199', 'Lohnsteuer für Aushilfen');
+INSERT INTO gifi (accno,description) VALUES ('4200', 'Raumkosten');
+INSERT INTO gifi (accno,description) VALUES ('4210', 'Miete');
+INSERT INTO gifi (accno,description) VALUES ('4218', 'Gewerbesteuerlich zu berücks. Miete §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('4219', 'Vergütung an Mitu. f. mietw. Überl. v. Wirtschaftsg. §15EStG');
+INSERT INTO gifi (accno,description) VALUES ('4220', 'Pacht');
+INSERT INTO gifi (accno,description) VALUES ('4228', 'Gewerbesteuerlich zu berücks. Pacht §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('4229', 'Vergütung an Mitu. f. pachtw. Überl. v. Wirtschaftsg.§15EStG');
+INSERT INTO gifi (accno,description) VALUES ('4230', 'Heizung');
+INSERT INTO gifi (accno,description) VALUES ('4240', 'Gas, Strom, Wasser (Verwaltung, Vertrieb)');
+INSERT INTO gifi (accno,description) VALUES ('4250', 'Reinigung');
+INSERT INTO gifi (accno,description) VALUES ('4260', 'Instandhaltung betrieblicher Räume');
+INSERT INTO gifi (accno,description) VALUES ('4270', 'Abgaben für betrieblich genutzten Grundbesitz');
+INSERT INTO gifi (accno,description) VALUES ('4280', 'Sonstige Raumkosten');
+INSERT INTO gifi (accno,description) VALUES ('4300', 'Nicht abziehb. VSt a. sonst. betriebl. Aufw./AfA');
+INSERT INTO gifi (accno,description) VALUES ('4301', 'Nicht abziehb. VSt, 7% a. sonst. betriebl. Aufw./AfA');
+INSERT INTO gifi (accno,description) VALUES ('4305', 'Nicht abziehb. VSt, 16% a. sonst. betriebl. Aufw./AfA');
+INSERT INTO gifi (accno,description) VALUES ('4306', 'Nicht abziehb. VSt, 15% a. sonst. betriebl. Aufw./AfA');
+INSERT INTO gifi (accno,description) VALUES ('4320', 'Gewerbesteuer (Vorauszahlung)');
+INSERT INTO gifi (accno,description) VALUES ('4330', 'Gewerbeertragsteuer');
+INSERT INTO gifi (accno,description) VALUES ('4335', 'Gewerbekapitalsteuer');
+INSERT INTO gifi (accno,description) VALUES ('4340', 'Sonstige Betriebsteuern');
+INSERT INTO gifi (accno,description) VALUES ('4350', 'Verbrauchsteuer');
+INSERT INTO gifi (accno,description) VALUES ('4360', 'Versicherungen');
+INSERT INTO gifi (accno,description) VALUES ('4370', 'Nettoprämie für Rückdeckung künftiger Versorgungsleistungen');
+INSERT INTO gifi (accno,description) VALUES ('4380', 'Beiträge');
+INSERT INTO gifi (accno,description) VALUES ('4390', 'Sonstige Abgaben');
+INSERT INTO gifi (accno,description) VALUES ('4396', 'Steuerlich abzugsfähige Verspätungszuschläge und Zwangsgelder');
+INSERT INTO gifi (accno,description) VALUES ('4397', 'Steuerlich nicht abzugsfähige Verspätungszuschläge und Zwangsgelder');
+INSERT INTO gifi (accno,description) VALUES ('4400', 'Besondere Kosten (zur freien Verfügung)');
+INSERT INTO gifi (accno,description) VALUES ('4500', 'Fahrzeugkosten');
+INSERT INTO gifi (accno,description) VALUES ('4510', 'Kfz-Steuern');
+INSERT INTO gifi (accno,description) VALUES ('4520', 'Kfz-Versicherungen');
+INSERT INTO gifi (accno,description) VALUES ('4530', 'Laufende Kfz-Betriebskosten');
+INSERT INTO gifi (accno,description) VALUES ('4540', 'Kfz-Reparaturen');
+INSERT INTO gifi (accno,description) VALUES ('4550', 'Garagenmieten');
+INSERT INTO gifi (accno,description) VALUES ('4570', 'Fremdfahrzeuge');
+INSERT INTO gifi (accno,description) VALUES ('4580', 'Sonstige Kfz-Kosten');
+INSERT INTO gifi (accno,description) VALUES ('4600', 'Werbe- und Reisekosten');
+INSERT INTO gifi (accno,description) VALUES ('4610', 'Werbekosten');
+INSERT INTO gifi (accno,description) VALUES ('4630', 'Geschenke bis DM 75,00');
+INSERT INTO gifi (accno,description) VALUES ('4635', 'Geschenke über DM 75,00');
+INSERT INTO gifi (accno,description) VALUES ('4638', 'Geschenke ausschließlich betrieblich genutzt');
+INSERT INTO gifi (accno,description) VALUES ('4640', 'Repräsentationskosten');
+INSERT INTO gifi (accno,description) VALUES ('4650', 'Bewirtungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4653', 'Aufwerksamkeiten');
+INSERT INTO gifi (accno,description) VALUES ('4654', 'Nicht abzugsfähige Bewirtungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4655', 'Nicht abzugsfähige Betriebsausgaben');
+INSERT INTO gifi (accno,description) VALUES ('4660', 'Reisekosten Arbeitnehmer');
+INSERT INTO gifi (accno,description) VALUES ('4666', 'Reisekost. Arbeitn., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('4667', 'Reisekost. Arbeitn., 9,8%/10,5% VSt Gesamtpauschal.');
+INSERT INTO gifi (accno,description) VALUES ('4670', 'Reisekosten Unternehmer');
+INSERT INTO gifi (accno,description) VALUES ('4675', 'Reisekosten Unternehmer, 9,8/10,5% VSt sonst.Gesamtpauschal.');
+INSERT INTO gifi (accno,description) VALUES ('4676', 'Reisekost. Untern., 12,3%/13,1% VSt Verpfl.Mehr- / Übern.Aufw.');
+INSERT INTO gifi (accno,description) VALUES ('4677', 'Reisekosten Unternehmer, 9,8%/10,5% VSt Verpfl.Mehraufw. Gesamtpauschal.');
+INSERT INTO gifi (accno,description) VALUES ('4678', 'Km-Geld Erstattung, Unternehmer, 5,7%/6,1% VSt');
+INSERT INTO gifi (accno,description) VALUES ('4685', 'Km-Geld-Erstattung, Arbeitnehmer 8,2%/8,7% VSt');
+INSERT INTO gifi (accno,description) VALUES ('4700', 'Kosten der Warenabgabe');
+INSERT INTO gifi (accno,description) VALUES ('4710', 'Verpackungsmaterial');
+INSERT INTO gifi (accno,description) VALUES ('4730', 'Ausgangsfrachten');
+INSERT INTO gifi (accno,description) VALUES ('4750', 'Transportversicherungen');
+INSERT INTO gifi (accno,description) VALUES ('4760', 'Verkaufsprovisionen');
+INSERT INTO gifi (accno,description) VALUES ('4780', 'Fremdarbeiten');
+INSERT INTO gifi (accno,description) VALUES ('4790', 'Aufwand für Gewährleistungen');
+INSERT INTO gifi (accno,description) VALUES ('4800', 'Reparat. u. Inst. v. Maschinen u. technischen Anlagen');
+INSERT INTO gifi (accno,description) VALUES ('4805', 'Reparat. u. Inst. v. and. Anl. d. Betr.- u. Geschäftsausst.');
+INSERT INTO gifi (accno,description) VALUES ('4809', 'Sonstige Reparaturen und Instandhaltungen');
+INSERT INTO gifi (accno,description) VALUES ('4810', 'Mietleasing');
+INSERT INTO gifi (accno,description) VALUES ('4814', 'Gewerbesteuerl. zu berücksicht. Mietleasing §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('4815', 'Kaufleasing');
+INSERT INTO gifi (accno,description) VALUES ('4820', 'Abschr. a. Aufw. f.d. Ingangs. u. Erw. des Geschäftsbetr.');
+INSERT INTO gifi (accno,description) VALUES ('4822', 'Abschr. a. immaterielle Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('4824', 'Abschreibung auf den Geschäfts- oder Firmenwert');
+INSERT INTO gifi (accno,description) VALUES ('4826', 'Außerplanm. Abschr. a. immaterielle Vermögensgegenstände');
+INSERT INTO gifi (accno,description) VALUES ('4830', 'Abschreibungen auf Sachanlagen');
+INSERT INTO gifi (accno,description) VALUES ('4840', 'Außerplanm. Abschreibungen auf Sachanlagen');
+INSERT INTO gifi (accno,description) VALUES ('4850', 'Abschr. a. Sachanl. aufgrund steuerl. Sondervorschriften');
+INSERT INTO gifi (accno,description) VALUES ('4855', 'Sofortabschreibung geringwertiger Wirtschaftsgüter');
+INSERT INTO gifi (accno,description) VALUES ('4860', 'Abschreibung auf aktivierte, geringwertige Wirtschaftsgüter');
+INSERT INTO gifi (accno,description) VALUES ('4865', 'Außerplanmäßige Abschr. a. aktivierte GWG');
+INSERT INTO gifi (accno,description) VALUES ('4870', 'Abschreibungen auf Finanzanlagen');
+INSERT INTO gifi (accno,description) VALUES ('4872', 'Abschr. aufgrund v. Verlustant. an Mitunt. §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('4874', 'Abschr. a. Finanzanl. aufgrund steuerl. Sondervorschriften');
+INSERT INTO gifi (accno,description) VALUES ('4875', 'Abschreibungen auf Wertpapiere des Umlaufvermögens');
+INSERT INTO gifi (accno,description) VALUES ('4879', 'Vorwegn. künft. Wertschw. bei Wertpapieren des Umlaufv.');
+INSERT INTO gifi (accno,description) VALUES ('4880', 'Abschr. a. Umlaufv. ohne Wertpapiere (soweit unübl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('4882', 'Abschr. a. Umlaufv. steuerrechtl. bedingt (unübl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('4885', 'Vorwegn. künft. Wertschw. Uml.V. auß. Vorr./Wertp. d. Uml.V.');
+INSERT INTO gifi (accno,description) VALUES ('4886', 'Abschr. a. Uml.V. auß. Vorr./Wertp. d. Uml.V. (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('4887', 'Abschr. a. Umlaufv., steuerrechtlich bedingt (übl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('4890', 'Vorwegn. künftiger Wertschw. im Umlaufv. (unübl. Höhe)');
+INSERT INTO gifi (accno,description) VALUES ('4900', 'Sonstige betriebliche Aufwendungen');
+INSERT INTO gifi (accno,description) VALUES ('4905', 'Sonstige Aufwendungen betrieblich und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('4910', 'Porto');
+INSERT INTO gifi (accno,description) VALUES ('4920', 'Telefon');
+INSERT INTO gifi (accno,description) VALUES ('4925', 'Telefax, Fernschreiber');
+INSERT INTO gifi (accno,description) VALUES ('4930', 'Bürobedarf');
+INSERT INTO gifi (accno,description) VALUES ('4940', 'Zeitschriften, Bücher');
+INSERT INTO gifi (accno,description) VALUES ('4945', 'Fortbildungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4946', 'Freiwillige Sozialleistungen');
+INSERT INTO gifi (accno,description) VALUES ('4948', 'Vergütungen an freiberufliche Mitunternehmer §15 EStG');
+INSERT INTO gifi (accno,description) VALUES ('4950', 'Rechts- und Beratungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4955', 'Buchführungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4957', 'Abschluß- und Prüfungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4960', 'Mieten für Einrichtungen');
+INSERT INTO gifi (accno,description) VALUES ('4968', 'Gewerbest. zu berücks. Miete f. Einrichtungen §8 GewStG');
+INSERT INTO gifi (accno,description) VALUES ('4969', 'Aufwendungen für Abraum- und Abfallbeseitigung');
+INSERT INTO gifi (accno,description) VALUES ('4970', 'Nebenkosten des Geldverkehrs');
+INSERT INTO gifi (accno,description) VALUES ('4980', 'Betriebsbedarf');
+INSERT INTO gifi (accno,description) VALUES ('4985', 'Werkzeuge und Kleingeräte');
+INSERT INTO gifi (accno,description) VALUES ('4990', 'Kalkulatorischer Unternehmerlohn');
+INSERT INTO gifi (accno,description) VALUES ('4991', 'Kalkulatorische Miete und Pacht');
+INSERT INTO gifi (accno,description) VALUES ('4992', 'Kalkulatorischer Zinsen');
+INSERT INTO gifi (accno,description) VALUES ('4993', 'Kalkulatorische Abschreibungen');
+INSERT INTO gifi (accno,description) VALUES ('4994', 'Kalkulatorische Wagnisse');
+INSERT INTO gifi (accno,description) VALUES ('4995', 'Kalkulatorischer Lohn für unentgeltliche Mitarbeiter');
+INSERT INTO gifi (accno,description) VALUES ('4996', 'Herstellungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4997', 'Verwaltungskosten');
+INSERT INTO gifi (accno,description) VALUES ('4998', 'Vertriebskosten');
+INSERT INTO gifi (accno,description) VALUES ('4999', 'Gegenkonto 49960-49980');
+INSERT INTO gifi (accno,description) VALUES ('7000', 'Unfertige Erzeugnisse, unfertige Leistungen (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('7050', 'Unfertige Erzeugnisse (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('7080', 'Unfertige Leistungen (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('7090', 'In Ausführung befindliche Bauaufträge');
+INSERT INTO gifi (accno,description) VALUES ('7095', 'In Arbeit befindliche Bauaufträge');
+INSERT INTO gifi (accno,description) VALUES ('7100', 'Fertige Erzeugnisse und Waren (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('7110', 'Fertige Erzeugnisse (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('7140', 'Fertige Waren (Bestand)');
+INSERT INTO gifi (accno,description) VALUES ('8000', 'Erlöse (zur freien Verfügung)');
+INSERT INTO gifi (accno,description) VALUES ('8100', 'Steuerfreie Umsätze o. VSt-Abzug §4 Nr.8 ff. UStG');
+INSERT INTO gifi (accno,description) VALUES ('8110', 'Sonstige steuerfreie o. VSt-Abzug Umsätze Inland');
+INSERT INTO gifi (accno,description) VALUES ('8120', 'Steuerfreie Umsätze m. VSt-Abzug §4 Nr.1a, 1c, 2-7 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8125', 'Steuerfreie innergem. Lief. §4 Nr.1b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8130', 'Lieferung d. ersten Abnehmers bei innergem. Dreiecksgesch. §25 b Abs. 2 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8135', 'Steuerfreie ig. Lief. v. Neufahrz. an Abn. ohne UST-ID');
+INSERT INTO gifi (accno,description) VALUES ('8140', 'Steuerfreie Umsätze Offshore usw.');
+INSERT INTO gifi (accno,description) VALUES ('8150', 'Sonstige steuerfreie Umsätze Ausland (§4,2-7)');
+INSERT INTO gifi (accno,description) VALUES ('8195', 'Erlöse aus Geldspielautomaten, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8196', 'Erlöse aus Geldspielautomaten, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8197', 'Erlöse aus Geldspielautomaten, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8200', 'Erlöse');
+INSERT INTO gifi (accno,description) VALUES ('8300', 'Erlöse, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8310', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8315', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8320', 'Erlöse a.i. anderen EU-Land steuerpfl. Lieferungen');
+INSERT INTO gifi (accno,description) VALUES ('8330', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8335', 'Erlöse a.i.Inland steuerpfl. EU-Lieferungen, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8339', 'Erlöse a.i. and. EU-Land steuerpfl. sonst. Leist. (Nullreg.)');
+INSERT INTO gifi (accno,description) VALUES ('8340', 'Erlöse, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8400', 'Erlöse, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8410', 'Erlöse, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8500', 'Provisionserlöse');
+INSERT INTO gifi (accno,description) VALUES ('8504', 'Provisionserlöse steuerfrei (§4 Nr.8ff UStG)');
+INSERT INTO gifi (accno,description) VALUES ('8505', 'Provisionserlöse steuerfrei (§4 Nr.5 UStG)');
+INSERT INTO gifi (accno,description) VALUES ('8506', 'Provisionserlöse, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8507', 'Provisionserlöse, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8508', 'Provisionserlöse, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8509', 'Provisionserlöse, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8520', 'Erlöse Abfallverwertung');
+INSERT INTO gifi (accno,description) VALUES ('8540', 'Erlöse Leergut');
+INSERT INTO gifi (accno,description) VALUES ('8590', 'Verrechnete Sachbezüge (keine Waren)');
+INSERT INTO gifi (accno,description) VALUES ('8591', 'Sachbezüge, 7% USt (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('8595', 'Sachbezüge, 15%/16% USt (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('8596', 'Sachbezüge, 16% USt (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('8597', 'Sachbezüge, 15% USt (Waren)');
+INSERT INTO gifi (accno,description) VALUES ('8600', 'Sonstige Erlöse betrieblich und regelmäßig');
+INSERT INTO gifi (accno,description) VALUES ('8610', 'Verrechnete sonstige Sachbezüge');
+INSERT INTO gifi (accno,description) VALUES ('8611', 'Verrechnete sonstige Sachbezüge 15%/16% USt (z.B. Kfz. Gestellung)');
+INSERT INTO gifi (accno,description) VALUES ('8612', 'Verrechnete sonstige Sachbezüge 16% USt (z.B. Kfz. Gestellung)');
+INSERT INTO gifi (accno,description) VALUES ('8613', 'Verrechnete sonstige Sachbezüge 15% USt (z.B. Kfz. Gestellung)');
+INSERT INTO gifi (accno,description) VALUES ('8614', 'Verrechnete sonstige Sachbezüge, ohne Umsatzsteuer');
+INSERT INTO gifi (accno,description) VALUES ('8625', 'Sonstige Erlöse betrieblich und regelmäßig, steuerfrei');
+INSERT INTO gifi (accno,description) VALUES ('8630', 'Sonstige Erlöse betrieblich und regelmäßig, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8640', 'Sonstige Erlöse betrieblich und regelmäßig, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8645', 'Sonstige Erlöse betrieblich und regelmäßig, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8647', 'Sonstige Erlöse betrieblich und regelmäßig, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8650', 'Erlöse Zinsen und Diskontspesen');
+INSERT INTO gifi (accno,description) VALUES ('8660', 'Erlöse Zinsen und Diskontspesen aus verbundenen Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('8700', 'Erlösschmälerungen');
+INSERT INTO gifi (accno,description) VALUES ('8705', 'Erlösschmälerungen aus steuerfreien Umsätzen §4 Nr. 1a UStG');
+INSERT INTO gifi (accno,description) VALUES ('8710', 'Erlösschmälerungen, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8720', 'Erlösschmälerungen, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8722', 'Erlösschmälerungen, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8723', 'Erlösschmälerungen, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8724', 'Erlösschmälerungen aus steuerfreien innergm. Lieferungen');
+INSERT INTO gifi (accno,description) VALUES ('8725', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8726', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8727', 'Erlösschmäl. a. im anderen EU-Land steuerpfl. Lief.');
+INSERT INTO gifi (accno,description) VALUES ('8728', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8729', 'Erlösschmäl. a. im Inland steuerpfl. EU-Lieferungen, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8730', 'Gewährte Skonti');
+INSERT INTO gifi (accno,description) VALUES ('8731', 'Gewährte Skonti, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8735', 'Gewährte Skonti, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8736', 'Gewährte Skonti, 15% USt');
+INSERT INTO gifi (accno,description) VALUES ('8740', 'Gewährte Boni');
+INSERT INTO gifi (accno,description) VALUES ('8750', 'Gewährte Boni, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8760', 'Gewährte Boni, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8762', 'Gewährte Boni, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8764', 'Gewährte Boni, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8770', 'Gewährte Rabatte');
+INSERT INTO gifi (accno,description) VALUES ('8780', 'Gewährte Rabatte, 7% USt');
+INSERT INTO gifi (accno,description) VALUES ('8790', 'Gewährte Rabatte, 15%/16% USt');
+INSERT INTO gifi (accno,description) VALUES ('8792', 'Gewährte Rabatte, 16% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8794', 'Gewährte Rabatte, 15% Ust');
+INSERT INTO gifi (accno,description) VALUES ('8800', 'Erlöse aus Anlagenverkäufen');
+INSERT INTO gifi (accno,description) VALUES ('8801', 'Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchverlust)');
+INSERT INTO gifi (accno,description) VALUES ('8810', 'Erlöse aus Anlagenverkäufen 16% USt (bei Buchverlust)');
+INSERT INTO gifi (accno,description) VALUES ('8815', 'Erlöse aus Anlagenverkäufen 15% USt (bei Buchverlust)');
+INSERT INTO gifi (accno,description) VALUES ('8820', 'Erlöse aus Anlagenverkäufen 15%/16% USt (bei Buchgewinn)');
+INSERT INTO gifi (accno,description) VALUES ('8829', 'Erlöse aus Anlagenverkäufen (bei Buchgewinn)');
+INSERT INTO gifi (accno,description) VALUES ('8830', 'Erlöse aus Anlagenverkäufen 16% USt (bei Buchgewinn)');
+INSERT INTO gifi (accno,description) VALUES ('8835', 'Erlöse aus Anlagenverkäufen 15% USt (bei Buchgewinn)');
+INSERT INTO gifi (accno,description) VALUES ('8840', 'Erträge aus Kursdifferenzen');
+INSERT INTO gifi (accno,description) VALUES ('8900', 'Eigenverbrauch');
+INSERT INTO gifi (accno,description) VALUES ('8905', 'Entnahme Gegenstände ohne USt');
+INSERT INTO gifi (accno,description) VALUES ('8908', 'Entnahme von Gegenstände, 16% USt §1 Abs.1 Nr.2a UStG');
+INSERT INTO gifi (accno,description) VALUES ('8909', 'Entnahme von Gegenstände, 15% USt §1 Abs.1 Nr.2a UStG');
+INSERT INTO gifi (accno,description) VALUES ('8910', 'Entnahme von Gegenstände, 15%/16% USt §1 Abs.1 Nr.2a UStG');
+INSERT INTO gifi (accno,description) VALUES ('8915', 'Entnahme von Gegenstände, 7% USt §1 Abs.1 Nr.2a UStG');
+INSERT INTO gifi (accno,description) VALUES ('8920', 'Entnahme v. sonst. Leist., 15%/16% USt §1 A.1 Nr.2b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8930', 'Entnahme v. sonst. Leist., 7% USt §1 A.1 Nr.2b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8937', 'Entnahme v. sonst. Leist., 16% USt §1 A.1 Nr.2b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8938', 'Entnahme v. sonst. Leist., 15% USt §1 A.1 Nr.2b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8939', 'Entnahme v. sonst. Leist., ohne USt §1 A.1 Nr.2b UStG');
+INSERT INTO gifi (accno,description) VALUES ('8940', 'Eigenverbr., 15%/16% Ust §4 A.1 Nr.5 1-7, A.7 EStG');
+INSERT INTO gifi (accno,description) VALUES ('8941', 'Eigenverbr., 7% Ust §4 A.1 Nr.5 1-7, A.7 EStG');
+INSERT INTO gifi (accno,description) VALUES ('8942', 'Eigenverbr., 16% Ust §4 A.1 Nr.5 1-7, A.7 EStG');
+INSERT INTO gifi (accno,description) VALUES ('8943', 'Eigenverbr., 15% Ust §4 A.1 Nr.5 1-7, A.7 EStG');
+INSERT INTO gifi (accno,description) VALUES ('8944', 'Eigenverbr., ohne Ust §4 A.1 Nr.5 1-7, A.7 EStG');
+INSERT INTO gifi (accno,description) VALUES ('8945', 'Unentgeltl. Leist. v. Ges. an Ges., 15%/16% USt §1A.1 Nr.3 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8946', 'Unentgeltl. Leist. v. Ges. an Ges., 7% USt §1A.1 Nr.3 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8947', 'Unentgeltl. Leist. v. Ges. an Ges., 16% USt §1A.1 Nr.3 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8948', 'Unentgeltl. Leist. v. Ges. an Ges., 15% USt §1A.1 Nr.3 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8949', 'Unentgeltl. Leist. v. Ges. an Ges., ohne USt §1A.1 Nr.3 UStG');
+INSERT INTO gifi (accno,description) VALUES ('8950', 'Nicht steuerbare Umsätze');
+INSERT INTO gifi (accno,description) VALUES ('8955', 'Umsatzsteuervergütungen');
+INSERT INTO gifi (accno,description) VALUES ('8960', 'Bestandsveränd. - unfertige Erzeugnisse');
+INSERT INTO gifi (accno,description) VALUES ('8970', 'Bestandsveränd. - unfertige Leistungen');
+INSERT INTO gifi (accno,description) VALUES ('8975', 'Bestandsveränd. - in Ausführung befindliche Bauaufträge');
+INSERT INTO gifi (accno,description) VALUES ('8977', 'Bestandsveränd. - in Arbeit befindliche Aufträge');
+INSERT INTO gifi (accno,description) VALUES ('8980', 'Bestandsveränd. - fertige Erzeugnisse');
+INSERT INTO gifi (accno,description) VALUES ('8990', 'Bestandsveränd. - andere aktivierte Eigenleistungen');
+INSERT INTO gifi (accno,description) VALUES ('9000', 'Saldenvorträge Sachkonten');
+INSERT INTO gifi (accno,description) VALUES ('9008', 'Saldenvorträge Debitoren');
+INSERT INTO gifi (accno,description) VALUES ('9009', 'Saldenvorträge Kreditoren');
+INSERT INTO gifi (accno,description) VALUES ('9060', 'Offene Posten aus 1990');
+INSERT INTO gifi (accno,description) VALUES ('9085', 'Offene Posten aus 1985');
+INSERT INTO gifi (accno,description) VALUES ('9086', 'Offene Posten aus 1986');
+INSERT INTO gifi (accno,description) VALUES ('9087', 'Offene Posten aus 1987');
+INSERT INTO gifi (accno,description) VALUES ('9088', 'Offene Posten aus 1988');
+INSERT INTO gifi (accno,description) VALUES ('9089', 'Offene Posten aus 1989');
+INSERT INTO gifi (accno,description) VALUES ('9090', 'Summenvortragskonto');
+INSERT INTO gifi (accno,description) VALUES ('9091', 'Offene Posten aus 1991');
+INSERT INTO gifi (accno,description) VALUES ('9092', 'Offene Posten aus 1992');
+INSERT INTO gifi (accno,description) VALUES ('9093', 'Offene Posten aus 1993');
+INSERT INTO gifi (accno,description) VALUES ('9094', 'Offene Posten aus 1994');
+INSERT INTO gifi (accno,description) VALUES ('9095', 'Offene Posten aus 1995');
+INSERT INTO gifi (accno,description) VALUES ('9096', 'Offene Posten aus 1996');
+INSERT INTO gifi (accno,description) VALUES ('9097', 'Offene Posten aus 1997');
+INSERT INTO gifi (accno,description) VALUES ('9098', 'Offene Posten aus 1998');
+INSERT INTO gifi (accno,description) VALUES ('9100', 'Saldovortragskonto der Statistikkonten');
+INSERT INTO gifi (accno,description) VALUES ('9101', 'Verkaufstage');
+INSERT INTO gifi (accno,description) VALUES ('9102', 'Anzahl der Barkunden');
+INSERT INTO gifi (accno,description) VALUES ('9103', 'Beschäftigte Personen');
+INSERT INTO gifi (accno,description) VALUES ('9104', 'Unbezahlte Personen');
+INSERT INTO gifi (accno,description) VALUES ('9105', 'Verkaufskräfte');
+INSERT INTO gifi (accno,description) VALUES ('9106', 'Geschäftsraum qm');
+INSERT INTO gifi (accno,description) VALUES ('9107', 'Verkaufsraum qm');
+INSERT INTO gifi (accno,description) VALUES ('9108', 'Veränderungsrate positiv');
+INSERT INTO gifi (accno,description) VALUES ('9109', 'Veränderungsrate negativ');
+INSERT INTO gifi (accno,description) VALUES ('9110', 'Plan-WE (in Prozent)');
+INSERT INTO gifi (accno,description) VALUES ('9120', 'Erweiterungsinvestitionen');
+INSERT INTO gifi (accno,description) VALUES ('9135', 'Auftragseingang im Geschäftsjahr');
+INSERT INTO gifi (accno,description) VALUES ('9140', 'Auftragsbestand');
+INSERT INTO gifi (accno,description) VALUES ('9190', 'Gegenkonto für statistische Mengeneinheiten Konten 91010-91190');
+INSERT INTO gifi (accno,description) VALUES ('9199', 'Gegenkonto zu 91200, 91350-91400');
+INSERT INTO gifi (accno,description) VALUES ('9200', 'Beschäftigte Personen');
+INSERT INTO gifi (accno,description) VALUES ('9209', 'Gegenkonto zu 92000');
+INSERT INTO gifi (accno,description) VALUES ('9210', 'Produktive Löhne');
+INSERT INTO gifi (accno,description) VALUES ('9219', 'Gegenkonto zu 92100');
+INSERT INTO gifi (accno,description) VALUES ('9230', 'Baukostenzuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('9232', 'Investitionszulagen');
+INSERT INTO gifi (accno,description) VALUES ('9234', 'Investitionszuschüsse');
+INSERT INTO gifi (accno,description) VALUES ('9239', 'Gegenkonto zu 92300-92380');
+INSERT INTO gifi (accno,description) VALUES ('9240', 'Investitionsverbindlichkeiten bei den Leistungsverbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('9244', 'Gegenkonto zu 92400');
+INSERT INTO gifi (accno,description) VALUES ('9245', 'Forderungen aus Anlagenverkäufen bei den sonstigen Vermögensgegenst.');
+INSERT INTO gifi (accno,description) VALUES ('9249', 'Gegenkonto zu 92450');
+INSERT INTO gifi (accno,description) VALUES ('9250', 'Eigenkapitalersetzende Gesellschafterdarlehen');
+INSERT INTO gifi (accno,description) VALUES ('9255', 'Ungesicherte Gesellschafterdarlehen mit Restlaufzeit > 5 Jahre');
+INSERT INTO gifi (accno,description) VALUES ('9259', 'Gegenkonto zu 92500-92580');
+INSERT INTO gifi (accno,description) VALUES ('9260', 'Kurzfristige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('9262', 'Mittelfristige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('9264', 'Langfristige Rückstellungen');
+INSERT INTO gifi (accno,description) VALUES ('9269', 'Gegenkonto zu 92600-92680');
+INSERT INTO gifi (accno,description) VALUES ('9270', 'Gegenkonto zu 92710-92780');
+INSERT INTO gifi (accno,description) VALUES ('9271', 'Verb. a. d. Begebung u. Übertragung v. Wechseln');
+INSERT INTO gifi (accno,description) VALUES ('9272', 'Verb. a. d. Begebung u. Übertr. v. Wechseln gg. verb. U.');
+INSERT INTO gifi (accno,description) VALUES ('9273', 'Verb. a. Bürgsch., Wechsel- u. Scheckbürgsch.');
+INSERT INTO gifi (accno,description) VALUES ('9274', 'Verb. a. Bürgsch., Wechsel- u. Scheckbürgsch. gg. verb. U.');
+INSERT INTO gifi (accno,description) VALUES ('9275', 'Verb. aus Gewährleistungsverträgen');
+INSERT INTO gifi (accno,description) VALUES ('9276', 'Verb. aus Gewährleistungsverträgen gg. verbund. Untern.');
+INSERT INTO gifi (accno,description) VALUES ('9277', 'Haftung a. d. Best. von Sicherheiten für fremde Verbindl.');
+INSERT INTO gifi (accno,description) VALUES ('9278', 'Haftung a.d. Best. v. Sicherh. f. fr. Verbindl. gg. verb. U.');
+INSERT INTO gifi (accno,description) VALUES ('9280', 'Gegenkonto zu 92810-92840');
+INSERT INTO gifi (accno,description) VALUES ('9281', 'Verpflichtungen aus Miet- und Leasingverträgen');
+INSERT INTO gifi (accno,description) VALUES ('9282', 'Verpflichtungen aus Miet- und Leasingverträgen gg. verb. Unternehm.');
+INSERT INTO gifi (accno,description) VALUES ('9283', 'Andere Verpflichtungen gem. §285 Nr.3 HGB');
+INSERT INTO gifi (accno,description) VALUES ('9284', 'Andere Verpflichtungen gem. §285 Nr.3 HGB gg. verb. Unternehmen');
+INSERT INTO gifi (accno,description) VALUES ('9410', 'Aussteh. Einl. §26 A.3 DMBilG nicht eingef. (Aktivausw.)');
+INSERT INTO gifi (accno,description) VALUES ('9411', 'Aussteh. Einl. §26 A.3 DMBilG eingef. (Aktivausweis)');
+INSERT INTO gifi (accno,description) VALUES ('9413', 'Aufw. f. Ingangs. u. Erw. d. Gesch.Betr. §31A.1 Nr.2 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9415', 'Nichtentgeltl. erw. immat. Verm.Gegenst. §31A.1 Nr.1 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9416', 'Nutzungsrechte gem. § 9 Abs.3 Satz 2 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9420', 'Ford. gg. verb. Untern. a. Ausgleichsverb. gem. §25 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9421', 'Ford. gg. verb. U. a. Ausgl.Verb. §25 DMBilG Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9422', 'Ford. gg. verb. U. a. Ausgl.Verb. §25 DMBilG Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9426', 'Eingeforderte Einlagen §26 Abs. 3 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9427', 'Ausgleichsforderungen §24 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9428', 'Ausgleichsford. §24 DMBilG - Restlaufz. bis 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('9429', 'Ausgleichsford. §24 DMBilG - Restlaufz. größer 1 Jahr');
+INSERT INTO gifi (accno,description) VALUES ('9430', 'Ford. nach dem VermG §7 Abs. 6 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9431', 'Ford. nach dem VermG §7 A.6 DMBilG - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9432', 'Ford. nach dem VermG §7 A.6 DMBilG - Restl. gr. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9433', 'Vermögensvorteile §31 Abs.1 Nr. 3 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9434', 'Kapitalentwertungskonto');
+INSERT INTO gifi (accno,description) VALUES ('9435', 'Kapitalentwertungskonto §28 Abs.1 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9436', 'Kapitalentwertungskonto §26 Abs.4 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9438', 'Sonderverlustkonto aus Rückstellungen §17 Abs.4 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9440', 'Beteiligunsentwertungskonto §24 Abs.5 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9445', 'Vorläufige Gewinnrücklage §31 Abs.1 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9446', 'Sonderrücklage §7 Abs.6 Satz 2 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9447', 'Sonderrücklage §17 Abs.4 Satz 3 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9448', 'Sonderrücklage §24 Abs. 5 Satz 3 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9449', 'Sonderrücklage §27 Abs. 2 Satz 3 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9450', 'Rückst. f. Umweltbeeinträchtigung §17 A.2a DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9451', 'Nachrangiges Kapital §16 Abs. 3 Satz 2 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9453', 'Berichtig. v. Wertans. §36 DMBilG - Erhöhung d. Aktiva');
+INSERT INTO gifi (accno,description) VALUES ('9454', 'Berichtig. v. Wertans. §36 DMBilG - Verm. d. Aktivp.');
+INSERT INTO gifi (accno,description) VALUES ('9455', 'Berichtig. v. Wertans. §36 DMBilG - Erhöhung d. Passiva');
+INSERT INTO gifi (accno,description) VALUES ('9456', 'Berichtig. v. Wertans. §36 DMBilG - Verm. d. Passivp.');
+INSERT INTO gifi (accno,description) VALUES ('9457', 'Verb. gg. verb. Untern. a. Ausgleichsford. gem. §24 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9458', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. b. 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9459', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. 1 b. 5 J');
+INSERT INTO gifi (accno,description) VALUES ('9460', 'Verb. gg. verb. U. a. Ausgl.Ford. §24 DMBilG Restl. gr. 5 J');
+INSERT INTO gifi (accno,description) VALUES ('9462', 'Verb. gg. verb. Untern. §26 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9463', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9464', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9465', 'Verb. gg. verb. Untern. §26 DMBilG - Restl. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9467', 'Ausgleichsverbindlichkeiten §25 Abs.1 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9468', 'Ausgleichsverb. §25 Abs.1 DMBilG - Restlaufz. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9469', 'Ausgleichsverb. §25 A.1 DMBilG - Restlaufz. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9470', 'Ausgleichsverb. §25 A.1 DMBilG - Restlaufz. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9472', 'Verb. nach dem VermG §7 Abs.6 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9473', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. bis 1 J.');
+INSERT INTO gifi (accno,description) VALUES ('9474', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. 1 bis 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9475', 'Verb. nach dem VermG §7 A.6 DMBilG - Restl. größer 5 J.');
+INSERT INTO gifi (accno,description) VALUES ('9476', 'Verb. aus Rückzahlungsverpfl. 17 Abs.4a DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9477', 'Verb. a. Rückzahlg.Verpfl. - Restl. b. 1 J. §17 A.4a DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9478', 'Verb. a. Rückzahlg.Verpfl. - Restl. 1 b. 5 J. §17A.4a DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9479', 'Verb. a. Rückzahlg.Verpfl. - Restl. gr. 5 J. §17 A.4a DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9480', 'Auflösung Kapitalentwertungskonto §28 A.2 Satz 4 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9481', 'Entnahmen a. vorläufigen Gewinnrücklagen §31 A.6 DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9482', 'Entnahmen a. Sonderrückl. zum Ausgleich von Verlusten');
+INSERT INTO gifi (accno,description) VALUES ('9486', 'Abschreibungen auf Ausgleichsforderungen DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9487', 'Erträge aus der Auflösung von Rückstellungen DMBilG');
+INSERT INTO gifi (accno,description) VALUES ('9500', 'Anteil für Konto 09000-09090');
+INSERT INTO gifi (accno,description) VALUES ('9510', 'Anteil für Konto 09100-09190');
+INSERT INTO gifi (accno,description) VALUES ('9520', 'Anteil für Konto 09200-09290');
+INSERT INTO gifi (accno,description) VALUES ('9530', 'Anteil für Konto 08300-08390');
+INSERT INTO gifi (accno,description) VALUES ('9540', 'Anteil für Konto 08100-08190');
+INSERT INTO gifi (accno,description) VALUES ('9570', 'Anteil für Konto 08700-08790');
+INSERT INTO gifi (accno,description) VALUES ('9580', 'Anteil für Konto 08800-08890');
+INSERT INTO gifi (accno,description) VALUES ('9590', 'Anteil für Konto 08900-08990');
+INSERT INTO gifi (accno,description) VALUES ('9600', 'Name des Gesellschafters (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9610', 'Tätigkeitsvergütung (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9620', 'Tantieme (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9630', 'Darlehensverzinsung (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9640', 'Gebrauchsüberlassung (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9650', 'Sonstige Vergütungen (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9690', 'Restanteil (Vollhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9700', 'Name des Gesellschafters (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9710', 'Tätigkeitsvergütung (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9720', 'Tantieme (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9730', 'Darlehensverzinsung (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9740', 'Gebrauchsüberlassung (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9750', 'Sonstige Vergütungen (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9790', 'Restanteil (Teilhafter)');
+INSERT INTO gifi (accno,description) VALUES ('9890', 'Statistisches Konto für passive Lohnveredelung');
+INSERT INTO gifi (accno,description) VALUES ('9899', 'Gegenkonto zu 9890');
diff --git a/sql-ledger/sql/Italy-chart.sql b/sql-ledger/sql/Italy-chart.sql
new file mode 100644
index 000000000..0af8e9f78
--- /dev/null
+++ b/sql-ledger/sql/Italy-chart.sql
@@ -0,0 +1,179 @@
+--
+-- Chart of Accounts for Italy
+--
+-- From: Luca Venturini <luca@yepa.com>
+-- 9 Oct 2001
+--
+-- ('2001101'5 Conto ('6470005' diventa tassa (negativa)
+-- ('2001102'5 IVA su acquisti diventa Iva su acq. (20%)
+-- ('2001102'5 Introdotto un conto per ogni aliquota IVA
+-- ('2001102'7 Modificato numero di conto per la Ritenuta d'acconto
+-- ('2001103'1 Inseriti Fornitore-test e Consulente-test
+-- ('2001111'5 Invertito i ruoli di ('6470005' e ('6470010' (erano sbagliati)
+-- ('2001111'5 Eliminata l'applicabilita' della RA al cliente test
+-- ('2001112'0 Aggiunto IC_expense al conto ('7005005' (mancava un conto di default per i servizi)
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2010000','COSTI DI RICERCA, DI SVILUPPO E DI PUBBLICITA\'','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2010005','Spese di ricerca e di sviluppo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2010010','Spese di pubblicita\'','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2015000','DIRITTI DI BREV. IND. E DIRITTI DI UTILIZZ DELLE OPERE DELL\'INGEGNO','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2015005','Brevetti','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2020005','Concessioni, licenze e diritti simili','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2025005','Avviamento','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2245000','TERRENI E FABBRICATI','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2245010','Fabbricati civili','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2250000','IMPIANTI E MACCHINARI','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2250005','Impianti generici','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2255000','ATTREZZATURE INDUSTRIALI E COMMERCIALI','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2255005','Attrezzature','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2255010','Mobili','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2255015','Macchine d\'ufficio','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2255025','Autovetture','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3005000','RIMANENZE MATERIE PRIME, SUSSIDIARIE E DI CONSUMO','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3005005','Rimanenze materie prime','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3020000','RIMANENZE PRODOTTI FINITI E MERCI','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3020005','Rimanenze prodotti finiti','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4001000','CREDITI VERSO CL. PER FATT. EM. ESIGIBILI ENTRO L\'ESER. SUCC.','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4001001','Crediti verso clienti per fatture emesse','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4064000','CREDITI VERSO ALTRI - CREDITI D\'IMPOSTA','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4064005','IRPEF acconto','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4064020','IRPEG acconto','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4064800','Credito verso erario per IVA','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400000','DISPONIBILITA\' LIQUIDE','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4480105','Banca ...c/c','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4480400','Assegni','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4480500','Cassa e valori','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5005000','CAPITALE','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5005005','Capitale sociale','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5005010','Versamenti in conto capitale','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020000','RISERVA LEGALE','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020005','Riserva legale','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5080000','UTILI (PERDITE) PORTATI A NUOVO','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5080005','Utili esercizi precedenti','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5080010','Perdite esercizi precedenti','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5090000','UTILE (PERDITA) DELL\'ESERCIZIO','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5090005','Utile dell\'esercizio','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5090010','Perdita dell\'esercizio','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6200000','TRATTAMENTO DI FINE RAPPORTO DI LAVORO SUBORDINATO','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6220005','Trattamento di fine rapporto di lavoro subordinato','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6220010','Anticipazioni erogate su trattamento di fine rapporto di lavoro subordinato','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6435000','DEBITI VERSO BANCHE ESIGIBILI ENTRO ES. SUCC.','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6435005','Banca di ... c/c','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6436000','DEBITI VERSO BANCHE ESIGIBILI OLTRE ES. SUCC.','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6436005','Mutuo banca di ...','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6450000','DEBITI VERSO FORNITORI FATT. RICEVUTE ESIGIBILI ENTRO ES. SUCC.','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6450001','Debiti verso fornitori per fatture ricevute','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470000','DEBITI TRIBUTARI','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470005','IRPEF dipendenti','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470010','IRPEF terzi','A','','L','AP_tax:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470015','IVA da versare','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470020','IVA in sospeso','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470025','IRPEG sul reddito d\'esercizio','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470030','ILOR sul reddito d\'esercizio','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6470050','Imposta patrimoniale','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6475000','DEBITI VERSO ISTITUTI PREV. ESIGIBILI ENTRO ES. SUCC.','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6475005','INPS','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6475010','INAIL','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6475020','Servizio sanitario nazionale (S.S.N.)','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6475025','ENASARCO','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480000','ALTRI DEBITI - IVA C/ERARIO','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480003','IVA su acquisti (4%)','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480004','IVA su acquisti (10%)','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480005','IVA su acquisti (20%)','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480006','IVA a credito su acquisti U.E.','A','','L','AP_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480010','IVA su fatture emesse','A','','L','AR_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480011','IVA a debito su acquisti U.E.','A','','L','AR_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480015','IVA su corrispettivi','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480020','IVA versata','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480025','IVA acconto','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480030','IVA a credito','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480035','IVA ulteriore detrazione','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480040','Crediti d\'imposta diversi','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480045','IVA pro-rata indetraibile','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480050','IVA da contabilità separata','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6480055','IVA c/riepilogativo','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6600000','RATEI E RISCONTI PASSIVI','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6690005','Ratei passivi','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('6692005','Risconti passivi','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005000','COSTI PER MATERIE PRIME, SUSSIDIARIE, DI CONSUMO E DI MERCI','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005005','Materie prime','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005015','Merci destinate alla rivendita','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005020','Materiali di consumo destinati alla produzione','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005030','Materiali di pulizia','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005035','Combustibile per riscaldamento','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005040','Cancelleria','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005045','Materiale pubblicitario','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7005050','Carburanti e lubrificanti','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025000','SPESE DI GESTIONE','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025005','Energia elettrica','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025015','Spese telefoniche','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025025','Spese pubblicità/propaganda','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025030','Spese di assicurazione','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025040','Pulizia locali','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025055','Viaggi e soggiorni amministratori','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025060','Spese di rappresentanza per servizi interamente detraibili','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025065','Altre spese di rappresentanza','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7025100','Altri servizi','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7028000','CARBURANTI E LUBRIFICANTI PER AUTOTRAZIONE','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7028005','Carburanti e lubrificanti autovetture','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7028010','Carburanti e lubrificanti autocarri etc.','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7030000','COMPENSI PROFESSIONALI','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7030005','Consulenza fiscale e tributaria','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7030015','Consulenza legale','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7030030','Compenso amministratori','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7035000','COSTI PER GODIMENTO BENI DI TERZI','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7035005','Fitti passivi','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7035050','Canoni di leasing','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7040000','COSTI PER IL PERSONALE','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7040005','Salari e stipendi','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7040010','Oneri sociali INPS','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7040015','Oneri sociali INAIL','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7040020','Oneri sociali C.E.','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7043000','AMMORTAMENTI E SVALUTAZIONI','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7043005','Ammortamenti immobilizzazioni immateriali','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7043100','Ammortamenti immobilizzazioni materiali','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7056000','ONERI DIVERSI DI GESTIONE','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7056010','Imposta di registro, bolli ,CC.GG., etc.','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7056015','Imposta camerale','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7056025','Tributi locali diversi','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7056040','Tassa possesso autoveicoli','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7260000','INTERESSI E ONERI FINANZIARI','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7260020','Interessi passivi bancari','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7260025','Interessi passivi mutui','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7875000','IMPOSTE SUL REDDITO DELL\'ESERCIZIO','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7875005','IRPEG corrente','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('7875020','IRPEG differita','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8005000','RICAVI DELLE VENDITE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8005005','Ricavi cessione beni','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8015000','RICAVI DELLE PRESTAZIONI','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8015005','Ricavi per prestazioni a terzi','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8015015','Noleggio impianti e macchinari','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8041000','INCREMENTI IMMOBILIZZAZIONI IMMATERIALI','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8041005','Brevetti','A','','I','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8041010','Spese di costituzione società','A','','I','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8041020','Spese pubblicità e propaganda','A','','I','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8045000','ALTRI RICAVI E PROVENTI','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('8045001','Cessione di materie prime, sussidiarie e semilavorati','A','','I','AR_amount');
+--
+-- foreign exchange gain / loss
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9990000','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('9990010','Foreign Exchange Loss','A','','E','');
+--
+-- insert taxes
+--
+--Ritenuta d'acconto
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6470010'), -0.2);
+--IVA Acquisti 4%
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480003'), 0.04);
+--IVA Acquisti 10%
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480004'), 0.1);
+--IVA Acquisti 20%
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480005'), 0.2);
+--IVA Fatture Emesse
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480010'), 0.2);
+--IVA su corrispettivi
+INSERT INTO tax (chart_id, rate) VALUES ((SELECT id FROM chart WHERE accno = '6480015'), 0.2);
+--
+-- update defaults
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '3020005'), income_accno_id = (select id from chart where accno = '8005005'), expense_accno_id = (select id from chart where accno = '7005005'), fxgain_accno_id = (select id from chart where accno = '9990000'), fxloss_accno_id = (select id from chart where accno = '9990010'), invnumber = '20010000', sonumber = '1000', ponumber = '1000', curr = 'EUR', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Oracle-indices.sql b/sql-ledger/sql/Oracle-indices.sql
new file mode 100644
index 000000000..e55915b05
--- /dev/null
+++ b/sql-ledger/sql/Oracle-indices.sql
@@ -0,0 +1,57 @@
+create index acc_trans_trans_id_key on acc_trans (trans_id);
+create index acc_trans_chart_id_key on acc_trans (chart_id);
+create index acc_trans_transdate_key on acc_trans (transdate);
+create index acc_trans_source_key on acc_trans (source);
+create index ap_id_key on ap (id);
+create index ap_transdate_key on ap (transdate);
+create index ap_invnumber_key on ap (invnumber);
+create index ap_ordnumber_key on ap (ordnumber);
+create index ap_vendor_id_key on ap (vendor_id);
+create index ap_employee_id_key on ap (employee_id);
+create index ar_id_key on ar (id);
+create index ar_transdate_key on ar (transdate);
+create index ar_invnumber_key on ar (invnumber);
+create index ar_ordnumber_key on ar (ordnumber);
+create index ar_customer_id_key on ar (customer_id);
+create index ar_employee_id_key on ar (employee_id);
+create index assembly_id_key on assembly (id);
+create index chart_id_key on chart (id);
+create unique index chart_accno_key on chart (accno);
+create index chart_category_key on chart (category);
+create index chart_link_key on chart (link);
+create index chart_gifi_accno_key on chart (gifi_accno);
+create index customer_id_key on customer (id);
+create index customer_customer_id_key on customertax (customer_id);
+create index customer_customernumber_key on customer (customernumber);
+create index customer_name_key on customer (name);
+create index customer_contact_key on customer (contact);
+create index employee_id_key on employee (id);
+create unique index employee_login_key on employee (login);
+create index employee_name_key on employee (name);
+create index exchangerate_ct_key on exchangerate (curr, transdate);
+create unique index gifi_accno_key on gifi (accno);
+create index gl_id_key on gl (id);
+create index gl_transdate_key on gl (transdate);
+create index gl_reference_key on gl (reference);
+create index gl_description_key on gl (description);
+create index gl_employee_id_key on gl (employee_id);
+create index invoice_id_key on invoice (id);
+create index invoice_trans_id_key on invoice (trans_id);
+create index makemodel_parts_id_key on makemodel (parts_id);
+create index oe_id_key on oe (id);
+create index oe_transdate_key on oe (transdate);
+create index oe_ordnumber_key on oe (ordnumber);
+create index oe_employee_id_key on oe (employee_id);
+create index orderitems_trans_id_key on orderitems (trans_id);
+create index parts_id_key on parts (id);
+create index parts_partnumber_key on parts (partnumber);
+create index parts_description_key on parts (description);
+create index partstax_parts_id_key on partstax (parts_id);
+create index vendor_id_key on vendor (id);
+create index vendor_name_key on vendor (name);
+create index vendor_vendornumber_key on vendor (vendornumber);
+create index vendor_contact_key on vendor (contact);
+create index vendortax_vendor_id_key on vendortax (vendor_id);
+create index shipto_trans_id_key on shipto (trans_id);
+create index project_id_key on project (id);
+create index partsgroup_id_key on partsgroup (id);
diff --git a/sql-ledger/sql/Oracle-tables.sql b/sql-ledger/sql/Oracle-tables.sql
new file mode 100644
index 000000000..d2bf7c779
--- /dev/null
+++ b/sql-ledger/sql/Oracle-tables.sql
@@ -0,0 +1,388 @@
+-- Oracle-tables.sql
+-- Paulo Rodrigues: added functions and triggers, Oct. 31, 2001
+--
+-- Modified for use with SL 2.0 and Oracle 9i2, Dec 13, 2002
+--
+ALTER SESSION SET NLS_DATE_FORMAT = 'YYYY-MM-DD';
+--
+CREATE SEQUENCE id START WITH 10000 INCREMENT BY 1 MAXVALUE 2147483647 MINVALUE 1 CACHE 2;
+SELECT ID.NEXTVAL FROM DUAL;
+--
+CREATE TABLE makemodel (
+ parts_id INTEGER,
+ name VARCHAR2(100)
+);
+--
+CREATE TABLE gl (
+ id INTEGER,
+ reference VARCHAR2(50),
+ description VARCHAR2(100),
+ transdate DATE DEFAULT SYSDATE,
+ employee_id INTEGER,
+ notes VARCHAR2(4000)
+);
+--
+CREATE TABLE chart (
+ id INTEGER,
+ accno VARCHAR2(20) NOT NULL,
+ description VARCHAR2(100),
+ charttype CHAR(1) DEFAULT 'A',
+ category CHAR(1),
+ link VARCHAR2(100),
+ gifi_accno VARCHAR2(20)
+);
+--
+CREATE TABLE gifi (
+ accno VARCHAR2(20),
+ description VARCHAR2(100)
+);
+--
+CREATE TABLE defaults (
+ inventory_accno_id INTEGER,
+ income_accno_id INTEGER,
+ expense_accno_id INTEGER,
+ fxgain_accno_id INTEGER,
+ fxloss_accno_id INTEGER,
+ invnumber VARCHAR2(30),
+ sonumber VARCHAR2(30),
+ yearend VARCHAR2(5),
+ weightunit VARCHAR2(5),
+ businessnumber VARCHAR2(30),
+ version VARCHAR2(8),
+ curr VARCHAR2(500),
+ closedto DATE,
+ revtrans CHAR(1) DEFAULT '0',
+ ponumber VARCHAR2(30)
+);
+INSERT INTO defaults (version) VALUES ('2.0.8');
+--
+CREATE TABLE acc_trans (
+ trans_id INTEGER,
+ chart_id INTEGER,
+ amount FLOAT,
+ transdate DATE DEFAULT SYSDATE,
+ source VARCHAR2(20),
+ cleared CHAR(1) DEFAULT '0',
+ fx_transaction CHAR(1) DEFAULT '0',
+ project_id INTEGER
+);
+--
+CREATE TABLE invoice (
+ id INTEGER,
+ trans_id INTEGER,
+ parts_id INTEGER,
+ description VARCHAR2(4000),
+ qty FLOAT,
+ allocated FLOAT,
+ sellprice FLOAT,
+ fxsellprice FLOAT,
+ discount FLOAT,
+ assemblyitem CHAR(1) DEFAULT '0',
+ unit VARCHAR2(5),
+ project_id INTEGER,
+ deliverydate DATE
+);
+--
+CREATE TABLE vendor (
+ id INTEGER,
+ name VARCHAR2(35),
+ addr1 VARCHAR2(35),
+ addr2 VARCHAR2(35),
+ addr3 VARCHAR2(35),
+ addr4 VARCHAR2(35),
+ contact VARCHAR2(35),
+ phone VARCHAR2(20),
+ fax VARCHAR2(20),
+ email VARCHAR2(50),
+ notes VARCHAR2(4000),
+ terms INTEGER DEFAULT 0,
+ taxincluded CHAR(1),
+ vendornumber VARCHAR2(40),
+ cc VARCHAR2(50),
+ bcc VARCHAR2(50)
+);
+--
+CREATE TABLE customer (
+ id INTEGER,
+ name VARCHAR2(35),
+ addr1 VARCHAR2(35),
+ addr2 VARCHAR2(35),
+ addr3 VARCHAR2(35),
+ addr4 VARCHAR2(35),
+ contact VARCHAR2(35),
+ phone VARCHAR2(20),
+ fax VARCHAR2(20),
+ email VARCHAR2(50),
+ notes VARCHAR2(4000),
+ discount FLOAT,
+ taxincluded CHAR(1),
+ creditlimit FLOAT,
+ terms INTEGER DEFAULT 0,
+ customernumber VARCHAR2(40),
+ cc VARCHAR2(50),
+ bcc VARCHAR2(50)
+);
+--
+CREATE TABLE parts (
+ id INTEGER,
+ partnumber VARCHAR2(30),
+ description VARCHAR2(4000),
+ unit VARCHAR2(5),
+ listprice FLOAT,
+ sellprice FLOAT,
+ lastcost FLOAT,
+ priceupdate DATE DEFAULT SYSDATE,
+ weight FLOAT,
+ onhand FLOAT DEFAULT 0,
+ notes VARCHAR2(4000),
+ makemodel CHAR(1) DEFAULT '0',
+ assembly CHAR(1) DEFAULT '0',
+ alternate CHAR(1) DEFAULT '0',
+ rop FLOAT,
+ inventory_accno_id INTEGER,
+ income_accno_id INTEGER,
+ expense_accno_id INTEGER,
+ bin VARCHAR2(20),
+ obsolete CHAR(1) DEFAULT '0',
+ bom CHAR(1) DEFAULT '0',
+ image VARCHAR2(100),
+ drawing VARCHAR2(100),
+ microfiche VARCHAR2(100),
+ partsgroup_id INTEGER
+);
+--
+CREATE TABLE assembly (
+ id INTEGER,
+ parts_id INTEGER,
+ qty FLOAT,
+ bom CHAR(1)
+);
+--
+CREATE TABLE ar (
+ id INTEGER,
+ invnumber VARCHAR2(30),
+ transdate DATE DEFAULT SYSDATE,
+ customer_id INTEGER,
+ taxincluded CHAR(1),
+ amount FLOAT,
+ netamount FLOAT,
+ paid FLOAT,
+ datepaid DATE,
+ duedate DATE,
+ invoice CHAR(1) DEFAULT '0',
+ shippingpoint VARCHAR2(100),
+ terms INTEGER DEFAULT 0,
+ notes VARCHAR2(4000),
+ curr CHAR(3),
+ ordnumber VARCHAR2(30),
+ employee_id INTEGER
+);
+--
+CREATE TABLE ap (
+ id INTEGER,
+ invnumber VARCHAR2(30),
+ transdate DATE DEFAULT SYSDATE,
+ vendor_id INTEGER,
+ taxincluded CHAR(1) DEFAULT '0',
+ amount FLOAT,
+ netamount FLOAT,
+ paid FLOAT,
+ datepaid DATE,
+ duedate DATE,
+ invoice CHAR(1) DEFAULT '0',
+ ordnumber VARCHAR2(30),
+ curr CHAR(3),
+ notes VARCHAR2(4000),
+ employee_id INTEGER
+);
+--
+CREATE TABLE partstax (
+ parts_id INTEGER,
+ chart_id INTEGER
+);
+--
+CREATE TABLE tax (
+ chart_id INTEGER,
+ rate FLOAT,
+ taxnumber VARCHAR2(30)
+);
+--
+CREATE TABLE customertax (
+ customer_id INTEGER,
+ chart_id INTEGER
+);
+--
+CREATE TABLE vendortax (
+ vendor_id INTEGER,
+ chart_id INTEGER
+);
+--
+CREATE TABLE oe (
+ id INTEGER,
+ ordnumber VARCHAR2(30),
+ transdate DATE DEFAULT SYSDATE,
+ vendor_id INTEGER,
+ customer_id INTEGER,
+ amount FLOAT,
+ netamount FLOAT,
+ reqdate DATE,
+ taxincluded CHAR(1),
+ shippingpoint VARCHAR2(100),
+ notes VARCHAR2(4000),
+ curr CHAR(3),
+ employee_id INTEGER,
+ closed CHAR(1) DEFAULT '0'
+);
+--
+CREATE TABLE orderitems (
+ trans_id INTEGER,
+ parts_id INTEGER,
+ description VARCHAR2(4000),
+ qty FLOAT,
+ sellprice FLOAT,
+ discount FLOAT,
+ unit VARCHAR2(5),
+ project_id INTEGER,
+ reqdate DATE
+);
+--
+CREATE TABLE exchangerate (
+ curr CHAR(3),
+ transdate DATE,
+ buy FLOAT,
+ sell FLOAT
+);
+--
+CREATE TABLE employee (
+ id INTEGER,
+ login VARCHAR2(20),
+ name VARCHAR2(35),
+ addr1 VARCHAR2(35),
+ addr2 VARCHAR2(35),
+ addr3 VARCHAR2(35),
+ addr4 VARCHAR2(35),
+ workphone VARCHAR2(20),
+ homephone VARCHAR2(20),
+ startdate DATE DEFAULT SYSDATE,
+ enddate DATE,
+ notes VARCHAR2(4000)
+);
+--
+CREATE TABLE shipto (
+ trans_id INTEGER,
+ shiptoname VARCHAR2(35),
+ shiptoaddr1 VARCHAR2(35),
+ shiptoaddr2 VARCHAR2(35),
+ shiptoaddr3 VARCHAR2(35),
+ shiptoaddr4 VARCHAR2(35),
+ shiptocontact VARCHAR2(35),
+ shiptophone VARCHAR2(20),
+ shiptofax VARCHAR2(20),
+ shiptoemail VARCHAR2(50)
+);
+--
+CREATE TABLE project (
+ id INTEGER,
+ projectnumber VARCHAR2(50),
+ description VARCHAR2(4000)
+);
+--
+CREATE TABLE partsgroup (
+ id INTEGER,
+ partsgroup VARCHAR2(100)
+);
+--
+-- functions
+--
+CREATE OR REPLACE FUNCTION current_date RETURN date AS
+BEGIN
+ return(sysdate);--
+END;;
+--
+-- triggers
+--
+CREATE OR REPLACE TRIGGER glid BEFORE INSERT ON gl FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER chartid BEFORE INSERT ON chart FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER invoiceid BEFORE INSERT ON invoice FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER vendorid BEFORE INSERT ON vendor FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER customerid BEFORE INSERT ON customer FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER partsid BEFORE INSERT ON parts FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER arid BEFORE INSERT ON ar FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER apid BEFORE INSERT ON ap FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER oeid BEFORE INSERT ON oe FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER employeeid BEFORE INSERT ON employee FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER projectid BEFORE INSERT ON project FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE OR REPLACE TRIGGER partsgroupid BEFORE INSERT ON partsgroup FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+
diff --git a/sql-ledger/sql/Oracle-upgrade-1.8.0-1.8.4.sql b/sql-ledger/sql/Oracle-upgrade-1.8.0-1.8.4.sql
new file mode 100644
index 000000000..a3293a648
--- /dev/null
+++ b/sql-ledger/sql/Oracle-upgrade-1.8.0-1.8.4.sql
@@ -0,0 +1,28 @@
+--
+ALTER TABLE chart ADD gifi_accno VARCHAR2(20);
+--
+CREATE TABLE gifi (
+ accno VARCHAR2(20),
+ description VARCHAR2(100)
+);
+--
+CREATE UNIQUE INDEX chart_accno_key ON chart (accno);
+--
+CREATE TABLE mtemp (
+ parts_id INTEGER,
+ name VARCHAR2(100)
+);
+INSERT INTO mtemp SELECT parts_id, name FROM makemodel;
+DROP TABLE makemodel;
+ALTER TABLE mtemp RENAME TO makemodel;
+--
+ALTER TABLE defaults ADD closedto DATE;
+ALTER TABLE defaults ADD revtrans CHAR(1);
+--
+ALTER TABLE ap ADD notes VARCHAR2(4000);
+--
+ALTER TABLE customer ADD businessnumber VARCHAR2(40);
+ALTER TABLE vendor ADD businessnumber VARCHAR2(40);
+--
+UPDATE defaults SET version = '1.8.4', revtrans = '0';
+--
diff --git a/sql-ledger/sql/Oracle-upgrade-1.8.4-1.8.5.sql b/sql-ledger/sql/Oracle-upgrade-1.8.4-1.8.5.sql
new file mode 100644
index 000000000..d228b9ee4
--- /dev/null
+++ b/sql-ledger/sql/Oracle-upgrade-1.8.4-1.8.5.sql
@@ -0,0 +1,77 @@
+--
+ALTER TABLE customer ADD (customernumber VARCHAR2(40));
+UPDATE customer SET customernumber = businessnumber;
+ALTER TABLE customer DROP COLUMN businessnumber;
+CREATE INDEX customer_customernumber_key ON customer (customernumber);
+--
+ALTER TABLE vendor ADD (vendornumber VARCHAR2(40));
+UPDATE vendor SET vendornumber = businessnumber;
+ALTER TABLE vendor DROP COLUMN businessnumber;
+CREATE INDEX vendor_vendornumber_key ON vendor (vendornumber);
+--
+CREATE TABLE employee (
+ id INTEGER,
+ login VARCHAR2(20),
+ name VARCHAR2(35),
+ addr1 VARCHAR2(35),
+ addr2 VARCHAR2(35),
+ addr3 VARCHAR2(35),
+ addr4 VARCHAR2(35),
+ workphone VARCHAR2(20),
+ homephone VARCHAR2(20),
+ startdate DATE DEFAULT SYSDATE,
+ enddate DATE,
+ notes VARCHAR2(4000)
+);
+--
+CREATE OR REPLACE TRIGGER employeeid BEFORE INSERT ON employee FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+CREATE INDEX employee_id_key ON employee (id);
+CREATE UNIQUE INDEX employee_login_key ON employee (login);
+CREATE INDEX employee_name_key ON employee (name);
+--
+ALTER TABLE gl ADD (employee_id INTEGER);
+CREATE INDEX gl_employee_id_key ON gl (employee_id);
+ALTER TABLE ar ADD (employee_id INTEGER);
+CREATE INDEX ar_employee_id_key ON ar (employee_id);
+ALTER TABLE ap ADD (employee_id INTEGER);
+CREATE INDEX ap_employee_id_key ON ap (employee_id);
+ALTER TABLE oe ADD (employee_id INTEGER);
+CREATE INDEX oe_employee_id_key ON oe (employee_id);
+--
+ALTER TABLE invoice ADD (unit VARCHAR2(5));
+ALTER TABLE orderitems ADD (unit VARCHAR2(5));
+--
+UPDATE chart SET gifi_accno = '' WHERE gifi_accno = NULL;
+ALTER TABLE chart RENAME TO chartold;
+CREATE TABLE chart (
+ id INTEGER,
+ accno VARCHAR2(20) NOT NULL,
+ description VARCHAR2(100),
+ charttype CHAR(1) DEFAULT 'A',
+ category CHAR(1),
+ link VARCHAR2(100),
+ gifi_accno VARCHAR2(20)
+);
+INSERT INTO chart (id, accno, description, charttype, category, link, gifi_accno) SELECT id, accno, description, charttype, category, link, gifi_accno from chartold;
+DROP TABLE chartold;
+CREATE INDEX chart_id_key ON chart (id);
+CREATE UNIQUE INDEX chart_accno_key ON chart (accno);
+CREATE INDEX chart_category_key ON chart (category);
+CREATE INDEX chart_link_key ON chart (link);
+CREATE INDEX chart_gifi_accno_key ON chart (gifi_accno);
+--
+ALTER TABLE parts MODIFY inventory_accno_id;
+--
+ALTER TABLE defaults ADD (sonumber VARCHAR2(30));
+UPDATE defaults SET sonumber = ordnumber;
+ALTER TABLE defaults DROP COLUMN ordnumber;
+ALTER TABLE defaults ADD (ponumber VARCHAR2(30));
+--
+UPDATE defaults SET version = '1.8.5';
+--
diff --git a/sql-ledger/sql/Oracle-upgrade-1.8.5-2.0.0.sql b/sql-ledger/sql/Oracle-upgrade-1.8.5-2.0.0.sql
new file mode 100644
index 000000000..2d2231be8
--- /dev/null
+++ b/sql-ledger/sql/Oracle-upgrade-1.8.5-2.0.0.sql
@@ -0,0 +1,100 @@
+--
+alter table customer add (cc VARCHAR2(50));
+alter table customer add (bcc VARCHAR2(50));
+--
+alter table vendor add (cc VARCHAR2(50));
+alter table vendor add (bcc VARCHAR2(50));
+--
+create table shipto (
+ trans_id integer,
+ shiptoname varchar2(35),
+ shiptoaddr1 varchar2(35),
+ shiptoaddr2 varchar2(35),
+ shiptoaddr3 varchar2(35),
+ shiptoaddr4 varchar2(35),
+ shiptocontact varchar2(35),
+ shiptophone varchar2(20),
+ shiptofax varchar2(20),
+ shiptoemail VARCHAR2(50)
+);
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail from customer where shiptoname != '' or shiptoname is not null;
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (a.id) a.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, ar a where a.customer_id = c.id;
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (o.id) o.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, oe o where o.customer_id = c.id;
+--
+create index shipto_trans_id_key on shipto (trans_id);
+--
+create table custome (
+ id integer,
+ name varchar2(35),
+ addr1 varchar2(35),
+ addr2 varchar2(35),
+ addr3 varchar2(35),
+ addr4 varchar2(35),
+ contact varchar2(35),
+ phone varchar2(20),
+ fax varchar2(20),
+ email VARCHAR2(50),
+ notes RCHAR2(4000),
+ discount float,
+ taxincluded char(1),
+ creditlimit float DEFAULT 0,
+ terms integer DEFAULT 0,
+ customernumber VARCHAR2(40),
+ cc VARCHAR2(50),
+ bcc VARCHAR2(50)
+);
+insert into custome (id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber) select id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber from customer;
+--
+drop table customer;
+alter table custome rename to customer;
+create index customer_id_key on customer (id);
+create index customer_name_key on customer (name);
+create index customer_contact_key on customer (contact);
+--
+alter table parts add (bom char(1) default '0');
+update parts set bom = '0';
+update parts set bom = '1' where assembly = '1';
+alter table parts add (image VARCHAR2(100));
+alter table parts add (drawing VARCHAR2(100));
+alter table parts add (microfiche VARCHAR2(100));
+--
+alter table gl add (notes VARCHAR2(4000));
+--
+alter table oe add (closed char(1) default '0');
+update oe set closed = '0';
+--
+create table project (
+ id integer,
+ projectnumber VARCHAR2(50),
+ description VARCHAR2(4000)
+);
+--
+create index project_id_key on project (id);
+--
+alter table acc_trans add (project_id integer);
+update acc_trans set cleared = '0' where cleared = '1';
+--
+alter table invoice add (project_id integer);
+alter table invoice add (deliverydate date);
+alter table orderitems add (project_id integer);
+alter table orderitems add (reqdate date);
+--
+CREATE OR REPLACE TRIGGER projectid BEFORE INSERT ON project FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+ FROM DUAL;--
+END;;
+--
+alter table gl add (reference VARCHAR2(50));
+update gl set reference = source;
+alter table gl drop column source;
+--
+create index gl_reference_key on gl (reference);
+create index acc_trans_source_key on acc_trans (source);
+--
+update defaults set version = '2.0.0';
+--
diff --git a/sql-ledger/sql/Oracle-upgrade-2.0.0-2.0.8.sql b/sql-ledger/sql/Oracle-upgrade-2.0.0-2.0.8.sql
new file mode 100644
index 000000000..eb65e9cae
--- /dev/null
+++ b/sql-ledger/sql/Oracle-upgrade-2.0.0-2.0.8.sql
@@ -0,0 +1,19 @@
+--
+create table partsgroup (id integer, partsgroup varchar2(100));
+create index partsgroup_id_key on partsgroup (id);
+--
+alter table parts add (partsgroup_id integer);
+--
+alter table assembly add (bom char(1));
+update assembly set bom = '0' where assembly.id = parts.id and parts.bom = '0';
+update assembly set bom = '1' where assembly.id = parts.id and parts.bom = '1';
+--
+CREATE OR REPLACE TRIGGER partsgroupid BEFORE INSERT ON partsgroup FOR EACH ROW
+BEGIN
+ SELECT id.nextval
+ INTO :new.id
+FROM DUAL;--
+END;;
+--
+update defaults set version = '2.0.8';
+--
diff --git a/sql-ledger/sql/Pg-indices.sql b/sql-ledger/sql/Pg-indices.sql
new file mode 100644
index 000000000..27a9e4318
--- /dev/null
+++ b/sql-ledger/sql/Pg-indices.sql
@@ -0,0 +1,57 @@
+create index acc_trans_trans_id_key on acc_trans (trans_id);
+create index acc_trans_chart_id_key on acc_trans (chart_id);
+create index acc_trans_transdate_key on acc_trans (transdate);
+create index acc_trans_source_key on acc_trans (lower(source));
+create index ap_id_key on ap (id);
+create index ap_transdate_key on ap (transdate);
+create index ap_invnumber_key on ap (lower(invnumber));
+create index ap_ordnumber_key on ap (lower(ordnumber));
+create index ap_vendor_id_key on ap (vendor_id);
+create index ap_employee_id_key on ap (employee_id);
+create index ar_id_key on ar (id);
+create index ar_transdate_key on ar (transdate);
+create index ar_invnumber_key on ar (lower(invnumber));
+create index ar_ordnumber_key on ar (lower(ordnumber));
+create index ar_customer_id_key on ar (customer_id);
+create index ar_employee_id_key on ar (employee_id);
+create index assembly_id_key on assembly (id);
+create index chart_id_key on chart (id);
+create unique index chart_accno_key on chart (accno);
+create index chart_category_key on chart (category);
+create index chart_link_key on chart (link);
+create index chart_gifi_accno_key on chart (gifi_accno);
+create index customer_id_key on customer (id);
+create index customer_customer_id_key on customertax (customer_id);
+create index customer_customernumber_key on customer (customernumber);
+create index customer_name_key on customer (name);
+create index customer_contact_key on customer (contact);
+create index employee_id_key on employee (id);
+create unique index employee_login_key on employee (login);
+create index employee_name_key on employee (name);
+create index exchangerate_ct_key on exchangerate (curr, transdate);
+create unique index gifi_accno_key on gifi (accno);
+create index gl_id_key on gl (id);
+create index gl_transdate_key on gl (transdate);
+create index gl_reference_key on gl (lower(reference));
+create index gl_description_key on gl (lower(description));
+create index gl_employee_id_key on gl (employee_id);
+create index invoice_id_key on invoice (id);
+create index invoice_trans_id_key on invoice (trans_id);
+create index makemodel_parts_id_key on makemodel (parts_id);
+create index oe_id_key on oe (id);
+create index oe_transdate_key on oe (transdate);
+create index oe_ordnumber_key on oe (lower(ordnumber));
+create index oe_employee_id_key on oe (employee_id);
+create index orderitems_trans_id_key on orderitems (trans_id);
+create index parts_id_key on parts (id);
+create index parts_partnumber_key on parts (lower(partnumber));
+create index parts_description_key on parts (lower(description));
+create index partstax_parts_id_key on partstax (parts_id);
+create index vendor_id_key on vendor (id);
+create index vendor_name_key on vendor (name);
+create index vendor_vendornumber_key on vendor (vendornumber);
+create index vendor_contact_key on vendor (contact);
+create index vendortax_vendor_id_key on vendortax (vendor_id);
+create index shipto_trans_id_key on shipto (trans_id);
+create index project_id_key on project (id);
+create index partsgroup_id_key on partsgroup (id);
diff --git a/sql-ledger/sql/Pg-tables.sql b/sql-ledger/sql/Pg-tables.sql
new file mode 100644
index 000000000..aed978724
--- /dev/null
+++ b/sql-ledger/sql/Pg-tables.sql
@@ -0,0 +1,289 @@
+CREATE SEQUENCE id
+ start 10000;
+--
+SELECT nextval ('id');
+--
+CREATE TABLE makemodel (
+ parts_id int,
+ name text
+);
+--
+CREATE TABLE gl (
+ id int DEFAULT nextval ( 'id' ),
+ reference text,
+ description text,
+ transdate date DEFAULT current_date,
+ employee_id int,
+ notes text
+);
+--
+CREATE TABLE chart (
+ id int DEFAULT nextval ( 'id' ),
+ accno text NOT NULL,
+ description text,
+ charttype char(1) DEFAULT 'A',
+ category char(1),
+ link text,
+ gifi_accno text
+);
+--
+CREATE TABLE gifi (
+ accno text,
+ description text
+);
+--
+CREATE TABLE defaults (
+ inventory_accno_id int,
+ income_accno_id int,
+ expense_accno_id int,
+ fxgain_accno_id int,
+ fxloss_accno_id int,
+ invnumber text,
+ sonumber text,
+ yearend varchar(5),
+ weightunit varchar(5),
+ businessnumber text,
+ version varchar(8),
+ curr text,
+ closedto date,
+ revtrans bool DEFAULT 'f',
+ ponumber text
+);
+INSERT INTO defaults (version) VALUES ('2.0.8');
+--
+CREATE TABLE acc_trans (
+ trans_id int,
+ chart_id int,
+ amount float,
+ transdate date DEFAULT current_date,
+ source text,
+ cleared bool DEFAULT 'f',
+ fx_transaction bool DEFAULT 'f',
+ project_id int
+);
+--
+CREATE TABLE invoice (
+ id int DEFAULT nextval ( 'id' ),
+ trans_id int,
+ parts_id int,
+ description text,
+ qty float4,
+ allocated float4,
+ sellprice float,
+ fxsellprice float,
+ discount float4,
+ assemblyitem bool DEFAULT 'f',
+ unit varchar(5),
+ project_id int,
+ deliverydate date
+);
+--
+CREATE TABLE vendor (
+ id int DEFAULT nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ terms int2 DEFAULT 0,
+ taxincluded bool,
+ vendornumber text,
+ cc text,
+ bcc text
+);
+--
+CREATE TABLE customer (
+ id int DEFAULT nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ discount float4,
+ taxincluded bool,
+ creditlimit float DEFAULT 0,
+ terms int2 DEFAULT 0,
+ customernumber text,
+ cc text,
+ bcc text
+);
+--
+CREATE TABLE parts (
+ id int DEFAULT nextval ( 'id' ),
+ partnumber text,
+ description text,
+ unit varchar(5),
+ listprice float,
+ sellprice float,
+ lastcost float,
+ priceupdate date DEFAULT current_date,
+ weight float4,
+ onhand float4 DEFAULT 0,
+ notes text,
+ makemodel bool DEFAULT 'f',
+ assembly bool DEFAULT 'f',
+ alternate bool DEFAULT 'f',
+ rop float4,
+ inventory_accno_id int,
+ income_accno_id int,
+ expense_accno_id int,
+ bin text,
+ obsolete bool DEFAULT 'f',
+ bom bool DEFAULT 'f',
+ image text,
+ drawing text,
+ microfiche text,
+ partsgroup_id int
+);
+--
+CREATE TABLE assembly (
+ id int,
+ parts_id int,
+ qty float,
+ bom bool
+);
+--
+CREATE TABLE ar (
+ id int DEFAULT nextval ( 'id' ),
+ invnumber text,
+ transdate date DEFAULT current_date,
+ customer_id int,
+ taxincluded bool,
+ amount float,
+ netamount float,
+ paid float,
+ datepaid date,
+ duedate date,
+ invoice bool DEFAULT 'f',
+ shippingpoint text,
+ terms int2 DEFAULT 0,
+ notes text,
+ curr char(3),
+ ordnumber text,
+ employee_id int
+);
+--
+CREATE TABLE ap (
+ id int DEFAULT nextval ( 'id' ),
+ invnumber text,
+ transdate date DEFAULT current_date,
+ vendor_id int,
+ taxincluded bool DEFAULT 'f',
+ amount float,
+ netamount float,
+ paid float,
+ datepaid date,
+ duedate date,
+ invoice bool DEFAULT 'f',
+ ordnumber text,
+ curr char(3),
+ notes text,
+ employee_id int
+);
+--
+CREATE TABLE partstax (
+ parts_id int,
+ chart_id int
+);
+--
+CREATE TABLE tax (
+ chart_id int,
+ rate float,
+ taxnumber text
+);
+--
+CREATE TABLE customertax (
+ customer_id int,
+ chart_id int
+);
+--
+CREATE TABLE vendortax (
+ vendor_id int,
+ chart_id int
+);
+--
+CREATE TABLE oe (
+ id int default nextval('id'),
+ ordnumber text,
+ transdate date default current_date,
+ vendor_id int,
+ customer_id int,
+ amount float8,
+ netamount float8,
+ reqdate date,
+ taxincluded bool,
+ shippingpoint text,
+ notes text,
+ curr char(3),
+ employee_id int,
+ closed bool default 'f'
+);
+--
+CREATE TABLE orderitems (
+ trans_id int,
+ parts_id int,
+ description text,
+ qty float4,
+ sellprice float8,
+ discount float4,
+ unit varchar(5),
+ project_id int,
+ reqdate date
+);
+--
+CREATE TABLE exchangerate (
+ curr char(3),
+ transdate date,
+ buy float8,
+ sell float8
+);
+--
+CREATE TABLE employee (
+ id int DEFAULT nextval ('id'),
+ login text,
+ name Varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ workphone varchar(20),
+ homephone varchar(20),
+ startdate date default current_date,
+ enddate date,
+ notes text
+);
+--
+create table shipto (
+ trans_id int,
+ shiptoname varchar(35),
+ shiptoaddr1 varchar(35),
+ shiptoaddr2 varchar(35),
+ shiptoaddr3 varchar(35),
+ shiptoaddr4 varchar(35),
+ shiptocontact varchar(35),
+ shiptophone varchar(20),
+ shiptofax varchar(20),
+ shiptoemail text
+);
+--
+create table project (
+ id int default nextval('id'),
+ projectnumber text,
+ description text
+);
+--
+create table partsgroup (
+ id int default nextval('id'),
+ partsgroup text
+);
+--
diff --git a/sql-ledger/sql/Pg-upgrade-1.2.6-1.2.7.sql b/sql-ledger/sql/Pg-upgrade-1.2.6-1.2.7.sql
new file mode 100644
index 000000000..159f31b3e
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.2.6-1.2.7.sql
@@ -0,0 +1,4 @@
+--
+-- add the field shiptoemail to the customer table
+--
+alter table customer add column shiptoemail text;
diff --git a/sql-ledger/sql/Pg-upgrade-1.2.7-1.4.0.sql b/sql-ledger/sql/Pg-upgrade-1.2.7-1.4.0.sql
new file mode 100644
index 000000000..04e1a7943
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.2.7-1.4.0.sql
@@ -0,0 +1,173 @@
+--
+CREATE TABLE newap (
+ id int DEFAULT nextval ( 'id' ),
+ invnumber text,
+ transdate date DEFAULT current_date,
+ vendor int,
+ taxincluded bool DEFAULT FALSE,
+ amount float,
+ netamount float,
+ paid float,
+ datepaid date,
+ duedate date,
+ invoice bool DEFAULT FALSE,
+ ordnumber text
+);
+--
+INSERT INTO newap (id, invnumber, transdate, vendor, amount, netamount, paid,
+datepaid, duedate, invoice, ordnumber)
+SELECT id, invnumber, transdate, vendor, amount, netamount, paid,
+datepaid, duedate, invoice, ordnumber
+FROM ap;
+--
+DROP TABLE ap;
+ALTER TABLE newap RENAME TO ap;
+--
+CREATE TABLE newar (
+ id int DEFAULT nextval ( 'id' ),
+ invnumber text,
+ transdate date DEFAULT current_date,
+ customer int,
+ taxincluded bool DEFAULT FALSE,
+ amount float,
+ netamount float,
+ paid float,
+ datepaid date,
+ duedate date,
+ invoice bool DEFAULT FALSE,
+ shippingpoint text,
+ terms int2,
+ notes text
+);
+--
+INSERT INTO newar (id, invnumber, transdate, customer, amount, netamount, paid,
+datepaid, duedate, invoice, shippingpoint, terms, notes)
+SELECT id, invnumber, transdate, customer, amount, netamount, paid,
+datepaid, duedate, invoice, shippingpoint, terms, notes
+FROM ar;
+--
+DROP TABLE ar;
+ALTER TABLE newar RENAME TO ar;
+--
+CREATE TABLE newcustomer (
+ id int DEFAULT nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ ytd float,
+ discount float4,
+ taxincluded bool,
+ creditlimit float,
+ terms int2,
+ shiptoname varchar(35),
+ shiptoaddr1 varchar(35),
+ shiptoaddr2 varchar(35),
+ shiptoaddr3 varchar(35),
+ shiptocontact varchar(20),
+ shiptophone varchar(20),
+ shiptofax varchar(20),
+ shiptoemail text
+);
+INSERT INTO newcustomer (
+id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, ytd,
+discount, creditlimit, terms, shiptoname, shiptoaddr1, shiptoaddr2,
+shiptoaddr3, shiptocontact, shiptophone, shiptofax, shiptoemail )
+SELECT id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, ytd,
+discount, creditlimit, terms, shiptoname, shiptoaddr1, shiptoaddr2,
+shiptoaddr3, shiptocontact, shiptophone, shiptofax, shiptoemail
+FROM customer;
+--
+DROP TABLE customer;
+ALTER TABLE newcustomer RENAME TO customer;
+--
+CREATE TABLE customertax (
+ customer_id int,
+ chart_id int
+);
+--
+CREATE TABLE newdefaults (
+ inventory_accno int,
+ income_accno int,
+ expense_accno int,
+ invnumber text,
+ ponumber text,
+ yearend varchar(5),
+ nativecurr varchar(3),
+ weightunit varchar(5)
+);
+--
+INSERT INTO newdefaults (
+inventory_accno, income_accno, expense_accno, invnumber, ponumber)
+SELECT inventory_accno, income_accno, expense_accno, invnumber, ponumber
+FROM defaults;
+--
+DROP TABLE defaults;
+ALTER TABLE newdefaults RENAME TO defaults;
+UPDATE defaults SET yearend = '1/31', nativecurr = 'CAD', weightunit = 'kg';
+--
+CREATE TABLE partstax (
+ parts_id int,
+ chart_id int
+);
+--
+CREATE TABLE tax (
+ chart_id int,
+ rate float,
+ number text
+);
+--
+CREATE TABLE newvendor (
+ id int DEFAULT nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ ytd float,
+ discount float4,
+ taxincluded bool,
+ creditlimit float,
+ terms int2
+);
+--
+INSERT INTO newvendor (
+id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, ytd )
+SELECT id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, ytd
+FROM vendor;
+--
+DROP TABLE vendor;
+ALTER TABLE newvendor RENAME TO vendor;
+--
+CREATE TABLE vendortax (
+ vendor_id int,
+ chart_id int
+);
+--
+ALTER TABLE chart RENAME TO oldchart;
+--
+CREATE TABLE chart (
+ id int DEFAULT nextval( 'id' ),
+ accno int UNIQUE,
+ description text,
+ balance float,
+ type char(1),
+ gifi int,
+ category char(1),
+ link text
+);
+--
+INSERT INTO chart SELECT * FROM oldchart;
+--
+DROP TABLE oldchart;
+--
+
diff --git a/sql-ledger/sql/Pg-upgrade-1.4.0-1.6.0.sql b/sql-ledger/sql/Pg-upgrade-1.4.0-1.6.0.sql
new file mode 100644
index 000000000..e0a389246
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.4.0-1.6.0.sql
@@ -0,0 +1,126 @@
+alter table acc_trans rename column accno to chart_id;
+update acc_trans set chart_id =
+ (select id from chart where accno = acc_trans.chart_id);
+--
+alter table parts rename column inventory_accno to inventory_accno_id;
+alter table parts rename column income_accno to income_accno_id;
+alter table parts rename column expense_accno to expense_accno_id;
+alter table parts rename column number to partnumber;
+update parts set inventory_accno_id =
+ (select id from chart where chart.accno = parts.inventory_accno_id);
+update parts set income_accno_id =
+ (select id from chart where chart.accno = parts.income_accno_id);
+update parts set expense_accno_id =
+ (select id from chart where chart.accno = parts.expense_accno_id);
+--
+create table assembly (id int, parts_id int, qty float);
+--
+alter table defaults rename column inventory_accno to inventory_accno_id;
+alter table defaults rename column income_accno to income_accno_id;
+alter table defaults rename column expense_accno to expense_accno_id;
+alter table defaults add column businessnumber text;
+alter table defaults add column version varchar(8);
+update defaults set inventory_accno_id =
+ (select id from chart where chart.accno = defaults.inventory_accno_id);
+update defaults set income_accno_id =
+ (select id from chart where chart.accno = defaults.income_accno_id);
+update defaults set expense_accno_id =
+ (select id from chart where chart.accno = defaults.expense_accno_id);
+update defaults set version = '1.6.0';
+--
+alter table invoice rename column inventory_accno to inventory_accno_id;
+alter table invoice rename column income_accno to income_accno_id;
+alter table invoice rename column expense_accno to expense_accno_id;
+alter table invoice rename column number to partnumber;
+alter table invoice add column assemblyitem bool;
+update invoice set assemblyitem = 'f';
+update invoice set inventory_accno_id =
+ (select id from chart where invoice.inventory_accno_id = chart.accno);
+update invoice set income_accno_id =
+ (select id from chart where invoice.income_accno_id = chart.accno);
+update invoice set expense_accno_id =
+ (select id from chart where invoice.expense_accno_id = chart.accno);
+--
+alter table gl rename column comment to description;
+--
+create table newvendor (
+ id int default nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ terms int2,
+ taxincluded bool
+);
+insert into newvendor (
+ id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, terms,
+ taxincluded)
+ select
+ id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, terms,
+ taxincluded from vendor;
+drop table vendor;
+alter table newvendor rename to vendor;
+--
+create table newcustomer (
+ id int default nextval ( 'id' ),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ discount float4,
+ taxincluded bool,
+ creditlimit float,
+ terms int2,
+ shiptoname varchar(35),
+ shiptoaddr1 varchar(35),
+ shiptoaddr2 varchar(35),
+ shiptoaddr3 varchar(35),
+ shiptoaddr4 varchar(35),
+ shiptocontact varchar(20),
+ shiptophone varchar(20),
+ shiptofax varchar(20),
+ shiptoemail text
+);
+insert into newcustomer (
+ id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, discount,
+ taxincluded, creditlimit, terms, shiptoname, shiptoaddr1, shiptoaddr2,
+ shiptoaddr3, shiptocontact, shiptophone, shiptofax, shiptoemail
+ )
+ select
+ id, name, addr1, addr2, addr3, contact, phone, fax, email, notes, discount,
+ taxincluded, creditlimit, terms, shiptoname, shiptoaddr1, shiptoaddr2,
+ shiptoaddr3, shiptocontact, shiptophone, shiptofax, shiptoemail
+ from customer;
+drop table customer;
+alter table newcustomer rename to customer;
+--
+drop index chart_accno_key;
+alter table chart rename to oldchart;
+create table chart (
+ id int default nextval('id'),
+ accno int unique,
+ description text,
+ charttype char(1),
+ gifi int,
+ category char(1),
+ link text
+);
+insert into chart (id, accno, description, charttype, gifi, category, link)
+ select id, accno, description, type, gifi, category, link from oldchart;
+drop table oldchart;
+--
+alter table tax rename column number to taxnumber;
+--
+-- apply
diff --git a/sql-ledger/sql/Pg-upgrade-1.6.0-1.8.0.sql b/sql-ledger/sql/Pg-upgrade-1.6.0-1.8.0.sql
new file mode 100644
index 000000000..4e98e1fe4
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.6.0-1.8.0.sql
@@ -0,0 +1,104 @@
+--
+create table def (
+ inventory_accno_id int,
+ income_accno_id int,
+ expense_accno_id int,
+ fxgain_accno_id int,
+ fxloss_accno_id int,
+ invnumber text,
+ ordnumber text,
+ yearend varchar(5),
+ weightunit varchar(5),
+ businessnumber text,
+ version varchar(8),
+ curr text
+);
+insert into def (inventory_accno_id, income_accno_id, expense_accno_id, invnumber, ordnumber, yearend, weightunit, businessnumber, version, curr) select inventory_accno_id, income_accno_id, expense_accno_id, invnumber, ponumber, yearend, weightunit, businessnumber, version, nativecurr from defaults;
+drop table defaults;
+alter table def rename to defaults;
+update defaults set version = '1.8.0';
+--
+-- create a default accno for exchange rate gain and loss
+--
+select accno into temp from chart where category = 'I' order by accno desc limit 1;
+update temp set accno = accno + 1;
+insert into chart (accno) select accno from temp;
+update chart set description = 'Foreign Exchange Gain', category = 'I', charttype = 'A' where accno = (select accno from temp);
+update defaults set fxgain_accno_id = (select id from chart where chart.accno = temp.accno);
+drop table temp;
+select accno into temp from chart where category = 'E' order by accno desc limit 1;
+update temp set accno = accno + 1;
+insert into chart (accno) select accno from temp;
+update chart set description = 'Foreign Exchange Loss', category = 'E', charttype = 'A' where accno = (select accno from temp);
+update defaults set fxloss_accno_id = (select id from chart where chart.accno = temp.accno);
+drop table temp;
+--
+alter table parts add column bin text;
+alter table parts alter column onhand set default 0;
+update parts set onhand = 0 where onhand = NULL;
+alter table parts add column obsolete bool;
+alter table parts alter column obsolete set default 'f';
+update parts set obsolete = 'f';
+--
+alter table ap rename column vendor to vendor_id;
+alter table ap add column curr char(3);
+--
+alter table ar rename column customer to customer_id;
+alter table ar add column curr char(3);
+alter table ar add column ordnumber text;
+--
+alter table acc_trans add column source text;
+alter table acc_trans add column cleared bool;
+alter table acc_trans alter column cleared set default 'f';
+alter table acc_trans add column fx_transaction bool;
+alter table acc_trans alter column fx_transaction set default 'f';
+update acc_trans set cleared = 'f', fx_transaction = 'f';
+--
+create table oe (
+ id int default nextval('id'),
+ ordnumber text,
+ transdate date default current_date,
+ vendor_id int,
+ customer_id int,
+ amount float8,
+ netamount float8,
+ reqdate date,
+ taxincluded bool,
+ shippingpoint text,
+ notes text,
+ curr char(3)
+);
+--
+create table orderitems (
+ trans_id int,
+ parts_id int,
+ description text,
+ qty float4,
+ sellprice float8,
+ discount float4
+);
+--
+alter table invoice rename to invoiceold;
+create table invoice (
+ id int default nextval('id'),
+ trans_id int,
+ parts_id int,
+ description text,
+ qty float4,
+ allocated float4,
+ sellprice float8,
+ fxsellprice float8,
+ discount float4,
+ assemblyitem bool default 'f'
+);
+insert into invoice (id, trans_id, parts_id, description, qty, allocated, sellprice, fxsellprice, discount, assemblyitem) select id, trans_id, parts_id, description, qty, allocated, sellprice, sellprice, discount, assemblyitem from invoiceold;
+update invoice set assemblyitem = 'f' where assemblyitem = NULL;
+drop table invoiceold;
+--
+create table exchangerate (
+ curr char(3),
+ transdate date,
+ buy float8,
+ sell float8
+);
+--
diff --git a/sql-ledger/sql/Pg-upgrade-1.8.0-1.8.4.sql b/sql-ledger/sql/Pg-upgrade-1.8.0-1.8.4.sql
new file mode 100644
index 000000000..57b24f1f3
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.8.0-1.8.4.sql
@@ -0,0 +1,21 @@
+--
+alter table chart add column gifi_accno text;
+--
+create table gifi (accno text, description text);
+create unique index gifi_accno_key on gifi (accno);
+--
+create table mtemp (parts_id int, name text);
+insert into mtemp select parts_id, name from makemodel;
+drop table makemodel;
+alter table mtemp rename to makemodel;
+--
+alter table defaults add column closedto date;
+alter table defaults add column revtrans bool;
+--
+alter table ap add column notes text;
+--
+alter table customer add column businessnumber text;
+alter table vendor add column businessnumber text;
+--
+update defaults set version = '1.8.4', revtrans = 'f';
+--
diff --git a/sql-ledger/sql/Pg-upgrade-1.8.4-1.8.5.sql b/sql-ledger/sql/Pg-upgrade-1.8.4-1.8.5.sql
new file mode 100644
index 000000000..807857aa1
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.8.4-1.8.5.sql
@@ -0,0 +1,63 @@
+--
+alter table customer rename column businessnumber to customernumber;
+create index customer_customernumber_key on customer (customernumber);
+alter table vendor rename column businessnumber to vendornumber;
+create index vendor_vendornumber_key on vendor (vendornumber);
+--
+CREATE TABLE employee (
+ id int DEFAULT nextval ('id'),
+ login text,
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ workphone varchar(20),
+ homephone varchar(20),
+ startdate date default current_date,
+ enddate date,
+ notes text
+);
+--
+create index employee_id_key on employee (id);
+create unique index employee_login_key on employee (login);
+create index employee_name_key on employee (name);
+--
+alter table gl add column employee_id int;
+create index gl_employee_id_key on gl (employee_id);
+alter table ar add column employee_id int;
+create index ar_employee_id_key on ar (employee_id);
+alter table ap add column employee_id int;
+create index ap_employee_id_key on ap (employee_id);
+alter table oe add column employee_id int;
+create index oe_employee_id_key on oe (employee_id);
+--
+alter table invoice add column unit varchar(5);
+alter table orderitems add column unit varchar(5);
+--
+update chart set gifi_accno = '' where gifi_accno = NULL;
+alter table chart rename to chartold;
+CREATE TABLE chart (
+ id int DEFAULT nextval ('id'),
+ accno text NOT NULL,
+ description text,
+ charttype char(1) DEFAULT 'A',
+ category char(1),
+ link text,
+ gifi_accno text
+);
+insert into chart (id, accno, description, charttype, category, link, gifi_accno) select id, accno, description, charttype, category, link, gifi_accno from chartold;
+drop table chartold;
+create index chart_id_key on chart (id);
+create unique index chart_accno_key on chart (accno);
+create index chart_category_key on chart (category);
+create index chart_link_key on chart (link);
+create index chart_gifi_accno_key on chart (gifi_accno);
+--
+alter table parts alter column inventory_accno_id drop default;
+--
+alter table defaults rename ordnumber to sonumber;
+alter table defaults add column ponumber text;
+--
+update defaults set version = '1.8.5', ponumber = sonumber;
+--
diff --git a/sql-ledger/sql/Pg-upgrade-1.8.5-2.0.0.sql b/sql-ledger/sql/Pg-upgrade-1.8.5-2.0.0.sql
new file mode 100644
index 000000000..ebc1d0702
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-1.8.5-2.0.0.sql
@@ -0,0 +1,92 @@
+--
+alter table customer add column cc text;
+alter table customer add column bcc text;
+--
+alter table vendor add column cc text;
+alter table vendor add column bcc text;
+--
+create table shipto (
+ trans_id int,
+ shiptoname varchar(35),
+ shiptoaddr1 varchar(35),
+ shiptoaddr2 varchar(35),
+ shiptoaddr3 varchar(35),
+ shiptoaddr4 varchar(35),
+ shiptocontact varchar(35),
+ shiptophone varchar(20),
+ shiptofax varchar(20),
+ shiptoemail text
+);
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail from customer where shiptoname != '' or shiptoname is not null;
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (a.id) a.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, ar a where a.customer_id = c.id;
+--
+insert into shipto (trans_id, shiptoname, shiptoaddr1, shiptoaddr2, shiptoaddr3, shiptoaddr4, shiptocontact, shiptophone, shiptofax, shiptoemail) select distinct on (o.id) o.id, c.shiptoname, c.shiptoaddr1, c.shiptoaddr2, c.shiptoaddr3, c.shiptoaddr4, c.shiptocontact, c.shiptophone, c.shiptofax, c.shiptoemail from customer c, oe o where o.customer_id = c.id;
+--
+create index shipto_trans_id_key on shipto (trans_id);
+--
+create table custome (
+ id int default nextval('id'),
+ name varchar(35),
+ addr1 varchar(35),
+ addr2 varchar(35),
+ addr3 varchar(35),
+ addr4 varchar(35),
+ contact varchar(35),
+ phone varchar(20),
+ fax varchar(20),
+ email text,
+ notes text,
+ discount float4,
+ taxincluded bool,
+ creditlimit float DEFAULT 0,
+ terms int2 DEFAULT 0,
+ customernumber text,
+ cc text,
+ bcc text
+);
+insert into custome (id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber) select id, name, addr1, addr2, addr3, addr4, contact, phone, fax, email, notes, discount, taxincluded, creditlimit, terms, customernumber from customer;
+--
+drop table customer;
+alter table custome rename to customer;
+create index customer_id_key on customer (id);
+create index customer_name_key on customer (name);
+create index customer_contact_key on customer (contact);
+--
+alter table parts add column bom boolean;
+alter table parts alter column bom set default 'f';
+update parts set bom = 'f';
+update parts set bom = 't' where assembly;
+alter table parts add column image text;
+alter table parts add column drawing text;
+alter table parts add column microfiche text;
+--
+alter table gl add column notes text;
+--
+alter table oe add column closed bool;
+alter table oe alter column closed set default 'f';
+update oe set closed = 'f';
+--
+create table project (
+ id int default nextval('id'),
+ projectnumber text,
+ description text
+);
+--
+create index project_id_key on project (id);
+--
+alter table acc_trans add column project_id int;
+update acc_trans set cleared = '0' where cleared = '1';
+--
+alter table invoice add column project_id int;
+alter table invoice add column deliverydate date;
+alter table orderitems add column project_id int;
+alter table orderitems add column reqdate date;
+--
+alter table gl rename source to reference;
+create index gl_reference_key on gl (reference);
+create index acc_trans_source_key on acc_trans (lower(source));
+--
+update defaults set version = '2.0.0';
+--
diff --git a/sql-ledger/sql/Pg-upgrade-2.0.0-2.0.8.sql b/sql-ledger/sql/Pg-upgrade-2.0.0-2.0.8.sql
new file mode 100644
index 000000000..ef73b1cb5
--- /dev/null
+++ b/sql-ledger/sql/Pg-upgrade-2.0.0-2.0.8.sql
@@ -0,0 +1,12 @@
+--
+create table partsgroup (id int default nextval('id'), partsgroup text);
+create index partsgroup_id_key on partsgroup (id);
+--
+alter table parts add partsgroup_id int;
+--
+alter table assembly add bom bool;
+update assembly set bom = '0' where assembly.id = parts.id and parts.bom = '0';
+update assembly set bom = '1' where assembly.id = parts.id and parts.bom = '1';
+--
+update defaults set version = '2.0.8';
+--
diff --git a/sql-ledger/sql/Poland-chart.sql b/sql-ledger/sql/Poland-chart.sql
new file mode 100644
index 000000000..64960cae0
--- /dev/null
+++ b/sql-ledger/sql/Poland-chart.sql
@@ -0,0 +1,337 @@
+-- Chart of Account for Poland
+-- From: Peter Dabrowski <meritage@mail.com>
+-- Sun, 23 March 2003
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('000000000','Aktywa Trwa³e','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001000000','¦rodki Trwa³e','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001010000','Grunty w³asne i prawa wieczystego u¿ytkowania gruntów','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001020000','Budynki, locale i obiekty in¿ynierii l±dowej i wodnej','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001030000','Urz±dzenia techniczne i maszyny','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001040000','¦rodki transportu','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('001050000','Inne ¶rodki trwa³e','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('002000000','Warto¶ci niematerialne i prawne','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('002010000','Koszty zakoñczonych prac rozwojowych','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('002020000','Nabyta warto¶æ firmy','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('002080000','Inne warto¶ci niematerialne i prawne','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('002090000','Zaliczki na warto¶ci niematerialne i prawne','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003000000','D³ugoterminowe aktywa finansowe','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003010000','W jednostkach powi±zanych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003010100','Udzia³y lub akcje','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003010200','Inne papiery warto¶ciowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003010300','Udzielone porzyczki','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003010400','Inne d³ugoterminowe aktywa finansowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003020000','W pozosta³ych jednostkach','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003020100','Udzia³y lub akcje','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003020200','Inne papiery warto¶ciowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003020300','Udzielone po¿yczki','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003020400','Inne d³ugoterminowe aktywa finansowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003090000','Inne investycje d³ugoterminowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('003090100','Inne rodzaje d³ugoterminowych aktywów finansowych','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('004000000','Investycje w nieruchomo¶ci i prawa','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('004010000','Nieruchomo¶ci','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('004020000','Warto¶ci niematerialne i prawne','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('005000000','D³ugoterminowe rozliczenia miêdzyokresowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('005010000','Aktywa z tytu³u odroczonego podatku dochodowego','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('005020000','Inne rozliczenia miêdzyokresowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('006000000','Nale¿no¶ci d³ugoterminowe','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('006010000','Od jednostek powi±zanych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('006020000','Od pozosta³ych jednostek','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007000000','Odpisy umorzeniowe ¶rodków trwa³ych oraz warto¶ci niematerialnych i prawnych','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007010000','Odpisy umorzeniowe warto¶ci gruntów i prawa wieczystego u¿ytkowania gruntów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007020000','Odpisy umorzeniowe budynków, lokali i obiektów in¿ynierii l±dowej i wodnej','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007030000','Odpisy umorzeniowe urz±dzeñ technicznych i maszyn','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007040000','Odpisy umorzeniowe ¶rodków transportu','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007050000','Odpisy umorzeniowe ulepszeñ obcych ¶rodków trwa³ych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('007090000','Odpisy umorzeniowe innych ¶rodków trwa³ych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008000000','¦rodki trwa³e w budowie','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008010000','Inwestycje budowy ¶rodka trwa³ego','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008020000','Ulepszenia ¶rodka trwa³ego','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008030000','Nak³ady na budowê ¶rodka trwa³ego','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008040000','Zaliczki na ¶rodki trwa³e w budowie','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('008050000','Ulepszenia obcych ¶rodków trwa³ych','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('009000000','Odpisy aktualizuj±ce d³ugoterminowe aktywa finansowe','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('009010000','Odpisy aktualizuj±ce udzia³y i akcje w obcych jednostkach','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('009020000','Odpisy aktualizuj±ce lokaty','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('009030000','Odpisy aktualizuj±ce udzielone porzyczki d³ugoterminowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('009090000','Odpisy aktualizuj±ce inne rodzaje d³ugoterminowych aktywów finansowych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('100000000','¦rodki pieniê¿ne, rachunki bankowe oraz inne krótkoterminowe aktywa finansowe','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('110000000','¦rodki pieniê¿ne w kasie','A','','A','AR:AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('110010000','Kasa krajowych ¶rodków pieniê¿nych','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('110020000','Kasa zagranicznych ¶rodków pieniê¿nych','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('113000000','Rachunki i kredyty bankowe','A','','A','AR:AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('113010000','Rachunek bie¿±cy','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('113020000','Rachunek ¶rodków wyodrêbnionych i zablokowanych','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('113030000','Rachunki kredytów bankowych','A','','A','AR_paid:AP_amount:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('113040000','Rachunek ¶rodków walutowych','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114000000','Krótkoterminowe aktywa finansowe','A','','A','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114010000','Krótkoterminowe aktywa finansowe w jednostkach powi±zanych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114010100','Udzia³y lub akcje','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114010200','Inne papiery warto¶ciowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114010300','Udzielone po¿yczki','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114010400','Inne krótkoterminowe aktywa finansowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114020000','Krótkoterminowe aktywa finansowe w pozosta³ych jednostkach','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114020100','Udzia³y lub akcje','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114020200','Inne papiery warto¶ciowe','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('114020400','Inne krótkoterminowe aktywa finansowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('115000000','Inne ¶rodki pieniê¿ne','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('116000000','Inne aktywa pieniê¿ne','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('117000000','Inne inwestycje krótkoterminowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('118000000','Krótkoterminowe rozliczenia miêdzyokresowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('200000000','Rozrachunki i roszczenia','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220000000','Nale¿no¶ci krótkoterminowe','A','','L','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010000','Nale¿no¶ci od jednostek powi±zanych','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010100','Nale¿no¶ci z tytu³u dostaw i us³ug','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010110','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty do 12 miesiêcy','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010120','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty powy¿ej 12 miesiêcy','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010200','Inne nale¿no¶ci','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010210','Zobowi±zania z tytu³u pokrycia kosztów ogólnego zarz±du','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220010220','Zobowi±zania z tytu³u rozliczeñ VAT','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221010000','Nale¿no¶ci od pozosta³ych jednostek','A','','L','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020100','Nale¿no¶ci z tytu³u dostaw i us³ug','A','','L','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020110','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty do 12 miesiêcy','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020120','Nale¿no¶ci z tytu³u dostaw i us³ug, o okresie sp³aty powy¿ej 12 miesiêcy','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020200','Nale¿no¶ci z tytu³u podatków, dotacji, ce³, ubezpieczeñ spo³ecznych i zdrowotnych oraz innych ¶wiadczeñ','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020300','Zaliczki przekazane dostawcom','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020400','Nale¿no¶ci dochodzone na drodze s±dowej','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('221020500','Inne nale¿no¶ci','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222000000','Zobowi±zania krótkoterminowe','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222010000','Zobowi±zania wobec jednostek powiazanych','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222010100','Zobowi±zania z tytu³u dostaw i us³ug','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222010200','Zobowi±zania o okresie wymagalno¶ci do 12 miesiêcy','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222010300','Zobowi±zania o okresie wymagalno¶ci powy¿ej 12 miesiêcy','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222010400','Inne zobowi±zania','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020000','Zobowi±zania wobec pozosta³ych jednostek','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020100','Kredyty i po¿yczki','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020200','Zobowi±zania z tytu³u emisji d³u¿nych papierów warto¶ciowych','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020300','Inne zobowi±zania finasowe','A','','L','AP_Amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020400','Zobowiazania z tytu³u dostaw i us³ug','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020500','Zobowi±zania o okresie wymagalno¶ci do 12 miesiêcy ','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020600','Zobowi±zania o okresie wymagalno¶ci powy¿ej 12 miesiêy','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020700','Zaliczki otrzmane na dostawy','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020800','Zobowi±zania wekslowe','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222020900','Zobowi±zania z tytu³u podatków, ce³, ubezpieczeñ i innych ¶wiadczeñ','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222021000','Zobowi±zania z tytu³u wynagrodzeñ','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('222021100','Inne zobowi±zania','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223000000','Rozrachunki publicznoprawne','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223010000','Rozrachunki z urzêdem skarbowym z tytu³u VAT','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223020000','Rozliczenie nale¿nego VAT','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223020100','Rozliczenie nale¿nego VAT-22%','A','','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223020200','Rozliczenie nale¿nego VAT-7%','A','','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223020300','Rozliczenie nale¿nego VAT-0%','A','','L','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223030000','Rozliczenie naliczonego VAT','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223030100','Rozliczenie naliczonego VAT-22%','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223030200','Rozliczenie naliczonego VAT-7%','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223030300','Rozliczenie naliczonego VAT-0%','A','','L','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223040000','Korekty naliczonego VAT','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223050000','Rozrachunki z Urzêdem Celnym','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223060000','Rozrachunki z Urzêdem Skarbowym z tytu³u znaków akcyzy','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223070000','Rozrachunki z Urzêdem Skarbowym z tytu³u podatku akcyzowego','A','','L','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223080000','Rozliczenie znaków akcyzy','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223090000','Rozrachunki z ZUS','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('223100000','Rozrachunki z Urzêdem Skarbowym z tytu³u podatku dochodowego od osób prawnych','A','','L','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('224000000','Rozrachunki z pracownikami','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('224010000','Rozrachunki z tytu³u wynagrodzeñ','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('224020000','Rozrachunki z tytu³u po¿yczek udzielonych pracownikom','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('224090000','Inne rozrachunki z pracownikami','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225000000','Zobowi±zania d³ugoterminowe','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225010000','Zobowi±zania wobec jednostek powi±zanych','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225010100','Zobowi±zania z tytu³u wyodrêbnienia sk³adników maj±tkowych','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225010200','Zobowi±zania z tytu³u podzia³u zysku','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020000','Zobowi±zania wobec pozosta³ych jednostek','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020100','Kredyty i po¿yczki otrzymane','A','','L','AR_amount:AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020200','Kredyty i po¿yczki udzielone','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020300','Zobowi±zania z tytu³u emisji d³u¿nych papierów warto¶ciowych','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020400','Inne zobowi±zania kredytowe','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225020500','Inne zobowi±zania','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225030000','Rozrachunki z tytu³u wp³at na kapita³ zak³adowy','A','','L','AR_amount:APamount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225040000','Rozrachunki z tytu³u wk³adów niepieniê¿nych na kapita³ zak³adowy','A','','L','AR_amount:AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225050000','Rozrachunki z tytu³u podwy¿szenia kapita³u ze ¶rodków w³asnych spó³ki','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225060000','Rozrachunki z tytu³u umorzenia udzia³ów w³asnych','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225070000','Rozrachunki z tytu³u dywident','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225080000','Rozrachunki z tytu³u dop³at i zwrotu dop³at','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('225090000','Pozosta³e rozrachunki ze wspólnikami','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('229000000','Odpisy aktualizuj±ce rozrachunki','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('300000000','Materia³y i towary','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330000000','Rozliczenie zakupu','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330010000','Rozliczenie warto¶ci materia³ów i towarów w drodze','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330020000','Warto¶ci dostaw niefakturowanych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330030000','Przychody wszelkich dostaw i us³ug i ich rozliczanie','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330040000','Odhylenia cen ewidencyjnych od rzeczywistych cen nabycia lub zakupu','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330050000','Koszty zakupu zawarte w fakturach dostawców','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330060000','Op³aty manipulacyjne policzone przez Urz±d Celny','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330070000','Niedobory, szkody i nadwy¿ki w transporcie','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330080000','Znaki akcyzy wed³ug dokumentu SAD','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330090000','Reklamacje faktur dostawców','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('331000000','Materia³y','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('331010000','Materia³y w magazynach w³asnych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('331020000','Materia³y w magazynach obcych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('331030000','Materia³y w przerobie','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('333000000','Towary','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('333010000','Towary w magazynach w³asnych','A','','A','IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('333020000','Towary w magazynach obcych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('333030000','Towary w detalu','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('334000000','Odchylenia od cen ewidencyjnych materia³ów i towarów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('334010000','Odpisy aktualizuj±ce warto¶æ materia³ów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('334020000','Odpisy aktualizuj±ce warto¶æ towarów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('400000000','Koszty wed³ug rodzajów i ich rozliczeñ','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440000000','Koszty wed³ug rodzajów','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440010000','Zu¿ycie materia³ów i energii','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440010100','Zu¿ycie materia³ów biurowych','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020000','Us³ugi obce','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020100','Us³ugi celne','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020200','Us³ugi telekomunikacyjne','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020300','Us³ugi pocztowe','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020400','Us³ugi kurierskie i transportowe','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020500','Analizy sanitarne','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440020600','Us³ugi graficzne i drukarskie','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440030000','Podatki i op³aty','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440030100','Op³aty i prowizje bankowe','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440030200','Op³aty s±dowe, prawnicze i notarialne','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440030300','Op³aty skarbowe','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440030400','Koncesje','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440040000','Wynagrodzenia za pracê','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('441000000','¦wiadczenia na rzecz pracowników','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('442000000','Amortyzacja','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('443000000','Pozosta³e','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('449000000','Rozliczenie kosztów','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('449010000','Nie podlegaj±ce rozliczeniu w czasie','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('449020000','Przypadaj±ce na przysz³e okresy','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('449030000','Koszty zgromadzone','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('449040000','Koszty nie wliczane do warto¶ci sprzeda¿y','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('500000000','Koszty wed³ug typów dzia³alno¶ci i ich rozliczenie','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550000000','Koszty dzia³alno¶ci podstawowej-produkcyjnej','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550010000','Rozliczone koszta dzia³alno¶ci','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550020000','Koszty nie zakoñczonych d³ugotrwa³ych us³ug','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550030000','Straty zwi±zane z wykonaniem d³ugotrwa³ych us³ug','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('552000000','Koszty dzia³alno¶ci podstawowej-handlowej','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('552010000','Koszty utrzymania punktów sprzeda¼y detalicznej','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550200000','Koszty utrzymania hurtowni','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('552030000','Koszty sprzeda¿y wyrobów','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('552040000','Podatek akcyzowy','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('552050000','Op³aty celne','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('553000000','Koszty dzia³alno¶ci pomocniczej','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('553010000','¦wiadczenia us³ug transportowych','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('555000000','Koszty zarz±du','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('555010000','Koszty zarz±dzania jednostk±','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('555020000','¦wiadczenia us³ug na potrzeby reprezentacji i reklamy','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('558000000','Rozliczenie kosztów dzia³alno¶ci','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('600000000','Produkty i rozliczenia miêdzyokresowe','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('660000000','Pó³produkty i produkty w toku','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('661000000','Produkty gotowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('661010000','Wyroby gotowe','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('661020000','Wyroby poza jednostk±','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('662000000','Odchylenia od cen ewidencyjnych produktów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('662010000','Odchylenia od cen evidencyjnych wyrobów gotowych','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('662020000','Odhylenia od cen evidencyjnych pó³fabrykatów','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('664000000','Rozliczenia miêdzyokresowe kosztów','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('664010000','Czynne rozliczenia miêdzyokresowe kosztów','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('664020000','Bierne rozliczenia miêdzyokresowe kosztów','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('665000000','Pozosta³e rozliczenia miêdzyokresowe','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('665010000','Czynne rozliczenia przysz³ych okresów','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('665020000','Bierne rozliczenia przysz³ych okresów','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('700000000','Przychody i koszty zwi±zane z ich osi±gniêciem','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770000000','Sprzeda¿ produktów','A','','I','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770010000','Sprzeda¿ produktów na kraj','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770020000','Sprzeda¿ produktów na eksport','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770030000','Sprzeda¿ us³ug na kraj','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770040000','Sprzeda¿ us³ug na eksport','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770100000','Koszty sprzedanych produktów','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770110000','Koszt w³asny sprzeda¿y produktów na kraj','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770120000','Koszt w³asny sprzeda¿y produktów na eksport','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770130000','Koszt w³asny sprzeda¿y us³ug na kraj','A','','E','IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770140000','Koszt w³asny sprzeda¿y us³ug na export','A','','E','IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773000000','Sprzeda¿ towarów','A','','I','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773010000','Sprzeda¿ hurtowa towarów','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773020000','Sprzeda¿ detaliczna towarów','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773030000','Sprzeda¿ wysy³kowa towarów','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773040000','Prowizja komisowa','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773100000','Warto¶æ sprzedanych towarów w cenach zakupu','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773110000','Warto¶æ sprzedanych towarów w sprzeda¿y hurtowej','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773120000','Warto¶æ sprzedanych towarów w sprzeda¿y detalicznej','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773130000','Warto¶æ sprzedanych towarów w sprzeda¿y wysy³kowej','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('773140000','Prowizja komisowa','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774000000','Sprzeda¿ materia³ów','A','','I','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774010000','Materia³y','A','','I','AP_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774020000','Opakowania','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774030000','Odpady','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774100000','Warto¶æ sprzedanych materia³ów','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774110000','Warto¶æ w cenach zakupu sprzedanych materia³ów','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774120000','Warto¶æ w cenach zakupu sprzedanych opakowañ','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('774130000','Warto¶æ w cenach zakupu sprzedanych odpadów','A','','E','IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775000000','Przychody finansowe','A','','I','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775010000','Kwoty nale¿ne ze sprzeda¿y aktywów finansowych','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775020000','Kwoty nale¿ne z tytu³u dywident','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775030000','Otrzymane odsetki','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775040000','Przychody ze zbycia investycji','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775050000','Aktualizacja warto¶ci investycji-przychody','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775060000','Dodatnie ró¿nice kursu walut','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775070000','Pozosta³e przychody finansowe','A','','I','AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775100000','Koszty finansowe','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775110000','Warto¶æ sprzedanych investycji','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775120000','Odpisy z tytu³u utraty warto¶ci investycji-koszty','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775130000','Odsetki zap³acone','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775140000','Ujemne ró¿nice kursu walut','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('775190000','Pozosta³e koszty finansowe','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776000000','Pozosta³e przychody operacyjne','A','','I','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776010000','Przychody ze zbycia niefinansowych aktywów trwa³ych','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776020000','Otrzymane dotacje','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776030000','Przychody z us³ug socjalnych','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776040000','Przychody ze wzrostu warto¶ci niefinansowych aktywów trwa³ych','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776090000','Inne pozosta³e przychody operacyjne','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776100000','Pozosta³e koszty operacyjne','A','','E','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776110000','Warto¶æ sprzedanych niefinansowych aktywów trwa³ych','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776120000','Dotacje przekazane','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776130000','Odpisy z tytu³u utraty warto¶ci aktywów niefinansowych','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('776140000','Inne pozosta³e koszty operacyjne','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('777000000','Zyski nadzwyczajne','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('777100000','Straty nadzwyczajne','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779000000','Obroty wewnêtrzne','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779010000','Koszt wyrobów w³asnej produkcji wydanych do w³asnych sklepów','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779020000','¦wiadczenia na rzecz ¶rodków trwa³ych w budowie','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779040000','Koszt niedoborów produktów','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779050000','Koszt zaniechania okre¶lonego rodzaju dzia³alno¶ci','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779100000','Koszt obrotów wewnêtrznych','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779110000','Koszt wytworzenia wyrobów gotowych wydanych do w³asnych sklepów','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779120000','Koszt wytworzenia ¶wiadczeñ na rzecz ¶rodków trwa³ych w budowie','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779130000','Koszt wytworzenia zakoñczonych prac rozwojowych','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779140000','Koszt wytworzenia produktów uznanych za niedobory','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('779150000','Koszt zaniechania okre¶lonego rodzaju dzia³alno¶ci','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('800000000','Kapita³y w³asne i wynik finansowy','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('880000000','Kapita³ podstawowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('880010000','Kapita³ zak³adowy','A','','Q','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('881000000','Fundusze wydzielone jednostkom zale¿nym','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('882000000','Nale¿ne wp³aty na kapita³ podstawowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('883000000','Fundusze wydzielone jednostkom zale¿nym','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('884000000','Kapita³ zapasowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('885000000','Kapita³ rezerwowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('886000000','Kapita³ z aktualizacji wyceny','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('887000000','Rozliczenia wyniku finansowego','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('888000000','Rezerwy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('888010000','Rezerwa z tytu³u odroczonego podatku dochodowego','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('888020000','Rezerwa na ¶wiadczenia','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('888020100','Rezerwa d³ugoterminowa na ¶wiadczenia emerytalne i podobne','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('888020200','Rezerwa krótkoterminowa na ¶wiadczenia emerytalne i podobne','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('889090000','Pozosta³e rezerwy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('889090100','Pozosta³e rezerwy d³ugoterminowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('889090200','Pozosta³e rezerwy krótkoterminowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('890000000','Rozliczenia miêdzyokresowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('890010000','Ujemna warto¶æ firmy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('890020000','Inne rozliczenia miêdzyokresowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('890020100','Inne rozliczenia miêdzyokresowe d³ugoterminowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('890020200','Inne rozliczenia miêdzyokresowe krótkoterminowe','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('891000000','Fundusze specjalne','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('892000000','Wynik finansowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('893000000','Odpisy z zysku netto w ci±gu roku obrotowego','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('893010000','Podatek dochodowy','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('893020000','Inne obowi±zkowe obci±¿enia wyniku finansowego','A','','Q','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223020100'),0.22);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223020200'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223020300'),0);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223030100'),0.22);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223030200'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '223030300'),0);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '333000000'), income_accno_id = (select id from chart where accno = '773010000'), expense_accno_id = (select id from chart where accno = '773110000'), fxgain_accno_id = (select id from chart where accno = '775060000'), fxloss_accno_id = (select id from chart where accno = '775140000'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'PLN:USD:EUR', weightunit = 'kg';
+--
+
+
diff --git a/sql-ledger/sql/Simplified_Chinese_Default-chart.sql b/sql-ledger/sql/Simplified_Chinese_Default-chart.sql
new file mode 100644
index 000000000..680adb88d
--- /dev/null
+++ b/sql-ledger/sql/Simplified_Chinese_Default-chart.sql
@@ -0,0 +1,78 @@
+-- Default chart of accounts -- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2190','Ó¦¸¶ËùµÃ˰','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','³¤ÆÚ¸ºÕ®','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','¹É·Ý×ʱ¾','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','±£ÁôÓ¯âÅ','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','ÏúÊÛÓ¯âÅ','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','ÚÑѯӯâÅ','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','ÆäËüÓ¯âÅ','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','»õÏú³É±¾','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','н×ÊÖ§³ö','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','ÈÕ³£¼°¹ÜÀíÖ§³ö','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','´ôÕʱ¸µÖ','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','Á÷¶¯×ʲú','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','×ʱ¾×ʲú','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','ÀÛ¼Æ·ÖÆÚ¸¶¿î - װ諼°É豸.','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','ÀÛ¼Æ·ÖÆÚ¸¶¿î - ÔËÊ乤¾ß','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','Á÷¶¯¸ºÕ®','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','ÒøÐнè¿î','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3600','Á÷¶¯Ó¯âÅ','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','Ó¦¸¶¹«Ë¾Ë°','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3590','±£ÁôÓ¯âÅ - È¥Äê¶È','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','ÆÕͨ¹É·Ý','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','´æ»õ×ʲú','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','¹ã¸æÐÐÏú','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','¹¤¾ß','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','°ì¹«ÓÃÆ·','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','ȨÀû½ð','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','»á¼Æ·¨Îñ','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','±£ÏÕ','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','·ÖÆÚÖ§³ö','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','»µÕÊ','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','ËùµÃ˰','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','ÀûÏ¢¼°ÒøÐÐÊÖÐø·Ñ','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','н×Ê','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','±£ÏÕÖ§³ö','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5430','ÍËÐݽðÖ§³ö','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5440','²¹³¥½ðÖ§³ö','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5470','Ô±¹¤¸£Àû','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','ÏúÊÛ / ÈíÌå','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','ÀûÏ¢','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','ÔË·Ñ','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','×â½ð','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','¿â´æ / ÈíÌå','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','¿â´æ / ¶þ¼¶Êг¡Áã¼þ','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','ÏúÊÛ / ¶þ¼¶Êг¡Áã¼þ','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','»õÏú³É±¾ / ÈíÌå','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','²É¹º','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','»õÏú³É±¾ / ¶þ¼¶Êг¡Áã¼þ','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','ÁãÓýð','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','°ì¹«ÊÒװ諼°É豸','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Â÷Ѽ°ÓéÀÖ','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','¹É¶«´û¿î','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5795','×¢²á·Ñ','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','µçÐÅ·Ñ','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5781','ÍøÂ·Á¬Ïß·Ñ','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','άÐÞ¹ÜÀí·Ñ','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2311','µØ·½Ë°','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','ÔËÏú·Ñ','A','','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','¿â´æ / Ó²Ìå','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','»õÏú³É±¾ / Ó²Ìå','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Ó¦¸¶ÕÊ¿î','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','ÔËÊ乤¾ß','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','³ÌʽÉè¼Æ','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','ÏúÊÛ / Ó²Ìå','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','ÚÑѯ','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Ó¦ÊÕÕÊ¿î','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1061','֧Ʊ»§Í·','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','ÉÌÆ··þÎñ˰','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+--
+-- exchange rate
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.08);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'CAD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Spain-chart.sql b/sql-ledger/sql/Spain-chart.sql
new file mode 100644
index 000000000..8c304a8b2
--- /dev/null
+++ b/sql-ledger/sql/Spain-chart.sql
@@ -0,0 +1,132 @@
+-- Chart of Accounts for Spain (Cuadro del Plan de Contabilidad español)
+-- From: Federico Montesino Pouzols <fedemp@arrok.com>
+-- 23 Apr 2002
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('099999999','Grupo 1: financiación básica','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('100000000','Capital','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('110000000','Reservas','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('120000000','Resultados pendientes de aplicación','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('130000000','Ingresos a distribuir en varios ejercicios','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('140000000','Provisiones para riesgos y gastos','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('150000000','Empréstitos y otras emisiones análogas','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('160000000','Deudas a largo plazo con empresas del grupo y asociadas','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('170000000','Deudas a largo plazo por prestamos recibidos y otros conceptos','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('180000000','Fianzas y depósitos recibidos a largo plazo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('190000000','Situaciones transitorias de financiación','A','','A','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('199999999','Grupo 2: inmovilizado','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('200000000','Gastos de establecimiento','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('210000000','Inmovilizaciones inmateriales','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('220000000','Inmovilizaciones materiales','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('230000000','Inmovilizaciones materiales en curso','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('240000000','Inversiones financieras en empresas del grupo y asociadas','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('250000000','Otras inversiones financieras permanentes','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('260000000','Fianzas y depósitos constituidos a largo plazo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('270000000','Gastos a distribuir en varios ejercicios','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('280000000','Amortización acumulada del inmovilizado','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('290000000','Provisiones de inmovilizado','A','','A','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('299999999','Grupo 3: existencias','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('300000000','Comerciales','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('310000000','Materias primas','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('320000000','Otros aprovisionamientos','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('330000000','Productos en curso','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('340000000','Productos semiterminados','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('350000000','Productos terminados','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('360000000','Subproductos, residuos y materiales recuperados','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('390000000','Provisiones por depreciación de existencias','A','','A','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('399999999','Grupo 4: acreedores y deudores por operaciones de tráfico','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('400000000','Proveedores','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('410000000','Acreedores varios','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('430000000','Clientes','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('431000000','Clientes, efectos comerciales a cobrar','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('440000000','Deudores varios','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('460000000','Personal','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('470000000','Administraciones públicas','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('472000000','Hacienda Pública, IVA soportado','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('472000001','IVA soportado 4%','A','','P','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('472000002','IVA soportado 7%','A','','P','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('472000003','IVA soportado 16%','A','','P','AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('475100000','Hacienda Pública, acreedor por retenciones practicadas','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('473000000','Hacienda Pública, retenciones y pagos a cuenta','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('477000000','Hacienda Pública, IVA repercutido','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('477000001','IVA repercutido 4%','A','','P','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('477000002','IVA repercutido 7%','A','','P','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('477000003','IVA repercutido 16%','A','','P','AR_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('480000000','Ajustes por periodificación','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('490000000','Provisiones por operaciones de tráfico','A','','P','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('499999999','Grupo 5: cuentas financieras','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('500000000','Empréstitos y otras emisiones análogas a corto plazo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('510000000','Deudas a corto plazo con empresas del grupo y asociadas','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('520000000','Deudas a corto plazo por préstamos recibidos y otros conceptos','A','','P','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('530000000','Inversiones financieras a corto plazo en empresas del grupo y asociadas','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('540000000','Otras inversiones financieras temporales','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('550000000','Otras cuentas no bancarias','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('560000000','Fianzas y depósitos recibidos y constituidos a corto plazo','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('569000000','Tesorería','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('570000000','Caja, euros','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('571000000','Caja, moneda extranjera','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('572000000','Bancos e instituciones de crédito, c/c. vista, euros','A','','A','AR_paid:AP_paid:AP_amount:AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('573000000','Bancos e instituciones de crédito, c/c. vista, moneda extranjera','A','','A','AR_paid:AP_paid:AP_amount:AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('574000000','Bancos e instituciones de crédito, cuentas de ahorro, euros','A','','A','AR_paid:AP_paid:AP_amount:AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('575000000','Bancos e instituciones de crédito, cuentas de ahorro, moneda extranjera','A','','A','AR_paid:AP_paid:AP_amount:AR_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('580000000','Ajustes por periodificación','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('590000000','Provisiones financieras','A','','P','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('599999999','Grupo 6: compras y gastos','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('600000000','Compras','A','','E','AP:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('608000000','Devoluciones de compras y operaciones similares','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('610000000','Variación de existencias','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('620000000','Servicios exteriores','A','','E','IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('630000000','Tributos','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('640000000','Gastos de personal','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('650000000','Otros gastos de gestión','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('660000000','Gastos financieros','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('665000000','Descuentos sobre ventas por pronto pago','A','','E','IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('668000000','Diferencias negativas de cambio','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('670000000','Pérdidas procedentes del inmovilizado y gastos excepcionales','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('680000000','Dotaciones para amortizaciones','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('690000000','Dotaciones a las provisiones','A','','E','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('699999999','Grupo 7: ventas e ingresos','H','','','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('700000000','Ventas de mercaderías, de producción propia, de servicios, etc.','A','','I','AR:IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('708000000','Devoluciones de ventas y operaciones similares','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('710000000','Variación de existencias','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('730000000','Trabajos realizados para la empresa','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('740000000','Subvenciones a la explotación','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('750000000','Otros ingresos de gestión','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('760000000','Ingresos financieros','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('765000000','Descuentos sobre compras por pronto pago','A','','I','IC_sale:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('768000000','Diferencias positivas de cambio','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('770000000','Beneficios procedentes de inmovilizados e ingresos excepcionales','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('790000000','Excesos y aplicaciones de provisiones','A','','I','');
+--
+-- Taxes in Spain
+--
+-- IVA: 4, 7 or 16%
+-- IVA soportado
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000000'), 0.0);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000001'), 0.04);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000002'), 0.07);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000003'), 0.16);
+-- Recargo equivalente: 0.5, 1 or 4%
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000004'), 0.005);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000005'), 0.01);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '472000006'), 0.04);
+--
+-- IVA repercutido
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000000'), 0.0);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000001'), 0.04);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000002'), 0.07);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000003'), 0.16);
+-- Recargo equivalente: 0.5, 1 or 4%
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000004'), 0.005);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000005'), 0.01);
+INSERT INTO "tax" ("chart_id", "rate") VALUES ((SELECT id FROM chart WHERE accno = '477000006'), 0.04);
+--
+-- update defaults
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '300000000'), income_accno_id = (select id from chart where accno = '700000000'), expense_accno_id = (select id from chart where accno = '600000000'), fxgain_accno_id = (select id from chart where accno = '768000000'), fxloss_accno_id = (select id from chart where accno = '668000000'), invnumber = 'F00000000', sonumber = '100000000', ponumber = '100000000', yearend = '31/12', curr = 'EUR', weightunit = 'Kg', businessnumber = '';
+--
diff --git a/sql-ledger/sql/Swiss-German-chart.sql b/sql-ledger/sql/Swiss-German-chart.sql
new file mode 100644
index 000000000..75959efd2
--- /dev/null
+++ b/sql-ledger/sql/Swiss-German-chart.sql
@@ -0,0 +1,160 @@
+-- Swiss chart of accounts
+-- adapted to numeric representation of chart no.
+--
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('10000','AKTIVEN','H','1','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11000','UMLAUFSVERMÖGEN','H','10000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11100','Flüssige Mittel','H','11000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11102','Bank CS Kt. 177929-11','A','11100','A','AR_paid:AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11110','Forderungen','H','11000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11120','Vorräte und angefangene Arbeiten','H','11000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11128','Angefangene Arbeiten','A','11120','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11130','Aktive Rechnungsabgrenzung','A','11000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('14000','ANLAGEVERMÖGEN','H','10000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('18000','AKTIVIERTER AUFWAND UND AKTIVE BERICHTIGUNGSPOSTEN','H','10000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('18182','Entwicklungsaufwand','A','18000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('20000','PASSIVEN','H','2','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21000','FREMDKAPITAL KURZFRISTIG','H','20000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21200','Kurzfristige Verbindlichkeiten aus Lieferungen und Leistungen','H','21000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21201','Lieferanten','A','21200','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21202','Personalaufwand','A','21200','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21203','Sozialversicherungen','A','21200','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21205','Leasing','A','21200','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21210','Kurzfristige Finanzverbindlichkeiten','H','21000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21220','Andere kurzfristige Verbindlichkeiten','H','21000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21222','MWST (3,6)','A','21220','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21229','Gewinnausschüttung','A','21220','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21230','Passive Rechnungsabgrenzung, kurzfristige Rückstellungen','H','21000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21235','Rückstellungen','A','21230','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('24000','FREMDKAPITAL LANGFRISTIG','H','20000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('24256','Gesellschafter','A','24000','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28000','EIGENKAPITAL','H','20000','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28280','Stammkapital','A','28000','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28290','Reserven, Bilanzgewinn','H','28000','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28291','Reserven','A','28290','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28295','Gewinnvortrag','A','28290','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('28296','Jahresgewinn','A','28290','Q','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('30000','BETRIEBSERTRAG AUS LIEFERUNGEN UND LEISTUNGEN','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('31000','PRODUKTIONSERTRAG','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('31001','Computer','A','31000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('31005','Übrige Produkte','A','31000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('32000','HANDELSERTRAG','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('32001','Hardware','A','32000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('32002','Software OSS','A','32000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('32003','Software kommerz.','A','32000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('32005','Übrige','A','32000','I','AR_amount:IC_sale');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('34000','DIENSTLEISTUNGSERTRAG','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('34001','Beratung','A','34000','I','AR_amount:IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('34002','Installation','A','34000','I','AR_amount:IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36000','ÜBRIGER ERTRAG','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('37000','EIGENLEISTUNGEN UND EIGENVERBRAUCH','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('37001','Eigenleistungen','A','37000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('37002','Eigenverbrauch','A','37000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('38000','BESTANDESÄNDERUNGEN ANGEFANGENE UND FERTIGGESTELLTE ARBEITUNG AUS PRODUKTION UND DIENSTLEISTUNG','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('38001','Bestandesänderungen','A','38000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39000','ERTRAGSMINDERUNGEN AUS PRODUKTIONS-, HANDELS- UND DIENSTLEISTUNGSERTRÄGEN','H','30000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('40000','AUFWAND FÜR MATERIAL, WAREN UND DIENSTLEISTUNGEN','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('41000','MATERIALAUFWAND','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('41001','Computer','A','41000','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('41005','Übrige Produkte','A','41000','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('42000','HANDELSWARENAUFWAND','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('42001','Hardware','A','42000','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('42002','Software OSS','A','32000','I','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('42003','Software kommerz.','A','42000','I','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('42005','Übrige','A','42000','E','AP_amount:IC_cogs');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('44000','AUFWAND FÜR DRITTLEISTUNGEN','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('46000','ÜBRIGER AUFWAND','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('47000','DIREKTE EINKAUFSSPESEN','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('47001','Einkaufsspesen','A','47000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('48000','BESTANDESVERÄNDERUNGEN, MATERIAL- UND WARENVERLUSTE','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('48001','Bestandesänderungen','A','48000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('49000','AUFWANDMINDERUNGEN','H','40000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('49005','Aufwandminderungen','A','49000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('50000','PERSONALAUFWAND','H','50000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57000','SOZIALVERSICHERUNGSAUFWAND','H','50000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('58000','ÜBRIGER PERSONALAUFWAND','H','58000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('58005','Sonstiger Personalaufwand','A','58000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('59000','ARBEITSLEISTUNGEN DRITTER','H','50000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('60000','SONSTIGER BETRIEBSAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61000','RAUMAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61900','UNTERHALT, REPARATUREN, ERSATZ, LEASINGAUFWAND MOBILE SACHANLAGEN','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61901','Unterhalt','A','61900','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('62000','FAHRZEUG- UND TRANSPORTAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('62002','Transportaufwand','A','62000','E','AP_amount');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('63000','SACHVERSICHERUNGEN, ABGABEN, GEBÜHREN, BEWILLIGUNGEN','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65000','VERWALTUNGS- UND INFORMATIKAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('66000','WERBEAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('67000','ÜBRIGER BETRIEBSAUFWAND','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('67001','Übriger Betriebsaufwand','A','67000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('68000','FINANZERFOLG','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('68001','Finanzaufwand','A','68000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('68002','Bankspesen','A','68000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('68005','Finanzertrag','A','68000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('69000','ABSCHREIBUNGEN','H','60000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('69001','Abschreibungen','A','69000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('80000','AUSSERORDENTLICHER UND BETRIEBSFREMDER ERFOLG, STEUERN','H','80000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('80001','Ausserordentlicher Ertrag','A','80000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('80002','Ausserordentlicher Aufwand','A','80000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('89000','STEUERAUFWAND','H','80000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('89001','Steuern','A','80000','E','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('90000','ABSCHLUSS','H','90000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('91000','ERFOLGSRECHNUNG','H','91000','I','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('92000','BILANZ','H','92000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('93000','GEWINNVERWENDUNG','H','93000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('99000','SAMMEL- UND FEHLBUCHUNGEN','H','99000','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11121','Warenvorräte','A','11120','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('44001','Aufwand für Drittleistungen','A','44000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('63001','Betriebsversicherungen','A','63000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57004','Unfallversicherung','A','57000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57005','Krankentaggeldversicherung','A','57000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57003','Berufliche Vorsorge','A','57000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57002','FAK','A','57000','E','AP_amount:IC_income:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65009','Übriger Verwaltungsaufwand','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65003','Porti','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65002','Telekomm','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65001','Büromaterial','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('18181','Gründungsaufwand','A','18000','A','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('50001','Löhne und Gehälter','A','50000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('50002','Erfolgsbeteiligungen','A','50000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21216','Gesellschafter','A','21210','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('62001','Fahrzeugaufwand','A','62000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('58003','Spesen','A','58000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65004','Fachliteratur','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39001','Skonti','A','39000','I','IC_sale:IC_cogs:IC_income:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39002','Rabatte, Preisnachlässe','A','39000','I','IC_sale:IC_cogs:IC_income:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36005','Kursgewinn','A','39000','I','IC_sale:IC_cogs:IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39006','Kursverlust','A','39000','E','IC_sale:IC_cogs:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39005','Verluste aus Forderungen','A','39000','E','IC_sale:IC_cogs:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('14151','Mobiliar und Einrichtungen','A','14150','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('14152','Büromaschinen, EDV','A','14150','A','IC');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11119','Verrechnungssteuer','A','11110','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11118','MWST Vorsteuer auf Investitionen','A','11110','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36004','Versand','A','36000','I','IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36001','Reisezeit','A','36000','I','IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36002','Reise (Fahrt)','A','36000','I','IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11117','MWST Vorsteuer auf Aufwand','A','11110','A','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21228','Geschuldete Steuern','A','21220','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21223','MWST (7,6)','A','21220','L','AR_tax:AP_tax:IC_taxpart:IC_expense:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('57001','AHV, IV, EO, ALV','A','57000','E','AP_amount:IC_income:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21221','MWST (2,4)','A','21220','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21224','MWST (7.6) 1/2','A','21220','L','AR_tax:AP_tax:IC_taxpart:IC_expense:IC_taxservice:CT_tax');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('66001','Werbeaufwand','A','66000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21217','Privat','A','21210','L','AP');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11101','Kasse','A','11100','A','AR_paid:AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('50005','Leistungen von Sozialversicherung','A','50000','E','AP_amount:IC_income:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('65005','Informatikaufwand','A','65000','E','AP_amount:IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('39004','Rundungsdifferenzen','A','39000','I','AR_paid:AP_paid');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('11111','Debitoren','A','11110','A','AR');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61001','Miete','A','61000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61002','Reinigung','A','61000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('61005','Übriger Raumaufwand','A','61000','E','IC_expense');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('36003','Essen','A','36000','I','IC_income');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('21231','Passive Rechnungsabgrenzung','A','21230','L','');
+INSERT INTO chart (accno,description,charttype,gifi_accno,category,link) VALUES ('67002','Produkteentwicklung','A','67000','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '21222'),0.036);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '21223'),0.076);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '21221'),0.024);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '21224'),0.076);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '11121'), income_accno_id = (select id from chart where accno = '34002'), expense_accno_id = (select id from chart where accno = '42005'), fxgain_accno_id = (select id from chart where accno = '36005'), fxloss_accno_id = (select id from chart where accno = '39006'), invnumber = '2002000', sonumber = '2002000', ponumber = '2002000', curr = 'EUR:USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/Swiss-German-gifi.sql b/sql-ledger/sql/Swiss-German-gifi.sql
new file mode 100644
index 000000000..ecd526d35
--- /dev/null
+++ b/sql-ledger/sql/Swiss-German-gifi.sql
@@ -0,0 +1,55 @@
+--
+INSERT INTO gifi (accno,description) VALUES ('1','AKTIVEN');
+INSERT INTO gifi (accno,description) VALUES ('2','PASSIVEN');
+INSERT INTO gifi (accno,description) VALUES ('4','AUFWAND FÜR MATERIAL, WAREN UND DIENSTLEISTUNGEN');
+INSERT INTO gifi (accno,description) VALUES ('5','PERSONALAUFWAND');
+INSERT INTO gifi (accno,description) VALUES ('10000','ANLAGEVERMÖGEN');
+INSERT INTO gifi (accno,description) VALUES ('11000','Forderungen');
+INSERT INTO gifi (accno,description) VALUES ('11100','Bank');
+INSERT INTO gifi (accno,description) VALUES ('11110','MWST Vorsteuer auf Investitionen');
+INSERT INTO gifi (accno,description) VALUES ('11120','Angefangene Arbeiten');
+INSERT INTO gifi (accno,description) VALUES ('14150','Büromaschinen, EDV');
+INSERT INTO gifi (accno,description) VALUES ('18000','Gründungsaufwand');
+INSERT INTO gifi (accno,description) VALUES ('20000','FREMDKAPITAL LANGFRISTIG');
+INSERT INTO gifi (accno,description) VALUES ('21000','Kurzfristige Finanzverbindlichkeiten');
+INSERT INTO gifi (accno,description) VALUES ('21200','Sozialversicherungen');
+INSERT INTO gifi (accno,description) VALUES ('21210','Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('21220','MWST (3,6)');
+INSERT INTO gifi (accno,description) VALUES ('21230','Passive Rechnungsabgrenzung');
+INSERT INTO gifi (accno,description) VALUES ('24000','Gesellschafter');
+INSERT INTO gifi (accno,description) VALUES ('28000','Stammkapital');
+INSERT INTO gifi (accno,description) VALUES ('28290','Gewinnvortrag');
+INSERT INTO gifi (accno,description) VALUES ('30000','ÜBRIGER ERTRAG');
+INSERT INTO gifi (accno,description) VALUES ('31000','Computer');
+INSERT INTO gifi (accno,description) VALUES ('32000','Software kommerz.');
+INSERT INTO gifi (accno,description) VALUES ('34000','Beratung');
+INSERT INTO gifi (accno,description) VALUES ('36000','Essen');
+INSERT INTO gifi (accno,description) VALUES ('37000','Eigenleistungen');
+INSERT INTO gifi (accno,description) VALUES ('38000','Bestandesänderungen');
+INSERT INTO gifi (accno,description) VALUES ('39000','Rabatte, Preisnachlässe');
+INSERT INTO gifi (accno,description) VALUES ('40000','AUFWANDMINDERUNGEN');
+INSERT INTO gifi (accno,description) VALUES ('41000','Übrige Produkte');
+INSERT INTO gifi (accno,description) VALUES ('42000','Software kommerz.');
+INSERT INTO gifi (accno,description) VALUES ('44000','Aufwand für Drittleistungen');
+INSERT INTO gifi (accno,description) VALUES ('47000','Einkaufsspesen');
+INSERT INTO gifi (accno,description) VALUES ('48000','Bestandesänderungen');
+INSERT INTO gifi (accno,description) VALUES ('49000','Aufwandminderungen');
+INSERT INTO gifi (accno,description) VALUES ('50000','Löhne und Gehälter');
+INSERT INTO gifi (accno,description) VALUES ('57000','FAK');
+INSERT INTO gifi (accno,description) VALUES ('58000','Spesen');
+INSERT INTO gifi (accno,description) VALUES ('60000','VERWALTUNGS- UND INFORMATIKAUFWAND');
+INSERT INTO gifi (accno,description) VALUES ('61000','Reinigung');
+INSERT INTO gifi (accno,description) VALUES ('61900','Unterhalt');
+INSERT INTO gifi (accno,description) VALUES ('62000','Fahrzeugaufwand');
+INSERT INTO gifi (accno,description) VALUES ('63000','Betriebsversicherungen');
+INSERT INTO gifi (accno,description) VALUES ('65000','Übriger Verwaltungsaufwand');
+INSERT INTO gifi (accno,description) VALUES ('66000','Werbeaufwand');
+INSERT INTO gifi (accno,description) VALUES ('67000','Produkteentwicklung');
+INSERT INTO gifi (accno,description) VALUES ('68000','Finanzaufwand');
+INSERT INTO gifi (accno,description) VALUES ('69000','Abschreibungen');
+INSERT INTO gifi (accno,description) VALUES ('80000','AUSSERORDENTLICHER UND BETRIEBSFREMDER ERFOLG, STEUERN');
+INSERT INTO gifi (accno,description) VALUES ('90000','ABSCHLUSS');
+INSERT INTO gifi (accno,description) VALUES ('91000','ERFOLGSRECHNUNG');
+INSERT INTO gifi (accno,description) VALUES ('92000','BILANZ');
+INSERT INTO gifi (accno,description) VALUES ('93000','GEWINNVERWENDUNG');
+INSERT INTO gifi (accno,description) VALUES ('99000','SAMMEL- UND FEHLBUCHUNGEN');
diff --git a/sql-ledger/sql/Traditional_Chinese_Default-chart.sql b/sql-ledger/sql/Traditional_Chinese_Default-chart.sql
new file mode 100644
index 000000000..68ebeac17
--- /dev/null
+++ b/sql-ledger/sql/Traditional_Chinese_Default-chart.sql
@@ -0,0 +1,78 @@
+-- Default chart of accounts -- sample only
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2190','À³¥I©Ò±oµ|','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','ªø´Á­t¶Å','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','ªÑ¥÷¸ê¥»','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','«O¯d¬Õ¾l','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','¾P°â¬Õ¾l','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','¿Ô¸ß¬Õ¾l','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','¨ä¥¦¬Õ¾l','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','³f¾P¦¨¥»','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','Á~¸ê¤ä¥X','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','¤é±`¤ÎºÞ²z¤ä¥X','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','§b±b³Æ©è','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','¬y°Ê¸ê²£','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','¸ê¥»¸ê²£','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','²Ö­p¤À´Á¥I´Ú - ¸Ë¿X¤Î³]³Æ.','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','²Ö­p¤À´Á¥I´Ú - ¹B¿é¤u¨ã','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','¬y°Ê­t¶Å','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','»È¦æ­É´Ú','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3600','¬y°Ê¬Õ¾l','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','À³¥I¤½¥qµ|','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3590','«O¯d¬Õ¾l - ¥h¦~«×','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','´¶³qªÑ¥÷','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','¦s³f¸ê²£','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','¼s§i¦æ¾P','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','¤u¨ã','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','¿ì¤½¥Î«~','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Åv§Qª÷','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','·|­pªk°È','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','«OÀI','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','¤À´Á¤ä¥X','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Ãa±b','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5680','©Ò±oµ|','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','§Q®§¤Î»È¦æ¤âÄò¶O','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Á~¸ê','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','«OÀI¤ä¥X','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5430','°h¥ðª÷¤ä¥X','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5440','¸ÉÀvª÷¤ä¥X','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5470','­û¤uºÖ§Q','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','¾P°â / ³nÅé','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','§Q®§','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','¹B¶O','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','¯²ª÷','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','®w¦s / ³nÅé','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','®w¦s / ¤G¯Å¥«³õ¹s¥ó','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','¾P°â / ¤G¯Å¥«³õ¹s¥ó','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','³f¾P¦¨¥» / ³nÅé','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','±ÄÁÊ','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','³f¾P¦¨¥» / ¤G¯Å¥«³õ¹s¥ó','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','¹s¥Îª÷','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','¿ì¤½«Ç¸Ë¿X¤Î³]³Æ','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','®È¶O¤Î®T¼Ö','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','ªÑªF¶U´Ú','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5795','µù¥U¶O','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','¹q«H¶O','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5781','ºô¸ô³s½u¶O','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','ºû­×ºÞ²z¶O','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2311','¦a¤èµ|','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','¹B¾P¶O','A','','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','®w¦s / µwÅé','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','³f¾P¦¨¥» / µwÅé','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','À³¥I±b´Ú','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','¹B¿é¤u¨ã','A','','A','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','µ{¦¡³]­p','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','¾P°â / µwÅé','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','¿Ô¸ß','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','À³¦¬±b´Ú','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1061','¤ä²¼¤áÀY','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','°Ó«~ªA°Èµ|','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+--
+-- exchange rate
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2310'),0.07);
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2311'),0.08);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5010'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'USD', weightunit = 'kg';
+--
diff --git a/sql-ledger/sql/US_General-chart.sql b/sql-ledger/sql/US_General-chart.sql
new file mode 100644
index 000000000..4506a7139
--- /dev/null
+++ b/sql-ledger/sql/US_General-chart.sql
@@ -0,0 +1,98 @@
+-- US_General COA
+-- modify as needed
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1000','CURRENT ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1060','Checking Account','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1065','Petty Cash','A','','A','AR_paid:AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1200','Accounts Receivables','A','','A','AR');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1205','Allowance for doubtful accounts','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1500','INVENTORY ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1520','Inventory / Hardware','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1530','Inventory / Software','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1540','Inventory / Aftermarket Parts','A','','A','IC');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1800','CAPITAL ASSETS','H','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1820','Office Furniture & Equipment','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1825','Accum. Amort. -Furn. & Equip.','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1840','Vehicle','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('1845','Accum. Amort. -Vehicle','A','','A','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2000','CURRENT LIABILITIES','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2100','Accounts Payable','A','','L','AP');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2600','LONG TERM LIABILITIES','H','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2620','Bank Loans','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2680','Loans from Shareholders','A','','L','AP_paid');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3300','SHARE CAPITAL','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3350','Common Shares','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3500','RETAINED EARNINGS','H','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3590','Retained Earnings - prior years','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('3600','Current Earnings','A','','Q','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4000','SALES REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4020','Sales / Hardware','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4030','Sales / Software','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4040','Sales / Aftermarket Parts','A','','I','AR_amount:IC_sale');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4300','CONSULTING REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4320','Consulting','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4330','Programming','A','','I','AR_amount:IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4400','OTHER REVENUE','H','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4430','Shipping & Handling','A','','I','IC_income');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4440','Interest','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('4450','Foreign Exchange Gain','A','','I','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5000','COST OF GOODS SOLD','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5010','Purchases','A','','E','AP_amount:IC_cogs:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5020','COGS / Hardware','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5030','COGS / Software','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5040','COGS / Aftermarket Parts','A','','E','AP_amount:IC_cogs');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5100','Freight','A','','E','AP_amount:IC_expense');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5400','PAYROLL EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5410','Wages & Salaries','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5600','GENERAL & ADMINISTRATIVE EXPENSES','H','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5610','Accounting & Legal','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5615','Advertising & Promotions','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5620','Bad Debts','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5660','Amortization Expense','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5685','Insurance','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5690','Interest & Bank Charges','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5700','Office Supplies','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5760','Rent','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5765','Repair & Maintenance','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5780','Telephone','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5785','Travel & Entertainment','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5790','Utilities','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5795','Registrations','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5800','Licenses','A','','E','AP_amount');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5810','Foreign Exchange Loss','A','','E','');
+--
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2110','Accrued Income Tax - Federal','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2120','Accrued Income Tax - State','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2130','Accrued Franchise Tax','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2140','Accrued Real & Personal Prop Tax','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2150','Sales Tax','A','','L','AR_tax:AP_tax:IC_taxpart:IC_taxservice:CT_tax');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2160','Accrued Use Tax Payable','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2210','Accrued Wages','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2220','Accrued Comp Time','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2230','Accrued Holiday Pay','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2240','Accrued Vacation Pay','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2310','Accr. Benefits - 401K','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2320','Accr. Benefits - Stock Purchase','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2330','Accr. Benefits - Med, Den','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2340','Accr. Benefits - Payroll Taxes','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2350','Accr. Benefits - Credit Union','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2360','Accr. Benefits - Savings Bond','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2370','Accr. Benefits - Garnish','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('2380','Accr. Benefits - Charity Cont.','A','','L','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5420','Wages - Overtime','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5430','Benefits - Comp Time','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5440','Benefits - Payroll Taxes','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5450','Benefits - Workers Comp','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5460','Benefits - Pension','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5470','Benefits - General Benefits','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5510','Inc Tax Exp - Federal','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5520','Inc Tax Exp - State','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5530','Taxes - Real Estate','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5540','Taxes - Personal Property','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5550','Taxes - Franchise','A','','E','');
+insert into chart (accno,description,charttype,gifi_accno,category,link) values ('5560','Taxes - Foreign Withholding','A','','E','');
+--
+insert into tax (chart_id,rate) values ((select id from chart where accno = '2150'),0.05);
+--
+update defaults set inventory_accno_id = (select id from chart where accno = '1520'), income_accno_id = (select id from chart where accno = '4020'), expense_accno_id = (select id from chart where accno = '5020'), fxgain_accno_id = (select id from chart where accno = '4450'), fxloss_accno_id = (select id from chart where accno = '5810'), invnumber = '1000', sonumber = '1000', ponumber = '1000', curr = 'USD:CAD:EUR', weightunit = 'lbs';
+--
diff --git a/sql-ledger/templates/Brazilian_Portuguese-balance_sheet.html b/sql-ledger/templates/Brazilian_Portuguese-balance_sheet.html
new file mode 100644
index 000000000..20c3c5123
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-balance_sheet.html
@@ -0,0 +1,103 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+ <p>BALAN&Ccedil;O<br>
+ <%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>VALORES<br>
+ <hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>BALAN&Ccedil;O<b>
+ <hr align=left width=250 size=5 noshade></b></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>S&Oacute;CIOS (%)<br>
+ <hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAIS</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-check.tex b/sql-ledger/templates/Brazilian_Portuguese-check.tex
new file mode 100644
index 000000000..ea62b003b
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Número da Fatura} & \textbf{Data da Fatura}
+ & \textbf{Prazo} & \textbf{Aplicação} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-income_statement.html b/sql-ledger/templates/Brazilian_Portuguese-income_statement.html
new file mode 100644
index 000000000..35311224f
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-income_statement.html
@@ -0,0 +1,77 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+ <p>DECLARA&Ccedil;&Atilde;O DE RENDIMENTOS<br>
+ <%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>RENDIMENTOS<br>
+ <hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>DESPESAS<br>
+ <hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>RENDIMENTOS / (PREJUIZO)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-invoice.html b/sql-ledger/templates/Brazilian_Portuguese-invoice.html
new file mode 100644
index 000000000..287123833
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-invoice.html
@@ -0,0 +1,315 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4> Telefone:
+ <%tel%>
+ <br>
+ Fax:
+ <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>FATURA</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right> Data</th>
+ <td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Entrega</th>
+ <td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N&uacute;mero</th>
+ <td>&nbsp;</td><td><%invnumber%></td></tr>
+ </table></tr>
+
+<!--
+ <tr>
+ <th align=right>Clerk:</th><td>&nbsp;</td><td><%employee%></td>
+ </tr>
+-->
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </table></td>
+ </table>
+
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color="ffffff">Para:</font></th>
+ <th align=left><font color="ffffff">Transportar Para:</font></th>
+ </tr>
+
+<!--
+ other variables which can be use:
+ contact, shiptocontact, shiptophone, shiptofax
+-->
+
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>N&uacute;mero</font></th>
+ <th align=left><font color=ffffff>Descri&ccedil;&atilde;o</font></th>
+ <th><font color=ffffff>Quant.</font></th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pre&ccedil;o</font></th>
+ <th><font color=ffffff>Disc.</font></th>
+ <th><font color="ffffff">Total</font></th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right>
+ <%taxdescription%>
+ em
+ <%taxbase%>
+ @
+ <%taxrate%>
+ %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Pago</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Fatura para<b>
+ <%terms%>
+ </b> dias</td>
+ <th colspan=2 align=right>Pendente</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Obs.:</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right> Pre&ccedil;os em<b>
+ <%currency%>
+ </b> <br>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<%if paid%>
+<tr>
+ <td colspan=7>
+ <table width=60%>
+ <tr>
+ <th align=left>Pagamentos</th>
+ </tr>
+ <tr>
+ <td colspan=4>
+ <hr noshade>
+ </td>
+ </tr>
+ <tr>
+ <th align=left>Data</th>
+ <th align=left>Conta</th>
+ <th align=left>Origem</th>
+ <th align=left>Total</th>
+ </tr>
+<%end paid%>
+
+<%foreach payment%>
+ <tr>
+ <td><%paymentdate%></td>
+ <td><%paymentaccount%></td>
+ <td><%paymentsource%></td>
+ <td><%payment%></td>
+ </tr>
+<%end payment%>
+
+<%if paid%>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>&nbsp;</td>
+</tr>
+<%end paid%>
+
+<tr>
+ <th colspan=7>
+ <br>
+ Obrigado por estarmos fazendo neg&oacute;cio! </th>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3> </font> </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+ <tr>
+
+ <th colspan=7 align=left><font size=-2>
+ <%taxdescription%>
+ Registro
+ <%taxnumber%>
+ </font></th>
+ </tr>
+<%end tax%>
+
+<%if taxincluded%>
+ <tr>
+
+ <th colspan=7 align=left><font size="-2">Impostos Inclusos.</font></th>
+ </tr>
+<%end taxincluded%>
+
+<!-- business number
+ <tr>
+ <th colspan=7 align=left><font size=-2>Business Number: <%businessnumber%></font></th>
+ </tr>
+-->
+
+<!-- banking information
+ <tr>
+ <th colspan=7 align=left>Banking Information:
+ <br>Bank
+ <br>Transit No.
+ <br>Account No.
+ </td>
+ </tr>
+-->
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-invoice.tex b/sql-ledger/templates/Brazilian_Portuguese-invoice.tex
new file mode 100644
index 000000000..15c407b89
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-invoice.tex
@@ -0,0 +1,223 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefone & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+ & carried forward from page <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{0.5cm}
+
+\parbox[t]{1cm}{\hfill}
+ \parbox[t]{10.5cm}{
+ \textbf{To}
+ \vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{0.3cm}
+
+%<%if contact%>
+%Attn: <%contact%>
+%\vspace{0.3cm}
+%<%end contact%>
+\vspace{0.5cm}
+
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\parbox[t]{7.5cm}{
+\textbf{Ship To}
+\vspace{0.5cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{0.3cm}
+
+\vspace{0.3cm}
+
+<%if shiptocontact%>
+Attn: <%shiptocontact%>
+\vspace{0.3cm}
+<%end shiptocontact%>
+
+<%if shiptophone%>
+Tel: <%shiptophone%>
+<%end shiptophone%>
+
+<%if shiptofax%>
+Fax: <%shiptofax%>
+<%end shiptofax%>
+
+<%shiptoemail%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{F A T U R A}
+\hfill
+
+\vspace{1cm}
+
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Data} & <%invdate%> \\
+ \textbf{Número} & <%invnumber%> \\
+ \textbf{Pedido} & <%ordnumber%> \\
+ \textbf{Produto} & <%employee%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Número} & \textbf{Descrição} & \textbf{Quant.} &
+ \textbf{Unid.} & \textbf{Preço} & \textbf{Disc.} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> em <%taxbase%> & <%tax%> \\
+<%end tax%>
+<%if paid%>
+ \textbf{Pago} & - <%paid%> \\
+<%end paid%>
+ \hline
+ \textbf{Pendente} & \textbf{<%total%>} \\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Preços em \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+
+<%if paid%>
+\begin{tabularx}{10cm}{@{}lXlr@{}}
+ \textbf{Pagamentos} & & & \\
+ \hline
+ \textbf{Data} & \textbf{Conta} & \textbf{Origem} & \textbf{Total} \\
+<%end paid%>
+<%foreach payment%>
+ <%paymentdate%> & <%paymentaccount%> & <%paymentsource%> & <%payment%> \\
+<%end payment%>
+<%if paid%>
+\end{tabularx}
+<%end paid%>
+
+\vspace{1cm}
+
+\centerline{\textbf{Obrigado por estarmos fazendo negócio!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
+
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-packing_list.html b/sql-ledger/templates/Brazilian_Portuguese-packing_list.html
new file mode 100644
index 000000000..4cdee7457
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-packing_list.html
@@ -0,0 +1,143 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>LISTA DE PRODUTOS</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Data</th>
+ <td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N&uacute;mero</th>
+ <td></td><td><%invnumber%></td></tr>
+ </table></tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </table></td>
+ </table>
+
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color="ffffff">Para:</font></th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+<%if shiptocontact%>
+ <p>Obs.:
+ <%shiptocontact%>
+ <%end shiptocontact%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>N&uacute;mero</font></th>
+ <th align=left><font color=ffffff>Descri&ccedil;&atilde;o</font></th>
+ <th><font color="ffffff">Quant.</font></th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Obs.:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3> </font> </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+
+
+
+
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-packing_list.tex b/sql-ledger/templates/Brazilian_Portuguese-packing_list.tex
new file mode 100644
index 000000000..48102302f
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-packing_list.tex
@@ -0,0 +1,116 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Bin} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{LISTA DE PRODUTOS} \parbox{0.3cm}{\hfill} \textbf{L I S T}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Data} & <%invdate%> \\
+ \textbf{Número} & <%invnumber%> \\
+ \textbf{Cliente} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Número} & \textbf{Descrição} & \textbf{Quant.} &
+ \textbf{Unid.} & \textbf{Bin} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{ }}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-purchase_order.html b/sql-ledger/templates/Brazilian_Portuguese-purchase_order.html
new file mode 100644
index 000000000..54b25f380
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-purchase_order.html
@@ -0,0 +1,187 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4> O R D E M &nbsp;&nbsp; D E &nbsp;&nbsp; C O M P R A</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Data</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Requerido por</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N&uacutemero</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Para:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>N&uacutemero</th>
+ <th align=left><font color=ffffff>Descri&ccedil&atildeo</th>
+ <th><font color=ffffff>Quant.</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pre&ccedilo (unit.)</th>
+ <th><font color=ffffff>Total</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Faturado em <b><%terms%></b> dias</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Obs.:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Todos os pre&ccedilos em <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-purchase_order.tex b/sql-ledger/templates/Brazilian_Portuguese-purchase_order.tex
new file mode 100644
index 000000000..61bb5183c
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-purchase_order.tex
@@ -0,0 +1,198 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefone & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{0.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+\textbf{To}
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{0.3cm}
+
+<%if contact%>
+Attn: <%contact%>
+\vspace{0.3cm}
+<%end contact%>
+
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\parbox[t]{7.5cm}{
+\textbf{Ship To}
+\vspace{0.3cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{0.3cm}
+
+<%if shiptocontact%>
+Attn: <%shiptocontact%>
+\vspace{0.3cm}
+<%end shiptocontact%>
+
+<%if shiptophone%>
+Tel: <%shiptophone%>
+<%end shiptophone%>
+
+<%if shiptofax%>
+Fax: <%shiptofax%>
+<%end shiptofax%>
+
+<%shiptoemail%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{ORDEM DE COMPRA} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Data} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Requerido por} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Número} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Número} & \textbf{Descrição} & \textbf{Quant.} &
+ \textbf{Unid.} & \textbf{Preço} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> em <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Preços em \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-receipt.tex b/sql-ledger/templates/Brazilian_Portuguese-receipt.tex
new file mode 100644
index 000000000..ea62b003b
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Número da Fatura} & \textbf{Data da Fatura}
+ & \textbf{Prazo} & \textbf{Aplicação} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-sales_order.html b/sql-ledger/templates/Brazilian_Portuguese-sales_order.html
new file mode 100644
index 000000000..480dc6351
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-sales_order.html
@@ -0,0 +1,221 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4> Telefone:
+ <%tel%>
+ <br>
+ Fax:
+ <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>ORDEM DE VENDA</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Data</th>
+ <td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Requerido por</th>
+ <td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N&uacute;mero</th>
+ <td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </table></tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </table></td>
+ </table>
+
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color="ffffff">Para:</font></th>
+ <th align=left><font color="ffffff">Transportar para:</font></th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>N&uacute;mero</font></th>
+ <th align=left><font color=ffffff>Descri&ccedil;&atilde;o</font></th>
+ <th><font color=ffffff>Quant.</font></th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pre&ccedil;o</font></th>
+ <th><font color=ffffff>Disc.</font></th>
+ <th><font color="ffffff">Total</font></th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right>
+ <%taxdescription%>
+ em
+ <%taxbase%>
+ @
+ <%taxrate%>
+ %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Faturar para<b>
+ <%terms%>
+ </b> dias</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Impostos inclusos do total</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Obs.:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right> Pre&ccedil;os em<b>
+ <%currency%>
+ </b><br>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3> </font> </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+
+
+
+
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-sales_order.tex b/sql-ledger/templates/Brazilian_Portuguese-sales_order.tex
new file mode 100644
index 000000000..4267143e7
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-sales_order.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefone & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{ORDEM DE VENDA} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Data} & <%orddate%> \\
+ \textbf{Número} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Número} & \textbf{Descrição} & \textbf{Quant.} &
+ \textbf{Unid.} & \textbf{Preço} & \textbf{Disc.} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> em <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Preços em \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-statement.html b/sql-ledger/templates/Brazilian_Portuguese-statement.html
new file mode 100644
index 000000000..963f65868
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-statement.html
@@ -0,0 +1,125 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3>
+ <h4>RELAT&Oacute;RIO</h4>
+ </th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>N&uacute;mero da Fatura</th>
+ <th width=15%>Data</th>
+ <th width=15%>Prazo</th>
+ <th width=10%>Atual</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></table></td>
+ <th align=right><%c30total%>
+ <th align=right><%c60total%>
+ <th align=right><%c90total%>
+ </tr>
+ </table>
+
+
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+
+ <td>Porfavor pagar com<b>
+ <%company%>
+ </b>. </td>
+ </tr>
+ <tr height=20></tr>
+
+
diff --git a/sql-ledger/templates/Brazilian_Portuguese-statement.tex b/sql-ledger/templates/Brazilian_Portuguese-statement.tex
new file mode 100644
index 000000000..fbc5b0350
--- /dev/null
+++ b/sql-ledger/templates/Brazilian_Portuguese-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{RELATÓRIO} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Número da Fatura \#} & \textbf{Data} & \textbf{Prazo} &
+ \textbf{Atual} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Totais} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Favor pagar com <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Danish-balance_sheet.html b/sql-ledger/templates/Danish-balance_sheet.html
new file mode 100644
index 000000000..61929eddd
--- /dev/null
+++ b/sql-ledger/templates/Danish-balance_sheet.html
@@ -0,0 +1,96 @@
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>STATUS
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>AKTIVER<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>SAMLEDE AKTIVER</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASSIVER<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Samlet gæld</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>KAPITAL<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Samlet egenkapital</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>SAMLET GÆLD OG EGENKAPITAL</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
diff --git a/sql-ledger/templates/Danish-check.tex b/sql-ledger/templates/Danish-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Danish-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Danish-income_statement.html b/sql-ledger/templates/Danish-income_statement.html
new file mode 100644
index 000000000..c0652977e
--- /dev/null
+++ b/sql-ledger/templates/Danish-income_statement.html
@@ -0,0 +1,73 @@
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>DRIFTSREGNSKAB
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INDTÆGTER<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Samlede indtægter</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>UDGIFTER<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Samlede udgifter</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>RESULTAT</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
diff --git a/sql-ledger/templates/Danish-invoice.html b/sql-ledger/templates/Danish-invoice.html
new file mode 100644
index 000000000..d150a8475
--- /dev/null
+++ b/sql-ledger/templates/Danish-invoice.html
@@ -0,0 +1,273 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tlf.: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>F A K T U R A</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Fakturadato</th><td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Betalingsdato</th><td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Fakturanummer</th><td>&nbsp;</td><td><%invnumber%></td></tr>
+ </tr>
+
+<!--
+ <tr>
+ <th align=right>Ekspederet af:</th><td>&nbsp;</td><td><%username%></td>
+ </tr>
+-->
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Faktureringsadresse:</th>
+ <%if shiptoname%>
+ <th align=left><font color=ffffff>Leveringsadresse:</th>
+ <%end shiptoname%>
+ </tr>
+
+<!--
+ other variables which can be use:
+ contact, shiptocontact, shiptophone, shiptofax
+-->
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <%if shiptoname%>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ <%end shiptoname%>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Varenummer</th>
+ <th align=left><font color=ffffff>Beskrivelse</th>
+ <th><font color=ffffff>Antal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pris</th>
+ <th><font color=ffffff>Rabat</th>
+ <th><font color=ffffff>Beløb</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> på <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Allerede betalt</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Betalingsfrist <b><%terms%></b> dage</td>
+ <th colspan=2 align=right>At betale</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemærkninger</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Alle priser i <b><%currency%></b>.
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <th colspan=7>
+ <br>Tak for handelen!
+ </th>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Betalingsfrist <%terms%> dage fra fakturadato. Betaling herefter påregnes
+ 1.5% per påbegyndt måned startende <%duedate%> og indtil det fulde beløb
+ er betalt. Returnerede varer modregnes 10% i ekspeditionsgebyr.
+ Et returnummer skal tildeles af <%company%> før varer returneres.
+ Returvarer skal forsendes forudbetalt og forsvarligt forsikret.
+ <%company%> kan ikke drages til ansvar for skade under transport.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=7 align=left><font size=-2><%taxdescription%> noteret som <%taxnumber%></th>
+ </tr>
+<%end tax%>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=7 align=left><font size=-2>Alle beløb er inklusive moms.</th>
+ </tr>
+<%end taxincluded%>
+
+<!-- business number
+ <tr>
+ <th colspan=7 align=left><font size=-2>CVR-nummer: <%businessnumber%></font></th>
+ </tr>
+-->
+
+<!-- banking information
+ <tr>
+ <th colspan=7 align=left>Bank-oplysninger:
+ <br>Bank
+ <br>Banknummer
+ <br>Kontonummer
+ </td>
+ </tr>
+-->
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Danish-invoice.tex b/sql-ledger/templates/Danish-invoice.tex
new file mode 100644
index 000000000..6c3fa8b43
--- /dev/null
+++ b/sql-ledger/templates/Danish-invoice.tex
@@ -0,0 +1,152 @@
+\documentclass[a4paper,twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[danish]{babel}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Tlf. & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Rabat} & \textbf{Beløb} \\
+ & overført fra side <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{F A K T U R A}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Dato} & <%invdate%> \\
+ \textbf{Nummer} & <%invnumber%> \\
+ \textbf{Kunde} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Rabat} & \textbf{Beløb} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> på <%taxbase%> & <%tax%> \\
+<%end tax%>
+<%if paid%>
+ \textbf{Betalt} & - <%paid%> \\
+<%end paid%>
+ \hline
+ \textbf{At betale} & \textbf{<%total%>} \\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle priser i \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Tak for handelen!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Betalingsfrist <%terms%> dage fra fakturadato. Betaling herefter påregnes
+1.5\% per påbegyndt måned startende <%duedate%> og indtil det fulde beløb
+er betalt. Returnerede varer modregnes 10\% i ekspeditionsgebyr.
+Et returnummer skal tildeles af <%company%> før varer returneres.
+Returvarer skal forsendes forudbetalt og forsvarligt forsikret.
+<%company%> kan ikke drages til ansvar for skade under transport.}
+
+\end{document}
diff --git a/sql-ledger/templates/Danish-packing_list.html b/sql-ledger/templates/Danish-packing_list.html
new file mode 100644
index 000000000..76e02b457
--- /dev/null
+++ b/sql-ledger/templates/Danish-packing_list.html
@@ -0,0 +1,145 @@
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>F Ø L G E S E D D E L</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Dato</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Nummer</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Leveringsadresse:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+<%if shiptocontact%>
+ <p>Att.: <%shiptocontact%>
+<%end shiptocontact%>
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Varenummer</th>
+ <th align=left><font color=ffffff>Beskrivelse</th>
+ <th><font color=ffffff>Antal</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemærkninger</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Returnerede varer modregnes 10% i ekspeditionsgebyr.
+ Et returnummer skal tildeles af <%company%> før varer returneres.
+ Returvarer skal forsendes forudbetalt og forsvarligt forsikret.
+ <%company%> kan ikke drages til ansvar for skade under transport.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/sql-ledger/templates/Danish-packing_list.tex b/sql-ledger/templates/Danish-packing_list.tex
new file mode 100644
index 000000000..0d6bfc47d
--- /dev/null
+++ b/sql-ledger/templates/Danish-packing_list.tex
@@ -0,0 +1,123 @@
+\documentclass[a4paper,twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[danish]{babel}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Tlf. & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Varelager} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{F Ø L G E S E D D E L}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Dato} & <%invdate%> \\
+ \textbf{Nummer} & <%invnumber%> \\
+ \textbf{Kunde} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Varelager} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Tak for ordren!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Returnerede varer modregnes 10\% i ekspeditionsgebyr.
+Et returnummer skal tildeles af <%company%> før varer returneres.
+Returvarer skal forsendes forudbetalt og forsvarligt forsikret.
+<%company%> kan ikke drages til ansvar for skade under transport.}
+
+\end{document}
diff --git a/sql-ledger/templates/Danish-purchase_order.html b/sql-ledger/templates/Danish-purchase_order.html
new file mode 100644
index 000000000..f9f21cd79
--- /dev/null
+++ b/sql-ledger/templates/Danish-purchase_order.html
@@ -0,0 +1,191 @@
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tlf.: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>I N D K Ø B S O R D R E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Ordredato</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Ønsket leveringsdato</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Ordrenummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Til:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Varenummer</th>
+ <th align=left><font color=ffffff>Beskrivelse</th>
+ <th><font color=ffffff>Antal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pris</th>
+ <th><font color=ffffff>Beløb</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Betalingsfrist <b><%terms%></b> dage</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemærkninger</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Alle priser i <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Betalingsfrist <%terms%> dage fra fakturadato. Betaling herefter påregnes
+ 1.5% per påbegyndt måned startende <%duedate%> og indtil det fulde beløb
+ er betalt. Returnerede varer modregnes 10% i ekspeditionsgebyr.
+ Et returnummer skal tildeles af <%company%> før varer returneres.
+ Returvarer skal forsendes forudbetalt og forsvarligt forsikret.
+ <%company%> kan ikke drages til ansvar for skade under transport.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/sql-ledger/templates/Danish-purchase_order.tex b/sql-ledger/templates/Danish-purchase_order.tex
new file mode 100644
index 000000000..bdd741622
--- /dev/null
+++ b/sql-ledger/templates/Danish-purchase_order.tex
@@ -0,0 +1,143 @@
+\documentclass[a4paper,twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[danish]{babel}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Tlf. & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Beløb} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{I N D K Ø B S O R D R E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Dato} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Ønsket leveringsdato} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Ordrenummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Varenummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Beløb} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle priser i \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
diff --git a/sql-ledger/templates/Danish-receipt.tex b/sql-ledger/templates/Danish-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Danish-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Danish-sales_order.html b/sql-ledger/templates/Danish-sales_order.html
new file mode 100644
index 000000000..f25652223
--- /dev/null
+++ b/sql-ledger/templates/Danish-sales_order.html
@@ -0,0 +1,210 @@
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tlf.: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>S A L G S O R D R E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Ordredato</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Ønsket leveringsdato</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Ordrenummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Til:</th>
+ <th align=left><font color=ffffff>Leveringsadresse:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Varenummer</th>
+ <th align=left><font color=ffffff>Beskrivelse</th>
+ <th><font color=ffffff>Antal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Pris</th>
+ <th><font color=ffffff>Rabat</th>
+ <th><font color=ffffff>Beløb</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> på <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Betalingsfrist netto <b><%terms%></b> dage</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Total er inklusive moms</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemærkninger</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Alle priser i <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Et gebyr for annullering af ordre på 10% vil blive tillagt alle specialtilbud
+ og produkter som er blevet tilpasset, forbedret eller opgraderet på kundens anmodning.<br>
+ Varer som ikke kan returneres er anført ovenfor.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/sql-ledger/templates/Danish-sales_order.tex b/sql-ledger/templates/Danish-sales_order.tex
new file mode 100644
index 000000000..d7307cd76
--- /dev/null
+++ b/sql-ledger/templates/Danish-sales_order.tex
@@ -0,0 +1,144 @@
+\documentclass[a4paper,twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[danish]{babel}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Tlf. & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Rabat} & \textbf{Beløb} \\
+ & Overført fra side <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{S A L G S O R D R E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Dato} & <%orddate%> \\
+ \textbf{Ordrenummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Varenummer} & \textbf{Beskrivelse} & \textbf{Antal} &
+ \textbf{Enhed} & \textbf{Pris} & \textbf{Rabat} & \textbf{Beløb} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> på <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle priser i \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Et gebyr for annullering af ordre på 10\% vil blive tillagt alle specialtilbud
+og produkter som er blevet tilpasset, forbedret eller opgraderet på kundens anmodning.
+Varer som ikke kan returneres er anført ovenfor.
+}
+
+\end{document}
diff --git a/sql-ledger/templates/Danish-statement.html b/sql-ledger/templates/Danish-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Danish-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Danish-statement.tex b/sql-ledger/templates/Danish-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/Danish-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Default-balance_sheet.html b/sql-ledger/templates/Default-balance_sheet.html
new file mode 100644
index 000000000..478caabca
--- /dev/null
+++ b/sql-ledger/templates/Default-balance_sheet.html
@@ -0,0 +1,100 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BALANCE SHEET
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ASSETS<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL ASSETS</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>LIABILITIES<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Liabilities</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>SHAREHOLDER'S EQUITY<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Equity</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL LIABILITIES & EQUITY</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
diff --git a/sql-ledger/templates/Default-check.tex b/sql-ledger/templates/Default-check.tex
new file mode 100644
index 000000000..a1ab20169
--- /dev/null
+++ b/sql-ledger/templates/Default-check.tex
@@ -0,0 +1,77 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{1.8cm}
+
+<%notes%>
+
+\vspace{0.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
+
+
diff --git a/sql-ledger/templates/Default-income_statement.html b/sql-ledger/templates/Default-income_statement.html
new file mode 100644
index 000000000..e9d6a4002
--- /dev/null
+++ b/sql-ledger/templates/Default-income_statement.html
@@ -0,0 +1,82 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>INCOME STATEMENT
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INCOME<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Income</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>EXPENSES<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Expenses</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>INCOME / (LOSS)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Default-invoice.html b/sql-ledger/templates/Default-invoice.html
new file mode 100644
index 000000000..0ba06cc32
--- /dev/null
+++ b/sql-ledger/templates/Default-invoice.html
@@ -0,0 +1,309 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telephone: <%tel%>
+ <br>Facsimile: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>I N V O I C E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Invoice Date</th><td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Due Date</th><td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%invnumber%></td></tr>
+ </tr>
+
+<!--
+ <tr>
+ <th align=right>Clerk:</th><td>&nbsp;</td><td><%employee%></td>
+ </tr>
+-->
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ <th align=left><font color=ffffff>Ship To:</th>
+ </tr>
+
+<!--
+ other variables which can be use:
+ contact, shiptocontact, shiptophone, shiptofax
+-->
+
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Disc</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> on <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Paid</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Terms Net <b><%terms%></b> days</td>
+ <th colspan=2 align=right>Outstanding</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ All prices in <b><%currency%></b> Funds
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<%if paid%>
+<tr>
+ <td colspan=7>
+ <table width=60%>
+ <tr>
+ <th align=left>Payments</th>
+ </tr>
+ <tr>
+ <td colspan=4>
+ <hr noshade>
+ </td>
+ </tr>
+ <tr>
+ <th align=left>Date</th>
+ <th align=left>Account</th>
+ <th align=left>Source</th>
+ <th align=left>Amount</th>
+ </tr>
+<%end paid%>
+
+<%foreach payment%>
+ <tr>
+ <td><%paymentdate%></td>
+ <td><%paymentaccount%></td>
+ <td><%paymentsource%></td>
+ <td><%payment%></td>
+ </tr>
+<%end payment%>
+
+<%if paid%>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>&nbsp;</td>
+</tr>
+<%end paid%>
+
+<tr>
+ <th colspan=7>
+ <br>Thank you for your valued business!
+ </th>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full. Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=7 align=left><font size=-2><%taxdescription%> Registration <%taxnumber%></th>
+ </tr>
+<%end tax%>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=7 align=left><font size=-2>Taxes shown are included in price.</th>
+ </tr>
+<%end taxincluded%>
+
+<!-- business number
+ <tr>
+ <th colspan=7 align=left><font size=-2>Business Number: <%businessnumber%></font></th>
+ </tr>
+-->
+
+<!-- banking information
+ <tr>
+ <th colspan=7 align=left>Banking Information:
+ <br>Bank
+ <br>Transit No.
+ <br>Account No.
+ </td>
+ </tr>
+-->
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Default-invoice.tex b/sql-ledger/templates/Default-invoice.tex
new file mode 100644
index 000000000..58a340d5e
--- /dev/null
+++ b/sql-ledger/templates/Default-invoice.tex
@@ -0,0 +1,231 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+ & carried forward from page <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{0.5cm}
+
+\parbox[t]{1cm}{\hfill}
+ \parbox[t]{10.5cm}{
+ \textbf{To}
+ \vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{0.3cm}
+
+%<%if contact%>
+%Attn: <%contact%>
+%\vspace{0.3cm}
+%<%end contact%>
+\vspace{0.5cm}
+
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\parbox[t]{7.5cm}{
+\textbf{Ship To}
+\vspace{0.5cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{0.3cm}
+
+\vspace{0.3cm}
+
+<%if shiptocontact%>
+Attn: <%shiptocontact%>
+\vspace{0.3cm}
+<%end shiptocontact%>
+
+<%if shiptophone%>
+Tel: <%shiptophone%>
+<%end shiptophone%>
+
+<%if shiptofax%>
+Fax: <%shiptofax%>
+<%end shiptofax%>
+
+<%shiptoemail%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{I N V O I C E}
+\hfill
+
+\vspace{1cm}
+
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Order} & <%ordnumber%> \\
+ \textbf{Clerk} & <%employee%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%> \\
+<%end tax%>
+<%if paid%>
+ \textbf{Paid} & - <%paid%> \\
+<%end paid%>
+ \hline
+ \textbf{Balance Owing} & \textbf{<%total%>} \\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+
+<%if paid%>
+\begin{tabularx}{10cm}{@{}lXlr@{}}
+ \textbf{Payments} & & & \\
+ \hline
+ \textbf{Date} & \textbf{Account} & \textbf{Source} & \textbf{Amount} \\
+<%end paid%>
+<%foreach payment%>
+ <%paymentdate%> & <%paymentaccount%> & <%paymentsource%> & <%payment%> \\
+<%end payment%>
+<%if paid%>
+\end{tabularx}
+<%end paid%>
+
+\vspace{1cm}
+
+\centerline{\textbf{Thank You for your valued business!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Payment due NET <%terms%> Days from date of Invoice. Interest on overdue
+amounts will acrue at the rate of 1.5\% per month starting <%duedate%>
+until paid in full. Items returned are subject to a 10\% restocking charge.
+A return authorization must be obtained from <%company%> before goods are
+returned. Returns must be shipped prepaid and properly insured.
+<%company%> will not be responsible for damages during transit.}
+
+\end{document}
+
+
+
diff --git a/sql-ledger/templates/Default-packing_list.html b/sql-ledger/templates/Default-packing_list.html
new file mode 100644
index 000000000..07ba8d61d
--- /dev/null
+++ b/sql-ledger/templates/Default-packing_list.html
@@ -0,0 +1,148 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>P A C K I N G &nbsp;&nbsp; L I S T</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Ship To:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+<%if shiptocontact%>
+ <p>Attn: <%shiptocontact%>
+<%end shiptocontact%>
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Default-packing_list.tex b/sql-ledger/templates/Default-packing_list.tex
new file mode 100644
index 000000000..fce17823c
--- /dev/null
+++ b/sql-ledger/templates/Default-packing_list.tex
@@ -0,0 +1,122 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Bin} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{P A C K I N G} \parbox{0.3cm}{\hfill} \textbf{L I S T}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Customer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Bin} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Thank You for your valued business!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Items returned are subject to a 10\% restocking charge.
+A return authorization must be obtained from <%company%> before goods are
+returned. Returns must be shipped prepaid and properly insured.
+<%company%> will not be responsible for damages during transit.}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Default-purchase_order.html b/sql-ledger/templates/Default-purchase_order.html
new file mode 100644
index 000000000..7df399ed6
--- /dev/null
+++ b/sql-ledger/templates/Default-purchase_order.html
@@ -0,0 +1,224 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telephone: <%tel%>
+ <br>Facsimile: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>P U R C H A S E &nbsp;&nbsp; O R D E R</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Order Date</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Required by</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left width=50%><font color=ffffff>To:</th>
+ <th align=left width=50%><font color=ffffff>Ship To:</th>
+ </tr>
+
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+
+<br>
+<%if contact%>
+<br>Attn: <%contact%>
+<%end contact%>
+<%if vendorphone%>
+<br>Tel: <%vendorphone%>
+<%end vendorphone%>
+<%if vendorfax%>
+<br>Fax: <%vendorfax%>
+<%end vendorfax%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+
+<br>
+<%if shiptocontact%>
+<br>Attn: <%shiptocontact%>
+<%end shiptocontact%>
+<%if shiptophone%>
+<br>Tel: <%shiptophone%>
+<%end shiptophone%>
+<%if shiptofax%>
+<br>Fax: <%shiptofax%>
+<%end shiptofax%>
+
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Terms Net <b><%terms%></b> days</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ All prices in <b><%currency%></b> Funds
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full. Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Default-purchase_order.tex b/sql-ledger/templates/Default-purchase_order.tex
new file mode 100644
index 000000000..4e1deb2f0
--- /dev/null
+++ b/sql-ledger/templates/Default-purchase_order.tex
@@ -0,0 +1,198 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{0.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+\textbf{To}
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{0.3cm}
+
+<%if contact%>
+Attn: <%contact%>
+\vspace{0.3cm}
+<%end contact%>
+
+<%if vendorphone%>
+Tel: <%vendorphone%>
+<%end vendorphone%>
+
+<%if vendorfax%>
+Fax: <%vendorfax%>
+<%end vendorfax%>
+
+<%email%>
+}
+\parbox[t]{7.5cm}{
+\textbf{Ship To}
+\vspace{0.3cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{0.3cm}
+
+<%if shiptocontact%>
+Attn: <%shiptocontact%>
+\vspace{0.3cm}
+<%end shiptocontact%>
+
+<%if shiptophone%>
+Tel: <%shiptophone%>
+<%end shiptophone%>
+
+<%if shiptofax%>
+Fax: <%shiptofax%>
+<%end shiptofax%>
+
+<%shiptoemail%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{P U R C H A S E} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Required by} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/Default-receipt.tex b/sql-ledger/templates/Default-receipt.tex
new file mode 100644
index 000000000..24427b369
--- /dev/null
+++ b/sql-ledger/templates/Default-receipt.tex
@@ -0,0 +1,74 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{1.8cm}
+
+<%notes%>
+
+\vspace{0.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
diff --git a/sql-ledger/templates/Default-sales_order.html b/sql-ledger/templates/Default-sales_order.html
new file mode 100644
index 000000000..c09e13a1c
--- /dev/null
+++ b/sql-ledger/templates/Default-sales_order.html
@@ -0,0 +1,212 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telephone: <%tel%>
+ <br>Facsimile: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>S A L E S &nbsp;&nbsp; O R D E R</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Order Date</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Required by</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ <th align=left><font color=ffffff>Ship To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Disc</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> on <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Terms Net <b><%terms%></b> days</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Tax is included in Total</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ All prices in <b><%currency%></b> Funds
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ A 10% order cancellation fee will be applied for any special order
+ products or products that have been customized, enhanced or
+ upgraded at customers request.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Default-sales_order.tex b/sql-ledger/templates/Default-sales_order.tex
new file mode 100644
index 000000000..d5ac40c67
--- /dev/null
+++ b/sql-ledger/templates/Default-sales_order.tex
@@ -0,0 +1,143 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{S A L E S} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%orddate%> \\
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+A 10\% order cancellation fee will be applied for any special order products or
+products that have been customized, enhanced or upgraded at customers request.
+Items which are non-returnable are indicated above.
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Default-statement.html b/sql-ledger/templates/Default-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Default-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Default-statement.tex b/sql-ledger/templates/Default-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/Default-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-balance_sheet.html b/sql-ledger/templates/Dutch-balance_sheet.html
new file mode 100644
index 000000000..16ede7037
--- /dev/null
+++ b/sql-ledger/templates/Dutch-balance_sheet.html
@@ -0,0 +1,104 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BALANS
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ACTIVA<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Totaal Activa</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASSIVA<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Totaal Passiva</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>ONVERDEELD RESULTAAT<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Totaal Opbrengst</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAAL PASSIVA & RESULTAAT</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Dutch-check.tex b/sql-ledger/templates/Dutch-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Dutch-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-income_statement.html b/sql-ledger/templates/Dutch-income_statement.html
new file mode 100644
index 000000000..ce4fd2462
--- /dev/null
+++ b/sql-ledger/templates/Dutch-income_statement.html
@@ -0,0 +1,83 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>INKOMSTEN OVERZICHT
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INKOMSTEN<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Totaal Inkomsten</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>ONKOSTEN<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Totaal Onkosten</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>WINST / (VERLIES)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
+
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Dutch-invoice.html b/sql-ledger/templates/Dutch-invoice.html
new file mode 100644
index 000000000..9dc656c88
--- /dev/null
+++ b/sql-ledger/templates/Dutch-invoice.html
@@ -0,0 +1,239 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>F A C T U U R</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Factuurdatum</th><td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Vervaldatum</th><td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Factuurnummer</th><td>&nbsp;</td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Factuuradres:</th>
+ <th align=left><font color=ffffff>Verzendadres:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>Regel</th> -->
+ <th align=left><font color=ffffff>Artikelnummer</th>
+ <th align=left><font color=ffffff>Omschrijving</th>
+ <th><font color=ffffff>Aantal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Prijs</th>
+ <th><font color=ffffff>Korting</th>
+ <th><font color=ffffff>Totaal</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=5 align=right>Subtotaal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right>BTW <%taxrate%>%</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Betaald</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Betalen binnen <b><%terms%></b> dagen</td>
+ <th colspan=2 align=right>Openstaand</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Opmerkingen</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Alle prijzen in <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <th colspan=7>
+ Gaarne u betaling overmaken op onderstaande giro- of bankrekening
+ <br>ten name van <%company%>
+ <br>onder vermelding van het factuurnummer.
+ </th>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Op al onze aanbiedingen/leveringen zijn, met uitsluiting van eventuele inkoop- of andere voorwaarden van de opdrachtgever,
+<br>de Algemene Voorwaarden van <%company%> van toepassing.
+<br>Deze Algemene Voorwaarden zijn gedeponeerd bij de Kamer van Koophandel te ........
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+ <tr>
+ <th colspan=7 align=left><font size=-2>BTW nummer:<%taxnumber%></th>
+ </tr>
+
+ <tr>
+ <th colspan=7 align=left><font size=-2>Kamer van Koophandel te ...... nummer:<%businessnumber%></th>
+ </tr>
+
+ <tr>
+ <th colspan=7 align=left><font size=-2>Girorekening:.........</th>
+ </tr>
+
+ <tr>
+ <th colspan=7 align=left><font size=-2>Bankrekening:..........</th>
+ </tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Dutch-invoice.tex b/sql-ledger/templates/Dutch-invoice.tex
new file mode 100644
index 000000000..c19d8e2cf
--- /dev/null
+++ b/sql-ledger/templates/Dutch-invoice.tex
@@ -0,0 +1,138 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Disc} & \textbf{Amount} \\
+ & carried forward from page <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{F A K T U U R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%invdate%> \\
+ \textbf{Faktuurnummer} & <%invnumber%> \\
+ \textbf{Klantnummer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Artikelnr} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Prijs} & \textbf{Korting} & \textbf{Bedrag} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotaal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Totaal} & \textbf{<%total%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle prijzen in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Dank voor uw gewaardeerde klandizie!}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-packing_list.html b/sql-ledger/templates/Dutch-packing_list.html
new file mode 100644
index 000000000..aea6ba7ba
--- /dev/null
+++ b/sql-ledger/templates/Dutch-packing_list.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>P A K B O N</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Factuurdatum</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Factuurnummer</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Verzendadres:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Artikelnummer</th>
+ <th align=left><font color=ffffff>Omschrijving</th>
+ <th><font color=ffffff>Aantal</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Opmerkingen</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+
diff --git a/sql-ledger/templates/Dutch-packing_list.tex b/sql-ledger/templates/Dutch-packing_list.tex
new file mode 100644
index 000000000..84289bc33
--- /dev/null
+++ b/sql-ledger/templates/Dutch-packing_list.tex
@@ -0,0 +1,114 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefoon & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Bin} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{P A K B O N} \parbox{0.3cm}{\hfill} \textbf{L I S T}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%invdate%> \\
+ \textbf{Faktuurnummer} & <%invnumber%> \\
+ \textbf{Klantnummer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Bin} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Dank voor uw gewaardeerde klandizie!}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-purchase_order.html b/sql-ledger/templates/Dutch-purchase_order.html
new file mode 100644
index 000000000..0cb58d7e4
--- /dev/null
+++ b/sql-ledger/templates/Dutch-purchase_order.html
@@ -0,0 +1,186 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>I N K O O P&nbsp;&nbsp;B E S T E L L I N G</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Bestel Datum</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Lever datum</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Bestel nummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Omschrijving</th>
+ <th><font color=ffffff>Aantal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Prijs</th>
+ <th><font color=ffffff>Bedrag</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotaal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Betalings termijn <b><%terms%></b> dagen</td>
+ <th colspan=2 align=right>Totaal</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Alle prijzen in <b><%currency%></b>'s
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>&nbsp;
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Dutch-purchase_order.tex b/sql-ledger/templates/Dutch-purchase_order.tex
new file mode 100644
index 000000000..c6c68d12c
--- /dev/null
+++ b/sql-ledger/templates/Dutch-purchase_order.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefoon & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotaal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Bestel Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Prijs} & \textbf{Bedrag} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{I N K O O P B E S T E L L I N G} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Gewenste Leverdatum} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Bestel Nummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Prijs} & \textbf{Bedrag} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotaal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle prijzen in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-receipt.tex b/sql-ledger/templates/Dutch-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Dutch-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-sales_order.html b/sql-ledger/templates/Dutch-sales_order.html
new file mode 100644
index 000000000..42b20a9c0
--- /dev/null
+++ b/sql-ledger/templates/Dutch-sales_order.html
@@ -0,0 +1,208 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>V E R K O O P&nbsp;&nbsp;B E S T E L L I N G</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Bestel Datum</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Gewenste Leverdatum</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Bestel Nummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Aan:</th>
+ <th align=left><font color=ffffff>Verzenden aan:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Omschrijving</th>
+ <th><font color=ffffff>Aantal</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Prijs</th>
+ <th><font color=ffffff>Korting</th>
+ <th><font color=ffffff>Bedrag</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Totaal</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Subtotaal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> over <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Betalingstermijn <b><%terms%></b> dagen</td>
+ <th colspan=2 align=right>Totaal</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Totaal bedrag is inclusief BTW.</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Opmerkingen:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Alle prijzen in <b><%currency%></b>'s
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>&nbsp;
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Dutch-sales_order.tex b/sql-ledger/templates/Dutch-sales_order.tex
new file mode 100644
index 000000000..79acb4d32
--- /dev/null
+++ b/sql-ledger/templates/Dutch-sales_order.tex
@@ -0,0 +1,134 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefoon & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotaal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Prijs} & \textbf{Korting} & \textbf{Bedrag} \\
+ & Transport van <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{V E R K O O P} \parbox{0.3cm}{\hfill} \textbf{B E S T E L L I N G}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%orddate%> \\
+ \textbf{Bestel Nummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Omschrijving} & \textbf{Aantal} &
+ \textbf{Eenheid} & \textbf{Prijs} & \textbf{Korting} & \textbf{Bedrag} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotaal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> over <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Totaal} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle prijzen in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Dutch-statement.html b/sql-ledger/templates/Dutch-statement.html
new file mode 100644
index 000000000..599a2f5ca
--- /dev/null
+++ b/sql-ledger/templates/Dutch-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>O P E N S T A A N D E &nbsp;&nbsp;F A C T U R E N</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Factuur #</th>
+ <th width=15%>Datum</th>
+ <th width=15%>Vervaldatum</th>
+ <th width=10%>Huidig</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Totaal Openstaand</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Maak de betalingen over aan<b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Dutch-statement.tex b/sql-ledger/templates/Dutch-statement.tex
new file mode 100644
index 000000000..470bb1bf1
--- /dev/null
+++ b/sql-ledger/templates/Dutch-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Factuur \#} & \textbf{Datum} & \textbf{Vervaldatum} &
+ \textbf{Huidig} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{O P E N S T A A N D E F A C T U R E N} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Factuur \#} & \textbf{Datum} & \textbf{Vervaldatum} &
+ \textbf{Huidig} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Totaal openstaand} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Maak U betalingen over aan <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Estonian-balance_sheet.html b/sql-ledger/templates/Estonian-balance_sheet.html
new file mode 100644
index 000000000..dcfa40bb4
--- /dev/null
+++ b/sql-ledger/templates/Estonian-balance_sheet.html
@@ -0,0 +1,103 @@
+<head>
+ <title>Bilanss</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BILANSS
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>AKTIVA<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>AKTIVA KOKKU</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASSIVA<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Passiva kokku</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>AKTSIAKAPITAL<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Aktsiakapital kokku</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>KOKKU PASSIVA JA AKTSIAKAPITAL</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
diff --git a/sql-ledger/templates/Estonian-check.tex b/sql-ledger/templates/Estonian-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Estonian-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Estonian-income_statement.html b/sql-ledger/templates/Estonian-income_statement.html
new file mode 100644
index 000000000..b0594ea5e
--- /dev/null
+++ b/sql-ledger/templates/Estonian-income_statement.html
@@ -0,0 +1,84 @@
+<head>
+ <title>Kasumiaruanne</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>KASUMIARUANNE
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>TULUD<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Tulud kokku</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>KULUD<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Kulud kokku</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>KASUM / (KAHJUM)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Estonian-invoice.html b/sql-ledger/templates/Estonian-invoice.html
new file mode 100644
index 000000000..8660fb866
--- /dev/null
+++ b/sql-ledger/templates/Estonian-invoice.html
@@ -0,0 +1,215 @@
+<head>
+ <title>Arve</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>A R V E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+<!-- other variables you can use include
+tel, fax, signature, username, businessnumber -->
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Kuupäev</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Arve Nr.</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Arve aadress:</th>
+ <th align=left><font color=ffffff>Tarneaadress:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Kood</th>
+ <th align=left><font color=ffffff>Selgitus</th>
+ <th colspan=2><font color=ffffff>Kogus</th>
+ <th><font color=ffffff>Hind</th>
+ <th><font color=ffffff>Alh%</th>
+ <th><font color=ffffff>Kogus</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=5 align=right>Summa</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Makstud</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3> </td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Maksetingimus <b><%terms%></b> päeva</td>
+ <th colspan=2 align=right>Lõppsumma</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Märkused</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Kõik hinnad: <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td colspan=7 align=right>Summa sõnadega: <%sum_as_words_ee%> </td></tr>
+
+<tr><td> </td></tr>
+
+<tr>
+ <th colspan=7>
+ Palun märkige pangatsheki saajaks <%company%>
+ <br>Täname meeldiva koostöö eest!
+ </th>
+</tr>
+
+
+<tr><td> </td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Maksetähtaeg <%terms%> päeva alates arve kuupäevast.
+ Intress tasumata summadelt on 1.5% kuus kuni arve täeliku tasumiseni.
+ Tagastatud toodetele kehtib 10% tagastamistasu. Enne toodete tagastamist on vajalik
+<%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud,
+<%company%> ei vastuta transpordi käigus tekkinud kahjude eest.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+<tr>
+ <th colspan=7 align=left><font size=-2><%taxdescription%> Registration <%taxnumber%></th>
+</tr>
+<%end tax%>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Estonian-invoice.tex b/sql-ledger/templates/Estonian-invoice.tex
new file mode 100644
index 000000000..bfa2f7ad6
--- /dev/null
+++ b/sql-ledger/templates/Estonian-invoice.tex
@@ -0,0 +1,147 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Faks & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Alh} & \textbf{Kokku} \\
+ & edasi kantud lehelt <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{A R V E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Kuupäev} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Klient} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Alh} & \textbf{Kokku} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Summa} & \textbf{<%total%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Kõik hinnad \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Täname meeldiva koostöö eest!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Maksetähtaeg <%terms%> päeva alates arve kuupäevast.
+ Intress tasumata summadelt on 1.5\% kuus kuni arve täeliku tasumiseni.
+ Tagastatud toodetele kehtib 10\% tagastamistasu. Enne toodete tagastamist on vajalik <%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud, <%company%> ei vastuta transpordi käigus tekkinud kahjude eest.}
+
+\end{document}
+
+
+
diff --git a/sql-ledger/templates/Estonian-packing_list.html b/sql-ledger/templates/Estonian-packing_list.html
new file mode 100644
index 000000000..000630758
--- /dev/null
+++ b/sql-ledger/templates/Estonian-packing_list.html
@@ -0,0 +1,147 @@
+<head>
+ <title>Saateleht</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>S A A T E L E H T</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Kuupäev</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Tarneaadress:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Kood</th>
+ <th align=left><font color=ffffff>Selgitus</th>
+ <th><font color=ffffff>Kogus</th>
+ <th> </th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Märkused</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Tagastatud toodetele kehtib 10% tagastamistasu. Enne toodete tagastamist on vajalik
+<%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud,
+ <%company%> ei vastuta transpordi käigus tekkinud kahjude eest.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Estonian-packing_list.tex b/sql-ledger/templates/Estonian-packing_list.tex
new file mode 100644
index 000000000..06c763a44
--- /dev/null
+++ b/sql-ledger/templates/Estonian-packing_list.tex
@@ -0,0 +1,119 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Faks & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Bin} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{S A A T E L E H T} \parbox{0.3cm}{\hfill}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Customer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Kood} & \textbf{Selgitus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Bin} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Täname meeldiva koostöö eest!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+ Tagastatud toodetele kehtib 10\% tagastamistasu. Enne toodete tagastamist on vajalik <%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud, <%company%> ei vastuta transpordi käigus tekkinud kahjude eest.}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Estonian-purchase_order.html b/sql-ledger/templates/Estonian-purchase_order.html
new file mode 100644
index 000000000..7ee0073e8
--- /dev/null
+++ b/sql-ledger/templates/Estonian-purchase_order.html
@@ -0,0 +1,195 @@
+<head>
+ <title>Ostutellimus</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>O S T U T E L L I M U S</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Tellimuse Kpv</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Required by</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Vahesumma</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Maksetähtaeg <b><%terms%></b> tööpäeva</td>
+ <th colspan=2 align=right>Kokku</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Märkused</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Kõik hinnad: <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Maksetähtaeg <%terms%> päeva alates arve kuupäevast.
+ Intress tasumata summadelt on 1.5% kuus kuni arve täeliku tasumiseni.
+ Tagastatud toodetele kehtib 10% tagastamistasu. Enne toodete tagastamist on vajalik
+<%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud,
+<%company%> ei vastuta transpordi käigus tekkinud kahjude eest.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Estonian-purchase_order.tex b/sql-ledger/templates/Estonian-purchase_order.tex
new file mode 100644
index 000000000..ee1d77871
--- /dev/null
+++ b/sql-ledger/templates/Estonian-purchase_order.tex
@@ -0,0 +1,143 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Faks & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Kogus} \\
+ & üle kantud lehelt <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{O S T U T E L L I M U S} \parbox{0.3cm}{\hfill}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Required by} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Kokku} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Summa} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Kõik hinnad \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/Estonian-receipt.tex b/sql-ledger/templates/Estonian-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Estonian-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Estonian-sales_order.html b/sql-ledger/templates/Estonian-sales_order.html
new file mode 100644
index 000000000..d608b730b
--- /dev/null
+++ b/sql-ledger/templates/Estonian-sales_order.html
@@ -0,0 +1,214 @@
+<head>
+ <title>Müügitellimus</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>M Ü Ü G I T E L L I M U S</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Tellimuse kpv</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Tarnekuupäev</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Tellija aadress:</th>
+ <th align=left><font color=ffffff>Tarneaadress:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>Nr.</th> -->
+ <th align=left><font color=ffffff>Kood</th>
+ <th align=left><font color=ffffff>Selgitus</th>
+ <th><font color=ffffff>Kogus</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Hind</th>
+ <th><font color=ffffff>Allh%</th>
+ <th><font color=ffffff>Summa</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Kokku</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Vahesumma</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Maksetähtaeg <b><%terms%></b> päeva</td>
+ <th colspan=2 align=right>Kokku</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Summa sisaldab käibemaksu</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Märkused</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Kõik hinnad <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Eritellimusel tehtud toodetel ning toodetel mida on kliendi soovil
+ kohandatud või täiendatud on tellimuse katkestamise tasu 10% tellimuse hinnast.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Estonian-sales_order.tex b/sql-ledger/templates/Estonian-sales_order.tex
new file mode 100644
index 000000000..beb32c52d
--- /dev/null
+++ b/sql-ledger/templates/Estonian-sales_order.tex
@@ -0,0 +1,141 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Faks & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Kirjeldus} & \textbf{Kokku} \\
+ & carried forward from <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{M Ü Ü G I T E L L I M U S} \parbox{0.3cm}{\hfill}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Kuupäev} & <%orddate%> \\
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Kood} & \textbf{Kirjeldus} & \textbf{Kogus} &
+ \textbf{Ühik} & \textbf{Hind} & \textbf{Alh} & \textbf{Kokku} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Vahesumma} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Summa} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Kõik hinnad \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+ Tagastatud toodetele kehtib 10\% tagastamistasu. Enne toodete tagastamist on vajalik <%company%> nõusolek. Tagastavad tooted peavad olema makstud ning kindlustatud, <%company%> ei vastuta transpordi käigus tekkinud kahjude eest.}
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Estonian-statement.html b/sql-ledger/templates/Estonian-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Estonian-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Estonian-statement.tex b/sql-ledger/templates/Estonian-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/Estonian-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/French-balance_sheet.html b/sql-ledger/templates/French-balance_sheet.html
new file mode 100644
index 000000000..56748d690
--- /dev/null
+++ b/sql-ledger/templates/French-balance_sheet.html
@@ -0,0 +1,109 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>Bilan</title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BILAN DE VÉRIFICATION
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ACTIF<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Total Actif</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASSIF<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Passif</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>BENEFICES NON DISTRIBUÉS<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Capital</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL PASSIF & CAPITAL</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/sql-ledger/templates/French-check.tex b/sql-ledger/templates/French-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/French-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/French-income_statement.html b/sql-ledger/templates/French-income_statement.html
new file mode 100644
index 000000000..e76df09a1
--- /dev/null
+++ b/sql-ledger/templates/French-income_statement.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>Compte de Résultat</title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>Compte de Résultat
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>RECETTES<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Recettes</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>DÉPENSES<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Dépenses</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>BENEFICES / PERTES (en <%currency%> )</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+</body>
+</html>
diff --git a/sql-ledger/templates/French-invoice.html b/sql-ledger/templates/French-invoice.html
new file mode 100644
index 000000000..901a31737
--- /dev/null
+++ b/sql-ledger/templates/French-invoice.html
@@ -0,0 +1,309 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>A2A <%invnumber%> <%name%></title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor="ffffff">
+
+<table width="100%">
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width="100%">
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tél&nbsp;: <%tel%>
+ <br>Fax&nbsp;: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>F A C T U R E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width="100%" cellspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date de facture</th><td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Date d'échéance</th><td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N° de facture</th><td>&nbsp;</td><td><%invnumber%></td></tr>
+ </tr>
+
+<!--
+ <tr>
+ <th align=right>Correspondant</th><td>&amp;nbsp;</td><td><%employee%></td>
+ </tr>
+-->
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width="100%">
+ <tr bgcolor="000000">
+ <th align=left><font color=ffffff>Adresse de facturation</font></th>
+ <th align=left><font color=ffffff>Adresse d'envoi</font></th>
+ </tr>
+
+<!--
+ d'autres variables pouvant être utilisées ici :
+ contact, shiptocontact, shiptophone, shiptofax
+-->
+
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width="100%">
+ <tr bgcolor="000000">
+<!-- <th align=right><font color="ffffff">N°</font></th> -->
+ <th align=left><font color="ffffff">N°</font></th>
+ <th align=left><font color="ffffff">Description</font></th>
+ <th><font color="ffffff">Qté</font></th>
+ <th>&nbsp;</th>
+ <th><font color="ffffff">Prix</font></th>
+ <th><font color="ffffff">Remise</font></th>
+ <th><font color="ffffff">Montant</font></th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+veuillez adapter le colspan si vous comptez inclure ce poste.
+ceci permettra de décaler le poste sous-total vers la gauche.
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+vous pouvez également utiliser netprice à la place de sellprice
+si vous ne voulez pas afficher la remise
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th colspan=5 align=right>Sous-total</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%></th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Déjà payé</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>À régler dans <b><%terms%></b> jours au plus tard.</td>
+ <th colspan=2 align=right>Solde à régler</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>À noter&nbsp;:</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Tous prix indiqués en <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<%if paid%>
+<tr>
+ <td colspan=7>
+ <table width="60%">
+ <tr>
+ <th align=left>Détail règlements</th>
+ </tr>
+ <tr>
+ <td colspan=4>
+ <hr noshade>
+ </td>
+ </tr>
+ <tr>
+ <th align=left>Date</th>
+ <th align=left>Compte</th>
+ <th align=left>Source</th>
+ <th align=left>Montant</th>
+ </tr>
+<%end paid%>
+
+<%foreach payment%>
+ <tr>
+ <td><%paymentdate%></td>
+ <td><%paymentaccount%></td>
+ <td><%paymentsource%></td>
+ <td><%payment%></td>
+ </tr>
+<%end payment%>
+
+<%if paid%>
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>&nbsp;</td>
+</tr>
+<%end paid%>
+
+<tr>
+ <th colspan=7>
+ <!-- <br>Merci beaucoup&amp;nbsp;! -->
+ </th>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+ <td><font size=-3>
+ &nbsp;
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<!-- <%foreach tax%>
+ <tr>
+ <th colspan=7 align=left><font size=-2><%taxdescription%> Numéro de TVA <%taxnumber%></font></th>
+ </tr>
+<%end tax%> -->
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=7 align=left><font size=-2>Les taxes affichés sont inclus dans le prix.</font></th>
+ </tr>
+<%end taxincluded%>
+
+<!-- business number
+ <tr>
+ <th colspan=7 align=left><font size=-2>Régistre de Commerce&amp;nbsp;: <%businessnumber%></font></th>
+ </tr>
+-->
+
+<!-- information banquaire -->
+ <tr><td>
+ <h6><center>N° TVA&nbsp;: &nbsp;&nbsp;Banque&nbsp;: &nbsp;&nbsp;N° de compte&nbsp;: &nbsp;&nbsp;Code SWIFT&nbsp;: </center>
+ </h6>
+ </td>
+ </tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/sql-ledger/templates/French-invoice.tex b/sql-ledger/templates/French-invoice.tex
new file mode 100644
index 000000000..2896fc936
--- /dev/null
+++ b/sql-ledger/templates/French-invoice.tex
@@ -0,0 +1,151 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage[frenchb]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{tabularx}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Téléphone & <%tel%>\\
+ Télécopieur & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Prix} & \textbf{Remise} & \textbf{Montant} \\
+ & reporté de la page <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{F A C T U R E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date de facturation} & <%invdate%> \\
+ \textbf{Numéro de facture} & <%invnumber%> \\
+ \textbf{Numéro de client} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Prix} & \textbf{Remise} & \textbf{Montant} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> de <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%total%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Tous les prix indiqués sont en \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Merci de faire affaire avec nous!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Le paiement doit être acquitté au plus tard <%terms%> jours à partir de
+la date de facturation. Des intérêts seront perçus à raison de 1.5\% par
+mois après <%duedate%> jusqu'à ce que le paiement soit complet. Les
+éléments retournés seront sujets à un supplément de remmagasinnage de
+10\%. Une autorisation de renvoi doit être obtenue au préalable auprès de
+<%company%>. Les frais de transports et d'assurance sur les éléments
+retournés devront être couvert par le client de façon appropriée.
+<%company%> ne peut être tenue responsable des dommages survenus pendant
+le transit.}
+
+\end{document}
diff --git a/sql-ledger/templates/French-packing_list.html b/sql-ledger/templates/French-packing_list.html
new file mode 100644
index 000000000..3fa2fec93
--- /dev/null
+++ b/sql-ledger/templates/French-packing_list.html
@@ -0,0 +1,152 @@
+CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>A2A <%invnumber%> <%name%></title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>L I S T E&nbsp;&nbsp;D ' E N V O I</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date de facture&nbsp;:</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Numéro de facture&nbsp;:</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Adresse d'envoi</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>N°</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qté</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=center><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>À noter&nbsp;:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right><b>EXPÉDIÉ PAR&nbsp;:
+ <%shippingpoint%></b>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3><!--
+ Conditions d'envoi :
+ Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit. -->
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/sql-ledger/templates/French-packing_list.tex b/sql-ledger/templates/French-packing_list.tex
new file mode 100644
index 000000000..87113deab
--- /dev/null
+++ b/sql-ledger/templates/French-packing_list.tex
@@ -0,0 +1,125 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage[frenchb]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{tabularx}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Téléphone & <%tel%>\\
+ Télécopieur & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Bin} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{L I S T E} \parbox{0.3cm}{\hfill} \textbf{D E}
+\parbox{0.3cm}{\hfill} \textbf{P A Q U E T A G E}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date de facture} & <%invdate%> \\
+ \textbf{Numéro de facture} & <%invnumber%> \\
+ \textbf{Numéro de client} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Bin} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Merci de faire affaire avec nous!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Les éléments retournés seront sujets à un supplément de remmagasinnage de
+10\%. Une autorisation de renvoi doit être obtenue au préalable auprès de
+<%company%>. Les frais de transports et d'assurance sur les éléments
+retournés devront être couvert par le client de façon appropriée.
+<%company%> ne peut être tenue responsable des dommages survenus pendant
+le transit.}
+
+\end{document}
diff --git a/sql-ledger/templates/French-purchase_order.html b/sql-ledger/templates/French-purchase_order.html
new file mode 100644
index 000000000..a5da0ad67
--- /dev/null
+++ b/sql-ledger/templates/French-purchase_order.html
@@ -0,0 +1,207 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>Commande <%ordnumber%> <%name%></title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tél&nbsp;: <%tel%>
+ <br>Fax&nbsp;: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>B O N&nbsp;&nbsp;D E&nbsp;&nbsp;C O M M A N D E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% cellspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date commande</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Requis pour</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N° commande</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Commandé par</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>N°</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qté</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Prix</th>
+ <th><font color=ffffff>Montant</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+veuillez ajuster le colspan si vous voulez inclure ce poste pour décaler le sous-total vers la droite.
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Sous-total</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>À régler dans <b><%terms%></b> jours au plus tard</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>À noter&nbsp;:</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ Tous prix indiqués en <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>
+<!--
+<font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full. Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+-->
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/French-purchase_order.tex b/sql-ledger/templates/French-purchase_order.tex
new file mode 100644
index 000000000..670d59ca4
--- /dev/null
+++ b/sql-ledger/templates/French-purchase_order.tex
@@ -0,0 +1,143 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage[frenchb]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{tabularx}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Téléphone & <%tel%>\\
+ Télécopieur & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & reporté de la page <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{B O N} \parbox{0.3cm}{\hfill} \textbf{D E} \parbox{0.3cm}{\hfill}
+\textbf{C O M M A N D E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date de la commande} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Livrable le} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Numéro de commande} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Prix} & \textbf{Montant} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> de <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Tous les prix indiqués sont en \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
diff --git a/sql-ledger/templates/French-receipt.tex b/sql-ledger/templates/French-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/French-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/French-sales_order.html b/sql-ledger/templates/French-sales_order.html
new file mode 100644
index 000000000..492e75e6c
--- /dev/null
+++ b/sql-ledger/templates/French-sales_order.html
@@ -0,0 +1,229 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>Commande <%ordnumber%> <%name%></title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+<body bgcolor="ffffff">
+
+<table width="100%">
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width="100%">
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Tél&nbsp;: <%tel%>
+ <br>Fax&nbsp;: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>B O N&nbsp;&nbsp;&nbsp;D E&nbsp;&nbsp;&nbsp;C O M M A N D E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% cellspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date commande</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Requis pour</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>N° commande</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width="100%">
+ <tr bgcolor="000000">
+ <th align=left><font color="ffffff">Commandé par</th>
+ <th align=left><font color="ffffff">Adresse d'envoi</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width="100%">
+ <tr bgcolor="000000">
+<!-- <th align=right><font color="ffffff">N°</th> -->
+ <th align=left><font color="ffffff">N°</th>
+ <th align=left><font color="ffffff">Description</th>
+ <th><font color="ffffff">Qté</th>
+ <th>&nbsp;</th>
+ <th><font color="ffffff">Prix</th>
+ <th><font color="ffffff">Remise</th>
+ <th><font color="ffffff">Montant</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <th colspan=5 align=right>Sous-total</th>
+ <td colspan=2 align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%></th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>À régler dans <b><%terms%></b> jours au plus tard</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Taxe comprise dans Total</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>À noter&nbsp;:</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Tous prix indiqués en <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width="100%">
+ <tr valign=top>
+ <td><font size=-3>
+<!--
+ A 10% order cancellation fee will be applied for any special order
+ products or products that have been customized, enhanced or
+ upgraded at customers request.
+-->
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ <tr>
+ <td colspan=5>
+ <h6><center>N° TVA&nbsp;: &nbsp;&nbsp;Banque&nbsp;: &nbsp;&nbsp;N° de compte&nbsp;: &nbsp;&nbsp;Code SWIFT&nbsp;: </center>
+ </h6>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
diff --git a/sql-ledger/templates/French-sales_order.tex b/sql-ledger/templates/French-sales_order.tex
new file mode 100644
index 000000000..88e142fce
--- /dev/null
+++ b/sql-ledger/templates/French-sales_order.tex
@@ -0,0 +1,144 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage[frenchb]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage{tabularx}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Téléphone & <%tel%>\\
+ Télécopieur & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Prix} & \textbf{Remise} & \textbf{Montant} \\
+ & reporté de la page <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{C O M M A N D E} \parbox{0.3cm}{\hfill} \textbf{C L I E N T}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date de la commande} & <%orddate%> \\
+ \textbf{Numéro de commande} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Numéro} & \textbf{Description} & \textbf{Qté} &
+ \textbf{Unité} & \textbf{Prix} & \textbf{Remise} & \textbf{Montant} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Sous-total} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> de <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Tous les prix indiqués sont en \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Un supplément de 10% sera appliqué à toute commande spécifique et à tout
+produit adapté, amélioré ou mis-à-jour à la demande du client. Les
+éléments non-retournables sont indiqués ci-dessus.
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/French-statement.html b/sql-ledger/templates/French-statement.html
new file mode 100644
index 000000000..c2c9a5d07
--- /dev/null
+++ b/sql-ledger/templates/French-statement.html
@@ -0,0 +1,133 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional">
+
+<html>
+
+<head>
+
+<title>Extrait de compte pour <%name%></title>
+<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-15">
+
+</head>
+
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th></th>
+ <td align=right>
+ <h4>
+ Tél&nbsp;: <%tel%>
+ <br>Fax&nbsp;: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>E X T R A I T&nbsp;&nbsp;D E&nbsp;&nbsp;C O M P T E</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tél&nbsp;: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax&nbsp;: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Facture n°</th>
+ <th width=15%>Date</th>
+ <th width=15%>Echeance</th>
+ <th width=10%>Actuel</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Solde impayé</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Tout paiement au nom de <b><%company%></b>
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+</body>
+</html>
diff --git a/sql-ledger/templates/French-statement.tex b/sql-ledger/templates/French-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/French-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/German-balance_sheet.html b/sql-ledger/templates/German-balance_sheet.html
new file mode 100644
index 000000000..f0d6f5e18
--- /dev/null
+++ b/sql-ledger/templates/German-balance_sheet.html
@@ -0,0 +1,100 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BILANZ
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>AKTIVA<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASSIVA<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>TOTAL</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>EIGENTUM<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>TOTAL</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL PASSIVA & EIGETNTUM</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
diff --git a/sql-ledger/templates/German-check.tex b/sql-ledger/templates/German-check.tex
new file mode 100644
index 000000000..d6256e7dc
--- /dev/null
+++ b/sql-ledger/templates/German-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Rechnung} & \textbf{Ausgestellt}
+ & \textbf{Fällig} & \textbf{Verrechnet} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/German-income_statement.html b/sql-ledger/templates/German-income_statement.html
new file mode 100644
index 000000000..aa3c22fbf
--- /dev/null
+++ b/sql-ledger/templates/German-income_statement.html
@@ -0,0 +1,78 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>GEWINN & VERLUST
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>EINNAHMEN<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Totale Einnahmen</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>AUSGABEN<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Totale Ausgaben</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>GEWINN / (VERLUST)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/German-invoice.html b/sql-ledger/templates/German-invoice.html
new file mode 100644
index 000000000..b2128c959
--- /dev/null
+++ b/sql-ledger/templates/German-invoice.html
@@ -0,0 +1,265 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telefon <%tel%>
+ <br>Telefax <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>R E C H N U N G</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Ausgestellt am</th><td width=10>&nbsp;</td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Bezahlbar bis</th><td width=10>&nbsp;</td><td><%duedate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Nummer</th><td>&nbsp;</td><td><%invnumber%></td></tr>
+ </tr>
+
+<!--
+ <tr>
+ <th align=right>Clerk:</th><td>&nbsp;</td><td><%username%></td>
+ </tr>
+-->
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>An:</th>
+ <th align=left><font color=ffffff>Lieferaddresse:</th>
+ </tr>
+
+<!--
+ other variables which can be use:
+ contact, shiptocontact, shiptophone, shiptofax
+-->
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Beschreibung</th>
+ <th><font color=ffffff>Anz.</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Preis</th>
+ <th><font color=ffffff>Rab</th>
+ <th><font color=ffffff>Total</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+<!--
+you can also use netprice instead of sellprice if you
+don't want to show the discount
+netprice = sellprice - discount
+-->
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%invtotal%></td>
+ </tr>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <tr>
+ <th colspan=5 align=right>Zwischensumme</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+<%end taxincluded%>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> auf <%taxbase%></th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th colspan=5 align=right>Bezahlt</th>
+ <td colspan=2 align=right>- <%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td colspan=3>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Bezahlbar innerhalb von <b><%terms%></b> Tagen</td>
+<%if total%>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+<%end total%>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemerkungen:</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Alle Preise in <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Rechnung ist bezahlbar innerhalb von <%terms%> Tagen.
+ Nach dem <%duedate%> werden Zinsen zu einem
+ monatlichen Satz von 1.5% verrechnet.
+ Waren bleiben im Besitz von <%company%> bis die Rechnung voll bezahlt ist.
+ Rückgaben werden mit 10% Lagergebühren belastet. Beschädigte Waren
+ und Waren ohne eine Rückgabenummer werden nicht entgegengenommen.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=7 align=left><font size=-2><%taxdescription%> Registration <%taxnumber%></th>
+ </tr>
+<%end tax%>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=7 align=left><font size=-2>Steuern sind im Preis inbegriffen.</th>
+ </tr>
+<%end taxincluded%>
+
+<!-- business number
+ <tr>
+ <th colspan=7 align=left><font size=-2>Business Number: <%businessnumber%></font></th>
+ </tr>
+-->
+
+ <tr>
+ <th colspan=7 align=left>
+ <hr>
+ <br>Bankverbindung
+ <br>Bank
+ <br>Bankleitzahl
+ <br>Konto No.
+ </td>
+ </tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/German-invoice.tex b/sql-ledger/templates/German-invoice.tex
new file mode 100644
index 000000000..0b38bb51a
--- /dev/null
+++ b/sql-ledger/templates/German-invoice.tex
@@ -0,0 +1,155 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Telefax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Rab} & \textbf{Total} \\
+ & Übertrag von Seite <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{R E C H N U N G}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%invdate%> \\
+ \textbf{Nummer} & <%invnumber%> \\
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Rab} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Zwischensumme} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> auf <%taxbase%> & <%tax%> \\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%invtotal%>} \\
+<%if paid%>
+ \textbf{Bezahlt} & <%paid%> \\
+<%end paid%>
+<%if total%>
+ \textbf{Bezahlbar} & \textbf{<%total%>} \\
+<%end total%>
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle Preise in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+%\vfill
+%\centerline{\textbf{salute}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Rechnung ist bezahlbar innerhalb von <%terms%> Tagen.
+Nach dem <%duedate%> werden Zinsen zu einem
+monatlichen Satz von 1.5\% verrechnet.
+Waren bleiben im Besitz von <%company%> bis die Rechnung voll bezahlt ist.
+Rückgaben werden mit 10 Prozent Lagergebühren belastet. Beschädigte Waren
+und Waren ohne eine Rückgabenummer werden nicht entgegengenommen.
+}
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/German-packing_list.html b/sql-ledger/templates/German-packing_list.html
new file mode 100644
index 000000000..09ef40218
--- /dev/null
+++ b/sql-ledger/templates/German-packing_list.html
@@ -0,0 +1,146 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>V E R P P A C K U N G S L I S T E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Datum</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Nummer</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Zustellung an:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+<%if shiptocontact%>
+ <p>An: <%shiptocontact%>
+<%end shiptocontact%>
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Artikel</th>
+ <th><font color=ffffff>Anz</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemerkungen</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Beschädigte Waren und Waren ohne Rückgabenummer werden nicht
+ entgegengenommen. Lagerkosten werden mit 10% berrechnet.
+ Waren müssen ausreichended verpackt und versichert sein.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/German-packing_list.tex b/sql-ledger/templates/German-packing_list.tex
new file mode 100644
index 000000000..dbfc93b61
--- /dev/null
+++ b/sql-ledger/templates/German-packing_list.tex
@@ -0,0 +1,118 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Telefax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Steige} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{P A C K I N G} \parbox{0.3cm}{\hfill} \textbf{L I S T}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%invdate%> \\
+ \textbf{Nummer} & <%invnumber%> \\
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rll@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Steige} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%bin%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Beschädigte Waren und Waren ohne Rückgabenummer werden nicht
+entgegengenommen. Lagerkosten werden mit 10\% berrechnet.
+Waren müssen ausreichended verpackt und versichert sein.
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/German-purchase_order.html b/sql-ledger/templates/German-purchase_order.html
new file mode 100644
index 000000000..9771d02d9
--- /dev/null
+++ b/sql-ledger/templates/German-purchase_order.html
@@ -0,0 +1,188 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telefon <%tel%>
+ <br>Telefax <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>B E S T E L L U N G</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Bestellungsdatum</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Lieferbar bis</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Bestellnummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>An:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Artikel</th>
+ <th><font color=ffffff>Anz</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Preis</th>
+ <th><font color=ffffff>Total</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Zwischensumme</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Netto <b><%terms%></b> Tage</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemerkungen</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Alle Preise in <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ &nbsp;
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/German-purchase_order.tex b/sql-ledger/templates/German-purchase_order.tex
new file mode 100644
index 000000000..f56f1a3bc
--- /dev/null
+++ b/sql-ledger/templates/German-purchase_order.tex
@@ -0,0 +1,143 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Telefax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Zwischensumme} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Total} \\
+ & Übertrag von <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{B E S T E L L U N G}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Lieferung bis} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Nummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Zwischensumme} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle Preise in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/German-receipt.tex b/sql-ledger/templates/German-receipt.tex
new file mode 100644
index 000000000..d6256e7dc
--- /dev/null
+++ b/sql-ledger/templates/German-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Rechnung} & \textbf{Ausgestellt}
+ & \textbf{Fällig} & \textbf{Verrechnet} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/German-sales_order.html b/sql-ledger/templates/German-sales_order.html
new file mode 100644
index 000000000..edb8b9076
--- /dev/null
+++ b/sql-ledger/templates/German-sales_order.html
@@ -0,0 +1,213 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telefon <%tel%>
+ <br>Telefax <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>B E S T E L L U N G</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Datum</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Lieferbar bei</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Bestellnummer</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Verrechnet An:</th>
+ <th align=left><font color=ffffff>Lieferaddresse:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Nummer</th>
+ <th align=left><font color=ffffff>Artikel</th>
+ <th><font color=ffffff>Anz</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Preis</th>
+ <th><font color=ffffff>Rab</th>
+ <th><font color=ffffff>Total</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%discount%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=7><hr noshade></td>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan=5 align=right>Total</th>
+ <td colspan=2 align=right><%ordtotal%></td>
+ </tr>
+<%end taxincluded%>
+
+<%if not taxincluded%>
+ <tr>
+ <th colspan=5 align=right>Zwischensumme</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+<%end taxincluded%>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=5 align=right><%taxdescription%> auf <%taxbase%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=5><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=3>Netto <b><%terms%></b> Tage</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%ordtotal%></th>
+ </tr>
+<%if taxincluded%>
+ <tr>
+ <td colspan=3>Steuern sind im Preis inbegriffen</td>
+ </tr>
+<%end taxincluded%>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Bemerkungen</td>
+ <td><%notes%></td>
+<%end notes%>
+ <td align=right>
+ Alle Preise in <b><%currency%></b>
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Spezialprodukte werden nicht zurückgenommen. Für alle anderen Waren
+ wird eine 10% Stornogebühr verrechnet.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/German-sales_order.tex b/sql-ledger/templates/German-sales_order.tex
new file mode 100644
index 000000000..21948c682
--- /dev/null
+++ b/sql-ledger/templates/German-sales_order.tex
@@ -0,0 +1,142 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telefon & <%tel%>\\
+ Telefax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Zwischensumme} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Rab} & \textbf{Total} \\
+ & Übertrag von Seite <%lastpage%> & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{B E S T E L L U N G}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Datum} & <%orddate%> \\
+ \textbf{Nummer} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrrr@{}}
+ \textbf{Nummer} & \textbf{Artikel} & \textbf{Anz} &
+ \textbf{Einh} & \textbf{Preis} & \textbf{Rab} & \textbf{Total} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%discount%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Zwischensumme} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> auf <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ Alle Preise in \textbf{<%currency%>}.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Spezialprodukte werden nicht zurückgenommen. Für alle anderen Waren
+wird eine 10\% Stornogebühr verrechnet.
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/German-statement.html b/sql-ledger/templates/German-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/German-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/German-statement.tex b/sql-ledger/templates/German-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/German-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Service-balance_sheet.html b/sql-ledger/templates/Service-balance_sheet.html
new file mode 100644
index 000000000..478caabca
--- /dev/null
+++ b/sql-ledger/templates/Service-balance_sheet.html
@@ -0,0 +1,100 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BALANCE SHEET
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ASSETS<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td> </td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL ASSETS</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>LIABILITIES<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Liabilities</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>SHAREHOLDER'S EQUITY<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total Equity</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>TOTAL LIABILITIES & EQUITY</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
+
+
+
diff --git a/sql-ledger/templates/Service-check.tex b/sql-ledger/templates/Service-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Service-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Service-income_statement.html b/sql-ledger/templates/Service-income_statement.html
new file mode 100644
index 000000000..e9d6a4002
--- /dev/null
+++ b/sql-ledger/templates/Service-income_statement.html
@@ -0,0 +1,82 @@
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>INCOME STATEMENT
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INCOME<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4> </td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Income</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>EXPENSES<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td> </td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td> </td>
+ <th align=left>Total Expenses</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>INCOME / (LOSS)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
+
+
+
+
+
+
+
+
diff --git a/sql-ledger/templates/Service-invoice.html b/sql-ledger/templates/Service-invoice.html
new file mode 100644
index 000000000..8ae689775
--- /dev/null
+++ b/sql-ledger/templates/Service-invoice.html
@@ -0,0 +1,226 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ <br>Tel/Fax <%tel%> / <%fax%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>I N V O I C E</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+<!-- prepared by: <%username%>
+-->
+
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Description</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%description%></td>
+ <td>&nbsp;</td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=3><hr noshade></td>
+ </tr>
+
+ <tr>
+<%if taxincluded%>
+ <td>&nbsp;</td>
+ <th align=right>Total</th>
+ <td align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <td>&nbsp;</td>
+ <th align=right>Subtotal</th>
+ <td align=right><%subtotal%></td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=2 align=right><%taxdescription%></th>
+ <td align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+<!--
+ <%taxbase%> = total netamount for each tax bracket
+ <%taxrate%> = taxrate in percent
+-->
+
+<%if paid%>
+ <tr>
+ <td>&nbsp;</td>
+ <th align=right>Paid</th>
+ <td align=right><%paid%></td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td colspan=2><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td>
+<%if terms%>
+Terms &nbsp;Net <b><%terms%></b> days
+<%end terms%>
+</td>
+ <th align=right>Total</th>
+ <th align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<%if notes%>
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+ <td align=right>
+ &nbsp;
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+<%end notes%>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <th colspan=3>
+ Please make check payable to <%company%>
+ <br>Thank you for your valued business!
+ </th>
+</tr>
+
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=3 align=left><font size=-2><%taxdescription%> Registration <%taxnumber%></th>
+ </tr>
+<%end tax%>
+
+<!--
+ %username% = user name
+ %businessnumber% = business number
+-->
+
+<!-- banking information
+ <tr>
+ <th colspan=3 align=left><font size=-2>Banking Information:
+ <br>Bank
+ <br>Transit No.
+ <br>Account No.
+ </th>
+ </tr>
+-->
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Service-invoice.tex b/sql-ledger/templates/Service-invoice.tex
new file mode 100644
index 000000000..810a50e81
--- /dev/null
+++ b/sql-ledger/templates/Service-invoice.tex
@@ -0,0 +1,151 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{I N V O I C E}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Customer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+<%foreach number%>
+ <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%> \\
+<%end tax%>
+<%if paid%>
+ \textbf{Paid} & - <%paid%> \\
+<%end paid%>
+ \hline
+ \textbf{Balance Owing} & \textbf{<%total%>} \\
+
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+\vfill
+\centerline{\textbf{Thank You for your valued business!}}
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+Payment due NET <%terms%> Days from date of Invoice. Interest on overdue
+amounts will acrue at the rate of 1.5\% per month starting <%duedate%>
+until paid in full.
+}
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/Service-packing_list.html b/sql-ledger/templates/Service-packing_list.html
new file mode 100644
index 000000000..07ba8d61d
--- /dev/null
+++ b/sql-ledger/templates/Service-packing_list.html
@@ -0,0 +1,148 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr>
+ <td width=10>
+ </td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <th colspan=2>
+ <h4 align=center>P A C K I N G &nbsp;&nbsp; L I S T</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Date</th><td width=10> </td><td><%invdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td></td><td><%invnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Ship To:</th>
+ </tr>
+
+ <tr>
+ <td><%shiptoname%>
+ <br><%shiptoaddr1%>
+ <br><%shiptoaddr2%>
+ <br><%shiptoaddr3%>
+ <br><%shiptoaddr4%>
+<%if shiptocontact%>
+ <p>Attn: <%shiptocontact%>
+<%end shiptocontact%>
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ <%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Service-packing_list.tex b/sql-ledger/templates/Service-packing_list.tex
new file mode 100644
index 000000000..b5a6a8a11
--- /dev/null
+++ b/sql-ledger/templates/Service-packing_list.tex
@@ -0,0 +1,120 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%invnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+\newpage
+
+\markright{<%company%>\hfill <%invnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rl@{}}
+ \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+
+\vspace{3.5cm}
+
+\textbf{P A C K I N G} \parbox{0.3cm}{\hfill} \textbf{L I S T}
+
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%invdate%> \\
+ \textbf{Number} & <%invnumber%> \\
+ \textbf{Customer} & <%customer_id%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rl@{}}
+ \textbf{Description} & \textbf{Qt'y} & \textbf{Unit} \\
+<%foreach number%>
+ <%description%> & <%qty%> & <%unit%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+%\vfill
+%\centerline{\textbf{Thank You for your valued business!}}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny
+%Items returned are subject to a 10\% restocking charge.
+%A return authorization must be obtained from <%company%> before goods are
+%returned. Returns must be shipped prepaid and properly insured.
+%<%company%> will not be responsible for damages during transit.}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Service-purchase_order.html b/sql-ledger/templates/Service-purchase_order.html
new file mode 100644
index 000000000..f2e9f7e22
--- /dev/null
+++ b/sql-ledger/templates/Service-purchase_order.html
@@ -0,0 +1,194 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telephone: <%tel%>
+ <br>Facsimile: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>P U R C H A S E &nbsp;&nbsp; O R D E R</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Order Date</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Required by</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Terms Net <b><%terms%></b> days</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ All prices in <b><%currency%></b> Funds
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full. Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Service-purchase_order.tex b/sql-ledger/templates/Service-purchase_order.tex
new file mode 100644
index 000000000..e6cc92c25
--- /dev/null
+++ b/sql-ledger/templates/Service-purchase_order.tex
@@ -0,0 +1,143 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{P U R C H A S E} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%orddate%> \\
+<%if reqdate%>
+ \textbf{Required by} & <%reqdate%> \\
+<%end reqdate%>
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}lp{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Number} & \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+<%foreach number%>
+ <%number%> & <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
+
diff --git a/sql-ledger/templates/Service-receipt.tex b/sql-ledger/templates/Service-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Service-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Service-sales_order.html b/sql-ledger/templates/Service-sales_order.html
new file mode 100644
index 000000000..319cc3bd7
--- /dev/null
+++ b/sql-ledger/templates/Service-sales_order.html
@@ -0,0 +1,198 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+<tr valign=bottom>
+ <td width=10>&nbsp;</td>
+ <td>
+
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+
+ <td align=right>
+ <h4>
+ Telelephone: <%tel%>
+ <br>Facsimile: <%fax%>
+ </h4>
+ </td>
+ </tr>
+
+ <tr>
+ <th colspan=3>
+ <h4>S A L E S &nbsp;&nbsp; O R D E R</h4>
+ </th>
+ </tr>
+
+ </table>
+
+
+ <table width=100% callspacing=0 cellpadding=0>
+
+ <tr>
+ <td align=right>
+ <table>
+ <tr>
+ <th align=right>Order Date</th><td width=10>&nbsp;</td><td><%orddate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Required by</th><td width=10>&nbsp;</td><td><%reqdate%></td>
+ </tr>
+
+ <tr>
+ <th align=right>Number</th><td>&nbsp;</td><td><%ordnumber%></td></tr>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ </td>
+ </table>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <th align=left><font color=ffffff>To:</th>
+ </tr>
+
+ <tr>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+<%if contact%>
+ <p>Attn: <%contact%>
+%end contact%>
+
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+<!-- <th align=right><font color=ffffff>No.</th> -->
+ <th align=left><font color=ffffff>Number</th>
+ <th align=left><font color=ffffff>Description</th>
+ <th><font color=ffffff>Qt'y</th>
+ <th>&nbsp;</th>
+ <th><font color=ffffff>Price</th>
+ <th><font color=ffffff>Amount</th>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+<!-- <td align=right><%runningnumber%>.</td>
+adjust the colspan if you include this to shift subtotal one to the right
+-->
+ <td><%number%></td>
+ <td><%description%></td>
+ <td align=right><%qty%></td>
+ <td><%unit%></td>
+ <td align=right><%sellprice%></td>
+ <td align=right><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan=6><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th colspan=4 align=right>Subtotal</th>
+ <td colspan=2 align=right><%subtotal%></td>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th colspan=4 align=right><%taxdescription%> @ <%taxrate%> %</th>
+ <td colspan=2 align=right><%tax%></td>
+ </tr>
+<%end tax%>
+
+ <tr>
+ <td colspan=2>&nbsp;</td>
+ <td colspan=4><hr noshade></td>
+ </tr>
+
+ <tr>
+ <td colspan=2>Terms Net <b><%terms%></b> days</td>
+ <th colspan=2 align=right>Total</th>
+ <th colspan=2 align=right><%total%></th>
+ </tr>
+
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+<%if notes%>
+ <td>Notes</td>
+ <td><pre><%notes%></pre></td>
+<%end notes%>
+ <td align=right>
+ All prices in <b><%currency%></b> Funds
+ <br><%shippingpoint%>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+</tr>
+
+<tr><td>&nbsp;</td></tr>
+
+<tr>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><font size=-3>
+ Payment due NET <%terms%> Days from date of Invoice.
+ Interest on overdue amounts will acrue at the rate of 1.5% per month
+ from due date until paid in full. Items returned are subject to
+ a 10% restocking charge. A return authorization must be obtained
+ from <%company%> before goods are returned. Returns must be shipped
+ prepaid and properly insured. <%company%> will not be responsible
+ for damages during transit.
+ </font>
+ </td>
+ <td width=150>
+ X <hr noshade>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Service-sales_order.tex b/sql-ledger/templates/Service-sales_order.tex
new file mode 100644
index 000000000..c5664e056
--- /dev/null
+++ b/sql-ledger/templates/Service-sales_order.tex
@@ -0,0 +1,139 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rr@{}}
+ Telephone & <%tel%>\\
+ Facsimile & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%ordnumber%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%ordnumber%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+ & carried forward from <%lastpage%> & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{2cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{3.5cm}
+
+\textbf{S A L E S} \parbox{0.3cm}{\hfill} \textbf{O R D E R}
+\hfill
+\begin{tabular}[t]{l@{\hspace{0.3cm}}l}
+ \textbf{Date} & <%orddate%> \\
+ \textbf{Number} & <%ordnumber%>
+\end{tabular}
+
+\vspace{1cm}
+
+\begin{tabular*}{\textwidth}{@{}p{\descrwidth}@{\extracolsep\fill}rlrr@{}}
+ \textbf{Description} & \textbf{Qt'y} &
+ \textbf{Unit} & \textbf{Price} & \textbf{Amount} \\
+<%foreach number%>
+ <%description%> & <%qty%> &
+ <%unit%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+
+\parbox{\textwidth}{
+\rule{\textwidth}{2pt}
+
+\vspace{0.2cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ <%taxdescription%> on <%taxbase%> & <%tax%>\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>}\\
+\end{tabularx}
+
+\vspace{0.3cm}
+
+\hfill
+ All prices in \textbf{<%currency%>} funds.
+
+\vspace{12pt}
+
+<%if notes%>
+ <%notes%>
+<%end if%>
+
+}
+
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+%\footnotetext[1]{\tiny }
+
+\end{document}
+
diff --git a/sql-ledger/templates/Service-statement.html b/sql-ledger/templates/Service-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Service-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Service-statement.tex b/sql-ledger/templates/Service-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/Service-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-balance_sheet.html b/sql-ledger/templates/Spanish_A4-balance_sheet.html
new file mode 100644
index 000000000..aef74d0e5
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-balance_sheet.html
@@ -0,0 +1,100 @@
+<head>
+ <title>Hoja de Balance</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>HOJA DE BALANCE
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ACTIVOS<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td>&nbsp;</td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Total de activos</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASIVOS<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total de pasivos</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>CAPITAL<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Capital total</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Total de pasivos y capital</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
diff --git a/sql-ledger/templates/Spanish_A4-check.tex b/sql-ledger/templates/Spanish_A4-check.tex
new file mode 100644
index 000000000..a1ef96935
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-check.tex
@@ -0,0 +1,71 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-income_statement.html b/sql-ledger/templates/Spanish_A4-income_statement.html
new file mode 100644
index 000000000..fbb5653b7
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-income_statement.html
@@ -0,0 +1,77 @@
+<head>
+ <title>Balance de Situación</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BALANCE DE SITUACIÓN
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INGRESOS<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4>&nbsp;</td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2>&nbsp;</td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td>&nbsp;</td>
+ <th align=left>Total de ingresos</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>GASTOS<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td>&nbsp;</td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2>&nbsp;</td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td>&nbsp;</td>
+ <th align=left>Total de gastos</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>GANANCIA/(PERDIDA)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
diff --git a/sql-ledger/templates/Spanish_A4-invoice.html b/sql-ledger/templates/Spanish_A4-invoice.html
new file mode 100644
index 000000000..d274936d0
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-invoice.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Factura de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>F A C T U R A</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%invnumber%></b></td>
+ <td><b><%invdate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%invtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_A4-invoice.tex b/sql-ledger/templates/Spanish_A4-invoice.tex
new file mode 100644
index 000000000..1d0619e97
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-invoice.tex
@@ -0,0 +1,108 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%invnumber%>} & \centering{<%invdate%>} & \centering{<%customer_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{F A C T U R A}
+\vspace{1cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \EUR \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \EUR\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%invtotal%>} \EUR\\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-packing_list.html b/sql-ledger/templates/Spanish_A4-packing_list.html
new file mode 100644
index 000000000..c34d1898a
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-packing_list.html
@@ -0,0 +1,155 @@
+<head>
+ <title>Albarán de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="5"> </th>
+ <th align="left">
+ <h4>A L B A R Á N</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Factura</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%invnumber%></b></td>
+ <td><b><%invdate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="5">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="5">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%invtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_A4-packing_list.tex b/sql-ledger/templates/Spanish_A4-packing_list.tex
new file mode 100644
index 000000000..312c349ba
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-packing_list.tex
@@ -0,0 +1,108 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Número} & \centering{Fecha} & C. Cliente\\
+ \centering{<%ordnumber%>} & \centering{<%invnumber%>} & \centering{<%invdate%>} & \centering{<%customer_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{A L B A R Á N}
+\vspace{1cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+\vspace{0.5cm}
+
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \EUR \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \EUR\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%invtotal%>} \EUR\\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-purchase_order.html b/sql-ledger/templates/Spanish_A4-purchase_order.html
new file mode 100644
index 000000000..693fe65f7
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-purchase_order.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Pedido de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>P E D I D O</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Proveedor</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%orddate%></b></td>
+ <td><b><%vendor_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align="right">Total</th>
+ <td align="right"><%ordtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%ordtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_A4-purchase_order.tex b/sql-ledger/templates/Spanish_A4-purchase_order.tex
new file mode 100644
index 000000000..f8300aee0
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-purchase_order.tex
@@ -0,0 +1,107 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%ordnumber%>} & \centering{<%orddate%>} & \centering{<%vendor_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{P E D I D O}
+\vspace{1cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \EUR \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \EUR\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>} \EUR\\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-receipt.tex b/sql-ledger/templates/Spanish_A4-receipt.tex
new file mode 100644
index 000000000..a1ef96935
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-sales_order.html b/sql-ledger/templates/Spanish_A4-sales_order.html
new file mode 100644
index 000000000..d54f37581
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-sales_order.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Presupuesto de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>P R E S U P U E S T O</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%orddate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%ordtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%ordtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_A4-sales_order.tex b/sql-ledger/templates/Spanish_A4-sales_order.tex
new file mode 100644
index 000000000..f8300aee0
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-sales_order.tex
@@ -0,0 +1,107 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%ordnumber%>} & \centering{<%orddate%>} & \centering{<%vendor_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{P E D I D O}
+\vspace{1cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \EUR \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \EUR\\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>} \EUR\\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_A4-statement.html b/sql-ledger/templates/Spanish_A4-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Spanish_A4-statement.tex b/sql-ledger/templates/Spanish_A4-statement.tex
new file mode 100644
index 000000000..268bb1a33
--- /dev/null
+++ b/sql-ledger/templates/Spanish_A4-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[a4paper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-balance_sheet.html b/sql-ledger/templates/Spanish_Letter-balance_sheet.html
new file mode 100644
index 000000000..aef74d0e5
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-balance_sheet.html
@@ -0,0 +1,100 @@
+<head>
+ <title>Hoja de Balance</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>HOJA DE BALANCE
+<br><%period%>
+</h2>
+
+<table border=0>
+<tr>
+ <th align=left width=400 colspan=2>ACTIVOS<br><hr align=left width=250 size=5 noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach asset_account%>
+<tr>
+ <td>&nbsp;</td>
+ <td><%asset_account%></td>
+ <td align=right><%asset_this_period%></td>
+ <td align=right><%asset_last_period%></td>
+</tr>
+<%end asset_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Total de activos</th>
+ <td align=right><%total_assets_this_period%><hr noshade size=2></td>
+ <td align=right><%total_assets_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>PASIVOS<b><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach liability_account%>
+<tr>
+ <td></td>
+ <td><%liability_account%></td>
+ <td align=right><%liability_this_period%></td>
+ <td align=right><%liability_last_period%></td>
+</tr>
+<%end liability_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Total de pasivos</th>
+ <td align=right><%total_liabilities_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_liabilities_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr>
+ <th align=left colspan=4>CAPITAL<br><hr align=left width=250 size=5 noshade></th>
+</tr>
+
+<%foreach equity_account%>
+<tr>
+ <td></td>
+ <td><%equity_account%></td>
+ <td align=right><%equity_this_period%></td>
+ <td align=right><%equity_last_period%></td>
+</tr>
+<%end equity_account%>
+
+<tr>
+ <td colspan=2> </td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td></td>
+ <th align=left>Capital total</th>
+ <td align=right><%total_equity_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_equity_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>Total de pasivos y capital</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+</table>
diff --git a/sql-ledger/templates/Spanish_Letter-check.tex b/sql-ledger/templates/Spanish_Letter-check.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-check.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-income_statement.html b/sql-ledger/templates/Spanish_Letter-income_statement.html
new file mode 100644
index 000000000..fbb5653b7
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-income_statement.html
@@ -0,0 +1,77 @@
+<head>
+ <title>Balance de Situación</title>
+</head>
+
+<body bgcolor=ffffff>
+
+<h2 align=center>
+<%company%>
+<br><%address%>
+
+<p>BALANCE DE SITUACIÓN
+<br><%period%>
+</h2>
+
+
+<table width=100% border=0>
+<tr>
+ <th width=400 align=left colspan=2>INGRESOS<br><hr width=300 size=5 align=left noshade></th>
+ <th><%this_period%></th>
+ <th><%last_period%></th>
+</tr>
+
+<%foreach income_account%>
+<tr>
+ <td width=4>&nbsp;</td>
+ <td><%income_account%></td>
+ <td align=right><%income_this_period%></td>
+ <td align=right><%income_last_period%></td>
+</tr>
+<%end income_account%>
+
+<tr>
+ <td colspan=2>&nbsp;</td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td>&nbsp;</td>
+ <th align=left>Total de ingresos</th>
+ <td align=right><%total_income_this_period%><hr noshade size=2></td>
+ <td align=right><%total_income_last_period%><hr noshade size=2></td>
+</tr>
+
+<tr>
+ <th align=left colspan=2>GASTOS<br><hr width=300 size=5 align=left noshade></th>
+</tr>
+
+<%foreach expense_account%>
+<tr>
+ <td>&nbsp;</td>
+ <td><%expense_account%></td>
+ <td align=right><%expenses_this_period%></td>
+ <td align=right><%expenses_last_period%></td>
+</tr>
+<%end expense_account%>
+
+<tr>
+ <td colspan=2>&nbsp;</td>
+ <td><hr noshade size=1></td>
+ <td><hr noshade size=1></td>
+</tr>
+
+<tr valign=top>
+ <td>&nbsp;</td>
+ <th align=left>Total de gastos</th>
+ <td align=right><%total_expenses_this_period%><br><hr noshade size=2</td>
+ <td align=right><%total_expenses_last_period%><br><hr noshade size=2</td>
+</tr>
+
+<tr valign=top>
+ <th align=left colspan=2>GANANCIA/(PERDIDA)</th>
+ <td align=right><%total_this_period%><br><hr noshade size=2></td>
+ <td align=right><%total_last_period%><br><hr noshade size=2></td>
+</tr>
+
+</table>
diff --git a/sql-ledger/templates/Spanish_Letter-invoice.html b/sql-ledger/templates/Spanish_Letter-invoice.html
new file mode 100644
index 000000000..d274936d0
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-invoice.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Factura de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>F A C T U R A</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%invnumber%></b></td>
+ <td><b><%invdate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%invtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_Letter-invoice.tex b/sql-ledger/templates/Spanish_Letter-invoice.tex
new file mode 100644
index 000000000..8fdd38abd
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-invoice.tex
@@ -0,0 +1,110 @@
+% ve-invoice.tex
+\documentclass[letterpaper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+%\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+%Or whatever font you want!
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%invnumber%>} & \centering{<%invdate%>} & \centering{<%customer_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{F A C T U R A}
+\vspace{1cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%invtotal%>} \\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-packing_list.html b/sql-ledger/templates/Spanish_Letter-packing_list.html
new file mode 100644
index 000000000..c34d1898a
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-packing_list.html
@@ -0,0 +1,155 @@
+<head>
+ <title>Albarán de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="5"> </th>
+ <th align="left">
+ <h4>A L B A R Á N</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="6"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Factura</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%invnumber%></b></td>
+ <td><b><%invdate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="5">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="5">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%invtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%invtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_Letter-packing_list.tex b/sql-ledger/templates/Spanish_Letter-packing_list.tex
new file mode 100644
index 000000000..bf146cad4
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-packing_list.tex
@@ -0,0 +1,108 @@
+\documentclass[letterpaper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+%\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Número} & \centering{Fecha} & C. Cliente\\
+ \centering{<%ordnumber%>} & \centering{<%invnumber%>} & \centering{<%invdate%>} & \centering{<%customer_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{A L B A R Á N}
+\vspace{1cm}
+
+<%shiptoname%>
+
+<%shiptoaddr1%>
+
+<%shiptoaddr2%>
+
+<%shiptoaddr3%>
+
+<%shiptoaddr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+\vspace{0.5cm}
+
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%invtotal%>} \\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-purchase_order.html b/sql-ledger/templates/Spanish_Letter-purchase_order.html
new file mode 100644
index 000000000..693fe65f7
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-purchase_order.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Pedido de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>P E D I D O</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Proveedor</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%orddate%></b></td>
+ <td><b><%vendor_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align="right">Total</th>
+ <td align="right"><%ordtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%ordtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_Letter-purchase_order.tex b/sql-ledger/templates/Spanish_Letter-purchase_order.tex
new file mode 100644
index 000000000..177f4b83b
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-purchase_order.tex
@@ -0,0 +1,107 @@
+\documentclass[letterpaper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+%\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%ordnumber%>} & \centering{<%orddate%>} & \centering{<%vendor_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{O R D E N \quad D E \quad C O M P R A}
+\vspace{1cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>} \\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-receipt.tex b/sql-ledger/templates/Spanish_Letter-receipt.tex
new file mode 100644
index 000000000..5b64e818e
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-receipt.tex
@@ -0,0 +1,71 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.4cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.0cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+
+\fontfamily{cmss}\fontsize{9pt}{9pt}\selectfont
+
+\parbox[t]{12cm}{
+ <%company%>
+
+ <%address%>}
+\hfill
+\parbox[t]{6cm}{\hfill <%source%>}
+
+\vspace*{0.6cm}
+
+<%text_amount%> \dotfill <%decimal%>/100 \makebox[0.5cm]{\hfill}
+
+\vspace{0.5cm}
+
+\hfill <%datepaid%> \makebox[2cm]{\hfill} <%amount%>
+
+\vspace{0.5cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+\vspace{2.8cm}
+
+<%company%>
+
+\vspace{0.5cm}
+
+<%name%> \hfill <%datepaid%> \hfill <%source%>
+
+\vspace{0.5cm}
+\begin{tabularx}{\textwidth}{lXrr@{}}
+\textbf{Invoice No.} & \textbf{Invoice Date}
+ & \textbf{Due} & \textbf{Applied} \\
+<%foreach invnumber%>
+<%invnumber%> & <%invdate%> \dotfill
+ & <%due%> & <%paid%> \\
+<%end invnumber%>
+\end{tabularx}
+
+\vfill
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-sales_order.html b/sql-ledger/templates/Spanish_Letter-sales_order.html
new file mode 100644
index 000000000..d54f37581
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-sales_order.html
@@ -0,0 +1,153 @@
+<head>
+ <title>Presupuesto de Instalaciones Industriales San José</title>
+</head>
+
+<body bgcolor="ffffff">
+ <!-- Cabecera -->
+ <table width="100%">
+ <tr valign=bottom>
+ <td width="10">&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th colspan="4"> </th>
+ <th align="left">
+ <h4>P R E S U P U E S T O</h4>
+ </th>
+ </tr>
+
+ <tr>
+ <td colspan="5"> </td>
+ </tr>
+
+ <tr>
+ <td colspan="4"> </td>
+ <td align="left"><%name%></td>
+ </tr>
+
+ <tr>
+ <td>Número</td>
+ <td>Fecha</td>
+ <td>Cód. Cliente</td>
+ <td width="10%"> </td>
+ <td><%addr1%></td>
+ </tr>
+ <tr>
+ <td><b><%ordnumber%></b></td>
+ <td><b><%orddate%></b></td>
+ <td><b><%customer_id%></b></td>
+ <td> </td>
+ <td><%addr2%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr3%></td>
+ </tr>
+ <tr>
+ <td colspan="4">
+ <td><%addr4%></td>
+ </tr>
+ </table>
+ </table>
+
+ <!-- Cuerpo -->
+ <table width=100% cellspacing=0 cellpadding=0>
+ <tr>
+ <td>
+ <table width=100%>
+ <tr bgcolor=000000>
+ <!-- <th align=left><font color=ffffff>Número</th> -->
+ <!-- <th><font color=ffffff>Cant.</th> -->
+ <th align="left"><font color="ffffff">Cant.</th>
+ <th align="left"><font color="ffffff">Descripción</th>
+ <th align="left"><font color="ffffff">Precio</th>
+ <!-- <th align="left"><font color="ffffff">Dto.</th> -->
+ <th align="left"><font color="ffffff">Importe</th>
+ </tr>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+
+<%foreach number%>
+ <tr valign=top>
+ <!-- <td><%number%></td> -->
+ <!-- <td><%unit%></td> -->
+ <td align="right"><%qty%></td>
+ <td align="left"><%description%></td>
+ <td align="right"><%sellprice%></td>
+ <!-- <td align=right><%discount%></td> -->
+ <td align="right"><%linetotal%></td>
+ </tr>
+<%end number%>
+
+ <tr>
+ <td colspan="4"><hr noshade></td>
+ </tr>
+ </table>
+
+ <!-- Subtotales, impuestos y totales -->
+ <table width="100%">
+ <tr>
+<%if taxincluded%>
+ <th align=right>Total</th>
+ <td align=right><%ordtotal%></td>
+<%end taxincluded%>
+<%if not taxincluded%>
+ <th align="right">Base imponible</th>
+ <td align="right"><%subtotal%> &euro;</td>
+<%end taxincluded%>
+ </tr>
+
+<%foreach tax%>
+ <tr>
+ <th align="right">IVA (<%taxrate%>%) sobre <%taxbase%>:</th>
+ <td align="right"><%tax%> &euro;</td>
+ </tr>
+<%end tax%>
+
+<%if paid%>
+ <tr>
+ <th align="right">Pagado:</th>
+ <td align="right"><%paid%> &euro;</td>
+ </tr>
+<%end paid%>
+
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+
+ <tr>
+ <th align="right">Total:</th>
+ <th align="right"><%ordtotal%> &euro;</th>
+ </tr>
+
+ <tr>
+ <td colspan="4">&nbsp;</td>
+ </tr>
+
+ </table>
+
+
+ <!-- Pie -->
+ <table width="100%">
+ <tr valign=top>
+<%if notes%>
+ <td>Notas</td>
+ <td><%notes%></td>
+<%end notes%>
+ </tr>
+
+<%if taxincluded%>
+ <tr>
+ <th colspan="2" align="left"><font size=-2>Los precios incluyen impuestos.</th>
+ </tr>
+<%end taxincluded%>
+
+ </table>
+
+
+</body>
+</html>
+
diff --git a/sql-ledger/templates/Spanish_Letter-sales_order.tex b/sql-ledger/templates/Spanish_Letter-sales_order.tex
new file mode 100644
index 000000000..fd51cb6ef
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-sales_order.tex
@@ -0,0 +1,107 @@
+\documentclass[letterpaper,oneside]{article}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+%\usepackage{marvosym} % Euro \EUR
+\usepackage{fancyhdr}
+\setlength{\topmargin}{0cm}
+\setlength{\topskip}{0cm}
+\setlength{\headheight}{0cm}
+\setlength{\headsep}{0.5cm}
+\setlength{\textheight}{24.2cm}
+\setlength{\textwidth}{19cm}
+\setlength{\oddsidemargin}{-1.4cm}
+\setlength{\evensidemargin}{-1.4cm}
+\setlength{\footskip}{1cm}
+
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{13.0cm}
+
+\newsavebox{\hdr}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\sbox{\hdr}{
+\begin{minipage}[t]{0.6\linewidth}
+\vspace{2.2cm}
+
+\begin{tabular}[t]{p{1.7cm}p{2.4cm}p{1.7cm}}\\
+\centering{Número} & \centering{Fecha} & C. Cliente\\
+\centering{<%ordnumber%>} & \centering{<%orddate%>} & \centering{<%vendor_id%>}
+\end{tabular}
+\end{minipage}
+
+\begin{minipage}[t]{0.4\linewidth}
+\textbf{P E D I D O}
+\vspace{1cm}
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+\end{minipage}
+
+}
+
+\pagestyle{fancy}
+\renewcommand{\headrulewidth}{0cm}
+\renewcommand{\footrulewidth}{0cm}
+\cfoot{\thepage}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+%\thispagestyle{empty} %use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+\newpage
+\usebox{\hdr}
+%\markboth{\usebox{\hdr}}{\usebox{\hdr}}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%end pagebreak%>
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\usebox{\hdr}
+\vspace{0.5cm}
+
+\begin{tabular*}{\textwidth}{rp{\descrwidth}rr}
+ \textbf{Cant.} & \textbf{Descripción} & \textbf{Precio} & \textbf{Importe} \\ \hline
+<%foreach number%>
+ <%qty%> & <%description%> & <%sellprice%> & <%linetotal%> \\
+<%end number%>
+\end{tabular*}
+
+\parbox{\textwidth}{
+\vspace{12pt}
+<%if notes%>
+ <%notes%>
+<%end if%>
+}
+
+\vfill
+
+\begin{flushright}
+\begin{tabularx}{10cm}{Xr@{}}
+ \textbf{Base imponible} & \textbf{<%subtotal%>} \\
+<%foreach tax%>
+ IVA (<%taxrate%>\%) sobre <%taxbase%> & <%tax%> \\
+<%end tax%>
+ \hline
+ \textbf{Total} & \textbf{<%ordtotal%>} \\
+\end{tabularx}
+\end{flushright}
+
+%\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\end{document}
+
diff --git a/sql-ledger/templates/Spanish_Letter-statement.html b/sql-ledger/templates/Spanish_Letter-statement.html
new file mode 100644
index 000000000..6fca322ee
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-statement.html
@@ -0,0 +1,121 @@
+
+<body bgcolor=ffffff>
+
+<table width=100%>
+ <tr>
+ <td width=10>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <td>
+ <h4>
+ <%company%>
+ <br><%address%>
+ </h4>
+ </td>
+ <th><img src=http://www.sql-ledger.org/images/sql-ledger.png border=0 width=64 height=58></th>
+ <td align=right>
+ <h4>
+ Tel: <%tel%>
+ <br>Fax: <%fax%>
+ </h4>
+ </td>
+ </tr>
+ <tr>
+ <th colspan=3><h4>S T A T E M E N T</h4></th>
+ </tr>
+ <tr>
+ <td colspan=3 align=right><%statementdate%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr valign=top>
+ <td><%name%>
+ <br><%addr1%>
+ <br><%addr2%>
+ <br><%addr3%>
+ <br><%addr4%>
+ <br>
+<%if customerphone%>
+ <br>Tel: <%customerphone%>
+<%end customerphone%>
+<%if customerfax%>
+ <br>Fax: <%customerfax%>
+<%end customerfax%>
+<%if email%>
+ <br><%email%>
+<%end email%>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>
+ <table width=100%>
+ <tr>
+ <th align=left>Invoice #</th>
+ <th width=15%>Date</th>
+ <th width=15%>Due</th>
+ <th width=10%>Current</th>
+ <th width=10%>30</th>
+ <th width=10%>60</th>
+ <th width=10%>90+</th>
+ </tr>
+<%foreach invnumber%>
+ <tr>
+ <td><%invnumber%></td>
+ <td><%invdate%></td>
+ <td><%duedate%></td>
+ <td align=right><%c0%></td>
+ <td align=right><%c30%></td>
+ <td align=right><%c60%></td>
+ <td align=right><%c90%></td>
+ </tr>
+<%end invnumber%>
+ <tr>
+ <td colspan=7><hr size=1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <td>&nbsp;</td>
+ <th align=right><%c0total%></td>
+ <th align=right><%c30total%></td>
+ <th align=right><%c60total%></td>
+ <th align=right><%c90total%></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr height=10></tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align=right>
+ <table width=50%>
+ <tr>
+ <th>Total Outstanding</th>
+ <th align=right><%total%></th>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><hr noshade></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td>Please make check payable to <b><%company%></b>.
+ </td>
+ </tr>
+ <tr height=20></tr>
+</table>
+
diff --git a/sql-ledger/templates/Spanish_Letter-statement.tex b/sql-ledger/templates/Spanish_Letter-statement.tex
new file mode 100644
index 000000000..0b63f7523
--- /dev/null
+++ b/sql-ledger/templates/Spanish_Letter-statement.tex
@@ -0,0 +1,137 @@
+\documentclass[twoside]{scrartcl}
+\usepackage[frame]{xy}
+\usepackage{tabularx}
+\usepackage[latin1]{inputenc}
+\setlength{\voffset}{0.5cm}
+\setlength{\hoffset}{-2.0cm}
+\setlength{\topmargin}{0cm}
+\setlength{\headheight}{0.5cm}
+\setlength{\headsep}{1cm}
+\setlength{\topskip}{0pt}
+\setlength{\oddsidemargin}{1.0cm}
+\setlength{\evensidemargin}{1.0cm}
+\setlength{\textwidth}{19.2cm}
+\setlength{\textheight}{24.5cm}
+\setlength{\footskip}{1cm}
+\setlength{\parindent}{0pt}
+\renewcommand{\baselinestretch}{1}
+\begin{document}
+
+\newlength{\descrwidth}\setlength{\descrwidth}{10cm}
+
+\newsavebox{\hdr}
+\sbox{\hdr}{
+ \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+ \parbox{\textwidth}{
+ \parbox[b]{12cm}{
+ <%company%>
+
+ <%address%>}\hfill
+ \begin{tabular}[b]{rrr@{}}
+ Tel & <%tel%>\\
+ Fax & <%fax%>
+ \end{tabular}
+
+ \rule[1.5ex]{\textwidth}{0.5pt}
+ }
+}
+
+\fontfamily{cmss}\fontshape{n}\selectfont
+
+\markboth{<%company%>\hfill <%statementdate%>}{\usebox{\hdr}}
+
+\pagestyle{myheadings}
+%\thispagestyle{empty} use this with letterhead paper
+
+<%pagebreak 90 27 48%>
+\end{tabular*}
+
+ \rule{\textwidth}{2pt}
+
+ \hfill
+ \begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Subtotal} & \textbf{<%sumcarriedforward%>} \\
+ \end{tabularx}
+
+\newpage
+
+\markright{<%company%>\hfill <%statementdate%>}
+
+\vspace*{-12pt}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+ carried forward from <%lastpage%> & & & & & & <%sumcarriedforward%> \\
+<%end pagebreak%>
+
+
+\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
+
+\vspace*{1.5cm}
+
+\parbox[t]{1cm}{\hfill}
+\parbox[t]{10.5cm}{
+
+<%name%>
+
+<%addr1%>
+
+<%addr2%>
+
+<%addr3%>
+
+<%addr4%>
+
+}
+\parbox[t]{7.5cm}{
+<%if customerphone%>
+Tel: <%customerphone%>
+<%end customerphone%>
+
+<%if customerfax%>
+Fax: <%customerfax%>
+<%end customerfax%>
+
+<%email%>
+}
+\hfill
+
+\vspace{1cm}
+
+\textbf{S T A T E M E N T} \hfill
+
+\hfill <%statementdate%>
+
+\vspace{2cm}
+
+\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
+ \textbf{Invoice \#} & \textbf{Date} & \textbf{Due} &
+ \textbf{Current} & \textbf{30} & \textbf{60} & \textbf{90+} \\
+<%foreach invnumber%>
+ <%invnumber%> & <%invdate%> & <%duedate%> &
+ <%c0%> & <%c30%> & <%c60%> & <%c90%> \\
+<%end invnumber%>
+\textbf{Subtotal} & & & <%c0total%> & <%c30total%> & <%c60total%> & <%c90total%>
+\end{tabular*}
+\rule{\textwidth}{1pt}
+
+\vspace{1cm}
+
+\hfill
+\begin{tabularx}{7cm}{Xr@{}}
+ \textbf{Total outstanding} & <%total%>
+\end{tabularx}
+
+\vfill
+
+Please make check payable to <%company%>
+
+\renewcommand{\thefootnote}{\fnsymbol{footnote}}
+
+\footnotetext[1]{\tiny
+}
+
+\end{document}
+
diff --git a/sql-ledger/users/members.default b/sql-ledger/users/members.default
new file mode 100644
index 000000000..5f7830db4
--- /dev/null
+++ b/sql-ledger/users/members.default
@@ -0,0 +1,5 @@
+# SQL-Ledger Accounting members
+
+[root login]
+password=
+
diff --git a/test/cgi-test b/test/cgi-test
new file mode 100755
index 000000000..2dda4849b
--- /dev/null
+++ b/test/cgi-test
@@ -0,0 +1,560 @@
+#!/usr/bin/perl -Tw
+#
+# $Id: cgi-test,v 1.3 2001-08-21 02:32:54 ivan Exp $
+#
+# This is the beginning of a test suite for the web interface.
+# It's also excellent for populating your database with some meaningful test
+# data. (a derivative is used by the web demo)
+# It only works on an empty database (probably need empty counters too, and
+# no arbirary RADIUS attributes).
+# Usage: cgi-test http://base.freeside.url/with/path/ username password
+# (Yes, if you were properly paranoid and are using SSL, you'll need to get
+# libwww-perl working with SSL to use this.)
+
+use strict;
+#use diagnostics;
+use subs qw( big_ugly_data_structure );
+use CGI;
+use LWP::UserAgent;
+
+my ( $base_url, $username, $password ) = ( shift, shift, shift );
+#trust 'em
+$base_url =~ /^(.*)$/; $base_url = $1;
+$username =~ /^(.*)$/; $username = $1;
+$password =~ /^(.*)$/; $password = $1;
+
+my @data = &big_ugly_data_structure;
+
+my $ua = new LWP::UserAgent;
+{
+ local $^W = 0;
+ eval '
+ sub LWP::UserAgent::get_basic_credentials {
+ #my $self = shift;
+ ( $username, $password );
+ }
+ ';
+}
+
+my $data;
+while ( $data = shift @data ) {
+ my $cgi = new CGI ( $data->{'params'} );
+ my $full_url = $base_url. $data->{'url'}. '?'. $cgi->query_string;
+ #my $request = new HTTP::Request( 'POST', $full_url );
+ my $request = new HTTP::Request( 'GET', $full_url );
+ my $response = $ua->request( $request );
+ if ( $response->is_redirect ) {
+ die "Unexpected redirect!\n".
+ "URL: $full_url\n".
+ "To: ". $response->base. "\n"
+ ;
+ } elsif ( $response->is_success ) {
+ my $location = $response->base;
+ my $expected_location = $data->{'location'};
+ #if ( $location =~ /^$base_url$expected_location$/ ) {
+ if ( $location eq $base_url. $expected_location ) {
+ #warn "cool, got expected response $location from $full_url\n";
+ } else {
+ die "Strange, regular response, but unexpected base!\n".
+ "URL: $full_url\n".
+ "Base : ". $response->base. "\n".
+ "Expected: $base_url$expected_location\n".
+ "Output: ". $response->content. "\n"
+ ;
+ }
+ } elsif ( $response->is_error ) {
+ die "Strange, I got an error\n".
+ "URL: $full_url\n".
+ "Error: ". $response->error_as_HTML. "\n".
+ "Output: ". $response->content. "\n"
+ ;
+ } elsif ( $response->is_info ) {
+ die "Strange, I got an info reponse\n".
+ "URL: $full_url\n".
+ "Output: ". $response->content. "\n"
+ ;
+ } else {
+ die "Really strange, got an unrecognized response from LWP::UserAgent!\n";
+ }
+}
+
+#---
+
+sub big_ugly_data_structure {
+
+ (
+ { 'url' => 'edit/process/part_svc.cgi',
+ 'params' => {
+ 'svcpart' => '',
+ 'svc' => 'Shell',
+ 'svcdb' => 'svc_acct',
+ 'svc_acct__popnum_flag' => '',
+ 'svc_acct__popnum' => '',
+ 'svc_acct__dir_flag' => '',
+ 'svc_acct__dir' => '',
+ 'svc_acct__username_flag' => '',
+ 'svc_acct__username' => '',
+ 'svc_acct__uid_flag' => '',
+ 'svc_acct__uid' => '',
+ 'svc_acct__quota_flag' => 'F',
+ 'svc_acct__quota' => '10',
+ 'svc_acct__slipip_flag' => 'F',
+ 'svc_acct__slipip' => '',
+ 'svc_acct___password_flag' => '',
+ 'svc_acct___password' => '',
+ 'svc_acct__gid_flag' => '',
+ 'svc_acct__gid' => '',
+ 'svc_acct__shell_flag' => 'D',
+ 'svc_acct__shell' => '/bin/sh',
+ 'svc_acct__finger_flag' => '',
+ 'svc_acct__finger' => '',
+ 'svc_domain__domain_flag' => '',
+ 'svc_domain__domain' => '',
+ 'svc_acct_sm__domuser_flag' => '',
+ 'svc_acct_sm__domuser' => '',
+ 'svc_acct_sm__domuid_flag' => '',
+ 'svc_acct_sm__domuid' => '',
+ 'svc_acct_sm__domsvc_flag' => '',
+ 'svc_acct_sm__domsvc' => '',
+ },
+ 'location' => 'browse/part_svc.cgi',
+ },
+ { 'url' => 'edit/process/part_svc.cgi',
+ 'params' => {
+ 'svcpart' => '',
+ 'svc' => 'SLIP/PPP',
+ 'svcdb' => 'svc_acct',
+ 'svc_acct__popnum_flag' => '',
+ 'svc_acct__popnum' => '',
+ 'svc_acct__dir_flag' => '',
+ 'svc_acct__dir' => '',
+ 'svc_acct__username_flag' => '',
+ 'svc_acct__username' => '',
+ 'svc_acct__uid_flag' => '',
+ 'svc_acct__uid' => '',
+ 'svc_acct__quota_flag' => 'F',
+ 'svc_acct__quota' => '10',
+ 'svc_acct__slipip_flag' => 'D',
+ 'svc_acct__slipip' => '0.0.0.0',
+ 'svc_acct___password_flag' => '',
+ 'svc_acct___password' => '',
+ 'svc_acct__gid_flag' => '',
+ 'svc_acct__gid' => '',
+ 'svc_acct__shell_flag' => 'D',
+ 'svc_acct__shell' => '/bin/sh',
+ 'svc_acct__finger_flag' => '',
+ 'svc_acct__finger' => '',
+ 'svc_domain__domain_flag' => '',
+ 'svc_domain__domain' => '',
+ 'svc_acct_sm__domuser_flag' => '',
+ 'svc_acct_sm__domuser' => '',
+ 'svc_acct_sm__domuid_flag' => '',
+ 'svc_acct_sm__domuid' => '',
+ 'svc_acct_sm__domsvc_flag' => '',
+ 'svc_acct_sm__domsvc' => '',
+ },
+ 'location' => 'browse/part_svc.cgi',
+ },
+ { 'url' => 'edit/process/part_svc.cgi',
+ 'params' => {
+ 'svcpart' => '',
+ 'svc' => 'POP Mailbox',
+ 'svcdb' => 'svc_acct',,
+ 'svc_acct__popnum_flag' => 'F',
+ 'svc_acct__popnum' => '',
+ 'svc_acct__dir_flag' => '',
+ 'svc_acct__dir' => '',
+ 'svc_acct__username_flag' => '',
+ 'svc_acct__username' => '',
+ 'svc_acct__uid_flag' => '',
+ 'svc_acct__uid' => '',
+ 'svc_acct__quota_flag' => 'F',
+ 'svc_acct__quota' => '10',
+ 'svc_acct__slipip_flag' => 'F',
+ 'svc_acct__slipip' => '',
+ 'svc_acct___password_flag' => '',
+ 'svc_acct___password' => '',
+ 'svc_acct__gid_flag' => '',
+ 'svc_acct__gid' => '',
+ 'svc_acct__shell_flag' => 'F',
+ 'svc_acct__shell' => '/bin/passwd',
+ 'svc_acct__finger_flag' => '',
+ 'svc_acct__finger' => '',
+ 'svc_domain__domain_flag' => '',
+ 'svc_domain__domain' => '',
+ 'svc_acct_sm__domuser_flag' => '',
+ 'svc_acct_sm__domuser' => '',
+ 'svc_acct_sm__domuid_flag' => '',
+ 'svc_acct_sm__domuid' => '',
+ 'svc_acct_sm__domsvc_flag' => '',
+ 'svc_acct_sm__domsvc' => '',
+ },
+ 'location' => 'browse/part_svc.cgi',
+ },
+ { 'url' => 'edit/process/part_svc.cgi',
+ 'params' => {
+ 'svcpart' => '',
+ 'svc' => 'Domain',
+ 'svcdb' => 'svc_domain',,
+ 'svc_acct__popnum_flag' => '',
+ 'svc_acct__popnum' => '',
+ 'svc_acct__dir_flag' => '',
+ 'svc_acct__dir' => '',
+ 'svc_acct__username_flag' => '',
+ 'svc_acct__username' => '',
+ 'svc_acct__uid_flag' => '',
+ 'svc_acct__uid' => '',
+ 'svc_acct__quota_flag' => '',
+ 'svc_acct__quota' => '',
+ 'svc_acct__slipip_flag' => '',
+ 'svc_acct__slipip' => '',
+ 'svc_acct___password_flag' => '',
+ 'svc_acct___password' => '',
+ 'svc_acct__gid_flag' => '',
+ 'svc_acct__gid' => '',
+ 'svc_acct__shell_flag' => '',
+ 'svc_acct__shell' => '',
+ 'svc_acct__finger_flag' => '',
+ 'svc_acct__finger' => '',
+ 'svc_domain__domain_flag' => '',
+ 'svc_domain__domain' => '',
+ 'svc_acct_sm__domuser_flag' => '',
+ 'svc_acct_sm__domuser' => '',
+ 'svc_acct_sm__domuid_flag' => '',
+ 'svc_acct_sm__domuid' => '',
+ 'svc_acct_sm__domsvc_flag' => '',
+ 'svc_acct_sm__domsvc' => '',
+ },
+ 'location' => 'browse/part_svc.cgi',
+ },
+ { 'url' => 'edit/process/part_svc.cgi',
+ 'params' => {
+ 'svcpart' => '',
+ 'svc' => 'Domain email alias',
+ 'svcdb' => 'svc_acct_sm',,
+ 'svc_acct__popnum_flag' => '',
+ 'svc_acct__popnum' => '',
+ 'svc_acct__dir_flag' => '',
+ 'svc_acct__dir' => '',
+ 'svc_acct__username_flag' => '',
+ 'svc_acct__username' => '',
+ 'svc_acct__uid_flag' => '',
+ 'svc_acct__uid' => '',
+ 'svc_acct__quota_flag' => '',
+ 'svc_acct__quota' => '',
+ 'svc_acct__slipip_flag' => '',
+ 'svc_acct__slipip' => '',
+ 'svc_acct___password_flag' => '',
+ 'svc_acct___password' => '',
+ 'svc_acct__gid_flag' => '',
+ 'svc_acct__gid' => '',
+ 'svc_acct__shell_flag' => '',
+ 'svc_acct__shell' => '',
+ 'svc_acct__finger_flag' => '',
+ 'svc_acct__finger' => '',
+ 'svc_domain__domain_flag' => '',
+ 'svc_domain__domain' => '',
+ 'svc_acct_sm__domuser_flag' => '',
+ 'svc_acct_sm__domuser' => '',
+ 'svc_acct_sm__domuid_flag' => '',
+ 'svc_acct_sm__domuid' => '',
+ 'svc_acct_sm__domsvc_flag' => '',
+ 'svc_acct_sm__domsvc' => '',
+ },
+ 'location' => 'browse/part_svc.cgi',
+ },
+
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Personal SLIP/PPP',
+ 'comment' => '$30/setup, $19.99/month',
+ 'setup' => '30',
+ 'recur' => '19.99',
+ 'freq' => '1',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '1',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '0',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Personal SLIP/PPP',
+ 'comment' => '$0/setup, $179.88/year',
+ 'setup' => '0',
+ 'recur' => '179.88',
+ 'freq' => '12',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '1',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '0',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Personal POP mailbox',
+ 'comment' => '$10/setup, $5/month',
+ 'setup' => '10',
+ 'recur' => '5',
+ 'freq' => '1',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '0',
+ 'pkg_svc3' => '1',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '0',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Business SLIP/PPP',
+ 'comment' => '$30/setup, $29.99/month',
+ 'setup' => '30',
+ 'recur' => '29.99',
+ 'freq' => '1',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '1',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '1',
+ 'pkg_svc5' => '1',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Business SLIP/PPP',
+ 'comment' => '$0/setup, $299.88/year',
+ 'setup' => '0',
+ 'recur' => '299.88',
+ 'freq' => '12',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '1',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '1',
+ 'pkg_svc5' => '1',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Business POP mailbox',
+ 'comment' => '$10/setup, $5/month',
+ 'setup' => '10',
+ 'recur' => '5',
+ 'freq' => '1',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '0',
+ 'pkg_svc3' => '1',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '1',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'UNIX shell',
+ 'comment' => '$20/setup, $9.99/month',
+ 'setup' => '20',
+ 'recur' => '9.99',
+ 'freq' => '1',
+ 'pkg_svc1' => '1',
+ 'pkg_svc2' => '0',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '0',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Point-to-point T1',
+ 'comment' => '$1000/setup, $1000/month',
+ 'setup' => '1000',
+ 'recur' => '1000',
+ 'freq' => '1',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '0',
+ 'pkg_svc3' => '5',
+ 'pkg_svc4' => '1',
+ 'pkg_svc5' => '5',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+ { 'url' => 'edit/process/part_pkg.cgi',
+ 'params' => {
+ 'pkgpart' => '',
+ 'pkg' => 'Cisco 2501 Router',
+ 'comment' => '$2500',
+ 'setup' => '2500',
+ 'recur' => '0',
+ 'freq' => '0',
+ 'pkg_svc1' => '0',
+ 'pkg_svc2' => '0',
+ 'pkg_svc3' => '0',
+ 'pkg_svc4' => '0',
+ 'pkg_svc5' => '0',
+ },
+ 'location' => 'browse/part_pkg.cgi',
+ },
+
+ { 'url' => 'edit/process/agent_type.cgi',
+ 'params' => {
+ 'typenum' => '',
+ 'atype' => 'Internal Sales',
+ 'pkgpart1' => 'ON',
+ 'pkgpart2' => 'ON',
+ 'pkgpart3' => 'ON',
+ 'pkgpart4' => 'ON',
+ 'pkgpart5' => 'ON',
+ 'pkgpart6' => 'ON',
+ 'pkgpart7' => 'ON',
+ 'pkgpart8' => 'ON',
+ 'pkgpart9' => 'ON',
+ },
+ 'location' => 'browse/agent_type.cgi',
+ },
+
+ { 'url' => 'edit/process/agent.cgi',
+ 'params' => {
+ 'agentnum' => '',
+ 'agent' => 'Internal Sales',
+ 'typenum' => '1',
+ 'freq' => '',
+ 'prog' => '',
+ },
+ 'location' => 'browse/agent.cgi',
+ },
+
+ { 'url' => 'edit/process/part_referral.cgi',
+ 'params' => {
+ 'refnum' => '',
+ 'referral' => 'Another customer',
+ },
+ 'location' => 'browse/part_referral.cgi',
+ },
+ { 'url' => 'edit/process/part_referral.cgi',
+ 'params' => {
+ 'refnum' => '',
+ 'referral' => 'Newspaper ad',
+ },
+ 'location' => 'browse/part_referral.cgi',
+ },
+
+ { 'url' => 'edit/process/svc_acct_pop.cgi',
+ 'params' => {
+ 'popnum' => '',
+ 'city' => 'Line Lexington',
+ 'state' => 'PA',
+ 'ac' => '215',
+ 'exch' => '996',
+ },
+ 'location' => 'browse/svc_acct_pop.cgi',
+ },
+ { 'url' => 'edit/process/svc_acct_pop.cgi',
+ 'params' => {
+ 'popnum' => '',
+ 'city' => 'Oakland',
+ 'state' => 'CA',
+ 'ac' => '510',
+ 'exch' => '208',
+ },
+ 'location' => 'browse/svc_acct_pop.cgi',
+ },
+
+ { 'url' => 'edit/process/cust_main.cgi',
+ 'params' => {
+ 'custnum' => '',
+ 'agentnum' => '1',
+ 'refnum' => '1',
+ 'last' => 'Hogan',
+ 'first' => 'Shawn D.',
+ 'ss' => '',
+ 'company' => 'Digital Point Solutions',
+ 'address1' => '3570 Tony Drive',
+ 'address2' => '',
+ 'city' => 'San Diego',
+ 'state' => 'CA / US',
+ 'zip' => '92122-2307',
+ 'daytime' => '',
+ 'night' => '',
+ 'fax' => '',
+ 'tax' => '',
+ 'invoicing_list_POST' => '',
+ 'invoicing_list' => '',
+ 'payby' => 'BILL',
+ 'CARD_payinfo' => '',
+ 'CARD_month' => '1',
+ 'CARD_year' => '1999',
+ 'CARD_payname' => '',
+ 'BILL_payinfo' => '',
+ 'BILL_month' => '12',
+ 'BILL_year' => '2037',
+ 'BILL_payname' => 'Accounts Payable',
+ 'COMP_payinfo' => '',
+ 'COMP_month' => '1',
+ 'COMP_year' => '1999',
+ 'pkgpart_svcpart' => '1_2',
+ 'username' => 'cyborg',
+ '_password' => '',
+ 'popnum' => '1',
+ 'otaker' => 'example',
+ },
+ 'location' => 'view/cust_main.cgi?1',
+ },
+ { 'url' => 'edit/process/cust_main.cgi',
+ 'params' => {
+ 'custnum' => '',
+ 'agentnum' => '1',
+ 'refnum' => '2',
+ 'last' => 'Ford',
+ 'first' => 'Bill',
+ 'ss' => '',
+ 'company' => 'Boardtown Corporation',
+ 'address1' => '116 East Main Street',
+ 'address2' => '',
+ 'city' => 'Starkville',
+ 'state' => 'MS / US',
+ 'zip' => '39759',
+ 'daytime' => '',
+ 'night' => '',
+ 'fax' => '',
+ 'tax' => '',
+ 'invoicing_list_POST' => '',
+ 'invoicing_list' => '',
+ 'payby' => 'BILL',
+ 'CARD_payinfo' => '',
+ 'CARD_month' => '1',
+ 'CARD_year' => '1999',
+ 'CARD_payname' => '',
+ 'BILL_payinfo' => '',
+ 'BILL_month' => '12',
+ 'BILL_year' => '2037',
+ 'BILL_payname' => 'Accounts Payable',
+ 'COMP_payinfo' => '',
+ 'COMP_month' => '1',
+ 'COMP_year' => '1999',
+ 'pkgpart_svcpart' => '3_3',
+ 'username' => 'billf',
+ '_password' => '',
+ 'popnum' => '',
+ 'otaker' => 'example',
+ },
+ 'location' => 'view/cust_main.cgi?2',
+ },
+
+
+ );
+}
+