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