KS - liquidation
This commit is contained in:
@@ -49,6 +49,12 @@ $edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
|
||||
$edit->bean = $focus;
|
||||
$edit->tplFile = 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl';
|
||||
|
||||
if ($focus->type == '8a6b804b-fac7-5cc2-de19-54c209116b19') {
|
||||
$r = $db->fetchByAssoc($db->query("SELECT COUNT(id) FROM ecommerce_invoices WHERE ecmstockdoccorrect_id = '".$focus->id."'"));
|
||||
if ($r['COUNT(id)'] > 0) {
|
||||
$edit->ss->assign ( "IS_RETURN", true );
|
||||
}
|
||||
}
|
||||
$edit->preDisplay ();
|
||||
echo $edit->display ();
|
||||
|
||||
|
||||
@@ -39,6 +39,8 @@ if (isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] == "false") {
|
||||
$new_number = true;
|
||||
$focus->stock_id = 'cf16804e-f698-5e09-2da3-6553588446ae';
|
||||
$focus->register_date = date("d.m.Y");
|
||||
$focus->type = '8a6b804b-fac7-5cc2-de19-54c209116b19';
|
||||
$focus->name = 'Zwrot allegro';
|
||||
$db = $GLOBALS['db'];
|
||||
$invoiceIds = $_SESSION[$_REQUEST['ecommerceKS']];
|
||||
|
||||
@@ -124,9 +126,6 @@ if (isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] == "false") {
|
||||
$edit->ss->assign('ECOMMERCE_PRODUCTS', json_encode($finalProducts));
|
||||
$edit->ss->assign('ECOMMERCE_INVOICES', json_encode($invoiceIds));
|
||||
$focus->ecommerce_invoices = $invoiceIds;
|
||||
$focus->type = '8a6b804b-fac7-5cc2-de19-54c209116b19';
|
||||
$focus->stock_id = 'cf16804e-f698-5e09-2da3-6553588446ae';
|
||||
$focus->name = 'Zwrot allegro';
|
||||
|
||||
$query = "SELECT document_no FROM ecommerce_invoices WHERE id IN ('" . implode('\',\'', $invoiceIds) . "')";
|
||||
$res = $db->query($query);
|
||||
@@ -135,6 +134,22 @@ if (isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] == "false") {
|
||||
$documentNos[] = $row['document_no'];
|
||||
}
|
||||
$focus->pdf_text = "Dotyczy faktur: " . implode(', ', $documentNos);
|
||||
} else if (isset($_REQUEST['liquidation'])) {
|
||||
$new_number = true;
|
||||
$focus->stock_id = 'cf16804e-f698-5e09-2da3-6553588446ae';
|
||||
$focus->register_date = date("d.m.Y");
|
||||
$focus->type = '7bb903d0-c296-7d1b-6e50-54c209e30850';
|
||||
$focus->name = 'Likwidacja allegro';
|
||||
$db = $GLOBALS['db'];
|
||||
|
||||
$ks = new EcmStockDocCorrect();
|
||||
$ks->retrieve($_REQUEST['liquidation']);
|
||||
$products = $ks->getPositionList(true);
|
||||
foreach ($products as &$item) {
|
||||
$item['quantity'] = -$item['quantity'];
|
||||
}
|
||||
unset($item);
|
||||
$edit->ss->assign('ECOMMERCE_PRODUCTS', json_encode($products));
|
||||
} else {
|
||||
$new_number = true;
|
||||
//dates
|
||||
|
||||
@@ -69,124 +69,124 @@
|
||||
* *******************************************************************************/
|
||||
global $app_list_strings;
|
||||
|
||||
$viewdefs ['EcmStockDocCorrects'] ['DetailView'] = array (
|
||||
|
||||
'templateMeta' => array (
|
||||
|
||||
'form' => array (
|
||||
|
||||
'buttons' => array (
|
||||
'CANCEL_DOC',
|
||||
array (
|
||||
'customCode' => "{include_php file='include/ECM/EcmCreatePdfButton.php'}",
|
||||
),
|
||||
),
|
||||
'hidden' => array (
|
||||
'<input type="hidden" name="vats_summary" id="vats_summary" value=\'{$fields.vats_summary.value}\'>',
|
||||
'<input type="hidden" id="doc_total" value=\'{$fields.total.value}\'>',
|
||||
'<input type="hidden" id="operations_out" value=\'{$OP_OUT}\'>',
|
||||
'<input type="hidden" id="operations_in" value=\'{$OP_IN}\'>'
|
||||
)
|
||||
$viewdefs['EcmStockDocCorrects']['DetailView'] = array(
|
||||
|
||||
'templateMeta' => array(
|
||||
|
||||
'form' => array(
|
||||
|
||||
'buttons' => array(
|
||||
'CANCEL_DOC',
|
||||
array(
|
||||
'customCode' => "{include_php file='include/ECM/EcmCreatePdfButton.php'}",
|
||||
),
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array (
|
||||
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
|
||||
array (
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
array(
|
||||
'customCode' => '{if $IS_RETURN}<input type="button" class="button" name="liquidation" id="liquidation" value="Likwidacja" onclick="window.open(\'index.php?module=EcmStockDocCorrects&action=EditView&liquidation={$fields.id.value}\');">{/if}',
|
||||
),
|
||||
|
||||
'includes' => array (
|
||||
array (
|
||||
'file' => 'include/JSON.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/EcmStockDocCorrectsDetail.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/helper.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/bimit_table.js'
|
||||
),
|
||||
array (
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/columndefs-detail.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
'hidden' => array(
|
||||
'<input type="hidden" name="vats_summary" id="vats_summary" value=\'{$fields.vats_summary.value}\'>',
|
||||
'<input type="hidden" id="doc_total" value=\'{$fields.total.value}\'>',
|
||||
'<input type="hidden" id="operations_out" value=\'{$OP_OUT}\'>',
|
||||
'<input type="hidden" id="operations_in" value=\'{$OP_IN}\'>'
|
||||
)
|
||||
),
|
||||
|
||||
'panels' => array (
|
||||
|
||||
'LBL_DETAILS_TAB' => array (
|
||||
|
||||
array (
|
||||
'document_no',
|
||||
'assigned_user_name'
|
||||
),
|
||||
|
||||
array (
|
||||
'name',
|
||||
'stock_name'
|
||||
),
|
||||
|
||||
array (
|
||||
'register_date',
|
||||
'type'
|
||||
),
|
||||
array (
|
||||
'ecmproductstockindex_name',
|
||||
),
|
||||
array (
|
||||
'pdf_text'
|
||||
),
|
||||
array (
|
||||
array (
|
||||
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<br>'
|
||||
)
|
||||
),
|
||||
array (
|
||||
array (
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$MODIFIED_BY_NAME}'
|
||||
),
|
||||
array (
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$CREATED_BY_NAME}'
|
||||
),
|
||||
),
|
||||
|
||||
'maxColumns' => '2',
|
||||
|
||||
'widths' => array(
|
||||
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
),
|
||||
|
||||
array(
|
||||
'label' => '10',
|
||||
'field' => '30'
|
||||
)
|
||||
),
|
||||
|
||||
'includes' => array(
|
||||
array(
|
||||
'file' => 'include/JSON.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/EcmStockDocCorrectsDetail.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/helper.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/bimit_table.js'
|
||||
),
|
||||
array(
|
||||
'file' => 'modules/EcmStockDocCorrects/javascript/columndefs-detail.js'
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
'panels' => array(
|
||||
|
||||
'LBL_DETAILS_TAB' => array(
|
||||
|
||||
array(
|
||||
'document_no',
|
||||
'assigned_user_name'
|
||||
),
|
||||
|
||||
array(
|
||||
'name',
|
||||
'stock_name'
|
||||
),
|
||||
|
||||
array(
|
||||
'register_date',
|
||||
'type'
|
||||
),
|
||||
array(
|
||||
'ecmproductstockindex_name',
|
||||
),
|
||||
array(
|
||||
'pdf_text'
|
||||
),
|
||||
array(
|
||||
array(
|
||||
|
||||
'name' => 'to_informations',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<br>'
|
||||
)
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'name' => 'date_modified',
|
||||
'label' => 'LBL_DATE_MODIFIED',
|
||||
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$MODIFIED_BY_NAME}'
|
||||
),
|
||||
|
||||
'LBL_ITEMS_TAB' => array (
|
||||
|
||||
array (
|
||||
|
||||
array (
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<div id="itemsTable"></div>'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
array(
|
||||
'name' => 'date_entered',
|
||||
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$CREATED_BY_NAME}'
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
'LBL_ITEMS_TAB' => array(
|
||||
|
||||
array(
|
||||
|
||||
array(
|
||||
'name' => 'items_list_panel',
|
||||
'allCols' => true,
|
||||
|
||||
'hideLabel' => true,
|
||||
|
||||
'customCode' => '<div id="itemsTable"></div>'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user