update
This commit is contained in:
@@ -7,8 +7,11 @@
|
|||||||
$response = array (
|
$response = array (
|
||||||
'document_no' => $inv->document_no,
|
'document_no' => $inv->document_no,
|
||||||
'register_date' => $inv->register_date,
|
'register_date' => $inv->register_date,
|
||||||
|
'payment_date' => $inv->payment_date,
|
||||||
'total_netto' => $inv->total_netto,
|
'total_netto' => $inv->total_netto,
|
||||||
'total_brutto' => $inv->total_brutto,
|
'total_brutto' => $inv->total_brutto,
|
||||||
|
'currency_id' => $inv->currency_id,
|
||||||
|
'currency_value' => $inv->currency_value,
|
||||||
'vats_summary' => $inv->vats_summary,
|
'vats_summary' => $inv->vats_summary,
|
||||||
'position_list' => $pl
|
'position_list' => $pl
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -25,5 +25,52 @@ switch ($_GET["action"]) {
|
|||||||
case 'copySaleFromTwinpol':
|
case 'copySaleFromTwinpol':
|
||||||
copySaleFromTwinpol($_GET['record']);
|
copySaleFromTwinpol($_GET['record']);
|
||||||
break;
|
break;
|
||||||
|
case 'export.products.list':
|
||||||
|
if ($_GET['since'] == null) {
|
||||||
|
echo 'No since date';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$products = [];
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
$sixMonthsAgo = (new DateTime())->modify('-6 months')->format('Y-m-d H:i:s');
|
||||||
|
$sinceDate = date('Y-m-d H:i:s', intval($_GET['since']));;
|
||||||
|
$query = "
|
||||||
|
SELECT
|
||||||
|
p.id,
|
||||||
|
p.name,
|
||||||
|
p.code,
|
||||||
|
p.ean,
|
||||||
|
GROUP_CONCAT(s.stock_address SEPARATOR ', ') AS stock_addresses
|
||||||
|
FROM ecmproducts p
|
||||||
|
LEFT JOIN ecmproducts_stock_addresses s ON p.id = s.ecmproduct_id
|
||||||
|
WHERE p.active = 1
|
||||||
|
AND p.deleted = 0
|
||||||
|
AND p.date_modified > '$sixMonthsAgo'
|
||||||
|
AND (p.exportedAt IS NULL OR p.exportedAt > '$sinceDate')
|
||||||
|
GROUP BY p.id, p.name, p.code
|
||||||
|
";
|
||||||
|
$r = $db->query($query);
|
||||||
|
while ($row = $db->fetchByAssoc($r)) {
|
||||||
|
$p = [];
|
||||||
|
$p['id'] = $row['id'];
|
||||||
|
$p['ean'] = $row['ean'];
|
||||||
|
$p['name'] = $row['name'];
|
||||||
|
$p['code'] = $row['code'];
|
||||||
|
$p['stock_addresses'] = $row['stock_addresses'];
|
||||||
|
array_push($products, $p);
|
||||||
|
}
|
||||||
|
echo json_encode($products);
|
||||||
|
break;
|
||||||
|
case 'export.products.setExportedAt':
|
||||||
|
{
|
||||||
|
if ($_GET['exportedAt'] == null || $_GET['id'] == null) {
|
||||||
|
echo 'Wrong parameters';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
$exportedAt = date('Y-m-d H:i:s', intval($_GET['exportedAt']));;
|
||||||
|
$id = $_GET['id'];
|
||||||
|
$db->query("UPDATE ecmproducts SET exportedAt='$exportedAt' WHERE id='$id'");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
@@ -5,6 +5,7 @@ $sugar_config['http_referer']['weak'] = true;
|
|||||||
$sugar_config['http_referer']['list'][] = 'crm.twinpool.com';
|
$sugar_config['http_referer']['list'][] = 'crm.twinpool.com';
|
||||||
$sugar_config['http_referer']['list'][] = 'www.google.com';
|
$sugar_config['http_referer']['list'][] = 'www.google.com';
|
||||||
$sugar_config['http_referer']['list'][] = 'crm.e5.pl';
|
$sugar_config['http_referer']['list'][] = 'crm.e5.pl';
|
||||||
|
$sugar_config['http_referer']['list'][] = 'accounts.google.com';
|
||||||
$sugar_config['default_currency_iso4217'] = 'PLN';
|
$sugar_config['default_currency_iso4217'] = 'PLN';
|
||||||
$sugar_config['default_currency_name'] = 'PLN';
|
$sugar_config['default_currency_name'] = 'PLN';
|
||||||
$sugar_config['default_currency_symbol'] = 'zł';
|
$sugar_config['default_currency_symbol'] = 'zł';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// created: 2025-04-29 21:26:15
|
// created: 2025-07-06 08:19:35
|
||||||
$customDoms = array (
|
$customDoms = array (
|
||||||
'ecmproducts_attribute_dom' =>
|
'ecmproducts_attribute_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -77,6 +77,9 @@ $customDoms = array (
|
|||||||
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Bottle B1_30ml',
|
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Bottle B1_30ml',
|
||||||
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
||||||
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'LCD Liquid',
|
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'LCD Liquid',
|
||||||
|
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Cellophane Bag',
|
||||||
|
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tablet',
|
||||||
|
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'Blister tablets 6pcs 6,5g',
|
||||||
),
|
),
|
||||||
'ecmproducts_brand_dom' =>
|
'ecmproducts_brand_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -166,6 +169,10 @@ $customDoms = array (
|
|||||||
'1f9d4c5d-670e-4c77-d4de-67cddc908559' => 'DeCal',
|
'1f9d4c5d-670e-4c77-d4de-67cddc908559' => 'DeCal',
|
||||||
'5c883b90-f1fb-83d1-6347-67dbd49469f0' => 'EntertainME',
|
'5c883b90-f1fb-83d1-6347-67dbd49469f0' => 'EntertainME',
|
||||||
'b1df2c57-aef2-290f-c207-67f7916afed9' => 'Mistify',
|
'b1df2c57-aef2-290f-c207-67f7916afed9' => 'Mistify',
|
||||||
|
'aa4a31f5-fd7b-7abb-546b-6822e453b107' => 'Mrs.Shiny',
|
||||||
|
'19b9cd31-f4d2-fd74-3cd4-6826d53b5245' => 'GAYA',
|
||||||
|
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
||||||
|
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
||||||
),
|
),
|
||||||
'ecmproducts_category_dom' =>
|
'ecmproducts_category_dom' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// created: 2025-04-29 21:26:15
|
// created: 2025-07-06 08:19:35
|
||||||
$customDoms = array (
|
$customDoms = array (
|
||||||
'ecmproducts_attribute_dom' =>
|
'ecmproducts_attribute_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -77,6 +77,9 @@ $customDoms = array (
|
|||||||
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Butelka B1_30ml',
|
'e3e0c9da-6d08-e1e0-b9ba-67eaa437cb84' => 'Butelka B1_30ml',
|
||||||
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
'8bcf43bf-7b49-5dbf-6b86-67f6c12b82d7' => 'Softpack',
|
||||||
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'Płyn LCD',
|
'd40c7d30-77bd-1f65-be9c-681142c7daf5' => 'Płyn LCD',
|
||||||
|
'1b7d6313-d7d4-4529-73d4-684a6d5ddde3' => 'Woreczek celofanowy',
|
||||||
|
'47fbe61c-20f4-5d48-118c-6851105ddc97' => 'Tabletka',
|
||||||
|
'c1477582-33b9-529d-bdd2-685250fc18d4' => 'Blister, tabletki 6szt. 6,5g',
|
||||||
),
|
),
|
||||||
'ecmproducts_brand_dom' =>
|
'ecmproducts_brand_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -166,6 +169,10 @@ $customDoms = array (
|
|||||||
'1f9d4c5d-670e-4c77-d4de-67cddc908559' => 'DeCal',
|
'1f9d4c5d-670e-4c77-d4de-67cddc908559' => 'DeCal',
|
||||||
'5c883b90-f1fb-83d1-6347-67dbd49469f0' => 'EntertainME',
|
'5c883b90-f1fb-83d1-6347-67dbd49469f0' => 'EntertainME',
|
||||||
'b1df2c57-aef2-290f-c207-67f7916afed9' => 'Mistify',
|
'b1df2c57-aef2-290f-c207-67f7916afed9' => 'Mistify',
|
||||||
|
'aa4a31f5-fd7b-7abb-546b-6822e453b107' => 'Mrs.Shiny',
|
||||||
|
'19b9cd31-f4d2-fd74-3cd4-6826d53b5245' => 'GAYA',
|
||||||
|
'11095313-0dd0-aa9b-df3a-682739877d33' => 'Coffix',
|
||||||
|
'd97b870b-86a1-1970-9cea-68527ecc5ad9' => 'Zenevo',
|
||||||
),
|
),
|
||||||
'ecmproducts_category_dom' =>
|
'ecmproducts_category_dom' =>
|
||||||
array (
|
array (
|
||||||
@@ -217,10 +224,10 @@ $customDoms = array (
|
|||||||
),
|
),
|
||||||
'ecmactions_category_dom' =>
|
'ecmactions_category_dom' =>
|
||||||
array (
|
array (
|
||||||
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'Nal. zakr. etyk.',
|
'dd4ddbad-c949-0ee5-fb73-54cb9b6c86ef' => 'NZE',
|
||||||
'f87b0591-14fd-b35f-1da5-54d1d584fd25' => 'Nal. zakr.',
|
'f87b0591-14fd-b35f-1da5-54d1d584fd25' => 'NZ',
|
||||||
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'Składanie zestawów',
|
'8519dfc8-5eec-0233-7f84-54d1fe00e9fc' => 'Zestawy',
|
||||||
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'Mieszanie płynów',
|
'55020d96-73d5-7b29-3bab-654f4818e0cd' => 'Mieszanie',
|
||||||
),
|
),
|
||||||
'payment_method_dom' =>
|
'payment_method_dom' =>
|
||||||
array (
|
array (
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
//die("Przerwa techniczna");
|
|
||||||
|
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
|
|
||||||
if(!defined('sugarEntry'))define('sugarEntry', true);
|
if(!defined('sugarEntry'))define('sugarEntry', true);
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ class EcmInvoiceOut extends SugarBean {
|
|||||||
var $total_netto;
|
var $total_netto;
|
||||||
var $total_brutto;
|
var $total_brutto;
|
||||||
var $vats_summary;
|
var $vats_summary;
|
||||||
|
var $payment_date;
|
||||||
|
var $currency_value;
|
||||||
// RELATED FIELDS
|
// RELATED FIELDS
|
||||||
var $created_by;
|
var $created_by;
|
||||||
var $created_by_name;
|
var $created_by_name;
|
||||||
|
|||||||
@@ -107,10 +107,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
|||||||
$focus->retrieve($_POST['record']);
|
$focus->retrieve($_POST['record']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$focus->ACLAccess('Save')){
|
|
||||||
ACLController::displayNoAccess(true);
|
|
||||||
sugar_cleanup(true);
|
|
||||||
}
|
|
||||||
$check_notify = FALSE;
|
$check_notify = FALSE;
|
||||||
|
|
||||||
foreach ($focus->column_fields as $field) {
|
foreach ($focus->column_fields as $field) {
|
||||||
@@ -133,7 +130,18 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
|||||||
|
|
||||||
$return_id = $focus->id;
|
$return_id = $focus->id;
|
||||||
|
|
||||||
|
// create document in twinpol crm
|
||||||
|
if ($focus->parent_id == '1b9643ca-5b1a-8f9b-b809-586b5619b068') {
|
||||||
|
$curl = curl_init();
|
||||||
|
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'GET');
|
||||||
|
curl_setopt($curl, CURLOPT_VERBOSE, 1);
|
||||||
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
curl_setopt($curl, CURLOPT_URL, "https://crm.twinpol.com/REST/index.php?key=d68dac4c-f784-4e1b-8267-9ffcfa0eda4c&action=createCostDocumentFromInvoice&record=" . $return_id);
|
||||||
|
$res = curl_exec($curl);
|
||||||
|
}
|
||||||
|
|
||||||
echo $return_id;
|
echo $return_id;
|
||||||
|
|
||||||
handleRedirect($return_id, 'EcmInvoiceOuts');
|
handleRedirect($return_id, 'EcmInvoiceOuts');
|
||||||
?>
|
|
||||||
@@ -222,7 +222,7 @@ class invoiceEdiXML
|
|||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
$i = $this->i;
|
$i = $this->i;
|
||||||
$oldInvoice = $db->fetchByAssoc($db->query("
|
$oldInvoice = $db->fetchByAssoc($db->query("
|
||||||
SELECT total_netto, total_brutto, total_vat, vats_summary, document_no, register_date
|
SELECT total_netto, total_brutto, total_vat, vats_summary, document_no, register_date, order_no
|
||||||
FROM ecminvoiceouts WHERE id='".$i->ecminvoiceout_id."'"));
|
FROM ecminvoiceouts WHERE id='".$i->ecminvoiceout_id."'"));
|
||||||
$xml = new XMLWriter();
|
$xml = new XMLWriter();
|
||||||
$name = str_replace('/', '_', $i->document_no);
|
$name = str_replace('/', '_', $i->document_no);
|
||||||
@@ -232,12 +232,10 @@ class invoiceEdiXML
|
|||||||
$xml->startDocument('1.0', 'UTF-8');
|
$xml->startDocument('1.0', 'UTF-8');
|
||||||
$xml->startElement('Document-Invoice');
|
$xml->startElement('Document-Invoice');
|
||||||
$xml->startElement('Invoice-Header');
|
$xml->startElement('Invoice-Header');
|
||||||
// FIX $xml->writeElement('InvoiceNumber', $i->document_no);
|
$xml->writeElement('InvoiceNumber', $i->document_no.'-TEST');
|
||||||
$xml->writeElement('InvoiceNumber', 'FVKOR 04/TEST/23');
|
$xml->writeElement('InvoiceDate', $timedate->to_db_date($i->register_date));
|
||||||
// FIX $xml->writeElement('InvoiceDate',
|
|
||||||
// $timedate->to_db_date($i->register_date));
|
|
||||||
$xml->writeElement('InvoiceDate', '2023-08-01');
|
$xml->writeElement('InvoiceDate', '2023-08-01');
|
||||||
// FIX $xml->writeElement('SalesDate', $timedate->to_db_date($i->sell_date));
|
$xml->writeElement('SalesDate', $timedate->to_db_date($i->sell_date));
|
||||||
$xml->writeElement('SalesDate', '2023-08-01');
|
$xml->writeElement('SalesDate', '2023-08-01');
|
||||||
$c = new Currency();
|
$c = new Currency();
|
||||||
$c->retrieve($i->currency_id);
|
$c->retrieve($i->currency_id);
|
||||||
@@ -254,9 +252,8 @@ class invoiceEdiXML
|
|||||||
$xml->writeElement('DocumentFunctionCode', 'C');
|
$xml->writeElement('DocumentFunctionCode', 'C');
|
||||||
$xml->writeElement('CorrectionReason', 'zgł. rekl.030/19/P320');
|
$xml->writeElement('CorrectionReason', 'zgł. rekl.030/19/P320');
|
||||||
$xml->startElement('Order');
|
$xml->startElement('Order');
|
||||||
$xml->writeElement('BuyerOrderNumber', end(explode(' ', $i->order_no)));
|
$xml->writeElement('BuyerOrderNumber', $oldInvoice['order_no']);
|
||||||
// FIX $xml->writeElement('BuyerOrderDate', $timedate->to_db_date($i->register_date));
|
$xml->writeElement('BuyerOrderDate', $timedate->to_db_date($i->register_date));
|
||||||
$xml->writeElement('BuyerOrderDate', '2023-08-01');
|
|
||||||
$xml->endElement(); // </Line-Order>
|
$xml->endElement(); // </Line-Order>
|
||||||
$xml->startElement('Reference');
|
$xml->startElement('Reference');
|
||||||
$xml->writeElement('InvoiceReferenceNumber', $oldInvoice['document_no']);
|
$xml->writeElement('InvoiceReferenceNumber', $oldInvoice['document_no']);
|
||||||
@@ -334,23 +331,16 @@ class invoiceEdiXML
|
|||||||
);
|
);
|
||||||
foreach ($e5_info as $val) {
|
foreach ($e5_info as $val) {
|
||||||
$xml->startElement($val);
|
$xml->startElement($val);
|
||||||
// FIX $xml->writeElement('ILN', '5909000035836');
|
$xml->writeElement('ILN', '5909000035836');
|
||||||
$xml->writeElement('ILN', '5909000896239');
|
|
||||||
if ($val != 'SellerHeadquarters')
|
if ($val != 'SellerHeadquarters')
|
||||||
// FIX $xml->writeElement('TaxID', '5252173990');
|
$xml->writeElement('TaxID', '5252173990');
|
||||||
$xml->writeElement('TaxID', '8792676609');
|
$xml->writeElement('Name', 'e5 Polska Sp. z o.o.');
|
||||||
// FIX $xml->writeElement('Name', 'e5 Polska Sp. z o.o.');
|
$xml->writeElement('StreetAndNumber', 'Wąwozowa 11');
|
||||||
$xml->writeElement('Name', 'Twinpol Sp. z o.o.');
|
$xml->writeElement('CityName', 'Warszawa');
|
||||||
// FIX $xml->writeElement('StreetAndNumber', 'Wąwozowa 11');
|
$xml->writeElement('PostalCode', '02-796');
|
||||||
$xml->writeElement('StreetAndNumber', 'Al. Lipowa 48');
|
|
||||||
// FIX $xml->writeElement('CityName', 'Warszawa');
|
|
||||||
$xml->writeElement('CityName', 'Obrowo');
|
|
||||||
// FIX $xml->writeElement('PostalCode', '02-796');
|
|
||||||
$xml->writeElement('PostalCode', '87-126');
|
|
||||||
$xml->writeElement('Country', 'PL');
|
$xml->writeElement('Country', 'PL');
|
||||||
if ($val == 'Seller')
|
if ($val == 'Seller')
|
||||||
// FIX $xml->writeElement('CodeByBuyer', '23862');
|
$xml->writeElement('CodeByBuyer', '23862');
|
||||||
$xml->writeElement('CodeByBuyer', '017776');
|
|
||||||
$xml->endElement();
|
$xml->endElement();
|
||||||
}
|
}
|
||||||
$xml->endElement(); // </Invoice-Parties>
|
$xml->endElement(); // </Invoice-Parties>
|
||||||
|
|||||||
@@ -628,7 +628,7 @@ class EcmProduct extends SugarBean
|
|||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
$res = $db->query("
|
$res = $db->query("
|
||||||
SELECT p.code, pc.quantity
|
SELECT p.code, pc.quantity, p.id
|
||||||
FROM ecmproductcomponents AS pc
|
FROM ecmproductcomponents AS pc
|
||||||
INNER JOIN ecmproducts AS p
|
INNER JOIN ecmproducts AS p
|
||||||
ON p.id = pc.ecmproduct_id
|
ON p.id = pc.ecmproduct_id
|
||||||
@@ -639,6 +639,7 @@ WHERE ecmcomponent_id='$this->id';
|
|||||||
$products[] = array(
|
$products[] = array(
|
||||||
'code' => $row['code'],
|
'code' => $row['code'],
|
||||||
'quantity' => $row['quantity'],
|
'quantity' => $row['quantity'],
|
||||||
|
'id' => $row['id'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return $products;
|
return $products;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*jshint esversion: 6 */
|
var SelectedTab = "";
|
||||||
|
var TabsMainBlock = false;
|
||||||
|
var Components;
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$.tablesorter.addParser({
|
$.tablesorter.addParser({
|
||||||
id: "production_date",
|
id: "production_date",
|
||||||
@@ -85,14 +86,134 @@ $(document).ready(function () {
|
|||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
}, 500);
|
}, 500);
|
||||||
|
$("#selectAll").click(function () {
|
||||||
|
if (this.checked) {
|
||||||
|
$(".allCheck").prop("checked", true);
|
||||||
|
} else {
|
||||||
|
$(".allCheck").prop("checked", false);
|
||||||
|
}
|
||||||
|
});
|
||||||
$("#duplicateBtn").click(() => duplicatePositions());
|
$("#duplicateBtn").click(() => duplicatePositions());
|
||||||
$("#deleteBtn").click(() => { removePositions(); });
|
$("#deleteBtn").click(() => { removePositions(); });
|
||||||
$("#excelBtn").click(() => { exportExcel(); });
|
$("#excelBtn").click(() => { exportExcel(); });
|
||||||
$("#pdfBtn").click(() => { window.alert("In progress."); });
|
$("#pdfBtn").click(() => { window.alert("In progress."); });
|
||||||
$("#productionBtn").click(() => { window.alert("In progress."); });
|
$("#productionBtn").click(() => { window.alert("In progress."); });
|
||||||
$("#createInsideOrder").click(createInsideOrder);
|
$("#createInsideOrder").click(createInsideOrder);
|
||||||
|
|
||||||
|
});
|
||||||
|
function SetTab(tab_name) {
|
||||||
|
if (TabsMainBlock) { return; }
|
||||||
|
var TabMenu = document.getElementById("groupTabsPanels");
|
||||||
|
var tabs = TabMenu.getElementsByTagName("li");
|
||||||
|
for (var i = 0; i < tabs.length; i++) {
|
||||||
|
if ((tab_name + "_menu") === tabs[i].id) {
|
||||||
|
tabs[i].className = "active";
|
||||||
|
tabs[i].getElementsByTagName("a")[0].className = "current";
|
||||||
|
} else {
|
||||||
|
tabs[i].className = "";
|
||||||
|
tabs[i].getElementsByTagName("a")[0].className = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var prev = document.getElementById(SelectedTab);
|
||||||
|
var curr = document.getElementById(tab_name);
|
||||||
|
prev.style.display = "none";
|
||||||
|
curr.style.display = "";
|
||||||
|
SelectedTab = tab_name;
|
||||||
|
if (SelectedTab === "3") {
|
||||||
|
|
||||||
|
}
|
||||||
|
if (SelectedTab === "2") {
|
||||||
|
getRawMaterials();
|
||||||
|
}
|
||||||
|
if (SelectedTab === "1") {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function getRawMaterials() {
|
||||||
|
var ids = [];
|
||||||
|
$("input.allCheck:checkbox:checked").each(function () {
|
||||||
|
// check if this element is visible on site
|
||||||
|
if ($(this).parent().parent().css("display") === "table-row") {
|
||||||
|
ids.push($(this).val());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (ids.length === 0) {
|
||||||
|
window.alert("Wybierz pozycje zamówień");
|
||||||
|
SetTab("1");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
showLoader();
|
||||||
|
var url = $(location).attr("href") + "&to_pdf=1&ajaxAction=getRawMaterials";
|
||||||
|
$.ajax({
|
||||||
|
method: "post",
|
||||||
|
url: url,
|
||||||
|
data: {
|
||||||
|
ids
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var result = JSON.parse(data);
|
||||||
|
Components = result;
|
||||||
|
drawRawMaterials(result);
|
||||||
|
//drawComponents(result);
|
||||||
|
//updateComponentsPositions();
|
||||||
|
hideLoader();
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
window.alert("Błąd ładowania surowców");
|
||||||
|
hideLoader();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function drawRawMaterials(data) {
|
||||||
|
$("#rawMaterialsTableContainer").html(rawMaterialsTablePrototype());
|
||||||
|
data.forEach((el, index) => {
|
||||||
|
var tr = $("<tr></tr>");
|
||||||
|
tr.append("<td><input type=\"checkbox\" value=" + el.id + " class=\"rawMaterialCheck\" /></td>");
|
||||||
|
tr.append("<td>" + (index + 1) + "</td>");
|
||||||
|
tr.append("<td><a target=\"_blank\" href=\"index.php?module=EcmProducts&action=DetailView&record=" + el.id + "\">" + el.code + "</a></td>");
|
||||||
|
tr.append("<td title=\""+ el.fullName +"\">" + el.name + "</td>");
|
||||||
|
tr.append("<td id=\"qty-" + el.id + "\">" + el.quantity + "</td>");
|
||||||
|
tr.append("<td>" + el.unit + "</td>");
|
||||||
|
tr.append("<td id=\"state-" + el.id + "\">" + el.stockState + "</td>");
|
||||||
|
tr.append("<td id=\"ordered-" + el.id + "\">" + el.stockAddress + "</td>");
|
||||||
|
$("#rawMaterialsTable > tbody").append(tr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#rawMaterialsTable").tablesorter({
|
||||||
|
theme: "blue",
|
||||||
|
widthFixed: true,
|
||||||
|
widgets: ["filter", "stickyHeaders"],
|
||||||
|
sortList: [[2, 0]],
|
||||||
|
});
|
||||||
|
$("#rawMaterialsTable").bind("filterEnd", function (event, config) {
|
||||||
|
updateRawMaterialsPositions();
|
||||||
|
});
|
||||||
|
$("#rawMaterialsTable").bind("sortEnd", function (event, config) {
|
||||||
|
updateRawMaterialsPositions();
|
||||||
|
$("#rawMaterialsTable tfoot").find("td").each(function () {
|
||||||
|
$(this).css("background-color", "white");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
$("#selectAllRawMaterials").attr('checked', false);
|
||||||
|
$("#selectAllRawMaterials").click(function () {
|
||||||
|
if (this.checked) {
|
||||||
|
$(".rawMaterialCheck").prop('checked', true);
|
||||||
|
} else {
|
||||||
|
$(".rawMaterialCheck").prop('checked', false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function rawMaterialsTablePrototype() {
|
||||||
|
return '<table id="rawMaterialsTable"><thead><tr><th class="filter-false"><input type="checkbox" id="selectAllRawMaterials" /></th><th>Pozycja</th><th>Indeks</th><th>Nazwa</th><th>Ilość</th><th>JM.</th><th>Stan</th><th>Adres magazynowy</th></tr></thead><tbody aria-live="polite" aria-relevant="all"></tbody></table>';
|
||||||
|
}
|
||||||
|
function updateRawMaterialsPositions() {
|
||||||
|
var i = 0;
|
||||||
|
$("#rawMaterialsTable").find("tr").each(function (index) {
|
||||||
|
if (index >= 2 && $(this).css('display') === 'table-row' && $(this).find("td").length > 3) {
|
||||||
|
i++;
|
||||||
|
$($(this).find("td")[1]).html(i);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
function editQty(id) {
|
function editQty(id) {
|
||||||
$("#edit-" + id).css("display", "none");
|
$("#edit-" + id).css("display", "none");
|
||||||
$("#qty-" + id).css("display", "none");
|
$("#qty-" + id).css("display", "none");
|
||||||
@@ -212,7 +333,6 @@ function exportExcel() {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function createInsideOrder() {
|
function createInsideOrder() {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$('input.allCheck:checkbox:checked').each(function () {
|
$('input.allCheck:checkbox:checked').each(function () {
|
||||||
|
|||||||
@@ -103,16 +103,88 @@ if (!isset($_GET['ajaxAction'])) {
|
|||||||
case 'exportExcel':
|
case 'exportExcel':
|
||||||
exportExcel();
|
exportExcel();
|
||||||
break;
|
break;
|
||||||
|
case 'getRawMaterials':
|
||||||
|
getRawMaterials($_POST['ids']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function getRawMaterials($ids) {
|
||||||
|
$response = array();
|
||||||
|
$idsString = join("','", $ids);
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
$res = $db->query("SELECT ecmproduct_id, SUM(quantity) AS quantity FROM productionScheduler WHERE id IN ('$idsString') GROUP BY ecmproduct_id");
|
||||||
|
$rawMaterials = array();
|
||||||
|
while ($p = $db->fetchByAssoc($res)) {
|
||||||
|
$rawMaterials = array_merge($rawMaterials, getProductRawMaterials($p['ecmproduct_id'], $p['quantity']));
|
||||||
|
}
|
||||||
|
|
||||||
|
$groupedRawMaterials = [];
|
||||||
|
foreach ($rawMaterials as $item) {
|
||||||
|
$productId = $item['ecmproduct_id'];
|
||||||
|
if (!isset($groupedRawMaterials[$productId])) {
|
||||||
|
$groupedRawMaterials[$productId] = 0;
|
||||||
|
}
|
||||||
|
$groupedRawMaterials[$productId] += $item['quantity'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$rawMaterials = [];
|
||||||
|
foreach ($groupedRawMaterials as $productId => $quantity) {
|
||||||
|
$rawMaterials[] = ['ecmproduct_id' => $productId, 'quantity' => $quantity];
|
||||||
|
}
|
||||||
|
|
||||||
|
global $app_list_strings;
|
||||||
|
foreach ($rawMaterials as $raw) {
|
||||||
|
$product = $db->fetchByAssoc($db->query("
|
||||||
|
SELECT p.id, p.code, p.name, p.group_ks, p.unit_id, ss.quantity as stockState,
|
||||||
|
GROUP_CONCAT(s.stock_address SEPARATOR ', ') AS stock_addresses
|
||||||
|
FROM ecmproducts AS p
|
||||||
|
LEFT JOIN ecmstockstates AS ss
|
||||||
|
ON ss.product_id = p.id AND ss.stock_id = '368479db-22c5-0220-3a14-4bc426b1c709'
|
||||||
|
LEFT JOIN ecmproducts_stock_addresses s ON p.id = s.ecmproduct_id
|
||||||
|
WHERE p.id='" . $raw['ecmproduct_id'] . "'
|
||||||
|
GROUP BY p.id
|
||||||
|
"));
|
||||||
|
$result['id'] = $product['id'];
|
||||||
|
$result['name'] = strlen($product['name']) > 55 ? substr($product['name'], 0, 55) . "..." : $product['name'];
|
||||||
|
$result['fullName'] = $product['name'];
|
||||||
|
$result['code'] = strlen($product['code']) > 20 ? substr($product['code'], 0, 20) . "..." : $product['code'];
|
||||||
|
$result['fullCode'] = $product['code'];
|
||||||
|
$result['quantity'] = $raw['quantity'];
|
||||||
|
$result['unit'] = $app_list_strings['ecmproducts_unit_dom'][$product['unit_id']];
|
||||||
|
$result['stockState'] = (!empty($product['stockState'])) ? $product['stockState'] : 0;
|
||||||
|
$result['stockAddress'] = (!empty($product['stock_addresses'])) ? $product['stock_addresses'] : "";
|
||||||
|
$response[] = $result;
|
||||||
|
}
|
||||||
|
echo json_encode($response);
|
||||||
|
}
|
||||||
|
function getProductRawMaterials($productId, $quantity)
|
||||||
|
{
|
||||||
|
$db = $GLOBALS['db'];
|
||||||
|
$response = array();
|
||||||
|
$componentsQuery = "SELECT c.ecmcomponent_id, c.quantity
|
||||||
|
FROM ecmproductcomponents as c
|
||||||
|
WHERE c.ecmproduct_id = '$productId'";
|
||||||
|
$crows = $db->query($componentsQuery);
|
||||||
|
if ($crows->num_rows == 0) {
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
'ecmproduct_id' => $productId,
|
||||||
|
'quantity' => $quantity
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
while ($c = $db->fetchByAssoc($crows)) {
|
||||||
|
$response = array_merge($response, getProductRawMaterials($c['ecmcomponent_id'], $quantity * $c['quantity']));
|
||||||
|
}
|
||||||
|
return $response;
|
||||||
|
}
|
||||||
|
}
|
||||||
function saveQty($id, $qty)
|
function saveQty($id, $qty)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
$query = sprintf("UPDATE productionScheduler SET quantity='%d' WHERE id='%s'", $qty, $id);
|
$query = sprintf("UPDATE productionScheduler SET quantity='%d' WHERE id='%s'", $qty, $id);
|
||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
function duplicatePositions($ids)
|
function duplicatePositions($ids)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
@@ -126,7 +198,6 @@ function duplicatePositions($ids)
|
|||||||
$db->query($query);
|
$db->query($query);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removePositions($ids)
|
function removePositions($ids)
|
||||||
{
|
{
|
||||||
$db = $GLOBALS['db'];
|
$db = $GLOBALS['db'];
|
||||||
|
|||||||
@@ -76,21 +76,67 @@
|
|||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<input class="button" id="duplicateBtn" value="Duplikuj" type="button">
|
|
||||||
<input class="button" id="deleteBtn" value="Usuń" type="button">
|
|
||||||
<input class="button" id="excelBtn" value="Excel" type="button">
|
|
||||||
<input class="button" id="pdfBtn" value="PDF" type="button">
|
|
||||||
<input class="button" value="Utwórz zamówienie wewnętrzne" type="button" id="createInsideOrder"/>
|
|
||||||
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductsBySalesReport=true" method="post"
|
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductsBySalesReport=true" method="post"
|
||||||
target="_blank" id="createInsideOrderForm">
|
target="_blank" id="createInsideOrderForm">
|
||||||
<input id="insideOrderProducts" name="insideOrderProducts" type="hidden" value=""/>
|
<input id="insideOrderProducts" name="insideOrderProducts" type="hidden" value=""/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<!-- TAB MENU -->
|
||||||
|
<ul class="subpanelTablist" style="margin-top:10px;" id="groupTabsPanels">
|
||||||
|
<li class="active" id="1_menu">
|
||||||
|
<script language="javascript">
|
||||||
|
{literal}
|
||||||
|
var set1 = function () {
|
||||||
|
SetTab('1');
|
||||||
|
};
|
||||||
|
SelectedTab = '1';
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
<a class="current" href="javascript:set1();">Produkty</a>
|
||||||
|
</li>
|
||||||
|
<li class="" id="2_menu">
|
||||||
|
<script language="javascript">
|
||||||
|
{literal}
|
||||||
|
var set2 = function () {
|
||||||
|
SetTab('2');
|
||||||
|
};
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
<a class="" href="javascript:set2();">Surowce</a>
|
||||||
|
</li>
|
||||||
|
<li class="" id="3_menu">
|
||||||
|
<script language="javascript">
|
||||||
|
{literal}
|
||||||
|
var set3 = function () {
|
||||||
|
SetTab('3');
|
||||||
|
};
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
<a class="" href="javascript:set3();">Receptury</a>
|
||||||
|
</li>
|
||||||
|
<li class="" id="4_menu">
|
||||||
|
<script language="javascript">
|
||||||
|
{literal}
|
||||||
|
var set4 = function () {
|
||||||
|
SetTab('4');
|
||||||
|
};
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
<a class="" href="javascript:set4();">Realizacja</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div id="1">
|
<div id="1">
|
||||||
|
<br>
|
||||||
|
<input class="button" id="duplicateBtn" value="Duplikuj" type="button">
|
||||||
|
<input class="button" id="deleteBtn" value="Usuń" type="button">
|
||||||
|
<input class="button" id="excelBtn" value="Excel" type="button">
|
||||||
|
<input class="button" id="pdfBtn" value="PDF" type="button">
|
||||||
|
<input class="button" value="Utwórz przyjęcie produkcyjne" type="button" id="createInsideOrder"/>
|
||||||
<table id="allTable">
|
<table id="allTable">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th> </th>
|
<th class="filter-false"><input type="checkbox" id="selectAll"></th>
|
||||||
<th>Indeks</th>
|
<th>Indeks</th>
|
||||||
<th>Nazwa</th>
|
<th>Nazwa</th>
|
||||||
<th>Data produkcji</th>
|
<th>Data produkcji</th>
|
||||||
@@ -205,3 +251,14 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div id="2" style="display: none">
|
||||||
|
<div id="rawMaterialsTableContainer">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="3" style="display: none">
|
||||||
|
Receptury
|
||||||
|
</div>
|
||||||
|
<div id="4" style="display: none">
|
||||||
|
Realizacja
|
||||||
|
</div>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#allTable").tablesorter({
|
$("#allTable").tablesorter({
|
||||||
sortList: [[13, 1]],
|
sortList: [[13, 1]],
|
||||||
theme: 'blue',
|
theme: "blue",
|
||||||
widthFixed: true,
|
widthFixed: true,
|
||||||
widgets: ['filter', 'zebra', 'stickyHeaders'],
|
widgets: ["filter", "zebra", "stickyHeaders"],
|
||||||
fixedWidth: true,
|
fixedWidth: true,
|
||||||
widgetOptions: {
|
widgetOptions: {
|
||||||
resizable: false,
|
resizable: false,
|
||||||
@@ -70,9 +70,9 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
$("#selectAll").click(function () {
|
$("#selectAll").click(function () {
|
||||||
if (this.checked) {
|
if (this.checked) {
|
||||||
$(".allCheck").prop('checked', true);
|
$(".allCheck").prop("checked", true);
|
||||||
} else {
|
} else {
|
||||||
$(".allCheck").prop('checked', false);
|
$(".allCheck").prop("checked", false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#orderComponents").click(orderComponents);
|
$("#orderComponents").click(orderComponents);
|
||||||
|
|||||||
@@ -139,7 +139,7 @@
|
|||||||
<!-- TABS -->
|
<!-- TABS -->
|
||||||
<div id="1">
|
<div id="1">
|
||||||
<br>
|
<br>
|
||||||
<input class="button" name="submit" value="Utwórz zamówienie wewnętrzne" type="button" id="createInsideOrder"/>
|
<input class="button" name="submit" value="Utwórz przyjęcie produkcyjne" type="button" id="createInsideOrder"/>
|
||||||
<br>
|
<br>
|
||||||
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductsBySalesReport=true" method="post"
|
<form action="index.php?module=EcmInsideOrders&action=EditView&fromProductsBySalesReport=true" method="post"
|
||||||
target="_blank" id="createInsideOrderForm">
|
target="_blank" id="createInsideOrderForm">
|
||||||
|
|||||||
@@ -848,30 +848,23 @@ class EcmSale extends SugarBean
|
|||||||
if ($array['date_to'] != '') $field_array[] = "delivery_date<='" . date("Y-m-d", strtotime($array['date_to'])) . "'";
|
if ($array['date_to'] != '') $field_array[] = "delivery_date<='" . date("Y-m-d", strtotime($array['date_to'])) . "'";
|
||||||
if ($array['date_send_from'] != '') $field_array[] = "send_date>='" . date("Y-m-d", strtotime($array['date_send_from'])) . "'";
|
if ($array['date_send_from'] != '') $field_array[] = "send_date>='" . date("Y-m-d", strtotime($array['date_send_from'])) . "'";
|
||||||
if ($array['date_send_to'] != '') $field_array[] = "send_date<='" . date("Y-m-d", strtotime($array['date_send_to'])) . "'";
|
if ($array['date_send_to'] != '') $field_array[] = "send_date<='" . date("Y-m-d", strtotime($array['date_send_to'])) . "'";
|
||||||
if ($array['time_from'] != '') $field_array[] = "date_entered>='" . date("Y-m-d", strtotime($array['time_from'])) . "'";
|
|
||||||
if ($array['time_to'] != '') $field_array[] = "date_entered<='" . date("Y-m-d", strtotime($array['time_to'])) . "'";
|
|
||||||
if ($array['account_id'] != '') $field_array[] = "parent_id='" . $array['account_id'] . "'";
|
if ($array['account_id'] != '') $field_array[] = "parent_id='" . $array['account_id'] . "'";
|
||||||
if ($array['account_name'] != '') $field_array[] = "parent_name like '" . $array['account_name'] . "'";
|
if ($array['account_name'] != '') $field_array[] = "parent_name like '" . $array['account_name'] . "'";
|
||||||
if ($array['parent_order_no'] != '') $field_array[] = "parent_document_no='" . $array['parent_order_no'] . "'";
|
if ($array['parent_order_no'] != '') $field_array[] = "parent_document_no='" . $array['parent_order_no'] . "'";
|
||||||
switch ($array ['sale_type']) {
|
|
||||||
case 'all' :
|
if ($array['sale_type'] != null) {
|
||||||
$field_array[] = "type IN ('sales_order', 'gratis')";
|
$field_array [] = "type IN ('" . implode($array['sale_type'], "','") . "')";
|
||||||
break;
|
}
|
||||||
case 'sale' :
|
|
||||||
$field_array[] = "type='sales_order'";
|
if ($array['sale_status'] != null) {
|
||||||
break;
|
$field_array [] = "status IN ('" . implode($array['sale_status'], "','") . "')";
|
||||||
case 'gratis' :
|
|
||||||
$field_array[] = "type='gratis'";
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($field_array) > 0)
|
if (count($field_array) > 0)
|
||||||
$where = " and " . implode(" and ", $field_array);
|
$where = " and " . implode(" and ", $field_array);
|
||||||
else
|
else
|
||||||
$where = "";
|
$where = "";
|
||||||
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where;
|
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where . " ORDER BY send_date DESC";
|
||||||
if ($array['sale_type'] == 'all')
|
|
||||||
$z .= " ORDER BY type DESC";
|
|
||||||
return $z;
|
return $z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,20 @@ $json_config = new json_config ();
|
|||||||
$focus = new EcmSale ();
|
$focus = new EcmSale ();
|
||||||
|
|
||||||
|
|
||||||
|
global $app_list_strings;
|
||||||
|
if ($_GET['sale_type'] == null || count($_GET['sale_type']) == 0) {
|
||||||
|
$_GET['sale_type'] = array();
|
||||||
|
foreach ($app_list_strings['ecmsales_type_dom'] as $key => $value) {
|
||||||
|
$_GET['sale_type'][] = $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($_GET['sale_status'] == null) {
|
||||||
|
$_GET['sale_status'] = array();
|
||||||
|
foreach ($app_list_strings['ecmsales_status_dom'] as $key => $value) {
|
||||||
|
$_GET['sale_status'][] = $key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($_GET['submit']){
|
if($_GET['submit']){
|
||||||
$position_list=$focus->GetArrayResultFromQuery($focus->CreateQueryFromPost($_GET));
|
$position_list=$focus->GetArrayResultFromQuery($focus->CreateQueryFromPost($_GET));
|
||||||
|
|
||||||
@@ -44,6 +58,11 @@ $currencies = [
|
|||||||
'98b2b752-b0be-37c2-d2eb-511e29f81cab'=>'USD',
|
'98b2b752-b0be-37c2-d2eb-511e29f81cab'=>'USD',
|
||||||
'6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'=>'EUR'
|
'6336d9a0-ee5f-52e3-7d0c-4e6f1472b2bf'=>'EUR'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$edit->ss->assign('SALE_TYPES', $app_list_strings['ecmsales_type_dom']);
|
||||||
|
$edit->ss->assign('SELECTED_TYPES', $_GET['sale_type']);
|
||||||
|
$edit->ss->assign('SALE_STATUSES', $app_list_strings['ecmsales_status_dom']);
|
||||||
|
$edit->ss->assign('SELECTED_STATUSES', $_GET['sale_status']);
|
||||||
$edit->ss->assign ( "CREATED_BY_NAME", $focus->created_by_name );
|
$edit->ss->assign ( "CREATED_BY_NAME", $focus->created_by_name );
|
||||||
$edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
|
$edit->ss->assign ( "MODIFIED_BY_NAME", $focus->modified_by_name );
|
||||||
$edit->ss->assign ( 'FOCUS', $focus);
|
$edit->ss->assign ( 'FOCUS', $focus);
|
||||||
@@ -57,4 +76,3 @@ $edit->ss-> display('modules/EcmSales/tpls/ListNewSales.tpl'); //4
|
|||||||
|
|
||||||
// loading view
|
// loading view
|
||||||
//echo '<link rel="stylesheet" type="text/css" href="modules/EcmInsideOrders/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
//echo '<link rel="stylesheet" type="text/css" href="modules/EcmInsideOrders/javascript/helper.css" media="screen" /><div class="loading_panel"></div>';
|
||||||
?>
|
|
||||||
@@ -11,135 +11,26 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br/>
|
<br/>
|
||||||
<form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales"><ul class="tablist" style="width:100%;">
|
<form action="index.php?module=EcmSales&action=ListNewSales" method="get" name="SearchFormListNewSales">
|
||||||
|
<ul class="tablist" style="width:100%;">
|
||||||
<input type="hidden" name="module" value="EcmSales">
|
<input type="hidden" name="module" value="EcmSales">
|
||||||
<input type="hidden" name="action" value="ListNewSales">
|
<input type="hidden" name="action" value="ListNewSales">
|
||||||
<li>
|
<li>
|
||||||
<a class="current" href="#">{$MOD.LBL_SEARCH}</a>
|
<a class="current" href="#">{$MOD.LBL_SEARCH}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
|
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0"
|
||||||
|
cellspacing="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td width="5%" nowrap="" >
|
<td nowrap="">
|
||||||
{$MOD.LBL_LISTNEWSALES_DATE_START}:
|
|
||||||
</td>
|
|
||||||
<td width="30%" nowrap="" >
|
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title="" value="{if $POST.date_from!=''}{$POST.date_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_from" name="date_from" autocomplete="off">
|
|
||||||
<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
|
||||||
<script type="text/javascript">
|
|
||||||
{literal}
|
|
||||||
// musi być tu w pliku js nie chce działać
|
|
||||||
Calendar.setup ({
|
|
||||||
inputField : "date_from",
|
|
||||||
daFormat : "%d.%m.%Y",
|
|
||||||
button : "date_from_trigger",
|
|
||||||
singleClick : true,
|
|
||||||
dateStr : "",
|
|
||||||
step : 1,
|
|
||||||
weekNumbers:false
|
|
||||||
}
|
|
||||||
);
|
|
||||||
{/literal}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
|
||||||
|
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title="" value="{if $POST.date_to!=''}{$POST.date_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_to" name="date_to" autocomplete="off">
|
|
||||||
<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
|
||||||
<script type="text/javascript">
|
|
||||||
{literal}
|
|
||||||
// musi być tu w pliku js nie chce działać
|
|
||||||
Calendar.setup ({
|
|
||||||
inputField : "date_to",
|
|
||||||
daFormat : "%d.%m.%Y",
|
|
||||||
button : "date_to_trigger",
|
|
||||||
singleClick : true,
|
|
||||||
dateStr : "",
|
|
||||||
step : 1,
|
|
||||||
weekNumbers:false
|
|
||||||
}
|
|
||||||
);
|
|
||||||
{/literal}
|
|
||||||
</script>
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
{$MOD.LBL_LISTNEWSALES_ACCOUNT_NAME}:
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
<input type="text" title="" value="{if $POST.account_name!=''}{$POST.account_name}{/if}" size="" id="account_name" tabindex="" name="account_name">
|
|
||||||
<input type="hidden" value="{if $POST.account_id!=''}{$POST.account_id}{/if}" id="account_id" name="account_id">
|
|
||||||
<input type="button" onclick="{literal}open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"SearchFormListNewSales","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);{/literal}" value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex="" name="btn_account_name">
|
|
||||||
<button value="Wyczyść" onclick="this.form.account_name.value = ''; this.form.account_id.value = '';" class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex="" name="btn_clr_parent_name_basic" type="button"><img src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1"></button>
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
{$MOD.LBL_LISTNEWSALES_DOCUMENT_CREATE_DATE_START}:
|
|
||||||
</td>
|
|
||||||
<td width="30%" nowrap="" >
|
|
||||||
<input type="text" value="{if $POST.time_from!=''}{$POST.time_from}{/if}" id="time_from" name="time_from">
|
|
||||||
<img align="absmiddle" border="0" id="time_from_trigger" name="time_from_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
|
||||||
<script type="text/javascript">
|
|
||||||
{literal}
|
|
||||||
// musi być tu w pliku js nie chce działać
|
|
||||||
Calendar.setup ({
|
|
||||||
inputField : "time_from",
|
|
||||||
daFormat : "%d.%m.%Y",
|
|
||||||
button : "time_from_trigger",
|
|
||||||
singleClick : true,
|
|
||||||
dateStr : "",
|
|
||||||
step : 1,
|
|
||||||
weekNumbers:false
|
|
||||||
}
|
|
||||||
);
|
|
||||||
{/literal}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
|
||||||
|
|
||||||
<input type="text" value="{if $POST.time_to!=''}{$POST.time_to}{/if}" id="time_to" name="time_to">
|
|
||||||
<img align="absmiddle" border="0" id="time_to_trigger" name="time_to_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
|
||||||
<script type="text/javascript">
|
|
||||||
{literal}
|
|
||||||
// musi być tu w pliku js nie chce działać
|
|
||||||
Calendar.setup ({
|
|
||||||
inputField : "time_to",
|
|
||||||
daFormat : "%d.%m.%Y",
|
|
||||||
button : "time_to_trigger",
|
|
||||||
singleClick : true,
|
|
||||||
dateStr : "",
|
|
||||||
step : 1,
|
|
||||||
weekNumbers:false
|
|
||||||
}
|
|
||||||
);
|
|
||||||
{/literal}
|
|
||||||
</script>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
{$MOD.LBL_LISTNEWSALES_NOT_ASSIGNED}:
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
<input type="checkbox" name="wz" value="1" {if $POST.wz=='1'}checked{/if}>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
{$MOD.LBL_LISTNEWSALES_ORDER_NO}:
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
<input type="text" value="{if $POST.parent_order_no!=''}{$POST.parent_order_no}{/if}" name="parent_order_no">
|
|
||||||
</td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
{$MOD.LBL_LISTNEWSALES_ORDER_TYPE}:
|
|
||||||
</td>
|
|
||||||
<td width="30%" nowrap="nowrap" class="dataField"><select id="sale_type" name="sale_type">
|
|
||||||
<option selected="" value="all" {if $POST.sale_type=='all'}selected{/if}>Wszystkie</option>
|
|
||||||
<option value="sale" {if $POST.sale_type=='sale'}selected{/if}>Zamówienie</option>
|
|
||||||
<option value="gratis" {if $POST.sale_type=='gratis'}selected{/if}>Próbki</option>
|
|
||||||
</select></td>
|
|
||||||
<td width="5%" nowrap="" >
|
|
||||||
Data wysyłki od
|
Data wysyłki od
|
||||||
</td>
|
</td>
|
||||||
<td width="30%" nowrap="" >
|
<td nowrap="">
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title="" value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{/if}" id="date_send_from" name="date_send_from" autocomplete="off">
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
<img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
value="{if $POST.date_send_from!=''}{$POST.date_send_from}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_from"
|
||||||
|
name="date_send_from" autocomplete="off">
|
||||||
|
<img align="absmiddle" border="0" id="date_send_from_trigger" name="date_send_from_trigger"
|
||||||
|
alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
@@ -158,8 +49,11 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
|
|
||||||
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
{$MOD.LBL_LISTNEWSALES_DATE_END}:
|
||||||
|
|
||||||
<input type="text" maxlength="10" size="11" tabindex="" title="" value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{/if}" id="date_send_to" name="date_send_to" autocomplete="off">
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
<img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date" src="themes/default/images/jscalendar.gif">
|
value="{if $POST.date_send_to!=''}{$POST.date_send_to}{else}{$smarty.now|date_format:"%d.%m.%Y"}{/if}" id="date_send_to"
|
||||||
|
name="date_send_to" autocomplete="off">
|
||||||
|
<img align="absmiddle" border="0" id="date_send_to_trigger" name="date_send_to_trigger" alt="Enter Date"
|
||||||
|
src="themes/default/images/jscalendar.gif">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
{literal}
|
{literal}
|
||||||
// musi być tu w pliku js nie chce działać
|
// musi być tu w pliku js nie chce działać
|
||||||
@@ -176,6 +70,102 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
{/literal}
|
{/literal}
|
||||||
</script>
|
</script>
|
||||||
</td>
|
</td>
|
||||||
|
<td rowspan="2">Typ:</td>
|
||||||
|
<td rowspan="2">
|
||||||
|
<select id="sale_type" name="sale_type[]" multiple="true">
|
||||||
|
{foreach from=$SALE_TYPES key="key" item="value" name="sale_types"}
|
||||||
|
<option {if in_array($key, $SELECTED_TYPES)}selected="selected" {/if} value="{$key}">{$value}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td rowspan="2">Status:</td>
|
||||||
|
<td rowspan="2">
|
||||||
|
<select id="sale_status" name="sale_status[]" multiple="true">
|
||||||
|
{foreach from=$SALE_STATUSES key="key" item="value" name="sale_statuses"}
|
||||||
|
<option {if in_array($key, $SELECTED_STATUSES)}selected="selected" {/if} value="{$key}">{$value}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
{$MOD.LBL_LISTNEWSALES_ACCOUNT_NAME}:
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
<input type="text" title="" value="{if $POST.account_name!=''}{$POST.account_name}{/if}" size=""
|
||||||
|
id="account_name" tabindex="" name="account_name">
|
||||||
|
<input type="hidden" value="{if $POST.account_id!=''}{$POST.account_id}{/if}" id="account_id"
|
||||||
|
name="account_id">
|
||||||
|
<input type="button"
|
||||||
|
onclick="{literal}open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"SearchFormListNewSales","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);{/literal}"
|
||||||
|
value="Wybierz" class="button" accesskey="T" title="Select [Alt+T]" tabindex=""
|
||||||
|
name="btn_account_name">
|
||||||
|
<button value="Wyczyść" onclick="this.form.account_name.value = ''; this.form.account_id.value = '';"
|
||||||
|
class="button lastChild" accesskey="C" title="Wyczyść[Alt+C]" tabindex=""
|
||||||
|
name="btn_clr_parent_name_basic" type="button"><img
|
||||||
|
src="themes/default/images/id-ff-clear.png?s=bed8cd35065048ceebdc639ebe305e2c&c=1">
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td nowrap="">
|
||||||
|
{$MOD.LBL_LISTNEWSALES_NOT_ASSIGNED}:
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
<input type="checkbox" name="wz" value="1" {if $POST.wz=='1'}checked{/if}>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td nowrap="">
|
||||||
|
Data dostawy od:
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
|
value="{if $POST.date_from!=''}{$POST.date_from}{/if}"
|
||||||
|
id="date_from" name="date_from" autocomplete="off">
|
||||||
|
<img align="absmiddle" border="0" id="date_from_trigger" name="date_from_trigger" alt="Enter Date"
|
||||||
|
src="themes/default/images/jscalendar.gif">
|
||||||
|
<script type="text/javascript">
|
||||||
|
{literal}
|
||||||
|
// musi być tu w pliku js nie chce działać
|
||||||
|
Calendar.setup({
|
||||||
|
inputField: "date_from",
|
||||||
|
daFormat: "%d.%m.%Y",
|
||||||
|
button: "date_from_trigger",
|
||||||
|
singleClick: true,
|
||||||
|
dateStr: "",
|
||||||
|
step: 1,
|
||||||
|
weekNumbers: false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
do:
|
||||||
|
<input type="text" maxlength="10" size="11" tabindex="" title=""
|
||||||
|
value="{if $POST.date_to!=''}{$POST.date_to}{/if}"
|
||||||
|
id="date_to" name="date_to" autocomplete="off">
|
||||||
|
<img align="absmiddle" border="0" id="date_to_trigger" name="date_to_trigger" alt="Enter Date"
|
||||||
|
src="themes/default/images/jscalendar.gif">
|
||||||
|
<script type="text/javascript">
|
||||||
|
{literal}
|
||||||
|
// musi być tu w pliku js nie chce działać
|
||||||
|
Calendar.setup({
|
||||||
|
inputField: "date_to",
|
||||||
|
daFormat: "%d.%m.%Y",
|
||||||
|
button: "date_to_trigger",
|
||||||
|
singleClick: true,
|
||||||
|
dateStr: "",
|
||||||
|
step: 1,
|
||||||
|
weekNumbers: false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
{/literal}
|
||||||
|
</script>
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
{$MOD.LBL_LISTNEWSALES_ORDER_NO}:
|
||||||
|
</td>
|
||||||
|
<td nowrap="">
|
||||||
|
<input type="text" value="{if $POST.parent_order_no!=''}{$POST.parent_order_no}{/if}"
|
||||||
|
name="parent_order_no">
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@@ -183,11 +173,16 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
<h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę wysyłki{/if}</h3>
|
<h3 style="color:red">{if $POST.date_send_from!='' && $POST.date_from!=''}Proszę wybrać date dostawy lub datę wysyłki{/if}</h3>
|
||||||
<input type="hidden" id="idss" value="">
|
<input type="hidden" id="idss" value="">
|
||||||
<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
|
<input type="submit" value="{$MOD.LBL_LISTNEWSALES_POST}" name="submit" class="button">
|
||||||
<input type="button" onclick="location.href='index.php?module=EcmSales&action=ListNewSales';" value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button">
|
<input type="button" onclick="location.href='index.php?module=EcmSales&action=ListNewSales';"
|
||||||
<input type="button" id="gets" class="button" name="gets" value="{$MOD.LBL_LISTNEWSALES_CREATE_PDFS}" onclick="createMultiPdf()">
|
value="{$MOD.LBL_LISTNEWSALES_CLEAR}" name="clear" class="button">
|
||||||
<input type="button" id="products_list" class="button" name="products_list" value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY}" onclick="getSelected(); getList();">
|
<input type="button" id="gets" class="button" name="gets" value="{$MOD.LBL_LISTNEWSALES_CREATE_PDFS}"
|
||||||
<input type="button" id="products_list" class="button" name="products_list" value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY} 2" onclick="getSelected(); getList2();">
|
onclick="createMultiPdf()">
|
||||||
<input type="button" id="products_list" class="button" name="products_list" value="Lista komponentów" onclick="getSelected(); getList3();">
|
<input type="button" id="products_list" class="button" name="products_list"
|
||||||
|
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY}" onclick="getSelected(); getList();">
|
||||||
|
<input type="button" id="products_list" class="button" name="products_list"
|
||||||
|
value="{$MOD.LBL_LISTNEWSALES_PRODUCT_SUMMARY} 2" onclick="getSelected(); getList2();">
|
||||||
|
<input type="button" id="products_list" class="button" name="products_list" value="Lista komponentów"
|
||||||
|
onclick="getSelected(); getList3();">
|
||||||
<br>{if $LINK!=''}<a href="https://95.50.148.50/crm/pdftmp/{$LINK}">{$LINK}</a>{/if}
|
<br>{if $LINK!=''}<a href="https://95.50.148.50/crm/pdftmp/{$LINK}">{$LINK}</a>{/if}
|
||||||
|
|
||||||
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;" id="myTable" class="tablesorter">
|
<table cellspacing="0" cellpadding="0" border="0" style="width:100%;" id="myTable" class="tablesorter">
|
||||||
@@ -209,38 +204,55 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
<th>{$MOD.LBL_LISTNEWSALES_PERCENT}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_PERCENT}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_CURRENCY}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_CURRENCY}</th>
|
||||||
<th>{$MOD.LBL_LISTNEWSALES_PRINTED}</th>
|
<th>{$MOD.LBL_LISTNEWSALES_PRINTED}</th>
|
||||||
<td > </td></tr>
|
<td> </td>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach from=$POSITION_LIST key="key" item="item" name="components"}
|
{foreach from=$POSITION_LIST key="key" item="item" name="components"}
|
||||||
{if $item.id!=''}
|
{if $item.id!=''}
|
||||||
<tr style="vertical-align:top;">
|
<tr style="vertical-align:top;">
|
||||||
<td ><input type="checkbox" value="{$item.id}" class="make_pdf" id="make_pdf_{$item.position}" name="selectedid[]"></td>
|
<td><input type="checkbox" value="{$item.id}" class="make_pdf" id="make_pdf_{$item.position}"
|
||||||
|
name="selectedid[]"></td>
|
||||||
<td>{$item.position}</td>
|
<td>{$item.position}</td>
|
||||||
<td data-price="{$item.number}"><a href="index.php?module=EcmSales&action=DetailView&record={$item.id}">{$item.document_no}</a></td>
|
<td data-price="{$item.number}"><a
|
||||||
|
href="index.php?module=EcmSales&action=DetailView&record={$item.id}">{$item.document_no}</a>
|
||||||
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td ><a href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a></td>
|
<td>
|
||||||
|
<a href="index.php?module=Accounts&action=DetailView&record={$item.parent_id}">{$item.parent_name}</a>
|
||||||
|
</td>
|
||||||
<td>{$item.delivery_date}</td>
|
<td>{$item.delivery_date}</td>
|
||||||
<td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if} disabled="disabled"></td>
|
<td><input type="checkbox" {if $item.send_accepted==true}checked="checked" {/if}
|
||||||
|
disabled="disabled"></td>
|
||||||
<td>{$item.send_date} </td>
|
<td>{$item.send_date} </td>
|
||||||
<td style="text-align: right">{$item.quantity}</td>
|
<td style="text-align: right">{$item.quantity}</td>
|
||||||
<td data-total="{$item.total_netto}" style="text-align: right">{$item.total_netto|number_format:2:".":","}</td>
|
<td data-total="{$item.total_netto}"
|
||||||
<td data-total="{$item.total_vat}" style="text-align: right">{$item.total_vat|number_format:2:".":","}</td>
|
style="text-align: right">{$item.total_netto|number_format:2:".":","}</td>
|
||||||
<td data-total="{$item.total_brutto}" style="text-align: right">{$item.total_brutto|number_format:2:".":","}</td>
|
<td data-total="{$item.total_vat}"
|
||||||
<td data-total="{$item.total_invoice}" style="text-align: right">{$item.total_invoice|number_format:2:".":","}</td>
|
style="text-align: right">{$item.total_vat|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$item.percent}<a style="cursor:pointer;" onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
<td data-total="{$item.total_brutto}"
|
||||||
|
style="text-align: right">{$item.total_brutto|number_format:2:".":","}</td>
|
||||||
|
<td data-total="{$item.total_invoice}"
|
||||||
|
style="text-align: right">{$item.total_invoice|number_format:2:".":","}</td>
|
||||||
|
<td style="text-align: right">{$item.percent}<a style="cursor:pointer;"
|
||||||
|
onclick="{literal}if(document.getElementById('div{/literal}{$item.id}{literal}').style.display=='none'){document.getElementById('div{/literal}{$item.id}{literal}').style.display='block';}else{document.getElementById('{/literal}div{$item.id}{literal}').style.display='none';}{/literal} "><img
|
||||||
|
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
||||||
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;"
|
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;"
|
||||||
id="div{$item.id}">
|
id="div{$item.id}">
|
||||||
<table cellspacing="0" cellpadding="3" border="0">
|
<table cellspacing="0" cellpadding="3" border="0">
|
||||||
<tbody><tr><td width="40%"><strong>Index</strong></td>
|
<tbody>
|
||||||
<td><strong>Order</strong></td><td><strong>WZ</strong></td>
|
<tr>
|
||||||
<td><strong>ETA</strong></td></tr>
|
<td width="40%"><strong>Index</strong></td>
|
||||||
|
<td><strong>Order</strong></td>
|
||||||
|
<td><strong>WZ</strong></td>
|
||||||
|
<td><strong>ETA</strong></td>
|
||||||
|
</tr>
|
||||||
{foreach from=$item.products key="ki" item="va" name="products"}
|
{foreach from=$item.products key="ki" item="va" name="products"}
|
||||||
{if $va.code!=''}
|
{if $va.code!=''}
|
||||||
|
|
||||||
|
|
||||||
<tr style="color:black;">
|
<tr style="color:black;">
|
||||||
<td style="color:black;"><a href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a></td>
|
<td style="color:black;"><a
|
||||||
|
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
||||||
|
</td>
|
||||||
{if $va.order>$va.wz}
|
{if $va.order>$va.wz}
|
||||||
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
||||||
@@ -248,29 +260,70 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
||||||
{/if}
|
{/if}
|
||||||
<td style="color:black;"></td></tr>
|
<td style="color:black;"></td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
|
|
||||||
<tr style="color:black;font-weight:bold"><td>Total</td>
|
<tr style="color:black;font-weight:bold">
|
||||||
<td>{$item.products.order_total|number_format:2:".":","}</td><td>{$item.products.wz_total|number_format:2:".":","}</td></tr><tr><td></td><td></td>
|
<td>Total</td>
|
||||||
<td><span style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span></td></tr>
|
<td>{$item.products.order_total|number_format:2:".":","}</td>
|
||||||
<tr><td></td><td></td><td><span style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span></td></tr></tbody></table></div>
|
<td>{$item.products.wz_total|number_format:2:".":","}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<span style="color:red;font-weight:bold">{$item.products.minus|number_format:2:".":","}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<span style="color:green;font-weight:bold">{$item.products.plus|number_format:2:".":","}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td style="text-align: right">{$CURRENCIES[$item.currency]}</td>
|
<td style="text-align: right">{$CURRENCIES[$item.currency]}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
{if $item.type!='gratis'}
|
{if $item.type!='gratis'}
|
||||||
{if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}" src="modules/EcmSales/images/convert_disabled.gif" title="{$item.fv_name}" style="cursor:pointer;" onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if}
|
{if $item.fv_switch=='yes'}<img border="0" id="convert_to_invoice_{$item.id}"
|
||||||
{if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}" src="modules/EcmSales/images/convert_enabled.gif" title="Create Invoice" onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}" style="cursor:pointer;" />{/if}
|
src="modules/EcmSales/images/convert_disabled.gif"
|
||||||
{if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif" title="{$item.wz_name}" onclick="{literal}window.open('index.php?module=EcmStockDocOuts&action=DetailView&record={/literal}{$item.wz_id}{literal}','_newtab');{/literal}" style="cursor: pointer;" border="0"> {/if}
|
title="{$item.fv_name}" style="cursor:pointer;"
|
||||||
{if $item.wz_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif" title="{$MOD.LBL_LISTNEWSALES_CREATEWZ}" onclick="{literal}javascript:window.open('index.php?module=EcmStockDocOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}" style="cursor: pointer;" border="0">{/if}
|
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=DetailView&record={/literal}{$item.fv_id}{literal}','_newtab');{/literal} " />'{/if}
|
||||||
|
{if $item.fv_switch=='no'}<img border="0" id="convert_to_invoice_{$item.id}"
|
||||||
|
src="modules/EcmSales/images/convert_enabled.gif"
|
||||||
|
title="Create Invoice"
|
||||||
|
onClick="{literal}javascript:window.open('index.php?module=EcmInvoiceOuts&action=EditView&isWZ=true&wz_record={/literal}{$item.fv_id}{literal}','_newtab');{/literal}"
|
||||||
|
style="cursor:pointer;" />{/if}
|
||||||
|
{if $item.wz_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
||||||
|
title="{$item.wz_name}"
|
||||||
|
onclick="{literal}window.open('index.php?module=EcmStockDocOuts&action=DetailView&record={/literal}{$item.wz_id}{literal}','_newtab');{/literal}"
|
||||||
|
style="cursor: pointer;" border="0"> {/if}
|
||||||
|
{if $item.wz_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
||||||
|
title="{$MOD.LBL_LISTNEWSALES_CREATEWZ}"
|
||||||
|
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
||||||
|
style="cursor: pointer;" border="0">{/if}
|
||||||
{else}
|
{else}
|
||||||
{if $item.rw_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif" title="{$item.rw_name}" onclick="{literal}window.open('index.php?module=EcmStockDocInsideOuts&action=DetailView&record={/literal}{$item.rw_id}{literal}','_newtab');{/literal}" style="cursor: pointer;" border="0"> {/if}
|
{if $item.rw_switch=='disabled'}<img src="modules/EcmSales/images/create_wz_disabled.gif"
|
||||||
{if $item.rw_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif" title="{$MOD.LBL_LISTNEWSALES_CREATERW}" onclick="{literal}javascript:window.open('index.php?module=EcmStockDocInsideOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}" style="cursor: pointer;" border="0">{/if}
|
title="{$item.rw_name}"
|
||||||
|
onclick="{literal}window.open('index.php?module=EcmStockDocInsideOuts&action=DetailView&record={/literal}{$item.rw_id}{literal}','_newtab');{/literal}"
|
||||||
|
style="cursor: pointer;" border="0"> {/if}
|
||||||
|
{if $item.rw_switch=='enabled'}<img src="modules/EcmSales/images/create_wz_enabled.gif"
|
||||||
|
title="{$MOD.LBL_LISTNEWSALES_CREATERW}"
|
||||||
|
onclick="{literal}javascript:window.open('index.php?module=EcmStockDocInsideOuts&action=EditView&parent_doc_type=EcmSales&parent_doc_id={/literal}{$item.id}{literal}','_newtab');{/literal}"
|
||||||
|
style="cursor: pointer;" border="0">{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<img src="modules/EcmSales/images/pdf.gif" title="Preview Sale" onclick="{literal}EcmPreviewPDF('index.php?module=EcmSales&action=previewPDF&method=I&record={$item.id}&to_pdf=1',{zoom:75,toolbar:1});{/literal}" style="cursor: pointer;" border="0">
|
<img src="modules/EcmSales/images/pdf.gif" title="Preview Sale"
|
||||||
</td></tr>
|
onclick="{literal}EcmPreviewPDF('index.php?module=EcmSales&action=previewPDF&method=I&record={$item.id}&to_pdf=1',{zoom:75,toolbar:1});{/literal}"
|
||||||
|
style="cursor: pointer;" border="0">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@@ -289,10 +342,14 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
<td style="text-align: right">{$POSITION_LIST.total_vat|number_format:2:".":","}</td>
|
<td style="text-align: right">{$POSITION_LIST.total_vat|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$POSITION_LIST.total_brutto|number_format:2:".":","}</td>
|
<td style="text-align: right">{$POSITION_LIST.total_brutto|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$POSITION_LIST.total_invoice|number_format:2:".":","}</td>
|
<td style="text-align: right">{$POSITION_LIST.total_invoice|number_format:2:".":","}</td>
|
||||||
<td style="text-align: right">{$POSITION_LIST.total_percent|string_format:"%.2f"}%<a style="cursor:pointer;" onclick="{literal}if(document.getElementById('div_all').style.display=='none'){document.getElementById('div_all').style.display='block';}else{document.getElementById('div_all').style.display='none';}{/literal}"><img border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
<td style="text-align: right">{$POSITION_LIST.total_percent|string_format:"%.2f"}%<a style="cursor:pointer;"
|
||||||
|
onclick="{literal}if(document.getElementById('div_all').style.display=='none'){document.getElementById('div_all').style.display='block';}else{document.getElementById('div_all').style.display='none';}{/literal}"><img
|
||||||
|
border="0" src="modules/EcmQuotes/images/search.gif"></a>
|
||||||
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;" id="div_all">
|
<div style="display:none; border: 1px solid #cccccc;background-color:#e6e6e6;padding:3px;" id="div_all">
|
||||||
<table cellspacing="0" cellpadding="3" border="0"><tbody>
|
<table cellspacing="0" cellpadding="3" border="0">
|
||||||
<tr><td width="40%"><strong>Index</strong></td>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td width="40%"><strong>Index</strong></td>
|
||||||
<td><strong>Order</strong></td>
|
<td><strong>Order</strong></td>
|
||||||
<td><strong>WZ</strong></td>
|
<td><strong>WZ</strong></td>
|
||||||
<td><strong>ETA</strong></td>
|
<td><strong>ETA</strong></td>
|
||||||
@@ -301,7 +358,9 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
|
|
||||||
|
|
||||||
<tr style="color:black;">
|
<tr style="color:black;">
|
||||||
<td style="color:black;"><a href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a></td>
|
<td style="color:black;"><a
|
||||||
|
href="index.php?module=EcmProducts&action=DetailView&record={$va.id}">{$va.code}</a>
|
||||||
|
</td>
|
||||||
{if $va.order>$va.wz}
|
{if $va.order>$va.wz}
|
||||||
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:red;">{$va.wz|number_format:2:".":","}</td>
|
||||||
@@ -309,12 +368,31 @@ src="include/jQuery/jquery.blockUI.js"></script>
|
|||||||
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.order|number_format:2:".":","}</td>
|
||||||
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
<td style="color:black;">{$va.wz|number_format:2:".":","}</td>
|
||||||
{/if}
|
{/if}
|
||||||
<td style="color:black;"></td></tr>
|
<td style="color:black;"></td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr style="color:black;font-weight:bold"><td>Total</td>
|
<tr style="color:black;font-weight:bold">
|
||||||
<td>{$POSITION_LIST.total_product.order_total|number_format:2:".":","}</td><td>{$POSITION_LIST.total_product.wz_total|number_format:2:".":","}</td></tr><tr><td></td><td></td>
|
<td>Total</td>
|
||||||
<td><span style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span></td></tr>
|
<td>{$POSITION_LIST.total_product.order_total|number_format:2:".":","}</td>
|
||||||
<tr><td></td><td></td><td><span style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span></td></tr></tbody></table></div>
|
<td>{$POSITION_LIST.total_product.wz_total|number_format:2:".":","}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<span style="color:red;font-weight:bold">{$POSITION_LIST.total_product.minus|number_format:2:".":","}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<span style="color:green;font-weight:bold">{$POSITION_LIST.total_product.plus|number_format:2:".":","}</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
@@ -204,6 +204,7 @@ if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
|||||||
|
|
||||||
var $correct_id;
|
var $correct_id;
|
||||||
var $correct_name;
|
var $correct_name;
|
||||||
|
var $kind;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1434,6 +1434,7 @@ addEvent(
|
|||||||
var arr = eval(result)[0];
|
var arr = eval(result)[0];
|
||||||
document.getElementById('number').value = arr.number;
|
document.getElementById('number').value = arr.number;
|
||||||
document.getElementById('document_no').value = arr.document_no;
|
document.getElementById('document_no').value = arr.document_no;
|
||||||
|
document.getElementById('status').value ='accepted';
|
||||||
},
|
},
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
|
|
||||||
$OPT['new_number'] = true;
|
$OPT['new_number'] = true;
|
||||||
$focus->kind='other';
|
$focus->kind='other';
|
||||||
$focus->status = "s10";
|
$focus->status = "accepted";
|
||||||
|
|
||||||
if(isset($cc)) {
|
if(isset($cc)) {
|
||||||
//payment condition
|
//payment condition
|
||||||
|
|||||||
Reference in New Issue
Block a user