#49 Mantis ID:8441 - ABC Classcode and Cycle Count Frequency added to dspItemSitesByParameterList.cpp

open
nobody
None
3
2009-02-09
2009-02-09
omfgppc
No

Reporter: szuke
Severity: Patch
Category: Inventory
Project: xTupleApps

Version:

Description:
Within the dspItemSitesByParameterList::sFillList() function, I added the itemsite_abcclasscode and itemsite_cyclecountfreq fields.

These fields are on the report and this addition was requested by Blair.

I added this line -->
" itemsite_abcclass,itemsite_cyclecountfreq,"

Source:

void dspItemSitesByParameterList::sFillList()
{
QString sql( "SELECT itemsite_id, warehous_code, item_number,"
" (item_descrip1 || ' ' || item_descrip2) AS description, uom_name,"
" itemsite_qtyonhand, formatBoolYN(itemsite_loccntrl) AS loccntrl,"
" CASE WHEN itemsite_controlmethod='R' THEN :regular"
" WHEN itemsite_controlmethod='N' THEN :none"
" WHEN itemsite_controlmethod='L' THEN :lot"
" WHEN itemsite_controlmethod='S' THEN :serial"
" END AS controlmethod,"
" CASE WHEN (itemsite_sold) THEN TEXT(itemsite_soldranking)"
" ELSE :na"
" END AS soldranking,"
" CASE WHEN (itemsite_datelastcount=startOfTime()) THEN NULL"
" ELSE itemsite_datelastcount"
" END AS datelastcount,"
" CASE WHEN (itemsite_datelastused=startOfTime()) THEN NULL"
" ELSE itemsite_datelastused"
" END AS datelastused,"
" 'qty' AS itemsite_qtyonhand_xtnumericrole,"
" itemsite_abcclass,itemsite_cyclecountfreq,"
" 'Never' AS datelastcount_xtnullrole,"
" 'Never' AS datelastused_xtnullrole "
"FROM itemsite, warehous, item, uom "
"WHERE ( (itemsite_item_id=item_id)"
" AND (item_inv_uom_id=uom_id)"
" AND (itemsite_warehous_id=warehous_id)" );

if (_parameter->isSelected())
{
if (_parameter->type() == ParameterGroup::ClassCode)
sql += " AND (item_classcode_id=:classcode_id)";
else if (_parameter->type() == ParameterGroup::ItemGroup)
sql += " AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=:itemgrp_id)))";
else if (_parameter->type() == ParameterGroup::PlannerCode)
sql += " AND (itemsite_plancode_id=:plancode_id)";
else if (_parameter->type() == ParameterGroup::CostCategory)
sql += " AND (itemsite_costcat_id=:costcat_id)";
}
else if (_parameter->isPattern())
{
if (_parameter->type() == ParameterGroup::ClassCode)
sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))";
else if (_parameter->type() == ParameterGroup::ItemGroup)
sql += " AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ :itemgrp_pattern) ) ))";
else if (_parameter->type() == ParameterGroup::PlannerCode)
sql += " AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ :plancode_pattern)))";
else if (_parameter->type() == ParameterGroup::CostCategory)
sql += " AND (itemsite_costcat_id IN (SELECT costcat_id FROM costcat WHERE (costcat_code ~ :costcat_pattern)))";
}

if (_warehouse->isSelected())
sql += " AND (warehous_id=:warehous_id)";

if (!_showInactive->isChecked())
sql += " AND (itemsite_active)";

sql += ") "
"ORDER BY item_number;";

q.prepare(sql);
_warehouse->bindValue(q);
_parameter->bindValue(q);
q.bindValue(":regular", tr("Regular"));
q.bindValue(":none", tr("None"));
q.bindValue(":lot", tr("Lot #"));
q.bindValue(":serial", tr("Serial #"));
q.bindValue(":na", tr("N/A"));
q.exec();
_itemsite->populate(q);
}

Steps to reproduce:

Additional information:

Read more at http://www.xtuple.org/mantis/view.php?id=8441

Discussion