summaryrefslogtreecommitdiff
path: root/pos.conf.pl
blob: e89e69cea8b184203eac7676ad7b02a4b862f33c (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'} = $locale->text("Visa/MC");
  26. $pos_sources{'disc'} = $locale->text("Discover");
  27. $pos_sources{'check'} = $locale->text('Check');
  28. $pos_sources{'cash'} = $locale->text('Cash');
  29. $pos_sources{'gcert'} = $locale->text('Gift Cert');
  30. $pos_source_default = 'cash';
  31. # 1 for source = memo
  32. # 2 for credit card handling
  33. %pos_source_type = {
  34. visa => 2,
  35. cash => 1,
  36. check => 1,
  37. disc => 2
  38. };
  39. ${$pos_config{'source_accno_override'}{'gcert'}} = '2105';
  40. # Define your till accno scheme here. Current supported values are 'terminal'
  41. # and 'cashier'
  42. $pos_config{'till_type'} = 'cashier';
  43. # FLAGS: 1 = projects, 2 = departments
  44. $pos_config{'disable_tables'} = 3;
  45. # HTML for the appropriate currency symbol for your tills
  46. $pos_config{'curren'} = '$';
  47. # Number format to use
  48. $pos_config{'numberformat'} = '1,000.00';
  49. # Units of currency to use in the till closing cash breakdown relative to
  50. # your base unit of currency, formatted in your chosen format
  51. @{$pos_config{'breakdown'}} = (
  52. '100', '50', '20', '10', '5', '2', '1', '0.25', '0.10', '0.05', '0.01');
  53. # Stop Editing Here
  54. if (lc($pos_config{'till_type'}) eq 'terminal'){
  55. $pos_config{'till'} = (split(/\./, $pos_config{'rem_host'}))[3];
  56. }
  57. elsif (lc($pos_config{'till_type'}) eq 'cashier'){
  58. use LedgerSMB::User;
  59. $pos_config{'till'} = $form->get_my_emp_num(\%myconfig, \%$form);
  60. }
  61. else {
  62. $form->error("No till type defined in pos.conf.pl!");
  63. }
  64. $pos_config{till_accno} = "$pos_config{coa_prefix}.$pos_config{till}";
  65. $pos_config{'pd_dest'}=pack(
  66. 's n a4 x8', 2, $pos_config{'pd_port'},
  67. pack('CCCC', split(/\./, $pos_config{'pd_host'}))
  68. );
  69. $form->{pos_config} = \%pos_config;
  70. $form->{pos_sources} = \%pos_sources;
  71. # Due to the architecture of SL, we need to use netcat to print.
  72. # Otherwise the document gets spooled twice and this interferes with timeliness.
  73. ${LedgerSMB::Sysconfig::printer}{'Printer'} = "utils/pos/directnet.pl $pos_config{rp_host} $pos_config{rp_proto} $pos_config{rp_port}";
  74. 1;