Example #1
0
 public SalesOrderLine()
 {
     DtoFields.Add(nameof(lineNbr), new DtoValue(0));
     DtoFields.Add(nameof(quantity), new DtoValue(1));
     RequiredFields.Add("salesOrderOperation", new DtoValue("Issue"));
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #2
0
        public virtual Dictionary <string, object> ToDto(bool delta = false)
        {
            var dict = _data.Where(x => _ignoreProperties == null || !_ignoreProperties.Contains(x.Key))
                       .Where(x => x.Value != null)
                       .Where(x => !delta || GetDeltaFields().Contains(x.Key))
                       .ToDictionary(x => CreateKey(x.Key),
                                     x => CreateDto(x.Value, x.Key));

            foreach (var dtoField in DtoFields.Where(dtoField => !dict.ContainsKey(dtoField.Key)))
            {
                if (dtoField.Value == null)
                {
                    continue;
                }
                var value = dtoField.Value as DtoValue;
                if (value != null)
                {
                    if (value.Value == null)
                    {
                        continue;
                    }
                    dict[dtoField.Key] = dtoField.Value;
                }
                else
                {
                    dict[dtoField.Key] = CreateDto(dtoField.Value, dtoField.Key);
                }
            }
            foreach (var required in RequiredFields.Where(x => !dict.ContainsKey(x.Key)))
            {
                dict[required.Key] = required.Value;
            }
            return(dict.Where(x => x.Value != null).ToDictionary(x => x.Key, x => x.Value));
        }
Example #3
0
 public InventoryIssueLine()
 {
     DtoFields.Add(nameof(lineNumber), new DtoValue(0));
     DtoFields.Add(nameof(quantity), new DtoValue(1));
     RequiredFields.Add("tranType", new DtoValue("Issue"));
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #4
0
 public SalesOrderLine()
 {
     DtoFields.Add(nameof(lineNbr), new DtoValue(0));
     DtoFields.Add(nameof(quantity), new DtoValue(1));
     RequiredFields.Add("warehouse", new DtoValue(null));
     RequiredFields.Add("salesOrderOperation", new DtoValue("Issue"));
 }
Example #5
0
        public CustomerInvoice()
        {
            DtoFields.Add("documentDueDate", new DtoValue(DateTime.Today.AddDays(14)));
            DtoFields.Add("cashDiscountDate", new DtoValue(DateTime.Today));

            IgnoreProperties.Add(nameof(this.number));
            IgnoreProperties.Add(nameof(this.referenceNumber));
        }
Example #6
0
 public ProjectTask()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #7
0
 public PurchaseRecieptLine()
 {
     DtoFields.Add(nameof(lineNbr), new DtoValue(0));
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #8
0
 public PaymentLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #9
0
 public RotRutDistribution()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #10
0
 public InventoryRecieptLine()
 {
     DtoFields.Add(nameof(lineNumber), new DtoValue(0));
     DtoFields.Add(nameof(quantity), new DtoValue(1));
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #11
0
 public ShipmentDetailLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #12
0
 public PackageDetailLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #13
0
 public CustomerInvoiceLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
     DtoFields.Add("lineNumber", new DtoValue(0));
     DtoFields.Add("quantity", new DtoValue(1));
 }
Example #14
0
 public CashTransactionDetails()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #15
0
 public InventoryIssueLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #16
0
 public AttributeDetails()
 {
     DtoFields.Add("operation", new NotDto<ApiOperation>(ApiOperation.Insert));
 }
 public CustomerPaymentOrderToApply()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #18
0
 public DirectDebitLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #19
0
 public RotRutDistribution()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
     DtoFields.Add("lineNbr", new DtoValue(0));
 }
Example #20
0
 public PurchaseOrderLine()
 {
     DtoFields.Add(nameof(operation), new NotDto <ApiOperation>(ApiOperation.Insert));
     DtoFields.Add(nameof(lineNbr), new DtoValue(0));
     DtoFields.Add(nameof(orderQty), new DtoValue(1));
 }
Example #21
0
 public Allocations()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Update));
 }
Example #22
0
        // WRITEABLE
        //public class CashSaleUpdateDto
        //{
        //    public DtoValue<string> CashAccount { get; set; }
        //    public DtoValue<string> PaymentReference { get; set; }
        //    public CashSaleLinesUpdateDto[] CashSalesLines { get; set; }
        //    public DtoValue<string> ReferenceNumber { get; set; }
        //    public DtoValue<string> CustomerNum-ber { get; set; }
        //    public DtoValue<DateTime> DocumentDate { get; set; }
        //    public DtoValue<bool> Hold { get; set; }
        //    public DtoValue<string> PostPeriod { get; set; }
        //    public DtoValue<string> InvoiceText { get; set; }
        //    public DtoValue<string> LocationId { get; set; }
        //    public DtoValue<string> CurrencyId { get; set; }
        //    public DtoValue<string> CreditTermsId { get; set; } // "CreditTerms"
        //    public DtoValue<DateTime> CashDiscountDate { get; set; }
        //    public DtoValue<string> PaymentMethodId { get; set; } // "PaymentMethod" (PaymentMethodDto)
        //    public DtoValue<Nullable<int>> SalesPersonID { get; set; }
        //    public DtoValue<string> Note { get; set; }
        //}

        /* READABLE */
        //public class CashSaleDto
        //{
        //    public LocationDto Location { get; set; }
        //    public decimal DetailTotal { get; set; }
        //    public decimal DetailTotalInCurrency { get; set; }
        //    public decimal VatTaxableTotal { get; set; }
        //    public decimal VatTaxableTotalInCurrency { get; set; }
        //    public decimal VatExemptTotal { get; set; }
        //    public decimal VatExemptTotalInCurrency { get; set; }
        //    public decimal VatTotal { get; set; }
        //    public decimal VatTotalInCurrency { get; set; }
        //    public string SalesPersonDescr { get; set; }
        //    public CustomerNumberDto Customer { get; set; }
        //    public Nullable<CustomerDocumentTypes> DocumentType { get; set; }
        //    public Nullable<CustomerDocumentStatuses> Status { get; set; }
        //    public decimal Amount { get; set; }
        //    public decimal AmountInCurrency { get; set; }
        //    public decimal Balance { get; set; }
        //    public decimal BalanceInCurrency { get; set; }
        //    public decimal CashDiscount { get; set; }
        //    public decimal CashDiscountInCurrency { get; set; }
        //    public string CustomerRefNumber { get; set; }
        //    public Nullable<DateTime> LastModifiedDateTime { get; set; }
        //    public Nullable<DateTime> CreatedDateTime { get; set; }
        //}

        public CashSale()
        {
            DtoFields.Add("creditTermsId", new CreditTerms("30"));
            DtoFields.Add("documentDueDate", new DtoValue(DateTime.Today.AddDays(14)));
            DtoFields.Add("cashDiscountDate", new DtoValue(DateTime.Today));
        }
Example #23
0
 public JournalTransactionLine()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
     DtoFields.Add("lineNumber", new DtoValue(0));
 }
 public DimensionSegmentValue()
 {
     DtoFields.Add("operation", new NotDto <ApiOperation>(ApiOperation.Insert));
 }
Example #25
0
        /* READABLE */
        //public class CashSaleLineDto
        //{
        //    public decimal UnitPrice { get; set; }
        //    public decimal ManualAmount { get; set; }
        //    public decimal Amount { get; set; }
        //    public decimal AmountInCurrency { get; set; }
        //    public decimal DiscountAmount { get; set; }
        //    public string DiscountCode { get; set; }
        //}

        /* WRITABLE */

        //public class CashSaleLinesUpdateDto
        //{
        //    public ApiOperation Operation { get; set; }
        //    public DtoValue<string> InventoryNumber { get; set; }
        //    public DtoValue<int> LineNumber { get; set; }
        //    public DtoValue<string> Description { get; set; }
        //    public DtoValue<decimal> Quantity { get; set; }
        //    public DtoValue<decimal> UnitPriceInCurrency { get; set; }
        //    public DtoValue<decimal> ManualAmountInCurrency { get; set; }
        //    public DtoValue<string> AccountNumber { get; set; } // "Account"
        //    public DtoValue<string> VatCodeId { get; set; } // "VatCode"
        //    public DtoValue<string> UOM { get; set; }
        //    public DtoValue<decimal> DiscountPercent { get; set; }
        //    public DtoValue<decimal> DiscountAmountInCurrency { get; set; }
        //    public DtoValue<bool> ManualDiscount { get; set; }
        //    public SegmentUpdateDto[] Subaccount { get; set; }
        //    public DtoValue<string> Salesperson { get; set; }
        //    public DtoValue<int> DeferralSchedule { get; set; }
        //    public DtoValue<string> DeferralCode { get; set; }
        //    public DtoValue<string> Note { get; set; }
        //}

        public CashSaleLine()
        {
            DtoFields.Add("operation", new NotDto <int>(1));
            DtoFields.Add("lineNumber", new DtoValue(0));
            DtoFields.Add("quantity", new DtoValue(1));
        }
 public SupplierInvoiceLine()
 {
     DtoFields.Add("operation", new NotDto <int>(1));
     DtoFields.Add("lineNumber", new DtoValue(0));
     DtoFields.Add("quantity", new DtoValue(1));
 }