use of org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationActionBase method insertCapitalAssetInfo.
/**
* inserts capital asset information into capital assets list.
* Also recalculates the system control and system control remaining amounts.
* Puts a global error message if the user does not enter capital asset quantity.
* If the quantity is > 1, it will insert that many tag/location detail records for this
* capital asset item.
*
* @param mapping
* @param form
* @param request
* @param response
* @return action forward string
* @throws Exception
*/
public ActionForward insertCapitalAssetInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
LOG.debug("insertCapitalAssetInfo() - start");
KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase = (KualiAccountingDocumentFormBase) form;
List<CapitalAssetInformation> capitalAssetInformation = this.getCurrentCapitalAssetInformationObject(kualiAccountingDocumentFormBase);
if (capitalAssetInformation == null) {
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
int addIndex = getSelectedLine(request);
if (capitalAssetInformation.get(addIndex).getCapitalAssetQuantity() == null || capitalAssetInformation.get(addIndex).getCapitalAssetQuantity() <= 0) {
GlobalVariables.getMessageMap().putError(KFSConstants.EDIT_CAPITAL_ASSET_INFORMATION_ERRORS, KFSKeyConstants.ERROR_DOCUMENT_CAPITAL_ASSET_QUANTITY_REQUIRED);
} else {
this.addCapitalAssetInfoDetailLines(capitalAssetInformation.get(addIndex));
}
// now process the remaining capital asset records
processRemainingCapitalAssetInfo(form, capitalAssetInformation);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase in project cu-kfs by CU-CommunityApps.
the class CuPreEncumbranceAction method route.
@Override
public ActionForward route(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiAccountingDocumentFormBase tmpForm = (KualiAccountingDocumentFormBase) form;
String docNum = tmpForm.getDocId();
PreEncumbranceDocument preEncDoc = SpringContext.getBean(BusinessObjectService.class).findBySinglePrimaryKey(PreEncumbranceDocument.class, docNum);
if (preEncDoc == null) {
GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(dot + "Save", KFSKeyConstants.ERROR_CUSTOM, "This Document needs to be saved before Submit");
}
ActionForward forward = super.route(mapping, form, request, response);
checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getSourceAccountingLines());
checkSalesTaxRequiredAllLines(tmpForm, tmpForm.getFinancialDocument().getTargetAccountingLines());
return forward;
}
use of org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase in project cu-kfs by CU-CommunityApps.
the class CuPreEncumbranceActionTest method setUp.
@Before
public void setUp() {
preEncumbranceDocument = createMock(PreEncumbranceDocument.class);
preEncumbranceDocument.setSourceAccountingLines(new ArrayList());
kualiAccountingDocumentFormBase = createMock(KualiAccountingDocumentFormBase.class);
kualiAccountingDocumentFormBase.setTabStates(new HashMap<>());
kualiAccountingDocumentFormBase.setDocument(preEncumbranceDocument);
cuPreEncumbranceAction = new CuPreEncumbranceAction();
}
use of org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationActionBase method redistributeModifyCapitalAssetAmount.
/**
* redistributes the capital asset amount for the modify capital asset lines.
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
* @throws Exception
*/
public ActionForward redistributeModifyCapitalAssetAmount(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
LOG.debug("redistributeModifyCapitalAssetAmount() - start");
KualiDecimal remainingAmountToDistribute = KualiDecimal.ZERO;
CapitalAccountingLinesFormBase calfb = (CapitalAccountingLinesFormBase) form;
CapitalAccountingLinesDocumentBase caldb = (CapitalAccountingLinesDocumentBase) calfb.getFinancialDocument();
List<CapitalAccountingLines> selectedCapitalAccountingLines = new ArrayList<CapitalAccountingLines>();
String distributionCode = calfb.getCapitalAccountingLine().getDistributionCode();
remainingAmountToDistribute = getRemainingAmounToDistribute(selectedCapitalAccountingLines, form);
KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase = (KualiAccountingDocumentFormBase) form;
List<CapitalAssetInformation> capitalAssetInformation = this.getCurrentCapitalAssetInformationObject(kualiAccountingDocumentFormBase);
// run the process to redistribute the accounting line amount to the capital assets.
redistributeAmountsForAccountingsLineForModifyAssets(selectedCapitalAccountingLines, capitalAssetInformation, remainingAmountToDistribute);
redistributeIndividualAmountsForAccountingLinesForModifyAssets(selectedCapitalAccountingLines, capitalAssetInformation);
// now process any capital assets that has distribution set to "by amount"
redistributeAmountsForAccountingsLineForModifyAssetsByAmounts(selectedCapitalAccountingLines, capitalAssetInformation, remainingAmountToDistribute);
// adjust any variance from capital accounting lines to the distributed accounting lines amounts....
adjustCapitalAssetsAccountingLinesAmounts(selectedCapitalAccountingLines, capitalAssetInformation);
processRemainingCapitalAssetInfo(form, capitalAssetInformation);
// redistribute capital asset amount to its group accounting lines on refresh
DistributeCapitalAssetAmountToGroupAccountingLines((KualiAccountingDocumentFormBase) form);
checkCapitalAccountingLinesSelected(calfb);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
use of org.kuali.kfs.sys.web.struts.KualiAccountingDocumentFormBase in project cu-kfs by CU-CommunityApps.
the class CapitalAssetInformationActionBase method deleteCapitalAssetInfo.
/**
* deletes the capital asset information
*/
public ActionForward deleteCapitalAssetInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
LOG.debug("deleteCapitalAssetInfoDetail() - start");
KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase = (KualiAccountingDocumentFormBase) form;
List<CapitalAssetInformation> capitalAssetInformation = this.getCurrentCapitalAssetInformationObject(kualiAccountingDocumentFormBase);
if (capitalAssetInformation == null) {
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
int lineIndexForCapitalAssetInfo = this.getLineToDelete(request);
if (capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetInformationDetails() != null && capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetInformationDetails().size() > 0) {
capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetInformationDetails().clear();
}
if (capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetAccountsGroupDetails() != null && capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetAccountsGroupDetails().size() > 0) {
capitalAssetInformation.get(lineIndexForCapitalAssetInfo).getCapitalAssetAccountsGroupDetails().clear();
}
capitalAssetInformation.remove(lineIndexForCapitalAssetInfo);
// now process the remaining capital asset records
processRemainingCapitalAssetInfo(form, capitalAssetInformation);
return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
Aggregations