Exemplo n.º 1
0
        public void UpdateTotalSummary()
        {
            if (BillId != null && !BillId.Equals(Guid.Empty))
            {
                Bill bill = session.GetObjectByKey <Bill>(BillId);

                //use default TaxCalculationType
                //if (!bill.TaxCalculationType.Equals(Utility.Constant.CALCULATION_TYPE_ON_BILL_BY_PERCENTAGE))
                //{
                //    bill.TaxCalculationType = Utility.Constant.CALCULATION_TYPE_ON_BILL_BY_PERCENTAGE;
                //    bill.Save();
                //}

                //Update subtotal
                UpdateSubtotal(bill);
                //Update bill promotion
                UpdateBillPromotion();
                //Update bill tax
                UpdateBillTax(bill);
                //Update total
                UpdateTotal(bill);
                //Update paid
                UpdatePaid(bill);
                //Update owned
                UpdateOwned(bill);
            }
        }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = BillId.GetHashCode();
         hashCode = (hashCode * 397) ^ Price.GetHashCode();
         hashCode = (hashCode * 397) ^ DeliveryId.GetHashCode();
         hashCode = (hashCode * 397) ^ Weight;
         hashCode = (hashCode * 397) ^ (AddreeseeEmail != null ? AddreeseeEmail.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LocalitySandName != null ? LocalitySandName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LocalityGetName != null ? LocalityGetName.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        public bool PurchaseInvoiceCreating_CRUD()
        {
            //Create new temporary bill
            NAS.BO.Invoice.PurchaseInvoiceBO purchaseInvoiceBO = new NAS.BO.Invoice.PurchaseInvoiceBO();
            Bill bill = purchaseInvoiceBO.InitTemporary(session, BillType);

            BillId             = bill.BillId;
            hfBillId["BillId"] = BillId.ToString();
            formlayoutInvoiceEditingForm_LoadData();

            //Get default code
            ArtifactCodeRuleBO artifactCodeRuleBO = new ArtifactCodeRuleBO();

            txtCode.Text = artifactCodeRuleBO.GetArtifactCodeOfArtifactType(ArtifactTypeEnum.INVOICE_PURCHASE);

            SetControlsProperties();
            return(true);
        }
Exemplo n.º 4
0
        protected void panelInvoiceEditingForm_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e)
        {
            string[]          args              = e.Parameter.Split('|');
            string            command           = args[0];
            PurchaseInvoiceBO purchaseInvoiceBO = new PurchaseInvoiceBO();
            Bill bill = null;

            switch (command)
            {
            case "Create":
                GUIContext.State = new PurchaseInvoiceCreating(this);

                billDetails.InitState();
                break;

            case "Edit":
                if (args.Length < 2)
                {
                    throw new Exception("Invalid parameters");
                }
                BillId = Guid.Parse(args[1]);
                //Determine bill status
                hfBillId["BillId"] = BillId.ToString();
                bill = purchaseInvoiceBO.GetBillById(session, BillId);
                if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY))
                {
                    GUIContext.State = new PurchaseInvoiceLocked(this);
                }
                else
                {
                    GUIContext.State = new PurchaseInvoiceEditing(this);
                }

                billDetails.InitState();
                break;

            case "Save":
                GUIContext.Request(command, this);

                bill = purchaseInvoiceBO.GetBillById(session, BillId);
                if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY))
                {
                    GUIContext.State = new PurchaseInvoiceLocked(this);
                }
                break;

            case "Cancel":
                GUIContext.Request(command, this);
                panelInvoiceEditingForm.JSProperties["cpEvent"] = "Closing";
                break;

            case "Refresh":
                bill = purchaseInvoiceBO.GetBillById(session, BillId);
                if (bill.RowStatus.Equals(Utility.Constant.ROWSTATUS_BOOKED_ENTRY))
                {
                    GUIContext.State = new PurchaseInvoiceLocked(this);
                }
                else
                {
                    GUIContext.State = new PurchaseInvoiceEditing(this);
                }
                break;

            default:
                break;
            }

            uEdittingInputInventoryCommand1.SettingInit <NAS.DAL.Invoice.PurchaseInvoice>(BillId, ButtonCreateInventoryCommand);
        }
Exemplo n.º 5
0
 public override string ToString()
 {
     return(BillId.ToString());
 }