Add states to sales report
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// created: 2025-01-23 12:37:10
|
||||
// created: 2025-01-31 16:54:46
|
||||
$customDoms = array (
|
||||
'ecmproducts_attribute_dom' =>
|
||||
array (
|
||||
@@ -194,6 +194,7 @@ $customDoms = array (
|
||||
'6fadf5e0-693e-6b9d-213c-66222fd03bdf' => 'Fabric Surface Cleaners',
|
||||
'f2156355-d06b-2904-d759-67923795c77b' => 'Oven Cleaners',
|
||||
'27697ebf-0d8e-5156-528e-679237ffd78f' => 'Toilet Cleaners',
|
||||
'f03ef1ce-e218-97eb-623e-679d00f02f98' => 'Car Cleaning',
|
||||
),
|
||||
'ecmquotes_status_dom' =>
|
||||
array (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// created: 2025-01-23 12:37:10
|
||||
// created: 2025-01-31 16:54:46
|
||||
$customDoms = array (
|
||||
'ecmproducts_attribute_dom' =>
|
||||
array (
|
||||
@@ -194,6 +194,7 @@ $customDoms = array (
|
||||
'6fadf5e0-693e-6b9d-213c-66222fd03bdf' => 'Środki do czyszczenia powierzchni materiałowych',
|
||||
'f2156355-d06b-2904-d759-67923795c77b' => 'Środki do czyszczenia piekarnika',
|
||||
'27697ebf-0d8e-5156-528e-679237ffd78f' => 'Środki do czyszczenia toalet',
|
||||
'f03ef1ce-e218-97eb-623e-679d00f02f98' => 'Środki do czyszczenia samochodów',
|
||||
),
|
||||
'ecmquotes_status_dom' =>
|
||||
array (
|
||||
|
||||
@@ -126,13 +126,16 @@
|
||||
ELSE
|
||||
pozycja.price_purchase*pozycja.quantity_corrected
|
||||
END
|
||||
) as koszt
|
||||
) as koszt,
|
||||
sum(s.quantity) AS 'state'
|
||||
FROM
|
||||
ecminvoiceoutitems pozycja
|
||||
JOIN
|
||||
ecminvoiceouts faktura ON pozycja.ecminvoiceout_id = faktura.id
|
||||
LEFT JOIN
|
||||
ecmproducts produkt ON pozycja.ecmproduct_id = produkt.id
|
||||
LEFT JOIN
|
||||
ecmstockstates s ON s.product_id = pozycja.ecmproduct_id
|
||||
WHERE
|
||||
faktura.register_date BETWEEN
|
||||
'".$date_from_to_query->format('Y-m-d')."' AND
|
||||
@@ -154,6 +157,8 @@
|
||||
$query .= "GROUP BY pozycja.id
|
||||
COLLATE utf8_polish_ci;";
|
||||
|
||||
echo $query;
|
||||
|
||||
|
||||
}else if ($searchBy=="contractor"){
|
||||
$query = "SELECT
|
||||
@@ -243,6 +248,7 @@
|
||||
$row["name"] = $r["name"];
|
||||
|
||||
$row["code"]=$r["code"];
|
||||
$row["state"]=$r["state"];
|
||||
$row["parent_id"]=$r["parent_id"];
|
||||
$row["type"]=$r["type"];
|
||||
|
||||
@@ -442,6 +448,7 @@
|
||||
$tmp2[$key1][$key2][$i]["id"]=$element3["id"];
|
||||
$tmp2[$key1][$key2][$i]["name"]=$element3["name"];
|
||||
$tmp2[$key1][$key2][$i]["code"]=$element3["code"];
|
||||
$tmp2[$key1][$key2][$i]["state"]=$element3["state"];
|
||||
$tmp2[$key1][$key2][$i]["parent_id"]=$element3["parent_id"];
|
||||
}
|
||||
//if($element3["type"]=="normal")
|
||||
|
||||
@@ -247,6 +247,7 @@
|
||||
<th width="30%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_PRODUCTS}</th>
|
||||
{if $searchBy=="product"}
|
||||
<th width="10%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Indeks</th>
|
||||
<th width="10%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="1" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Stan</th>
|
||||
{/if}
|
||||
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="2" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_SOLD_AMOUNT}</th>
|
||||
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="3" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">{$MOD.LBL_VALUE_SALES}</th>
|
||||
@@ -269,6 +270,7 @@
|
||||
{/if}
|
||||
{if $searchBy=="product"}
|
||||
<td class="oddListRowS1 alignLeft" ></td>
|
||||
<td class="oddListRowS1 alignLeft" ></td>
|
||||
{/if}
|
||||
<td class="oddListRowS1 sumRow" ><b>{$DATA.$CATNAME.IloscSum|number_format:0:",":"." }</b></td>
|
||||
<td class="oddListRowS1 sumRow" ><b>{$DATA.$CATNAME.SoldSum|number_format:2:",":"." }</b></td>
|
||||
@@ -289,6 +291,7 @@
|
||||
<td class="oddListRowS1 alignLeft"><a class="showRows" style="color: cadetblue; text-decoration: none; cursor: pointer;">[+]</a><b> {$CAT2NAME}</b></td>
|
||||
{if $searchBy=="product"}
|
||||
<td class="oddListRowS1 alignLeft" ></td>
|
||||
<td class="oddListRowS1 alignLeft" ></td>
|
||||
{/if}
|
||||
<td class="oddListRowS1 sumRow" ><b>{$CAT.$CAT2NAME.IloscSum2|number_format:0:",":"." }</b></td>
|
||||
<td class="oddListRowS1 sumRow" ><b>{$CAT.$CAT2NAME.SoldSum2|number_format:2:",":"." }</b></td>
|
||||
@@ -326,6 +329,7 @@
|
||||
{/if}
|
||||
{if $searchBy=="product"}
|
||||
<td class="oddListRowS1 alignLeft" >{$ROW.code}</td>
|
||||
<td class="oddListRowS1 alignLeft" >{$ROW.state}</td>
|
||||
{/if}
|
||||
<td class="oddListRowS1" >{$ROW.ilosc|number_format:0:",":"."}</td>
|
||||
<td class="oddListRowS1" >{$ROW.netto|number_format:2:",":"."}</td>
|
||||
@@ -347,6 +351,7 @@
|
||||
<td class="oddListRowS1 alignLeft"><b>{$MOD.LBL_SUM}:</b></td>
|
||||
{if $searchBy=="product"}
|
||||
<td class="oddListRowS1" ></td>
|
||||
<td class="oddListRowS1" ></td>
|
||||
{/if}
|
||||
<td class="oddListRowS1 sumRow" ><b>{$SUM.IloscSumSum|number_format:0:",":"." }</b></td>
|
||||
<td class="oddListRowS1 sumRow" ><b>{$SUM.SoldSumSum|number_format:2:",":"." }</b></td>
|
||||
|
||||
Reference in New Issue
Block a user