Import tychto dat 2390081280912210446 24022010000000001826000016S000000S000000400203810775000308000000021500000000003ANETA NEMECKOVA CSLA 123 90845GBELY $
spravite upravou cashimportcft.php $patterns[] = array(
'id' => NULL, // import source identifier (from 'cashsources' table)
'pattern' => "/^[^ ]+\ ([0-9]{8})[0-9]{6}([0-9]{6}).{38}([0-9]{10})([0-9]{10})[0-9]{1}([^ ]*)[ ]*([^ ]*).*/",
'pid' => 0, // customer ID position in expression
// if zero - we try to search ID by regexp,
// invoice number or customer name and forename in entire line
'pname' => 5, // Pozicia mena
'plastname' => 6, // Pozicia priezviska
'pvalue' => 2, // Pozicia hodnoty vkladu
'pvariab_symbol' => 3, // operation comment position VARIABILNY SYMBOL
'pdate' => 1, // date position
// 'ppopis_platby' => 5, // popis platby z banky
'pspec_symbol' => 4, // doplni este specific symbol do komentara
//datum bez medzier denmesiacrok
'date_regexp' => '/([0-9]{2})([0-9]{2})([0-9]{4})/', // date format (ddmmyyyy)
'pday' => 1,
'pmonth' => 2,
'pyear' => 3,
'pid_regexp' => '/^[^ ]+\ [0-9]{8}[0-9]{6}[0-9]{6}.{38}([0-9]{10}).*/', // if 'pid' is not specified
// try to find it by regexp
'invoice_regexp' => '/^[^ ]+\ [0-9]{8}[0-9]{6}[0-9]{6}.{38}[0]{2}([1]{1})([0-9]{2})([0-9]{2})([0-9]{3}).*/',// format of invoice number
// default %N/LMS/%Y teraz 10909123 a NEPOCITA SA S CISLOVANIM NAD TISIC V ID FAKTURY, v pripade nad 1000 si uprav regexp chlape
'pinvoice_number' => 4, // position of invoice number in $invoice_regexp
'pinvoice_year' => 2, // year position in $invoice_regexp
'pinvoice_month' => 3, // month position in $invoice_regexp
'encoding' => 'cp852', // imported data encoding (for conversion)
'modvalue' => 0.01, // if not zero do value = value * modvalue
'use_line_hash' => TRUE, // create md5 hash for whole import line instead of
// time, value, customer name and comment
'line_idx_hash' => FALSE, // include line number into hash data NEDEFINOVAT TRUE
a drobne upravy v cashimportparser.php $name = isset($matches[$pattern['pname']]) ? trim($matches[$pattern['pname']]) : '';
$lastname = isset($matches[$pattern['plastname']]) ? trim($matches[$pattern['plastname']]) : '';
$time = isset($matches[$pattern['pdate']]) ? trim($matches[$pattern['pdate']]) : '';
$value = str_replace(',','.', isset($matches[$pattern['pvalue']]) ? trim($matches[$pattern['pvalue']]) : '');
// $popis_platby = isset($matches[$pattern['ppopis_platby']]) ? trim($matches[$pattern['ppopis_platby']]) : '';
$variab_symbol = isset($matches[$pattern['pvariab_symbol']]) ? trim($matches[$pattern['pvariab_symbol']]) : '';
$spec_symbol = isset($matches[$pattern['pspec_symbol']]) ? trim($matches[$pattern['pspec_symbol']]) : '';
//skontroluje nulovy variabilny symbol a prideli prazdnu hodnotu
if($variab_symbol =='0000000000'){$variab_symbol ='';}
//skontroluje nulovy specificky symbol a prideli prazdnu hodnotu
if($spec_symbol =='0000000000'){$spec_symbol ='';}
$fullname = $lastname;
Pokial chcete kontrolovat najprv podla VS, potom podla cisla faktury, a nakoniec skusit vyhladat jeden relevantny vysledok z kombinacie mena+priezviska, resp. z priezviska+mena, obcas si doplnte nasledovne //skontroluje nekorektne ID zakaznika alebo nepriradenu hodnotu
if(!$id || (!$DB->GetOne('SELECT id FROM customers WHERE id = ?', array($id)))){$id = 0;}
A treba este toto if(!$id && $name && $lastname)
{
$uids = $DB->GetCol('SELECT id FROM customers WHERE UPPER(lastname)=UPPER(?) and UPPER(name)=UPPER(?)', array($lastname, $name));
$uidsneq = $DB->GetCol('SELECT id FROM customers WHERE UPPER(lastname)=UPPER(?) and UPPER(name)=UPPER(?)', array($name, $lastname));
$uidsfull = $DB->GetCol('SELECT id FROM customers WHERE UPPER(lastname)=UPPER(?)', array($fullname));
if(sizeof($uids)==1)
$id = $uids[0];
if(sizeof($uidsneq)==1)
$id = $uidsneq[0];
if(sizeof($uidsfull)==1)
$id = $uidsfull[0];
}
A nakoniec komentar zoskladam zo vsetkeho, co si zakaznik vyplni na PPP U $comment = trim('Platba'.' '.'PPP'.' '.'U'.' '.$variab_symbol.' '.$spec_symbol);
Zbytocnostou nie je upravit i template, aby bola moznost doparovat rucne, resp. zvolit ineho zakaznikav pripade, ze zakaznik uhradi pod zlym VS(obcas i posta zle precita rukou vyplneny symbol).