Exemplo n.º 1
0
 public override string GetInsertSQL()
 {
     return(String.Format(@"insert into table_receiptitem 
         (   
             rec_id,
             cus_id,
             ccy_id,
             reci_amount,
             vbe_id,
             vb_id,
             reci_entrytype,
             reci_invoicedate,
             reci_invoiceno,
             reci_duedate,
             emp_id,
             reci_discount,
             reci_amountbeforediscount,
             top_id,
             reci_description,
             reci_notes,
             inv_id,
             inv_type,
             bank_id,
             reci_receipttype,
             arcr_id
         ) 
         VALUES ({0},{1},{2},{3},{4},{5},'{6}','{7}','{8}','{9}',{10},{11},{12},{13},
         '{14}','{15}',{16},'{17}',{18},'{19}',{20})",
                          EVENT_JOURNAL.ID,
                          VENDOR.ID,
                          CURRENCY.ID,
                          AMOUNT,
                          VENDOR_BALANCE_ENTRY == null?0:VENDOR_BALANCE_ENTRY.ID,
                          VENDOR_BALANCE == null?0:VENDOR_BALANCE.ID,
                          VendorBalanceEntryType.Receipt.ToString(),
                          INVOICE_DATE.ToString(Utils.DATE_FORMAT),
                          INVOICE_NO,
                          DUE_DATE.ToString(Utils.DATE_FORMAT),
                          EMPLOYEE.ID,
                          DISCOUNT,
                          AMOUNT_BEFORE_DISCOUNT,
                          TOP == null?0:TOP.ID,
                          DESCRIPTION,
                          NOTES,
                          CUSTOMER_INVOICE_JOURNAL_ITEM.GetID(),
                          VENDOR_BALANCE_CUSTOMER_INVOICE_TYPE.ToString(),
                          BANK == null?0:BANK.ID,
                          PAYMENT_TYPE.ToString(),
                          AR_CREDIT_NOTE == null?0:AR_CREDIT_NOTE.ID
                          ));
 }
Exemplo n.º 2
0
        private static POSReceiptRow CreateNewPOSReceiptRow(ReceiptType paReceiptType)
        {
            bool          lcTaxApplicable;
            POSReceiptRow lcPOSReceiptRow;

            lcPOSReceiptRow = new POSReceiptRow(EServiceTableManager.GetInstance().GetNewRow(EServiceTableManager.TableType.POSReceipt, true));
            lcTaxApplicable = General.ParseBoolean(ApplicationFrame.GetInstance().ActiveSubscription.ActiveSetting.GetSettingValue(ctSETTaxApplicable), false);

            lcPOSReceiptRow.ReceiptID   = -1;
            lcPOSReceiptRow.ReceiptNo   = GetPOSLastReceiptNo(paReceiptType) + 1;
            lcPOSReceiptRow.ReceiptDate = General.GetCurrentSystemLocalTime();

            if ((lcTaxApplicable) && (paReceiptType == ReceiptType.Sale))
            {
                lcPOSReceiptRow.TaxPercent = General.ParseDecimal(ApplicationFrame.GetInstance().ActiveSubscription.ActiveSetting.GetSettingValue(ctSETTaxPercent), 0);
            }
            else
            {
                lcPOSReceiptRow.TaxPercent = 0;
            }

            lcPOSReceiptRow.TaxInclusive = General.ParseBoolean(ApplicationFrame.GetInstance().ActiveSubscription.ActiveSetting.GetSettingValue(ctSETTaxInclusive), false);
            lcPOSReceiptRow.ReceiptType  = paReceiptType.ToString().ToUpper();
            lcPOSReceiptRow.Status       = Status.Active.ToString().ToUpper();

            return(lcPOSReceiptRow);
        }
        public void SetReceiptPartOfMessage(Model.Message message, ReceiptType receiptType)
        {
            String receipt = receiptType.ToString();

            if (message.ReceiptType == receipt)
            {
                return;
            }

            message.ReceiptType = receipt;
            switch (receiptType)
            {
            case ReceiptType.ServerReceived:
                message.ReceiptSource = "msg_check";
                break;

            case ReceiptType.ClientReceived:
                message.ReceiptSource = "msg_not_read";
                break;

            case ReceiptType.ClientRead:
                message.ReceiptSource = "msg_read";
                break;

            case ReceiptType.None:
                message.ReceiptSource = "msg_sending";
                break;
            }
        }
Exemplo n.º 4
0
        private static int GetPOSLastReceiptNo(ReceiptType paReceiptType)
        {
            object             lcResult;
            EServiceQueryClass lcQuery;

            lcQuery = new EServiceQueryClass(EServiceQueryClass.QueryType.GetPOSLastReceiptNo);
            lcQuery.Query.ReplacePlaceHolder("$RECEIPTTYPE", paReceiptType.ToString(), true);

            if ((lcResult = lcQuery.Query.GetResult()) != null)
            {
                return(Convert.ToInt32(lcResult));
            }
            else
            {
                return(0);
            }
        }
Exemplo n.º 5
0
        private async Task <ReceiptWebAllModel> AllReceiptsByType(ReceiptType receiptType, int id = 1)
        {
            var page     = id;
            var receipts = await this.receiptsService
                           .GetAllReceiptsByTypeWithPagingAsync <ReceiptServiceDetailsModel>(
                receiptType, GlobalConstants.ItemsPerPageAdmin, (page - 1) *GlobalConstants.ItemsPerPageAdmin);

            var viewModel = new ReceiptWebAllModel();

            this.AddEntitiesToViewModel(viewModel, receipts);

            viewModel.PagesCount = await this.GetPagesCount(receiptType.ToString());

            viewModel.CurrentPage = page;

            return(viewModel);
        }