91 lines
2.3 KiB
PHP
91 lines
2.3 KiB
PHP
<?php
|
|
error_reporting(E_PARSE | E_WARNING);
|
|
|
|
$json = getJSONobj();
|
|
$pll = array(); $i=0; while(isset($_POST['p_'.$i])) { $pll[] = $json->decode(htmlspecialchars_decode($_POST['p_'.$i])); $_POST['p_'.$i] = ''; $i++;}
|
|
$_POST = $json->decode(htmlspecialchars_decode($_POST['otherFormData']));
|
|
$_POST['position_list'] = $pll;
|
|
|
|
if(isset($_REQUEST['record']) && $_REQUEST['record'] != '' && $_REQUEST['cache'] != "fromJava") {
|
|
|
|
require_once("modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php");
|
|
|
|
$focus = new EcmPrepaymentInvoice();
|
|
|
|
$method = (isset($_REQUEST['method']) && $_REQUEST['method'] != '') ? $_REQUEST['method'] : 'D';
|
|
|
|
$focus->getPDF($_REQUEST['record'],$method);
|
|
|
|
} else
|
|
|
|
if($_REQUEST['cache'] == "fromJava" && $_GET['from']!="EcmPrepaymentInvoices") {
|
|
|
|
$_SESSION['PDF_ECMINVOICEOUTS'] = $_POST;
|
|
|
|
} else
|
|
|
|
if($_GET['from']=="EcmPrepaymentInvoices") {
|
|
|
|
|
|
|
|
require_once("modules/EcmPrepaymentInvoices/EcmPrepaymentInvoice.php");
|
|
|
|
$focus = new EcmPrepaymentInvoice();
|
|
|
|
if(isset($_SESSION['PDF_ECMINVOICEOUTS']['record']) && $_SESSION['PDF_ECMINVOICEOUTS']['record'] != '') {
|
|
|
|
$focus->retrieve($_SESSION['PDF_ECMINVOICEOUTS']['record']);
|
|
|
|
}
|
|
|
|
if(!$focus->ACLAccess('Save')){
|
|
|
|
ACLController::displayNoAccess(true);
|
|
|
|
sugar_cleanup(true);
|
|
|
|
}
|
|
|
|
foreach($focus->column_fields as $field){
|
|
|
|
if(isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])){
|
|
|
|
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
|
|
|
|
$focus->$field = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
foreach($focus->additional_column_fields as $field){
|
|
|
|
if(isset($_SESSION['PDF_ECMINVOICEOUTS'][$field])){
|
|
|
|
$value = $_SESSION['PDF_ECMINVOICEOUTS'][$field];
|
|
|
|
$focus->$field = $value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(isset($_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) && $_SESSION['PDF_ECMINVOICEOUTS']['to_is_vat_free']) $focus->to_is_vat_free = 1; else $focus->to_is_vat_free = 0;
|
|
|
|
$json = getJSONobj();
|
|
|
|
$pl = $_SESSION['PDF_ECMINVOICEOUTS']['position_list'];
|
|
|
|
$focus->position_list = $pl;
|
|
|
|
$focus->document_no = $_SESSION['PDF_ECMINVOICEOUTS']['document_no'];
|
|
|
|
$focus->wz_id=$_SESSION['PDF_ECMINVOICEOUTS']['out_id'];
|
|
|
|
//$focus->ecmpaymentcondition_text = EcmPrepaymentInvoice::getTranslation('EcmPaymentConditions',$focus->ecmpaymentcondition_id,$focus->ecmlanguage);
|
|
//die();
|
|
$focus->getPDF();
|
|
|
|
}
|
|
|
|
?>
|