Merge pull request #10456 from aspangaro/10.0_Ledger_improve_import

FIX: FEC Compatibility for import in ledger
This commit is contained in:
Laurent Destailleur 2019-01-30 15:01:02 +01:00 committed by GitHub
commit 60fa8d08c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 9 deletions

View File

@ -262,15 +262,34 @@ class modAccounting extends DolibarrModules
$this->import_icon[$r]=$this->picto;
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('b'=>MAIN_DB_PREFIX.'accounting_bookkeeping'); // List of tables to insert into (insert done in same order)
$this->import_fields_array[$r]=array('b.doc_date'=>"Docdate",'b.code_journal'=>'Codejournal','b.numero_compte'=>'AccountAccountingShort','b.label_operation'=>'LabelOperation','b.debit'=>"Debit",'b.credit'=>"Credit",'b.date_creation'=>"DateCreation");
$this->import_fieldshidden_array[$r]=array('b.fk_user'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_convertvalue_array[$r]=array(
't.fk_projet'=>array('rule'=>'fetchidfromref','classfile'=>'/projet/class/project.class.php','class'=>'Project','method'=>'fetch','element'=>'Project'),
't.ref'=>array('rule'=>'getrefifauto')
);
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_fields_array[$r]=array(
'b.doc_date'=>"Docdate",
'b.piece_num'=>"TransactionNumShort",
'b.code_journal'=>'Codejournal',
'b.journal_label'=>'JournalLabel',
'b.numero_compte'=>'AccountAccounting',
'b.label_compte'=>'LabelAccount',
'b.subledger_account'=>'SubledgerAccount',
'b.subledger_label'=>'SubledgerAccountLabel',
'b.label_operation'=>'LabelOperation',
'b.debit'=>"Debit",
'b.credit'=>"Credit"
);
$this->import_fieldshidden_array[$r]=array('b.fk_user_author'=>'user->id'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r]=array('b.doc_date'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
//$this->import_examplevalues_array[$r]=array('t.fk_projet'=>'MyProjectRef','t.ref'=>"auto or TK2010-1234",'t.label'=>"My task",'t.progress'=>"0 (not started) to 100 (finished)",'t.datec'=>'1972-10-10','t.note_private'=>"My private note",'t.note_public'=>"My public note");
$this->import_examplevalues_array[$r]=array(
'b.doc_date'=>'formatted as \'.dol_print_date(dol_now(),\'%Y-%m-%d\')',
'b.piece_num'=>'1',
'b.code_journal'=>"VTE",
'b.journal_label'=>"Journal des ventes",
'b.numero_compte'=>"707",
'b.label_compte'=>'Ventes',
'b.subledger_account'=>'',
'b.subledger_label'=>'',
'b.label_operation'=>"Ventes services",
'b.debit'=>"0,00",
'b.credit'=>"100,00"
);
// Chart of accounts
$r++;

View File

@ -84,7 +84,8 @@ ChangeAndLoad=Change and load
Addanaccount=Add an accounting account
AccountAccounting=Accounting account
AccountAccountingShort=Account
SubledgerAccount=Subledger Account
SubledgerAccount=Subledger account
SubledgerAccountLabel=Subledger account label
ShowAccountingAccount=Show accounting account
ShowAccountingJournal=Show accounting journal
AccountAccountingSuggest=Accounting account suggested
@ -166,6 +167,7 @@ LabelOperation=Label operation
Sens=Sens
LetteringCode=Lettering code
Codejournal=Journal
JournalLabel=Journal label
NumPiece=Piece number
TransactionNumShort=Num. transaction
AccountingCategory=Personalized groups