private static void changeQtyToConfirmedAmount(ITable table, RejectionsSapLineProperty rejection, int sapLineNumber) { if (table.getCellValue(sapLineNumber, "Un") == "MUN") { table.setCellValue(sapLineNumber, "Un", "MCS"); table.setCellValue(sapLineNumber, "Order Quantity", rejection.confirmedQty); table.setCellValue(sapLineNumber, "Un", "MUN"); } else { table.setCellValue(sapLineNumber, "Order Quantity", rejection.confirmedQty); } }
private static bool isForChange(ITable table, RejectionsSapLineProperty rejection, int sapLineNumber) { if (!(table.getCell(sapLineNumber, VA02.rejectionCodeColumnIndex) as dynamic).Changeable) { rejection.reason = "RRC is not changeable."; return(false); } if (int.Parse(table.getCellValue(sapLineNumber, "Material")) != rejection.sku) { rejection.reason = "RRC cannot be applied as the sku was changed."; return(false); } return(true); }
private void endLog(RejectionsSapOrderProperty rejObj, string id, string tableName, RejectionsSapLineProperty rejection, bool shouldChange, bool isRelease) { log.update( tableName: tableName, columnNames: new[] { "status", "reason" }, values: new[] { shouldChange ? "success" : "fail", rejection.reason.Replace("'", "") }, conditionName: isRelease ? new[] { "[orderNumber]", "[id]", "[isDuringRelease]" } : new[] { "[orderNumber]", "[isDuringRelease]" }, conditionValue: isRelease ? new[] { rejObj.orderNumber.ToString(), id, "1" } : new[] { rejObj.orderNumber.ToString(), "0" }, customCondition: isRelease ? "" : "([status] IS NULL OR [status] = 'Fail: blocked by batch job' OR [status] = 'Fail: blocked by user')" ); }
private static ReplacePartialCutProperty getRPCProperty(string tableUnitsOfMeasure, RejectionsSapLineProperty rejection) { return(new ReplacePartialCutProperty() { sku = rejection.sku, unitsOfMeasure = tableUnitsOfMeasure, rejCode = rejection.rejectionCode, cutQty = (rejection.orderedQty - rejection.confirmedQty) }); }