Ejemplo n.º 1
0
 public ActionResult Create(InvoiceDetail invoicedetail)
 {
     if (ModelState.IsValid)
     {
         invoicedetailRepository.InsertOrUpdate(invoicedetail);
         invoicedetailRepository.Save();
         return(RedirectToAction("Index"));
     }
     else
     {
         ViewBag.PossibleInvoices = invoiceRepository.All;
         ViewBag.PossibleProducts = productRepository.All;
         return(View());
     }
 }
Ejemplo n.º 2
0
        public void AddTest()
        {
            var newInvoice = new Invoice
            {
                nomorInvoice = "9000",
                dueDate      = DateTime.Now,
                outletCode   = "71390002",
                issuedDate   = DateTime.Now,
                subTotal     = 2400000232300,
                ppn          = 423232323,

                nomorPO  = "PS02221",
                isPPN    = true,
                pengguna = "admin",
            };

            var result = invoice.Save(newInvoice);

            Assert.IsTrue(result != 0);

            var getInvoice = invoice.GetInvoiceByNomor("9000");
            var detail     = new InvoiceDetail
            {
                invoiceID = getInvoice.invoiceID,
                itemCode  = "FG00002",
                itemPrice = 24124124,
                itemQty   = 1345345,
                subTotal  = 345345,
                discount  = 3.3
            };
            var result2 = invoiceDetail.Save(detail);

            Assert.IsTrue(result2 != 0);
        }