예제 #1
0
    void calculate()
    {
        float total_amount = 0;
        InvoiceRecords_Details thisRecord = DataManager_New.instance.invoiceList [thisInvoiceID];

        for (int i = 0; i < thisRecord.itemDetails_List.Count; i++)
        {
            for (int j = 0; j < thisRecord.itemDetails_List[i].nettAmount_List.Count; j++)
            {
                float result = 0;
                float.TryParse(thisRecord.itemDetails_List[i].nettAmount_List[j], out result);

                total_amount += result;
            }
        }

        currentSubTotal = total_amount;

        subTotal_priceText.text = "RM " + currentSubTotal.ToString("N");
        float sixPer = currentSubTotal / 100 * 6;

        gst_priceText.text          = "GST RM " + sixPer.ToString("N");
        total_priceText.text        = "RM " + (currentSubTotal + sixPer).ToString("N");
        priceInText_InputField.text = PriceToWords((currentSubTotal + sixPer).ToString(".00"));
        priceInText_InputField.textComponent.horizontalOverflow = HorizontalWrapMode.Wrap;
        priceInText_InputField.textComponent.verticalOverflow   = VerticalWrapMode.Truncate;
    }
    public void addPage()
    {
        saveAll();
        DataManager_New.instance.addNewPage(invoiceID);
        currentPage++;

        thisInvoiceData = DataManager_New.instance.invoiceList[invoiceID];

        refresh();
    }
    public void deletePage()
    {
        if (pageList.Count > 1)
        {
            saveAll();
            DataManager_New.instance.invoiceList[invoiceID].itemDetails_List.RemoveAt(currentPage);
            DataManager_New.instance.saveCurrentInvoice();
            thisInvoiceData = DataManager_New.instance.invoiceList[invoiceID];

            refresh();
        }
    }
예제 #4
0
    void instantiateButton_S(InvoiceRecords_Details inputInvoice)
    {
        GameObject newButton = Instantiate(buttonPrefab, buttonsMama);

        newButton.SetActive(true);
        UI_InvoiceButton button_s = newButton.GetComponent <UI_InvoiceButton> ();

        button_s.thisInvoiceRecord = inputInvoice;
        button_s.refreshText();

        buttonList.Add(newButton);
    }
 IEnumerator load_coroutine()
 {
     while (DataManager_New.instance == null)
     {
         yield return(null);
     }
     while (!DataManager_New.instance.loaded_partner)
     {
         yield return(null);
     }
     thisInvoiceRecords = DataManager_New.instance.invoiceList [InvoiceId];
     refreshUI();
 }
 IEnumerator load_coroutine()
 {
     while (DataManager_New.instance == null)
     {
         yield return(null);
     }
     while (!DataManager_New.instance.loaded_partner)
     {
         yield return(null);
     }
     thisInvoiceRecords = DataManager_New.instance.invoiceList [thisInvoiceID];
     loadOtherDetails();
 }
    IEnumerator LoadCoroutine()
    {
        while (DataManager_New.instance == null)
        {
            yield return(null);
        }

        while (!DataManager_New.instance.loaded_partner)
        {
            yield return(null);
        }

        thisInvoiceData = DataManager_New.instance.invoiceList[invoiceID];

        refresh();
    }
    InvoiceRecords_Details NewEmptyInvoice()
    {
        InvoiceRecords_Details newInvoice = new InvoiceRecords_Details();

        newInvoice.invoiceID = (invoiceList.Count).ToString("0000");
        Debug.Log("Here Invoice ID : " + newInvoice.invoiceID);
        newInvoice.projectTitle  = "New Project " + newInvoice.invoiceID;
        newInvoice.clientData_ID = "empty";

        //Create a newRecords for one page
        InvoiceItemRecord newInvoiceItems = new InvoiceItemRecord();

        newInvoiceItems = newEmptyRecord();

        newInvoice.itemDetails_List = new List <InvoiceItemRecord> ();
        newInvoice.itemDetails_List.Add(newInvoiceItems);

        return(newInvoice);
    }
 public void saveInvoice_target(InvoiceRecords_Details invoiceData_input)
 {
     invoiceList [int.Parse(invoiceData_input.invoiceID)] = invoiceData_input;
     saveInvoiceFile(invoiceList);
 }
예제 #10
0
    void addToTotal(InvoiceRecords_Details inputInvoice)
    {
        float thisPrice = getTotalPrice(inputInvoice.itemDetails_List);

        monthlyTotal_price += thisPrice;
    }