Ligação do Gestix ERP a Loja Online WooCommerce

Com o Gestix consegue trabalhar com a facturação e controlo de stock de sua loja online. Nosso plug-in permite-lhe além de comunicar com o software ERP para controlo de stock, indicação de vendedora ser associado ao documento, escolher o documento que será utilizado para entrada da encomenda no ERP, dentre outras opções.

Comercializada a partir do ano 2008, a Gestix WebShop API (ou simplesmente API do Gestix) é uma Interface de Programação de Aplicativos desenvolvida para fornecer aos desenvolvedores da Web as ferramentas para integrar um site de comércio eletrónico ao software Gestix ERP.

Plugin WooGestix para WordPress

Para facilitar a integração do Gestix ERP às lojas online criadas com WordPress e WooCommerce, está disponível um plugin específico para esta plataforma.

Máxima Segurança

O controlo de acesso exclusivo por URL, Login, Password, e Desafio (Autoid), permite garantir um nível de segurança mais elevado na ligação da loja online ao Gestix ERP. A loja online nunca acede diretamente à informação armazenada no Gestix.

Máxima Flexibilidade

Nas definições do plugin WooGestix, é mais fácil configurar cada loja da forma mais conveniente em cada caso. De acordo com o tipo de produtos, modo de processamento da encomenda, e tipo de informação a mostrar ao visitante, o utilizador pode ajustar o funcionamento do sistema através de um ecrã simples e com um mínimo de opções.

Pronto a Funcionar

Uma vez configurada a ligação entre a loja e o Gestix, pode de imediato começar a processar encomendas. O Gestix cria automaticamente as fichas do cliente e dos produtos envolvidos.

Por outro lado, pode também exportar os Produtos do Gestix ERP para a loja online, ou, caso esteja a começar com o Gestix ERP e já tenha loja online, pode importar os Produtos da loja online para o Gestix ERP.

Ecrã de Configuração Simples

Documento de faturação a utilizar – pode indicar encomendas ou faturas/recibo

Conta de Vendedor – contabilização das vendas numa determinada conta de vendedor

Código do Armazém ou Loja Virtual – para efeitos de processamento das encomendas

Modalidade de Processamento

  • Emissão de Confirmação de Encomenda
  • Emissão da Fatura/Recibo

Stock máximo disponível a apresentar na loja online




Gestix 5.5.3 changes log

Release History (up to date)

Changes log and improvements made over time indicating the software version in which it occurred.

Highlight for POS – Touch a Sale with all the functionality for Touch or Mouse, tablet, etc.

Screen Shot 2017-11-13 at 08.54.58

Gestix 5.5.3 ERP+CRM

  • Return memo obtained the value of the customer’s price list and not the value of the source document [5.5.3]
  • Search Article in several series in the menu Purchasing / Billing, etc. [5.5.3]
  • Do not allow delete invoiced contracts unless closed [5.5.3]
  • Show balance in SAF-T menu vs Invoicing Fiscal Report Listing [5.5.3]
  • Make PL / GT from order * without closing (* Proposal / Quote, Estimate) [5.5.3]
  • Enable saving Order as a draft document [5.5.3]
  • Picking list no prices – check Shipping & Handling amount is hidden as well [5.5.3]
  • AT ID / Código AT print in same font as the Shipping details [5.5.3]
  • Generation of ATM references and other means of electronic payment [5.5.3]
  • Assign Tax Exemption Reason automatically on Document Import (add option) [5.5.3]
  • Automatic Billing Per Document with 0% VAT assuming pre-defined reason [5.5.3]
  • Simplified invoice up to 100 euros or 1000 in case of Retailer / V. Ambulante [5.5.3]
  • Invoice in foreign currency: always include countervalue Base Currency [5.5.3]
  • Contract billing – pending invoice – Calculate Due Date accordingly [5.5.3]
  • Order of Proposta/Quote respect Seller and Project [5.5.3]
  • The link to the invoice receipt in the document status window would open the invoice instead of the receipt [5.5.2]
  • Point of Sales / Till system – search item by Description/Family [5.5.1]
  • Credit memo without Invoice invalid for SAF-T – idem Receipt without Invoice [5.5.1]
  • Warn user before closing window during document edit [5.5.1]
  • List customers with VAT ID information. Exclude customers with empty VAT ID field. List alphabetically (By ID checked) and by VAT ID number (By ID unchecked) [5.3.2]
  • Nova versão [5.2.5]
  • Enable task management in suppliers and salespersons (Corporate) [5.2.4]
  • Kit/Package – show net prices in articles listing [5.2.4]
  • Adding kit/package to document looses prices when edited [5.2.4]
  • Não é permitida a edição de dados de documentos fechados ou anulados [5.2.4]
  • Option to disallow users from entering duplicate barcode items. Barcode fields repositioned for easier access. [5.2.4]
  • New Inventory by Date in Gestix Business 5.3 [5.2.4]
  • New possibility, create invoice from a void one [5.2.4]
  • New Gestix Bill a free invoicing application for up to 60 kEUR billing volume, on demand technical support by Help Desk service [5.2.3]
  • It was possible to edit stock transactions even when involving Batch Numbers, yielding wrong item stock – fixed [5.2.2]
  • Invalid Min.Qty warning in Invoice when Article’s minimum sale quantity not zero [5.2.2]
  • Set VAT Reasons using Gestix API: dci_reason_N now available [5.2.2]
  • The carrier defined in the order was not preserved when converting to Invoice [5.2.2]
  • Avoid accepting duplicate batch numbers in sales to prevent breaking the available stock [5.2.2]
  • New standard VAT Exemptions Table (for SAF-T enabled countries, shows exemptions reasons in invoice’s notes/comments and SAF-T file) [5.2.2]

Gestix 5.2 Billing Software Update

A new update, Gestix 5.2 is being released.

This update introduces the table of standard VAT exemption reasons, as recommended by the Tax Authority. It also includes several enhancements and fixes relative to version 5.1.

If you use Gestix Cloud, the update is automatic. It appears information to the user that it had an effect, and no need to do anything else.

If you use Gestix Download, running on your computer, and have the updates plan on time, you can download the software update from the location:

The new Table Normalized VAT Exceptions can be accessed in the Admin / VAT rates menu. When invoicing with VAT exemption will now be available the codes in this list. You find in this menu the ability to edit the list to remove the options possibly not necessary in the case of your company.

In countries where it is not compulsory to use certified billing software, the new version does not require changes to the VAT table. However, it offers a new security option to give more freedom to editing invoices and other documents after recorded, as in earlier versions of Gestix prior to the 2008-2010 certification.

Gestix 5.2 (fiscal update, release 1, 2016)

  • New standard VAT Exemptions Table (for SAF-T enabled countries, shows exemptions reasons in invoice’s notes/comments and SAF-T file) [5.2.2]
  • Group VAT exemption reasons by reason and display then in the invoice’s Notes/comments area [5.2]
  • Set VAT Reasons using Gestix API: dci_reason_N now available [5.2.2]
  • Manage Batch Quantity by warehouse (same batch ID in different warehouses) [5.2.2]
  • It was possible to edit stock transactions even when involving Batch Numbers, yielding wrong item stock – fixed [5.2.2]
  • Corrected problem in sending supplier purchase orders by email  [5.1.13]
  • Fixed issue where the amount in words on invoices / receipts appeared with parts in English [5.2]
  • Billing contracts / recurrent Billing: option expiration date corresponds to the date of the contract renewal limit (Use data de vencimento do contrato) [5.2]
  • The conversion of orders into invoices was corrected problem in the currency could be changed for that was set in the client file [5.2]
  • Gestix API Improved handling of multiple shipping addresses for recurring customers [5.2]
  • Gestix API Improved to handle different VAT Exemptions for products and shipping [5.2]
  • Automatic notification of transport documents by AT Webservice [5.1.12]
  • The carrier defined in the order was not preserved when converting to Invoice [5.2.2]
  • Invalid Min.Qty warning in Invoice when Article’s minimum sale quantity not zero [5.2.2]
  • New function to duplicate article records and general tables records on new Gestix Enterprise [5.1.12]
  • New function to set Measurement Units and remove invalid chars from articles [5.1.12]
  • Inventory CSV small corrections, old versions [5.1.11]
  • Recalculate due date according to customer’s payment terms when changing invoice date [5.1.11]
  • Web Service AT – improvement of diagnostic messages [5.1.12]
  • Contract billing – optionally make the due date follow the first date of the billing period. Configurable from parameters usr_ctfduedt [5.1.12]
  • Webservice AT: in case of wrong password webservice returns error 99 and Gestix now transmits this message clearly to the operator [5.1.12]
  • Enable companies based in countries where it is not compulsory digital signature to enable editing invoices [5.1.12]
  • Print invoices in batches to print only the original or a duplicate (selectable) [5.1.15]
  • Allow import documents generated under other than digitally signs for intermediate document type order or similar  [5.1.12]
  • Corrected problem that could forget the default VAT after editing Admin / TA Credentials [5.1.12]
  • Corrected issue: Assigning the batch number’s Production Date is always forgot [5.1.15]
  • In calculating the Cost Average Price, option for dilution of expenses by amount or quantity [5.1.14]
  • Print 2nd copy with explicit indication on every page of the invoice or at the end bottom of the same [5.1.15]
  • Avoid accepting duplicate batch numbers in sales to prevent breaking the available stock [5.2.2]
  • Salespersons listings and reports by Geographic Area [5.1.11]
  • Allow Close Orders to users that can change and delete [5.2.1]
  • Allow the operator to define the default warehouse, in the multi-store menu, that will be used in data import operations  [5.2.1]
  • Enable Stock Release and Stock Reception memos to print price information [5.1.13]
  • Warehouse reports where corrected regarding a problem when only one warehouse was selected [5.1.13]
  • Optional dilution of shipping cost calculation by item quantity instead of item amount [5.1.13]
  • security option to just letting register invoices and overall sales of products in stock. Services and text with price are not allowed [5.1.13]
  • New configuration option to forbid sales of items not in stock, like services and others. [5.1.13]
  • The Use due date option in the Report Customer Debt by Age was not working correctly [5.1.13]
  • Corrected the customer totals in the CSV Report Customer Debt by Age [5.1.15]
  • When multiple currencies involved, show the invoice total in both EURO and GBP (or any other currencies)  [5.1.13]
  • Corporate: Discount by customer and product category – multiple discount columns [5.1.15]
  • Corrected: Initial Balance is not handled properly when paid in part: it would not allow another payment [5.1.12]
  • Improving efficiency in the Transport Document Transmission AT Webservice [5.1.15]
  • Corrected a problem when sending a document by email, only the duplicate was sent [5.1.15]
  • Corrected a problem that prevented configuration of the LDAP Directory system for user authentication [5.1.15]
  • Make the due date editable in open invoices [5.1.12]
  • Corrected transitory problem that required the operator to enter the item quantity manually in the Point of Sales menu [5.1.15]
  • Corrected problem that prevented access to the function to change the VAT for multiple items [5.2]


0394 Gestix Enterprise (Corporate Enterprise)
0395 Gestix Business (Business Light, Business Mini, Business CRM)
0396 Gestix POS
0397 Gestix Life

Estado da Certificação

eCommerce integration case study – OSCommerce + Gestix API

Intended for web programmers, these code snippets handle, respectively, gathering the order from the oscommerce database, and posting the order to the Gestix business support system through the Gestix Webshop API.

Code Snippets

Gather an order from OSCommerce

function gnet_GetOrder( $order_id )
{ // register an order to Gestix
global $gnet_aAuth, $gnet_aConf;
 // get customer information
 $customer_query= tep_db_query("SELECT customers_id, billing_name, billing_company, billing_nif, billing_street_address, billing_suburb, billing_postcode, billing_city, billing_country, delivery_street_address, delivery_suburb, delivery_postcode, delivery_city, delivery_country, payment_method FROM " . TABLE_ORDERS . " WHERE orders_id='" . $order_id . "'");
 $customer_rows= tep_db_num_rows($customer_query);
 if ( $customer_rows != 1 )
 echo '<pre>gnet-wsi.php: gnet_GetInvoice(): $gnet_customer_rows= ' . $customer_rows . '</pre>';
 $customer= tep_db_fetch_array( $customer_query );
 $entity_query= tep_db_query("SELECT customer_id, ent_id FROM gnet_customers_entities WHERE customer_id='" . $customer['customers_id'] . "'");
 $entity_rows= tep_db_num_rows($entity_query);
 /* According to GTM#739,
 when placing an order with a different billing address,
 the entity file shall not be modified in Gestix.
 Nevertheless, since no two entities can share the same taxpayerid,
 even if we don't supply ent_id to Gestix, it will modify the entity file
 if the taxpayerid matches.
 if ( $entity_rows == 0 )
 $DocHeader['ent_id']= '';
 $entity= tep_db_fetch_array( $entity_query );
 $DocHeader['ent_id']= $entity['ent_id'];
 $DocHeader['ent_name']= $customer['billing_name'];
 $DocHeader['ent_name2']= $customer['billing_company'];
 $DocHeader['ent_taxid']= $customer['billing_nif'];
// Billing address
 $DocHeader['adr_1']= $customer['billing_street_address'];
 $DocHeader['adr_2']= $customer['billing_suburb'];
 $DocHeader['adr_3']= $customer['billing_postcode'] . ' ' . $customer['billing_city'];
 $DocHeader['adr_4']= $customer['billing_country'];
 // Shipping address
 $DocHeader['sadr_1']= $customer['delivery_street_address'];
 $DocHeader['sadr_2']= $customer['delivery_suburb'];
 $DocHeader['sadr_3']= $customer['delivery_postcode'] . ' ' . $customer['delivery_city'];
 $DocHeader['sadr_4']= $customer['delivery_country'];
 // get order's products
 $order_query= tep_db_query("SELECT products_model, products_name, products_price, products_quantity, products_tax, final_price FROM " . TABLE_ORDERS_PRODUCTS . " WHERE orders_id='" . $order_id . "'");
 $order_rows= tep_db_num_rows($order_query);
 if ( $order_rows < 1 )
 echo '<pre>gnet-wsi.php: gnet_GetOrder(): order_rows= ' . $order_rows . ', order_id= ' . $order_id . '</pre>';
 // cache known articles from Gestix
 $gnet_articles= gnet_GetResponse( gnet_GetArticleList(), $gnet_aConf['LongQueryTimeout'] );
 for ( $row= 0; $row < $order_rows; $row++ ) // for every product in order
 $order= tep_db_fetch_array($order_query);
 $article_found= false;
 for ( $article= 0; $article < $gnet_articles['nr_of_items']; $article++ ) // for every known article
 if ( $order['products_model'] == ltrim($gnet_articles['kit_id'.$article]) ) // if it matches
 $Items[$row]['dit_type'.$row]= 'P';
 $Items[$row]['dit_kit_id'.$row]= $order['products_model']; // 13 chars
 $Items[$row]['dit_descr'.$row]= $order['products_name']; // 64 chars
 $article_found= true;
 break; // breakfor $article
 if ( $article_found == false ) // What are we supposed to do in this situations ? Answer by JG: Do exactly this!
 // NOTE: We're NOT supposed to create articles in Gestix in this implementation
 // so, i'll just create a text line with model and name concatenated
 $Items[$row]['dit_type'.$row]= 'T';
 $Items[$row]['dit_kit_id'.$row]= '';
 $Items[$row]['dit_descr'.$row]= $order['products_model'] . ' ' . $order['products_name']; // 13+64=77 chars
 $Items[$row]['dit_qty'.$row]= $order['products_quantity'];
 // this site goes like: unit_price * tax * quantity
 $Items[$row]['dit_up'.$row]= round( $order['products_price'] * ( 1 + ( $order['products_tax'] / 100 ) ), 2 );
 $Items[$row]['dit_tax'.$row]= $order['products_tax'];
 $Items[$row]['dit_s_taxinc']= '1';
 // Shipping method and expenses
 $shipping_query= tep_db_query("SELECT title, value, class FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id='" . $order_id . "'");
 $shipping_rows= tep_db_num_rows($shipping_query);
 for ($row= 0; $row < $shipping_rows; $row++)
 $shipping= tep_db_fetch_array($shipping_query);
 if ($shipping['class'] == 'ot_shipping')
 $line= 0;
 $shipping_title= gnet_StringWrap( $shipping['title'] );
 while ( $shipping_title[$line] != '' )
 $Items[$order_rows]['dit_type'.$order_rows]= 'T';
 $Items[$order_rows]['dit_descr'.$order_rows]= $shipping_title[$line++];
 if ( $shipping['value'] != 0 ) // pickup at store is a shipping method without costs
 $Items[$order_rows]['dit_qty'.$order_rows]= '1';
 $Items[$order_rows]['dit_up'.$order_rows]= $shipping['value'];
 $Items[$order_rows]['dit_tax'.$order_rows]= '0'; // tax included in shipping values
 $Items[$order_rows]['dit_s_taxinc'.$order_rows]= '1';
 // Payment method
 $Items[$order_rows]['dit_type'.$order_rows] = 'T';
 $Items[$order_rows]['dit_descr'.$order_rows] = $customer['payment_method'];
 // Comments
 $comments_query= tep_db_query("SELECT comments FROM " . TABLE_ORDERS_STATUS_HISTORY . " WHERE orders_id='" . $order_id . "'");
 $comments_rows= tep_db_num_rows($comments_query);
 if ($comments_rows != 0)
 $comments= tep_db_fetch_array($comments_query);
 $line= 0;
 $comments_line= gnet_StringWrap( $comments['comments'] );
 while ( $comments_line[$line] != '' )
 $Items[$order_rows]['dit_type'.$order_rows]= 'T';
 $Items[$order_rows]['dit_descr'.$order_rows]= $comments_line[$line++];
 // prepare the authentication fields
 // $gnet_aAuth['diag']= '1'; // use 0 or 1 (3 is forbiden)
 $gnet_aAuth['command']= 'order';
 //$gnet_aAuth['ordinal_number']= (1 + time()) % 100000000;
 $DocHeader['dhd_ser']= $gnet_aConf['DocOrder'];
 $DocHeader['dhd_ref']= $order_id;
 $DocHeader['lines']= $order_rows;
// POST the form to Gestix
 $gnet_aAuth['ordinal_number']= gnet_PostForm( $DocHeader, $Items, $order_rows );
// Wait for the answer
 $ReturnFields= gnet_GetResponse( $gnet_aAuth['ordinal_number'], $gnet_aConf['Timeout'] );
 if ( $ReturnFields === false )
 echo '<pre>gnet-wsi.php: gnet_GetOrder(): Timeout waiting for answer: ' . $gnet_aAuth['ordinal_number'] . '</pre>';
 else // something came back
 if (count($ReturnFields) > 0 && isset($ReturnFields['response']))
 if (substr($ReturnFields['response'], 0, 2) != 'ok')
 $Error= $ReturnFields['response'];
 print '<pre>gnet-wsi.php: gnet_GetOrder(): Gestix document error</pre>';
 print '<pre>' . $Error . '</pre>';
 else // response ok
 // fill in gnet_customers_entities if needed
 if ( $entity_rows == 0 )
 tep_db_query("INSERT INTO gnet_customers_entities ( customer_id, ent_id ) VALUES (" . $customer['customers_id'] . ", " . $ReturnFields['ent_id'] . ")");
} // endfunction gnet_GetOrder

Post an order to Gestix

// gnet-postform.php
// Copyright 2008
// Writen by Rui Ferreira @ 
function gnet_PostForm( $DocHeader= array(), $Items= array(), $Lines= 0)
// send a post to Gestix; return ordinal number
  global $gnet_aAuth; // see Gestix Webshop integration guide
 // generate a random number
 $gnet_aAuth['ordinal_number']= rand( 1, 98765432);
 // Set authentication
 $ch= curl_init();
 curl_setopt($ch, CURLOPT_URL, $gnet_aAuth['gestix_url']);
 curl_setopt($ch, CURLOPT_POST, 1);
 $PostOutput= http_build_query($gnet_aAuth);
 // Set document header, if any
 if ( count($DocHeader) != 0 )
 $PostOutput .= '&';
 $PostOutput .= http_build_query($DocHeader);
 // Set item lines, if any
 for ($row= 0; $row < $Lines; $row++)
 $PostOutput .= '&';
 $PostOutput .= http_build_query($Items[$row]);
 // Send all
 curl_setopt($ch, CURLOPT_POSTFIELDS, $PostOutput);
 $output= curl_exec($ch);
 return $gnet_aAuth['ordinal_number'];
} // endfunction gnet_PostFrom