Files
2025-05-12 15:44:39 +00:00

572 lines
17 KiB
PHP
Executable File

<?php
if (! defined ( 'sugarEntry' ) || ! sugarEntry)
die ( 'Not A Valid Entry Point' );
/**
* ***************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License.
* You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
* ******************************************************************************
*/
$dictionary ['EcmStockDocIn'] = array (
'table' => "ecmstockdocins",
'comment' => 'EcmStockDocIns',
'duplicate_merge' => true,
'unified_search' => true,
// FIELDS SECTION
'fields' => array (
// STANDARD FIELDS SECTION
'id' => array (
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'required' => true,
'reportable' => false,
'comment' => 'Unique identifier'
),
'name' => array (
'name' => 'name',
'vname' => 'LBL_NAME',
'type' => 'name',
'required' => false,
'dbType' => 'varchar',
'len' => 255,
'unified_search' => true,
'comment' => 'The short description of the record contents',
'massupdate' => true,
'merge_filter' => 'selected'
),
'description' => array (
'type' => 'text',
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'comment' => 'Description',
'unified_search' => true
// 'required' => true,
),
'date_fk' => array (
'name' => 'date_fk',
'vname' => 'Data faktury',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'required' => true
),
'kind' => array (
'name' => 'kind',
'vname' => 'LBL_KIND',
'required' => false,
'type' => 'enum',
'options' => 'ecmstockdocins_kind_dom',
'massupdate' => false,
),
'parent_name_copy' => array (
'name' => 'parent_name_copy',
'vname' => 'LBL_PARENT_NAME_COPY',
'type' => 'varchar',
'source' => 'non-db'
),
'parent_address_street' => array (
'name' => 'parent_address_street',
'vname' => 'LBL_PARENT_ADDRESS_STREET',
'type' => 'varchar',
'len' => '150',
'comment' => 'The street address used for parent address',
'group' => 'parent_address',
'merge_filter' => 'enabled'
),
'parent_address_city' => array (
'name' => 'parent_address_city',
'vname' => 'LBL_PARENT_ADDRESS_CITY',
'type' => 'varchar',
'len' => '100',
'comment' => 'The city used for parent address',
'group' => 'parent_address',
'merge_filter' => 'enabled'
),
'parent_address_postalcode' => array (
'name' => 'parent_address_postalcode',
'vname' => 'LBL_PARENT_ADDRESS_POSTALCODE',
'type' => 'varchar',
'len' => '20',
'group' => 'parent_address',
'comment' => 'The postal code used for parent address',
'merge_filter' => 'enabled'
),
'parent_address_country' => array (
'name' => 'parent_address_country',
'vname' => 'LBL_PARENT_ADDRESS_COUNTRY',
'type' => 'varchar',
'group' => 'parent_address',
'comment' => 'The country used for the parent address',
'merge_filter' => 'enabled'
),
'status' => array (
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'enum',
'size' => '3',
'options' => 'ecmstockdocins_status_dom',
'massupdate' => false,
),
'date_fk_p' => array (
'name' => 'date_fk_p',
'vname' => 'Termin płatności',
'type' => 'date',
'showFormats' => true,
'reportable' => false,
'required' => true
),
'date_entered' => array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record created'
),
'po_id' => array (
'name' => 'po_id',
'vname' => 'LBL_ID',
'type' => 'id',
'required' => false,
'reportable' => false,
'comment' => 'Unique identifier'
),
'date_modified' => array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record last modified'
),
'modified_user_id' => array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED',
'type' => 'assigned_user_name',
'table' => 'modified_user_id_users',
'isnull' => 'false',
'dbType' => 'varchar',
'len' => 36,
'required' => true,
'reportable' => true,
'comment' => 'User who last modified record'
),
'assigned_user_id' => array (
'name' => 'assigned_user_id',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'vname' => 'LBL_ASSIGNED_TO_ID',
'group' => 'assigned_user_name',
'type' => 'relate',
'table' => 'users',
'reportable' => true,
'Importable' => false,
'isnull' => 'false',
'dbType' => 'id',
'audited' => true,
'comment' => 'User ID assigned to record',
'duplicate_merge' => 'disabled',
'massupdate' => false
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_ASSIGNED_TO',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'users',
'id_name' => 'assigned_user_id',
'module' => 'Users',
'duplicate_merge' => 'disabled',
'massupdate' => false
),
'created_by' => array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'created_by',
'vname' => 'LBL_CREATED',
'type' => 'assigned_user_name',
'table' => 'created_by_users',
'isnull' => 'false',
'dbType' => 'varchar',
'len' => 36,
'comment' => 'User that created the record'
),
'created_by_link' => array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'ecmstockdocins' . '_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db'
),
'modified_user_link' => array (
'name' => 'modified_user_link',
'type' => 'link',
'relationship' => 'ecmstockdocins' . '_modified_user',
'vname' => 'LBL_MODIFIED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db'
),
'assigned_user_link' => array (
'name' => 'assigned_user_link',
'type' => 'link',
'relationship' => 'ecmstockdocins' . '_assigned_user',
'vname' => 'LBL_ASSIGNED_TO_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
'duplicate_merge' => 'enabled',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'table' => 'users'
),
'deleted' => array (
'name' => 'deleted',
'vname' => 'LBL_DELETED_BY',
'type' => 'bool',
'required' => true,
'reportable' => false,
'comment' => 'Record deletion indicator'
),
'foreign_transport_val' => array (
'name' => 'foreign_transport_val',
'vname' => 'LBL_FOREIGN_TRANSPORT_VAL',
'type' => 'decimal',
'len' => '15,2',
),
'foreign_transport_cur_id' => array (
'name' => 'foreign_transport_cur_id',
'vname' => 'LBL_FOREIGN_TRANSPORT_CUR_ID',
'type' => 'varchar',
'len' => '36',
),
'foreign_transport_cur_val' => array (
'name' => 'foreign_transport_cur_val',
'vname' => 'LBL_FOREIGN_TRANSPORT_CUR_VAL',
'type' => 'decimal',
'len' => '15,2',
),
'country_transport_val' => array (
'name' => 'country_transport_val',
'vname' => 'LBL_COUNTRY_TRANSPORT_VAL',
'type' => 'decimal',
'len' => '15,2',
),
'country_transport_cur_id' => array (
'name' => 'country_transport_cur_id',
'vname' => 'LBL_COUNTRY_TRANSPORT_CUR_ID',
'type' => 'varchar',
'len' => '36',
),
'country_transport_cur_val' => array (
'name' => 'country_transport_cur_val',
'vname' => 'LBL_COUNTRY_TRANSPORT_CUR_VAL',
'type' => 'decimal',
'len' => '15,2',
),
'addition_cost_val' => array (
'name' => 'addition_cost_val',
'vname' => 'LBL_ADDITION_TRANSPORT_VAL',
'type' => 'decimal',
'len' => '15,2',
),
'addition_cost_cur_id' => array (
'name' => 'addition_cost_cur_id',
'vname' => 'LBL_ADDITION_TRANSPORT_CUR_ID',
'type' => 'varchar',
'len' => '36',
),
'addition_cost_cur_val' => array (
'name' => 'addition_cost_cur_val',
'vname' => 'LBL_ADDITION_TRANSPORT_CUR_VAL',
'type' => 'decimal',
'len' => '15,2',
),
//currency
'currency_id' =>
array (
'name' => 'currency_id',
'type' => 'varchar',
'len' => '36',
'label' => 'LBL_CURRENCY',
),
'currency_value' => array (
'name' => 'currency_value',
'vname' => 'LBL_CURRENCY_VALUE',
'type' => 'decimal',
'len' => '15,5',
),
'currency_sad_value' => array (
'name' => 'currency_sad_value',
'vname' => 'LBL_CURRENCY_SAD_VALUE',
'type' => 'decimal',
'len' => '15,5',
),
// NEW FIELDS SECTION
'number' => array (
'name' => 'number',
'vname' => 'LBL_NUMBER',
'type' => 'varchar',
'required_option' => true,
'unified_search' => true,
'required' => true,
'len' => '20'
),
'parent_name' => array(
'name'=> 'parent_name',
'parent_type'=>'ecmstockdocouts_parent_dom' ,
// 'type_name'=>'parent_type',
'id_name'=>'parent_id',
'vname'=>'LBL_PARENT_NAME',
'type'=>'relate',
'group'=>'parent_name',
'dbtype' => 'varchar',
'len' => '255',
//'source'=>'non-db',
'module' => 'Accounts',
'massupdate' => false,
// 'options'=> 'ecmstockdocouts_parent_dom',
'required' => true,
),
'parent_nip'=> array (
'name' => 'parent_nip',
'vname' => 'LBL_PARENT_NIP',
'type' => 'varchar',
'len' => 15,
),
'parent_id' => array (
'name' => 'parent_id',
'type' => 'id',
'module' => 'Accounts',
'vname' => 'LBL_PARENT_ID',
'group'=>'parent_name',
'massupdate' => false,
'reportable'=>false,
'required' => true,
),
'document_no' => array (
'name' => 'document_no',
'vname' => 'LBL_DOCUMENT_NO',
'type' => 'varchar',
'required_option' => true,
'unified_search' => true,
'required' => true,
'len' => '30'
),
'register_date' => array (
'name' => 'register_date',
'vname' => 'LBL_REGISTER_DATE',
'type' => 'date',
'reportable' => false,
'showFormats' => true,
'massupdate' => false,
'required' => true
),
'vats_summary' =>
array (
'name' => 'vats_summary',
'type' => 'varchar',
'len' => '200',
),
'total_netto' => array (
'name' => 'total_netto',
'vname' => 'LBL_SUBTOTAL',
'type' => 'decimal',
'len' => '15,2',
),
'total_brutto' => array (
'name' => 'total_brutto',
'vname' => 'LBL_TOTAL',
'type' => 'decimal',
'len' => '15,2',
),
'pdf_text' => array (
'name' => 'pdf_text',
'vname' => 'LBL_PDF_TEXT',
'type' => 'text'
),
'items_list_panel' => array (
'name' => 'items_list_panel',
'vname' => 'LBL_ITEMS',
'type' => 'text',
'source' => 'non-db'
),
'preview_panel' => array (
'name' => 'preview_panel',
'vname' => 'LBL_PREVIEW',
'type' => 'text',
'source' => 'non-db'
),
'stock_name' =>
array (
'name' => 'stock_name',
'vname' => 'LBL_STOCK_NAME',
'type' => 'relate',
'reportable' => false,
'source' => 'non-db',
'table' => 'ecmstocks',
'id_name' => 'stock_id',
'module' => 'EcmStocks',
'group'=>'stock_name',
'massupdate' => false,
'required' => false,
),
'stock_id' =>
array (
'name' => 'stock_id',
'type' => 'enum',
'module' => 'EcmStocks',
'table'=>'ecmstocks',
'vname' => 'LBL_STOCK_NAME',
'group'=>'stock_name',
'options'=>'ecmstocks_list_dom',
'required' => true,
'massupdate'=>false,
),
// FOR SUBPANELS
'notes' => array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'ecmstockdocins_notes',
'source' => 'non-db',
'vname' => 'LBL_NOTES'
),
'documents' => array (
'name' => 'documents',
'type' => 'link',
'relationship' => 'ecmstockdocin_documents',
'source' => 'non-db',
'vname' => 'LBL_NOTES'
),
),
// INDICES SECTION
'indices' => array (
array (
'name' => 'ecmstockdocins' . 'pk',
'type' => 'primary',
'fields' => array (
'id'
)
),
array (
'name' => 'idx_' . 'ecmstockdocins' . '_document_no',
'type' => 'index',
'fields' => array (
'document_no'
)
) ,
),
// RELATIONSHIPS SECTION
'relationships' => array (
'ecmstockdocins' . '_assigned_user' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmStockDocIns',
'rhs_table' => 'ecmstockdocins',
'rhs_key' => 'assigned_user_id',
'relationship_type' => 'one-to-many'
),
'ecmstockdocins' . '_modified_user' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmStockDocIns',
'rhs_table' => 'ecmstockdocins',
'rhs_key' => 'modified_user_id',
'relationship_type' => 'one-to-many'
),
'ecmstockdocins' . '_created_by' => array (
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'EcmStockDocIns',
'rhs_table' => 'ecmstockdocins',
'rhs_key' => 'created_by',
'relationship_type' => 'one-to-many'
),
'ecmstockdocins_notes' => array (
'lhs_module' => 'EcmStockDocIns',
'lhs_table' => 'ecmstockdocins',
'lhs_key' => 'id',
'rhs_module' => 'Notes',
'rhs_table' => 'notes',
'rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many',
'relationship_role_column' => 'parent_type',
'relationship_role_column_value' => 'EcmStockDocIns'
),
'ecmstockdocin_documents' => array (
'lhs_module' => 'EcmStockDocIns',
'lhs_table' => 'ecmstockdocins',
'lhs_key' => 'id',
'rhs_module' => 'Documents',
'rhs_table' => 'documents',
'rhs_key' => 'id',
'relationship_type' => 'many-to-many',
'join_table' => 'documents_accounts',
'join_key_lhs' => 'parent_id',
'join_key_rhs' => 'document_id',
),
),
// THIS FLAG ENABLES OPTIMISTIC LOCKING FOR SAVES FROM EDITVIEW
'optimistic_locking' => true
);