private void BillingTotal(Table table, TotalRow total)
        {
            Row row = table.AddRow();

            row.Style = "TableRow";

            string font; Color shading;

            if (total.Inverse == true)
            {
                font    = "H2-9B-Inverse";
                shading = MigraDocHelpers.TextColorFromHtml(Invoice.TextColor);
            }
            else
            {
                font    = "H2-9B";
                shading = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);
            }

            var cell = row.Cells[2];

            cell.Shading.Color = shading;
            cell.AddParagraph(total.Name, ParagraphAlignment.Left, font);

            cell = row.Cells[3];
            cell.Shading.Color = shading;
            if (!total.NegativeAmount)
            {
                cell.AddParagraph(total.Value.ToCurrency(Invoice.Currency), ParagraphAlignment.Right, font);
            }
            else
            {
                cell.AddParagraph("- " + total.Value.ToCurrency(Invoice.Currency), ParagraphAlignment.Right, font);
            }
        }
        private void BillingTotal(Table table, TotalRow total)
        {
            Row row = table.AddRow();

            row.Style = "TableRow";

            string font; Color shading;

            if (total.Inverse == true)
            {
                font    = "H2-9B-Inverse";
                shading = MigraDocHelpers.TextColorFromHtml(Invoice.TextColor);
            }
            else
            {
                font    = "H2-9B";
                shading = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);
            }

            Cell cell = row.Cells[Invoice.HasDiscount ? COLUMN_DISCOUNT : COLUMN_UNITPRICE];

            cell.Shading.Color = shading;
            cell.AddParagraph(total.Name, ParagraphAlignment.Left, font);

            cell = row.Cells[COLUMN_TOTAL];
            cell.Shading.Color = shading;
            cell.AddParagraph(total.Value.ToCurrency(Invoice.Currency), ParagraphAlignment.Right, font);
        }
Esempio n. 3
0
        private void BillingTotal(Table table, TotalRow total)
        {
            table.Columns[4].Format.Alignment = ParagraphAlignment.Center;

            Row row = table.AddRow();

            row.Style = "TableRow";

            string font; Color shading;

            if (total.Inverse == true)
            {
                font    = "H2-9B-Inverse";
                shading = MigraDocHelpers.TextColorFromHtml(Invoice.TextColor);
            }
            else
            {
                font    = "H2-9B";
                shading = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);
            }

            Cell cell = row.Cells[3];

            cell.Shading.Color = shading;
            cell.AddParagraph(total.Name, ParagraphAlignment.Left, font);

            cell = row.Cells[4];
            cell.Shading.Color = shading;
            cell.AddParagraph(total.Value.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, font);
        }
Esempio n. 4
0
        private void BillingRow(Table table, ItemRow item)
        {
            Row row = table.AddRow();

            row.Style         = "TableRow";
            row.Shading.Color = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);

            Cell cell = row.Cells[0];

            cell.AddParagraph(item.Name, ParagraphAlignment.Left, "H2-9B");

            cell = row.Cells[1];
            cell.AddParagraph(item.Brand, ParagraphAlignment.Left, "H2-9");

            cell = row.Cells[2];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Amount.ToCurrency(), ParagraphAlignment.Center, "H2-9");

            cell = row.Cells[3];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Price.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");

            cell = row.Cells[4];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");
        }
        private void BillingRow(Table table, ItemRow item)
        {
            Row row = table.AddRow();

            row.Style         = "TableRow";
            row.Shading.Color = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);

            Cell cell = row.Cells[COLUMN_PRODUCT];

            cell.AddParagraph(item.Name, ParagraphAlignment.Left, "H2-9B");
            if (!String.IsNullOrEmpty(item.Description))
            {
                cell.AddParagraph(item.Description, ParagraphAlignment.Left, "H2-9-Grey");
            }

            cell = row.Cells[COLUMN_QTY];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Quantity.ToCurrency(), ParagraphAlignment.Right, "H2-9");

            cell = row.Cells[COLUMN_UNITPRICE];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Price.ToCurrency(Invoice.Currency), ParagraphAlignment.Right, "H2-9");

            cell = row.Cells[COLUMN_TOTAL];
            cell.VerticalAlignment = VerticalAlignment.Center;
            cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Right, "H2-9");

            if (Invoice.Company.HasVatNumber)
            {
                cell = row.Cells[COLUMN_VATPERCENT];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(item.VAT.ToCurrency(), ParagraphAlignment.Right, "H2-9");
            }

            if (Invoice.HasDiscount)
            {
                cell = row.Cells[COLUMN_DISCOUNT];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(item.Discount, ParagraphAlignment.Right, "H2-9");
            }
        }
Esempio n. 6
0
        private void BillingRow(Table table, ItemRow item)
        {
            //Row row = table.AddRow();
            //row.Style = "TableRow";
            //row.Shading.Color = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);

            //Cell cell = row.Cells[0];
            //cell.AddParagraph(item.Name, ParagraphAlignment.Left, "H2-9B");
            //cell.AddParagraph(item.Description, ParagraphAlignment.Left, "H2-9-Grey");

            //cell = row.Cells[1];
            //cell.VerticalAlignment = VerticalAlignment.Center;
            //cell.AddParagraph(item.Amount.ToCurrency(), ParagraphAlignment.Center, "H2-9");

            //cell = row.Cells[2];
            //cell.VerticalAlignment = VerticalAlignment.Center;
            //cell.AddParagraph(item.VAT.ToCurrency(), ParagraphAlignment.Center, "H2-9");

            //cell = row.Cells[3];
            //cell.VerticalAlignment = VerticalAlignment.Center;
            //cell.AddParagraph(item.Price.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");

            //if (Invoice.HasDiscount)
            //{
            //    cell = row.Cells[4];
            //    cell.VerticalAlignment = VerticalAlignment.Center;
            //    cell.AddParagraph(item.Discount, ParagraphAlignment.Center, "H2-9");

            //    cell = row.Cells[5];
            //    cell.VerticalAlignment = VerticalAlignment.Center;
            //    cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");
            //}
            //else
            //{
            //    cell = row.Cells[4];
            //    cell.VerticalAlignment = VerticalAlignment.Center;
            //    cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");
            //}

            if (Invoice.Type == "Invoice")
            {
                Row row = table.AddRow();
                row.Style         = "TableRow";
                row.Shading.Color = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);

                Cell cell = row.Cells[0];
                cell.AddParagraph(item.Name, ParagraphAlignment.Left, "H2-9B");
                cell.AddParagraph(item.Description, ParagraphAlignment.Left, "H2-9-Grey");
            }
            else
            {
                Row row = table.AddRow();
                row.Style         = "TableRow";
                row.Shading.Color = MigraDocHelpers.BackColorFromHtml(Invoice.BackColor);

                Cell cell = row.Cells[0];
                cell.AddParagraph(item.Name, ParagraphAlignment.Left, "H2-9B");
                cell.AddParagraph(item.Description, ParagraphAlignment.Left, "H2-9-Grey");

                cell = row.Cells[1];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(item.Amount.ToCurrency(), ParagraphAlignment.Center, "H2-9");

                //cell = row.Cells[2];
                //cell.VerticalAlignment = VerticalAlignment.Center;
                //cell.AddParagraph(item.VAT.ToCurrency(), ParagraphAlignment.Center, "H2-9");

                cell = row.Cells[2];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(item.Price.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");

                cell = row.Cells[3];
                cell.VerticalAlignment = VerticalAlignment.Center;
                cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");

                if (Invoice.HasDiscount)
                {
                    cell = row.Cells[3];
                    cell.VerticalAlignment = VerticalAlignment.Center;
                    cell.AddParagraph(item.Discount, ParagraphAlignment.Center, "H2-9");

                    cell = row.Cells[4];
                    cell.VerticalAlignment = VerticalAlignment.Center;
                    cell.AddParagraph(item.Total.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");
                }
                else
                {
                    cell = row.Cells[4];
                    cell.VerticalAlignment = VerticalAlignment.Center;
                    cell.AddParagraph(item.GCT.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");

                    var totalWithGCT = item.GCT + item.Total;

                    cell = row.Cells[5];
                    cell.VerticalAlignment = VerticalAlignment.Center;
                    cell.AddParagraph(totalWithGCT.ToCurrency(Invoice.Currency), ParagraphAlignment.Center, "H2-9");
                }
            }
        }