/// <summary> /// Create Payment for Import /// </summary> /// <param name="ibs">import bank statement</param> /// <returns></returns> private String CreatePayment(X_I_BankStatement ibs) { if (ibs == null || ibs.GetC_Payment_ID() != 0) { return("--"); } log.Fine(ibs.ToString()); if (ibs.GetC_Invoice_ID() == 0 && ibs.GetC_BPartner_ID() == 0) { throw new Exception("@NotFound@ @C_Invoice_ID@ / @C_BPartner_ID@"); } if (ibs.GetC_BankAccount_ID() == 0) { throw new Exception("@NotFound@ @C_BankAccount_ID@"); } // MPayment payment = CreatePayment(ibs.GetC_Invoice_ID(), ibs.GetC_BPartner_ID(), ibs.GetC_Currency_ID(), ibs.GetStmtAmt(), ibs.GetTrxAmt(), ibs.GetC_BankAccount_ID(), Utility.Util.GetValueOfDateTime(ibs.GetStatementLineDate() == null ? ibs.GetStatementDate() : ibs.GetStatementLineDate()), Utility.Util.GetValueOfDateTime(ibs.GetDateAcct()), ibs.GetDescription(), ibs.GetAD_Org_ID(), 0, 0); //Used Zero's as parameters to Avoid throw Error if (payment == null) { throw new SystemException("Could not create Payment"); } ibs.SetC_Payment_ID(payment.GetC_Payment_ID()); ibs.SetC_Currency_ID(payment.GetC_Currency_ID()); ibs.SetTrxAmt(payment.GetPayAmt()); ibs.Save(); // String retString = "@C_Payment_ID@ = " + payment.GetDocumentNo(); if (Env.Signum(payment.GetOverUnderAmt()) != 0) { retString += " - @OverUnderAmt@=" + payment.GetOverUnderAmt(); } return(retString); }