Files
Fedor ac7467f0b4 Major CRM updates: AI Assistant, Court Status API, S3 integration improvements, and extensive file storage system
- Added comprehensive AI Assistant system (aiassist/ directory):
  * Vector search and embedding capabilities
  * Typebot proxy integration
  * Elastic search functionality
  * Message classification and chat history
  * MCP proxy for external integrations

- Implemented Court Status API (GetCourtStatus.php):
  * Real-time court document status checking
  * Integration with external court systems
  * Comprehensive error handling and logging

- Enhanced S3 integration:
  * Improved file backup system with metadata
  * Batch processing capabilities
  * Enhanced error logging and recovery
  * Copy operations with URL fixing

- Added Telegram contact creation API
- Improved error logging across all modules
- Enhanced callback system for AI responses
- Extensive backup file storage with timestamps
- Updated documentation and README files

- File storage improvements:
  * Thousands of backup files with proper metadata
  * Fix operations for broken file references
  * Project-specific backup and recovery systems
  * Comprehensive file integrity checking

Total: 26,461+ files added/modified including AWS SDK, vendor dependencies, and extensive backup system.
2025-10-16 11:17:21 +03:00

78 lines
2.5 KiB
PHP

<?php
/**
* Created by Stefan Warnat
* User: Stefan
* Date: 28.09.2016
* Time: 18:59
*/
namespace Workflow\Plugin\InventoryLoader;
use Workflow\InventoryLoader;
use Workflow\VTEntity;
class MergeItems implements \Workflow\Interfaces\IInventoryLoader {
public function getAvailableLoader()
{
return array(
'loaderkey' => array( // LOADERKEY
'label' => 'Merge items of other Inventory Records', // LOADERLABEL
'config' => array( // LOADERCONFIG
'recordids' => array(
'type' => 'template',
'label' => 'Record IDs to merge:',
'description' => 'List all Record IDs you want to merge. Separated by comma.<br/>It does not matter if they are within different modules.'
)
)
),
);
}
public function getItems($config, VTEntity $context)
{
$recordIds = $config['recordids'];
if(empty($recordIds)) return array();
$recordIds = \Workflow\VTTemplate::parse($recordIds, $context);
$split = explode(',', $recordIds);
$products = array();
$availableTaxes = getAllTaxes();
foreach($split as $id) {
$context = VTEntity::getForId($id);
$productExport = $context->exportInventory();
$listItems = $productExport['listitems'];
foreach($listItems as $item) {
$productContext = VTEntity::getForId($item['productid']);
$tmp = array(
'module' => $productContext->getModuleName(),
'productlabel' => $productContext->getCRMRecordLabel(),
'productid' => $item['productid'],
'comment' => $item['comment'],
'quantity' => $item['quantity'],
'listprice' => $item['unitprice'],
'discount_amount' => $item['discount_amount'],
'discount_percent' => $item['discount_percent'],
'taxes' => array()
);
foreach($availableTaxes as $tax) {
if(!empty($item[$tax['taxname']])) {
$tmp['taxes'][$tax['taxid']] = $item[$tax['taxname']];
}
}
$products[] = $tmp;
}
}
return $products;
}
}
InventoryLoader::register(__NAMESPACE__.'\\MergeItems');