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