Exemplo n.º 1
0
    print "Usage: " . $script_file . " bank_ref [bank_receipt_number|all] (csv|tsv|excel|excel2007) [lang=xx_XX]\n";
    exit(-1);
}
$bankref = $argv[1];
$num = $argv[2];
$model = $argv[3];
$newlangid = 'en_EN';
// To force a new lang id
$invoicestatic = new Facture($db);
$invoicesupplierstatic = new FactureFournisseur($db);
$societestatic = new Societe($db);
$chargestatic = new ChargeSociales($db);
$memberstatic = new Adherent($db);
$paymentstatic = new Paiement($db);
$paymentsupplierstatic = new PaiementFourn($db);
$paymentsocialcontributionstatic = new PaymentSocialContribution($db);
$paymentvatstatic = new Tva($db);
$bankstatic = new Account($db);
$banklinestatic = new AccountLine($db);
// Parse parameters
foreach ($argv as $key => $value) {
    $found = false;
    // Define options
    if (preg_match('/^lang=/i', $value)) {
        $found = true;
        $valarray = explode('=', $value);
        $newlangid = $valarray[1];
        print 'Use language ' . $newlangid . ".\n";
    }
}
$outputlangs = $langs;
Exemplo n.º 2
0
    $page = 0;
}
//$limit = $conf->liste_limit;
//$offset = $limit * $page ;
if (!$sortfield) {
    $sortfield = "cs.date_ech";
}
if (!$sortorder) {
    $sortorder = "DESC";
}
/*
 * View
 */
$tva_static = new Tva($db);
$socialcontrib = new ChargeSociales($db);
$payment_sc_static = new PaymentSocialContribution($db);
$sal_static = new PaymentSalary($db);
llxHeader('', $langs->trans("SpecialExpensesArea"));
$title = $langs->trans("SpecialExpensesArea");
if ($_GET["mode"] == 'sconly') {
    $title = $langs->trans("SocialContributionsPayments");
}
$param = '';
if (GETPOST("mode") == 'sconly') {
    $param = '&mode=sconly';
}
if ($sortfield) {
    $param .= '&sortfield=' . $sortfield;
}
if ($sortorder) {
    $param .= '&sortorder=' . $sortorder;
	/**
	 *		\brief      Load an object from its id and create a new one in database
	 *		\param      fromid     		Id of object to clone
	 * 	 	\return		int				New id of clone
	 */
	function createFromClone($fromid)
	{
		global $user,$langs;

		$error=0;

		$object=new PaymentSocialContribution($this->db);

		$this->db->begin();

		// Load source object
		$object->fetch($fromid);
		$object->id=0;
		$object->statut=0;

		// Clear fields
		// ...

		// Create clone
		$result=$object->create($user);

		// Other options
		if ($result < 0)
		{
			$this->error=$object->error;
			$error++;
		}

		if (! $error)
		{



		}

		// End
		if (! $error)
		{
			$this->db->commit();
			return $object->id;
		}
		else
		{
			$this->db->rollback();
			return -1;
		}
	}
Exemplo n.º 4
0
 $paymentid = 0;
 // Read possible payments
 foreach ($_POST as $key => $value) {
     if (substr($key, 0, 7) == 'amount_') {
         $other_chid = substr($key, 7);
         $amounts[$other_chid] = price2num($_POST[$key]);
     }
 }
 if (count($amounts) <= 0) {
     $error++;
     $errmsg = 'ErrorNoPaymentDefined';
 }
 if (!$error) {
     $db->begin();
     // Create a line of payments
     $paiement = new PaymentSocialContribution($db);
     $paiement->chid = $chid;
     $paiement->datepaye = $datepaye;
     $paiement->amounts = $amounts;
     // Tableau de montant
     $paiement->paiementtype = $_POST["paiementtype"];
     $paiement->num_paiement = $_POST["num_paiement"];
     $paiement->note = $_POST["note"];
     if (!$error) {
         $paymentid = $paiement->create($user);
         if ($paymentid < 0) {
             $errmsg = $paiement->error;
             $error++;
         }
     }
     if (!$error) {
Exemplo n.º 5
0
                facture_pdf_create($db, $fac, $fac->modelpdf, $outputlangs, $hookmanager);
            }
        }
        Header('Location: fiche.php?id=' . $paiement->id);
        exit;
    } else {
        $mesg = '<div class="error">' . $paiement->error . '</div>';
        $db->rollback();
    }
}
/*
 * View
 */
llxHeader();
$socialcontrib = new ChargeSociales($db);
$paiement = new PaymentSocialContribution($db);
$result = $paiement->fetch($_GET['id']);
if ($result <= 0) {
    dol_print_error($db, 'Payment ' . $_GET['id'] . ' not found in database');
    exit;
}
$form = new Form($db);
$h = 0;
$head[$h][0] = DOL_URL_ROOT . '/compta/payment_sc/fiche.php?id=' . $_GET["id"];
$head[$h][1] = $langs->trans("Card");
$hselected = $h;
$h++;
/*$head[$h][0] = DOL_URL_ROOT.'/compta/payment_sc/info.php?id='.$_GET["id"];
$head[$h][1] = $langs->trans("Info");
$h++;
*/
Exemplo n.º 6
0
if (!empty($conf->banque->enabled)) {
    require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
}
$langs->load('bills');
$langs->load('banks');
$langs->load('companies');
// Security check
$id = GETPOST("id");
$action = GETPOST("action");
$confirm = GETPOST('confirm');
if ($user->societe_id) {
    $socid = $user->societe_id;
}
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
$paiement = new PaymentSocialContribution($db);
if ($id > 0) {
    $result = $paiement->fetch($id);
    if (!$result) {
        dol_print_error($db, 'Failed to get payment id ' . $id);
    }
}
/*
 * Actions
 */
// Delete payment
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->charges->supprimer) {
    $db->begin();
    $result = $paiement->delete($user);
    if ($result > 0) {
        $db->commit();