Пример #1
0
        private void Finance(ref string ContentMail)
        {
            ContentMail += "<b>Finance :</b> <br />";
            decimal total = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "'");

            ContentMail += "<table>";
            ContentMail += "<tr><td></td><td colspan='2'>Payment Received (Rp) : " + Cf.Num(total) + "</td></tr>";

            decimal cash = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND CaraBayar = 'TN'");

            ContentMail += "<tr><td colspan='2'></td><td style='text-align:right;'>Cash :</td><td>" + Cf.Num(cash) + "</td></tr>";

            decimal creditcard = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND CaraBayar = 'KK'");

            ContentMail += "<tr><td colspan='2'></td><td style='text-align:right;'>Credit Card :</td><td>" + Cf.Num(creditcard) + "</td></tr>";

            decimal debitcard = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND CaraBayar = 'KD'");

            ContentMail += "<tr><td colspan='2'></td><td style='text-align:right;'>Debit Card :</td><td>" + Cf.Num(debitcard) + "</td></tr>";

            decimal giro = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND CaraBayar = 'BG'");

            ContentMail += "<tr><td colspan='2'></td><td style='text-align:right;'>Giro :</td><td>" + Cf.Num(giro) + "</td></tr>";

            decimal transfer = Db.SingleDecimal("SELECT ISNULL(SUM(Total),0) FROM ISC064_FINANCEAR..MS_TTS WHERE TglTTS = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND CaraBayar = 'TR'");

            ContentMail += "<tr><td colspan='2'></td><td style='text-align:right;'>Transfer :</td><td>" + Cf.Num(transfer) + "</td></tr>";

            ContentMail += "</table><br /><br />";
        }
Пример #2
0
        private void Stok(ref string ContentMail)
        {
            ContentMail += "<b>Stock Unit : </b> <br />";
            DataTable rsLokasi = Db.Rs("SELECT DISTINCT Lokasi FROM ISC064_MARKETINGJUAL..MS_UNIT");

            ContentMail += "<table>";
            for (int i = 0; i < rsLokasi.Rows.Count; i++)
            {
                ContentMail += "<tr><td colspan='2'>" + rsLokasi.Rows[i]["Lokasi"].ToString() + "</td></tr>";

                int book = Db.SingleInteger("SELECT COUNT(*) FROM ISC064_MARKETINGJUAL..MS_UNIT WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "'" +
                                            "AND NoStock IN (SELECT NoStock FROM ISC064_MARKETINGJUAL..MS_RESERVASI WHERE Status = 'A')");

                int available = Db.SingleInteger("SELECT COUNT(*) FROM ISC064_MARKETINGJUAL..MS_UNIT WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "' AND Status = 'A'");
                ContentMail += "<tr><td style='text-align:right;'>Available :</td><td>" + Cf.Num(available - book) + "</td></tr>";


                ContentMail += "<tr><td style='text-align:right;'>Booking :</td><td>" + Cf.Num(book) + "</td></tr>";

                int hold = Db.SingleInteger("SELECT COUNT(*) FROM ISC064_MARKETINGJUAL..MS_UNIT WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "' AND Status = 'B'" +
                                            "AND NoStock NOT IN (SELECT NoStock FROM ISC064_MARKETINGJUAL..MS_KONTRAK WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "' AND Status = 'A')");
                ContentMail += "<tr><td style='text-align:right;'>Hold :</td><td>" + Cf.Num(hold) + "</td></tr>";

                int sold = Db.SingleInteger("SELECT COUNT(*) FROM ISC064_MARKETINGJUAL..MS_UNIT WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "' AND Status = 'B'" +
                                            "AND NoStock IN (SELECT NoStock FROM ISC064_MARKETINGJUAL..MS_KONTRAK WHERE Lokasi = '" + rsLokasi.Rows[i]["Lokasi"].ToString() + "' AND Status = 'A')");
                ContentMail += "<tr><td style='text-align:right;'>Sold :</td><td>" + Cf.Num(sold) + "</td></tr>";
            }
            ContentMail += "</table><br />";
        }
Пример #3
0
        private void Summary(ref string ContentMail)
        {
            decimal totalJenis = 0, totalUnit = 0;

            ContentMail += "<b>Sales :</b> <br />";
            DataTable rsJenis = Db.Rs("SELECT DISTINCT Jenis FROM ISC064_MARKETINGJUAL..MS_KONTRAK WHERE TglKontrak = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND Status = 'A'");

            ContentMail += "<table>";
            ContentMail += "<tr><td style='width:100px;'>Tipe Unit</td><td style='width:100px;'>Jumlah Unit</td><td style='width:100px;'>Nilai Kontrak (Rp.)</td></tr>";
            for (int i = 0; i < rsJenis.Rows.Count; i++)
            {
                ContentMail += "<tr>";
                ContentMail += "<td>" + rsJenis.Rows[i]["Jenis"].ToString() + "</td>";

                int unitJenis = Db.SingleInteger("SELECT COUNT(*) FROM ISC064_MARKETINGJUAL..MS_KONTRAK WHERE TglKontrak = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND Status = 'A' AND Jenis = '" + rsJenis.Rows[i]["Jenis"] + "'");
                totalUnit   += unitJenis;
                ContentMail += "<td>" + Cf.Num(unitJenis) + "</td>";

                decimal nilaiJenis = Db.SingleDecimal("SELECT ISNULL(SUM(NilaiKontrak), 0) FROM ISC064_MARKETINGJUAL..MS_KONTRAK WHERE TglKontrak = '" + Cf.Tgl112(DateTime.Today.AddDays(-1)) + "' AND Status = 'A' AND Jenis = '" + rsJenis.Rows[i]["Jenis"] + "'");
                totalJenis  += nilaiJenis;
                ContentMail += "<td>" + Cf.Num(nilaiJenis) + "</td>";

                ContentMail += "</tr>";
            }
            ContentMail += "<tr><td>Total</td><td style='border-top:double black 1px;'>" + Cf.Num(totalUnit) + "</td><td style='border-top:double black 1px;'>" + Cf.Num(totalJenis) + "</td></tr>";
            ContentMail += "</table><br />";
        }