summaryrefslogtreecommitdiff
path: root/pos.conf.pl
blob: c0fa3dfadfbf56b355a82192cbeafb77a755a213 (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 'terminal'
  31. # and 'cashier'
  32. $pos_config{'till_type'} = 'cashier';
  33. # FLAGS: 1 = projects, 2 = departments
  34. $pos_config{'disable_tables'} = 3;
  35. # HTML for the appropriate currency symbol for your tills
  36. $pos_config{'curren'} = '$';
  37. # Number format to use
  38. $pos_config{'numberformat'} = '1,000.00';
  39. # Units of currency to use in the till closing cash breakdown relative to
  40. # your base unit of currency, formatted in your chosen format
  41. @{$pos_config{'breakdown'}} = (
  42. '100', '50', '20', '10', '5', '2', '1', '0.25', '0.10', '0.05', '0.01');
  43. # Stop Editing Here
  44. if (lc($pos_config{'till_type'}) eq 'terminal'){
  45. $pos_config{'till'} = (split(/\./, $pos_config{'rem_host'}))[3];
  46. }
  47. elsif (lc($pos_config{'till_type'}) eq 'cashier'){
  48. use LedgerSMB::User;
  49. $pos_config{'till'} = $form->get_my_emp_num(\%myconfig, \%$form);
  50. }
  51. else {
  52. $form->error("No till type defined in pos.conf.pl!");
  53. }
  54. $pos_config{till_accno} = "$pos_config{coa_prefix}.$pos_config{till}";
  55. $pos_config{'pd_dest'}=pack(
  56. 's n a4 x8', 2, $pos_config{'pd_port'},
  57. pack('CCCC', split(/\./, $pos_config{'pd_host'}))
  58. );
  59. $form->{pos_config} = \%pos_config;
  60. $form->{pos_sources} = \%pos_sources;
  61. # Due to the architecture of SL, we need to use netcat to print.
  62. # Otherwise the document gets spooled twice and this interferes with timeliness.
  63. %printer = (
  64. 'Printer' => "utils/pos/directnet.pl $pos_config{rp_host} $pos_config{rp_proto} $pos_config{rp_port}"
  65. );
  66. 1;