<?php
  
  if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
  
  require_once('modules/EcmStockDocIns/EcmStockDocIn.php');
  $source = new EcmStockDocIn();
  $source->retrieve($outId);
  if(isset($source->id) && $source->id != '') {
  
    $focus->name = $source->name;
    $focus->position_list = str_replace('&quot;','\"',$source->getPositionList());
    $focus->template_id = $source->template_id;
    $focus->template_name = $source->template_name;
    $focus->total = $source->total;
    $focus->subtotal = $source->subtotal;
    
    $focus->parent_type = $source->parent_type;
    $focus->parent_id = $source->parent_id;
    $focus->parent_name = $source->parent_name;
	$focus->contact_id = $source->contact_id;
	$focus->contact_name = $source->contact_name;
    
	$focus->type = 'normal';
    $focus->parent_address_street = $source->parent_address_street;
    $focus->parent_address_postalcode = $source->parent_address_postalcode;
    $focus->parent_address_city = $source->parent_address_city;
    $focus->parent_address_country = $source->parent_address_country;
    $focus->to_nip = $source->to_nip;
    $focus->to_vatid = $source->to_vatid;
    $focus->to_is_vat_free = $source->to_is_vat_free;
	$focus->ecmlanguage = $source->ecmlanguage;

	$focus->ecmpaymentcondition_id = $source->ecmpaymentcondition_id;
	$focus->ecmpaymentcondition_name = $source->ecmpaymentcondition_name;
	$focus->ecmpaymentcondition_text = $source->ecmpaymentcondition_text;

		
    $focus->header_text = str_replace('$quote_','$invoiceout_',$source->header_text);
    $focus->footer_text = str_replace('$quote_','$invoiceout_',$source->footer_text);
    $focus->ads_text = str_replace('$quote_','$invoiceout_',$source->ads_text);
    
    
  }
  
?>