Nopcommerce liqpay payment module

Hello everybody.

Today I just want to share with everybody liqpay payment module for pryvatbank. Pryvatbank is Ukrainian bank which makes possible to accept credit cards payments on your web site. If you'll install nopcommerce, then you can use my payment module absolutely for free. Later  I will modify this article with description of process of development.

You can Download  it and use it for your own. 

For downloading of 3.2 module you can  click here.  

If you wish to support future extensions of this module, you can do it here.

Web sites which use this module:

http://abc-device.com

http://payment.zaletskyy.com/en/

If you use this module as well let me know in comments

Autonumbering in Acumatica

Today I want to share with you how I implemented autonumbering feature in acumatica for page CA304000.

My task originally was the following: add autonumbering feature to the "Document Ref" field with following rules:

  a. step of incrementing is 1

  b. length of field should be six characters. For example 000001, 000002, ... ,  000223,  001024, ..., and so on

First of all I want to state that my way of adding much simpler then "canonical" ( according to acumatica manuals ) way of adding autonumbering.  If you wish to use standard way you should accomplish so many steps that I should admit that my brain wasn't able to boil them in one project. 

Instead of this I used the following steps.

1. In the page CA304000 I found class, which provides data for the page. It looks like this:

<px:PXDataSource ID="ds" runat="server" Visible="True" Width="100%" PrimaryView="CAAdjRecords" TypeName="PX.Objects.CA.CATranEntry">

2. Created extention of class in the following way:

public class CATranEntryExt : PXGraphExtension<CATranEntry>
    {

3. Located method which returns list of records for the page CA304000, it was the method: CAAdjRecords.

4. According to rules of acumatica, if I want to modify behaviour of method CAAdjRecords I should implement method caadjrecords.

5. 

protected virtual IEnumerable caadjrecords()
        {

6. Implemented method which digs in DB, and returns needed number in string format:

protected string GetExtRefNbr()
        {
            var maxNbr = 1;
            foreach (var cAddjRec in PXSelect<CAAdj>.Select(Base, new byte[0]))
            {
                var extRefNbr = ((CAAdj) cAddjRec).ExtRefNbr;
                int curNbr = 0;
                if (int.TryParse(extRefNbr, out curNbr))
                {
                    maxNbr = curNbr + 1;
                }
            }
            var result = maxNbr.ToString(CultureInfo.InvariantCulture).PadLeft(defaultLength, '0');
            return result;
        }

7. Used GetExtRefNbr in the method caadjrecords in the following way:

protected virtual IEnumerable caadjrecords()
        {
            var res = new List<CAAdj>();
            var availableCashAccounts = GetAvailableCashAccounts();

            foreach (
                var doc in
                    PXSelect<CAAdj, Where<CAAdj.draft, Equal<False>>>.Select(Base, new byte[0]))
            {
                
                if (((CAAdj)doc).RefNbr.Contains("NEW"))
                {
                    ((CAAdj) doc).ExtRefNbr = GetExtRefNbr();
                }
                    
            }
            return res;
        }

8. Enjoyed results:

the field Document Ref.: was inserted automatically.

 

Filter cash accounts for next, prev

Hello everybody.

Today I want to tell you a story how to make some special filtering in Accumatica. 

So at acumatica screen ScreenId=CA304000 which looks like this:

So my task was the following:

1. User permissions were configured in a way, that user shouldn't have permissions for some accounts for cases is user wants to enter new transaction.

2. If user press at buttons First, Previous, Next, Last he got opportunity to see documents for which he didn't have permissions.

In order to modify that functionality it was reuired to modify default behaviour.

In order to do this I used the following steps.

1. Analyzed which Data class is responsible for getting data in the page: CA304000. It was APInvoiceEntry.

2. In the source code of this class found which member takes recrods for the page CA304000, it was

public PXSelect<CAAdj, Where<CAAdj.draft, Equal<False>>> CAAdjRecords;

Then redeclared and overrided it in the following way:

public class CATranEntryExt : PXGraphExtension<CATranEntry>
    {
        public PXSelect<CAAdj, Where<CAAdj.draft, Equal<False>>> CAAdjRecords;

        protected virtual IEnumerable caadjrecords()
        { 
            var res = new List<CAAdj>();
            var availableCashAccounts = GetAvailableCashAccounts();
             foreach (
                var doc in
                    PXSelect<CAAdj, Where<CAAdj.draft, Equal<False>>>.Select(Base, new byte[0]))
            {
              // if for some reason you need this code, let me know via comments. For now I don't see practical value in it from Acumatica understanding view point.
             .
             .
             .
        }

Take note, that Acumatica uses convention over configuration principle. If you want to change functionality of some method, in our case CAAdjRecords, you can do it, via simply writing it from all non-capital characters.

Another important feature of acumatica is 

 

var res = new List<CAAdj>();
            var availableCashAccounts = GetAvailableCashAccounts();

            foreach (
                var doc in
                    PXSelect<CAAdj, Where<CAAdj.draft, Equal<False>>>.Select(Base, new byte[0]))
            {

 

In case if you want to get something from code of base class, you can use already mentioned >>>.Select(Base, new byte[0])) part and you'll achieve access to data in view ( which is also called PXSelect )

That's all for now. Enjoy your time

 

Acumatica Active directory

Hello,

today I want to share just simple record of how to join acumatica and your Active Directory.

For example you have the following data:

Active directory url:LDAP://RT1:389

User name yura_zale@dot.com, password: 123

For cases like this you need the following record in your web.config file:

<activeDirectory enabled="true" path="RT1:389" user="dot\yura_zale" password="123" />

Acumatica certificate

Hello everybody,

this will be the first post in December. I want to boast that I got T101 certificate from acumatica univercity which proves that I'm certified developer for acumatica!!!!

you can download it from  Download

The screenshot of it:

Find table by column name

Quite common task, which I bored to google and as it is not hard to memorize, but decided to record it.

SELECT COLUMN_NAME, TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS  WHERE COLUMN_NAME LIKE '%DocType%'

List View in accumatica

Here I want to describe how to create such simple page like this:

For reading this manual father you need to know how to add page to sitemap in accumatica. If you need me to describe this process let me know, I assume it is not challenging process.

For staff like this you need ListView template and two other classes.

The first class is used to represent single view item in grid and second class intended for navigating in the db. 

Accumatica manual recomends the following location of those two classes:

1. Create separated project ( for example IG )

2. Inside of it create Folder with the name of pages folder ( for example Investigation )

3. Add reference to the dll PX.Data

4. Create class CountryMaint:

namespace IG.Investigation
{
    public class CountryMaint : PXGraph<CountryMaint>
    {
    }
}

5. Build class library and add reference to newly created project.

I got something similar to this ( just without red rectangle ):

For now we have manager of records but without representation of records itself. Let's do it with tool called Data access class generator. Switch back to the file IG301000.aspx choose design mode and for the typename choose IG.Investigation.CountryMaint.