Beispiel #1
0
        private void GetAllDOs()
        {
            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                var list1 = db.Table <DelOrder> ().Where(x => x.isUploaded == false)
                            .OrderBy(x => x.dono)
                            .ToList <DelOrder> ();

                var list2 = db.Table <DelOrderDtls> ().ToList <DelOrderDtls> ();

                foreach (DelOrder delOrder in list1)
                {
                    var list3 = list2.Where(x => x.dono == delOrder.dono).ToList <DelOrderDtls> ();
                    foreach (DelOrderDtls invdtl in list3)
                    {
                        OutLetBillTemp bill = new OutLetBillTemp();
                        bill.UserID      = userid;
                        bill.BranchCode  = brn;
                        bill.CompanyCode = comp;
                        bill.Created     = delOrder.created;
                        bill.CustCode    = delOrder.custcode;
                        bill.ICode       = invdtl.icode;
                        bill.InvDate     = delOrder.dodate;
                        bill.InvNo       = delOrder.dono;
                        bill.IsInclusive = invdtl.isincludesive;
                        bill.Amount      = invdtl.amount;
                        bill.NetAmount   = invdtl.netamount;
                        bill.TaxAmt      = invdtl.tax;
                        bill.TaxGrp      = invdtl.taxgrp;
                        bill.UPrice      = invdtl.price;
                        bill.Qty         = invdtl.qty;
                        bill.TrxType     = "DO";
                        bill.Remark      = delOrder.remark;
                        bill.OtheDesc    = delOrder.term;
                        //bill.CNInvNo = so.custpono;
                        bill.Module = "DO";
                        allbills.Add(bill);
                    }
                }
            }
        }
Beispiel #2
0
        private void GetAllCNs()
        {
            using (var db = new SQLite.SQLiteConnection(pathToDatabase)) {
                var list1 = db.Table <CNNote> ().Where(x => x.isUploaded == false)
                            .OrderBy(x => x.cnno)
                            .ToList <CNNote> ();

                var list2 = db.Table <CNNoteDtls> ().ToList <CNNoteDtls> ();

                foreach (CNNote inv in list1)
                {
                    var list3 = list2.Where(x => x.cnno == inv.cnno).ToList <CNNoteDtls> ();
                    foreach (CNNoteDtls invdtl in list3)
                    {
                        OutLetBillTemp bill = new OutLetBillTemp();
                        bill.UserID      = userid;
                        bill.BranchCode  = brn;
                        bill.CompanyCode = comp;
                        bill.Created     = inv.created;
                        bill.CustCode    = inv.custcode;
                        bill.ICode       = invdtl.icode;
                        bill.InvDate     = inv.invdate;
                        bill.InvNo       = inv.cnno;
                        bill.CNInvNo     = inv.invno;
                        bill.IsInclusive = invdtl.isincludesive;
                        bill.Amount      = invdtl.amount;
                        bill.NetAmount   = invdtl.netamount;
                        bill.TaxAmt      = invdtl.tax;
                        bill.TaxGrp      = invdtl.taxgrp;
                        bill.UPrice      = invdtl.price;
                        bill.Qty         = invdtl.qty;
                        bill.TrxType     = "CN";
                        bill.Module      = "CN";
                        allbills.Add(bill);
                    }
                }
            }
        }
Beispiel #3
0
        private void GetAllSOs()
        {
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                var list1 = db.Table<SaleOrder> ().Where(x=>x.isUploaded==false)
                    .OrderBy(x=>x.sono)
                    .ToList<SaleOrder> ();

                var list2 = db.Table<SaleOrderDtls> ().ToList<SaleOrderDtls> ();

                foreach (SaleOrder so in list1) {
                    var list3 = list2.Where (x => x.sono == so.sono).ToList<SaleOrderDtls> ();
                    foreach (SaleOrderDtls invdtl in list3) {
                        OutLetBillTemp bill = new OutLetBillTemp ();
                        bill.UserID = userid;
                        bill.BranchCode = brn;
                        bill.CompanyCode = comp;
                        bill.Created = so.created;
                        bill.CustCode = so.custcode;
                        bill.ICode = invdtl.icode;
                        bill.InvDate = so.sodate;
                        bill.InvNo = so.sono;
                        bill.IsInclusive = invdtl.isincludesive;
                        bill.Amount = invdtl.amount;
                        bill.NetAmount = invdtl.netamount;
                        bill.TaxAmt = invdtl.tax;
                        bill.TaxGrp = invdtl.taxgrp;
                        bill.UPrice = invdtl.price;
                        bill.Qty = invdtl.qty;
                        bill.TrxType = "SO";
                        bill.CNInvNo = so.custpono;
                        bill.Remark = so.remark;
                        bill.OtheDesc = so.billTo;
                        bill.Module = "SO";
                        allbills.Add (bill);
                    }
                }
            }
        }
Beispiel #4
0
        private void GetAllInvBills()
        {
            using (var db = new SQLite.SQLiteConnection (pathToDatabase)) {
                var list1 = db.Table<Invoice> ().Where(x=>x.isUploaded==false)
                    .OrderBy(x=>x.invno)
                    .ToList<Invoice> ();

                var list2 = db.Table<InvoiceDtls> ().ToList<InvoiceDtls> ();

                foreach (Invoice inv in list1) {
                    var list3 = list2.Where (x => x.invno == inv.invno).ToList<InvoiceDtls> ();
                    foreach (InvoiceDtls invdtl in list3) {
                        OutLetBillTemp bill = new OutLetBillTemp ();
                        bill.UserID = userid;
                        bill.BranchCode = brn;
                        bill.CompanyCode = comp;
                        bill.Created = inv.created;
                        bill.CustCode = inv.custcode;
                        bill.ICode = invdtl.icode;
                        bill.InvDate = inv.invdate;
                        bill.InvNo = inv.invno;
                        bill.IsInclusive = invdtl.isincludesive;
                        bill.Amount = invdtl.amount;
                        bill.NetAmount = invdtl.netamount;
                        bill.TaxAmt = invdtl.tax;
                        bill.TaxGrp = invdtl.taxgrp;
                        bill.UPrice = invdtl.price;
                        bill.Qty = invdtl.qty;
                        bill.TrxType = inv.trxtype;
                        bill.Module = "INV";
                        allbills.Add (bill);
                    }
                }
            }
        }