/// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (AdditionalData != null)
         {
             hashCode = hashCode * 59 + AdditionalData.GetHashCode();
         }
         if (InvoiceDate != null)
         {
             hashCode = hashCode * 59 + InvoiceDate.GetHashCode();
         }
         if (InvoiceNumber != null)
         {
             hashCode = hashCode * 59 + InvoiceNumber.GetHashCode();
         }
         if (TextQualifiers != null)
         {
             hashCode = hashCode * 59 + TextQualifiers.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        public IActionResult AddOrder([FromBody] OrderDto orderDto)
        {
            try
            {
                Customer customer = _unitOfWork.Customers.Get(orderDto.CustomerId);

                if (customer == null)
                {
                    return(NotFound("Customer Not Found"));
                }

                Result <InvoiceNo>   invoiceNoOrError   = InvoiceNo.Create(orderDto.InvoiceNo);
                Result <InvoiceDate> invoiceDateOrError = InvoiceDate.Create(orderDto.InvoiceDate);
                Result <ReferenceNo> referenceNoOrError = ReferenceNo.Create(orderDto.ReferenceNo);

                Result result = Result.Combine(invoiceNoOrError, invoiceDateOrError, referenceNoOrError);
                if (result.IsFailure)
                {
                    return(BadRequest(result.Error));
                }

                var order = new Order(invoiceNoOrError.Value, invoiceDateOrError.Value, referenceNoOrError.Value, orderDto.Note, customer);

                _unitOfWork.Orders.Add(order);
                _unitOfWork.Complete();

                return(Ok());
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
        /// <summary>
        /// Returns true if OrderInvoiceData instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderInvoiceData to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderInvoiceData other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AdditionalData == other.AdditionalData ||
                     AdditionalData != null &&
                     AdditionalData.Equals(other.AdditionalData)
                     ) &&
                 (
                     InvoiceDate == other.InvoiceDate ||
                     InvoiceDate != null &&
                     InvoiceDate.Equals(other.InvoiceDate)
                 ) &&
                 (
                     InvoiceNumber == other.InvoiceNumber ||
                     InvoiceNumber != null &&
                     InvoiceNumber.Equals(other.InvoiceNumber)
                 ) &&
                 (
                     TextQualifiers == other.TextQualifiers ||
                     TextQualifiers != null &&
                     TextQualifiers.SequenceEqual(other.TextQualifiers)
                 ));
        }
Beispiel #4
0
 partial void InvoiceDate_Changed()
 {
     InvoiceDue = InvoiceDate.AddDays(30);
     // If the ShipDate is earlier than the new InvoiceDate, update it
     if (ShipDate < InvoiceDate)
     {
         ShipDate = InvoiceDate.AddDays(2);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Function called to search the model
 /// for availability of the specified string.
 /// </summary>
 /// <param name="str">The search string</param>
 /// <returns>True, if the string is contained in the model, else false</returns>
 public override bool Contains(string str)
 {
     return((InvoiceDate != null && InvoiceDate.ToShortDateString().Contains(str)) ||
            (RenewalStartDate != null && RenewalStartDate.Value.ToShortDateString().Contains(str)) ||
            (RenewalEndDate != null && RenewalEndDate.Value.ToShortDateString().Contains(str)) ||
            (ActualBillDate != null && ActualBillDate.Value.ToShortDateString().Contains(str)) ||
            (Amount != 0 && Amount.ToString().StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (UpliftForMilestone != 0 && UpliftForMilestone.ToString().StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (MilestoneStatusDescription != null && MilestoneStatusDescription.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)));
 }
Beispiel #6
0
 /// <summary>
 /// Function called to search the model for availability of the specified string.
 /// </summary>
 /// <param name="str">The search string</param>
 /// <returns>True, if the string is contained in the model, else false</returns>
 public override bool Contains(string str)
 {
     return((ContractNumber != null && ContractNumber.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (InvoiceCustomer != null && InvoiceCustomer.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (CompanyName != null && CompanyName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (DivisionName != null && DivisionName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (ActivityName != null && ActivityName.StartsWith(str, StringComparison.CurrentCultureIgnoreCase)) ||
            (!string.IsNullOrEmpty(Convert.ToString(InvoiceDate)) && InvoiceDate.ToString(Constants.DATE_FORMAT).Contains(str)) ||
            (!string.IsNullOrEmpty(Convert.ToString(Amount)) && Convert.ToString(Amount).StartsWith(str, StringComparison.CurrentCultureIgnoreCase)));
 }
        internal void Populate_InspHireInvoice(Dictionary <string, string> invoice)
        {
            DateTime tmpDateTime;
            Decimal  tmpDecimal;
            double   tmpDouble;

            InvoiceAccount = invoice["ACCT"];
            AccountName    = invoice["ACCTNAME"];

            InvoiceId = invoice["INVNO"];
            if (!string.IsNullOrEmpty(InvoiceId) && InvoiceId.IndexOf(".") != -1)
            {
                InvoiceId = InvoiceId.Substring(0, InvoiceId.IndexOf("."));
            }

            if (DateTime.TryParse(invoice["DATE"], out tmpDateTime))
            {
                InvoiceDate = tmpDateTime;
            }

            // invoice["SETTDAYS"] ??
            if (Double.TryParse(invoice["SETTDAYS"], out tmpDouble))
            {
                DueDate = InvoiceDate.AddDays(tmpDouble);
            }

            if (DueDate < DateTime.Now)
            {
                DaysOverdue = (DateTime.Now - DueDate).Days;
            }

            //SalesBalanceMST ?? I dont think this is used sitewide

            if (Decimal.TryParse(invoice["VAT"], out tmpDecimal))
            {
                SumTaxMST = tmpDecimal;
            }
            if (Decimal.TryParse(invoice["GOODS"], out tmpDecimal))
            {
                InvoiceAmountMST = tmpDecimal;
            }

            if (Decimal.TryParse(invoice["AMTPAID"], out tmpDecimal))
            {
                AMTPAID = (int)tmpDecimal;
            }
            IsPaid = AMTPAID == InvoiceAmountMST;

            SalesType = invoice["INVTYPE"];

            ContactPersonId = SPCODE = invoice["SPCODE"];
            SalesId         = CONTNO = invoice["CONTNO"];
        }
Beispiel #8
0
 private void Cancel_Click(object sender, RoutedEventArgs e)
 {
     CustName.Clear();
     InvoiceNo.Clear();
     OrderNo.Clear();
     InvoiceDate.Clear();
     DueDate.Clear();
     SubTotal.Clear();
     Adjustment.Clear();
     Total.Clear();
     CustNotes.Clear();
     TermAndCondns.Clear();
 }
Beispiel #9
0
        /// <summary>
        /// Override for the ToString method that outputs the invoice data in a more readable format.
        /// </summary>
        /// <returns>Outputs invoice data in the format ID: [invoice number] | Date: [invoice date] | Cost: [total cost]</returns>
        public override string ToString()
        {
            try
            {
                return("ID: " + InvoiceNumber + " | Date: " + InvoiceDate.ToShortDateString() + " | Cost: " + Formatting.FormatCurrency(TotalCost));
            }

            catch (Exception ex)
            {
                throw new Exception(MethodInfo.GetCurrentMethod().DeclaringType.Name + "."
                                    + MethodInfo.GetCurrentMethod().Name + " -> " + ex.Message);
            }
        }
        public override string ToString()
        {
            string output = "\r\n";

            foreach (var i in InvoiceItems)
            {
                output += $"  { i.ItemName } ({ i.Description }) - R{ i.Total.ToString("#,#", CultureInfo.InvariantCulture) }\r\n";
            }
            return($"Invoice Number: { InvoiceNumber }\r\n" +
                   $"Invoice Date: { InvoiceDate.ToString("d") }\r\n" +
                   $"Due Date: { DueDate.ToString("d") }\r\n" +
                   $"Invoice Items: { output }\r\n" +
                   $"Invoice Total: R{ InvoiceTotal.ToString("#,#", CultureInfo.InvariantCulture) }\r\n");
        }
Beispiel #11
0
        public StartRecord()
        {
            // Set default values.
            StandardVersion    = 4;
            StandardSubversion = 2;
            MessageCode        = 117;

            // Make this a test message by default.
            Type = MessageType.Test;

            InvoiceId    = string.Empty;
            CurrencyCode = "EUR";

            // Define the fields for this record.
            MapField(2, 3, "Code").Numeric().Getter(x => MessageCode.ToString("000"));
            MapField(5, 2, "Versienummer berichtstandaard").Numeric().Getter(x => StandardVersion.ToString());
            MapField(7, 2, "Subversienummer berichtstandaard").Numeric().Getter(x => StandardSubversion.ToString());
            MapField(9, 1, "Soortbericht").Numeric().Getter(x =>
            {
                switch (Type)
                {
                case MessageType.Production:
                    return("P");

                case MessageType.Test:
                    return("T");

                default:
                    throw new InvalidOperationException("Message type is not specified.");
                }
            });

            MapField(10, 6, "Code informatiesysteem softwareleverancier").Numeric();

            MapField(26, 4, "UZOVI-nummer").Numeric().Getter(x => UzoviId.ToString());
            MapField(30, 8, "Code servicebureau").Numeric();
            MapField(38, 8, "Zorgverlenerscode").Numeric().Getter(x => CareProviderAgbId.ToString());
            MapField(46, 8, "Praktijkcode").Numeric();
            MapField(54, 8, "Instellingcode").Numeric();

            MapField(62, 2, "Identificatiecode betaling aan").Numeric().Getter(x => PaymentRecipientCode.ToString("D"));
            MapField(64, 8, "Begindatum declaratieperiode").Numeric().Getter(x => StartDate.ToString("yyyyMMdd"));
            MapField(72, 8, "Einddatum declaratieperiode").Numeric().Getter(x => EndDate.ToString("yyyyMMdd"));

            MapField(80, 12, "Factuurnummer declarant").Alphanumeric().Getter(x => InvoiceId);
            MapField(92, 8, "Dagtekening factuur").Numeric().Getter(x => InvoiceDate.ToString("yyyyMMdd"));

            MapField(114, 3, "Valutacode").Alphanumeric().Getter(x => CurrencyCode);
        }
Beispiel #12
0
        public string ToJSONString()
        {
            string dateFormat   = "dd-MMM-yyyy";
            string amountFormat = "00.00";

            return(string.Format("$!$\r\n \"invoiceType\": \"{0}\",\r\n \"supplierNumber\": \"{1}\",\r\n \"supplierSiteNumber\": \"{2}\",\r\n \"invoiceDate\": \"{3}\",\r\n \"invoiceNumber\": \"{4}\",\r\n \"invoiceAmount\": {5},\r\n \"payGroup\": \"{6}\",\r\n \"dateInvoiceReceived\": \"{7}\",\r\n \"dateGoodsReceived\": \"{8}\",\r\n \"remittanceCode\": \"{9}\",\r\n \"specialHandling\": \"{10}\",\r\n \"nameLine1\": \"{11}\",\r\n \"nameLine2\": \"{12}\",\r\n \"addressLine1\": \"{13}\",\r\n \"addressLine2\": \"{14}\",\r\n \"addressLine3\": \"{15}\",\r\n \"city\": \"{16}\",\r\n \"country\": \"{17}\",\r\n \"province\": \"{18}\",\r\n \"postalCode\": \"{19}\",\r\n \"qualifiedReceiver\": \"{20}\",\r\n \"terms\": \"{21}\",\r\n \"payAloneFlag\": \"{22}\",\r\n \"paymentAdviceComments\": \"{23}\",\r\n \"remittanceMessage1\": \"{24}\",\r\n \"remittanceMessage2\": \"{25}\",\r\n \"remittanceMessage3\": \"{26}\",\r\n \"glDate\": \"{27}\",\r\n \"invoiceBatchName\": \"{28}\",\r\n \"currencyCode\": \"{29}\",\r\n \"invoiceLineDetails\": [$!$\r\n   \"invoiceLineNumber\": {30},\r\n   \"invoiceLineType\": \"{31}\",\r\n   \"lineCode\": \"{32}\",\r\n   \"invoiceLineAmount\": {33},\r\n   \"defaultDistributionAccount\": \"{34}\",\r\n   \"description\": \"{35}\",\r\n   \"taxClassificationCode\": \"{36}\",\r\n   \"distributionSupplier\": \"{37}\",\r\n   \"info1\": \"{38}\",\r\n   \"info2\": \"{39}\",\r\n   \"info3\": \"{40}\"\r\n   $&$]\r\n$&$",
                                 InvoiceType,
                                 SupplierNumber,
                                 SupplierSiteNumber.ToString("000"),
                                 InvoiceDate.ToLocalTime().ToString(dateFormat),
                                 InvoiceNumber,
                                 InvoiceAmount.ToString(amountFormat),
                                 PayGroup,
                                 DateInvoiceReceived.ToLocalTime().ToString(dateFormat),
                                 DateGoodsReceived.HasValue ? DateGoodsReceived.Value.ToLocalTime().ToString(dateFormat) : "",
                                 RemittanceCode,
                                 (SpecialHandling ? "D" : "N"),
                                 NameLine1,
                                 NameLine2,
                                 AddressLine1,
                                 AddressLine2,
                                 AddressLine3,
                                 City,
                                 Country,
                                 Province,
                                 PostalCode = !string.IsNullOrEmpty(PostalCode) ? PostalCode.Replace(" ", ""): string.Empty,
                                 QualifiedReceiver,
                                 Terms,
                                 PayAloneFlag,
                                 PaymentAdviceComments,
                                 RemittanceMessage1,
                                 RemittanceMessage2,
                                 RemittanceMessage3,
                                 GLDate.HasValue ? GLDate.Value.ToLocalTime().ToString(dateFormat) : "",
                                 InvoiceBatchName,
                                 CurrencyCode,
                                 InvoiceLineNumber,
                                 InvoiceLineType,
                                 LineCode,
                                 InvoiceLineAmount.ToString(amountFormat),
                                 DefaultDistributionAccount,
                                 Description,
                                 TaxClassificationCode,
                                 DistributionSupplier,
                                 Info1,
                                 Info2,
                                 Info3
                                 ).Replace("$!$", "{").Replace("$&$", "}"));
        }
Beispiel #13
0
 public bool SerializeToPRM(string prm_path)
 {
     using (st = System.IO.File.OpenWrite(prm_path))
     {
         WriteToPRM("DocType", DocType);
         WriteToPRM("Sender", Sender);
         WriteToPRM("Receiver", Receiver);
         //WriteToPRM("MsgDateTime", MsgDateTime.ToShortDateString());
         WriteToPRM("MsgDate", MsgDate);
         WriteToPRM("MsgTime", MsgTime);
         WriteToPRM("InvoiceType", InvoiceType);
         WriteToPRM("InvoiceNumber", InvoiceNumber);
         WriteToPRM("SupplierName", SupplierName);
         WriteToPRM("DiscountAmount", DiscountAmount);
         WriteToPRM("CompanyCode", CompanyCode.ToString());
         WriteToPRM("InvoiceDate", InvoiceDate.ToShortDateString());
         WriteToPRM("ExchangeRate", ExchangeRate.ToString());
         WriteToPRM("Currentcy", Currentcy);
         WriteToPRM("TaxInvoice", TaxInvoice);
         WriteToPRM("DocumentInvoiceType", DocumentInvoiceType);
         WriteToPRM("SupplierPrivateCompanyCode", SupplierPrivateCompanyCode);
         WriteToPRM("RetailerPrivateCompanyCode", RetailerPrivateCompanyCode);
         WriteToPRM("CurrencyDocumentSum", CurrencyDocumentSum.ToString());
         WriteToPRM("DocumentSum", DocumentSum.ToString());
         WriteToPRM("TaxSum", TaxSum.ToString());
         WriteToPRM("TaxSumNIS", TaxSumNIS.ToString());
         WriteToPRM("CurrencyRate", CurrencyRate.ToString());
         WriteToPRM("TaxRate", TaxRate);
         WriteToPRM("CompanyName", CompanyName);
         WriteToPRM("Address", Address);
         WriteToPRM("City", City);
         WriteToPRM("State", State);
         WriteToPRM("Country", Country);
         WriteToPRM("POB", POB);
         WriteToPRM("Zipcode", Zipcode);
         WriteToPRM("Bank", Bank);
         WriteToPRM("Account", Account);
         WriteToPRM("Details", Details);
         WriteToPRM("TotalLines", TotalLines.ToString());
         foreach (InvoiceLine line in Lines)
         {
             WriteToPRM(line);
         }
     }
     return(true);
 }
Beispiel #14
0
 //TOSTRING (with delimitter)
 public string ToString(string delim)
 {
     return(RecordType + delim +
            VendorCode + delim +
            LocationCode + delim +
            PurchaseOrderNo + delim +
            ((Object)ExpectedDeliveryDate ?? " ") + delim +
            VendorInvoiceNo + delim +
            InvoiceDate.ToString("MM'/'dd'/'yyyy") + delim +      //11/16/2016   (forces the "/" separator)
            InvoiceTotal.ToString("0.00") + delim +               //format (two decimal places)
            (TaxGlDescription ?? " ") + delim +
            ((Object)TaxValue ?? " ") + delim +
            (FreightShippingGlDescription ?? " ") + delim +
            ((Object)FreightShippingValue ?? " ") + delim +
            Misc1GlDescription + delim +
            Misc1Value.ToString("0.00"));
 }
        public List <Invoice> GetAllInvoice()
        {
            var            invoiceObj  = new InvoiceModel();
            List <Invoice> invoiceList = new List <Invoice>();
            var            result      = invoiceObj.GetAllInvoice();

            if (result != null && result.Count > 0)
            {
                if (!string.IsNullOrEmpty(this.InvoiceDate))
                {
                    string[] daterange = InvoiceDate.Split('|');
                    result = result.Where(m => m.InvoiceDate >= Convert.ToDateTime(daterange[0]) && m.InvoiceDate <= Convert.ToDateTime(daterange[1])).ToList();
                }
                if (result != null && result.Count > 0)
                {
                    invoiceList = result.Select(m => new Invoice
                    {
                        InvoiceID            = m.InvoiceID,
                        InvoiceDate          = Convert.ToString(m.InvoiceDate),
                        PO_No                = m.PO_No,
                        TransportationMode   = m.TransportationMode,
                        Veh_No               = m.Veh_No,
                        LR_No                = m.LR_No,
                        LR_Date              = Convert.ToString(m.LR_Date),
                        DateTimeSupply       = Convert.ToString(m.DateTimeSupply),
                        CustomerName         = m.CustomerName,
                        GST_No               = m.GST_No,
                        PAN_No               = m.PAN_No,
                        CompanyAddress       = m.CompanyAddress,
                        ShippingAddress      = m.ShippingAddress,
                        Total_Nos_Kg         = m.Total_Nos_Kg,
                        Total_Nos_Bag        = m.Total_Nos_Bag,
                        TotalAmountBeforeTax = m.TotalAmountBeforeTax,
                        Total_CGST           = m.Total_CGST,
                        Total_SGST           = m.Total_SGST,
                        Total_IGST           = m.Total_IGST,
                        Total_GST            = m.Total_GST,
                        TotalAmountAfterTax  = m.TotalAmountAfterTax,
                        TotalAfterRoundOff   = m.TotalAfterRoundOff
                    }).ToList();
                }
            }
            return(invoiceList);
        }
Beispiel #16
0
        public virtual int _GetUniqueIdentifier()
        {
            var hashCode = 399326290;

            hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (DeliveryDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderQuantity?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (OrderDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvoiceId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InvoiceDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FundedRate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (InterestRate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (TotalValue?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (FundingValue?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PaymentId?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (PayementDate?.GetHashCode() ?? 0);
            hashCode = hashCode * -1521134295 + (CreditNoteNumber?.GetHashCode() ?? 0);
            return(hashCode);
        }
Beispiel #17
0
        public IActionResult PutOrder(long id, OrderDto orderDto)
        {
            try
            {
                if (id != orderDto.Id)
                {
                    return(BadRequest());
                }

                Order order = _unitOfWork.Orders.Get(id);
                if (order == null)
                {
                    return(NotFound("Order Not Found"));
                }

                Customer customer = _unitOfWork.Customers.Get(orderDto.CustomerId);

                if (customer == null)
                {
                    return(NotFound("Customer Not Found"));
                }

                Result <InvoiceDate> invoiceDateOrError = InvoiceDate.Create(orderDto.InvoiceDate);
                Result <ReferenceNo> referenceNoOrError = ReferenceNo.Create(orderDto.ReferenceNo);

                Result result = Result.Combine(invoiceDateOrError, referenceNoOrError);
                if (result.IsFailure)
                {
                    return(BadRequest(result.Error));
                }

                order.UpdateOrder(invoiceDateOrError.Value, referenceNoOrError.Value, orderDto.Note, customer);

                _unitOfWork.Complete();

                return(Ok());
            }
            catch (Exception e)
            {
                return(StatusCode(500, new { error = e.Message }));
            }
        }
Beispiel #18
0
        public async Task <IActionResult> SearchInvoice(InvoiceDate invoiceDate)
        {
            try
            {
                var result = await _repository.GetInvoice(invoiceDate.date);

                return(Json(new
                {
                    Status = true,
                    Invoice = result,
                }));
            }
            catch (Exception ex)
            {
                return(Json(new
                {
                    Status = false,
                    Message = ex.InnerException.Message.ToString()
                }));
            }
        }
Beispiel #19
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (InvoiceId != null ? InvoiceId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ InvoiceNumber;
         hashCode = (hashCode * 397) ^ (InvoiceNumberAsString != null ? InvoiceNumberAsString.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Total.GetHashCode();
         hashCode = (hashCode * 397) ^ Subtotal.GetHashCode();
         hashCode = (hashCode * 397) ^ Tax.GetHashCode();
         hashCode = (hashCode * 397) ^ TaxPercentage.GetHashCode();
         hashCode = (hashCode * 397) ^ InvoiceDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (ContractName != null ? ContractName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PeriodStartDate.GetHashCode();
         hashCode = (hashCode * 397) ^ PeriodEndDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (Currency != null ? Currency.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (From != null ? From.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LineItems?.Sum(x => x.GetHashCode()) ?? 0);
         return(hashCode);
     }
 }
Beispiel #20
0
        public override int GetHashCode()
        {
            var hashCode = -133760364;

            hashCode = hashCode * -1521134295 + base.GetHashCode();
            hashCode = hashCode * -1521134295 + CreationDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CreatedBy);

            hashCode = hashCode * -1521134295 + ModificationDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ModifiedBy);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(IctsReference);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Tag);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Serial);

            hashCode = hashCode * -1521134295 + EqualityComparer <ProductDto> .Default.GetHashCode(Product);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description);

            hashCode = hashCode * -1521134295 + InvoiceDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(InvoiceNumber);

            hashCode = hashCode * -1521134295 + Price.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PaidBy);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Owner);

            hashCode = hashCode * -1521134295 + InstallDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(InstalledBy);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Remark);

            hashCode = hashCode * -1521134295 + TeamAsset.GetHashCode();

            return(hashCode);
        }
Beispiel #21
0
        //TOSTRING OVERRIDE
        public override string ToString()
        {
            return(RecordType + "\t" +
                   VendorCode + "\t" +
                   LocationCode + "\t" +
                   PurchaseOrderNo + "\t" +
                   ((Object)ExpectedDeliveryDate ?? " ") + "\t" +
                   VendorInvoiceNo + "\t" +
                   InvoiceDate.ToString("MM'/'dd'/'yyyy") + "\t" +      //11/16/2016    (forces the "/" separator)
                   InvoiceTotal.ToString("0.00") + "\t" +               //format (two decimal places)

                   (TaxGlDescription ?? " ") + "\t" +
                   //(handle NULL value and converting (double? to double) in the correct format)
                   MyDoubleToString(TaxValue) + "\t" +
                   //((Object)TaxValue ?? " ") + "\t" +

                   (FreightShippingGlDescription ?? " ") + "\t" +
                   //(handle NULL value and converting (double? to double) in the correct format)
                   MyDoubleToString(FreightShippingValue) + "\t" +
                   //((Object)FreightShippingValue ?? " ") + "\t" +

                   Misc1GlDescription + "\t" +
                   Misc1Value.ToString("0.00"));
        }
        public void Configure(EntityTypeBuilder <Order> orderConfiguration)
        {
            orderConfiguration.Property(b => b.Id).HasColumnName("OrderID");

            orderConfiguration.Property(b => b.InvoiceNo).HasConversion(p => p.Value, p => InvoiceNo.Create(p).Value).IsRequired().HasMaxLength(10);
            orderConfiguration.Property(b => b.InvoiceDate).HasConversion(p => p.Value, p => InvoiceDate.Create(p).Value).IsRequired();
            orderConfiguration.Property(b => b.ReferenceNo).HasConversion(p => p.Value, p => ReferenceNo.Create(p).Value).IsRequired().HasMaxLength(10);

            orderConfiguration.HasOne(s => s.Customer).WithMany().IsRequired();
            orderConfiguration.HasMany(s => s.OrderLines).WithOne(e => e.Order);
        }
 public override string ToString() => $"D,{InvoiceNumber?.Trim().EscapeCSV()},{InvoiceDate?.Trim()},{NetAmount.Trim()},{PONumber?.Trim().EscapeCSV()},{Description?.Trim().EscapeCSV()}";
Beispiel #24
0
 /// <summary>
 /// prints the invoice on console
 /// </summary>
 public void DisplayInvoice()
 {
     Console.WriteLine($"\nINVOICE NO: INV-{InvoiceRef}" + "\t\t\tDATE: " + InvoiceDate.DayOfWeek.ToString() + InvoiceDate.ToShortDateString());
     Console.WriteLine("FROM: " + From + "\t\tDUE: " + DueDate.DayOfWeek.ToString() + " " + DueDate.Date.ToShortDateString());
     Console.WriteLine("CLIENT: " + Client.Name);
     Console.WriteLine("CONTACT: " + Client.Contact);
     Console.WriteLine("ADDRESS: " + Client.Address);
     Console.WriteLine("=================================================================================");
     Console.WriteLine($"{"SERVICES",-10}\t|\t" + $"HOURS\t|\t" + $"RATE PER HOUR\t|\t" + $"Amount");
     Console.WriteLine("=================================================================================");
     foreach (var item in invoiceItems)
     {
         item.PrintItem();
     }
     Console.WriteLine("---------------------------------------------------------------------------------");
     Console.WriteLine($"\t\t\t\t\t\t   TOTAL:       R{TotalAmount:0.00} \n" +
                       $"---------------------------------------------------------------------------------");
 }
Beispiel #25
0
        private bool Equals(IInvoice other)
        {
            if (!(InvoiceId == other.InvoiceId && InvoiceNumber == other.InvoiceNumber && InvoiceNumberAsString == other.InvoiceNumberAsString && Total.Equals(other.Total) &&
                  Subtotal.Equals(other.Subtotal) && Nullable.Equals(Tax, other.Tax) && Nullable.Equals(TaxPercentage, other.TaxPercentage) && InvoiceDate.Equals(other.InvoiceDate) &&
                  ContractName == other.ContractName && PeriodStartDate.Equals(other.PeriodStartDate) && PeriodEndDate.Equals(other.PeriodEndDate) && Currency == other.Currency &&
                  Equals(From, other.From) && Equals(To, other.To)))
            {
                return(false);
            }

            if (LineItems is null && other.LineItems is null)
            {
                return(true);
            }
            if (LineItems is null || other.LineItems is null)
            {
                return(false);
            }
            return(LineItems.OrderBy(x => x.LineIdx).SequenceEqual(other.LineItems.OrderBy(x => x.LineIdx)));
        }
Beispiel #26
0
 public string Log()
 {
     return(InvoiceDate.ToString());
 }
Beispiel #27
0
 public override string ToString()
 {
     return($"{InvoiceDate?.ToShortDateString()} {Supplier} {GrossAmount}");
 }
Beispiel #28
0
 public override string ToString()
 {
     return($"Invoice ID: {Id} Customer Name:{CustomerFirstName} {CustomerLastName} Date:{InvoiceDate.ToString("dd/MM/yyyy")}");
 }
Beispiel #29
0
 public override string ToString()
 {
     return($"Invoice no. [{InvoiceNumber}] from [{InvoiceDate.ToShortDateString()}] for customer [{CustomerNumber}] in branch [{Branch}]");
 }
Beispiel #30
0
 /// <summary>
 /// Outputs string containing the following (replace [] with actual values):
 /// Invoice Number: [InvoiceNumber], InvoiceDate: [DD/MM/YYYY], LineItemCount: [Number of items in LineItems]
 /// </summary>
 public override string ToString()
 {
     return($"Invoice Number: {InvoiceNumber}, InvoiceDate: {(InvoiceDate == DateTime.MinValue ? string.Empty : InvoiceDate.ToString("dd/MM/yyyy")) }, LineItemCount: {LineItems.Count()}");
 }