Hi,
I have a strange one which is got my a little stumped to know how to handle.
when generating an invoice file, it uses a counter to get the last number, and I use this same counter to send an RSG message back. This works perfectly when there is one invoice, however if I send 5 the two values don't match up. They do at one point as they cross over, but it seems like the number isn't the same. For instance;
STX : Reference 1
RSG : Reference 4
STX : Reference 2
RSG : Reference 2
STX : Reference 3
RSG : Reference 4
STX : Reference 4
RSG : Reference 3
Because the STX value doesn't match the RSG value it causes an error. I am using the invoice plugin from the source forge website and nothing has changed, and like I said it works with just one invoice, but not multiple.
Grammar is;
from bots.botsconfig import *
syntax = {
'field_sep': ',',
'charset': "utf-8",
'quote_char': '"',
'skip_firstline':True,
'noBOTSID': True, #use this if there is no 'record identification' this is only possible it all records are the same kind of records.
}
nextmessageblock = ({'BOTSID':'HEADER','INVOICE_NUMBER':None})
structure = [
{ID:'HEADER',MIN:0,MAX:99999,
QUERIES:{
'frompartner': ({'BOTSID':'HEADER','ANA_NO':None}),
'topartner': ({'BOTSID':'HEADER','ANA':None}),
'referenceunb': {'BOTSID':'HEADER','INVOICE_NUMBER':None},
'intdtm': {'BOTSID':'HEADER','trans_date':None},
},
}]
recorddefs = {
'HEADER': [
['BOTSID', 'M', 256, 'AN'],
['ANA_NO', 'C', 256, 'AN'],
['JL_ANA', 'C', 256, 'AN'],
['trans_date', 'C', 256, 'AN'],
['trans_time', 'C', 256, 'AN'],
['ih_id', 'C', 256, 'AN'],
['Suppliers_ID', 'C', 256, 'AN'],
['VAT', 'C', 256, 'AN'],
['Branch_name', 'C', 256, 'AN'],
['Despatch_note_no', 'C', 256, 'AN'],
['ili_net', 'C', 256, 'AN'],
['ili_gross', 'C', 256, 'AN'],
['ili_vat', 'C', 256, 'AN'],
['TRACKING_NUMBER', 'C', 256, 'AN'],
['INVOICE_NUMBER', 'C', 256, 'AN'],
['INVOICE_DATE', 'C', 256, 'AN'],
['ORDER_NUMBER', 'C', 256, 'AN'],
['ORDER_DATE', 'C', 256, 'AN'],
['ECOMMERCEITEMID', 'C', 256, 'AN'],
['SKU', 'C', 256, 'AN'],
['SKU_DESCRIPTION', 'C', 256, 'AN'],
['SKU_QUANTITY', 'C', 256, 'AN'],
['PRICE_NET', 'C', 256, 'AN'],
['PRICE_GROSS', 'C', 256, 'AN'],
['Delivery_charge', 'C', 256, 'AN'],
],
}
and the line I am using in the mapping file is;
ord.put({'BOTSID':'MHD'},{'BOTSID':'RSG','RSGA':int(transform.unique('stxcounter_5060409680017'))+1,'RSGB':mes.get({'BOTSID':'HEADER','ANA':None})})
The invoice grammars are the standard ones off the source forge website.
Thanks for your help on this.
Lee