User input-Defect Type

PHOTO EMBED

Thu Jan 16 2025 05:13:57 GMT+0000 (Coordinated Universal Time)

Saved by @Nisha

gethourdata = Hourly_Quality_Report[Release_Production_wo_recid == input.Release_Production_wo_recid].sum(Total_Complete_Qty);
hourdata = Hourly_Quality_Report[Release_Production_wo_recid == input.Release_Production_wo_recid];
hourdatanew = Hourly_Quality_Report[Release_Production_wo_recid == input.Release_Production_wo_recid] sort by Added_Time desc;
for each  rec in input.Specifications
{
	if(row.Defect_Type = "No Defects" && row.S_No == 1 && hourdatanew.Status == null)
	{
		input.Total_OK_Qty = ifnull(input.Actual_Qty,0);
	}
	if(row.Defect_Type = "No Defects" && row.S_No == 1 && hourdatanew.Status == "Hourly QC Partially Completed")
	{
		//input.Total_OK_Qty = ifnull(hourdatanew.Total_OK_Qty,0);
		input.Total_OK_Qty = ifnull(input.Actual_Qty,0);
	}
	if(row.Defect_Type = "No Defects")
	{
		if(hourdata.count() == 0)
		{
			row.Actual_Qty=null;
		}
		//input.Total_OK_Qty = ifnull(input.Actual_Qty,0);
		disable row.Defects;
		disable row.Actual_Qty;
	}
	else
	{
		enable row.Defects;
		enable row.Actual_Qty;
	}
	/* 	if(rec.Defect_Type = "No Defects")
	{
		if(hourdata.count() == 0)
		{
			//rec.Actual_Qty=ifnull(input.Actual_Qty,0);
			rec.Actual_Qty=null;
		}
		else if(hourdata.count() > 0)
		{
			rec.Actual_Qty=ifnull(input.Actual_Qty,0) - ifnull(gethourdata,0);
		}
		input.Do_you_want_to_Complete_QC_fully = True;
		//input.Total_OK_Qty = ifnull(input.Actual_Qty,0);
		disable row.Defects;
		disable row.Actual_Qty;
	} */
	// 	if(hourdata.count() == 0 || hourdata.count() > 0 && row.Defect_Type == "No Defects")
	// 	{
	// 		alert "You can only choose No Defects, If the above rows not choosed as Reject/Rework/COD";
	// 		row.Defect_Type=null;
	// 		row.Actual_Qty=null;
	// 		input.Do_you_want_to_Complete_QC_fully = null;
	// 	}
	// 	else
	// 	{
	// 		input.Do_you_want_to_Complete_QC_fully = False;
	// 		enable row.Actual_Qty;
	// 		enable row.Defects;
	// 	}
}
if(row.Defect_Type != "COD")
{
	fet_qc = QC_Department_Master[Production_Department == input.Line];
	fet_def = Defects_Master[QC_Department == fet_qc.ID && Defect_Type == row.Defect_Type].ID.getAll();
	row.Defects:ui.add(fet_def);
}
//---If COD choosen & ,Department RIM / Disc  means show all Raw material defects & if Assembly Means show All defects Raw+Rim+Disc Defects-------------
if(row.Defect_Type == "COD")
{
	//info"cod";
	if(row.Department.Department == "Front Rim Line" || row.Department.Department == "Rear Rim Line" || row.Department.Department == "Front Disc Line" || row.Department.Department == "Rear Disc Line")
	{
		//info "---" + row.Department.Department;
		//fet_qc = QC_Department_Master[Production_Department.Department == "Raw Material"];
		fet_def1 = Defects_Master[QC_Department.QC_Department == "Raw Material"].ID.getAll();
		info fet_def1;
		row.Defects:ui.add(fet_def1);
	}
	else if(row.Department.Department == "Front Assembly" || row.Department.Department == "Rear Assembly" || row.Department.Department == "Rear Lug Welding" || row.Department.Department == "Front Lug Welding")
	{
		//info "--Assebly--" + row.Department.Department;
		//fet_qc = QC_Department_Master[Production_Department.Department == "Raw Material"];
		fet_def2 = Defects_Master[QC_Department.QC_Department == "Raw Material" || QC_Department.QC_Department == "Rim Line" || QC_Department.QC_Department == "Disc Line"].ID.getAll();
		//info fet_def2;
		row.Defects:ui.add(fet_def2);
		/* 	raw = List();
	rim =List();
	disc = List();
		fet_def3 = Defects_Master[QC_Department.QC_Department == "Raw Material" ].ID.getAll();

	fet_def4 = Defects_Master[QC_Department.QC_Department == "Rim Line" ].ID.getAll();
		fet_def5 = Defects_Master[QC_Department.QC_Department == "Disc Line" ].ID.getAll();

row.Defects:ui.add(fet_def3);
row.Defects:ui.add(fet_def4);
row.Defects:ui.add(fet_def5); */
	}
}
//-----------------------COLOUR Change Option-------------
// if(row.Defect_Type == "Rejected")
// {
// 	css = "<style>";
// 	//css = css + "#zc-BoM_Details_CWPL-S_No {background : red;}";
// 	//css = css + "#s2id_autogen39 {background : red;}";
// 	//                         css = css + "#zc-BoM_Details_CWPL-Level {background : #ff3333;}";
// 	//               
// 	css = css + "#zc-Specifications {background : #ff3333;}";
// 	css = css + ".zc-Specifications-S_No {background : #ff3333;}";
// 	css = css + ".zc-Specifications-From_Time {background : #ff3333;}";
// 	css = css + ".zc-Specifications-To_Time {background : #ff3333;}";
// 	css = css + ".zc-Specifications-Defect_Type {background : #ff3333;}";
// 	css = css + ".zc-Specifications-Actual_Qty {background : #ff3333;}";
// 	css = css + ".zc-Specifications-Defects {background : #ff3333;}";
// 	css = css + ".zc-Specifications-Department {background : #ff3333;}";
// 	css = css + ".zc-Specifications-Remarks {background : #ff3333;}";
// 	          css = css + ".zc-BoM_Details_CWPL-S_No {background : #ff3333;}";
// 	css = css + "</style>";
// 	input.plain2 = css;
// }
// else
// {
// 	css1 = "<style>";
// 	css1 = css1 + "#zc-Specifications {background : #ffffff;}";
// 	css1 = css1 + "</style>";
// 	input.plain2 = css1;
// }
content_copyCOPY