Exemple #1
0
        public static decimal GetPaidValuesForFactureExtend(Facture f)
        {
            List <PolicyItemFactureItem> lst = PolicyItemFactureItem.GetByFactureID(f.ID);
            decimal totalPaidValue           = 0;

            foreach (PolicyItemFactureItem pifi in lst)
            {
                decimal paidValue = Payment.GetPaidValueForPolicyItemExtend(pifi.PolicyItemID);
                totalPaidValue += paidValue;
            }
            return(totalPaidValue);
        }
Exemple #2
0
        public static void DiscardFacture(int id)
        {
            Facture f = Get(id);

            f.Discard = true;
            Facture.Table.Context.SubmitChanges();
            IEnumerable <FacturePayment> fpIenum = FacturePayment.GetByFacture(id);

            foreach (FacturePayment fp in fpIenum)
            {
                Payment p = Payment.Get(fp.PaymentID);
                p.IsFactured = false;
                Payment.Table.Context.SubmitChanges();
            }
            List <PolicyItemFactureItem> lstPIFI = PolicyItemFactureItem.GetByFactureID(id);

            foreach (PolicyItemFactureItem pifi in lstPIFI)
            {
                PolicyItem pi = PolicyItem.Get(pifi.PolicyItemID);
                pi.IsFactureCreated = false;
                PolicyItem.Table.Context.SubmitChanges();
            }
        }