コード例 #1
0
ファイル: PrintingPreprocessor.cs プロジェクト: juehv/SPOS
        public static List<SimplePOS.Invoicing.Invoice> ProcessInvoices(SimplePOS.Invoicing.Invoice invoice)
        {
            List<SimplePOS.Invoicing.Invoice> pages = new List<SimplePOS.Invoicing.Invoice>();

            // Lines berechnen
            int lines = 0;
            foreach (SimplePOS.Invoicing.InvoiceItem item in invoice.Items)
            {
                lines++;
                if (item.Quantity > 1) lines++;
            }

            // Checken obs auf eine Seite passt
            if (!fitsInPage(lines))
            {
                // prepare item stacks
                //List<List<InvoiceItem>> itemStacks = new List<List<InvoiceItem>>();
                //List<InvoiceItem> rawData = invoice.Items;
                lines = 0;
                int pageCount = 1;
                List<SimplePOS.Invoicing.InvoiceItem> aktStack = new List<SimplePOS.Invoicing.InvoiceItem>();
                foreach (SimplePOS.Invoicing.InvoiceItem item in invoice.Items)
                {
                    lines++;
                    if (item.Quantity > 1) lines++;

                    if (fitsInPage(lines))
                    {
                        aktStack.Add(item);
                    }
                    else
                    {
                        lines = 0;
                        //itemStacks.Add(aktStack);
                        pages.Add(new SimplePOS.Invoicing.Invoice(invoice, pageCount++, aktStack, invoice.TaxSet1, invoice.TaxSet2,invoice.ShowTax));
                        aktStack = new List<SimplePOS.Invoicing.InvoiceItem>();
                        aktStack.Add(item);
                    }
                }
                if (aktStack.Count > 0)
                {
                    pages.Add(new SimplePOS.Invoicing.Invoice(invoice, pageCount++, aktStack, invoice.TaxSet1, invoice.TaxSet2, invoice.ShowTax));
                }


            }
            else pages.Add(invoice);



            return pages;
        }
コード例 #2
0
ファイル: A4.xaml.cs プロジェクト: juehv/SPOS
 public A4(SimplePOS.Invoicing.Invoice invoice)
 {
     this.invoice = invoice;
     InitializeComponent();
     listBox1.ItemsSource = invoice.getArticleList();
     listBox2.ItemsSource = invoice.getPriceList();
     textBlock2.Text = string.Format("{0:0.00}", invoice.getAmmount());
     textBlock5.Text = invoice.Date.ToString("dd.MM.yyy");
     textBlock6.Text = invoice.PageNumber;
     if (invoice.ShowTax){
         tax_field.Text = "enthaltene MwSt (" + invoice.TaxSet1 + "%):";
         textBlock3.Text = string.Format("{0:0.00}", invoice.getTax1());
     }
     else
     {
         tax_field.Text = "";
         textBlock3.Text = "Der Betrag enthält keine MwSt gem. §19 UStG";
     }
 }
コード例 #3
0
ファイル: InvoicePrinter.cs プロジェクト: juehv/SPOS
        /// <summary>
        /// Prints the invoice
        /// </summary>
        /// <param name="items"></param>
        /// <returns></returns>
        public bool print(SimplePOS.Invoicing.Invoice items)
        {

            SimplePOS.Invoicing.SerializableInvoice serialinvoice = new Invoicing.SerializableInvoice(items);

            XmlInvoiceGenerator InvoiceXMLGenerator = new XmlInvoiceGenerator(serialinvoice);
            InvoiceXMLGenerator.PrintXmlInvoice();
            return true;

            //foreach (SimplePOS.Invoicing.InvoiceItem item in items.Items)
            //{
            //    Console.WriteLine(item.Article.Name + " x" + item.Quantity);
            //}


            //PrintDialog pd = new PrintDialog();

            

            //if (pd.ShowDialog() == true)
            //{
            //    List<SimplePOS.Invoicing.Invoice> pages = PrintingPreprocessor.ProcessInvoices(items);
            //    foreach (SimplePOS.Invoicing.Invoice item in pages)
            //    {
            //        A4 page = new A4(item);
            //        page.Measure(new System.Windows.Size(pd.PrintableAreaWidth, pd.PrintableAreaHeight));
            //        page.Arrange(new System.Windows.Rect(new System.Windows.Point(0, 0), page.DesiredSize));
            //        pd.PrintVisual(page.getGrid(), item.PageNumber);

            //        if (PreferenceManager.DOUBLEPRINT)
            //        {
            //           pd.PrintVisual(page.getGrid(), item.PageNumber);
            //        }
            //    }

            //return true;
            //}
            //return false;
        }
コード例 #4
0
ファイル: InventoryItem.xaml.cs プロジェクト: juehv/SPOS
 public InventoryItem(SimplePOS.Database.ISposDb db)
 {
     this.db = db;
     InitializeComponent();
     textBox1.Focus();
 }
コード例 #5
0
ファイル: InventoryOverview.xaml.cs プロジェクト: juehv/SPOS
 public InventoryOverview(SimplePOS.Database.ISposDb db)
 {
     this.db = db;
     InitializeComponent();
     updategrid();
 }
コード例 #6
0
ファイル: InvoiceItem.cs プロジェクト: juehv/SPOS
 public InvoiceItem(SimplePOS.Article.AbstractArticle article, double quantity)
 {
     this.article = article;
     this.quantity = quantity;
 }