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