Example #1
0
        /**
         *  Create Line Reversal
         *	@return new reversed CashLine
         */
        public MCashLine CreateReversal()
        {
            MCash parent = GetParent();

            if (parent.IsProcessed())
            {   //	saved
                parent = MCash.Get(GetCtx(), parent.GetAD_Org_ID(),
                                   parent.GetStatementDate(), parent.GetC_Currency_ID(), Get_TrxName());
            }
            //
            MCashLine reversal = new MCashLine(parent);

            reversal.SetClientOrg(this);
            reversal.SetC_BankAccount_ID(GetC_BankAccount_ID());
            reversal.SetC_Charge_ID(GetC_Charge_ID());
            reversal.SetC_Currency_ID(GetC_Currency_ID());
            reversal.SetC_Invoice_ID(GetC_Invoice_ID());
            reversal.SetCashType(GetCashType());
            reversal.SetDescription(GetDescription());
            reversal.SetIsGenerated(true);
            //
            reversal.SetAmount(Decimal.Negate(GetAmount()));
            //if (GetDiscountAmt() == null)
            ////    SetDiscountAmt(Env.ZERO);
            //else
            reversal.SetDiscountAmt(Decimal.Negate(GetDiscountAmt()));
            //if (GetWriteOffAmt() == null)
            //    SetWriteOffAmt(Env.ZERO);
            //else
            reversal.SetWriteOffAmt(Decimal.Negate(GetWriteOffAmt()));
            reversal.AddDescription("(" + GetLine() + ")");
            return(reversal);
        }
Example #2
0
        //Get Cash Journal Detail Added by Bharat 16/12/2016
        public Dictionary <string, string> GetCashJournal(Ctx ctx, string fields)
        {
            string[] paramValue = fields.Split(',');
            //Assign parameter value
            int C_CashJournal_ID = Util.GetValueOfInt(paramValue[0].ToString());
            //End Assign parameter value
            MCash cash = new MCash(ctx, C_CashJournal_ID, null);
            Dictionary <string, string> result = new Dictionary <string, string>();

            result["C_Currency_ID"] = cash.GetC_Currency_ID().ToString();
            result["DateAcct"]      = cash.GetDateAcct().ToString();
            return(result);
        }