Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ExactOnline for coreBOS
#1
I've created this repo on github. Right now it's quite a mess, but I'm getting there. Take a look at the files:

Which is where I'm setting up the OAuth dance (which was an enormous pain in the ass), but now it seems to be okay. I'm now in the process of creating an API class and severall classes for updating and reading accounts, invoices etc.

In the end I want to create workflow tasks for this and register this module with only a backend settings menu where you could enter you client_id, secret etc.
Reply
#2
Looking good. A few comments:

- you need to respect the structure. look at the modules we have (https://github.com/tsolucio/coreBOSEmployee):
modules/yourmodule/{your module files, with manifest.xml}
cron
templates
manifest.xml
composer.json

- put a license on your files. The ones you copy from coreBOS must be VPL, but the new ones you create can be whatever you want, but put a license: tell the world what conditions they can use this code under

- change ModuleFile.js to ExactOnline.js

- complete your manifest.xml

- keep asking... :-)
Joe
TSolucio
Reply
#3
No problem, but I'm still in the process of building it. Just a few questions:
  • If I'm correct you'd like me to move all my classes to 'ExactOnline.php'?
  • Right now I've no Javascript, don't know if I'm going to need it, but still I can keep an empty JS file?
  • Right now I use the 'test.php' file to test all kinds of things, but I guess that should be moved to index.php later on? Don't know if it'll do anything in the final version, since this module is meant to do all it's work in the background.
  • The cron is for a later stage, first I'd like to complete the module with the workflow tasks.
  • I see this composer everywhere on github, never knew what it was. I'll check into this.
  • As license you mean the license per file I guess?
  • I'll take a look at the manifest also.

About the content, I'm not sure how to customize (or even create) my 'Settings' page. This is basically the only one I'm going to need. I read the Create Entity PDF from the vTIger team but that didn't give me all the answers.
Reply
#4
(11-28-2015, 09:11 PM)Guido1982 Wrote: If I'm correct you'd like me to move all my classes to 'ExactOnline.php'?

Not necessarily but it is a good and clean way to proceed. You can have a "tools" file and put them in there also.

(11-28-2015, 09:11 PM)Guido1982 Wrote: Right now I've no Javascript, don't know if I'm going to need it, but still I can keep an empty JS file?

Yes, keep the empty .js file, it is loaded by default so if you don't put it you will get warning messages about it not being there.

(11-28-2015, 09:11 PM)Guido1982 Wrote: Right now I use the 'test.php' file to test all kinds of things, but I guess that should be moved to index.php later on? Don't know if it'll do anything in the final version, since this module is meant to do all it's work in the background.

If you don't want to explicitly expose the tests to the users you can leave them in the test file. In fact you can leave them there even if you do expose the results to the user.

(11-28-2015, 09:11 PM)Guido1982 Wrote: I see this composer everywhere on github, never knew what it was. I'll check into this.

The composer files are for automated installs of a sequence of modules. The normal application install just ignores the file. That is for advanced deployment of verticalizations. I think you can safely ignore that file for your current needs but it easy to fill in and doesn't hurt.

(11-28-2015, 09:11 PM)Guido1982 Wrote: As license you mean the license per file I guess?

Yes, correct.

(11-28-2015, 09:11 PM)Guido1982 Wrote: About the content, I'm not sure how to customize (or even create) my 'Settings' page. This is basically the only one I'm going to need. I read the Create Entity PDF from the vTIger team but that didn't give me all the answers.

I don't think the Settings functionality is documented anywhere. It is rather simple: you define a few entries in an array that indicate the icon, title description and file to execute. coreBOS will add the "hammer" settings icon and paint the box for you. When the admin user clicks on the link he will be redirected to the link you indicated, from there on it is all yours, do whatever you need to do.

Start by looking at the existing code. For example I uploaded yesterday our Confidential Information module that has two custom Settings sections:

https://github.com/tsolucio/Confidential-Information/blob/master/modules/ConfidentialInfo/Settings.php#L69
Joe
TSolucio
Reply
#5
Hey Joe,

Thanks, I'll study you answers when I get to this point in development. In the meantime I've some more questions/remarks:

To be able to connect to Exact you must provide Exact with your Accounts and Products. I've written classes that take care of this and the 'Items' class can even send ALL you products to Exact in one go. Before you can send an invoice to Exact you need the get the GUID (the primary ID for every entity within Exact) for the Account you're sending. I made sure account numbers from coreBOS get synchonised so that the module will always find the correct account based on the coreBOS account number.

Apart from that, there are two dependancies that will trouble any spreading of this module when it's finished. Namely, Exact requires you to specify a 'Journal' when you send an invoice. This is an accounting term, but it won't accept a non-existing one. coreBOS doesn't provide this out of the box, so my install manifest will have to update the 'vtiger_invoice' table to add a dropdown, where you can choose (including a default) Journal. Otherwise you can't send invoices to Exact, which was the whole point.

Secondly, every invoice Line (so every product you list on an invoice) needs to have a General Ledger number. Basically this is the code for a group of items. You could, in Exact for instance create a General Ledger that says 'Office Supplies'. This Ledger will receive a number, and with that a GUID. When you send an invoice, every product line MUST specify this general Ledger GUID. This will require an extra field in the vtiger_products table, also a dropdown. Before sending the invoice the module will then check the description or human-readable code of this product and get the GUID from Exact, then send it.

For this module to work the module must create the two extra columns in the table (of the fields tables for these modules?), and a user must setup the Journals and General Ledgers in both Exact and coreBOS to correspond. I could probably build a method that connects one to the other, so maybe we can suffice with just setting it all up on one side.
Reply
#6
Quote:joebordes wrote:

Not necessarily but it is a good and clean way to proceed. You can have a "tools" file and put them in there also.

Right now I'm thinking about moving all my classes to a subfolder of the module folder, would that be in line with the application structure?

Quote:joebordes wrote:

If you don't want to explicitly expose the tests to the users you can leave them in the test file. In fact you can leave them there even if you do expose the results to the user.

I'm also not wuite sure about what the index.php file does. I know it loads when no further action is specified on the url, but I have to study some simple modules further I think.

Quote:joebordes wrote:

I don't think the Settings functionality is documented anywhere. It is rather simple: you define a few entries in an array that indicate the icon, title description and file to execute. coreBOS will add the "hammer" settings icon and paint the box for you. When the admin user clicks on the link he will be redirected to the link you indicated, from there on it is all yours, do whatever you need to do.


Start by looking at the existing code. For example I uploaded yesterday our Confidential Information module that has two custom Settings sections:

https://github.com/tsolucio/Confidential-Information/blob/master/modules/ConfidentialInfo/Settings.php#L69

Thanks, I'll look into this.

============================ MAYBE ===========================
I have some more functionality in mind for which I'd like to use the standard 'record keeping' functionality of coreBOS. Because I want to automate every action through workflow tasks, I was thinking maybe it would be a good idea to create some method that updates the 'normal' table (and move the Settings to a different table) with a record each time. This mainly to create a detailed track about what was sent to Exact and if any errors occured. I'll take a look at the default functionality of a skeleton module and see how I can incorporate this behaviour. Keep in mind these will be 'view only' records, only to keep track of what the module is doing. Tomorrow I will start studying existing modules.
Reply
#7
Yes, saving your modules' specific files inside it's directory is the way to go.

coreBOS Updater is a view only module. You can have a look at how we did it there.
Joe
TSolucio
Reply
#8
(11-30-2015, 10:10 PM)joebordes Wrote: Yes, saving your modules' specific files inside it's directory is the way to go.

coreBOS Updater is a view only module. You can have a look at how we did it there.

I see in this file you turn off the normal topbar with icons. This file is then included in this file to make sure you override the default settings.

(11-30-2015, 10:10 PM)joebordes Wrote: Yes, saving your modules' specific files inside it's directory is the way to go.

coreBOS Updater is a view only module. You can have a look at how we did it there.

I see here you set an option for this. Anything I missed?
Reply
#9
Besides those two:

save is commented here:
https://github.com/tsolucio/corebos/blob/master/modules/cbupdater/Save.php#L75

although now I would do that adding a preSaveCheck (preSaveCheck didn't exist when I created this module)

I also cleared out the Delete.php file. There is currently no preDeleteCheck but that is on my TODO list)

I blocked MassEditSave:
https://github.com/tsolucio/corebos/blob/master/modules/cbupdater/MassEditSave.php#L26
Joe
TSolucio
Reply
#10
Thanks, I'll look into this. I've got my workflow tasks all setup and installed, fully functioning sending stuff to Exact now when saving a record. I'll take a look at cbupdater when I get the chance, but first I need to sort out the settings.

Quote:Start by looking at the existing code. For example I uploaded yesterday our Confidential Information module that has two custom Settings sections:

https://github.com/tsolucio/Confidential-Information/blob/master/modules/ConfidentialInfo/Settings.php#L69
Thanks, I see pretty much what's going on there, will let you know if I have any questions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)