Question Status

Suggested Answer
Pedro Rodriguez asked a question on 24 Mar 2015 7:31 AM

Hi,

Here is a question that should arrise quite often  but it seems that there is not too much info about. Which is the way to go in order to import the Register Transactions from 3rd Party POS Systems?

I think it should done in a way that it lets later to create Statement journals with the imported transactions.

Thanks

Reply
Suggested Answer
nunomaia responded on 24 Mar 2015 4:54 PM

Hi

Without knowing all the details (data volumes, etc.), I would recommend AIF to import data.

Please, take a look at msdn.microsoft.com/.../dd362007.aspx

Reply
Suggested Answer
Pedro Rodriguez responded on 25 Mar 2015 9:18 AM

I think I found it. The tables that should be at least filled are RetailTransactionTable, RetailTransactionSalesTrans and RetailTransactionPaymentTrans. Here a piece of code which simply copies the data from the demo data to generate a transaction which could be used to generate a Statement.

RetailTransactionTable retailTransactionTable, retailTransactionTableNew;
 RetailTransactionSalesTrans retailTransactionSalesTrans, retailTransactionSalesTransNew;
 RetailTransactionPaymentTrans retailTransactionPaymentTrans, retailTransactionPaymentTransNew;
 RetailReceiptId retailReceiptId = 'ANNAPOL-1-237878';
 RetailReceiptId retailReceiptIdNew = "ANNAPOL-TEST001";
 RetailTransactionId retailTransactionIdNew = "ANNAPOL-TEST001";
 ;


 ttsBegin;
    retailTransactionTable = retailTransactionTable::findReceiptId(retailReceiptId);
    retailTransactionTableNew = retailTransactionTable::findReceiptId(retailReceiptIdNew);
    if (!retailTransactionTableNew)
    {
        retailTransactionTableNew.data( retailTransactionTable);
        retailTransactionTableNew.receiptId = retailReceiptIdNew;
        retailTransactionTableNew.invoiceId = '';
        retailTransactionTableNew.salesOrderId = '';
        retailTransactionTableNew.statementId = '';
        retailTransactionTableNew.transactionId = RetailTransactionIdNew;
        retailTransactionTableNew.entryStatus = RetailEntryStatus::None;
        retailTransactionTableNew.transDate = systemDateGet();
        retailTransactionTableNew.businessDate = systemDateGet();
        retailTransactionTableNew.insert();
    }

    while select retailTransactionPaymentTrans
        where retailTransactionPaymentTrans.transactionId == retailTransactionTable.transactionId
        && retailTransactionPaymentTrans.store == retailTransactionTable.store
        && retailTransactionPaymentTrans.terminal == retailTransactionTable.terminal
    {
        retailTransactionPaymentTransNew.data( retailTransactionPaymentTrans);
        retailTransactionPaymentTransNew.transactionId = retailTransactionIdNew;
        retailTransactionPaymentTransNew.receiptId = retailReceiptIdNew;
        retailTransactionPaymentTransNew.statementId = '';
        retailTransactionPaymentTransNew.transactionStatus = RetailEntryStatus::None;
        retailTransactionPaymentTransNew.transDate = systemDateGet();
        retailTransactionPaymentTransNew.businessDate = retailTransactionPaymentTransNew.transDate;
        retailTransactionPaymentTransNew.insert();
    }


    while select retailTransactionSalesTrans
        where retailTransactionSalesTrans.transactionId == retailTransactionTable.transactionId
        && retailTransactionSalesTrans.store == retailTransactionTable.store
        && retailTransactionSalesTrans.terminalId == retailTransactionTable.terminal
    {
        retailTransactionSalesTransNew.data( retailTransactionSalesTrans);
        retailTransactionSalesTransNew.transactionId = retailTransactionIdNew;
        retailTransactionSalesTransNew.receiptId = retailReceiptIdNew;
        retailTransactionSalesTransNew.statementId = '';
        retailTransactionSalesTransNew.inventStatusSales = RetailInventStatusSales::None;
        retailTransactionSalesTransNew.transactionStatus = RetailEntryStatus::None;
        retailTransactionSalesTransNew.inventTransId = '';
        retailTransactionSalesTransNew.transDate = systemDateGet();
        retailTransactionSalesTransNew.businessDate = retailTransactionSalesTransNew.transDate;
        retailTransactionSalesTransNew.insert();
    }

 ttsCommit;

Reply
Pedro Rodriguez responded on 25 Mar 2015 9:19 AM

This answer is too general. I know that maybe I should use AIF but I meant which Service to use or which tables to fill. I think the answer is below.

Reply
Suggested Answer
nunomaia responded on 24 Mar 2015 4:54 PM

Hi

Without knowing all the details (data volumes, etc.), I would recommend AIF to import data.

Please, take a look at msdn.microsoft.com/.../dd362007.aspx

Reply
Suggested Answer
Pedro Rodriguez responded on 25 Mar 2015 9:18 AM

I think I found it. The tables that should be at least filled are RetailTransactionTable, RetailTransactionSalesTrans and RetailTransactionPaymentTrans. Here a piece of code which simply copies the data from the demo data to generate a transaction which could be used to generate a Statement.

RetailTransactionTable retailTransactionTable, retailTransactionTableNew;
 RetailTransactionSalesTrans retailTransactionSalesTrans, retailTransactionSalesTransNew;
 RetailTransactionPaymentTrans retailTransactionPaymentTrans, retailTransactionPaymentTransNew;
 RetailReceiptId retailReceiptId = 'ANNAPOL-1-237878';
 RetailReceiptId retailReceiptIdNew = "ANNAPOL-TEST001";
 RetailTransactionId retailTransactionIdNew = "ANNAPOL-TEST001";
 ;


 ttsBegin;
    retailTransactionTable = retailTransactionTable::findReceiptId(retailReceiptId);
    retailTransactionTableNew = retailTransactionTable::findReceiptId(retailReceiptIdNew);
    if (!retailTransactionTableNew)
    {
        retailTransactionTableNew.data( retailTransactionTable);
        retailTransactionTableNew.receiptId = retailReceiptIdNew;
        retailTransactionTableNew.invoiceId = '';
        retailTransactionTableNew.salesOrderId = '';
        retailTransactionTableNew.statementId = '';
        retailTransactionTableNew.transactionId = RetailTransactionIdNew;
        retailTransactionTableNew.entryStatus = RetailEntryStatus::None;
        retailTransactionTableNew.transDate = systemDateGet();
        retailTransactionTableNew.businessDate = systemDateGet();
        retailTransactionTableNew.insert();
    }

    while select retailTransactionPaymentTrans
        where retailTransactionPaymentTrans.transactionId == retailTransactionTable.transactionId
        && retailTransactionPaymentTrans.store == retailTransactionTable.store
        && retailTransactionPaymentTrans.terminal == retailTransactionTable.terminal
    {
        retailTransactionPaymentTransNew.data( retailTransactionPaymentTrans);
        retailTransactionPaymentTransNew.transactionId = retailTransactionIdNew;
        retailTransactionPaymentTransNew.receiptId = retailReceiptIdNew;
        retailTransactionPaymentTransNew.statementId = '';
        retailTransactionPaymentTransNew.transactionStatus = RetailEntryStatus::None;
        retailTransactionPaymentTransNew.transDate = systemDateGet();
        retailTransactionPaymentTransNew.businessDate = retailTransactionPaymentTransNew.transDate;
        retailTransactionPaymentTransNew.insert();
    }


    while select retailTransactionSalesTrans
        where retailTransactionSalesTrans.transactionId == retailTransactionTable.transactionId
        && retailTransactionSalesTrans.store == retailTransactionTable.store
        && retailTransactionSalesTrans.terminalId == retailTransactionTable.terminal
    {
        retailTransactionSalesTransNew.data( retailTransactionSalesTrans);
        retailTransactionSalesTransNew.transactionId = retailTransactionIdNew;
        retailTransactionSalesTransNew.receiptId = retailReceiptIdNew;
        retailTransactionSalesTransNew.statementId = '';
        retailTransactionSalesTransNew.inventStatusSales = RetailInventStatusSales::None;
        retailTransactionSalesTransNew.transactionStatus = RetailEntryStatus::None;
        retailTransactionSalesTransNew.inventTransId = '';
        retailTransactionSalesTransNew.transDate = systemDateGet();
        retailTransactionSalesTransNew.businessDate = retailTransactionSalesTransNew.transDate;
        retailTransactionSalesTransNew.insert();
    }

 ttsCommit;

Reply