summaryrefslogtreecommitdiff
path: root/pos.conf.pl
blob: 64827f6fbdc99aaad4676607df93153c1501ae8e (plain)
  1. use LedgerSMB::Sysconfig;
  2. # This sets up the settings for the POS hardware. You can use it to override
  3. # printing commands etc. as well.
  4. # Chris Travers
  5. # Chris@metatrontech.com
  6. # 2004-02-07
  7. # Begin Editing Here
  8. $pos_config{'rem_host'}=$ENV{'REMOTE_ADDR'};
  9. $pos_config{'pd_host'} = $pos_config{'rem_host'};
  10. $pos_config{'pd_port'} = 6601;
  11. $pos_config{'pd_proto'} = 'tcp';
  12. require "drivers/pd3000.pl"; # Use the PD3000 driver
  13. # Some businesses may want to Override this for custom apps
  14. $pos_config{'pd_host'} = $pos_config{'rem_host'};
  15. $pos_config{'rp_port'} = 6602;
  16. $pos_config{'rp_proto'} = 'tcp';
  17. $pos_config{'rp_netdirect'} = 'yes';
  18. # Some businesses may want to Override this for custom apps
  19. $pos_config{'rp_host'} = $pos_config{'rem_host'};
  20. $pos_config{'rp_cash_open'} = pack("CCCCC",27,112,0,25,250);
  21. $pos_config{'coa_prefix'} = 1300;
  22. $pos_config{'close_cash_accno'} = 1060;
  23. $pos_config{till_cash} = 200;
  24. # Add your sources here.
  25. $pos_sources{'visa'} = "Visa/MC";
  26. $pos_sources{'disc'} = "Discover";
  27. $pos_sources{'check'} = 'Check';
  28. $pos_sources{'cash'} = 'Cash';
  29. $pos_sources{'gcert'} = 'Gift Cert';
  30. # 1 for source = memo
  31. # 2 for credit card handling
  32. %pos_source_type = {
  33. visa => 2,
  34. cash => 1,
  35. check => 1,
  36. disc => 2
  37. };
  38. ${$pos_config{'source_accno_override'}{'gcert'}} = '2105';
  39. # Define your till accno scheme here. Current supported values are 'terminal'
  40. # and 'cashier'
  41. $pos_config{'till_type'} = 'cashier';
  42. # FLAGS: 1 = projects, 2 = departments
  43. $pos_config{'disable_tables'} = 3;
  44. # HTML for the appropriate currency symbol for your tills
  45. $pos_config{'curren'} = '$';
  46. # Number format to use
  47. $pos_config{'numberformat'} = '1,000.00';
  48. # Units of currency to use in the till closing cash breakdown relative to
  49. # your base unit of currency, formatted in your chosen format
  50. @{$pos_config{'breakdown'}} = (
  51. '100', '50', '20', '10', '5', '2', '1', '0.25', '0.10', '0.05', '0.01');
  52. # Stop Editing Here
  53. if (lc($pos_config{'till_type'}) eq 'terminal'){
  54. $pos_config{'till'} = (split(/\./, $pos_config{'rem_host'}))[3];
  55. }
  56. elsif (lc($pos_config{'till_type'}) eq 'cashier'){
  57. use LedgerSMB::User;
  58. $pos_config{'till'} = $form->get_my_emp_num(\%myconfig, \%$form);
  59. }
  60. else {
  61. $form->error("No till type defined in pos.conf.pl!");
  62. }
  63. $pos_config{till_accno} = "$pos_config{coa_prefix}.$pos_config{till}";
  64. $pos_config{'pd_dest'}=pack(
  65. 's n a4 x8', 2, $pos_config{'pd_port'},
  66. pack('CCCC', split(/\./, $pos_config{'pd_host'}))
  67. );
  68. $form->{pos_config} = \%pos_config;
  69. $form->{pos_sources} = \%pos_sources;
  70. # Due to the architecture of SL, we need to use netcat to print.
  71. # Otherwise the document gets spooled twice and this interferes with timeliness.
  72. ${LedgerSMB::Sysconfig::printer}{'Printer'} = "utils/pos/directnet.pl $pos_config{rp_host} $pos_config{rp_proto} $pos_config{rp_port}";
  73. 1;