CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • POS Point of Sale + Invoicing module and Products + Inventory module
Pages: [1] 2

Author Topic: POS Point of Sale + Invoicing module and Products + Inventory module  (Read 9318 times)

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
POS Point of Sale + Invoicing module and Products + Inventory module
April 21, 2010, 02:35:49 pm
With the ability to already process Credit Cards, register people for events, sell memberships and take contributions, it seems to me that the next logical step would be some kind of point of sale system.

For example, when you have an event, say a conference, maybe you want to sell Books, CD's and DVD's (non-tax deductible products) as well as memberships and take donations. Also, our church has a small bookstore so being able to sell books and cds and track them with members quickly and easily is another use case.

This would require some kind of products or inventory module to manage and look after actual items that are being sold, and then some kind of point of sale / invoicing module that can: (1) take customer info (is it already in database?), (2) add products they want to purchase (eventually would need to support bar code scanners and cash drawers and receipt printers),  (3) take multiple payments methods on same transaction (some in cash, some by check, and some credit/debit card), and (4) all from the same single screen!

Should this be an extension of an existing module like CiviContribute or CiviEvent? Should it be it's own module? Should POS and Products/Inventory be all in one module or separate modules? Should products be an extension of premiums, or be its own table is db? These are some basic questions that first need to be answered!

I have spent the last few months investigating open source solutions for CRM/ERP/Accounting/POS and quite honestly have not found any solutions that are what I would consider "good" ... CiviCRM is the first open source solution that is truly at a level above the rest... very professional and well thought out. Of course there is never one solution that does everything you need, so no matter which one you choose, you still will need to find something to fill the gap or else modify it or develop your own solution! But that is the great thing about open source ... hack away until it does it exactly the way YOU want!!!

Anyways, I was about to start designing my own custom solution for POS a couple days ago, and that is when I stumbled across CiviCRM and it really fills the gap where all the others lacked. The only missing components are Products and POS. So since I have to get something working for our organization anyways, I am willing to start working on the code for this feature.

My initial work will be to get it working for our specific needs, which are as follows:
-From a SINGLE PAGE/SCREEN, be able to do the following:
 (1) CUSTOMER INFO SECTION: Search for customers to see if they are already in db by last name, phone number or email. If they do not already exist, then add them as a new contact instantly.
 (2) PRODUCTS SECTION: Search for products (search box and/or drop down?) and add them to the 'shopping cart' and modify quantity, price, taxable, tax-deductible if necessary.
 (3) PAYMENTS SECTION: Choose multiple payment methods (ex: some people may want to pay part with cash and the rest on their credit card), and be able to process credit cards on the spot (we use PayPal Website Payments Pro so this will be initial functionality).
 (4) AFTER SALE: -Print receipt on standard laser printer for customer. -Have all sales be viewable online by customer (they will be able to login and print their own tax deductible receipts if necessary).

So thats off the top of my head what I need to get done... and as they say: "Good, fast and cheap... pick two!" With my time being limited (and volunteer), this probably wont be fast ... I will work on good though! Any ideas would be greatly appreciated, and especially guidance from CiviCRM developers on how it should integrate with existing code. I would like to keep it as Drupal/Joomla independent as possible (if possibel?), so two different versions do not have to be maintained. If thats not possible, then I will be working on a Drupal version since thats we have installed.

Okay, anybody interested in something like this? Ideas, thoughts, suggestions?

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 11:34:49 am
If you want a shopping cart type of interface, why not Ubercart? There is http://drupal.org/project/uberpos for POS and http://www.ubercart.org/contrib/3762 for CiviCRM integration.

Then you have a full shopping cart. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 11:40:22 am
Shopping Cart is not really the correct terminology... I meant a single screen where products can be added and removed (just like a cash register). I think shopping cart infers a webpage and then add products and then go to your shopping cart and then go to another page to checkout... I am looking at a single page solution!

But I will take a look and see if it will work for what I need or not.

Thanks

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 11:49:20 am
I see what you mean. Your #1 is not difficult to achieve as Drupal module. I even have something fairly similar. Your #2 I think can be done mostly using built-in features.

The idea in #3 of multiple payment processors is a bit of a stretch, as even most shopping carts that I am familiar with don't support that. :)

Your #4 is also fairly easy as a Drupal module. I also have something similar for a certain site, based on the idea of PDF tickets detailed here: http://civicrm.org/blogs/hershel/civicrm-ticketing-and-attendance The content of the PDFs can easily be receipts instead of tickets.

To build this in Drupal is not a large job. To add it in CiviCRM itself I can't say for sure.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 12:08:26 pm
Yes, as I am playing with Drupal and CiviCRM, I am finding the ability to create a Drupal module much easier than a civi component. So as long as my drupal module has access to the civicrm db, then there won't be a problem! My original intent was to try and keep it as a component so that it would be available to Joomla as well, but unfortunately the ease of adding Drupal modules will probably mean Joomla gets left out!

As for multiple payment processors, I don't mean multiple credit card processors, I just mean that since this is a POS with a real person sitting at the terminal, if the total is $100, then the customer can give the person $20 cash, and a check for $30 and then you charge the credit card for $50. Should not be that difficult with javascript.

I have looked and looked for an acceptable open source POS solution and there really is not anything that meets our needs, so hopefully I can get something up and running in the next month or so!

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 12:31:38 pm
Accessing the DB is easy via

Code: [Select]
require_once "CRM/Core/DAO.php";
$dao = CRM_Core_DAO::executeQuery($query);

etc.

The other issue would be to store the fact that the customer paid via three different methods but that should be a fairly simple matter to solve.

Post back here when you have something to share. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 12:37:58 pm
I will... and thanks!

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 12:53:31 pm
Quick question on executeQuery...
static function &executeQuery( $query,
                                   $params = array( ),
                                   $abort = true,
                                   $daoName = null,
                                   $freeDAO = false,
                                   $i18nRewrite = true )

Is $query the full mysql query (like "select * from mytable where x = 1" or INSERT or UPDATE)?

What about $params? How do these relate to $query?

Thanks

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 01:28:50 pm

this is for all queries

the query contains parameters %1 %2 etc

these parameters are defined in $params (value and type).the function does the necessary checking and escaping before sending it to the DB. We use this to prevent sql injections

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 02:02:13 pm
So $params is optional so to speak? Meaning I could put the full query in $query like this?
$query ="SELECT * FROM tablename WHERE x = '1'"

Can you give an example of using $params because I still don't quite understand how to use it!

Thanks
« Last Edit: April 25, 2010, 02:08:20 pm by jsherk »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 03:07:17 pm
Quote from: jsherk on April 25, 2010, 02:02:13 pm
So $params is optional so to speak? Meaning I could put the full query in $query like this?
$query ="SELECT * FROM tablename WHERE x = '1'"

Correct

Quote from: jsherk on April 25, 2010, 02:02:13 pm
Can you give an example of using $params because I still don't quite understand how to use it!


 
Code: [Select]
      $sql="SELECT phone FROM civicrm_phone WHERE contact_id = %1";
        $params = array(1=> array($contact_id, 'Integer'));
        $dao = CRM_Core_DAO::executeQuery( $sql, $params );
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 03:17:12 pm
Ok, great! I see now! :D

Thank you

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 25, 2010, 03:51:41 pm
Hum... when I do this:
Code: [Select]
require_once "CRM/Core/DAO.php"
I get this:
Code: [Select]
Warning: require_once(DB/DataObject.php) [function.require-once]: failed to open stream: No such file or directory in /home/public_html/civicrm/sites/all/modules/civicrm/CRM/Core/DAO.php  on line 39
Fatal error: require_once() [function.require]: Failed opening required 'DB/DataObject.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/public_html/civicrm/sites/all/modules/civicrm/CRM/Core/DAO.php on line 39

UPDATE: Ok, the problem was that I was calling the require_once from the same server, but outside the civicrm directory, so I had to add this before the require_once:
Code: [Select]
$get_include_path = get_include_path(); //Since calling functions from outside CiviCRM directories, need to adjust the include path or it won't work!
set_include_path($get_include_path.':/home/path/to/sites/all/modules/civicrm:/home/path/to/sites/all/modules/civicrm/packages');
« Last Edit: April 25, 2010, 06:20:04 pm by jsherk »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 26, 2010, 02:31:55 am
Should be that if you run civicrm_initialize() then it will work without adjusting paths manually.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

jsherk

  • I post occasionally
  • **
  • Posts: 82
  • Karma: 0
Re: POS Point of Sale + Invoicing module and Products + Inventory module
April 26, 2010, 05:06:38 am
Thanks hershel ... still having problems though ...

I solved the one issue by requiring the civicrm.setting.php file first ... that automatically sets the include path and gives you the global variable $civicrm_root:
Code: [Select]
require_once('/home/path/to/civicrm.settings.php');
require_once($civicrm_root.'/CRM/Core/DAO.php');

Now when I try to run a CRM_Core_DAO::executeQuery($query) query though I get:
Code: [Select]
DB_DataObject Error: No database name / dsn found anywhere
Is there some more setup that needs to be done? Maybe user information needs to be populated into a global variable? I included civicrm.settings.php so CIVICRM_DSN and CIVICRM_UF_DSN are both defined.

I tried adding civicrm_initialize() as well but I get Fatal error: Call to undefined function. So are there other includes that need to included as well?

Once I get all this figured out I will add it to the docs because I am pretty sure this information is not in there yet ... there is info on using the api, but I am bypassing the api and trying to access built-in civicrm functions directly.

Thanks

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Feature Requests and Suggestions (Moderator: Dave Greenberg) »
  • POS Point of Sale + Invoicing module and Products + Inventory module

This forum was archived on 2017-11-26.